@libgot/whatsapp-bridge-sdk 1.0.42 → 1.0.44-rc.1

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.
Files changed (39) hide show
  1. package/README.md +2 -2
  2. package/api.ts +1 -0
  3. package/apis/chats-api.ts +379 -0
  4. package/apis/sessions-api.ts +83 -0
  5. package/apis/tasks-api.ts +141 -0
  6. package/dist/api.d.ts +1 -0
  7. package/dist/api.js +1 -0
  8. package/dist/apis/chats-api.d.ts +149 -0
  9. package/dist/apis/chats-api.js +381 -0
  10. package/dist/apis/sessions-api.d.ts +33 -0
  11. package/dist/apis/sessions-api.js +86 -0
  12. package/dist/apis/tasks-api.d.ts +74 -0
  13. package/dist/apis/tasks-api.js +153 -0
  14. package/dist/models/chat-lifecycle-event-dto.d.ts +65 -0
  15. package/dist/models/chat-lifecycle-event-dto.js +26 -0
  16. package/dist/models/chat-lifecycle-events-response-dto.d.ts +25 -0
  17. package/dist/models/chat-lifecycle-events-response-dto.js +15 -0
  18. package/dist/models/create-chat-lifecycle-event-dto.d.ts +40 -0
  19. package/dist/models/create-chat-lifecycle-event-dto.js +26 -0
  20. package/dist/models/index.d.ts +6 -0
  21. package/dist/models/index.js +6 -0
  22. package/dist/models/repair-missing-message-keys-dto.d.ts +19 -0
  23. package/dist/models/repair-missing-message-keys-dto.js +15 -0
  24. package/dist/models/send-template-data-dto.d.ts +6 -0
  25. package/dist/models/update-agent-dto.d.ts +55 -0
  26. package/dist/models/update-agent-dto.js +15 -0
  27. package/dist/models/update-chat-status-dto.d.ts +43 -0
  28. package/dist/models/update-chat-status-dto.js +15 -0
  29. package/dist/models/whatsapp-chat-dto.d.ts +6 -0
  30. package/models/chat-lifecycle-event-dto.ts +74 -0
  31. package/models/chat-lifecycle-events-response-dto.ts +29 -0
  32. package/models/create-chat-lifecycle-event-dto.ts +47 -0
  33. package/models/index.ts +6 -0
  34. package/models/repair-missing-message-keys-dto.ts +22 -0
  35. package/models/send-template-data-dto.ts +7 -0
  36. package/models/update-agent-dto.ts +64 -0
  37. package/models/update-chat-status-dto.ts +50 -0
  38. package/models/whatsapp-chat-dto.ts +7 -0
  39. package/package.json +2 -2
