From 71f8f80dfe4277034a704a11ffdb45d38c9c81a6 Mon Sep 17 00:00:00 2001 From: Yerti <36551149+UZ9@users.noreply.github.com> Date: Mon, 20 Oct 2025 19:03:46 -0400 Subject: [PATCH 1/2] File + SDK Route Update --- src/internal/api/emailApi.ts | 143 ++++++++++++++ src/internal/api/fileConfigApi.ts | 95 +++++++++ src/internal/model/aggregateInterval.ts | 19 ++ src/internal/model/fileBucketResponse.ts | 65 ------- src/internal/model/models.ts | 12 ++ src/internal/model/projectResponses.ts | 26 +-- .../model/sendEmailStatisticsResponse.ts | 182 ++++++++++++++++++ .../model/sendEmailStatisticsResponses.ts | 39 ++++ .../model/setupFileServiceResponse.ts | 38 ++++ src/lib/project.ts | 2 +- 10 files changed, 537 insertions(+), 84 deletions(-) create mode 100644 src/internal/model/aggregateInterval.ts delete mode 100644 src/internal/model/fileBucketResponse.ts create mode 100644 src/internal/model/sendEmailStatisticsResponse.ts create mode 100644 src/internal/model/sendEmailStatisticsResponses.ts create mode 100644 src/internal/model/setupFileServiceResponse.ts diff --git a/src/internal/api/emailApi.ts b/src/internal/api/emailApi.ts index 8ca9c83..89145d5 100644 --- a/src/internal/api/emailApi.ts +++ b/src/internal/api/emailApi.ts @@ -14,6 +14,7 @@ import localVarRequest from 'request'; import http from 'http'; /* tslint:disable:no-unused-locals */ +import { AggregateInterval } from '../model/aggregateInterval'; import { EmailConfigResponse } from '../model/emailConfigResponse'; import { RegisterDomainModel } from '../model/registerDomainModel'; import { RegisterDomainResponse } from '../model/registerDomainResponse'; @@ -21,6 +22,7 @@ import { RegisterEmailModel } from '../model/registerEmailModel'; import { RegisterEmailResponse } from '../model/registerEmailResponse'; import { SendEmailModel } from '../model/sendEmailModel'; import { SendEmailResponse } from '../model/sendEmailResponse'; +import { SendEmailStatisticsResponses } from '../model/sendEmailStatisticsResponses'; import { SetupEmailResponse } from '../model/setupEmailResponse'; import { SetupEmailServiceModel } from '../model/setupEmailServiceModel'; import { VerifyDomainModel } from '../model/verifyDomainModel'; @@ -210,6 +212,147 @@ export class EmailApi { }); }); } + /** + * + * @summary Gets overall email analytics + * @param startDate The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD + * @param limit The number of results to return + * @param offset The point in the list to begin retrieving results + * @param aggregatedBy How to group the statistics. Must be either \'day\', \'week\', or \'month\' + * @param endDate The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD + */ + public async emailControllerGetStatistics( + startDate: string, + limit?: number, + offset?: number, + aggregatedBy?: AggregateInterval, + endDate?: string, + options: { headers: { [name: string]: string } } = { headers: {} } + ): Promise<{ + response: http.IncomingMessage; + body: SendEmailStatisticsResponses; + }> { + const localVarPath = this.basePath + '/email/analytics'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign( + {}, + this._defaultHeaders + ); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + // verify required parameter 'startDate' is not null or undefined + if (startDate === null || startDate === undefined) { + throw new Error( + 'Required parameter startDate was null or undefined when calling emailControllerGetStatistics.' + ); + } + + if (startDate !== undefined) { + localVarQueryParameters['startDate'] = ObjectSerializer.serialize( + startDate, + 'string' + ); + } + + if (limit !== undefined) { + localVarQueryParameters['limit'] = ObjectSerializer.serialize( + limit, + 'number' + ); + } + + if (offset !== undefined) { + localVarQueryParameters['offset'] = ObjectSerializer.serialize( + offset, + 'number' + ); + } + + if (aggregatedBy !== undefined) { + localVarQueryParameters['aggregatedBy'] = ObjectSerializer.serialize( + aggregatedBy, + 'AggregateInterval' + ); + } + + if (endDate !== undefined) { + localVarQueryParameters['endDate'] = ObjectSerializer.serialize( + endDate, + 'string' + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.API_Key.accessToken) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.API_Key.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then(() => + this.authentications.default.applyToRequest(localVarRequestOptions) + ); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => + interceptor(localVarRequestOptions) + ); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ + response: http.IncomingMessage; + body: SendEmailStatisticsResponses; + }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if ( + response.statusCode && + response.statusCode >= 200 && + response.statusCode <= 299 + ) { + body = ObjectSerializer.deserialize( + body, + 'SendEmailStatisticsResponses' + ); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } /** * * @summary Registers a sender domain with SendGrid. diff --git a/src/internal/api/fileConfigApi.ts b/src/internal/api/fileConfigApi.ts index 368f77b..6c98565 100644 --- a/src/internal/api/fileConfigApi.ts +++ b/src/internal/api/fileConfigApi.ts @@ -15,6 +15,7 @@ import http from 'http'; /* tslint:disable:no-unused-locals */ import { FileConfigResponse } from '../model/fileConfigResponse'; +import { SetupFileServiceResponse } from '../model/setupFileServiceResponse'; import { ObjectSerializer, @@ -154,6 +155,11 @@ export class FileConfigApi { }; let authenticationPromise = Promise.resolve(); + if (this.authentications.API_Key.accessToken) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.API_Key.applyToRequest(localVarRequestOptions) + ); + } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions) ); @@ -196,4 +202,93 @@ export class FileConfigApi { }); }); } + /** + * + * @summary Sets up file services for the Project/Environment + */ + public async fileConfigControllerSetup( + options: { headers: { [name: string]: string } } = { headers: {} } + ): Promise<{ + response: http.IncomingMessage; + body: SetupFileServiceResponse; + }> { + const localVarPath = this.basePath + '/file/config/setup'; + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign( + {}, + this._defaultHeaders + ); + const produces = ['application/json']; + // give precedence to 'application/json' + if (produces.indexOf('application/json') >= 0) { + localVarHeaderParams.Accept = 'application/json'; + } else { + localVarHeaderParams.Accept = produces.join(','); + } + let localVarFormParams: any = {}; + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + if (this.authentications.API_Key.accessToken) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.API_Key.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then(() => + this.authentications.default.applyToRequest(localVarRequestOptions) + ); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => + interceptor(localVarRequestOptions) + ); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ + response: http.IncomingMessage; + body: SetupFileServiceResponse; + }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if ( + response.statusCode && + response.statusCode >= 200 && + response.statusCode <= 299 + ) { + body = ObjectSerializer.deserialize( + body, + 'SetupFileServiceResponse' + ); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } } diff --git a/src/internal/model/aggregateInterval.ts b/src/internal/model/aggregateInterval.ts new file mode 100644 index 0000000..611b723 --- /dev/null +++ b/src/internal/model/aggregateInterval.ts @@ -0,0 +1,19 @@ +/** + * Juno + * Juno Public API Docs + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export enum AggregateInterval { + Day = 'day', + Week = 'week', + Month = 'month', +} diff --git a/src/internal/model/fileBucketResponse.ts b/src/internal/model/fileBucketResponse.ts deleted file mode 100644 index d21a847..0000000 --- a/src/internal/model/fileBucketResponse.ts +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Juno - * Juno Public API Docs - * - * The version of the OpenAPI document: 1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { RequestFile } from './models'; - -export class FileBucketResponse { - /** - * The unique name of the registered bucket - */ - 'name': string; - /** - * Configuration ID associated with the registered bucket - */ - 'configId': number; - /** - * The name of the file provider associated with the bucket - */ - 'fileProviderName': string; - /** - * The list of file identifiers associated with the bucket - */ - 'fileServiceFile': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{ - name: string; - baseName: string; - type: string; - }> = [ - { - name: 'name', - baseName: 'name', - type: 'string', - }, - { - name: 'configId', - baseName: 'configId', - type: 'number', - }, - { - name: 'fileProviderName', - baseName: 'fileProviderName', - type: 'string', - }, - { - name: 'fileServiceFile', - baseName: 'FileServiceFile', - type: 'Array', - }, - ]; - - static getAttributeTypeMap() { - return FileBucketResponse.attributeTypeMap; - } -} diff --git a/src/internal/model/models.ts b/src/internal/model/models.ts index 1ac9ddf..c1fb0fc 100644 --- a/src/internal/model/models.ts +++ b/src/internal/model/models.ts @@ -1,6 +1,7 @@ import localVarRequest from 'request'; export * from './accessKey'; +export * from './aggregateInterval'; export * from './createProjectModel'; export * from './createUserModel'; export * from './downloadFileModel'; @@ -29,11 +30,14 @@ export * from './registerFileBucketModel'; export * from './registerFileProviderModel'; export * from './sendEmailModel'; export * from './sendEmailResponse'; +export * from './sendEmailStatisticsResponse'; +export * from './sendEmailStatisticsResponses'; export * from './sendGridDNSRecord'; export * from './sendGridDNSResponse'; export * from './setUserTypeModel'; export * from './setupEmailResponse'; export * from './setupEmailServiceModel'; +export * from './setupFileServiceResponse'; export * from './unlinkProjectModel'; export * from './uploadFileModel'; export * from './uploadFileResponse'; @@ -54,6 +58,7 @@ export interface RequestDetailedFile { export type RequestFile = string | Buffer | fs.ReadStream | RequestDetailedFile; import { AccessKey } from './accessKey'; +import { AggregateInterval } from './aggregateInterval'; import { CreateProjectModel } from './createProjectModel'; import { CreateUserModel } from './createUserModel'; import { DownloadFileModel } from './downloadFileModel'; @@ -82,11 +87,14 @@ import { RegisterFileBucketModel } from './registerFileBucketModel'; import { RegisterFileProviderModel } from './registerFileProviderModel'; import { SendEmailModel } from './sendEmailModel'; import { SendEmailResponse } from './sendEmailResponse'; +import { SendEmailStatisticsResponse } from './sendEmailStatisticsResponse'; +import { SendEmailStatisticsResponses } from './sendEmailStatisticsResponses'; import { SendGridDNSRecord } from './sendGridDNSRecord'; import { SendGridDNSResponse } from './sendGridDNSResponse'; import { SetUserTypeModel } from './setUserTypeModel'; import { SetupEmailResponse } from './setupEmailResponse'; import { SetupEmailServiceModel } from './setupEmailServiceModel'; +import { SetupFileServiceResponse } from './setupFileServiceResponse'; import { UnlinkProjectModel } from './unlinkProjectModel'; import { UploadFileModel } from './uploadFileModel'; import { UploadFileResponse } from './uploadFileResponse'; @@ -107,6 +115,7 @@ let primitives = [ ]; let enumsMap: { [index: string]: any } = { + AggregateInterval: AggregateInterval, 'RegisterFileProviderModel.TypeEnum': RegisterFileProviderModel.TypeEnum, 'SetUserTypeModel.TypeEnum': SetUserTypeModel.TypeEnum, 'UserResponse.TypeEnum': UserResponse.TypeEnum, @@ -142,11 +151,14 @@ let typeMap: { [index: string]: any } = { RegisterFileProviderModel: RegisterFileProviderModel, SendEmailModel: SendEmailModel, SendEmailResponse: SendEmailResponse, + SendEmailStatisticsResponse: SendEmailStatisticsResponse, + SendEmailStatisticsResponses: SendEmailStatisticsResponses, SendGridDNSRecord: SendGridDNSRecord, SendGridDNSResponse: SendGridDNSResponse, SetUserTypeModel: SetUserTypeModel, SetupEmailResponse: SetupEmailResponse, SetupEmailServiceModel: SetupEmailServiceModel, + SetupFileServiceResponse: SetupFileServiceResponse, UnlinkProjectModel: UnlinkProjectModel, UploadFileModel: UploadFileModel, UploadFileResponse: UploadFileResponse, diff --git a/src/internal/model/projectResponses.ts b/src/internal/model/projectResponses.ts index 30ebf7c..2ec7c4b 100644 --- a/src/internal/model/projectResponses.ts +++ b/src/internal/model/projectResponses.ts @@ -9,31 +9,21 @@ * https://openapi-generator.tech * Do not edit the class manually. */ - -import { RequestFile } from './models'; import { ProjectResponse } from './projectResponse'; - -export class ProjectResponses { +export declare class ProjectResponses { /** * List of projects */ 'projects': Array; - - static discriminator: string | undefined = undefined; - + static discriminator: string | undefined; static attributeTypeMap: Array<{ name: string; baseName: string; type: string; - }> = [ - { - name: 'projects', - baseName: 'projects', - type: 'Array', - }, - ]; - - static getAttributeTypeMap() { - return ProjectResponses.attributeTypeMap; - } + }>; + static getAttributeTypeMap(): { + name: string; + baseName: string; + type: string; + }[]; } diff --git a/src/internal/model/sendEmailStatisticsResponse.ts b/src/internal/model/sendEmailStatisticsResponse.ts new file mode 100644 index 0000000..7e77298 --- /dev/null +++ b/src/internal/model/sendEmailStatisticsResponse.ts @@ -0,0 +1,182 @@ +/** + * Juno + * Juno Public API Docs + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class SendEmailStatisticsResponse { + /** + * Date + */ + 'date': string; + /** + * The number of links that were clicked in your emails. + */ + 'clicks': number; + /** + * The number of unique recipients who clicked links in your emails. + */ + 'uniqueClicks': number; + /** + * The total number of times your emails were opened by recipients. + */ + 'opens': number; + /** + * The number of unique recipients who opened your emails. + */ + 'uniqueOpens': number; + /** + * The number of emails that were not allowed to be delivered by ISPs. + */ + 'blocks': number; + /** + * The number of emails that were dropped because of a bounce. + */ + 'bounceDrops': number; + /** + * The number of emails that bounced instead of being delivered. + */ + 'bounces': number; + /** + * The number of emails that temporarily could not be delivered. + */ + 'deferred': number; + /** + * The number of emails confirmed to have been delivered. + */ + 'delivered': number; + /** + * The number of recipients with malformed or invalid email addresses. + */ + 'invalidEmails': number; + /** + * Requests from your website, application, or mail client via SMTP Relay or API. + */ + 'processed': number; + /** + * The number of emails that were requested to be delivered. + */ + 'requests': number; + /** + * The number of emails dropped due to a recipient marking your email as spam. + */ + 'spamReportDrops': number; + /** + * The number of recipients who marked your email as spam. + */ + 'spamReports': number; + /** + * The number of emails dropped due to a recipient unsubscribing. + */ + 'unsubscribeDrops': number; + /** + * The number of recipients who unsubscribed from your emails. + */ + 'unsubscribes': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + }> = [ + { + name: 'date', + baseName: 'date', + type: 'string', + }, + { + name: 'clicks', + baseName: 'clicks', + type: 'number', + }, + { + name: 'uniqueClicks', + baseName: 'unique_clicks', + type: 'number', + }, + { + name: 'opens', + baseName: 'opens', + type: 'number', + }, + { + name: 'uniqueOpens', + baseName: 'unique_opens', + type: 'number', + }, + { + name: 'blocks', + baseName: 'blocks', + type: 'number', + }, + { + name: 'bounceDrops', + baseName: 'bounce_drops', + type: 'number', + }, + { + name: 'bounces', + baseName: 'bounces', + type: 'number', + }, + { + name: 'deferred', + baseName: 'deferred', + type: 'number', + }, + { + name: 'delivered', + baseName: 'delivered', + type: 'number', + }, + { + name: 'invalidEmails', + baseName: 'invalid_emails', + type: 'number', + }, + { + name: 'processed', + baseName: 'processed', + type: 'number', + }, + { + name: 'requests', + baseName: 'requests', + type: 'number', + }, + { + name: 'spamReportDrops', + baseName: 'spam_report_drops', + type: 'number', + }, + { + name: 'spamReports', + baseName: 'spam_reports', + type: 'number', + }, + { + name: 'unsubscribeDrops', + baseName: 'unsubscribe_drops', + type: 'number', + }, + { + name: 'unsubscribes', + baseName: 'unsubscribes', + type: 'number', + }, + ]; + + static getAttributeTypeMap() { + return SendEmailStatisticsResponse.attributeTypeMap; + } +} diff --git a/src/internal/model/sendEmailStatisticsResponses.ts b/src/internal/model/sendEmailStatisticsResponses.ts new file mode 100644 index 0000000..381263f --- /dev/null +++ b/src/internal/model/sendEmailStatisticsResponses.ts @@ -0,0 +1,39 @@ +/** + * Juno + * Juno Public API Docs + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; +import { SendEmailStatisticsResponse } from './sendEmailStatisticsResponse'; + +export class SendEmailStatisticsResponses { + /** + * List of email analytics. + */ + 'responses': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + }> = [ + { + name: 'responses', + baseName: 'responses', + type: 'Array', + }, + ]; + + static getAttributeTypeMap() { + return SendEmailStatisticsResponses.attributeTypeMap; + } +} diff --git a/src/internal/model/setupFileServiceResponse.ts b/src/internal/model/setupFileServiceResponse.ts new file mode 100644 index 0000000..f669211 --- /dev/null +++ b/src/internal/model/setupFileServiceResponse.ts @@ -0,0 +1,38 @@ +/** + * Juno + * Juno Public API Docs + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from './models'; + +export class SetupFileServiceResponse { + /** + * Whether file services were successfully setup + */ + 'success': boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + }> = [ + { + name: 'success', + baseName: 'success', + type: 'boolean', + }, + ]; + + static getAttributeTypeMap() { + return SetupFileServiceResponse.attributeTypeMap; + } +} diff --git a/src/lib/project.ts b/src/lib/project.ts index a56e217..c82f3e6 100644 --- a/src/lib/project.ts +++ b/src/lib/project.ts @@ -6,8 +6,8 @@ import { ProjectResponse, UserResponses, } from '../internal/api'; -import { ProjectResponses } from '../internal/model/projectResponses'; import { UserCredentials } from './auth'; +import { ProjectResponses } from '../internal/model/projectResponses'; import { ProjectIdentifier, UserIdentifier } from './identifiers'; import { validateProjectIdentifier, From dcd897bc08f44425bf30fbab33d5b62aa0c081f6 Mon Sep 17 00:00:00 2001 From: Yerti <36551149+UZ9@users.noreply.github.com> Date: Mon, 20 Oct 2025 19:17:49 -0400 Subject: [PATCH 2/2] auto: update sdk with auth routes --- src/internal/api/fileBucketApi.ts | 5 +++++ src/internal/api/fileDownloadApi.ts | 5 +++++ src/internal/api/fileProviderApi.ts | 5 +++++ src/internal/api/fileUploadApi.ts | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/src/internal/api/fileBucketApi.ts b/src/internal/api/fileBucketApi.ts index be878d8..09bcb79 100644 --- a/src/internal/api/fileBucketApi.ts +++ b/src/internal/api/fileBucketApi.ts @@ -157,6 +157,11 @@ export class FileBucketApi { }; let authenticationPromise = Promise.resolve(); + if (this.authentications.API_Key.accessToken) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.API_Key.applyToRequest(localVarRequestOptions) + ); + } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions) ); diff --git a/src/internal/api/fileDownloadApi.ts b/src/internal/api/fileDownloadApi.ts index fb025e2..936a04c 100644 --- a/src/internal/api/fileDownloadApi.ts +++ b/src/internal/api/fileDownloadApi.ts @@ -151,6 +151,11 @@ export class FileDownloadApi { }; let authenticationPromise = Promise.resolve(); + if (this.authentications.API_Key.accessToken) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.API_Key.applyToRequest(localVarRequestOptions) + ); + } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions) ); diff --git a/src/internal/api/fileProviderApi.ts b/src/internal/api/fileProviderApi.ts index 4cb12a2..3db402e 100644 --- a/src/internal/api/fileProviderApi.ts +++ b/src/internal/api/fileProviderApi.ts @@ -157,6 +157,11 @@ export class FileProviderApi { }; let authenticationPromise = Promise.resolve(); + if (this.authentications.API_Key.accessToken) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.API_Key.applyToRequest(localVarRequestOptions) + ); + } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions) ); diff --git a/src/internal/api/fileUploadApi.ts b/src/internal/api/fileUploadApi.ts index 7fd8e85..ad83337 100644 --- a/src/internal/api/fileUploadApi.ts +++ b/src/internal/api/fileUploadApi.ts @@ -151,6 +151,11 @@ export class FileUploadApi { }; let authenticationPromise = Promise.resolve(); + if (this.authentications.API_Key.accessToken) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.API_Key.applyToRequest(localVarRequestOptions) + ); + } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions) );