postboost 1.8.0 → 1.15.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 +35 -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
@@ -0,0 +1,957 @@
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.15.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 { ApproveInboxReplyDraft403Response } from '../model/approveInboxReplyDraft403Response';
19
+ import { CreateInboxReplyDraft201Response } from '../model/createInboxReplyDraft201Response';
20
+ import { GetInboxConversation200Response } from '../model/getInboxConversation200Response';
21
+ import { InboxConversationUpdate } from '../model/inboxConversationUpdate';
22
+ import { InboxReplyDraftApprove } from '../model/inboxReplyDraftApprove';
23
+ import { InboxReplyDraftEdit } from '../model/inboxReplyDraftEdit';
24
+ import { InboxReplyDraftInput } from '../model/inboxReplyDraftInput';
25
+ import { ListInboxConversations200Response } from '../model/listInboxConversations200Response';
26
+ import { ListInboxReplyDrafts200Response } from '../model/listInboxReplyDrafts200Response';
27
+ import { MessageOnly } from '../model/messageOnly';
28
+
29
+ import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
30
+ import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
31
+
32
+ import { HttpError, RequestFile } from './apis';
33
+
34
+ let defaultBasePath = 'https://postboost.co/app/api';
35
+
36
+ // ===============================================
37
+ // This file is autogenerated - Please do not edit
38
+ // ===============================================
39
+
40
+ export enum InboxApiApiKeys {
41
+ }
42
+
43
+ export class InboxApi {
44
+ protected _basePath = defaultBasePath;
45
+ protected _defaultHeaders : any = {};
46
+ protected _useQuerystring : boolean = false;
47
+
48
+ protected authentications = {
49
+ 'default': <Authentication>new VoidAuth(),
50
+ 'bearerAuth': new HttpBearerAuth(),
51
+ }
52
+
53
+ protected interceptors: Interceptor[] = [];
54
+
55
+ constructor(basePath?: string);
56
+ constructor(basePathOrUsername: string, password?: string, basePath?: string) {
57
+ if (password) {
58
+ if (basePath) {
59
+ this.basePath = basePath;
60
+ }
61
+ } else {
62
+ if (basePathOrUsername) {
63
+ this.basePath = basePathOrUsername
64
+ }
65
+ }
66
+ }
67
+
68
+ set useQuerystring(value: boolean) {
69
+ this._useQuerystring = value;
70
+ }
71
+
72
+ set basePath(basePath: string) {
73
+ this._basePath = basePath;
74
+ }
75
+
76
+ set defaultHeaders(defaultHeaders: any) {
77
+ this._defaultHeaders = defaultHeaders;
78
+ }
79
+
80
+ get defaultHeaders() {
81
+ return this._defaultHeaders;
82
+ }
83
+
84
+ get basePath() {
85
+ return this._basePath;
86
+ }
87
+
88
+ public setDefaultAuthentication(auth: Authentication) {
89
+ this.authentications.default = auth;
90
+ }
91
+
92
+ public setApiKey(key: InboxApiApiKeys, value: string) {
93
+ (this.authentications as any)[InboxApiApiKeys[key]].apiKey = value;
94
+ }
95
+
96
+ set accessToken(accessToken: string | (() => string)) {
97
+ this.authentications.bearerAuth.accessToken = accessToken;
98
+ }
99
+
100
+ public addInterceptor(interceptor: Interceptor) {
101
+ this.interceptors.push(interceptor);
102
+ }
103
+
104
+ /**
105
+ * Sends the draft to the network (optionally with an edited `body`). Ends as `sent`, or `failed` with `error`. Needs the `publish` ability; the API key that wrote the draft cannot approve it (`403`, `code: self_approval`). A draft is sent at most once: approving again returns `409`. Requires the inbox API to be enabled for the workspace (otherwise `404`). Admins and members only.
106
+ * @summary Approve and send a reply draft
107
+ * @param workspaceUuid UUID of the workspace.
108
+ * @param draftId The draft &#x60;id&#x60;.
109
+ * @param inboxReplyDraftApprove
110
+ */
111
+ public async approveInboxReplyDraft (workspaceUuid: string, draftId: string, inboxReplyDraftApprove?: InboxReplyDraftApprove, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateInboxReplyDraft201Response; }> {
112
+ const localVarPath = this.basePath + '/{workspaceUuid}/inbox/drafts/{draftId}/approve'
113
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
114
+ .replace('{' + 'draftId' + '}', encodeURIComponent(String(draftId)));
115
+ let localVarQueryParameters: any = {};
116
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
117
+ const produces = ['application/json'];
118
+ // give precedence to 'application/json'
119
+ if (produces.indexOf('application/json') >= 0) {
120
+ localVarHeaderParams.Accept = 'application/json';
121
+ } else {
122
+ localVarHeaderParams.Accept = produces.join(',');
123
+ }
124
+ let localVarFormParams: any = {};
125
+
126
+ // verify required parameter 'workspaceUuid' is not null or undefined
127
+ if (workspaceUuid === null || workspaceUuid === undefined) {
128
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling approveInboxReplyDraft.');
129
+ }
130
+
131
+ // verify required parameter 'draftId' is not null or undefined
132
+ if (draftId === null || draftId === undefined) {
133
+ throw new Error('Required parameter draftId was null or undefined when calling approveInboxReplyDraft.');
134
+ }
135
+
136
+ (<any>Object).assign(localVarHeaderParams, options.headers);
137
+
138
+ let localVarUseFormData = false;
139
+
140
+ let localVarRequestOptions: localVarRequest.Options = {
141
+ method: 'POST',
142
+ qs: localVarQueryParameters,
143
+ headers: localVarHeaderParams,
144
+ uri: localVarPath,
145
+ useQuerystring: this._useQuerystring,
146
+ json: true,
147
+ body: ObjectSerializer.serialize(inboxReplyDraftApprove, "InboxReplyDraftApprove")
148
+ };
149
+
150
+ let authenticationPromise = Promise.resolve();
151
+ if (this.authentications.bearerAuth.accessToken) {
152
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
153
+ }
154
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
155
+
156
+ let interceptorPromise = authenticationPromise;
157
+ for (const interceptor of this.interceptors) {
158
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
159
+ }
160
+
161
+ return interceptorPromise.then(() => {
162
+ if (Object.keys(localVarFormParams).length) {
163
+ if (localVarUseFormData) {
164
+ (<any>localVarRequestOptions).formData = localVarFormParams;
165
+ } else {
166
+ localVarRequestOptions.form = localVarFormParams;
167
+ }
168
+ }
169
+ return new Promise<{ response: http.IncomingMessage; body: CreateInboxReplyDraft201Response; }>((resolve, reject) => {
170
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
171
+ if (error) {
172
+ reject(error);
173
+ } else {
174
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
175
+ body = ObjectSerializer.deserialize(body, "CreateInboxReplyDraft201Response");
176
+ resolve({ response: response, body: body });
177
+ } else {
178
+ reject(new HttpError(response, body, response.statusCode));
179
+ }
180
+ }
181
+ });
182
+ });
183
+ });
184
+ }
185
+ /**
186
+ * Proposes a reply. Nothing is posted: a person approves the draft in the app (Reply drafts page) or another API key with the `publish` ability approves it. `in_reply_to` defaults to the latest incoming message. The body limit depends on the network (Bluesky 300, Mastodon 500, LinkedIn 1250, Google 4000). Needs the `write` ability. Requires the inbox API to be enabled for the workspace (otherwise `404`). Admins and members only.
187
+ * @summary Draft a reply
188
+ * @param workspaceUuid UUID of the workspace.
189
+ * @param conversationId The conversation &#x60;id&#x60;.
190
+ * @param inboxReplyDraftInput
191
+ */
192
+ public async createInboxReplyDraft (workspaceUuid: string, conversationId: string, inboxReplyDraftInput: InboxReplyDraftInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateInboxReplyDraft201Response; }> {
193
+ const localVarPath = this.basePath + '/{workspaceUuid}/inbox/conversations/{conversationId}/drafts'
194
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
195
+ .replace('{' + 'conversationId' + '}', encodeURIComponent(String(conversationId)));
196
+ let localVarQueryParameters: any = {};
197
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
198
+ const produces = ['application/json'];
199
+ // give precedence to 'application/json'
200
+ if (produces.indexOf('application/json') >= 0) {
201
+ localVarHeaderParams.Accept = 'application/json';
202
+ } else {
203
+ localVarHeaderParams.Accept = produces.join(',');
204
+ }
205
+ let localVarFormParams: any = {};
206
+
207
+ // verify required parameter 'workspaceUuid' is not null or undefined
208
+ if (workspaceUuid === null || workspaceUuid === undefined) {
209
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling createInboxReplyDraft.');
210
+ }
211
+
212
+ // verify required parameter 'conversationId' is not null or undefined
213
+ if (conversationId === null || conversationId === undefined) {
214
+ throw new Error('Required parameter conversationId was null or undefined when calling createInboxReplyDraft.');
215
+ }
216
+
217
+ // verify required parameter 'inboxReplyDraftInput' is not null or undefined
218
+ if (inboxReplyDraftInput === null || inboxReplyDraftInput === undefined) {
219
+ throw new Error('Required parameter inboxReplyDraftInput was null or undefined when calling createInboxReplyDraft.');
220
+ }
221
+
222
+ (<any>Object).assign(localVarHeaderParams, options.headers);
223
+
224
+ let localVarUseFormData = false;
225
+
226
+ let localVarRequestOptions: localVarRequest.Options = {
227
+ method: 'POST',
228
+ qs: localVarQueryParameters,
229
+ headers: localVarHeaderParams,
230
+ uri: localVarPath,
231
+ useQuerystring: this._useQuerystring,
232
+ json: true,
233
+ body: ObjectSerializer.serialize(inboxReplyDraftInput, "InboxReplyDraftInput")
234
+ };
235
+
236
+ let authenticationPromise = Promise.resolve();
237
+ if (this.authentications.bearerAuth.accessToken) {
238
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
239
+ }
240
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
241
+
242
+ let interceptorPromise = authenticationPromise;
243
+ for (const interceptor of this.interceptors) {
244
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
245
+ }
246
+
247
+ return interceptorPromise.then(() => {
248
+ if (Object.keys(localVarFormParams).length) {
249
+ if (localVarUseFormData) {
250
+ (<any>localVarRequestOptions).formData = localVarFormParams;
251
+ } else {
252
+ localVarRequestOptions.form = localVarFormParams;
253
+ }
254
+ }
255
+ return new Promise<{ response: http.IncomingMessage; body: CreateInboxReplyDraft201Response; }>((resolve, reject) => {
256
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
257
+ if (error) {
258
+ reject(error);
259
+ } else {
260
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
261
+ body = ObjectSerializer.deserialize(body, "CreateInboxReplyDraft201Response");
262
+ resolve({ response: response, body: body });
263
+ } else {
264
+ reject(new HttpError(response, body, response.statusCode));
265
+ }
266
+ }
267
+ });
268
+ });
269
+ });
270
+ }
271
+ /**
272
+ * Deletes a pending draft. `409` once it was reviewed. Requires the inbox API to be enabled for the workspace (otherwise `404`). Admins and members only.
273
+ * @summary Withdraw a reply draft
274
+ * @param workspaceUuid UUID of the workspace.
275
+ * @param draftId The draft &#x60;id&#x60;.
276
+ */
277
+ public async deleteInboxReplyDraft (workspaceUuid: string, draftId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
278
+ const localVarPath = this.basePath + '/{workspaceUuid}/inbox/drafts/{draftId}'
279
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
280
+ .replace('{' + 'draftId' + '}', encodeURIComponent(String(draftId)));
281
+ let localVarQueryParameters: any = {};
282
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
283
+ const produces = ['application/json'];
284
+ // give precedence to 'application/json'
285
+ if (produces.indexOf('application/json') >= 0) {
286
+ localVarHeaderParams.Accept = 'application/json';
287
+ } else {
288
+ localVarHeaderParams.Accept = produces.join(',');
289
+ }
290
+ let localVarFormParams: any = {};
291
+
292
+ // verify required parameter 'workspaceUuid' is not null or undefined
293
+ if (workspaceUuid === null || workspaceUuid === undefined) {
294
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling deleteInboxReplyDraft.');
295
+ }
296
+
297
+ // verify required parameter 'draftId' is not null or undefined
298
+ if (draftId === null || draftId === undefined) {
299
+ throw new Error('Required parameter draftId was null or undefined when calling deleteInboxReplyDraft.');
300
+ }
301
+
302
+ (<any>Object).assign(localVarHeaderParams, options.headers);
303
+
304
+ let localVarUseFormData = false;
305
+
306
+ let localVarRequestOptions: localVarRequest.Options = {
307
+ method: 'DELETE',
308
+ qs: localVarQueryParameters,
309
+ headers: localVarHeaderParams,
310
+ uri: localVarPath,
311
+ useQuerystring: this._useQuerystring,
312
+ json: true,
313
+ };
314
+
315
+ let authenticationPromise = Promise.resolve();
316
+ if (this.authentications.bearerAuth.accessToken) {
317
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
318
+ }
319
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
320
+
321
+ let interceptorPromise = authenticationPromise;
322
+ for (const interceptor of this.interceptors) {
323
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
324
+ }
325
+
326
+ return interceptorPromise.then(() => {
327
+ if (Object.keys(localVarFormParams).length) {
328
+ if (localVarUseFormData) {
329
+ (<any>localVarRequestOptions).formData = localVarFormParams;
330
+ } else {
331
+ localVarRequestOptions.form = localVarFormParams;
332
+ }
333
+ }
334
+ return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
335
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
336
+ if (error) {
337
+ reject(error);
338
+ } else {
339
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
340
+ resolve({ response: response, body: body });
341
+ } else {
342
+ reject(new HttpError(response, body, response.statusCode));
343
+ }
344
+ }
345
+ });
346
+ });
347
+ });
348
+ }
349
+ /**
350
+ * The conversation with its 50 most recent messages, oldest first. Requires the inbox API to be enabled for the workspace (otherwise `404`). Admins and members only.
351
+ * @summary Get an inbox conversation
352
+ * @param workspaceUuid UUID of the workspace.
353
+ * @param conversationId The conversation &#x60;id&#x60;.
354
+ */
355
+ public async getInboxConversation (workspaceUuid: string, conversationId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetInboxConversation200Response; }> {
356
+ const localVarPath = this.basePath + '/{workspaceUuid}/inbox/conversations/{conversationId}'
357
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
358
+ .replace('{' + 'conversationId' + '}', encodeURIComponent(String(conversationId)));
359
+ let localVarQueryParameters: any = {};
360
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
361
+ const produces = ['application/json'];
362
+ // give precedence to 'application/json'
363
+ if (produces.indexOf('application/json') >= 0) {
364
+ localVarHeaderParams.Accept = 'application/json';
365
+ } else {
366
+ localVarHeaderParams.Accept = produces.join(',');
367
+ }
368
+ let localVarFormParams: any = {};
369
+
370
+ // verify required parameter 'workspaceUuid' is not null or undefined
371
+ if (workspaceUuid === null || workspaceUuid === undefined) {
372
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling getInboxConversation.');
373
+ }
374
+
375
+ // verify required parameter 'conversationId' is not null or undefined
376
+ if (conversationId === null || conversationId === undefined) {
377
+ throw new Error('Required parameter conversationId was null or undefined when calling getInboxConversation.');
378
+ }
379
+
380
+ (<any>Object).assign(localVarHeaderParams, options.headers);
381
+
382
+ let localVarUseFormData = false;
383
+
384
+ let localVarRequestOptions: localVarRequest.Options = {
385
+ method: 'GET',
386
+ qs: localVarQueryParameters,
387
+ headers: localVarHeaderParams,
388
+ uri: localVarPath,
389
+ useQuerystring: this._useQuerystring,
390
+ json: true,
391
+ };
392
+
393
+ let authenticationPromise = Promise.resolve();
394
+ if (this.authentications.bearerAuth.accessToken) {
395
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
396
+ }
397
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
398
+
399
+ let interceptorPromise = authenticationPromise;
400
+ for (const interceptor of this.interceptors) {
401
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
402
+ }
403
+
404
+ return interceptorPromise.then(() => {
405
+ if (Object.keys(localVarFormParams).length) {
406
+ if (localVarUseFormData) {
407
+ (<any>localVarRequestOptions).formData = localVarFormParams;
408
+ } else {
409
+ localVarRequestOptions.form = localVarFormParams;
410
+ }
411
+ }
412
+ return new Promise<{ response: http.IncomingMessage; body: GetInboxConversation200Response; }>((resolve, reject) => {
413
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
414
+ if (error) {
415
+ reject(error);
416
+ } else {
417
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
418
+ body = ObjectSerializer.deserialize(body, "GetInboxConversation200Response");
419
+ resolve({ response: response, body: body });
420
+ } else {
421
+ reject(new HttpError(response, body, response.statusCode));
422
+ }
423
+ }
424
+ });
425
+ });
426
+ });
427
+ }
428
+ /**
429
+ * One draft. Poll it to see whether it was approved and sent. Requires the inbox API to be enabled for the workspace (otherwise `404`). Admins and members only.
430
+ * @summary Get a reply draft
431
+ * @param workspaceUuid UUID of the workspace.
432
+ * @param draftId The draft &#x60;id&#x60;.
433
+ */
434
+ public async getInboxReplyDraft (workspaceUuid: string, draftId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateInboxReplyDraft201Response; }> {
435
+ const localVarPath = this.basePath + '/{workspaceUuid}/inbox/drafts/{draftId}'
436
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
437
+ .replace('{' + 'draftId' + '}', encodeURIComponent(String(draftId)));
438
+ let localVarQueryParameters: any = {};
439
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
440
+ const produces = ['application/json'];
441
+ // give precedence to 'application/json'
442
+ if (produces.indexOf('application/json') >= 0) {
443
+ localVarHeaderParams.Accept = 'application/json';
444
+ } else {
445
+ localVarHeaderParams.Accept = produces.join(',');
446
+ }
447
+ let localVarFormParams: any = {};
448
+
449
+ // verify required parameter 'workspaceUuid' is not null or undefined
450
+ if (workspaceUuid === null || workspaceUuid === undefined) {
451
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling getInboxReplyDraft.');
452
+ }
453
+
454
+ // verify required parameter 'draftId' is not null or undefined
455
+ if (draftId === null || draftId === undefined) {
456
+ throw new Error('Required parameter draftId was null or undefined when calling getInboxReplyDraft.');
457
+ }
458
+
459
+ (<any>Object).assign(localVarHeaderParams, options.headers);
460
+
461
+ let localVarUseFormData = false;
462
+
463
+ let localVarRequestOptions: localVarRequest.Options = {
464
+ method: 'GET',
465
+ qs: localVarQueryParameters,
466
+ headers: localVarHeaderParams,
467
+ uri: localVarPath,
468
+ useQuerystring: this._useQuerystring,
469
+ json: true,
470
+ };
471
+
472
+ let authenticationPromise = Promise.resolve();
473
+ if (this.authentications.bearerAuth.accessToken) {
474
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
475
+ }
476
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
477
+
478
+ let interceptorPromise = authenticationPromise;
479
+ for (const interceptor of this.interceptors) {
480
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
481
+ }
482
+
483
+ return interceptorPromise.then(() => {
484
+ if (Object.keys(localVarFormParams).length) {
485
+ if (localVarUseFormData) {
486
+ (<any>localVarRequestOptions).formData = localVarFormParams;
487
+ } else {
488
+ localVarRequestOptions.form = localVarFormParams;
489
+ }
490
+ }
491
+ return new Promise<{ response: http.IncomingMessage; body: CreateInboxReplyDraft201Response; }>((resolve, reject) => {
492
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
493
+ if (error) {
494
+ reject(error);
495
+ } else {
496
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
497
+ body = ObjectSerializer.deserialize(body, "CreateInboxReplyDraft201Response");
498
+ resolve({ response: response, body: body });
499
+ } else {
500
+ reject(new HttpError(response, body, response.statusCode));
501
+ }
502
+ }
503
+ });
504
+ });
505
+ });
506
+ }
507
+ /**
508
+ * Comments, mentions and reviews on your accounts, most recent activity first, 25 per page. Available for Bluesky, Mastodon, LinkedIn Pages and Google Business Profile. Requires the inbox API to be enabled for the workspace (otherwise `404`). Admins and members only.
509
+ * @summary List inbox conversations
510
+ * @param workspaceUuid UUID of the workspace.
511
+ * @param status Conversation status.
512
+ * @param accountId Account &#x60;id&#x60;.
513
+ * @param provider Network, for example &#x60;bluesky&#x60;.
514
+ * @param unread Only unread (&#x60;true&#x60;) or read (&#x60;false&#x60;) conversations.
515
+ * @param sentiment AI sentiment.
516
+ * @param aiLabel AI label.
517
+ * @param since Only conversations with activity at or after this time.
518
+ * @param page Page number.
519
+ */
520
+ public async listInboxConversations (workspaceUuid: string, status?: 'open' | 'resolved', accountId?: number, provider?: string, unread?: boolean, sentiment?: 'negative' | 'neutral' | 'positive', aiLabel?: 'question' | 'complaint' | 'praise' | 'lead' | 'other', since?: Date, page?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListInboxConversations200Response; }> {
521
+ const localVarPath = this.basePath + '/{workspaceUuid}/inbox/conversations'
522
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
523
+ let localVarQueryParameters: any = {};
524
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
525
+ const produces = ['application/json'];
526
+ // give precedence to 'application/json'
527
+ if (produces.indexOf('application/json') >= 0) {
528
+ localVarHeaderParams.Accept = 'application/json';
529
+ } else {
530
+ localVarHeaderParams.Accept = produces.join(',');
531
+ }
532
+ let localVarFormParams: any = {};
533
+
534
+ // verify required parameter 'workspaceUuid' is not null or undefined
535
+ if (workspaceUuid === null || workspaceUuid === undefined) {
536
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling listInboxConversations.');
537
+ }
538
+
539
+ if (status !== undefined) {
540
+ localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'open' | 'resolved'");
541
+ }
542
+
543
+ if (accountId !== undefined) {
544
+ localVarQueryParameters['account_id'] = ObjectSerializer.serialize(accountId, "number");
545
+ }
546
+
547
+ if (provider !== undefined) {
548
+ localVarQueryParameters['provider'] = ObjectSerializer.serialize(provider, "string");
549
+ }
550
+
551
+ if (unread !== undefined) {
552
+ localVarQueryParameters['unread'] = ObjectSerializer.serialize(unread, "boolean");
553
+ }
554
+
555
+ if (sentiment !== undefined) {
556
+ localVarQueryParameters['sentiment'] = ObjectSerializer.serialize(sentiment, "'negative' | 'neutral' | 'positive'");
557
+ }
558
+
559
+ if (aiLabel !== undefined) {
560
+ localVarQueryParameters['ai_label'] = ObjectSerializer.serialize(aiLabel, "'question' | 'complaint' | 'praise' | 'lead' | 'other'");
561
+ }
562
+
563
+ if (since !== undefined) {
564
+ localVarQueryParameters['since'] = ObjectSerializer.serialize(since, "Date");
565
+ }
566
+
567
+ if (page !== undefined) {
568
+ localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number");
569
+ }
570
+
571
+ (<any>Object).assign(localVarHeaderParams, options.headers);
572
+
573
+ let localVarUseFormData = false;
574
+
575
+ let localVarRequestOptions: localVarRequest.Options = {
576
+ method: 'GET',
577
+ qs: localVarQueryParameters,
578
+ headers: localVarHeaderParams,
579
+ uri: localVarPath,
580
+ useQuerystring: this._useQuerystring,
581
+ json: true,
582
+ };
583
+
584
+ let authenticationPromise = Promise.resolve();
585
+ if (this.authentications.bearerAuth.accessToken) {
586
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
587
+ }
588
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
589
+
590
+ let interceptorPromise = authenticationPromise;
591
+ for (const interceptor of this.interceptors) {
592
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
593
+ }
594
+
595
+ return interceptorPromise.then(() => {
596
+ if (Object.keys(localVarFormParams).length) {
597
+ if (localVarUseFormData) {
598
+ (<any>localVarRequestOptions).formData = localVarFormParams;
599
+ } else {
600
+ localVarRequestOptions.form = localVarFormParams;
601
+ }
602
+ }
603
+ return new Promise<{ response: http.IncomingMessage; body: ListInboxConversations200Response; }>((resolve, reject) => {
604
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
605
+ if (error) {
606
+ reject(error);
607
+ } else {
608
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
609
+ body = ObjectSerializer.deserialize(body, "ListInboxConversations200Response");
610
+ resolve({ response: response, body: body });
611
+ } else {
612
+ reject(new HttpError(response, body, response.statusCode));
613
+ }
614
+ }
615
+ });
616
+ });
617
+ });
618
+ }
619
+ /**
620
+ * Reply drafts, newest first, 25 per page. Requires the inbox API to be enabled for the workspace (otherwise `404`). Admins and members only.
621
+ * @summary List reply drafts
622
+ * @param workspaceUuid UUID of the workspace.
623
+ * @param status Draft status.
624
+ * @param conversationId Only drafts for this conversation &#x60;id&#x60;.
625
+ * @param page Page number.
626
+ */
627
+ public async listInboxReplyDrafts (workspaceUuid: string, status?: 'pending' | 'approved' | 'rejected' | 'sent' | 'failed', conversationId?: string, page?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListInboxReplyDrafts200Response; }> {
628
+ const localVarPath = this.basePath + '/{workspaceUuid}/inbox/drafts'
629
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
630
+ let localVarQueryParameters: any = {};
631
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
632
+ const produces = ['application/json'];
633
+ // give precedence to 'application/json'
634
+ if (produces.indexOf('application/json') >= 0) {
635
+ localVarHeaderParams.Accept = 'application/json';
636
+ } else {
637
+ localVarHeaderParams.Accept = produces.join(',');
638
+ }
639
+ let localVarFormParams: any = {};
640
+
641
+ // verify required parameter 'workspaceUuid' is not null or undefined
642
+ if (workspaceUuid === null || workspaceUuid === undefined) {
643
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling listInboxReplyDrafts.');
644
+ }
645
+
646
+ if (status !== undefined) {
647
+ localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "'pending' | 'approved' | 'rejected' | 'sent' | 'failed'");
648
+ }
649
+
650
+ if (conversationId !== undefined) {
651
+ localVarQueryParameters['conversation_id'] = ObjectSerializer.serialize(conversationId, "string");
652
+ }
653
+
654
+ if (page !== undefined) {
655
+ localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number");
656
+ }
657
+
658
+ (<any>Object).assign(localVarHeaderParams, options.headers);
659
+
660
+ let localVarUseFormData = false;
661
+
662
+ let localVarRequestOptions: localVarRequest.Options = {
663
+ method: 'GET',
664
+ qs: localVarQueryParameters,
665
+ headers: localVarHeaderParams,
666
+ uri: localVarPath,
667
+ useQuerystring: this._useQuerystring,
668
+ json: true,
669
+ };
670
+
671
+ let authenticationPromise = Promise.resolve();
672
+ if (this.authentications.bearerAuth.accessToken) {
673
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
674
+ }
675
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
676
+
677
+ let interceptorPromise = authenticationPromise;
678
+ for (const interceptor of this.interceptors) {
679
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
680
+ }
681
+
682
+ return interceptorPromise.then(() => {
683
+ if (Object.keys(localVarFormParams).length) {
684
+ if (localVarUseFormData) {
685
+ (<any>localVarRequestOptions).formData = localVarFormParams;
686
+ } else {
687
+ localVarRequestOptions.form = localVarFormParams;
688
+ }
689
+ }
690
+ return new Promise<{ response: http.IncomingMessage; body: ListInboxReplyDrafts200Response; }>((resolve, reject) => {
691
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
692
+ if (error) {
693
+ reject(error);
694
+ } else {
695
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
696
+ body = ObjectSerializer.deserialize(body, "ListInboxReplyDrafts200Response");
697
+ resolve({ response: response, body: body });
698
+ } else {
699
+ reject(new HttpError(response, body, response.statusCode));
700
+ }
701
+ }
702
+ });
703
+ });
704
+ });
705
+ }
706
+ /**
707
+ * Rejects a pending draft; nothing is sent. Needs the `publish` ability. Requires the inbox API to be enabled for the workspace (otherwise `404`). Admins and members only.
708
+ * @summary Reject a reply draft
709
+ * @param workspaceUuid UUID of the workspace.
710
+ * @param draftId The draft &#x60;id&#x60;.
711
+ */
712
+ public async rejectInboxReplyDraft (workspaceUuid: string, draftId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateInboxReplyDraft201Response; }> {
713
+ const localVarPath = this.basePath + '/{workspaceUuid}/inbox/drafts/{draftId}/reject'
714
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
715
+ .replace('{' + 'draftId' + '}', encodeURIComponent(String(draftId)));
716
+ let localVarQueryParameters: any = {};
717
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
718
+ const produces = ['application/json'];
719
+ // give precedence to 'application/json'
720
+ if (produces.indexOf('application/json') >= 0) {
721
+ localVarHeaderParams.Accept = 'application/json';
722
+ } else {
723
+ localVarHeaderParams.Accept = produces.join(',');
724
+ }
725
+ let localVarFormParams: any = {};
726
+
727
+ // verify required parameter 'workspaceUuid' is not null or undefined
728
+ if (workspaceUuid === null || workspaceUuid === undefined) {
729
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling rejectInboxReplyDraft.');
730
+ }
731
+
732
+ // verify required parameter 'draftId' is not null or undefined
733
+ if (draftId === null || draftId === undefined) {
734
+ throw new Error('Required parameter draftId was null or undefined when calling rejectInboxReplyDraft.');
735
+ }
736
+
737
+ (<any>Object).assign(localVarHeaderParams, options.headers);
738
+
739
+ let localVarUseFormData = false;
740
+
741
+ let localVarRequestOptions: localVarRequest.Options = {
742
+ method: 'POST',
743
+ qs: localVarQueryParameters,
744
+ headers: localVarHeaderParams,
745
+ uri: localVarPath,
746
+ useQuerystring: this._useQuerystring,
747
+ json: true,
748
+ };
749
+
750
+ let authenticationPromise = Promise.resolve();
751
+ if (this.authentications.bearerAuth.accessToken) {
752
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
753
+ }
754
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
755
+
756
+ let interceptorPromise = authenticationPromise;
757
+ for (const interceptor of this.interceptors) {
758
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
759
+ }
760
+
761
+ return interceptorPromise.then(() => {
762
+ if (Object.keys(localVarFormParams).length) {
763
+ if (localVarUseFormData) {
764
+ (<any>localVarRequestOptions).formData = localVarFormParams;
765
+ } else {
766
+ localVarRequestOptions.form = localVarFormParams;
767
+ }
768
+ }
769
+ return new Promise<{ response: http.IncomingMessage; body: CreateInboxReplyDraft201Response; }>((resolve, reject) => {
770
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
771
+ if (error) {
772
+ reject(error);
773
+ } else {
774
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
775
+ body = ObjectSerializer.deserialize(body, "CreateInboxReplyDraft201Response");
776
+ resolve({ response: response, body: body });
777
+ } else {
778
+ reject(new HttpError(response, body, response.statusCode));
779
+ }
780
+ }
781
+ });
782
+ });
783
+ });
784
+ }
785
+ /**
786
+ * Marks the conversation open or resolved, read or unread. Requires the inbox API to be enabled for the workspace (otherwise `404`). Admins and members only.
787
+ * @summary Update an inbox conversation
788
+ * @param workspaceUuid UUID of the workspace.
789
+ * @param conversationId The conversation &#x60;id&#x60;.
790
+ * @param inboxConversationUpdate
791
+ */
792
+ public async updateInboxConversation (workspaceUuid: string, conversationId: string, inboxConversationUpdate: InboxConversationUpdate, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetInboxConversation200Response; }> {
793
+ const localVarPath = this.basePath + '/{workspaceUuid}/inbox/conversations/{conversationId}'
794
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
795
+ .replace('{' + 'conversationId' + '}', encodeURIComponent(String(conversationId)));
796
+ let localVarQueryParameters: any = {};
797
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
798
+ const produces = ['application/json'];
799
+ // give precedence to 'application/json'
800
+ if (produces.indexOf('application/json') >= 0) {
801
+ localVarHeaderParams.Accept = 'application/json';
802
+ } else {
803
+ localVarHeaderParams.Accept = produces.join(',');
804
+ }
805
+ let localVarFormParams: any = {};
806
+
807
+ // verify required parameter 'workspaceUuid' is not null or undefined
808
+ if (workspaceUuid === null || workspaceUuid === undefined) {
809
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling updateInboxConversation.');
810
+ }
811
+
812
+ // verify required parameter 'conversationId' is not null or undefined
813
+ if (conversationId === null || conversationId === undefined) {
814
+ throw new Error('Required parameter conversationId was null or undefined when calling updateInboxConversation.');
815
+ }
816
+
817
+ // verify required parameter 'inboxConversationUpdate' is not null or undefined
818
+ if (inboxConversationUpdate === null || inboxConversationUpdate === undefined) {
819
+ throw new Error('Required parameter inboxConversationUpdate was null or undefined when calling updateInboxConversation.');
820
+ }
821
+
822
+ (<any>Object).assign(localVarHeaderParams, options.headers);
823
+
824
+ let localVarUseFormData = false;
825
+
826
+ let localVarRequestOptions: localVarRequest.Options = {
827
+ method: 'PATCH',
828
+ qs: localVarQueryParameters,
829
+ headers: localVarHeaderParams,
830
+ uri: localVarPath,
831
+ useQuerystring: this._useQuerystring,
832
+ json: true,
833
+ body: ObjectSerializer.serialize(inboxConversationUpdate, "InboxConversationUpdate")
834
+ };
835
+
836
+ let authenticationPromise = Promise.resolve();
837
+ if (this.authentications.bearerAuth.accessToken) {
838
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
839
+ }
840
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
841
+
842
+ let interceptorPromise = authenticationPromise;
843
+ for (const interceptor of this.interceptors) {
844
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
845
+ }
846
+
847
+ return interceptorPromise.then(() => {
848
+ if (Object.keys(localVarFormParams).length) {
849
+ if (localVarUseFormData) {
850
+ (<any>localVarRequestOptions).formData = localVarFormParams;
851
+ } else {
852
+ localVarRequestOptions.form = localVarFormParams;
853
+ }
854
+ }
855
+ return new Promise<{ response: http.IncomingMessage; body: GetInboxConversation200Response; }>((resolve, reject) => {
856
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
857
+ if (error) {
858
+ reject(error);
859
+ } else {
860
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
861
+ body = ObjectSerializer.deserialize(body, "GetInboxConversation200Response");
862
+ resolve({ response: response, body: body });
863
+ } else {
864
+ reject(new HttpError(response, body, response.statusCode));
865
+ }
866
+ }
867
+ });
868
+ });
869
+ });
870
+ }
871
+ /**
872
+ * Changes the text of a pending draft. `409` once it was reviewed. Requires the inbox API to be enabled for the workspace (otherwise `404`). Admins and members only.
873
+ * @summary Edit a reply draft
874
+ * @param workspaceUuid UUID of the workspace.
875
+ * @param draftId The draft &#x60;id&#x60;.
876
+ * @param inboxReplyDraftEdit
877
+ */
878
+ public async updateInboxReplyDraft (workspaceUuid: string, draftId: string, inboxReplyDraftEdit: InboxReplyDraftEdit, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateInboxReplyDraft201Response; }> {
879
+ const localVarPath = this.basePath + '/{workspaceUuid}/inbox/drafts/{draftId}'
880
+ .replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
881
+ .replace('{' + 'draftId' + '}', encodeURIComponent(String(draftId)));
882
+ let localVarQueryParameters: any = {};
883
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
884
+ const produces = ['application/json'];
885
+ // give precedence to 'application/json'
886
+ if (produces.indexOf('application/json') >= 0) {
887
+ localVarHeaderParams.Accept = 'application/json';
888
+ } else {
889
+ localVarHeaderParams.Accept = produces.join(',');
890
+ }
891
+ let localVarFormParams: any = {};
892
+
893
+ // verify required parameter 'workspaceUuid' is not null or undefined
894
+ if (workspaceUuid === null || workspaceUuid === undefined) {
895
+ throw new Error('Required parameter workspaceUuid was null or undefined when calling updateInboxReplyDraft.');
896
+ }
897
+
898
+ // verify required parameter 'draftId' is not null or undefined
899
+ if (draftId === null || draftId === undefined) {
900
+ throw new Error('Required parameter draftId was null or undefined when calling updateInboxReplyDraft.');
901
+ }
902
+
903
+ // verify required parameter 'inboxReplyDraftEdit' is not null or undefined
904
+ if (inboxReplyDraftEdit === null || inboxReplyDraftEdit === undefined) {
905
+ throw new Error('Required parameter inboxReplyDraftEdit was null or undefined when calling updateInboxReplyDraft.');
906
+ }
907
+
908
+ (<any>Object).assign(localVarHeaderParams, options.headers);
909
+
910
+ let localVarUseFormData = false;
911
+
912
+ let localVarRequestOptions: localVarRequest.Options = {
913
+ method: 'PUT',
914
+ qs: localVarQueryParameters,
915
+ headers: localVarHeaderParams,
916
+ uri: localVarPath,
917
+ useQuerystring: this._useQuerystring,
918
+ json: true,
919
+ body: ObjectSerializer.serialize(inboxReplyDraftEdit, "InboxReplyDraftEdit")
920
+ };
921
+
922
+ let authenticationPromise = Promise.resolve();
923
+ if (this.authentications.bearerAuth.accessToken) {
924
+ authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
925
+ }
926
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
927
+
928
+ let interceptorPromise = authenticationPromise;
929
+ for (const interceptor of this.interceptors) {
930
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
931
+ }
932
+
933
+ return interceptorPromise.then(() => {
934
+ if (Object.keys(localVarFormParams).length) {
935
+ if (localVarUseFormData) {
936
+ (<any>localVarRequestOptions).formData = localVarFormParams;
937
+ } else {
938
+ localVarRequestOptions.form = localVarFormParams;
939
+ }
940
+ }
941
+ return new Promise<{ response: http.IncomingMessage; body: CreateInboxReplyDraft201Response; }>((resolve, reject) => {
942
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
943
+ if (error) {
944
+ reject(error);
945
+ } else {
946
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
947
+ body = ObjectSerializer.deserialize(body, "CreateInboxReplyDraft201Response");
948
+ resolve({ response: response, body: body });
949
+ } else {
950
+ reject(new HttpError(response, body, response.statusCode));
951
+ }
952
+ }
953
+ });
954
+ });
955
+ });
956
+ }
957
+ }