@wildix/wms-api-client 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/WmsApiClient.js +6 -3
- package/dist-cjs/commands/CreatePbxOAuth2ClientCommand.js +12 -32
- package/dist-cjs/commands/DeletePbxOAuth2ClientCommand.js +12 -32
- package/dist-cjs/commands/GetPbxAclGroupsPermissionsCommand.js +12 -32
- package/dist-cjs/commands/GetPbxCallGroupsCommand.js +12 -32
- package/dist-cjs/commands/GetPbxColleaguesCommand.js +12 -32
- package/dist-cjs/commands/GetPbxOAuth2ClientsCommand.js +12 -32
- package/dist-cjs/commands/UpdatePbxOAuth2ClientCommand.js +12 -32
- package/dist-cjs/protocols/Aws_restJson1.js +122 -237
- package/dist-cjs/runtimeConfig.browser.js +5 -1
- package/dist-cjs/runtimeConfig.js +5 -1
- package/dist-cjs/runtimeConfig.shared.js +13 -11
- package/dist-es/WmsApiClient.js +6 -3
- package/dist-es/commands/CreatePbxOAuth2ClientCommand.js +12 -32
- package/dist-es/commands/DeletePbxOAuth2ClientCommand.js +12 -32
- package/dist-es/commands/GetPbxAclGroupsPermissionsCommand.js +12 -32
- package/dist-es/commands/GetPbxCallGroupsCommand.js +12 -32
- package/dist-es/commands/GetPbxColleaguesCommand.js +12 -32
- package/dist-es/commands/GetPbxOAuth2ClientsCommand.js +12 -32
- package/dist-es/commands/UpdatePbxOAuth2ClientCommand.js +12 -32
- package/dist-es/protocols/Aws_restJson1.js +123 -238
- package/dist-es/runtimeConfig.browser.js +4 -1
- package/dist-es/runtimeConfig.js +4 -1
- package/dist-es/runtimeConfig.shared.js +13 -11
- package/dist-types/WmsApi.d.ts +4 -0
- package/dist-types/WmsApiClient.d.ts +13 -7
- package/dist-types/commands/CreatePbxOAuth2ClientCommand.d.ts +8 -20
- package/dist-types/commands/DeletePbxOAuth2ClientCommand.d.ts +8 -20
- package/dist-types/commands/GetPbxAclGroupsPermissionsCommand.d.ts +7 -19
- package/dist-types/commands/GetPbxCallGroupsCommand.d.ts +8 -20
- package/dist-types/commands/GetPbxColleaguesCommand.d.ts +7 -19
- package/dist-types/commands/GetPbxOAuth2ClientsCommand.d.ts +8 -20
- package/dist-types/commands/UpdatePbxOAuth2ClientCommand.d.ts +8 -20
- package/dist-types/index.d.ts +2 -0
- package/dist-types/models/models_0.d.ts +27 -27
- package/dist-types/runtimeConfig.browser.d.ts +3 -4
- package/dist-types/runtimeConfig.d.ts +3 -4
- package/dist-types/runtimeConfig.native.d.ts +3 -4
- package/package.json +30 -28
|
@@ -3,173 +3,138 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.de_UpdatePbxOAuth2ClientCommand = exports.de_GetPbxOAuth2ClientsCommand = exports.de_GetPbxColleaguesCommand = exports.de_GetPbxCallGroupsCommand = exports.de_GetPbxAclGroupsPermissionsCommand = exports.de_DeletePbxOAuth2ClientCommand = exports.de_CreatePbxOAuth2ClientCommand = exports.se_UpdatePbxOAuth2ClientCommand = exports.se_GetPbxOAuth2ClientsCommand = exports.se_GetPbxColleaguesCommand = exports.se_GetPbxCallGroupsCommand = exports.se_GetPbxAclGroupsPermissionsCommand = exports.se_DeletePbxOAuth2ClientCommand = exports.se_CreatePbxOAuth2ClientCommand = void 0;
|
|
4
4
|
const WmsApiServiceException_1 = require("../models/WmsApiServiceException");
|
|
5
5
|
const models_0_1 = require("../models/models_0");
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@smithy/core");
|
|
7
7
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
8
8
|
const se_CreatePbxOAuth2ClientCommand = async (input, context) => {
|
|
9
|
-
const
|
|
9
|
+
const b = (0, core_1.requestBuilder)(input, context);
|
|
10
10
|
const headers = {
|
|
11
11
|
'content-type': 'application/json',
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
b.bp("/api/v1/pbx/applications/oauth2");
|
|
14
14
|
let body;
|
|
15
15
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
16
16
|
'name': [],
|
|
17
17
|
'redirectUri': _ => (0, smithy_client_1._json)(_),
|
|
18
18
|
}));
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
method: "POST",
|
|
24
|
-
headers,
|
|
25
|
-
path: resolvedPath,
|
|
26
|
-
body,
|
|
27
|
-
});
|
|
19
|
+
b.m("POST")
|
|
20
|
+
.h(headers)
|
|
21
|
+
.b(body);
|
|
22
|
+
return b.build();
|
|
28
23
|
};
|
|
29
24
|
exports.se_CreatePbxOAuth2ClientCommand = se_CreatePbxOAuth2ClientCommand;
|
|
30
25
|
const se_DeletePbxOAuth2ClientCommand = async (input, context) => {
|
|
31
|
-
const
|
|
26
|
+
const b = (0, core_1.requestBuilder)(input, context);
|
|
32
27
|
const headers = {};
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
b.bp("/api/v1/pbx/applications/oauth2/{id}");
|
|
29
|
+
b.p('id', () => input.id, '{id}', false);
|
|
35
30
|
let body;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
method: "DELETE",
|
|
41
|
-
headers,
|
|
42
|
-
path: resolvedPath,
|
|
43
|
-
body,
|
|
44
|
-
});
|
|
31
|
+
b.m("DELETE")
|
|
32
|
+
.h(headers)
|
|
33
|
+
.b(body);
|
|
34
|
+
return b.build();
|
|
45
35
|
};
|
|
46
36
|
exports.se_DeletePbxOAuth2ClientCommand = se_DeletePbxOAuth2ClientCommand;
|
|
47
37
|
const se_GetPbxAclGroupsPermissionsCommand = async (input, context) => {
|
|
48
|
-
const
|
|
38
|
+
const b = (0, core_1.requestBuilder)(input, context);
|
|
49
39
|
const headers = {};
|
|
50
|
-
|
|
40
|
+
b.bp("/api/v1/pbx/aclgroups/permissions");
|
|
51
41
|
const query = (0, smithy_client_1.map)({
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
[_gr]: [() => input.groups !== void 0, () => ((input[_g] || []).map(_entry => _entry))],
|
|
43
|
+
[_pe]: [() => input.permissions !== void 0, () => ((input[_p] || []).map(_entry => _entry))],
|
|
54
44
|
});
|
|
55
45
|
let body;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
headers,
|
|
62
|
-
path: resolvedPath,
|
|
63
|
-
query,
|
|
64
|
-
body,
|
|
65
|
-
});
|
|
46
|
+
b.m("GET")
|
|
47
|
+
.h(headers)
|
|
48
|
+
.q(query)
|
|
49
|
+
.b(body);
|
|
50
|
+
return b.build();
|
|
66
51
|
};
|
|
67
52
|
exports.se_GetPbxAclGroupsPermissionsCommand = se_GetPbxAclGroupsPermissionsCommand;
|
|
68
53
|
const se_GetPbxCallGroupsCommand = async (input, context) => {
|
|
69
|
-
const
|
|
54
|
+
const b = (0, core_1.requestBuilder)(input, context);
|
|
70
55
|
const headers = {
|
|
71
56
|
'content-type': 'application/json',
|
|
72
57
|
};
|
|
73
|
-
|
|
58
|
+
b.bp("/api/v1/Dialplan/CallGroups");
|
|
74
59
|
let body;
|
|
75
60
|
body = "";
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
method: "GET",
|
|
81
|
-
headers,
|
|
82
|
-
path: resolvedPath,
|
|
83
|
-
body,
|
|
84
|
-
});
|
|
61
|
+
b.m("GET")
|
|
62
|
+
.h(headers)
|
|
63
|
+
.b(body);
|
|
64
|
+
return b.build();
|
|
85
65
|
};
|
|
86
66
|
exports.se_GetPbxCallGroupsCommand = se_GetPbxCallGroupsCommand;
|
|
87
67
|
const se_GetPbxColleaguesCommand = async (input, context) => {
|
|
88
|
-
const
|
|
68
|
+
const b = (0, core_1.requestBuilder)(input, context);
|
|
89
69
|
const headers = {};
|
|
90
|
-
|
|
70
|
+
b.bp("/api/v1/PBX/Colleagues");
|
|
91
71
|
const query = (0, smithy_client_1.map)({
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
72
|
+
[_f]: [() => input.extension !== void 0, () => ((input[_e] || []).map(_entry => _entry))],
|
|
73
|
+
[_fi]: [() => input.id !== void 0, () => ((input[_i] || []).map(_entry => _entry))],
|
|
74
|
+
[_fP]: [() => input.officePhone !== void 0, () => ((input[_oP] || []).map(_entry => _entry))],
|
|
75
|
+
[_fPi]: [() => input.mobilePhone !== void 0, () => ((input[_mP] || []).map(_entry => _entry))],
|
|
76
|
+
[_fil]: [() => input.name !== void 0, () => ((input[_n] || []).map(_entry => _entry))],
|
|
77
|
+
[_filt]: [() => input.email !== void 0, () => ((input[_em] || []).map(_entry => _entry))],
|
|
78
|
+
[_filte]: [() => input.role !== void 0, () => ((input[_r] || []).map(_entry => _entry))],
|
|
79
|
+
[_filter]: [() => input.dialplan !== void 0, () => ((input[_d] || []).map(_entry => _entry))],
|
|
80
|
+
[_fDi]: [() => input.faxDialplan !== void 0, () => ((input[_fD] || []).map(_entry => _entry))],
|
|
81
|
+
[_filterd]: [() => input.department !== void 0, () => ((input[_de] || []).map(_entry => _entry))],
|
|
82
|
+
[_filterl]: [() => input.login !== void 0, () => ((input[_l] || []).map(_entry => _entry))],
|
|
83
|
+
[_fDil]: [() => input.groupDn !== void 0, () => ((input[_gD] || []).map(_entry => _entry))],
|
|
84
|
+
[_fDilt]: [() => input.pbxDn !== void 0, () => ((input[_pD] || []).map(_entry => _entry))],
|
|
85
|
+
[_fT]: [() => input.licenseType !== void 0, () => ((input[_lT] || []).map(_entry => _entry))],
|
|
86
|
+
[_fie]: [() => input.fields !== void 0, () => ((input[_fie] || []).join(','))],
|
|
87
|
+
[_sF]: [() => input.searchFields !== void 0, () => ((input[_sF] || []).join(','))],
|
|
88
|
+
[_s]: [, input[_s]],
|
|
89
|
+
[_so]: [() => input.sort !== void 0, () => ((input[_so] || []).map(_entry => _entry))],
|
|
90
|
+
[_st]: [() => input.start !== void 0, () => (input[_st].toString())],
|
|
91
|
+
[_c]: [() => input.count !== void 0, () => (input[_c].toString())],
|
|
92
|
+
[_di]: [, input[_di]],
|
|
93
|
+
[_sS]: [, input[_sS]],
|
|
114
94
|
});
|
|
115
95
|
let body;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
headers,
|
|
122
|
-
path: resolvedPath,
|
|
123
|
-
query,
|
|
124
|
-
body,
|
|
125
|
-
});
|
|
96
|
+
b.m("GET")
|
|
97
|
+
.h(headers)
|
|
98
|
+
.q(query)
|
|
99
|
+
.b(body);
|
|
100
|
+
return b.build();
|
|
126
101
|
};
|
|
127
102
|
exports.se_GetPbxColleaguesCommand = se_GetPbxColleaguesCommand;
|
|
128
103
|
const se_GetPbxOAuth2ClientsCommand = async (input, context) => {
|
|
129
|
-
const
|
|
104
|
+
const b = (0, core_1.requestBuilder)(input, context);
|
|
130
105
|
const headers = {
|
|
131
106
|
'content-type': 'application/json',
|
|
132
107
|
};
|
|
133
|
-
|
|
108
|
+
b.bp("/api/v1/pbx/applications/oauth2");
|
|
134
109
|
let body;
|
|
135
110
|
body = "";
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
method: "GET",
|
|
141
|
-
headers,
|
|
142
|
-
path: resolvedPath,
|
|
143
|
-
body,
|
|
144
|
-
});
|
|
111
|
+
b.m("GET")
|
|
112
|
+
.h(headers)
|
|
113
|
+
.b(body);
|
|
114
|
+
return b.build();
|
|
145
115
|
};
|
|
146
116
|
exports.se_GetPbxOAuth2ClientsCommand = se_GetPbxOAuth2ClientsCommand;
|
|
147
117
|
const se_UpdatePbxOAuth2ClientCommand = async (input, context) => {
|
|
148
|
-
const
|
|
118
|
+
const b = (0, core_1.requestBuilder)(input, context);
|
|
149
119
|
const headers = {
|
|
150
120
|
'content-type': 'application/json',
|
|
151
121
|
};
|
|
152
|
-
|
|
153
|
-
|
|
122
|
+
b.bp("/api/v1/pbx/applications/oauth2/{id}");
|
|
123
|
+
b.p('id', () => input.id, '{id}', false);
|
|
154
124
|
let body;
|
|
155
125
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
156
126
|
'name': [],
|
|
157
127
|
'redirectUri': _ => (0, smithy_client_1._json)(_),
|
|
158
128
|
}));
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
method: "PUT",
|
|
164
|
-
headers,
|
|
165
|
-
path: resolvedPath,
|
|
166
|
-
body,
|
|
167
|
-
});
|
|
129
|
+
b.m("PUT")
|
|
130
|
+
.h(headers)
|
|
131
|
+
.b(body);
|
|
132
|
+
return b.build();
|
|
168
133
|
};
|
|
169
134
|
exports.se_UpdatePbxOAuth2ClientCommand = se_UpdatePbxOAuth2ClientCommand;
|
|
170
135
|
const de_CreatePbxOAuth2ClientCommand = async (output, context) => {
|
|
171
136
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
172
|
-
return
|
|
137
|
+
return de_CommandError(output, context);
|
|
173
138
|
}
|
|
174
139
|
const contents = (0, smithy_client_1.map)({
|
|
175
140
|
$metadata: deserializeMetadata(output),
|
|
@@ -183,31 +148,9 @@ const de_CreatePbxOAuth2ClientCommand = async (output, context) => {
|
|
|
183
148
|
return contents;
|
|
184
149
|
};
|
|
185
150
|
exports.de_CreatePbxOAuth2ClientCommand = de_CreatePbxOAuth2ClientCommand;
|
|
186
|
-
const de_CreatePbxOAuth2ClientCommandError = async (output, context) => {
|
|
187
|
-
const parsedOutput = {
|
|
188
|
-
...output,
|
|
189
|
-
body: await parseErrorBody(output.body, context)
|
|
190
|
-
};
|
|
191
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
192
|
-
switch (errorCode) {
|
|
193
|
-
case "WmsUnauthorizedException":
|
|
194
|
-
case "wildix.wms.api#WmsUnauthorizedException":
|
|
195
|
-
throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
|
|
196
|
-
case "WmsValidationException":
|
|
197
|
-
case "wildix.wms.api#WmsValidationException":
|
|
198
|
-
throw await de_WmsValidationExceptionRes(parsedOutput, context);
|
|
199
|
-
default:
|
|
200
|
-
const parsedBody = parsedOutput.body;
|
|
201
|
-
return throwDefaultError({
|
|
202
|
-
output,
|
|
203
|
-
parsedBody,
|
|
204
|
-
errorCode
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
151
|
const de_DeletePbxOAuth2ClientCommand = async (output, context) => {
|
|
209
152
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
210
|
-
return
|
|
153
|
+
return de_CommandError(output, context);
|
|
211
154
|
}
|
|
212
155
|
const contents = (0, smithy_client_1.map)({
|
|
213
156
|
$metadata: deserializeMetadata(output),
|
|
@@ -221,31 +164,9 @@ const de_DeletePbxOAuth2ClientCommand = async (output, context) => {
|
|
|
221
164
|
return contents;
|
|
222
165
|
};
|
|
223
166
|
exports.de_DeletePbxOAuth2ClientCommand = de_DeletePbxOAuth2ClientCommand;
|
|
224
|
-
const de_DeletePbxOAuth2ClientCommandError = async (output, context) => {
|
|
225
|
-
const parsedOutput = {
|
|
226
|
-
...output,
|
|
227
|
-
body: await parseErrorBody(output.body, context)
|
|
228
|
-
};
|
|
229
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
230
|
-
switch (errorCode) {
|
|
231
|
-
case "WmsNotFoundException":
|
|
232
|
-
case "wildix.wms.api#WmsNotFoundException":
|
|
233
|
-
throw await de_WmsNotFoundExceptionRes(parsedOutput, context);
|
|
234
|
-
case "WmsUnauthorizedException":
|
|
235
|
-
case "wildix.wms.api#WmsUnauthorizedException":
|
|
236
|
-
throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
|
|
237
|
-
default:
|
|
238
|
-
const parsedBody = parsedOutput.body;
|
|
239
|
-
return throwDefaultError({
|
|
240
|
-
output,
|
|
241
|
-
parsedBody,
|
|
242
|
-
errorCode
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
};
|
|
246
167
|
const de_GetPbxAclGroupsPermissionsCommand = async (output, context) => {
|
|
247
168
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
248
|
-
return
|
|
169
|
+
return de_CommandError(output, context);
|
|
249
170
|
}
|
|
250
171
|
const contents = (0, smithy_client_1.map)({
|
|
251
172
|
$metadata: deserializeMetadata(output),
|
|
@@ -259,28 +180,9 @@ const de_GetPbxAclGroupsPermissionsCommand = async (output, context) => {
|
|
|
259
180
|
return contents;
|
|
260
181
|
};
|
|
261
182
|
exports.de_GetPbxAclGroupsPermissionsCommand = de_GetPbxAclGroupsPermissionsCommand;
|
|
262
|
-
const de_GetPbxAclGroupsPermissionsCommandError = async (output, context) => {
|
|
263
|
-
const parsedOutput = {
|
|
264
|
-
...output,
|
|
265
|
-
body: await parseErrorBody(output.body, context)
|
|
266
|
-
};
|
|
267
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
268
|
-
switch (errorCode) {
|
|
269
|
-
case "WmsUnauthorizedException":
|
|
270
|
-
case "wildix.wms.api#WmsUnauthorizedException":
|
|
271
|
-
throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
|
|
272
|
-
default:
|
|
273
|
-
const parsedBody = parsedOutput.body;
|
|
274
|
-
return throwDefaultError({
|
|
275
|
-
output,
|
|
276
|
-
parsedBody,
|
|
277
|
-
errorCode
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
};
|
|
281
183
|
const de_GetPbxCallGroupsCommand = async (output, context) => {
|
|
282
184
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
283
|
-
return
|
|
185
|
+
return de_CommandError(output, context);
|
|
284
186
|
}
|
|
285
187
|
const contents = (0, smithy_client_1.map)({
|
|
286
188
|
$metadata: deserializeMetadata(output),
|
|
@@ -294,28 +196,9 @@ const de_GetPbxCallGroupsCommand = async (output, context) => {
|
|
|
294
196
|
return contents;
|
|
295
197
|
};
|
|
296
198
|
exports.de_GetPbxCallGroupsCommand = de_GetPbxCallGroupsCommand;
|
|
297
|
-
const de_GetPbxCallGroupsCommandError = async (output, context) => {
|
|
298
|
-
const parsedOutput = {
|
|
299
|
-
...output,
|
|
300
|
-
body: await parseErrorBody(output.body, context)
|
|
301
|
-
};
|
|
302
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
303
|
-
switch (errorCode) {
|
|
304
|
-
case "WmsUnauthorizedException":
|
|
305
|
-
case "wildix.wms.api#WmsUnauthorizedException":
|
|
306
|
-
throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
|
|
307
|
-
default:
|
|
308
|
-
const parsedBody = parsedOutput.body;
|
|
309
|
-
return throwDefaultError({
|
|
310
|
-
output,
|
|
311
|
-
parsedBody,
|
|
312
|
-
errorCode
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
199
|
const de_GetPbxColleaguesCommand = async (output, context) => {
|
|
317
200
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
318
|
-
return
|
|
201
|
+
return de_CommandError(output, context);
|
|
319
202
|
}
|
|
320
203
|
const contents = (0, smithy_client_1.map)({
|
|
321
204
|
$metadata: deserializeMetadata(output),
|
|
@@ -329,28 +212,9 @@ const de_GetPbxColleaguesCommand = async (output, context) => {
|
|
|
329
212
|
return contents;
|
|
330
213
|
};
|
|
331
214
|
exports.de_GetPbxColleaguesCommand = de_GetPbxColleaguesCommand;
|
|
332
|
-
const de_GetPbxColleaguesCommandError = async (output, context) => {
|
|
333
|
-
const parsedOutput = {
|
|
334
|
-
...output,
|
|
335
|
-
body: await parseErrorBody(output.body, context)
|
|
336
|
-
};
|
|
337
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
338
|
-
switch (errorCode) {
|
|
339
|
-
case "WmsUnauthorizedException":
|
|
340
|
-
case "wildix.wms.api#WmsUnauthorizedException":
|
|
341
|
-
throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
|
|
342
|
-
default:
|
|
343
|
-
const parsedBody = parsedOutput.body;
|
|
344
|
-
return throwDefaultError({
|
|
345
|
-
output,
|
|
346
|
-
parsedBody,
|
|
347
|
-
errorCode
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
};
|
|
351
215
|
const de_GetPbxOAuth2ClientsCommand = async (output, context) => {
|
|
352
216
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
353
|
-
return
|
|
217
|
+
return de_CommandError(output, context);
|
|
354
218
|
}
|
|
355
219
|
const contents = (0, smithy_client_1.map)({
|
|
356
220
|
$metadata: deserializeMetadata(output),
|
|
@@ -364,28 +228,9 @@ const de_GetPbxOAuth2ClientsCommand = async (output, context) => {
|
|
|
364
228
|
return contents;
|
|
365
229
|
};
|
|
366
230
|
exports.de_GetPbxOAuth2ClientsCommand = de_GetPbxOAuth2ClientsCommand;
|
|
367
|
-
const de_GetPbxOAuth2ClientsCommandError = async (output, context) => {
|
|
368
|
-
const parsedOutput = {
|
|
369
|
-
...output,
|
|
370
|
-
body: await parseErrorBody(output.body, context)
|
|
371
|
-
};
|
|
372
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
373
|
-
switch (errorCode) {
|
|
374
|
-
case "WmsUnauthorizedException":
|
|
375
|
-
case "wildix.wms.api#WmsUnauthorizedException":
|
|
376
|
-
throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
|
|
377
|
-
default:
|
|
378
|
-
const parsedBody = parsedOutput.body;
|
|
379
|
-
return throwDefaultError({
|
|
380
|
-
output,
|
|
381
|
-
parsedBody,
|
|
382
|
-
errorCode
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
231
|
const de_UpdatePbxOAuth2ClientCommand = async (output, context) => {
|
|
387
232
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
388
|
-
return
|
|
233
|
+
return de_CommandError(output, context);
|
|
389
234
|
}
|
|
390
235
|
const contents = (0, smithy_client_1.map)({
|
|
391
236
|
$metadata: deserializeMetadata(output),
|
|
@@ -399,22 +244,22 @@ const de_UpdatePbxOAuth2ClientCommand = async (output, context) => {
|
|
|
399
244
|
return contents;
|
|
400
245
|
};
|
|
401
246
|
exports.de_UpdatePbxOAuth2ClientCommand = de_UpdatePbxOAuth2ClientCommand;
|
|
402
|
-
const
|
|
247
|
+
const de_CommandError = async (output, context) => {
|
|
403
248
|
const parsedOutput = {
|
|
404
249
|
...output,
|
|
405
250
|
body: await parseErrorBody(output.body, context)
|
|
406
251
|
};
|
|
407
252
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
408
253
|
switch (errorCode) {
|
|
409
|
-
case "WmsNotFoundException":
|
|
410
|
-
case "wildix.wms.api#WmsNotFoundException":
|
|
411
|
-
throw await de_WmsNotFoundExceptionRes(parsedOutput, context);
|
|
412
254
|
case "WmsUnauthorizedException":
|
|
413
255
|
case "wildix.wms.api#WmsUnauthorizedException":
|
|
414
256
|
throw await de_WmsUnauthorizedExceptionRes(parsedOutput, context);
|
|
415
257
|
case "WmsValidationException":
|
|
416
258
|
case "wildix.wms.api#WmsValidationException":
|
|
417
259
|
throw await de_WmsValidationExceptionRes(parsedOutput, context);
|
|
260
|
+
case "WmsNotFoundException":
|
|
261
|
+
case "wildix.wms.api#WmsNotFoundException":
|
|
262
|
+
throw await de_WmsNotFoundExceptionRes(parsedOutput, context);
|
|
418
263
|
default:
|
|
419
264
|
const parsedBody = parsedOutput.body;
|
|
420
265
|
return throwDefaultError({
|
|
@@ -481,6 +326,46 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
|
481
326
|
(!Object.getOwnPropertyNames(value).includes("length") ||
|
|
482
327
|
value.length != 0) &&
|
|
483
328
|
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
329
|
+
const _c = "count";
|
|
330
|
+
const _d = "dialplan";
|
|
331
|
+
const _de = "department";
|
|
332
|
+
const _di = "dir";
|
|
333
|
+
const _e = "extension";
|
|
334
|
+
const _em = "email";
|
|
335
|
+
const _f = "filter[extension][]";
|
|
336
|
+
const _fD = "faxDialplan";
|
|
337
|
+
const _fDi = "filter[faxDialplan][]";
|
|
338
|
+
const _fDil = "filter[groupDn][]";
|
|
339
|
+
const _fDilt = "filter[pbxDn][]";
|
|
340
|
+
const _fP = "filter[officePhone][]";
|
|
341
|
+
const _fPi = "filter[mobilePhone][]";
|
|
342
|
+
const _fT = "filter[licenseType][]";
|
|
343
|
+
const _fi = "filter[id][]";
|
|
344
|
+
const _fie = "fields";
|
|
345
|
+
const _fil = "filter[name][]";
|
|
346
|
+
const _filt = "filter[email][]";
|
|
347
|
+
const _filte = "filter[role][]";
|
|
348
|
+
const _filter = "filter[dialplan][]";
|
|
349
|
+
const _filterd = "filter[department][]";
|
|
350
|
+
const _filterl = "filter[login][]";
|
|
351
|
+
const _g = "groups";
|
|
352
|
+
const _gD = "groupDn";
|
|
353
|
+
const _gr = "groups[]";
|
|
354
|
+
const _i = "id";
|
|
355
|
+
const _l = "login";
|
|
356
|
+
const _lT = "licenseType";
|
|
357
|
+
const _mP = "mobilePhone";
|
|
358
|
+
const _n = "name";
|
|
359
|
+
const _oP = "officePhone";
|
|
360
|
+
const _p = "permissions";
|
|
361
|
+
const _pD = "pbxDn";
|
|
362
|
+
const _pe = "permissions[]";
|
|
363
|
+
const _r = "role";
|
|
364
|
+
const _s = "search";
|
|
365
|
+
const _sF = "searchFields";
|
|
366
|
+
const _sS = "searchStrategy";
|
|
367
|
+
const _so = "sort";
|
|
368
|
+
const _st = "start";
|
|
484
369
|
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then(encoded => {
|
|
485
370
|
if (encoded.length) {
|
|
486
371
|
return JSON.parse(encoded);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
4
6
|
const sha256_browser_1 = require("@aws-crypto/sha256-browser");
|
|
7
|
+
const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser");
|
|
5
8
|
const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
|
|
6
9
|
const util_body_length_browser_1 = require("@smithy/util-body-length-browser");
|
|
7
10
|
const util_retry_1 = require("@smithy/util-retry");
|
|
@@ -18,8 +21,9 @@ const getRuntimeConfig = (config) => {
|
|
|
18
21
|
runtime: "browser",
|
|
19
22
|
defaultsMode,
|
|
20
23
|
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength,
|
|
24
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, util_user_agent_browser_1.defaultUserAgent)({ serviceId: package_json_1.default.name, clientVersion: package_json_1.default.version }),
|
|
21
25
|
maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS,
|
|
22
|
-
requestHandler: config?.requestHandler ??
|
|
26
|
+
requestHandler: fetch_http_handler_1.FetchHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
23
27
|
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE),
|
|
24
28
|
sha256: config?.sha256 ?? sha256_browser_1.Sha256,
|
|
25
29
|
streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
6
|
+
const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node");
|
|
4
7
|
const hash_node_1 = require("@smithy/hash-node");
|
|
5
8
|
const middleware_retry_1 = require("@smithy/middleware-retry");
|
|
6
9
|
const node_config_provider_1 = require("@smithy/node-config-provider");
|
|
@@ -22,8 +25,9 @@ const getRuntimeConfig = (config) => {
|
|
|
22
25
|
runtime: "node",
|
|
23
26
|
defaultsMode,
|
|
24
27
|
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
|
|
28
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, util_user_agent_node_1.defaultUserAgent)({ serviceId: package_json_1.default.name, clientVersion: package_json_1.default.version }),
|
|
25
29
|
maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
26
|
-
requestHandler: config?.requestHandler ??
|
|
30
|
+
requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
27
31
|
retryMode: config?.retryMode ?? (0, node_config_provider_1.loadConfig)({ ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE, }),
|
|
28
32
|
sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
|
|
29
33
|
streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
|
|
@@ -5,15 +5,17 @@ const smithy_client_1 = require("@smithy/smithy-client");
|
|
|
5
5
|
const url_parser_1 = require("@smithy/url-parser");
|
|
6
6
|
const util_base64_1 = require("@smithy/util-base64");
|
|
7
7
|
const util_utf8_1 = require("@smithy/util-utf8");
|
|
8
|
-
const getRuntimeConfig = (config) =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
const getRuntimeConfig = (config) => {
|
|
9
|
+
return {
|
|
10
|
+
apiVersion: "",
|
|
11
|
+
base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,
|
|
12
|
+
base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
|
|
13
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
14
|
+
extensions: config?.extensions ?? [],
|
|
15
|
+
logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
|
|
16
|
+
urlParser: config?.urlParser ?? url_parser_1.parseUrl,
|
|
17
|
+
utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
|
|
18
|
+
utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
19
21
|
exports.getRuntimeConfig = getRuntimeConfig;
|
package/dist-es/WmsApiClient.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
|
|
2
2
|
import { resolveRuntimeExtensions, } from "./runtimeExtensions";
|
|
3
|
+
import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
|
|
3
4
|
import { Client as __Client, } from "@smithy/smithy-client";
|
|
4
5
|
import { authorizationMiddleware } from '@wildix/smithy-utils';
|
|
5
6
|
export { __Client };
|
|
6
7
|
export class WmsApiClient extends __Client {
|
|
7
8
|
constructor(...[configuration]) {
|
|
8
9
|
let _config_0 = __getRuntimeConfig(configuration || {});
|
|
9
|
-
let _config_1 =
|
|
10
|
+
let _config_1 = resolveUserAgentConfig(_config_0);
|
|
11
|
+
let _config_2 = resolveRuntimeExtensions(_config_1, configuration?.extensions || []);
|
|
12
|
+
const hostname = configuration.domain.endsWith("wildixin.com") ? configuration.domain : `${configuration.domain}.wildixin.com`;
|
|
10
13
|
const endpoint = () => {
|
|
11
|
-
const hostname = configuration.domain.endsWith("wildixin.com") ? configuration.domain : `${configuration.domain}.wildixin.com`;
|
|
12
14
|
return {
|
|
13
15
|
hostname,
|
|
14
16
|
protocol: "https",
|
|
@@ -17,12 +19,13 @@ export class WmsApiClient extends __Client {
|
|
|
17
19
|
};
|
|
18
20
|
};
|
|
19
21
|
const config = {
|
|
20
|
-
...
|
|
22
|
+
..._config_2,
|
|
21
23
|
endpoint,
|
|
22
24
|
};
|
|
23
25
|
super(config);
|
|
24
26
|
this.config = config;
|
|
25
27
|
this.middlewareStack.add(authorizationMiddleware.bind(this, configuration.token), { step: "build" });
|
|
28
|
+
this.middlewareStack.use(getUserAgentPlugin(this.config));
|
|
26
29
|
}
|
|
27
30
|
destroy() {
|
|
28
31
|
super.destroy();
|