@wildix/wim-voicebots-client 1.1.9 → 3.1.10

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.
Files changed (102) hide show
  1. package/dist-cjs/VoiceBots.js +3 -3
  2. package/dist-cjs/VoiceBotsClient.js +34 -26
  3. package/dist-cjs/auth/httpAuthExtensionConfiguration.js +43 -0
  4. package/dist-cjs/auth/httpAuthSchemeProvider.js +65 -0
  5. package/dist-cjs/commands/CreateVoiceBotCommand.js +10 -11
  6. package/dist-cjs/commands/DeleteVoiceBotCommand.js +10 -11
  7. package/dist-cjs/commands/DescribeEventCommand.js +10 -11
  8. package/dist-cjs/commands/GetTraceCommand.js +10 -11
  9. package/dist-cjs/commands/GetVoiceBotCommand.js +10 -11
  10. package/dist-cjs/commands/ListTracesCommand.js +10 -11
  11. package/dist-cjs/commands/ListVoiceBotsCommand.js +10 -11
  12. package/dist-cjs/commands/ListVoiceBotsNamesCommand.js +10 -11
  13. package/dist-cjs/commands/SendHangupCommand.js +10 -11
  14. package/dist-cjs/commands/SendPlayCommand.js +10 -11
  15. package/dist-cjs/commands/SendSayCommand.js +10 -11
  16. package/dist-cjs/commands/SendStopCommand.js +10 -11
  17. package/dist-cjs/commands/SendTransferCommand.js +10 -11
  18. package/dist-cjs/commands/UpdateVoiceBotCommand.js +10 -11
  19. package/dist-cjs/endpoint/EndpointParameters.js +16 -0
  20. package/dist-cjs/endpoint/bdd.js +28 -0
  21. package/dist-cjs/endpoint/endpointResolver.js +16 -0
  22. package/dist-cjs/index.js +4 -1
  23. package/dist-cjs/models/VoiceBotsServiceException.js +3 -3
  24. package/dist-cjs/models/enums.js +64 -0
  25. package/dist-cjs/models/errors.js +75 -0
  26. package/dist-cjs/models/models_0.js +0 -350
  27. package/dist-cjs/runtimeConfig.browser.js +11 -11
  28. package/dist-cjs/runtimeConfig.js +22 -18
  29. package/dist-cjs/runtimeConfig.shared.js +30 -10
  30. package/dist-cjs/runtimeExtensions.js +6 -5
  31. package/dist-cjs/schemas/schemas_0.js +1247 -0
  32. package/dist-es/VoiceBots.js +6 -6
  33. package/dist-es/VoiceBotsClient.js +30 -22
  34. package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  35. package/dist-es/auth/httpAuthSchemeProvider.js +59 -0
  36. package/dist-es/commands/CreateVoiceBotCommand.js +9 -10
  37. package/dist-es/commands/DeleteVoiceBotCommand.js +9 -10
  38. package/dist-es/commands/DescribeEventCommand.js +9 -10
  39. package/dist-es/commands/GetTraceCommand.js +9 -10
  40. package/dist-es/commands/GetVoiceBotCommand.js +9 -10
  41. package/dist-es/commands/ListTracesCommand.js +9 -10
  42. package/dist-es/commands/ListVoiceBotsCommand.js +9 -10
  43. package/dist-es/commands/ListVoiceBotsNamesCommand.js +9 -10
  44. package/dist-es/commands/SendHangupCommand.js +9 -10
  45. package/dist-es/commands/SendPlayCommand.js +9 -10
  46. package/dist-es/commands/SendSayCommand.js +9 -10
  47. package/dist-es/commands/SendStopCommand.js +9 -10
  48. package/dist-es/commands/SendTransferCommand.js +9 -10
  49. package/dist-es/commands/UpdateVoiceBotCommand.js +9 -10
  50. package/dist-es/endpoint/EndpointParameters.js +12 -0
  51. package/dist-es/endpoint/bdd.js +25 -0
  52. package/dist-es/endpoint/endpointResolver.js +12 -0
  53. package/dist-es/index.js +4 -1
  54. package/dist-es/models/VoiceBotsServiceException.js +1 -1
  55. package/dist-es/models/enums.js +61 -0
  56. package/dist-es/models/errors.js +67 -0
  57. package/dist-es/models/models_0.js +1 -344
  58. package/dist-es/runtimeConfig.browser.js +7 -7
  59. package/dist-es/runtimeConfig.js +17 -13
  60. package/dist-es/runtimeConfig.shared.js +24 -4
  61. package/dist-es/runtimeExtensions.js +6 -5
  62. package/dist-es/schemas/schemas_0.js +1241 -0
  63. package/dist-types/VoiceBots.d.ts +15 -15
  64. package/dist-types/VoiceBotsClient.d.ts +44 -26
  65. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  66. package/dist-types/auth/httpAuthSchemeProvider.d.ts +81 -0
  67. package/dist-types/commands/CreateVoiceBotCommand.d.ts +11 -7
  68. package/dist-types/commands/DeleteVoiceBotCommand.d.ts +11 -7
  69. package/dist-types/commands/DescribeEventCommand.d.ts +11 -7
  70. package/dist-types/commands/GetTraceCommand.d.ts +11 -7
  71. package/dist-types/commands/GetVoiceBotCommand.d.ts +11 -7
  72. package/dist-types/commands/ListTracesCommand.d.ts +11 -7
  73. package/dist-types/commands/ListVoiceBotsCommand.d.ts +11 -7
  74. package/dist-types/commands/ListVoiceBotsNamesCommand.d.ts +11 -7
  75. package/dist-types/commands/SendHangupCommand.d.ts +11 -7
  76. package/dist-types/commands/SendPlayCommand.d.ts +11 -7
  77. package/dist-types/commands/SendSayCommand.d.ts +11 -7
  78. package/dist-types/commands/SendStopCommand.d.ts +11 -7
  79. package/dist-types/commands/SendTransferCommand.d.ts +11 -7
  80. package/dist-types/commands/UpdateVoiceBotCommand.d.ts +11 -7
  81. package/dist-types/endpoint/EndpointParameters.d.ts +41 -0
  82. package/dist-types/endpoint/bdd.d.ts +2 -0
  83. package/dist-types/endpoint/endpointResolver.d.ts +8 -0
  84. package/dist-types/extensionConfiguration.d.ts +4 -3
  85. package/dist-types/index.d.ts +5 -1
  86. package/dist-types/models/VoiceBotsServiceException.d.ts +1 -1
  87. package/dist-types/models/enums.d.ts +141 -0
  88. package/dist-types/models/errors.d.ts +60 -0
  89. package/dist-types/models/models_0.d.ts +92 -244
  90. package/dist-types/runtimeConfig.browser.d.ts +34 -15
  91. package/dist-types/runtimeConfig.d.ts +33 -14
  92. package/dist-types/runtimeConfig.native.d.ts +35 -16
  93. package/dist-types/runtimeConfig.shared.d.ts +20 -3
  94. package/dist-types/runtimeExtensions.d.ts +1 -1
  95. package/dist-types/schemas/schemas_0.d.ts +175 -0
  96. package/package.json +14 -40
  97. package/dist-cjs/models/index.js +0 -4
  98. package/dist-cjs/protocols/Aws_restJson1.js +0 -1106
  99. package/dist-es/models/index.js +0 -1
  100. package/dist-es/protocols/Aws_restJson1.js +0 -1075
  101. package/dist-types/models/index.d.ts +0 -1
  102. package/dist-types/protocols/Aws_restJson1.d.ts +0 -128
