postboost 1.6.0 → 1.8.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/README.md +1 -1
- package/api/aIApi.ts +2 -2
- package/api/accountsApi.ts +24 -4
- package/api/analyticsApi.ts +553 -0
- package/api/apis.ts +5 -1
- package/api/mediaApi.ts +381 -10
- package/api/mentionsApi.ts +507 -0
- package/api/postsApi.ts +182 -9
- package/api/receiptsApi.ts +2 -2
- package/api/subscriptionsApi.ts +10 -5
- package/api/tagsApi.ts +2 -2
- package/api/usersApi.ts +2 -2
- package/api/workspacesApi.ts +142 -3
- package/model/aICredits.ts +52 -0
- package/model/account.ts +35 -2
- package/model/accountAnalytics.ts +73 -0
- package/model/accountAnalyticsInitialSync.ts +37 -0
- package/model/accountSchedule.ts +49 -0
- package/model/addGenericSubscriptionRequest.ts +2 -2
- package/model/addPostToQueueRequest.ts +34 -0
- package/model/analyticsPeriod.ts +52 -0
- package/model/analyticsSummary.ts +39 -0
- package/model/analyticsSummaryData.ts +100 -0
- package/model/approvePostRequest.ts +62 -0
- package/model/bestPostingTimes.ts +41 -0
- package/model/bestPostingTimesTimesInner.ts +49 -0
- package/model/blogToSocial200Response.ts +2 -2
- package/model/blogToSocial429Response.ts +2 -2
- package/model/blogToSocialCaption.ts +2 -2
- package/model/blogToSocialInput.ts +2 -2
- package/model/blogToSocialMedia.ts +2 -2
- package/model/blogToSocialResponse.ts +2 -2
- 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/checkoutSubscription200Response.ts +2 -2
- package/model/checkoutSubscriptionRequest.ts +2 -2
- package/model/completeChunkedUploadRequest.ts +40 -0
- package/model/createMediaFolderRequest.ts +43 -0
- package/model/createMention201Response.ts +32 -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/getRemoteUploadStatus200Response.ts +2 -2
- package/model/imageAltText200Response.ts +2 -2
- package/model/imageAltTextInput.ts +2 -2
- package/model/imageAltTextResponse.ts +2 -2
- package/model/imageEditInput.ts +2 -2
- package/model/imageGenerate200Response.ts +2 -2
- package/model/imageGenerate429Response.ts +2 -2
- package/model/imageGenerateInput.ts +2 -2
- package/model/imageGenerationResponse.ts +5 -5
- package/model/imagePrompt200Response.ts +2 -2
- package/model/imagePrompt429Response.ts +2 -2
- package/model/imagePromptInput.ts +2 -2
- package/model/imagePromptResponse.ts +2 -2
- package/model/imageVariations200Response.ts +2 -2
- package/model/imageVariationsInput.ts +2 -2
- package/model/imageVariationsResponse.ts +5 -5
- 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/listAccounts200Response.ts +2 -2
- 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/listTags200Response.ts +2 -2
- package/model/listUsers200Response.ts +2 -2
- package/model/listWorkspaces200Response.ts +2 -2
- package/model/media.ts +60 -2
- package/model/mediaFolder.ts +55 -0
- package/model/mediaFolderInput.ts +43 -0
- package/model/{generatedImageItem.ts → mediaFolderRef.ts} +10 -16
- 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/models.ts +125 -3
- package/model/paginationMeta.ts +2 -2
- package/model/paginationMetaLinks.ts +2 -2
- package/model/paginationMetaMeta.ts +2 -2
- package/model/post.ts +12 -2
- package/model/postAnalytics.ts +46 -0
- package/model/postContent.ts +2 -2
- package/model/postInput.ts +15 -2
- package/model/postStatus.ts +9 -3
- package/model/postVersion.ts +11 -2
- 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/publicWorkspace.ts +50 -0
- package/model/publicWorkspacePivot.ts +53 -0
- package/model/publishProgress.ts +46 -0
- package/model/receipt.ts +2 -2
- package/model/receiptInput.ts +2 -2
- package/model/receiptUpdateInput.ts +2 -2
- package/model/removeGenericSubscription422Response.ts +31 -0
- package/model/removeUserFromWorkspaceRequest.ts +2 -2
- package/model/retryPostAccountResult.ts +47 -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/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/workspace.ts +17 -3
- package/model/workspaceInput.ts +8 -3
- package/model/workspaceUserInput.ts +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,507 @@
|
|
|
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. ## 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.8.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 { CreateMention201Response } from '../model/createMention201Response';
|
|
19
|
+
import { ListMentions200Response } from '../model/listMentions200Response';
|
|
20
|
+
import { MentionInput } from '../model/mentionInput';
|
|
21
|
+
|
|
22
|
+
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
23
|
+
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
|
24
|
+
|
|
25
|
+
import { HttpError, RequestFile } from './apis';
|
|
26
|
+
|
|
27
|
+
let defaultBasePath = 'https://postboost.co/app/api';
|
|
28
|
+
|
|
29
|
+
// ===============================================
|
|
30
|
+
// This file is autogenerated - Please do not edit
|
|
31
|
+
// ===============================================
|
|
32
|
+
|
|
33
|
+
export enum MentionsApiApiKeys {
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class MentionsApi {
|
|
37
|
+
protected _basePath = defaultBasePath;
|
|
38
|
+
protected _defaultHeaders : any = {};
|
|
39
|
+
protected _useQuerystring : boolean = false;
|
|
40
|
+
|
|
41
|
+
protected authentications = {
|
|
42
|
+
'default': <Authentication>new VoidAuth(),
|
|
43
|
+
'bearerAuth': new HttpBearerAuth(),
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
protected interceptors: Interceptor[] = [];
|
|
47
|
+
|
|
48
|
+
constructor(basePath?: string);
|
|
49
|
+
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
50
|
+
if (password) {
|
|
51
|
+
if (basePath) {
|
|
52
|
+
this.basePath = basePath;
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
if (basePathOrUsername) {
|
|
56
|
+
this.basePath = basePathOrUsername
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
set useQuerystring(value: boolean) {
|
|
62
|
+
this._useQuerystring = value;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
set basePath(basePath: string) {
|
|
66
|
+
this._basePath = basePath;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
70
|
+
this._defaultHeaders = defaultHeaders;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
get defaultHeaders() {
|
|
74
|
+
return this._defaultHeaders;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
get basePath() {
|
|
78
|
+
return this._basePath;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
public setDefaultAuthentication(auth: Authentication) {
|
|
82
|
+
this.authentications.default = auth;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public setApiKey(key: MentionsApiApiKeys, value: string) {
|
|
86
|
+
(this.authentications as any)[MentionsApiApiKeys[key]].apiKey = value;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
set accessToken(accessToken: string | (() => string)) {
|
|
90
|
+
this.authentications.bearerAuth.accessToken = accessToken;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
public addInterceptor(interceptor: Interceptor) {
|
|
94
|
+
this.interceptors.push(interceptor);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Adds a person or page to the mention book. When one of the submitted identities already belongs to a stored mention, that mention is reused and the identities are added to it (status `200` instead of `201`).
|
|
99
|
+
* @summary Create mention
|
|
100
|
+
* @param workspaceUuid UUID of the workspace.
|
|
101
|
+
* @param mentionInput
|
|
102
|
+
*/
|
|
103
|
+
public async createMention (workspaceUuid: string, mentionInput: MentionInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateMention201Response; }> {
|
|
104
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/mentions'
|
|
105
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
106
|
+
let localVarQueryParameters: any = {};
|
|
107
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
108
|
+
const produces = ['application/json'];
|
|
109
|
+
// give precedence to 'application/json'
|
|
110
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
111
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
112
|
+
} else {
|
|
113
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
114
|
+
}
|
|
115
|
+
let localVarFormParams: any = {};
|
|
116
|
+
|
|
117
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
118
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
119
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling createMention.');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// verify required parameter 'mentionInput' is not null or undefined
|
|
123
|
+
if (mentionInput === null || mentionInput === undefined) {
|
|
124
|
+
throw new Error('Required parameter mentionInput was null or undefined when calling createMention.');
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
128
|
+
|
|
129
|
+
let localVarUseFormData = false;
|
|
130
|
+
|
|
131
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
132
|
+
method: 'POST',
|
|
133
|
+
qs: localVarQueryParameters,
|
|
134
|
+
headers: localVarHeaderParams,
|
|
135
|
+
uri: localVarPath,
|
|
136
|
+
useQuerystring: this._useQuerystring,
|
|
137
|
+
json: true,
|
|
138
|
+
body: ObjectSerializer.serialize(mentionInput, "MentionInput")
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
let authenticationPromise = Promise.resolve();
|
|
142
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
143
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
144
|
+
}
|
|
145
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
146
|
+
|
|
147
|
+
let interceptorPromise = authenticationPromise;
|
|
148
|
+
for (const interceptor of this.interceptors) {
|
|
149
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return interceptorPromise.then(() => {
|
|
153
|
+
if (Object.keys(localVarFormParams).length) {
|
|
154
|
+
if (localVarUseFormData) {
|
|
155
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
156
|
+
} else {
|
|
157
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return new Promise<{ response: http.IncomingMessage; body: CreateMention201Response; }>((resolve, reject) => {
|
|
161
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
162
|
+
if (error) {
|
|
163
|
+
reject(error);
|
|
164
|
+
} else {
|
|
165
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
166
|
+
body = ObjectSerializer.deserialize(body, "CreateMention201Response");
|
|
167
|
+
resolve({ response: response, body: body });
|
|
168
|
+
} else {
|
|
169
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Removes a mention from the mention book. `success` is false when nothing was deleted.
|
|
178
|
+
* @summary Delete mention
|
|
179
|
+
* @param workspaceUuid UUID of the workspace.
|
|
180
|
+
* @param mentionId The mention\'s `id` (a UUID).
|
|
181
|
+
*/
|
|
182
|
+
public async deleteMention (workspaceUuid: string, mentionId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
183
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/mentions/{mentionId}'
|
|
184
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
|
|
185
|
+
.replace('{' + 'mentionId' + '}', encodeURIComponent(String(mentionId)));
|
|
186
|
+
let localVarQueryParameters: any = {};
|
|
187
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
188
|
+
const produces = ['application/json'];
|
|
189
|
+
// give precedence to 'application/json'
|
|
190
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
191
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
192
|
+
} else {
|
|
193
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
194
|
+
}
|
|
195
|
+
let localVarFormParams: any = {};
|
|
196
|
+
|
|
197
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
198
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
199
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling deleteMention.');
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// verify required parameter 'mentionId' is not null or undefined
|
|
203
|
+
if (mentionId === null || mentionId === undefined) {
|
|
204
|
+
throw new Error('Required parameter mentionId was null or undefined when calling deleteMention.');
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
208
|
+
|
|
209
|
+
let localVarUseFormData = false;
|
|
210
|
+
|
|
211
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
212
|
+
method: 'DELETE',
|
|
213
|
+
qs: localVarQueryParameters,
|
|
214
|
+
headers: localVarHeaderParams,
|
|
215
|
+
uri: localVarPath,
|
|
216
|
+
useQuerystring: this._useQuerystring,
|
|
217
|
+
json: true,
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
let authenticationPromise = Promise.resolve();
|
|
221
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
222
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
223
|
+
}
|
|
224
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
225
|
+
|
|
226
|
+
let interceptorPromise = authenticationPromise;
|
|
227
|
+
for (const interceptor of this.interceptors) {
|
|
228
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return interceptorPromise.then(() => {
|
|
232
|
+
if (Object.keys(localVarFormParams).length) {
|
|
233
|
+
if (localVarUseFormData) {
|
|
234
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
235
|
+
} else {
|
|
236
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
240
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
241
|
+
if (error) {
|
|
242
|
+
reject(error);
|
|
243
|
+
} else {
|
|
244
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
245
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
246
|
+
resolve({ response: response, body: body });
|
|
247
|
+
} else {
|
|
248
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Returns a single mention with its identities.
|
|
257
|
+
* @summary Get mention
|
|
258
|
+
* @param workspaceUuid UUID of the workspace.
|
|
259
|
+
* @param mentionId The mention\'s `id` (a UUID).
|
|
260
|
+
*/
|
|
261
|
+
public async getMention (workspaceUuid: string, mentionId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateMention201Response; }> {
|
|
262
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/mentions/{mentionId}'
|
|
263
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
|
|
264
|
+
.replace('{' + 'mentionId' + '}', encodeURIComponent(String(mentionId)));
|
|
265
|
+
let localVarQueryParameters: any = {};
|
|
266
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
267
|
+
const produces = ['application/json'];
|
|
268
|
+
// give precedence to 'application/json'
|
|
269
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
270
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
271
|
+
} else {
|
|
272
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
273
|
+
}
|
|
274
|
+
let localVarFormParams: any = {};
|
|
275
|
+
|
|
276
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
277
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
278
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling getMention.');
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// verify required parameter 'mentionId' is not null or undefined
|
|
282
|
+
if (mentionId === null || mentionId === undefined) {
|
|
283
|
+
throw new Error('Required parameter mentionId was null or undefined when calling getMention.');
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
287
|
+
|
|
288
|
+
let localVarUseFormData = false;
|
|
289
|
+
|
|
290
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
291
|
+
method: 'GET',
|
|
292
|
+
qs: localVarQueryParameters,
|
|
293
|
+
headers: localVarHeaderParams,
|
|
294
|
+
uri: localVarPath,
|
|
295
|
+
useQuerystring: this._useQuerystring,
|
|
296
|
+
json: true,
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
let authenticationPromise = Promise.resolve();
|
|
300
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
301
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
302
|
+
}
|
|
303
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
304
|
+
|
|
305
|
+
let interceptorPromise = authenticationPromise;
|
|
306
|
+
for (const interceptor of this.interceptors) {
|
|
307
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
return interceptorPromise.then(() => {
|
|
311
|
+
if (Object.keys(localVarFormParams).length) {
|
|
312
|
+
if (localVarUseFormData) {
|
|
313
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
314
|
+
} else {
|
|
315
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return new Promise<{ response: http.IncomingMessage; body: CreateMention201Response; }>((resolve, reject) => {
|
|
319
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
320
|
+
if (error) {
|
|
321
|
+
reject(error);
|
|
322
|
+
} else {
|
|
323
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
324
|
+
body = ObjectSerializer.deserialize(body, "CreateMention201Response");
|
|
325
|
+
resolve({ response: response, body: body });
|
|
326
|
+
} else {
|
|
327
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Returns a paginated list of the workspace\'s mention book, ranked, with each entry\'s network identities.
|
|
336
|
+
* @summary List mentions
|
|
337
|
+
* @param workspaceUuid UUID of the workspace.
|
|
338
|
+
* @param q Search keyword.
|
|
339
|
+
* @param perPage
|
|
340
|
+
* @param page
|
|
341
|
+
*/
|
|
342
|
+
public async listMentions (workspaceUuid: string, q?: string, perPage?: number, page?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListMentions200Response; }> {
|
|
343
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/mentions'
|
|
344
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)));
|
|
345
|
+
let localVarQueryParameters: any = {};
|
|
346
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
347
|
+
const produces = ['application/json'];
|
|
348
|
+
// give precedence to 'application/json'
|
|
349
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
350
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
351
|
+
} else {
|
|
352
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
353
|
+
}
|
|
354
|
+
let localVarFormParams: any = {};
|
|
355
|
+
|
|
356
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
357
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
358
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling listMentions.');
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
if (q !== undefined) {
|
|
362
|
+
localVarQueryParameters['q'] = ObjectSerializer.serialize(q, "string");
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
if (perPage !== undefined) {
|
|
366
|
+
localVarQueryParameters['per_page'] = ObjectSerializer.serialize(perPage, "number");
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
if (page !== undefined) {
|
|
370
|
+
localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number");
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
374
|
+
|
|
375
|
+
let localVarUseFormData = false;
|
|
376
|
+
|
|
377
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
378
|
+
method: 'GET',
|
|
379
|
+
qs: localVarQueryParameters,
|
|
380
|
+
headers: localVarHeaderParams,
|
|
381
|
+
uri: localVarPath,
|
|
382
|
+
useQuerystring: this._useQuerystring,
|
|
383
|
+
json: true,
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
let authenticationPromise = Promise.resolve();
|
|
387
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
388
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
389
|
+
}
|
|
390
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
391
|
+
|
|
392
|
+
let interceptorPromise = authenticationPromise;
|
|
393
|
+
for (const interceptor of this.interceptors) {
|
|
394
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
return interceptorPromise.then(() => {
|
|
398
|
+
if (Object.keys(localVarFormParams).length) {
|
|
399
|
+
if (localVarUseFormData) {
|
|
400
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
401
|
+
} else {
|
|
402
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
return new Promise<{ response: http.IncomingMessage; body: ListMentions200Response; }>((resolve, reject) => {
|
|
406
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
407
|
+
if (error) {
|
|
408
|
+
reject(error);
|
|
409
|
+
} else {
|
|
410
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
411
|
+
body = ObjectSerializer.deserialize(body, "ListMentions200Response");
|
|
412
|
+
resolve({ response: response, body: body });
|
|
413
|
+
} else {
|
|
414
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
});
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Replaces the mention\'s name, avatar and identities. Identities for providers not in the payload are removed. An identity already held by another mention returns `422`.
|
|
423
|
+
* @summary Update mention
|
|
424
|
+
* @param workspaceUuid UUID of the workspace.
|
|
425
|
+
* @param mentionId The mention\'s `id` (a UUID).
|
|
426
|
+
* @param mentionInput
|
|
427
|
+
*/
|
|
428
|
+
public async updateMention (workspaceUuid: string, mentionId: string, mentionInput: MentionInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateMention201Response; }> {
|
|
429
|
+
const localVarPath = this.basePath + '/{workspaceUuid}/mentions/{mentionId}'
|
|
430
|
+
.replace('{' + 'workspaceUuid' + '}', encodeURIComponent(String(workspaceUuid)))
|
|
431
|
+
.replace('{' + 'mentionId' + '}', encodeURIComponent(String(mentionId)));
|
|
432
|
+
let localVarQueryParameters: any = {};
|
|
433
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
434
|
+
const produces = ['application/json'];
|
|
435
|
+
// give precedence to 'application/json'
|
|
436
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
437
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
438
|
+
} else {
|
|
439
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
440
|
+
}
|
|
441
|
+
let localVarFormParams: any = {};
|
|
442
|
+
|
|
443
|
+
// verify required parameter 'workspaceUuid' is not null or undefined
|
|
444
|
+
if (workspaceUuid === null || workspaceUuid === undefined) {
|
|
445
|
+
throw new Error('Required parameter workspaceUuid was null or undefined when calling updateMention.');
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// verify required parameter 'mentionId' is not null or undefined
|
|
449
|
+
if (mentionId === null || mentionId === undefined) {
|
|
450
|
+
throw new Error('Required parameter mentionId was null or undefined when calling updateMention.');
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
// verify required parameter 'mentionInput' is not null or undefined
|
|
454
|
+
if (mentionInput === null || mentionInput === undefined) {
|
|
455
|
+
throw new Error('Required parameter mentionInput was null or undefined when calling updateMention.');
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
459
|
+
|
|
460
|
+
let localVarUseFormData = false;
|
|
461
|
+
|
|
462
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
463
|
+
method: 'PUT',
|
|
464
|
+
qs: localVarQueryParameters,
|
|
465
|
+
headers: localVarHeaderParams,
|
|
466
|
+
uri: localVarPath,
|
|
467
|
+
useQuerystring: this._useQuerystring,
|
|
468
|
+
json: true,
|
|
469
|
+
body: ObjectSerializer.serialize(mentionInput, "MentionInput")
|
|
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: CreateMention201Response; }>((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, "CreateMention201Response");
|
|
498
|
+
resolve({ response: response, body: body });
|
|
499
|
+
} else {
|
|
500
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
});
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
}
|