@libgot/whatsapp-bridge-sdk 1.0.1 → 1.0.3
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/dist/api.d.ts +16 -0
- package/dist/api.js +30 -0
- package/dist/apis/auth-api.d.ts +121 -0
- package/dist/apis/auth-api.js +418 -0
- package/dist/apis/contacts-api.d.ts +66 -0
- package/dist/apis/contacts-api.js +203 -0
- package/dist/apis/default-api.d.ts +90 -0
- package/dist/apis/default-api.js +287 -0
- package/dist/apis/healthchecks-api.d.ts +90 -0
- package/dist/apis/healthchecks-api.js +287 -0
- package/dist/apis/users-api.d.ts +179 -0
- package/dist/apis/users-api.js +586 -0
- package/dist/base.d.ts +55 -0
- package/dist/base.js +80 -0
- package/dist/configuration.d.ts +65 -0
- package/dist/configuration.js +29 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +28 -0
- package/dist/models/api-request-user-update-password-dto.d.ts +25 -0
- package/dist/models/api-request-user-update-password-dto.js +15 -0
- package/dist/models/api-response-auth-dto.d.ts +25 -0
- package/dist/models/api-response-auth-dto.js +15 -0
- package/dist/models/api-response-user-dto.d.ts +25 -0
- package/dist/models/api-response-user-dto.js +15 -0
- package/dist/models/attributes.d.ts +31 -0
- package/dist/models/attributes.js +15 -0
- package/dist/models/auth-dto.d.ts +31 -0
- package/dist/models/auth-dto.js +15 -0
- package/dist/models/contacts-response-dto.d.ts +25 -0
- package/dist/models/contacts-response-dto.js +15 -0
- package/dist/models/data-dto.d.ts +25 -0
- package/dist/models/data-dto.js +15 -0
- package/dist/models/data-unauthorized-dto.d.ts +29 -0
- package/dist/models/data-unauthorized-dto.js +15 -0
- package/dist/models/index.d.ts +19 -0
- package/dist/models/index.js +31 -0
- package/dist/models/inline-response503-info.d.ts +24 -0
- package/dist/models/inline-response503-info.js +15 -0
- package/dist/models/inline-response503.d.ts +50 -0
- package/dist/models/inline-response503.js +15 -0
- package/dist/models/message-dto.d.ts +19 -0
- package/dist/models/message-dto.js +15 -0
- package/dist/models/role-dto.d.ts +37 -0
- package/dist/models/role-dto.js +15 -0
- package/dist/models/status-dto.d.ts +31 -0
- package/dist/models/status-dto.js +15 -0
- package/dist/models/tokens-dto.d.ts +31 -0
- package/dist/models/tokens-dto.js +15 -0
- package/dist/models/unauthorized-dto.d.ts +25 -0
- package/dist/models/unauthorized-dto.js +15 -0
- package/dist/models/unauthorized-token-dto.d.ts +29 -0
- package/dist/models/unauthorized-token-dto.js +15 -0
- package/dist/models/user-detail-dto.d.ts +49 -0
- package/dist/models/user-detail-dto.js +15 -0
- package/dist/models/user-update-password-dto.d.ts +37 -0
- package/dist/models/user-update-password-dto.js +15 -0
- package/dist/models/whatsapp-contact-dto.d.ts +43 -0
- package/dist/models/whatsapp-contact-dto.js +15 -0
- package/models/whatsapp-contact-dto.ts +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @1.0.
|
|
1
|
+
## @1.0.3
|
|
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.3 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* whatsapp-bridge Node Api
|
|
3
|
+
* The whatsapp-bridge API description
|
|
4
|
+
*
|
|
5
|
+
* OpenAPI spec version: 0.0.1
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by the swagger code generator program.
|
|
9
|
+
* https://github.com/swagger-api/swagger-codegen.git
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
export * from './apis/auth-api';
|
|
13
|
+
export * from './apis/contacts-api';
|
|
14
|
+
export * from './apis/default-api';
|
|
15
|
+
export * from './apis/healthchecks-api';
|
|
16
|
+
export * from './apis/users-api';
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
/* tslint:disable */
|
|
14
|
+
/* eslint-disable */
|
|
15
|
+
/**
|
|
16
|
+
* whatsapp-bridge Node Api
|
|
17
|
+
* The whatsapp-bridge API description
|
|
18
|
+
*
|
|
19
|
+
* OpenAPI spec version: 0.0.1
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
* NOTE: This class is auto generated by the swagger code generator program.
|
|
23
|
+
* https://github.com/swagger-api/swagger-codegen.git
|
|
24
|
+
* Do not edit the class manually.
|
|
25
|
+
*/
|
|
26
|
+
__exportStar(require("./apis/auth-api"), exports);
|
|
27
|
+
__exportStar(require("./apis/contacts-api"), exports);
|
|
28
|
+
__exportStar(require("./apis/default-api"), exports);
|
|
29
|
+
__exportStar(require("./apis/healthchecks-api"), exports);
|
|
30
|
+
__exportStar(require("./apis/users-api"), exports);
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* whatsapp-bridge Node Api
|
|
3
|
+
* The whatsapp-bridge API description
|
|
4
|
+
*
|
|
5
|
+
* OpenAPI spec version: 0.0.1
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by the swagger code generator program.
|
|
9
|
+
* https://github.com/swagger-api/swagger-codegen.git
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
13
|
+
import { Configuration } from '../configuration';
|
|
14
|
+
import { RequestArgs, BaseAPI } from '../base';
|
|
15
|
+
import { ApiResponseAuthDto } from '../models';
|
|
16
|
+
import { AuthDto } from '../models';
|
|
17
|
+
/**
|
|
18
|
+
* AuthApi - axios parameter creator
|
|
19
|
+
* @export
|
|
20
|
+
*/
|
|
21
|
+
export declare const AuthApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param {AuthDto} body
|
|
25
|
+
* @param {*} [options] Override http request option.
|
|
26
|
+
* @throws {RequiredError}
|
|
27
|
+
*/
|
|
28
|
+
login: (body: AuthDto, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @param {*} [options] Override http request option.
|
|
32
|
+
* @throws {RequiredError}
|
|
33
|
+
*/
|
|
34
|
+
logout: (options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @param {*} [options] Override http request option.
|
|
38
|
+
* @throws {RequiredError}
|
|
39
|
+
*/
|
|
40
|
+
refreshToken: (options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* AuthApi - functional programming interface
|
|
44
|
+
* @export
|
|
45
|
+
*/
|
|
46
|
+
export declare const AuthApiFp: (configuration?: Configuration) => {
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @param {AuthDto} body
|
|
50
|
+
* @param {*} [options] Override http request option.
|
|
51
|
+
* @throws {RequiredError}
|
|
52
|
+
*/
|
|
53
|
+
login(body: AuthDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ApiResponseAuthDto>>>;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @param {*} [options] Override http request option.
|
|
57
|
+
* @throws {RequiredError}
|
|
58
|
+
*/
|
|
59
|
+
logout(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>>;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @param {*} [options] Override http request option.
|
|
63
|
+
* @throws {RequiredError}
|
|
64
|
+
*/
|
|
65
|
+
refreshToken(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ApiResponseAuthDto>>>;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* AuthApi - factory interface
|
|
69
|
+
* @export
|
|
70
|
+
*/
|
|
71
|
+
export declare const AuthApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
* @param {AuthDto} body
|
|
75
|
+
* @param {*} [options] Override http request option.
|
|
76
|
+
* @throws {RequiredError}
|
|
77
|
+
*/
|
|
78
|
+
login(body: AuthDto, options?: AxiosRequestConfig): Promise<AxiosResponse<ApiResponseAuthDto>>;
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @param {*} [options] Override http request option.
|
|
82
|
+
* @throws {RequiredError}
|
|
83
|
+
*/
|
|
84
|
+
logout(options?: AxiosRequestConfig): Promise<AxiosResponse<void>>;
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* @param {*} [options] Override http request option.
|
|
88
|
+
* @throws {RequiredError}
|
|
89
|
+
*/
|
|
90
|
+
refreshToken(options?: AxiosRequestConfig): Promise<AxiosResponse<ApiResponseAuthDto>>;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* AuthApi - object-oriented interface
|
|
94
|
+
* @export
|
|
95
|
+
* @class AuthApi
|
|
96
|
+
* @extends {BaseAPI}
|
|
97
|
+
*/
|
|
98
|
+
export declare class AuthApi extends BaseAPI {
|
|
99
|
+
/**
|
|
100
|
+
*
|
|
101
|
+
* @param {AuthDto} body
|
|
102
|
+
* @param {*} [options] Override http request option.
|
|
103
|
+
* @throws {RequiredError}
|
|
104
|
+
* @memberof AuthApi
|
|
105
|
+
*/
|
|
106
|
+
login(body: AuthDto, options?: AxiosRequestConfig): Promise<AxiosResponse<ApiResponseAuthDto>>;
|
|
107
|
+
/**
|
|
108
|
+
*
|
|
109
|
+
* @param {*} [options] Override http request option.
|
|
110
|
+
* @throws {RequiredError}
|
|
111
|
+
* @memberof AuthApi
|
|
112
|
+
*/
|
|
113
|
+
logout(options?: AxiosRequestConfig): Promise<AxiosResponse<void>>;
|
|
114
|
+
/**
|
|
115
|
+
*
|
|
116
|
+
* @param {*} [options] Override http request option.
|
|
117
|
+
* @throws {RequiredError}
|
|
118
|
+
* @memberof AuthApi
|
|
119
|
+
*/
|
|
120
|
+
refreshToken(options?: AxiosRequestConfig): Promise<AxiosResponse<ApiResponseAuthDto>>;
|
|
121
|
+
}
|
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* whatsapp-bridge Node Api
|
|
6
|
+
* The whatsapp-bridge API description
|
|
7
|
+
*
|
|
8
|
+
* OpenAPI spec version: 0.0.1
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by the swagger code generator program.
|
|
12
|
+
* https://github.com/swagger-api/swagger-codegen.git
|
|
13
|
+
* Do not edit the class manually.
|
|
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 (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
20
|
+
return extendStatics(d, b);
|
|
21
|
+
};
|
|
22
|
+
return function (d, b) {
|
|
23
|
+
extendStatics(d, b);
|
|
24
|
+
function __() { this.constructor = d; }
|
|
25
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __assign = (this && this.__assign) || function () {
|
|
29
|
+
__assign = Object.assign || function(t) {
|
|
30
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
31
|
+
s = arguments[i];
|
|
32
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
33
|
+
t[p] = s[p];
|
|
34
|
+
}
|
|
35
|
+
return t;
|
|
36
|
+
};
|
|
37
|
+
return __assign.apply(this, arguments);
|
|
38
|
+
};
|
|
39
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
40
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
41
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
42
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
43
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
44
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
45
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
49
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
50
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
51
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
52
|
+
function step(op) {
|
|
53
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
54
|
+
while (_) try {
|
|
55
|
+
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;
|
|
56
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
57
|
+
switch (op[0]) {
|
|
58
|
+
case 0: case 1: t = op; break;
|
|
59
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
60
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
61
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
62
|
+
default:
|
|
63
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
64
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
65
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
66
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
67
|
+
if (t[2]) _.ops.pop();
|
|
68
|
+
_.trys.pop(); continue;
|
|
69
|
+
}
|
|
70
|
+
op = body.call(thisArg, _);
|
|
71
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
72
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
76
|
+
exports.AuthApi = exports.AuthApiFactory = exports.AuthApiFp = exports.AuthApiAxiosParamCreator = void 0;
|
|
77
|
+
var axios_1 = require("axios");
|
|
78
|
+
// Some imports not used depending on template conditions
|
|
79
|
+
// @ts-ignore
|
|
80
|
+
var base_1 = require("../base");
|
|
81
|
+
/**
|
|
82
|
+
* AuthApi - axios parameter creator
|
|
83
|
+
* @export
|
|
84
|
+
*/
|
|
85
|
+
exports.AuthApiAxiosParamCreator = function (configuration) {
|
|
86
|
+
var _this = this;
|
|
87
|
+
return {
|
|
88
|
+
/**
|
|
89
|
+
*
|
|
90
|
+
* @param {AuthDto} body
|
|
91
|
+
* @param {*} [options] Override http request option.
|
|
92
|
+
* @throws {RequiredError}
|
|
93
|
+
*/
|
|
94
|
+
login: function (body, options) {
|
|
95
|
+
if (options === void 0) { options = {}; }
|
|
96
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
97
|
+
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, query, key, key, headersFromBaseOptions, needsSerialization;
|
|
98
|
+
return __generator(this, function (_a) {
|
|
99
|
+
// verify required parameter 'body' is not null or undefined
|
|
100
|
+
if (body === null || body === undefined) {
|
|
101
|
+
throw new base_1.RequiredError('body', 'Required parameter body was null or undefined when calling login.');
|
|
102
|
+
}
|
|
103
|
+
localVarPath = "/api/auth/login";
|
|
104
|
+
localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
105
|
+
if (configuration) {
|
|
106
|
+
baseOptions = configuration.baseOptions;
|
|
107
|
+
}
|
|
108
|
+
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
|
|
109
|
+
localVarHeaderParameter = {};
|
|
110
|
+
localVarQueryParameter = {};
|
|
111
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
112
|
+
query = new URLSearchParams(localVarUrlObj.search);
|
|
113
|
+
for (key in localVarQueryParameter) {
|
|
114
|
+
query.set(key, localVarQueryParameter[key]);
|
|
115
|
+
}
|
|
116
|
+
for (key in options.params) {
|
|
117
|
+
query.set(key, options.params[key]);
|
|
118
|
+
}
|
|
119
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
120
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
121
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
122
|
+
needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
123
|
+
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
124
|
+
return [2 /*return*/, {
|
|
125
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
126
|
+
options: localVarRequestOptions,
|
|
127
|
+
}];
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
},
|
|
131
|
+
/**
|
|
132
|
+
*
|
|
133
|
+
* @param {*} [options] Override http request option.
|
|
134
|
+
* @throws {RequiredError}
|
|
135
|
+
*/
|
|
136
|
+
logout: function (options) {
|
|
137
|
+
if (options === void 0) { options = {}; }
|
|
138
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
139
|
+
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, accessToken, _a, query, key, key, headersFromBaseOptions;
|
|
140
|
+
return __generator(this, function (_b) {
|
|
141
|
+
switch (_b.label) {
|
|
142
|
+
case 0:
|
|
143
|
+
localVarPath = "/api/auth/logout";
|
|
144
|
+
localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
145
|
+
if (configuration) {
|
|
146
|
+
baseOptions = configuration.baseOptions;
|
|
147
|
+
}
|
|
148
|
+
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
|
149
|
+
localVarHeaderParameter = {};
|
|
150
|
+
localVarQueryParameter = {};
|
|
151
|
+
if (!(configuration && configuration.accessToken)) return [3 /*break*/, 5];
|
|
152
|
+
if (!(typeof configuration.accessToken === 'function')) return [3 /*break*/, 2];
|
|
153
|
+
return [4 /*yield*/, configuration.accessToken()];
|
|
154
|
+
case 1:
|
|
155
|
+
_a = _b.sent();
|
|
156
|
+
return [3 /*break*/, 4];
|
|
157
|
+
case 2: return [4 /*yield*/, configuration.accessToken];
|
|
158
|
+
case 3:
|
|
159
|
+
_a = _b.sent();
|
|
160
|
+
_b.label = 4;
|
|
161
|
+
case 4:
|
|
162
|
+
accessToken = _a;
|
|
163
|
+
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
164
|
+
_b.label = 5;
|
|
165
|
+
case 5:
|
|
166
|
+
query = new URLSearchParams(localVarUrlObj.search);
|
|
167
|
+
for (key in localVarQueryParameter) {
|
|
168
|
+
query.set(key, localVarQueryParameter[key]);
|
|
169
|
+
}
|
|
170
|
+
for (key in options.params) {
|
|
171
|
+
query.set(key, options.params[key]);
|
|
172
|
+
}
|
|
173
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
174
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
175
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
176
|
+
return [2 /*return*/, {
|
|
177
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
178
|
+
options: localVarRequestOptions,
|
|
179
|
+
}];
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
},
|
|
184
|
+
/**
|
|
185
|
+
*
|
|
186
|
+
* @param {*} [options] Override http request option.
|
|
187
|
+
* @throws {RequiredError}
|
|
188
|
+
*/
|
|
189
|
+
refreshToken: function (options) {
|
|
190
|
+
if (options === void 0) { options = {}; }
|
|
191
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
192
|
+
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, accessToken, _a, query, key, key, headersFromBaseOptions;
|
|
193
|
+
return __generator(this, function (_b) {
|
|
194
|
+
switch (_b.label) {
|
|
195
|
+
case 0:
|
|
196
|
+
localVarPath = "/api/auth/refresh";
|
|
197
|
+
localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
198
|
+
if (configuration) {
|
|
199
|
+
baseOptions = configuration.baseOptions;
|
|
200
|
+
}
|
|
201
|
+
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
|
202
|
+
localVarHeaderParameter = {};
|
|
203
|
+
localVarQueryParameter = {};
|
|
204
|
+
if (!(configuration && configuration.accessToken)) return [3 /*break*/, 5];
|
|
205
|
+
if (!(typeof configuration.accessToken === 'function')) return [3 /*break*/, 2];
|
|
206
|
+
return [4 /*yield*/, configuration.accessToken()];
|
|
207
|
+
case 1:
|
|
208
|
+
_a = _b.sent();
|
|
209
|
+
return [3 /*break*/, 4];
|
|
210
|
+
case 2: return [4 /*yield*/, configuration.accessToken];
|
|
211
|
+
case 3:
|
|
212
|
+
_a = _b.sent();
|
|
213
|
+
_b.label = 4;
|
|
214
|
+
case 4:
|
|
215
|
+
accessToken = _a;
|
|
216
|
+
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
217
|
+
_b.label = 5;
|
|
218
|
+
case 5:
|
|
219
|
+
query = new URLSearchParams(localVarUrlObj.search);
|
|
220
|
+
for (key in localVarQueryParameter) {
|
|
221
|
+
query.set(key, localVarQueryParameter[key]);
|
|
222
|
+
}
|
|
223
|
+
for (key in options.params) {
|
|
224
|
+
query.set(key, options.params[key]);
|
|
225
|
+
}
|
|
226
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
227
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
228
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
229
|
+
return [2 /*return*/, {
|
|
230
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
231
|
+
options: localVarRequestOptions,
|
|
232
|
+
}];
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* AuthApi - functional programming interface
|
|
241
|
+
* @export
|
|
242
|
+
*/
|
|
243
|
+
exports.AuthApiFp = function (configuration) {
|
|
244
|
+
return {
|
|
245
|
+
/**
|
|
246
|
+
*
|
|
247
|
+
* @param {AuthDto} body
|
|
248
|
+
* @param {*} [options] Override http request option.
|
|
249
|
+
* @throws {RequiredError}
|
|
250
|
+
*/
|
|
251
|
+
login: function (body, options) {
|
|
252
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
253
|
+
var localVarAxiosArgs;
|
|
254
|
+
return __generator(this, function (_a) {
|
|
255
|
+
switch (_a.label) {
|
|
256
|
+
case 0: return [4 /*yield*/, exports.AuthApiAxiosParamCreator(configuration).login(body, options)];
|
|
257
|
+
case 1:
|
|
258
|
+
localVarAxiosArgs = _a.sent();
|
|
259
|
+
return [2 /*return*/, function (axios, basePath) {
|
|
260
|
+
if (axios === void 0) { axios = axios_1.default; }
|
|
261
|
+
if (basePath === void 0) { basePath = base_1.BASE_PATH; }
|
|
262
|
+
var axiosRequestArgs = __assign(__assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
|
|
263
|
+
return axios.request(axiosRequestArgs);
|
|
264
|
+
}];
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
},
|
|
269
|
+
/**
|
|
270
|
+
*
|
|
271
|
+
* @param {*} [options] Override http request option.
|
|
272
|
+
* @throws {RequiredError}
|
|
273
|
+
*/
|
|
274
|
+
logout: function (options) {
|
|
275
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
276
|
+
var localVarAxiosArgs;
|
|
277
|
+
return __generator(this, function (_a) {
|
|
278
|
+
switch (_a.label) {
|
|
279
|
+
case 0: return [4 /*yield*/, exports.AuthApiAxiosParamCreator(configuration).logout(options)];
|
|
280
|
+
case 1:
|
|
281
|
+
localVarAxiosArgs = _a.sent();
|
|
282
|
+
return [2 /*return*/, function (axios, basePath) {
|
|
283
|
+
if (axios === void 0) { axios = axios_1.default; }
|
|
284
|
+
if (basePath === void 0) { basePath = base_1.BASE_PATH; }
|
|
285
|
+
var axiosRequestArgs = __assign(__assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
|
|
286
|
+
return axios.request(axiosRequestArgs);
|
|
287
|
+
}];
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
},
|
|
292
|
+
/**
|
|
293
|
+
*
|
|
294
|
+
* @param {*} [options] Override http request option.
|
|
295
|
+
* @throws {RequiredError}
|
|
296
|
+
*/
|
|
297
|
+
refreshToken: function (options) {
|
|
298
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
299
|
+
var localVarAxiosArgs;
|
|
300
|
+
return __generator(this, function (_a) {
|
|
301
|
+
switch (_a.label) {
|
|
302
|
+
case 0: return [4 /*yield*/, exports.AuthApiAxiosParamCreator(configuration).refreshToken(options)];
|
|
303
|
+
case 1:
|
|
304
|
+
localVarAxiosArgs = _a.sent();
|
|
305
|
+
return [2 /*return*/, function (axios, basePath) {
|
|
306
|
+
if (axios === void 0) { axios = axios_1.default; }
|
|
307
|
+
if (basePath === void 0) { basePath = base_1.BASE_PATH; }
|
|
308
|
+
var axiosRequestArgs = __assign(__assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
|
|
309
|
+
return axios.request(axiosRequestArgs);
|
|
310
|
+
}];
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
},
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
/**
|
|
318
|
+
* AuthApi - factory interface
|
|
319
|
+
* @export
|
|
320
|
+
*/
|
|
321
|
+
exports.AuthApiFactory = function (configuration, basePath, axios) {
|
|
322
|
+
return {
|
|
323
|
+
/**
|
|
324
|
+
*
|
|
325
|
+
* @param {AuthDto} body
|
|
326
|
+
* @param {*} [options] Override http request option.
|
|
327
|
+
* @throws {RequiredError}
|
|
328
|
+
*/
|
|
329
|
+
login: function (body, options) {
|
|
330
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
331
|
+
return __generator(this, function (_a) {
|
|
332
|
+
return [2 /*return*/, exports.AuthApiFp(configuration).login(body, options).then(function (request) { return request(axios, basePath); })];
|
|
333
|
+
});
|
|
334
|
+
});
|
|
335
|
+
},
|
|
336
|
+
/**
|
|
337
|
+
*
|
|
338
|
+
* @param {*} [options] Override http request option.
|
|
339
|
+
* @throws {RequiredError}
|
|
340
|
+
*/
|
|
341
|
+
logout: function (options) {
|
|
342
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
343
|
+
return __generator(this, function (_a) {
|
|
344
|
+
return [2 /*return*/, exports.AuthApiFp(configuration).logout(options).then(function (request) { return request(axios, basePath); })];
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
},
|
|
348
|
+
/**
|
|
349
|
+
*
|
|
350
|
+
* @param {*} [options] Override http request option.
|
|
351
|
+
* @throws {RequiredError}
|
|
352
|
+
*/
|
|
353
|
+
refreshToken: function (options) {
|
|
354
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
355
|
+
return __generator(this, function (_a) {
|
|
356
|
+
return [2 /*return*/, exports.AuthApiFp(configuration).refreshToken(options).then(function (request) { return request(axios, basePath); })];
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
},
|
|
360
|
+
};
|
|
361
|
+
};
|
|
362
|
+
/**
|
|
363
|
+
* AuthApi - object-oriented interface
|
|
364
|
+
* @export
|
|
365
|
+
* @class AuthApi
|
|
366
|
+
* @extends {BaseAPI}
|
|
367
|
+
*/
|
|
368
|
+
var AuthApi = /** @class */ (function (_super) {
|
|
369
|
+
__extends(AuthApi, _super);
|
|
370
|
+
function AuthApi() {
|
|
371
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
*
|
|
375
|
+
* @param {AuthDto} body
|
|
376
|
+
* @param {*} [options] Override http request option.
|
|
377
|
+
* @throws {RequiredError}
|
|
378
|
+
* @memberof AuthApi
|
|
379
|
+
*/
|
|
380
|
+
AuthApi.prototype.login = function (body, options) {
|
|
381
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
382
|
+
var _this = this;
|
|
383
|
+
return __generator(this, function (_a) {
|
|
384
|
+
return [2 /*return*/, exports.AuthApiFp(this.configuration).login(body, options).then(function (request) { return request(_this.axios, _this.basePath); })];
|
|
385
|
+
});
|
|
386
|
+
});
|
|
387
|
+
};
|
|
388
|
+
/**
|
|
389
|
+
*
|
|
390
|
+
* @param {*} [options] Override http request option.
|
|
391
|
+
* @throws {RequiredError}
|
|
392
|
+
* @memberof AuthApi
|
|
393
|
+
*/
|
|
394
|
+
AuthApi.prototype.logout = function (options) {
|
|
395
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
396
|
+
var _this = this;
|
|
397
|
+
return __generator(this, function (_a) {
|
|
398
|
+
return [2 /*return*/, exports.AuthApiFp(this.configuration).logout(options).then(function (request) { return request(_this.axios, _this.basePath); })];
|
|
399
|
+
});
|
|
400
|
+
});
|
|
401
|
+
};
|
|
402
|
+
/**
|
|
403
|
+
*
|
|
404
|
+
* @param {*} [options] Override http request option.
|
|
405
|
+
* @throws {RequiredError}
|
|
406
|
+
* @memberof AuthApi
|
|
407
|
+
*/
|
|
408
|
+
AuthApi.prototype.refreshToken = function (options) {
|
|
409
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
410
|
+
var _this = this;
|
|
411
|
+
return __generator(this, function (_a) {
|
|
412
|
+
return [2 /*return*/, exports.AuthApiFp(this.configuration).refreshToken(options).then(function (request) { return request(_this.axios, _this.basePath); })];
|
|
413
|
+
});
|
|
414
|
+
});
|
|
415
|
+
};
|
|
416
|
+
return AuthApi;
|
|
417
|
+
}(base_1.BaseAPI));
|
|
418
|
+
exports.AuthApi = AuthApi;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* whatsapp-bridge Node Api
|
|
3
|
+
* The whatsapp-bridge API description
|
|
4
|
+
*
|
|
5
|
+
* OpenAPI spec version: 0.0.1
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by the swagger code generator program.
|
|
9
|
+
* https://github.com/swagger-api/swagger-codegen.git
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
13
|
+
import { Configuration } from '../configuration';
|
|
14
|
+
import { RequestArgs, BaseAPI } from '../base';
|
|
15
|
+
import { ContactsResponseDTO } from '../models';
|
|
16
|
+
/**
|
|
17
|
+
* ContactsApi - axios parameter creator
|
|
18
|
+
* @export
|
|
19
|
+
*/
|
|
20
|
+
export declare const ContactsApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @param {*} [options] Override http request option.
|
|
24
|
+
* @throws {RequiredError}
|
|
25
|
+
*/
|
|
26
|
+
getContacts: (options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* ContactsApi - functional programming interface
|
|
30
|
+
* @export
|
|
31
|
+
*/
|
|
32
|
+
export declare const ContactsApiFp: (configuration?: Configuration) => {
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param {*} [options] Override http request option.
|
|
36
|
+
* @throws {RequiredError}
|
|
37
|
+
*/
|
|
38
|
+
getContacts(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ContactsResponseDTO>>>;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* ContactsApi - factory interface
|
|
42
|
+
* @export
|
|
43
|
+
*/
|
|
44
|
+
export declare const ContactsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @param {*} [options] Override http request option.
|
|
48
|
+
* @throws {RequiredError}
|
|
49
|
+
*/
|
|
50
|
+
getContacts(options?: AxiosRequestConfig): Promise<AxiosResponse<ContactsResponseDTO>>;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* ContactsApi - object-oriented interface
|
|
54
|
+
* @export
|
|
55
|
+
* @class ContactsApi
|
|
56
|
+
* @extends {BaseAPI}
|
|
57
|
+
*/
|
|
58
|
+
export declare class ContactsApi extends BaseAPI {
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @param {*} [options] Override http request option.
|
|
62
|
+
* @throws {RequiredError}
|
|
63
|
+
* @memberof ContactsApi
|
|
64
|
+
*/
|
|
65
|
+
getContacts(options?: AxiosRequestConfig): Promise<AxiosResponse<ContactsResponseDTO>>;
|
|
66
|
+
}
|