@allthings/sdk 6.2.0-3 → 6.2.0-5

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 CHANGED
@@ -13,6 +13,32 @@ 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-5";
17
+
18
+ const REST_API_URL = 'https://api.allthings.me';
19
+ const OAUTH_URL = 'https://accounts.allthings.me';
20
+ const QUEUE_CONCURRENCY = undefined;
21
+ const QUEUE_DELAY = 0;
22
+ const QUEUE_RESERVOIR = 30;
23
+ const QUEUE_RESERVOIR_REFILL_INTERVAL = 166;
24
+ const REQUEST_BACK_OFF_INTERVAL = 200;
25
+ const REQUEST_MAX_RETRIES = 50;
26
+ const DEFAULT_API_WRAPPER_OPTIONS = {
27
+ apiUrl: process.env.ALLTHINGS_REST_API_URL || REST_API_URL,
28
+ clientId: process.env.ALLTHINGS_OAUTH_CLIENT_ID,
29
+ clientSecret: process.env.ALLTHINGS_OAUTH_CLIENT_SECRET,
30
+ oauthUrl: process.env.ALLTHINGS_OAUTH_URL || OAUTH_URL,
31
+ password: process.env.ALLTHINGS_OAUTH_PASSWORD,
32
+ requestBackOffInterval: REQUEST_BACK_OFF_INTERVAL,
33
+ requestMaxRetries: REQUEST_MAX_RETRIES,
34
+ scope: 'user:profile',
35
+ username: process.env.ALLTHINGS_OAUTH_USERNAME,
36
+ };
37
+ const USER_AGENT = `Allthings Node SDK REST Client/${version}`;
38
+ const DEFAULT_AWS_CONFIGURATION = {
39
+ region: 'eu-central-2',
40
+ };
41
+
16
42
  (undefined && undefined.__rest) || function (s, e) {
17
43
  var t = {};
18
44
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -30,10 +56,6 @@ var require$$6 = require('fs');
30
56
  prefix: process.env.SSM_PARAM_PATH,
31
57
  });
32
58
 
