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.
Files changed (288) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.yml +26 -0
  2. package/.github/ISSUE_TEMPLATE/config.yml +11 -0
  3. package/.github/ISSUE_TEMPLATE/feature_request.yml +14 -0
  4. package/.github/pull_request_template.md +6 -0
  5. package/CODE_OF_CONDUCT.md +7 -0
  6. package/CONTRIBUTING.md +31 -0
  7. package/README.md +46 -2
  8. package/SECURITY.md +9 -0
  9. package/api/aIApi.ts +460 -2
  10. package/api/accountGroupsApi.ts +501 -0
  11. package/api/accountsApi.ts +244 -2
  12. package/api/activityApi.ts +188 -0
  13. package/api/agentsApi.ts +918 -0
  14. package/api/analyticsApi.ts +551 -2
  15. package/api/apis.ts +19 -1
  16. package/api/competitorsApi.ts +412 -0
  17. package/api/hashtagGroupsApi.ts +501 -0
  18. package/api/inboxApi.ts +957 -0
  19. package/api/mediaApi.ts +97 -7
  20. package/api/mentionsApi.ts +5 -3
  21. package/api/postingScheduleApi.ts +497 -0
  22. package/api/postsApi.ts +1236 -99
  23. package/api/receiptsApi.ts +2 -2
  24. package/api/subscriptionsApi.ts +2 -2
  25. package/api/tagsApi.ts +5 -3
  26. package/api/templatesApi.ts +501 -0
  27. package/api/usersApi.ts +2 -2
  28. package/api/webhooksApi.ts +327 -0
  29. package/api/workspacesApi.ts +463 -2
  30. package/model/aICredits.ts +2 -2
  31. package/model/aIUsage.ts +39 -0
  32. package/model/aIUsageText.ts +52 -0
  33. package/model/account.ts +26 -4
  34. package/model/accountAnalytics.ts +2 -2
  35. package/model/accountAnalyticsInitialSync.ts +2 -2
  36. package/model/accountConnectionHealth.ts +124 -0
  37. package/model/accountErrorsInner.ts +50 -0
  38. package/model/accountErrorsInnerOneOf.ts +49 -0
  39. package/model/accountGroup.ts +49 -0
  40. package/model/accountGroupInput.ts +40 -0
  41. package/model/accountHealth.ts +90 -0
  42. package/model/accountHealthDailyCap.ts +43 -0
  43. package/model/accountSchedule.ts +2 -2
  44. package/model/addCompetitor202Response.ts +43 -0
  45. package/model/addCompetitor409Response.ts +37 -0
  46. package/model/addGenericSubscriptionRequest.ts +2 -2
  47. package/model/addPostToQueueRequest.ts +2 -2
  48. package/model/agentPageMeta.ts +49 -0
  49. package/model/agentProposal.ts +137 -0
  50. package/model/agentProposalDecision.ts +31 -0
  51. package/model/agentRun.ts +129 -0
  52. package/model/analyticsPeriod.ts +2 -2
  53. package/model/analyticsSummary.ts +2 -2
  54. package/model/analyticsSummaryData.ts +2 -2
  55. package/model/apiActivity.ts +94 -0
  56. package/model/apiActivityOutcome.ts +27 -0
  57. package/model/apiKey.ts +77 -0
  58. package/model/apiKeyAbility.ts +21 -0
  59. package/model/apiKeyInput.ts +56 -0
  60. package/model/approveAgentProposal200Response.ts +32 -0
  61. package/model/approveAgentProposal409Response.ts +38 -0
  62. package/model/approveInboxReplyDraft403Response.ts +43 -0
  63. package/model/approvePostRequest.ts +2 -2
  64. package/model/bestPostingTimes.ts +2 -2
  65. package/model/bestPostingTimesTimesInner.ts +2 -2
  66. package/model/blogToSocial200Response.ts +9 -2
  67. package/model/blogToSocial429Response.ts +2 -2
  68. package/model/blogToSocialCaption.ts +2 -2
  69. package/model/blogToSocialInput.ts +11 -2
  70. package/model/blogToSocialMedia.ts +2 -2
  71. package/model/blogToSocialResponse.ts +2 -2
  72. package/model/brandVoice.ts +136 -0
  73. package/model/brandVoiceInput.ts +142 -0
  74. package/model/brandVoiceMeta.ts +34 -0
  75. package/model/cancelSubscription422Response.ts +2 -2
  76. package/model/cancelSubscription422ResponseErrors.ts +2 -2
  77. package/model/cancelSubscriptionRequest.ts +2 -2
  78. package/model/changeSubscriptionPlanRequest.ts +2 -2
  79. package/model/channelAccount.ts +101 -0
  80. package/model/checkoutSubscription200Response.ts +2 -2
  81. package/model/checkoutSubscriptionRequest.ts +2 -2
  82. package/model/codedError.ts +46 -0
  83. package/model/competitor.ts +82 -0
  84. package/model/competitorDetail.ts +96 -0
  85. package/model/competitorInput.ts +43 -0
  86. package/model/competitorMedia.ts +61 -0
  87. package/model/competitorSnapshot.ts +43 -0
  88. package/model/completeChunkedUploadRequest.ts +2 -2
  89. package/model/connectChannelInput.ts +64 -0
  90. package/model/createAccountGroup201Response.ts +32 -0
  91. package/model/createAgent201Response.ts +32 -0
  92. package/model/createApiKey201Response.ts +32 -0
  93. package/model/createApiKey201ResponseData.ts +86 -0
  94. package/model/createHashtagGroup201Response.ts +32 -0
  95. package/model/createInboxReplyDraft201Response.ts +32 -0
  96. package/model/createMediaFolderRequest.ts +2 -2
  97. package/model/createMention201Response.ts +2 -2
  98. package/model/createRecyclingRule201Response.ts +32 -0
  99. package/model/createReportExport201Response.ts +32 -0
  100. package/model/createResellerClient201Response.ts +32 -0
  101. package/model/createRssFeed201Response.ts +32 -0
  102. package/model/createTemplate201Response.ts +32 -0
  103. package/model/createWebhookSubscription201Response.ts +32 -0
  104. package/model/createWebhookSubscription201ResponseData.ts +70 -0
  105. package/model/deleteAgent200Response.ts +31 -0
  106. package/model/deleteMediaBulkRequest.ts +2 -2
  107. package/model/deleteMediaBulkRequestItemsInner.ts +2 -2
  108. package/model/deleteMediaFolderRequest.ts +2 -2
  109. package/model/deleteMode.ts +2 -2
  110. package/model/deletePostRequest.ts +2 -2
  111. package/model/deletePostsBulkRequest.ts +2 -2
  112. package/model/deleteReceiptsBulkRequest.ts +2 -2
  113. package/model/deleteResult.ts +2 -2
  114. package/model/deleteUser400Response.ts +2 -2
  115. package/model/deleteUsersBulkRequest.ts +2 -2
  116. package/model/deleteWorkspacesBulkRequest.ts +2 -2
  117. package/model/getAccountHealth200Response.ts +32 -0
  118. package/model/getBrandVoice200Response.ts +32 -0
  119. package/model/getCompetitor200Response.ts +32 -0
  120. package/model/getInboxConversation200Response.ts +32 -0
  121. package/model/getPostingSchedule200Response.ts +32 -0
  122. package/model/getRemoteUploadStatus200Response.ts +2 -2
  123. package/model/getReportBranding200Response.ts +32 -0
  124. package/model/guardrailError.ts +82 -0
  125. package/model/hashtagGroup.ts +46 -0
  126. package/model/hashtagGroupInput.ts +37 -0
  127. package/model/imageAltText200Response.ts +2 -2
  128. package/model/imageAltTextInput.ts +2 -2
  129. package/model/imageAltTextResponse.ts +2 -2
  130. package/model/imageCreditBalance.ts +67 -0
  131. package/model/imageEditInput.ts +11 -2
  132. package/model/imageGenerate200Response.ts +9 -2
  133. package/model/imageGenerate429Response.ts +2 -2
  134. package/model/imageGenerateInput.ts +14 -2
  135. package/model/imageGenerationResponse.ts +2 -2
  136. package/model/imagePrompt200Response.ts +9 -2
  137. package/model/imagePrompt429Response.ts +2 -2
  138. package/model/imagePromptInput.ts +14 -2
  139. package/model/imagePromptResponse.ts +2 -2
  140. package/model/imageVariations200Response.ts +2 -2
  141. package/model/imageVariationsInput.ts +2 -2
  142. package/model/imageVariationsResponse.ts +2 -2
  143. package/model/inboxAuthor.ts +43 -0
  144. package/model/inboxConversation.ts +139 -0
  145. package/model/inboxConversationAccount.ts +49 -0
  146. package/model/inboxConversationUpdate.ts +43 -0
  147. package/model/inboxMessage.ts +95 -0
  148. package/model/inboxMessageAuthor.ts +43 -0
  149. package/model/inboxReplyDraft.ts +132 -0
  150. package/model/inboxReplyDraftApprove.ts +34 -0
  151. package/model/inboxReplyDraftEdit.ts +31 -0
  152. package/model/inboxReplyDraftInput.ts +43 -0
  153. package/model/initiateChunkedUpload201Response.ts +2 -2
  154. package/model/initiateChunkedUploadRequest.ts +2 -2
  155. package/model/initiateRemoteUpload201Response.ts +2 -2
  156. package/model/initiateRemoteUpload201ResponseOneOf.ts +2 -2
  157. package/model/initiateRemoteUploadRequest.ts +2 -2
  158. package/model/learnBrandVoiceInput.ts +61 -0
  159. package/model/learnBrandVoiceResponse.ts +39 -0
  160. package/model/learnBrandVoiceResponseMeta.ts +55 -0
  161. package/model/listAccountGroups200Response.ts +46 -0
  162. package/model/listAccounts200Response.ts +2 -2
  163. package/model/listAgentProposals200Response.ts +39 -0
  164. package/model/listAgentRuns200Response.ts +39 -0
  165. package/model/listAgents200Response.ts +32 -0
  166. package/model/listApiActivity200Response.ts +46 -0
  167. package/model/listApiKeys200Response.ts +32 -0
  168. package/model/listCompetitors200Response.ts +32 -0
  169. package/model/listHashtagGroups200Response.ts +46 -0
  170. package/model/listInboxConversations200Response.ts +46 -0
  171. package/model/listInboxReplyDrafts200Response.ts +46 -0
  172. package/model/listMedia200Response.ts +2 -2
  173. package/model/listMediaFolders200Response.ts +2 -2
  174. package/model/listMentions200Response.ts +2 -2
  175. package/model/listMyWorkspaces200Response.ts +2 -2
  176. package/model/listPosts200Response.ts +2 -2
  177. package/model/listReceipts200Response.ts +2 -2
  178. package/model/listRecyclingRules200Response.ts +32 -0
  179. package/model/listRecyclingRuns200Response.ts +32 -0
  180. package/model/listReportExports200Response.ts +32 -0
  181. package/model/listResellerClients200Response.ts +39 -0
  182. package/model/listRssFeeds200Response.ts +32 -0
  183. package/model/listTags200Response.ts +2 -2
  184. package/model/listTemplates200Response.ts +46 -0
  185. package/model/listUsers200Response.ts +2 -2
  186. package/model/listWebhookSubscriptions200Response.ts +32 -0
  187. package/model/listWorkspaces200Response.ts +2 -2
  188. package/model/media.ts +2 -2
  189. package/model/mediaBase64Input.ts +61 -0
  190. package/model/mediaFolder.ts +2 -2
  191. package/model/mediaFolderInput.ts +2 -2
  192. package/model/mediaFolderRef.ts +2 -2
  193. package/model/mention.ts +2 -2
  194. package/model/mentionIdentity.ts +2 -2
  195. package/model/mentionIdentityInput.ts +2 -2
  196. package/model/mentionInput.ts +2 -2
  197. package/model/messageOnly.ts +31 -0
  198. package/model/models.ts +475 -0
  199. package/model/paginationMeta.ts +2 -2
  200. package/model/paginationMetaLinks.ts +4 -4
  201. package/model/paginationMetaMeta.ts +4 -4
  202. package/model/pollRssFeed200Response.ts +50 -0
  203. package/model/post.ts +2 -2
  204. package/model/postAnalytics.ts +2 -2
  205. package/model/postContent.ts +6 -3
  206. package/model/postInput.ts +20 -2
  207. package/model/postOptionsInstagram.ts +59 -0
  208. package/model/postOptionsTikTok.ts +97 -0
  209. package/model/postOptionsYoutube.ts +62 -0
  210. package/model/postStatus.ts +2 -2
  211. package/model/postVersion.ts +7 -6
  212. package/model/postVersionOptions.ts +55 -0
  213. package/model/postingSchedule.ts +74 -0
  214. package/model/postingScheduleDay.ts +50 -0
  215. package/model/postingScheduleDayTimesInner.ts +34 -0
  216. package/model/postingScheduleInput.ts +53 -0
  217. package/model/postingTimeSlot.ts +2 -2
  218. package/model/postingTimes.ts +2 -2
  219. package/model/postingTimesBestInner.ts +2 -2
  220. package/model/postingTimesDayIntervalsInnerInner.ts +2 -2
  221. package/model/postingTimesDaysInner.ts +2 -2
  222. package/model/preflightResult.ts +69 -0
  223. package/model/publicWorkspace.ts +2 -2
  224. package/model/publicWorkspacePivot.ts +2 -2
  225. package/model/publishProgress.ts +2 -2
  226. package/model/queueSlots.ts +43 -0
  227. package/model/receipt.ts +2 -2
  228. package/model/receiptInput.ts +2 -2
  229. package/model/receiptUpdateInput.ts +2 -2
  230. package/model/recommendedPostingTimes.ts +61 -0
  231. package/model/reconnectLink.ts +46 -0
  232. package/model/recyclingRule.ts +117 -0
  233. package/model/recyclingRuleInput.ts +114 -0
  234. package/model/recyclingRuleSettings.ts +83 -0
  235. package/model/recyclingRuleUpdate.ts +71 -0
  236. package/model/recyclingRun.ts +71 -0
  237. package/model/removeGenericSubscription422Response.ts +2 -2
  238. package/model/removeUserFromWorkspaceRequest.ts +2 -2
  239. package/model/reportBranding.ts +61 -0
  240. package/model/reportBrandingInput.ts +55 -0
  241. package/model/reportExport.ts +121 -0
  242. package/model/reportExportInput.ts +91 -0
  243. package/model/repurposeContent200Response.ts +39 -0
  244. package/model/repurposeInput.ts +213 -0
  245. package/model/repurposeInputTheme.ts +46 -0
  246. package/model/repurposeResult.ts +89 -0
  247. package/model/repurposeResultMedia.ts +40 -0
  248. package/model/repurposeResultSource.ts +51 -0
  249. package/model/repurposeSlide.ts +43 -0
  250. package/model/resellerClient.ts +82 -0
  251. package/model/resellerClientInput.ts +31 -0
  252. package/model/resellerClientUsage.ts +43 -0
  253. package/model/retryPostAccountResult.ts +2 -2
  254. package/model/rssFeed.ts +100 -0
  255. package/model/rssFeedInput.ts +79 -0
  256. package/model/rssFeedUpdate.ts +73 -0
  257. package/model/runAgent202Response.ts +32 -0
  258. package/model/schedulePostRequest.ts +2 -2
  259. package/model/scheduleResult.ts +2 -2
  260. package/model/subscription.ts +2 -2
  261. package/model/subscriptionInput.ts +2 -2
  262. package/model/subscriptionStatus.ts +2 -2
  263. package/model/subscriptionUpdateInput.ts +2 -2
  264. package/model/tag.ts +2 -2
  265. package/model/tagInput.ts +2 -2
  266. package/model/template.ts +47 -0
  267. package/model/templateContentItem.ts +40 -0
  268. package/model/templateInput.ts +41 -0
  269. package/model/templateInputContentInner.ts +40 -0
  270. package/model/updateMediaRequest.ts +2 -2
  271. package/model/uploadChunk201Response.ts +2 -2
  272. package/model/user.ts +2 -2
  273. package/model/userInput.ts +2 -2
  274. package/model/userUpdateInput.ts +2 -2
  275. package/model/webhookEventName.ts +31 -0
  276. package/model/webhookEventPayload.ts +43 -0
  277. package/model/webhookSubscription.ts +61 -0
  278. package/model/webhookSubscriptionInput.ts +67 -0
  279. package/model/workspace.ts +2 -2
  280. package/model/workspaceAgent.ts +91 -0
  281. package/model/workspaceAgentInput.ts +67 -0
  282. package/model/workspaceAgentSettings.ts +70 -0
  283. package/model/workspaceAgentUpdate.ts +58 -0
  284. package/model/workspaceInput.ts +2 -2
  285. package/model/workspaceUserInput.ts +2 -2
  286. package/model/xUsage.ts +68 -0
  287. package/model/xUsageCounter.ts +40 -0
  288. package/package.json +1 -1
