@libgot/whatsapp-bridge-sdk 1.0.10 → 1.0.11
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/apis/chats-api.ts +72 -0
- package/apis/messages-api.ts +19 -7
- package/dist/apis/chats-api.d.ts +30 -0
- package/dist/apis/chats-api.js +97 -0
- package/dist/apis/messages-api.d.ts +8 -4
- package/dist/apis/messages-api.js +21 -10
- package/dist/models/active-chat-dto.d.ts +31 -0
- package/dist/models/active-chat-dto.js +15 -0
- package/dist/models/active-chat-response-dto.d.ts +25 -0
- package/dist/models/active-chat-response-dto.js +15 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/models/whatsapp-chat-dto.d.ts +12 -0
- package/dist/models/whatsapp-contact-dto.d.ts +0 -6
- package/models/active-chat-dto.ts +36 -0
- package/models/active-chat-response-dto.ts +29 -0
- package/models/index.ts +2 -0
- package/models/whatsapp-chat-dto.ts +14 -0
- package/models/whatsapp-contact-dto.ts +0 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @1.0.
|
|
1
|
+
## @1.0.11
|
|
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.11 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
package/apis/chats-api.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { Configuration } from '../configuration';
|
|
|
17
17
|
// Some imports not used depending on template conditions
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
|
|
20
|
+
import { ActiveChatResponseDTO } from '../models';
|
|
20
21
|
import { ChatsResponseDTO } from '../models';
|
|
21
22
|
/**
|
|
22
23
|
* ChatsApi - axios parameter creator
|
|
@@ -24,6 +25,45 @@ import { ChatsResponseDTO } from '../models';
|
|
|
24
25
|
*/
|
|
25
26
|
export const ChatsApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
26
27
|
return {
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param {number} id
|
|
31
|
+
* @param {*} [options] Override http request option.
|
|
32
|
+
* @throws {RequiredError}
|
|
33
|
+
*/
|
|
34
|
+
getChat: async (id: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
35
|
+
// verify required parameter 'id' is not null or undefined
|
|
36
|
+
if (id === null || id === undefined) {
|
|
37
|
+
throw new RequiredError('id','Required parameter id was null or undefined when calling getChat.');
|
|
38
|
+
}
|
|
39
|
+
const localVarPath = `/api/chats/{id}`
|
|
40
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
41
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
42
|
+
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
43
|
+
let baseOptions;
|
|
44
|
+
if (configuration) {
|
|
45
|
+
baseOptions = configuration.baseOptions;
|
|
46
|
+
}
|
|
47
|
+
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
|
48
|
+
const localVarHeaderParameter = {} as any;
|
|
49
|
+
const localVarQueryParameter = {} as any;
|
|
50
|
+
|
|
51
|
+
const query = new URLSearchParams(localVarUrlObj.search);
|
|
52
|
+
for (const key in localVarQueryParameter) {
|
|
53
|
+
query.set(key, localVarQueryParameter[key]);
|
|
54
|
+
}
|
|
55
|
+
for (const key in options.params) {
|
|
56
|
+
query.set(key, options.params[key]);
|
|
57
|
+
}
|
|
58
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
59
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
60
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
64
|
+
options: localVarRequestOptions,
|
|
65
|
+
};
|
|
66
|
+
},
|
|
27
67
|
/**
|
|
28
68
|
*
|
|
29
69
|
* @param {*} [options] Override http request option.
|
|
@@ -66,6 +106,19 @@ export const ChatsApiAxiosParamCreator = function (configuration?: Configuration
|
|
|
66
106
|
*/
|
|
67
107
|
export const ChatsApiFp = function(configuration?: Configuration) {
|
|
68
108
|
return {
|
|
109
|
+
/**
|
|
110
|
+
*
|
|
111
|
+
* @param {number} id
|
|
112
|
+
* @param {*} [options] Override http request option.
|
|
113
|
+
* @throws {RequiredError}
|
|
114
|
+
*/
|
|
115
|
+
async getChat(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ActiveChatResponseDTO>>> {
|
|
116
|
+
const localVarAxiosArgs = await ChatsApiAxiosParamCreator(configuration).getChat(id, options);
|
|
117
|
+
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
118
|
+
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
119
|
+
return axios.request(axiosRequestArgs);
|
|
120
|
+
};
|
|
121
|
+
},
|
|
69
122
|
/**
|
|
70
123
|
*
|
|
71
124
|
* @param {*} [options] Override http request option.
|
|
@@ -87,6 +140,15 @@ export const ChatsApiFp = function(configuration?: Configuration) {
|
|
|
87
140
|
*/
|
|
88
141
|
export const ChatsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
89
142
|
return {
|
|
143
|
+
/**
|
|
144
|
+
*
|
|
145
|
+
* @param {number} id
|
|
146
|
+
* @param {*} [options] Override http request option.
|
|
147
|
+
* @throws {RequiredError}
|
|
148
|
+
*/
|
|
149
|
+
async getChat(id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<ActiveChatResponseDTO>> {
|
|
150
|
+
return ChatsApiFp(configuration).getChat(id, options).then((request) => request(axios, basePath));
|
|
151
|
+
},
|
|
90
152
|
/**
|
|
91
153
|
*
|
|
92
154
|
* @param {*} [options] Override http request option.
|
|
@@ -105,6 +167,16 @@ export const ChatsApiFactory = function (configuration?: Configuration, basePath
|
|
|
105
167
|
* @extends {BaseAPI}
|
|
106
168
|
*/
|
|
107
169
|
export class ChatsApi extends BaseAPI {
|
|
170
|
+
/**
|
|
171
|
+
*
|
|
172
|
+
* @param {number} id
|
|
173
|
+
* @param {*} [options] Override http request option.
|
|
174
|
+
* @throws {RequiredError}
|
|
175
|
+
* @memberof ChatsApi
|
|
176
|
+
*/
|
|
177
|
+
public async getChat(id: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<ActiveChatResponseDTO>> {
|
|
178
|
+
return ChatsApiFp(this.configuration).getChat(id, options).then((request) => request(this.axios, this.basePath));
|
|
179
|
+
}
|
|
108
180
|
/**
|
|
109
181
|
*
|
|
110
182
|
* @param {*} [options] Override http request option.
|
package/apis/messages-api.ts
CHANGED
|
@@ -26,10 +26,15 @@ export const MessagesApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
26
26
|
return {
|
|
27
27
|
/**
|
|
28
28
|
*
|
|
29
|
+
* @param {number} chatId
|
|
29
30
|
* @param {*} [options] Override http request option.
|
|
30
31
|
* @throws {RequiredError}
|
|
31
32
|
*/
|
|
32
|
-
getMessages: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
33
|
+
getMessages: async (chatId: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
34
|
+
// verify required parameter 'chatId' is not null or undefined
|
|
35
|
+
if (chatId === null || chatId === undefined) {
|
|
36
|
+
throw new RequiredError('chatId','Required parameter chatId was null or undefined when calling getMessages.');
|
|
37
|
+
}
|
|
33
38
|
const localVarPath = `/api/messages`;
|
|
34
39
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
35
40
|
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
@@ -41,6 +46,10 @@ export const MessagesApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
41
46
|
const localVarHeaderParameter = {} as any;
|
|
42
47
|
const localVarQueryParameter = {} as any;
|
|
43
48
|
|
|
49
|
+
if (chatId !== undefined) {
|
|
50
|
+
localVarQueryParameter['chatId'] = chatId;
|
|
51
|
+
}
|
|
52
|
+
|
|
44
53
|
const query = new URLSearchParams(localVarUrlObj.search);
|
|
45
54
|
for (const key in localVarQueryParameter) {
|
|
46
55
|
query.set(key, localVarQueryParameter[key]);
|
|
@@ -68,11 +77,12 @@ export const MessagesApiFp = function(configuration?: Configuration) {
|
|
|
68
77
|
return {
|
|
69
78
|
/**
|
|
70
79
|
*
|
|
80
|
+
* @param {number} chatId
|
|
71
81
|
* @param {*} [options] Override http request option.
|
|
72
82
|
* @throws {RequiredError}
|
|
73
83
|
*/
|
|
74
|
-
async getMessages(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<MessageResponseDto>>> {
|
|
75
|
-
const localVarAxiosArgs = await MessagesApiAxiosParamCreator(configuration).getMessages(options);
|
|
84
|
+
async getMessages(chatId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<MessageResponseDto>>> {
|
|
85
|
+
const localVarAxiosArgs = await MessagesApiAxiosParamCreator(configuration).getMessages(chatId, options);
|
|
76
86
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
77
87
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
78
88
|
return axios.request(axiosRequestArgs);
|
|
@@ -89,11 +99,12 @@ export const MessagesApiFactory = function (configuration?: Configuration, baseP
|
|
|
89
99
|
return {
|
|
90
100
|
/**
|
|
91
101
|
*
|
|
102
|
+
* @param {number} chatId
|
|
92
103
|
* @param {*} [options] Override http request option.
|
|
93
104
|
* @throws {RequiredError}
|
|
94
105
|
*/
|
|
95
|
-
async getMessages(options?: AxiosRequestConfig): Promise<AxiosResponse<MessageResponseDto>> {
|
|
96
|
-
return MessagesApiFp(configuration).getMessages(options).then((request) => request(axios, basePath));
|
|
106
|
+
async getMessages(chatId: number, options?: AxiosRequestConfig): Promise<AxiosResponse<MessageResponseDto>> {
|
|
107
|
+
return MessagesApiFp(configuration).getMessages(chatId, options).then((request) => request(axios, basePath));
|
|
97
108
|
},
|
|
98
109
|
};
|
|
99
110
|
};
|
|
@@ -107,11 +118,12 @@ export const MessagesApiFactory = function (configuration?: Configuration, baseP
|
|
|
107
118
|
export class MessagesApi extends BaseAPI {
|
|
108
119
|
/**
|
|
109
120
|
*
|
|
121
|
+
* @param {number} chatId
|
|
110
122
|
* @param {*} [options] Override http request option.
|
|
111
123
|
* @throws {RequiredError}
|
|
112
124
|
* @memberof MessagesApi
|
|
113
125
|
*/
|
|
114
|
-
public async getMessages(options?: AxiosRequestConfig) : Promise<AxiosResponse<MessageResponseDto>> {
|
|
115
|
-
return MessagesApiFp(this.configuration).getMessages(options).then((request) => request(this.axios, this.basePath));
|
|
126
|
+
public async getMessages(chatId: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<MessageResponseDto>> {
|
|
127
|
+
return MessagesApiFp(this.configuration).getMessages(chatId, options).then((request) => request(this.axios, this.basePath));
|
|
116
128
|
}
|
|
117
129
|
}
|
package/dist/apis/chats-api.d.ts
CHANGED
|
@@ -12,12 +12,20 @@
|
|
|
12
12
|
import { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
13
13
|
import { Configuration } from '../configuration';
|
|
14
14
|
import { RequestArgs, BaseAPI } from '../base';
|
|
15
|
+
import { ActiveChatResponseDTO } from '../models';
|
|
15
16
|
import { ChatsResponseDTO } from '../models';
|
|
16
17
|
/**
|
|
17
18
|
* ChatsApi - axios parameter creator
|
|
18
19
|
* @export
|
|
19
20
|
*/
|
|
20
21
|
export declare const ChatsApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param {number} id
|
|
25
|
+
* @param {*} [options] Override http request option.
|
|
26
|
+
* @throws {RequiredError}
|
|
27
|
+
*/
|
|
28
|
+
getChat: (id: number, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
21
29
|
/**
|
|
22
30
|
*
|
|
23
31
|
* @param {*} [options] Override http request option.
|
|
@@ -30,6 +38,13 @@ export declare const ChatsApiAxiosParamCreator: (configuration?: Configuration)
|
|
|
30
38
|
* @export
|
|
31
39
|
*/
|
|
32
40
|
export declare const ChatsApiFp: (configuration?: Configuration) => {
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @param {number} id
|
|
44
|
+
* @param {*} [options] Override http request option.
|
|
45
|
+
* @throws {RequiredError}
|
|
46
|
+
*/
|
|
47
|
+
getChat(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ActiveChatResponseDTO>>>;
|
|
33
48
|
/**
|
|
34
49
|
*
|
|
35
50
|
* @param {*} [options] Override http request option.
|
|
@@ -42,6 +57,13 @@ export declare const ChatsApiFp: (configuration?: Configuration) => {
|
|
|
42
57
|
* @export
|
|
43
58
|
*/
|
|
44
59
|
export declare const ChatsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @param {number} id
|
|
63
|
+
* @param {*} [options] Override http request option.
|
|
64
|
+
* @throws {RequiredError}
|
|
65
|
+
*/
|
|
66
|
+
getChat(id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<ActiveChatResponseDTO>>;
|
|
45
67
|
/**
|
|
46
68
|
*
|
|
47
69
|
* @param {*} [options] Override http request option.
|
|
@@ -56,6 +78,14 @@ export declare const ChatsApiFactory: (configuration?: Configuration, basePath?:
|
|
|
56
78
|
* @extends {BaseAPI}
|
|
57
79
|
*/
|
|
58
80
|
export declare class ChatsApi extends BaseAPI {
|
|
81
|
+
/**
|
|
82
|
+
*
|
|
83
|
+
* @param {number} id
|
|
84
|
+
* @param {*} [options] Override http request option.
|
|
85
|
+
* @throws {RequiredError}
|
|
86
|
+
* @memberof ChatsApi
|
|
87
|
+
*/
|
|
88
|
+
getChat(id: number, options?: AxiosRequestConfig): Promise<AxiosResponse<ActiveChatResponseDTO>>;
|
|
59
89
|
/**
|
|
60
90
|
*
|
|
61
91
|
* @param {*} [options] Override http request option.
|
package/dist/apis/chats-api.js
CHANGED
|
@@ -96,6 +96,51 @@ var base_1 = require("../base");
|
|
|
96
96
|
var ChatsApiAxiosParamCreator = function (configuration) {
|
|
97
97
|
var _this = this;
|
|
98
98
|
return {
|
|
99
|
+
/**
|
|
100
|
+
*
|
|
101
|
+
* @param {number} id
|
|
102
|
+
* @param {*} [options] Override http request option.
|
|
103
|
+
* @throws {RequiredError}
|
|
104
|
+
*/
|
|
105
|
+
getChat: function (id_1) {
|
|
106
|
+
var args_1 = [];
|
|
107
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
108
|
+
args_1[_i - 1] = arguments[_i];
|
|
109
|
+
}
|
|
110
|
+
return __awaiter(_this, __spreadArray([id_1], args_1, true), void 0, function (id, options) {
|
|
111
|
+
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, query, key, key, headersFromBaseOptions;
|
|
112
|
+
if (options === void 0) { options = {}; }
|
|
113
|
+
return __generator(this, function (_a) {
|
|
114
|
+
// verify required parameter 'id' is not null or undefined
|
|
115
|
+
if (id === null || id === undefined) {
|
|
116
|
+
throw new base_1.RequiredError('id', 'Required parameter id was null or undefined when calling getChat.');
|
|
117
|
+
}
|
|
118
|
+
localVarPath = "/api/chats/{id}"
|
|
119
|
+
.replace("{".concat("id", "}"), encodeURIComponent(String(id)));
|
|
120
|
+
localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
121
|
+
if (configuration) {
|
|
122
|
+
baseOptions = configuration.baseOptions;
|
|
123
|
+
}
|
|
124
|
+
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
|
125
|
+
localVarHeaderParameter = {};
|
|
126
|
+
localVarQueryParameter = {};
|
|
127
|
+
query = new URLSearchParams(localVarUrlObj.search);
|
|
128
|
+
for (key in localVarQueryParameter) {
|
|
129
|
+
query.set(key, localVarQueryParameter[key]);
|
|
130
|
+
}
|
|
131
|
+
for (key in options.params) {
|
|
132
|
+
query.set(key, options.params[key]);
|
|
133
|
+
}
|
|
134
|
+
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
135
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
136
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
137
|
+
return [2 /*return*/, {
|
|
138
|
+
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
139
|
+
options: localVarRequestOptions,
|
|
140
|
+
}];
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
},
|
|
99
144
|
/**
|
|
100
145
|
*
|
|
101
146
|
* @param {*} [options] Override http request option.
|
|
@@ -144,6 +189,30 @@ exports.ChatsApiAxiosParamCreator = ChatsApiAxiosParamCreator;
|
|
|
144
189
|
*/
|
|
145
190
|
var ChatsApiFp = function (configuration) {
|
|
146
191
|
return {
|
|
192
|
+
/**
|
|
193
|
+
*
|
|
194
|
+
* @param {number} id
|
|
195
|
+
* @param {*} [options] Override http request option.
|
|
196
|
+
* @throws {RequiredError}
|
|
197
|
+
*/
|
|
198
|
+
getChat: function (id, options) {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
200
|
+
var localVarAxiosArgs;
|
|
201
|
+
return __generator(this, function (_a) {
|
|
202
|
+
switch (_a.label) {
|
|
203
|
+
case 0: return [4 /*yield*/, (0, exports.ChatsApiAxiosParamCreator)(configuration).getChat(id, options)];
|
|
204
|
+
case 1:
|
|
205
|
+
localVarAxiosArgs = _a.sent();
|
|
206
|
+
return [2 /*return*/, function (axios, basePath) {
|
|
207
|
+
if (axios === void 0) { axios = axios_1.default; }
|
|
208
|
+
if (basePath === void 0) { basePath = base_1.BASE_PATH; }
|
|
209
|
+
var axiosRequestArgs = __assign(__assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
|
|
210
|
+
return axios.request(axiosRequestArgs);
|
|
211
|
+
}];
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
},
|
|
147
216
|
/**
|
|
148
217
|
*
|
|
149
218
|
* @param {*} [options] Override http request option.
|
|
@@ -176,6 +245,19 @@ exports.ChatsApiFp = ChatsApiFp;
|
|
|
176
245
|
*/
|
|
177
246
|
var ChatsApiFactory = function (configuration, basePath, axios) {
|
|
178
247
|
return {
|
|
248
|
+
/**
|
|
249
|
+
*
|
|
250
|
+
* @param {number} id
|
|
251
|
+
* @param {*} [options] Override http request option.
|
|
252
|
+
* @throws {RequiredError}
|
|
253
|
+
*/
|
|
254
|
+
getChat: function (id, options) {
|
|
255
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
256
|
+
return __generator(this, function (_a) {
|
|
257
|
+
return [2 /*return*/, (0, exports.ChatsApiFp)(configuration).getChat(id, options).then(function (request) { return request(axios, basePath); })];
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
},
|
|
179
261
|
/**
|
|
180
262
|
*
|
|
181
263
|
* @param {*} [options] Override http request option.
|
|
@@ -202,6 +284,21 @@ var ChatsApi = /** @class */ (function (_super) {
|
|
|
202
284
|
function ChatsApi() {
|
|
203
285
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
204
286
|
}
|
|
287
|
+
/**
|
|
288
|
+
*
|
|
289
|
+
* @param {number} id
|
|
290
|
+
* @param {*} [options] Override http request option.
|
|
291
|
+
* @throws {RequiredError}
|
|
292
|
+
* @memberof ChatsApi
|
|
293
|
+
*/
|
|
294
|
+
ChatsApi.prototype.getChat = function (id, options) {
|
|
295
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
296
|
+
var _this = this;
|
|
297
|
+
return __generator(this, function (_a) {
|
|
298
|
+
return [2 /*return*/, (0, exports.ChatsApiFp)(this.configuration).getChat(id, options).then(function (request) { return request(_this.axios, _this.basePath); })];
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
};
|
|
205
302
|
/**
|
|
206
303
|
*
|
|
207
304
|
* @param {*} [options] Override http request option.
|
|
@@ -20,10 +20,11 @@ import { MessageResponseDto } from '../models';
|
|
|
20
20
|
export declare const MessagesApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
21
21
|
/**
|
|
22
22
|
*
|
|
23
|
+
* @param {number} chatId
|
|
23
24
|
* @param {*} [options] Override http request option.
|
|
24
25
|
* @throws {RequiredError}
|
|
25
26
|
*/
|
|
26
|
-
getMessages: (options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
27
|
+
getMessages: (chatId: number, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
27
28
|
};
|
|
28
29
|
/**
|
|
29
30
|
* MessagesApi - functional programming interface
|
|
@@ -32,10 +33,11 @@ export declare const MessagesApiAxiosParamCreator: (configuration?: Configuratio
|
|
|
32
33
|
export declare const MessagesApiFp: (configuration?: Configuration) => {
|
|
33
34
|
/**
|
|
34
35
|
*
|
|
36
|
+
* @param {number} chatId
|
|
35
37
|
* @param {*} [options] Override http request option.
|
|
36
38
|
* @throws {RequiredError}
|
|
37
39
|
*/
|
|
38
|
-
getMessages(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<MessageResponseDto>>>;
|
|
40
|
+
getMessages(chatId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<MessageResponseDto>>>;
|
|
39
41
|
};
|
|
40
42
|
/**
|
|
41
43
|
* MessagesApi - factory interface
|
|
@@ -44,10 +46,11 @@ export declare const MessagesApiFp: (configuration?: Configuration) => {
|
|
|
44
46
|
export declare const MessagesApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
45
47
|
/**
|
|
46
48
|
*
|
|
49
|
+
* @param {number} chatId
|
|
47
50
|
* @param {*} [options] Override http request option.
|
|
48
51
|
* @throws {RequiredError}
|
|
49
52
|
*/
|
|
50
|
-
getMessages(options?: AxiosRequestConfig): Promise<AxiosResponse<MessageResponseDto>>;
|
|
53
|
+
getMessages(chatId: number, options?: AxiosRequestConfig): Promise<AxiosResponse<MessageResponseDto>>;
|
|
51
54
|
};
|
|
52
55
|
/**
|
|
53
56
|
* MessagesApi - object-oriented interface
|
|
@@ -58,9 +61,10 @@ export declare const MessagesApiFactory: (configuration?: Configuration, basePat
|
|
|
58
61
|
export declare class MessagesApi extends BaseAPI {
|
|
59
62
|
/**
|
|
60
63
|
*
|
|
64
|
+
* @param {number} chatId
|
|
61
65
|
* @param {*} [options] Override http request option.
|
|
62
66
|
* @throws {RequiredError}
|
|
63
67
|
* @memberof MessagesApi
|
|
64
68
|
*/
|
|
65
|
-
getMessages(options?: AxiosRequestConfig): Promise<AxiosResponse<MessageResponseDto>>;
|
|
69
|
+
getMessages(chatId: number, options?: AxiosRequestConfig): Promise<AxiosResponse<MessageResponseDto>>;
|
|
66
70
|
}
|
|
@@ -98,18 +98,23 @@ var MessagesApiAxiosParamCreator = function (configuration) {
|
|
|
98
98
|
return {
|
|
99
99
|
/**
|
|
100
100
|
*
|
|
101
|
+
* @param {number} chatId
|
|
101
102
|
* @param {*} [options] Override http request option.
|
|
102
103
|
* @throws {RequiredError}
|
|
103
104
|
*/
|
|
104
|
-
getMessages: function () {
|
|
105
|
+
getMessages: function (chatId_1) {
|
|
105
106
|
var args_1 = [];
|
|
106
|
-
for (var _i =
|
|
107
|
-
args_1[_i] = arguments[_i];
|
|
107
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
108
|
+
args_1[_i - 1] = arguments[_i];
|
|
108
109
|
}
|
|
109
|
-
return __awaiter(_this, __spreadArray([], args_1, true), void 0, function (options) {
|
|
110
|
+
return __awaiter(_this, __spreadArray([chatId_1], args_1, true), void 0, function (chatId, options) {
|
|
110
111
|
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, query, key, key, headersFromBaseOptions;
|
|
111
112
|
if (options === void 0) { options = {}; }
|
|
112
113
|
return __generator(this, function (_a) {
|
|
114
|
+
// verify required parameter 'chatId' is not null or undefined
|
|
115
|
+
if (chatId === null || chatId === undefined) {
|
|
116
|
+
throw new base_1.RequiredError('chatId', 'Required parameter chatId was null or undefined when calling getMessages.');
|
|
117
|
+
}
|
|
113
118
|
localVarPath = "/api/messages";
|
|
114
119
|
localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
115
120
|
if (configuration) {
|
|
@@ -118,6 +123,9 @@ var MessagesApiAxiosParamCreator = function (configuration) {
|
|
|
118
123
|
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
|
119
124
|
localVarHeaderParameter = {};
|
|
120
125
|
localVarQueryParameter = {};
|
|
126
|
+
if (chatId !== undefined) {
|
|
127
|
+
localVarQueryParameter['chatId'] = chatId;
|
|
128
|
+
}
|
|
121
129
|
query = new URLSearchParams(localVarUrlObj.search);
|
|
122
130
|
for (key in localVarQueryParameter) {
|
|
123
131
|
query.set(key, localVarQueryParameter[key]);
|
|
@@ -146,15 +154,16 @@ var MessagesApiFp = function (configuration) {
|
|
|
146
154
|
return {
|
|
147
155
|
/**
|
|
148
156
|
*
|
|
157
|
+
* @param {number} chatId
|
|
149
158
|
* @param {*} [options] Override http request option.
|
|
150
159
|
* @throws {RequiredError}
|
|
151
160
|
*/
|
|
152
|
-
getMessages: function (options) {
|
|
161
|
+
getMessages: function (chatId, options) {
|
|
153
162
|
return __awaiter(this, void 0, void 0, function () {
|
|
154
163
|
var localVarAxiosArgs;
|
|
155
164
|
return __generator(this, function (_a) {
|
|
156
165
|
switch (_a.label) {
|
|
157
|
-
case 0: return [4 /*yield*/, (0, exports.MessagesApiAxiosParamCreator)(configuration).getMessages(options)];
|
|
166
|
+
case 0: return [4 /*yield*/, (0, exports.MessagesApiAxiosParamCreator)(configuration).getMessages(chatId, options)];
|
|
158
167
|
case 1:
|
|
159
168
|
localVarAxiosArgs = _a.sent();
|
|
160
169
|
return [2 /*return*/, function (axios, basePath) {
|
|
@@ -178,13 +187,14 @@ var MessagesApiFactory = function (configuration, basePath, axios) {
|
|
|
178
187
|
return {
|
|
179
188
|
/**
|
|
180
189
|
*
|
|
190
|
+
* @param {number} chatId
|
|
181
191
|
* @param {*} [options] Override http request option.
|
|
182
192
|
* @throws {RequiredError}
|
|
183
193
|
*/
|
|
184
|
-
getMessages: function (options) {
|
|
194
|
+
getMessages: function (chatId, options) {
|
|
185
195
|
return __awaiter(this, void 0, void 0, function () {
|
|
186
196
|
return __generator(this, function (_a) {
|
|
187
|
-
return [2 /*return*/, (0, exports.MessagesApiFp)(configuration).getMessages(options).then(function (request) { return request(axios, basePath); })];
|
|
197
|
+
return [2 /*return*/, (0, exports.MessagesApiFp)(configuration).getMessages(chatId, options).then(function (request) { return request(axios, basePath); })];
|
|
188
198
|
});
|
|
189
199
|
});
|
|
190
200
|
},
|
|
@@ -204,15 +214,16 @@ var MessagesApi = /** @class */ (function (_super) {
|
|
|
204
214
|
}
|
|
205
215
|
/**
|
|
206
216
|
*
|
|
217
|
+
* @param {number} chatId
|
|
207
218
|
* @param {*} [options] Override http request option.
|
|
208
219
|
* @throws {RequiredError}
|
|
209
220
|
* @memberof MessagesApi
|
|
210
221
|
*/
|
|
211
|
-
MessagesApi.prototype.getMessages = function (options) {
|
|
222
|
+
MessagesApi.prototype.getMessages = function (chatId, options) {
|
|
212
223
|
return __awaiter(this, void 0, void 0, function () {
|
|
213
224
|
var _this = this;
|
|
214
225
|
return __generator(this, function (_a) {
|
|
215
|
-
return [2 /*return*/, (0, exports.MessagesApiFp)(this.configuration).getMessages(options).then(function (request) { return request(_this.axios, _this.basePath); })];
|
|
226
|
+
return [2 /*return*/, (0, exports.MessagesApiFp)(this.configuration).getMessages(chatId, options).then(function (request) { return request(_this.axios, _this.basePath); })];
|
|
216
227
|
});
|
|
217
228
|
});
|
|
218
229
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { WhatsappChatDto } from './whatsapp-chat-dto';
|
|
13
|
+
import { WhatsappContactDto } from './whatsapp-contact-dto';
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
* @interface ActiveChatDTO
|
|
19
|
+
*/
|
|
20
|
+
export interface ActiveChatDTO {
|
|
21
|
+
/**
|
|
22
|
+
* @type {WhatsappChatDto}
|
|
23
|
+
* @memberof ActiveChatDTO
|
|
24
|
+
*/
|
|
25
|
+
chat: WhatsappChatDto;
|
|
26
|
+
/**
|
|
27
|
+
* @type {WhatsappContactDto}
|
|
28
|
+
* @memberof ActiveChatDTO
|
|
29
|
+
*/
|
|
30
|
+
contact: WhatsappContactDto;
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,25 @@
|
|
|
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 { ActiveChatDTO } from './active-chat-dto';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
*
|
|
16
|
+
* @export
|
|
17
|
+
* @interface ActiveChatResponseDTO
|
|
18
|
+
*/
|
|
19
|
+
export interface ActiveChatResponseDTO {
|
|
20
|
+
/**
|
|
21
|
+
* @type {ActiveChatDTO}
|
|
22
|
+
* @memberof ActiveChatResponseDTO
|
|
23
|
+
*/
|
|
24
|
+
data: ActiveChatDTO;
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/models/index.d.ts
CHANGED
package/dist/models/index.js
CHANGED
|
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./active-chat-dto"), exports);
|
|
18
|
+
__exportStar(require("./active-chat-response-dto"), exports);
|
|
17
19
|
__exportStar(require("./api-request-user-update-password-dto"), exports);
|
|
18
20
|
__exportStar(require("./api-response-auth-dto"), exports);
|
|
19
21
|
__exportStar(require("./api-response-user-dto"), exports);
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* https://github.com/swagger-api/swagger-codegen.git
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
+
import { WhatsappContactDto } from './whatsapp-contact-dto';
|
|
12
13
|
/**
|
|
13
14
|
*
|
|
14
15
|
*
|
|
@@ -46,4 +47,15 @@ export interface WhatsappChatDto {
|
|
|
46
47
|
* @example 3
|
|
47
48
|
*/
|
|
48
49
|
unreadMessages: number;
|
|
50
|
+
/**
|
|
51
|
+
* @type {number}
|
|
52
|
+
* @memberof WhatsappChatDto
|
|
53
|
+
* @example 3
|
|
54
|
+
*/
|
|
55
|
+
messages: number;
|
|
56
|
+
/**
|
|
57
|
+
* @type {WhatsappContactDto}
|
|
58
|
+
* @memberof WhatsappChatDto
|
|
59
|
+
*/
|
|
60
|
+
contact: WhatsappContactDto;
|
|
49
61
|
}
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* https://github.com/swagger-api/swagger-codegen.git
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
-
import { WhatsappChatDto } from './whatsapp-chat-dto';
|
|
13
12
|
/**
|
|
14
13
|
*
|
|
15
14
|
*
|
|
@@ -41,9 +40,4 @@ export interface WhatsappContactDto {
|
|
|
41
40
|
* @example https://pps.whatsapp.net/v/t61.24694-24/457509556_2356010488071107_6417764276476104496_n.jpg?ccb=11-4&oh=01_Q5AaIIFucBhJzpQiltPNuSAmyUkHd0uxhyBTWGxrhxSmEaU2&oe=677BCB9A&_nc_sid=5e03e0&_nc_cat=101
|
|
42
41
|
*/
|
|
43
42
|
profilePicUrl: string | null;
|
|
44
|
-
/**
|
|
45
|
-
* @type {WhatsappChatDto}
|
|
46
|
-
* @memberof WhatsappContactDto
|
|
47
|
-
*/
|
|
48
|
-
chat: WhatsappChatDto | null;
|
|
49
43
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 { WhatsappChatDto } from './whatsapp-chat-dto';
|
|
16
|
+
import { WhatsappContactDto } from './whatsapp-contact-dto';
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
* @interface ActiveChatDTO
|
|
22
|
+
*/
|
|
23
|
+
export interface ActiveChatDTO {
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @type {WhatsappChatDto}
|
|
27
|
+
* @memberof ActiveChatDTO
|
|
28
|
+
*/
|
|
29
|
+
chat: WhatsappChatDto;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @type {WhatsappContactDto}
|
|
33
|
+
* @memberof ActiveChatDTO
|
|
34
|
+
*/
|
|
35
|
+
contact: WhatsappContactDto;
|
|
36
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { ActiveChatDTO } from './active-chat-dto';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @interface ActiveChatResponseDTO
|
|
21
|
+
*/
|
|
22
|
+
export interface ActiveChatResponseDTO {
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @type {ActiveChatDTO}
|
|
26
|
+
* @memberof ActiveChatResponseDTO
|
|
27
|
+
*/
|
|
28
|
+
data: ActiveChatDTO;
|
|
29
|
+
}
|
package/models/index.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
+
import { WhatsappContactDto } from './whatsapp-contact-dto';
|
|
15
16
|
/**
|
|
16
17
|
*
|
|
17
18
|
*
|
|
@@ -54,4 +55,17 @@ export interface WhatsappChatDto {
|
|
|
54
55
|
* @example 3
|
|
55
56
|
*/
|
|
56
57
|
unreadMessages: number;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @type {number}
|
|
61
|
+
* @memberof WhatsappChatDto
|
|
62
|
+
* @example 3
|
|
63
|
+
*/
|
|
64
|
+
messages: number;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @type {WhatsappContactDto}
|
|
68
|
+
* @memberof WhatsappChatDto
|
|
69
|
+
*/
|
|
70
|
+
contact: WhatsappContactDto;
|
|
57
71
|
}
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { WhatsappChatDto } from './whatsapp-chat-dto';
|
|
16
15
|
/**
|
|
17
16
|
*
|
|
18
17
|
*
|
|
@@ -48,10 +47,4 @@ export interface WhatsappContactDto {
|
|
|
48
47
|
* @example https://pps.whatsapp.net/v/t61.24694-24/457509556_2356010488071107_6417764276476104496_n.jpg?ccb=11-4&oh=01_Q5AaIIFucBhJzpQiltPNuSAmyUkHd0uxhyBTWGxrhxSmEaU2&oe=677BCB9A&_nc_sid=5e03e0&_nc_cat=101
|
|
49
48
|
*/
|
|
50
49
|
profilePicUrl: string | null;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @type {WhatsappChatDto}
|
|
54
|
-
* @memberof WhatsappContactDto
|
|
55
|
-
*/
|
|
56
|
-
chat: WhatsappChatDto | null;
|
|
57
50
|
}
|