@@ -1,19 +1,19 @@
1
- import { VoiceBotsClient, } from "./VoiceBotsClient";
1
+ import { createAggregatedClient } from "@smithy/core/client";
2
2
  import { CreateVoiceBotCommand, } from "./commands/CreateVoiceBotCommand";
3
3
  import { DeleteVoiceBotCommand, } from "./commands/DeleteVoiceBotCommand";
4
4
  import { DescribeEventCommand, } from "./commands/DescribeEventCommand";
5
- import { GetTraceCommand, } from "./commands/GetTraceCommand";
5
+ import { GetTraceCommand } from "./commands/GetTraceCommand";
6
6
  import { GetVoiceBotCommand, } from "./commands/GetVoiceBotCommand";
7
7
  import { ListTracesCommand, } from "./commands/ListTracesCommand";
8
8
  import { ListVoiceBotsCommand, } from "./commands/ListVoiceBotsCommand";
9
9
  import { ListVoiceBotsNamesCommand, } from "./commands/ListVoiceBotsNamesCommand";
10
10
  import { SendHangupCommand, } from "./commands/SendHangupCommand";
11
- import { SendPlayCommand, } from "./commands/SendPlayCommand";
12
- import { SendSayCommand, } from "./commands/SendSayCommand";
13
- import { SendStopCommand, } from "./commands/SendStopCommand";
11
+ import { SendPlayCommand } from "./commands/SendPlayCommand";
12
+ import { SendSayCommand } from "./commands/SendSayCommand";
13
+ import { SendStopCommand } from "./commands/SendStopCommand";
14
14
  import { SendTransferCommand, } from "./commands/SendTransferCommand";
15
15
  import { UpdateVoiceBotCommand, } from "./commands/UpdateVoiceBotCommand";