package/api/aIApi.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`. ## Plan access Every workspace-scoped endpoint returns `403` when the workspace\'s plan does not include API access (capability `api`). ## Dates and times Post dates and times (`date`, `time`, `accounts_schedule`) are read in the request\'s `timezone` when one is given, otherwise in the workspace timezone. ## Authentication All requests require a Bearer token in the `Authorization` header. Generate tokens in your PostBoost dashboard under **Settings → Access Tokens**. ``` Authorization: Bearer YOUR_API_TOKEN ```
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.8.0
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,9 +15,13 @@ import localVarRequest from 'request';
15
15
  import http from 'http';
16
16
 
17
17
  /* tslint:disable:no-unused-locals */
18
+ import { AIUsage } from '../model/aIUsage';
18
19
  import { BlogToSocial200Response } from '../model/blogToSocial200Response';
19
20
  import { BlogToSocial429Response } from '../model/blogToSocial429Response';
20
21
  import { BlogToSocialInput } from '../model/blogToSocialInput';
22
+ import { BrandVoiceInput } from '../model/brandVoiceInput';
23
+ import { CodedError } from '../model/codedError';
24
+ import { GetBrandVoice200Response } from '../model/getBrandVoice200Response';
21
25
  import { ImageAltText200Response } from '../model/imageAltText200Response';
22
26
  import { ImageAltTextInput } from '../model/imageAltTextInput';
23
27
  import { ImageEditInput } from '../model/imageEditInput';
@@ -29,6 +33,10 @@ import { ImagePrompt429Response } from '../model/imagePrompt429Response';
29
33
  import { ImagePromptInput } from '../model/imagePromptInput';
30
34
  import { ImageVariations200Response } from '../model/imageVariations200Response';
31
35
  import { ImageVariationsInput } from '../model/imageVariationsInput';
36
+ import { LearnBrandVoiceInput } from '../model/learnBrandVoiceInput';
37
+ import { LearnBrandVoiceResponse } from '../model/learnBrandVoiceResponse';
38
+ import { RepurposeContent200Response } from '../model/repurposeContent200Response';
39
+ import { RepurposeInput } from '../model/repurposeInput';
32
40
 
33
41
  import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
34
42
  import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
@@ -184,6 +192,222 @@ export class AIApi {
184
192
  });
185
193
  });
186
194
  }
195
+ /**
196
+ * Removes the workspace\'s brand voice. AI endpoints then run without one. Admins and members only.
197
+ * @summary Delete the brand voice
198
+ * @param workspaceUuid UUID of the workspace.
199
+ */
200
+ public async deleteBrandVoice (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
201
+ const localVarPath = this.basePath + '/{workspaceUuid}/brand-voice'
202
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
203
+ let localVarQueryParameters: any = {};
204
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
205
+ const produces = ['application/json'];
206
+ // give precedence to 'application/json'
207
+ if (produces.indexOf('application/json') >= 0) {
208
+ localVarHeaderParams.Accept = 'application/json';
209
+ } else {
210
+ localVarHeaderParams.Accept = produces.join(',');
211
+ }
212
+ let localVarFormParams: any = {};
213
+
214
+ // verify required parameter 'workspaceUuid' is not null or undefined
215
+ if (workspaceUuid === null || workspaceUuid === undefined) {
216
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling deleteBrandVoice.');
217
+ }
218
+
219
+ (<any>Object).assign(localVarHeaderParams, options.headers);
220
+
221
+ let localVarUseFormData = false;
222
+
223
+ let localVarRequestOptions: localVarRequest.Options = {
224
+ method: 'DELETE',
225
+ qs: localVarQueryParameters,
226
+ headers: localVarHeaderParams,
227
+ uri: localVarPath,
228
+ useQuerystring: this._useQuerystring,
229
+ json: true,
230
+ };
231
+
232
+ let authenticationPromise = Promise.resolve();
233
+ if (this.authentications.bearerAuth.accessToken) {
234
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
235
+ }
236
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
237
+
238
+ let interceptorPromise = authenticationPromise;
239
+ for (const interceptor of this.interceptors) {
240
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
241
+ }
242
+
243
+ return interceptorPromise.then(() => {
244
+ if (Object.keys(localVarFormParams).length) {
245
+ if (localVarUseFormData) {
246
+ (<any>localVarRequestOptions).formData = localVarFormParams;
247
+ } else {
248
+ localVarRequestOptions.form = localVarFormParams;
249
+ }
250
+ }
251
+ return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
252
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
253
+ if (error) {
254
+ reject(error);
255
+ } else {
256
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
257
+ body = ObjectSerializer.deserialize(body, "object");
258
+ resolve({ response: response, body: body });
259
+ } else {
260
+ reject(new HttpError(response, body, response.statusCode));
261
+ }
262
+ }
263
+ });
264
+ });
265
+ });
266
+ }
267
+ /**
268
+ * The workspace\'s AI credits: text credits (captions, rewrites, outlines, alt text; counted per billing cycle) and image credits (one per generated, edited or varied image, and one per repurpose carousel; counted per calendar month, UTC). `limit` and `remaining` are `null` when the workspace has no limit. Readable when credits are used up; costs nothing. When image credits run out, the image endpoints and carousels answer `429` with `code: image_credits_exhausted`; when text credits run out, the AI endpoints answer `429` with `code: ai_credits_exhausted`. Image endpoint responses also carry `image_credits_used` and `image_credits_remaining`; their `credits_used` counts text credits only. If the image pool is switched off (`image.enabled: false`), images cost text credits as before.
269
+ * @summary AI credit usage
270
+ * @param workspaceUuid UUID of the workspace.
271
+ */
272
+ public async getAIUsage (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: AIUsage; }> {
273
+ const localVarPath = this.basePath + '/{workspaceUuid}/usage/ai'
274
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
275
+ let localVarQueryParameters: any = {};
276
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
277
+ const produces = ['application/json'];
278
+ // give precedence to 'application/json'
279
+ if (produces.indexOf('application/json') >= 0) {
280
+ localVarHeaderParams.Accept = 'application/json';
281
+ } else {
282
+ localVarHeaderParams.Accept = produces.join(',');
283
+ }
284
+ let localVarFormParams: any = {};
285
+
286
+ // verify required parameter 'workspaceUuid' is not null or undefined
287
+ if (workspaceUuid === null || workspaceUuid === undefined) {
288
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling getAIUsage.');
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: AIUsage; }>((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, "AIUsage");
330
+ resolve({ response: response, body: body });
331
+ } else {
332
+ reject(new HttpError(response, body, response.statusCode));
333
+ }
334
+ }
335
+ });
336
+ });
337
+ });
338
+ }
339
+ /**
340
+ * The workspace\'s brand voice: identity, audience, tone sliders, style rules and example posts. It is the same profile as the Brand Voice page in the app (one per workspace). `data` is `null` when no voice is set. Any workspace member may read it; reading costs no AI credits. The AI endpoints apply it automatically: `blog-to-social` adds it to the caption instructions, `image-prompt` and `image-generate` turn it into a short visual tone line, and `image-edit` applies it when you send `use_brand_voice: true`. `image-variations` and `image-alt-text` never use it (alt text must describe the image literally). Send `use_brand_voice: false` to skip it on a call; responses report `meta.brand_voice_applied`.
341
+ * @summary Get the brand voice
342
+ * @param workspaceUuid UUID of the workspace.
343
+ */
344
+ public async getBrandVoice (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetBrandVoice200Response; }> {
345
+ const localVarPath = this.basePath + '/{workspaceUuid}/brand-voice'
346
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
347
+ let localVarQueryParameters: any = {};
348
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
349
+ const produces = ['application/json'];
350
+ // give precedence to 'application/json'
351
+ if (produces.indexOf('application/json') >= 0) {
352
+ localVarHeaderParams.Accept = 'application/json';
353
+ } else {
354
+ localVarHeaderParams.Accept = produces.join(',');
355
+ }
356
+ let localVarFormParams: any = {};
357
+
358
+ // verify required parameter 'workspaceUuid' is not null or undefined
359
+ if (workspaceUuid === null || workspaceUuid === undefined) {
360
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling getBrandVoice.');
361
+ }
362
+
363
+ (<any>Object).assign(localVarHeaderParams, options.headers);
364
+
365
+ let localVarUseFormData = false;
366
+
367
+ let localVarRequestOptions: localVarRequest.Options = {
368
+ method: 'GET',
369
+ qs: localVarQueryParameters,
370
+ headers: localVarHeaderParams,
371
+ uri: localVarPath,
372
+ useQuerystring: this._useQuerystring,
373
+ json: true,
374
+ };
375
+
376
+ let authenticationPromise = Promise.resolve();
377
+ if (this.authentications.bearerAuth.accessToken) {
378
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
379
+ }
380
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
381
+
382
+ let interceptorPromise = authenticationPromise;
383
+ for (const interceptor of this.interceptors) {
384
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
385
+ }
386
+
387
+ return interceptorPromise.then(() => {
388
+ if (Object.keys(localVarFormParams).length) {
389
+ if (localVarUseFormData) {
390
+ (<any>localVarRequestOptions).formData = localVarFormParams;
391
+ } else {
392
+ localVarRequestOptions.form = localVarFormParams;
393
+ }
394
+ }
395
+ return new Promise<{ response: http.IncomingMessage; body: GetBrandVoice200Response; }>((resolve, reject) => {
396
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
397
+ if (error) {
398
+ reject(error);
399
+ } else {
400
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
401
+ body = ObjectSerializer.deserialize(body, "GetBrandVoice200Response");
402
+ resolve({ response: response, body: body });
403
+ } else {
404
+ reject(new HttpError(response, body, response.statusCode));
405
+ }
406
+ }
407
+ });
408
+ });
409
+ });
410
+ }
187
411
  /**
188
412
  * Analyzes an existing workspace media item and generates accessible alt text. The alt text is saved back to the media record. Costs 1 AI credit per call.
189
413
  * @summary Generate alt text for a media image using AI
@@ -579,4 +803,238 @@ export class AIApi {
579
803
  });
580
804
  });
581
805
  }
806
+ /**
807
+ * Reads the workspace\'s latest published posts (original text) and proposes a brand voice in the same shape as `GET /brand-voice`. Returns a draft and saves nothing unless `apply: true`. Without `overwrite`, learned values only fill fields that are empty (tone sliders and styles still at their defaults count as empty); with `overwrite: true` they replace them. The first five sampled posts become `example_posts`. Needs at least 3 published posts (`422`, `code: not_enough_posts`). Costs one AI text credit per AI call (one retry when the reply is not usable). Admins and members only. A key limited to some accounts must send `account_ids`; only posts whose accounts are all among them are read. `apply` also needs the `write` ability.
808
+ * @summary Learn a brand voice from past posts
809
+ * @param workspaceUuid UUID of the workspace.
810
+ * @param learnBrandVoiceInput
811
+ */
812
+ public async learnBrandVoice (workspaceUuid: string, learnBrandVoiceInput?: LearnBrandVoiceInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: LearnBrandVoiceResponse; }> {
813
+ const localVarPath = this.basePath + '/{workspaceUuid}/brand-voice/learn'
814
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
815
+ let localVarQueryParameters: any = {};
816
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
817
+ const produces = ['application/json'];
818
+ // give precedence to 'application/json'
819
+ if (produces.indexOf('application/json') >= 0) {
820
+ localVarHeaderParams.Accept = 'application/json';
821
+ } else {
822
+ localVarHeaderParams.Accept = produces.join(',');
823
+ }
824
+ let localVarFormParams: any = {};
825
+
826
+ // verify required parameter 'workspaceUuid' is not null or undefined
827
+ if (workspaceUuid === null || workspaceUuid === undefined) {
828
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling learnBrandVoice.');
829
+ }
830
+
831
+ (<any>Object).assign(localVarHeaderParams, options.headers);
832
+
833
+ let localVarUseFormData = false;
834
+
835
+ let localVarRequestOptions: localVarRequest.Options = {
836
+ method: 'POST',
837
+ qs: localVarQueryParameters,
838
+ headers: localVarHeaderParams,
839
+ uri: localVarPath,
840
+ useQuerystring: this._useQuerystring,
841
+ json: true,
842
+ body: ObjectSerializer.serialize(learnBrandVoiceInput, "LearnBrandVoiceInput")
843
+ };
844
+
845
+ let authenticationPromise = Promise.resolve();
846
+ if (this.authentications.bearerAuth.accessToken) {
847
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
848
+ }
849
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
850
+
851
+ let interceptorPromise = authenticationPromise;
852
+ for (const interceptor of this.interceptors) {
853
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
854
+ }
855
+
856
+ return interceptorPromise.then(() => {
857
+ if (Object.keys(localVarFormParams).length) {
858
+ if (localVarUseFormData) {
859
+ (<any>localVarRequestOptions).formData = localVarFormParams;
860
+ } else {
861
+ localVarRequestOptions.form = localVarFormParams;
862
+ }
863
+ }
864
+ return new Promise<{ response: http.IncomingMessage; body: LearnBrandVoiceResponse; }>((resolve, reject) => {
865
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
866
+ if (error) {
867
+ reject(error);
868
+ } else {
869
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
870
+ body = ObjectSerializer.deserialize(body, "LearnBrandVoiceResponse");
871
+ resolve({ response: response, body: body });
872
+ } else {
873
+ reject(new HttpError(response, body, response.statusCode));
874
+ }
875
+ }
876
+ });
877
+ });
878
+ });
879
+ }
880
+ /**
881
+ * Turns an article URL, a YouTube video, a PDF or pasted text into one **draft** post with a caption for every target account, plus a carousel of rendered slide images (hook, 1 to 6 idea slides, call to action; 1080×1350 PNG). Nothing is published or scheduled. **Sources** (`source_type`): - `url`: the article is fetched and its main text extracted. - `youtube`: title, description and chapters come from YouTube; send the transcript in `transcript` for better results (required when the description is short). - `pdf`: `pdf_url` must be a public PDF of at most 20 MB; the first 30 pages are read. - `text`: send `title` and `text`. **Carousel per network**: Instagram, Facebook, Threads up to 10 slides; LinkedIn up to 9; X and Bluesky up to 4; other networks get the cover slide; YouTube and TikTok get none (listed in `warnings`). Without a carousel, the source image (article image or video thumbnail) is attached when available. **AI credits**: one per target account plus one for the carousel outline. Slides are drawn without AI and cost nothing. The workspace brand voice applies unless `use_brand_voice` is `false`. Send an `Idempotency-Key` so a retried call does not create a second draft. Limited to 10 calls per minute.
882
+ * @summary Repurpose long-form content into a draft post set with a carousel
883
+ * @param workspaceUuid UUID of the workspace.
884
+ * @param repurposeInput
885
+ * @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 &#x60;Idempotent-Replayed: true&#x60; and has no further effect. Keys are scoped to your user, the workspace, the method and the path.
886
+ */
887
+ public async repurposeContent (workspaceUuid: string, repurposeInput: RepurposeInput, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: RepurposeContent200Response; }> {
888
+ const localVarPath = this.basePath + '/{workspaceUuid}/ai/repurpose'
889
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
890
+ let localVarQueryParameters: any = {};
891
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
892
+ const produces = ['application/json'];
893
+ // give precedence to 'application/json'
894
+ if (produces.indexOf('application/json') >= 0) {
895
+ localVarHeaderParams.Accept = 'application/json';
896
+ } else {
897
+ localVarHeaderParams.Accept = produces.join(',');
898
+ }
899
+ let localVarFormParams: any = {};
900
+
901
+ // verify required parameter 'workspaceUuid' is not null or undefined
902
+ if (workspaceUuid === null || workspaceUuid === undefined) {
903
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling repurposeContent.');
904
+ }
905
+
906
+ // verify required parameter 'repurposeInput' is not null or undefined
907
+ if (repurposeInput === null || repurposeInput === undefined) {
908
+ throw new Error('Required parameter repurposeInput was null or undefined when calling repurposeContent.');
909
+ }
910
+
911
+ localVarHeaderParams['Idempotency-Key'] = ObjectSerializer.serialize(idempotencyKey, "string");
912
+ (<any>Object).assign(localVarHeaderParams, options.headers);
913
+
914
+ let localVarUseFormData = false;
915
+
916
+ let localVarRequestOptions: localVarRequest.Options = {
917
+ method: 'POST',
918
+ qs: localVarQueryParameters,
919
+ headers: localVarHeaderParams,
920
+ uri: localVarPath,
921
+ useQuerystring: this._useQuerystring,
922
+ json: true,
923
+ body: ObjectSerializer.serialize(repurposeInput, "RepurposeInput")
924
+ };
925
+
926
+ let authenticationPromise = Promise.resolve();
927
+ if (this.authentications.bearerAuth.accessToken) {
928
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
929
+ }
930
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
931
+
932
+ let interceptorPromise = authenticationPromise;
933
+ for (const interceptor of this.interceptors) {
934
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
935
+ }
936
+
937
+ return interceptorPromise.then(() => {
938
+ if (Object.keys(localVarFormParams).length) {
939
+ if (localVarUseFormData) {
940
+ (<any>localVarRequestOptions).formData = localVarFormParams;
941
+ } else {
942
+ localVarRequestOptions.form = localVarFormParams;
943
+ }
944
+ }
945
+ return new Promise<{ response: http.IncomingMessage; body: RepurposeContent200Response; }>((resolve, reject) => {
946
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
947
+ if (error) {
948
+ reject(error);
949
+ } else {
950
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
951
+ body = ObjectSerializer.deserialize(body, "RepurposeContent200Response");
952
+ resolve({ response: response, body: body });
953
+ } else {
954
+ reject(new HttpError(response, body, response.statusCode));
955
+ }
956
+ }
957
+ });
958
+ });
959
+ });
960
+ }
961
+ /**
962
+ * Creates the workspace\'s brand voice or updates it. Fields you leave out keep their current value. Admins and members only (not viewers); the workspace must have AI enabled.
963
+ * @summary Create or update the brand voice
964
+ * @param workspaceUuid UUID of the workspace.
965
+ * @param brandVoiceInput
966
+ */
967
+ public async updateBrandVoice (workspaceUuid: string, brandVoiceInput: BrandVoiceInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetBrandVoice200Response; }> {
968
+ const localVarPath = this.basePath + '/{workspaceUuid}/brand-voice'
969
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
970
+ let localVarQueryParameters: any = {};
971
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
972
+ const produces = ['application/json'];
973
+ // give precedence to 'application/json'
974
+ if (produces.indexOf('application/json') >= 0) {
975
+ localVarHeaderParams.Accept = 'application/json';
976
+ } else {
977
+ localVarHeaderParams.Accept = produces.join(',');
978
+ }
979
+ let localVarFormParams: any = {};
980
+
981
+ // verify required parameter 'workspaceUuid' is not null or undefined
982
+ if (workspaceUuid === null || workspaceUuid === undefined) {
983
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling updateBrandVoice.');
984
+ }
985
+
986
+ // verify required parameter 'brandVoiceInput' is not null or undefined
987
+ if (brandVoiceInput === null || brandVoiceInput === undefined) {
988
+ throw new Error('Required parameter brandVoiceInput was null or undefined when calling updateBrandVoice.');
989
+ }
990
+
991
+ (<any>Object).assign(localVarHeaderParams, options.headers);
992
+
993
+ let localVarUseFormData = false;
994
+
995
+ let localVarRequestOptions: localVarRequest.Options = {
996
+ method: 'PUT',
997
+ qs: localVarQueryParameters,
998
+ headers: localVarHeaderParams,
999
+ uri: localVarPath,
1000
+ useQuerystring: this._useQuerystring,
1001
+ json: true,
1002
+ body: ObjectSerializer.serialize(brandVoiceInput, "BrandVoiceInput")
1003
+ };
1004
+
1005
+ let authenticationPromise = Promise.resolve();
1006
+ if (this.authentications.bearerAuth.accessToken) {
1007
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
1008
+ }
1009
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
1010
+
1011
+ let interceptorPromise = authenticationPromise;
1012
+ for (const interceptor of this.interceptors) {
1013
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
1014
+ }
1015
+
1016
+ return interceptorPromise.then(() => {
1017
+ if (Object.keys(localVarFormParams).length) {
1018
+ if (localVarUseFormData) {
1019
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1020
+ } else {
1021
+ localVarRequestOptions.form = localVarFormParams;
1022
+ }
1023
+ }
1024
+ return new Promise<{ response: http.IncomingMessage; body: GetBrandVoice200Response; }>((resolve, reject) => {
1025
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
1026
+ if (error) {
1027
+ reject(error);
1028
+ } else {
1029
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
1030
+ body = ObjectSerializer.deserialize(body, "GetBrandVoice200Response");
1031
+ resolve({ response: response, body: body });
1032
+ } else {
1033
+ reject(new HttpError(response, body, response.statusCode));
1034
+ }
1035
+ }
1036
+ });
1037
+ });
1038
+ });
1039
+ }
582
1040
  }