@libgot/whatsapp-bridge-sdk 1.0.35 → 1.0.36-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 +2 -2
- package/api.ts +3 -0
- package/apis/auth-api.ts +26 -27
- package/apis/cellphone-api.ts +151 -0
- package/apis/chats-api.ts +116 -7
- package/apis/flows-api.ts +263 -0
- package/apis/sessions-api.ts +201 -0
- package/dist/api.d.ts +3 -0
- package/dist/api.js +3 -0
- package/dist/apis/auth-api.d.ts +12 -13
- package/dist/apis/auth-api.js +25 -25
- package/dist/apis/cellphone-api.d.ts +74 -0
- package/dist/apis/cellphone-api.js +161 -0
- package/dist/apis/chats-api.d.ts +50 -4
- package/dist/apis/chats-api.js +116 -7
- package/dist/apis/flows-api.d.ts +125 -0
- package/dist/apis/flows-api.js +283 -0
- package/dist/apis/sessions-api.d.ts +100 -0
- package/dist/apis/sessions-api.js +217 -0
- package/dist/models/apply-for-loan-response-dto.d.ts +19 -0
- package/dist/models/apply-for-loan-response-dto.js +15 -0
- package/dist/models/assignment-type-dto.d.ts +31 -0
- package/dist/models/assignment-type-dto.js +15 -0
- package/dist/models/cellphone-validation-dto.d.ts +24 -0
- package/dist/models/cellphone-validation-dto.js +15 -0
- package/dist/models/index.d.ts +7 -1
- package/dist/models/index.js +7 -1
- package/dist/models/send-template-data-dto.d.ts +2 -1
- package/dist/models/send-template-data-dto.js +1 -0
- package/dist/models/send-text-dto.d.ts +2 -1
- package/dist/models/send-text-dto.js +1 -0
- package/dist/models/session-response-data-dto.d.ts +25 -0
- package/dist/models/session-response-data-dto.js +15 -0
- package/dist/models/session-response-dto.d.ts +43 -0
- package/dist/models/session-response-dto.js +15 -0
- package/dist/models/sessions-response-data-dto.d.ts +25 -0
- package/dist/models/sessions-response-data-dto.js +15 -0
- package/dist/models/signature-data-dto.d.ts +19 -0
- package/dist/models/signature-data-dto.js +15 -0
- package/dist/models/whatsapp-chat-dto.d.ts +6 -0
- package/models/apply-for-loan-response-dto.ts +22 -0
- package/models/assignment-type-dto.ts +36 -0
- package/models/cellphone-validation-dto.ts +28 -0
- package/models/index.ts +7 -1
- package/models/send-template-data-dto.ts +2 -1
- package/models/send-text-dto.ts +2 -1
- package/models/session-response-data-dto.ts +29 -0
- package/models/session-response-dto.ts +50 -0
- package/models/sessions-response-data-dto.ts +29 -0
- package/models/signature-data-dto.ts +22 -0
- package/models/whatsapp-chat-dto.ts +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @1.0.
|
|
1
|
+
## @1.0.36-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,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.36-rc.2 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
package/api.ts
CHANGED
|
@@ -12,10 +12,13 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
export * from './apis/auth-api';
|
|
15
|
+
export * from './apis/cellphone-api';
|
|
15
16
|
export * from './apis/chats-api';
|
|
16
17
|
export * from './apis/contacts-api';
|
|
17
18
|
export * from './apis/default-api';
|
|
19
|
+
export * from './apis/flows-api';
|
|
18
20
|
export * from './apis/healthchecks-api';
|
|
19
21
|
export * from './apis/messages-api';
|
|
22
|
+
export * from './apis/sessions-api';
|
|
20
23
|
export * from './apis/users-api';
|
|
21
24
|
|
package/apis/auth-api.ts
CHANGED
|
@@ -18,7 +18,6 @@ import { Configuration } from '../configuration';
|
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
|
|
20
20
|
import { ApiResponseAuthDto } from '../models';
|
|
21
|
-
import { AuthDto } from '../models';
|
|
22
21
|
import { UnauthorizedDto } from '../models';
|
|
23
22
|
import { UnauthorizedTokenDto } from '../models';
|
|
24
23
|
/**
|
|
@@ -29,15 +28,10 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration)
|
|
|
29
28
|
return {
|
|
30
29
|
/**
|
|
31
30
|
*
|
|
32
|
-
* @param {AuthDto} body
|
|
33
31
|
* @param {*} [options] Override http request option.
|
|
34
32
|
* @throws {RequiredError}
|
|
35
33
|
*/
|
|
36
|
-
login: async (
|
|
37
|
-
// verify required parameter 'body' is not null or undefined
|
|
38
|
-
if (body === null || body === undefined) {
|
|
39
|
-
throw new RequiredError('body','Required parameter body was null or undefined when calling login.');
|
|
40
|
-
}
|
|
34
|
+
login: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
41
35
|
const localVarPath = `/api/auth/login`;
|
|
42
36
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
43
37
|
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
@@ -49,8 +43,6 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration)
|
|
|
49
43
|
const localVarHeaderParameter = {} as any;
|
|
50
44
|
const localVarQueryParameter = {} as any;
|
|
51
45
|
|
|
52
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
53
|
-
|
|
54
46
|
const query = new URLSearchParams(localVarUrlObj.search);
|
|
55
47
|
for (const key in localVarQueryParameter) {
|
|
56
48
|
query.set(key, localVarQueryParameter[key]);
|
|
@@ -61,8 +53,6 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration)
|
|
|
61
53
|
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
62
54
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
63
55
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
64
|
-
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
65
|
-
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
66
56
|
|
|
67
57
|
return {
|
|
68
58
|
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
@@ -113,10 +103,15 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration)
|
|
|
113
103
|
},
|
|
114
104
|
/**
|
|
115
105
|
*
|
|
106
|
+
* @param {string} authorization Custom header
|
|
116
107
|
* @param {*} [options] Override http request option.
|
|
117
108
|
* @throws {RequiredError}
|
|
118
109
|
*/
|
|
119
|
-
refreshToken: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
110
|
+
refreshToken: async (authorization: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
111
|
+
// verify required parameter 'authorization' is not null or undefined
|
|
112
|
+
if (authorization === null || authorization === undefined) {
|
|
113
|
+
throw new RequiredError('authorization','Required parameter authorization was null or undefined when calling refreshToken.');
|
|
114
|
+
}
|
|
120
115
|
const localVarPath = `/api/auth/refresh`;
|
|
121
116
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
122
117
|
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
@@ -137,6 +132,10 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration)
|
|
|
137
132
|
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
138
133
|
}
|
|
139
134
|
|
|
135
|
+
if (authorization !== undefined && authorization !== null) {
|
|
136
|
+
localVarHeaderParameter['Authorization'] = String(authorization);
|
|
137
|
+
}
|
|
138
|
+
|
|
140
139
|
const query = new URLSearchParams(localVarUrlObj.search);
|
|
141
140
|
for (const key in localVarQueryParameter) {
|
|
142
141
|
query.set(key, localVarQueryParameter[key]);
|
|
@@ -164,12 +163,11 @@ export const AuthApiFp = function(configuration?: Configuration) {
|
|
|
164
163
|
return {
|
|
165
164
|
/**
|
|
166
165
|
*
|
|
167
|
-
* @param {AuthDto} body
|
|
168
166
|
* @param {*} [options] Override http request option.
|
|
169
167
|
* @throws {RequiredError}
|
|
170
168
|
*/
|
|
171
|
-
async login(
|
|
172
|
-
const localVarAxiosArgs = await AuthApiAxiosParamCreator(configuration).login(
|
|
169
|
+
async login(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ApiResponseAuthDto>>> {
|
|
170
|
+
const localVarAxiosArgs = await AuthApiAxiosParamCreator(configuration).login(options);
|
|
173
171
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
174
172
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
175
173
|
return axios.request(axiosRequestArgs);
|
|
@@ -189,11 +187,12 @@ export const AuthApiFp = function(configuration?: Configuration) {
|
|
|
189
187
|
},
|
|
190
188
|
/**
|
|
191
189
|
*
|
|
190
|
+
* @param {string} authorization Custom header
|
|
192
191
|
* @param {*} [options] Override http request option.
|
|
193
192
|
* @throws {RequiredError}
|
|
194
193
|
*/
|
|
195
|
-
async refreshToken(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ApiResponseAuthDto>>> {
|
|
196
|
-
const localVarAxiosArgs = await AuthApiAxiosParamCreator(configuration).refreshToken(options);
|
|
194
|
+
async refreshToken(authorization: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ApiResponseAuthDto>>> {
|
|
195
|
+
const localVarAxiosArgs = await AuthApiAxiosParamCreator(configuration).refreshToken(authorization, options);
|
|
197
196
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
198
197
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
199
198
|
return axios.request(axiosRequestArgs);
|
|
@@ -210,12 +209,11 @@ export const AuthApiFactory = function (configuration?: Configuration, basePath?
|
|
|
210
209
|
return {
|
|
211
210
|
/**
|
|
212
211
|
*
|
|
213
|
-
* @param {AuthDto} body
|
|
214
212
|
* @param {*} [options] Override http request option.
|
|
215
213
|
* @throws {RequiredError}
|
|
216
214
|
*/
|
|
217
|
-
async login(
|
|
218
|
-
return AuthApiFp(configuration).login(
|
|
215
|
+
async login(options?: AxiosRequestConfig): Promise<AxiosResponse<ApiResponseAuthDto>> {
|
|
216
|
+
return AuthApiFp(configuration).login(options).then((request) => request(axios, basePath));
|
|
219
217
|
},
|
|
220
218
|
/**
|
|
221
219
|
*
|
|
@@ -227,11 +225,12 @@ export const AuthApiFactory = function (configuration?: Configuration, basePath?
|
|
|
227
225
|
},
|
|
228
226
|
/**
|
|
229
227
|
*
|
|
228
|
+
* @param {string} authorization Custom header
|
|
230
229
|
* @param {*} [options] Override http request option.
|
|
231
230
|
* @throws {RequiredError}
|
|
232
231
|
*/
|
|
233
|
-
async refreshToken(options?: AxiosRequestConfig): Promise<AxiosResponse<ApiResponseAuthDto>> {
|
|
234
|
-
return AuthApiFp(configuration).refreshToken(options).then((request) => request(axios, basePath));
|
|
232
|
+
async refreshToken(authorization: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ApiResponseAuthDto>> {
|
|
233
|
+
return AuthApiFp(configuration).refreshToken(authorization, options).then((request) => request(axios, basePath));
|
|
235
234
|
},
|
|
236
235
|
};
|
|
237
236
|
};
|
|
@@ -245,13 +244,12 @@ export const AuthApiFactory = function (configuration?: Configuration, basePath?
|
|
|
245
244
|
export class AuthApi extends BaseAPI {
|
|
246
245
|
/**
|
|
247
246
|
*
|
|
248
|
-
* @param {AuthDto} body
|
|
249
247
|
* @param {*} [options] Override http request option.
|
|
250
248
|
* @throws {RequiredError}
|
|
251
249
|
* @memberof AuthApi
|
|
252
250
|
*/
|
|
253
|
-
public async login(
|
|
254
|
-
return AuthApiFp(this.configuration).login(
|
|
251
|
+
public async login(options?: AxiosRequestConfig) : Promise<AxiosResponse<ApiResponseAuthDto>> {
|
|
252
|
+
return AuthApiFp(this.configuration).login(options).then((request) => request(this.axios, this.basePath));
|
|
255
253
|
}
|
|
256
254
|
/**
|
|
257
255
|
*
|
|
@@ -264,11 +262,12 @@ export class AuthApi extends BaseAPI {
|
|
|
264
262
|
}
|
|
265
263
|
/**
|
|
266
264
|
*
|
|
265
|
+
* @param {string} authorization Custom header
|
|
267
266
|
* @param {*} [options] Override http request option.
|
|
268
267
|
* @throws {RequiredError}
|
|
269
268
|
* @memberof AuthApi
|
|
270
269
|
*/
|
|
271
|
-
public async refreshToken(options?: AxiosRequestConfig) : Promise<AxiosResponse<ApiResponseAuthDto>> {
|
|
272
|
-
return AuthApiFp(this.configuration).refreshToken(options).then((request) => request(this.axios, this.basePath));
|
|
270
|
+
public async refreshToken(authorization: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ApiResponseAuthDto>> {
|
|
271
|
+
return AuthApiFp(this.configuration).refreshToken(authorization, options).then((request) => request(this.axios, this.basePath));
|
|
273
272
|
}
|
|
274
273
|
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* whatsapp-bridge Node Api
|
|
5
|
+
* The whatsapp-bridge API description
|
|
6
|
+
*
|
|
7
|
+
* OpenAPI spec version: 0.0.1
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by the swagger code generator program.
|
|
11
|
+
* https://github.com/swagger-api/swagger-codegen.git
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
16
|
+
import { Configuration } from '../configuration';
|
|
17
|
+
// Some imports not used depending on template conditions
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
|
|
20
|
+
import { CellphoneValidationDto } from '../models';
|
|
21
|
+
import { UnauthorizedTokenDto } from '../models';
|
|
22
|
+
/**
|
|
23
|
+
* CellphoneApi - axios parameter creator
|
|
24
|
+
* @export
|
|
25
|
+
*/
|
|
26
|
+
export const CellphoneApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
27
|
+
return {
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param {CellphoneValidationDto} body
|
|
31
|
+
* @param {string} authorization Custom header
|
|
32
|
+
* @param {*} [options] Override http request option.
|
|
33
|
+
* @throws {RequiredError}
|
|
34
|
+
*/
|
|
35
|
+
validate: async (body: CellphoneValidationDto, authorization: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
36
|
+
// verify required parameter 'body' is not null or undefined
|
|
37
|
+
if (body === null || body === undefined) {
|
|
38
|
+
throw new RequiredError('body','Required parameter body was null or undefined when calling validate.');
|
|
39
|
+
}
|
|
40
|
+
// verify required parameter 'authorization' is not null or undefined
|
|
41
|
+
if (authorization === null || authorization === undefined) {
|
|
42
|
+
throw new RequiredError('authorization','Required parameter authorization was null or undefined when calling validate.');
|
|
43
|
+
}
|
|
44
|
+
const localVarPath = `/api/cellphone/validate`;
|
|
45
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
46
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
47
|
+
let baseOptions;
|
|
48
|
+
if (configuration) {
|
|
49
|
+
baseOptions = configuration.baseOptions;
|
|
50
|
+
}
|
|
51
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
|
52
|
+
const localVarHeaderParameter = {} as any;
|
|
53
|
+
const localVarQueryParameter = {} as any;
|
|
54
|
+
|
|
55
|
+
// authentication access-token required
|
|
56
|
+
// http bearer authentication required
|
|
57
|
+
if (configuration && configuration.accessToken) {
|
|
58
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
59
|
+
? await configuration.accessToken()
|
|
60
|
+
: await configuration.accessToken;
|
|
61
|
+
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (authorization !== undefined && authorization !== null) {
|
|
65
|
+
localVarHeaderParameter['Authorization'] = String(authorization);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
69
|
+
|
|
70
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
71
|
+
for (const key in localVarQueryParameter) {
|
|
72
|
+
query.set(key, localVarQueryParameter[key]);
|
|
73
|
+
}
|
|
74
|
+
for (const key in options.params) {
|
|
75
|
+
query.set(key, options.params[key]);
|
|
76
|
+
}
|
|
77
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
78
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
79
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
80
|
+
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
81
|
+
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
85
|
+
options: localVarRequestOptions,
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* CellphoneApi - functional programming interface
|
|
93
|
+
* @export
|
|
94
|
+
*/
|
|
95
|
+
export const CellphoneApiFp = function(configuration?: Configuration) {
|
|
96
|
+
return {
|
|
97
|
+
/**
|
|
98
|
+
*
|
|
99
|
+
* @param {CellphoneValidationDto} body
|
|
100
|
+
* @param {string} authorization Custom header
|
|
101
|
+
* @param {*} [options] Override http request option.
|
|
102
|
+
* @throws {RequiredError}
|
|
103
|
+
*/
|
|
104
|
+
async validate(body: CellphoneValidationDto, authorization: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
|
105
|
+
const localVarAxiosArgs = await CellphoneApiAxiosParamCreator(configuration).validate(body, authorization, options);
|
|
106
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
107
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
108
|
+
return axios.request(axiosRequestArgs);
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* CellphoneApi - factory interface
|
|
116
|
+
* @export
|
|
117
|
+
*/
|
|
118
|
+
export const CellphoneApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
119
|
+
return {
|
|
120
|
+
/**
|
|
121
|
+
*
|
|
122
|
+
* @param {CellphoneValidationDto} body
|
|
123
|
+
* @param {string} authorization Custom header
|
|
124
|
+
* @param {*} [options] Override http request option.
|
|
125
|
+
* @throws {RequiredError}
|
|
126
|
+
*/
|
|
127
|
+
async validate(body: CellphoneValidationDto, authorization: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
128
|
+
return CellphoneApiFp(configuration).validate(body, authorization, options).then((request) => request(axios, basePath));
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* CellphoneApi - object-oriented interface
|
|
135
|
+
* @export
|
|
136
|
+
* @class CellphoneApi
|
|
137
|
+
* @extends {BaseAPI}
|
|
138
|
+
*/
|
|
139
|
+
export class CellphoneApi extends BaseAPI {
|
|
140
|
+
/**
|
|
141
|
+
*
|
|
142
|
+
* @param {CellphoneValidationDto} body
|
|
143
|
+
* @param {string} authorization Custom header
|
|
144
|
+
* @param {*} [options] Override http request option.
|
|
145
|
+
* @throws {RequiredError}
|
|
146
|
+
* @memberof CellphoneApi
|
|
147
|
+
*/
|
|
148
|
+
public async validate(body: CellphoneValidationDto, authorization: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
149
|
+
return CellphoneApiFp(this.configuration).validate(body, authorization, options).then((request) => request(this.axios, this.basePath));
|
|
150
|
+
}
|
|
151
|
+
}
|
package/apis/chats-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 { AssignToMeDto } from '../models';
|
|
21
|
+
import { AssignmentTypeDto } from '../models';
|
|
21
22
|
import { MarkChatUnreadDto } from '../models';
|
|
22
23
|
import { PaginationChatResponseDto } from '../models';
|
|
23
24
|
import { WhatsappChatResponseDTO } from '../models';
|
|
@@ -75,6 +76,60 @@ export const ChatsApiAxiosParamCreator = function (configuration?: Configuration
|
|
|
75
76
|
options: localVarRequestOptions,
|
|
76
77
|
};
|
|
77
78
|
},
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @param {AssignmentTypeDto} body
|
|
82
|
+
* @param {string} cellphone
|
|
83
|
+
* @param {number} id
|
|
84
|
+
* @param {*} [options] Override http request option.
|
|
85
|
+
* @throws {RequiredError}
|
|
86
|
+
*/
|
|
87
|
+
assignmentType: async (body: AssignmentTypeDto, cellphone: string, id: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
88
|
+
// verify required parameter 'body' is not null or undefined
|
|
89
|
+
if (body === null || body === undefined) {
|
|
90
|
+
throw new RequiredError('body','Required parameter body was null or undefined when calling assignmentType.');
|
|
91
|
+
}
|
|
92
|
+
// verify required parameter 'cellphone' is not null or undefined
|
|
93
|
+
if (cellphone === null || cellphone === undefined) {
|
|
94
|
+
throw new RequiredError('cellphone','Required parameter cellphone was null or undefined when calling assignmentType.');
|
|
95
|
+
}
|
|
96
|
+
// verify required parameter 'id' is not null or undefined
|
|
97
|
+
if (id === null || id === undefined) {
|
|
98
|
+
throw new RequiredError('id','Required parameter id was null or undefined when calling assignmentType.');
|
|
99
|
+
}
|
|
100
|
+
const localVarPath = `/api/chats/{cellphone}/assignment-type`
|
|
101
|
+
.replace(`{${"cellphone"}}`, encodeURIComponent(String(cellphone)))
|
|
102
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
103
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
104
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
105
|
+
let baseOptions;
|
|
106
|
+
if (configuration) {
|
|
107
|
+
baseOptions = configuration.baseOptions;
|
|
108
|
+
}
|
|
109
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'PUT', ...baseOptions, ...options};
|
|
110
|
+
const localVarHeaderParameter = {} as any;
|
|
111
|
+
const localVarQueryParameter = {} as any;
|
|
112
|
+
|
|
113
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
114
|
+
|
|
115
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
116
|
+
for (const key in localVarQueryParameter) {
|
|
117
|
+
query.set(key, localVarQueryParameter[key]);
|
|
118
|
+
}
|
|
119
|
+
for (const key in options.params) {
|
|
120
|
+
query.set(key, options.params[key]);
|
|
121
|
+
}
|
|
122
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
123
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
124
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
125
|
+
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
126
|
+
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
130
|
+
options: localVarRequestOptions,
|
|
131
|
+
};
|
|
132
|
+
},
|
|
78
133
|
/**
|
|
79
134
|
*
|
|
80
135
|
* @param {number} id
|
|
@@ -124,10 +179,12 @@ export const ChatsApiAxiosParamCreator = function (configuration?: Configuration
|
|
|
124
179
|
* @param {number} [currentPage]
|
|
125
180
|
* @param {number} [userId]
|
|
126
181
|
* @param {boolean} [externallyInitiated]
|
|
182
|
+
* @param {number} [id]
|
|
183
|
+
* @param {any} [assignmentType]
|
|
127
184
|
* @param {*} [options] Override http request option.
|
|
128
185
|
* @throws {RequiredError}
|
|
129
186
|
*/
|
|
130
|
-
getChats: async (branchId: number, q?: string, unassigned?: boolean, unread?: boolean, rowsPerPage?: number, currentPage?: number, userId?: number, externallyInitiated?: boolean, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
187
|
+
getChats: async (branchId: number, q?: string, unassigned?: boolean, unread?: boolean, rowsPerPage?: number, currentPage?: number, userId?: number, externallyInitiated?: boolean, id?: number, assignmentType?: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
131
188
|
// verify required parameter 'branchId' is not null or undefined
|
|
132
189
|
if (branchId === null || branchId === undefined) {
|
|
133
190
|
throw new RequiredError('branchId','Required parameter branchId was null or undefined when calling getChats.');
|
|
@@ -175,6 +232,14 @@ export const ChatsApiAxiosParamCreator = function (configuration?: Configuration
|
|
|
175
232
|
localVarQueryParameter['externallyInitiated'] = externallyInitiated;
|
|
176
233
|
}
|
|
177
234
|
|
|
235
|
+
if (id !== undefined) {
|
|
236
|
+
localVarQueryParameter['id'] = id;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (assignmentType !== undefined) {
|
|
240
|
+
localVarQueryParameter['assignmentType'] = assignmentType;
|
|
241
|
+
}
|
|
242
|
+
|
|
178
243
|
const query = new URLSearchParams(localVarUrlObj.search);
|
|
179
244
|
for (const key in localVarQueryParameter) {
|
|
180
245
|
query.set(key, localVarQueryParameter[key]);
|
|
@@ -262,6 +327,21 @@ export const ChatsApiFp = function(configuration?: Configuration) {
|
|
|
262
327
|
return axios.request(axiosRequestArgs);
|
|
263
328
|
};
|
|
264
329
|
},
|
|
330
|
+
/**
|
|
331
|
+
*
|
|
332
|
+
* @param {AssignmentTypeDto} body
|
|
333
|
+
* @param {string} cellphone
|
|
334
|
+
* @param {number} id
|
|
335
|
+
* @param {*} [options] Override http request option.
|
|
336
|
+
* @throws {RequiredError}
|
|
337
|
+
*/
|
|
338
|
+
async assignmentType(body: AssignmentTypeDto, cellphone: string, id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
|
339
|
+
const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).assignmentType(body, cellphone, id, options);
|
|
340
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
341
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
342
|
+
return axios.request(axiosRequestArgs);
|
|
343
|
+
};
|
|
344
|
+
},
|
|
265
345
|
/**
|
|
266
346
|
*
|
|
267
347
|
* @param {number} id
|
|
@@ -285,11 +365,13 @@ export const ChatsApiFp = function(configuration?: Configuration) {
|
|
|
285
365
|
* @param {number} [currentPage]
|
|
286
366
|
* @param {number} [userId]
|
|
287
367
|
* @param {boolean} [externallyInitiated]
|
|
368
|
+
* @param {number} [id]
|
|
369
|
+
* @param {any} [assignmentType]
|
|
288
370
|
* @param {*} [options] Override http request option.
|
|
289
371
|
* @throws {RequiredError}
|
|
290
372
|
*/
|
|
291
|
-
async getChats(branchId: number, q?: string, unassigned?: boolean, unread?: boolean, rowsPerPage?: number, currentPage?: number, userId?: number, externallyInitiated?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PaginationChatResponseDto>>> {
|
|
292
|
-
const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).getChats(branchId, q, unassigned, unread, rowsPerPage, currentPage, userId, externallyInitiated, options);
|
|
373
|
+
async getChats(branchId: number, q?: string, unassigned?: boolean, unread?: boolean, rowsPerPage?: number, currentPage?: number, userId?: number, externallyInitiated?: boolean, id?: number, assignmentType?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PaginationChatResponseDto>>> {
|
|
374
|
+
const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).getChats(branchId, q, unassigned, unread, rowsPerPage, currentPage, userId, externallyInitiated, id, assignmentType, options);
|
|
293
375
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
294
376
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
295
377
|
return axios.request(axiosRequestArgs);
|
|
@@ -328,6 +410,17 @@ export const ChatsApiFactory = function (configuration?: Configuration, basePath
|
|
|
328
410
|
async assignToMe(body: AssignToMeDto, id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
329
411
|
return ChatsApiFp(configuration).assignToMe(body, id, options).then((request) => request(axios, basePath));
|
|
330
412
|
},
|
|
413
|
+
/**
|
|
414
|
+
*
|
|
415
|
+
* @param {AssignmentTypeDto} body
|
|
416
|
+
* @param {string} cellphone
|
|
417
|
+
* @param {number} id
|
|
418
|
+
* @param {*} [options] Override http request option.
|
|
419
|
+
* @throws {RequiredError}
|
|
420
|
+
*/
|
|
421
|
+
async assignmentType(body: AssignmentTypeDto, cellphone: string, id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
422
|
+
return ChatsApiFp(configuration).assignmentType(body, cellphone, id, options).then((request) => request(axios, basePath));
|
|
423
|
+
},
|
|
331
424
|
/**
|
|
332
425
|
*
|
|
333
426
|
* @param {number} id
|
|
@@ -347,11 +440,13 @@ export const ChatsApiFactory = function (configuration?: Configuration, basePath
|
|
|
347
440
|
* @param {number} [currentPage]
|
|
348
441
|
* @param {number} [userId]
|
|
349
442
|
* @param {boolean} [externallyInitiated]
|
|
443
|
+
* @param {number} [id]
|
|
444
|
+
* @param {any} [assignmentType]
|
|
350
445
|
* @param {*} [options] Override http request option.
|
|
351
446
|
* @throws {RequiredError}
|
|
352
447
|
*/
|
|
353
|
-
async getChats(branchId: number, q?: string, unassigned?: boolean, unread?: boolean, rowsPerPage?: number, currentPage?: number, userId?: number, externallyInitiated?: boolean, options?: AxiosRequestConfig): Promise<AxiosResponse<PaginationChatResponseDto>> {
|
|
354
|
-
return ChatsApiFp(configuration).getChats(branchId, q, unassigned, unread, rowsPerPage, currentPage, userId, externallyInitiated, options).then((request) => request(axios, basePath));
|
|
448
|
+
async getChats(branchId: number, q?: string, unassigned?: boolean, unread?: boolean, rowsPerPage?: number, currentPage?: number, userId?: number, externallyInitiated?: boolean, id?: number, assignmentType?: any, options?: AxiosRequestConfig): Promise<AxiosResponse<PaginationChatResponseDto>> {
|
|
449
|
+
return ChatsApiFp(configuration).getChats(branchId, q, unassigned, unread, rowsPerPage, currentPage, userId, externallyInitiated, id, assignmentType, options).then((request) => request(axios, basePath));
|
|
355
450
|
},
|
|
356
451
|
/**
|
|
357
452
|
*
|
|
@@ -384,6 +479,18 @@ export class ChatsApi extends BaseAPI {
|
|
|
384
479
|
public async assignToMe(body: AssignToMeDto, id: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
385
480
|
return ChatsApiFp(this.configuration).assignToMe(body, id, options).then((request) => request(this.axios, this.basePath));
|
|
386
481
|
}
|
|
482
|
+
/**
|
|
483
|
+
*
|
|
484
|
+
* @param {AssignmentTypeDto} body
|
|
485
|
+
* @param {string} cellphone
|
|
486
|
+
* @param {number} id
|
|
487
|
+
* @param {*} [options] Override http request option.
|
|
488
|
+
* @throws {RequiredError}
|
|
489
|
+
* @memberof ChatsApi
|
|
490
|
+
*/
|
|
491
|
+
public async assignmentType(body: AssignmentTypeDto, cellphone: string, id: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
492
|
+
return ChatsApiFp(this.configuration).assignmentType(body, cellphone, id, options).then((request) => request(this.axios, this.basePath));
|
|
493
|
+
}
|
|
387
494
|
/**
|
|
388
495
|
*
|
|
389
496
|
* @param {number} id
|
|
@@ -404,12 +511,14 @@ export class ChatsApi extends BaseAPI {
|
|
|
404
511
|
* @param {number} [currentPage]
|
|
405
512
|
* @param {number} [userId]
|
|
406
513
|
* @param {boolean} [externallyInitiated]
|
|
514
|
+
* @param {number} [id]
|
|
515
|
+
* @param {any} [assignmentType]
|
|
407
516
|
* @param {*} [options] Override http request option.
|
|
408
517
|
* @throws {RequiredError}
|
|
409
518
|
* @memberof ChatsApi
|
|
410
519
|
*/
|
|
411
|
-
public async getChats(branchId: number, q?: string, unassigned?: boolean, unread?: boolean, rowsPerPage?: number, currentPage?: number, userId?: number, externallyInitiated?: boolean, options?: AxiosRequestConfig) : Promise<AxiosResponse<PaginationChatResponseDto>> {
|
|
412
|
-
return ChatsApiFp(this.configuration).getChats(branchId, q, unassigned, unread, rowsPerPage, currentPage, userId, externallyInitiated, options).then((request) => request(this.axios, this.basePath));
|
|
520
|
+
public async getChats(branchId: number, q?: string, unassigned?: boolean, unread?: boolean, rowsPerPage?: number, currentPage?: number, userId?: number, externallyInitiated?: boolean, id?: number, assignmentType?: any, options?: AxiosRequestConfig) : Promise<AxiosResponse<PaginationChatResponseDto>> {
|
|
521
|
+
return ChatsApiFp(this.configuration).getChats(branchId, q, unassigned, unread, rowsPerPage, currentPage, userId, externallyInitiated, id, assignmentType, options).then((request) => request(this.axios, this.basePath));
|
|
413
522
|
}
|
|
414
523
|
/**
|
|
415
524
|
*
|