@allthings/sdk 6.2.0-5 → 6.2.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/cli.js +1 -1
- package/dist/lib.cjs.js +6 -9
- package/dist/lib.esm.js +6 -9
- package/dist/lib.umd.min.js +1 -1
- package/dist/src/aws/parameterStore.d.ts +2 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ var require$$4 = require('https');
|
|
|
13
13
|
var require$$5 = require('url');
|
|
14
14
|
var require$$6 = require('fs');
|
|
15
15
|
|
|
16
|
-
const version = "6.2.0-
|
|
16
|
+
const version = "6.2.0-6";
|
|
17
17
|
|
|
18
18
|
const REST_API_URL = 'https://api.allthings.me';
|
|
19
19
|
const OAUTH_URL = 'https://accounts.allthings.me';
|
package/dist/lib.cjs.js
CHANGED
|
@@ -12,7 +12,7 @@ var require$$4 = require('https');
|
|
|
12
12
|
var require$$5 = require('url');
|
|
13
13
|
var require$$6 = require('fs');
|
|
14
14
|
|
|
15
|
-
const version = "6.2.0-
|
|
15
|
+
const version = "6.2.0-6";
|
|
16
16
|
|
|
17
17
|
const REST_API_URL = 'https://api.allthings.me';
|
|
18
18
|
const OAUTH_URL = 'https://accounts.allthings.me';
|
|
@@ -54,7 +54,7 @@ const DEFAULT_CLIENT_CONFIG = {
|
|
|
54
54
|
onlyDefault: false,
|
|
55
55
|
prefix: process.env.SSM_PARAM_PATH,
|
|
56
56
|
};
|
|
57
|
-
const getSecrets = async (ssm, config, params, defaultValue
|
|
57
|
+
const getSecrets = async (ssm, config, params, defaultValue) => {
|
|
58
58
|
var _a, _b;
|
|
59
59
|
if (config.onlyDefault) {
|
|
60
60
|
return [defaultValue];
|
|
@@ -73,14 +73,12 @@ const getSecrets = async (ssm, config, params, defaultValue = '') => {
|
|
|
73
73
|
return [defaultValue];
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
const getSecret = async (ssm, config, param, defaultValue
|
|
76
|
+
const getSecret = async (ssm, config, param, defaultValue) => {
|
|
77
77
|
var _a, _b;
|
|
78
|
-
console.log(config, param, defaultValue);
|
|
78
|
+
console.log(config, param, { defaultValue });
|
|
79
79
|
if (config.onlyDefault) {
|
|
80
|
-
console.log(1);
|
|
81
80
|
return defaultValue;
|
|
82
81
|
}
|
|
83
|
-
console.log(2);
|
|
84
82
|
try {
|
|
85
83
|
const parameter = await ssm.send(new clientSsm.GetParameterCommand({
|
|
86
84
|
Name: config.prefix + param,
|
|
@@ -89,7 +87,6 @@ const getSecret = async (ssm, config, param, defaultValue = '') => {
|
|
|
89
87
|
return (_b = (_a = parameter === null || parameter === void 0 ? void 0 : parameter.Parameter) === null || _a === void 0 ? void 0 : _a.Value) !== null && _b !== void 0 ? _b : defaultValue;
|
|
90
88
|
}
|
|
91
89
|
catch (e) {
|
|
92
|
-
console.log(3);
|
|
93
90
|
if (config.logger) {
|
|
94
91
|
config.logger(e);
|
|
95
92
|
}
|
|
@@ -100,8 +97,8 @@ const parameterStore = (userConfig) => {
|
|
|
100
97
|
const _a = Object.assign(Object.assign({}, DEFAULT_CLIENT_CONFIG), userConfig), { clientConfig } = _a, config = __rest$5(_a, ["clientConfig"]);
|
|
101
98
|
const ssm = new clientSsm.SSMClient(clientConfig);
|
|
102
99
|
return {
|
|
103
|
-
getSecret: (param, defaultValue) => getSecret(ssm, config, param, defaultValue),
|
|
104
|
-
getSecrets: (params, defaultValue) => getSecrets(ssm, config, params, defaultValue),
|
|
100
|
+
getSecret: (param, defaultValue = '') => getSecret(ssm, config, param, defaultValue),
|
|
101
|
+
getSecrets: (params, defaultValue = '') => getSecrets(ssm, config, params, defaultValue),
|
|
105
102
|
};
|
|
106
103
|
};
|
|
107
104
|
|
package/dist/lib.esm.js
CHANGED
|
@@ -10,7 +10,7 @@ import require$$4 from 'https';
|
|
|
10
10
|
import require$$5 from 'url';
|
|
11
11
|
import require$$6 from 'fs';
|
|
12
12
|
|
|
13
|
-
const version = "6.2.0-
|
|
13
|
+
const version = "6.2.0-6";
|
|
14
14
|
|
|
15
15
|
const REST_API_URL = 'https://api.allthings.me';
|
|
16
16
|
const OAUTH_URL = 'https://accounts.allthings.me';
|
|
@@ -52,7 +52,7 @@ const DEFAULT_CLIENT_CONFIG = {
|
|
|
52
52
|
onlyDefault: false,
|
|
53
53
|
prefix: process.env.SSM_PARAM_PATH,
|
|
54
54
|
};
|
|
55
|
-
const getSecrets = async (ssm, config, params, defaultValue
|
|
55
|
+
const getSecrets = async (ssm, config, params, defaultValue) => {
|
|
56
56
|
var _a, _b;
|
|
57
57
|
if (config.onlyDefault) {
|
|
58
58
|
return [defaultValue];
|
|
@@ -71,14 +71,12 @@ const getSecrets = async (ssm, config, params, defaultValue = '') => {
|
|
|
71
71
|
return [defaultValue];
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
|
-
const getSecret = async (ssm, config, param, defaultValue
|
|
74
|
+
const getSecret = async (ssm, config, param, defaultValue) => {
|
|
75
75
|
var _a, _b;
|
|
76
|
-
console.log(config, param, defaultValue);
|
|
76
|
+
console.log(config, param, { defaultValue });
|
|
77
77
|
if (config.onlyDefault) {
|
|
78
|
-
console.log(1);
|
|
79
78
|
return defaultValue;
|
|
80
79
|
}
|
|
81
|
-
console.log(2);
|
|
82
80
|
try {
|
|
83
81
|
const parameter = await ssm.send(new GetParameterCommand({
|
|
84
82
|
Name: config.prefix + param,
|
|
@@ -87,7 +85,6 @@ const getSecret = async (ssm, config, param, defaultValue = '') => {
|
|
|
87
85
|
return (_b = (_a = parameter === null || parameter === void 0 ? void 0 : parameter.Parameter) === null || _a === void 0 ? void 0 : _a.Value) !== null && _b !== void 0 ? _b : defaultValue;
|
|
88
86
|
}
|
|
89
87
|
catch (e) {
|
|
90
|
-
console.log(3);
|
|
91
88
|
if (config.logger) {
|
|
92
89
|
config.logger(e);
|
|
93
90
|
}
|
|
@@ -98,8 +95,8 @@ const parameterStore = (userConfig) => {
|
|
|
98
95
|
const _a = Object.assign(Object.assign({}, DEFAULT_CLIENT_CONFIG), userConfig), { clientConfig } = _a, config = __rest$5(_a, ["clientConfig"]);
|
|
99
96
|
const ssm = new SSMClient(clientConfig);
|
|
100
97
|
return {
|
|
101
|
-
getSecret: (param, defaultValue) => getSecret(ssm, config, param, defaultValue),
|
|
102
|
-
getSecrets: (params, defaultValue) => getSecrets(ssm, config, params, defaultValue),
|
|
98
|
+
getSecret: (param, defaultValue = '') => getSecret(ssm, config, param, defaultValue),
|
|
99
|
+
getSecrets: (params, defaultValue = '') => getSecrets(ssm, config, params, defaultValue),
|
|
103
100
|
};
|
|
104
101
|
};
|
|
105
102
|
|