16
- import { createAggregatedClient } from "@smithy/smithy-client";
16
+ import { VoiceBotsClient } from "./VoiceBotsClient";
17
17
  const commands = {
18
18
  CreateVoiceBotCommand,
19
19
  DeleteVoiceBotCommand,
@@ -1,35 +1,43 @@
1
+ import { getHostHeaderPlugin, getLoggerPlugin, getRecursionDetectionPlugin, getUserAgentPlugin, resolveHostHeaderConfig, resolveUserAgentConfig, } from "@aws-sdk/core/client";
2
+ import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
3
+ import { Client as __Client, } from "@smithy/core/client";
4
+ import { resolveEndpointConfig } from "@smithy/core/endpoints";
5
+ import { getContentLengthPlugin } from "@smithy/core/protocols";
6
+ import { getRetryPlugin, resolveRetryConfig, } from "@smithy/core/retry";
7
+ import { getSchemaSerdePlugin } from "@smithy/core/schema";
8
+ import { defaultVoiceBotsHttpAuthSchemeParametersProvider, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider";
9
+ import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters";
1
10
  import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
2
- import { resolveRuntimeExtensions, } from "./runtimeExtensions";
3
- import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
4
- import { getContentLengthPlugin } from "@smithy/middleware-content-length";
5
- import { getRetryPlugin, resolveRetryConfig, } from "@smithy/middleware-retry";
6
- import { Client as __Client, } from "@smithy/smithy-client";
7
- import { authorizationMiddleware } from '@wildix/smithy-utils';
11
+ import { resolveRuntimeExtensions } from "./runtimeExtensions";
8
12
  export { __Client };
9
13
  export class VoiceBotsClient extends __Client {
10
14
  config;
11
15
  constructor(...[configuration]) {
12
- let _config_0 = __getRuntimeConfig(configuration || {});
16
+ const _config_0 = __getRuntimeConfig(configuration || {});
13
17
  super(_config_0);
14
18
  this.initConfig = _config_0;
15
- let _config_1 = resolveUserAgentConfig(_config_0);
16
- let _config_2 = resolveRetryConfig(_config_1);
17
- let _config_3 = resolveRuntimeExtensions(_config_2, configuration?.extensions || []);
18
- const hostname = ['stable', 'stage'].includes(configuration.env || '') ? `wim-${configuration.env}.wildix.com` : 'wim.wildix.com';
19
- const endpoint = () => {
20
- return {
21
- hostname,
22
- protocol: "https",
23
- port: '443',
24
- path: ''
25
- };
26
- };
27
- const config = { ..._config_3, endpoint };
28
- this.config = config;
29
- this.middlewareStack.add(authorizationMiddleware.bind(this, configuration.token), { step: "build" });
19
+ const _config_1 = resolveClientEndpointParameters(_config_0);
20
+ const _config_2 = resolveUserAgentConfig(_config_1);
21
+ const _config_3 = resolveRetryConfig(_config_2);
22
+ const _config_4 = resolveHostHeaderConfig(_config_3);
23
+ const _config_5 = resolveEndpointConfig(_config_4);
24
+ const _config_6 = resolveHttpAuthSchemeConfig(_config_5);
25
+ const _config_7 = resolveRuntimeExtensions(_config_6, configuration?.extensions || []);
26
+ this.config = _config_7;
27
+ this.middlewareStack.use(getSchemaSerdePlugin(this.config));
30
28
  this.middlewareStack.use(getUserAgentPlugin(this.config));
31
29
  this.middlewareStack.use(getRetryPlugin(this.config));
32
30
  this.middlewareStack.use(getContentLengthPlugin(this.config));
31
+ this.middlewareStack.use(getHostHeaderPlugin(this.config));
32
+ this.middlewareStack.use(getLoggerPlugin(this.config));
33
+ this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
34
+ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
35
+ httpAuthSchemeParametersProvider: defaultVoiceBotsHttpAuthSchemeParametersProvider,
36
+ identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
37
+ "smithy.api#httpBearerAuth": config.token,
38
+ }),
39
+ }));
40
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
33
41
  }
