postboost 1.7.0 → 1.14.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/.github/ISSUE_TEMPLATE/bug_report.yml +26 -0
- package/.github/ISSUE_TEMPLATE/config.yml +11 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +14 -0
- package/.github/pull_request_template.md +6 -0
- package/CODE_OF_CONDUCT.md +7 -0
- package/CONTRIBUTING.md +31 -0
- package/README.md +46 -2
- package/SECURITY.md +9 -0
- package/api/aIApi.ts +460 -2
- package/api/accountGroupsApi.ts +501 -0
- package/api/accountsApi.ts +266 -4
- package/api/activityApi.ts +188 -0
- package/api/agentsApi.ts +918 -0
- package/api/analyticsApi.ts +1102 -0
- package/api/apis.ts +23 -1
- package/api/competitorsApi.ts +412 -0
- package/api/hashtagGroupsApi.ts +501 -0
- package/api/inboxApi.ts +957 -0
- package/api/mediaApi.ts +474 -13
- package/api/mentionsApi.ts +509 -0
- package/api/postingScheduleApi.ts +497 -0
- package/api/postsApi.ts +1375 -65
- package/api/receiptsApi.ts +2 -2
- package/api/subscriptionsApi.ts +10 -5
- package/api/tagsApi.ts +5 -3
- package/api/templatesApi.ts +501 -0
- package/api/usersApi.ts +2 -2
- package/api/webhooksApi.ts +327 -0
- package/api/workspacesApi.ts +603 -3
- package/model/aICredits.ts +52 -0
- package/model/aIUsage.ts +39 -0
- package/model/aIUsageText.ts +52 -0
- package/model/account.ts +59 -4
- package/model/accountAnalytics.ts +73 -0
- package/model/accountAnalyticsInitialSync.ts +37 -0
- package/model/accountConnectionHealth.ts +124 -0
- package/model/accountErrorsInner.ts +50 -0
- package/model/accountErrorsInnerOneOf.ts +49 -0
- package/model/accountGroup.ts +49 -0
- package/model/accountGroupInput.ts +40 -0
- package/model/accountHealth.ts +90 -0
- package/model/accountHealthDailyCap.ts +43 -0
- package/model/accountSchedule.ts +49 -0
- package/model/addCompetitor202Response.ts +43 -0
- package/model/addCompetitor409Response.ts +37 -0
- package/model/addGenericSubscriptionRequest.ts +2 -2
- package/model/addPostToQueueRequest.ts +34 -0
- package/model/agentPageMeta.ts +49 -0
- package/model/agentProposal.ts +137 -0
- package/model/agentProposalDecision.ts +31 -0
- package/model/agentRun.ts +129 -0
- package/model/analyticsPeriod.ts +52 -0
- package/model/analyticsSummary.ts +39 -0
- package/model/analyticsSummaryData.ts +100 -0
- package/model/apiActivity.ts +94 -0
- package/model/apiActivityOutcome.ts +27 -0
- package/model/apiKey.ts +77 -0
- package/model/apiKeyAbility.ts +21 -0
- package/model/apiKeyInput.ts +56 -0
- package/model/approveAgentProposal200Response.ts +32 -0
- package/model/approveAgentProposal409Response.ts +38 -0
- package/model/approveInboxReplyDraft403Response.ts +43 -0
- package/model/approvePostRequest.ts +62 -0
- package/model/bestPostingTimes.ts +41 -0
- package/model/bestPostingTimesTimesInner.ts +49 -0
- package/model/blogToSocial200Response.ts +9 -2
- package/model/blogToSocial429Response.ts +2 -2
- package/model/blogToSocialCaption.ts +2 -2
- package/model/blogToSocialInput.ts +11 -2
- package/model/blogToSocialMedia.ts +2 -2
- package/model/blogToSocialResponse.ts +2 -2
- package/model/brandVoice.ts +136 -0
- package/model/brandVoiceInput.ts +142 -0
- package/model/brandVoiceMeta.ts +34 -0
- 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/channelAccount.ts +101 -0
- package/model/checkoutSubscription200Response.ts +2 -2
- package/model/checkoutSubscriptionRequest.ts +2 -2
- package/model/codedError.ts +46 -0
- package/model/competitor.ts +82 -0
- package/model/competitorDetail.ts +96 -0
- package/model/competitorInput.ts +43 -0
- package/model/competitorMedia.ts +61 -0
- package/model/competitorSnapshot.ts +43 -0
- package/model/completeChunkedUploadRequest.ts +40 -0
- package/model/connectChannelInput.ts +64 -0
- package/model/createAccountGroup201Response.ts +32 -0
- package/model/createAgent201Response.ts +32 -0
- package/model/createApiKey201Response.ts +32 -0
- package/model/createApiKey201ResponseData.ts +86 -0
- package/model/createHashtagGroup201Response.ts +32 -0
- package/model/createInboxReplyDraft201Response.ts +32 -0
- package/model/createMediaFolderRequest.ts +43 -0
- package/model/createMention201Response.ts +32 -0
- package/model/createRecyclingRule201Response.ts +32 -0
- package/model/createReportExport201Response.ts +32 -0
- package/model/createResellerClient201Response.ts +32 -0
- package/model/createRssFeed201Response.ts +32 -0
- package/model/createTemplate201Response.ts +32 -0
- package/model/createWebhookSubscription201Response.ts +32 -0
- package/model/createWebhookSubscription201ResponseData.ts +70 -0
- package/model/deleteAgent200Response.ts +31 -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/getAccountHealth200Response.ts +32 -0
- package/model/getBrandVoice200Response.ts +32 -0
- package/model/getCompetitor200Response.ts +32 -0
- package/model/getInboxConversation200Response.ts +32 -0
- package/model/getPostingSchedule200Response.ts +32 -0
- package/model/getRemoteUploadStatus200Response.ts +2 -2
- package/model/getReportBranding200Response.ts +32 -0
- package/model/guardrailError.ts +82 -0
- package/model/hashtagGroup.ts +46 -0
- package/model/hashtagGroupInput.ts +37 -0
- package/model/imageAltText200Response.ts +2 -2
- package/model/imageAltTextInput.ts +2 -2
- package/model/imageAltTextResponse.ts +2 -2
- package/model/imageCreditBalance.ts +67 -0
- package/model/imageEditInput.ts +11 -2
- package/model/imageGenerate200Response.ts +9 -2
- package/model/imageGenerate429Response.ts +2 -2
- package/model/imageGenerateInput.ts +14 -2
- package/model/imageGenerationResponse.ts +2 -2
- package/model/imagePrompt200Response.ts +9 -2
- package/model/imagePrompt429Response.ts +2 -2
- package/model/imagePromptInput.ts +14 -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/inboxAuthor.ts +43 -0
- package/model/inboxConversation.ts +139 -0
- package/model/inboxConversationAccount.ts +49 -0
- package/model/inboxConversationUpdate.ts +43 -0
- package/model/inboxMessage.ts +95 -0
- package/model/inboxMessageAuthor.ts +43 -0
- package/model/inboxReplyDraft.ts +132 -0
- package/model/inboxReplyDraftApprove.ts +34 -0
- package/model/inboxReplyDraftEdit.ts +31 -0
- package/model/inboxReplyDraftInput.ts +43 -0
- 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/learnBrandVoiceInput.ts +61 -0
- package/model/learnBrandVoiceResponse.ts +39 -0
- package/model/learnBrandVoiceResponseMeta.ts +55 -0
- package/model/listAccountGroups200Response.ts +46 -0
- package/model/listAccounts200Response.ts +2 -2
- package/model/listAgentProposals200Response.ts +39 -0
- package/model/listAgentRuns200Response.ts +39 -0
- package/model/listAgents200Response.ts +32 -0
- package/model/listApiActivity200Response.ts +46 -0
- package/model/listApiKeys200Response.ts +32 -0
- package/model/listCompetitors200Response.ts +32 -0
- package/model/listHashtagGroups200Response.ts +46 -0
- package/model/listInboxConversations200Response.ts +46 -0
- package/model/listInboxReplyDrafts200Response.ts +46 -0
- 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/listRecyclingRules200Response.ts +32 -0
- package/model/listRecyclingRuns200Response.ts +32 -0
- package/model/listReportExports200Response.ts +32 -0
- package/model/listResellerClients200Response.ts +39 -0
- package/model/listRssFeeds200Response.ts +32 -0
- package/model/listTags200Response.ts +2 -2
- package/model/listTemplates200Response.ts +46 -0
- package/model/listUsers200Response.ts +2 -2
- package/model/listWebhookSubscriptions200Response.ts +32 -0
- package/model/listWorkspaces200Response.ts +2 -2
- package/model/media.ts +60 -2
- package/model/mediaBase64Input.ts +61 -0
- 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/messageOnly.ts +31 -0
- package/model/models.ts +600 -0
- package/model/paginationMeta.ts +2 -2
- package/model/paginationMetaLinks.ts +4 -4
- package/model/paginationMetaMeta.ts +4 -4
- package/model/pollRssFeed200Response.ts +50 -0
- package/model/post.ts +12 -2
- package/model/postAnalytics.ts +46 -0
- package/model/postContent.ts +6 -3
- package/model/postInput.ts +33 -2
- package/model/postOptionsInstagram.ts +59 -0
- package/model/postOptionsTikTok.ts +97 -0
- package/model/postOptionsYoutube.ts +62 -0
- package/model/postStatus.ts +9 -3
- package/model/postVersion.ts +16 -6
- package/model/postVersionOptions.ts +55 -0
- package/model/postingSchedule.ts +74 -0
- package/model/postingScheduleDay.ts +50 -0
- package/model/postingScheduleDayTimesInner.ts +34 -0
- package/model/postingScheduleInput.ts +53 -0
- 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/preflightResult.ts +69 -0
- package/model/publicWorkspace.ts +50 -0
- package/model/publicWorkspacePivot.ts +53 -0
- package/model/publishProgress.ts +46 -0
- package/model/queueSlots.ts +43 -0
- package/model/receipt.ts +2 -2
- package/model/receiptInput.ts +2 -2
- package/model/receiptUpdateInput.ts +2 -2
- package/model/recommendedPostingTimes.ts +61 -0
- package/model/reconnectLink.ts +46 -0
- package/model/recyclingRule.ts +117 -0
- package/model/recyclingRuleInput.ts +114 -0
- package/model/recyclingRuleSettings.ts +83 -0
- package/model/recyclingRuleUpdate.ts +71 -0
- package/model/recyclingRun.ts +71 -0
- package/model/removeGenericSubscription422Response.ts +31 -0
- package/model/removeUserFromWorkspaceRequest.ts +2 -2
- package/model/reportBranding.ts +61 -0
- package/model/reportBrandingInput.ts +55 -0
- package/model/reportExport.ts +121 -0
- package/model/reportExportInput.ts +91 -0
- package/model/repurposeContent200Response.ts +39 -0
- package/model/repurposeInput.ts +213 -0
- package/model/repurposeInputTheme.ts +46 -0
- package/model/repurposeResult.ts +89 -0
- package/model/repurposeResultMedia.ts +40 -0
- package/model/repurposeResultSource.ts +51 -0
- package/model/repurposeSlide.ts +43 -0
- package/model/resellerClient.ts +82 -0
- package/model/resellerClientInput.ts +31 -0
- package/model/resellerClientUsage.ts +43 -0
- package/model/retryPostAccountResult.ts +47 -0
- package/model/rssFeed.ts +100 -0
- package/model/rssFeedInput.ts +79 -0
- package/model/rssFeedUpdate.ts +73 -0
- package/model/runAgent202Response.ts +32 -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/template.ts +47 -0
- package/model/templateContentItem.ts +40 -0
- package/model/templateInput.ts +41 -0
- package/model/templateInputContentInner.ts +40 -0
- 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/webhookEventName.ts +31 -0
- package/model/webhookEventPayload.ts +43 -0
- package/model/webhookSubscription.ts +61 -0
- package/model/webhookSubscriptionInput.ts +67 -0
- package/model/workspace.ts +17 -3
- package/model/workspaceAgent.ts +91 -0
- package/model/workspaceAgentInput.ts +67 -0
- package/model/workspaceAgentSettings.ts +70 -0
- package/model/workspaceAgentUpdate.ts +58 -0
- package/model/workspaceInput.ts +8 -3
- package/model/workspaceUserInput.ts +2 -2
- package/model/xUsage.ts +68 -0
- package/model/xUsageCounter.ts +40 -0
- 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. ## Idempotent requests Send an `Idempotency-Key` header (any unique string, for example a UUID) with a `POST`. Repeating the request with the same key within 24 hours returns the stored response with `Idempotent-Replayed: true` and creates nothing new. Reusing a key with a different body returns `422`; a request still in progress with the same key returns `409`. `5xx` and `429` responses are not stored, so they can be retried with the same key. ## Guardrails for automated clients Create and update requests are checked before anything is written: a post whose content matches one created for the same account in the last 24 hours returns `409` (`code: duplicate_post`, override with `allow_duplicate: true`), scheduling past an account\'s daily cap returns `429` (`code: account_daily_cap_reached`), and scheduling to an account that must be reconnected returns `422` (`code: account_unauthorized` or `account_token_missing`). Use `POST /{workspaceUuid}/posts/validate` for a dry run and `GET /{workspaceUuid}/activity` to review what API clients did. ## 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.14.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,21 @@ 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 { MediaBase64Input } from '../model/mediaBase64Input';
|
|
31
|
+
import { MediaFolder } from '../model/mediaFolder';
|
|
32
|
+
import { MediaFolderInput } from '../model/mediaFolderInput';
|
|
26
33
|
import { UpdateMediaRequest } from '../model/updateMediaRequest';
|
|
27
34
|
import { UploadChunk201Response } from '../model/uploadChunk201Response';
|
|
28
35
|
|
|
@@ -180,12 +187,13 @@ export class MediaApi {
|
|
|
180
187
|
});
|
|
181
188
|
}
|
|
182
189
|
/**
|
|
183
|
-
* Signal that all chunks have been uploaded. Returns the final media object.
|
|
190
|
+
* 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
191
|
* @summary Complete chunked upload
|
|
185
192
|
* @param workspaceUuid UUID of the workspace.
|
|
186
193
|
* @param uploadUuid
|
|
194
|
+
* @param completeChunkedUploadRequest
|
|
187
195
|
*/
|
|
188
|
-
public async completeChunkedUpload (workspaceUuid: string, uploadUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Media; }> {
|
|
196
|
+
public async completeChunkedUpload (workspaceUuid: string, uploadUuid: string, completeChunkedUploadRequest?: CompleteChunkedUploadRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Media; }> {
|
|
189
197
|
const localVarPath = this.basePath + '/{workspaceUuid}/media/chunked/{uploadUuid}/complete'
|
|
190
198
|
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
|
|
191
199
|
.replace('{' + 'uploadUuid' + '}', encodeURIComponent(String(uploadUuid)));
|
|
@@ -221,6 +229,7 @@ export class MediaApi {
|
|
|
221
229
|
uri: localVarPath,
|
|
222
230
|
useQuerystring: this._useQuerystring,
|
|
223
231
|
json: true,
|
|
232
|
+
body: ObjectSerializer.serialize(completeChunkedUploadRequest, "CompleteChunkedUploadRequest")
|
|
224
233
|
};
|
|
225
234
|
|
|
226
235
|
let authenticationPromise = Promise.resolve();
|
|
@@ -259,7 +268,88 @@ export class MediaApi {
|
|
|
259
268
|
});
|
|
260
269
|
}
|
|
261
270
|
/**
|
|
262
|
-
*
|
|
271
|
+
* Creates a folder at the top level or under `parent`. The name must be unique among its siblings.
|
|
272
|
+
* @summary Create media folder
|
|
273
|
+
* @param workspaceUuid UUID of the workspace.
|
|
274
|
+
* @param createMediaFolderRequest
|
|
275
|
+
* @param idempotencyKey Unique key (for example a UUID) that makes the request safe to retry. A repeat with the same key and body within 24 hours returns the stored response with `Idempotent-Replayed: true` and has no further effect. Keys are scoped to your user, the workspace, the method and the path.
|
|
276
|
+
*/
|
|
277
|
+
public async createMediaFolder (workspaceUuid: string, createMediaFolderRequest: CreateMediaFolderRequest, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MediaFolder; }> {
|
|
278
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/media/folders'
|
|
279
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
280
|
+
let localVarQueryParameters: any = {};
|
|
281
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
282
|
+
const produces = ['application/json'];
|
|
283
|
+
// give precedence to 'application/json'
|
|
284
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
285
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
286
|
+
} else {
|
|
287
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
288
|
+
}
|
|
289
|
+
let localVarFormParams: any = {};
|
|
290
|
+
|
|
291
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
292
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
293
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling createMediaFolder.');
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// verify required parameter 'createMediaFolderRequest' is not null or undefined
|
|
297
|
+
if (createMediaFolderRequest === null || createMediaFolderRequest === undefined) {
|
|
298
|
+
throw new Error('Required parameter createMediaFolderRequest was null or undefined when calling createMediaFolder.');
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
localVarHeaderParams['Idempotency-Key'] = ObjectSerializer.serialize(idempotencyKey, "string");
|
|
302
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
303
|
+
|
|
304
|
+
let localVarUseFormData = false;
|
|
305
|
+
|
|
306
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
307
|
+
method: 'POST',
|
|
308
|
+
qs: localVarQueryParameters,
|
|
309
|
+
headers: localVarHeaderParams,
|
|
310
|
+
uri: localVarPath,
|
|
311
|
+
useQuerystring: this._useQuerystring,
|
|
312
|
+
json: true,
|
|
313
|
+
body: ObjectSerializer.serialize(createMediaFolderRequest, "CreateMediaFolderRequest")
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
let authenticationPromise = Promise.resolve();
|
|
317
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
318
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
319
|
+
}
|
|
320
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
321
|
+
|
|
322
|
+
let interceptorPromise = authenticationPromise;
|
|
323
|
+
for (const interceptor of this.interceptors) {
|
|
324
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
return interceptorPromise.then(() => {
|
|
328
|
+
if (Object.keys(localVarFormParams).length) {
|
|
329
|
+
if (localVarUseFormData) {
|
|
330
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
331
|
+
} else {
|
|
332
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return new Promise<{ response: http.IncomingMessage; body: MediaFolder; }>((resolve, reject) => {
|
|
336
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
337
|
+
if (error) {
|
|
338
|
+
reject(error);
|
|
339
|
+
} else {
|
|
340
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
341
|
+
body = ObjectSerializer.deserialize(body, "MediaFolder");
|
|
342
|
+
resolve({ response: response, body: body });
|
|
343
|
+
} else {
|
|
344
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
});
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Delete one or more media items by their numeric IDs or UUIDs (both may be mixed, up to 500 per request).
|
|
263
353
|
* @summary Delete media (bulk)
|
|
264
354
|
* @param workspaceUuid UUID of the workspace.
|
|
265
355
|
* @param deleteMediaBulkRequest
|
|
@@ -337,6 +427,87 @@ export class MediaApi {
|
|
|
337
427
|
});
|
|
338
428
|
});
|
|
339
429
|
}
|
|
430
|
+
/**
|
|
431
|
+
* 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.
|
|
432
|
+
* @summary Delete media folder
|
|
433
|
+
* @param workspaceUuid UUID of the workspace.
|
|
434
|
+
* @param folderUuid UUID of the media folder.
|
|
435
|
+
* @param deleteMediaFolderRequest
|
|
436
|
+
*/
|
|
437
|
+
public async deleteMediaFolder (workspaceUuid: string, folderUuid: string, deleteMediaFolderRequest?: DeleteMediaFolderRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
438
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/media/folders/{folderUuid}'
|
|
439
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
|
|
440
|
+
.replace('{' + 'folderUuid' + '}', encodeURIComponent(String(folderUuid)));
|
|
441
|
+
let localVarQueryParameters: any = {};
|
|
442
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
443
|
+
const produces = ['application/json'];
|
|
444
|
+
// give precedence to 'application/json'
|
|
445
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
446
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
447
|
+
} else {
|
|
448
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
449
|
+
}
|
|
450
|
+
let localVarFormParams: any = {};
|
|
451
|
+
|
|
452
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
453
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
454
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling deleteMediaFolder.');
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// verify required parameter 'folderUuid' is not null or undefined
|
|
458
|
+
if (folderUuid === null || folderUuid === undefined) {
|
|
459
|
+
throw new Error('Required parameter folderUuid was null or undefined when calling deleteMediaFolder.');
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
463
|
+
|
|
464
|
+
let localVarUseFormData = false;
|
|
465
|
+
|
|
466
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
467
|
+
method: 'DELETE',
|
|
468
|
+
qs: localVarQueryParameters,
|
|
469
|
+
headers: localVarHeaderParams,
|
|
470
|
+
uri: localVarPath,
|
|
471
|
+
useQuerystring: this._useQuerystring,
|
|
472
|
+
json: true,
|
|
473
|
+
body: ObjectSerializer.serialize(deleteMediaFolderRequest, "DeleteMediaFolderRequest")
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
let authenticationPromise = Promise.resolve();
|
|
477
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
478
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
479
|
+
}
|
|
480
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
481
|
+
|
|
482
|
+
let interceptorPromise = authenticationPromise;
|
|
483
|
+
for (const interceptor of this.interceptors) {
|
|
484
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
return interceptorPromise.then(() => {
|
|
488
|
+
if (Object.keys(localVarFormParams).length) {
|
|
489
|
+
if (localVarUseFormData) {
|
|
490
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
491
|
+
} else {
|
|
492
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
496
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
497
|
+
if (error) {
|
|
498
|
+
reject(error);
|
|
499
|
+
} else {
|
|
500
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
501
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
502
|
+
resolve({ response: response, body: body });
|
|
503
|
+
} else {
|
|
504
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
});
|
|
509
|
+
});
|
|
510
|
+
}
|
|
340
511
|
/**
|
|
341
512
|
* Returns a single media asset.
|
|
342
513
|
* @summary Get media
|
|
@@ -500,8 +671,9 @@ export class MediaApi {
|
|
|
500
671
|
* @summary Initiate chunked upload
|
|
501
672
|
* @param workspaceUuid UUID of the workspace.
|
|
502
673
|
* @param initiateChunkedUploadRequest
|
|
674
|
+
* @param idempotencyKey Unique key (for example a UUID) that makes the request safe to retry. A repeat with the same key and body within 24 hours returns the stored response with `Idempotent-Replayed: true` and has no further effect. Keys are scoped to your user, the workspace, the method and the path.
|
|
503
675
|
*/
|
|
504
|
-
public async initiateChunkedUpload (workspaceUuid: string, initiateChunkedUploadRequest: InitiateChunkedUploadRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: InitiateChunkedUpload201Response; }> {
|
|
676
|
+
public async initiateChunkedUpload (workspaceUuid: string, initiateChunkedUploadRequest: InitiateChunkedUploadRequest, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: InitiateChunkedUpload201Response; }> {
|
|
505
677
|
const localVarPath = this.basePath + '/{workspaceUuid}/media/chunked/initiate'
|
|
506
678
|
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
507
679
|
let localVarQueryParameters: any = {};
|
|
@@ -525,6 +697,7 @@ export class MediaApi {
|
|
|
525
697
|
throw new Error('Required parameter initiateChunkedUploadRequest was null or undefined when calling initiateChunkedUpload.');
|
|
526
698
|
}
|
|
527
699
|
|
|
700
|
+
localVarHeaderParams['Idempotency-Key'] = ObjectSerializer.serialize(idempotencyKey, "string");
|
|
528
701
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
529
702
|
|
|
530
703
|
let localVarUseFormData = false;
|
|
@@ -579,8 +752,9 @@ export class MediaApi {
|
|
|
579
752
|
* @summary Initiate remote upload
|
|
580
753
|
* @param workspaceUuid UUID of the workspace.
|
|
581
754
|
* @param initiateRemoteUploadRequest
|
|
755
|
+
* @param idempotencyKey Unique key (for example a UUID) that makes the request safe to retry. A repeat with the same key and body within 24 hours returns the stored response with `Idempotent-Replayed: true` and has no further effect. Keys are scoped to your user, the workspace, the method and the path.
|
|
582
756
|
*/
|
|
583
|
-
public async initiateRemoteUpload (workspaceUuid: string, initiateRemoteUploadRequest: InitiateRemoteUploadRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: InitiateRemoteUpload201Response; }> {
|
|
757
|
+
public async initiateRemoteUpload (workspaceUuid: string, initiateRemoteUploadRequest: InitiateRemoteUploadRequest, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: InitiateRemoteUpload201Response; }> {
|
|
584
758
|
const localVarPath = this.basePath + '/{workspaceUuid}/media/remote/initiate'
|
|
585
759
|
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
586
760
|
let localVarQueryParameters: any = {};
|
|
@@ -604,6 +778,7 @@ export class MediaApi {
|
|
|
604
778
|
throw new Error('Required parameter initiateRemoteUploadRequest was null or undefined when calling initiateRemoteUpload.');
|
|
605
779
|
}
|
|
606
780
|
|
|
781
|
+
localVarHeaderParams['Idempotency-Key'] = ObjectSerializer.serialize(idempotencyKey, "string");
|
|
607
782
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
608
783
|
|
|
609
784
|
let localVarUseFormData = false;
|
|
@@ -654,12 +829,20 @@ export class MediaApi {
|
|
|
654
829
|
});
|
|
655
830
|
}
|
|
656
831
|
/**
|
|
657
|
-
* Returns a paginated list of media assets in the workspace library.
|
|
832
|
+
* 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
833
|
* @summary List media
|
|
659
834
|
* @param workspaceUuid UUID of the workspace.
|
|
660
|
-
* @param page Page number
|
|
835
|
+
* @param page Page number.
|
|
836
|
+
* @param limit Items per page. Values below 1 fall back to 50; values above 100 are capped at 100.
|
|
837
|
+
* @param folder Media folder UUID, or `root` for items not filed in any folder.
|
|
838
|
+
* @param mimeTypes Only these MIME types (for example `image/png`).
|
|
839
|
+
* @param type Only this media type.
|
|
840
|
+
* @param keyword Search media by name.
|
|
841
|
+
* @param usage Filter by how the media is used in posts.
|
|
842
|
+
* @param favorite When `true`, only media the caller marked as favorite.
|
|
843
|
+
* @param sort
|
|
661
844
|
*/
|
|
662
|
-
public async listMedia (workspaceUuid: string, page?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListMedia200Response; }> {
|
|
845
|
+
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
846
|
const localVarPath = this.basePath + '/{workspaceUuid}/media'
|
|
664
847
|
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
665
848
|
let localVarQueryParameters: any = {};
|
|
@@ -682,6 +865,38 @@ export class MediaApi {
|
|
|
682
865
|
localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number");
|
|
683
866
|
}
|
|
684
867
|
|
|
868
|
+
if (limit !== undefined) {
|
|
869
|
+
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
if (folder !== undefined) {
|
|
873
|
+
localVarQueryParameters['folder'] = ObjectSerializer.serialize(folder, "string");
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
if (mimeTypes !== undefined) {
|
|
877
|
+
localVarQueryParameters['mime_types[]'] = ObjectSerializer.serialize(mimeTypes, "Array<string>");
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
if (type !== undefined) {
|
|
881
|
+
localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "'image' | 'gif' | 'video'");
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
if (keyword !== undefined) {
|
|
885
|
+
localVarQueryParameters['keyword'] = ObjectSerializer.serialize(keyword, "string");
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
if (usage !== undefined) {
|
|
889
|
+
localVarQueryParameters['usage'] = ObjectSerializer.serialize(usage, "'unused' | 'draft' | 'scheduled' | 'published'");
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
if (favorite !== undefined) {
|
|
893
|
+
localVarQueryParameters['favorite'] = ObjectSerializer.serialize(favorite, "boolean");
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
if (sort !== undefined) {
|
|
897
|
+
localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'newest' | 'oldest' | 'name' | 'size'");
|
|
898
|
+
}
|
|
899
|
+
|
|
685
900
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
686
901
|
|
|
687
902
|
let localVarUseFormData = false;
|
|
@@ -731,7 +946,79 @@ export class MediaApi {
|
|
|
731
946
|
});
|
|
732
947
|
}
|
|
733
948
|
/**
|
|
734
|
-
*
|
|
949
|
+
* Returns the whole folder tree of the media library in one response (not paginated). Rebuild the tree from each folder\'s `parent`.
|
|
950
|
+
* @summary List media folders
|
|
951
|
+
* @param workspaceUuid UUID of the workspace.
|
|
952
|
+
*/
|
|
953
|
+
public async listMediaFolders (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListMediaFolders200Response; }> {
|
|
954
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/media/folders'
|
|
955
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
956
|
+
let localVarQueryParameters: any = {};
|
|
957
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
958
|
+
const produces = ['application/json'];
|
|
959
|
+
// give precedence to 'application/json'
|
|
960
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
961
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
962
|
+
} else {
|
|
963
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
964
|
+
}
|
|
965
|
+
let localVarFormParams: any = {};
|
|
966
|
+
|
|
967
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
968
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
969
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling listMediaFolders.');
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
973
|
+
|
|
974
|
+
let localVarUseFormData = false;
|
|
975
|
+
|
|
976
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
977
|
+
method: 'GET',
|
|
978
|
+
qs: localVarQueryParameters,
|
|
979
|
+
headers: localVarHeaderParams,
|
|
980
|
+
uri: localVarPath,
|
|
981
|
+
useQuerystring: this._useQuerystring,
|
|
982
|
+
json: true,
|
|
983
|
+
};
|
|
984
|
+
|
|
985
|
+
let authenticationPromise = Promise.resolve();
|
|
986
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
987
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
988
|
+
}
|
|
989
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
990
|
+
|
|
991
|
+
let interceptorPromise = authenticationPromise;
|
|
992
|
+
for (const interceptor of this.interceptors) {
|
|
993
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
return interceptorPromise.then(() => {
|
|
997
|
+
if (Object.keys(localVarFormParams).length) {
|
|
998
|
+
if (localVarUseFormData) {
|
|
999
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1000
|
+
} else {
|
|
1001
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
return new Promise<{ response: http.IncomingMessage; body: ListMediaFolders200Response; }>((resolve, reject) => {
|
|
1005
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1006
|
+
if (error) {
|
|
1007
|
+
reject(error);
|
|
1008
|
+
} else {
|
|
1009
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1010
|
+
body = ObjectSerializer.deserialize(body, "ListMediaFolders200Response");
|
|
1011
|
+
resolve({ response: response, body: body });
|
|
1012
|
+
} else {
|
|
1013
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
});
|
|
1017
|
+
});
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
/**
|
|
1021
|
+
* 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
1022
|
* @summary Update media
|
|
736
1023
|
* @param workspaceUuid UUID of the workspace.
|
|
737
1024
|
* @param mediaUuid UUID of the media asset.
|
|
@@ -816,6 +1103,92 @@ export class MediaApi {
|
|
|
816
1103
|
});
|
|
817
1104
|
});
|
|
818
1105
|
}
|
|
1106
|
+
/**
|
|
1107
|
+
* 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.
|
|
1108
|
+
* @summary Update media folder
|
|
1109
|
+
* @param workspaceUuid UUID of the workspace.
|
|
1110
|
+
* @param folderUuid UUID of the media folder.
|
|
1111
|
+
* @param mediaFolderInput
|
|
1112
|
+
*/
|
|
1113
|
+
public async updateMediaFolder (workspaceUuid: string, folderUuid: string, mediaFolderInput: MediaFolderInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MediaFolder; }> {
|
|
1114
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/media/folders/{folderUuid}'
|
|
1115
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
|
|
1116
|
+
.replace('{' + 'folderUuid' + '}', encodeURIComponent(String(folderUuid)));
|
|
1117
|
+
let localVarQueryParameters: any = {};
|
|
1118
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1119
|
+
const produces = ['application/json'];
|
|
1120
|
+
// give precedence to 'application/json'
|
|
1121
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1122
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1123
|
+
} else {
|
|
1124
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1125
|
+
}
|
|
1126
|
+
let localVarFormParams: any = {};
|
|
1127
|
+
|
|
1128
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
1129
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
1130
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling updateMediaFolder.');
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
// verify required parameter 'folderUuid' is not null or undefined
|
|
1134
|
+
if (folderUuid === null || folderUuid === undefined) {
|
|
1135
|
+
throw new Error('Required parameter folderUuid was null or undefined when calling updateMediaFolder.');
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
// verify required parameter 'mediaFolderInput' is not null or undefined
|
|
1139
|
+
if (mediaFolderInput === null || mediaFolderInput === undefined) {
|
|
1140
|
+
throw new Error('Required parameter mediaFolderInput was null or undefined when calling updateMediaFolder.');
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1144
|
+
|
|
1145
|
+
let localVarUseFormData = false;
|
|
1146
|
+
|
|
1147
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1148
|
+
method: 'PUT',
|
|
1149
|
+
qs: localVarQueryParameters,
|
|
1150
|
+
headers: localVarHeaderParams,
|
|
1151
|
+
uri: localVarPath,
|
|
1152
|
+
useQuerystring: this._useQuerystring,
|
|
1153
|
+
json: true,
|
|
1154
|
+
body: ObjectSerializer.serialize(mediaFolderInput, "MediaFolderInput")
|
|
1155
|
+
};
|
|
1156
|
+
|
|
1157
|
+
let authenticationPromise = Promise.resolve();
|
|
1158
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
1159
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
1160
|
+
}
|
|
1161
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1162
|
+
|
|
1163
|
+
let interceptorPromise = authenticationPromise;
|
|
1164
|
+
for (const interceptor of this.interceptors) {
|
|
1165
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
return interceptorPromise.then(() => {
|
|
1169
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1170
|
+
if (localVarUseFormData) {
|
|
1171
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1172
|
+
} else {
|
|
1173
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
return new Promise<{ response: http.IncomingMessage; body: MediaFolder; }>((resolve, reject) => {
|
|
1177
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1178
|
+
if (error) {
|
|
1179
|
+
reject(error);
|
|
1180
|
+
} else {
|
|
1181
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1182
|
+
body = ObjectSerializer.deserialize(body, "MediaFolder");
|
|
1183
|
+
resolve({ response: response, body: body });
|
|
1184
|
+
} else {
|
|
1185
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
});
|
|
1189
|
+
});
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
819
1192
|
/**
|
|
820
1193
|
* Upload a single chunk of a chunked upload session.
|
|
821
1194
|
* @summary Upload a chunk
|
|
@@ -917,13 +1290,15 @@ export class MediaApi {
|
|
|
917
1290
|
});
|
|
918
1291
|
}
|
|
919
1292
|
/**
|
|
920
|
-
* Upload a file directly as multipart form data.
|
|
1293
|
+
* Upload a file directly as multipart form data. Images and videos, plus a PDF (up to 100 MB) for LinkedIn document posts: a post that attaches a PDF must have it as the only media item and may only go to LinkedIn profiles and pages.
|
|
921
1294
|
* @summary Upload media (binary)
|
|
922
1295
|
* @param workspaceUuid UUID of the workspace.
|
|
923
1296
|
* @param file The file to upload.
|
|
1297
|
+
* @param idempotencyKey Unique key (for example a UUID) that makes the request safe to retry. A repeat with the same key and body within 24 hours returns the stored response with `Idempotent-Replayed: true` and has no further effect. Keys are scoped to your user, the workspace, the method and the path.
|
|
924
1298
|
* @param altText Alternative text for accessibility.
|
|
1299
|
+
* @param folder UUID of the media folder to file the upload in. Omit or null for the library root.
|
|
925
1300
|
*/
|
|
926
|
-
public async uploadMedia (workspaceUuid: string, file: RequestFile, altText?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Media; }> {
|
|
1301
|
+
public async uploadMedia (workspaceUuid: string, file: RequestFile, idempotencyKey?: string, altText?: string, folder?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Media; }> {
|
|
927
1302
|
const localVarPath = this.basePath + '/{workspaceUuid}/media'
|
|
928
1303
|
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
929
1304
|
let localVarQueryParameters: any = {};
|
|
@@ -947,6 +1322,7 @@ export class MediaApi {
|
|
|
947
1322
|
throw new Error('Required parameter file was null or undefined when calling uploadMedia.');
|
|
948
1323
|
}
|
|
949
1324
|
|
|
1325
|
+
localVarHeaderParams['Idempotency-Key'] = ObjectSerializer.serialize(idempotencyKey, "string");
|
|
950
1326
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
951
1327
|
|
|
952
1328
|
let localVarUseFormData = false;
|
|
@@ -960,6 +1336,90 @@ export class MediaApi {
|
|
|
960
1336
|
localVarFormParams['alt_text'] = ObjectSerializer.serialize(altText, "string");
|
|
961
1337
|
}
|
|
962
1338
|
|
|
1339
|
+
if (folder !== undefined) {
|
|
1340
|
+
localVarFormParams['folder'] = ObjectSerializer.serialize(folder, "string");
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1344
|
+
method: 'POST',
|
|
1345
|
+
qs: localVarQueryParameters,
|
|
1346
|
+
headers: localVarHeaderParams,
|
|
1347
|
+
uri: localVarPath,
|
|
1348
|
+
useQuerystring: this._useQuerystring,
|
|
1349
|
+
json: true,
|
|
1350
|
+
};
|
|
1351
|
+
|
|
1352
|
+
let authenticationPromise = Promise.resolve();
|
|
1353
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
1354
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
1355
|
+
}
|
|
1356
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1357
|
+
|
|
1358
|
+
let interceptorPromise = authenticationPromise;
|
|
1359
|
+
for (const interceptor of this.interceptors) {
|
|
1360
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
return interceptorPromise.then(() => {
|
|
1364
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1365
|
+
if (localVarUseFormData) {
|
|
1366
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1367
|
+
} else {
|
|
1368
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
return new Promise<{ response: http.IncomingMessage; body: Media; }>((resolve, reject) => {
|
|
1372
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1373
|
+
if (error) {
|
|
1374
|
+
reject(error);
|
|
1375
|
+
} else {
|
|
1376
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1377
|
+
body = ObjectSerializer.deserialize(body, "Media");
|
|
1378
|
+
resolve({ response: response, body: body });
|
|
1379
|
+
} else {
|
|
1380
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
});
|
|
1384
|
+
});
|
|
1385
|
+
});
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* Upload a file as base64 inside a JSON body, for agents and tools that cannot send multipart form data. The decoded file is checked exactly like `POST media` (allowed types and size limits; a PDF is accepted for LinkedIn document posts). Decoded size is capped at 20 MB; for larger files use remote upload by URL or chunked upload.
|
|
1389
|
+
* @summary Upload media (base64 JSON)
|
|
1390
|
+
* @param workspaceUuid UUID of the workspace.
|
|
1391
|
+
* @param mediaBase64Input
|
|
1392
|
+
* @param idempotencyKey Unique key (for example a UUID) that makes the request safe to retry. A repeat with the same key and body within 24 hours returns the stored response with `Idempotent-Replayed: true` and has no further effect. Keys are scoped to your user, the workspace, the method and the path.
|
|
1393
|
+
*/
|
|
1394
|
+
public async uploadMediaBase64 (workspaceUuid: string, mediaBase64Input: MediaBase64Input, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Media; }> {
|
|
1395
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/media/base64'
|
|
1396
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
1397
|
+
let localVarQueryParameters: any = {};
|
|
1398
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1399
|
+
const produces = ['application/json'];
|
|
1400
|
+
// give precedence to 'application/json'
|
|
1401
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1402
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1403
|
+
} else {
|
|
1404
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1405
|
+
}
|
|
1406
|
+
let localVarFormParams: any = {};
|
|
1407
|
+
|
|
1408
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
1409
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
1410
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling uploadMediaBase64.');
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
// verify required parameter 'mediaBase64Input' is not null or undefined
|
|
1414
|
+
if (mediaBase64Input === null || mediaBase64Input === undefined) {
|
|
1415
|
+
throw new Error('Required parameter mediaBase64Input was null or undefined when calling uploadMediaBase64.');
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
localVarHeaderParams['Idempotency-Key'] = ObjectSerializer.serialize(idempotencyKey, "string");
|
|
1419
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1420
|
+
|
|
1421
|
+
let localVarUseFormData = false;
|
|
1422
|
+
|
|
963
1423
|
let localVarRequestOptions: localVarRequest.Options = {
|
|
964
1424
|
method: 'POST',
|
|
965
1425
|
qs: localVarQueryParameters,
|
|
@@ -967,6 +1427,7 @@ export class MediaApi {
|
|
|
967
1427
|
uri: localVarPath,
|
|
968
1428
|
useQuerystring: this._useQuerystring,
|
|
969
1429
|
json: true,
|
|
1430
|
+
body: ObjectSerializer.serialize(mediaBase64Input, "MediaBase64Input")
|
|
970
1431
|
};
|
|
971
1432
|
|
|
972
1433
|
let authenticationPromise = Promise.resolve();
|