postboost 1.7.0 → 1.8.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.
- package/README.md +1 -1
- package/api/aIApi.ts +2 -2
- package/api/accountsApi.ts +24 -4
- package/api/analyticsApi.ts +553 -0
- package/api/apis.ts +5 -1
- package/api/mediaApi.ts +381 -10
- package/api/mentionsApi.ts +507 -0
- package/api/postsApi.ts +182 -9
- package/api/receiptsApi.ts +2 -2
- package/api/subscriptionsApi.ts +10 -5
- package/api/tagsApi.ts +2 -2
- package/api/usersApi.ts +2 -2
- package/api/workspacesApi.ts +142 -3
- package/model/aICredits.ts +52 -0
- package/model/account.ts +35 -2
- package/model/accountAnalytics.ts +73 -0
- package/model/accountAnalyticsInitialSync.ts +37 -0
- package/model/accountSchedule.ts +49 -0
- package/model/addGenericSubscriptionRequest.ts +2 -2
- package/model/addPostToQueueRequest.ts +34 -0
- package/model/analyticsPeriod.ts +52 -0
- package/model/analyticsSummary.ts +39 -0
- package/model/analyticsSummaryData.ts +100 -0
- package/model/approvePostRequest.ts +62 -0
- package/model/bestPostingTimes.ts +41 -0
- package/model/bestPostingTimesTimesInner.ts +49 -0
- package/model/blogToSocial200Response.ts +2 -2
- package/model/blogToSocial429Response.ts +2 -2
- package/model/blogToSocialCaption.ts +2 -2
- package/model/blogToSocialInput.ts +2 -2
- package/model/blogToSocialMedia.ts +2 -2
- package/model/blogToSocialResponse.ts +2 -2
- package/model/cancelSubscription422Response.ts +38 -0
- package/model/cancelSubscription422ResponseErrors.ts +31 -0
- package/model/cancelSubscriptionRequest.ts +34 -0
- package/model/changeSubscriptionPlanRequest.ts +2 -2
- package/model/checkoutSubscription200Response.ts +2 -2
- package/model/checkoutSubscriptionRequest.ts +2 -2
- package/model/completeChunkedUploadRequest.ts +40 -0
- package/model/createMediaFolderRequest.ts +43 -0
- package/model/createMention201Response.ts +32 -0
- package/model/deleteMediaBulkRequest.ts +6 -5
- package/model/deleteMediaBulkRequestItemsInner.ts +26 -0
- package/model/deleteMediaFolderRequest.ts +31 -0
- package/model/deleteMode.ts +2 -2
- package/model/deletePostRequest.ts +2 -2
- package/model/deletePostsBulkRequest.ts +2 -2
- package/model/deleteReceiptsBulkRequest.ts +2 -2
- package/model/deleteResult.ts +2 -2
- package/model/deleteUser400Response.ts +2 -2
- package/model/deleteUsersBulkRequest.ts +2 -2
- package/model/deleteWorkspacesBulkRequest.ts +2 -2
- package/model/getRemoteUploadStatus200Response.ts +2 -2
- package/model/imageAltText200Response.ts +2 -2
- package/model/imageAltTextInput.ts +2 -2
- package/model/imageAltTextResponse.ts +2 -2
- package/model/imageEditInput.ts +2 -2
- package/model/imageGenerate200Response.ts +2 -2
- package/model/imageGenerate429Response.ts +2 -2
- package/model/imageGenerateInput.ts +2 -2
- package/model/imageGenerationResponse.ts +2 -2
- package/model/imagePrompt200Response.ts +2 -2
- package/model/imagePrompt429Response.ts +2 -2
- package/model/imagePromptInput.ts +2 -2
- package/model/imagePromptResponse.ts +2 -2
- package/model/imageVariations200Response.ts +2 -2
- package/model/imageVariationsInput.ts +2 -2
- package/model/imageVariationsResponse.ts +2 -2
- package/model/initiateChunkedUpload201Response.ts +2 -2
- package/model/initiateChunkedUploadRequest.ts +2 -2
- package/model/initiateRemoteUpload201Response.ts +60 -2
- package/model/initiateRemoteUpload201ResponseOneOf.ts +2 -2
- package/model/initiateRemoteUploadRequest.ts +11 -2
- package/model/listAccounts200Response.ts +2 -2
- package/model/listMedia200Response.ts +2 -2
- package/model/listMediaFolders200Response.ts +32 -0
- package/model/listMentions200Response.ts +46 -0
- package/model/listMyWorkspaces200Response.ts +32 -0
- package/model/listPosts200Response.ts +2 -2
- package/model/listReceipts200Response.ts +2 -2
- package/model/listTags200Response.ts +2 -2
- package/model/listUsers200Response.ts +2 -2
- package/model/listWorkspaces200Response.ts +2 -2
- package/model/media.ts +60 -2
- package/model/mediaFolder.ts +55 -0
- package/model/mediaFolderInput.ts +43 -0
- package/model/mediaFolderRef.ts +37 -0
- package/model/mention.ts +65 -0
- package/model/mentionIdentity.ts +55 -0
- package/model/mentionIdentityInput.ts +67 -0
- package/model/mentionInput.ts +44 -0
- package/model/models.ts +125 -0
- package/model/paginationMeta.ts +2 -2
- package/model/paginationMetaLinks.ts +2 -2
- package/model/paginationMetaMeta.ts +2 -2
- package/model/post.ts +12 -2
- package/model/postAnalytics.ts +46 -0
- package/model/postContent.ts +2 -2
- package/model/postInput.ts +15 -2
- package/model/postStatus.ts +9 -3
- package/model/postVersion.ts +11 -2
- package/model/postingTimeSlot.ts +51 -0
- package/model/postingTimes.ts +88 -0
- package/model/postingTimesBestInner.ts +49 -0
- package/model/postingTimesDayIntervalsInnerInner.ts +69 -0
- package/model/postingTimesDaysInner.ts +57 -0
- package/model/publicWorkspace.ts +50 -0
- package/model/publicWorkspacePivot.ts +53 -0
- package/model/publishProgress.ts +46 -0
- package/model/receipt.ts +2 -2
- package/model/receiptInput.ts +2 -2
- package/model/receiptUpdateInput.ts +2 -2
- package/model/removeGenericSubscription422Response.ts +31 -0
- package/model/removeUserFromWorkspaceRequest.ts +2 -2
- package/model/retryPostAccountResult.ts +47 -0
- package/model/schedulePostRequest.ts +39 -2
- package/model/scheduleResult.ts +11 -2
- package/model/subscription.ts +2 -2
- package/model/subscriptionInput.ts +2 -2
- package/model/subscriptionStatus.ts +2 -2
- package/model/subscriptionUpdateInput.ts +2 -2
- package/model/tag.ts +2 -2
- package/model/tagInput.ts +2 -2
- package/model/updateMediaRequest.ts +18 -3
- package/model/uploadChunk201Response.ts +2 -2
- package/model/user.ts +11 -2
- package/model/userInput.ts +2 -2
- package/model/userUpdateInput.ts +2 -2
- package/model/workspace.ts +17 -3
- package/model/workspaceInput.ts +8 -3
- package/model/workspaceUserInput.ts +2 -2
- package/package.json +1 -1
package/api/mediaApi.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* PostBoost API
|
|
3
|
-
* The PostBoost REST API lets you publish, schedule, and analyze social media posts across 12+ platforms from a single integration. No OAuth apps to maintain — PostBoost handles platform authorization for you. ## Base URL All workspace-scoped endpoints are prefixed with `/{workspaceUuid}`. Panel/admin endpoints are prefixed with `/panel`. ## Authentication All requests require a Bearer token in the `Authorization` header. Generate tokens in your PostBoost dashboard under **Settings → Access Tokens**. ``` Authorization: Bearer YOUR_API_TOKEN ```
|
|
3
|
+
* The PostBoost REST API lets you publish, schedule, and analyze social media posts across 12+ platforms from a single integration. No OAuth apps to maintain — PostBoost handles platform authorization for you. ## Base URL All workspace-scoped endpoints are prefixed with `/{workspaceUuid}`. Panel/admin endpoints are prefixed with `/panel`. ## Plan access Every workspace-scoped endpoint returns `403` when the workspace\'s plan does not include API access (capability `api`). ## Dates and times Post dates and times (`date`, `time`, `accounts_schedule`) are read in the request\'s `timezone` when one is given, otherwise in the workspace timezone. ## Authentication All requests require a Bearer token in the `Authorization` header. Generate tokens in your PostBoost dashboard under **Settings → Access Tokens**. ``` Authorization: Bearer YOUR_API_TOKEN ```
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.
|
|
5
|
+
* The version of the OpenAPI document: 1.8.0
|
|
6
6
|
* Contact: hi@postboost.co
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -15,14 +15,20 @@ import localVarRequest from 'request';
|
|
|
15
15
|
import http from 'http';
|
|
16
16
|
|
|
17
17
|
/* tslint:disable:no-unused-locals */
|
|
18
|
+
import { CompleteChunkedUploadRequest } from '../model/completeChunkedUploadRequest';
|
|
19
|
+
import { CreateMediaFolderRequest } from '../model/createMediaFolderRequest';
|
|
18
20
|
import { DeleteMediaBulkRequest } from '../model/deleteMediaBulkRequest';
|
|
21
|
+
import { DeleteMediaFolderRequest } from '../model/deleteMediaFolderRequest';
|
|
19
22
|
import { GetRemoteUploadStatus200Response } from '../model/getRemoteUploadStatus200Response';
|
|
20
23
|
import { InitiateChunkedUpload201Response } from '../model/initiateChunkedUpload201Response';
|
|
21
24
|
import { InitiateChunkedUploadRequest } from '../model/initiateChunkedUploadRequest';
|
|
22
25
|
import { InitiateRemoteUpload201Response } from '../model/initiateRemoteUpload201Response';
|
|
23
26
|
import { InitiateRemoteUploadRequest } from '../model/initiateRemoteUploadRequest';
|
|
24
27
|
import { ListMedia200Response } from '../model/listMedia200Response';
|
|
28
|
+
import { ListMediaFolders200Response } from '../model/listMediaFolders200Response';
|
|
25
29
|
import { Media } from '../model/media';
|
|
30
|
+
import { MediaFolder } from '../model/mediaFolder';
|
|
31
|
+
import { MediaFolderInput } from '../model/mediaFolderInput';
|
|
26
32
|
import { UpdateMediaRequest } from '../model/updateMediaRequest';
|
|
27
33
|
import { UploadChunk201Response } from '../model/uploadChunk201Response';
|
|
28
34
|
|
|
@@ -180,12 +186,13 @@ export class MediaApi {
|
|
|
180
186
|
});
|
|
181
187
|
}
|
|
182
188
|
/**
|
|
183
|
-
* Signal that all chunks have been uploaded. Returns the final media object.
|
|
189
|
+
* Signal that all chunks have been uploaded. Returns the final media object. A video may come back with `is_processing` set to `true` while its conversion runs.
|
|
184
190
|
* @summary Complete chunked upload
|
|
185
191
|
* @param workspaceUuid UUID of the workspace.
|
|
186
192
|
* @param uploadUuid
|
|
193
|
+
* @param completeChunkedUploadRequest
|
|
187
194
|
*/
|
|
188
|
-
public async completeChunkedUpload (workspaceUuid: string, uploadUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Media; }> {
|
|
195
|
+
public async completeChunkedUpload (workspaceUuid: string, uploadUuid: string, completeChunkedUploadRequest?: CompleteChunkedUploadRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Media; }> {
|
|
189
196
|
const localVarPath = this.basePath + '/{workspaceUuid}/media/chunked/{uploadUuid}/complete'
|
|
190
197
|
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
|
|
191
198
|
.replace('{' + 'uploadUuid' + '}', encodeURIComponent(String(uploadUuid)));
|
|
@@ -221,6 +228,7 @@ export class MediaApi {
|
|
|
221
228
|
uri: localVarPath,
|
|
222
229
|
useQuerystring: this._useQuerystring,
|
|
223
230
|
json: true,
|
|
231
|
+
body: ObjectSerializer.serialize(completeChunkedUploadRequest, "CompleteChunkedUploadRequest")
|
|
224
232
|
};
|
|
225
233
|
|
|
226
234
|
let authenticationPromise = Promise.resolve();
|
|
@@ -259,7 +267,86 @@ export class MediaApi {
|
|
|
259
267
|
});
|
|
260
268
|
}
|
|
261
269
|
/**
|
|
262
|
-
*
|
|
270
|
+
* Creates a folder at the top level or under `parent`. The name must be unique among its siblings.
|
|
271
|
+
* @summary Create media folder
|
|
272
|
+
* @param workspaceUuid UUID of the workspace.
|
|
273
|
+
* @param createMediaFolderRequest
|
|
274
|
+
*/
|
|
275
|
+
public async createMediaFolder (workspaceUuid: string, createMediaFolderRequest: CreateMediaFolderRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MediaFolder; }> {
|
|
276
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/media/folders'
|
|
277
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
278
|
+
let localVarQueryParameters: any = {};
|
|
279
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
280
|
+
const produces = ['application/json'];
|
|
281
|
+
// give precedence to 'application/json'
|
|
282
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
283
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
284
|
+
} else {
|
|
285
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
286
|
+
}
|
|
287
|
+
let localVarFormParams: any = {};
|
|
288
|
+
|
|
289
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
290
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
291
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling createMediaFolder.');
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// verify required parameter 'createMediaFolderRequest' is not null or undefined
|
|
295
|
+
if (createMediaFolderRequest === null || createMediaFolderRequest === undefined) {
|
|
296
|
+
throw new Error('Required parameter createMediaFolderRequest was null or undefined when calling createMediaFolder.');
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
300
|
+
|
|
301
|
+
let localVarUseFormData = false;
|
|
302
|
+
|
|
303
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
304
|
+
method: 'POST',
|
|
305
|
+
qs: localVarQueryParameters,
|
|
306
|
+
headers: localVarHeaderParams,
|
|
307
|
+
uri: localVarPath,
|
|
308
|
+
useQuerystring: this._useQuerystring,
|
|
309
|
+
json: true,
|
|
310
|
+
body: ObjectSerializer.serialize(createMediaFolderRequest, "CreateMediaFolderRequest")
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
let authenticationPromise = Promise.resolve();
|
|
314
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
315
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
316
|
+
}
|
|
317
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
318
|
+
|
|
319
|
+
let interceptorPromise = authenticationPromise;
|
|
320
|
+
for (const interceptor of this.interceptors) {
|
|
321
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return interceptorPromise.then(() => {
|
|
325
|
+
if (Object.keys(localVarFormParams).length) {
|
|
326
|
+
if (localVarUseFormData) {
|
|
327
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
328
|
+
} else {
|
|
329
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
return new Promise<{ response: http.IncomingMessage; body: MediaFolder; }>((resolve, reject) => {
|
|
333
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
334
|
+
if (error) {
|
|
335
|
+
reject(error);
|
|
336
|
+
} else {
|
|
337
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
338
|
+
body = ObjectSerializer.deserialize(body, "MediaFolder");
|
|
339
|
+
resolve({ response: response, body: body });
|
|
340
|
+
} else {
|
|
341
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Delete one or more media items by their numeric IDs or UUIDs (both may be mixed, up to 500 per request).
|
|
263
350
|
* @summary Delete media (bulk)
|
|
264
351
|
* @param workspaceUuid UUID of the workspace.
|
|
265
352
|
* @param deleteMediaBulkRequest
|
|
@@ -337,6 +424,87 @@ export class MediaApi {
|
|
|
337
424
|
});
|
|
338
425
|
});
|
|
339
426
|
}
|
|
427
|
+
/**
|
|
428
|
+
* Deletes a folder. By default its media and sub-folders move up to the folder\'s parent; with `delete_media` set to true every media item below the folder is deleted as well.
|
|
429
|
+
* @summary Delete media folder
|
|
430
|
+
* @param workspaceUuid UUID of the workspace.
|
|
431
|
+
* @param folderUuid UUID of the media folder.
|
|
432
|
+
* @param deleteMediaFolderRequest
|
|
433
|
+
*/
|
|
434
|
+
public async deleteMediaFolder (workspaceUuid: string, folderUuid: string, deleteMediaFolderRequest?: DeleteMediaFolderRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
435
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/media/folders/{folderUuid}'
|
|
436
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
|
|
437
|
+
.replace('{' + 'folderUuid' + '}', encodeURIComponent(String(folderUuid)));
|
|
438
|
+
let localVarQueryParameters: any = {};
|
|
439
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
440
|
+
const produces = ['application/json'];
|
|
441
|
+
// give precedence to 'application/json'
|
|
442
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
443
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
444
|
+
} else {
|
|
445
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
446
|
+
}
|
|
447
|
+
let localVarFormParams: any = {};
|
|
448
|
+
|
|
449
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
450
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
451
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling deleteMediaFolder.');
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// verify required parameter 'folderUuid' is not null or undefined
|
|
455
|
+
if (folderUuid === null || folderUuid === undefined) {
|
|
456
|
+
throw new Error('Required parameter folderUuid was null or undefined when calling deleteMediaFolder.');
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
460
|
+
|
|
461
|
+
let localVarUseFormData = false;
|
|
462
|
+
|
|
463
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
464
|
+
method: 'DELETE',
|
|
465
|
+
qs: localVarQueryParameters,
|
|
466
|
+
headers: localVarHeaderParams,
|
|
467
|
+
uri: localVarPath,
|
|
468
|
+
useQuerystring: this._useQuerystring,
|
|
469
|
+
json: true,
|
|
470
|
+
body: ObjectSerializer.serialize(deleteMediaFolderRequest, "DeleteMediaFolderRequest")
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
let authenticationPromise = Promise.resolve();
|
|
474
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
475
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
476
|
+
}
|
|
477
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
478
|
+
|
|
479
|
+
let interceptorPromise = authenticationPromise;
|
|
480
|
+
for (const interceptor of this.interceptors) {
|
|
481
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
return interceptorPromise.then(() => {
|
|
485
|
+
if (Object.keys(localVarFormParams).length) {
|
|
486
|
+
if (localVarUseFormData) {
|
|
487
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
488
|
+
} else {
|
|
489
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
493
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
494
|
+
if (error) {
|
|
495
|
+
reject(error);
|
|
496
|
+
} else {
|
|
497
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
498
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
499
|
+
resolve({ response: response, body: body });
|
|
500
|
+
} else {
|
|
501
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
});
|
|
506
|
+
});
|
|
507
|
+
}
|
|
340
508
|
/**
|
|
341
509
|
* Returns a single media asset.
|
|
342
510
|
* @summary Get media
|
|
@@ -654,12 +822,20 @@ export class MediaApi {
|
|
|
654
822
|
});
|
|
655
823
|
}
|
|
656
824
|
/**
|
|
657
|
-
* Returns a paginated list of media assets in the workspace library.
|
|
825
|
+
* Returns a paginated list of media assets in the workspace library. Without `folder` every item is listed, whatever folder it is filed in. A `keyword` search always looks at the whole library and ignores `folder` and `favorite`.
|
|
658
826
|
* @summary List media
|
|
659
827
|
* @param workspaceUuid UUID of the workspace.
|
|
660
|
-
* @param page Page number
|
|
828
|
+
* @param page Page number.
|
|
829
|
+
* @param limit Items per page. Values below 1 fall back to 50; values above 100 are capped at 100.
|
|
830
|
+
* @param folder Media folder UUID, or `root` for items not filed in any folder.
|
|
831
|
+
* @param mimeTypes Only these MIME types (for example `image/png`).
|
|
832
|
+
* @param type Only this media type.
|
|
833
|
+
* @param keyword Search media by name.
|
|
834
|
+
* @param usage Filter by how the media is used in posts.
|
|
835
|
+
* @param favorite When `true`, only media the caller marked as favorite.
|
|
836
|
+
* @param sort
|
|
661
837
|
*/
|
|
662
|
-
public async listMedia (workspaceUuid: string, page?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListMedia200Response; }> {
|
|
838
|
+
public async listMedia (workspaceUuid: string, page?: number, limit?: number, folder?: string, mimeTypes?: Array<string>, type?: 'image' | 'gif' | 'video', keyword?: string, usage?: 'unused' | 'draft' | 'scheduled' | 'published', favorite?: boolean, sort?: 'newest' | 'oldest' | 'name' | 'size', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListMedia200Response; }> {
|
|
663
839
|
const localVarPath = this.basePath + '/{workspaceUuid}/media'
|
|
664
840
|
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
665
841
|
let localVarQueryParameters: any = {};
|
|
@@ -682,6 +858,38 @@ export class MediaApi {
|
|
|
682
858
|
localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number");
|
|
683
859
|
}
|
|
684
860
|
|
|
861
|
+
if (limit !== undefined) {
|
|
862
|
+
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
if (folder !== undefined) {
|
|
866
|
+
localVarQueryParameters['folder'] = ObjectSerializer.serialize(folder, "string");
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
if (mimeTypes !== undefined) {
|
|
870
|
+
localVarQueryParameters['mime_types[]'] = ObjectSerializer.serialize(mimeTypes, "Array<string>");
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
if (type !== undefined) {
|
|
874
|
+
localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "'image' | 'gif' | 'video'");
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
if (keyword !== undefined) {
|
|
878
|
+
localVarQueryParameters['keyword'] = ObjectSerializer.serialize(keyword, "string");
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
if (usage !== undefined) {
|
|
882
|
+
localVarQueryParameters['usage'] = ObjectSerializer.serialize(usage, "'unused' | 'draft' | 'scheduled' | 'published'");
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
if (favorite !== undefined) {
|
|
886
|
+
localVarQueryParameters['favorite'] = ObjectSerializer.serialize(favorite, "boolean");
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
if (sort !== undefined) {
|
|
890
|
+
localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'newest' | 'oldest' | 'name' | 'size'");
|
|
891
|
+
}
|
|
892
|
+
|
|
685
893
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
686
894
|
|
|
687
895
|
let localVarUseFormData = false;
|
|
@@ -731,7 +939,79 @@ export class MediaApi {
|
|
|
731
939
|
});
|
|
732
940
|
}
|
|
733
941
|
/**
|
|
734
|
-
*
|
|
942
|
+
* Returns the whole folder tree of the media library in one response (not paginated). Rebuild the tree from each folder\'s `parent`.
|
|
943
|
+
* @summary List media folders
|
|
944
|
+
* @param workspaceUuid UUID of the workspace.
|
|
945
|
+
*/
|
|
946
|
+
public async listMediaFolders (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListMediaFolders200Response; }> {
|
|
947
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/media/folders'
|
|
948
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
949
|
+
let localVarQueryParameters: any = {};
|
|
950
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
951
|
+
const produces = ['application/json'];
|
|
952
|
+
// give precedence to 'application/json'
|
|
953
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
954
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
955
|
+
} else {
|
|
956
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
957
|
+
}
|
|
958
|
+
let localVarFormParams: any = {};
|
|
959
|
+
|
|
960
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
961
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
962
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling listMediaFolders.');
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
966
|
+
|
|
967
|
+
let localVarUseFormData = false;
|
|
968
|
+
|
|
969
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
970
|
+
method: 'GET',
|
|
971
|
+
qs: localVarQueryParameters,
|
|
972
|
+
headers: localVarHeaderParams,
|
|
973
|
+
uri: localVarPath,
|
|
974
|
+
useQuerystring: this._useQuerystring,
|
|
975
|
+
json: true,
|
|
976
|
+
};
|
|
977
|
+
|
|
978
|
+
let authenticationPromise = Promise.resolve();
|
|
979
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
980
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
981
|
+
}
|
|
982
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
983
|
+
|
|
984
|
+
let interceptorPromise = authenticationPromise;
|
|
985
|
+
for (const interceptor of this.interceptors) {
|
|
986
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
return interceptorPromise.then(() => {
|
|
990
|
+
if (Object.keys(localVarFormParams).length) {
|
|
991
|
+
if (localVarUseFormData) {
|
|
992
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
993
|
+
} else {
|
|
994
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
return new Promise<{ response: http.IncomingMessage; body: ListMediaFolders200Response; }>((resolve, reject) => {
|
|
998
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
999
|
+
if (error) {
|
|
1000
|
+
reject(error);
|
|
1001
|
+
} else {
|
|
1002
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1003
|
+
body = ObjectSerializer.deserialize(body, "ListMediaFolders200Response");
|
|
1004
|
+
resolve({ response: response, body: body });
|
|
1005
|
+
} else {
|
|
1006
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
});
|
|
1010
|
+
});
|
|
1011
|
+
});
|
|
1012
|
+
}
|
|
1013
|
+
/**
|
|
1014
|
+
* Update the name, alt text, or folder of a media asset. Only the keys present in the body are written. Sending `folder: null` moves the item to the library root; omitting `folder` leaves it where it is.
|
|
735
1015
|
* @summary Update media
|
|
736
1016
|
* @param workspaceUuid UUID of the workspace.
|
|
737
1017
|
* @param mediaUuid UUID of the media asset.
|
|
@@ -816,6 +1096,92 @@ export class MediaApi {
|
|
|
816
1096
|
});
|
|
817
1097
|
});
|
|
818
1098
|
}
|
|
1099
|
+
/**
|
|
1100
|
+
* Renames a folder and/or moves it. Sending `parent` moves the folder (null = top level); omitting it keeps the current parent. A folder cannot be moved into itself or one of its descendants.
|
|
1101
|
+
* @summary Update media folder
|
|
1102
|
+
* @param workspaceUuid UUID of the workspace.
|
|
1103
|
+
* @param folderUuid UUID of the media folder.
|
|
1104
|
+
* @param mediaFolderInput
|
|
1105
|
+
*/
|
|
1106
|
+
public async updateMediaFolder (workspaceUuid: string, folderUuid: string, mediaFolderInput: MediaFolderInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MediaFolder; }> {
|
|
1107
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/media/folders/{folderUuid}'
|
|
1108
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
|
|
1109
|
+
.replace('{' + 'folderUuid' + '}', encodeURIComponent(String(folderUuid)));
|
|
1110
|
+
let localVarQueryParameters: any = {};
|
|
1111
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1112
|
+
const produces = ['application/json'];
|
|
1113
|
+
// give precedence to 'application/json'
|
|
1114
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1115
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1116
|
+
} else {
|
|
1117
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1118
|
+
}
|
|
1119
|
+
let localVarFormParams: any = {};
|
|
1120
|
+
|
|
1121
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
1122
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
1123
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling updateMediaFolder.');
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
// verify required parameter 'folderUuid' is not null or undefined
|
|
1127
|
+
if (folderUuid === null || folderUuid === undefined) {
|
|
1128
|
+
throw new Error('Required parameter folderUuid was null or undefined when calling updateMediaFolder.');
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
// verify required parameter 'mediaFolderInput' is not null or undefined
|
|
1132
|
+
if (mediaFolderInput === null || mediaFolderInput === undefined) {
|
|
1133
|
+
throw new Error('Required parameter mediaFolderInput was null or undefined when calling updateMediaFolder.');
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1137
|
+
|
|
1138
|
+
let localVarUseFormData = false;
|
|
1139
|
+
|
|
1140
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1141
|
+
method: 'PUT',
|
|
1142
|
+
qs: localVarQueryParameters,
|
|
1143
|
+
headers: localVarHeaderParams,
|
|
1144
|
+
uri: localVarPath,
|
|
1145
|
+
useQuerystring: this._useQuerystring,
|
|
1146
|
+
json: true,
|
|
1147
|
+
body: ObjectSerializer.serialize(mediaFolderInput, "MediaFolderInput")
|
|
1148
|
+
};
|
|
1149
|
+
|
|
1150
|
+
let authenticationPromise = Promise.resolve();
|
|
1151
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
1152
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
1153
|
+
}
|
|
1154
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1155
|
+
|
|
1156
|
+
let interceptorPromise = authenticationPromise;
|
|
1157
|
+
for (const interceptor of this.interceptors) {
|
|
1158
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
return interceptorPromise.then(() => {
|
|
1162
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1163
|
+
if (localVarUseFormData) {
|
|
1164
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1165
|
+
} else {
|
|
1166
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
return new Promise<{ response: http.IncomingMessage; body: MediaFolder; }>((resolve, reject) => {
|
|
1170
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1171
|
+
if (error) {
|
|
1172
|
+
reject(error);
|
|
1173
|
+
} else {
|
|
1174
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1175
|
+
body = ObjectSerializer.deserialize(body, "MediaFolder");
|
|
1176
|
+
resolve({ response: response, body: body });
|
|
1177
|
+
} else {
|
|
1178
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
});
|
|
1182
|
+
});
|
|
1183
|
+
});
|
|
1184
|
+
}
|
|
819
1185
|
/**
|
|
820
1186
|
* Upload a single chunk of a chunked upload session.
|
|
821
1187
|
* @summary Upload a chunk
|
|
@@ -922,8 +1288,9 @@ export class MediaApi {
|
|
|
922
1288
|
* @param workspaceUuid UUID of the workspace.
|
|
923
1289
|
* @param file The file to upload.
|
|
924
1290
|
* @param altText Alternative text for accessibility.
|
|
1291
|
+
* @param folder UUID of the media folder to file the upload in. Omit or null for the library root.
|
|
925
1292
|
*/
|
|
926
|
-
public async uploadMedia (workspaceUuid: string, file: RequestFile, altText?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Media; }> {
|
|
1293
|
+
public async uploadMedia (workspaceUuid: string, file: RequestFile, altText?: string, folder?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Media; }> {
|
|
927
1294
|
const localVarPath = this.basePath + '/{workspaceUuid}/media'
|
|
928
1295
|
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
929
1296
|
let localVarQueryParameters: any = {};
|
|
@@ -960,6 +1327,10 @@ export class MediaApi {
|
|
|
960
1327
|
localVarFormParams['alt_text'] = ObjectSerializer.serialize(altText, "string");
|
|
961
1328
|
}
|
|
962
1329
|
|
|
1330
|
+
if (folder !== undefined) {
|
|
1331
|
+
localVarFormParams['folder'] = ObjectSerializer.serialize(folder, "string");
|
|
1332
|
+
}
|
|
1333
|
+
|
|
963
1334
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
964
1335
|
method: 'POST',
|
|
965
1336
|
qs: localVarQueryParameters,
|