34
42
  destroy() {
35
43
  super.destroy();
@@ -0,0 +1,38 @@
1
+ export const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
2
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
3
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
4
+ let _token = runtimeConfig.token;
5
+ return {
6
+ setHttpAuthScheme(httpAuthScheme) {
7
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
8
+ if (index === -1) {
9
+ _httpAuthSchemes.push(httpAuthScheme);
10
+ }
11
+ else {
12
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
13
+ }
14
+ },
15
+ httpAuthSchemes() {
16
+ return _httpAuthSchemes;
17
+ },
18
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
19
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
20
+ },
21
+ httpAuthSchemeProvider() {
22
+ return _httpAuthSchemeProvider;
23
+ },
24
+ setToken(token) {
25
+ _token = token;
26
+ },
27
+ token() {
28
+ return _token;
29
+ },
30
+ };
31
+ };
32
+ export const resolveHttpAuthRuntimeConfig = (config) => {
33
+ return {
34
+ httpAuthSchemes: config.httpAuthSchemes(),
35
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
36
+ token: config.token(),
37
+ };
38
+ };
@@ -0,0 +1,59 @@
1
+ import { doesIdentityRequireRefresh, isIdentityExpired, memoizeIdentityProvider } from "@smithy/core";
2
+ import { getSmithyContext, normalizeProvider } from "@smithy/core/client";
3
+ export const defaultVoiceBotsHttpAuthSchemeParametersProvider = async (config, context, input) => {
4
+ return {
5
+ operation: getSmithyContext(context).operation,
6
+ };
7
+ };
8
+ function createSmithyApiHttpBearerAuthHttpAuthOption(authParameters) {
9
+ return {
10
+ schemeId: "smithy.api#httpBearerAuth",
11
+ };
12
+ }
13
+ function createWildixAuthApiKeysHttpAuthOption(authParameters) {
14
+ return {
15
+ schemeId: "wildix.auth#apiKeys",
16
+ };
17
+ }
18
+ function createWildixAuthPbxHttpAuthOption(authParameters) {
19
+ return {
20
+ schemeId: "wildix.auth#pbx",
21
+ };
22
+ }
23
+ function createWildixAuthS2sHttpAuthOption(authParameters) {
24
+ return {
25
+ schemeId: "wildix.auth#s2s",
26
+ };
27
+ }
28
+ function createWildixAuthXbsHttpAuthOption(authParameters) {
29
+ return {
30
+ schemeId: "wildix.auth#xbs",
31
+ };
32
+ }
33
+ export const defaultVoiceBotsHttpAuthSchemeProvider = (authParameters) => {
34
+ const options = [];
35
+ switch (authParameters.operation) {
36
+ case "ListVoiceBotsNames":
37
+ {
38
+ options.push(createWildixAuthS2sHttpAuthOption(authParameters));
39
+ options.push(createWildixAuthPbxHttpAuthOption(authParameters));
40
+ options.push(createWildixAuthXbsHttpAuthOption(authParameters));
41
+ options.push(createWildixAuthApiKeysHttpAuthOption(authParameters));
42
+ break;
43
+ }
44
+ ;
45
+ default: {
46
+ options.push(createSmithyApiHttpBearerAuthHttpAuthOption(authParameters));
47
+ options.push(createWildixAuthS2sHttpAuthOption(authParameters));
48
+ options.push(createWildixAuthPbxHttpAuthOption(authParameters));
49
+ }
50
+ }
51
+ return options;
52
+ };
53
+ export const resolveHttpAuthSchemeConfig = (config) => {
54
+ const token = memoizeIdentityProvider(config.token, isIdentityExpired, doesIdentityRequireRefresh);
55
+ return Object.assign(config, {
56
+ authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
57
+ token,
58
+ });
59
+ };
@@ -1,17 +1,16 @@
1
- import { de_CreateVoiceBotCommand, se_CreateVoiceBotCommand, } from "../protocols/Aws_restJson1";
2
- import { getSerdePlugin } from "@smithy/middleware-serde";
3
- import { Command as $Command } from "@smithy/smithy-client";
1
+ import { Command as $Command } from "@smithy/core/client";
2
+ import { getEndpointPlugin } from "@smithy/core/endpoints";
3
+ import { commonParams } from "../endpoint/EndpointParameters";
4
+ import { CreateVoiceBot$ } from "../schemas/schemas_0";
4
5
  export { $Command };
5
- export class CreateVoiceBotCommand extends $Command.classBuilder()
6
+ export class CreateVoiceBotCommand extends $Command
7
+ .classBuilder()
8
+ .ep(commonParams)
6
9
  .m(function (Command, cs, config, o) {
7
- return [
8
- getSerdePlugin(config, this.serialize, this.deserialize),
9
- ];
10
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
10
11
  })
11
12
  .s("VoiceBots", "CreateVoiceBot", {})
12
13
  .n("VoiceBotsClient", "CreateVoiceBotCommand")
13
- .f(void 0, void 0)
14
- .ser(se_CreateVoiceBotCommand)
15
- .de(de_CreateVoiceBotCommand)
14
+ .sc(CreateVoiceBot$)
16
15
  .build() {
17
16
  }
@@ -1,17 +1,16 @@
1
- import { de_DeleteVoiceBotCommand, se_DeleteVoiceBotCommand, } from "../protocols/Aws_restJson1";
2
- import { getSerdePlugin } from "@smithy/middleware-serde";
3
- import { Command as $Command } from "@smithy/smithy-client";
1
+ import { Command as $Command } from "@smithy/core/client";
2
+ import { getEndpointPlugin } from "@smithy/core/endpoints";
3
+ import { commonParams } from "../endpoint/EndpointParameters";
4
+ import { DeleteVoiceBot$ } from "../schemas/schemas_0";
4
5
  export { $Command };
