File tree Expand file tree Collapse file tree 37 files changed +353
-108
lines changed
aiAnimationGenerator/client
aiBackgroundChanger/client
aiGeneratedPhotoFromEmailProfileLookup/client
compareAiImageGenerators/client
compareAiImageUpscalers/client
compareAiTranslations/client
compareAiVoiceGenerators/client
copilotForYourEnterprise/client
copilotIntegrations/client
createAPerfectSeoOptimizedTitleParagraph/client
editAnImageWithAiPrompt/client
generatePeopleAlsoAskSeoContent/client
generateProductPhotoBackgrounds/client
largeLanguageModelsGpt3/client
lipsyncVideoWithAnyText/client
peopleAlsoAskAnswersFromADoc/client
profileLookupGpt3ForAiPersonalizedEmails/client
renderImageSearchResultsWithAi/client
searchYourDocsWithGpt/client
speechRecognitionTranslation/client
summarizeYourDocsWithGpt/client
syntheticDataMakerForVideosPdFs/client
textGuidedAudioGenerator/client Expand file tree Collapse file tree 37 files changed +353
-108
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ Instantiate and use the client with the following:
18
18
``` typescript
19
19
import { GooeyClient } from " gooey" ;
20
20
21
- const client = new GooeyClient ({ token : " YOUR_TOKEN " });
21
+ const client = new GooeyClient ({ apiKey : " YOUR_API_KEY " });
22
22
await client .copilotIntegrations .videoBotsStreamCreate ({
23
23
integrationId: " integration_id" ,
24
24
});
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ import { Misc } from "./api/resources/misc/client/Client";
43
43
export declare namespace GooeyClient {
44
44
interface Options {
45
45
environment ?: core . Supplier < environments . GooeyEnvironment | string > ;
46
- token : core . Supplier < core . BearerToken > ;
46
+ apiKey ? : core . Supplier < core . BearerToken | undefined > ;
47
47
fetcher ?: core . FetchFunction ;
48
48
}
49
49
@@ -58,7 +58,7 @@ export declare namespace GooeyClient {
58
58
}
59
59
60
60
export class GooeyClient {
61
- constructor ( protected readonly _options : GooeyClient . Options ) { }
61
+ constructor ( protected readonly _options : GooeyClient . Options = { } ) { }
62
62
63
63
protected _copilotIntegrations : CopilotIntegrations | undefined ;
64
64
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import * as errors from "../../../../errors/index";
12
12
export declare namespace AiAnimationGenerator {
13
13
interface Options {
14
14
environment ?: core . Supplier < environments . GooeyEnvironment | string > ;
15
- token : core . Supplier < core . BearerToken > ;
15
+ apiKey ? : core . Supplier < core . BearerToken | undefined > ;
16
16
fetcher ?: core . FetchFunction ;
17
17
}
18
18
@@ -27,7 +27,7 @@ export declare namespace AiAnimationGenerator {
27
27
}
28
28
29
29
export class AiAnimationGenerator {
30
- constructor ( protected readonly _options : AiAnimationGenerator . Options ) { }
30
+ constructor ( protected readonly _options : AiAnimationGenerator . Options = { } ) { }
31
31
32
32
/**
33
33
* @param {Gooey.DeforumSdPageRequest } request
@@ -335,6 +335,13 @@ export class AiAnimationGenerator {
335
335
}
336
336
337
337
protected async _getAuthorizationHeader ( ) : Promise < string > {
338
- return `Bearer ${ await core . Supplier . get ( this . _options . token ) } ` ;
338
+ const bearer = ( await core . Supplier . get ( this . _options . apiKey ) ) ?? process ?. env [ "GOOEY_API_KEY" ] ;
339
+ if ( bearer == null ) {
340
+ throw new errors . GooeyError ( {
341
+ message : "Please specify GOOEY_API_KEY when instantiating the client." ,
342
+ } ) ;
343
+ }
344
+
345
+ return `Bearer ${ bearer } ` ;
339
346
}
340
347
}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import * as errors from "../../../../errors/index";
12
12
export declare namespace AiArtQrCode {
13
13
interface Options {
14
14
environment ?: core . Supplier < environments . GooeyEnvironment | string > ;
15
- token : core . Supplier < core . BearerToken > ;
15
+ apiKey ? : core . Supplier < core . BearerToken | undefined > ;
16
16
fetcher ?: core . FetchFunction ;
17
17
}
18
18
@@ -27,7 +27,7 @@ export declare namespace AiArtQrCode {
27
27
}
28
28
29
29
export class AiArtQrCode {
30
- constructor ( protected readonly _options : AiArtQrCode . Options ) { }
30
+ constructor ( protected readonly _options : AiArtQrCode . Options = { } ) { }
31
31
32
32
/**
33
33
* @param {Gooey.QrCodeGeneratorPageRequest } request
@@ -329,6 +329,13 @@ export class AiArtQrCode {
329
329
}
330
330
331
331
protected async _getAuthorizationHeader ( ) : Promise < string > {
332
- return `Bearer ${ await core . Supplier . get ( this . _options . token ) } ` ;
332
+ const bearer = ( await core . Supplier . get ( this . _options . apiKey ) ) ?? process ?. env [ "GOOEY_API_KEY" ] ;
333
+ if ( bearer == null ) {
334
+ throw new errors . GooeyError ( {
335
+ message : "Please specify GOOEY_API_KEY when instantiating the client." ,
336
+ } ) ;
337
+ }
338
+
339
+ return `Bearer ${ bearer } ` ;
333
340
}
334
341
}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import * as errors from "../../../../errors/index";
12
12
export declare namespace AiBackgroundChanger {
13
13
interface Options {
14
14
environment ?: core . Supplier < environments . GooeyEnvironment | string > ;
15
- token : core . Supplier < core . BearerToken > ;
15
+ apiKey ? : core . Supplier < core . BearerToken | undefined > ;
16
16
fetcher ?: core . FetchFunction ;
17
17
}
18
18
@@ -27,7 +27,7 @@ export declare namespace AiBackgroundChanger {
27
27
}
28
28
29
29
export class AiBackgroundChanger {
30
- constructor ( protected readonly _options : AiBackgroundChanger . Options ) { }
30
+ constructor ( protected readonly _options : AiBackgroundChanger . Options = { } ) { }
31
31
32
32
/**
33
33
* @param {Gooey.ImageSegmentationPageRequest } request
@@ -329,6 +329,13 @@ export class AiBackgroundChanger {
329
329
}
330
330
331
331
protected async _getAuthorizationHeader ( ) : Promise < string > {
332
- return `Bearer ${ await core . Supplier . get ( this . _options . token ) } ` ;
332
+ const bearer = ( await core . Supplier . get ( this . _options . apiKey ) ) ?? process ?. env [ "GOOEY_API_KEY" ] ;
333
+ if ( bearer == null ) {
334
+ throw new errors . GooeyError ( {
335
+ message : "Please specify GOOEY_API_KEY when instantiating the client." ,
336
+ } ) ;
337
+ }
338
+
339
+ return `Bearer ${ bearer } ` ;
333
340
}
334
341
}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import * as errors from "../../../../errors/index";
12
12
export declare namespace AiGeneratedPhotoFromEmailProfileLookup {
13
13
interface Options {
14
14
environment ?: core . Supplier < environments . GooeyEnvironment | string > ;
15
- token : core . Supplier < core . BearerToken > ;
15
+ apiKey ? : core . Supplier < core . BearerToken | undefined > ;
16
16
fetcher ?: core . FetchFunction ;
17
17
}
18
18
@@ -27,7 +27,7 @@ export declare namespace AiGeneratedPhotoFromEmailProfileLookup {
27
27
}
28
28
29
29
export class AiGeneratedPhotoFromEmailProfileLookup {
30
- constructor ( protected readonly _options : AiGeneratedPhotoFromEmailProfileLookup . Options ) { }
30
+ constructor ( protected readonly _options : AiGeneratedPhotoFromEmailProfileLookup . Options = { } ) { }
31
31
32
32
/**
33
33
* @param {Gooey.EmailFaceInpaintingPageRequest } request
@@ -331,6 +331,13 @@ export class AiGeneratedPhotoFromEmailProfileLookup {
331
331
}
332
332
333
333
protected async _getAuthorizationHeader ( ) : Promise < string > {
334
- return `Bearer ${ await core . Supplier . get ( this . _options . token ) } ` ;
334
+ const bearer = ( await core . Supplier . get ( this . _options . apiKey ) ) ?? process ?. env [ "GOOEY_API_KEY" ] ;
335
+ if ( bearer == null ) {
336
+ throw new errors . GooeyError ( {
337
+ message : "Please specify GOOEY_API_KEY when instantiating the client." ,
338
+ } ) ;
339
+ }
340
+
341
+ return `Bearer ${ bearer } ` ;
335
342
}
336
343
}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import * as errors from "../../../../errors/index";
12
12
export declare namespace AiImageWithAFace {
13
13
interface Options {
14
14
environment ?: core . Supplier < environments . GooeyEnvironment | string > ;
15
- token : core . Supplier < core . BearerToken > ;
15
+ apiKey ? : core . Supplier < core . BearerToken | undefined > ;
16
16
fetcher ?: core . FetchFunction ;
17
17
}
18
18
@@ -27,7 +27,7 @@ export declare namespace AiImageWithAFace {
27
27
}
28
28
29
29
export class AiImageWithAFace {
30
- constructor ( protected readonly _options : AiImageWithAFace . Options ) { }
30
+ constructor ( protected readonly _options : AiImageWithAFace . Options = { } ) { }
31
31
32
32
/**
33
33
* @param {Gooey.FaceInpaintingPageRequest } request
@@ -331,6 +331,13 @@ export class AiImageWithAFace {
331
331
}
332
332
333
333
protected async _getAuthorizationHeader ( ) : Promise < string > {
334
- return `Bearer ${ await core . Supplier . get ( this . _options . token ) } ` ;
334
+ const bearer = ( await core . Supplier . get ( this . _options . apiKey ) ) ?? process ?. env [ "GOOEY_API_KEY" ] ;
335
+ if ( bearer == null ) {
336
+ throw new errors . GooeyError ( {
337
+ message : "Please specify GOOEY_API_KEY when instantiating the client." ,
338
+ } ) ;
339
+ }
340
+
341
+ return `Bearer ${ bearer } ` ;
335
342
}
336
343
}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import * as errors from "../../../../errors/index";
12
12
export declare namespace BulkRunner {
13
13
interface Options {
14
14
environment ?: core . Supplier < environments . GooeyEnvironment | string > ;
15
- token : core . Supplier < core . BearerToken > ;
15
+ apiKey ? : core . Supplier < core . BearerToken | undefined > ;
16
16
fetcher ?: core . FetchFunction ;
17
17
}
18
18
@@ -27,7 +27,7 @@ export declare namespace BulkRunner {
27
27
}
28
28
29
29
export class BulkRunner {
30
- constructor ( protected readonly _options : BulkRunner . Options ) { }
30
+ constructor ( protected readonly _options : BulkRunner . Options = { } ) { }
31
31
32
32
/**
33
33
* @param {Gooey.BulkRunnerPageRequest } request
@@ -343,6 +343,13 @@ export class BulkRunner {
343
343
}
344
344
345
345
protected async _getAuthorizationHeader ( ) : Promise < string > {
346
- return `Bearer ${ await core . Supplier . get ( this . _options . token ) } ` ;
346
+ const bearer = ( await core . Supplier . get ( this . _options . apiKey ) ) ?? process ?. env [ "GOOEY_API_KEY" ] ;
347
+ if ( bearer == null ) {
348
+ throw new errors . GooeyError ( {
349
+ message : "Please specify GOOEY_API_KEY when instantiating the client." ,
350
+ } ) ;
351
+ }
352
+
353
+ return `Bearer ${ bearer } ` ;
347
354
}
348
355
}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import * as errors from "../../../../errors/index";
12
12
export declare namespace ChyronPlantBot {
13
13
interface Options {
14
14
environment ?: core . Supplier < environments . GooeyEnvironment | string > ;
15
- token : core . Supplier < core . BearerToken > ;
15
+ apiKey ? : core . Supplier < core . BearerToken | undefined > ;
16
16
fetcher ?: core . FetchFunction ;
17
17
}
18
18
@@ -27,7 +27,7 @@ export declare namespace ChyronPlantBot {
27
27
}
28
28
29
29
export class ChyronPlantBot {
30
- constructor ( protected readonly _options : ChyronPlantBot . Options ) { }
30
+ constructor ( protected readonly _options : ChyronPlantBot . Options = { } ) { }
31
31
32
32
/**
33
33
* @param {Gooey.ChyronPlantPageRequest } request
@@ -329,6 +329,13 @@ export class ChyronPlantBot {
329
329
}
330
330
331
331
protected async _getAuthorizationHeader ( ) : Promise < string > {
332
- return `Bearer ${ await core . Supplier . get ( this . _options . token ) } ` ;
332
+ const bearer = ( await core . Supplier . get ( this . _options . apiKey ) ) ?? process ?. env [ "GOOEY_API_KEY" ] ;
333
+ if ( bearer == null ) {
334
+ throw new errors . GooeyError ( {
335
+ message : "Please specify GOOEY_API_KEY when instantiating the client." ,
336
+ } ) ;
337
+ }
338
+
339
+ return `Bearer ${ bearer } ` ;
333
340
}
334
341
}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import * as errors from "../../../../errors/index";
12
12
export declare namespace CompareAiImageGenerators {
13
13
interface Options {
14
14
environment ?: core . Supplier < environments . GooeyEnvironment | string > ;
15
- token : core . Supplier < core . BearerToken > ;
15
+ apiKey ? : core . Supplier < core . BearerToken | undefined > ;
16
16
fetcher ?: core . FetchFunction ;
17
17
}
18
18
@@ -27,7 +27,7 @@ export declare namespace CompareAiImageGenerators {
27
27
}
28
28
29
29
export class CompareAiImageGenerators {
30
- constructor ( protected readonly _options : CompareAiImageGenerators . Options ) { }
30
+ constructor ( protected readonly _options : CompareAiImageGenerators . Options = { } ) { }
31
31
32
32
/**
33
33
* @param {Gooey.CompareText2ImgPageRequest } request
@@ -329,6 +329,13 @@ export class CompareAiImageGenerators {
329
329
}
330
330
331
331
protected async _getAuthorizationHeader ( ) : Promise < string > {
332
- return `Bearer ${ await core . Supplier . get ( this . _options . token ) } ` ;
332
+ const bearer = ( await core . Supplier . get ( this . _options . apiKey ) ) ?? process ?. env [ "GOOEY_API_KEY" ] ;
333
+ if ( bearer == null ) {
334
+ throw new errors . GooeyError ( {
335
+ message : "Please specify GOOEY_API_KEY when instantiating the client." ,
336
+ } ) ;
337
+ }
338
+
339
+ return `Bearer ${ bearer } ` ;
333
340
}
334
341
}
You can’t perform that action at this time.
0 commit comments