@libgot/whatsapp-bridge-sdk 1.0.18 → 1.0.20

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 CHANGED
@@ -1,4 +1,4 @@
1
- ## @1.0.18
1
+ ## @1.0.20
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.18 --save
39
+ npm install @libgot/whatsapp-bridge-sdk@1.0.20 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -18,12 +18,61 @@ import { Configuration } from '../configuration';
18
18
  // @ts-ignore
19
19
  import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
20
20
  import { ContactsResponseDTO } from '../models';
21
+ import { WhatsappChatResponseDTO } from '../models';
21
22
  /**
22
23
  * ContactsApi - axios parameter creator
23
24
  * @export
24
25
  */
25
26
  export const ContactsApiAxiosParamCreator = function (configuration?: Configuration) {
26
27
  return {
28
+ /**
29
+ *
30
+ * @param {number} cellphone
31
+ * @param {number} branchId
32
+ * @param {*} [options] Override http request option.
33
+ * @throws {RequiredError}
34
+ */
35
+ getChatFromCellphone: async (cellphone: number, branchId: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
36
+ // verify required parameter 'cellphone' is not null or undefined
37
+ if (cellphone === null || cellphone === undefined) {
38
+ throw new RequiredError('cellphone','Required parameter cellphone was null or undefined when calling getChatFromCellphone.');
39
+ }
40
+ // verify required parameter 'branchId' is not null or undefined
41
+ if (branchId === null || branchId === undefined) {
42
+ throw new RequiredError('branchId','Required parameter branchId was null or undefined when calling getChatFromCellphone.');
43
+ }
44
+ const localVarPath = `/api/contacts/{cellphone}/chat`
45
+ .replace(`{${"cellphone"}}`, encodeURIComponent(String(cellphone)));
46
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
47
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
48
+ let baseOptions;
49
+ if (configuration) {
50
+ baseOptions = configuration.baseOptions;
51
+ }
52
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
53
+ const localVarHeaderParameter = {} as any;
54
+ const localVarQueryParameter = {} as any;
55
+
56
+ if (branchId !== undefined) {
57
+ localVarQueryParameter['branchId'] = branchId;
58
+ }
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
+
71
+ return {
72
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
73
+ options: localVarRequestOptions,
74
+ };
75
+ },
27
76
  /**
28
77
  *
29
78
  * @param {number} branchId
@@ -75,6 +124,20 @@ export const ContactsApiAxiosParamCreator = function (configuration?: Configurat
75
124
  */
76
125
  export const ContactsApiFp = function(configuration?: Configuration) {
77
126
  return {
127
+ /**
128
+ *
129
+ * @param {number} cellphone
130
+ * @param {number} branchId
131
+ * @param {*} [options] Override http request option.
132
+ * @throws {RequiredError}
133
+ */
134
+ async getChatFromCellphone(cellphone: number, branchId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<WhatsappChatResponseDTO>>> {
135
+ const localVarAxiosArgs = await ContactsApiAxiosParamCreator(configuration).getChatFromCellphone(cellphone, branchId, options);
136
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
137
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
138
+ return axios.request(axiosRequestArgs);
139
+ };
140
+ },
78
141
  /**
79
142
  *
80
143
  * @param {number} branchId
@@ -97,6 +160,16 @@ export const ContactsApiFp = function(configuration?: Configuration) {
97
160
  */
98
161
  export const ContactsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
99
162
  return {
163
+ /**
164
+ *
165
+ * @param {number} cellphone
166
+ * @param {number} branchId
167
+ * @param {*} [options] Override http request option.
168
+ * @throws {RequiredError}
169
+ */
170
+ async getChatFromCellphone(cellphone: number, branchId: number, options?: AxiosRequestConfig): Promise<AxiosResponse<WhatsappChatResponseDTO>> {
171
+ return ContactsApiFp(configuration).getChatFromCellphone(cellphone, branchId, options).then((request) => request(axios, basePath));
172
+ },
100
173
  /**
101
174
  *
102
175
  * @param {number} branchId
@@ -116,6 +189,17 @@ export const ContactsApiFactory = function (configuration?: Configuration, baseP
116
189
  * @extends {BaseAPI}
117
190
  */
118
191
  export class ContactsApi extends BaseAPI {
192
+ /**
193
+ *
194
+ * @param {number} cellphone
195
+ * @param {number} branchId
196
+ * @param {*} [options] Override http request option.
197
+ * @throws {RequiredError}
198
+ * @memberof ContactsApi
199
+ */
200
+ public async getChatFromCellphone(cellphone: number, branchId: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<WhatsappChatResponseDTO>> {
201
+ return ContactsApiFp(this.configuration).getChatFromCellphone(cellphone, branchId, options).then((request) => request(this.axios, this.basePath));
202
+ }
119
203
  /**
120
204
  *
121
205
  * @param {number} branchId
@@ -13,11 +13,20 @@ import { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
13
13
  import { Configuration } from '../configuration';
14
14
  import { RequestArgs, BaseAPI } from '../base';
15
15
  import { ContactsResponseDTO } from '../models';
16
+ import { WhatsappChatResponseDTO } from '../models';
16
17
  /**
17
18
  * ContactsApi - axios parameter creator
18
19
  * @export
19
20
  */
20
21
  export declare const ContactsApiAxiosParamCreator: (configuration?: Configuration) => {
22
+ /**
23
+ *
24
+ * @param {number} cellphone
25
+ * @param {number} branchId
26
+ * @param {*} [options] Override http request option.
27
+ * @throws {RequiredError}
28
+ */
29
+ getChatFromCellphone: (cellphone: number, branchId: number, options?: AxiosRequestConfig) => Promise<RequestArgs>;
21
30
  /**
22
31
  *
23
32
  * @param {number} branchId
@@ -31,6 +40,14 @@ export declare const ContactsApiAxiosParamCreator: (configuration?: Configuratio
31
40
  * @export
32
41
  */
33
42
  export declare const ContactsApiFp: (configuration?: Configuration) => {
43
+ /**
44
+ *
45
+ * @param {number} cellphone
46
+ * @param {number} branchId
47
+ * @param {*} [options] Override http request option.
48
+ * @throws {RequiredError}
49
+ */
50
+ getChatFromCellphone(cellphone: number, branchId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<WhatsappChatResponseDTO>>>;
34
51
  /**
35
52
  *
36
53
  * @param {number} branchId
@@ -44,6 +61,14 @@ export declare const ContactsApiFp: (configuration?: Configuration) => {
44
61
  * @export
45
62
  */
46
63
  export declare const ContactsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
64
+ /**
65
+ *
66
+ * @param {number} cellphone
67
+ * @param {number} branchId
68
+ * @param {*} [options] Override http request option.
69
+ * @throws {RequiredError}
70
+ */
71
+ getChatFromCellphone(cellphone: number, branchId: number, options?: AxiosRequestConfig): Promise<AxiosResponse<WhatsappChatResponseDTO>>;
47
72
  /**
48
73
  *
49
74
  * @param {number} branchId
@@ -59,6 +84,15 @@ export declare const ContactsApiFactory: (configuration?: Configuration, basePat
59
84
  * @extends {BaseAPI}
60
85
  */
61
86
  export declare class ContactsApi extends BaseAPI {
87
+ /**
88
+ *
89
+ * @param {number} cellphone
90
+ * @param {number} branchId
91
+ * @param {*} [options] Override http request option.
92
+ * @throws {RequiredError}
93
+ * @memberof ContactsApi
94
+ */
95
+ getChatFromCellphone(cellphone: number, branchId: number, options?: AxiosRequestConfig): Promise<AxiosResponse<WhatsappChatResponseDTO>>;
62
96
  /**
63
97
  *
64
98
  * @param {number} branchId
@@ -96,6 +96,59 @@ var base_1 = require("../base");
96
96
  var ContactsApiAxiosParamCreator = function (configuration) {
97
97
  var _this = this;
98
98
  return {
99
+ /**
100
+ *
101
+ * @param {number} cellphone
102
+ * @param {number} branchId
103
+ * @param {*} [options] Override http request option.
104
+ * @throws {RequiredError}
105
+ */
106
+ getChatFromCellphone: function (cellphone_1, branchId_1) {
107
+ var args_1 = [];
108
+ for (var _i = 2; _i < arguments.length; _i++) {
109
+ args_1[_i - 2] = arguments[_i];
110
+ }
111
+ return __awaiter(_this, __spreadArray([cellphone_1, branchId_1], args_1, true), void 0, function (cellphone, branchId, options) {
112
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, query, key, key, headersFromBaseOptions;
113
+ if (options === void 0) { options = {}; }
114
+ return __generator(this, function (_a) {
115
+ // verify required parameter 'cellphone' is not null or undefined
116
+ if (cellphone === null || cellphone === undefined) {
117
+ throw new base_1.RequiredError('cellphone', 'Required parameter cellphone was null or undefined when calling getChatFromCellphone.');
118
+ }
119
+ // verify required parameter 'branchId' is not null or undefined
120
+ if (branchId === null || branchId === undefined) {
121
+ throw new base_1.RequiredError('branchId', 'Required parameter branchId was null or undefined when calling getChatFromCellphone.');
122
+ }
123
+ localVarPath = "/api/contacts/{cellphone}/chat"
124
+ .replace("{".concat("cellphone", "}"), encodeURIComponent(String(cellphone)));
125
+ localVarUrlObj = new URL(localVarPath, 'https://example.com');
126
+ if (configuration) {
127
+ baseOptions = configuration.baseOptions;
128
+ }
129
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
130
+ localVarHeaderParameter = {};
131
+ localVarQueryParameter = {};
132
+ if (branchId !== undefined) {
133
+ localVarQueryParameter['branchId'] = branchId;
134
+ }
135
+ query = new URLSearchParams(localVarUrlObj.search);
136
+ for (key in localVarQueryParameter) {
137
+ query.set(key, localVarQueryParameter[key]);
138
+ }
139
+ for (key in options.params) {
140
+ query.set(key, options.params[key]);
141
+ }
142
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
143
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
144
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
145
+ return [2 /*return*/, {
146
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
147
+ options: localVarRequestOptions,
148
+ }];
149
+ });
150
+ });
151
+ },
99
152
  /**
100
153
  *
101
154
  * @param {number} branchId
@@ -152,6 +205,31 @@ exports.ContactsApiAxiosParamCreator = ContactsApiAxiosParamCreator;
152
205
  */
153
206
  var ContactsApiFp = function (configuration) {
154
207
  return {
208
+ /**
209
+ *
210
+ * @param {number} cellphone
211
+ * @param {number} branchId
212
+ * @param {*} [options] Override http request option.
213
+ * @throws {RequiredError}
214
+ */
215
+ getChatFromCellphone: function (cellphone, branchId, options) {
216
+ return __awaiter(this, void 0, void 0, function () {
217
+ var localVarAxiosArgs;
218
+ return __generator(this, function (_a) {
219
+ switch (_a.label) {
220
+ case 0: return [4 /*yield*/, (0, exports.ContactsApiAxiosParamCreator)(configuration).getChatFromCellphone(cellphone, branchId, options)];
221
+ case 1:
222
+ localVarAxiosArgs = _a.sent();
223
+ return [2 /*return*/, function (axios, basePath) {
224
+ if (axios === void 0) { axios = axios_1.default; }
225
+ if (basePath === void 0) { basePath = base_1.BASE_PATH; }
226
+ var axiosRequestArgs = __assign(__assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
227
+ return axios.request(axiosRequestArgs);
228
+ }];
229
+ }
230
+ });
231
+ });
232
+ },
155
233
  /**
156
234
  *
157
235
  * @param {number} branchId
@@ -185,6 +263,20 @@ exports.ContactsApiFp = ContactsApiFp;
185
263
  */
186
264
  var ContactsApiFactory = function (configuration, basePath, axios) {
187
265
  return {
266
+ /**
267
+ *
268
+ * @param {number} cellphone
269
+ * @param {number} branchId
270
+ * @param {*} [options] Override http request option.
271
+ * @throws {RequiredError}
272
+ */
273
+ getChatFromCellphone: function (cellphone, branchId, options) {
274
+ return __awaiter(this, void 0, void 0, function () {
275
+ return __generator(this, function (_a) {
276
+ return [2 /*return*/, (0, exports.ContactsApiFp)(configuration).getChatFromCellphone(cellphone, branchId, options).then(function (request) { return request(axios, basePath); })];
277
+ });
278
+ });
279
+ },
188
280
  /**
189
281
  *
190
282
  * @param {number} branchId
@@ -212,6 +304,22 @@ var ContactsApi = /** @class */ (function (_super) {
212
304
  function ContactsApi() {
213
305
  return _super !== null && _super.apply(this, arguments) || this;
214
306
  }
307
+ /**
308
+ *
309
+ * @param {number} cellphone
310
+ * @param {number} branchId
311
+ * @param {*} [options] Override http request option.
312
+ * @throws {RequiredError}
313
+ * @memberof ContactsApi
314
+ */
315
+ ContactsApi.prototype.getChatFromCellphone = function (cellphone, branchId, options) {
316
+ return __awaiter(this, void 0, void 0, function () {
317
+ var _this = this;
318
+ return __generator(this, function (_a) {
319
+ return [2 /*return*/, (0, exports.ContactsApiFp)(this.configuration).getChatFromCellphone(cellphone, branchId, options).then(function (request) { return request(_this.axios, _this.basePath); })];
320
+ });
321
+ });
322
+ };
215
323
  /**
216
324
  *
217
325
  * @param {number} branchId
@@ -16,6 +16,12 @@
16
16
  * @interface SendTextDto
17
17
  */
18
18
  export interface SendTextDto {
19
+ /**
20
+ * @type {number}
21
+ * @memberof SendTextDto
22
+ * @example 1
23
+ */
24
+ branchId: number;
19
25
  /**
20
26
  * @type {number}
21
27
  * @memberof SendTextDto
@@ -28,4 +34,10 @@ export interface SendTextDto {
28
34
  * @example texto de envio
29
35
  */
30
36
  text: string;
37
+ /**
38
+ * @type {number}
39
+ * @memberof SendTextDto
40
+ * @example 3814652933
41
+ */
42
+ cellphone: number;
31
43
  }
@@ -20,6 +20,13 @@
20
20
  */
21
21
  export interface SendTextDto {
22
22
 
23
+ /**
24
+ * @type {number}
25
+ * @memberof SendTextDto
26
+ * @example 1
27
+ */
28
+ branchId: number;
29
+
23
30
  /**
24
31
  * @type {number}
25
32
  * @memberof SendTextDto
@@ -33,4 +40,11 @@ export interface SendTextDto {
33
40
  * @example texto de envio
34
41
  */
35
42
  text: string;
43
+
44
+ /**
45
+ * @type {number}
46
+ * @memberof SendTextDto
47
+ * @example 3814652933
48
+ */
49
+ cellphone: number;
36
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libgot/whatsapp-bridge-sdk",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "description": "OpenAPI client for ",
5
5
  "author": "OpenAPI-Generator Contributors",
6
6
  "keywords": [