@wildix/wms-api-client 1.0.1
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/WmsApi.js +15 -0
- package/dist-cjs/WmsApiClient.js +34 -0
- package/dist-cjs/commands/GetPbxAclGroupsPermissionsCommand.js +41 -0
- package/dist-cjs/commands/GetPbxColleaguesCommand.js +41 -0
- package/dist-cjs/commands/index.js +5 -0
- package/dist-cjs/extensionConfiguration.js +2 -0
- package/dist-cjs/index.js +10 -0
- package/dist-cjs/models/WmsApiServiceException.js +12 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +54 -0
- package/dist-cjs/protocols/Aws_restJson1.js +178 -0
- package/dist-cjs/runtimeConfig.browser.js +28 -0
- package/dist-cjs/runtimeConfig.js +32 -0
- package/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist-cjs/runtimeConfig.shared.js +19 -0
- package/dist-cjs/runtimeExtensions.js +19 -0
- package/dist-es/WmsApi.js +11 -0
- package/dist-es/WmsApiClient.js +30 -0
- package/dist-es/commands/GetPbxAclGroupsPermissionsCommand.js +37 -0
- package/dist-es/commands/GetPbxColleaguesCommand.js +37 -0
- package/dist-es/commands/index.js +2 -0
- package/dist-es/extensionConfiguration.js +1 -0
- package/dist-es/index.js +5 -0
- package/dist-es/models/WmsApiServiceException.js +8 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +51 -0
- package/dist-es/protocols/Aws_restJson1.js +171 -0
- package/dist-es/runtimeConfig.browser.js +24 -0
- package/dist-es/runtimeConfig.js +28 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +15 -0
- package/dist-es/runtimeExtensions.js +15 -0
- package/dist-types/WmsApi.d.ts +23 -0
- package/dist-types/WmsApiClient.d.ts +139 -0
- package/dist-types/commands/GetPbxAclGroupsPermissionsCommand.d.ts +91 -0
- package/dist-types/commands/GetPbxColleaguesCommand.d.ts +138 -0
- package/dist-types/commands/index.d.ts +2 -0
- package/dist-types/extensionConfiguration.d.ts +7 -0
- package/dist-types/index.d.ts +5 -0
- package/dist-types/models/WmsApiServiceException.d.ts +13 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +208 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +20 -0
- package/dist-types/runtimeConfig.browser.d.ts +30 -0
- package/dist-types/runtimeConfig.d.ts +30 -0
- package/dist-types/runtimeConfig.native.d.ts +29 -0
- package/dist-types/runtimeConfig.shared.d.ts +15 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/package.json +77 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WmsApi = void 0;
|
|
4
|
+
const WmsApiClient_1 = require("./WmsApiClient");
|
|
5
|
+
const GetPbxAclGroupsPermissionsCommand_1 = require("./commands/GetPbxAclGroupsPermissionsCommand");
|
|
6
|
+
const GetPbxColleaguesCommand_1 = require("./commands/GetPbxColleaguesCommand");
|
|
7
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
8
|
+
const commands = {
|
|
9
|
+
GetPbxAclGroupsPermissionsCommand: GetPbxAclGroupsPermissionsCommand_1.GetPbxAclGroupsPermissionsCommand,
|
|
10
|
+
GetPbxColleaguesCommand: GetPbxColleaguesCommand_1.GetPbxColleaguesCommand,
|
|
11
|
+
};
|
|
12
|
+
class WmsApi extends WmsApiClient_1.WmsApiClient {
|
|
13
|
+
}
|
|
14
|
+
exports.WmsApi = WmsApi;
|
|
15
|
+
(0, smithy_client_1.createAggregatedClient)(commands, WmsApi);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WmsApiClient = exports.__Client = void 0;
|
|
4
|
+
const runtimeConfig_1 = require("./runtimeConfig");
|
|
5
|
+
const runtimeExtensions_1 = require("./runtimeExtensions");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
Object.defineProperty(exports, "__Client", { enumerable: true, get: function () { return smithy_client_1.Client; } });
|
|
8
|
+
const smithy_utils_1 = require("@wildix/smithy-utils");
|
|
9
|
+
class WmsApiClient extends smithy_client_1.Client {
|
|
10
|
+
constructor(...[configuration]) {
|
|
11
|
+
let _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {});
|
|
12
|
+
let _config_1 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_0, configuration?.extensions || []);
|
|
13
|
+
const endpoint = () => {
|
|
14
|
+
const hostname = configuration.domain.endsWith("wildixin.com") ? configuration.domain : `${configuration.domain}.wildixin.com`;
|
|
15
|
+
return {
|
|
16
|
+
hostname,
|
|
17
|
+
protocol: "https",
|
|
18
|
+
port: configuration.port ? String(configuration.port) : '443',
|
|
19
|
+
path: ''
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
const config = {
|
|
23
|
+
..._config_1,
|
|
24
|
+
endpoint,
|
|
25
|
+
};
|
|
26
|
+
super(config);
|
|
27
|
+
this.config = config;
|
|
28
|
+
this.middlewareStack.add(smithy_utils_1.authorizationMiddleware.bind(this, configuration.token), { step: "build" });
|
|
29
|
+
}
|
|
30
|
+
destroy() {
|
|
31
|
+
super.destroy();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.WmsApiClient = WmsApiClient;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetPbxAclGroupsPermissionsCommand = exports.$Command = void 0;
|
|
4
|
+
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
5
|
+
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
+
const types_1 = require("@smithy/types");
|
|
9
|
+
class GetPbxAclGroupsPermissionsCommand extends smithy_client_1.Command {
|
|
10
|
+
constructor(input) {
|
|
11
|
+
super();
|
|
12
|
+
this.input = input;
|
|
13
|
+
}
|
|
14
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
15
|
+
this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
|
|
16
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
17
|
+
const { logger } = configuration;
|
|
18
|
+
const clientName = "WmsApiClient";
|
|
19
|
+
const commandName = "GetPbxAclGroupsPermissionsCommand";
|
|
20
|
+
const handlerExecutionContext = {
|
|
21
|
+
logger,
|
|
22
|
+
clientName,
|
|
23
|
+
commandName,
|
|
24
|
+
inputFilterSensitiveLog: (_) => _,
|
|
25
|
+
outputFilterSensitiveLog: (_) => _,
|
|
26
|
+
[types_1.SMITHY_CONTEXT_KEY]: {
|
|
27
|
+
service: "WmsApi",
|
|
28
|
+
operation: "GetPbxAclGroupsPermissions",
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
const { requestHandler } = configuration;
|
|
32
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
33
|
+
}
|
|
34
|
+
serialize(input, context) {
|
|
35
|
+
return (0, Aws_restJson1_1.se_GetPbxAclGroupsPermissionsCommand)(input, context);
|
|
36
|
+
}
|
|
37
|
+
deserialize(output, context) {
|
|
38
|
+
return (0, Aws_restJson1_1.de_GetPbxAclGroupsPermissionsCommand)(output, context);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.GetPbxAclGroupsPermissionsCommand = GetPbxAclGroupsPermissionsCommand;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetPbxColleaguesCommand = exports.$Command = void 0;
|
|
4
|
+
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
5
|
+
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
+
const types_1 = require("@smithy/types");
|
|
9
|
+
class GetPbxColleaguesCommand extends smithy_client_1.Command {
|
|
10
|
+
constructor(input) {
|
|
11
|
+
super();
|
|
12
|
+
this.input = input;
|
|
13
|
+
}
|
|
14
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
15
|
+
this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
|
|
16
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
17
|
+
const { logger } = configuration;
|
|
18
|
+
const clientName = "WmsApiClient";
|
|
19
|
+
const commandName = "GetPbxColleaguesCommand";
|
|
20
|
+
const handlerExecutionContext = {
|
|
21
|
+
logger,
|
|
22
|
+
clientName,
|
|
23
|
+
commandName,
|
|
24
|
+
inputFilterSensitiveLog: (_) => _,
|
|
25
|
+
outputFilterSensitiveLog: (_) => _,
|
|
26
|
+
[types_1.SMITHY_CONTEXT_KEY]: {
|
|
27
|
+
service: "WmsApi",
|
|
28
|
+
operation: "GetPbxColleagues",
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
const { requestHandler } = configuration;
|
|
32
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
33
|
+
}
|
|
34
|
+
serialize(input, context) {
|
|
35
|
+
return (0, Aws_restJson1_1.se_GetPbxColleaguesCommand)(input, context);
|
|
36
|
+
}
|
|
37
|
+
deserialize(output, context) {
|
|
38
|
+
return (0, Aws_restJson1_1.de_GetPbxColleaguesCommand)(output, context);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.GetPbxColleaguesCommand = GetPbxColleaguesCommand;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WmsApiServiceException = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./WmsApiClient"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./WmsApi"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./commands"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./models"), exports);
|
|
9
|
+
var WmsApiServiceException_1 = require("./models/WmsApiServiceException");
|
|
10
|
+
Object.defineProperty(exports, "WmsApiServiceException", { enumerable: true, get: function () { return WmsApiServiceException_1.WmsApiServiceException; } });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WmsApiServiceException = exports.__ServiceException = void 0;
|
|
4
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
5
|
+
Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function () { return smithy_client_1.ServiceException; } });
|
|
6
|
+
class WmsApiServiceException extends smithy_client_1.ServiceException {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
9
|
+
Object.setPrototypeOf(this, WmsApiServiceException.prototype);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.WmsApiServiceException = WmsApiServiceException;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PbxColleagueRole = exports.PbxColleaguesSearchStrategy = exports.PbxColleaguesQueryField = exports.GetPbxColleaguesDir = exports.ResponseType = exports.PbxLicenseType = exports.AclGroupPermissionAbility = void 0;
|
|
4
|
+
exports.AclGroupPermissionAbility = {
|
|
5
|
+
CAN: "can",
|
|
6
|
+
CANNOT: "cannot",
|
|
7
|
+
NO: "no",
|
|
8
|
+
YES: "yes",
|
|
9
|
+
};
|
|
10
|
+
exports.PbxLicenseType = {
|
|
11
|
+
BASIC: "basic",
|
|
12
|
+
BUSINESS: "business",
|
|
13
|
+
ESSENTIAL: "essential",
|
|
14
|
+
PREMIUM: "premium",
|
|
15
|
+
WIZYCONF: "wizyconf",
|
|
16
|
+
};
|
|
17
|
+
exports.ResponseType = {
|
|
18
|
+
ERROR: "error",
|
|
19
|
+
RESULT: "result",
|
|
20
|
+
};
|
|
21
|
+
exports.GetPbxColleaguesDir = {
|
|
22
|
+
ASC: "asc",
|
|
23
|
+
DESC: "desc",
|
|
24
|
+
};
|
|
25
|
+
exports.PbxColleaguesQueryField = {
|
|
26
|
+
DEPARTMENT: "department",
|
|
27
|
+
DIALPLAN: "dialplan",
|
|
28
|
+
EMAIL: "email",
|
|
29
|
+
EXTENSION: "extension",
|
|
30
|
+
FAX_DIALPLAN: "faxDialplan",
|
|
31
|
+
GROUP_DN: "groupDn",
|
|
32
|
+
ID: "id",
|
|
33
|
+
LANGUAGE: "language",
|
|
34
|
+
LICENSE_TYPE: "licenseType",
|
|
35
|
+
LOGIN: "login",
|
|
36
|
+
MOBILE_PHONE: "mobilePhone",
|
|
37
|
+
NAME: "name",
|
|
38
|
+
OFFICE_PHONE: "officePhone",
|
|
39
|
+
PBX_DN: "pbxDn",
|
|
40
|
+
PICTURE: "picture",
|
|
41
|
+
ROLE: "role",
|
|
42
|
+
SOURCE_ID: "sourceId",
|
|
43
|
+
};
|
|
44
|
+
exports.PbxColleaguesSearchStrategy = {
|
|
45
|
+
CONTAIN: "contain",
|
|
46
|
+
STARTS_WITH: "startsWith",
|
|
47
|
+
};
|
|
48
|
+
exports.PbxColleagueRole = {
|
|
49
|
+
ADMIN: "admin",
|
|
50
|
+
FAX: "fax",
|
|
51
|
+
PARK_ORBIT: "park_orbit",
|
|
52
|
+
ROOM: "room",
|
|
53
|
+
USER: "user",
|
|
54
|
+
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.de_GetPbxColleaguesCommand = exports.de_GetPbxAclGroupsPermissionsCommand = exports.se_GetPbxColleaguesCommand = exports.se_GetPbxAclGroupsPermissionsCommand = void 0;
|
|
4
|
+
const WmsApiServiceException_1 = require("../models/WmsApiServiceException");
|
|
5
|
+
const protocol_http_1 = require("@smithy/protocol-http");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
const se_GetPbxAclGroupsPermissionsCommand = async (input, context) => {
|
|
8
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
9
|
+
const headers = {
|
|
10
|
+
'content-type': 'application/json',
|
|
11
|
+
};
|
|
12
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/pbx/aclgroups/permissions";
|
|
13
|
+
let body;
|
|
14
|
+
body = "";
|
|
15
|
+
return new protocol_http_1.HttpRequest({
|
|
16
|
+
protocol,
|
|
17
|
+
hostname,
|
|
18
|
+
port,
|
|
19
|
+
method: "GET",
|
|
20
|
+
headers,
|
|
21
|
+
path: resolvedPath,
|
|
22
|
+
body,
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
exports.se_GetPbxAclGroupsPermissionsCommand = se_GetPbxAclGroupsPermissionsCommand;
|
|
26
|
+
const se_GetPbxColleaguesCommand = async (input, context) => {
|
|
27
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
28
|
+
const headers = {};
|
|
29
|
+
let resolvedPath = `${basePath?.endsWith('/') ? basePath.slice(0, -1) : (basePath || '')}` + "/api/v1/PBX/Colleagues";
|
|
30
|
+
const query = (0, smithy_client_1.map)({
|
|
31
|
+
"filter[extension][]": [() => input.extension !== void 0, () => ((input.extension || []).map(_entry => _entry))],
|
|
32
|
+
"filter[id][]": [() => input.id !== void 0, () => ((input.id || []).map(_entry => _entry))],
|
|
33
|
+
"filter[officePhone][]": [() => input.officePhone !== void 0, () => ((input.officePhone || []).map(_entry => _entry))],
|
|
34
|
+
"filter[mobilePhone][]": [() => input.mobilePhone !== void 0, () => ((input.mobilePhone || []).map(_entry => _entry))],
|
|
35
|
+
"filter[name][]": [() => input.name !== void 0, () => ((input.name || []).map(_entry => _entry))],
|
|
36
|
+
"filter[email][]": [() => input.email !== void 0, () => ((input.email || []).map(_entry => _entry))],
|
|
37
|
+
"filter[role][]": [() => input.role !== void 0, () => ((input.role || []).map(_entry => _entry))],
|
|
38
|
+
"filter[dialplan][]": [() => input.dialplan !== void 0, () => ((input.dialplan || []).map(_entry => _entry))],
|
|
39
|
+
"filter[faxDialplan][]": [() => input.faxDialplan !== void 0, () => ((input.faxDialplan || []).map(_entry => _entry))],
|
|
40
|
+
"filter[department][]": [() => input.department !== void 0, () => ((input.department || []).map(_entry => _entry))],
|
|
41
|
+
"filter[login][]": [() => input.login !== void 0, () => ((input.login || []).map(_entry => _entry))],
|
|
42
|
+
"filter[groupDn][]": [() => input.groupDn !== void 0, () => ((input.groupDn || []).map(_entry => _entry))],
|
|
43
|
+
"filter[pbxDn][]": [() => input.pbxDn !== void 0, () => ((input.pbxDn || []).map(_entry => _entry))],
|
|
44
|
+
"filter[licenseType][]": [() => input.licenseType !== void 0, () => ((input.licenseType || []).map(_entry => _entry))],
|
|
45
|
+
"fields": [() => input.fields !== void 0, () => ((input.fields || []).map(_entry => _entry))],
|
|
46
|
+
"searchFields": [() => input.searchFields !== void 0, () => ((input.searchFields || []).map(_entry => _entry))],
|
|
47
|
+
"search": [, input.search],
|
|
48
|
+
"sort": [() => input.sort !== void 0, () => ((input.sort || []).map(_entry => _entry))],
|
|
49
|
+
"start": [() => input.start !== void 0, () => (input.start.toString())],
|
|
50
|
+
"count": [() => input.count !== void 0, () => (input.count.toString())],
|
|
51
|
+
"dir": [, input.dir],
|
|
52
|
+
"searchStrategy": [, input.searchStrategy],
|
|
53
|
+
});
|
|
54
|
+
let body;
|
|
55
|
+
return new protocol_http_1.HttpRequest({
|
|
56
|
+
protocol,
|
|
57
|
+
hostname,
|
|
58
|
+
port,
|
|
59
|
+
method: "GET",
|
|
60
|
+
headers,
|
|
61
|
+
path: resolvedPath,
|
|
62
|
+
query,
|
|
63
|
+
body,
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
exports.se_GetPbxColleaguesCommand = se_GetPbxColleaguesCommand;
|
|
67
|
+
const de_GetPbxAclGroupsPermissionsCommand = async (output, context) => {
|
|
68
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
69
|
+
return de_GetPbxAclGroupsPermissionsCommandError(output, context);
|
|
70
|
+
}
|
|
71
|
+
const contents = (0, smithy_client_1.map)({
|
|
72
|
+
$metadata: deserializeMetadata(output),
|
|
73
|
+
});
|
|
74
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
|
|
75
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
76
|
+
'result': smithy_client_1._json,
|
|
77
|
+
'type': smithy_client_1.expectString,
|
|
78
|
+
});
|
|
79
|
+
Object.assign(contents, doc);
|
|
80
|
+
return contents;
|
|
81
|
+
};
|
|
82
|
+
exports.de_GetPbxAclGroupsPermissionsCommand = de_GetPbxAclGroupsPermissionsCommand;
|
|
83
|
+
const de_GetPbxAclGroupsPermissionsCommandError = async (output, context) => {
|
|
84
|
+
const parsedOutput = {
|
|
85
|
+
...output,
|
|
86
|
+
body: await parseErrorBody(output.body, context)
|
|
87
|
+
};
|
|
88
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
89
|
+
const parsedBody = parsedOutput.body;
|
|
90
|
+
return throwDefaultError({
|
|
91
|
+
output,
|
|
92
|
+
parsedBody,
|
|
93
|
+
errorCode
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
const de_GetPbxColleaguesCommand = async (output, context) => {
|
|
97
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
98
|
+
return de_GetPbxColleaguesCommandError(output, context);
|
|
99
|
+
}
|
|
100
|
+
const contents = (0, smithy_client_1.map)({
|
|
101
|
+
$metadata: deserializeMetadata(output),
|
|
102
|
+
});
|
|
103
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await parseBody(output.body, context))), "body");
|
|
104
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
105
|
+
'result': smithy_client_1._json,
|
|
106
|
+
'type': smithy_client_1.expectString,
|
|
107
|
+
});
|
|
108
|
+
Object.assign(contents, doc);
|
|
109
|
+
return contents;
|
|
110
|
+
};
|
|
111
|
+
exports.de_GetPbxColleaguesCommand = de_GetPbxColleaguesCommand;
|
|
112
|
+
const de_GetPbxColleaguesCommandError = async (output, context) => {
|
|
113
|
+
const parsedOutput = {
|
|
114
|
+
...output,
|
|
115
|
+
body: await parseErrorBody(output.body, context)
|
|
116
|
+
};
|
|
117
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
118
|
+
const parsedBody = parsedOutput.body;
|
|
119
|
+
return throwDefaultError({
|
|
120
|
+
output,
|
|
121
|
+
parsedBody,
|
|
122
|
+
errorCode
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
const throwDefaultError = (0, smithy_client_1.withBaseException)(WmsApiServiceException_1.WmsApiServiceException);
|
|
126
|
+
const deserializeMetadata = (output) => ({
|
|
127
|
+
httpStatusCode: output.statusCode,
|
|
128
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
129
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
130
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
131
|
+
});
|
|
132
|
+
const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then(body => context.utf8Encoder(body));
|
|
133
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
134
|
+
value !== null &&
|
|
135
|
+
value !== "" &&
|
|
136
|
+
(!Object.getOwnPropertyNames(value).includes("length") ||
|
|
137
|
+
value.length != 0) &&
|
|
138
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
139
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then(encoded => {
|
|
140
|
+
if (encoded.length) {
|
|
141
|
+
return JSON.parse(encoded);
|
|
142
|
+
}
|
|
143
|
+
return {};
|
|
144
|
+
});
|
|
145
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
146
|
+
const value = await parseBody(errorBody, context);
|
|
147
|
+
value.message = value.message ?? value.Message;
|
|
148
|
+
return value;
|
|
149
|
+
};
|
|
150
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
151
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
152
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
153
|
+
let cleanValue = rawValue;
|
|
154
|
+
if (typeof cleanValue === "number") {
|
|
155
|
+
cleanValue = cleanValue.toString();
|
|
156
|
+
}
|
|
157
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
158
|
+
cleanValue = cleanValue.split(",")[0];
|
|
159
|
+
}
|
|
160
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
161
|
+
cleanValue = cleanValue.split(":")[0];
|
|
162
|
+
}
|
|
163
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
164
|
+
cleanValue = cleanValue.split("#")[1];
|
|
165
|
+
}
|
|
166
|
+
return cleanValue;
|
|
167
|
+
};
|
|
168
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
169
|
+
if (headerKey !== undefined) {
|
|
170
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
171
|
+
}
|
|
172
|
+
if (data.code !== undefined) {
|
|
173
|
+
return sanitizeErrorCode(data.code);
|
|
174
|
+
}
|
|
175
|
+
if (data["__type"] !== undefined) {
|
|
176
|
+
return sanitizeErrorCode(data["__type"]);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const sha256_browser_1 = require("@aws-crypto/sha256-browser");
|
|
5
|
+
const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
|
|
6
|
+
const util_body_length_browser_1 = require("@smithy/util-body-length-browser");
|
|
7
|
+
const util_retry_1 = require("@smithy/util-retry");
|
|
8
|
+
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
|
9
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
10
|
+
const util_defaults_mode_browser_1 = require("@smithy/util-defaults-mode-browser");
|
|
11
|
+
const getRuntimeConfig = (config) => {
|
|
12
|
+
const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config);
|
|
13
|
+
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
|
|
14
|
+
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
|
|
15
|
+
return {
|
|
16
|
+
...clientSharedValues,
|
|
17
|
+
...config,
|
|
18
|
+
runtime: "browser",
|
|
19
|
+
defaultsMode,
|
|
20
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength,
|
|
21
|
+
maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS,
|
|
22
|
+
requestHandler: config?.requestHandler ?? new fetch_http_handler_1.FetchHttpHandler(defaultConfigProvider),
|
|
23
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE),
|
|
24
|
+
sha256: config?.sha256 ?? sha256_browser_1.Sha256,
|
|
25
|
+
streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector,
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const hash_node_1 = require("@smithy/hash-node");
|
|
5
|
+
const middleware_retry_1 = require("@smithy/middleware-retry");
|
|
6
|
+
const node_config_provider_1 = require("@smithy/node-config-provider");
|
|
7
|
+
const node_http_handler_1 = require("@smithy/node-http-handler");
|
|
8
|
+
const util_body_length_node_1 = require("@smithy/util-body-length-node");
|
|
9
|
+
const util_retry_1 = require("@smithy/util-retry");
|
|
10
|
+
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
|
11
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
12
|
+
const util_defaults_mode_node_1 = require("@smithy/util-defaults-mode-node");
|
|
13
|
+
const smithy_client_2 = require("@smithy/smithy-client");
|
|
14
|
+
const getRuntimeConfig = (config) => {
|
|
15
|
+
(0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
|
|
16
|
+
const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
|
|
17
|
+
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
|
|
18
|
+
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
|
|
19
|
+
return {
|
|
20
|
+
...clientSharedValues,
|
|
21
|
+
...config,
|
|
22
|
+
runtime: "node",
|
|
23
|
+
defaultsMode,
|
|
24
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
|
|
25
|
+
maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
26
|
+
requestHandler: config?.requestHandler ?? new node_http_handler_1.NodeHttpHandler(defaultConfigProvider),
|
|
27
|
+
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
|
+
sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
|
|
29
|
+
streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const sha256_js_1 = require("@aws-crypto/sha256-js");
|
|
5
|
+
const runtimeConfig_browser_1 = require("./runtimeConfig.browser");
|
|
6
|
+
const getRuntimeConfig = (config) => {
|
|
7
|
+
const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config);
|
|
8
|
+
return {
|
|
9
|
+
...browserDefaults,
|
|
10
|
+
...config,
|
|
11
|
+
runtime: "react-native",
|
|
12
|
+
sha256: config?.sha256 ?? sha256_js_1.Sha256,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
5
|
+
const url_parser_1 = require("@smithy/url-parser");
|
|
6
|
+
const util_base64_1 = require("@smithy/util-base64");
|
|
7
|
+
const util_utf8_1 = require("@smithy/util-utf8");
|
|
8
|
+
const getRuntimeConfig = (config) => ({
|
|
9
|
+
apiVersion: "",
|
|
10
|
+
base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,
|
|
11
|
+
base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
|
|
12
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
13
|
+
extensions: config?.extensions ?? [],
|
|
14
|
+
logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
|
|
15
|
+
urlParser: config?.urlParser ?? url_parser_1.parseUrl,
|
|
16
|
+
utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
|
|
17
|
+
utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
|
|
18
|
+
});
|
|
19
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRuntimeExtensions = void 0;
|
|
4
|
+
const protocol_http_1 = require("@smithy/protocol-http");
|
|
5
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
6
|
+
const asPartial = (t) => t;
|
|
7
|
+
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
8
|
+
const extensionConfiguration = {
|
|
9
|
+
...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
|
|
10
|
+
...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
|
|
11
|
+
};
|
|
12
|
+
extensions.forEach(extension => extension.configure(extensionConfiguration));
|
|
13
|
+
return {
|
|
14
|
+
...runtimeConfig,
|
|
15
|
+
...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration),
|
|
16
|
+
...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WmsApiClient, } from "./WmsApiClient";
|
|
2
|
+
import { GetPbxAclGroupsPermissionsCommand, } from "./commands/GetPbxAclGroupsPermissionsCommand";
|
|
3
|
+
import { GetPbxColleaguesCommand, } from "./commands/GetPbxColleaguesCommand";
|
|
4
|
+
import { createAggregatedClient } from "@smithy/smithy-client";
|
|
5
|
+
const commands = {
|
|
6
|
+
GetPbxAclGroupsPermissionsCommand,
|
|
7
|
+
GetPbxColleaguesCommand,
|
|
8
|
+
};
|
|
9
|
+
export class WmsApi extends WmsApiClient {
|
|
10
|
+
}
|
|
11
|
+
createAggregatedClient(commands, WmsApi);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
|
|
2
|
+
import { resolveRuntimeExtensions, } from "./runtimeExtensions";
|
|
3
|
+
import { Client as __Client, } from "@smithy/smithy-client";
|
|
4
|
+
import { authorizationMiddleware } from '@wildix/smithy-utils';
|
|
5
|
+
export { __Client };
|
|
6
|
+
export class WmsApiClient extends __Client {
|
|
7
|
+
constructor(...[configuration]) {
|
|
8
|
+
let _config_0 = __getRuntimeConfig(configuration || {});
|
|
9
|
+
let _config_1 = resolveRuntimeExtensions(_config_0, configuration?.extensions || []);
|
|
10
|
+
const endpoint = () => {
|
|
11
|
+
const hostname = configuration.domain.endsWith("wildixin.com") ? configuration.domain : `${configuration.domain}.wildixin.com`;
|
|
12
|
+
return {
|
|
13
|
+
hostname,
|
|
14
|
+
protocol: "https",
|
|
15
|
+
port: configuration.port ? String(configuration.port) : '443',
|
|
16
|
+
path: ''
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
const config = {
|
|
20
|
+
..._config_1,
|
|
21
|
+
endpoint,
|
|
22
|
+
};
|
|
23
|
+
super(config);
|
|
24
|
+
this.config = config;
|
|
25
|
+
this.middlewareStack.add(authorizationMiddleware.bind(this, configuration.token), { step: "build" });
|
|
26
|
+
}
|
|
27
|
+
destroy() {
|
|
28
|
+
super.destroy();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { de_GetPbxAclGroupsPermissionsCommand, se_GetPbxAclGroupsPermissionsCommand, } from "../protocols/Aws_restJson1";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
|
|
5
|
+
export { $Command };
|
|
6
|
+
export class GetPbxAclGroupsPermissionsCommand extends $Command {
|
|
7
|
+
constructor(input) {
|
|
8
|
+
super();
|
|
9
|
+
this.input = input;
|
|
10
|
+
}
|
|
11
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
12
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
13
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
14
|
+
const { logger } = configuration;
|
|
15
|
+
const clientName = "WmsApiClient";
|
|
16
|
+
const commandName = "GetPbxAclGroupsPermissionsCommand";
|
|
17
|
+
const handlerExecutionContext = {
|
|
18
|
+
logger,
|
|
19
|
+
clientName,
|
|
20
|
+
commandName,
|
|
21
|
+
inputFilterSensitiveLog: (_) => _,
|
|
22
|
+
outputFilterSensitiveLog: (_) => _,
|
|
23
|
+
[SMITHY_CONTEXT_KEY]: {
|
|
24
|
+
service: "WmsApi",
|
|
25
|
+
operation: "GetPbxAclGroupsPermissions",
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
const { requestHandler } = configuration;
|
|
29
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
30
|
+
}
|
|
31
|
+
serialize(input, context) {
|
|
32
|
+
return se_GetPbxAclGroupsPermissionsCommand(input, context);
|
|
33
|
+
}
|
|
34
|
+
deserialize(output, context) {
|
|
35
|
+
return de_GetPbxAclGroupsPermissionsCommand(output, context);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { de_GetPbxColleaguesCommand, se_GetPbxColleaguesCommand, } from "../protocols/Aws_restJson1";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
|
|
5
|
+
export { $Command };
|
|
6
|
+
export class GetPbxColleaguesCommand extends $Command {
|
|
7
|
+
constructor(input) {
|
|
8
|
+
super();
|
|
9
|
+
this.input = input;
|
|
10
|
+
}
|
|
11
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
12
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
13
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
14
|
+
const { logger } = configuration;
|
|
15
|
+
const clientName = "WmsApiClient";
|
|
16
|
+
const commandName = "GetPbxColleaguesCommand";
|
|
17
|
+
const handlerExecutionContext = {
|
|
18
|
+
logger,
|
|
19
|
+
clientName,
|
|
20
|
+
commandName,
|
|
21
|
+
inputFilterSensitiveLog: (_) => _,
|
|
22
|
+
outputFilterSensitiveLog: (_) => _,
|
|
23
|
+
[SMITHY_CONTEXT_KEY]: {
|
|
24
|
+
service: "WmsApi",
|
|
25
|
+
operation: "GetPbxColleagues",
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
const { requestHandler } = configuration;
|
|
29
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
30
|
+
}
|
|
31
|
+
serialize(input, context) {
|
|
32
|
+
return se_GetPbxColleaguesCommand(input, context);
|
|
33
|
+
}
|
|
34
|
+
deserialize(output, context) {
|
|
35
|
+
return de_GetPbxColleaguesCommand(output, context);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|