diff --git a/src/app.module.ts b/src/app.module.ts index 664f3a5..47e38c2 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -32,10 +32,10 @@ import { CatalogService } from './modules/catalog/catalog.service'; import { OauthController } from './modules/oauth/oauth.controller'; import { getOauthSecrets } from './utils/OauthSecrets'; import { HubspotStrategy } from './modules/oauth/passport-strategies/hubspot-strategy'; -import { GoogleStrategy } from './modules/oauth/passport-strategies/google-strategy'; import { FacebookStrategy } from './modules/oauth/passport-strategies/facebook-strategy'; import { AuthenticationGuard } from './authentication/authentication.guard'; import { APP_GUARD } from '@nestjs/core'; +import { GoogleStrategy } from './modules/oauth/passport-strategies/google-strategy'; const ducClient = new DucClient(); const inputClient = new InputsClientConfiguration(); @@ -74,8 +74,8 @@ const transformationClient = new TransformationsClientConfiguration(); }, //OAUTH Passport Strategies HubspotStrategy, - GoogleStrategy, FacebookStrategy, + GoogleStrategy, ], imports: [ ConfigModule.forRoot({ diff --git a/src/modules/oauth/oauth.controller.ts b/src/modules/oauth/oauth.controller.ts index bb8a8e7..38144ca 100644 --- a/src/modules/oauth/oauth.controller.ts +++ b/src/modules/oauth/oauth.controller.ts @@ -1,11 +1,4 @@ -import { - BadRequestException, - Controller, - Get, - Redirect, - Req, - UseGuards, -} from '@nestjs/common'; +import { Controller, Get, Redirect, Req, UseGuards } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; import { AuthGuard } from '@nestjs/passport'; import { InputsClientService } from 'src/clients/inputs/client.service'; @@ -54,7 +47,32 @@ export class OauthController { @UseGuards(AuthGuard('google')) @Redirect() async oauthGoogleCallback(@Req() req) { - return await this.callback(req, 'google'); + return await this.callback(req, 'googleads'); + } + @Get('googleads') + @UseGuards(AuthGuard('google')) + async oauthGoogleAds() { + return true; + } + + @Get('googleads/callback') + @UseGuards(AuthGuard('google')) + @Redirect() + async oauthGoogleAdsCallback(@Req() req) { + return await this.callback(req, 'googleads'); + } + + @Get('google-sheets') + @UseGuards(AuthGuard('google')) + async oauthGoogleSheets() { + return true; + } + + @Get('google-sheets/callback') + @UseGuards(AuthGuard('google')) + @Redirect() + async oauthGoogleSheetsCallback(@Req() req) { + return await this.callback(req, 'google-sheets'); } @Get('facebook') @@ -70,15 +88,22 @@ export class OauthController { return await this.callback(req, 'facebook'); } - async callback(@Req() req, plugin) { - const { authInfo } = req; + async callback(@Req() req: Request, plugin) { + const { error, state: customer_id } = req.query; - const request: Request = req; + if (error) + return { + url: `${this.frontendRedirectUri}?error=${error}`, + }; + const request: any = req; + const { authInfo } = request; - if (!authInfo) throw new BadRequestException('Oauth tokens not found'); + if (!authInfo) + return { + url: `${this.frontendRedirectUri}?error=invalid_credentials`, + }; const { accessToken: access_token, refreshToken: refresh_token } = authInfo; - const { state: customer_id } = request.query; const response = await this.inputService.create({ info: { customer_id, customer: 'customer', user_id: 'empty' }, diff --git a/src/modules/oauth/passport-strategies/google-strategy.ts b/src/modules/oauth/passport-strategies/google-strategy.ts index 648103b..7d68a09 100644 --- a/src/modules/oauth/passport-strategies/google-strategy.ts +++ b/src/modules/oauth/passport-strategies/google-strategy.ts @@ -1,6 +1,6 @@ import { Profile, Strategy, StrategyOptions } from 'passport-google-oauth20'; import { PassportStrategy } from '@nestjs/passport'; -import { Inject, Injectable, Req } from '@nestjs/common'; +import { Inject, Injectable } from '@nestjs/common'; import { OauthSecrets } from 'src/utils/OauthSecrets'; @Injectable() @@ -12,12 +12,7 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') { const options: StrategyOptions = { clientID: oauthSecrets.google.client_id, clientSecret: oauthSecrets.google.client_secret, - scope: [ - 'https://www.googleapis.com/auth/drive.metadata.readonly', - 'https://www.googleapis.com/auth/spreadsheets.readonly', - 'https://www.googleapis.com/auth/userinfo.email', - ], - callbackURL: oauthSecrets.google.redirect_uri, + callbackURL: '/oauth/googleads/callback', }; const verify = ( accessToken: string, @@ -32,16 +27,21 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') { super(options, verify); } - authenticate(@Req() req, options) { + authenticate(req, options) { + const path: string = req.route.path; const { customer_id } = req.query; + const scope: string[] = ['https://www.googleapis.com/auth/userinfo.email']; + if (path.includes('googleads')) + scope.push('https://www.googleapis.com/auth/adwords'); + if (path.includes('google-sheets')) + scope.push( + 'https://www.googleapis.com/auth/drive.metadata.readonly', + 'https://www.googleapis.com/auth/spreadsheets.readonly', + ); + options.scope = scope; options.state = customer_id; options.accessType = 'offline'; options.prompt = 'consent'; super.authenticate(req, options); } - - async validate(...args) { - console.log('validate'); - console.log(args); - } } diff --git a/swagger.json b/swagger.json index 708be7e..3fbbf98 100644 --- a/swagger.json +++ b/swagger.json @@ -1 +1 @@ -{"openapi":"3.0.0","paths":{"/inputs/available-entities/{plugin}":{"get":{"operationId":"InputsController_getAvailableEntities","parameters":[{"name":"plugin","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAvailableEntitiesRes"}}}}},"tags":["inputs"]}},"/inputs/test-connection":{"post":{"operationId":"InputsController_testConnection","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestConnectionReq"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestConnectionRes"}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["inputs"]}},"/inputs/test-connection/get-columns":{"post":{"operationId":"InputsController_getColumns","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestConnectionGetColumnsReq"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestConnectionGetColumnsRes"}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["inputs"]}},"/inputs":{"post":{"operationId":"InputsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInputReq"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Input"}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["inputs"]},"get":{"operationId":"InputsController_findAll","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["inputs"]}},"/inputs/{id}":{"post":{"operationId":"InputsController_reCreate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInputReq"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Input"}}}},"201":{"description":""}},"tags":["inputs"]},"get":{"operationId":"InputsController_findOne","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["inputs"]},"patch":{"operationId":"InputsController_update","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["inputs"]},"delete":{"operationId":"InputsController_delete","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["inputs"]}},"/transformations":{"post":{"operationId":"TransformationsController_create","parameters":[],"responses":{"201":{"description":""}},"tags":["Transformations"]},"get":{"operationId":"TransformationsController_findAll","parameters":[],"responses":{"200":{"description":""}},"tags":["Transformations"]}},"/transformations/{id}":{"get":{"operationId":"TransformationsController_findOne","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Transformations"]},"put":{"operationId":"TransformationsController_update","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Transformations"]},"delete":{"operationId":"TransformationsController_delete","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Transformations"]}},"/outputs":{"post":{"operationId":"OutputsController_create","parameters":[],"responses":{"201":{"description":""}},"tags":["Outputs"]},"get":{"operationId":"OutputsController_findAll","parameters":[],"responses":{"200":{"description":""}},"tags":["Outputs"]}},"/outputs/{id}":{"get":{"operationId":"OutputsController_findOne","parameters":[],"responses":{"200":{"description":""}},"tags":["Outputs"]},"put":{"operationId":"OutputsController_update","parameters":[],"responses":{"200":{"description":""}},"tags":["Outputs"]},"delete":{"operationId":"OutputsController_delete","parameters":[],"responses":{"200":{"description":""}},"tags":["Outputs"]}},"/pipelines/start/{id}":{"post":{"operationId":"PipelinesController_activate","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Pipelines"]}},"/pipelines/{id}/status":{"get":{"operationId":"PipelinesController_getPipelineStatus","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Pipelines"]}},"/pipelines/{id}/{details}":{"get":{"operationId":"PipelinesController_getPipelineLogs","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Pipelines"]}},"/pipelines":{"post":{"operationId":"PipelinesController_create","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Pipelines"]},"get":{"operationId":"PipelinesController_findAll","parameters":[],"responses":{"200":{"description":""}},"tags":["Pipelines"]}},"/pipelines/{id}":{"get":{"operationId":"PipelinesController_findOne","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Pipelines"]},"put":{"operationId":"PipelinesController_update","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Pipelines"]},"delete":{"operationId":"PipelinesController_delete","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Pipelines"]}},"/auth/sign-in":{"post":{"operationId":"AuthController_signIn","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/refresh-access-token":{"post":{"operationId":"AuthController_refreshAccessToken","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/change-password":{"post":{"operationId":"AuthController_changePassword","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/reset-password":{"post":{"operationId":"AuthController_resetPassword","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/verify-reset-password-code":{"post":{"operationId":"AuthController_verifyResetPasswordCode","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/confirm-reset-password":{"post":{"operationId":"AuthController_confirmResetPassword","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/enable-totp":{"post":{"operationId":"AuthController_enableTotpMFA","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/disable-totp":{"post":{"operationId":"AuthController_disableTotpMFA","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/dismiss-totp":{"post":{"operationId":"AuthController_dismissTotpMFA","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/verify-totp":{"post":{"operationId":"AuthController_verifyTotp","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/health":{"get":{"operationId":"HealthController_check","parameters":[],"responses":{"200":{"description":""}},"tags":["Health"]}},"/catalog/all":{"get":{"operationId":"CatalogController_catalogAll","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/data_apps":{"get":{"operationId":"CatalogController_dataAppsAll","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/data_apps/{id}":{"delete":{"operationId":"CatalogController_dataAppsOne","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/dashboard-metabase":{"get":{"operationId":"CatalogController_getAllDashboardMetabase","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/dashboard-metabase/{id}":{"get":{"operationId":"CatalogController_getOneDashboardMetabase","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/table-metadata":{"get":{"operationId":"CatalogController_getAllTableMetadata","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/table-metadata/{id}":{"delete":{"operationId":"CatalogController_deleteOneTableMetadata","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/column-metadata":{"get":{"operationId":"CatalogController_getOneColumnMetadata","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/column-metadata/{id}":{"delete":{"operationId":"CatalogController_deleteOneColumnMetadata","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/data-preview":{"get":{"operationId":"CatalogController_getOneDataPreview","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/data-status":{"get":{"operationId":"CatalogController_createDataStatus","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/data-description":{"get":{"operationId":"CatalogController_getDataDescription","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]},"post":{"operationId":"CatalogController_createDataDescription","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/data-docs":{"get":{"operationId":"CatalogController_getDataDocs","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]},"post":{"operationId":"CatalogController_createDataDocs","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/data-rating":{"get":{"operationId":"CatalogController_getDataRating","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]},"post":{"operationId":"CatalogController_createDataRating","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/summary-rating/{id}":{"get":{"operationId":"CatalogController_getSummaryRating","parameters":[],"responses":{"200":{"description":""}},"tags":["Catalog"]}},"/catalog/data-comment":{"get":{"operationId":"CatalogController_getDataComment","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]},"post":{"operationId":"CatalogController_createDataComment","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/data-review":{"get":{"operationId":"CatalogController_getDataReview","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/tags":{"post":{"operationId":"CatalogController_createTags","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]},"get":{"operationId":"CatalogController_findAllTags","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/tags/{id}":{"delete":{"operationId":"CatalogController_deleteTags","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/table-tags":{"post":{"operationId":"CatalogController_createTableTags","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]},"get":{"operationId":"CatalogController_getAllTableTags","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/table-tags/{id}":{"delete":{"operationId":"CatalogController_deleteTableTags","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/table-rules":{"get":{"operationId":"CatalogController_getTableRules","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/table-rules/{id}":{"delete":{"operationId":"CatalogController_deleteTableRules","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/oauth/hubspot":{"get":{"operationId":"OauthController_oauthHubspot","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"boolean"}}}}},"tags":["oauth"]}},"/oauth/hubspot/callback":{"get":{"operationId":"OauthController_oauthHubspotCallback","parameters":[],"responses":{"200":{"description":""}},"tags":["oauth"]}},"/oauth/google":{"get":{"operationId":"OauthController_oauthGoogle","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"boolean"}}}}},"tags":["oauth"]}},"/oauth/google/callback":{"get":{"operationId":"OauthController_oauthGoogleCallback","parameters":[],"responses":{"200":{"description":""}},"tags":["oauth"]}},"/oauth/facebook":{"get":{"operationId":"OauthController_oauthFacebook","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"boolean"}}}}},"tags":["oauth"]}},"/oauth/facebook/callback":{"get":{"operationId":"OauthController_oauthFacebookCallback","parameters":[],"responses":{"200":{"description":""}},"tags":["oauth"]}}},"info":{"title":"Maestro Grpc Documentation","description":"Documentation for Maestro gateway","version":"1.0","contact":{}},"tags":[],"servers":[],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"GetAvailableEntitiesRes":{"type":"object","properties":{"entities":{"type":"array","items":{"type":"string"}}},"required":["entities"]},"CredentialsJdbc":{"type":"object","properties":{"jdbc_user":{"type":"string"},"jdbc_password":{"type":"string"},"database":{"type":"string"},"endpoint":{"type":"string"},"port":{"type":"string"},"engine":{"type":"string"},"schema":{"type":"string"}}},"TestConnectionReq":{"type":"object","properties":{"plugin":{"type":"string"},"credentials":{"$ref":"#/components/schemas/CredentialsJdbc"}},"required":["plugin","credentials"]},"TestConnectionRes":{"type":"object","properties":{"connection_state":{"type":"boolean"},"total_entities":{"type":"number"},"database_tables":{"type":"array","items":{"type":"string"}}},"required":["connection_state","total_entities","database_tables"]},"TestConnectionGetColumnsReq":{"type":"object","properties":{"plugin":{"type":"string"},"tables":{"type":"array","items":{"type":"string"}},"credentials":{"$ref":"#/components/schemas/CredentialsJdbc"},"id":{"type":"string"}},"required":["plugin","tables"]},"TestConnectionGetColumnsRes":{"type":"object","properties":{"tables":{"type":"array","items":{"type":"string"}}},"required":["tables"]},"FileFormatParams":{"type":"object","properties":{"file_format":{"type":"string"},"encoding":{"type":"string"}}},"GoogleAnalyticsClientSecrets":{"type":"object","properties":{"type":{"type":"string"},"project_id":{"type":"string"},"private_key_id":{"type":"string"},"private_key":{"type":"string"},"client_email":{"type":"string"},"client_id":{"type":"string"},"auth_uri":{"type":"string"},"token_uri":{"type":"string"},"auth_provider_x509_cert_url":{"type":"string"},"client_x509_cert_url":{"type":"string"}},"required":["type","project_id","private_key_id","private_key","client_email","client_id","auth_uri","token_uri","auth_provider_x509_cert_url","client_x509_cert_url"]},"Credentials":{"type":"object","properties":{"jdbc_user":{"type":"string"},"jdbc_password":{"type":"string"},"database":{"type":"string"},"endpoint":{"type":"string"},"port":{"type":"string"},"engine":{"type":"string"},"schema":{"type":"string"},"connection_type":{"type":"string"},"client_aws_access_key_id":{"type":"string"},"client_aws_secret_access_key":{"type":"string"},"client_bucket":{"type":"string"},"file_to_extract":{"type":"string"},"file_format_params":{"$ref":"#/components/schemas/FileFormatParams"},"view_id":{"type":"string"},"client_secrets":{"$ref":"#/components/schemas/GoogleAnalyticsClientSecrets"},"start_date":{"type":"string"},"end_date":{"type":"string"},"oauth_code":{"type":"string"}},"required":["connection_type"]},"OauthObject":{"type":"object","properties":{"get_tokens_url":{"type":"string"},"get_tokens_url_params":{"type":"string"},"get_tokens_set_response":{"type":"object"},"content_type":{"type":"string"}}},"InputOptions":{"type":"object","properties":{"oauth":{"$ref":"#/components/schemas/OauthObject"},"skip_select_columns":{"type":"boolean"},"skip_select_entities":{"type":"boolean"},"skip_transformation":{"type":"boolean"}}},"CreateInputReq":{"type":"object","properties":{"id":{"type":"string"},"plugin":{"type":"string"},"category":{"type":"string"},"credentials":{"$ref":"#/components/schemas/Credentials"},"name":{"type":"string"},"options":{"$ref":"#/components/schemas/InputOptions"}},"required":["plugin","category","credentials","name"]},"Input":{"type":"object","properties":{"id":{"type":"string"},"category":{"type":"string"},"plugin":{"type":"string"},"name":{"type":"string"},"cron":{"type":"string"},"credentials":{"$ref":"#/components/schemas/Credentials"},"client_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","category","plugin","name","cron","credentials","client_id","created_at","updated_at"]}}}} \ No newline at end of file +{"openapi":"3.0.0","paths":{"/inputs/available-entities/{plugin}":{"get":{"operationId":"InputsController_getAvailableEntities","parameters":[{"name":"plugin","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAvailableEntitiesRes"}}}}},"tags":["inputs"]}},"/inputs/test-connection":{"post":{"operationId":"InputsController_testConnection","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestConnectionReq"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestConnectionRes"}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["inputs"]}},"/inputs/test-connection/get-columns":{"post":{"operationId":"InputsController_getColumns","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestConnectionGetColumnsReq"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestConnectionGetColumnsRes"}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["inputs"]}},"/inputs":{"post":{"operationId":"InputsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInputReq"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Input"}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["inputs"]},"get":{"operationId":"InputsController_findAll","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["inputs"]}},"/inputs/{id}":{"post":{"operationId":"InputsController_reCreate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInputReq"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Input"}}}},"201":{"description":""}},"tags":["inputs"]},"get":{"operationId":"InputsController_findOne","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["inputs"]},"patch":{"operationId":"InputsController_update","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["inputs"]},"delete":{"operationId":"InputsController_delete","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["inputs"]}},"/transformations":{"post":{"operationId":"TransformationsController_create","parameters":[],"responses":{"201":{"description":""}},"tags":["Transformations"]},"get":{"operationId":"TransformationsController_findAll","parameters":[],"responses":{"200":{"description":""}},"tags":["Transformations"]}},"/transformations/{id}":{"get":{"operationId":"TransformationsController_findOne","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Transformations"]},"put":{"operationId":"TransformationsController_update","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Transformations"]},"delete":{"operationId":"TransformationsController_delete","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Transformations"]}},"/outputs":{"post":{"operationId":"OutputsController_create","parameters":[],"responses":{"201":{"description":""}},"tags":["Outputs"]},"get":{"operationId":"OutputsController_findAll","parameters":[],"responses":{"200":{"description":""}},"tags":["Outputs"]}},"/outputs/{id}":{"get":{"operationId":"OutputsController_findOne","parameters":[],"responses":{"200":{"description":""}},"tags":["Outputs"]},"put":{"operationId":"OutputsController_update","parameters":[],"responses":{"200":{"description":""}},"tags":["Outputs"]},"delete":{"operationId":"OutputsController_delete","parameters":[],"responses":{"200":{"description":""}},"tags":["Outputs"]}},"/pipelines/start/{id}":{"post":{"operationId":"PipelinesController_activate","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Pipelines"]}},"/pipelines/{id}/status":{"get":{"operationId":"PipelinesController_getPipelineStatus","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Pipelines"]}},"/pipelines/{id}/{details}":{"get":{"operationId":"PipelinesController_getPipelineLogs","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Pipelines"]}},"/pipelines":{"post":{"operationId":"PipelinesController_create","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Pipelines"]},"get":{"operationId":"PipelinesController_findAll","parameters":[],"responses":{"200":{"description":""}},"tags":["Pipelines"]}},"/pipelines/{id}":{"get":{"operationId":"PipelinesController_findOne","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Pipelines"]},"put":{"operationId":"PipelinesController_update","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Pipelines"]},"delete":{"operationId":"PipelinesController_delete","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Pipelines"]}},"/auth/sign-in":{"post":{"operationId":"AuthController_signIn","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/refresh-access-token":{"post":{"operationId":"AuthController_refreshAccessToken","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/change-password":{"post":{"operationId":"AuthController_changePassword","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/reset-password":{"post":{"operationId":"AuthController_resetPassword","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/verify-reset-password-code":{"post":{"operationId":"AuthController_verifyResetPasswordCode","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/confirm-reset-password":{"post":{"operationId":"AuthController_confirmResetPassword","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/enable-totp":{"post":{"operationId":"AuthController_enableTotpMFA","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/disable-totp":{"post":{"operationId":"AuthController_disableTotpMFA","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/dismiss-totp":{"post":{"operationId":"AuthController_dismissTotpMFA","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/auth/verify-totp":{"post":{"operationId":"AuthController_verifyTotp","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Auth"]}},"/health":{"get":{"operationId":"HealthController_check","parameters":[],"responses":{"200":{"description":""}},"tags":["Health"]}},"/catalog/all":{"get":{"operationId":"CatalogController_catalogAll","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/data_apps":{"get":{"operationId":"CatalogController_dataAppsAll","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/data_apps/{id}":{"delete":{"operationId":"CatalogController_dataAppsOne","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/dashboard-metabase":{"get":{"operationId":"CatalogController_getAllDashboardMetabase","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/dashboard-metabase/{id}":{"get":{"operationId":"CatalogController_getOneDashboardMetabase","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/table-metadata":{"get":{"operationId":"CatalogController_getAllTableMetadata","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/table-metadata/{id}":{"delete":{"operationId":"CatalogController_deleteOneTableMetadata","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/column-metadata":{"get":{"operationId":"CatalogController_getOneColumnMetadata","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/column-metadata/{id}":{"delete":{"operationId":"CatalogController_deleteOneColumnMetadata","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/data-preview":{"get":{"operationId":"CatalogController_getOneDataPreview","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/data-status":{"get":{"operationId":"CatalogController_createDataStatus","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/data-description":{"get":{"operationId":"CatalogController_getDataDescription","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]},"post":{"operationId":"CatalogController_createDataDescription","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/data-docs":{"get":{"operationId":"CatalogController_getDataDocs","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]},"post":{"operationId":"CatalogController_createDataDocs","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/data-rating":{"get":{"operationId":"CatalogController_getDataRating","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]},"post":{"operationId":"CatalogController_createDataRating","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/summary-rating/{id}":{"get":{"operationId":"CatalogController_getSummaryRating","parameters":[],"responses":{"200":{"description":""}},"tags":["Catalog"]}},"/catalog/data-comment":{"get":{"operationId":"CatalogController_getDataComment","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]},"post":{"operationId":"CatalogController_createDataComment","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/data-review":{"get":{"operationId":"CatalogController_getDataReview","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/tags":{"post":{"operationId":"CatalogController_createTags","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]},"get":{"operationId":"CatalogController_findAllTags","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/tags/{id}":{"delete":{"operationId":"CatalogController_deleteTags","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/table-tags":{"post":{"operationId":"CatalogController_createTableTags","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]},"get":{"operationId":"CatalogController_getAllTableTags","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/table-tags/{id}":{"delete":{"operationId":"CatalogController_deleteTableTags","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/table-rules":{"get":{"operationId":"CatalogController_getTableRules","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/catalog/table-rules/{id}":{"delete":{"operationId":"CatalogController_deleteTableRules","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Catalog"]}},"/oauth/hubspot":{"get":{"operationId":"OauthController_oauthHubspot","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"boolean"}}}}},"tags":["oauth"]}},"/oauth/hubspot/callback":{"get":{"operationId":"OauthController_oauthHubspotCallback","parameters":[],"responses":{"200":{"description":""}},"tags":["oauth"]}},"/oauth/google":{"get":{"operationId":"OauthController_oauthGoogle","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"boolean"}}}}},"tags":["oauth"]}},"/oauth/google/callback":{"get":{"operationId":"OauthController_oauthGoogleCallback","parameters":[],"responses":{"200":{"description":""}},"tags":["oauth"]}},"/oauth/googleads":{"get":{"operationId":"OauthController_oauthGoogleAds","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"boolean"}}}}},"tags":["oauth"]}},"/oauth/googleads/callback":{"get":{"operationId":"OauthController_oauthGoogleAdsCallback","parameters":[],"responses":{"200":{"description":""}},"tags":["oauth"]}},"/oauth/google-sheets":{"get":{"operationId":"OauthController_oauthGoogleSheets","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"boolean"}}}}},"tags":["oauth"]}},"/oauth/google-sheets/callback":{"get":{"operationId":"OauthController_oauthGoogleSheetsCallback","parameters":[],"responses":{"200":{"description":""}},"tags":["oauth"]}},"/oauth/facebook":{"get":{"operationId":"OauthController_oauthFacebook","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"boolean"}}}}},"tags":["oauth"]}},"/oauth/facebook/callback":{"get":{"operationId":"OauthController_oauthFacebookCallback","parameters":[],"responses":{"200":{"description":""}},"tags":["oauth"]}}},"info":{"title":"Maestro Grpc Documentation","description":"Documentation for Maestro gateway","version":"1.0","contact":{}},"tags":[],"servers":[],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"GetAvailableEntitiesRes":{"type":"object","properties":{"entities":{"type":"array","items":{"type":"string"}}},"required":["entities"]},"CredentialsJdbc":{"type":"object","properties":{"jdbc_user":{"type":"string"},"jdbc_password":{"type":"string"},"database":{"type":"string"},"endpoint":{"type":"string"},"port":{"type":"string"},"engine":{"type":"string"},"schema":{"type":"string"}}},"TestConnectionReq":{"type":"object","properties":{"plugin":{"type":"string"},"credentials":{"$ref":"#/components/schemas/CredentialsJdbc"}},"required":["plugin","credentials"]},"TestConnectionRes":{"type":"object","properties":{"connection_state":{"type":"boolean"},"total_entities":{"type":"number"},"database_tables":{"type":"array","items":{"type":"string"}}},"required":["connection_state","total_entities","database_tables"]},"TestConnectionGetColumnsReq":{"type":"object","properties":{"plugin":{"type":"string"},"tables":{"type":"array","items":{"type":"string"}},"credentials":{"$ref":"#/components/schemas/CredentialsJdbc"},"id":{"type":"string"}},"required":["plugin","tables"]},"TestConnectionGetColumnsRes":{"type":"object","properties":{"tables":{"type":"array","items":{"type":"string"}}},"required":["tables"]},"FileFormatParams":{"type":"object","properties":{"file_format":{"type":"string"},"encoding":{"type":"string"}}},"GoogleAnalyticsClientSecrets":{"type":"object","properties":{"type":{"type":"string"},"project_id":{"type":"string"},"private_key_id":{"type":"string"},"private_key":{"type":"string"},"client_email":{"type":"string"},"client_id":{"type":"string"},"auth_uri":{"type":"string"},"token_uri":{"type":"string"},"auth_provider_x509_cert_url":{"type":"string"},"client_x509_cert_url":{"type":"string"}},"required":["type","project_id","private_key_id","private_key","client_email","client_id","auth_uri","token_uri","auth_provider_x509_cert_url","client_x509_cert_url"]},"Credentials":{"type":"object","properties":{"jdbc_user":{"type":"string"},"jdbc_password":{"type":"string"},"database":{"type":"string"},"endpoint":{"type":"string"},"port":{"type":"string"},"engine":{"type":"string"},"schema":{"type":"string"},"connection_type":{"type":"string"},"client_aws_access_key_id":{"type":"string"},"client_aws_secret_access_key":{"type":"string"},"client_bucket":{"type":"string"},"file_to_extract":{"type":"string"},"file_format_params":{"$ref":"#/components/schemas/FileFormatParams"},"view_id":{"type":"string"},"client_secrets":{"$ref":"#/components/schemas/GoogleAnalyticsClientSecrets"},"start_date":{"type":"string"},"end_date":{"type":"string"},"oauth_code":{"type":"string"}},"required":["connection_type"]},"OauthObject":{"type":"object","properties":{"get_tokens_url":{"type":"string"},"get_tokens_url_params":{"type":"string"},"get_tokens_set_response":{"type":"object"},"content_type":{"type":"string"}}},"InputOptions":{"type":"object","properties":{"oauth":{"$ref":"#/components/schemas/OauthObject"},"skip_select_columns":{"type":"boolean"},"skip_select_entities":{"type":"boolean"},"skip_transformation":{"type":"boolean"}}},"CreateInputReq":{"type":"object","properties":{"id":{"type":"string"},"plugin":{"type":"string"},"category":{"type":"string"},"credentials":{"$ref":"#/components/schemas/Credentials"},"name":{"type":"string"},"options":{"$ref":"#/components/schemas/InputOptions"}},"required":["plugin","category","credentials","name"]},"Input":{"type":"object","properties":{"id":{"type":"string"},"category":{"type":"string"},"plugin":{"type":"string"},"name":{"type":"string"},"cron":{"type":"string"},"credentials":{"$ref":"#/components/schemas/Credentials"},"client_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","category","plugin","name","cron","credentials","client_id","created_at","updated_at"]}}}} \ No newline at end of file