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
package/model/media.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
import { RequestFile } from './models';
|
|
14
|
+
|
|
15
|
+
export class Media {
|
|
16
|
+
'id'?: number;
|
|
17
|
+
'uuid'?: string;
|
|
18
|
+
'name'?: string;
|
|
19
|
+
'mimeType'?: string;
|
|
20
|
+
'type'?: Media.TypeEnum;
|
|
21
|
+
'url'?: string;
|
|
22
|
+
'thumbUrl'?: string;
|
|
23
|
+
'isVideo'?: boolean;
|
|
24
|
+
'createdAt'?: Date;
|
|
25
|
+
|
|
26
|
+
static discriminator: string | undefined = undefined;
|
|
27
|
+
|
|
28
|
+
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
|
29
|
+
{
|
|
30
|
+
"name": "id",
|
|
31
|
+
"baseName": "id",
|
|
32
|
+
"type": "number"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "uuid",
|
|
36
|
+
"baseName": "uuid",
|
|
37
|
+
"type": "string"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "name",
|
|
41
|
+
"baseName": "name",
|
|
42
|
+
"type": "string"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "mimeType",
|
|
46
|
+
"baseName": "mime_type",
|
|
47
|
+
"type": "string"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "type",
|
|
51
|
+
"baseName": "type",
|
|
52
|
+
"type": "Media.TypeEnum"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "url",
|
|
56
|
+
"baseName": "url",
|
|
57
|
+
"type": "string"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "thumbUrl",
|
|
61
|
+
"baseName": "thumb_url",
|
|
62
|
+
"type": "string"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "isVideo",
|
|
66
|
+
"baseName": "is_video",
|
|
67
|
+
"type": "boolean"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "createdAt",
|
|
71
|
+
"baseName": "created_at",
|
|
72
|
+
"type": "Date"
|
|
73
|
+
} ];
|
|
74
|
+
|
|
75
|
+
static getAttributeTypeMap() {
|
|
76
|
+
return Media.attributeTypeMap;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export namespace Media {
|
|
81
|
+
export enum TypeEnum {
|
|
82
|
+
Image = <any> 'image',
|
|
83
|
+
Video = <any> 'video',
|
|
84
|
+
Gif = <any> 'gif'
|
|
85
|
+
}
|
|
86
|
+
}
|
package/model/models.ts
ADDED
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
import localVarRequest from 'request';
|
|
2
|
+
|
|
3
|
+
export * from './account';
|
|
4
|
+
export * from './addGenericSubscriptionRequest';
|
|
5
|
+
export * from './changeSubscriptionPlanRequest';
|
|
6
|
+
export * from './checkoutSubscription200Response';
|
|
7
|
+
export * from './checkoutSubscriptionRequest';
|
|
8
|
+
export * from './deleteMediaBulkRequest';
|
|
9
|
+
export * from './deleteMode';
|
|
10
|
+
export * from './deletePostRequest';
|
|
11
|
+
export * from './deletePostsBulkRequest';
|
|
12
|
+
export * from './deleteReceiptsBulkRequest';
|
|
13
|
+
export * from './deleteResult';
|
|
14
|
+
export * from './deleteUser400Response';
|
|
15
|
+
export * from './deleteUsersBulkRequest';
|
|
16
|
+
export * from './deleteWorkspacesBulkRequest';
|
|
17
|
+
export * from './getRemoteUploadStatus200Response';
|
|
18
|
+
export * from './initiateChunkedUpload200Response';
|
|
19
|
+
export * from './initiateChunkedUploadRequest';
|
|
20
|
+
export * from './initiateRemoteUpload200Response';
|
|
21
|
+
export * from './initiateRemoteUpload200ResponseOneOf';
|
|
22
|
+
export * from './initiateRemoteUploadRequest';
|
|
23
|
+
export * from './listAccounts200Response';
|
|
24
|
+
export * from './listMedia200Response';
|
|
25
|
+
export * from './listPosts200Response';
|
|
26
|
+
export * from './listReceipts200Response';
|
|
27
|
+
export * from './listTags200Response';
|
|
28
|
+
export * from './listUsers200Response';
|
|
29
|
+
export * from './listWorkspaces200Response';
|
|
30
|
+
export * from './media';
|
|
31
|
+
export * from './paginationMeta';
|
|
32
|
+
export * from './paginationMetaLinks';
|
|
33
|
+
export * from './paginationMetaMeta';
|
|
34
|
+
export * from './post';
|
|
35
|
+
export * from './postContent';
|
|
36
|
+
export * from './postInput';
|
|
37
|
+
export * from './postStatus';
|
|
38
|
+
export * from './postVersion';
|
|
39
|
+
export * from './receipt';
|
|
40
|
+
export * from './receiptInput';
|
|
41
|
+
export * from './receiptUpdateInput';
|
|
42
|
+
export * from './removeUserFromWorkspaceRequest';
|
|
43
|
+
export * from './schedulePostRequest';
|
|
44
|
+
export * from './scheduleResult';
|
|
45
|
+
export * from './subscription';
|
|
46
|
+
export * from './subscriptionInput';
|
|
47
|
+
export * from './subscriptionStatus';
|
|
48
|
+
export * from './subscriptionUpdateInput';
|
|
49
|
+
export * from './tag';
|
|
50
|
+
export * from './tagInput';
|
|
51
|
+
export * from './updateMediaRequest';
|
|
52
|
+
export * from './uploadChunk200Response';
|
|
53
|
+
export * from './user';
|
|
54
|
+
export * from './userInput';
|
|
55
|
+
export * from './userUpdateInput';
|
|
56
|
+
export * from './workspace';
|
|
57
|
+
export * from './workspaceInput';
|
|
58
|
+
export * from './workspaceUserInput';
|
|
59
|
+
|
|
60
|
+
import * as fs from 'fs';
|
|
61
|
+
|
|
62
|
+
export interface RequestDetailedFile {
|
|
63
|
+
value: Buffer;
|
|
64
|
+
options?: {
|
|
65
|
+
filename?: string;
|
|
66
|
+
contentType?: string;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type RequestFile = string | Buffer | fs.ReadStream | RequestDetailedFile;
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
import { Account } from './account';
|
|
74
|
+
import { AddGenericSubscriptionRequest } from './addGenericSubscriptionRequest';
|
|
75
|
+
import { ChangeSubscriptionPlanRequest } from './changeSubscriptionPlanRequest';
|
|
76
|
+
import { CheckoutSubscription200Response } from './checkoutSubscription200Response';
|
|
77
|
+
import { CheckoutSubscriptionRequest } from './checkoutSubscriptionRequest';
|
|
78
|
+
import { DeleteMediaBulkRequest } from './deleteMediaBulkRequest';
|
|
79
|
+
import { DeleteMode } from './deleteMode';
|
|
80
|
+
import { DeletePostRequest } from './deletePostRequest';
|
|
81
|
+
import { DeletePostsBulkRequest } from './deletePostsBulkRequest';
|
|
82
|
+
import { DeleteReceiptsBulkRequest } from './deleteReceiptsBulkRequest';
|
|
83
|
+
import { DeleteResult } from './deleteResult';
|
|
84
|
+
import { DeleteUser400Response } from './deleteUser400Response';
|
|
85
|
+
import { DeleteUsersBulkRequest } from './deleteUsersBulkRequest';
|
|
86
|
+
import { DeleteWorkspacesBulkRequest } from './deleteWorkspacesBulkRequest';
|
|
87
|
+
import { GetRemoteUploadStatus200Response } from './getRemoteUploadStatus200Response';
|
|
88
|
+
import { InitiateChunkedUpload200Response } from './initiateChunkedUpload200Response';
|
|
89
|
+
import { InitiateChunkedUploadRequest } from './initiateChunkedUploadRequest';
|
|
90
|
+
import { InitiateRemoteUpload200Response } from './initiateRemoteUpload200Response';
|
|
91
|
+
import { InitiateRemoteUpload200ResponseOneOf } from './initiateRemoteUpload200ResponseOneOf';
|
|
92
|
+
import { InitiateRemoteUploadRequest } from './initiateRemoteUploadRequest';
|
|
93
|
+
import { ListAccounts200Response } from './listAccounts200Response';
|
|
94
|
+
import { ListMedia200Response } from './listMedia200Response';
|
|
95
|
+
import { ListPosts200Response } from './listPosts200Response';
|
|
96
|
+
import { ListReceipts200Response } from './listReceipts200Response';
|
|
97
|
+
import { ListTags200Response } from './listTags200Response';
|
|
98
|
+
import { ListUsers200Response } from './listUsers200Response';
|
|
99
|
+
import { ListWorkspaces200Response } from './listWorkspaces200Response';
|
|
100
|
+
import { Media } from './media';
|
|
101
|
+
import { PaginationMeta } from './paginationMeta';
|
|
102
|
+
import { PaginationMetaLinks } from './paginationMetaLinks';
|
|
103
|
+
import { PaginationMetaMeta } from './paginationMetaMeta';
|
|
104
|
+
import { Post } from './post';
|
|
105
|
+
import { PostContent } from './postContent';
|
|
106
|
+
import { PostInput } from './postInput';
|
|
107
|
+
import { PostStatus } from './postStatus';
|
|
108
|
+
import { PostVersion } from './postVersion';
|
|
109
|
+
import { Receipt } from './receipt';
|
|
110
|
+
import { ReceiptInput } from './receiptInput';
|
|
111
|
+
import { ReceiptUpdateInput } from './receiptUpdateInput';
|
|
112
|
+
import { RemoveUserFromWorkspaceRequest } from './removeUserFromWorkspaceRequest';
|
|
113
|
+
import { SchedulePostRequest } from './schedulePostRequest';
|
|
114
|
+
import { ScheduleResult } from './scheduleResult';
|
|
115
|
+
import { Subscription } from './subscription';
|
|
116
|
+
import { SubscriptionInput } from './subscriptionInput';
|
|
117
|
+
import { SubscriptionStatus } from './subscriptionStatus';
|
|
118
|
+
import { SubscriptionUpdateInput } from './subscriptionUpdateInput';
|
|
119
|
+
import { Tag } from './tag';
|
|
120
|
+
import { TagInput } from './tagInput';
|
|
121
|
+
import { UpdateMediaRequest } from './updateMediaRequest';
|
|
122
|
+
import { UploadChunk200Response } from './uploadChunk200Response';
|
|
123
|
+
import { User } from './user';
|
|
124
|
+
import { UserInput } from './userInput';
|
|
125
|
+
import { UserUpdateInput } from './userUpdateInput';
|
|
126
|
+
import { Workspace } from './workspace';
|
|
127
|
+
import { WorkspaceInput } from './workspaceInput';
|
|
128
|
+
import { WorkspaceUserInput } from './workspaceUserInput';
|
|
129
|
+
|
|
130
|
+
/* tslint:disable:no-unused-variable */
|
|
131
|
+
let primitives = [
|
|
132
|
+
"string",
|
|
133
|
+
"boolean",
|
|
134
|
+
"double",
|
|
135
|
+
"integer",
|
|
136
|
+
"long",
|
|
137
|
+
"float",
|
|
138
|
+
"number",
|
|
139
|
+
"any"
|
|
140
|
+
];
|
|
141
|
+
|
|
142
|
+
let enumsMap: {[index: string]: any} = {
|
|
143
|
+
"Account.ProviderEnum": Account.ProviderEnum,
|
|
144
|
+
"ChangeSubscriptionPlanRequest.CycleEnum": ChangeSubscriptionPlanRequest.CycleEnum,
|
|
145
|
+
"CheckoutSubscriptionRequest.CycleEnum": CheckoutSubscriptionRequest.CycleEnum,
|
|
146
|
+
"DeleteMode": DeleteMode,
|
|
147
|
+
"GetRemoteUploadStatus200Response.StatusEnum": GetRemoteUploadStatus200Response.StatusEnum,
|
|
148
|
+
"InitiateRemoteUpload200Response.TypeEnum": InitiateRemoteUpload200Response.TypeEnum,
|
|
149
|
+
"Media.TypeEnum": Media.TypeEnum,
|
|
150
|
+
"PostStatus": PostStatus,
|
|
151
|
+
"SubscriptionStatus": SubscriptionStatus,
|
|
152
|
+
"Workspace.AccessStatusEnum": Workspace.AccessStatusEnum,
|
|
153
|
+
"WorkspaceInput.AccessStatusEnum": WorkspaceInput.AccessStatusEnum,
|
|
154
|
+
"WorkspaceUserInput.RoleEnum": WorkspaceUserInput.RoleEnum,
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
let typeMap: {[index: string]: any} = {
|
|
158
|
+
"Account": Account,
|
|
159
|
+
"AddGenericSubscriptionRequest": AddGenericSubscriptionRequest,
|
|
160
|
+
"ChangeSubscriptionPlanRequest": ChangeSubscriptionPlanRequest,
|
|
161
|
+
"CheckoutSubscription200Response": CheckoutSubscription200Response,
|
|
162
|
+
"CheckoutSubscriptionRequest": CheckoutSubscriptionRequest,
|
|
163
|
+
"DeleteMediaBulkRequest": DeleteMediaBulkRequest,
|
|
164
|
+
"DeletePostRequest": DeletePostRequest,
|
|
165
|
+
"DeletePostsBulkRequest": DeletePostsBulkRequest,
|
|
166
|
+
"DeleteReceiptsBulkRequest": DeleteReceiptsBulkRequest,
|
|
167
|
+
"DeleteResult": DeleteResult,
|
|
168
|
+
"DeleteUser400Response": DeleteUser400Response,
|
|
169
|
+
"DeleteUsersBulkRequest": DeleteUsersBulkRequest,
|
|
170
|
+
"DeleteWorkspacesBulkRequest": DeleteWorkspacesBulkRequest,
|
|
171
|
+
"GetRemoteUploadStatus200Response": GetRemoteUploadStatus200Response,
|
|
172
|
+
"InitiateChunkedUpload200Response": InitiateChunkedUpload200Response,
|
|
173
|
+
"InitiateChunkedUploadRequest": InitiateChunkedUploadRequest,
|
|
174
|
+
"InitiateRemoteUpload200Response": InitiateRemoteUpload200Response,
|
|
175
|
+
"InitiateRemoteUpload200ResponseOneOf": InitiateRemoteUpload200ResponseOneOf,
|
|
176
|
+
"InitiateRemoteUploadRequest": InitiateRemoteUploadRequest,
|
|
177
|
+
"ListAccounts200Response": ListAccounts200Response,
|
|
178
|
+
"ListMedia200Response": ListMedia200Response,
|
|
179
|
+
"ListPosts200Response": ListPosts200Response,
|
|
180
|
+
"ListReceipts200Response": ListReceipts200Response,
|
|
181
|
+
"ListTags200Response": ListTags200Response,
|
|
182
|
+
"ListUsers200Response": ListUsers200Response,
|
|
183
|
+
"ListWorkspaces200Response": ListWorkspaces200Response,
|
|
184
|
+
"Media": Media,
|
|
185
|
+
"PaginationMeta": PaginationMeta,
|
|
186
|
+
"PaginationMetaLinks": PaginationMetaLinks,
|
|
187
|
+
"PaginationMetaMeta": PaginationMetaMeta,
|
|
188
|
+
"Post": Post,
|
|
189
|
+
"PostContent": PostContent,
|
|
190
|
+
"PostInput": PostInput,
|
|
191
|
+
"PostVersion": PostVersion,
|
|
192
|
+
"Receipt": Receipt,
|
|
193
|
+
"ReceiptInput": ReceiptInput,
|
|
194
|
+
"ReceiptUpdateInput": ReceiptUpdateInput,
|
|
195
|
+
"RemoveUserFromWorkspaceRequest": RemoveUserFromWorkspaceRequest,
|
|
196
|
+
"SchedulePostRequest": SchedulePostRequest,
|
|
197
|
+
"ScheduleResult": ScheduleResult,
|
|
198
|
+
"Subscription": Subscription,
|
|
199
|
+
"SubscriptionInput": SubscriptionInput,
|
|
200
|
+
"SubscriptionUpdateInput": SubscriptionUpdateInput,
|
|
201
|
+
"Tag": Tag,
|
|
202
|
+
"TagInput": TagInput,
|
|
203
|
+
"UpdateMediaRequest": UpdateMediaRequest,
|
|
204
|
+
"UploadChunk200Response": UploadChunk200Response,
|
|
205
|
+
"User": User,
|
|
206
|
+
"UserInput": UserInput,
|
|
207
|
+
"UserUpdateInput": UserUpdateInput,
|
|
208
|
+
"Workspace": Workspace,
|
|
209
|
+
"WorkspaceInput": WorkspaceInput,
|
|
210
|
+
"WorkspaceUserInput": WorkspaceUserInput,
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Check if a string starts with another string without using es6 features
|
|
214
|
+
function startsWith(str: string, match: string): boolean {
|
|
215
|
+
return str.substring(0, match.length) === match;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Check if a string ends with another string without using es6 features
|
|
219
|
+
function endsWith(str: string, match: string): boolean {
|
|
220
|
+
return str.length >= match.length && str.substring(str.length - match.length) === match;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const nullableSuffix = " | null";
|
|
224
|
+
const optionalSuffix = " | undefined";
|
|
225
|
+
const arrayPrefix = "Array<";
|
|
226
|
+
const arraySuffix = ">";
|
|
227
|
+
const mapPrefix = "{ [key: string]: ";
|
|
228
|
+
const mapSuffix = "; }";
|
|
229
|
+
|
|
230
|
+
export class ObjectSerializer {
|
|
231
|
+
public static findCorrectType(data: any, expectedType: string) {
|
|
232
|
+
if (data == undefined) {
|
|
233
|
+
return expectedType;
|
|
234
|
+
} else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
|
|
235
|
+
return expectedType;
|
|
236
|
+
} else if (expectedType === "Date") {
|
|
237
|
+
return expectedType;
|
|
238
|
+
} else {
|
|
239
|
+
if (enumsMap[expectedType]) {
|
|
240
|
+
return expectedType;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (!typeMap[expectedType]) {
|
|
244
|
+
return expectedType; // w/e we don't know the type
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Check the discriminator
|
|
248
|
+
let discriminatorProperty = typeMap[expectedType].discriminator;
|
|
249
|
+
if (discriminatorProperty == null) {
|
|
250
|
+
return expectedType; // the type does not have a discriminator. use it.
|
|
251
|
+
} else {
|
|
252
|
+
if (data[discriminatorProperty]) {
|
|
253
|
+
var discriminatorType = data[discriminatorProperty];
|
|
254
|
+
if(typeMap[discriminatorType]){
|
|
255
|
+
return discriminatorType; // use the type given in the discriminator
|
|
256
|
+
} else {
|
|
257
|
+
return expectedType; // discriminator did not map to a type
|
|
258
|
+
}
|
|
259
|
+
} else {
|
|
260
|
+
return expectedType; // discriminator was not present (or an empty string)
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
public static serialize(data: any, type: string): any {
|
|
267
|
+
if (data == undefined) {
|
|
268
|
+
return data;
|
|
269
|
+
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
|
|
270
|
+
return data;
|
|
271
|
+
} else if (endsWith(type, nullableSuffix)) {
|
|
272
|
+
let subType: string = type.slice(0, -nullableSuffix.length); // Type | null => Type
|
|
273
|
+
return ObjectSerializer.serialize(data, subType);
|
|
274
|
+
} else if (endsWith(type, optionalSuffix)) {
|
|
275
|
+
let subType: string = type.slice(0, -optionalSuffix.length); // Type | undefined => Type
|
|
276
|
+
return ObjectSerializer.serialize(data, subType);
|
|
277
|
+
} else if (startsWith(type, arrayPrefix)) {
|
|
278
|
+
let subType: string = type.slice(arrayPrefix.length, -arraySuffix.length); // Array<Type> => Type
|
|
279
|
+
let transformedData: any[] = [];
|
|
280
|
+
for (let index = 0; index < data.length; index++) {
|
|
281
|
+
let datum = data[index];
|
|
282
|
+
transformedData.push(ObjectSerializer.serialize(datum, subType));
|
|
283
|
+
}
|
|
284
|
+
return transformedData;
|
|
285
|
+
} else if (startsWith(type, mapPrefix)) {
|
|
286
|
+
let subType: string = type.slice(mapPrefix.length, -mapSuffix.length); // { [key: string]: Type; } => Type
|
|
287
|
+
let transformedData: { [key: string]: any } = {};
|
|
288
|
+
for (let key in data) {
|
|
289
|
+
transformedData[key] = ObjectSerializer.serialize(
|
|
290
|
+
data[key],
|
|
291
|
+
subType,
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
return transformedData;
|
|
295
|
+
} else if (type === "Date") {
|
|
296
|
+
return data.toISOString();
|
|
297
|
+
} else {
|
|
298
|
+
if (enumsMap[type]) {
|
|
299
|
+
return data;
|
|
300
|
+
}
|
|
301
|
+
if (!typeMap[type]) { // in case we dont know the type
|
|
302
|
+
return data;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// Get the actual type of this object
|
|
306
|
+
type = this.findCorrectType(data, type);
|
|
307
|
+
|
|
308
|
+
// get the map for the correct type.
|
|
309
|
+
let attributeTypes = typeMap[type].getAttributeTypeMap();
|
|
310
|
+
let instance: {[index: string]: any} = {};
|
|
311
|
+
for (let index = 0; index < attributeTypes.length; index++) {
|
|
312
|
+
let attributeType = attributeTypes[index];
|
|
313
|
+
instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
|
|
314
|
+
}
|
|
315
|
+
return instance;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
public static deserialize(data: any, type: string): any {
|
|
320
|
+
// polymorphism may change the actual type.
|
|
321
|
+
type = ObjectSerializer.findCorrectType(data, type);
|
|
322
|
+
if (data == undefined) {
|
|
323
|
+
return data;
|
|
324
|
+
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
|
|
325
|
+
return data;
|
|
326
|
+
} else if (endsWith(type, nullableSuffix)) {
|
|
327
|
+
let subType: string = type.slice(0, -nullableSuffix.length); // Type | null => Type
|
|
328
|
+
return ObjectSerializer.deserialize(data, subType);
|
|
329
|
+
} else if (endsWith(type, optionalSuffix)) {
|
|
330
|
+
let subType: string = type.slice(0, -optionalSuffix.length); // Type | undefined => Type
|
|
331
|
+
return ObjectSerializer.deserialize(data, subType);
|
|
332
|
+
} else if (startsWith(type, arrayPrefix)) {
|
|
333
|
+
let subType: string = type.slice(arrayPrefix.length, -arraySuffix.length); // Array<Type> => Type
|
|
334
|
+
let transformedData: any[] = [];
|
|
335
|
+
for (let index = 0; index < data.length; index++) {
|
|
336
|
+
let datum = data[index];
|
|
337
|
+
transformedData.push(ObjectSerializer.deserialize(datum, subType));
|
|
338
|
+
}
|
|
339
|
+
return transformedData;
|
|
340
|
+
} else if (startsWith(type, mapPrefix)) {
|
|
341
|
+
let subType: string = type.slice(mapPrefix.length, -mapSuffix.length); // { [key: string]: Type; } => Type
|
|
342
|
+
let transformedData: { [key: string]: any } = {};
|
|
343
|
+
for (let key in data) {
|
|
344
|
+
transformedData[key] = ObjectSerializer.deserialize(
|
|
345
|
+
data[key],
|
|
346
|
+
subType,
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
return transformedData;
|
|
350
|
+
} else if (type === "Date") {
|
|
351
|
+
return new Date(data);
|
|
352
|
+
} else {
|
|
353
|
+
if (enumsMap[type]) {// is Enum
|
|
354
|
+
return data;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (!typeMap[type]) { // dont know the type
|
|
358
|
+
return data;
|
|
359
|
+
}
|
|
360
|
+
let instance = new typeMap[type]();
|
|
361
|
+
let attributeTypes = typeMap[type].getAttributeTypeMap();
|
|
362
|
+
for (let index = 0; index < attributeTypes.length; index++) {
|
|
363
|
+
let attributeType = attributeTypes[index];
|
|
364
|
+
instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type);
|
|
365
|
+
}
|
|
366
|
+
return instance;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export interface Authentication {
|
|
372
|
+
/**
|
|
373
|
+
* Apply authentication settings to header and query params.
|
|
374
|
+
*/
|
|
375
|
+
applyToRequest(requestOptions: localVarRequest.Options): Promise<void> | void;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export class HttpBasicAuth implements Authentication {
|
|
379
|
+
public username: string = '';
|
|
380
|
+
public password: string = '';
|
|
381
|
+
|
|
382
|
+
applyToRequest(requestOptions: localVarRequest.Options): void {
|
|
383
|
+
requestOptions.auth = {
|
|
384
|
+
username: this.username, password: this.password
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export class HttpBearerAuth implements Authentication {
|
|
390
|
+
public accessToken: string | (() => string) = '';
|
|
391
|
+
|
|
392
|
+
applyToRequest(requestOptions: localVarRequest.Options): void {
|
|
393
|
+
if (requestOptions && requestOptions.headers) {
|
|
394
|
+
const accessToken = typeof this.accessToken === 'function'
|
|
395
|
+
? this.accessToken()
|
|
396
|
+
: this.accessToken;
|
|
397
|
+
requestOptions.headers["Authorization"] = "Bearer " + accessToken;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export class ApiKeyAuth implements Authentication {
|
|
403
|
+
public apiKey: string = '';
|
|
404
|
+
|
|
405
|
+
constructor(private location: string, private paramName: string) {
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
applyToRequest(requestOptions: localVarRequest.Options): void {
|
|
409
|
+
if (this.location == "query") {
|
|
410
|
+
(<any>requestOptions.qs)[this.paramName] = this.apiKey;
|
|
411
|
+
} else if (this.location == "header" && requestOptions && requestOptions.headers) {
|
|
412
|
+
requestOptions.headers[this.paramName] = this.apiKey;
|
|
413
|
+
} else if (this.location == 'cookie' && requestOptions && requestOptions.headers) {
|
|
414
|
+
if (requestOptions.headers['Cookie']) {
|
|
415
|
+
requestOptions.headers['Cookie'] += '; ' + this.paramName + '=' + encodeURIComponent(this.apiKey);
|
|
416
|
+
}
|
|
417
|
+
else {
|
|
418
|
+
requestOptions.headers['Cookie'] = this.paramName + '=' + encodeURIComponent(this.apiKey);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export class OAuth implements Authentication {
|
|
425
|
+
public accessToken: string = '';
|
|
426
|
+
|
|
427
|
+
applyToRequest(requestOptions: localVarRequest.Options): void {
|
|
428
|
+
if (requestOptions && requestOptions.headers) {
|
|
429
|
+
requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
export class VoidAuth implements Authentication {
|
|
435
|
+
public username: string = '';
|
|
436
|
+
public password: string = '';
|
|
437
|
+
|
|
438
|
+
applyToRequest(_: localVarRequest.Options): void {
|
|
439
|
+
// Do nothing
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
export type Interceptor = (requestOptions: localVarRequest.Options) => (Promise<void> | void);
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
import { RequestFile } from './models';
|
|
14
|
+
import { PaginationMetaLinks } from './paginationMetaLinks';
|
|
15
|
+
import { PaginationMetaMeta } from './paginationMetaMeta';
|
|
16
|
+
|
|
17
|
+
export class PaginationMeta {
|
|
18
|
+
'links'?: PaginationMetaLinks;
|
|
19
|
+
'meta'?: PaginationMetaMeta;
|
|
20
|
+
|
|
21
|
+
static discriminator: string | undefined = undefined;
|
|
22
|
+
|
|
23
|
+
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
|
24
|
+
{
|
|
25
|
+
"name": "links",
|
|
26
|
+
"baseName": "links",
|
|
27
|
+
"type": "PaginationMetaLinks"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "meta",
|
|
31
|
+
"baseName": "meta",
|
|
32
|
+
"type": "PaginationMetaMeta"
|
|
33
|
+
} ];
|
|
34
|
+
|
|
35
|
+
static getAttributeTypeMap() {
|
|
36
|
+
return PaginationMeta.attributeTypeMap;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
import { RequestFile } from './models';
|
|
14
|
+
|
|
15
|
+
export class PaginationMetaLinks {
|
|
16
|
+
'first'?: string;
|
|
17
|
+
'last'?: string;
|
|
18
|
+
'prev'?: string;
|
|
19
|
+
'next'?: string;
|
|
20
|
+
|
|
21
|
+
static discriminator: string | undefined = undefined;
|
|
22
|
+
|
|
23
|
+
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
|
24
|
+
{
|
|
25
|
+
"name": "first",
|
|
26
|
+
"baseName": "first",
|
|
27
|
+
"type": "string"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "last",
|
|
31
|
+
"baseName": "last",
|
|
32
|
+
"type": "string"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "prev",
|
|
36
|
+
"baseName": "prev",
|
|
37
|
+
"type": "string"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "next",
|
|
41
|
+
"baseName": "next",
|
|
42
|
+
"type": "string"
|
|
43
|
+
} ];
|
|
44
|
+
|
|
45
|
+
static getAttributeTypeMap() {
|
|
46
|
+
return PaginationMetaLinks.attributeTypeMap;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
import { RequestFile } from './models';
|
|
14
|
+
|
|
15
|
+
export class PaginationMetaMeta {
|
|
16
|
+
'currentPage'?: number;
|
|
17
|
+
'from'?: number;
|
|
18
|
+
'lastPage'?: number;
|
|
19
|
+
'perPage'?: number;
|
|
20
|
+
'to'?: number;
|
|
21
|
+
'total'?: number;
|
|
22
|
+
|
|
23
|
+
static discriminator: string | undefined = undefined;
|
|
24
|
+
|
|
25
|
+
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
|
26
|
+
{
|
|
27
|
+
"name": "currentPage",
|
|
28
|
+
"baseName": "current_page",
|
|
29
|
+
"type": "number"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "from",
|
|
33
|
+
"baseName": "from",
|
|
34
|
+
"type": "number"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "lastPage",
|
|
38
|
+
"baseName": "last_page",
|
|
39
|
+
"type": "number"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "perPage",
|
|
43
|
+
"baseName": "per_page",
|
|
44
|
+
"type": "number"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "to",
|
|
48
|
+
"baseName": "to",
|
|
49
|
+
"type": "number"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "total",
|
|
53
|
+
"baseName": "total",
|
|
54
|
+
"type": "number"
|
|
55
|
+
} ];
|
|
56
|
+
|
|
57
|
+
static getAttributeTypeMap() {
|
|
58
|
+
return PaginationMetaMeta.attributeTypeMap;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|