@libgot/whatsapp-bridge-sdk 1.0.45 → 1.0.46-rc.2
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/messages-api.ts +88 -0
- package/apis/sessions-api.ts +96 -0
- package/apis/tasks-api.ts +86 -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/index.d.ts +10 -0
- package/dist/models/index.js +10 -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 +99 -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/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/index.ts +10 -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 +115 -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/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.2
|
|
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.2 --save
|
|
40
|
+
pnpm add @libgot/whatsapp-bridge-sdk@1.0.46-rc.2
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
_unPublished (not recommended):_
|
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
|
}
|
|
@@ -15,6 +15,8 @@ import { RequestArgs, BaseAPI } from '../base';
|
|
|
15
15
|
import { MessageResponseDto } from '../models';
|
|
16
16
|
import { ReadMessageDto } from '../models';
|
|
17
17
|
import { ReadMessageResponseDataDto } from '../models';
|
|
18
|
+
import { SendMediaDataDto } from '../models';
|
|
19
|
+
import { SendMediaDataResponseDto } from '../models';
|
|
18
20
|
import { SendTemplateDataDto } from '../models';
|
|
19
21
|
import { SendTextDataResponseDto } from '../models';
|
|
20
22
|
import { SendTextDto } from '../models';
|
|
@@ -40,6 +42,14 @@ export declare const MessagesApiAxiosParamCreator: (configuration?: Configuratio
|
|
|
40
42
|
* @throws {RequiredError}
|
|
41
43
|
*/
|
|
42
44
|
readMessage: (body: ReadMessageDto, apikey: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @param {SendMediaDataDto} body
|
|
48
|
+
* @param {string} apikey
|
|
49
|
+
* @param {*} [options] Override http request option.
|
|
50
|
+
* @throws {RequiredError}
|
|
51
|
+
*/
|
|
52
|
+
sendMediaMessage: (body: SendMediaDataDto, apikey: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
43
53
|
/**
|
|
44
54
|
*
|
|
45
55
|
* @param {SendTemplateDataDto} body
|
|
@@ -79,6 +89,14 @@ export declare const MessagesApiFp: (configuration?: Configuration) => {
|
|
|
79
89
|
* @throws {RequiredError}
|
|
80
90
|
*/
|
|
81
91
|
readMessage(body: ReadMessageDto, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ReadMessageResponseDataDto>>>;
|
|
92
|
+
/**
|
|
93
|
+
*
|
|
94
|
+
* @param {SendMediaDataDto} body
|
|
95
|
+
* @param {string} apikey
|
|
96
|
+
* @param {*} [options] Override http request option.
|
|
97
|
+
* @throws {RequiredError}
|
|
98
|
+
*/
|
|
99
|
+
sendMediaMessage(body: SendMediaDataDto, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<SendMediaDataResponseDto>>>;
|
|
82
100
|
/**
|
|
83
101
|
*
|
|
84
102
|
* @param {SendTemplateDataDto} body
|
|
@@ -118,6 +136,14 @@ export declare const MessagesApiFactory: (configuration?: Configuration, basePat
|
|
|
118
136
|
* @throws {RequiredError}
|
|
119
137
|
*/
|
|
120
138
|
readMessage(body: ReadMessageDto, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ReadMessageResponseDataDto>>;
|
|
139
|
+
/**
|
|
140
|
+
*
|
|
141
|
+
* @param {SendMediaDataDto} body
|
|
142
|
+
* @param {string} apikey
|
|
143
|
+
* @param {*} [options] Override http request option.
|
|
144
|
+
* @throws {RequiredError}
|
|
145
|
+
*/
|
|
146
|
+
sendMediaMessage(body: SendMediaDataDto, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<SendMediaDataResponseDto>>;
|
|
121
147
|
/**
|
|
122
148
|
*
|
|
123
149
|
* @param {SendTemplateDataDto} body
|
|
@@ -161,6 +187,15 @@ export declare class MessagesApi extends BaseAPI {
|
|
|
161
187
|
* @memberof MessagesApi
|
|
162
188
|
*/
|
|
163
189
|
readMessage(body: ReadMessageDto, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ReadMessageResponseDataDto>>;
|
|
190
|
+
/**
|
|
191
|
+
*
|
|
192
|
+
* @param {SendMediaDataDto} body
|
|
193
|
+
* @param {string} apikey
|
|
194
|
+
* @param {*} [options] Override http request option.
|
|
195
|
+
* @throws {RequiredError}
|
|
196
|
+
* @memberof MessagesApi
|
|
197
|
+
*/
|
|
198
|
+
sendMediaMessage(body: SendMediaDataDto, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<SendMediaDataResponseDto>>;
|
|
164
199
|
/**
|
|
165
200
|
*
|
|
166
201
|
* @param {SendTemplateDataDto} body
|
|
@@ -135,6 +135,53 @@ const MessagesApiAxiosParamCreator = function (configuration) {
|
|
|
135
135
|
options: localVarRequestOptions,
|
|
136
136
|
};
|
|
137
137
|
}),
|
|
138
|
+
/**
|
|
139
|
+
*
|
|
140
|
+
* @param {SendMediaDataDto} body
|
|
141
|
+
* @param {string} apikey
|
|
142
|
+
* @param {*} [options] Override http request option.
|
|
143
|
+
* @throws {RequiredError}
|
|
144
|
+
*/
|
|
145
|
+
sendMediaMessage: (body_1, apikey_1, ...args_1) => __awaiter(this, [body_1, apikey_1, ...args_1], void 0, function* (body, apikey, options = {}) {
|
|
146
|
+
// verify required parameter 'body' is not null or undefined
|
|
147
|
+
if (body === null || body === undefined) {
|
|
148
|
+
throw new base_1.RequiredError('body', 'Required parameter body was null or undefined when calling sendMediaMessage.');
|
|
149
|
+
}
|
|
150
|
+
// verify required parameter 'apikey' is not null or undefined
|
|
151
|
+
if (apikey === null || apikey === undefined) {
|
|
152
|
+
throw new base_1.RequiredError('apikey', 'Required parameter apikey was null or undefined when calling sendMediaMessage.');
|
|
153
|
+
}
|
|
154
|
+
const localVarPath = `/api/messages/send-media`;
|
|
155
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
156
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
157
|
+
let baseOptions;
|
|
158
|
+
if (configuration) {
|
|
159
|
+
baseOptions = configuration.baseOptions;
|
|
160
|
+
}
|
|
161
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
162
|
+
const localVarHeaderParameter = {};
|
|
163
|
+
const localVarQueryParameter = {};
|
|
164
|
+
if (apikey !== undefined && apikey !== null) {
|
|
165
|
+
localVarHeaderParameter['apikey'] = String(apikey);
|
|
166
|
+
}
|
|
167
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
168
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
169
|
+
for (const key in localVarQueryParameter) {
|
|
170
|
+
query.set(key, localVarQueryParameter[key]);
|
|
171
|
+
}
|
|
172
|
+
for (const key in options.params) {
|
|
173
|
+
query.set(key, options.params[key]);
|
|
174
|
+
}
|
|
175
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
176
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
177
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
178
|
+
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
179
|
+
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
180
|
+
return {
|
|
181
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
182
|
+
options: localVarRequestOptions,
|
|
183
|
+
};
|
|
184
|
+
}),
|
|
138
185
|
/**
|
|
139
186
|
*
|
|
140
187
|
* @param {SendTemplateDataDto} body
|
|
@@ -271,6 +318,22 @@ const MessagesApiFp = function (configuration) {
|
|
|
271
318
|
};
|
|
272
319
|
});
|
|
273
320
|
},
|
|
321
|
+
/**
|
|
322
|
+
*
|
|
323
|
+
* @param {SendMediaDataDto} body
|
|
324
|
+
* @param {string} apikey
|
|
325
|
+
* @param {*} [options] Override http request option.
|
|
326
|
+
* @throws {RequiredError}
|
|
327
|
+
*/
|
|
328
|
+
sendMediaMessage(body, apikey, options) {
|
|
329
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
330
|
+
const localVarAxiosArgs = yield (0, exports.MessagesApiAxiosParamCreator)(configuration).sendMediaMessage(body, apikey, options);
|
|
331
|
+
return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
|
|
332
|
+
const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
|
|
333
|
+
return axios.request(axiosRequestArgs);
|
|
334
|
+
};
|
|
335
|
+
});
|
|
336
|
+
},
|
|
274
337
|
/**
|
|
275
338
|
*
|
|
276
339
|
* @param {SendTemplateDataDto} body
|
|
@@ -337,6 +400,18 @@ const MessagesApiFactory = function (configuration, basePath, axios) {
|
|
|
337
400
|
return (0, exports.MessagesApiFp)(configuration).readMessage(body, apikey, options).then((request) => request(axios, basePath));
|
|
338
401
|
});
|
|
339
402
|
},
|
|
403
|
+
/**
|
|
404
|
+
*
|
|
405
|
+
* @param {SendMediaDataDto} body
|
|
406
|
+
* @param {string} apikey
|
|
407
|
+
* @param {*} [options] Override http request option.
|
|
408
|
+
* @throws {RequiredError}
|
|
409
|
+
*/
|
|
410
|
+
sendMediaMessage(body, apikey, options) {
|
|
411
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
412
|
+
return (0, exports.MessagesApiFp)(configuration).sendMediaMessage(body, apikey, options).then((request) => request(axios, basePath));
|
|
413
|
+
});
|
|
414
|
+
},
|
|
340
415
|
/**
|
|
341
416
|
*
|
|
342
417
|
* @param {SendTemplateDataDto} body
|
|
@@ -398,6 +473,19 @@ class MessagesApi extends base_1.BaseAPI {
|
|
|
398
473
|
return (0, exports.MessagesApiFp)(this.configuration).readMessage(body, apikey, options).then((request) => request(this.axios, this.basePath));
|
|
399
474
|
});
|
|
400
475
|
}
|
|
476
|
+
/**
|
|
477
|
+
*
|
|
478
|
+
* @param {SendMediaDataDto} body
|
|
479
|
+
* @param {string} apikey
|
|
480
|
+
* @param {*} [options] Override http request option.
|
|
481
|
+
* @throws {RequiredError}
|
|
482
|
+
* @memberof MessagesApi
|
|
483
|
+
*/
|
|
484
|
+
sendMediaMessage(body, apikey, options) {
|
|
485
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
486
|
+
return (0, exports.MessagesApiFp)(this.configuration).sendMediaMessage(body, apikey, options).then((request) => request(this.axios, this.basePath));
|
|
487
|
+
});
|
|
488
|
+
}
|
|
401
489
|
/**
|
|
402
490
|
*
|
|
403
491
|
* @param {SendTemplateDataDto} body
|
|
@@ -13,6 +13,7 @@ import { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
|
13
13
|
import { Configuration } from '../configuration';
|
|
14
14
|
import { RequestArgs, BaseAPI } from '../base';
|
|
15
15
|
import { SessionResponseDataDto } from '../models';
|
|
16
|
+
import { SessionSummaryListResponseDataDto } from '../models';
|
|
16
17
|
import { SessionsResponseDataDto } from '../models';
|
|
17
18
|
/**
|
|
18
19
|
* SessionsApi - axios parameter creator
|
|
@@ -43,6 +44,15 @@ export declare const SessionsApiAxiosParamCreator: (configuration?: Configuratio
|
|
|
43
44
|
* @throws {RequiredError}
|
|
44
45
|
*/
|
|
45
46
|
getSessions: (branchId: number, apikey: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @param {number} cellphone
|
|
50
|
+
* @param {number} branchId
|
|
51
|
+
* @param {string} apikey
|
|
52
|
+
* @param {*} [options] Override http request option.
|
|
53
|
+
* @throws {RequiredError}
|
|
54
|
+
*/
|
|
55
|
+
getSessionsByCellphone: (cellphone: number, branchId: number, apikey: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
46
56
|
};
|
|
47
57
|
/**
|
|
48
58
|
* SessionsApi - functional programming interface
|
|
@@ -73,6 +83,15 @@ export declare const SessionsApiFp: (configuration?: Configuration) => {
|
|
|
73
83
|
* @throws {RequiredError}
|
|
74
84
|
*/
|
|
75
85
|
getSessions(branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<SessionsResponseDataDto>>>;
|
|
86
|
+
/**
|
|
87
|
+
*
|
|
88
|
+
* @param {number} cellphone
|
|
89
|
+
* @param {number} branchId
|
|
90
|
+
* @param {string} apikey
|
|
91
|
+
* @param {*} [options] Override http request option.
|
|
92
|
+
* @throws {RequiredError}
|
|
93
|
+
*/
|
|
94
|
+
getSessionsByCellphone(cellphone: number, branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<SessionSummaryListResponseDataDto>>>;
|
|
76
95
|
};
|
|
77
96
|
/**
|
|
78
97
|
* SessionsApi - factory interface
|
|
@@ -103,6 +122,15 @@ export declare const SessionsApiFactory: (configuration?: Configuration, basePat
|
|
|
103
122
|
* @throws {RequiredError}
|
|
104
123
|
*/
|
|
105
124
|
getSessions(branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<SessionsResponseDataDto>>;
|
|
125
|
+
/**
|
|
126
|
+
*
|
|
127
|
+
* @param {number} cellphone
|
|
128
|
+
* @param {number} branchId
|
|
129
|
+
* @param {string} apikey
|
|
130
|
+
* @param {*} [options] Override http request option.
|
|
131
|
+
* @throws {RequiredError}
|
|
132
|
+
*/
|
|
133
|
+
getSessionsByCellphone(cellphone: number, branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<SessionSummaryListResponseDataDto>>;
|
|
106
134
|
};
|
|
107
135
|
/**
|
|
108
136
|
* SessionsApi - object-oriented interface
|
|
@@ -138,4 +166,14 @@ export declare class SessionsApi extends BaseAPI {
|
|
|
138
166
|
* @memberof SessionsApi
|
|
139
167
|
*/
|
|
140
168
|
getSessions(branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<SessionsResponseDataDto>>;
|
|
169
|
+
/**
|
|
170
|
+
*
|
|
171
|
+
* @param {number} cellphone
|
|
172
|
+
* @param {number} branchId
|
|
173
|
+
* @param {string} apikey
|
|
174
|
+
* @param {*} [options] Override http request option.
|
|
175
|
+
* @throws {RequiredError}
|
|
176
|
+
* @memberof SessionsApi
|
|
177
|
+
*/
|
|
178
|
+
getSessionsByCellphone(cellphone: number, branchId: number, apikey: string, options?: AxiosRequestConfig): Promise<AxiosResponse<SessionSummaryListResponseDataDto>>;
|
|
141
179
|
}
|