33
- const DEFAULT_AWS_CONFIGURATION = {
34
- region: 'eu-central-2',
35
- };
36
-
37
59
  function createTokenStore(initialToken) {
38
60
  const token = new Map(Object.entries(initialToken || {}));
39
61
  return {
@@ -43,29 +65,6 @@ function createTokenStore(initialToken) {
43
65
  };
44
66
  }
45
67
 
46
- const version = "6.2.0-3";
47
-
48
- const REST_API_URL = 'https://api.allthings.me';
49
- const OAUTH_URL = 'https://accounts.allthings.me';
50
- const QUEUE_CONCURRENCY = undefined;
51
- const QUEUE_DELAY = 0;
52
- const QUEUE_RESERVOIR = 30;
53
- const QUEUE_RESERVOIR_REFILL_INTERVAL = 166;
54
- const REQUEST_BACK_OFF_INTERVAL = 200;
55
- const REQUEST_MAX_RETRIES = 50;
56
- const DEFAULT_API_WRAPPER_OPTIONS = {
57
- apiUrl: process.env.ALLTHINGS_REST_API_URL || REST_API_URL,
58
- clientId: process.env.ALLTHINGS_OAUTH_CLIENT_ID,
59
- clientSecret: process.env.ALLTHINGS_OAUTH_CLIENT_SECRET,
60
- oauthUrl: process.env.ALLTHINGS_OAUTH_URL || OAUTH_URL,
61
- password: process.env.ALLTHINGS_OAUTH_PASSWORD,
62
- requestBackOffInterval: REQUEST_BACK_OFF_INTERVAL,
63
- requestMaxRetries: REQUEST_MAX_RETRIES,
64
- scope: 'user:profile',
65
- username: process.env.ALLTHINGS_OAUTH_USERNAME,
66
- };
67
- const USER_AGENT = `Allthings Node SDK REST Client/${version}`;
68
-
69
68
  const RESPONSE_TYPE$1 = 'code';
70
69
  const GRANT_TYPE$3 = 'authorization_code';
71
70
  const castToAuthorizationRequestParams$1 = (params) => {
package/dist/lib.cjs.js CHANGED
@@ -12,6 +12,32 @@ 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-5";
16
+
17
+ const REST_API_URL = 'https://api.allthings.me';
18
+ const OAUTH_URL = 'https://accounts.allthings.me';
19
+ const QUEUE_CONCURRENCY = undefined;
20
+ const QUEUE_DELAY = 0;
21
+ const QUEUE_RESERVOIR = 30;
22
+ const QUEUE_RESERVOIR_REFILL_INTERVAL = 166;
23
+ const REQUEST_BACK_OFF_INTERVAL = 200;
24
+ const REQUEST_MAX_RETRIES = 50;
25
+ const DEFAULT_API_WRAPPER_OPTIONS = {
26
+ apiUrl: process.env.ALLTHINGS_REST_API_URL || REST_API_URL,
27
+ clientId: process.env.ALLTHINGS_OAUTH_CLIENT_ID,
28
+ clientSecret: process.env.ALLTHINGS_OAUTH_CLIENT_SECRET,
29
+ oauthUrl: process.env.ALLTHINGS_OAUTH_URL || OAUTH_URL,
30
+ password: process.env.ALLTHINGS_OAUTH_PASSWORD,
31
+ requestBackOffInterval: REQUEST_BACK_OFF_INTERVAL,
32
+ requestMaxRetries: REQUEST_MAX_RETRIES,
33
+ scope: 'user:profile',
34
+ username: process.env.ALLTHINGS_OAUTH_USERNAME,
35
+ };
36
+ const USER_AGENT = `Allthings Node SDK REST Client/${version}`;
37
+ const DEFAULT_AWS_CONFIGURATION = {
38
+ region: 'eu-central-2',
39
+ };
40
+
15
41
  var __rest$5 = (undefined && undefined.__rest) || function (s, e) {
16
42
  var t = {};
17
43
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -49,9 +75,12 @@ const getSecrets = async (ssm, config, params, defaultValue = '') => {
49
75
  };
50
76
  const getSecret = async (ssm, config, param, defaultValue = '') => {
51
77
  var _a, _b;
78
+ console.log(config, param, defaultValue);
52
79
  if (config.onlyDefault) {
80
+ console.log(1);
53
81
  return defaultValue;
54
82
  }
83
+ console.log(2);
55
84
  try {
56
85
  const parameter = await ssm.send(new clientSsm.GetParameterCommand({
57
86
  Name: config.prefix + param,
@@ -60,6 +89,7 @@ const getSecret = async (ssm, config, param, defaultValue = '') => {
60
89
  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;
61
90
  }
62
91
  catch (e) {
92
+ console.log(3);
63
93
  if (config.logger) {
64
94
  config.logger(e);
65
95
  }
@@ -75,11 +105,6 @@ const parameterStore = (userConfig) => {
75
105
  };
76
106
  };
77
107
 
78
- const DEFAULT_AWS_CONFIGURATION = {
79
- region: 'eu-central-2',
80
- };
81
- var index = { parameterStore };
82
-
83
108
  function createTokenStore(initialToken) {
84
109
  const token = new Map(Object.entries(initialToken || {}));
85
110
  return {
@@ -89,29 +114,6 @@ function createTokenStore(initialToken) {
89
114
  };
90
115
  }
91
116
 
92
- const version = "6.2.0-3";
93
-
94
- const REST_API_URL = 'https://api.allthings.me';
95
- const OAUTH_URL = 'https://accounts.allthings.me';
96
- const QUEUE_CONCURRENCY = undefined;
97
- const QUEUE_DELAY = 0;
98
- const QUEUE_RESERVOIR = 30;
99
- const QUEUE_RESERVOIR_REFILL_INTERVAL = 166;
100
- const REQUEST_BACK_OFF_INTERVAL = 200;
101
- const REQUEST_MAX_RETRIES = 50;
102
- const DEFAULT_API_WRAPPER_OPTIONS = {
103
- apiUrl: process.env.ALLTHINGS_REST_API_URL || REST_API_URL,
104
- clientId: process.env.ALLTHINGS_OAUTH_CLIENT_ID,
105
- clientSecret: process.env.ALLTHINGS_OAUTH_CLIENT_SECRET,
106
- oauthUrl: process.env.ALLTHINGS_OAUTH_URL || OAUTH_URL,
107
- password: process.env.ALLTHINGS_OAUTH_PASSWORD,
108
- requestBackOffInterval: REQUEST_BACK_OFF_INTERVAL,
109
- requestMaxRetries: REQUEST_MAX_RETRIES,
110
- scope: 'user:profile',
111
- username: process.env.ALLTHINGS_OAUTH_USERNAME,
112
- };
113
- const USER_AGENT = `Allthings Node SDK REST Client/${version}`;
114
-
115
117
  const RESPONSE_TYPE$1 = 'code';
116
118
  const GRANT_TYPE$3 = 'authorization_code';
117
119
  const castToAuthorizationRequestParams$1 = (params) => {
@@ -12416,9 +12418,7 @@ exports.EnumLookupUserType = void 0;
12416
12418
  EnumLookupUserType["tenant"] = "tenant";
12417
12419
  })(exports.EnumLookupUserType || (exports.EnumLookupUserType = {}));
12418
12420
 
12419
- exports.DEFAULT_AWS_CONFIGURATION = DEFAULT_AWS_CONFIGURATION;
12420
12421
  exports.DEFAULT_PARAMETER_STORE_CLIENT_CONFIG = DEFAULT_CLIENT_CONFIG;
12421
- exports.awsClients = index;
12422
12422
  exports.createTokenStore = createTokenStore;
12423
12423
  exports.parameterStore = parameterStore;
12424
12424
  exports.restClient = restClient;
package/dist/lib.esm.js CHANGED
@@ -10,6 +10,32 @@ 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-5";
14
+
15
+ const REST_API_URL = 'https://api.allthings.me';
16
+ const OAUTH_URL = 'https://accounts.allthings.me';
17
+ const QUEUE_CONCURRENCY = undefined;
18
+ const QUEUE_DELAY = 0;
19
+ const QUEUE_RESERVOIR = 30;
20
+ const QUEUE_RESERVOIR_REFILL_INTERVAL = 166;
21
+ const REQUEST_BACK_OFF_INTERVAL = 200;
22
+ const REQUEST_MAX_RETRIES = 50;
23
+ const DEFAULT_API_WRAPPER_OPTIONS = {
24
+ apiUrl: process.env.ALLTHINGS_REST_API_URL || REST_API_URL,
25
+ clientId: process.env.ALLTHINGS_OAUTH_CLIENT_ID,
26
+ clientSecret: process.env.ALLTHINGS_OAUTH_CLIENT_SECRET,
27
+ oauthUrl: process.env.ALLTHINGS_OAUTH_URL || OAUTH_URL,
28
+ password: process.env.ALLTHINGS_OAUTH_PASSWORD,
29
+ requestBackOffInterval: REQUEST_BACK_OFF_INTERVAL,
30
+ requestMaxRetries: REQUEST_MAX_RETRIES,
31
+ scope: 'user:profile',
32
+ username: process.env.ALLTHINGS_OAUTH_USERNAME,
33
+ };
34
+ const USER_AGENT = `Allthings Node SDK REST Client/${version}`;
35
+ const DEFAULT_AWS_CONFIGURATION = {
36
+ region: 'eu-central-2',
37
+ };
38
+
13
39
  var __rest$5 = (undefined && undefined.__rest) || function (s, e) {
14
40
  var t = {};
15
41
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -47,9 +73,12 @@ const getSecrets = async (ssm, config, params, defaultValue = '') => {
47
73
  };
48
74
  const getSecret = async (ssm, config, param, defaultValue = '') => {
49
75
  var _a, _b;
76
+ console.log(config, param, defaultValue);
50
77
  if (config.onlyDefault) {
78
+ console.log(1);
51
79
  return defaultValue;
52
80
  }
81
+ console.log(2);
53
82
  try {
54
83
  const parameter = await ssm.send(new GetParameterCommand({
55
84
  Name: config.prefix + param,
@@ -58,6 +87,7 @@ const getSecret = async (ssm, config, param, defaultValue = '') => {
58
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;
59
88
  }
60
89
  catch (e) {
90
+ console.log(3);
61
91
  if (config.logger) {
62
92
  config.logger(e);
63
93
  }
@@ -73,11 +103,6 @@ const parameterStore = (userConfig) => {
73
103
  };
74
104
  };
75
105
 
76
- const DEFAULT_AWS_CONFIGURATION = {
77
- region: 'eu-central-2',
78
- };
79
- var index = { parameterStore };
80
-
81
106
  function createTokenStore(initialToken) {
82
107
  const token = new Map(Object.entries(initialToken || {}));
83
108
  return {
@@ -87,29 +112,6 @@ function createTokenStore(initialToken) {
87
112
  };
88
113
  }
89
114
 
90
- const version = "6.2.0-3";
91
-
92
- const REST_API_URL = 'https://api.allthings.me';
93
- const OAUTH_URL = 'https://accounts.allthings.me';
94
- const QUEUE_CONCURRENCY = undefined;
95
- const QUEUE_DELAY = 0;
96
- const QUEUE_RESERVOIR = 30;
97
- const QUEUE_RESERVOIR_REFILL_INTERVAL = 166;
98
- const REQUEST_BACK_OFF_INTERVAL = 200;
99
- const REQUEST_MAX_RETRIES = 50;
100
- const DEFAULT_API_WRAPPER_OPTIONS = {
101
- apiUrl: process.env.ALLTHINGS_REST_API_URL || REST_API_URL,
102
- clientId: process.env.ALLTHINGS_OAUTH_CLIENT_ID,
103
- clientSecret: process.env.ALLTHINGS_OAUTH_CLIENT_SECRET,
104
- oauthUrl: process.env.ALLTHINGS_OAUTH_URL || OAUTH_URL,
105
- password: process.env.ALLTHINGS_OAUTH_PASSWORD,
106
- requestBackOffInterval: REQUEST_BACK_OFF_INTERVAL,
107
- requestMaxRetries: REQUEST_MAX_RETRIES,
108
- scope: 'user:profile',
109
- username: process.env.ALLTHINGS_OAUTH_USERNAME,
110
- };
111
- const USER_AGENT = `Allthings Node SDK REST Client/${version}`;
112
-
113
115
  const RESPONSE_TYPE$1 = 'code';
114
116
  const GRANT_TYPE$3 = 'authorization_code';
115
117
  const castToAuthorizationRequestParams$1 = (params) => {
@@ -12414,4 +12416,4 @@ var EnumLookupUserType;
12414
12416
  EnumLookupUserType["tenant"] = "tenant";
12415
12417
  })(EnumLookupUserType || (EnumLookupUserType = {}));
12416
12418
 
12417
- export { DEFAULT_AWS_CONFIGURATION, DEFAULT_CLIENT_CONFIG as DEFAULT_PARAMETER_STORE_CLIENT_CONFIG, EnumCommunicationMethodType, EnumCommunicationPreferenceChannel, EnumCountryCode, EnumInputChannel, EnumLocale, EnumLookupUserType, EnumResource, EnumServiceProviderType, EnumTimezone, EnumUnitObjectType, EnumUnitType, EnumUserPermissionObjectType, EnumUserPermissionRole, EnumUserRelationType, EnumUtilisationPeriodType, index as awsClients, createTokenStore, parameterStore, restClient };
12419
+ export { DEFAULT_CLIENT_CONFIG as DEFAULT_PARAMETER_STORE_CLIENT_CONFIG, EnumCommunicationMethodType, EnumCommunicationPreferenceChannel, EnumCountryCode, EnumInputChannel, EnumLocale, EnumLookupUserType, EnumResource, EnumServiceProviderType, EnumTimezone, EnumUnitObjectType, EnumUnitType, EnumUserPermissionObjectType, EnumUserPermissionRole, EnumUserRelationType, EnumUtilisationPeriodType, createTokenStore, parameterStore, restClient };