@wildix/wim-tools-client 0.0.5 → 0.0.6
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/ToolsClient.js
CHANGED
|
@@ -3,15 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ToolsClient = exports.__Client = void 0;
|
|
4
4
|
const runtimeConfig_1 = require("./runtimeConfig");
|
|
5
5
|
const runtimeExtensions_1 = require("./runtimeExtensions");
|
|
6
|
-
const middleware_host_header_1 = require("@aws-sdk/middleware-host-header");
|
|
7
6
|
const middleware_logger_1 = require("@aws-sdk/middleware-logger");
|
|
8
7
|
const middleware_recursion_detection_1 = require("@aws-sdk/middleware-recursion-detection");
|
|
9
8
|
const middleware_user_agent_1 = require("@aws-sdk/middleware-user-agent");
|
|
10
|
-
const config_resolver_1 = require("@smithy/config-resolver");
|
|
11
9
|
const middleware_content_length_1 = require("@smithy/middleware-content-length");
|
|
12
10
|
const middleware_retry_1 = require("@smithy/middleware-retry");
|
|
13
11
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
14
12
|
Object.defineProperty(exports, "__Client", { enumerable: true, get: function () { return smithy_client_1.Client; } });
|
|
13
|
+
const smithy_utils_1 = require("@wildix/smithy-utils");
|
|
15
14
|
class ToolsClient extends smithy_client_1.Client {
|
|
16
15
|
config;
|
|
17
16
|
constructor(...[configuration]) {
|
|
@@ -19,16 +18,23 @@ class ToolsClient extends smithy_client_1.Client {
|
|
|
19
18
|
super(_config_0);
|
|
20
19
|
this.initConfig = _config_0;
|
|
21
20
|
let _config_1 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_0);
|
|
22
|
-
let _config_2 = (0,
|
|
23
|
-
let _config_3 = (0,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
let _config_2 = (0, middleware_retry_1.resolveRetryConfig)(_config_1);
|
|
22
|
+
let _config_3 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_2, configuration?.extensions || []);
|
|
23
|
+
const hostname = ['stable', 'stage'].includes(configuration.env || '') ? `tools.wim-${configuration.env}.wildix.com` : 'tools.wim.wildix.com';
|
|
24
|
+
const endpoint = () => {
|
|
25
|
+
return {
|
|
26
|
+
hostname,
|
|
27
|
+
protocol: "https",
|
|
28
|
+
port: '443',
|
|
29
|
+
path: '/'
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
_config_3.endpoint = endpoint;
|
|
33
|
+
this.config = _config_3;
|
|
34
|
+
this.middlewareStack.add(smithy_utils_1.authorizationMiddleware.bind(this, configuration.token), { step: "build" });
|
|
28
35
|
this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));
|
|
29
36
|
this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));
|
|
30
37
|
this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));
|
|
31
|
-
this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config));
|
|
32
38
|
this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config));
|
|
33
39
|
this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config));
|
|
34
40
|
}
|
package/dist-es/ToolsClient.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
|
|
2
2
|
import { resolveRuntimeExtensions, } from "./runtimeExtensions";
|
|
3
|
-
import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
|
|
4
3
|
import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
|
|
5
4
|
import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
|
|
6
5
|
import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
|
|
7
|
-
import { resolveCustomEndpointsConfig, resolveRegionConfig, } from "@smithy/config-resolver";
|
|
8
6
|
import { getContentLengthPlugin } from "@smithy/middleware-content-length";
|
|
9
7
|
import { getRetryPlugin, resolveRetryConfig, } from "@smithy/middleware-retry";
|
|
10
8
|
import { Client as __Client, } from "@smithy/smithy-client";
|
|
9
|
+
import { authorizationMiddleware } from '@wildix/smithy-utils';
|
|
11
10
|
export { __Client };
|
|
12
11
|
export class ToolsClient extends __Client {
|
|
13
12
|
config;
|
|
@@ -16,16 +15,23 @@ export class ToolsClient extends __Client {
|
|
|
16
15
|
super(_config_0);
|
|
17
16
|
this.initConfig = _config_0;
|
|
18
17
|
let _config_1 = resolveUserAgentConfig(_config_0);
|
|
19
|
-
let _config_2 =
|
|
20
|
-
let _config_3 =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
let _config_2 = resolveRetryConfig(_config_1);
|
|
19
|
+
let _config_3 = resolveRuntimeExtensions(_config_2, configuration?.extensions || []);
|
|
20
|
+
const hostname = ['stable', 'stage'].includes(configuration.env || '') ? `tools.wim-${configuration.env}.wildix.com` : 'tools.wim.wildix.com';
|
|
21
|
+
const endpoint = () => {
|
|
22
|
+
return {
|
|
23
|
+
hostname,
|
|
24
|
+
protocol: "https",
|
|
25
|
+
port: '443',
|
|
26
|
+
path: '/'
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
_config_3.endpoint = endpoint;
|
|
30
|
+
this.config = _config_3;
|
|
31
|
+
this.middlewareStack.add(authorizationMiddleware.bind(this, configuration.token), { step: "build" });
|
|
25
32
|
this.middlewareStack.use(getUserAgentPlugin(this.config));
|
|
26
33
|
this.middlewareStack.use(getRetryPlugin(this.config));
|
|
27
34
|
this.middlewareStack.use(getContentLengthPlugin(this.config));
|
|
28
|
-
this.middlewareStack.use(getHostHeaderPlugin(this.config));
|
|
29
35
|
this.middlewareStack.use(getLoggerPlugin(this.config));
|
|
30
36
|
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
|
|
31
37
|
}
|
|
@@ -6,13 +6,12 @@ import { ListToolsCommandInput, ListToolsCommandOutput } from "./commands/ListTo
|
|
|
6
6
|
import { TestEndpointCommandInput, TestEndpointCommandOutput } from "./commands/TestEndpointCommand";
|
|
7
7
|
import { UpdateToolCommandInput, UpdateToolCommandOutput } from "./commands/UpdateToolCommand";
|
|
8
8
|
import { RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions";
|
|
9
|
-
import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header";
|
|
10
9
|
import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent";
|
|
11
|
-
import { CustomEndpointsInputConfig, CustomEndpointsResolvedConfig, RegionInputConfig, RegionResolvedConfig } from "@smithy/config-resolver";
|
|
12
10
|
import { RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry";
|
|
13
11
|
import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http";
|
|
14
12
|
import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@smithy/smithy-client";
|
|
15
13
|
import { Provider, BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
|
|
14
|
+
import { TokenProvider } from '@wildix/smithy-utils';
|
|
16
15
|
export { __Client };
|
|
17
16
|
/**
|
|
18
17
|
* @public
|
|
@@ -112,18 +111,20 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
|
|
|
112
111
|
/**
|
|
113
112
|
* @public
|
|
114
113
|
*/
|
|
115
|
-
export type ToolsClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & UserAgentInputConfig &
|
|
114
|
+
export type ToolsClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & UserAgentInputConfig & RetryInputConfig;
|
|
116
115
|
/**
|
|
117
116
|
* @public
|
|
118
117
|
*
|
|
119
118
|
* The configuration interface of ToolsClient class constructor that set the region, credentials and other options.
|
|
120
119
|
*/
|
|
121
120
|
export interface ToolsClientConfig extends ToolsClientConfigType {
|
|
121
|
+
env?: 'stage' | 'stable' | 'prod';
|
|
122
|
+
token: TokenProvider;
|
|
122
123
|
}
|
|
123
124
|
/**
|
|
124
125
|
* @public
|
|
125
126
|
*/
|
|
126
|
-
export type ToolsClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & UserAgentResolvedConfig &
|
|
127
|
+
export type ToolsClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & UserAgentResolvedConfig & RetryResolvedConfig;
|
|
127
128
|
/**
|
|
128
129
|
* @public
|
|
129
130
|
*
|
|
@@ -13,6 +13,8 @@ export declare const getRuntimeConfig: (config: ToolsClientConfig) => {
|
|
|
13
13
|
retryMode: string | import("@smithy/types").Provider<string>;
|
|
14
14
|
sha256: import("@smithy/types").HashConstructor;
|
|
15
15
|
streamCollector: import("@smithy/types").StreamCollector;
|
|
16
|
+
env?: "stage" | "stable" | "prod" | undefined;
|
|
17
|
+
token: import("@wildix/smithy-utils").TokenProvider;
|
|
16
18
|
apiVersion: string;
|
|
17
19
|
cacheMiddleware?: boolean | undefined;
|
|
18
20
|
urlParser: import("@smithy/types").UrlParser;
|
|
@@ -25,10 +27,5 @@ export declare const getRuntimeConfig: (config: ToolsClientConfig) => {
|
|
|
25
27
|
extensions: import("./runtimeExtensions").RuntimeExtension[];
|
|
26
28
|
customUserAgent?: string | import("@smithy/types").UserAgent | undefined;
|
|
27
29
|
userAgentAppId?: string | import("@smithy/types").Provider<string | undefined> | undefined;
|
|
28
|
-
endpoint: string | import("@smithy/types").Endpoint | import("@smithy/types").Provider<import("@smithy/types").Endpoint>;
|
|
29
|
-
tls?: boolean | undefined;
|
|
30
|
-
useDualstackEndpoint?: boolean | import("@smithy/types").Provider<boolean> | undefined;
|
|
31
30
|
retryStrategy?: import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2 | undefined;
|
|
32
|
-
region?: string | import("@smithy/types").Provider<string> | undefined;
|
|
33
|
-
useFipsEndpoint?: boolean | import("@smithy/types").Provider<boolean> | undefined;
|
|
34
31
|
};
|
|
@@ -14,6 +14,8 @@ export declare const getRuntimeConfig: (config: ToolsClientConfig) => {
|
|
|
14
14
|
sha256: import("@smithy/types").HashConstructor;
|
|
15
15
|
streamCollector: import("@smithy/types").StreamCollector;
|
|
16
16
|
userAgentAppId: string | import("@smithy/types").Provider<string | undefined>;
|
|
17
|
+
env?: "stage" | "stable" | "prod" | undefined;
|
|
18
|
+
token: import("@wildix/smithy-utils").TokenProvider;
|
|
17
19
|
apiVersion: string;
|
|
18
20
|
cacheMiddleware?: boolean | undefined;
|
|
19
21
|
urlParser: import("@smithy/types").UrlParser;
|
|
@@ -25,10 +27,5 @@ export declare const getRuntimeConfig: (config: ToolsClientConfig) => {
|
|
|
25
27
|
logger: import("@smithy/types").Logger;
|
|
26
28
|
extensions: import("./runtimeExtensions").RuntimeExtension[];
|
|
27
29
|
customUserAgent?: string | import("@smithy/types").UserAgent | undefined;
|
|
28
|
-
endpoint: string | import("@smithy/types").Endpoint | import("@smithy/types").Provider<import("@smithy/types").Endpoint>;
|
|
29
|
-
tls?: boolean | undefined;
|
|
30
|
-
useDualstackEndpoint?: boolean | import("@smithy/types").Provider<boolean> | undefined;
|
|
31
30
|
retryStrategy?: import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2 | undefined;
|
|
32
|
-
region?: string | import("@smithy/types").Provider<string> | undefined;
|
|
33
|
-
useFipsEndpoint?: boolean | import("@smithy/types").Provider<boolean> | undefined;
|
|
34
31
|
};
|
|
@@ -5,6 +5,8 @@ import { ToolsClientConfig } from "./ToolsClient";
|
|
|
5
5
|
export declare const getRuntimeConfig: (config: ToolsClientConfig) => {
|
|
6
6
|
runtime: string;
|
|
7
7
|
sha256: import("@smithy/types").HashConstructor;
|
|
8
|
+
env?: "stage" | "stable" | "prod" | undefined;
|
|
9
|
+
token: import("@wildix/smithy-utils").TokenProvider;
|
|
8
10
|
requestHandler: import("@smithy/types").NodeHttpHandlerOptions | import("@smithy/types").FetchHttpHandlerOptions | Record<string, unknown> | import("@smithy/protocol-http").HttpHandler<any> | import("@smithy/fetch-http-handler").FetchHttpHandler;
|
|
9
11
|
apiVersion: string;
|
|
10
12
|
cacheMiddleware?: boolean | undefined;
|
|
@@ -24,10 +26,5 @@ export declare const getRuntimeConfig: (config: ToolsClientConfig) => {
|
|
|
24
26
|
defaultsMode: import("@smithy/smithy-client").DefaultsMode | import("@smithy/types").Provider<import("@smithy/smithy-client").DefaultsMode>;
|
|
25
27
|
customUserAgent?: string | import("@smithy/types").UserAgent | undefined;
|
|
26
28
|
userAgentAppId?: string | import("@smithy/types").Provider<string | undefined> | undefined;
|
|
27
|
-
endpoint: string | import("@smithy/types").Endpoint | import("@smithy/types").Provider<import("@smithy/types").Endpoint>;
|
|
28
|
-
tls?: boolean | undefined;
|
|
29
|
-
useDualstackEndpoint?: boolean | import("@smithy/types").Provider<boolean> | undefined;
|
|
30
29
|
retryStrategy?: import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2 | undefined;
|
|
31
|
-
region?: string | import("@smithy/types").Provider<string> | undefined;
|
|
32
|
-
useFipsEndpoint?: boolean | import("@smithy/types").Provider<boolean> | undefined;
|
|
33
30
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/wim-tools-client",
|
|
3
3
|
"description": "@wildix/wim-tools-client client",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.6",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
7
7
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
"@smithy/util-defaults-mode-browser": "^4.0.8",
|
|
50
50
|
"@smithy/util-defaults-mode-node": "^4.0.8",
|
|
51
51
|
"@smithy/util-retry": "^4.0.2",
|
|
52
|
-
"@smithy/util-utf8": "^4.0.0"
|
|
52
|
+
"@smithy/util-utf8": "^4.0.0",
|
|
53
|
+
"@wildix/smithy-utils": "^1.0.3"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
56
|
"@tsconfig/node18": "18.2.4",
|