@wildix/xbees-kite-client 1.0.8 → 1.0.9
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/KiteClient.js
CHANGED
|
@@ -15,7 +15,7 @@ class KiteClient extends smithy_client_1.Client {
|
|
|
15
15
|
let _config_1 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_0);
|
|
16
16
|
let _config_2 = (0, middleware_retry_1.resolveRetryConfig)(_config_1);
|
|
17
17
|
let _config_3 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_2, configuration?.extensions || []);
|
|
18
|
-
const hostname = ['stable', 'stage'].includes(configuration
|
|
18
|
+
const hostname = ['stable', 'stage'].includes(configuration?.env || '') ? `api-${configuration?.env}.x-bees.com` : 'api.x-bees.com';
|
|
19
19
|
const endpoint = () => {
|
|
20
20
|
return {
|
|
21
21
|
hostname,
|
|
@@ -30,7 +30,9 @@ class KiteClient extends smithy_client_1.Client {
|
|
|
30
30
|
};
|
|
31
31
|
super(config);
|
|
32
32
|
this.config = config;
|
|
33
|
-
|
|
33
|
+
if (configuration?.token) {
|
|
34
|
+
this.middlewareStack.add(smithy_utils_1.authorizationMiddleware.bind(this, configuration.token), { step: "build" });
|
|
35
|
+
}
|
|
34
36
|
this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));
|
|
35
37
|
this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));
|
|
36
38
|
this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));
|
package/dist-es/KiteClient.js
CHANGED
|
@@ -12,7 +12,7 @@ export class KiteClient extends __Client {
|
|
|
12
12
|
let _config_1 = resolveUserAgentConfig(_config_0);
|
|
13
13
|
let _config_2 = resolveRetryConfig(_config_1);
|
|
14
14
|
let _config_3 = resolveRuntimeExtensions(_config_2, configuration?.extensions || []);
|
|
15
|
-
const hostname = ['stable', 'stage'].includes(configuration
|
|
15
|
+
const hostname = ['stable', 'stage'].includes(configuration?.env || '') ? `api-${configuration?.env}.x-bees.com` : 'api.x-bees.com';
|
|
16
16
|
const endpoint = () => {
|
|
17
17
|
return {
|
|
18
18
|
hostname,
|
|
@@ -27,7 +27,9 @@ export class KiteClient extends __Client {
|
|
|
27
27
|
};
|
|
28
28
|
super(config);
|
|
29
29
|
this.config = config;
|
|
30
|
-
|
|
30
|
+
if (configuration?.token) {
|
|
31
|
+
this.middlewareStack.add(authorizationMiddleware.bind(this, configuration.token), { step: "build" });
|
|
32
|
+
}
|
|
31
33
|
this.middlewareStack.use(getUserAgentPlugin(this.config));
|
|
32
34
|
this.middlewareStack.use(getRetryPlugin(this.config));
|
|
33
35
|
this.middlewareStack.use(getContentLengthPlugin(this.config));
|
|
@@ -120,8 +120,8 @@ export type KiteClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOp
|
|
|
120
120
|
* The configuration interface of KiteClient class constructor that set the region, credentials and other options.
|
|
121
121
|
*/
|
|
122
122
|
export interface KiteClientConfig extends KiteClientConfigType {
|
|
123
|
-
env
|
|
124
|
-
token
|
|
123
|
+
env?: 'stage' | 'stable' | 'prod';
|
|
124
|
+
token?: TokenProvider;
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
127
|
* @public
|
|
@@ -13,8 +13,8 @@ export declare const getRuntimeConfig: (config: KiteClientConfig) => {
|
|
|
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
|
|
17
|
-
token
|
|
16
|
+
env?: "stage" | "stable" | "prod" | undefined;
|
|
17
|
+
token?: import("@wildix/smithy-utils").TokenProvider | undefined;
|
|
18
18
|
apiVersion: string;
|
|
19
19
|
cacheMiddleware?: boolean | undefined;
|
|
20
20
|
urlParser: import("@smithy/types").UrlParser;
|
|
@@ -13,8 +13,8 @@ export declare const getRuntimeConfig: (config: KiteClientConfig) => {
|
|
|
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
|
|
17
|
-
token
|
|
16
|
+
env?: "stage" | "stable" | "prod" | undefined;
|
|
17
|
+
token?: import("@wildix/smithy-utils").TokenProvider | undefined;
|
|
18
18
|
apiVersion: string;
|
|
19
19
|
cacheMiddleware?: boolean | undefined;
|
|
20
20
|
urlParser: import("@smithy/types").UrlParser;
|
|
@@ -5,8 +5,8 @@ import { KiteClientConfig } from "./KiteClient";
|
|
|
5
5
|
export declare const getRuntimeConfig: (config: KiteClientConfig) => {
|
|
6
6
|
runtime: string;
|
|
7
7
|
sha256: import("@smithy/types").HashConstructor;
|
|
8
|
-
env
|
|
9
|
-
token
|
|
8
|
+
env?: "stage" | "stable" | "prod" | undefined;
|
|
9
|
+
token?: import("@wildix/smithy-utils").TokenProvider | undefined;
|
|
10
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;
|
|
11
11
|
apiVersion: string;
|
|
12
12
|
cacheMiddleware?: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/xbees-kite-client",
|
|
3
3
|
"description": "@wildix/xbees-kite-client client",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.9",
|
|
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",
|