@libgot/whatsapp-bridge-sdk 1.0.32 → 1.0.33

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.
@@ -12,32 +12,6 @@
12
12
  * https://github.com/swagger-api/swagger-codegen.git
13
13
  * Do not edit the class manually.
14
14
  */
15
- var __extends = (this && this.__extends) || (function () {
16
- var extendStatics = function (d, b) {
17
- extendStatics = Object.setPrototypeOf ||
18
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
- return extendStatics(d, b);
21
- };
22
- return function (d, b) {
23
- if (typeof b !== "function" && b !== null)
24
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
- extendStatics(d, b);
26
- function __() { this.constructor = d; }
27
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
- };
29
- })();
30
- var __assign = (this && this.__assign) || function () {
31
- __assign = Object.assign || function(t) {
32
- for (var s, i = 1, n = arguments.length; i < n; i++) {
33
- s = arguments[i];
34
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
35
- t[p] = s[p];
36
- }
37
- return t;
38
- };
39
- return __assign.apply(this, arguments);
40
- };
41
15
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
42
16
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
43
17
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -47,54 +21,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
47
21
  step((generator = generator.apply(thisArg, _arguments || [])).next());
48
22
  });
49
23
  };
50
- var __generator = (this && this.__generator) || function (thisArg, body) {
51
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
52
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
- function verb(n) { return function (v) { return step([n, v]); }; }
54
- function step(op) {
55
- if (f) throw new TypeError("Generator is already executing.");
56
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
57
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
- if (y = 0, t) op = [op[0] & 2, t.value];
59
- switch (op[0]) {
60
- case 0: case 1: t = op; break;
61
- case 4: _.label++; return { value: op[1], done: false };
62
- case 5: _.label++; y = op[1]; op = [0]; continue;
63
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
64
- default:
65
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
66
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
67
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
68
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
69
- if (t[2]) _.ops.pop();
70
- _.trys.pop(); continue;
71
- }
72
- op = body.call(thisArg, _);
73
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
74
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
- }
76
- };
77
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
78
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
79
- if (ar || !(i in from)) {
80
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
81
- ar[i] = from[i];
82
- }
83
- }
84
- return to.concat(ar || Array.prototype.slice.call(from));
85
- };
86
24
  Object.defineProperty(exports, "__esModule", { value: true });
87
25
  exports.ContactsApi = exports.ContactsApiFactory = exports.ContactsApiFp = exports.ContactsApiAxiosParamCreator = void 0;
88
- var axios_1 = require("axios");
26
+ const axios_1 = require("axios");
89
27
  // Some imports not used depending on template conditions
90
28
  // @ts-ignore
91
- var base_1 = require("../base");
29
+ const base_1 = require("../base");
92
30
  /**
93
31
  * ContactsApi - axios parameter creator
94
32
  * @export
95
33
  */
