@be-link/shield-for-tcb-node-sdk 1.0.17 → 1.0.18

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.
@@ -33,11 +33,15 @@ class ShieldCloudFunctionConfig {
33
33
  _ShieldCloudFunctionConfig_env.set(this, void 0);
34
34
  _ShieldCloudFunctionConfig_fetchTimeoutMs.set(this, void 0);
35
35
  _ShieldCloudFunctionConfig_logger.set(this, void 0);
36
- if (!options.serviceName) {
36
+ const serviceName = (options.serviceName || '').trim();
37
+ if (!serviceName) {
37
38
  throw new Error('[ShieldCloudFunctionConfig] serviceName is required');
38
39
  }
39
- __classPrivateFieldSet(this, _ShieldCloudFunctionConfig_serviceName, options.serviceName, "f");
40
- __classPrivateFieldSet(this, _ShieldCloudFunctionConfig_env, options.env || process.env.NODE_ENV, "f");
40
+ if (options.env !== undefined && options.env.trim() === '') {
41
+ throw new Error('[ShieldCloudFunctionConfig] env must not be empty');
42
+ }
43
+ __classPrivateFieldSet(this, _ShieldCloudFunctionConfig_serviceName, serviceName, "f");
44
+ __classPrivateFieldSet(this, _ShieldCloudFunctionConfig_env, (options.env && options.env.trim()) || process.env.NODE_ENV, "f");
41
45
  __classPrivateFieldSet(this, _ShieldCloudFunctionConfig_fetchTimeoutMs, options.fetchTimeoutMs ?? DEFAULT_FETCH_TIMEOUT_MS, "f");
42
46
  __classPrivateFieldSet(this, _ShieldCloudFunctionConfig_logger, options.logger || defaultLogger, "f");
43
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/shield-for-tcb-node-sdk",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "ShieldForTCB Node.js SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",