@use_socials/sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1243 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * use-socials API
5
+ * Social media publishing API as a service. Allows app builders to let their users post to YouTube, TikTok, Instagram, and Pinterest.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import globalAxios from 'axios';
24
+ // Some imports not used depending on template conditions
25
+ // @ts-ignore
26
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
27
+ // @ts-ignore
28
+ import { BASE_PATH, BaseAPI, operationServerMap } from './base';
29
+ /**
30
+ * HealthApi - axios parameter creator
31
+ */
32
+ export const HealthApiAxiosParamCreator = function (configuration) {
33
+ return {
34
+ /**
35
+ * Returns the current health status of the API.
36
+ * @summary Health check
37
+ * @param {*} [options] Override http request option.
38
+ * @throws {RequiredError}
39
+ */
40
+ healthGet: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) {
41
+ const localVarPath = `/health`;
42
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
43
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
44
+ let baseOptions;
45
+ if (configuration) {
46
+ baseOptions = configuration.baseOptions;
47
+ }
48
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
49
+ const localVarHeaderParameter = {};
50
+ const localVarQueryParameter = {};
51
+ localVarHeaderParameter['Accept'] = 'application/json';
52
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
53
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
54
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
55
+ return {
56
+ url: toPathString(localVarUrlObj),
57
+ options: localVarRequestOptions,
58
+ };
59
+ }),
60
+ };
61
+ };
62
+ /**
63
+ * HealthApi - functional programming interface
64
+ */
65
+ export const HealthApiFp = function (configuration) {
66
+ const localVarAxiosParamCreator = HealthApiAxiosParamCreator(configuration);
67
+ return {
68
+ /**
69
+ * Returns the current health status of the API.
70
+ * @summary Health check
71
+ * @param {*} [options] Override http request option.
72
+ * @throws {RequiredError}
73
+ */
74
+ healthGet(options) {
75
+ return __awaiter(this, void 0, void 0, function* () {
76
+ var _a, _b, _c;
77
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.healthGet(options);
78
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
79
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['HealthApi.healthGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
80
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
81
+ });
82
+ },
83
+ };
84
+ };
85
+ /**
86
+ * HealthApi - factory interface
87
+ */
88
+ export const HealthApiFactory = function (configuration, basePath, axios) {
89
+ const localVarFp = HealthApiFp(configuration);
90
+ return {
91
+ /**
92
+ * Returns the current health status of the API.
93
+ * @summary Health check
94
+ * @param {*} [options] Override http request option.
95
+ * @throws {RequiredError}
96
+ */
97
+ healthGet(options) {
98
+ return localVarFp.healthGet(options).then((request) => request(axios, basePath));
99
+ },
100
+ };
101
+ };
102
+ /**
103
+ * HealthApi - object-oriented interface
104
+ */
105
+ export class HealthApi extends BaseAPI {
106
+ /**
107
+ * Returns the current health status of the API.
108
+ * @summary Health check
109
+ * @param {*} [options] Override http request option.
110
+ * @throws {RequiredError}
111
+ */
112
+ healthGet(options) {
113
+ return HealthApiFp(this.configuration).healthGet(options).then((request) => request(this.axios, this.basePath));
114
+ }
115
+ }
116
+ /**
117
+ * MediaApi - axios parameter creator
118
+ */
119
+ export const MediaApiAxiosParamCreator = function (configuration) {
120
+ return {
121
+ /**
122
+ * Confirms media upload is complete and ready for use in publish jobs.
123
+ * @summary Complete media upload
124
+ * @param {string} mediaId Media ID
125
+ * @param {*} [options] Override http request option.
126
+ * @throws {RequiredError}
127
+ */
128
+ apiV1MediaMediaIdCompletePost: (mediaId_1, ...args_1) => __awaiter(this, [mediaId_1, ...args_1], void 0, function* (mediaId, options = {}) {
129
+ // verify required parameter 'mediaId' is not null or undefined
130
+ assertParamExists('apiV1MediaMediaIdCompletePost', 'mediaId', mediaId);
131
+ const localVarPath = `/api/v1/media/{mediaId}/complete`
132
+ .replace(`{${"mediaId"}}`, encodeURIComponent(String(mediaId)));
133
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
134
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
135
+ let baseOptions;
136
+ if (configuration) {
137
+ baseOptions = configuration.baseOptions;
138
+ }
139
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
140
+ const localVarHeaderParameter = {};
141
+ const localVarQueryParameter = {};
142
+ // authentication ApiKeyAuth required
143
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
144
+ localVarHeaderParameter['Accept'] = 'application/json';
145
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
146
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
147
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
148
+ return {
149
+ url: toPathString(localVarUrlObj),
150
+ options: localVarRequestOptions,
151
+ };
152
+ }),
153
+ /**
154
+ * Returns a presigned URL for direct media upload to cloud storage.
155
+ * @summary Generate presigned upload URL
156
+ * @param {HandlersPresignMediaRequest} body Media presign request
157
+ * @param {*} [options] Override http request option.
158
+ * @throws {RequiredError}
159
+ */
160
+ apiV1MediaPresignPost: (body_1, ...args_1) => __awaiter(this, [body_1, ...args_1], void 0, function* (body, options = {}) {
161
+ // verify required parameter 'body' is not null or undefined
162
+ assertParamExists('apiV1MediaPresignPost', 'body', body);
163
+ const localVarPath = `/api/v1/media/presign`;
164
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
165
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
166
+ let baseOptions;
167
+ if (configuration) {
168
+ baseOptions = configuration.baseOptions;
169
+ }
170
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
171
+ const localVarHeaderParameter = {};
172
+ const localVarQueryParameter = {};
173
+ // authentication ApiKeyAuth required
174
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
175
+ localVarHeaderParameter['Content-Type'] = 'application/json';
176
+ localVarHeaderParameter['Accept'] = 'application/json';
177
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
178
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
179
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
180
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
181
+ return {
182
+ url: toPathString(localVarUrlObj),
183
+ options: localVarRequestOptions,
184
+ };
185
+ }),
186
+ };
187
+ };
188
+ /**
189
+ * MediaApi - functional programming interface
190
+ */
191
+ export const MediaApiFp = function (configuration) {
192
+ const localVarAxiosParamCreator = MediaApiAxiosParamCreator(configuration);
193
+ return {
194
+ /**
195
+ * Confirms media upload is complete and ready for use in publish jobs.
196
+ * @summary Complete media upload
197
+ * @param {string} mediaId Media ID
198
+ * @param {*} [options] Override http request option.
199
+ * @throws {RequiredError}
200
+ */
201
+ apiV1MediaMediaIdCompletePost(mediaId, options) {
202
+ return __awaiter(this, void 0, void 0, function* () {
203
+ var _a, _b, _c;
204
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.apiV1MediaMediaIdCompletePost(mediaId, options);
205
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
206
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['MediaApi.apiV1MediaMediaIdCompletePost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
207
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
208
+ });
209
+ },
210
+ /**
211
+ * Returns a presigned URL for direct media upload to cloud storage.
212
+ * @summary Generate presigned upload URL
213
+ * @param {HandlersPresignMediaRequest} body Media presign request
214
+ * @param {*} [options] Override http request option.
215
+ * @throws {RequiredError}
216
+ */
217
+ apiV1MediaPresignPost(body, options) {
218
+ return __awaiter(this, void 0, void 0, function* () {
219
+ var _a, _b, _c;
220
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.apiV1MediaPresignPost(body, options);
221
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
222
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['MediaApi.apiV1MediaPresignPost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
223
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
224
+ });
225
+ },
226
+ };
227
+ };
228
+ /**
229
+ * MediaApi - factory interface
230
+ */
231
+ export const MediaApiFactory = function (configuration, basePath, axios) {
232
+ const localVarFp = MediaApiFp(configuration);
233
+ return {
234
+ /**
235
+ * Confirms media upload is complete and ready for use in publish jobs.
236
+ * @summary Complete media upload
237
+ * @param {string} mediaId Media ID
238
+ * @param {*} [options] Override http request option.
239
+ * @throws {RequiredError}
240
+ */
241
+ apiV1MediaMediaIdCompletePost(mediaId, options) {
242
+ return localVarFp.apiV1MediaMediaIdCompletePost(mediaId, options).then((request) => request(axios, basePath));
243
+ },
244
+ /**
245
+ * Returns a presigned URL for direct media upload to cloud storage.
246
+ * @summary Generate presigned upload URL
247
+ * @param {HandlersPresignMediaRequest} body Media presign request
248
+ * @param {*} [options] Override http request option.
249
+ * @throws {RequiredError}
250
+ */
251
+ apiV1MediaPresignPost(body, options) {
252
+ return localVarFp.apiV1MediaPresignPost(body, options).then((request) => request(axios, basePath));
253
+ },
254
+ };
255
+ };
256
+ /**
257
+ * MediaApi - object-oriented interface
258
+ */
259
+ export class MediaApi extends BaseAPI {
260
+ /**
261
+ * Confirms media upload is complete and ready for use in publish jobs.
262
+ * @summary Complete media upload
263
+ * @param {string} mediaId Media ID
264
+ * @param {*} [options] Override http request option.
265
+ * @throws {RequiredError}
266
+ */
267
+ apiV1MediaMediaIdCompletePost(mediaId, options) {
268
+ return MediaApiFp(this.configuration).apiV1MediaMediaIdCompletePost(mediaId, options).then((request) => request(this.axios, this.basePath));
269
+ }
270
+ /**
271
+ * Returns a presigned URL for direct media upload to cloud storage.
272
+ * @summary Generate presigned upload URL
273
+ * @param {HandlersPresignMediaRequest} body Media presign request
274
+ * @param {*} [options] Override http request option.
275
+ * @throws {RequiredError}
276
+ */
277
+ apiV1MediaPresignPost(body, options) {
278
+ return MediaApiFp(this.configuration).apiV1MediaPresignPost(body, options).then((request) => request(this.axios, this.basePath));
279
+ }
280
+ }
281
+ /**
282
+ * OauthApi - axios parameter creator
283
+ */
284
+ export const OauthApiAxiosParamCreator = function (configuration) {
285
+ return {
286
+ /**
287
+ * Callback endpoint for social platform OAuth flows. On success, the social account is connected immediately and the response returns `status=connected`.
288
+ * @summary OAuth callback endpoint
289
+ * @param {string} platform Platform name (youtube, tiktok, instagram, pinterest)
290
+ * @param {string} code Authorization code from the platform
291
+ * @param {string} state State parameter for CSRF protection
292
+ * @param {*} [options] Override http request option.
293
+ * @throws {RequiredError}
294
+ */
295
+ apiV1OauthPlatformCallbackGet: (platform_1, code_1, state_1, ...args_1) => __awaiter(this, [platform_1, code_1, state_1, ...args_1], void 0, function* (platform, code, state, options = {}) {
296
+ // verify required parameter 'platform' is not null or undefined
297
+ assertParamExists('apiV1OauthPlatformCallbackGet', 'platform', platform);
298
+ // verify required parameter 'code' is not null or undefined
299
+ assertParamExists('apiV1OauthPlatformCallbackGet', 'code', code);
300
+ // verify required parameter 'state' is not null or undefined
301
+ assertParamExists('apiV1OauthPlatformCallbackGet', 'state', state);
302
+ const localVarPath = `/api/v1/oauth/{platform}/callback`
303
+ .replace(`{${"platform"}}`, encodeURIComponent(String(platform)));
304
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
305
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
306
+ let baseOptions;
307
+ if (configuration) {
308
+ baseOptions = configuration.baseOptions;
309
+ }
310
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
311
+ const localVarHeaderParameter = {};
312
+ const localVarQueryParameter = {};
313
+ if (code !== undefined) {
314
+ localVarQueryParameter['code'] = code;
315
+ }
316
+ if (state !== undefined) {
317
+ localVarQueryParameter['state'] = state;
318
+ }
319
+ localVarHeaderParameter['Accept'] = 'application/json';
320
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
321
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
322
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
323
+ return {
324
+ url: toPathString(localVarUrlObj),
325
+ options: localVarRequestOptions,
326
+ };
327
+ }),
328
+ /**
329
+ * Returns an authorization URL for the user to authenticate with the specified social platform.
330
+ * @summary Generate OAuth authorization URL
331
+ * @param {string} platform Platform name (youtube, tiktok, instagram, pinterest)
332
+ * @param {string} userId User ID
333
+ * @param {string} [redirectUrl] URL to redirect to after OAuth callback
334
+ * @param {*} [options] Override http request option.
335
+ * @throws {RequiredError}
336
+ */
337
+ apiV1OauthPlatformUrlGet: (platform_1, userId_1, redirectUrl_1, ...args_1) => __awaiter(this, [platform_1, userId_1, redirectUrl_1, ...args_1], void 0, function* (platform, userId, redirectUrl, options = {}) {
338
+ // verify required parameter 'platform' is not null or undefined
339
+ assertParamExists('apiV1OauthPlatformUrlGet', 'platform', platform);
340
+ // verify required parameter 'userId' is not null or undefined
341
+ assertParamExists('apiV1OauthPlatformUrlGet', 'userId', userId);
342
+ const localVarPath = `/api/v1/oauth/{platform}/url`
343
+ .replace(`{${"platform"}}`, encodeURIComponent(String(platform)));
344
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
345
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
346
+ let baseOptions;
347
+ if (configuration) {
348
+ baseOptions = configuration.baseOptions;
349
+ }
350
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
351
+ const localVarHeaderParameter = {};
352
+ const localVarQueryParameter = {};
353
+ // authentication ApiKeyAuth required
354
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
355
+ if (userId !== undefined) {
356
+ localVarQueryParameter['userId'] = userId;
357
+ }
358
+ if (redirectUrl !== undefined) {
359
+ localVarQueryParameter['redirectUrl'] = redirectUrl;
360
+ }
361
+ localVarHeaderParameter['Accept'] = 'application/json';
362
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
363
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
364
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
365
+ return {
366
+ url: toPathString(localVarUrlObj),
367
+ options: localVarRequestOptions,
368
+ };
369
+ }),
370
+ };
371
+ };
372
+ /**
373
+ * OauthApi - functional programming interface
374
+ */
375
+ export const OauthApiFp = function (configuration) {
376
+ const localVarAxiosParamCreator = OauthApiAxiosParamCreator(configuration);
377
+ return {
378
+ /**
379
+ * Callback endpoint for social platform OAuth flows. On success, the social account is connected immediately and the response returns `status=connected`.
380
+ * @summary OAuth callback endpoint
381
+ * @param {string} platform Platform name (youtube, tiktok, instagram, pinterest)
382
+ * @param {string} code Authorization code from the platform
383
+ * @param {string} state State parameter for CSRF protection
384
+ * @param {*} [options] Override http request option.
385
+ * @throws {RequiredError}
386
+ */
387
+ apiV1OauthPlatformCallbackGet(platform, code, state, options) {
388
+ return __awaiter(this, void 0, void 0, function* () {
389
+ var _a, _b, _c;
390
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.apiV1OauthPlatformCallbackGet(platform, code, state, options);
391
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
392
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['OauthApi.apiV1OauthPlatformCallbackGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
393
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
394
+ });
395
+ },
396
+ /**
397
+ * Returns an authorization URL for the user to authenticate with the specified social platform.
398
+ * @summary Generate OAuth authorization URL
399
+ * @param {string} platform Platform name (youtube, tiktok, instagram, pinterest)
400
+ * @param {string} userId User ID
401
+ * @param {string} [redirectUrl] URL to redirect to after OAuth callback
402
+ * @param {*} [options] Override http request option.
403
+ * @throws {RequiredError}
404
+ */
405
+ apiV1OauthPlatformUrlGet(platform, userId, redirectUrl, options) {
406
+ return __awaiter(this, void 0, void 0, function* () {
407
+ var _a, _b, _c;
408
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.apiV1OauthPlatformUrlGet(platform, userId, redirectUrl, options);
409
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
410
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['OauthApi.apiV1OauthPlatformUrlGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
411
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
412
+ });
413
+ },
414
+ };
415
+ };
416
+ /**
417
+ * OauthApi - factory interface
418
+ */
419
+ export const OauthApiFactory = function (configuration, basePath, axios) {
420
+ const localVarFp = OauthApiFp(configuration);
421
+ return {
422
+ /**
423
+ * Callback endpoint for social platform OAuth flows. On success, the social account is connected immediately and the response returns `status=connected`.
424
+ * @summary OAuth callback endpoint
425
+ * @param {string} platform Platform name (youtube, tiktok, instagram, pinterest)
426
+ * @param {string} code Authorization code from the platform
427
+ * @param {string} state State parameter for CSRF protection
428
+ * @param {*} [options] Override http request option.
429
+ * @throws {RequiredError}
430
+ */
431
+ apiV1OauthPlatformCallbackGet(platform, code, state, options) {
432
+ return localVarFp.apiV1OauthPlatformCallbackGet(platform, code, state, options).then((request) => request(axios, basePath));
433
+ },
434
+ /**
435
+ * Returns an authorization URL for the user to authenticate with the specified social platform.
436
+ * @summary Generate OAuth authorization URL
437
+ * @param {string} platform Platform name (youtube, tiktok, instagram, pinterest)
438
+ * @param {string} userId User ID
439
+ * @param {string} [redirectUrl] URL to redirect to after OAuth callback
440
+ * @param {*} [options] Override http request option.
441
+ * @throws {RequiredError}
442
+ */
443
+ apiV1OauthPlatformUrlGet(platform, userId, redirectUrl, options) {
444
+ return localVarFp.apiV1OauthPlatformUrlGet(platform, userId, redirectUrl, options).then((request) => request(axios, basePath));
445
+ },
446
+ };
447
+ };
448
+ /**
449
+ * OauthApi - object-oriented interface
450
+ */
451
+ export class OauthApi extends BaseAPI {
452
+ /**
453
+ * Callback endpoint for social platform OAuth flows. On success, the social account is connected immediately and the response returns `status=connected`.
454
+ * @summary OAuth callback endpoint
455
+ * @param {string} platform Platform name (youtube, tiktok, instagram, pinterest)
456
+ * @param {string} code Authorization code from the platform
457
+ * @param {string} state State parameter for CSRF protection
458
+ * @param {*} [options] Override http request option.
459
+ * @throws {RequiredError}
460
+ */
461
+ apiV1OauthPlatformCallbackGet(platform, code, state, options) {
462
+ return OauthApiFp(this.configuration).apiV1OauthPlatformCallbackGet(platform, code, state, options).then((request) => request(this.axios, this.basePath));
463
+ }
464
+ /**
465
+ * Returns an authorization URL for the user to authenticate with the specified social platform.
466
+ * @summary Generate OAuth authorization URL
467
+ * @param {string} platform Platform name (youtube, tiktok, instagram, pinterest)
468
+ * @param {string} userId User ID
469
+ * @param {string} [redirectUrl] URL to redirect to after OAuth callback
470
+ * @param {*} [options] Override http request option.
471
+ * @throws {RequiredError}
472
+ */
473
+ apiV1OauthPlatformUrlGet(platform, userId, redirectUrl, options) {
474
+ return OauthApiFp(this.configuration).apiV1OauthPlatformUrlGet(platform, userId, redirectUrl, options).then((request) => request(this.axios, this.basePath));
475
+ }
476
+ }
477
+ /**
478
+ * PostsApi - axios parameter creator
479
+ */
480
+ export const PostsApiAxiosParamCreator = function (configuration) {
481
+ return {
482
+ /**
483
+ * Returns all posts for a user.
484
+ * @summary List posts
485
+ * @param {string} userId User ID
486
+ * @param {*} [options] Override http request option.
487
+ * @throws {RequiredError}
488
+ */
489
+ apiV1UsersUserIdPostsGet: (userId_1, ...args_1) => __awaiter(this, [userId_1, ...args_1], void 0, function* (userId, options = {}) {
490
+ // verify required parameter 'userId' is not null or undefined
491
+ assertParamExists('apiV1UsersUserIdPostsGet', 'userId', userId);
492
+ const localVarPath = `/api/v1/users/{userId}/posts`
493
+ .replace(`{${"userId"}}`, encodeURIComponent(String(userId)));
494
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
495
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
496
+ let baseOptions;
497
+ if (configuration) {
498
+ baseOptions = configuration.baseOptions;
499
+ }
500
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
501
+ const localVarHeaderParameter = {};
502
+ const localVarQueryParameter = {};
503
+ // authentication ApiKeyAuth required
504
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
505
+ localVarHeaderParameter['Accept'] = 'application/json';
506
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
507
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
508
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
509
+ return {
510
+ url: toPathString(localVarUrlObj),
511
+ options: localVarRequestOptions,
512
+ };
513
+ }),
514
+ /**
515
+ * Creates a post for one or more connected social accounts and enqueues publish tasks.
516
+ * @summary Create a new post
517
+ * @param {string} userId User ID
518
+ * @param {HandlersCreatePostRequest} body Post payload
519
+ * @param {string} [idempotencyKey] Idempotency key for safe retries (optional)
520
+ * @param {*} [options] Override http request option.
521
+ * @throws {RequiredError}
522
+ */
523
+ apiV1UsersUserIdPostsPost: (userId_1, body_1, idempotencyKey_1, ...args_1) => __awaiter(this, [userId_1, body_1, idempotencyKey_1, ...args_1], void 0, function* (userId, body, idempotencyKey, options = {}) {
524
+ // verify required parameter 'userId' is not null or undefined
525
+ assertParamExists('apiV1UsersUserIdPostsPost', 'userId', userId);
526
+ // verify required parameter 'body' is not null or undefined
527
+ assertParamExists('apiV1UsersUserIdPostsPost', 'body', body);
528
+ const localVarPath = `/api/v1/users/{userId}/posts`
529
+ .replace(`{${"userId"}}`, encodeURIComponent(String(userId)));
530
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
531
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
532
+ let baseOptions;
533
+ if (configuration) {
534
+ baseOptions = configuration.baseOptions;
535
+ }
536
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
537
+ const localVarHeaderParameter = {};
538
+ const localVarQueryParameter = {};
539
+ // authentication ApiKeyAuth required
540
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
541
+ localVarHeaderParameter['Content-Type'] = 'application/json';
542
+ localVarHeaderParameter['Accept'] = 'application/json';
543
+ if (idempotencyKey != null) {
544
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
545
+ }
546
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
547
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
548
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
549
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
550
+ return {
551
+ url: toPathString(localVarUrlObj),
552
+ options: localVarRequestOptions,
553
+ };
554
+ }),
555
+ /**
556
+ * Returns a post with all social publication targets.
557
+ * @summary Get post
558
+ * @param {string} userId User ID
559
+ * @param {string} postId Post ID
560
+ * @param {*} [options] Override http request option.
561
+ * @throws {RequiredError}
562
+ */
563
+ apiV1UsersUserIdPostsPostIdGet: (userId_1, postId_1, ...args_1) => __awaiter(this, [userId_1, postId_1, ...args_1], void 0, function* (userId, postId, options = {}) {
564
+ // verify required parameter 'userId' is not null or undefined
565
+ assertParamExists('apiV1UsersUserIdPostsPostIdGet', 'userId', userId);
566
+ // verify required parameter 'postId' is not null or undefined
567
+ assertParamExists('apiV1UsersUserIdPostsPostIdGet', 'postId', postId);
568
+ const localVarPath = `/api/v1/users/{userId}/posts/{postId}`
569
+ .replace(`{${"userId"}}`, encodeURIComponent(String(userId)))
570
+ .replace(`{${"postId"}}`, encodeURIComponent(String(postId)));
571
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
572
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
573
+ let baseOptions;
574
+ if (configuration) {
575
+ baseOptions = configuration.baseOptions;
576
+ }
577
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
578
+ const localVarHeaderParameter = {};
579
+ const localVarQueryParameter = {};
580
+ // authentication ApiKeyAuth required
581
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
582
+ localVarHeaderParameter['Accept'] = 'application/json';
583
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
584
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
585
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
586
+ return {
587
+ url: toPathString(localVarUrlObj),
588
+ options: localVarRequestOptions,
589
+ };
590
+ }),
591
+ /**
592
+ * Retries publish for a specific social target row.
593
+ * @summary Retry post publish for a failed target
594
+ * @param {string} userId User ID
595
+ * @param {string} postId Post ID
596
+ * @param {string} targetId Post target ID
597
+ * @param {*} [options] Override http request option.
598
+ * @throws {RequiredError}
599
+ */
600
+ apiV1UsersUserIdPostsPostIdTargetsTargetIdRetryPost: (userId_1, postId_1, targetId_1, ...args_1) => __awaiter(this, [userId_1, postId_1, targetId_1, ...args_1], void 0, function* (userId, postId, targetId, options = {}) {
601
+ // verify required parameter 'userId' is not null or undefined
602
+ assertParamExists('apiV1UsersUserIdPostsPostIdTargetsTargetIdRetryPost', 'userId', userId);
603
+ // verify required parameter 'postId' is not null or undefined
604
+ assertParamExists('apiV1UsersUserIdPostsPostIdTargetsTargetIdRetryPost', 'postId', postId);
605
+ // verify required parameter 'targetId' is not null or undefined
606
+ assertParamExists('apiV1UsersUserIdPostsPostIdTargetsTargetIdRetryPost', 'targetId', targetId);
607
+ const localVarPath = `/api/v1/users/{userId}/posts/{postId}/targets/{targetId}/retry`
608
+ .replace(`{${"userId"}}`, encodeURIComponent(String(userId)))
609
+ .replace(`{${"postId"}}`, encodeURIComponent(String(postId)))
610
+ .replace(`{${"targetId"}}`, encodeURIComponent(String(targetId)));
611
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
612
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
613
+ let baseOptions;
614
+ if (configuration) {
615
+ baseOptions = configuration.baseOptions;
616
+ }
617
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
618
+ const localVarHeaderParameter = {};
619
+ const localVarQueryParameter = {};
620
+ // authentication ApiKeyAuth required
621
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
622
+ localVarHeaderParameter['Accept'] = 'application/json';
623
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
624
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
625
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
626
+ return {
627
+ url: toPathString(localVarUrlObj),
628
+ options: localVarRequestOptions,
629
+ };
630
+ }),
631
+ };
632
+ };
633
+ /**
634
+ * PostsApi - functional programming interface
635
+ */
636
+ export const PostsApiFp = function (configuration) {
637
+ const localVarAxiosParamCreator = PostsApiAxiosParamCreator(configuration);
638
+ return {
639
+ /**
640
+ * Returns all posts for a user.
641
+ * @summary List posts
642
+ * @param {string} userId User ID
643
+ * @param {*} [options] Override http request option.
644
+ * @throws {RequiredError}
645
+ */
646
+ apiV1UsersUserIdPostsGet(userId, options) {
647
+ return __awaiter(this, void 0, void 0, function* () {
648
+ var _a, _b, _c;
649
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.apiV1UsersUserIdPostsGet(userId, options);
650
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
651
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PostsApi.apiV1UsersUserIdPostsGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
652
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
653
+ });
654
+ },
655
+ /**
656
+ * Creates a post for one or more connected social accounts and enqueues publish tasks.
657
+ * @summary Create a new post
658
+ * @param {string} userId User ID
659
+ * @param {HandlersCreatePostRequest} body Post payload
660
+ * @param {string} [idempotencyKey] Idempotency key for safe retries (optional)
661
+ * @param {*} [options] Override http request option.
662
+ * @throws {RequiredError}
663
+ */
664
+ apiV1UsersUserIdPostsPost(userId, body, idempotencyKey, options) {
665
+ return __awaiter(this, void 0, void 0, function* () {
666
+ var _a, _b, _c;
667
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.apiV1UsersUserIdPostsPost(userId, body, idempotencyKey, options);
668
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
669
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PostsApi.apiV1UsersUserIdPostsPost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
670
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
671
+ });
672
+ },
673
+ /**
674
+ * Returns a post with all social publication targets.
675
+ * @summary Get post
676
+ * @param {string} userId User ID
677
+ * @param {string} postId Post ID
678
+ * @param {*} [options] Override http request option.
679
+ * @throws {RequiredError}
680
+ */
681
+ apiV1UsersUserIdPostsPostIdGet(userId, postId, options) {
682
+ return __awaiter(this, void 0, void 0, function* () {
683
+ var _a, _b, _c;
684
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.apiV1UsersUserIdPostsPostIdGet(userId, postId, options);
685
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
686
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PostsApi.apiV1UsersUserIdPostsPostIdGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
687
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
688
+ });
689
+ },
690
+ /**
691
+ * Retries publish for a specific social target row.
692
+ * @summary Retry post publish for a failed target
693
+ * @param {string} userId User ID
694
+ * @param {string} postId Post ID
695
+ * @param {string} targetId Post target ID
696
+ * @param {*} [options] Override http request option.
697
+ * @throws {RequiredError}
698
+ */
699
+ apiV1UsersUserIdPostsPostIdTargetsTargetIdRetryPost(userId, postId, targetId, options) {
700
+ return __awaiter(this, void 0, void 0, function* () {
701
+ var _a, _b, _c;
702
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.apiV1UsersUserIdPostsPostIdTargetsTargetIdRetryPost(userId, postId, targetId, options);
703
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
704
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PostsApi.apiV1UsersUserIdPostsPostIdTargetsTargetIdRetryPost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
705
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
706
+ });
707
+ },
708
+ };
709
+ };
710
+ /**
711
+ * PostsApi - factory interface
712
+ */
713
+ export const PostsApiFactory = function (configuration, basePath, axios) {
714
+ const localVarFp = PostsApiFp(configuration);
715
+ return {
716
+ /**
717
+ * Returns all posts for a user.
718
+ * @summary List posts
719
+ * @param {string} userId User ID
720
+ * @param {*} [options] Override http request option.
721
+ * @throws {RequiredError}
722
+ */
723
+ apiV1UsersUserIdPostsGet(userId, options) {
724
+ return localVarFp.apiV1UsersUserIdPostsGet(userId, options).then((request) => request(axios, basePath));
725
+ },
726
+ /**
727
+ * Creates a post for one or more connected social accounts and enqueues publish tasks.
728
+ * @summary Create a new post
729
+ * @param {string} userId User ID
730
+ * @param {HandlersCreatePostRequest} body Post payload
731
+ * @param {string} [idempotencyKey] Idempotency key for safe retries (optional)
732
+ * @param {*} [options] Override http request option.
733
+ * @throws {RequiredError}
734
+ */
735
+ apiV1UsersUserIdPostsPost(userId, body, idempotencyKey, options) {
736
+ return localVarFp.apiV1UsersUserIdPostsPost(userId, body, idempotencyKey, options).then((request) => request(axios, basePath));
737
+ },
738
+ /**
739
+ * Returns a post with all social publication targets.
740
+ * @summary Get post
741
+ * @param {string} userId User ID
742
+ * @param {string} postId Post ID
743
+ * @param {*} [options] Override http request option.
744
+ * @throws {RequiredError}
745
+ */
746
+ apiV1UsersUserIdPostsPostIdGet(userId, postId, options) {
747
+ return localVarFp.apiV1UsersUserIdPostsPostIdGet(userId, postId, options).then((request) => request(axios, basePath));
748
+ },
749
+ /**
750
+ * Retries publish for a specific social target row.
751
+ * @summary Retry post publish for a failed target
752
+ * @param {string} userId User ID
753
+ * @param {string} postId Post ID
754
+ * @param {string} targetId Post target ID
755
+ * @param {*} [options] Override http request option.
756
+ * @throws {RequiredError}
757
+ */
758
+ apiV1UsersUserIdPostsPostIdTargetsTargetIdRetryPost(userId, postId, targetId, options) {
759
+ return localVarFp.apiV1UsersUserIdPostsPostIdTargetsTargetIdRetryPost(userId, postId, targetId, options).then((request) => request(axios, basePath));
760
+ },
761
+ };
762
+ };
763
+ /**
764
+ * PostsApi - object-oriented interface
765
+ */
766
+ export class PostsApi extends BaseAPI {
767
+ /**
768
+ * Returns all posts for a user.
769
+ * @summary List posts
770
+ * @param {string} userId User ID
771
+ * @param {*} [options] Override http request option.
772
+ * @throws {RequiredError}
773
+ */
774
+ apiV1UsersUserIdPostsGet(userId, options) {
775
+ return PostsApiFp(this.configuration).apiV1UsersUserIdPostsGet(userId, options).then((request) => request(this.axios, this.basePath));
776
+ }
777
+ /**
778
+ * Creates a post for one or more connected social accounts and enqueues publish tasks.
779
+ * @summary Create a new post
780
+ * @param {string} userId User ID
781
+ * @param {HandlersCreatePostRequest} body Post payload
782
+ * @param {string} [idempotencyKey] Idempotency key for safe retries (optional)
783
+ * @param {*} [options] Override http request option.
784
+ * @throws {RequiredError}
785
+ */
786
+ apiV1UsersUserIdPostsPost(userId, body, idempotencyKey, options) {
787
+ return PostsApiFp(this.configuration).apiV1UsersUserIdPostsPost(userId, body, idempotencyKey, options).then((request) => request(this.axios, this.basePath));
788
+ }
789
+ /**
790
+ * Returns a post with all social publication targets.
791
+ * @summary Get post
792
+ * @param {string} userId User ID
793
+ * @param {string} postId Post ID
794
+ * @param {*} [options] Override http request option.
795
+ * @throws {RequiredError}
796
+ */
797
+ apiV1UsersUserIdPostsPostIdGet(userId, postId, options) {
798
+ return PostsApiFp(this.configuration).apiV1UsersUserIdPostsPostIdGet(userId, postId, options).then((request) => request(this.axios, this.basePath));
799
+ }
800
+ /**
801
+ * Retries publish for a specific social target row.
802
+ * @summary Retry post publish for a failed target
803
+ * @param {string} userId User ID
804
+ * @param {string} postId Post ID
805
+ * @param {string} targetId Post target ID
806
+ * @param {*} [options] Override http request option.
807
+ * @throws {RequiredError}
808
+ */
809
+ apiV1UsersUserIdPostsPostIdTargetsTargetIdRetryPost(userId, postId, targetId, options) {
810
+ return PostsApiFp(this.configuration).apiV1UsersUserIdPostsPostIdTargetsTargetIdRetryPost(userId, postId, targetId, options).then((request) => request(this.axios, this.basePath));
811
+ }
812
+ }
813
+ /**
814
+ * PublishApi - axios parameter creator
815
+ */
816
+ export const PublishApiAxiosParamCreator = function (configuration) {
817
+ return {
818
+ /**
819
+ * Returns the current status and results of a publish task.
820
+ * @summary Get publish task status
821
+ * @param {string} jobId Job ID
822
+ * @param {*} [options] Override http request option.
823
+ * @throws {RequiredError}
824
+ */
825
+ apiV1PublishJobsJobIdGet: (jobId_1, ...args_1) => __awaiter(this, [jobId_1, ...args_1], void 0, function* (jobId, options = {}) {
826
+ // verify required parameter 'jobId' is not null or undefined
827
+ assertParamExists('apiV1PublishJobsJobIdGet', 'jobId', jobId);
828
+ const localVarPath = `/api/v1/publish-jobs/{jobId}`
829
+ .replace(`{${"jobId"}}`, encodeURIComponent(String(jobId)));
830
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
831
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
832
+ let baseOptions;
833
+ if (configuration) {
834
+ baseOptions = configuration.baseOptions;
835
+ }
836
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
837
+ const localVarHeaderParameter = {};
838
+ const localVarQueryParameter = {};
839
+ // authentication ApiKeyAuth required
840
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
841
+ localVarHeaderParameter['Accept'] = 'application/json';
842
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
843
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
844
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
845
+ return {
846
+ url: toPathString(localVarUrlObj),
847
+ options: localVarRequestOptions,
848
+ };
849
+ }),
850
+ };
851
+ };
852
+ /**
853
+ * PublishApi - functional programming interface
854
+ */
855
+ export const PublishApiFp = function (configuration) {
856
+ const localVarAxiosParamCreator = PublishApiAxiosParamCreator(configuration);
857
+ return {
858
+ /**
859
+ * Returns the current status and results of a publish task.
860
+ * @summary Get publish task status
861
+ * @param {string} jobId Job ID
862
+ * @param {*} [options] Override http request option.
863
+ * @throws {RequiredError}
864
+ */
865
+ apiV1PublishJobsJobIdGet(jobId, options) {
866
+ return __awaiter(this, void 0, void 0, function* () {
867
+ var _a, _b, _c;
868
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.apiV1PublishJobsJobIdGet(jobId, options);
869
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
870
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PublishApi.apiV1PublishJobsJobIdGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
871
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
872
+ });
873
+ },
874
+ };
875
+ };
876
+ /**
877
+ * PublishApi - factory interface
878
+ */
879
+ export const PublishApiFactory = function (configuration, basePath, axios) {
880
+ const localVarFp = PublishApiFp(configuration);
881
+ return {
882
+ /**
883
+ * Returns the current status and results of a publish task.
884
+ * @summary Get publish task status
885
+ * @param {string} jobId Job ID
886
+ * @param {*} [options] Override http request option.
887
+ * @throws {RequiredError}
888
+ */
889
+ apiV1PublishJobsJobIdGet(jobId, options) {
890
+ return localVarFp.apiV1PublishJobsJobIdGet(jobId, options).then((request) => request(axios, basePath));
891
+ },
892
+ };
893
+ };
894
+ /**
895
+ * PublishApi - object-oriented interface
896
+ */
897
+ export class PublishApi extends BaseAPI {
898
+ /**
899
+ * Returns the current status and results of a publish task.
900
+ * @summary Get publish task status
901
+ * @param {string} jobId Job ID
902
+ * @param {*} [options] Override http request option.
903
+ * @throws {RequiredError}
904
+ */
905
+ apiV1PublishJobsJobIdGet(jobId, options) {
906
+ return PublishApiFp(this.configuration).apiV1PublishJobsJobIdGet(jobId, options).then((request) => request(this.axios, this.basePath));
907
+ }
908
+ }
909
+ /**
910
+ * UsersApi - axios parameter creator
911
+ */
912
+ export const UsersApiAxiosParamCreator = function (configuration) {
913
+ return {
914
+ /**
915
+ * Creates a new user or retrieves an existing one for an organization. Idempotent by externalId.
916
+ * @summary Create or retrieve a user
917
+ * @param {HandlersCreateUserRequest} body Create user request
918
+ * @param {*} [options] Override http request option.
919
+ * @throws {RequiredError}
920
+ */
921
+ apiV1UsersPost: (body_1, ...args_1) => __awaiter(this, [body_1, ...args_1], void 0, function* (body, options = {}) {
922
+ // verify required parameter 'body' is not null or undefined
923
+ assertParamExists('apiV1UsersPost', 'body', body);
924
+ const localVarPath = `/api/v1/users`;
925
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
926
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
927
+ let baseOptions;
928
+ if (configuration) {
929
+ baseOptions = configuration.baseOptions;
930
+ }
931
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
932
+ const localVarHeaderParameter = {};
933
+ const localVarQueryParameter = {};
934
+ // authentication ApiKeyAuth required
935
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
936
+ localVarHeaderParameter['Content-Type'] = 'application/json';
937
+ localVarHeaderParameter['Accept'] = 'application/json';
938
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
939
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
940
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
941
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
942
+ return {
943
+ url: toPathString(localVarUrlObj),
944
+ options: localVarRequestOptions,
945
+ };
946
+ }),
947
+ /**
948
+ * Revokes access to a connected social media account.
949
+ * @summary Disconnect a social media account
950
+ * @param {string} userId User ID
951
+ * @param {string} accountId Account ID
952
+ * @param {*} [options] Override http request option.
953
+ * @throws {RequiredError}
954
+ */
955
+ apiV1UsersUserIdAccountsAccountIdDelete: (userId_1, accountId_1, ...args_1) => __awaiter(this, [userId_1, accountId_1, ...args_1], void 0, function* (userId, accountId, options = {}) {
956
+ // verify required parameter 'userId' is not null or undefined
957
+ assertParamExists('apiV1UsersUserIdAccountsAccountIdDelete', 'userId', userId);
958
+ // verify required parameter 'accountId' is not null or undefined
959
+ assertParamExists('apiV1UsersUserIdAccountsAccountIdDelete', 'accountId', accountId);
960
+ const localVarPath = `/api/v1/users/{userId}/accounts/{accountId}`
961
+ .replace(`{${"userId"}}`, encodeURIComponent(String(userId)))
962
+ .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId)));
963
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
964
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
965
+ let baseOptions;
966
+ if (configuration) {
967
+ baseOptions = configuration.baseOptions;
968
+ }
969
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
970
+ const localVarHeaderParameter = {};
971
+ const localVarQueryParameter = {};
972
+ // authentication ApiKeyAuth required
973
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
974
+ localVarHeaderParameter['Accept'] = 'application/json';
975
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
976
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
977
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
978
+ return {
979
+ url: toPathString(localVarUrlObj),
980
+ options: localVarRequestOptions,
981
+ };
982
+ }),
983
+ /**
984
+ * Returns all connected social media accounts for a specific user.
985
+ * @summary List social media accounts for a user
986
+ * @param {string} userId User ID
987
+ * @param {*} [options] Override http request option.
988
+ * @throws {RequiredError}
989
+ */
990
+ apiV1UsersUserIdAccountsGet: (userId_1, ...args_1) => __awaiter(this, [userId_1, ...args_1], void 0, function* (userId, options = {}) {
991
+ // verify required parameter 'userId' is not null or undefined
992
+ assertParamExists('apiV1UsersUserIdAccountsGet', 'userId', userId);
993
+ const localVarPath = `/api/v1/users/{userId}/accounts`
994
+ .replace(`{${"userId"}}`, encodeURIComponent(String(userId)));
995
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
996
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
997
+ let baseOptions;
998
+ if (configuration) {
999
+ baseOptions = configuration.baseOptions;
1000
+ }
1001
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
1002
+ const localVarHeaderParameter = {};
1003
+ const localVarQueryParameter = {};
1004
+ // authentication ApiKeyAuth required
1005
+ yield setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
1006
+ localVarHeaderParameter['Accept'] = 'application/json';
1007
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1008
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1009
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1010
+ return {
1011
+ url: toPathString(localVarUrlObj),
1012
+ options: localVarRequestOptions,
1013
+ };
1014
+ }),
1015
+ };
1016
+ };
1017
+ /**
1018
+ * UsersApi - functional programming interface
1019
+ */
1020
+ export const UsersApiFp = function (configuration) {
1021
+ const localVarAxiosParamCreator = UsersApiAxiosParamCreator(configuration);
1022
+ return {
1023
+ /**
1024
+ * Creates a new user or retrieves an existing one for an organization. Idempotent by externalId.
1025
+ * @summary Create or retrieve a user
1026
+ * @param {HandlersCreateUserRequest} body Create user request
1027
+ * @param {*} [options] Override http request option.
1028
+ * @throws {RequiredError}
1029
+ */
1030
+ apiV1UsersPost(body, options) {
1031
+ return __awaiter(this, void 0, void 0, function* () {
1032
+ var _a, _b, _c;
1033
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.apiV1UsersPost(body, options);
1034
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
1035
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['UsersApi.apiV1UsersPost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1036
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1037
+ });
1038
+ },
1039
+ /**
1040
+ * Revokes access to a connected social media account.
1041
+ * @summary Disconnect a social media account
1042
+ * @param {string} userId User ID
1043
+ * @param {string} accountId Account ID
1044
+ * @param {*} [options] Override http request option.
1045
+ * @throws {RequiredError}
1046
+ */
1047
+ apiV1UsersUserIdAccountsAccountIdDelete(userId, accountId, options) {
1048
+ return __awaiter(this, void 0, void 0, function* () {
1049
+ var _a, _b, _c;
1050
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.apiV1UsersUserIdAccountsAccountIdDelete(userId, accountId, options);
1051
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
1052
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['UsersApi.apiV1UsersUserIdAccountsAccountIdDelete']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1053
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1054
+ });
1055
+ },
1056
+ /**
1057
+ * Returns all connected social media accounts for a specific user.
1058
+ * @summary List social media accounts for a user
1059
+ * @param {string} userId User ID
1060
+ * @param {*} [options] Override http request option.
1061
+ * @throws {RequiredError}
1062
+ */
1063
+ apiV1UsersUserIdAccountsGet(userId, options) {
1064
+ return __awaiter(this, void 0, void 0, function* () {
1065
+ var _a, _b, _c;
1066
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.apiV1UsersUserIdAccountsGet(userId, options);
1067
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
1068
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['UsersApi.apiV1UsersUserIdAccountsGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1069
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1070
+ });
1071
+ },
1072
+ };
1073
+ };
1074
+ /**
1075
+ * UsersApi - factory interface
1076
+ */
1077
+ export const UsersApiFactory = function (configuration, basePath, axios) {
1078
+ const localVarFp = UsersApiFp(configuration);
1079
+ return {
1080
+ /**
1081
+ * Creates a new user or retrieves an existing one for an organization. Idempotent by externalId.
1082
+ * @summary Create or retrieve a user
1083
+ * @param {HandlersCreateUserRequest} body Create user request
1084
+ * @param {*} [options] Override http request option.
1085
+ * @throws {RequiredError}
1086
+ */
1087
+ apiV1UsersPost(body, options) {
1088
+ return localVarFp.apiV1UsersPost(body, options).then((request) => request(axios, basePath));
1089
+ },
1090
+ /**
1091
+ * Revokes access to a connected social media account.
1092
+ * @summary Disconnect a social media account
1093
+ * @param {string} userId User ID
1094
+ * @param {string} accountId Account ID
1095
+ * @param {*} [options] Override http request option.
1096
+ * @throws {RequiredError}
1097
+ */
1098
+ apiV1UsersUserIdAccountsAccountIdDelete(userId, accountId, options) {
1099
+ return localVarFp.apiV1UsersUserIdAccountsAccountIdDelete(userId, accountId, options).then((request) => request(axios, basePath));
1100
+ },
1101
+ /**
1102
+ * Returns all connected social media accounts for a specific user.
1103
+ * @summary List social media accounts for a user
1104
+ * @param {string} userId User ID
1105
+ * @param {*} [options] Override http request option.
1106
+ * @throws {RequiredError}
1107
+ */
1108
+ apiV1UsersUserIdAccountsGet(userId, options) {
1109
+ return localVarFp.apiV1UsersUserIdAccountsGet(userId, options).then((request) => request(axios, basePath));
1110
+ },
1111
+ };
1112
+ };
1113
+ /**
1114
+ * UsersApi - object-oriented interface
1115
+ */
1116
+ export class UsersApi extends BaseAPI {
1117
+ /**
1118
+ * Creates a new user or retrieves an existing one for an organization. Idempotent by externalId.
1119
+ * @summary Create or retrieve a user
1120
+ * @param {HandlersCreateUserRequest} body Create user request
1121
+ * @param {*} [options] Override http request option.
1122
+ * @throws {RequiredError}
1123
+ */
1124
+ apiV1UsersPost(body, options) {
1125
+ return UsersApiFp(this.configuration).apiV1UsersPost(body, options).then((request) => request(this.axios, this.basePath));
1126
+ }
1127
+ /**
1128
+ * Revokes access to a connected social media account.
1129
+ * @summary Disconnect a social media account
1130
+ * @param {string} userId User ID
1131
+ * @param {string} accountId Account ID
1132
+ * @param {*} [options] Override http request option.
1133
+ * @throws {RequiredError}
1134
+ */
1135
+ apiV1UsersUserIdAccountsAccountIdDelete(userId, accountId, options) {
1136
+ return UsersApiFp(this.configuration).apiV1UsersUserIdAccountsAccountIdDelete(userId, accountId, options).then((request) => request(this.axios, this.basePath));
1137
+ }
1138
+ /**
1139
+ * Returns all connected social media accounts for a specific user.
1140
+ * @summary List social media accounts for a user
1141
+ * @param {string} userId User ID
1142
+ * @param {*} [options] Override http request option.
1143
+ * @throws {RequiredError}
1144
+ */
1145
+ apiV1UsersUserIdAccountsGet(userId, options) {
1146
+ return UsersApiFp(this.configuration).apiV1UsersUserIdAccountsGet(userId, options).then((request) => request(this.axios, this.basePath));
1147
+ }
1148
+ }
1149
+ /**
1150
+ * WaitlistApi - axios parameter creator
1151
+ */
1152
+ export const WaitlistApiAxiosParamCreator = function (configuration) {
1153
+ return {
1154
+ /**
1155
+ * Add an email address to the waitlist for early access.
1156
+ * @summary Join the waitlist
1157
+ * @param {HandlersWaitlistRequest} body Waitlist signup
1158
+ * @param {*} [options] Override http request option.
1159
+ * @throws {RequiredError}
1160
+ */
1161
+ waitlistPost: (body_1, ...args_1) => __awaiter(this, [body_1, ...args_1], void 0, function* (body, options = {}) {
1162
+ // verify required parameter 'body' is not null or undefined
1163
+ assertParamExists('waitlistPost', 'body', body);
1164
+ const localVarPath = `/waitlist`;
1165
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1166
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1167
+ let baseOptions;
1168
+ if (configuration) {
1169
+ baseOptions = configuration.baseOptions;
1170
+ }
1171
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
1172
+ const localVarHeaderParameter = {};
1173
+ const localVarQueryParameter = {};
1174
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1175
+ localVarHeaderParameter['Accept'] = 'application/json';
1176
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1177
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1178
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1179
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration);
1180
+ return {
1181
+ url: toPathString(localVarUrlObj),
1182
+ options: localVarRequestOptions,
1183
+ };
1184
+ }),
1185
+ };
1186
+ };
1187
+ /**
1188
+ * WaitlistApi - functional programming interface
1189
+ */
1190
+ export const WaitlistApiFp = function (configuration) {
1191
+ const localVarAxiosParamCreator = WaitlistApiAxiosParamCreator(configuration);
1192
+ return {
1193
+ /**
1194
+ * Add an email address to the waitlist for early access.
1195
+ * @summary Join the waitlist
1196
+ * @param {HandlersWaitlistRequest} body Waitlist signup
1197
+ * @param {*} [options] Override http request option.
1198
+ * @throws {RequiredError}
1199
+ */
1200
+ waitlistPost(body, options) {
1201
+ return __awaiter(this, void 0, void 0, function* () {
1202
+ var _a, _b, _c;
1203
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.waitlistPost(body, options);
1204
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
1205
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['WaitlistApi.waitlistPost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1206
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1207
+ });
1208
+ },
1209
+ };
1210
+ };
1211
+ /**
1212
+ * WaitlistApi - factory interface
1213
+ */
1214
+ export const WaitlistApiFactory = function (configuration, basePath, axios) {
1215
+ const localVarFp = WaitlistApiFp(configuration);
1216
+ return {
1217
+ /**
1218
+ * Add an email address to the waitlist for early access.
1219
+ * @summary Join the waitlist
1220
+ * @param {HandlersWaitlistRequest} body Waitlist signup
1221
+ * @param {*} [options] Override http request option.
1222
+ * @throws {RequiredError}
1223
+ */
1224
+ waitlistPost(body, options) {
1225
+ return localVarFp.waitlistPost(body, options).then((request) => request(axios, basePath));
1226
+ },
1227
+ };
1228
+ };
1229
+ /**
1230
+ * WaitlistApi - object-oriented interface
1231
+ */
1232
+ export class WaitlistApi extends BaseAPI {
1233
+ /**
1234
+ * Add an email address to the waitlist for early access.
1235
+ * @summary Join the waitlist
1236
+ * @param {HandlersWaitlistRequest} body Waitlist signup
1237
+ * @param {*} [options] Override http request option.
1238
+ * @throws {RequiredError}
1239
+ */
1240
+ waitlistPost(body, options) {
1241
+ return WaitlistApiFp(this.configuration).waitlistPost(body, options).then((request) => request(this.axios, this.basePath));
1242
+ }
1243
+ }