96
- var ContactsApiAxiosParamCreator = function (configuration) {
97
- var _this = this;
34
+ const ContactsApiAxiosParamCreator = function (configuration) {
98
35
  return {
99
36
  /**
100
37
  *
@@ -103,99 +40,83 @@ var ContactsApiAxiosParamCreator = function (configuration) {
103
40
  * @param {*} [options] Override http request option.
104
41
  * @throws {RequiredError}
105
42
  */
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];
43
+ getChatFromCellphone: (cellphone_1, branchId_1, ...args_1) => __awaiter(this, [cellphone_1, branchId_1, ...args_1], void 0, function* (cellphone, branchId, options = {}) {
44
+ // verify required parameter 'cellphone' is not null or undefined
45
+ if (cellphone === null || cellphone === undefined) {
46
+ throw new base_1.RequiredError('cellphone', 'Required parameter cellphone was null or undefined when calling getChatFromCellphone.');
110
47
  }
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
- },
48
+ // verify required parameter 'branchId' is not null or undefined
49
+ if (branchId === null || branchId === undefined) {
50
+ throw new base_1.RequiredError('branchId', 'Required parameter branchId was null or undefined when calling getChatFromCellphone.');
51
+ }
52
+ const localVarPath = `/api/contacts/{cellphone}/chat`
53
+ .replace(`{${"cellphone"}}`, encodeURIComponent(String(cellphone)));
54
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
55
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
56
+ let baseOptions;
57
+ if (configuration) {
58
+ baseOptions = configuration.baseOptions;
59
+ }
60
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
61
+ const localVarHeaderParameter = {};
62
+ const localVarQueryParameter = {};
63
+ if (branchId !== undefined) {
64
+ localVarQueryParameter['branchId'] = branchId;
65
+ }
66
+ const query = new URLSearchParams(localVarUrlObj.search);
67
+ for (const key in localVarQueryParameter) {
68
+ query.set(key, localVarQueryParameter[key]);
69
+ }
70
+ for (const key in options.params) {
71
+ query.set(key, options.params[key]);
72
+ }
73
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
74
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
75
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
76
+ return {
77
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
78
+ options: localVarRequestOptions,
79
+ };
80
+ }),
152
81
  /**
153
82
  *
154
83
  * @param {number} branchId
155
84
  * @param {*} [options] Override http request option.
156
85
  * @throws {RequiredError}
157
86
  */
158
- getContacts: function (branchId_1) {
159
- var args_1 = [];
160
- for (var _i = 1; _i < arguments.length; _i++) {
161
- args_1[_i - 1] = arguments[_i];
87
+ getContacts: (branchId_1, ...args_1) => __awaiter(this, [branchId_1, ...args_1], void 0, function* (branchId, options = {}) {
88
+ // verify required parameter 'branchId' is not null or undefined
89
+ if (branchId === null || branchId === undefined) {
90
+ throw new base_1.RequiredError('branchId', 'Required parameter branchId was null or undefined when calling getContacts.');
162
91
  }
163
- return __awaiter(_this, __spreadArray([branchId_1], args_1, true), void 0, function (branchId, options) {
164
- var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, query, key, key, headersFromBaseOptions;
165
- if (options === void 0) { options = {}; }
166
- return __generator(this, function (_a) {
167
- // verify required parameter 'branchId' is not null or undefined
168
- if (branchId === null || branchId === undefined) {
169
- throw new base_1.RequiredError('branchId', 'Required parameter branchId was null or undefined when calling getContacts.');
170
- }
171
- localVarPath = "/api/contacts";
172
- localVarUrlObj = new URL(localVarPath, 'https://example.com');
173
- if (configuration) {
174
- baseOptions = configuration.baseOptions;
175
- }
176
- localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
177
- localVarHeaderParameter = {};
178
- localVarQueryParameter = {};
179
- if (branchId !== undefined) {
180
- localVarQueryParameter['branchId'] = branchId;
181
- }
182
- query = new URLSearchParams(localVarUrlObj.search);
183
- for (key in localVarQueryParameter) {
184
- query.set(key, localVarQueryParameter[key]);
185
- }
186
- for (key in options.params) {
187
- query.set(key, options.params[key]);
188
- }
189
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
190
- headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
191
- localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
192
- return [2 /*return*/, {
193
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
194
- options: localVarRequestOptions,
195
- }];
196
- });
197
- });
198
- },
92
+ const localVarPath = `/api/contacts`;
93
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
94
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
95
+ let baseOptions;
96
+ if (configuration) {
97
+ baseOptions = configuration.baseOptions;
98
+ }
99
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
100
+ const localVarHeaderParameter = {};
101
+ const localVarQueryParameter = {};
102
+ if (branchId !== undefined) {
103
+ localVarQueryParameter['branchId'] = branchId;
104
+ }
105
+ const query = new URLSearchParams(localVarUrlObj.search);
106
+ for (const key in localVarQueryParameter) {
107
+ query.set(key, localVarQueryParameter[key]);
108
+ }
109
+ for (const key in options.params) {
110
+ query.set(key, options.params[key]);
111
+ }
112
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
113
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
114
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
115
+ return {
116
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
117
+ options: localVarRequestOptions,
118
+ };
119
+ }),
199
120
  };
200
121
  };
201
122
  exports.ContactsApiAxiosParamCreator = ContactsApiAxiosParamCreator;
@@ -203,7 +124,7 @@ exports.ContactsApiAxiosParamCreator = ContactsApiAxiosParamCreator;
203
124
  * ContactsApi - functional programming interface
204
125
  * @export
205
126
  */
206
- var ContactsApiFp = function (configuration) {
127
+ const ContactsApiFp = function (configuration) {
207
128
  return {
208
129
  /**
209
130
  *
@@ -212,22 +133,13 @@ var ContactsApiFp = function (configuration) {
212
133
  * @param {*} [options] Override http request option.
213
134
  * @throws {RequiredError}
214
135
  */
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
- });
136
+ getChatFromCellphone(cellphone, branchId, options) {
137
+ return __awaiter(this, void 0, void 0, function* () {
138
+ const localVarAxiosArgs = yield (0, exports.ContactsApiAxiosParamCreator)(configuration).getChatFromCellphone(cellphone, branchId, options);
139
+ return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
140
+ const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
141
+ return axios.request(axiosRequestArgs);
142
+ };
231
143
  });
232
144
  },
233
145
  /**
@@ -236,22 +148,13 @@ var ContactsApiFp = function (configuration) {
236
148
  * @param {*} [options] Override http request option.
237
149
  * @throws {RequiredError}
238
150
  */