5
- export class DeleteVoiceBotCommand extends $Command.classBuilder()
6
+ export class DeleteVoiceBotCommand extends $Command
7
+ .classBuilder()
8
+ .ep(commonParams)
6
9
  .m(function (Command, cs, config, o) {
7
- return [
8
- getSerdePlugin(config, this.serialize, this.deserialize),
9
- ];
10
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
10
11
  })
11
12
  .s("VoiceBots", "DeleteVoiceBot", {})
12
13
  .n("VoiceBotsClient", "DeleteVoiceBotCommand")
13
- .f(void 0, void 0)
14
- .ser(se_DeleteVoiceBotCommand)
15
- .de(de_DeleteVoiceBotCommand)
14
+ .sc(DeleteVoiceBot$)
16
15
  .build() {
17
16
  }
@@ -1,17 +1,16 @@
1
- import { de_DescribeEventCommand, se_DescribeEventCommand, } from "../protocols/Aws_restJson1";
2
- import { getSerdePlugin } from "@smithy/middleware-serde";
3
- import { Command as $Command } from "@smithy/smithy-client";
1
+ import { Command as $Command } from "@smithy/core/client";
2
+ import { getEndpointPlugin } from "@smithy/core/endpoints";
3
+ import { commonParams } from "../endpoint/EndpointParameters";
4
+ import { DescribeEvent$ } from "../schemas/schemas_0";
4
5
  export { $Command };
5
- export class DescribeEventCommand extends $Command.classBuilder()
6
+ export class DescribeEventCommand extends $Command
7
+ .classBuilder()
8
+ .ep(commonParams)
6
9
  .m(function (Command, cs, config, o) {
7
- return [
8
- getSerdePlugin(config, this.serialize, this.deserialize),
9
- ];
10
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
10
11
  })
11
12
  .s("VoiceBots", "DescribeEvent", {})
12
13
  .n("VoiceBotsClient", "DescribeEventCommand")
13
- .f(void 0, void 0)
14
- .ser(se_DescribeEventCommand)
15
- .de(de_DescribeEventCommand)
14
+ .sc(DescribeEvent$)
16
15
  .build() {
17
16
  }
@@ -1,17 +1,16 @@
1
- import { de_GetTraceCommand, se_GetTraceCommand, } from "../protocols/Aws_restJson1";
2
- import { getSerdePlugin } from "@smithy/middleware-serde";
3
- import { Command as $Command } from "@smithy/smithy-client";
1
+ import { Command as $Command } from "@smithy/core/client";
2
+ import { getEndpointPlugin } from "@smithy/core/endpoints";
3
+ import { commonParams } from "../endpoint/EndpointParameters";
4
+ import { GetTrace$ } from "../schemas/schemas_0";
4
5
  export { $Command };
5
- export class GetTraceCommand extends $Command.classBuilder()
6
+ export class GetTraceCommand extends $Command
7
+ .classBuilder()
8
+ .ep(commonParams)
6
9
  .m(function (Command, cs, config, o) {
7
- return [
8
- getSerdePlugin(config, this.serialize, this.deserialize),
9
- ];
10
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
10
11
  })
11
12
  .s("VoiceBots", "GetTrace", {})
12
13
  .n("VoiceBotsClient", "GetTraceCommand")
13
- .f(void 0, void 0)
14
- .ser(se_GetTraceCommand)
15
- .de(de_GetTraceCommand)
14
+ .sc(GetTrace$)
16
15
  .build() {
17
16
  }
@@ -1,17 +1,16 @@
1
- import { de_GetVoiceBotCommand, se_GetVoiceBotCommand, } from "../protocols/Aws_restJson1";
2
- import { getSerdePlugin } from "@smithy/middleware-serde";
3
- import { Command as $Command } from "@smithy/smithy-client";
1
+ import { Command as $Command } from "@smithy/core/client";
2
+ import { getEndpointPlugin } from "@smithy/core/endpoints";
3
+ import { commonParams } from "../endpoint/EndpointParameters";
4
+ import { GetVoiceBot$ } from "../schemas/schemas_0";
4
5
  export { $Command };
5
- export class GetVoiceBotCommand extends $Command.classBuilder()
6
+ export class GetVoiceBotCommand extends $Command
7
+ .classBuilder()
8
+ .ep(commonParams)
6
9
  .m(function (Command, cs, config, o) {
7
- return [
8
- getSerdePlugin(config, this.serialize, this.deserialize),
9
- ];
10
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
10
11
  })
11
12
  .s("VoiceBots", "GetVoiceBot", {})
12
13
  .n("VoiceBotsClient", "GetVoiceBotCommand")
13
- .f(void 0, void 0)
14
- .ser(se_GetVoiceBotCommand)
15
- .de(de_GetVoiceBotCommand)
14
+ .sc(GetVoiceBot$)
16
15
  .build() {
17
16
  }
