@libgot/whatsapp-bridge-sdk 1.0.44 → 1.0.46-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.
- package/README.md +3 -3
- package/apis/chats-api.ts +191 -0
- package/apis/messages-api.ts +88 -0
- package/apis/sessions-api.ts +96 -0
- package/apis/tasks-api.ts +86 -0
- package/dist/apis/chats-api.d.ts +75 -0
- package/dist/apis/chats-api.js +194 -0
- package/dist/apis/messages-api.d.ts +35 -0
- package/dist/apis/messages-api.js +88 -0
- package/dist/apis/sessions-api.d.ts +38 -0
- package/dist/apis/sessions-api.js +97 -0
- package/dist/apis/tasks-api.d.ts +33 -0
- package/dist/apis/tasks-api.js +88 -0
- package/dist/models/audio-message-dto.d.ts +31 -0
- package/dist/models/audio-message-dto.js +15 -0
- package/dist/models/chat-user-cellphone-dto.d.ts +25 -0
- package/dist/models/chat-user-cellphone-dto.js +15 -0
- package/dist/models/index.d.ts +11 -0
- package/dist/models/index.js +11 -0
- package/dist/models/send-media-data-dto.d.ts +31 -0
- package/dist/models/send-media-data-dto.js +15 -0
- package/dist/models/send-media-data-response-dto.d.ts +25 -0
- package/dist/models/send-media-data-response-dto.js +15 -0
- package/dist/models/send-media-dto.d.ts +91 -0
- package/dist/models/send-media-dto.js +25 -0
- package/dist/models/send-media-key-dto.d.ts +37 -0
- package/dist/models/send-media-key-dto.js +15 -0
- package/dist/models/send-media-message-dto.d.ts +25 -0
- package/dist/models/send-media-message-dto.js +15 -0
- package/dist/models/send-media-response-dto.d.ts +72 -0
- package/dist/models/send-media-response-dto.js +15 -0
- package/dist/models/send-template-data-dto.d.ts +6 -0
- package/dist/models/session-summary-dto.d.ts +47 -0
- package/dist/models/session-summary-dto.js +15 -0
- package/dist/models/session-summary-list-response-data-dto.d.ts +25 -0
- package/dist/models/session-summary-list-response-data-dto.js +15 -0
- package/dist/models/sticker-message-dto.d.ts +31 -0
- package/dist/models/sticker-message-dto.js +15 -0
- package/dist/models/whatsapp-message-dto.d.ts +4 -2
- package/models/audio-message-dto.ts +36 -0
- package/models/chat-user-cellphone-dto.ts +29 -0
- package/models/index.ts +11 -0
- package/models/send-media-data-dto.ts +36 -0
- package/models/send-media-data-response-dto.ts +29 -0
- package/models/send-media-dto.ts +106 -0
- package/models/send-media-key-dto.ts +43 -0
- package/models/send-media-message-dto.ts +29 -0
- package/models/send-media-response-dto.ts +84 -0
- package/models/send-template-data-dto.ts +7 -0
- package/models/session-summary-dto.ts +55 -0
- package/models/session-summary-list-response-data-dto.ts +29 -0
- package/models/sticker-message-dto.ts +36 -0
- package/models/whatsapp-message-dto.ts +4 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @1.0.
|
|
1
|
+
## @1.0.46-rc.1
|
|
2
2
|
|
|
3
3
|
This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
|
|
4
4
|
|
|
@@ -36,8 +36,8 @@ navigate to the folder of your consuming project and run one of the following co
|
|
|
36
36
|
_published:_
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
npm install @libgot/whatsapp-bridge-sdk@1.0.
|
|
40
|
-
pnpm add @libgot/whatsapp-bridge-sdk@1.0.
|
|
39
|
+
npm install @libgot/whatsapp-bridge-sdk@1.0.46-rc.1 --save
|
|
40
|
+
pnpm add @libgot/whatsapp-bridge-sdk@1.0.46-rc.1
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
_unPublished (not recommended):_
|
package/apis/chats-api.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { AssignmentTypeDto } from '../models';
|
|
|
22
22
|
import { ChatLatestStatusDto } from '../models';
|
|
23
23
|
import { ChatLifecycleEventDto } from '../models';
|
|
24
24
|
import { ChatLifecycleEventsResponseDto } from '../models';
|
|
25
|
+
import { ChatUserCellphoneDto } from '../models';
|
|
25
26
|
import { CreateChatLifecycleEventDto } from '../models';
|
|
26
27
|
import { MarkChatUnreadDto } from '../models';
|
|
27
28
|
import { PaginationChatResponseDto } from '../models';
|
|
@@ -214,6 +215,63 @@ export const ChatsApiAxiosParamCreator = function (configuration?: Configuration
|
|
|
214
215
|
options: localVarRequestOptions,
|
|
215
216
|
};
|
|
216
217
|
},
|
|
218
|
+
/**
|
|
219
|
+
*
|
|
220
|
+
* @param {string} userId
|
|
221
|
+
* @param {number} branchId
|
|
222
|
+
* @param {string} apikey
|
|
223
|
+
* @param {*} [options] Override http request option.
|
|
224
|
+
* @throws {RequiredError}
|
|
225
|
+
*/
|
|
226
|
+
getCellphoneByUserId: async (userId: string, branchId: number, apikey: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
227
|
+
// verify required parameter 'userId' is not null or undefined
|
|
228
|
+
if (userId === null || userId === undefined) {
|
|
229
|
+
throw new RequiredError('userId','Required parameter userId was null or undefined when calling getCellphoneByUserId.');
|
|
230
|
+
}
|
|
231
|
+
// verify required parameter 'branchId' is not null or undefined
|
|
232
|
+
if (branchId === null || branchId === undefined) {
|
|
233
|
+
throw new RequiredError('branchId','Required parameter branchId was null or undefined when calling getCellphoneByUserId.');
|
|
234
|
+
}
|
|
235
|
+
// verify required parameter 'apikey' is not null or undefined
|
|
236
|
+
if (apikey === null || apikey === undefined) {
|
|
237
|
+
throw new RequiredError('apikey','Required parameter apikey was null or undefined when calling getCellphoneByUserId.');
|
|
238
|
+
}
|
|
239
|
+
const localVarPath = `/api/chats/user/{userId}/cellphone`
|
|
240
|
+
.replace(`{${"userId"}}`, encodeURIComponent(String(userId)));
|
|
241
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
242
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
243
|
+
let baseOptions;
|
|
244
|
+
if (configuration) {
|
|
245
|
+
baseOptions = configuration.baseOptions;
|
|
246
|
+
}
|
|
247
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
|
248
|
+
const localVarHeaderParameter = {} as any;
|
|
249
|
+
const localVarQueryParameter = {} as any;
|
|
250
|
+
|
|
251
|
+
if (branchId !== undefined) {
|
|
252
|
+
localVarQueryParameter['branchId'] = branchId;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (apikey !== undefined && apikey !== null) {
|
|
256
|
+
localVarHeaderParameter['apikey'] = String(apikey);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
260
|
+
for (const key in localVarQueryParameter) {
|
|
261
|
+
query.set(key, localVarQueryParameter[key]);
|
|
262
|
+
}
|
|
263
|
+
for (const key in options.params) {
|
|
264
|
+
query.set(key, options.params[key]);
|
|
265
|
+
}
|
|
266
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
267
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
268
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
269
|
+
|
|
270
|
+
return {
|
|
271
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
272
|
+
options: localVarRequestOptions,
|
|
273
|
+
};
|
|
274
|
+
},
|
|
217
275
|
/**
|
|
218
276
|
*
|
|
219
277
|
* @param {number} id
|
|
@@ -319,6 +377,63 @@ export const ChatsApiAxiosParamCreator = function (configuration?: Configuration
|
|
|
319
377
|
options: localVarRequestOptions,
|
|
320
378
|
};
|
|
321
379
|
},
|
|
380
|
+
/**
|
|
381
|
+
*
|
|
382
|
+
* @param {number} cellphone
|
|
383
|
+
* @param {number} branchId
|
|
384
|
+
* @param {string} apikey
|
|
385
|
+
* @param {*} [options] Override http request option.
|
|
386
|
+
* @throws {RequiredError}
|
|
387
|
+
*/
|
|
388
|
+
getChatEventsByCellphone: async (cellphone: number, branchId: number, apikey: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
389
|
+
// verify required parameter 'cellphone' is not null or undefined
|
|
390
|
+
if (cellphone === null || cellphone === undefined) {
|
|
391
|
+
throw new RequiredError('cellphone','Required parameter cellphone was null or undefined when calling getChatEventsByCellphone.');
|
|
392
|
+
}
|
|
393
|
+
// verify required parameter 'branchId' is not null or undefined
|
|
394
|
+
if (branchId === null || branchId === undefined) {
|
|
395
|
+
throw new RequiredError('branchId','Required parameter branchId was null or undefined when calling getChatEventsByCellphone.');
|
|
396
|
+
}
|
|
397
|
+
// verify required parameter 'apikey' is not null or undefined
|
|
398
|
+
if (apikey === null || apikey === undefined) {
|
|
399
|
+
throw new RequiredError('apikey','Required parameter apikey was null or undefined when calling getChatEventsByCellphone.');
|
|
400
|
+
}
|
|
401
|
+
const localVarPath = `/api/chats/cellphone/{cellphone}/events`
|
|
402
|
+
.replace(`{${"cellphone"}}`, encodeURIComponent(String(cellphone)));
|
|
403
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
404
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
405
|
+
let baseOptions;
|
|
406
|
+
if (configuration) {
|
|
407
|
+
baseOptions = configuration.baseOptions;
|
|
408
|
+
}
|
|
409
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
|
410
|
+
const localVarHeaderParameter = {} as any;
|
|
411
|
+
const localVarQueryParameter = {} as any;
|
|
412
|
+
|
|
413
|
+
if (branchId !== undefined) {
|
|
414
|
+
localVarQueryParameter['branchId'] = branchId;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
if (apikey !== undefined && apikey !== null) {
|
|
418
|
+
localVarHeaderParameter['apikey'] = String(apikey);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
422
|
+
for (const key in localVarQueryParameter) {
|
|
423
|
+
query.set(key, localVarQueryParameter[key]);
|
|
424
|
+
}
|
|
425
|
+
for (const key in options.params) {
|
|
426
|
+
query.set(key, options.params[key]);
|
|
427
|
+
}
|
|
428
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
429
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
430
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
431
|
+
|
|
432
|
+
return {
|
|
433
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
434
|
+
options: localVarRequestOptions,
|
|
435
|
+
};
|
|
436
|
+
},
|
|
322
437
|
/**
|
|
323
438
|
*
|
|
324
439
|
* @param {number} id
|
|
@@ -686,6 +801,21 @@ export const ChatsApiFp = function(configuration?: Configuration) {
|
|
|
686
801
|
return axios.request(axiosRequestArgs);
|
|
687
802
|
};
|
|
688
803
|
},
|
|
804
|
+
/**
|
|
805
|
+
*
|
|
806
|
+
* @param {string} userId
|
|
807
|
+
* @param {number} branchId
|
|
808
|
+
* @param {string} apikey
|
|
809
|
+
* @param {*} [options] Override http request option.
|
|
810
|
+
* @throws {RequiredError}
|
|
811
|
+
*/
|
|
812
|
+
async getCellphoneByUserId(userId: string, branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ChatUserCellphoneDto>>> {
|
|
813
|
+
const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).getCellphoneByUserId(userId, branchId, apikey, options);
|
|
814
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
815
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
816
|
+
return axios.request(axiosRequestArgs);
|
|
817
|
+
};
|
|
818
|
+
},
|
|
689
819
|
/**
|
|
690
820
|
*
|
|
691
821
|
* @param {number} id
|
|
@@ -715,6 +845,21 @@ export const ChatsApiFp = function(configuration?: Configuration) {
|
|
|
715
845
|
return axios.request(axiosRequestArgs);
|
|
716
846
|
};
|
|
717
847
|
},
|
|
848
|
+
/**
|
|
849
|
+
*
|
|
850
|
+
* @param {number} cellphone
|
|
851
|
+
* @param {number} branchId
|
|
852
|
+
* @param {string} apikey
|
|
853
|
+
* @param {*} [options] Override http request option.
|
|
854
|
+
* @throws {RequiredError}
|
|
855
|
+
*/
|
|
856
|
+
async getChatEventsByCellphone(cellphone: number, branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ChatLifecycleEventsResponseDto>>> {
|
|
857
|
+
const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).getChatEventsByCellphone(cellphone, branchId, apikey, options);
|
|
858
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
859
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
860
|
+
return axios.request(axiosRequestArgs);
|
|
861
|
+
};
|
|
862
|
+
},
|
|
718
863
|
/**
|
|
719
864
|
*
|
|
720
865
|
* @param {number} id
|
|
@@ -839,6 +984,17 @@ export const ChatsApiFactory = function (configuration?: Configuration, basePath
|
|
|
839
984
|
async createChatEvent(body: CreateChatLifecycleEventDto, apikey: string, branchId: number, id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<ChatLifecycleEventDto>> {
|
|
840
985
|
return ChatsApiFp(configuration).createChatEvent(body, apikey, branchId, id, options).then((request) => request(axios, basePath));
|
|
841
986
|
},
|
|
987
|
+
/**
|
|
988
|
+
*
|
|
989
|
+
* @param {string} userId
|
|
990
|
+
* @param {number} branchId
|
|
991
|
+
* @param {string} apikey
|
|
992
|
+
* @param {*} [options] Override http request option.
|
|
993
|
+
* @throws {RequiredError}
|
|
994
|
+
*/
|
|
995
|
+
async getCellphoneByUserId(userId: string, branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ChatUserCellphoneDto>> {
|
|
996
|
+
return ChatsApiFp(configuration).getCellphoneByUserId(userId, branchId, apikey, options).then((request) => request(axios, basePath));
|
|
997
|
+
},
|
|
842
998
|
/**
|
|
843
999
|
*
|
|
844
1000
|
* @param {number} id
|
|
@@ -860,6 +1016,17 @@ export const ChatsApiFactory = function (configuration?: Configuration, basePath
|
|
|
860
1016
|
async getChatEvents(id: number, branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ChatLifecycleEventsResponseDto>> {
|
|
861
1017
|
return ChatsApiFp(configuration).getChatEvents(id, branchId, apikey, options).then((request) => request(axios, basePath));
|
|
862
1018
|
},
|
|
1019
|
+
/**
|
|
1020
|
+
*
|
|
1021
|
+
* @param {number} cellphone
|
|
1022
|
+
* @param {number} branchId
|
|
1023
|
+
* @param {string} apikey
|
|
1024
|
+
* @param {*} [options] Override http request option.
|
|
1025
|
+
* @throws {RequiredError}
|
|
1026
|
+
*/
|
|
1027
|
+
async getChatEventsByCellphone(cellphone: number, branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ChatLifecycleEventsResponseDto>> {
|
|
1028
|
+
return ChatsApiFp(configuration).getChatEventsByCellphone(cellphone, branchId, apikey, options).then((request) => request(axios, basePath));
|
|
1029
|
+
},
|
|
863
1030
|
/**
|
|
864
1031
|
*
|
|
865
1032
|
* @param {number} id
|
|
@@ -968,6 +1135,18 @@ export class ChatsApi extends BaseAPI {
|
|
|
968
1135
|
public async createChatEvent(body: CreateChatLifecycleEventDto, apikey: string, branchId: number, id: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<ChatLifecycleEventDto>> {
|
|
969
1136
|
return ChatsApiFp(this.configuration).createChatEvent(body, apikey, branchId, id, options).then((request) => request(this.axios, this.basePath));
|
|
970
1137
|
}
|
|
1138
|
+
/**
|
|
1139
|
+
*
|
|
1140
|
+
* @param {string} userId
|
|
1141
|
+
* @param {number} branchId
|
|
1142
|
+
* @param {string} apikey
|
|
1143
|
+
* @param {*} [options] Override http request option.
|
|
1144
|
+
* @throws {RequiredError}
|
|
1145
|
+
* @memberof ChatsApi
|
|
1146
|
+
*/
|
|
1147
|
+
public async getCellphoneByUserId(userId: string, branchId: number, apikey: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ChatUserCellphoneDto>> {
|
|
1148
|
+
return ChatsApiFp(this.configuration).getCellphoneByUserId(userId, branchId, apikey, options).then((request) => request(this.axios, this.basePath));
|
|
1149
|
+
}
|
|
971
1150
|
/**
|
|
972
1151
|
*
|
|
973
1152
|
* @param {number} id
|
|
@@ -991,6 +1170,18 @@ export class ChatsApi extends BaseAPI {
|
|
|
991
1170
|
public async getChatEvents(id: number, branchId: number, apikey: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ChatLifecycleEventsResponseDto>> {
|
|
992
1171
|
return ChatsApiFp(this.configuration).getChatEvents(id, branchId, apikey, options).then((request) => request(this.axios, this.basePath));
|
|
993
1172
|
}
|
|
1173
|
+
/**
|
|
1174
|
+
*
|
|
1175
|
+
* @param {number} cellphone
|
|
1176
|
+
* @param {number} branchId
|
|
1177
|
+
* @param {string} apikey
|
|
1178
|
+
* @param {*} [options] Override http request option.
|
|
1179
|
+
* @throws {RequiredError}
|
|
1180
|
+
* @memberof ChatsApi
|
|
1181
|
+
*/
|
|
1182
|
+
public async getChatEventsByCellphone(cellphone: number, branchId: number, apikey: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ChatLifecycleEventsResponseDto>> {
|
|
1183
|
+
return ChatsApiFp(this.configuration).getChatEventsByCellphone(cellphone, branchId, apikey, options).then((request) => request(this.axios, this.basePath));
|
|
1184
|
+
}
|
|
994
1185
|
/**
|
|
995
1186
|
*
|
|
996
1187
|
* @param {number} id
|
package/apis/messages-api.ts
CHANGED
|
@@ -20,6 +20,8 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } fr
|
|
|
20
20
|
import { MessageResponseDto } from '../models';
|
|
21
21
|
import { ReadMessageDto } from '../models';
|
|
22
22
|
import { ReadMessageResponseDataDto } from '../models';
|
|
23
|
+
import { SendMediaDataDto } from '../models';
|
|
24
|
+
import { SendMediaDataResponseDto } from '../models';
|
|
23
25
|
import { SendTemplateDataDto } from '../models';
|
|
24
26
|
import { SendTextDataResponseDto } from '../models';
|
|
25
27
|
import { SendTextDto } from '../models';
|
|
@@ -140,6 +142,57 @@ export const MessagesApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
140
142
|
options: localVarRequestOptions,
|
|
141
143
|
};
|
|
142
144
|
},
|
|
145
|
+
/**
|
|
146
|
+
*
|
|
147
|
+
* @param {SendMediaDataDto} body
|
|
148
|
+
* @param {string} apikey
|
|
149
|
+
* @param {*} [options] Override http request option.
|
|
150
|
+
* @throws {RequiredError}
|
|
151
|
+
*/
|
|
152
|
+
sendMediaMessage: async (body: SendMediaDataDto, apikey: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
153
|
+
// verify required parameter 'body' is not null or undefined
|
|
154
|
+
if (body === null || body === undefined) {
|
|
155
|
+
throw new RequiredError('body','Required parameter body was null or undefined when calling sendMediaMessage.');
|
|
156
|
+
}
|
|
157
|
+
// verify required parameter 'apikey' is not null or undefined
|
|
158
|
+
if (apikey === null || apikey === undefined) {
|
|
159
|
+
throw new RequiredError('apikey','Required parameter apikey was null or undefined when calling sendMediaMessage.');
|
|
160
|
+
}
|
|
161
|
+
const localVarPath = `/api/messages/send-media`;
|
|
162
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
163
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
164
|
+
let baseOptions;
|
|
165
|
+
if (configuration) {
|
|
166
|
+
baseOptions = configuration.baseOptions;
|
|
167
|
+
}
|
|
168
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
|
169
|
+
const localVarHeaderParameter = {} as any;
|
|
170
|
+
const localVarQueryParameter = {} as any;
|
|
171
|
+
|
|
172
|
+
if (apikey !== undefined && apikey !== null) {
|
|
173
|
+
localVarHeaderParameter['apikey'] = String(apikey);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
177
|
+
|
|
178
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
179
|
+
for (const key in localVarQueryParameter) {
|
|
180
|
+
query.set(key, localVarQueryParameter[key]);
|
|
181
|
+
}
|
|
182
|
+
for (const key in options.params) {
|
|
183
|
+
query.set(key, options.params[key]);
|
|
184
|
+
}
|
|
185
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
186
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
187
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
188
|
+
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
189
|
+
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
190
|
+
|
|
191
|
+
return {
|
|
192
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
193
|
+
options: localVarRequestOptions,
|
|
194
|
+
};
|
|
195
|
+
},
|
|
143
196
|
/**
|
|
144
197
|
*
|
|
145
198
|
* @param {SendTemplateDataDto} body
|
|
@@ -280,6 +333,20 @@ export const MessagesApiFp = function(configuration?: Configuration) {
|
|
|
280
333
|
return axios.request(axiosRequestArgs);
|
|
281
334
|
};
|
|
282
335
|
},
|
|
336
|
+
/**
|
|
337
|
+
*
|
|
338
|
+
* @param {SendMediaDataDto} body
|
|
339
|
+
* @param {string} apikey
|
|
340
|
+
* @param {*} [options] Override http request option.
|
|
341
|
+
* @throws {RequiredError}
|
|
342
|
+
*/
|
|
343
|
+
async sendMediaMessage(body: SendMediaDataDto, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<SendMediaDataResponseDto>>> {
|
|
344
|
+
const localVarAxiosArgs = await MessagesApiAxiosParamCreator(configuration).sendMediaMessage(body, apikey, options);
|
|
345
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
346
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
347
|
+
return axios.request(axiosRequestArgs);
|
|
348
|
+
};
|
|
349
|
+
},
|
|
283
350
|
/**
|
|
284
351
|
*
|
|
285
352
|
* @param {SendTemplateDataDto} body
|
|
@@ -338,6 +405,16 @@ export const MessagesApiFactory = function (configuration?: Configuration, baseP
|
|
|
338
405
|
async readMessage(body: ReadMessageDto, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ReadMessageResponseDataDto>> {
|
|
339
406
|
return MessagesApiFp(configuration).readMessage(body, apikey, options).then((request) => request(axios, basePath));
|
|
340
407
|
},
|
|
408
|
+
/**
|
|
409
|
+
*
|
|
410
|
+
* @param {SendMediaDataDto} body
|
|
411
|
+
* @param {string} apikey
|
|
412
|
+
* @param {*} [options] Override http request option.
|
|
413
|
+
* @throws {RequiredError}
|
|
414
|
+
*/
|
|
415
|
+
async sendMediaMessage(body: SendMediaDataDto, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<SendMediaDataResponseDto>> {
|
|
416
|
+
return MessagesApiFp(configuration).sendMediaMessage(body, apikey, options).then((request) => request(axios, basePath));
|
|
417
|
+
},
|
|
341
418
|
/**
|
|
342
419
|
*
|
|
343
420
|
* @param {SendTemplateDataDto} body
|
|
@@ -391,6 +468,17 @@ export class MessagesApi extends BaseAPI {
|
|
|
391
468
|
public async readMessage(body: ReadMessageDto, apikey: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ReadMessageResponseDataDto>> {
|
|
392
469
|
return MessagesApiFp(this.configuration).readMessage(body, apikey, options).then((request) => request(this.axios, this.basePath));
|
|
393
470
|
}
|
|
471
|
+
/**
|
|
472
|
+
*
|
|
473
|
+
* @param {SendMediaDataDto} body
|
|
474
|
+
* @param {string} apikey
|
|
475
|
+
* @param {*} [options] Override http request option.
|
|
476
|
+
* @throws {RequiredError}
|
|
477
|
+
* @memberof MessagesApi
|
|
478
|
+
*/
|
|
479
|
+
public async sendMediaMessage(body: SendMediaDataDto, apikey: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<SendMediaDataResponseDto>> {
|
|
480
|
+
return MessagesApiFp(this.configuration).sendMediaMessage(body, apikey, options).then((request) => request(this.axios, this.basePath));
|
|
481
|
+
}
|
|
394
482
|
/**
|
|
395
483
|
*
|
|
396
484
|
* @param {SendTemplateDataDto} body
|
package/apis/sessions-api.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { Configuration } from '../configuration';
|
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
|
|
20
20
|
import { SessionResponseDataDto } from '../models';
|
|
21
|
+
import { SessionSummaryListResponseDataDto } from '../models';
|
|
21
22
|
import { SessionsResponseDataDto } from '../models';
|
|
22
23
|
/**
|
|
23
24
|
* SessionsApi - axios parameter creator
|
|
@@ -167,6 +168,63 @@ export const SessionsApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
167
168
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
168
169
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
169
170
|
|
|
171
|
+
return {
|
|
172
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
173
|
+
options: localVarRequestOptions,
|
|
174
|
+
};
|
|
175
|
+
},
|
|
176
|
+
/**
|
|
177
|
+
*
|
|
178
|
+
* @param {number} cellphone
|
|
179
|
+
* @param {number} branchId
|
|
180
|
+
* @param {string} apikey
|
|
181
|
+
* @param {*} [options] Override http request option.
|
|
182
|
+
* @throws {RequiredError}
|
|
183
|
+
*/
|
|
184
|
+
getSessionsByCellphone: async (cellphone: number, branchId: number, apikey: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
185
|
+
// verify required parameter 'cellphone' is not null or undefined
|
|
186
|
+
if (cellphone === null || cellphone === undefined) {
|
|
187
|
+
throw new RequiredError('cellphone','Required parameter cellphone was null or undefined when calling getSessionsByCellphone.');
|
|
188
|
+
}
|
|
189
|
+
// verify required parameter 'branchId' is not null or undefined
|
|
190
|
+
if (branchId === null || branchId === undefined) {
|
|
191
|
+
throw new RequiredError('branchId','Required parameter branchId was null or undefined when calling getSessionsByCellphone.');
|
|
192
|
+
}
|
|
193
|
+
// verify required parameter 'apikey' is not null or undefined
|
|
194
|
+
if (apikey === null || apikey === undefined) {
|
|
195
|
+
throw new RequiredError('apikey','Required parameter apikey was null or undefined when calling getSessionsByCellphone.');
|
|
196
|
+
}
|
|
197
|
+
const localVarPath = `/api/sessions/cellphone/{cellphone}`
|
|
198
|
+
.replace(`{${"cellphone"}}`, encodeURIComponent(String(cellphone)));
|
|
199
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
200
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
201
|
+
let baseOptions;
|
|
202
|
+
if (configuration) {
|
|
203
|
+
baseOptions = configuration.baseOptions;
|
|
204
|
+
}
|
|
205
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
|
206
|
+
const localVarHeaderParameter = {} as any;
|
|
207
|
+
const localVarQueryParameter = {} as any;
|
|
208
|
+
|
|
209
|
+
if (branchId !== undefined) {
|
|
210
|
+
localVarQueryParameter['branchId'] = branchId;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (apikey !== undefined && apikey !== null) {
|
|
214
|
+
localVarHeaderParameter['apikey'] = String(apikey);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
218
|
+
for (const key in localVarQueryParameter) {
|
|
219
|
+
query.set(key, localVarQueryParameter[key]);
|
|
220
|
+
}
|
|
221
|
+
for (const key in options.params) {
|
|
222
|
+
query.set(key, options.params[key]);
|
|
223
|
+
}
|
|
224
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
225
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
226
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
227
|
+
|
|
170
228
|
return {
|
|
171
229
|
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
172
230
|
options: localVarRequestOptions,
|
|
@@ -223,6 +281,21 @@ export const SessionsApiFp = function(configuration?: Configuration) {
|
|
|
223
281
|
return axios.request(axiosRequestArgs);
|
|
224
282
|
};
|
|
225
283
|
},
|
|
284
|
+
/**
|
|
285
|
+
*
|
|
286
|
+
* @param {number} cellphone
|
|
287
|
+
* @param {number} branchId
|
|
288
|
+
* @param {string} apikey
|
|
289
|
+
* @param {*} [options] Override http request option.
|
|
290
|
+
* @throws {RequiredError}
|
|
291
|
+
*/
|
|
292
|
+
async getSessionsByCellphone(cellphone: number, branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<SessionSummaryListResponseDataDto>>> {
|
|
293
|
+
const localVarAxiosArgs = await SessionsApiAxiosParamCreator(configuration).getSessionsByCellphone(cellphone, branchId, apikey, options);
|
|
294
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
295
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
296
|
+
return axios.request(axiosRequestArgs);
|
|
297
|
+
};
|
|
298
|
+
},
|
|
226
299
|
}
|
|
227
300
|
};
|
|
228
301
|
|
|
@@ -262,6 +335,17 @@ export const SessionsApiFactory = function (configuration?: Configuration, baseP
|
|
|
262
335
|
async getSessions(branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<SessionsResponseDataDto>> {
|
|
263
336
|
return SessionsApiFp(configuration).getSessions(branchId, apikey, options).then((request) => request(axios, basePath));
|
|
264
337
|
},
|
|
338
|
+
/**
|
|
339
|
+
*
|
|
340
|
+
* @param {number} cellphone
|
|
341
|
+
* @param {number} branchId
|
|
342
|
+
* @param {string} apikey
|
|
343
|
+
* @param {*} [options] Override http request option.
|
|
344
|
+
* @throws {RequiredError}
|
|
345
|
+
*/
|
|
346
|
+
async getSessionsByCellphone(cellphone: number, branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<SessionSummaryListResponseDataDto>> {
|
|
347
|
+
return SessionsApiFp(configuration).getSessionsByCellphone(cellphone, branchId, apikey, options).then((request) => request(axios, basePath));
|
|
348
|
+
},
|
|
265
349
|
};
|
|
266
350
|
};
|
|
267
351
|
|
|
@@ -305,4 +389,16 @@ export class SessionsApi extends BaseAPI {
|
|
|
305
389
|
public async getSessions(branchId: number, apikey: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<SessionsResponseDataDto>> {
|
|
306
390
|
return SessionsApiFp(this.configuration).getSessions(branchId, apikey, options).then((request) => request(this.axios, this.basePath));
|
|
307
391
|
}
|
|
392
|
+
/**
|
|
393
|
+
*
|
|
394
|
+
* @param {number} cellphone
|
|
395
|
+
* @param {number} branchId
|
|
396
|
+
* @param {string} apikey
|
|
397
|
+
* @param {*} [options] Override http request option.
|
|
398
|
+
* @throws {RequiredError}
|
|
399
|
+
* @memberof SessionsApi
|
|
400
|
+
*/
|
|
401
|
+
public async getSessionsByCellphone(cellphone: number, branchId: number, apikey: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<SessionSummaryListResponseDataDto>> {
|
|
402
|
+
return SessionsApiFp(this.configuration).getSessionsByCellphone(cellphone, branchId, apikey, options).then((request) => request(this.axios, this.basePath));
|
|
403
|
+
}
|
|
308
404
|
}
|
package/apis/tasks-api.ts
CHANGED
|
@@ -70,6 +70,57 @@ export const TasksApiAxiosParamCreator = function (configuration?: Configuration
|
|
|
70
70
|
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
71
71
|
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
72
72
|
|
|
73
|
+
return {
|
|
74
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
75
|
+
options: localVarRequestOptions,
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* @param {string} targetOriginTypeId
|
|
81
|
+
* @param {string} apikey
|
|
82
|
+
* @param {*} [options] Override http request option.
|
|
83
|
+
* @throws {RequiredError}
|
|
84
|
+
*/
|
|
85
|
+
syncWhatsappMessagesOriginType: async (targetOriginTypeId: string, apikey: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
86
|
+
// verify required parameter 'targetOriginTypeId' is not null or undefined
|
|
87
|
+
if (targetOriginTypeId === null || targetOriginTypeId === undefined) {
|
|
88
|
+
throw new RequiredError('targetOriginTypeId','Required parameter targetOriginTypeId was null or undefined when calling syncWhatsappMessagesOriginType.');
|
|
89
|
+
}
|
|
90
|
+
// verify required parameter 'apikey' is not null or undefined
|
|
91
|
+
if (apikey === null || apikey === undefined) {
|
|
92
|
+
throw new RequiredError('apikey','Required parameter apikey was null or undefined when calling syncWhatsappMessagesOriginType.');
|
|
93
|
+
}
|
|
94
|
+
const localVarPath = `/api/tasks/sync-whatsapp-messages-origin-type`;
|
|
95
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
96
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
97
|
+
let baseOptions;
|
|
98
|
+
if (configuration) {
|
|
99
|
+
baseOptions = configuration.baseOptions;
|
|
100
|
+
}
|
|
101
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
|
102
|
+
const localVarHeaderParameter = {} as any;
|
|
103
|
+
const localVarQueryParameter = {} as any;
|
|
104
|
+
|
|
105
|
+
if (targetOriginTypeId !== undefined) {
|
|
106
|
+
localVarQueryParameter['targetOriginTypeId'] = targetOriginTypeId;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (apikey !== undefined && apikey !== null) {
|
|
110
|
+
localVarHeaderParameter['apikey'] = String(apikey);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
114
|
+
for (const key in localVarQueryParameter) {
|
|
115
|
+
query.set(key, localVarQueryParameter[key]);
|
|
116
|
+
}
|
|
117
|
+
for (const key in options.params) {
|
|
118
|
+
query.set(key, options.params[key]);
|
|
119
|
+
}
|
|
120
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
121
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
122
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
123
|
+
|
|
73
124
|
return {
|
|
74
125
|
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
75
126
|
options: localVarRequestOptions,
|
|
@@ -98,6 +149,20 @@ export const TasksApiFp = function(configuration?: Configuration) {
|
|
|
98
149
|
return axios.request(axiosRequestArgs);
|
|
99
150
|
};
|
|
100
151
|
},
|
|
152
|
+
/**
|
|
153
|
+
*
|
|
154
|
+
* @param {string} targetOriginTypeId
|
|
155
|
+
* @param {string} apikey
|
|
156
|
+
* @param {*} [options] Override http request option.
|
|
157
|
+
* @throws {RequiredError}
|
|
158
|
+
*/
|
|
159
|
+
async syncWhatsappMessagesOriginType(targetOriginTypeId: string, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
|
160
|
+
const localVarAxiosArgs = await TasksApiAxiosParamCreator(configuration).syncWhatsappMessagesOriginType(targetOriginTypeId, apikey, options);
|
|
161
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
162
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
163
|
+
return axios.request(axiosRequestArgs);
|
|
164
|
+
};
|
|
165
|
+
},
|
|
101
166
|
}
|
|
102
167
|
};
|
|
103
168
|
|
|
@@ -117,6 +182,16 @@ export const TasksApiFactory = function (configuration?: Configuration, basePath
|
|
|
117
182
|
async repairMissingMessageKeys(body: RepairMissingMessageKeysDto, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
118
183
|
return TasksApiFp(configuration).repairMissingMessageKeys(body, apikey, options).then((request) => request(axios, basePath));
|
|
119
184
|
},
|
|
185
|
+
/**
|
|
186
|
+
*
|
|
187
|
+
* @param {string} targetOriginTypeId
|
|
188
|
+
* @param {string} apikey
|
|
189
|
+
* @param {*} [options] Override http request option.
|
|
190
|
+
* @throws {RequiredError}
|
|
191
|
+
*/
|
|
192
|
+
async syncWhatsappMessagesOriginType(targetOriginTypeId: string, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
193
|
+
return TasksApiFp(configuration).syncWhatsappMessagesOriginType(targetOriginTypeId, apikey, options).then((request) => request(axios, basePath));
|
|
194
|
+
},
|
|
120
195
|
};
|
|
121
196
|
};
|
|
122
197
|
|
|
@@ -138,4 +213,15 @@ export class TasksApi extends BaseAPI {
|
|
|
138
213
|
public async repairMissingMessageKeys(body: RepairMissingMessageKeysDto, apikey: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
139
214
|
return TasksApiFp(this.configuration).repairMissingMessageKeys(body, apikey, options).then((request) => request(this.axios, this.basePath));
|
|
140
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
*
|
|
218
|
+
* @param {string} targetOriginTypeId
|
|
219
|
+
* @param {string} apikey
|
|
220
|
+
* @param {*} [options] Override http request option.
|
|
221
|
+
* @throws {RequiredError}
|
|
222
|
+
* @memberof TasksApi
|
|
223
|
+
*/
|
|
224
|
+
public async syncWhatsappMessagesOriginType(targetOriginTypeId: string, apikey: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
225
|
+
return TasksApiFp(this.configuration).syncWhatsappMessagesOriginType(targetOriginTypeId, apikey, options).then((request) => request(this.axios, this.basePath));
|
|
226
|
+
}
|
|
141
227
|
}
|