239
- getContacts: function (branchId, options) {
240
- return __awaiter(this, void 0, void 0, function () {
241
- var localVarAxiosArgs;
242
- return __generator(this, function (_a) {
243
- switch (_a.label) {
244
- case 0: return [4 /*yield*/, (0, exports.ContactsApiAxiosParamCreator)(configuration).getContacts(branchId, options)];
245
- case 1:
246
- localVarAxiosArgs = _a.sent();
247
- return [2 /*return*/, function (axios, basePath) {
248
- if (axios === void 0) { axios = axios_1.default; }
249
- if (basePath === void 0) { basePath = base_1.BASE_PATH; }
250
- var axiosRequestArgs = __assign(__assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
251
- return axios.request(axiosRequestArgs);
252
- }];
253
- }
254
- });
151
+ getContacts(branchId, options) {
152
+ return __awaiter(this, void 0, void 0, function* () {
153
+ const localVarAxiosArgs = yield (0, exports.ContactsApiAxiosParamCreator)(configuration).getContacts(branchId, options);
154
+ return (axios = axios_1.default, basePath = base_1.BASE_PATH) => {
155
+ const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
156
+ return axios.request(axiosRequestArgs);
157
+ };
255
158
  });
256
159
  },
257
160
  };
@@ -261,7 +164,7 @@ exports.ContactsApiFp = ContactsApiFp;
261
164
  * ContactsApi - factory interface
262
165
  * @export
263
166
  */
264
- var ContactsApiFactory = function (configuration, basePath, axios) {
167
+ const ContactsApiFactory = function (configuration, basePath, axios) {
265
168
  return {
266
169
  /**
267
170
  *
@@ -270,11 +173,9 @@ var ContactsApiFactory = function (configuration, basePath, axios) {
270
173
  * @param {*} [options] Override http request option.
271
174
  * @throws {RequiredError}
272
175
  */
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
- });
176
+ getChatFromCellphone(cellphone, branchId, options) {
177
+ return __awaiter(this, void 0, void 0, function* () {
178
+ return (0, exports.ContactsApiFp)(configuration).getChatFromCellphone(cellphone, branchId, options).then((request) => request(axios, basePath));
278
179
  });
279
180
  },
280
181
  /**
@@ -283,11 +184,9 @@ var ContactsApiFactory = function (configuration, basePath, axios) {
283
184
  * @param {*} [options] Override http request option.
284
185
  * @throws {RequiredError}
285
186
  */
286
- getContacts: function (branchId, options) {
287
- return __awaiter(this, void 0, void 0, function () {
288
- return __generator(this, function (_a) {
289
- return [2 /*return*/, (0, exports.ContactsApiFp)(configuration).getContacts(branchId, options).then(function (request) { return request(axios, basePath); })];
290
- });
187
+ getContacts(branchId, options) {
188
+ return __awaiter(this, void 0, void 0, function* () {
189
+ return (0, exports.ContactsApiFp)(configuration).getContacts(branchId, options).then((request) => request(axios, basePath));
291
190
  });
292
191
  },
293
192
  };
@@ -299,11 +198,7 @@ exports.ContactsApiFactory = ContactsApiFactory;
299
198
  * @class ContactsApi
300
199
  * @extends {BaseAPI}
301
200
  */
302
- var ContactsApi = /** @class */ (function (_super) {
303
- __extends(ContactsApi, _super);
304
- function ContactsApi() {
305
- return _super !== null && _super.apply(this, arguments) || this;
306
- }
201
+ class ContactsApi extends base_1.BaseAPI {
307
202
  /**
308
203
  *
309
204
  * @param {number} cellphone
@@ -312,14 +207,11 @@ var ContactsApi = /** @class */ (function (_super) {
312
207
  * @throws {RequiredError}
313
208
  * @memberof ContactsApi
314
209
  */
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
- });
210
+ getChatFromCellphone(cellphone, branchId, options) {
211
+ return __awaiter(this, void 0, void 0, function* () {
212
+ return (0, exports.ContactsApiFp)(this.configuration).getChatFromCellphone(cellphone, branchId, options).then((request) => request(this.axios, this.basePath));
321
213
  });
322
- };
214
+ }
323
215
  /**
324
216
  *
325
217
  * @param {number} branchId
@@ -327,14 +219,10 @@ var ContactsApi = /** @class */ (function (_super) {
327
219
  * @throws {RequiredError}
328
220
  * @memberof ContactsApi
329
221
  */
330
- ContactsApi.prototype.getContacts = function (branchId, options) {
331
- return __awaiter(this, void 0, void 0, function () {
332
- var _this = this;
333
- return __generator(this, function (_a) {
334
- return [2 /*return*/, (0, exports.ContactsApiFp)(this.configuration).getContacts(branchId, options).then(function (request) { return request(_this.axios, _this.basePath); })];
335
- });
222
+ getContacts(branchId, options) {
223
+ return __awaiter(this, void 0, void 0, function* () {
224
+ return (0, exports.ContactsApiFp)(this.configuration).getContacts(branchId, options).then((request) => request(this.axios, this.basePath));
336
225
  });
337
- };
338
- return ContactsApi;
339
- }(base_1.BaseAPI));
226
+ }
227
+ }
340
228
  exports.ContactsApi = ContactsApi;