@@ -1,17 +1,16 @@
1
- import { de_ListTracesCommand, se_ListTracesCommand, } from "../protocols/Aws_restJson1";
2
- import { getSerdePlugin } from "@smithy/middleware-serde";
3
- import { Command as $Command } from "@smithy/smithy-client";
1
+ import { Command as $Command } from "@smithy/core/client";
2
+ import { getEndpointPlugin } from "@smithy/core/endpoints";
3
+ import { commonParams } from "../endpoint/EndpointParameters";
4
+ import { ListTraces$ } from "../schemas/schemas_0";
4
5
  export { $Command };
5
- export class ListTracesCommand extends $Command.classBuilder()
6
+ export class ListTracesCommand extends $Command
7
+ .classBuilder()
8
+ .ep(commonParams)
6
9
  .m(function (Command, cs, config, o) {
7
- return [
8
- getSerdePlugin(config, this.serialize, this.deserialize),
9
- ];
10
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
10
11
  })
11
12
  .s("VoiceBots", "ListTraces", {})
12
13
  .n("VoiceBotsClient", "ListTracesCommand")
13
- .f(void 0, void 0)
14
- .ser(se_ListTracesCommand)
15
- .de(de_ListTracesCommand)
14
+ .sc(ListTraces$)
16
15
  .build() {
17
16
  }
@@ -1,17 +1,16 @@
1
- import { de_ListVoiceBotsCommand, se_ListVoiceBotsCommand, } from "../protocols/Aws_restJson1";
2
- import { getSerdePlugin } from "@smithy/middleware-serde";
3
- import { Command as $Command } from "@smithy/smithy-client";
1
+ import { Command as $Command } from "@smithy/core/client";
2
+ import { getEndpointPlugin } from "@smithy/core/endpoints";
3
+ import { commonParams } from "../endpoint/EndpointParameters";
4
+ import { ListVoiceBots$ } from "../schemas/schemas_0";
4
5
  export { $Command };
5
- export class ListVoiceBotsCommand extends $Command.classBuilder()
6
+ export class ListVoiceBotsCommand extends $Command
7
+ .classBuilder()
8
+ .ep(commonParams)
6
9
  .m(function (Command, cs, config, o) {
7
- return [
8
- getSerdePlugin(config, this.serialize, this.deserialize),
9
- ];
10
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
10
11
  })
11
12
  .s("VoiceBots", "ListVoiceBots", {})
12
13
  .n("VoiceBotsClient", "ListVoiceBotsCommand")
13
- .f(void 0, void 0)
14
- .ser(se_ListVoiceBotsCommand)
15
- .de(de_ListVoiceBotsCommand)
14
+ .sc(ListVoiceBots$)
16
15
  .build() {
17
16
  }
@@ -1,17 +1,16 @@
1
- import { de_ListVoiceBotsNamesCommand, se_ListVoiceBotsNamesCommand, } from "../protocols/Aws_restJson1";
2
- import { getSerdePlugin } from "@smithy/middleware-serde";
3
- import { Command as $Command } from "@smithy/smithy-client";
1
+ import { Command as $Command } from "@smithy/core/client";
2
+ import { getEndpointPlugin } from "@smithy/core/endpoints";
3
+ import { commonParams } from "../endpoint/EndpointParameters";
4
+ import { ListVoiceBotsNames$ } from "../schemas/schemas_0";
4
5
  export { $Command };
5
- export class ListVoiceBotsNamesCommand extends $Command.classBuilder()
6
+ export class ListVoiceBotsNamesCommand extends $Command
7
+ .classBuilder()
8
+ .ep(commonParams)
6
9
  .m(function (Command, cs, config, o) {
7
- return [
8
- getSerdePlugin(config, this.serialize, this.deserialize),
9
- ];
10
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
10
11
  })
11
12
  .s("VoiceBots", "ListVoiceBotsNames", {})
12
13
  .n("VoiceBotsClient", "ListVoiceBotsNamesCommand")
13
- .f(void 0, void 0)
14
- .ser(se_ListVoiceBotsNamesCommand)
15
- .de(de_ListVoiceBotsNamesCommand)
14
+ .sc(ListVoiceBotsNames$)
16
15
  .build() {
17
16
  }
@@ -1,17 +1,16 @@
1
- import { de_SendHangupCommand, se_SendHangupCommand, } from "../protocols/Aws_restJson1";
2
- import { getSerdePlugin } from "@smithy/middleware-serde";
3
- import { Command as $Command } from "@smithy/smithy-client";
1
+ import { Command as $Command } from "@smithy/core/client";
2
+ import { getEndpointPlugin } from "@smithy/core/endpoints";
3
+ import { commonParams } from "../endpoint/EndpointParameters";
4
+ import { SendHangup$ } from "../schemas/schemas_0";
4
5
  export { $Command };
