@libgot/whatsapp-bridge-sdk 1.0.16 → 1.0.18
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 +2 -2
- package/apis/messages-api.ts +19 -7
- package/dist/apis/messages-api.d.ts +8 -4
- package/dist/apis/messages-api.js +21 -10
- package/dist/models/read-message-dto.d.ts +10 -0
- package/models/read-message-dto.ts +12 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @1.0.
|
|
1
|
+
## @1.0.18
|
|
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,7 +36,7 @@ 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.
|
|
39
|
+
npm install @libgot/whatsapp-bridge-sdk@1.0.18 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
package/apis/messages-api.ts
CHANGED
|
@@ -30,11 +30,16 @@ export const MessagesApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
30
30
|
return {
|
|
31
31
|
/**
|
|
32
32
|
*
|
|
33
|
+
* @param {number} branchId
|
|
33
34
|
* @param {number} chatId
|
|
34
35
|
* @param {*} [options] Override http request option.
|
|
35
36
|
* @throws {RequiredError}
|
|
36
37
|
*/
|
|
37
|
-
getMessages: async (chatId: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
38
|
+
getMessages: async (branchId: number, chatId: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
39
|
+
// verify required parameter 'branchId' is not null or undefined
|
|
40
|
+
if (branchId === null || branchId === undefined) {
|
|
41
|
+
throw new RequiredError('branchId','Required parameter branchId was null or undefined when calling getMessages.');
|
|
42
|
+
}
|
|
38
43
|
// verify required parameter 'chatId' is not null or undefined
|
|
39
44
|
if (chatId === null || chatId === undefined) {
|
|
40
45
|
throw new RequiredError('chatId','Required parameter chatId was null or undefined when calling getMessages.');
|
|
@@ -50,6 +55,10 @@ export const MessagesApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
50
55
|
const localVarHeaderParameter = {} as any;
|
|
51
56
|
const localVarQueryParameter = {} as any;
|
|
52
57
|
|
|
58
|
+
if (branchId !== undefined) {
|
|
59
|
+
localVarQueryParameter['branchId'] = branchId;
|
|
60
|
+
}
|
|
61
|
+
|
|
53
62
|
if (chatId !== undefined) {
|
|
54
63
|
localVarQueryParameter['chatId'] = chatId;
|
|
55
64
|
}
|
|
@@ -165,12 +174,13 @@ export const MessagesApiFp = function(configuration?: Configuration) {
|
|
|
165
174
|
return {
|
|
166
175
|
/**
|
|
167
176
|
*
|
|
177
|
+
* @param {number} branchId
|
|
168
178
|
* @param {number} chatId
|
|
169
179
|
* @param {*} [options] Override http request option.
|
|
170
180
|
* @throws {RequiredError}
|
|
171
181
|
*/
|
|
172
|
-
async getMessages(chatId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<MessageResponseDto>>> {
|
|
173
|
-
const localVarAxiosArgs = await MessagesApiAxiosParamCreator(configuration).getMessages(chatId, options);
|
|
182
|
+
async getMessages(branchId: number, chatId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<MessageResponseDto>>> {
|
|
183
|
+
const localVarAxiosArgs = await MessagesApiAxiosParamCreator(configuration).getMessages(branchId, chatId, options);
|
|
174
184
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
175
185
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
176
186
|
return axios.request(axiosRequestArgs);
|
|
@@ -213,12 +223,13 @@ export const MessagesApiFactory = function (configuration?: Configuration, baseP
|
|
|
213
223
|
return {
|
|
214
224
|
/**
|
|
215
225
|
*
|
|
226
|
+
* @param {number} branchId
|
|
216
227
|
* @param {number} chatId
|
|
217
228
|
* @param {*} [options] Override http request option.
|
|
218
229
|
* @throws {RequiredError}
|
|
219
230
|
*/
|
|
220
|
-
async getMessages(chatId: number, options?: AxiosRequestConfig): Promise<AxiosResponse<MessageResponseDto>> {
|
|
221
|
-
return MessagesApiFp(configuration).getMessages(chatId, options).then((request) => request(axios, basePath));
|
|
231
|
+
async getMessages(branchId: number, chatId: number, options?: AxiosRequestConfig): Promise<AxiosResponse<MessageResponseDto>> {
|
|
232
|
+
return MessagesApiFp(configuration).getMessages(branchId, chatId, options).then((request) => request(axios, basePath));
|
|
222
233
|
},
|
|
223
234
|
/**
|
|
224
235
|
*
|
|
@@ -250,13 +261,14 @@ export const MessagesApiFactory = function (configuration?: Configuration, baseP
|
|
|
250
261
|
export class MessagesApi extends BaseAPI {
|
|
251
262
|
/**
|
|
252
263
|
*
|
|
264
|
+
* @param {number} branchId
|
|
253
265
|
* @param {number} chatId
|
|
254
266
|
* @param {*} [options] Override http request option.
|
|
255
267
|
* @throws {RequiredError}
|
|
256
268
|
* @memberof MessagesApi
|
|
257
269
|
*/
|
|
258
|
-
public async getMessages(chatId: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<MessageResponseDto>> {
|
|
259
|
-
return MessagesApiFp(this.configuration).getMessages(chatId, options).then((request) => request(this.axios, this.basePath));
|
|
270
|
+
public async getMessages(branchId: number, chatId: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<MessageResponseDto>> {
|
|
271
|
+
return MessagesApiFp(this.configuration).getMessages(branchId, chatId, options).then((request) => request(this.axios, this.basePath));
|
|
260
272
|
}
|
|
261
273
|
/**
|
|
262
274
|
*
|
|
@@ -24,11 +24,12 @@ import { SendTextDto } from '../models';
|
|
|
24
24
|
export declare const MessagesApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
27
|
+
* @param {number} branchId
|
|
27
28
|
* @param {number} chatId
|
|
28
29
|
* @param {*} [options] Override http request option.
|
|
29
30
|
* @throws {RequiredError}
|
|
30
31
|
*/
|
|
31
|
-
getMessages: (chatId: number, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
32
|
+
getMessages: (branchId: number, chatId: number, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
32
33
|
/**
|
|
33
34
|
*
|
|
34
35
|
* @param {ReadMessageDto} body
|
|
@@ -51,11 +52,12 @@ export declare const MessagesApiAxiosParamCreator: (configuration?: Configuratio
|
|
|
51
52
|
export declare const MessagesApiFp: (configuration?: Configuration) => {
|
|
52
53
|
/**
|
|
53
54
|
*
|
|
55
|
+
* @param {number} branchId
|
|
54
56
|
* @param {number} chatId
|
|
55
57
|
* @param {*} [options] Override http request option.
|
|
56
58
|
* @throws {RequiredError}
|
|
57
59
|
*/
|
|
58
|
-
getMessages(chatId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<MessageResponseDto>>>;
|
|
60
|
+
getMessages(branchId: number, chatId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<MessageResponseDto>>>;
|
|
59
61
|
/**
|
|
60
62
|
*
|
|
61
63
|
* @param {ReadMessageDto} body
|
|
@@ -78,11 +80,12 @@ export declare const MessagesApiFp: (configuration?: Configuration) => {
|
|
|
78
80
|
export declare const MessagesApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
79
81
|
/**
|
|
80
82
|
*
|
|
83
|
+
* @param {number} branchId
|
|
81
84
|
* @param {number} chatId
|
|
82
85
|
* @param {*} [options] Override http request option.
|
|
83
86
|
* @throws {RequiredError}
|
|
84
87
|
*/
|
|
85
|
-
getMessages(chatId: number, options?: AxiosRequestConfig): Promise<AxiosResponse<MessageResponseDto>>;
|
|
88
|
+
getMessages(branchId: number, chatId: number, options?: AxiosRequestConfig): Promise<AxiosResponse<MessageResponseDto>>;
|
|
86
89
|
/**
|
|
87
90
|
*
|
|
88
91
|
* @param {ReadMessageDto} body
|
|
@@ -107,12 +110,13 @@ export declare const MessagesApiFactory: (configuration?: Configuration, basePat
|
|
|
107
110
|
export declare class MessagesApi extends BaseAPI {
|
|
108
111
|
/**
|
|
109
112
|
*
|
|
113
|
+
* @param {number} branchId
|
|
110
114
|
* @param {number} chatId
|
|
111
115
|
* @param {*} [options] Override http request option.
|
|
112
116
|
* @throws {RequiredError}
|
|
113
117
|
* @memberof MessagesApi
|
|
114
118
|
*/
|
|
115
|
-
getMessages(chatId: number, options?: AxiosRequestConfig): Promise<AxiosResponse<MessageResponseDto>>;
|
|
119
|
+
getMessages(branchId: number, chatId: number, options?: AxiosRequestConfig): Promise<AxiosResponse<MessageResponseDto>>;
|
|
116
120
|
/**
|
|
117
121
|
*
|
|
118
122
|
* @param {ReadMessageDto} body
|
|
@@ -98,19 +98,24 @@ var MessagesApiAxiosParamCreator = function (configuration) {
|
|
|
98
98
|
return {
|
|
99
99
|
/**
|
|
100
100
|
*
|
|
101
|
+
* @param {number} branchId
|
|
101
102
|
* @param {number} chatId
|
|
102
103
|
* @param {*} [options] Override http request option.
|
|
103
104
|
* @throws {RequiredError}
|
|
104
105
|
*/
|
|
105
|
-
getMessages: function (chatId_1) {
|
|
106
|
+
getMessages: function (branchId_1, chatId_1) {
|
|
106
107
|
var args_1 = [];
|
|
107
|
-
for (var _i =
|
|
108
|
-
args_1[_i -
|
|
108
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
109
|
+
args_1[_i - 2] = arguments[_i];
|
|
109
110
|
}
|
|
110
|
-
return __awaiter(_this, __spreadArray([chatId_1], args_1, true), void 0, function (chatId, options) {
|
|
111
|
+
return __awaiter(_this, __spreadArray([branchId_1, chatId_1], args_1, true), void 0, function (branchId, chatId, options) {
|
|
111
112
|
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, query, key, key, headersFromBaseOptions;
|
|
112
113
|
if (options === void 0) { options = {}; }
|
|
113
114
|
return __generator(this, function (_a) {
|
|
115
|
+
// verify required parameter 'branchId' is not null or undefined
|
|
116
|
+
if (branchId === null || branchId === undefined) {
|
|
117
|
+
throw new base_1.RequiredError('branchId', 'Required parameter branchId was null or undefined when calling getMessages.');
|
|
118
|
+
}
|
|
114
119
|
// verify required parameter 'chatId' is not null or undefined
|
|
115
120
|
if (chatId === null || chatId === undefined) {
|
|
116
121
|
throw new base_1.RequiredError('chatId', 'Required parameter chatId was null or undefined when calling getMessages.');
|
|
@@ -123,6 +128,9 @@ var MessagesApiAxiosParamCreator = function (configuration) {
|
|
|
123
128
|
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
|
124
129
|
localVarHeaderParameter = {};
|
|
125
130
|
localVarQueryParameter = {};
|
|
131
|
+
if (branchId !== undefined) {
|
|
132
|
+
localVarQueryParameter['branchId'] = branchId;
|
|
133
|
+
}
|
|
126
134
|
if (chatId !== undefined) {
|
|
127
135
|
localVarQueryParameter['chatId'] = chatId;
|
|
128
136
|
}
|
|
@@ -248,16 +256,17 @@ var MessagesApiFp = function (configuration) {
|
|
|
248
256
|
return {
|
|
249
257
|
/**
|
|
250
258
|
*
|
|
259
|
+
* @param {number} branchId
|
|
251
260
|
* @param {number} chatId
|
|
252
261
|
* @param {*} [options] Override http request option.
|
|
253
262
|
* @throws {RequiredError}
|
|
254
263
|
*/
|
|
255
|
-
getMessages: function (chatId, options) {
|
|
264
|
+
getMessages: function (branchId, chatId, options) {
|
|
256
265
|
return __awaiter(this, void 0, void 0, function () {
|
|
257
266
|
var localVarAxiosArgs;
|
|
258
267
|
return __generator(this, function (_a) {
|
|
259
268
|
switch (_a.label) {
|
|
260
|
-
case 0: return [4 /*yield*/, (0, exports.MessagesApiAxiosParamCreator)(configuration).getMessages(chatId, options)];
|
|
269
|
+
case 0: return [4 /*yield*/, (0, exports.MessagesApiAxiosParamCreator)(configuration).getMessages(branchId, chatId, options)];
|
|
261
270
|
case 1:
|
|
262
271
|
localVarAxiosArgs = _a.sent();
|
|
263
272
|
return [2 /*return*/, function (axios, basePath) {
|
|
@@ -329,14 +338,15 @@ var MessagesApiFactory = function (configuration, basePath, axios) {
|
|
|
329
338
|
return {
|
|
330
339
|
/**
|
|
331
340
|
*
|
|
341
|
+
* @param {number} branchId
|
|
332
342
|
* @param {number} chatId
|
|
333
343
|
* @param {*} [options] Override http request option.
|
|
334
344
|
* @throws {RequiredError}
|
|
335
345
|
*/
|
|
336
|
-
getMessages: function (chatId, options) {
|
|
346
|
+
getMessages: function (branchId, chatId, options) {
|
|
337
347
|
return __awaiter(this, void 0, void 0, function () {
|
|
338
348
|
return __generator(this, function (_a) {
|
|
339
|
-
return [2 /*return*/, (0, exports.MessagesApiFp)(configuration).getMessages(chatId, options).then(function (request) { return request(axios, basePath); })];
|
|
349
|
+
return [2 /*return*/, (0, exports.MessagesApiFp)(configuration).getMessages(branchId, chatId, options).then(function (request) { return request(axios, basePath); })];
|
|
340
350
|
});
|
|
341
351
|
});
|
|
342
352
|
},
|
|
@@ -382,16 +392,17 @@ var MessagesApi = /** @class */ (function (_super) {
|
|
|
382
392
|
}
|
|
383
393
|
/**
|
|
384
394
|
*
|
|
395
|
+
* @param {number} branchId
|
|
385
396
|
* @param {number} chatId
|
|
386
397
|
* @param {*} [options] Override http request option.
|
|
387
398
|
* @throws {RequiredError}
|
|
388
399
|
* @memberof MessagesApi
|
|
389
400
|
*/
|
|
390
|
-
MessagesApi.prototype.getMessages = function (chatId, options) {
|
|
401
|
+
MessagesApi.prototype.getMessages = function (branchId, chatId, options) {
|
|
391
402
|
return __awaiter(this, void 0, void 0, function () {
|
|
392
403
|
var _this = this;
|
|
393
404
|
return __generator(this, function (_a) {
|
|
394
|
-
return [2 /*return*/, (0, exports.MessagesApiFp)(this.configuration).getMessages(chatId, options).then(function (request) { return request(_this.axios, _this.basePath); })];
|
|
405
|
+
return [2 /*return*/, (0, exports.MessagesApiFp)(this.configuration).getMessages(branchId, chatId, options).then(function (request) { return request(_this.axios, _this.basePath); })];
|
|
395
406
|
});
|
|
396
407
|
});
|
|
397
408
|
};
|
|
@@ -19,4 +19,16 @@
|
|
|
19
19
|
* @interface ReadMessageDto
|
|
20
20
|
*/
|
|
21
21
|
export interface ReadMessageDto {
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof ReadMessageDto
|
|
26
|
+
*/
|
|
27
|
+
chatId: number;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @type {number}
|
|
31
|
+
* @memberof ReadMessageDto
|
|
32
|
+
*/
|
|
33
|
+
branchId: number;
|
|
22
34
|
}
|