@libgot/whatsapp-bridge-sdk 1.0.0
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 +45 -0
- package/api.ts +19 -0
- package/apis/auth-api.ts +274 -0
- package/apis/contacts-api.ts +117 -0
- package/apis/default-api.ts +178 -0
- package/apis/healthchecks-api.ts +179 -0
- package/apis/users-api.ts +405 -0
- package/base.ts +70 -0
- package/configuration.ts +83 -0
- package/git_push.sh +53 -0
- package/index.ts +18 -0
- package/models/api-request-user-update-password-dto.ts +29 -0
- package/models/api-response-auth-dto.ts +29 -0
- package/models/api-response-user-dto.ts +29 -0
- package/models/attributes.ts +36 -0
- package/models/auth-dto.ts +36 -0
- package/models/contacts-response-dto.ts +29 -0
- package/models/data-dto.ts +29 -0
- package/models/data-unauthorized-dto.ts +34 -0
- package/models/index.ts +19 -0
- package/models/inline-response503-info.ts +28 -0
- package/models/inline-response503.ts +51 -0
- package/models/message-dto.ts +22 -0
- package/models/role-dto.ts +43 -0
- package/models/status-dto.ts +36 -0
- package/models/tokens-dto.ts +36 -0
- package/models/unauthorized-dto.ts +29 -0
- package/models/unauthorized-token-dto.ts +34 -0
- package/models/user-detail-dto.ts +57 -0
- package/models/user-update-password-dto.ts +43 -0
- package/models/whatsapp-contact-dto.ts +50 -0
- package/package.json +34 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,179 @@
|
|
|
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 { InlineResponse503 } from '../models';
|
|
21
|
+
/**
|
|
22
|
+
* HealthchecksApi - axios parameter creator
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
export const HealthchecksApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
26
|
+
return {
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @param {*} [options] Override http request option.
|
|
30
|
+
* @throws {RequiredError}
|
|
31
|
+
*/
|
|
32
|
+
healthcheckControllerLiveness: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
33
|
+
const localVarPath = `/api/healthcheck/liveness`;
|
|
34
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
35
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
36
|
+
let baseOptions;
|
|
37
|
+
if (configuration) {
|
|
38
|
+
baseOptions = configuration.baseOptions;
|
|
39
|
+
}
|
|
40
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
|
41
|
+
const localVarHeaderParameter = {} as any;
|
|
42
|
+
const localVarQueryParameter = {} as any;
|
|
43
|
+
|
|
44
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
45
|
+
for (const key in localVarQueryParameter) {
|
|
46
|
+
query.set(key, localVarQueryParameter[key]);
|
|
47
|
+
}
|
|
48
|
+
for (const key in options.params) {
|
|
49
|
+
query.set(key, options.params[key]);
|
|
50
|
+
}
|
|
51
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
52
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
53
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
57
|
+
options: localVarRequestOptions,
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @param {*} [options] Override http request option.
|
|
63
|
+
* @throws {RequiredError}
|
|
64
|
+
*/
|
|
65
|
+
healthcheckControllerReadiness: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
66
|
+
const localVarPath = `/api/healthcheck/readiness`;
|
|
67
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
68
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
69
|
+
let baseOptions;
|
|
70
|
+
if (configuration) {
|
|
71
|
+
baseOptions = configuration.baseOptions;
|
|
72
|
+
}
|
|
73
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
|
74
|
+
const localVarHeaderParameter = {} as any;
|
|
75
|
+
const localVarQueryParameter = {} as any;
|
|
76
|
+
|
|
77
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
78
|
+
for (const key in localVarQueryParameter) {
|
|
79
|
+
query.set(key, localVarQueryParameter[key]);
|
|
80
|
+
}
|
|
81
|
+
for (const key in options.params) {
|
|
82
|
+
query.set(key, options.params[key]);
|
|
83
|
+
}
|
|
84
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
85
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
86
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
90
|
+
options: localVarRequestOptions,
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* HealthchecksApi - functional programming interface
|
|
98
|
+
* @export
|
|
99
|
+
*/
|
|
100
|
+
export const HealthchecksApiFp = function(configuration?: Configuration) {
|
|
101
|
+
return {
|
|
102
|
+
/**
|
|
103
|
+
*
|
|
104
|
+
* @param {*} [options] Override http request option.
|
|
105
|
+
* @throws {RequiredError}
|
|
106
|
+
*/
|
|
107
|
+
async healthcheckControllerLiveness(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
|
108
|
+
const localVarAxiosArgs = await HealthchecksApiAxiosParamCreator(configuration).healthcheckControllerLiveness(options);
|
|
109
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
110
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
111
|
+
return axios.request(axiosRequestArgs);
|
|
112
|
+
};
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
*
|
|
116
|
+
* @param {*} [options] Override http request option.
|
|
117
|
+
* @throws {RequiredError}
|
|
118
|
+
*/
|
|
119
|
+
async healthcheckControllerReadiness(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
|
120
|
+
const localVarAxiosArgs = await HealthchecksApiAxiosParamCreator(configuration).healthcheckControllerReadiness(options);
|
|
121
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
122
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
123
|
+
return axios.request(axiosRequestArgs);
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* HealthchecksApi - factory interface
|
|
131
|
+
* @export
|
|
132
|
+
*/
|
|
133
|
+
export const HealthchecksApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
134
|
+
return {
|
|
135
|
+
/**
|
|
136
|
+
*
|
|
137
|
+
* @param {*} [options] Override http request option.
|
|
138
|
+
* @throws {RequiredError}
|
|
139
|
+
*/
|
|
140
|
+
async healthcheckControllerLiveness(options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
141
|
+
return HealthchecksApiFp(configuration).healthcheckControllerLiveness(options).then((request) => request(axios, basePath));
|
|
142
|
+
},
|
|
143
|
+
/**
|
|
144
|
+
*
|
|
145
|
+
* @param {*} [options] Override http request option.
|
|
146
|
+
* @throws {RequiredError}
|
|
147
|
+
*/
|
|
148
|
+
async healthcheckControllerReadiness(options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
149
|
+
return HealthchecksApiFp(configuration).healthcheckControllerReadiness(options).then((request) => request(axios, basePath));
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* HealthchecksApi - object-oriented interface
|
|
156
|
+
* @export
|
|
157
|
+
* @class HealthchecksApi
|
|
158
|
+
* @extends {BaseAPI}
|
|
159
|
+
*/
|
|
160
|
+
export class HealthchecksApi extends BaseAPI {
|
|
161
|
+
/**
|
|
162
|
+
*
|
|
163
|
+
* @param {*} [options] Override http request option.
|
|
164
|
+
* @throws {RequiredError}
|
|
165
|
+
* @memberof HealthchecksApi
|
|
166
|
+
*/
|
|
167
|
+
public async healthcheckControllerLiveness(options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
168
|
+
return HealthchecksApiFp(this.configuration).healthcheckControllerLiveness(options).then((request) => request(this.axios, this.basePath));
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
*
|
|
172
|
+
* @param {*} [options] Override http request option.
|
|
173
|
+
* @throws {RequiredError}
|
|
174
|
+
* @memberof HealthchecksApi
|
|
175
|
+
*/
|
|
176
|
+
public async healthcheckControllerReadiness(options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
177
|
+
return HealthchecksApiFp(this.configuration).healthcheckControllerReadiness(options).then((request) => request(this.axios, this.basePath));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,405 @@
|
|
|
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 { ApiRequestUserUpdatePasswordDto } from '../models';
|
|
21
|
+
import { ApiResponseUserDto } from '../models';
|
|
22
|
+
/**
|
|
23
|
+
* UsersApi - axios parameter creator
|
|
24
|
+
* @export
|
|
25
|
+
*/
|
|
26
|
+
export const UsersApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
27
|
+
return {
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param {ApiRequestUserUpdatePasswordDto} body
|
|
31
|
+
* @param {*} [options] Override http request option.
|
|
32
|
+
* @throws {RequiredError}
|
|
33
|
+
*/
|
|
34
|
+
createSetter: async (body: ApiRequestUserUpdatePasswordDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
35
|
+
// verify required parameter 'body' is not null or undefined
|
|
36
|
+
if (body === null || body === undefined) {
|
|
37
|
+
throw new RequiredError('body','Required parameter body was null or undefined when calling createSetter.');
|
|
38
|
+
}
|
|
39
|
+
const localVarPath = `/api/users/update-password`;
|
|
40
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
41
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
42
|
+
let baseOptions;
|
|
43
|
+
if (configuration) {
|
|
44
|
+
baseOptions = configuration.baseOptions;
|
|
45
|
+
}
|
|
46
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
|
|
47
|
+
const localVarHeaderParameter = {} as any;
|
|
48
|
+
const localVarQueryParameter = {} as any;
|
|
49
|
+
|
|
50
|
+
// authentication access-token required
|
|
51
|
+
// http bearer authentication required
|
|
52
|
+
if (configuration && configuration.accessToken) {
|
|
53
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
54
|
+
? await configuration.accessToken()
|
|
55
|
+
: await configuration.accessToken;
|
|
56
|
+
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
60
|
+
|
|
61
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
62
|
+
for (const key in localVarQueryParameter) {
|
|
63
|
+
query.set(key, localVarQueryParameter[key]);
|
|
64
|
+
}
|
|
65
|
+
for (const key in options.params) {
|
|
66
|
+
query.set(key, options.params[key]);
|
|
67
|
+
}
|
|
68
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
69
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
70
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
71
|
+
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
72
|
+
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
76
|
+
options: localVarRequestOptions,
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @param {*} [options] Override http request option.
|
|
82
|
+
* @throws {RequiredError}
|
|
83
|
+
*/
|
|
84
|
+
usersControllerGet: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
85
|
+
const localVarPath = `/api/users`;
|
|
86
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
87
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
88
|
+
let baseOptions;
|
|
89
|
+
if (configuration) {
|
|
90
|
+
baseOptions = configuration.baseOptions;
|
|
91
|
+
}
|
|
92
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
|
93
|
+
const localVarHeaderParameter = {} as any;
|
|
94
|
+
const localVarQueryParameter = {} as any;
|
|
95
|
+
|
|
96
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
97
|
+
for (const key in localVarQueryParameter) {
|
|
98
|
+
query.set(key, localVarQueryParameter[key]);
|
|
99
|
+
}
|
|
100
|
+
for (const key in options.params) {
|
|
101
|
+
query.set(key, options.params[key]);
|
|
102
|
+
}
|
|
103
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
104
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
105
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
106
|
+
|
|
107
|
+
return {
|
|
108
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
109
|
+
options: localVarRequestOptions,
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
*
|
|
114
|
+
* @param {number} id
|
|
115
|
+
* @param {*} [options] Override http request option.
|
|
116
|
+
* @throws {RequiredError}
|
|
117
|
+
*/
|
|
118
|
+
usersControllerShow: async (id: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
119
|
+
// verify required parameter 'id' is not null or undefined
|
|
120
|
+
if (id === null || id === undefined) {
|
|
121
|
+
throw new RequiredError('id','Required parameter id was null or undefined when calling usersControllerShow.');
|
|
122
|
+
}
|
|
123
|
+
const localVarPath = `/api/users/{id}`
|
|
124
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
125
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
126
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
127
|
+
let baseOptions;
|
|
128
|
+
if (configuration) {
|
|
129
|
+
baseOptions = configuration.baseOptions;
|
|
130
|
+
}
|
|
131
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
|
132
|
+
const localVarHeaderParameter = {} as any;
|
|
133
|
+
const localVarQueryParameter = {} as any;
|
|
134
|
+
|
|
135
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
136
|
+
for (const key in localVarQueryParameter) {
|
|
137
|
+
query.set(key, localVarQueryParameter[key]);
|
|
138
|
+
}
|
|
139
|
+
for (const key in options.params) {
|
|
140
|
+
query.set(key, options.params[key]);
|
|
141
|
+
}
|
|
142
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
143
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
144
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
145
|
+
|
|
146
|
+
return {
|
|
147
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
148
|
+
options: localVarRequestOptions,
|
|
149
|
+
};
|
|
150
|
+
},
|
|
151
|
+
/**
|
|
152
|
+
*
|
|
153
|
+
* @param {*} [options] Override http request option.
|
|
154
|
+
* @throws {RequiredError}
|
|
155
|
+
*/
|
|
156
|
+
usersControllerStore: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
157
|
+
const localVarPath = `/api/users`;
|
|
158
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
159
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
160
|
+
let baseOptions;
|
|
161
|
+
if (configuration) {
|
|
162
|
+
baseOptions = configuration.baseOptions;
|
|
163
|
+
}
|
|
164
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
|
165
|
+
const localVarHeaderParameter = {} as any;
|
|
166
|
+
const localVarQueryParameter = {} as any;
|
|
167
|
+
|
|
168
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
169
|
+
for (const key in localVarQueryParameter) {
|
|
170
|
+
query.set(key, localVarQueryParameter[key]);
|
|
171
|
+
}
|
|
172
|
+
for (const key in options.params) {
|
|
173
|
+
query.set(key, options.params[key]);
|
|
174
|
+
}
|
|
175
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
176
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
177
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
178
|
+
|
|
179
|
+
return {
|
|
180
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
181
|
+
options: localVarRequestOptions,
|
|
182
|
+
};
|
|
183
|
+
},
|
|
184
|
+
/**
|
|
185
|
+
*
|
|
186
|
+
* @param {number} id
|
|
187
|
+
* @param {*} [options] Override http request option.
|
|
188
|
+
* @throws {RequiredError}
|
|
189
|
+
*/
|
|
190
|
+
usersControllerUpdate: async (id: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
191
|
+
// verify required parameter 'id' is not null or undefined
|
|
192
|
+
if (id === null || id === undefined) {
|
|
193
|
+
throw new RequiredError('id','Required parameter id was null or undefined when calling usersControllerUpdate.');
|
|
194
|
+
}
|
|
195
|
+
const localVarPath = `/api/users/{id}`
|
|
196
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
197
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
198
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
199
|
+
let baseOptions;
|
|
200
|
+
if (configuration) {
|
|
201
|
+
baseOptions = configuration.baseOptions;
|
|
202
|
+
}
|
|
203
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'PUT', ...baseOptions, ...options};
|
|
204
|
+
const localVarHeaderParameter = {} as any;
|
|
205
|
+
const localVarQueryParameter = {} as any;
|
|
206
|
+
|
|
207
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
208
|
+
for (const key in localVarQueryParameter) {
|
|
209
|
+
query.set(key, localVarQueryParameter[key]);
|
|
210
|
+
}
|
|
211
|
+
for (const key in options.params) {
|
|
212
|
+
query.set(key, options.params[key]);
|
|
213
|
+
}
|
|
214
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
215
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
216
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
217
|
+
|
|
218
|
+
return {
|
|
219
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
220
|
+
options: localVarRequestOptions,
|
|
221
|
+
};
|
|
222
|
+
},
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* UsersApi - functional programming interface
|
|
228
|
+
* @export
|
|
229
|
+
*/
|
|
230
|
+
export const UsersApiFp = function(configuration?: Configuration) {
|
|
231
|
+
return {
|
|
232
|
+
/**
|
|
233
|
+
*
|
|
234
|
+
* @param {ApiRequestUserUpdatePasswordDto} body
|
|
235
|
+
* @param {*} [options] Override http request option.
|
|
236
|
+
* @throws {RequiredError}
|
|
237
|
+
*/
|
|
238
|
+
async createSetter(body: ApiRequestUserUpdatePasswordDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ApiResponseUserDto>>> {
|
|
239
|
+
const localVarAxiosArgs = await UsersApiAxiosParamCreator(configuration).createSetter(body, options);
|
|
240
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
241
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
242
|
+
return axios.request(axiosRequestArgs);
|
|
243
|
+
};
|
|
244
|
+
},
|
|
245
|
+
/**
|
|
246
|
+
*
|
|
247
|
+
* @param {*} [options] Override http request option.
|
|
248
|
+
* @throws {RequiredError}
|
|
249
|
+
*/
|
|
250
|
+
async usersControllerGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
|
251
|
+
const localVarAxiosArgs = await UsersApiAxiosParamCreator(configuration).usersControllerGet(options);
|
|
252
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
253
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
254
|
+
return axios.request(axiosRequestArgs);
|
|
255
|
+
};
|
|
256
|
+
},
|
|
257
|
+
/**
|
|
258
|
+
*
|
|
259
|
+
* @param {number} id
|
|
260
|
+
* @param {*} [options] Override http request option.
|
|
261
|
+
* @throws {RequiredError}
|
|
262
|
+
*/
|
|
263
|
+
async usersControllerShow(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
|
264
|
+
const localVarAxiosArgs = await UsersApiAxiosParamCreator(configuration).usersControllerShow(id, options);
|
|
265
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
266
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
267
|
+
return axios.request(axiosRequestArgs);
|
|
268
|
+
};
|
|
269
|
+
},
|
|
270
|
+
/**
|
|
271
|
+
*
|
|
272
|
+
* @param {*} [options] Override http request option.
|
|
273
|
+
* @throws {RequiredError}
|
|
274
|
+
*/
|
|
275
|
+
async usersControllerStore(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
|
276
|
+
const localVarAxiosArgs = await UsersApiAxiosParamCreator(configuration).usersControllerStore(options);
|
|
277
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
278
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
279
|
+
return axios.request(axiosRequestArgs);
|
|
280
|
+
};
|
|
281
|
+
},
|
|
282
|
+
/**
|
|
283
|
+
*
|
|
284
|
+
* @param {number} id
|
|
285
|
+
* @param {*} [options] Override http request option.
|
|
286
|
+
* @throws {RequiredError}
|
|
287
|
+
*/
|
|
288
|
+
async usersControllerUpdate(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
|
289
|
+
const localVarAxiosArgs = await UsersApiAxiosParamCreator(configuration).usersControllerUpdate(id, options);
|
|
290
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
291
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
292
|
+
return axios.request(axiosRequestArgs);
|
|
293
|
+
};
|
|
294
|
+
},
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* UsersApi - factory interface
|
|
300
|
+
* @export
|
|
301
|
+
*/
|
|
302
|
+
export const UsersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
303
|
+
return {
|
|
304
|
+
/**
|
|
305
|
+
*
|
|
306
|
+
* @param {ApiRequestUserUpdatePasswordDto} body
|
|
307
|
+
* @param {*} [options] Override http request option.
|
|
308
|
+
* @throws {RequiredError}
|
|
309
|
+
*/
|
|
310
|
+
async createSetter(body: ApiRequestUserUpdatePasswordDto, options?: AxiosRequestConfig): Promise<AxiosResponse<ApiResponseUserDto>> {
|
|
311
|
+
return UsersApiFp(configuration).createSetter(body, options).then((request) => request(axios, basePath));
|
|
312
|
+
},
|
|
313
|
+
/**
|
|
314
|
+
*
|
|
315
|
+
* @param {*} [options] Override http request option.
|
|
316
|
+
* @throws {RequiredError}
|
|
317
|
+
*/
|
|
318
|
+
async usersControllerGet(options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
319
|
+
return UsersApiFp(configuration).usersControllerGet(options).then((request) => request(axios, basePath));
|
|
320
|
+
},
|
|
321
|
+
/**
|
|
322
|
+
*
|
|
323
|
+
* @param {number} id
|
|
324
|
+
* @param {*} [options] Override http request option.
|
|
325
|
+
* @throws {RequiredError}
|
|
326
|
+
*/
|
|
327
|
+
async usersControllerShow(id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
328
|
+
return UsersApiFp(configuration).usersControllerShow(id, options).then((request) => request(axios, basePath));
|
|
329
|
+
},
|
|
330
|
+
/**
|
|
331
|
+
*
|
|
332
|
+
* @param {*} [options] Override http request option.
|
|
333
|
+
* @throws {RequiredError}
|
|
334
|
+
*/
|
|
335
|
+
async usersControllerStore(options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
336
|
+
return UsersApiFp(configuration).usersControllerStore(options).then((request) => request(axios, basePath));
|
|
337
|
+
},
|
|
338
|
+
/**
|
|
339
|
+
*
|
|
340
|
+
* @param {number} id
|
|
341
|
+
* @param {*} [options] Override http request option.
|
|
342
|
+
* @throws {RequiredError}
|
|
343
|
+
*/
|
|
344
|
+
async usersControllerUpdate(id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
345
|
+
return UsersApiFp(configuration).usersControllerUpdate(id, options).then((request) => request(axios, basePath));
|
|
346
|
+
},
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* UsersApi - object-oriented interface
|
|
352
|
+
* @export
|
|
353
|
+
* @class UsersApi
|
|
354
|
+
* @extends {BaseAPI}
|
|
355
|
+
*/
|
|
356
|
+
export class UsersApi extends BaseAPI {
|
|
357
|
+
/**
|
|
358
|
+
*
|
|
359
|
+
* @param {ApiRequestUserUpdatePasswordDto} body
|
|
360
|
+
* @param {*} [options] Override http request option.
|
|
361
|
+
* @throws {RequiredError}
|
|
362
|
+
* @memberof UsersApi
|
|
363
|
+
*/
|
|
364
|
+
public async createSetter(body: ApiRequestUserUpdatePasswordDto, options?: AxiosRequestConfig) : Promise<AxiosResponse<ApiResponseUserDto>> {
|
|
365
|
+
return UsersApiFp(this.configuration).createSetter(body, options).then((request) => request(this.axios, this.basePath));
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
*
|
|
369
|
+
* @param {*} [options] Override http request option.
|
|
370
|
+
* @throws {RequiredError}
|
|
371
|
+
* @memberof UsersApi
|
|
372
|
+
*/
|
|
373
|
+
public async usersControllerGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
374
|
+
return UsersApiFp(this.configuration).usersControllerGet(options).then((request) => request(this.axios, this.basePath));
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
*
|
|
378
|
+
* @param {number} id
|
|
379
|
+
* @param {*} [options] Override http request option.
|
|
380
|
+
* @throws {RequiredError}
|
|
381
|
+
* @memberof UsersApi
|
|
382
|
+
*/
|
|
383
|
+
public async usersControllerShow(id: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
384
|
+
return UsersApiFp(this.configuration).usersControllerShow(id, options).then((request) => request(this.axios, this.basePath));
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
*
|
|
388
|
+
* @param {*} [options] Override http request option.
|
|
389
|
+
* @throws {RequiredError}
|
|
390
|
+
* @memberof UsersApi
|
|
391
|
+
*/
|
|
392
|
+
public async usersControllerStore(options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
393
|
+
return UsersApiFp(this.configuration).usersControllerStore(options).then((request) => request(this.axios, this.basePath));
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
*
|
|
397
|
+
* @param {number} id
|
|
398
|
+
* @param {*} [options] Override http request option.
|
|
399
|
+
* @throws {RequiredError}
|
|
400
|
+
* @memberof UsersApi
|
|
401
|
+
*/
|
|
402
|
+
public async usersControllerUpdate(id: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
403
|
+
return UsersApiFp(this.configuration).usersControllerUpdate(id, options).then((request) => request(this.axios, this.basePath));
|
|
404
|
+
}
|
|
405
|
+
}
|
package/base.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
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 { Configuration } from "./configuration";
|
|
16
|
+
// Some imports not used depending on template conditions
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
import globalAxios, { AxiosRequestConfig, AxiosInstance } from 'axios';
|
|
19
|
+
|
|
20
|
+
export const BASE_PATH = "http://api-whatsapp-bridge.local.libgot.com".replace(/\/+$/, "");
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @export
|
|
25
|
+
*/
|
|
26
|
+
export const COLLECTION_FORMATS = {
|
|
27
|
+
csv: ",",
|
|
28
|
+
ssv: " ",
|
|
29
|
+
tsv: "\t",
|
|
30
|
+
pipes: "|",
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @export
|
|
36
|
+
* @interface RequestArgs
|
|
37
|
+
*/
|
|
38
|
+
export interface RequestArgs {
|
|
39
|
+
url: string;
|
|
40
|
+
options: AxiosRequestConfig;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @export
|
|
46
|
+
* @class BaseAPI
|
|
47
|
+
*/
|
|
48
|
+
export class BaseAPI {
|
|
49
|
+
protected configuration: Configuration | undefined;
|
|
50
|
+
|
|
51
|
+
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
|
52
|
+
if (configuration) {
|
|
53
|
+
this.configuration = configuration;
|
|
54
|
+
this.basePath = configuration.basePath || this.basePath;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @export
|
|
62
|
+
* @class RequiredError
|
|
63
|
+
* @extends {Error}
|
|
64
|
+
*/
|
|
65
|
+
export class RequiredError extends Error {
|
|
66
|
+
name: "RequiredError" = "RequiredError";
|
|
67
|
+
constructor(public field: string, msg?: string) {
|
|
68
|
+
super(msg);
|
|
69
|
+
}
|
|
70
|
+
}
|