5
- export class SendHangupCommand extends $Command.classBuilder()
6
+ export class SendHangupCommand extends $Command
7
+ .classBuilder()
8
+ .ep(commonParams)
6
9
  .m(function (Command, cs, config, o) {
7
- return [
8
- getSerdePlugin(config, this.serialize, this.deserialize),
9
- ];
10
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
10
11
  })
11
12
  .s("VoiceBots", "SendHangup", {})
12
13
  .n("VoiceBotsClient", "SendHangupCommand")
13
- .f(void 0, void 0)
14
- .ser(se_SendHangupCommand)
15
- .de(de_SendHangupCommand)
14
+ .sc(SendHangup$)
16
15
  .build() {
17
16
  }
@@ -1,17 +1,16 @@
1
- import { de_SendPlayCommand, se_SendPlayCommand, } from "../protocols/Aws_restJson1";
2
- import { getSerdePlugin } from "@smithy/middleware-serde";
3
- import { Command as $Command } from "@smithy/smithy-client";
1
+ import { Command as $Command } from "@smithy/core/client";
2
+ import { getEndpointPlugin } from "@smithy/core/endpoints";
3
+ import { commonParams } from "../endpoint/EndpointParameters";
4
+ import { SendPlay$ } from "../schemas/schemas_0";
4
5
  export { $Command };
5
- export class SendPlayCommand extends $Command.classBuilder()
6
+ export class SendPlayCommand extends $Command
7
+ .classBuilder()
8
+ .ep(commonParams)
6
9
  .m(function (Command, cs, config, o) {
7
- return [
8
- getSerdePlugin(config, this.serialize, this.deserialize),
9
- ];
10
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
10
11
  })
11
12
  .s("VoiceBots", "SendPlay", {})
12
13
  .n("VoiceBotsClient", "SendPlayCommand")
13
- .f(void 0, void 0)
14
- .ser(se_SendPlayCommand)
15
- .de(de_SendPlayCommand)
14
+ .sc(SendPlay$)
16
15
  .build() {
17
16
  }
@@ -1,17 +1,16 @@
1
- import { de_SendSayCommand, se_SendSayCommand, } from "../protocols/Aws_restJson1";
2
- import { getSerdePlugin } from "@smithy/middleware-serde";
3
- import { Command as $Command } from "@smithy/smithy-client";
1
+ import { Command as $Command } from "@smithy/core/client";
2
+ import { getEndpointPlugin } from "@smithy/core/endpoints";
3
+ import { commonParams } from "../endpoint/EndpointParameters";
4
+ import { SendSay$ } from "../schemas/schemas_0";
4
5
  export { $Command };
5
- export class SendSayCommand extends $Command.classBuilder()
6
+ export class SendSayCommand extends $Command
7
+ .classBuilder()
8
+ .ep(commonParams)
6
9
  .m(function (Command, cs, config, o) {
7
- return [
8
- getSerdePlugin(config, this.serialize, this.deserialize),
9
- ];
10
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
10
11
  })
11
12
  .s("VoiceBots", "SendSay", {})
12
13
  .n("VoiceBotsClient", "SendSayCommand")
13
- .f(void 0, void 0)
14
- .ser(se_SendSayCommand)
15
- .de(de_SendSayCommand)
14
+ .sc(SendSay$)
16
15
  .build() {
17
16
  }
@@ -1,17 +1,16 @@
1
- import { de_SendStopCommand, se_SendStopCommand, } from "../protocols/Aws_restJson1";
2
- import { getSerdePlugin } from "@smithy/middleware-serde";
3
- import { Command as $Command } from "@smithy/smithy-client";
1
+ import { Command as $Command } from "@smithy/core/client";
2
+ import { getEndpointPlugin } from "@smithy/core/endpoints";
3
+ import { commonParams } from "../endpoint/EndpointParameters";
4
+ import { SendStop$ } from "../schemas/schemas_0";
4
5
  export { $Command };
5
- export class SendStopCommand extends $Command.classBuilder()
6
+ export class SendStopCommand extends $Command
7
+ .classBuilder()
8
+ .ep(commonParams)
6
9
  .m(function (Command, cs, config, o) {
7
- return [
8
- getSerdePlugin(config, this.serialize, this.deserialize),
9
- ];
10
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
10
11
  })
11
12
  .s("VoiceBots", "SendStop", {})
12
13
  .n("VoiceBotsClient", "SendStopCommand")
13
- .f(void 0, void 0)
14
- .ser(se_SendStopCommand)
15
- .de(de_SendStopCommand)
14
+ .sc(SendStop$)
16
15
  .build() {
17
16
  }