@@ -0,0 +1,141 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * whatsapp-bridge Node Api
5
+ * The whatsapp-bridge API description
6
+ *
7
+ * OpenAPI spec version: 0.0.1
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by the swagger code generator program.
11
+ * https://github.com/swagger-api/swagger-codegen.git
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
16
+ import { Configuration } from '../configuration';
17
+ // Some imports not used depending on template conditions
18
+ // @ts-ignore
19
+ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
20
+ import { RepairMissingMessageKeysDto } from '../models';
21
+ /**
22
+ * TasksApi - axios parameter creator
23
+ * @export
24
+ */
25
+ export const TasksApiAxiosParamCreator = function (configuration?: Configuration) {
26
+ return {
27
+ /**
28
+ *
29
+ * @param {RepairMissingMessageKeysDto} body
30
+ * @param {string} apikey
31
+ * @param {*} [options] Override http request option.
32
+ * @throws {RequiredError}
33
+ */
34
+ repairMissingMessageKeys: async (body: RepairMissingMessageKeysDto, apikey: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
35
+ // verify required parameter 'body' is not null or undefined
36
+ if (body === null || body === undefined) {
37
+ throw new RequiredError('body','Required parameter body was null or undefined when calling repairMissingMessageKeys.');
38
+ }
39
+ // verify required parameter 'apikey' is not null or undefined
40
+ if (apikey === null || apikey === undefined) {
41
+ throw new RequiredError('apikey','Required parameter apikey was null or undefined when calling repairMissingMessageKeys.');
42
+ }
43
+ const localVarPath = `/api/tasks/repair-missing-message-keys`;
44
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
45
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
46
+ let baseOptions;
47
+ if (configuration) {
48
+ baseOptions = configuration.baseOptions;
49
+ }
50
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
51
+ const localVarHeaderParameter = {} as any;
52
+ const localVarQueryParameter = {} as any;
53
+
54
+ if (apikey !== undefined && apikey !== null) {
55
+ localVarHeaderParameter['apikey'] = String(apikey);
56
+ }
57
+
58
+ localVarHeaderParameter['Content-Type'] = 'application/json';
59
+
60
+ const query = new URLSearchParams(localVarUrlObj.search);
61
+ for (const key in localVarQueryParameter) {
62
+ query.set(key, localVarQueryParameter[key]);
63
+ }
64
+ for (const key in options.params) {
65
+ query.set(key, options.params[key]);
66
+ }
67
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
68
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
69
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
70
+ const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
71
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
72
+
73
+ return {
74
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
75
+ options: localVarRequestOptions,
76
+ };
77
+ },
78
+ }
79
+ };
80
+
81
+ /**
82
+ * TasksApi - functional programming interface
83
+ * @export
84
+ */
85
+ export const TasksApiFp = function(configuration?: Configuration) {
86
+ return {
87
+ /**
88
+ *
89
+ * @param {RepairMissingMessageKeysDto} body
90
+ * @param {string} apikey
91
+ * @param {*} [options] Override http request option.
92
+ * @throws {RequiredError}
93
+ */
94
+ async repairMissingMessageKeys(body: RepairMissingMessageKeysDto, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
95
+ const localVarAxiosArgs = await TasksApiAxiosParamCreator(configuration).repairMissingMessageKeys(body, apikey, options);
96
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
97
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
98
+ return axios.request(axiosRequestArgs);
99
+ };
100
+ },
101
+ }
102
+ };
103
+
104
+ /**
105
+ * TasksApi - factory interface
106
+ * @export
107
+ */
108
+ export const TasksApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
109
+ return {
110
+ /**
111
+ *
112
+ * @param {RepairMissingMessageKeysDto} body
113
+ * @param {string} apikey
114
+ * @param {*} [options] Override http request option.
115
+ * @throws {RequiredError}
116
+ */
117
+ async repairMissingMessageKeys(body: RepairMissingMessageKeysDto, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
118
+ return TasksApiFp(configuration).repairMissingMessageKeys(body, apikey, options).then((request) => request(axios, basePath));
119
+ },
120
+ };
121
+ };
122
+
123
+ /**
124
+ * TasksApi - object-oriented interface
125
+ * @export
126
+ * @class TasksApi
127
+ * @extends {BaseAPI}
128
+ */
129
+ export class TasksApi extends BaseAPI {
130
+ /**
131
+ *
132
+ * @param {RepairMissingMessageKeysDto} body
133
+ * @param {string} apikey
134
+ * @param {*} [options] Override http request option.
135
+ * @throws {RequiredError}
136
+ * @memberof TasksApi
137
+ */
138
+ public async repairMissingMessageKeys(body: RepairMissingMessageKeysDto, apikey: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
139
+ return TasksApiFp(this.configuration).repairMissingMessageKeys(body, apikey, options).then((request) => request(this.axios, this.basePath));
140
+ }
141
+ }
package/dist/api.d.ts CHANGED
@@ -18,4 +18,5 @@ export * from './apis/flows-api';
18
18
  export * from './apis/healthchecks-api';
19
19
  export * from './apis/messages-api';
20
20
  export * from './apis/sessions-api';
21
+ export * from './apis/tasks-api';
21
22
  export * from './apis/users-api';
package/dist/api.js CHANGED
@@ -36,4 +36,5 @@ __exportStar(require("./apis/flows-api"), exports);
36
36
  __exportStar(require("./apis/healthchecks-api"), exports);
37
37
  __exportStar(require("./apis/messages-api"), exports);
38
38
  __exportStar(require("./apis/sessions-api"), exports);
39
+ __exportStar(require("./apis/tasks-api"), exports);
39
40
  __exportStar(require("./apis/users-api"), exports);
@@ -14,8 +14,13 @@ import { Configuration } from '../configuration';
14
14
  import { RequestArgs, BaseAPI } from '../base';
15
15
  import { AssignToMeDto } from '../models';
16
16
  import { AssignmentTypeDto } from '../models';
17
+ import { ChatLifecycleEventDto } from '../models';
18
+ import { ChatLifecycleEventsResponseDto } from '../models';
19
+ import { CreateChatLifecycleEventDto } from '../models';
17
20
  import { MarkChatUnreadDto } from '../models';
18
21
  import { PaginationChatResponseDto } from '../models';
22
+ import { UpdateAgentDto } from '../models';
23
+ import { UpdateChatStatusDto } from '../models';
19
24
  import { WhatsappChatResponseDTO } from '../models';
20
25
  /**
21
26
  * ChatsApi - axios parameter creator
@@ -40,6 +45,16 @@ export declare const ChatsApiAxiosParamCreator: (configuration?: Configuration)
40
45
  * @throws {RequiredError}
41
46
  */
42
47
  assignmentType: (body: AssignmentTypeDto, apikey: string, cellphone: string, id: number, options?: AxiosRequestConfig) => Promise<RequestArgs>;
