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/accountsApi.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).
|
|
@@ -16,7 +16,12 @@ import http from 'http';
|
|
|
16
16
|
|
|
17
17
|
/* tslint:disable:no-unused-locals */
|
|
18
18
|
import { Account } from '../model/account';
|
|
19
|
+
import { ChannelAccount } from '../model/channelAccount';
|
|
20
|
+
import { ConnectChannelInput } from '../model/connectChannelInput';
|
|
21
|
+
import { GetAccountHealth200Response } from '../model/getAccountHealth200Response';
|
|
19
22
|
import { ListAccounts200Response } from '../model/listAccounts200Response';
|
|
23
|
+
import { MessageOnly } from '../model/messageOnly';
|
|
24
|
+
import { ReconnectLink } from '../model/reconnectLink';
|
|
20
25
|
|
|
21
26
|
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
22
27
|
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
|
@@ -93,6 +98,171 @@ export class AccountsApi {
|
|
|
93
98
|
this.interceptors.push(interceptor);
|
|
94
99
|
}
|
|
95
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Connects a channel that uses a bot token or a webhook URL instead of a login. The credentials are checked against the network first, stored encrypted and never returned. Connecting the same channel again updates it (`200`) instead of adding a second account. Workspace admins only; counts toward the plan\'s social account limit. - **telegram**: `bot_token` from @BotFather and `chat` (the channel\'s `@username`, or its numeric id such as `-1001234567890` for a private channel). The bot must be an administrator of the channel allowed to post messages. - **discord**: `webhook_url` from Channel settings → Integrations → Webhooks (`https://discord.com/api/webhooks/…`). - **slack**: `webhook_url` of an incoming webhook (`https://hooks.slack.com/services/…`) and an optional display `name`. Slack posts cannot be deleted from PostBoost, and images must be publicly reachable. Webhook URLs on any other host are refused (`422`) before any request is made.
|
|
103
|
+
* @summary Connect a Telegram, Discord or Slack channel
|
|
104
|
+
* @param workspaceUuid UUID of the workspace.
|
|
105
|
+
* @param provider
|
|
106
|
+
* @param connectChannelInput
|
|
107
|
+
*/
|
|
108
|
+
public async connectChannel (workspaceUuid: string, provider: 'telegram' | 'discord' | 'slack', connectChannelInput: ConnectChannelInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ChannelAccount; }> {
|
|
109
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/accounts/connect/{provider}'
|
|
110
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
|
|
111
|
+
.replace('{' + 'provider' + '}', encodeURIComponent(String(provider)));
|
|
112
|
+
let localVarQueryParameters: any = {};
|
|
113
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
114
|
+
const produces = ['application/json'];
|
|
115
|
+
// give precedence to 'application/json'
|
|
116
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
117
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
118
|
+
} else {
|
|
119
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
120
|
+
}
|
|
121
|
+
let localVarFormParams: any = {};
|
|
122
|
+
|
|
123
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
124
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
125
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling connectChannel.');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// verify required parameter 'provider' is not null or undefined
|
|
129
|
+
if (provider === null || provider === undefined) {
|
|
130
|
+
throw new Error('Required parameter provider was null or undefined when calling connectChannel.');
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// verify required parameter 'connectChannelInput' is not null or undefined
|
|
134
|
+
if (connectChannelInput === null || connectChannelInput === undefined) {
|
|
135
|
+
throw new Error('Required parameter connectChannelInput was null or undefined when calling connectChannel.');
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
139
|
+
|
|
140
|
+
let localVarUseFormData = false;
|
|
141
|
+
|
|
142
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
143
|
+
method: 'POST',
|
|
144
|
+
qs: localVarQueryParameters,
|
|
145
|
+
headers: localVarHeaderParams,
|
|
146
|
+
uri: localVarPath,
|
|
147
|
+
useQuerystring: this._useQuerystring,
|
|
148
|
+
json: true,
|
|
149
|
+
body: ObjectSerializer.serialize(connectChannelInput, "ConnectChannelInput")
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
let authenticationPromise = Promise.resolve();
|
|
153
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
154
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
155
|
+
}
|
|
156
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
157
|
+
|
|
158
|
+
let interceptorPromise = authenticationPromise;
|
|
159
|
+
for (const interceptor of this.interceptors) {
|
|
160
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return interceptorPromise.then(() => {
|
|
164
|
+
if (Object.keys(localVarFormParams).length) {
|
|
165
|
+
if (localVarUseFormData) {
|
|
166
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
167
|
+
} else {
|
|
168
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return new Promise<{ response: http.IncomingMessage; body: ChannelAccount; }>((resolve, reject) => {
|
|
172
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
173
|
+
if (error) {
|
|
174
|
+
reject(error);
|
|
175
|
+
} else {
|
|
176
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
177
|
+
body = ObjectSerializer.deserialize(body, "ChannelAccount");
|
|
178
|
+
resolve({ response: response, body: body });
|
|
179
|
+
} else {
|
|
180
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Creates a single-use link (valid 7 days) that lets someone without a PostBoost login, such as an agency\'s client, re-authorize this one account on its network. The link only refreshes the connection of this account; signing in as a different profile or page changes nothing. Workspace admins only. Available for Facebook Pages, Instagram, Threads, LinkedIn, TikTok, YouTube and Pinterest. Returns `404` while the feature is not enabled on this instance.
|
|
189
|
+
* @summary Create a reconnect link
|
|
190
|
+
* @param workspaceUuid UUID of the workspace.
|
|
191
|
+
* @param accountUuid UUID of the social media account.
|
|
192
|
+
*/
|
|
193
|
+
public async createReconnectLink (workspaceUuid: string, accountUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ReconnectLink; }> {
|
|
194
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/accounts/{accountUuid}/reconnect-links'
|
|
195
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
|
|
196
|
+
.replace('{' + 'accountUuid' + '}', encodeURIComponent(String(accountUuid)));
|
|
197
|
+
let localVarQueryParameters: any = {};
|
|
198
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
199
|
+
const produces = ['application/json'];
|
|
200
|
+
// give precedence to 'application/json'
|
|
201
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
202
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
203
|
+
} else {
|
|
204
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
205
|
+
}
|
|
206
|
+
let localVarFormParams: any = {};
|
|
207
|
+
|
|
208
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
209
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
210
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling createReconnectLink.');
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// verify required parameter 'accountUuid' is not null or undefined
|
|
214
|
+
if (accountUuid === null || accountUuid === undefined) {
|
|
215
|
+
throw new Error('Required parameter accountUuid was null or undefined when calling createReconnectLink.');
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
219
|
+
|
|
220
|
+
let localVarUseFormData = false;
|
|
221
|
+
|
|
222
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
223
|
+
method: 'POST',
|
|
224
|
+
qs: localVarQueryParameters,
|
|
225
|
+
headers: localVarHeaderParams,
|
|
226
|
+
uri: localVarPath,
|
|
227
|
+
useQuerystring: this._useQuerystring,
|
|
228
|
+
json: true,
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
let authenticationPromise = Promise.resolve();
|
|
232
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
233
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
234
|
+
}
|
|
235
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
236
|
+
|
|
237
|
+
let interceptorPromise = authenticationPromise;
|
|
238
|
+
for (const interceptor of this.interceptors) {
|
|
239
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return interceptorPromise.then(() => {
|
|
243
|
+
if (Object.keys(localVarFormParams).length) {
|
|
244
|
+
if (localVarUseFormData) {
|
|
245
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
246
|
+
} else {
|
|
247
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return new Promise<{ response: http.IncomingMessage; body: ReconnectLink; }>((resolve, reject) => {
|
|
251
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
252
|
+
if (error) {
|
|
253
|
+
reject(error);
|
|
254
|
+
} else {
|
|
255
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
256
|
+
body = ObjectSerializer.deserialize(body, "ReconnectLink");
|
|
257
|
+
resolve({ response: response, body: body });
|
|
258
|
+
} else {
|
|
259
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
});
|
|
264
|
+
});
|
|
265
|
+
}
|
|
96
266
|
/**
|
|
97
267
|
* Returns a single social media account.
|
|
98
268
|
* @summary Get account
|
|
@@ -173,11 +343,87 @@ export class AccountsApi {
|
|
|
173
343
|
});
|
|
174
344
|
}
|
|
175
345
|
/**
|
|
176
|
-
*
|
|
346
|
+
* Pre-flight health of every account in the workspace: whether it is authorized and holds an access token, how much of its daily post cap (per UTC day, scheduled, awaiting approval and published posts) is used today, and its connection health: predicted token expiry, latest publish outcome and where to reconnect it. The `account.token_expiring` and `account.disconnected` webhooks report changes as they happen.
|
|
347
|
+
* @summary Account health
|
|
348
|
+
* @param workspaceUuid UUID of the workspace.
|
|
349
|
+
*/
|
|
350
|
+
public async getAccountHealth (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetAccountHealth200Response; }> {
|
|
351
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/account-health'
|
|
352
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
353
|
+
let localVarQueryParameters: any = {};
|
|
354
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
355
|
+
const produces = ['application/json'];
|
|
356
|
+
// give precedence to 'application/json'
|
|
357
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
358
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
359
|
+
} else {
|
|
360
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
361
|
+
}
|
|
362
|
+
let localVarFormParams: any = {};
|
|
363
|
+
|
|
364
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
365
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
366
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling getAccountHealth.');
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
370
|
+
|
|
371
|
+
let localVarUseFormData = false;
|
|
372
|
+
|
|
373
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
374
|
+
method: 'GET',
|
|
375
|
+
qs: localVarQueryParameters,
|
|
376
|
+
headers: localVarHeaderParams,
|
|
377
|
+
uri: localVarPath,
|
|
378
|
+
useQuerystring: this._useQuerystring,
|
|
379
|
+
json: true,
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
let authenticationPromise = Promise.resolve();
|
|
383
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
384
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
385
|
+
}
|
|
386
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
387
|
+
|
|
388
|
+
let interceptorPromise = authenticationPromise;
|
|
389
|
+
for (const interceptor of this.interceptors) {
|
|
390
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
return interceptorPromise.then(() => {
|
|
394
|
+
if (Object.keys(localVarFormParams).length) {
|
|
395
|
+
if (localVarUseFormData) {
|
|
396
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
397
|
+
} else {
|
|
398
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
return new Promise<{ response: http.IncomingMessage; body: GetAccountHealth200Response; }>((resolve, reject) => {
|
|
402
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
403
|
+
if (error) {
|
|
404
|
+
reject(error);
|
|
405
|
+
} else {
|
|
406
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
407
|
+
body = ObjectSerializer.deserialize(body, "GetAccountHealth200Response");
|
|
408
|
+
resolve({ response: response, body: body });
|
|
409
|
+
} else {
|
|
410
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
});
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Returns all social media accounts connected to the workspace, newest first. Optional filters narrow the list.
|
|
177
419
|
* @summary List accounts
|
|
178
420
|
* @param workspaceUuid UUID of the workspace.
|
|
421
|
+
* @param keyword Match the account name or username.
|
|
422
|
+
* @param group Only accounts in this account group.
|
|
423
|
+
* @param providers Only accounts of these providers (for example `instagram`, `linkedin`).
|
|
424
|
+
* @param unauthorized When `true`, only accounts that need to be reconnected.
|
|
179
425
|
*/
|
|
180
|
-
public async listAccounts (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListAccounts200Response; }> {
|
|
426
|
+
public async listAccounts (workspaceUuid: string, keyword?: string, group?: string, providers?: Array<string>, unauthorized?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListAccounts200Response; }> {
|
|
181
427
|
const localVarPath = this.basePath + '/{workspaceUuid}/accounts'
|
|
182
428
|
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
183
429
|
let localVarQueryParameters: any = {};
|
|
@@ -196,6 +442,22 @@ export class AccountsApi {
|
|
|
196
442
|
throw new Error('Required parameter workspaceUuid was null or undefined when calling listAccounts.');
|
|
197
443
|
}
|
|
198
444
|
|
|
445
|
+
if (keyword !== undefined) {
|
|
446
|
+
localVarQueryParameters['keyword'] = ObjectSerializer.serialize(keyword, "string");
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
if (group !== undefined) {
|
|
450
|
+
localVarQueryParameters['group'] = ObjectSerializer.serialize(group, "string");
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
if (providers !== undefined) {
|
|
454
|
+
localVarQueryParameters['providers[]'] = ObjectSerializer.serialize(providers, "Array<string>");
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
if (unauthorized !== undefined) {
|
|
458
|
+
localVarQueryParameters['unauthorized'] = ObjectSerializer.serialize(unauthorized, "boolean");
|
|
459
|
+
}
|
|
460
|
+
|
|
199
461
|
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
200
462
|
|
|
201
463
|
let localVarUseFormData = false;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
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`. ## 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
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.14.0
|
|
6
|
+
* Contact: hi@postboost.co
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
import localVarRequest from 'request';
|
|
15
|
+
import http from 'http';
|
|
16
|
+
|
|
17
|
+
/* tslint:disable:no-unused-locals */
|
|
18
|
+
import { ApiActivityOutcome } from '../model/apiActivityOutcome';
|
|
19
|
+
import { ListApiActivity200Response } from '../model/listApiActivity200Response';
|
|
20
|
+
|
|
21
|
+
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
22
|
+
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
|
23
|
+
|
|
24
|
+
import { HttpError, RequestFile } from './apis';
|
|
25
|
+
|
|
26
|
+
let defaultBasePath = 'https://postboost.co/app/api';
|
|
27
|
+
|
|
28
|
+
// ===============================================
|
|
29
|
+
// This file is autogenerated - Please do not edit
|
|
30
|
+
// ===============================================
|
|
31
|
+
|
|
32
|
+
export enum ActivityApiApiKeys {
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export class ActivityApi {
|
|
36
|
+
protected _basePath = defaultBasePath;
|
|
37
|
+
protected _defaultHeaders : any = {};
|
|
38
|
+
protected _useQuerystring : boolean = false;
|
|
39
|
+
|
|
40
|
+
protected authentications = {
|
|
41
|
+
'default': <Authentication>new VoidAuth(),
|
|
42
|
+
'bearerAuth': new HttpBearerAuth(),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
protected interceptors: Interceptor[] = [];
|
|
46
|
+
|
|
47
|
+
constructor(basePath?: string);
|
|
48
|
+
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
49
|
+
if (password) {
|
|
50
|
+
if (basePath) {
|
|
51
|
+
this.basePath = basePath;
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
if (basePathOrUsername) {
|
|
55
|
+
this.basePath = basePathOrUsername
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
set useQuerystring(value: boolean) {
|
|
61
|
+
this._useQuerystring = value;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
set basePath(basePath: string) {
|
|
65
|
+
this._basePath = basePath;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
69
|
+
this._defaultHeaders = defaultHeaders;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
get defaultHeaders() {
|
|
73
|
+
return this._defaultHeaders;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
get basePath() {
|
|
77
|
+
return this._basePath;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
public setDefaultAuthentication(auth: Authentication) {
|
|
81
|
+
this.authentications.default = auth;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public setApiKey(key: ActivityApiApiKeys, value: string) {
|
|
85
|
+
(this.authentications as any)[ActivityApiApiKeys[key]].apiKey = value;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
set accessToken(accessToken: string | (() => string)) {
|
|
89
|
+
this.authentications.bearerAuth.accessToken = accessToken;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
public addInterceptor(interceptor: Interceptor) {
|
|
93
|
+
this.interceptors.push(interceptor);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Every write request (`POST`, `PUT`, `DELETE`) made through the API in this workspace, newest first, with the client that made it and its outcome. Kept for 90 days. Send an `X-PostBoost-Client` header (for example `my-agent/1.2`) to label your requests; otherwise the `User-Agent` is recorded.
|
|
98
|
+
* @summary List API activity
|
|
99
|
+
* @param workspaceUuid UUID of the workspace.
|
|
100
|
+
* @param outcome
|
|
101
|
+
* @param client Client label prefix, for example `mcp`.
|
|
102
|
+
* @param since Only entries at or after this time (UTC).
|
|
103
|
+
* @param page
|
|
104
|
+
*/
|
|
105
|
+
public async listApiActivity (workspaceUuid: string, outcome?: ApiActivityOutcome, client?: string, since?: Date, page?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListApiActivity200Response; }> {
|
|
106
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/activity'
|
|
107
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
108
|
+
let localVarQueryParameters: any = {};
|
|
109
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
110
|
+
const produces = ['application/json'];
|
|
111
|
+
// give precedence to 'application/json'
|
|
112
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
113
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
114
|
+
} else {
|
|
115
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
116
|
+
}
|
|
117
|
+
let localVarFormParams: any = {};
|
|
118
|
+
|
|
119
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
120
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
121
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling listApiActivity.');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (outcome !== undefined) {
|
|
125
|
+
localVarQueryParameters['outcome'] = ObjectSerializer.serialize(outcome, "ApiActivityOutcome");
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (client !== undefined) {
|
|
129
|
+
localVarQueryParameters['client'] = ObjectSerializer.serialize(client, "string");
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (since !== undefined) {
|
|
133
|
+
localVarQueryParameters['since'] = ObjectSerializer.serialize(since, "Date");
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (page !== undefined) {
|
|
137
|
+
localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number");
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
141
|
+
|
|
142
|
+
let localVarUseFormData = false;
|
|
143
|
+
|
|
144
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
145
|
+
method: 'GET',
|
|
146
|
+
qs: localVarQueryParameters,
|
|
147
|
+
headers: localVarHeaderParams,
|
|
148
|
+
uri: localVarPath,
|
|
149
|
+
useQuerystring: this._useQuerystring,
|
|
150
|
+
json: true,
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
let authenticationPromise = Promise.resolve();
|
|
154
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
155
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
156
|
+
}
|
|
157
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
158
|
+
|
|
159
|
+
let interceptorPromise = authenticationPromise;
|
|
160
|
+
for (const interceptor of this.interceptors) {
|
|
161
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return interceptorPromise.then(() => {
|
|
165
|
+
if (Object.keys(localVarFormParams).length) {
|
|
166
|
+
if (localVarUseFormData) {
|
|
167
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
168
|
+
} else {
|
|
169
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return new Promise<{ response: http.IncomingMessage; body: ListApiActivity200Response; }>((resolve, reject) => {
|
|
173
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
174
|
+
if (error) {
|
|
175
|
+
reject(error);
|
|
176
|
+
} else {
|
|
177
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
178
|
+
body = ObjectSerializer.deserialize(body, "ListApiActivity200Response");
|
|
179
|
+
resolve({ response: response, body: body });
|
|
180
|
+
} else {
|
|
181
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|