@@ -1,17 +1,16 @@
1
- import { de_SendTransferCommand, se_SendTransferCommand, } from "../protocols/Aws_restJson1";
2
- import { getSerdePlugin } from "@smithy/middleware-serde";
3
- import { Command as $Command } from "@smithy/smithy-client";
1
+ import { Command as $Command } from "@smithy/core/client";
2
+ import { getEndpointPlugin } from "@smithy/core/endpoints";
3
+ import { commonParams } from "../endpoint/EndpointParameters";
4
+ import { SendTransfer$ } from "../schemas/schemas_0";
4
5
  export { $Command };
5
- export class SendTransferCommand extends $Command.classBuilder()
6
+ export class SendTransferCommand extends $Command
7
+ .classBuilder()
8
+ .ep(commonParams)
6
9
  .m(function (Command, cs, config, o) {
7
- return [
8
- getSerdePlugin(config, this.serialize, this.deserialize),
9
- ];
10
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
10
11
  })
11
12
  .s("VoiceBots", "SendTransfer", {})
12
13
  .n("VoiceBotsClient", "SendTransferCommand")
13
- .f(void 0, void 0)
14
- .ser(se_SendTransferCommand)
15
- .de(de_SendTransferCommand)
14
+ .sc(SendTransfer$)
16
15
  .build() {
17
16
  }
@@ -1,17 +1,16 @@
1
- import { de_UpdateVoiceBotCommand, se_UpdateVoiceBotCommand, } from "../protocols/Aws_restJson1";
2
- import { getSerdePlugin } from "@smithy/middleware-serde";
3
- import { Command as $Command } from "@smithy/smithy-client";
1
+ import { Command as $Command } from "@smithy/core/client";
2
+ import { getEndpointPlugin } from "@smithy/core/endpoints";
3
+ import { commonParams } from "../endpoint/EndpointParameters";
4
+ import { UpdateVoiceBot$ } from "../schemas/schemas_0";
4
5
  export { $Command };
5
- export class UpdateVoiceBotCommand extends $Command.classBuilder()
6
+ export class UpdateVoiceBotCommand extends $Command
7
+ .classBuilder()
8
+ .ep(commonParams)
6
9
  .m(function (Command, cs, config, o) {
7
- return [
8
- getSerdePlugin(config, this.serialize, this.deserialize),
9
- ];
10
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
10
11
  })
11
12
  .s("VoiceBots", "UpdateVoiceBot", {})
12
13
  .n("VoiceBotsClient", "UpdateVoiceBotCommand")
13
- .f(void 0, void 0)
14
- .ser(se_UpdateVoiceBotCommand)
15
- .de(de_UpdateVoiceBotCommand)
14
+ .sc(UpdateVoiceBot$)
16
15
  .build() {
17
16
  }
@@ -0,0 +1,12 @@
1
+ const clientContextParamDefaults = {};
2
+ export const resolveClientEndpointParameters = (options) => {
3
+ return Object.assign(options, {
4
+ env: options.env ?? "prod",
5
+ defaultSigningName: "",
6
+ clientContextParams: Object.assign(clientContextParamDefaults, options.clientContextParams),
7
+ });
8
+ };
9
+ export const commonParams = {
10
+ env: { type: "clientContextParams", name: "env" },
11
+ endpoint: { type: "builtInParams", name: "endpoint" },
12
+ };
@@ -0,0 +1,25 @@
1
+ import { BinaryDecisionDiagram } from "@smithy/core/endpoints";
2
+ const a = "stringEquals", b = { "ref": "endpoint" }, c = { "ref": "env" };
3
+ const _data = {
4
+ conditions: [
5
+ ["isSet", [b]],
6
+ [a, [c, "stable"]],
7
+ [a, [c, "stage"]]
8
+ ],
9
+ results: [
10
+ [-1],
11
+ [b, {}],
12
+ ["https://wim-stable.wildix.com", {}],
13
+ ["https://wim-stage.wildix.com", {}],
14
+ ["https://wim.wildix.com", {}]
15
+ ]
16
+ };
17
+ const root = 2;
18
+ const r = 100_000_000;
19
+ const nodes = new Int32Array([
20
+ -1, 1, -1,
21
+ 0, r + 1, 3,
22
+ 1, r + 2, 4,
23
+ 2, r + 3, r + 4,
24
+ ]);
25
+ export const bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
@@ -0,0 +1,12 @@
1
+ import { decideEndpoint, EndpointCache } from "@smithy/core/endpoints";
2
+ import { bdd } from "./bdd";
3
+ const cache = new EndpointCache({
4
+ size: 50,
5
+ params: ["endpoint", "env"],
6
+ });
7
+ export const defaultEndpointResolver = (endpointParams, context = {}) => {
8
+ return cache.get(endpointParams, () => decideEndpoint(bdd, {
9
+ endpointParams: endpointParams,
10
+ logger: context.logger,
11
+ }));
12
+ };