48
+ /**
49
+ *
50
+ * @param {CreateChatLifecycleEventDto} body
51
+ * @param {string} apikey
52
+ * @param {number} branchId
53
+ * @param {number} id
54
+ * @param {*} [options] Override http request option.
55
+ * @throws {RequiredError}
56
+ */
57
+ createChatEvent: (body: CreateChatLifecycleEventDto, apikey: string, branchId: number, id: number, options?: AxiosRequestConfig) => Promise<RequestArgs>;
43
58
  /**
44
59
  *
45
60
  * @param {number} id
@@ -48,6 +63,15 @@ export declare const ChatsApiAxiosParamCreator: (configuration?: Configuration)
48
63
  * @throws {RequiredError}
49
64
  */
50
65
  getChat: (id: number, apikey: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
66
+ /**
67
+ *
68
+ * @param {number} id
69
+ * @param {number} branchId
70
+ * @param {string} apikey
71
+ * @param {*} [options] Override http request option.
72
+ * @throws {RequiredError}
73
+ */
74
+ getChatEvents: (id: number, branchId: number, apikey: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
51
75
  /**
52
76
  *
53
77
  * @param {number} branchId
@@ -74,6 +98,22 @@ export declare const ChatsApiAxiosParamCreator: (configuration?: Configuration)
74
98
  * @throws {RequiredError}
75
99
  */
76
100
  markChatUnread: (body: MarkChatUnreadDto, apikey: string, id: number, options?: AxiosRequestConfig) => Promise<RequestArgs>;
101
+ /**
102
+ *
103
+ * @param {UpdateAgentDto} body
104
+ * @param {string} apikey
105
+ * @param {*} [options] Override http request option.
106
+ * @throws {RequiredError}
107
+ */
108
+ updateAgent: (body: UpdateAgentDto, apikey: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
109
+ /**
110
+ *
111
+ * @param {UpdateChatStatusDto} body
112
+ * @param {string} apikey
113
+ * @param {*} [options] Override http request option.
114
+ * @throws {RequiredError}
115
+ */
116
+ updateChatStatus: (body: UpdateChatStatusDto, apikey: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
77
117
  };
78
118
  /**
79
119
  * ChatsApi - functional programming interface
@@ -98,6 +138,16 @@ export declare const ChatsApiFp: (configuration?: Configuration) => {
98
138
  * @throws {RequiredError}
99
139
  */
100
140
  assignmentType(body: AssignmentTypeDto, apikey: string, cellphone: string, id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>>;
141
+ /**
142
+ *
143
+ * @param {CreateChatLifecycleEventDto} body
144
+ * @param {string} apikey
145
+ * @param {number} branchId
146
+ * @param {number} id
147
+ * @param {*} [options] Override http request option.
148
+ * @throws {RequiredError}
149
+ */
150
+ createChatEvent(body: CreateChatLifecycleEventDto, apikey: string, branchId: number, id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ChatLifecycleEventDto>>>;
101
151
  /**
102
152
  *
103
153
  * @param {number} id
@@ -106,6 +156,15 @@ export declare const ChatsApiFp: (configuration?: Configuration) => {
106
156
  * @throws {RequiredError}
107
157
  */
108
158
  getChat(id: number, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<WhatsappChatResponseDTO>>>;
159
+ /**
160
+ *
161
+ * @param {number} id
162
+ * @param {number} branchId
163
+ * @param {string} apikey
164
+ * @param {*} [options] Override http request option.
165
+ * @throws {RequiredError}
166
+ */
167
+ getChatEvents(id: number, branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ChatLifecycleEventsResponseDto>>>;
109
168
  /**
110
169
  *
111
170
  * @param {number} branchId
@@ -132,6 +191,22 @@ export declare const ChatsApiFp: (configuration?: Configuration) => {
132
191
  * @throws {RequiredError}
133
192
  */
134
193
  markChatUnread(body: MarkChatUnreadDto, apikey: string, id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>>;
194
+ /**
195
+ *
196
+ * @param {UpdateAgentDto} body
197
+ * @param {string} apikey
198
+ * @param {*} [options] Override http request option.
199
+ * @throws {RequiredError}
200
+ */
201
+ updateAgent(body: UpdateAgentDto, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>>;
202
+ /**
203
+ *
204
+ * @param {UpdateChatStatusDto} body
205
+ * @param {string} apikey
206
+ * @param {*} [options] Override http request option.
207
+ * @throws {RequiredError}
208
+ */
209
+ updateChatStatus(body: UpdateChatStatusDto, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>>;
135
210
  };
136
211
  /**
137
212
  * ChatsApi - factory interface
@@ -156,6 +231,16 @@ export declare const ChatsApiFactory: (configuration?: Configuration, basePath?:
156
231
  * @throws {RequiredError}
157
232
  */
158
233
  assignmentType(body: AssignmentTypeDto, apikey: string, cellphone: string, id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<void>>;
234
+ /**
235
+ *
236
+ * @param {CreateChatLifecycleEventDto} body
237
+ * @param {string} apikey
238
+ * @param {number} branchId
239
+ * @param {number} id
240
+ * @param {*} [options] Override http request option.
241
+ * @throws {RequiredError}
242
+ */
243
+ createChatEvent(body: CreateChatLifecycleEventDto, apikey: string, branchId: number, id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<ChatLifecycleEventDto>>;
159
244
  /**
160
245
  *
161
246
  * @param {number} id
@@ -164,6 +249,15 @@ export declare const ChatsApiFactory: (configuration?: Configuration, basePath?:
164
249
  * @throws {RequiredError}
165
250
  */
166
251
  getChat(id: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<WhatsappChatResponseDTO>>;
252
+ /**
253
+ *
254
+ * @param {number} id
255
+ * @param {number} branchId
256
+ * @param {string} apikey
257
+ * @param {*} [options] Override http request option.
258
+ * @throws {RequiredError}
259
+ */
260
+ getChatEvents(id: number, branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ChatLifecycleEventsResponseDto>>;
167
261
  /**
168
262
  *
169
263
  * @param {number} branchId
@@ -190,6 +284,22 @@ export declare const ChatsApiFactory: (configuration?: Configuration, basePath?:
190
284
  * @throws {RequiredError}
191
285
  */
192
286
  markChatUnread(body: MarkChatUnreadDto, apikey: string, id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<void>>;
287
+ /**
288
+ *
289
+ * @param {UpdateAgentDto} body
290
+ * @param {string} apikey
291
+ * @param {*} [options] Override http request option.
292
+ * @throws {RequiredError}
293
+ */
294
+ updateAgent(body: UpdateAgentDto, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>>;
295
+ /**
296
+ *
297
+ * @param {UpdateChatStatusDto} body
298
+ * @param {string} apikey
299
+ * @param {*} [options] Override http request option.
300
+ * @throws {RequiredError}
301
+ */
302
+ updateChatStatus(body: UpdateChatStatusDto, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>>;
193
303
  };
194
304
  /**
195
305
  * ChatsApi - object-oriented interface
@@ -218,6 +328,17 @@ export declare class ChatsApi extends BaseAPI {
218
328
  * @memberof ChatsApi
219
329
  */
220
330
  assignmentType(body: AssignmentTypeDto, apikey: string, cellphone: string, id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<void>>;
331
+ /**
332
+ *
333
+ * @param {CreateChatLifecycleEventDto} body
334
+ * @param {string} apikey
335
+ * @param {number} branchId
336
+ * @param {number} id
337
+ * @param {*} [options] Override http request option.
338
+ * @throws {RequiredError}
339
+ * @memberof ChatsApi
340
+ */
341
+ createChatEvent(body: CreateChatLifecycleEventDto, apikey: string, branchId: number, id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<ChatLifecycleEventDto>>;
221
342
  /**
222
343
  *
223
344
  * @param {number} id
@@ -227,6 +348,16 @@ export declare class ChatsApi extends BaseAPI {
227
348
  * @memberof ChatsApi
228
349
  */
229
350
  getChat(id: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<WhatsappChatResponseDTO>>;
351
+ /**
352
+ *
353
+ * @param {number} id
354
+ * @param {number} branchId
355
+ * @param {string} apikey
356
+ * @param {*} [options] Override http request option.
357
+ * @throws {RequiredError}
358
+ * @memberof ChatsApi
359
+ */
360
+ getChatEvents(id: number, branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ChatLifecycleEventsResponseDto>>;
230
361
  /**
231
362
  *
232
363
  * @param {number} branchId
@@ -255,4 +386,22 @@ export declare class ChatsApi extends BaseAPI {
255
386
  * @memberof ChatsApi
256
387
  */
257
388
  markChatUnread(body: MarkChatUnreadDto, apikey: string, id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<void>>;
389
+ /**
390
+ *
391
+ * @param {UpdateAgentDto} body
392
+ * @param {string} apikey
393
+ * @param {*} [options] Override http request option.
394
+ * @throws {RequiredError}
395
+ * @memberof ChatsApi
396
+ */
397
+ updateAgent(body: UpdateAgentDto, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>>;
398
+ /**
399
+ *
400
+ * @param {UpdateChatStatusDto} body
401
+ * @param {string} apikey
402
+ * @param {*} [options] Override http request option.
403
+ * @throws {RequiredError}
404
+ * @memberof ChatsApi
405
+ */
406
+ updateChatStatus(body: UpdateChatStatusDto, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>>;
258
407
  }