postboost 1.7.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.yml +26 -0
- package/.github/ISSUE_TEMPLATE/config.yml +11 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +14 -0
- package/.github/pull_request_template.md +6 -0
- package/CODE_OF_CONDUCT.md +7 -0
- package/CONTRIBUTING.md +31 -0
- package/README.md +46 -2
- package/SECURITY.md +9 -0
- package/api/aIApi.ts +460 -2
- package/api/accountGroupsApi.ts +501 -0
- package/api/accountsApi.ts +266 -4
- package/api/activityApi.ts +188 -0
- package/api/agentsApi.ts +918 -0
- package/api/analyticsApi.ts +1102 -0
- package/api/apis.ts +23 -1
- package/api/competitorsApi.ts +412 -0
- package/api/hashtagGroupsApi.ts +501 -0
- package/api/inboxApi.ts +957 -0
- package/api/mediaApi.ts +474 -13
- package/api/mentionsApi.ts +509 -0
- package/api/postingScheduleApi.ts +497 -0
- package/api/postsApi.ts +1375 -65
- package/api/receiptsApi.ts +2 -2
- package/api/subscriptionsApi.ts +10 -5
- package/api/tagsApi.ts +5 -3
- package/api/templatesApi.ts +501 -0
- package/api/usersApi.ts +2 -2
- package/api/webhooksApi.ts +327 -0
- package/api/workspacesApi.ts +603 -3
- package/model/aICredits.ts +52 -0
- package/model/aIUsage.ts +39 -0
- package/model/aIUsageText.ts +52 -0
- package/model/account.ts +59 -4
- package/model/accountAnalytics.ts +73 -0
- package/model/accountAnalyticsInitialSync.ts +37 -0
- package/model/accountConnectionHealth.ts +124 -0
- package/model/accountErrorsInner.ts +50 -0
- package/model/accountErrorsInnerOneOf.ts +49 -0
- package/model/accountGroup.ts +49 -0
- package/model/accountGroupInput.ts +40 -0
- package/model/accountHealth.ts +90 -0
- package/model/accountHealthDailyCap.ts +43 -0
- package/model/accountSchedule.ts +49 -0
- package/model/addCompetitor202Response.ts +43 -0
- package/model/addCompetitor409Response.ts +37 -0
- package/model/addGenericSubscriptionRequest.ts +2 -2
- package/model/addPostToQueueRequest.ts +34 -0
- package/model/agentPageMeta.ts +49 -0
- package/model/agentProposal.ts +137 -0
- package/model/agentProposalDecision.ts +31 -0
- package/model/agentRun.ts +129 -0
- package/model/analyticsPeriod.ts +52 -0
- package/model/analyticsSummary.ts +39 -0
- package/model/analyticsSummaryData.ts +100 -0
- package/model/apiActivity.ts +94 -0
- package/model/apiActivityOutcome.ts +27 -0
- package/model/apiKey.ts +77 -0
- package/model/apiKeyAbility.ts +21 -0
- package/model/apiKeyInput.ts +56 -0
- package/model/approveAgentProposal200Response.ts +32 -0
- package/model/approveAgentProposal409Response.ts +38 -0
- package/model/approveInboxReplyDraft403Response.ts +43 -0
- package/model/approvePostRequest.ts +62 -0
- package/model/bestPostingTimes.ts +41 -0
- package/model/bestPostingTimesTimesInner.ts +49 -0
- package/model/blogToSocial200Response.ts +9 -2
- package/model/blogToSocial429Response.ts +2 -2
- package/model/blogToSocialCaption.ts +2 -2
- package/model/blogToSocialInput.ts +11 -2
- package/model/blogToSocialMedia.ts +2 -2
- package/model/blogToSocialResponse.ts +2 -2
- package/model/brandVoice.ts +136 -0
- package/model/brandVoiceInput.ts +142 -0
- package/model/brandVoiceMeta.ts +34 -0
- package/model/cancelSubscription422Response.ts +38 -0
- package/model/cancelSubscription422ResponseErrors.ts +31 -0
- package/model/cancelSubscriptionRequest.ts +34 -0
- package/model/changeSubscriptionPlanRequest.ts +2 -2
- package/model/channelAccount.ts +101 -0
- package/model/checkoutSubscription200Response.ts +2 -2
- package/model/checkoutSubscriptionRequest.ts +2 -2
- package/model/codedError.ts +46 -0
- package/model/competitor.ts +82 -0
- package/model/competitorDetail.ts +96 -0
- package/model/competitorInput.ts +43 -0
- package/model/competitorMedia.ts +61 -0
- package/model/competitorSnapshot.ts +43 -0
- package/model/completeChunkedUploadRequest.ts +40 -0
- package/model/connectChannelInput.ts +64 -0
- package/model/createAccountGroup201Response.ts +32 -0
- package/model/createAgent201Response.ts +32 -0
- package/model/createApiKey201Response.ts +32 -0
- package/model/createApiKey201ResponseData.ts +86 -0
- package/model/createHashtagGroup201Response.ts +32 -0
- package/model/createInboxReplyDraft201Response.ts +32 -0
- package/model/createMediaFolderRequest.ts +43 -0
- package/model/createMention201Response.ts +32 -0
- package/model/createRecyclingRule201Response.ts +32 -0
- package/model/createReportExport201Response.ts +32 -0
- package/model/createResellerClient201Response.ts +32 -0
- package/model/createRssFeed201Response.ts +32 -0
- package/model/createTemplate201Response.ts +32 -0
- package/model/createWebhookSubscription201Response.ts +32 -0
- package/model/createWebhookSubscription201ResponseData.ts +70 -0
- package/model/deleteAgent200Response.ts +31 -0
- package/model/deleteMediaBulkRequest.ts +6 -5
- package/model/deleteMediaBulkRequestItemsInner.ts +26 -0
- package/model/deleteMediaFolderRequest.ts +31 -0
- package/model/deleteMode.ts +2 -2
- package/model/deletePostRequest.ts +2 -2
- package/model/deletePostsBulkRequest.ts +2 -2
- package/model/deleteReceiptsBulkRequest.ts +2 -2
- package/model/deleteResult.ts +2 -2
- package/model/deleteUser400Response.ts +2 -2
- package/model/deleteUsersBulkRequest.ts +2 -2
- package/model/deleteWorkspacesBulkRequest.ts +2 -2
- package/model/getAccountHealth200Response.ts +32 -0
- package/model/getBrandVoice200Response.ts +32 -0
- package/model/getCompetitor200Response.ts +32 -0
- package/model/getInboxConversation200Response.ts +32 -0
- package/model/getPostingSchedule200Response.ts +32 -0
- package/model/getRemoteUploadStatus200Response.ts +2 -2
- package/model/getReportBranding200Response.ts +32 -0
- package/model/guardrailError.ts +82 -0
- package/model/hashtagGroup.ts +46 -0
- package/model/hashtagGroupInput.ts +37 -0
- package/model/imageAltText200Response.ts +2 -2
- package/model/imageAltTextInput.ts +2 -2
- package/model/imageAltTextResponse.ts +2 -2
- package/model/imageCreditBalance.ts +67 -0
- package/model/imageEditInput.ts +11 -2
- package/model/imageGenerate200Response.ts +9 -2
- package/model/imageGenerate429Response.ts +2 -2
- package/model/imageGenerateInput.ts +14 -2
- package/model/imageGenerationResponse.ts +2 -2
- package/model/imagePrompt200Response.ts +9 -2
- package/model/imagePrompt429Response.ts +2 -2
- package/model/imagePromptInput.ts +14 -2
- package/model/imagePromptResponse.ts +2 -2
- package/model/imageVariations200Response.ts +2 -2
- package/model/imageVariationsInput.ts +2 -2
- package/model/imageVariationsResponse.ts +2 -2
- package/model/inboxAuthor.ts +43 -0
- package/model/inboxConversation.ts +139 -0
- package/model/inboxConversationAccount.ts +49 -0
- package/model/inboxConversationUpdate.ts +43 -0
- package/model/inboxMessage.ts +95 -0
- package/model/inboxMessageAuthor.ts +43 -0
- package/model/inboxReplyDraft.ts +132 -0
- package/model/inboxReplyDraftApprove.ts +34 -0
- package/model/inboxReplyDraftEdit.ts +31 -0
- package/model/inboxReplyDraftInput.ts +43 -0
- package/model/initiateChunkedUpload201Response.ts +2 -2
- package/model/initiateChunkedUploadRequest.ts +2 -2
- package/model/initiateRemoteUpload201Response.ts +60 -2
- package/model/initiateRemoteUpload201ResponseOneOf.ts +2 -2
- package/model/initiateRemoteUploadRequest.ts +11 -2
- package/model/learnBrandVoiceInput.ts +61 -0
- package/model/learnBrandVoiceResponse.ts +39 -0
- package/model/learnBrandVoiceResponseMeta.ts +55 -0
- package/model/listAccountGroups200Response.ts +46 -0
- package/model/listAccounts200Response.ts +2 -2
- package/model/listAgentProposals200Response.ts +39 -0
- package/model/listAgentRuns200Response.ts +39 -0
- package/model/listAgents200Response.ts +32 -0
- package/model/listApiActivity200Response.ts +46 -0
- package/model/listApiKeys200Response.ts +32 -0
- package/model/listCompetitors200Response.ts +32 -0
- package/model/listHashtagGroups200Response.ts +46 -0
- package/model/listInboxConversations200Response.ts +46 -0
- package/model/listInboxReplyDrafts200Response.ts +46 -0
- package/model/listMedia200Response.ts +2 -2
- package/model/listMediaFolders200Response.ts +32 -0
- package/model/listMentions200Response.ts +46 -0
- package/model/listMyWorkspaces200Response.ts +32 -0
- package/model/listPosts200Response.ts +2 -2
- package/model/listReceipts200Response.ts +2 -2
- package/model/listRecyclingRules200Response.ts +32 -0
- package/model/listRecyclingRuns200Response.ts +32 -0
- package/model/listReportExports200Response.ts +32 -0
- package/model/listResellerClients200Response.ts +39 -0
- package/model/listRssFeeds200Response.ts +32 -0
- package/model/listTags200Response.ts +2 -2
- package/model/listTemplates200Response.ts +46 -0
- package/model/listUsers200Response.ts +2 -2
- package/model/listWebhookSubscriptions200Response.ts +32 -0
- package/model/listWorkspaces200Response.ts +2 -2
- package/model/media.ts +60 -2
- package/model/mediaBase64Input.ts +61 -0
- package/model/mediaFolder.ts +55 -0
- package/model/mediaFolderInput.ts +43 -0
- package/model/mediaFolderRef.ts +37 -0
- package/model/mention.ts +65 -0
- package/model/mentionIdentity.ts +55 -0
- package/model/mentionIdentityInput.ts +67 -0
- package/model/mentionInput.ts +44 -0
- package/model/messageOnly.ts +31 -0
- package/model/models.ts +600 -0
- package/model/paginationMeta.ts +2 -2
- package/model/paginationMetaLinks.ts +4 -4
- package/model/paginationMetaMeta.ts +4 -4
- package/model/pollRssFeed200Response.ts +50 -0
- package/model/post.ts +12 -2
- package/model/postAnalytics.ts +46 -0
- package/model/postContent.ts +6 -3
- package/model/postInput.ts +33 -2
- package/model/postOptionsInstagram.ts +59 -0
- package/model/postOptionsTikTok.ts +97 -0
- package/model/postOptionsYoutube.ts +62 -0
- package/model/postStatus.ts +9 -3
- package/model/postVersion.ts +16 -6
- package/model/postVersionOptions.ts +55 -0
- package/model/postingSchedule.ts +74 -0
- package/model/postingScheduleDay.ts +50 -0
- package/model/postingScheduleDayTimesInner.ts +34 -0
- package/model/postingScheduleInput.ts +53 -0
- package/model/postingTimeSlot.ts +51 -0
- package/model/postingTimes.ts +88 -0
- package/model/postingTimesBestInner.ts +49 -0
- package/model/postingTimesDayIntervalsInnerInner.ts +69 -0
- package/model/postingTimesDaysInner.ts +57 -0
- package/model/preflightResult.ts +69 -0
- package/model/publicWorkspace.ts +50 -0
- package/model/publicWorkspacePivot.ts +53 -0
- package/model/publishProgress.ts +46 -0
- package/model/queueSlots.ts +43 -0
- package/model/receipt.ts +2 -2
- package/model/receiptInput.ts +2 -2
- package/model/receiptUpdateInput.ts +2 -2
- package/model/recommendedPostingTimes.ts +61 -0
- package/model/reconnectLink.ts +46 -0
- package/model/recyclingRule.ts +117 -0
- package/model/recyclingRuleInput.ts +114 -0
- package/model/recyclingRuleSettings.ts +83 -0
- package/model/recyclingRuleUpdate.ts +71 -0
- package/model/recyclingRun.ts +71 -0
- package/model/removeGenericSubscription422Response.ts +31 -0
- package/model/removeUserFromWorkspaceRequest.ts +2 -2
- package/model/reportBranding.ts +61 -0
- package/model/reportBrandingInput.ts +55 -0
- package/model/reportExport.ts +121 -0
- package/model/reportExportInput.ts +91 -0
- package/model/repurposeContent200Response.ts +39 -0
- package/model/repurposeInput.ts +213 -0
- package/model/repurposeInputTheme.ts +46 -0
- package/model/repurposeResult.ts +89 -0
- package/model/repurposeResultMedia.ts +40 -0
- package/model/repurposeResultSource.ts +51 -0
- package/model/repurposeSlide.ts +43 -0
- package/model/resellerClient.ts +82 -0
- package/model/resellerClientInput.ts +31 -0
- package/model/resellerClientUsage.ts +43 -0
- package/model/retryPostAccountResult.ts +47 -0
- package/model/rssFeed.ts +100 -0
- package/model/rssFeedInput.ts +79 -0
- package/model/rssFeedUpdate.ts +73 -0
- package/model/runAgent202Response.ts +32 -0
- package/model/schedulePostRequest.ts +39 -2
- package/model/scheduleResult.ts +11 -2
- package/model/subscription.ts +2 -2
- package/model/subscriptionInput.ts +2 -2
- package/model/subscriptionStatus.ts +2 -2
- package/model/subscriptionUpdateInput.ts +2 -2
- package/model/tag.ts +2 -2
- package/model/tagInput.ts +2 -2
- package/model/template.ts +47 -0
- package/model/templateContentItem.ts +40 -0
- package/model/templateInput.ts +41 -0
- package/model/templateInputContentInner.ts +40 -0
- package/model/updateMediaRequest.ts +18 -3
- package/model/uploadChunk201Response.ts +2 -2
- package/model/user.ts +11 -2
- package/model/userInput.ts +2 -2
- package/model/userUpdateInput.ts +2 -2
- package/model/webhookEventName.ts +31 -0
- package/model/webhookEventPayload.ts +43 -0
- package/model/webhookSubscription.ts +61 -0
- package/model/webhookSubscriptionInput.ts +67 -0
- package/model/workspace.ts +17 -3
- package/model/workspaceAgent.ts +91 -0
- package/model/workspaceAgentInput.ts +67 -0
- package/model/workspaceAgentSettings.ts +70 -0
- package/model/workspaceAgentUpdate.ts +58 -0
- package/model/workspaceInput.ts +8 -3
- package/model/workspaceUserInput.ts +2 -2
- package/model/xUsage.ts +68 -0
- package/model/xUsageCounter.ts +40 -0
- package/package.json +1 -1
package/api/workspacesApi.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* PostBoost API
|
|
3
|
-
* The PostBoost REST API lets you publish, schedule, and analyze social media posts across 12+ platforms from a single integration. No OAuth apps to maintain — PostBoost handles platform authorization for you. ## Base URL All workspace-scoped endpoints are prefixed with `/{workspaceUuid}`. Panel/admin endpoints are prefixed with `/panel`. ## Authentication All requests require a Bearer token in the `Authorization` header. Generate tokens in your PostBoost dashboard under **Settings → Access Tokens**. ``` Authorization: Bearer YOUR_API_TOKEN ```
|
|
3
|
+
* The PostBoost REST API lets you publish, schedule, and analyze social media posts across 12+ platforms from a single integration. No OAuth apps to maintain — PostBoost handles platform authorization for you. ## Base URL All workspace-scoped endpoints are prefixed with `/{workspaceUuid}`. Panel/admin endpoints are prefixed with `/panel`. ## Plan access Every workspace-scoped endpoint returns `403` when the workspace\'s plan does not include API access (capability `api`). ## Dates and times Post dates and times (`date`, `time`, `accounts_schedule`) are read in the request\'s `timezone` when one is given, otherwise in the workspace timezone. ## Idempotent requests Send an `Idempotency-Key` header (any unique string, for example a UUID) with a `POST`. Repeating the request with the same key within 24 hours returns the stored response with `Idempotent-Replayed: true` and creates nothing new. Reusing a key with a different body returns `422`; a request still in progress with the same key returns `409`. `5xx` and `429` responses are not stored, so they can be retried with the same key. ## Guardrails for automated clients Create and update requests are checked before anything is written: a post whose content matches one created for the same account in the last 24 hours returns `409` (`code: duplicate_post`, override with `allow_duplicate: true`), scheduling past an account\'s daily cap returns `429` (`code: account_daily_cap_reached`), and scheduling to an account that must be reconnected returns `422` (`code: account_unauthorized` or `account_token_missing`). Use `POST /{workspaceUuid}/posts/validate` for a dry run and `GET /{workspaceUuid}/activity` to review what API clients did. ## Authentication All requests require a Bearer token in the `Authorization` header. Generate tokens in your PostBoost dashboard under **Settings → Access Tokens**. ``` Authorization: Bearer YOUR_API_TOKEN ```
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.
|
|
5
|
+
* The version of the OpenAPI document: 1.14.0
|
|
6
6
|
* Contact: hi@postboost.co
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -15,12 +15,22 @@ import localVarRequest from 'request';
|
|
|
15
15
|
import http from 'http';
|
|
16
16
|
|
|
17
17
|
/* tslint:disable:no-unused-locals */
|
|
18
|
+
import { AICredits } from '../model/aICredits';
|
|
19
|
+
import { ApiKeyInput } from '../model/apiKeyInput';
|
|
20
|
+
import { CodedError } from '../model/codedError';
|
|
21
|
+
import { CreateApiKey201Response } from '../model/createApiKey201Response';
|
|
22
|
+
import { CreateResellerClient201Response } from '../model/createResellerClient201Response';
|
|
18
23
|
import { DeleteWorkspacesBulkRequest } from '../model/deleteWorkspacesBulkRequest';
|
|
24
|
+
import { ListApiKeys200Response } from '../model/listApiKeys200Response';
|
|
25
|
+
import { ListMyWorkspaces200Response } from '../model/listMyWorkspaces200Response';
|
|
26
|
+
import { ListResellerClients200Response } from '../model/listResellerClients200Response';
|
|
19
27
|
import { ListWorkspaces200Response } from '../model/listWorkspaces200Response';
|
|
20
28
|
import { RemoveUserFromWorkspaceRequest } from '../model/removeUserFromWorkspaceRequest';
|
|
29
|
+
import { ResellerClientInput } from '../model/resellerClientInput';
|
|
21
30
|
import { Workspace } from '../model/workspace';
|
|
22
31
|
import { WorkspaceInput } from '../model/workspaceInput';
|
|
23
32
|
import { WorkspaceUserInput } from '../model/workspaceUserInput';
|
|
33
|
+
import { XUsage } from '../model/xUsage';
|
|
24
34
|
|
|
25
35
|
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
26
36
|
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
|
@@ -176,6 +186,164 @@ export class WorkspacesApi {
|
|
|
176
186
|
});
|
|
177
187
|
});
|
|
178
188
|
}
|
|
189
|
+
/**
|
|
190
|
+
* Creates a least-privilege API key for the calling user, bound to this workspace. Pick the abilities it gets and, optionally, the accounts it may act on. The plain key is in `data.token` of this response only; store it safely. | Ability | Allows | |---|---| | `read` | Every `GET`, plus the `posts/validate` dry run | | `write` | Creating and changing drafts, media, tags, mentions, the brand voice | | `publish` | Scheduling, queueing, publishing now, approving and retrying posts, and editing a post that is already scheduled | | `ai` | The `/ai/_*` endpoints, running agents and turning on agent AI review (they also need AI credits) | | `webhooks` | Webhook subscription endpoints | A scoped key is refused on other workspaces, on the admin panel, on API key management and on the app\'s built-in MCP endpoint (use `/mcp/postboost`). With `account_ids`, it may only name those accounts (in the URL, `accounts`, `account_ids` or post versions), cannot touch posts on other accounts, and `GET accounts` / `GET posts` only list matching items (pagination counts are computed before that filter). Workspace admins only, called with an unscoped key.
|
|
191
|
+
* @summary Create a scoped API key
|
|
192
|
+
* @param workspaceUuid UUID of the workspace.
|
|
193
|
+
* @param apiKeyInput
|
|
194
|
+
*/
|
|
195
|
+
public async createApiKey (workspaceUuid: string, apiKeyInput: ApiKeyInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateApiKey201Response; }> {
|
|
196
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/api-keys'
|
|
197
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
198
|
+
let localVarQueryParameters: any = {};
|
|
199
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
200
|
+
const produces = ['application/json'];
|
|
201
|
+
// give precedence to 'application/json'
|
|
202
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
203
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
204
|
+
} else {
|
|
205
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
206
|
+
}
|
|
207
|
+
let localVarFormParams: any = {};
|
|
208
|
+
|
|
209
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
210
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
211
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling createApiKey.');
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// verify required parameter 'apiKeyInput' is not null or undefined
|
|
215
|
+
if (apiKeyInput === null || apiKeyInput === undefined) {
|
|
216
|
+
throw new Error('Required parameter apiKeyInput was null or undefined when calling createApiKey.');
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
220
|
+
|
|
221
|
+
let localVarUseFormData = false;
|
|
222
|
+
|
|
223
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
224
|
+
method: 'POST',
|
|
225
|
+
qs: localVarQueryParameters,
|
|
226
|
+
headers: localVarHeaderParams,
|
|
227
|
+
uri: localVarPath,
|
|
228
|
+
useQuerystring: this._useQuerystring,
|
|
229
|
+
json: true,
|
|
230
|
+
body: ObjectSerializer.serialize(apiKeyInput, "ApiKeyInput")
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
let authenticationPromise = Promise.resolve();
|
|
234
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
235
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
236
|
+
}
|
|
237
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
238
|
+
|
|
239
|
+
let interceptorPromise = authenticationPromise;
|
|
240
|
+
for (const interceptor of this.interceptors) {
|
|
241
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return interceptorPromise.then(() => {
|
|
245
|
+
if (Object.keys(localVarFormParams).length) {
|
|
246
|
+
if (localVarUseFormData) {
|
|
247
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
248
|
+
} else {
|
|
249
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return new Promise<{ response: http.IncomingMessage; body: CreateApiKey201Response; }>((resolve, reject) => {
|
|
253
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
254
|
+
if (error) {
|
|
255
|
+
reject(error);
|
|
256
|
+
} else {
|
|
257
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
258
|
+
body = ObjectSerializer.deserialize(body, "CreateApiKey201Response");
|
|
259
|
+
resolve({ response: response, body: body });
|
|
260
|
+
} else {
|
|
261
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Creates a client workspace on the Reseller client plan, with the caller as its owner and admin, and links it to this workspace. Fails with `422` and `code: client_limit_reached` once the plan\'s client limit is used (archived clients do not count). Archive clients on the Client workspaces page. Workspace admins with an unscoped key only.
|
|
270
|
+
* @summary Create a client workspace
|
|
271
|
+
* @param workspaceUuid UUID of the workspace.
|
|
272
|
+
* @param resellerClientInput
|
|
273
|
+
*/
|
|
274
|
+
public async createResellerClient (workspaceUuid: string, resellerClientInput: ResellerClientInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateResellerClient201Response; }> {
|
|
275
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/clients'
|
|
276
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
277
|
+
let localVarQueryParameters: any = {};
|
|
278
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
279
|
+
const produces = ['application/json'];
|
|
280
|
+
// give precedence to 'application/json'
|
|
281
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
282
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
283
|
+
} else {
|
|
284
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
285
|
+
}
|
|
286
|
+
let localVarFormParams: any = {};
|
|
287
|
+
|
|
288
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
289
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
290
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling createResellerClient.');
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// verify required parameter 'resellerClientInput' is not null or undefined
|
|
294
|
+
if (resellerClientInput === null || resellerClientInput === undefined) {
|
|
295
|
+
throw new Error('Required parameter resellerClientInput was null or undefined when calling createResellerClient.');
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
299
|
+
|
|
300
|
+
let localVarUseFormData = false;
|
|
301
|
+
|
|
302
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
303
|
+
method: 'POST',
|
|
304
|
+
qs: localVarQueryParameters,
|
|
305
|
+
headers: localVarHeaderParams,
|
|
306
|
+
uri: localVarPath,
|
|
307
|
+
useQuerystring: this._useQuerystring,
|
|
308
|
+
json: true,
|
|
309
|
+
body: ObjectSerializer.serialize(resellerClientInput, "ResellerClientInput")
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
let authenticationPromise = Promise.resolve();
|
|
313
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
314
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
315
|
+
}
|
|
316
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
317
|
+
|
|
318
|
+
let interceptorPromise = authenticationPromise;
|
|
319
|
+
for (const interceptor of this.interceptors) {
|
|
320
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return interceptorPromise.then(() => {
|
|
324
|
+
if (Object.keys(localVarFormParams).length) {
|
|
325
|
+
if (localVarUseFormData) {
|
|
326
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
327
|
+
} else {
|
|
328
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
return new Promise<{ response: http.IncomingMessage; body: CreateResellerClient201Response; }>((resolve, reject) => {
|
|
332
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
333
|
+
if (error) {
|
|
334
|
+
reject(error);
|
|
335
|
+
} else {
|
|
336
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
337
|
+
body = ObjectSerializer.deserialize(body, "CreateResellerClient201Response");
|
|
338
|
+
resolve({ response: response, body: body });
|
|
339
|
+
} else {
|
|
340
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
});
|
|
345
|
+
});
|
|
346
|
+
}
|
|
179
347
|
/**
|
|
180
348
|
* Create a new workspace. Admin only.
|
|
181
349
|
* @summary Create workspace
|
|
@@ -248,6 +416,85 @@ export class WorkspacesApi {
|
|
|
248
416
|
});
|
|
249
417
|
});
|
|
250
418
|
}
|
|
419
|
+
/**
|
|
420
|
+
* Revokes a scoped key bound to this workspace. It stops working at once. Workspace admins only, called with an unscoped key.
|
|
421
|
+
* @summary Revoke a scoped API key
|
|
422
|
+
* @param workspaceUuid UUID of the workspace.
|
|
423
|
+
* @param apiKeyId The key\'s `id` from `GET api-keys`.
|
|
424
|
+
*/
|
|
425
|
+
public async deleteApiKey (workspaceUuid: string, apiKeyId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
426
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/api-keys/{apiKeyId}'
|
|
427
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
|
|
428
|
+
.replace('{' + 'apiKeyId' + '}', encodeURIComponent(String(apiKeyId)));
|
|
429
|
+
let localVarQueryParameters: any = {};
|
|
430
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
431
|
+
const produces = ['application/json'];
|
|
432
|
+
// give precedence to 'application/json'
|
|
433
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
434
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
435
|
+
} else {
|
|
436
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
437
|
+
}
|
|
438
|
+
let localVarFormParams: any = {};
|
|
439
|
+
|
|
440
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
441
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
442
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling deleteApiKey.');
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
// verify required parameter 'apiKeyId' is not null or undefined
|
|
446
|
+
if (apiKeyId === null || apiKeyId === undefined) {
|
|
447
|
+
throw new Error('Required parameter apiKeyId was null or undefined when calling deleteApiKey.');
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
451
|
+
|
|
452
|
+
let localVarUseFormData = false;
|
|
453
|
+
|
|
454
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
455
|
+
method: 'DELETE',
|
|
456
|
+
qs: localVarQueryParameters,
|
|
457
|
+
headers: localVarHeaderParams,
|
|
458
|
+
uri: localVarPath,
|
|
459
|
+
useQuerystring: this._useQuerystring,
|
|
460
|
+
json: true,
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
let authenticationPromise = Promise.resolve();
|
|
464
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
465
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
466
|
+
}
|
|
467
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
468
|
+
|
|
469
|
+
let interceptorPromise = authenticationPromise;
|
|
470
|
+
for (const interceptor of this.interceptors) {
|
|
471
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
return interceptorPromise.then(() => {
|
|
475
|
+
if (Object.keys(localVarFormParams).length) {
|
|
476
|
+
if (localVarUseFormData) {
|
|
477
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
478
|
+
} else {
|
|
479
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
483
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
484
|
+
if (error) {
|
|
485
|
+
reject(error);
|
|
486
|
+
} else {
|
|
487
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
488
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
489
|
+
resolve({ response: response, body: body });
|
|
490
|
+
} else {
|
|
491
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
});
|
|
496
|
+
});
|
|
497
|
+
}
|
|
251
498
|
/**
|
|
252
499
|
* Permanently deletes a single workspace and all its associated data. Admin only.
|
|
253
500
|
* @summary Delete workspace
|
|
@@ -464,6 +711,359 @@ export class WorkspacesApi {
|
|
|
464
711
|
});
|
|
465
712
|
});
|
|
466
713
|
}
|
|
714
|
+
/**
|
|
715
|
+
* Returns whether the workspace can use AI credits, its remaining balance, and whether the balance is low. Admin only.
|
|
716
|
+
* @summary Get workspace AI credits
|
|
717
|
+
* @param workspaceUuid UUID of the workspace.
|
|
718
|
+
*/
|
|
719
|
+
public async getWorkspaceAICredits (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: AICredits; }> {
|
|
720
|
+
const localVarPath = this.basePath + '/panel/workspaces/{workspaceUuid}/ai-credits'
|
|
721
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
722
|
+
let localVarQueryParameters: any = {};
|
|
723
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
724
|
+
const produces = ['application/json'];
|
|
725
|
+
// give precedence to 'application/json'
|
|
726
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
727
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
728
|
+
} else {
|
|
729
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
730
|
+
}
|
|
731
|
+
let localVarFormParams: any = {};
|
|
732
|
+
|
|
733
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
734
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
735
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling getWorkspaceAICredits.');
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
739
|
+
|
|
740
|
+
let localVarUseFormData = false;
|
|
741
|
+
|
|
742
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
743
|
+
method: 'GET',
|
|
744
|
+
qs: localVarQueryParameters,
|
|
745
|
+
headers: localVarHeaderParams,
|
|
746
|
+
uri: localVarPath,
|
|
747
|
+
useQuerystring: this._useQuerystring,
|
|
748
|
+
json: true,
|
|
749
|
+
};
|
|
750
|
+
|
|
751
|
+
let authenticationPromise = Promise.resolve();
|
|
752
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
753
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
754
|
+
}
|
|
755
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
756
|
+
|
|
757
|
+
let interceptorPromise = authenticationPromise;
|
|
758
|
+
for (const interceptor of this.interceptors) {
|
|
759
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
return interceptorPromise.then(() => {
|
|
763
|
+
if (Object.keys(localVarFormParams).length) {
|
|
764
|
+
if (localVarUseFormData) {
|
|
765
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
766
|
+
} else {
|
|
767
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
return new Promise<{ response: http.IncomingMessage; body: AICredits; }>((resolve, reject) => {
|
|
771
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
772
|
+
if (error) {
|
|
773
|
+
reject(error);
|
|
774
|
+
} else {
|
|
775
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
776
|
+
body = ObjectSerializer.deserialize(body, "AICredits");
|
|
777
|
+
resolve({ response: response, body: body });
|
|
778
|
+
} else {
|
|
779
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
});
|
|
783
|
+
});
|
|
784
|
+
});
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* The workspace\'s X posts this calendar month (UTC) against its monthly X allowance. Every thread part is one X post; a part with a link also counts as a link post. When the allowance is used up, scheduling to X is refused (`429`, `code: x_monthly_cap_reached`) and X posts that come due fail with \"Monthly X allowance reached\". Other networks are not affected. See the X policy in the developer docs.
|
|
788
|
+
* @summary X (Twitter) usage
|
|
789
|
+
* @param workspaceUuid UUID of the workspace.
|
|
790
|
+
*/
|
|
791
|
+
public async getXUsage (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: XUsage; }> {
|
|
792
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/usage/x'
|
|
793
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
794
|
+
let localVarQueryParameters: any = {};
|
|
795
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
796
|
+
const produces = ['application/json'];
|
|
797
|
+
// give precedence to 'application/json'
|
|
798
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
799
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
800
|
+
} else {
|
|
801
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
802
|
+
}
|
|
803
|
+
let localVarFormParams: any = {};
|
|
804
|
+
|
|
805
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
806
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
807
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling getXUsage.');
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
811
|
+
|
|
812
|
+
let localVarUseFormData = false;
|
|
813
|
+
|
|
814
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
815
|
+
method: 'GET',
|
|
816
|
+
qs: localVarQueryParameters,
|
|
817
|
+
headers: localVarHeaderParams,
|
|
818
|
+
uri: localVarPath,
|
|
819
|
+
useQuerystring: this._useQuerystring,
|
|
820
|
+
json: true,
|
|
821
|
+
};
|
|
822
|
+
|
|
823
|
+
let authenticationPromise = Promise.resolve();
|
|
824
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
825
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
826
|
+
}
|
|
827
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
828
|
+
|
|
829
|
+
let interceptorPromise = authenticationPromise;
|
|
830
|
+
for (const interceptor of this.interceptors) {
|
|
831
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
return interceptorPromise.then(() => {
|
|
835
|
+
if (Object.keys(localVarFormParams).length) {
|
|
836
|
+
if (localVarUseFormData) {
|
|
837
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
838
|
+
} else {
|
|
839
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
return new Promise<{ response: http.IncomingMessage; body: XUsage; }>((resolve, reject) => {
|
|
843
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
844
|
+
if (error) {
|
|
845
|
+
reject(error);
|
|
846
|
+
} else {
|
|
847
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
848
|
+
body = ObjectSerializer.deserialize(body, "XUsage");
|
|
849
|
+
resolve({ response: response, body: body });
|
|
850
|
+
} else {
|
|
851
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
});
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* Scoped API keys bound to this workspace, newest first. The secret is never shown again after creation. Workspace admins only, called with an unscoped key (a scoped key gets `403` with `code: insufficient_scope`).
|
|
860
|
+
* @summary List scoped API keys
|
|
861
|
+
* @param workspaceUuid UUID of the workspace.
|
|
862
|
+
*/
|
|
863
|
+
public async listApiKeys (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListApiKeys200Response; }> {
|
|
864
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/api-keys'
|
|
865
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
866
|
+
let localVarQueryParameters: any = {};
|
|
867
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
868
|
+
const produces = ['application/json'];
|
|
869
|
+
// give precedence to 'application/json'
|
|
870
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
871
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
872
|
+
} else {
|
|
873
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
874
|
+
}
|
|
875
|
+
let localVarFormParams: any = {};
|
|
876
|
+
|
|
877
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
878
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
879
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling listApiKeys.');
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
883
|
+
|
|
884
|
+
let localVarUseFormData = false;
|
|
885
|
+
|
|
886
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
887
|
+
method: 'GET',
|
|
888
|
+
qs: localVarQueryParameters,
|
|
889
|
+
headers: localVarHeaderParams,
|
|
890
|
+
uri: localVarPath,
|
|
891
|
+
useQuerystring: this._useQuerystring,
|
|
892
|
+
json: true,
|
|
893
|
+
};
|
|
894
|
+
|
|
895
|
+
let authenticationPromise = Promise.resolve();
|
|
896
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
897
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
898
|
+
}
|
|
899
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
900
|
+
|
|
901
|
+
let interceptorPromise = authenticationPromise;
|
|
902
|
+
for (const interceptor of this.interceptors) {
|
|
903
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
return interceptorPromise.then(() => {
|
|
907
|
+
if (Object.keys(localVarFormParams).length) {
|
|
908
|
+
if (localVarUseFormData) {
|
|
909
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
910
|
+
} else {
|
|
911
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
return new Promise<{ response: http.IncomingMessage; body: ListApiKeys200Response; }>((resolve, reject) => {
|
|
915
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
916
|
+
if (error) {
|
|
917
|
+
reject(error);
|
|
918
|
+
} else {
|
|
919
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
920
|
+
body = ObjectSerializer.deserialize(body, "ListApiKeys200Response");
|
|
921
|
+
resolve({ response: response, body: body });
|
|
922
|
+
} else {
|
|
923
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
});
|
|
927
|
+
});
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
/**
|
|
931
|
+
* Returns the workspaces the authenticated user belongs to, most recently updated first, with the caller\'s role in each. Use a returned `uuid` as `workspaceUuid`.
|
|
932
|
+
* @summary List my workspaces
|
|
933
|
+
*/
|
|
934
|
+
public async listMyWorkspaces (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListMyWorkspaces200Response; }> {
|
|
935
|
+
const localVarPath = this.basePath + '/workspaces';
|
|
936
|
+
let localVarQueryParameters: any = {};
|
|
937
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
938
|
+
const produces = ['application/json'];
|
|
939
|
+
// give precedence to 'application/json'
|
|
940
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
941
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
942
|
+
} else {
|
|
943
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
944
|
+
}
|
|
945
|
+
let localVarFormParams: any = {};
|
|
946
|
+
|
|
947
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
948
|
+
|
|
949
|
+
let localVarUseFormData = false;
|
|
950
|
+
|
|
951
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
952
|
+
method: 'GET',
|
|
953
|
+
qs: localVarQueryParameters,
|
|
954
|
+
headers: localVarHeaderParams,
|
|
955
|
+
uri: localVarPath,
|
|
956
|
+
useQuerystring: this._useQuerystring,
|
|
957
|
+
json: true,
|
|
958
|
+
};
|
|
959
|
+
|
|
960
|
+
let authenticationPromise = Promise.resolve();
|
|
961
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
962
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
963
|
+
}
|
|
964
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
965
|
+
|
|
966
|
+
let interceptorPromise = authenticationPromise;
|
|
967
|
+
for (const interceptor of this.interceptors) {
|
|
968
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
return interceptorPromise.then(() => {
|
|
972
|
+
if (Object.keys(localVarFormParams).length) {
|
|
973
|
+
if (localVarUseFormData) {
|
|
974
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
975
|
+
} else {
|
|
976
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
return new Promise<{ response: http.IncomingMessage; body: ListMyWorkspaces200Response; }>((resolve, reject) => {
|
|
980
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
981
|
+
if (error) {
|
|
982
|
+
reject(error);
|
|
983
|
+
} else {
|
|
984
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
985
|
+
body = ObjectSerializer.deserialize(body, "ListMyWorkspaces200Response");
|
|
986
|
+
resolve({ response: response, body: body });
|
|
987
|
+
} else {
|
|
988
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
});
|
|
992
|
+
});
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* Client workspaces this workspace created on the Reseller plan, active first, then archived. `accounts_needing_reconnect` counts accounts whose connection must be renewed. `meta` gives the active clients and the plan\'s client limit. Workspace admins with an unscoped key only; other workspaces get `403` with `code: not_a_reseller`.
|
|
997
|
+
* @summary List client workspaces
|
|
998
|
+
* @param workspaceUuid UUID of the workspace.
|
|
999
|
+
*/
|
|
1000
|
+
public async listResellerClients (workspaceUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListResellerClients200Response; }> {
|
|
1001
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/clients'
|
|
1002
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
1003
|
+
let localVarQueryParameters: any = {};
|
|
1004
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1005
|
+
const produces = ['application/json'];
|
|
1006
|
+
// give precedence to 'application/json'
|
|
1007
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1008
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1009
|
+
} else {
|
|
1010
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1011
|
+
}
|
|
1012
|
+
let localVarFormParams: any = {};
|
|
1013
|
+
|
|
1014
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
1015
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
1016
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling listResellerClients.');
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1020
|
+
|
|
1021
|
+
let localVarUseFormData = false;
|
|
1022
|
+
|
|
1023
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1024
|
+
method: 'GET',
|
|
1025
|
+
qs: localVarQueryParameters,
|
|
1026
|
+
headers: localVarHeaderParams,
|
|
1027
|
+
uri: localVarPath,
|
|
1028
|
+
useQuerystring: this._useQuerystring,
|
|
1029
|
+
json: true,
|
|
1030
|
+
};
|
|
1031
|
+
|
|
1032
|
+
let authenticationPromise = Promise.resolve();
|
|
1033
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
1034
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
1035
|
+
}
|
|
1036
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1037
|
+
|
|
1038
|
+
let interceptorPromise = authenticationPromise;
|
|
1039
|
+
for (const interceptor of this.interceptors) {
|
|
1040
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
return interceptorPromise.then(() => {
|
|
1044
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1045
|
+
if (localVarUseFormData) {
|
|
1046
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1047
|
+
} else {
|
|
1048
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
return new Promise<{ response: http.IncomingMessage; body: ListResellerClients200Response; }>((resolve, reject) => {
|
|
1052
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1053
|
+
if (error) {
|
|
1054
|
+
reject(error);
|
|
1055
|
+
} else {
|
|
1056
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1057
|
+
body = ObjectSerializer.deserialize(body, "ListResellerClients200Response");
|
|
1058
|
+
resolve({ response: response, body: body });
|
|
1059
|
+
} else {
|
|
1060
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
});
|
|
1064
|
+
});
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
467
1067
|
/**
|
|
468
1068
|
* Returns a paginated list of all workspaces. Admin only.
|
|
469
1069
|
* @summary List workspaces
|
|
@@ -629,7 +1229,7 @@ export class WorkspacesApi {
|
|
|
629
1229
|
});
|
|
630
1230
|
}
|
|
631
1231
|
/**
|
|
632
|
-
* Updates a workspace\'s name,
|
|
1232
|
+
* Updates a workspace\'s name, owner, or access status. Admin only. `hex_color` is accepted but ignored.
|
|
633
1233
|
* @summary Update workspace
|
|
634
1234
|
* @param workspaceUuid UUID of the workspace.
|
|
635
1235
|
* @param workspaceInput
|