postboost 1.8.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 +244 -2
- package/api/activityApi.ts +188 -0
- package/api/agentsApi.ts +918 -0
- package/api/analyticsApi.ts +551 -2
- package/api/apis.ts +19 -1
- package/api/competitorsApi.ts +412 -0
- package/api/hashtagGroupsApi.ts +501 -0
- package/api/inboxApi.ts +957 -0
- package/api/mediaApi.ts +97 -7
- package/api/mentionsApi.ts +5 -3
- package/api/postingScheduleApi.ts +497 -0
- package/api/postsApi.ts +1236 -99
- package/api/receiptsApi.ts +2 -2
- package/api/subscriptionsApi.ts +2 -2
- 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 +463 -2
- package/model/aICredits.ts +2 -2
- package/model/aIUsage.ts +39 -0
- package/model/aIUsageText.ts +52 -0
- package/model/account.ts +26 -4
- package/model/accountAnalytics.ts +2 -2
- package/model/accountAnalyticsInitialSync.ts +2 -2
- 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 +2 -2
- package/model/addCompetitor202Response.ts +43 -0
- package/model/addCompetitor409Response.ts +37 -0
- package/model/addGenericSubscriptionRequest.ts +2 -2
- package/model/addPostToQueueRequest.ts +2 -2
- 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 +2 -2
- package/model/analyticsSummary.ts +2 -2
- package/model/analyticsSummaryData.ts +2 -2
- 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 +2 -2
- package/model/bestPostingTimes.ts +2 -2
- package/model/bestPostingTimesTimesInner.ts +2 -2
- 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 +2 -2
- package/model/cancelSubscription422ResponseErrors.ts +2 -2
- package/model/cancelSubscriptionRequest.ts +2 -2
- 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 +2 -2
- 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 +2 -2
- package/model/createMention201Response.ts +2 -2
- 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 +2 -2
- package/model/deleteMediaBulkRequestItemsInner.ts +2 -2
- package/model/deleteMediaFolderRequest.ts +2 -2
- 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 +2 -2
- package/model/initiateRemoteUpload201ResponseOneOf.ts +2 -2
- package/model/initiateRemoteUploadRequest.ts +2 -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 +2 -2
- package/model/listMentions200Response.ts +2 -2
- package/model/listMyWorkspaces200Response.ts +2 -2
- 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 +2 -2
- package/model/mediaBase64Input.ts +61 -0
- package/model/mediaFolder.ts +2 -2
- package/model/mediaFolderInput.ts +2 -2
- package/model/mediaFolderRef.ts +2 -2
- package/model/mention.ts +2 -2
- package/model/mentionIdentity.ts +2 -2
- package/model/mentionIdentityInput.ts +2 -2
- package/model/mentionInput.ts +2 -2
- package/model/messageOnly.ts +31 -0
- package/model/models.ts +475 -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 +2 -2
- package/model/postAnalytics.ts +2 -2
- package/model/postContent.ts +6 -3
- package/model/postInput.ts +20 -2
- package/model/postOptionsInstagram.ts +59 -0
- package/model/postOptionsTikTok.ts +97 -0
- package/model/postOptionsYoutube.ts +62 -0
- package/model/postStatus.ts +2 -2
- package/model/postVersion.ts +7 -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 +2 -2
- package/model/postingTimes.ts +2 -2
- package/model/postingTimesBestInner.ts +2 -2
- package/model/postingTimesDayIntervalsInnerInner.ts +2 -2
- package/model/postingTimesDaysInner.ts +2 -2
- package/model/preflightResult.ts +69 -0
- package/model/publicWorkspace.ts +2 -2
- package/model/publicWorkspacePivot.ts +2 -2
- package/model/publishProgress.ts +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/model/scheduleResult.ts +2 -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 +2 -2
- package/model/uploadChunk201Response.ts +2 -2
- package/model/user.ts +2 -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 +2 -2
- 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 +2 -2
- package/model/workspaceUserInput.ts +2 -2
- package/model/xUsage.ts +68 -0
- package/model/xUsageCounter.ts +40 -0
- package/package.json +1 -1
|
@@ -0,0 +1,497 @@
|
|
|
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 { GetPostingSchedule200Response } from '../model/getPostingSchedule200Response';
|
|
19
|
+
import { PostingScheduleInput } from '../model/postingScheduleInput';
|
|
20
|
+
import { QueueSlots } from '../model/queueSlots';
|
|
21
|
+
import { RecommendedPostingTimes } from '../model/recommendedPostingTimes';
|
|
22
|
+
|
|
23
|
+
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
24
|
+
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
|
25
|
+
|
|
26
|
+
import { HttpError, RequestFile } from './apis';
|
|
27
|
+
|
|
28
|
+
let defaultBasePath = 'https://postboost.co/app/api';
|
|
29
|
+
|
|
30
|
+
// ===============================================
|
|
31
|
+
// This file is autogenerated - Please do not edit
|
|
32
|
+
// ===============================================
|
|
33
|
+
|
|
34
|
+
export enum PostingScheduleApiApiKeys {
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export class PostingScheduleApi {
|
|
38
|
+
protected _basePath = defaultBasePath;
|
|
39
|
+
protected _defaultHeaders : any = {};
|
|
40
|
+
protected _useQuerystring : boolean = false;
|
|
41
|
+
|
|
42
|
+
protected authentications = {
|
|
43
|
+
'default': <Authentication>new VoidAuth(),
|
|
44
|
+
'bearerAuth': new HttpBearerAuth(),
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
protected interceptors: Interceptor[] = [];
|
|
48
|
+
|
|
49
|
+
constructor(basePath?: string);
|
|
50
|
+
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
51
|
+
if (password) {
|
|
52
|
+
if (basePath) {
|
|
53
|
+
this.basePath = basePath;
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
if (basePathOrUsername) {
|
|
57
|
+
this.basePath = basePathOrUsername
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
set useQuerystring(value: boolean) {
|
|
63
|
+
this._useQuerystring = value;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
set basePath(basePath: string) {
|
|
67
|
+
this._basePath = basePath;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
71
|
+
this._defaultHeaders = defaultHeaders;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
get defaultHeaders() {
|
|
75
|
+
return this._defaultHeaders;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
get basePath() {
|
|
79
|
+
return this._basePath;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public setDefaultAuthentication(auth: Authentication) {
|
|
83
|
+
this.authentications.default = auth;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public setApiKey(key: PostingScheduleApiApiKeys, value: string) {
|
|
87
|
+
(this.authentications as any)[PostingScheduleApiApiKeys[key]].apiKey = value;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
set accessToken(accessToken: string | (() => string)) {
|
|
91
|
+
this.authentications.bearerAuth.accessToken = accessToken;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
public addInterceptor(interceptor: Interceptor) {
|
|
95
|
+
this.interceptors.push(interceptor);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The queue\'s posting times: per weekday, a list of clock times in the schedule\'s timezone. `account_id=0` is the workspace schedule. An account without its own schedule follows the workspace one (`inherited: true`, `source_account_id: 0`). Posts added to the queue take the next free time.
|
|
100
|
+
* @summary Get the posting schedule
|
|
101
|
+
* @param workspaceUuid UUID of the workspace.
|
|
102
|
+
* @param accountId `0` (default) for the workspace schedule, or an account `id`.
|
|
103
|
+
*/
|
|
104
|
+
public async getPostingSchedule (workspaceUuid: string, accountId?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetPostingSchedule200Response; }> {
|
|
105
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/posting-schedule'
|
|
106
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
107
|
+
let localVarQueryParameters: any = {};
|
|
108
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
109
|
+
const produces = ['application/json'];
|
|
110
|
+
// give precedence to 'application/json'
|
|
111
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
112
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
113
|
+
} else {
|
|
114
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
115
|
+
}
|
|
116
|
+
let localVarFormParams: any = {};
|
|
117
|
+
|
|
118
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
119
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
120
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling getPostingSchedule.');
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (accountId !== undefined) {
|
|
124
|
+
localVarQueryParameters['account_id'] = ObjectSerializer.serialize(accountId, "number");
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
128
|
+
|
|
129
|
+
let localVarUseFormData = false;
|
|
130
|
+
|
|
131
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
132
|
+
method: 'GET',
|
|
133
|
+
qs: localVarQueryParameters,
|
|
134
|
+
headers: localVarHeaderParams,
|
|
135
|
+
uri: localVarPath,
|
|
136
|
+
useQuerystring: this._useQuerystring,
|
|
137
|
+
json: true,
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
let authenticationPromise = Promise.resolve();
|
|
141
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
142
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
143
|
+
}
|
|
144
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
145
|
+
|
|
146
|
+
let interceptorPromise = authenticationPromise;
|
|
147
|
+
for (const interceptor of this.interceptors) {
|
|
148
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return interceptorPromise.then(() => {
|
|
152
|
+
if (Object.keys(localVarFormParams).length) {
|
|
153
|
+
if (localVarUseFormData) {
|
|
154
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
155
|
+
} else {
|
|
156
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return new Promise<{ response: http.IncomingMessage; body: GetPostingSchedule200Response; }>((resolve, reject) => {
|
|
160
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
161
|
+
if (error) {
|
|
162
|
+
reject(error);
|
|
163
|
+
} else {
|
|
164
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
165
|
+
body = ObjectSerializer.deserialize(body, "GetPostingSchedule200Response");
|
|
166
|
+
resolve({ response: response, body: body });
|
|
167
|
+
} else {
|
|
168
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Suggested posting times from past engagement, in the schedule\'s timezone. `has_data` is false until there is enough analytics history.
|
|
177
|
+
* @summary Get recommended posting times
|
|
178
|
+
* @param workspaceUuid UUID of the workspace.
|
|
179
|
+
* @param accountId `0` (default) for the workspace schedule, or an account `id`.
|
|
180
|
+
* @param slotsPerDay Times to suggest per day (1 to 6).
|
|
181
|
+
*/
|
|
182
|
+
public async getRecommendedPostingTimes (workspaceUuid: string, accountId?: number, slotsPerDay?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: RecommendedPostingTimes; }> {
|
|
183
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/posting-schedule/recommended'
|
|
184
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
185
|
+
let localVarQueryParameters: any = {};
|
|
186
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
187
|
+
const produces = ['application/json'];
|
|
188
|
+
// give precedence to 'application/json'
|
|
189
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
190
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
191
|
+
} else {
|
|
192
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
193
|
+
}
|
|
194
|
+
let localVarFormParams: any = {};
|
|
195
|
+
|
|
196
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
197
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
198
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling getRecommendedPostingTimes.');
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (accountId !== undefined) {
|
|
202
|
+
localVarQueryParameters['account_id'] = ObjectSerializer.serialize(accountId, "number");
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (slotsPerDay !== undefined) {
|
|
206
|
+
localVarQueryParameters['slots_per_day'] = ObjectSerializer.serialize(slotsPerDay, "number");
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
210
|
+
|
|
211
|
+
let localVarUseFormData = false;
|
|
212
|
+
|
|
213
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
214
|
+
method: 'GET',
|
|
215
|
+
qs: localVarQueryParameters,
|
|
216
|
+
headers: localVarHeaderParams,
|
|
217
|
+
uri: localVarPath,
|
|
218
|
+
useQuerystring: this._useQuerystring,
|
|
219
|
+
json: true,
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
let authenticationPromise = Promise.resolve();
|
|
223
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
224
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
225
|
+
}
|
|
226
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
227
|
+
|
|
228
|
+
let interceptorPromise = authenticationPromise;
|
|
229
|
+
for (const interceptor of this.interceptors) {
|
|
230
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return interceptorPromise.then(() => {
|
|
234
|
+
if (Object.keys(localVarFormParams).length) {
|
|
235
|
+
if (localVarUseFormData) {
|
|
236
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
237
|
+
} else {
|
|
238
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return new Promise<{ response: http.IncomingMessage; body: RecommendedPostingTimes; }>((resolve, reject) => {
|
|
242
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
243
|
+
if (error) {
|
|
244
|
+
reject(error);
|
|
245
|
+
} else {
|
|
246
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
247
|
+
body = ObjectSerializer.deserialize(body, "RecommendedPostingTimes");
|
|
248
|
+
resolve({ response: response, body: body });
|
|
249
|
+
} else {
|
|
250
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* The queue read forward: upcoming posting times, filled by scheduled posts where they land on one. Page with `after` set to the previous `next_cursor`.
|
|
259
|
+
* @summary List upcoming queue slots
|
|
260
|
+
* @param workspaceUuid UUID of the workspace.
|
|
261
|
+
* @param accountId `0` (default) for the workspace schedule, or an account `id`.
|
|
262
|
+
* @param after Start after this time (`Y-m-d H:i:s`, UTC), from `next_cursor`.
|
|
263
|
+
*/
|
|
264
|
+
public async listQueueSlots (workspaceUuid: string, accountId?: number, after?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: QueueSlots; }> {
|
|
265
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/queue/slots'
|
|
266
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
267
|
+
let localVarQueryParameters: any = {};
|
|
268
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
269
|
+
const produces = ['application/json'];
|
|
270
|
+
// give precedence to 'application/json'
|
|
271
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
272
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
273
|
+
} else {
|
|
274
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
275
|
+
}
|
|
276
|
+
let localVarFormParams: any = {};
|
|
277
|
+
|
|
278
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
279
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
280
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling listQueueSlots.');
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
if (accountId !== undefined) {
|
|
284
|
+
localVarQueryParameters['account_id'] = ObjectSerializer.serialize(accountId, "number");
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
if (after !== undefined) {
|
|
288
|
+
localVarQueryParameters['after'] = ObjectSerializer.serialize(after, "string");
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
292
|
+
|
|
293
|
+
let localVarUseFormData = false;
|
|
294
|
+
|
|
295
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
296
|
+
method: 'GET',
|
|
297
|
+
qs: localVarQueryParameters,
|
|
298
|
+
headers: localVarHeaderParams,
|
|
299
|
+
uri: localVarPath,
|
|
300
|
+
useQuerystring: this._useQuerystring,
|
|
301
|
+
json: true,
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
let authenticationPromise = Promise.resolve();
|
|
305
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
306
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
307
|
+
}
|
|
308
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
309
|
+
|
|
310
|
+
let interceptorPromise = authenticationPromise;
|
|
311
|
+
for (const interceptor of this.interceptors) {
|
|
312
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
return interceptorPromise.then(() => {
|
|
316
|
+
if (Object.keys(localVarFormParams).length) {
|
|
317
|
+
if (localVarUseFormData) {
|
|
318
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
319
|
+
} else {
|
|
320
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return new Promise<{ response: http.IncomingMessage; body: QueueSlots; }>((resolve, reject) => {
|
|
324
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
325
|
+
if (error) {
|
|
326
|
+
reject(error);
|
|
327
|
+
} else {
|
|
328
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
329
|
+
body = ObjectSerializer.deserialize(body, "QueueSlots");
|
|
330
|
+
resolve({ response: response, body: body });
|
|
331
|
+
} else {
|
|
332
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
});
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Removes the account\'s own schedule so it follows the workspace schedule again. Workspace admins only.
|
|
341
|
+
* @summary Reset an account schedule
|
|
342
|
+
* @param workspaceUuid UUID of the workspace.
|
|
343
|
+
* @param accountId The account `id`.
|
|
344
|
+
*/
|
|
345
|
+
public async resetAccountPostingSchedule (workspaceUuid: string, accountId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetPostingSchedule200Response; }> {
|
|
346
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/posting-schedule/{accountId}'
|
|
347
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
|
|
348
|
+
.replace('{' + 'accountId' + '}', encodeURIComponent(String(accountId)));
|
|
349
|
+
let localVarQueryParameters: any = {};
|
|
350
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
351
|
+
const produces = ['application/json'];
|
|
352
|
+
// give precedence to 'application/json'
|
|
353
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
354
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
355
|
+
} else {
|
|
356
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
357
|
+
}
|
|
358
|
+
let localVarFormParams: any = {};
|
|
359
|
+
|
|
360
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
361
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
362
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling resetAccountPostingSchedule.');
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// verify required parameter 'accountId' is not null or undefined
|
|
366
|
+
if (accountId === null || accountId === undefined) {
|
|
367
|
+
throw new Error('Required parameter accountId was null or undefined when calling resetAccountPostingSchedule.');
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
371
|
+
|
|
372
|
+
let localVarUseFormData = false;
|
|
373
|
+
|
|
374
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
375
|
+
method: 'DELETE',
|
|
376
|
+
qs: localVarQueryParameters,
|
|
377
|
+
headers: localVarHeaderParams,
|
|
378
|
+
uri: localVarPath,
|
|
379
|
+
useQuerystring: this._useQuerystring,
|
|
380
|
+
json: true,
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
let authenticationPromise = Promise.resolve();
|
|
384
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
385
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
386
|
+
}
|
|
387
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
388
|
+
|
|
389
|
+
let interceptorPromise = authenticationPromise;
|
|
390
|
+
for (const interceptor of this.interceptors) {
|
|
391
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
return interceptorPromise.then(() => {
|
|
395
|
+
if (Object.keys(localVarFormParams).length) {
|
|
396
|
+
if (localVarUseFormData) {
|
|
397
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
398
|
+
} else {
|
|
399
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
return new Promise<{ response: http.IncomingMessage; body: GetPostingSchedule200Response; }>((resolve, reject) => {
|
|
403
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
404
|
+
if (error) {
|
|
405
|
+
reject(error);
|
|
406
|
+
} else {
|
|
407
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
408
|
+
body = ObjectSerializer.deserialize(body, "GetPostingSchedule200Response");
|
|
409
|
+
resolve({ response: response, body: body });
|
|
410
|
+
} else {
|
|
411
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
});
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Sets the workspace schedule (`account_id: 0`) or gives one account its own schedule. Send all seven weekdays (ids 1 to 6 for Monday to Saturday, 0 for Sunday). Workspace admins only.
|
|
420
|
+
* @summary Set the posting schedule
|
|
421
|
+
* @param workspaceUuid UUID of the workspace.
|
|
422
|
+
* @param postingScheduleInput
|
|
423
|
+
*/
|
|
424
|
+
public async updatePostingSchedule (workspaceUuid: string, postingScheduleInput: PostingScheduleInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetPostingSchedule200Response; }> {
|
|
425
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/posting-schedule'
|
|
426
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
427
|
+
let localVarQueryParameters: any = {};
|
|
428
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
429
|
+
const produces = ['application/json'];
|
|
430
|
+
// give precedence to 'application/json'
|
|
431
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
432
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
433
|
+
} else {
|
|
434
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
435
|
+
}
|
|
436
|
+
let localVarFormParams: any = {};
|
|
437
|
+
|
|
438
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
439
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
440
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling updatePostingSchedule.');
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// verify required parameter 'postingScheduleInput' is not null or undefined
|
|
444
|
+
if (postingScheduleInput === null || postingScheduleInput === undefined) {
|
|
445
|
+
throw new Error('Required parameter postingScheduleInput was null or undefined when calling updatePostingSchedule.');
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
449
|
+
|
|
450
|
+
let localVarUseFormData = false;
|
|
451
|
+
|
|
452
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
453
|
+
method: 'PUT',
|
|
454
|
+
qs: localVarQueryParameters,
|
|
455
|
+
headers: localVarHeaderParams,
|
|
456
|
+
uri: localVarPath,
|
|
457
|
+
useQuerystring: this._useQuerystring,
|
|
458
|
+
json: true,
|
|
459
|
+
body: ObjectSerializer.serialize(postingScheduleInput, "PostingScheduleInput")
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
let authenticationPromise = Promise.resolve();
|
|
463
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
464
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
465
|
+
}
|
|
466
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
467
|
+
|
|
468
|
+
let interceptorPromise = authenticationPromise;
|
|
469
|
+
for (const interceptor of this.interceptors) {
|
|
470
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
return interceptorPromise.then(() => {
|
|
474
|
+
if (Object.keys(localVarFormParams).length) {
|
|
475
|
+
if (localVarUseFormData) {
|
|
476
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
477
|
+
} else {
|
|
478
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
return new Promise<{ response: http.IncomingMessage; body: GetPostingSchedule200Response; }>((resolve, reject) => {
|
|
482
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
483
|
+
if (error) {
|
|
484
|
+
reject(error);
|
|
485
|
+
} else {
|
|
486
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
487
|
+
body = ObjectSerializer.deserialize(body, "GetPostingSchedule200Response");
|
|
488
|
+
resolve({ response: response, body: body });
|
|
489
|
+
} else {
|
|
490
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
});
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
}
|