postboost 1.0.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/.openapi-generator/FILES +72 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/LICENSE +21 -0
- package/README.md +0 -0
- package/api/accountsApi.ts +247 -0
- package/api/apis.ts +28 -0
- package/api/mediaApi.ts +1007 -0
- package/api/postsApi.ts +827 -0
- package/api/receiptsApi.ts +541 -0
- package/api/subscriptionsApi.ts +856 -0
- package/api/tagsApi.ts +492 -0
- package/api/usersApi.ts +537 -0
- package/api/workspacesApi.ts +784 -0
- package/api.ts +3 -0
- package/git_push.sh +57 -0
- package/model/account.ts +94 -0
- package/model/addGenericSubscriptionRequest.ts +43 -0
- package/model/changeSubscriptionPlanRequest.ts +55 -0
- package/model/checkoutSubscription200Response.ts +31 -0
- package/model/checkoutSubscriptionRequest.ts +49 -0
- package/model/deleteMediaBulkRequest.ts +34 -0
- package/model/deleteMode.ts +22 -0
- package/model/deletePostRequest.ts +40 -0
- package/model/deletePostsBulkRequest.ts +52 -0
- package/model/deleteReceiptsBulkRequest.ts +31 -0
- package/model/deleteResult.ts +43 -0
- package/model/deleteUser400Response.ts +37 -0
- package/model/deleteUsersBulkRequest.ts +31 -0
- package/model/deleteWorkspacesBulkRequest.ts +31 -0
- package/model/getRemoteUploadStatus200Response.ts +49 -0
- package/model/initiateChunkedUpload200Response.ts +43 -0
- package/model/initiateChunkedUploadRequest.ts +46 -0
- package/model/initiateRemoteUpload200Response.ts +94 -0
- package/model/initiateRemoteUpload200ResponseOneOf.ts +31 -0
- package/model/initiateRemoteUploadRequest.ts +40 -0
- package/model/listAccounts200Response.ts +32 -0
- package/model/listMedia200Response.ts +46 -0
- package/model/listPosts200Response.ts +46 -0
- package/model/listReceipts200Response.ts +46 -0
- package/model/listTags200Response.ts +32 -0
- package/model/listUsers200Response.ts +46 -0
- package/model/listWorkspaces200Response.ts +46 -0
- package/model/media.ts +86 -0
- package/model/models.ts +443 -0
- package/model/paginationMeta.ts +39 -0
- package/model/paginationMetaLinks.ts +49 -0
- package/model/paginationMetaMeta.ts +61 -0
- package/model/post.ts +91 -0
- package/model/postContent.ts +55 -0
- package/model/postInput.ts +98 -0
- package/model/postStatus.ts +19 -0
- package/model/postVersion.ts +59 -0
- package/model/receipt.ts +85 -0
- package/model/receiptInput.ts +79 -0
- package/model/receiptUpdateInput.ts +73 -0
- package/model/removeUserFromWorkspaceRequest.ts +31 -0
- package/model/schedulePostRequest.ts +31 -0
- package/model/scheduleResult.ts +37 -0
- package/model/subscription.ts +76 -0
- package/model/subscriptionInput.ts +55 -0
- package/model/subscriptionStatus.ts +22 -0
- package/model/subscriptionUpdateInput.ts +58 -0
- package/model/tag.ts +49 -0
- package/model/tagInput.ts +37 -0
- package/model/updateMediaRequest.ts +34 -0
- package/model/uploadChunk200Response.ts +34 -0
- package/model/user.ts +61 -0
- package/model/userInput.ts +55 -0
- package/model/userUpdateInput.ts +58 -0
- package/model/workspace.ts +69 -0
- package/model/workspaceInput.ts +56 -0
- package/model/workspaceUserInput.ts +56 -0
- package/package.json +28 -0
- package/tsconfig.json +24 -0
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PostBoost API
|
|
3
|
+
* The PostBoost REST API lets you publish, schedule, and analyze social media posts across 8+ 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 ```
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.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 { DeleteReceiptsBulkRequest } from '../model/deleteReceiptsBulkRequest';
|
|
19
|
+
import { ListReceipts200Response } from '../model/listReceipts200Response';
|
|
20
|
+
import { Receipt } from '../model/receipt';
|
|
21
|
+
import { ReceiptInput } from '../model/receiptInput';
|
|
22
|
+
import { ReceiptUpdateInput } from '../model/receiptUpdateInput';
|
|
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 ReceiptsApiApiKeys {
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class ReceiptsApi {
|
|
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: ReceiptsApiApiKeys, value: string) {
|
|
88
|
+
(this.authentications as any)[ReceiptsApiApiKeys[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
|
+
*
|
|
101
|
+
* @summary Create receipt
|
|
102
|
+
* @param receiptInput
|
|
103
|
+
*/
|
|
104
|
+
public async createReceipt (receiptInput: ReceiptInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Receipt; }> {
|
|
105
|
+
const localVarPath = this.basePath + '/panel/receipts';
|
|
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 'receiptInput' is not null or undefined
|
|
118
|
+
if (receiptInput === null || receiptInput === undefined) {
|
|
119
|
+
throw new Error('Required parameter receiptInput was null or undefined when calling createReceipt.');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
123
|
+
|
|
124
|
+
let localVarUseFormData = false;
|
|
125
|
+
|
|
126
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
127
|
+
method: 'POST',
|
|
128
|
+
qs: localVarQueryParameters,
|
|
129
|
+
headers: localVarHeaderParams,
|
|
130
|
+
uri: localVarPath,
|
|
131
|
+
useQuerystring: this._useQuerystring,
|
|
132
|
+
json: true,
|
|
133
|
+
body: ObjectSerializer.serialize(receiptInput, "ReceiptInput")
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
let authenticationPromise = Promise.resolve();
|
|
137
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
138
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
139
|
+
}
|
|
140
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
141
|
+
|
|
142
|
+
let interceptorPromise = authenticationPromise;
|
|
143
|
+
for (const interceptor of this.interceptors) {
|
|
144
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return interceptorPromise.then(() => {
|
|
148
|
+
if (Object.keys(localVarFormParams).length) {
|
|
149
|
+
if (localVarUseFormData) {
|
|
150
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
151
|
+
} else {
|
|
152
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return new Promise<{ response: http.IncomingMessage; body: Receipt; }>((resolve, reject) => {
|
|
156
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
157
|
+
if (error) {
|
|
158
|
+
reject(error);
|
|
159
|
+
} else {
|
|
160
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
161
|
+
body = ObjectSerializer.deserialize(body, "Receipt");
|
|
162
|
+
resolve({ response: response, body: body });
|
|
163
|
+
} else {
|
|
164
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
*
|
|
173
|
+
* @summary Delete receipt
|
|
174
|
+
* @param receiptUuid UUID of the receipt.
|
|
175
|
+
*/
|
|
176
|
+
public async deleteReceipt (receiptUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
177
|
+
const localVarPath = this.basePath + '/panel/receipts/{receiptUuid}'
|
|
178
|
+
.replace('{' + 'receiptUuid' + '}', encodeURIComponent(String(receiptUuid)));
|
|
179
|
+
let localVarQueryParameters: any = {};
|
|
180
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
181
|
+
const produces = ['application/json'];
|
|
182
|
+
// give precedence to 'application/json'
|
|
183
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
184
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
185
|
+
} else {
|
|
186
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
187
|
+
}
|
|
188
|
+
let localVarFormParams: any = {};
|
|
189
|
+
|
|
190
|
+
// verify required parameter 'receiptUuid' is not null or undefined
|
|
191
|
+
if (receiptUuid === null || receiptUuid === undefined) {
|
|
192
|
+
throw new Error('Required parameter receiptUuid was null or undefined when calling deleteReceipt.');
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
196
|
+
|
|
197
|
+
let localVarUseFormData = false;
|
|
198
|
+
|
|
199
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
200
|
+
method: 'DELETE',
|
|
201
|
+
qs: localVarQueryParameters,
|
|
202
|
+
headers: localVarHeaderParams,
|
|
203
|
+
uri: localVarPath,
|
|
204
|
+
useQuerystring: this._useQuerystring,
|
|
205
|
+
json: true,
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
let authenticationPromise = Promise.resolve();
|
|
209
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
210
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
211
|
+
}
|
|
212
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
213
|
+
|
|
214
|
+
let interceptorPromise = authenticationPromise;
|
|
215
|
+
for (const interceptor of this.interceptors) {
|
|
216
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return interceptorPromise.then(() => {
|
|
220
|
+
if (Object.keys(localVarFormParams).length) {
|
|
221
|
+
if (localVarUseFormData) {
|
|
222
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
223
|
+
} else {
|
|
224
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
228
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
229
|
+
if (error) {
|
|
230
|
+
reject(error);
|
|
231
|
+
} else {
|
|
232
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
233
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
234
|
+
resolve({ response: response, body: body });
|
|
235
|
+
} else {
|
|
236
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
*
|
|
245
|
+
* @summary Delete receipts (bulk)
|
|
246
|
+
* @param deleteReceiptsBulkRequest
|
|
247
|
+
*/
|
|
248
|
+
public async deleteReceiptsBulk (deleteReceiptsBulkRequest: DeleteReceiptsBulkRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
249
|
+
const localVarPath = this.basePath + '/panel/receipts';
|
|
250
|
+
let localVarQueryParameters: any = {};
|
|
251
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
252
|
+
const produces = ['application/json'];
|
|
253
|
+
// give precedence to 'application/json'
|
|
254
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
255
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
256
|
+
} else {
|
|
257
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
258
|
+
}
|
|
259
|
+
let localVarFormParams: any = {};
|
|
260
|
+
|
|
261
|
+
// verify required parameter 'deleteReceiptsBulkRequest' is not null or undefined
|
|
262
|
+
if (deleteReceiptsBulkRequest === null || deleteReceiptsBulkRequest === undefined) {
|
|
263
|
+
throw new Error('Required parameter deleteReceiptsBulkRequest was null or undefined when calling deleteReceiptsBulk.');
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
267
|
+
|
|
268
|
+
let localVarUseFormData = false;
|
|
269
|
+
|
|
270
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
271
|
+
method: 'DELETE',
|
|
272
|
+
qs: localVarQueryParameters,
|
|
273
|
+
headers: localVarHeaderParams,
|
|
274
|
+
uri: localVarPath,
|
|
275
|
+
useQuerystring: this._useQuerystring,
|
|
276
|
+
json: true,
|
|
277
|
+
body: ObjectSerializer.serialize(deleteReceiptsBulkRequest, "DeleteReceiptsBulkRequest")
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
let authenticationPromise = Promise.resolve();
|
|
281
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
282
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
283
|
+
}
|
|
284
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
285
|
+
|
|
286
|
+
let interceptorPromise = authenticationPromise;
|
|
287
|
+
for (const interceptor of this.interceptors) {
|
|
288
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return interceptorPromise.then(() => {
|
|
292
|
+
if (Object.keys(localVarFormParams).length) {
|
|
293
|
+
if (localVarUseFormData) {
|
|
294
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
295
|
+
} else {
|
|
296
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
300
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
301
|
+
if (error) {
|
|
302
|
+
reject(error);
|
|
303
|
+
} else {
|
|
304
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
305
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
306
|
+
resolve({ response: response, body: body });
|
|
307
|
+
} else {
|
|
308
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
*
|
|
317
|
+
* @summary Get receipt
|
|
318
|
+
* @param receiptUuid UUID of the receipt.
|
|
319
|
+
*/
|
|
320
|
+
public async getReceipt (receiptUuid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Receipt; }> {
|
|
321
|
+
const localVarPath = this.basePath + '/panel/receipts/{receiptUuid}'
|
|
322
|
+
.replace('{' + 'receiptUuid' + '}', encodeURIComponent(String(receiptUuid)));
|
|
323
|
+
let localVarQueryParameters: any = {};
|
|
324
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
325
|
+
const produces = ['application/json'];
|
|
326
|
+
// give precedence to 'application/json'
|
|
327
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
328
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
329
|
+
} else {
|
|
330
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
331
|
+
}
|
|
332
|
+
let localVarFormParams: any = {};
|
|
333
|
+
|
|
334
|
+
// verify required parameter 'receiptUuid' is not null or undefined
|
|
335
|
+
if (receiptUuid === null || receiptUuid === undefined) {
|
|
336
|
+
throw new Error('Required parameter receiptUuid was null or undefined when calling getReceipt.');
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
340
|
+
|
|
341
|
+
let localVarUseFormData = false;
|
|
342
|
+
|
|
343
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
344
|
+
method: 'GET',
|
|
345
|
+
qs: localVarQueryParameters,
|
|
346
|
+
headers: localVarHeaderParams,
|
|
347
|
+
uri: localVarPath,
|
|
348
|
+
useQuerystring: this._useQuerystring,
|
|
349
|
+
json: true,
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
let authenticationPromise = Promise.resolve();
|
|
353
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
354
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
355
|
+
}
|
|
356
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
357
|
+
|
|
358
|
+
let interceptorPromise = authenticationPromise;
|
|
359
|
+
for (const interceptor of this.interceptors) {
|
|
360
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
return interceptorPromise.then(() => {
|
|
364
|
+
if (Object.keys(localVarFormParams).length) {
|
|
365
|
+
if (localVarUseFormData) {
|
|
366
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
367
|
+
} else {
|
|
368
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return new Promise<{ response: http.IncomingMessage; body: Receipt; }>((resolve, reject) => {
|
|
372
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
373
|
+
if (error) {
|
|
374
|
+
reject(error);
|
|
375
|
+
} else {
|
|
376
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
377
|
+
body = ObjectSerializer.deserialize(body, "Receipt");
|
|
378
|
+
resolve({ response: response, body: body });
|
|
379
|
+
} else {
|
|
380
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
});
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
*
|
|
389
|
+
* @summary List receipts
|
|
390
|
+
* @param workspaceUuid
|
|
391
|
+
* @param invoiceNumber
|
|
392
|
+
*/
|
|
393
|
+
public async listReceipts (workspaceUuid?: string, invoiceNumber?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListReceipts200Response; }> {
|
|
394
|
+
const localVarPath = this.basePath + '/panel/receipts';
|
|
395
|
+
let localVarQueryParameters: any = {};
|
|
396
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
397
|
+
const produces = ['application/json'];
|
|
398
|
+
// give precedence to 'application/json'
|
|
399
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
400
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
401
|
+
} else {
|
|
402
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
403
|
+
}
|
|
404
|
+
let localVarFormParams: any = {};
|
|
405
|
+
|
|
406
|
+
if (workspaceUuid !== undefined) {
|
|
407
|
+
localVarQueryParameters['workspace_uuid'] = ObjectSerializer.serialize(workspaceUuid, "string");
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
if (invoiceNumber !== undefined) {
|
|
411
|
+
localVarQueryParameters['invoice_number'] = ObjectSerializer.serialize(invoiceNumber, "string");
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
415
|
+
|
|
416
|
+
let localVarUseFormData = false;
|
|
417
|
+
|
|
418
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
419
|
+
method: 'GET',
|
|
420
|
+
qs: localVarQueryParameters,
|
|
421
|
+
headers: localVarHeaderParams,
|
|
422
|
+
uri: localVarPath,
|
|
423
|
+
useQuerystring: this._useQuerystring,
|
|
424
|
+
json: true,
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
let authenticationPromise = Promise.resolve();
|
|
428
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
429
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
430
|
+
}
|
|
431
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
432
|
+
|
|
433
|
+
let interceptorPromise = authenticationPromise;
|
|
434
|
+
for (const interceptor of this.interceptors) {
|
|
435
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
return interceptorPromise.then(() => {
|
|
439
|
+
if (Object.keys(localVarFormParams).length) {
|
|
440
|
+
if (localVarUseFormData) {
|
|
441
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
442
|
+
} else {
|
|
443
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
return new Promise<{ response: http.IncomingMessage; body: ListReceipts200Response; }>((resolve, reject) => {
|
|
447
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
448
|
+
if (error) {
|
|
449
|
+
reject(error);
|
|
450
|
+
} else {
|
|
451
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
452
|
+
body = ObjectSerializer.deserialize(body, "ListReceipts200Response");
|
|
453
|
+
resolve({ response: response, body: body });
|
|
454
|
+
} else {
|
|
455
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
});
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
*
|
|
464
|
+
* @summary Update receipt
|
|
465
|
+
* @param receiptUuid UUID of the receipt.
|
|
466
|
+
* @param receiptUpdateInput
|
|
467
|
+
*/
|
|
468
|
+
public async updateReceipt (receiptUuid: string, receiptUpdateInput: ReceiptUpdateInput, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
469
|
+
const localVarPath = this.basePath + '/panel/receipts/{receiptUuid}'
|
|
470
|
+
.replace('{' + 'receiptUuid' + '}', encodeURIComponent(String(receiptUuid)));
|
|
471
|
+
let localVarQueryParameters: any = {};
|
|
472
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
473
|
+
const produces = ['application/json'];
|
|
474
|
+
// give precedence to 'application/json'
|
|
475
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
476
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
477
|
+
} else {
|
|
478
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
479
|
+
}
|
|
480
|
+
let localVarFormParams: any = {};
|
|
481
|
+
|
|
482
|
+
// verify required parameter 'receiptUuid' is not null or undefined
|
|
483
|
+
if (receiptUuid === null || receiptUuid === undefined) {
|
|
484
|
+
throw new Error('Required parameter receiptUuid was null or undefined when calling updateReceipt.');
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// verify required parameter 'receiptUpdateInput' is not null or undefined
|
|
488
|
+
if (receiptUpdateInput === null || receiptUpdateInput === undefined) {
|
|
489
|
+
throw new Error('Required parameter receiptUpdateInput was null or undefined when calling updateReceipt.');
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
493
|
+
|
|
494
|
+
let localVarUseFormData = false;
|
|
495
|
+
|
|
496
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
497
|
+
method: 'PUT',
|
|
498
|
+
qs: localVarQueryParameters,
|
|
499
|
+
headers: localVarHeaderParams,
|
|
500
|
+
uri: localVarPath,
|
|
501
|
+
useQuerystring: this._useQuerystring,
|
|
502
|
+
json: true,
|
|
503
|
+
body: ObjectSerializer.serialize(receiptUpdateInput, "ReceiptUpdateInput")
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
let authenticationPromise = Promise.resolve();
|
|
507
|
+
if (this.authentications.bearerAuth.accessToken) {
|
|
508
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.bearerAuth.applyToRequest(localVarRequestOptions));
|
|
509
|
+
}
|
|
510
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
511
|
+
|
|
512
|
+
let interceptorPromise = authenticationPromise;
|
|
513
|
+
for (const interceptor of this.interceptors) {
|
|
514
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
return interceptorPromise.then(() => {
|
|
518
|
+
if (Object.keys(localVarFormParams).length) {
|
|
519
|
+
if (localVarUseFormData) {
|
|
520
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
521
|
+
} else {
|
|
522
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
526
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
527
|
+
if (error) {
|
|
528
|
+
reject(error);
|
|
529
|
+
} else {
|
|
530
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
531
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
532
|
+
resolve({ response: response, body: body });
|
|
533
|
+
} else {
|
|
534
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
});
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
}
|