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/apis.ts
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
export * from './aIApi';
|
|
2
2
|
import { AIApi } from './aIApi';
|
|
3
|
+
export * from './accountGroupsApi';
|
|
4
|
+
import { AccountGroupsApi } from './accountGroupsApi';
|
|
3
5
|
export * from './accountsApi';
|
|
4
6
|
import { AccountsApi } from './accountsApi';
|
|
7
|
+
export * from './activityApi';
|
|
8
|
+
import { ActivityApi } from './activityApi';
|
|
9
|
+
export * from './agentsApi';
|
|
10
|
+
import { AgentsApi } from './agentsApi';
|
|
11
|
+
export * from './analyticsApi';
|
|
12
|
+
import { AnalyticsApi } from './analyticsApi';
|
|
13
|
+
export * from './competitorsApi';
|
|
14
|
+
import { CompetitorsApi } from './competitorsApi';
|
|
15
|
+
export * from './hashtagGroupsApi';
|
|
16
|
+
import { HashtagGroupsApi } from './hashtagGroupsApi';
|
|
17
|
+
export * from './inboxApi';
|
|
18
|
+
import { InboxApi } from './inboxApi';
|
|
5
19
|
export * from './mediaApi';
|
|
6
20
|
import { MediaApi } from './mediaApi';
|
|
21
|
+
export * from './mentionsApi';
|
|
22
|
+
import { MentionsApi } from './mentionsApi';
|
|
23
|
+
export * from './postingScheduleApi';
|
|
24
|
+
import { PostingScheduleApi } from './postingScheduleApi';
|
|
7
25
|
export * from './postsApi';
|
|
8
26
|
import { PostsApi } from './postsApi';
|
|
9
27
|
export * from './receiptsApi';
|
|
@@ -12,8 +30,12 @@ export * from './subscriptionsApi';
|
|
|
12
30
|
import { SubscriptionsApi } from './subscriptionsApi';
|
|
13
31
|
export * from './tagsApi';
|
|
14
32
|
import { TagsApi } from './tagsApi';
|
|
33
|
+
export * from './templatesApi';
|
|
34
|
+
import { TemplatesApi } from './templatesApi';
|
|
15
35
|
export * from './usersApi';
|
|
16
36
|
import { UsersApi } from './usersApi';
|
|
37
|
+
export * from './webhooksApi';
|
|
38
|
+
import { WebhooksApi } from './webhooksApi';
|
|
17
39
|
export * from './workspacesApi';
|
|
18
40
|
import { WorkspacesApi } from './workspacesApi';
|
|
19
41
|
import * as http from 'http';
|
|
@@ -27,4 +49,4 @@ export class HttpError extends Error {
|
|
|
27
49
|
|
|
28
50
|
export { RequestFile } from '../model/models';
|
|
29
51
|
|
|
30
|
-
export const APIS = [AIApi, AccountsApi, MediaApi, PostsApi, ReceiptsApi, SubscriptionsApi, TagsApi, UsersApi, WorkspacesApi];
|
|
52
|
+
export const APIS = [AIApi, AccountGroupsApi, AccountsApi, ActivityApi, AgentsApi, AnalyticsApi, CompetitorsApi, HashtagGroupsApi, InboxApi, MediaApi, MentionsApi, PostingScheduleApi, PostsApi, ReceiptsApi, SubscriptionsApi, TagsApi, TemplatesApi, UsersApi, WebhooksApi, WorkspacesApi];
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PostBoost API
|
|
3
|
+
* The PostBoost REST API lets you publish, schedule, and analyze social media posts across 12+ platforms from a single integration. No OAuth apps to maintain — PostBoost handles platform authorization for you. ## Base URL All workspace-scoped endpoints are prefixed with `/{workspaceUuid}`. Panel/admin endpoints are prefixed with `/panel`. ## Plan access Every workspace-scoped endpoint returns `403` when the workspace\'s plan does not include API access (capability `api`). ## Dates and times Post dates and times (`date`, `time`, `accounts_schedule`) are read in the request\'s `timezone` when one is given, otherwise in the workspace timezone. ## Idempotent requests Send an `Idempotency-Key` header (any unique string, for example a UUID) with a `POST`. Repeating the request with the same key within 24 hours returns the stored response with `Idempotent-Replayed: true` and creates nothing new. Reusing a key with a different body returns `422`; a request still in progress with the same key returns `409`. `5xx` and `429` responses are not stored, so they can be retried with the same key. ## Guardrails for automated clients Create and update requests are checked before anything is written: a post whose content matches one created for the same account in the last 24 hours returns `409` (`code: duplicate_post`, override with `allow_duplicate: true`), scheduling past an account\'s daily cap returns `429` (`code: account_daily_cap_reached`), and scheduling to an account that must be reconnected returns `422` (`code: account_unauthorized` or `account_token_missing`). Use `POST /{workspaceUuid}/posts/validate` for a dry run and `GET /{workspaceUuid}/activity` to review what API clients did. ## Authentication All requests require a Bearer token in the `Authorization` header. Generate tokens in your PostBoost dashboard under **Settings → Access Tokens**. ``` Authorization: Bearer YOUR_API_TOKEN ```
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.14.0
|
|
6
|
+
* Contact: hi@postboost.co
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
import localVarRequest from 'request';
|
|
15
|
+
import http from 'http';
|
|
16
|
+
|
|
17
|
+
/* tslint:disable:no-unused-locals */
|
|
18
|
+
import { AddCompetitor202Response } from '../model/addCompetitor202Response';
|
|
19
|
+
import { AddCompetitor409Response } from '../model/addCompetitor409Response';
|
|
20
|
+
import { CompetitorInput } from '../model/competitorInput';
|
|
21
|
+
import { GetCompetitor200Response } from '../model/getCompetitor200Response';
|
|
22
|
+
import { ListCompetitors200Response } from '../model/listCompetitors200Response';
|
|
23
|
+
|
|
24
|
+
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
25
|
+
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
|
26
|
+
|
|
27
|
+
import { HttpError, RequestFile } from './apis';
|
|
28
|
+
|
|
29
|
+
let defaultBasePath = 'https://postboost.co/app/api';
|
|
30
|
+
|
|
31
|
+
// ===============================================
|
|
32
|
+
// This file is autogenerated - Please do not edit
|
|
33
|
+
// ===============================================
|
|
34
|
+
|
|
35
|
+
export enum CompetitorsApiApiKeys {
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class CompetitorsApi {
|
|
39
|
+
protected _basePath = defaultBasePath;
|
|
40
|
+
protected _defaultHeaders : any = {};
|
|
41
|
+
protected _useQuerystring : boolean = false;
|
|
42
|
+
|
|
43
|
+
protected authentications = {
|
|
44
|
+
'default': <Authentication>new VoidAuth(),
|
|
45
|
+
'bearerAuth': new HttpBearerAuth(),
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
protected interceptors: Interceptor[] = [];
|
|
49
|
+
|
|
50
|
+
constructor(basePath?: string);
|
|
51
|
+
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
52
|
+
if (password) {
|
|
53
|
+
if (basePath) {
|
|
54
|
+
this.basePath = basePath;
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
if (basePathOrUsername) {
|
|
58
|
+
this.basePath = basePathOrUsername
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
set useQuerystring(value: boolean) {
|
|
64
|
+
this._useQuerystring = value;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
set basePath(basePath: string) {
|
|
68
|
+
this._basePath = basePath;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
72
|
+
this._defaultHeaders = defaultHeaders;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
get defaultHeaders() {
|
|
76
|
+
return this._defaultHeaders;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
get basePath() {
|
|
80
|
+
return this._basePath;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public setDefaultAuthentication(auth: Authentication) {
|
|
84
|
+
this.authentications.default = auth;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public setApiKey(key: CompetitorsApiApiKeys, value: string) {
|
|
88
|
+
(this.authentications as any)[CompetitorsApiApiKeys[key]].apiKey = value;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
set accessToken(accessToken: string | (() => string)) {
|
|
92
|
+
this.authentications.bearerAuth.accessToken = accessToken;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public addInterceptor(interceptor: Interceptor) {
|
|
96
|
+
this.interceptors.push(interceptor);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Starts tracking a public Instagram business or creator account from one of your Instagram accounts (connected through a Facebook Page). Returns `202` at once; followers, snapshots and recent media appear after the background import. `409` if that account already tracks the username. Admins and members only (not viewers).
|
|
101
|
+
* @summary Track a competitor
|
|
102
|
+
* @param workspaceUuid UUID of the workspace.
|
|
103
|
+
* @param competitorInput
|
|
104
|
+
*/
|
|
105
|
+
public async addCompetitor (workspaceUuid: string, competitorInput: CompetitorInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: AddCompetitor202Response; }> {
|
|
106
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/competitors'
|
|
107
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
108
|
+
let localVarQueryParameters: any = {};
|
|
109
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
110
|
+
const produces = ['application/json'];
|
|
111
|
+
// give precedence to 'application/json'
|
|
112
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
113
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
114
|
+
} else {
|
|
115
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
116
|
+
}
|
|
117
|
+
let localVarFormParams: any = {};
|
|
118
|
+
|
|
119
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
120
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
121
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling addCompetitor.');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// verify required parameter 'competitorInput' is not null or undefined
|
|
125
|
+
if (competitorInput === null || competitorInput === undefined) {
|
|
126
|
+
throw new Error('Required parameter competitorInput was null or undefined when calling addCompetitor.');
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
130
|
+
|
|
131
|
+
let localVarUseFormData = false;
|
|
132
|
+
|
|
133
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
134
|
+
method: 'POST',
|
|
135
|
+
qs: localVarQueryParameters,
|
|
136
|
+
headers: localVarHeaderParams,
|
|
137
|
+
uri: localVarPath,
|
|
138
|
+
useQuerystring: this._useQuerystring,
|
|
139
|
+
json: true,
|
|
140
|
+
body: ObjectSerializer.serialize(competitorInput, "CompetitorInput")
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
let authenticationPromise = Promise.resolve();
|
|
144
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
145
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
146
|
+
}
|
|
147
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
148
|
+
|
|
149
|
+
let interceptorPromise = authenticationPromise;
|
|
150
|
+
for (const interceptor of this.interceptors) {
|
|
151
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return interceptorPromise.then(() => {
|
|
155
|
+
if (Object.keys(localVarFormParams).length) {
|
|
156
|
+
if (localVarUseFormData) {
|
|
157
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
158
|
+
} else {
|
|
159
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return new Promise<{ response: http.IncomingMessage; body: AddCompetitor202Response; }>((resolve, reject) => {
|
|
163
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
164
|
+
if (error) {
|
|
165
|
+
reject(error);
|
|
166
|
+
} else {
|
|
167
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
168
|
+
body = ObjectSerializer.deserialize(body, "AddCompetitor202Response");
|
|
169
|
+
resolve({ response: response, body: body });
|
|
170
|
+
} else {
|
|
171
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Deletes the competitor with its snapshots and media. Admins and members only (not viewers).
|
|
180
|
+
* @summary Stop tracking a competitor
|
|
181
|
+
* @param workspaceUuid UUID of the workspace.
|
|
182
|
+
* @param competitorId The competitor `id`.
|
|
183
|
+
*/
|
|
184
|
+
public async deleteCompetitor (workspaceUuid: string, competitorId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
|
185
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/competitors/{competitorId}'
|
|
186
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
|
|
187
|
+
.replace('{' + 'competitorId' + '}', encodeURIComponent(String(competitorId)));
|
|
188
|
+
let localVarQueryParameters: any = {};
|
|
189
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
190
|
+
const produces = ['application/json'];
|
|
191
|
+
// give precedence to 'application/json'
|
|
192
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
193
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
194
|
+
} else {
|
|
195
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
196
|
+
}
|
|
197
|
+
let localVarFormParams: any = {};
|
|
198
|
+
|
|
199
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
200
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
201
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling deleteCompetitor.');
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// verify required parameter 'competitorId' is not null or undefined
|
|
205
|
+
if (competitorId === null || competitorId === undefined) {
|
|
206
|
+
throw new Error('Required parameter competitorId was null or undefined when calling deleteCompetitor.');
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
210
|
+
|
|
211
|
+
let localVarUseFormData = false;
|
|
212
|
+
|
|
213
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
214
|
+
method: 'DELETE',
|
|
215
|
+
qs: localVarQueryParameters,
|
|
216
|
+
headers: localVarHeaderParams,
|
|
217
|
+
uri: localVarPath,
|
|
218
|
+
useQuerystring: this._useQuerystring,
|
|
219
|
+
json: true,
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
let authenticationPromise = Promise.resolve();
|
|
223
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
224
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
225
|
+
}
|
|
226
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
227
|
+
|
|
228
|
+
let interceptorPromise = authenticationPromise;
|
|
229
|
+
for (const interceptor of this.interceptors) {
|
|
230
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return interceptorPromise.then(() => {
|
|
234
|
+
if (Object.keys(localVarFormParams).length) {
|
|
235
|
+
if (localVarUseFormData) {
|
|
236
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
237
|
+
} else {
|
|
238
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
|
242
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
243
|
+
if (error) {
|
|
244
|
+
reject(error);
|
|
245
|
+
} else {
|
|
246
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
247
|
+
resolve({ response: response, body: body });
|
|
248
|
+
} else {
|
|
249
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* The competitor with daily follower snapshots for the last 90 days and its 12 most recent posts.
|
|
258
|
+
* @summary Get a competitor
|
|
259
|
+
* @param workspaceUuid UUID of the workspace.
|
|
260
|
+
* @param competitorId The competitor `id`.
|
|
261
|
+
*/
|
|
262
|
+
public async getCompetitor (workspaceUuid: string, competitorId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetCompetitor200Response; }> {
|
|
263
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/competitors/{competitorId}'
|
|
264
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
|
|
265
|
+
.replace('{' + 'competitorId' + '}', encodeURIComponent(String(competitorId)));
|
|
266
|
+
let localVarQueryParameters: any = {};
|
|
267
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
268
|
+
const produces = ['application/json'];
|
|
269
|
+
// give precedence to 'application/json'
|
|
270
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
271
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
272
|
+
} else {
|
|
273
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
274
|
+
}
|
|
275
|
+
let localVarFormParams: any = {};
|
|
276
|
+
|
|
277
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
278
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
279
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling getCompetitor.');
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// verify required parameter 'competitorId' is not null or undefined
|
|
283
|
+
if (competitorId === null || competitorId === undefined) {
|
|
284
|
+
throw new Error('Required parameter competitorId was null or undefined when calling getCompetitor.');
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
288
|
+
|
|
289
|
+
let localVarUseFormData = false;
|
|
290
|
+
|
|
291
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
292
|
+
method: 'GET',
|
|
293
|
+
qs: localVarQueryParameters,
|
|
294
|
+
headers: localVarHeaderParams,
|
|
295
|
+
uri: localVarPath,
|
|
296
|
+
useQuerystring: this._useQuerystring,
|
|
297
|
+
json: true,
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
let authenticationPromise = Promise.resolve();
|
|
301
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
302
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
303
|
+
}
|
|
304
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
305
|
+
|
|
306
|
+
let interceptorPromise = authenticationPromise;
|
|
307
|
+
for (const interceptor of this.interceptors) {
|
|
308
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
return interceptorPromise.then(() => {
|
|
312
|
+
if (Object.keys(localVarFormParams).length) {
|
|
313
|
+
if (localVarUseFormData) {
|
|
314
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
315
|
+
} else {
|
|
316
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return new Promise<{ response: http.IncomingMessage; body: GetCompetitor200Response; }>((resolve, reject) => {
|
|
320
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
321
|
+
if (error) {
|
|
322
|
+
reject(error);
|
|
323
|
+
} else {
|
|
324
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
325
|
+
body = ObjectSerializer.deserialize(body, "GetCompetitor200Response");
|
|
326
|
+
resolve({ response: response, body: body });
|
|
327
|
+
} else {
|
|
328
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Instagram business or creator accounts the workspace tracks, by follower count.
|
|
337
|
+
* @summary List competitors
|
|
338
|
+
* @param workspaceUuid UUID of the workspace.
|
|
339
|
+
* @param accountId Only competitors tracked from this Instagram account `id`.
|
|
340
|
+
*/
|
|
341
|
+
public async listCompetitors (workspaceUuid: string, accountId?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListCompetitors200Response; }> {
|
|
342
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/competitors'
|
|
343
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
344
|
+
let localVarQueryParameters: any = {};
|
|
345
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
346
|
+
const produces = ['application/json'];
|
|
347
|
+
// give precedence to 'application/json'
|
|
348
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
349
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
350
|
+
} else {
|
|
351
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
352
|
+
}
|
|
353
|
+
let localVarFormParams: any = {};
|
|
354
|
+
|
|
355
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
356
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
357
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling listCompetitors.');
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if (accountId !== undefined) {
|
|
361
|
+
localVarQueryParameters['account_id'] = ObjectSerializer.serialize(accountId, "number");
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
365
|
+
|
|
366
|
+
let localVarUseFormData = false;
|
|
367
|
+
|
|
368
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
369
|
+
method: 'GET',
|
|
370
|
+
qs: localVarQueryParameters,
|
|
371
|
+
headers: localVarHeaderParams,
|
|
372
|
+
uri: localVarPath,
|
|
373
|
+
useQuerystring: this._useQuerystring,
|
|
374
|
+
json: true,
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
let authenticationPromise = Promise.resolve();
|
|
378
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
379
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
380
|
+
}
|
|
381
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
382
|
+
|
|
383
|
+
let interceptorPromise = authenticationPromise;
|
|
384
|
+
for (const interceptor of this.interceptors) {
|
|
385
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
return interceptorPromise.then(() => {
|
|
389
|
+
if (Object.keys(localVarFormParams).length) {
|
|
390
|
+
if (localVarUseFormData) {
|
|
391
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
392
|
+
} else {
|
|
393
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return new Promise<{ response: http.IncomingMessage; body: ListCompetitors200Response; }>((resolve, reject) => {
|
|
397
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
398
|
+
if (error) {
|
|
399
|
+
reject(error);
|
|
400
|
+
} else {
|
|
401
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
402
|
+
body = ObjectSerializer.deserialize(body, "ListCompetitors200Response");
|
|
403
|
+
resolve({ response: response, body: body });
|
|
404
|
+
} else {
|
|
405
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
});
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
}
|