@aws-amplify/core 6.0.17 → 6.0.18-experimental-lerna-test.d2b0b08.55

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.
Files changed (63) hide show
  1. package/dist/cjs/I18n/index.js +1 -1
  2. package/dist/cjs/I18n/index.js.map +1 -1
  3. package/dist/cjs/Logger/ConsoleLogger.js +9 -0
  4. package/dist/cjs/Logger/ConsoleLogger.js.map +1 -1
  5. package/dist/cjs/Platform/version.js +1 -1
  6. package/dist/cjs/Platform/version.js.map +1 -1
  7. package/dist/cjs/ServiceWorker/ServiceWorker.js +3 -3
  8. package/dist/cjs/ServiceWorker/ServiceWorker.js.map +1 -1
  9. package/dist/cjs/clients/middleware/retry/defaultRetryDecider.js +1 -1
  10. package/dist/cjs/clients/middleware/retry/defaultRetryDecider.js.map +1 -1
  11. package/dist/cjs/libraryUtils.js +4 -5
  12. package/dist/cjs/libraryUtils.js.map +1 -1
  13. package/dist/cjs/types/index.js +1 -0
  14. package/dist/cjs/types/index.js.map +1 -1
  15. package/dist/cjs/types/utils.js +6 -0
  16. package/dist/cjs/types/utils.js.map +1 -0
  17. package/dist/cjs/utils/WordArray.js +2 -1
  18. package/dist/cjs/utils/WordArray.js.map +1 -1
  19. package/dist/esm/I18n/index.d.ts +1 -1
  20. package/dist/esm/I18n/index.mjs +1 -1
  21. package/dist/esm/I18n/index.mjs.map +1 -1
  22. package/dist/esm/Logger/ConsoleLogger.d.ts +1 -0
  23. package/dist/esm/Logger/ConsoleLogger.mjs +9 -0
  24. package/dist/esm/Logger/ConsoleLogger.mjs.map +1 -1
  25. package/dist/esm/Platform/version.d.ts +1 -1
  26. package/dist/esm/Platform/version.mjs +1 -1
  27. package/dist/esm/Platform/version.mjs.map +1 -1
  28. package/dist/esm/ServiceWorker/ServiceWorker.d.ts +3 -3
  29. package/dist/esm/ServiceWorker/ServiceWorker.mjs +3 -3
  30. package/dist/esm/ServiceWorker/ServiceWorker.mjs.map +1 -1
  31. package/dist/esm/clients/middleware/retry/defaultRetryDecider.mjs +1 -1
  32. package/dist/esm/clients/middleware/retry/defaultRetryDecider.mjs.map +1 -1
  33. package/dist/esm/index.d.ts +1 -1
  34. package/dist/esm/libraryUtils.d.ts +4 -4
  35. package/dist/esm/libraryUtils.mjs +1 -1
  36. package/dist/esm/singleton/API/types.d.ts +23 -3
  37. package/dist/esm/singleton/Auth/types.d.ts +17 -3
  38. package/dist/esm/singleton/Auth/utils/index.d.ts +2 -1
  39. package/dist/esm/singleton/apis/fetchAuthSession.d.ts +2 -2
  40. package/dist/esm/singleton/types.d.ts +9 -0
  41. package/dist/esm/types/index.d.ts +1 -0
  42. package/dist/esm/types/utils.d.ts +8 -0
  43. package/dist/esm/types/utils.mjs +2 -0
  44. package/dist/esm/types/utils.mjs.map +1 -0
  45. package/dist/esm/utils/WordArray.d.ts +1 -1
  46. package/dist/esm/utils/WordArray.mjs +1 -1
  47. package/dist/esm/utils/WordArray.mjs.map +1 -1
  48. package/package.json +3 -3
  49. package/src/I18n/index.ts +1 -1
  50. package/src/Logger/ConsoleLogger.ts +9 -0
  51. package/src/Platform/version.ts +1 -1
  52. package/src/ServiceWorker/ServiceWorker.ts +3 -3
  53. package/src/clients/middleware/retry/defaultRetryDecider.ts +1 -1
  54. package/src/index.ts +1 -0
  55. package/src/libraryUtils.ts +11 -3
  56. package/src/singleton/API/types.ts +26 -1
  57. package/src/singleton/Auth/types.ts +25 -6
  58. package/src/singleton/Auth/utils/index.ts +1 -1
  59. package/src/singleton/apis/fetchAuthSession.ts +4 -2
  60. package/src/singleton/types.ts +9 -0
  61. package/src/types/index.ts +1 -0
  62. package/src/types/utils.ts +14 -0
  63. package/src/utils/WordArray.ts +1 -1
@@ -71,7 +71,7 @@ class I18n {
71
71
  * @static
72
72
  * @method
73
73
  * Add vocabularies for one language
74
- * @param {String} langurage - Language of the dictionary
74
+ * @param {String} language - Language of the dictionary
75
75
  * @param {Object} vocabularies - Object that has key-value as dictionary entry
76
76
  */
77
77
  static putVocabulariesForLanguage(language, vocabularies) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/I18n/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.I18n = void 0;\nconst Logger_1 = require(\"../Logger\");\nconst I18n_1 = require(\"./I18n\");\nconst errorHelpers_1 = require(\"./errorHelpers\");\nconst logger = new Logger_1.ConsoleLogger('I18n');\nlet _config = { language: null };\nlet _i18n = null;\n/**\n * Export I18n APIs\n */\nclass I18n {\n /**\n * @static\n * @method\n * Configure I18n part\n * @param {Object} config - Configuration of the I18n\n */\n static configure(config) {\n logger.debug('configure I18n');\n if (!config) {\n return _config;\n }\n _config = Object.assign({}, _config, config.I18n || config);\n I18n.createInstance();\n return _config;\n }\n static getModuleName() {\n return 'I18n';\n }\n /**\n * @static\n * @method\n * Create an instance of I18n for the library\n */\n static createInstance() {\n logger.debug('create I18n instance');\n if (_i18n) {\n return;\n }\n _i18n = new I18n_1.I18n();\n }\n /**\n * @static @method\n * Explicitly setting language\n * @param {String} lang\n */\n static setLanguage(lang) {\n I18n.checkConfig();\n (0, errorHelpers_1.assert)(!!_i18n, errorHelpers_1.I18nErrorCode.NotConfigured);\n _i18n.setLanguage(lang);\n }\n /**\n * @static @method\n * Get value\n * @param {String} key\n * @param {String} defVal - Default value\n */\n static get(key, defVal) {\n if (!I18n.checkConfig()) {\n return typeof defVal === 'undefined' ? key : defVal;\n }\n (0, errorHelpers_1.assert)(!!_i18n, errorHelpers_1.I18nErrorCode.NotConfigured);\n return _i18n.get(key, defVal);\n }\n /**\n * @static\n * @method\n * Add vocabularies for one language\n * @param {String} langurage - Language of the dictionary\n * @param {Object} vocabularies - Object that has key-value as dictionary entry\n */\n static putVocabulariesForLanguage(language, vocabularies) {\n I18n.checkConfig();\n (0, errorHelpers_1.assert)(!!_i18n, errorHelpers_1.I18nErrorCode.NotConfigured);\n _i18n.putVocabulariesForLanguage(language, vocabularies);\n }\n /**\n * @static\n * @method\n * Add vocabularies for one language\n * @param {Object} vocabularies - Object that has language as key,\n * vocabularies of each language as value\n */\n static putVocabularies(vocabularies) {\n I18n.checkConfig();\n (0, errorHelpers_1.assert)(!!_i18n, errorHelpers_1.I18nErrorCode.NotConfigured);\n _i18n.putVocabularies(vocabularies);\n }\n static checkConfig() {\n if (!_i18n) {\n I18n.createInstance();\n }\n return true;\n }\n}\nexports.I18n = I18n;\n// Create an instance of I18n in the static class\nI18n.createInstance();\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;AACtB,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACtC,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AACjC,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACjD,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AAClD,IAAI,OAAO,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACjC,IAAI,KAAK,GAAG,IAAI,CAAC;AACjB;AACA;AACA;AACA,MAAM,IAAI,CAAC;AACX;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,SAAS,CAAC,MAAM,EAAE;AAC7B,QAAQ,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACvC,QAAQ,IAAI,CAAC,MAAM,EAAE;AACrB,YAAY,OAAO,OAAO,CAAC;AAC3B,SAAS;AACT,QAAQ,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,IAAI,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,IAAI,CAAC,WAAW,EAAE,CAAC;AAC3B,QAAQ,IAAI,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,EAAE,cAAc,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;AACxF,QAAQ,KAAK,CAAC,0BAA0B,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AACjE,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,eAAe,CAAC,YAAY,EAAE;AACzC,QAAQ,IAAI,CAAC,WAAW,EAAE,CAAC;AAC3B,QAAQ,IAAI,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,EAAE,cAAc,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;AACxF,QAAQ,KAAK,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;AAC5C,KAAK;AACL,IAAI,OAAO,WAAW,GAAG;AACzB,QAAQ,IAAI,CAAC,KAAK,EAAE;AACpB,YAAY,IAAI,CAAC,cAAc,EAAE,CAAC;AAClC,SAAS;AACT,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,CAAC;AACD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpB;AACA,IAAI,CAAC,cAAc,EAAE;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/I18n/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.I18n = void 0;\nconst Logger_1 = require(\"../Logger\");\nconst I18n_1 = require(\"./I18n\");\nconst errorHelpers_1 = require(\"./errorHelpers\");\nconst logger = new Logger_1.ConsoleLogger('I18n');\nlet _config = { language: null };\nlet _i18n = null;\n/**\n * Export I18n APIs\n */\nclass I18n {\n /**\n * @static\n * @method\n * Configure I18n part\n * @param {Object} config - Configuration of the I18n\n */\n static configure(config) {\n logger.debug('configure I18n');\n if (!config) {\n return _config;\n }\n _config = Object.assign({}, _config, config.I18n || config);\n I18n.createInstance();\n return _config;\n }\n static getModuleName() {\n return 'I18n';\n }\n /**\n * @static\n * @method\n * Create an instance of I18n for the library\n */\n static createInstance() {\n logger.debug('create I18n instance');\n if (_i18n) {\n return;\n }\n _i18n = new I18n_1.I18n();\n }\n /**\n * @static @method\n * Explicitly setting language\n * @param {String} lang\n */\n static setLanguage(lang) {\n I18n.checkConfig();\n (0, errorHelpers_1.assert)(!!_i18n, errorHelpers_1.I18nErrorCode.NotConfigured);\n _i18n.setLanguage(lang);\n }\n /**\n * @static @method\n * Get value\n * @param {String} key\n * @param {String} defVal - Default value\n */\n static get(key, defVal) {\n if (!I18n.checkConfig()) {\n return typeof defVal === 'undefined' ? key : defVal;\n }\n (0, errorHelpers_1.assert)(!!_i18n, errorHelpers_1.I18nErrorCode.NotConfigured);\n return _i18n.get(key, defVal);\n }\n /**\n * @static\n * @method\n * Add vocabularies for one language\n * @param {String} language - Language of the dictionary\n * @param {Object} vocabularies - Object that has key-value as dictionary entry\n */\n static putVocabulariesForLanguage(language, vocabularies) {\n I18n.checkConfig();\n (0, errorHelpers_1.assert)(!!_i18n, errorHelpers_1.I18nErrorCode.NotConfigured);\n _i18n.putVocabulariesForLanguage(language, vocabularies);\n }\n /**\n * @static\n * @method\n * Add vocabularies for one language\n * @param {Object} vocabularies - Object that has language as key,\n * vocabularies of each language as value\n */\n static putVocabularies(vocabularies) {\n I18n.checkConfig();\n (0, errorHelpers_1.assert)(!!_i18n, errorHelpers_1.I18nErrorCode.NotConfigured);\n _i18n.putVocabularies(vocabularies);\n }\n static checkConfig() {\n if (!_i18n) {\n I18n.createInstance();\n }\n return true;\n }\n}\nexports.I18n = I18n;\n// Create an instance of I18n in the static class\nI18n.createInstance();\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,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5C,KAAK;AACL,IAAI,OAAO,WAAW,GAAG;AACzB,QAAQ,IAAI,CAAC,KAAK,EAAE;AACpB,YAAY,IAAI,CAAC,cAAc,EAAE,CAAC;AAClC,SAAS;AACT,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,CAAC;AACD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpB;AACA,IAAI,CAAC,cAAc,EAAE;;"}
@@ -71,6 +71,14 @@ class ConsoleLogger {
71
71
  if (type === types_1.LogType.WARN && console.warn) {
72
72
  log = console.warn.bind(console);
73
73
  }
74
+ if (ConsoleLogger.BIND_ALL_LOG_LEVELS) {
75
+ if (type === types_1.LogType.INFO && console.info) {
76
+ log = console.info.bind(console);
77
+ }
78
+ if (type === types_1.LogType.DEBUG && console.debug) {
79
+ log = console.debug.bind(console);
80
+ }
81
+ }
74
82
  const prefix = `[${type}] ${this._ts()} ${this.name}`;
75
83
  let message = '';
76
84
  if (msg.length === 1 && typeof msg[0] === 'string') {
@@ -164,4 +172,5 @@ class ConsoleLogger {
164
172
  }
165
173
  exports.ConsoleLogger = ConsoleLogger;
166
174
  ConsoleLogger.LOG_LEVEL = null;
175
+ ConsoleLogger.BIND_ALL_LOG_LEVELS = false;
167
176
  //# sourceMappingURL=ConsoleLogger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConsoleLogger.js","sources":["../../../src/Logger/ConsoleLogger.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConsoleLogger = void 0;\nconst constants_1 = require(\"../constants\");\nconst types_1 = require(\"./types\");\nconst LOG_LEVELS = {\n VERBOSE: 1,\n DEBUG: 2,\n INFO: 3,\n WARN: 4,\n ERROR: 5,\n NONE: 6,\n};\n/**\n * Write logs\n * @class Logger\n */\nclass ConsoleLogger {\n /**\n * @constructor\n * @param {string} name - Name of the logger\n */\n constructor(name, level = types_1.LogType.WARN) {\n this.name = name;\n this.level = level;\n this._pluggables = [];\n }\n _padding(n) {\n return n < 10 ? '0' + n : '' + n;\n }\n _ts() {\n const dt = new Date();\n return ([this._padding(dt.getMinutes()), this._padding(dt.getSeconds())].join(':') +\n '.' +\n dt.getMilliseconds());\n }\n configure(config) {\n if (!config)\n return this._config;\n this._config = config;\n return this._config;\n }\n /**\n * Write log\n * @method\n * @memeberof Logger\n * @param {LogType|string} type - log type, default INFO\n * @param {string|object} msg - Logging message or object\n */\n _log(type, ...msg) {\n let loggerLevelName = this.level;\n if (ConsoleLogger.LOG_LEVEL) {\n loggerLevelName = ConsoleLogger.LOG_LEVEL;\n }\n if (typeof window !== 'undefined' && window.LOG_LEVEL) {\n loggerLevelName = window.LOG_LEVEL;\n }\n const loggerLevel = LOG_LEVELS[loggerLevelName];\n const typeLevel = LOG_LEVELS[type];\n if (!(typeLevel >= loggerLevel)) {\n // Do nothing if type is not greater than or equal to logger level (handle undefined)\n return;\n }\n let log = console.log.bind(console);\n if (type === types_1.LogType.ERROR && console.error) {\n log = console.error.bind(console);\n }\n if (type === types_1.LogType.WARN && console.warn) {\n log = console.warn.bind(console);\n }\n const prefix = `[${type}] ${this._ts()} ${this.name}`;\n let message = '';\n if (msg.length === 1 && typeof msg[0] === 'string') {\n message = `${prefix} - ${msg[0]}`;\n log(message);\n }\n else if (msg.length === 1) {\n message = `${prefix} ${msg[0]}`;\n log(prefix, msg[0]);\n }\n else if (typeof msg[0] === 'string') {\n let obj = msg.slice(1);\n if (obj.length === 1) {\n obj = obj[0];\n }\n message = `${prefix} - ${msg[0]} ${obj}`;\n log(`${prefix} - ${msg[0]}`, obj);\n }\n else {\n message = `${prefix} ${msg}`;\n log(prefix, msg);\n }\n for (const plugin of this._pluggables) {\n const logEvent = { message, timestamp: Date.now() };\n plugin.pushLogs([logEvent]);\n }\n }\n /**\n * Write General log. Default to INFO\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n log(...msg) {\n this._log(types_1.LogType.INFO, ...msg);\n }\n /**\n * Write INFO log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n info(...msg) {\n this._log(types_1.LogType.INFO, ...msg);\n }\n /**\n * Write WARN log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n warn(...msg) {\n this._log(types_1.LogType.WARN, ...msg);\n }\n /**\n * Write ERROR log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n error(...msg) {\n this._log(types_1.LogType.ERROR, ...msg);\n }\n /**\n * Write DEBUG log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n debug(...msg) {\n this._log(types_1.LogType.DEBUG, ...msg);\n }\n /**\n * Write VERBOSE log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n verbose(...msg) {\n this._log(types_1.LogType.VERBOSE, ...msg);\n }\n addPluggable(pluggable) {\n if (pluggable && pluggable.getCategoryName() === constants_1.AWS_CLOUDWATCH_CATEGORY) {\n this._pluggables.push(pluggable);\n pluggable.configure(this._config);\n }\n }\n listPluggables() {\n return this._pluggables;\n }\n}\nexports.ConsoleLogger = ConsoleLogger;\nConsoleLogger.LOG_LEVEL = null;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC;AAC/B,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACnC,MAAM,UAAU,GAAG;AACnB,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,KAAK,EAAE,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F,YAAY,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC7C,YAAY,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC9C,SAAS;AACT,KAAK;AACL,IAAI,cAAc,GAAG;AACrB,QAAQ,OAAO,IAAI,CAAC,WAAW,CAAC;AAChC,KAAK;AACL,CAAC;AACD,OAAO,CAAC,aAAa,GAAG,aAAa,CAAC;AACtC,aAAa,CAAC,SAAS,GAAG,IAAI;;"}
1
+ {"version":3,"file":"ConsoleLogger.js","sources":["../../../src/Logger/ConsoleLogger.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConsoleLogger = void 0;\nconst constants_1 = require(\"../constants\");\nconst types_1 = require(\"./types\");\nconst LOG_LEVELS = {\n VERBOSE: 1,\n DEBUG: 2,\n INFO: 3,\n WARN: 4,\n ERROR: 5,\n NONE: 6,\n};\n/**\n * Write logs\n * @class Logger\n */\nclass ConsoleLogger {\n /**\n * @constructor\n * @param {string} name - Name of the logger\n */\n constructor(name, level = types_1.LogType.WARN) {\n this.name = name;\n this.level = level;\n this._pluggables = [];\n }\n _padding(n) {\n return n < 10 ? '0' + n : '' + n;\n }\n _ts() {\n const dt = new Date();\n return ([this._padding(dt.getMinutes()), this._padding(dt.getSeconds())].join(':') +\n '.' +\n dt.getMilliseconds());\n }\n configure(config) {\n if (!config)\n return this._config;\n this._config = config;\n return this._config;\n }\n /**\n * Write log\n * @method\n * @memeberof Logger\n * @param {LogType|string} type - log type, default INFO\n * @param {string|object} msg - Logging message or object\n */\n _log(type, ...msg) {\n let loggerLevelName = this.level;\n if (ConsoleLogger.LOG_LEVEL) {\n loggerLevelName = ConsoleLogger.LOG_LEVEL;\n }\n if (typeof window !== 'undefined' && window.LOG_LEVEL) {\n loggerLevelName = window.LOG_LEVEL;\n }\n const loggerLevel = LOG_LEVELS[loggerLevelName];\n const typeLevel = LOG_LEVELS[type];\n if (!(typeLevel >= loggerLevel)) {\n // Do nothing if type is not greater than or equal to logger level (handle undefined)\n return;\n }\n let log = console.log.bind(console);\n if (type === types_1.LogType.ERROR && console.error) {\n log = console.error.bind(console);\n }\n if (type === types_1.LogType.WARN && console.warn) {\n log = console.warn.bind(console);\n }\n if (ConsoleLogger.BIND_ALL_LOG_LEVELS) {\n if (type === types_1.LogType.INFO && console.info) {\n log = console.info.bind(console);\n }\n if (type === types_1.LogType.DEBUG && console.debug) {\n log = console.debug.bind(console);\n }\n }\n const prefix = `[${type}] ${this._ts()} ${this.name}`;\n let message = '';\n if (msg.length === 1 && typeof msg[0] === 'string') {\n message = `${prefix} - ${msg[0]}`;\n log(message);\n }\n else if (msg.length === 1) {\n message = `${prefix} ${msg[0]}`;\n log(prefix, msg[0]);\n }\n else if (typeof msg[0] === 'string') {\n let obj = msg.slice(1);\n if (obj.length === 1) {\n obj = obj[0];\n }\n message = `${prefix} - ${msg[0]} ${obj}`;\n log(`${prefix} - ${msg[0]}`, obj);\n }\n else {\n message = `${prefix} ${msg}`;\n log(prefix, msg);\n }\n for (const plugin of this._pluggables) {\n const logEvent = { message, timestamp: Date.now() };\n plugin.pushLogs([logEvent]);\n }\n }\n /**\n * Write General log. Default to INFO\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n log(...msg) {\n this._log(types_1.LogType.INFO, ...msg);\n }\n /**\n * Write INFO log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n info(...msg) {\n this._log(types_1.LogType.INFO, ...msg);\n }\n /**\n * Write WARN log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n warn(...msg) {\n this._log(types_1.LogType.WARN, ...msg);\n }\n /**\n * Write ERROR log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n error(...msg) {\n this._log(types_1.LogType.ERROR, ...msg);\n }\n /**\n * Write DEBUG log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n debug(...msg) {\n this._log(types_1.LogType.DEBUG, ...msg);\n }\n /**\n * Write VERBOSE log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n verbose(...msg) {\n this._log(types_1.LogType.VERBOSE, ...msg);\n }\n addPluggable(pluggable) {\n if (pluggable && pluggable.getCategoryName() === constants_1.AWS_CLOUDWATCH_CATEGORY) {\n this._pluggables.push(pluggable);\n pluggable.configure(this._config);\n }\n }\n listPluggables() {\n return this._pluggables;\n }\n}\nexports.ConsoleLogger = ConsoleLogger;\nConsoleLogger.LOG_LEVEL = null;\nConsoleLogger.BIND_ALL_LOG_LEVELS = false;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC;AAC/B,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACnC,MAAM,UAAU,GAAG;AACnB,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,IAAI,EAAE,CAAC;AACX,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA,MAAM,aAAa,CAAC;AACpB;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE;AACpD,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACzB,QAAQ,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AAC3B,QAAQ,I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AC,SAAS,EAAE;AAC5B,QAAQ,IAAI,SAAS,IAAI,SAAS,CAAC,eAAe,EAAE,KAAK,WAAW,CAAC,uBAAuB,EAAE;AAC9F,YAAY,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC7C,YAAY,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC9C,SAAS;AACT,KAAK;AACL,IAAI,cAAc,GAAG;AACrB,QAAQ,OAAO,IAAI,CAAC,WAAW,CAAC;AAChC,KAAK;AACL,CAAC;AACD,OAAO,CAAC,aAAa,GAAG,aAAa,CAAC;AACtC,aAAa,CAAC,SAAS,GAAG,IAAI,CAAC;AAC/B,aAAa,CAAC,mBAAmB,GAAG,KAAK;;"}
@@ -3,5 +3,5 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.version = void 0;
5
5
  // generated by genversion
6
- exports.version = '6.0.17';
6
+ exports.version = '6.0.18-experimental-lerna-test.d2b0b08.55+d2b0b087b';
7
7
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../../../src/Platform/version.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = void 0;\n// generated by genversion\nexports.version = '6.0.17';\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;AACzB;AACA,OAAO,CAAC,OAAO,GAAG,QAAQ;;"}
1
+ {"version":3,"file":"version.js","sources":["../../../src/Platform/version.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = void 0;\n// generated by genversion\nexports.version = '6.0.18-experimental-lerna-test.d2b0b08.55+d2b0b087b';\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;AACzB;AACA,OAAO,CAAC,OAAO,GAAG,qDAAqD;;"}
@@ -39,8 +39,8 @@ class ServiceWorkerClass {
39
39
  * Make sure the service-worker.js is part of the build
40
40
  * for example with Angular, modify the angular-cli.json file
41
41
  * and add to "assets" array "service-worker.js"
42
- * @param {string} - (optional) Service worker file. Defaults to "/service-worker.js"
43
- * @param {string} - (optional) The service worker scope. Defaults to "/"
42
+ * @param {string} filePath Service worker file. Defaults to "/service-worker.js"
43
+ * @param {string} scope The service worker scope. Defaults to "/"
44
44
  * - API Doc: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register
45
45
  * @returns {Promise}
46
46
  * - resolve(ServiceWorkerRegistration)
@@ -155,7 +155,7 @@ class ServiceWorkerClass {
155
155
  * Send a message to the service worker. The service worker needs
156
156
  * to implement `self.addEventListener('message') to handle the
157
157
  * message. This ***currently*** does not work in Safari or IE.
158
- * @param {object | string} - An arbitrary JSON object or string message to send to the service worker
158
+ * @param {object | string} message An arbitrary JSON object or string message to send to the service worker
159
159
  * - see: https://developer.mozilla.org/en-US/docs/Web/API/Transferable
160
160
  * @returns {Promise}
161
161
  **/
@@ -1 +1 @@
1
- {"version":3,"file":"ServiceWorker.js","sources":["../../../src/ServiceWorker/ServiceWorker.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ServiceWorkerClass = void 0;\nconst Logger_1 = require(\"../Logger\");\nconst utils_1 = require(\"../utils\");\nconst errors_1 = require(\"../errors\");\nconst pinpoint_1 = require(\"../providers/pinpoint\");\nconst singleton_1 = require(\"../singleton\");\nconst errorHelpers_1 = require(\"./errorHelpers\");\n/**\n * Provides a means to registering a service worker in the browser\n * and communicating with it via postMessage events.\n * https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/\n *\n * postMessage events are currently not supported in all browsers. See:\n * https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API\n *\n * At the minmum this class will register the service worker and listen\n * and attempt to dispatch messages on state change and record analytics\n * events based on the service worker lifecycle.\n */\nclass ServiceWorkerClass {\n constructor() {\n // The AWS Amplify logger\n this._logger = new Logger_1.ConsoleLogger('ServiceWorker');\n }\n /**\n * Get the currently active service worker\n */\n get serviceWorker() {\n (0, errorHelpers_1.assert)(this._serviceWorker !== undefined, errorHelpers_1.ServiceWorkerErrorCode.UndefinedInstance);\n return this._serviceWorker;\n }\n /**\n * Register the service-worker.js file in the browser\n * Make sure the service-worker.js is part of the build\n * for example with Angular, modify the angular-cli.json file\n * and add to \"assets\" array \"service-worker.js\"\n * @param {string} - (optional) Service worker file. Defaults to \"/service-worker.js\"\n * @param {string} - (optional) The service worker scope. Defaults to \"/\"\n * - API Doc: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register\n * @returns {Promise}\n *\t- resolve(ServiceWorkerRegistration)\n *\t- reject(Error)\n **/\n register(filePath = '/service-worker.js', scope = '/') {\n this._logger.debug(`registering ${filePath}`);\n this._logger.debug(`registering service worker with scope ${scope}`);\n return new Promise((resolve, reject) => {\n if (navigator && 'serviceWorker' in navigator) {\n navigator.serviceWorker\n .register(filePath, {\n scope,\n })\n .then(registration => {\n if (registration.installing) {\n this._serviceWorker = registration.installing;\n }\n else if (registration.waiting) {\n this._serviceWorker = registration.waiting;\n }\n else if (registration.active) {\n this._serviceWorker = registration.active;\n }\n this._registration = registration;\n this._setupListeners();\n this._logger.debug(`Service Worker Registration Success: ${registration}`);\n resolve(registration);\n })\n .catch(error => {\n this._logger.debug(`Service Worker Registration Failed ${error}`);\n reject(new errors_1.AmplifyError({\n name: errorHelpers_1.ServiceWorkerErrorCode.Unavailable,\n message: 'Service Worker not available',\n underlyingError: error,\n }));\n });\n }\n else {\n reject(new errors_1.AmplifyError({\n name: errorHelpers_1.ServiceWorkerErrorCode.Unavailable,\n message: 'Service Worker not available',\n }));\n }\n });\n }\n /**\n * Enable web push notifications. If not subscribed, a new subscription will\n * be created and registered.\n * \tTest Push Server: https://web-push-codelab.glitch.me/\n * \tPush Server Libraries: https://github.com/web-push-libs/\n * \tAPI Doc: https://developers.google.com/web/fundamentals/codelabs/push-notifications/\n * @param publicKey\n * @returns {Promise}\n * \t- resolve(PushSubscription)\n * - reject(Error)\n */\n enablePush(publicKey) {\n (0, errorHelpers_1.assert)(this._registration !== undefined, errorHelpers_1.ServiceWorkerErrorCode.UndefinedRegistration);\n this._publicKey = publicKey;\n return new Promise((resolve, reject) => {\n if ((0, utils_1.isBrowser)()) {\n (0, errorHelpers_1.assert)(this._registration !== undefined, errorHelpers_1.ServiceWorkerErrorCode.UndefinedRegistration);\n this._registration.pushManager.getSubscription().then(subscription => {\n if (subscription) {\n this._subscription = subscription;\n this._logger.debug(`User is subscribed to push: ${JSON.stringify(subscription)}`);\n resolve(subscription);\n }\n else {\n this._logger.debug(`User is NOT subscribed to push`);\n return this._registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: this._urlB64ToUint8Array(publicKey),\n })\n .then(pushManagerSubscription => {\n this._subscription = pushManagerSubscription;\n this._logger.debug(`User subscribed: ${JSON.stringify(pushManagerSubscription)}`);\n resolve(pushManagerSubscription);\n })\n .catch(error => {\n this._logger.error(error);\n });\n }\n });\n }\n else {\n reject(new errors_1.AmplifyError({\n name: errorHelpers_1.ServiceWorkerErrorCode.Unavailable,\n message: 'Service Worker not available',\n }));\n }\n });\n }\n /**\n * Convert a base64 encoded string to a Uint8 array for the push server key\n * @param base64String\n */\n _urlB64ToUint8Array(base64String) {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding)\n .replace(/-/g, '+')\n .replace(/_/g, '/');\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n }\n /**\n * Send a message to the service worker. The service worker needs\n * to implement `self.addEventListener('message') to handle the\n * message. This ***currently*** does not work in Safari or IE.\n * @param {object | string} - An arbitrary JSON object or string message to send to the service worker\n *\t- see: https://developer.mozilla.org/en-US/docs/Web/API/Transferable\n * @returns {Promise}\n **/\n send(message) {\n if (this._serviceWorker) {\n this._serviceWorker.postMessage(typeof message === 'object' ? JSON.stringify(message) : message);\n }\n }\n /**\n * Listen for service worker state change and message events\n * https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/state\n **/\n _setupListeners() {\n this.serviceWorker.addEventListener('statechange', async () => {\n const currentState = this.serviceWorker.state;\n this._logger.debug(`ServiceWorker statechange: ${currentState}`);\n const { appId, region, bufferSize, flushInterval, flushSize, resendLimit, } = singleton_1.Amplify.getConfig().Analytics?.Pinpoint ?? {};\n const { credentials } = await (0, singleton_1.fetchAuthSession)();\n if (appId && region && credentials) {\n // Pinpoint is configured, record an event\n (0, pinpoint_1.record)({\n appId,\n region,\n category: 'Core',\n credentials,\n bufferSize,\n flushInterval,\n flushSize,\n resendLimit,\n event: {\n name: 'ServiceWorker',\n attributes: {\n state: currentState,\n },\n },\n });\n }\n });\n this.serviceWorker.addEventListener('message', event => {\n this._logger.debug(`ServiceWorker message event: ${event}`);\n });\n }\n}\nexports.ServiceWorkerClass = ServiceWorkerClass;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,kBAAkB,GAAG,KAAK,CAAC,CAAC;AACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACtC,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACpC,MAAM,QAAQ,GAAG,OAAO,CA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AAQ,EAAE,MAAM;AACpC,oBAAoB,WAAW;AAC/B,oBAAoB,UAAU;AAC9B,oBAAoB,aAAa;AACjC,oBAAoB,SAAS;AAC7B,oBAAoB,WAAW;AAC/B,oBAAoB,KAAK,EAAE;AAC3B,wBAAwB,IAAI,EAAE,eAAe;AAC7C,wBAAwB,UAAU,EAAE;AACpC,4BAA4B,KAAK,EAAE,YAAY;AAC/C,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB,CAAC,CAAC;AACnB,aAAa;AACb,SAAS,CAAC,CAAC;AACX,QAAQ,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,IAAI;AAChE,YAAY,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AACxE,SAAS,CAAC,CAAC;AACX,KAAK;AACL,CAAC;AACD,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
1
+ {"version":3,"file":"ServiceWorker.js","sources":["../../../src/ServiceWorker/ServiceWorker.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ServiceWorkerClass = void 0;\nconst Logger_1 = require(\"../Logger\");\nconst utils_1 = require(\"../utils\");\nconst errors_1 = require(\"../errors\");\nconst pinpoint_1 = require(\"../providers/pinpoint\");\nconst singleton_1 = require(\"../singleton\");\nconst errorHelpers_1 = require(\"./errorHelpers\");\n/**\n * Provides a means to registering a service worker in the browser\n * and communicating with it via postMessage events.\n * https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/\n *\n * postMessage events are currently not supported in all browsers. See:\n * https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API\n *\n * At the minmum this class will register the service worker and listen\n * and attempt to dispatch messages on state change and record analytics\n * events based on the service worker lifecycle.\n */\nclass ServiceWorkerClass {\n constructor() {\n // The AWS Amplify logger\n this._logger = new Logger_1.ConsoleLogger('ServiceWorker');\n }\n /**\n * Get the currently active service worker\n */\n get serviceWorker() {\n (0, errorHelpers_1.assert)(this._serviceWorker !== undefined, errorHelpers_1.ServiceWorkerErrorCode.UndefinedInstance);\n return this._serviceWorker;\n }\n /**\n * Register the service-worker.js file in the browser\n * Make sure the service-worker.js is part of the build\n * for example with Angular, modify the angular-cli.json file\n * and add to \"assets\" array \"service-worker.js\"\n * @param {string} filePath Service worker file. Defaults to \"/service-worker.js\"\n * @param {string} scope The service worker scope. Defaults to \"/\"\n * - API Doc: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register\n * @returns {Promise}\n *\t- resolve(ServiceWorkerRegistration)\n *\t- reject(Error)\n **/\n register(filePath = '/service-worker.js', scope = '/') {\n this._logger.debug(`registering ${filePath}`);\n this._logger.debug(`registering service worker with scope ${scope}`);\n return new Promise((resolve, reject) => {\n if (navigator && 'serviceWorker' in navigator) {\n navigator.serviceWorker\n .register(filePath, {\n scope,\n })\n .then(registration => {\n if (registration.installing) {\n this._serviceWorker = registration.installing;\n }\n else if (registration.waiting) {\n this._serviceWorker = registration.waiting;\n }\n else if (registration.active) {\n this._serviceWorker = registration.active;\n }\n this._registration = registration;\n this._setupListeners();\n this._logger.debug(`Service Worker Registration Success: ${registration}`);\n resolve(registration);\n })\n .catch(error => {\n this._logger.debug(`Service Worker Registration Failed ${error}`);\n reject(new errors_1.AmplifyError({\n name: errorHelpers_1.ServiceWorkerErrorCode.Unavailable,\n message: 'Service Worker not available',\n underlyingError: error,\n }));\n });\n }\n else {\n reject(new errors_1.AmplifyError({\n name: errorHelpers_1.ServiceWorkerErrorCode.Unavailable,\n message: 'Service Worker not available',\n }));\n }\n });\n }\n /**\n * Enable web push notifications. If not subscribed, a new subscription will\n * be created and registered.\n * \tTest Push Server: https://web-push-codelab.glitch.me/\n * \tPush Server Libraries: https://github.com/web-push-libs/\n * \tAPI Doc: https://developers.google.com/web/fundamentals/codelabs/push-notifications/\n * @param publicKey\n * @returns {Promise}\n * \t- resolve(PushSubscription)\n * - reject(Error)\n */\n enablePush(publicKey) {\n (0, errorHelpers_1.assert)(this._registration !== undefined, errorHelpers_1.ServiceWorkerErrorCode.UndefinedRegistration);\n this._publicKey = publicKey;\n return new Promise((resolve, reject) => {\n if ((0, utils_1.isBrowser)()) {\n (0, errorHelpers_1.assert)(this._registration !== undefined, errorHelpers_1.ServiceWorkerErrorCode.UndefinedRegistration);\n this._registration.pushManager.getSubscription().then(subscription => {\n if (subscription) {\n this._subscription = subscription;\n this._logger.debug(`User is subscribed to push: ${JSON.stringify(subscription)}`);\n resolve(subscription);\n }\n else {\n this._logger.debug(`User is NOT subscribed to push`);\n return this._registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: this._urlB64ToUint8Array(publicKey),\n })\n .then(pushManagerSubscription => {\n this._subscription = pushManagerSubscription;\n this._logger.debug(`User subscribed: ${JSON.stringify(pushManagerSubscription)}`);\n resolve(pushManagerSubscription);\n })\n .catch(error => {\n this._logger.error(error);\n });\n }\n });\n }\n else {\n reject(new errors_1.AmplifyError({\n name: errorHelpers_1.ServiceWorkerErrorCode.Unavailable,\n message: 'Service Worker not available',\n }));\n }\n });\n }\n /**\n * Convert a base64 encoded string to a Uint8 array for the push server key\n * @param base64String\n */\n _urlB64ToUint8Array(base64String) {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding)\n .replace(/-/g, '+')\n .replace(/_/g, '/');\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n }\n /**\n * Send a message to the service worker. The service worker needs\n * to implement `self.addEventListener('message') to handle the\n * message. This ***currently*** does not work in Safari or IE.\n * @param {object | string} message An arbitrary JSON object or string message to send to the service worker\n *\t- see: https://developer.mozilla.org/en-US/docs/Web/API/Transferable\n * @returns {Promise}\n **/\n send(message) {\n if (this._serviceWorker) {\n this._serviceWorker.postMessage(typeof message === 'object' ? JSON.stringify(message) : message);\n }\n }\n /**\n * Listen for service worker state change and message events\n * https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/state\n **/\n _setupListeners() {\n this.serviceWorker.addEventListener('statechange', async () => {\n const currentState = this.serviceWorker.state;\n this._logger.debug(`ServiceWorker statechange: ${currentState}`);\n const { appId, region, bufferSize, flushInterval, flushSize, resendLimit, } = singleton_1.Amplify.getConfig().Analytics?.Pinpoint ?? {};\n const { credentials } = await (0, singleton_1.fetchAuthSession)();\n if (appId && region && credentials) {\n // Pinpoint is configured, record an event\n (0, pinpoint_1.record)({\n appId,\n region,\n category: 'Core',\n credentials,\n bufferSize,\n flushInterval,\n flushSize,\n resendLimit,\n event: {\n name: 'ServiceWorker',\n attributes: {\n state: currentState,\n },\n },\n });\n }\n });\n this.serviceWorker.addEventListener('message', event => {\n this._logger.debug(`ServiceWorker message event: ${event}`);\n });\n }\n}\nexports.ServiceWorkerClass = ServiceWorkerClass;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,kBAAkB,GAAG,KAAK,CAAC,CAAC;AACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACtC,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACtC,MAAM,UAAU,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AACpD,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAC5C,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MA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AyB;AACzB,qBAAqB;AACrB,iBAAiB,CAAC,CAAC;AACnB,aAAa;AACb,SAAS,CAAC,CAAC;AACX,QAAQ,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,IAAI;AAChE,YAAY,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AACxE,SAAS,CAAC,CAAC;AACX,KAAK;AACL,CAAC;AACD,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
@@ -13,7 +13,7 @@ const getRetryDecider = (errorParser) => async (response, error) => {
13
13
  const parsedError = error ??
14
14
  (await errorParser(response)) ??
15
15
  undefined;
16
- const errorCode = parsedError?.code;
16
+ const errorCode = parsedError?.code || parsedError?.name;
17
17
  const statusCode = response?.statusCode;
18
18
  return (isConnectionError(error) ||
19
19
  isThrottlingError(statusCode, errorCode) ||
@@ -1 +1 @@
1
- {"version":3,"file":"defaultRetryDecider.js","sources":["../../../../../src/clients/middleware/retry/defaultRetryDecider.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRetryDecider = void 0;\nconst isClockSkewError_1 = require(\"./isClockSkewError\");\n/**\n * Get retry decider function\n * @param errorParser Function to load JavaScript error from HTTP response\n */\nconst getRetryDecider = (errorParser) => async (response, error) => {\n const parsedError = error ??\n (await errorParser(response)) ??\n undefined;\n const errorCode = parsedError?.code;\n const statusCode = response?.statusCode;\n return (isConnectionError(error) ||\n isThrottlingError(statusCode, errorCode) ||\n (0, isClockSkewError_1.isClockSkewError)(errorCode) ||\n isServerSideError(statusCode, errorCode));\n};\nexports.getRetryDecider = getRetryDecider;\n// reference: https://github.com/aws/aws-sdk-js-v3/blob/ab0e7be36e7e7f8a0c04834357aaad643c7912c3/packages/service-error-classification/src/constants.ts#L22-L37\nconst THROTTLING_ERROR_CODES = [\n 'BandwidthLimitExceeded',\n 'EC2ThrottledException',\n 'LimitExceededException',\n 'PriorRequestNotComplete',\n 'ProvisionedThroughputExceededException',\n 'RequestLimitExceeded',\n 'RequestThrottled',\n 'RequestThrottledException',\n 'SlowDown',\n 'ThrottledException',\n 'Throttling',\n 'ThrottlingException',\n 'TooManyRequestsException',\n];\nconst TIMEOUT_ERROR_CODES = [\n 'TimeoutError',\n 'RequestTimeout',\n 'RequestTimeoutException',\n];\nconst isThrottlingError = (statusCode, errorCode) => statusCode === 429 ||\n (!!errorCode && THROTTLING_ERROR_CODES.includes(errorCode));\nconst isConnectionError = (error) => error?.name === 'Network error';\nconst isServerSideError = (statusCode, errorCode) => (!!statusCode && [500, 502, 503, 504].includes(statusCode)) ||\n (!!errorCode && TIMEOUT_ERROR_CODES.includes(errorCode));\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,eAAe,GAAG,KAAK,CAAC,CAAC;AACjC,MAAM,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AACzD;AACA;AACA;AACA;AACA,MAAM,eAAe,GAAG,CAAC,WAAW,KAAK,OAAO,QAAQ,EAAE,KAAK,KAAK;AACpE,IAAI,MAAM,WAAW,GAAG,KAAK;AAC7B,SAAS,MAAM,WAAW,CAAC,QAAQ,CAAC,CAAC;AACrC,QAAQ,SAAS,CAAC;AAClB,IAAI,MAAM,SAAS,GAAG,WAAW,EAAE,IAAI,CAAC;AACxC,IAAI,MAAM,UAAU,GAAG,QAAQ,EAAE,UAAU,CAAC;AAC5C,IAAI,QAAQ,iBAAiB,CAAC,KAAK,CAAC;AACpC,QAAQ,iBAAiB,CAAC,UAAU,EAAE,SAAS,CAAC;AAChD,QAAQ,IAAI,kBAAkB,CAAC,gBAAgB,EAAE,SAAS,CAAC;AAC3D,QAAQ,iBAAiB,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE;AAClD,CAAC,CAAC;AACF,OAAO,CAAC,eAAe,GAAG,eAAe,CAAC;AAC1C;AACA,MAAM,sBAAsB,GAAG;AAC/B,IAAI,wBAAwB;AAC5B,IAAI,uBAAuB;AAC3B,IAAI,wBAAwB;AAC5B,IAAI,yBAAyB;AAC7B,IAAI,wCAAwC;AAC5C,IAAI,sBAAsB;AAC1B,IAAI,kBAAkB;AACtB,IAAI,2BAA2B;AAC/B,IAAI,UAAU;AACd,IAAI,oBAAoB;AACxB,IAAI,YAAY;AAChB,IAAI,qBAAqB;AACzB,IAAI,0BAA0B;AAC9B,CAAC,CAAC;AACF,MAAM,mBAAmB,GAAG;AAC5B,IAAI,cAAc;AAClB,IAAI,gBAAgB;AACpB,IAAI,yBAAyB;AAC7B,CAAC,CAAC;AACF,MAAM,iBAAiB,GAAG,CAAC,UAAU,EAAE,SAAS,KAAK,UAAU,KAAK,GAAG;AACvE,KAAK,CAAC,CAAC,SAAS,IAAI,sBAAsB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;AAChE,MAAM,iBAAiB,GAAG,CAAC,KAAK,KAAK,KAAK,EAAE,IAAI,KAAK,eAAe,CAAC;AACrE,MAAM,iBAAiB,GAAG,CAAC,UAAU,EAAE,SAAS,KAAK,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC;AAC/G,KAAK,CAAC,CAAC,SAAS,IAAI,mBAAmB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;;"}
1
+ {"version":3,"file":"defaultRetryDecider.js","sources":["../../../../../src/clients/middleware/retry/defaultRetryDecider.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRetryDecider = void 0;\nconst isClockSkewError_1 = require(\"./isClockSkewError\");\n/**\n * Get retry decider function\n * @param errorParser Function to load JavaScript error from HTTP response\n */\nconst getRetryDecider = (errorParser) => async (response, error) => {\n const parsedError = error ??\n (await errorParser(response)) ??\n undefined;\n const errorCode = parsedError?.code || parsedError?.name;\n const statusCode = response?.statusCode;\n return (isConnectionError(error) ||\n isThrottlingError(statusCode, errorCode) ||\n (0, isClockSkewError_1.isClockSkewError)(errorCode) ||\n isServerSideError(statusCode, errorCode));\n};\nexports.getRetryDecider = getRetryDecider;\n// reference: https://github.com/aws/aws-sdk-js-v3/blob/ab0e7be36e7e7f8a0c04834357aaad643c7912c3/packages/service-error-classification/src/constants.ts#L22-L37\nconst THROTTLING_ERROR_CODES = [\n 'BandwidthLimitExceeded',\n 'EC2ThrottledException',\n 'LimitExceededException',\n 'PriorRequestNotComplete',\n 'ProvisionedThroughputExceededException',\n 'RequestLimitExceeded',\n 'RequestThrottled',\n 'RequestThrottledException',\n 'SlowDown',\n 'ThrottledException',\n 'Throttling',\n 'ThrottlingException',\n 'TooManyRequestsException',\n];\nconst TIMEOUT_ERROR_CODES = [\n 'TimeoutError',\n 'RequestTimeout',\n 'RequestTimeoutException',\n];\nconst isThrottlingError = (statusCode, errorCode) => statusCode === 429 ||\n (!!errorCode && THROTTLING_ERROR_CODES.includes(errorCode));\nconst isConnectionError = (error) => error?.name === 'Network error';\nconst isServerSideError = (statusCode, errorCode) => (!!statusCode && [500, 502, 503, 504].includes(statusCode)) ||\n (!!errorCode && TIMEOUT_ERROR_CODES.includes(errorCode));\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,eAAe,GAAG,KAAK,CAAC,CAAC;AACjC,MAAM,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;A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C,KAAK,KAAK,KAAK,EAAE,IAAI,KAAK,eAAe,CAAC;AACrE,MAAM,iBAAiB,GAAG,CAAC,UAAU,EAAE,SAAS,KAAK,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC;AAC/G,KAAK,CAAC,CAAC,SAAS,IAAI,mBAAmB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;;"}
@@ -1,13 +1,10 @@
1
1
  'use strict';
2
2
 
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
3
5
  Object.defineProperty(exports, "__esModule", { value: true });
4
6
  exports.fetchAuthSession = exports.USER_AGENT_HEADER = exports.Reachability = exports.Mutex = exports.BackgroundProcessManager = exports.AmplifyErrorCode = exports.ApiError = exports.createAssertionFunction = exports.PlatformNotSupportedError = exports.AmplifyError = exports.setCustomUserAgent = exports.StorageAction = exports.PushNotificationAction = exports.PubSubAction = exports.PredictionsAction = exports.InAppMessagingAction = exports.InteractionsAction = exports.GeoAction = exports.Framework = exports.DataStoreAction = exports.Category = exports.AnalyticsAction = exports.AuthAction = exports.ApiAction = exports.getAmplifyUserAgent = exports.getAmplifyUserAgentObject = exports.Platform = exports.haveCredentialsChanged = exports.Signer = exports.isTokenExpired = exports.assertOAuthConfig = exports.assertIdentityPoolIdConfig = exports.assertTokenProviderConfig = exports.decodeJWT = exports.AmplifyUrlSearchParams = exports.AmplifyUrl = exports.amplifyUuid = exports.ADD_OAUTH_LISTENER = exports.parseAWSExports = exports.deDupeAsyncFunction = exports.urlSafeEncode = exports.urlSafeDecode = exports.retry = exports.NonRetryableError = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isWebWorker = exports.isNonRetryableError = exports.isBrowser = exports.generateRandomString = void 0;
5
7
  exports.SESSION_STOP_EVENT = exports.SESSION_START_EVENT = exports.sessionListener = exports.HubInternal = exports.WordArray = exports.cryptoSecureRandomInt = exports.getCrypto = exports.base64Encoder = exports.base64Decoder = exports.AMPLIFY_SYMBOL = void 0;
6
- const tslib_1 = require("tslib");
7
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
8
- // SPDX-License-Identifier: Apache-2.0
9
- const WordArray_1 = tslib_1.__importDefault(require("./utils/WordArray"));
10
- exports.WordArray = WordArray_1.default;
11
8
  /*
12
9
  This file maps top-level exports from `@aws-amplify/core/internals/utils`. These are intended to be internal
13
10
  utils for use throughout the library.
@@ -95,6 +92,8 @@ var globalHelpers_1 = require("./utils/globalHelpers");
95
92
  Object.defineProperty(exports, "getCrypto", { enumerable: true, get: function () { return globalHelpers_1.getCrypto; } });
96
93
  var cryptoSecureRandomInt_1 = require("./utils/cryptoSecureRandomInt");
97
94
  Object.defineProperty(exports, "cryptoSecureRandomInt", { enumerable: true, get: function () { return cryptoSecureRandomInt_1.cryptoSecureRandomInt; } });
95
+ var WordArray_1 = require("./utils/WordArray");
96
+ Object.defineProperty(exports, "WordArray", { enumerable: true, get: function () { return WordArray_1.WordArray; } });
98
97
  // Hub
99
98
  var Hub_2 = require("./Hub");
100
99
  Object.defineProperty(exports, "HubInternal", { enumerable: true, get: function () { return Hub_2.HubInternal; } });
@@ -1 +1 @@
1
- {"version":3,"file":"libraryUtils.js","sources":["../../src/libraryUtils.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fetchAuthSession = exports.USER_AGENT_HEADER = exports.Reachability = exports.Mutex = exports.BackgroundProcessManager = exports.AmplifyErrorCode = exports.ApiError = exports.createAssertionFunction = exports.PlatformNotSupportedError = exports.AmplifyError = exports.setCustomUserAgent = exports.StorageAction = exports.PushNotificationAction = exports.PubSubAction = exports.PredictionsAction = exports.InAppMessagingAction = exports.InteractionsAction = exports.GeoAction = exports.Framework = exports.DataStoreAction = exports.Category = exports.AnalyticsAction = exports.AuthAction = exports.ApiAction = exports.getAmplifyUserAgent = exports.getAmplifyUserAgentObject = exports.Platform = exports.haveCredentialsChanged = exports.Signer = exports.isTokenExpired = exports.assertOAuthConfig = exports.assertIdentityPoolIdConfig = exports.assertTokenProviderConfig = exports.decodeJWT = exports.AmplifyUrlSearchParams = exports.AmplifyUrl = exports.amplifyUuid = exports.ADD_OAUTH_LISTENER = exports.parseAWSExports = exports.deDupeAsyncFunction = exports.urlSafeEncode = exports.urlSafeDecode = exports.retry = exports.NonRetryableError = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isWebWorker = exports.isNonRetryableError = exports.isBrowser = exports.generateRandomString = void 0;\nexports.SESSION_STOP_EVENT = exports.SESSION_START_EVENT = exports.sessionListener = exports.HubInternal = exports.WordArray = exports.cryptoSecureRandomInt = exports.getCrypto = exports.base64Encoder = exports.base64Decoder = exports.AMPLIFY_SYMBOL = void 0;\nconst tslib_1 = require(\"tslib\");\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst WordArray_1 = tslib_1.__importDefault(require(\"./utils/WordArray\"));\nexports.WordArray = WordArray_1.default;\n/*\nThis file maps top-level exports from `@aws-amplify/core/internals/utils`. These are intended to be internal\nutils for use throughout the library.\n*/\n// Core utilities\nvar utils_1 = require(\"./utils\");\nObject.defineProperty(exports, \"generateRandomString\", { enumerable: true, get: function () { return utils_1.generateRandomString; } });\nObject.defineProperty(exports, \"isBrowser\", { enumerable: true, get: function () { return utils_1.isBrowser; } });\nObject.defineProperty(exports, \"isNonRetryableError\", { enumerable: true, get: function () { return utils_1.isNonRetryableError; } });\nObject.defineProperty(exports, \"isWebWorker\", { enumerable: true, get: function () { return utils_1.isWebWorker; } });\nObject.defineProperty(exports, \"jitteredBackoff\", { enumerable: true, get: function () { return utils_1.jitteredBackoff; } });\nObject.defineProperty(exports, \"jitteredExponentialRetry\", { enumerable: true, get: function () { return utils_1.jitteredExponentialRetry; } });\nObject.defineProperty(exports, \"NonRetryableError\", { enumerable: true, get: function () { return utils_1.NonRetryableError; } });\nObject.defineProperty(exports, \"retry\", { enumerable: true, get: function () { return utils_1.retry; } });\nObject.defineProperty(exports, \"urlSafeDecode\", { enumerable: true, get: function () { return utils_1.urlSafeDecode; } });\nObject.defineProperty(exports, \"urlSafeEncode\", { enumerable: true, get: function () { return utils_1.urlSafeEncode; } });\nObject.defineProperty(exports, \"deDupeAsyncFunction\", { enumerable: true, get: function () { return utils_1.deDupeAsyncFunction; } });\nvar parseAWSExports_1 = require(\"./parseAWSExports\");\nObject.defineProperty(exports, \"parseAWSExports\", { enumerable: true, get: function () { return parseAWSExports_1.parseAWSExports; } });\nvar constants_1 = require(\"./singleton/constants\");\nObject.defineProperty(exports, \"ADD_OAUTH_LISTENER\", { enumerable: true, get: function () { return constants_1.ADD_OAUTH_LISTENER; } });\nvar amplifyUuid_1 = require(\"./utils/amplifyUuid\");\nObject.defineProperty(exports, \"amplifyUuid\", { enumerable: true, get: function () { return amplifyUuid_1.amplifyUuid; } });\nvar amplifyUrl_1 = require(\"./utils/amplifyUrl\");\nObject.defineProperty(exports, \"AmplifyUrl\", { enumerable: true, get: function () { return amplifyUrl_1.AmplifyUrl; } });\nObject.defineProperty(exports, \"AmplifyUrlSearchParams\", { enumerable: true, get: function () { return amplifyUrl_1.AmplifyUrlSearchParams; } });\n// Auth utilities\nvar utils_2 = require(\"./singleton/Auth/utils\");\nObject.defineProperty(exports, \"decodeJWT\", { enumerable: true, get: function () { return utils_2.decodeJWT; } });\nObject.defineProperty(exports, \"assertTokenProviderConfig\", { enumerable: true, get: function () { return utils_2.assertTokenProviderConfig; } });\nObject.defineProperty(exports, \"assertIdentityPoolIdConfig\", { enumerable: true, get: function () { return utils_2.assertIdentityPoolIdConfig; } });\nObject.defineProperty(exports, \"assertOAuthConfig\", { enumerable: true, get: function () { return utils_2.assertOAuthConfig; } });\nvar Auth_1 = require(\"./singleton/Auth\");\nObject.defineProperty(exports, \"isTokenExpired\", { enumerable: true, get: function () { return Auth_1.isTokenExpired; } });\nvar Signer_1 = require(\"./Signer\");\nObject.defineProperty(exports, \"Signer\", { enumerable: true, get: function () { return Signer_1.Signer; } });\nvar haveCredentialsChanged_1 = require(\"./utils/haveCredentialsChanged\");\nObject.defineProperty(exports, \"haveCredentialsChanged\", { enumerable: true, get: function () { return haveCredentialsChanged_1.haveCredentialsChanged; } });\n// Platform & user-agent utilities\nvar Platform_1 = require(\"./Platform\");\nObject.defineProperty(exports, \"Platform\", { enumerable: true, get: function () { return Platform_1.Platform; } });\nObject.defineProperty(exports, \"getAmplifyUserAgentObject\", { enumerable: true, get: function () { return Platform_1.getAmplifyUserAgentObject; } });\nObject.defineProperty(exports, \"getAmplifyUserAgent\", { enumerable: true, get: function () { return Platform_1.getAmplifyUserAgent; } });\nvar types_1 = require(\"./Platform/types\");\nObject.defineProperty(exports, \"ApiAction\", { enumerable: true, get: function () { return types_1.ApiAction; } });\nObject.defineProperty(exports, \"AuthAction\", { enumerable: true, get: function () { return types_1.AuthAction; } });\nObject.defineProperty(exports, \"AnalyticsAction\", { enumerable: true, get: function () { return types_1.AnalyticsAction; } });\nObject.defineProperty(exports, \"Category\", { enumerable: true, get: function () { return types_1.Category; } });\nObject.defineProperty(exports, \"DataStoreAction\", { enumerable: true, get: function () { return types_1.DataStoreAction; } });\nObject.defineProperty(exports, \"Framework\", { enumerable: true, get: function () { return types_1.Framework; } });\nObject.defineProperty(exports, \"GeoAction\", { enumerable: true, get: function () { return types_1.GeoAction; } });\nObject.defineProperty(exports, \"InteractionsAction\", { enumerable: true, get: function () { return types_1.InteractionsAction; } });\nObject.defineProperty(exports, \"InAppMessagingAction\", { enumerable: true, get: function () { return types_1.InAppMessagingAction; } });\nObject.defineProperty(exports, \"PredictionsAction\", { enumerable: true, get: function () { return types_1.PredictionsAction; } });\nObject.defineProperty(exports, \"PubSubAction\", { enumerable: true, get: function () { return types_1.PubSubAction; } });\nObject.defineProperty(exports, \"PushNotificationAction\", { enumerable: true, get: function () { return types_1.PushNotificationAction; } });\nObject.defineProperty(exports, \"StorageAction\", { enumerable: true, get: function () { return types_1.StorageAction; } });\nvar customUserAgent_1 = require(\"./Platform/customUserAgent\");\nObject.defineProperty(exports, \"setCustomUserAgent\", { enumerable: true, get: function () { return customUserAgent_1.setCustomUserAgent; } });\n// Error handling\nvar errors_1 = require(\"./errors\");\nObject.defineProperty(exports, \"AmplifyError\", { enumerable: true, get: function () { return errors_1.AmplifyError; } });\nObject.defineProperty(exports, \"PlatformNotSupportedError\", { enumerable: true, get: function () { return errors_1.PlatformNotSupportedError; } });\nObject.defineProperty(exports, \"createAssertionFunction\", { enumerable: true, get: function () { return errors_1.createAssertionFunction; } });\nObject.defineProperty(exports, \"ApiError\", { enumerable: true, get: function () { return errors_1.ApiError; } });\nvar types_2 = require(\"./types\");\nObject.defineProperty(exports, \"AmplifyErrorCode\", { enumerable: true, get: function () { return types_2.AmplifyErrorCode; } });\n// Other utilities & constants\nvar BackgroundProcessManager_1 = require(\"./BackgroundProcessManager\");\nObject.defineProperty(exports, \"BackgroundProcessManager\", { enumerable: true, get: function () { return BackgroundProcessManager_1.BackgroundProcessManager; } });\nvar Mutex_1 = require(\"./Mutex\");\nObject.defineProperty(exports, \"Mutex\", { enumerable: true, get: function () { return Mutex_1.Mutex; } });\nvar Reachability_1 = require(\"./Reachability\");\nObject.defineProperty(exports, \"Reachability\", { enumerable: true, get: function () { return Reachability_1.Reachability; } });\nvar constants_2 = require(\"./constants\");\nObject.defineProperty(exports, \"USER_AGENT_HEADER\", { enumerable: true, get: function () { return constants_2.USER_AGENT_HEADER; } });\nvar fetchAuthSession_1 = require(\"./singleton/apis/internal/fetchAuthSession\");\nObject.defineProperty(exports, \"fetchAuthSession\", { enumerable: true, get: function () { return fetchAuthSession_1.fetchAuthSession; } });\nvar Hub_1 = require(\"./Hub\");\nObject.defineProperty(exports, \"AMPLIFY_SYMBOL\", { enumerable: true, get: function () { return Hub_1.AMPLIFY_SYMBOL; } });\nvar convert_1 = require(\"./utils/convert\");\nObject.defineProperty(exports, \"base64Decoder\", { enumerable: true, get: function () { return convert_1.base64Decoder; } });\nObject.defineProperty(exports, \"base64Encoder\", { enumerable: true, get: function () { return convert_1.base64Encoder; } });\nvar globalHelpers_1 = require(\"./utils/globalHelpers\");\nObject.defineProperty(exports, \"getCrypto\", { enumerable: true, get: function () { return globalHelpers_1.getCrypto; } });\nvar cryptoSecureRandomInt_1 = require(\"./utils/cryptoSecureRandomInt\");\nObject.defineProperty(exports, \"cryptoSecureRandomInt\", { enumerable: true, get: function () { return cryptoSecureRandomInt_1.cryptoSecureRandomInt; } });\n// Hub\nvar Hub_2 = require(\"./Hub\");\nObject.defineProperty(exports, \"HubInternal\", { enumerable: true, get: function () { return Hub_2.HubInternal; } });\n// Session listener\nvar sessionListener_1 = require(\"./utils/sessionListener\");\nObject.defineProperty(exports, \"sessionListener\", { enumerable: true, get: function () { return sessionListener_1.sessionListener; } });\nvar sessionListener_2 = require(\"./utils/sessionListener\");\nObject.defineProperty(exports, \"SESSION_START_EVENT\", { enumerable: true, get: function () { return sessionListener_2.SESSION_START_EVENT; } });\nObject.defineProperty(exports, \"SESSION_STOP_EVENT\", { enumerable: true, get: function () { return sessionListener_2.SESSION_STOP_EVENT; } });\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,YAAY,GAA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,EAAE,CAAC,CAAC;AACxI,IAAI,iBAAiB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC3D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,qBAAqB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,iBAAiB,CAAC,mBAAmB,CAAC,EAAE,EAAE,CAAC,CAAC;AAChJ,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,oBAAoB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,iBAAiB,CAAC,kBAAkB,CAAC,EAAE,EAAE,CAAC;;"}
1
+ {"version":3,"file":"libraryUtils.js","sources":["../../src/libraryUtils.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fetchAuthSession = exports.USER_AGENT_HEADER = exports.Reachability = exports.Mutex = exports.BackgroundProcessManager = exports.AmplifyErrorCode = exports.ApiError = exports.createAssertionFunction = exports.PlatformNotSupportedError = exports.AmplifyError = exports.setCustomUserAgent = exports.StorageAction = exports.PushNotificationAction = exports.PubSubAction = exports.PredictionsAction = exports.InAppMessagingAction = exports.InteractionsAction = exports.GeoAction = exports.Framework = exports.DataStoreAction = exports.Category = exports.AnalyticsAction = exports.AuthAction = exports.ApiAction = exports.getAmplifyUserAgent = exports.getAmplifyUserAgentObject = exports.Platform = exports.haveCredentialsChanged = exports.Signer = exports.isTokenExpired = exports.assertOAuthConfig = exports.assertIdentityPoolIdConfig = exports.assertTokenProviderConfig = exports.decodeJWT = exports.AmplifyUrlSearchParams = exports.AmplifyUrl = exports.amplifyUuid = exports.ADD_OAUTH_LISTENER = exports.parseAWSExports = exports.deDupeAsyncFunction = exports.urlSafeEncode = exports.urlSafeDecode = exports.retry = exports.NonRetryableError = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isWebWorker = exports.isNonRetryableError = exports.isBrowser = exports.generateRandomString = void 0;\nexports.SESSION_STOP_EVENT = exports.SESSION_START_EVENT = exports.sessionListener = exports.HubInternal = exports.WordArray = exports.cryptoSecureRandomInt = exports.getCrypto = exports.base64Encoder = exports.base64Decoder = exports.AMPLIFY_SYMBOL = void 0;\n/*\nThis file maps top-level exports from `@aws-amplify/core/internals/utils`. These are intended to be internal\nutils for use throughout the library.\n*/\n// Core utilities\nvar utils_1 = require(\"./utils\");\nObject.defineProperty(exports, \"generateRandomString\", { enumerable: true, get: function () { return utils_1.generateRandomString; } });\nObject.defineProperty(exports, \"isBrowser\", { enumerable: true, get: function () { return utils_1.isBrowser; } });\nObject.defineProperty(exports, \"isNonRetryableError\", { enumerable: true, get: function () { return utils_1.isNonRetryableError; } });\nObject.defineProperty(exports, \"isWebWorker\", { enumerable: true, get: function () { return utils_1.isWebWorker; } });\nObject.defineProperty(exports, \"jitteredBackoff\", { enumerable: true, get: function () { return utils_1.jitteredBackoff; } });\nObject.defineProperty(exports, \"jitteredExponentialRetry\", { enumerable: true, get: function () { return utils_1.jitteredExponentialRetry; } });\nObject.defineProperty(exports, \"NonRetryableError\", { enumerable: true, get: function () { return utils_1.NonRetryableError; } });\nObject.defineProperty(exports, \"retry\", { enumerable: true, get: function () { return utils_1.retry; } });\nObject.defineProperty(exports, \"urlSafeDecode\", { enumerable: true, get: function () { return utils_1.urlSafeDecode; } });\nObject.defineProperty(exports, \"urlSafeEncode\", { enumerable: true, get: function () { return utils_1.urlSafeEncode; } });\nObject.defineProperty(exports, \"deDupeAsyncFunction\", { enumerable: true, get: function () { return utils_1.deDupeAsyncFunction; } });\nvar parseAWSExports_1 = require(\"./parseAWSExports\");\nObject.defineProperty(exports, \"parseAWSExports\", { enumerable: true, get: function () { return parseAWSExports_1.parseAWSExports; } });\nvar constants_1 = require(\"./singleton/constants\");\nObject.defineProperty(exports, \"ADD_OAUTH_LISTENER\", { enumerable: true, get: function () { return constants_1.ADD_OAUTH_LISTENER; } });\nvar amplifyUuid_1 = require(\"./utils/amplifyUuid\");\nObject.defineProperty(exports, \"amplifyUuid\", { enumerable: true, get: function () { return amplifyUuid_1.amplifyUuid; } });\nvar amplifyUrl_1 = require(\"./utils/amplifyUrl\");\nObject.defineProperty(exports, \"AmplifyUrl\", { enumerable: true, get: function () { return amplifyUrl_1.AmplifyUrl; } });\nObject.defineProperty(exports, \"AmplifyUrlSearchParams\", { enumerable: true, get: function () { return amplifyUrl_1.AmplifyUrlSearchParams; } });\n// Auth utilities\nvar utils_2 = require(\"./singleton/Auth/utils\");\nObject.defineProperty(exports, \"decodeJWT\", { enumerable: true, get: function () { return utils_2.decodeJWT; } });\nObject.defineProperty(exports, \"assertTokenProviderConfig\", { enumerable: true, get: function () { return utils_2.assertTokenProviderConfig; } });\nObject.defineProperty(exports, \"assertIdentityPoolIdConfig\", { enumerable: true, get: function () { return utils_2.assertIdentityPoolIdConfig; } });\nObject.defineProperty(exports, \"assertOAuthConfig\", { enumerable: true, get: function () { return utils_2.assertOAuthConfig; } });\nvar Auth_1 = require(\"./singleton/Auth\");\nObject.defineProperty(exports, \"isTokenExpired\", { enumerable: true, get: function () { return Auth_1.isTokenExpired; } });\nvar Signer_1 = require(\"./Signer\");\nObject.defineProperty(exports, \"Signer\", { enumerable: true, get: function () { return Signer_1.Signer; } });\nvar haveCredentialsChanged_1 = require(\"./utils/haveCredentialsChanged\");\nObject.defineProperty(exports, \"haveCredentialsChanged\", { enumerable: true, get: function () { return haveCredentialsChanged_1.haveCredentialsChanged; } });\n// Platform & user-agent utilities\nvar Platform_1 = require(\"./Platform\");\nObject.defineProperty(exports, \"Platform\", { enumerable: true, get: function () { return Platform_1.Platform; } });\nObject.defineProperty(exports, \"getAmplifyUserAgentObject\", { enumerable: true, get: function () { return Platform_1.getAmplifyUserAgentObject; } });\nObject.defineProperty(exports, \"getAmplifyUserAgent\", { enumerable: true, get: function () { return Platform_1.getAmplifyUserAgent; } });\nvar types_1 = require(\"./Platform/types\");\nObject.defineProperty(exports, \"ApiAction\", { enumerable: true, get: function () { return types_1.ApiAction; } });\nObject.defineProperty(exports, \"AuthAction\", { enumerable: true, get: function () { return types_1.AuthAction; } });\nObject.defineProperty(exports, \"AnalyticsAction\", { enumerable: true, get: function () { return types_1.AnalyticsAction; } });\nObject.defineProperty(exports, \"Category\", { enumerable: true, get: function () { return types_1.Category; } });\nObject.defineProperty(exports, \"DataStoreAction\", { enumerable: true, get: function () { return types_1.DataStoreAction; } });\nObject.defineProperty(exports, \"Framework\", { enumerable: true, get: function () { return types_1.Framework; } });\nObject.defineProperty(exports, \"GeoAction\", { enumerable: true, get: function () { return types_1.GeoAction; } });\nObject.defineProperty(exports, \"InteractionsAction\", { enumerable: true, get: function () { return types_1.InteractionsAction; } });\nObject.defineProperty(exports, \"InAppMessagingAction\", { enumerable: true, get: function () { return types_1.InAppMessagingAction; } });\nObject.defineProperty(exports, \"PredictionsAction\", { enumerable: true, get: function () { return types_1.PredictionsAction; } });\nObject.defineProperty(exports, \"PubSubAction\", { enumerable: true, get: function () { return types_1.PubSubAction; } });\nObject.defineProperty(exports, \"PushNotificationAction\", { enumerable: true, get: function () { return types_1.PushNotificationAction; } });\nObject.defineProperty(exports, \"StorageAction\", { enumerable: true, get: function () { return types_1.StorageAction; } });\nvar customUserAgent_1 = require(\"./Platform/customUserAgent\");\nObject.defineProperty(exports, \"setCustomUserAgent\", { enumerable: true, get: function () { return customUserAgent_1.setCustomUserAgent; } });\n// Error handling\nvar errors_1 = require(\"./errors\");\nObject.defineProperty(exports, \"AmplifyError\", { enumerable: true, get: function () { return errors_1.AmplifyError; } });\nObject.defineProperty(exports, \"PlatformNotSupportedError\", { enumerable: true, get: function () { return errors_1.PlatformNotSupportedError; } });\nObject.defineProperty(exports, \"createAssertionFunction\", { enumerable: true, get: function () { return errors_1.createAssertionFunction; } });\nObject.defineProperty(exports, \"ApiError\", { enumerable: true, get: function () { return errors_1.ApiError; } });\nvar types_2 = require(\"./types\");\nObject.defineProperty(exports, \"AmplifyErrorCode\", { enumerable: true, get: function () { return types_2.AmplifyErrorCode; } });\n// Other utilities & constants\nvar BackgroundProcessManager_1 = require(\"./BackgroundProcessManager\");\nObject.defineProperty(exports, \"BackgroundProcessManager\", { enumerable: true, get: function () { return BackgroundProcessManager_1.BackgroundProcessManager; } });\nvar Mutex_1 = require(\"./Mutex\");\nObject.defineProperty(exports, \"Mutex\", { enumerable: true, get: function () { return Mutex_1.Mutex; } });\nvar Reachability_1 = require(\"./Reachability\");\nObject.defineProperty(exports, \"Reachability\", { enumerable: true, get: function () { return Reachability_1.Reachability; } });\nvar constants_2 = require(\"./constants\");\nObject.defineProperty(exports, \"USER_AGENT_HEADER\", { enumerable: true, get: function () { return constants_2.USER_AGENT_HEADER; } });\nvar fetchAuthSession_1 = require(\"./singleton/apis/internal/fetchAuthSession\");\nObject.defineProperty(exports, \"fetchAuthSession\", { enumerable: true, get: function () { return fetchAuthSession_1.fetchAuthSession; } });\nvar Hub_1 = require(\"./Hub\");\nObject.defineProperty(exports, \"AMPLIFY_SYMBOL\", { enumerable: true, get: function () { return Hub_1.AMPLIFY_SYMBOL; } });\nvar convert_1 = require(\"./utils/convert\");\nObject.defineProperty(exports, \"base64Decoder\", { enumerable: true, get: function () { return convert_1.base64Decoder; } });\nObject.defineProperty(exports, \"base64Encoder\", { enumerable: true, get: function () { return convert_1.base64Encoder; } });\nvar globalHelpers_1 = require(\"./utils/globalHelpers\");\nObject.defineProperty(exports, \"getCrypto\", { enumerable: true, get: function () { return globalHelpers_1.getCrypto; } });\nvar cryptoSecureRandomInt_1 = require(\"./utils/cryptoSecureRandomInt\");\nObject.defineProperty(exports, \"cryptoSecureRandomInt\", { enumerable: true, get: function () { return cryptoSecureRandomInt_1.cryptoSecureRandomInt; } });\nvar WordArray_1 = require(\"./utils/WordArray\");\nObject.defineProperty(exports, \"WordArray\", { enumerable: true, get: function () { return WordArray_1.WordArray; } });\n// Hub\nvar Hub_2 = require(\"./Hub\");\nObject.defineProperty(exports, \"HubInternal\", { enumerable: true, get: function () { return Hub_2.HubInternal; } });\n// Session listener\nvar sessionListener_1 = require(\"./utils/sessionListener\");\nObject.defineProperty(exports, \"sessionListener\", { enumerable: true, get: function () { return sessionListener_1.sessionListener; } });\nvar sessionListener_2 = require(\"./utils/sessionListener\");\nObject.defineProperty(exports, \"SESSION_START_EVENT\", { enumerable: true, get: function () { return sessionListener_2.SESSION_START_EVENT; } });\nObject.defineProperty(exports, \"SESSION_STOP_EVENT\", { enumerable: true, get: function () { return sessionListener_2.SESSION_STOP_EVENT; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,MAAM,GA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AAO,iBAAiB,CAAC,kBAAkB,CAAC,EAAE,EAAE,CAAC;;"}
@@ -7,4 +7,5 @@ const tslib_1 = require("tslib");
7
7
  tslib_1.__exportStar(require("./core"), exports);
8
8
  tslib_1.__exportStar(require("./errors"), exports);
9
9
  tslib_1.__exportStar(require("./storage"), exports);
10
+ tslib_1.__exportStar(require("./utils"), exports);
10
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/types/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./core\"), exports);\ntslib_1.__exportStar(require(\"./errors\"), exports);\ntslib_1.__exportStar(require(\"./storage\"), exports);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AACjC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;AACjD,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC;AACnD,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/types/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./core\"), exports);\ntslib_1.__exportStar(require(\"./errors\"), exports);\ntslib_1.__exportStar(require(\"./storage\"), exports);\ntslib_1.__exportStar(require(\"./utils\"), exports);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AACjC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;AACjD,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC;AACnD,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC;AACpD,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;;"}
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sources":["../../../src/types/utils.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;"}
@@ -3,6 +3,7 @@
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.WordArray = void 0;
6
7
  const cryptoSecureRandomInt_1 = require("./cryptoSecureRandomInt");
7
8
  /**
8
9
  * Hex encoding strategy.
@@ -47,5 +48,5 @@ class WordArray {
47
48
  return hexStringify(this);
48
49
  }
49
50
  }
50
- exports.default = WordArray;
51
+ exports.WordArray = WordArray;
51
52
  //# sourceMappingURL=WordArray.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WordArray.js","sources":["../../../src/utils/WordArray.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst cryptoSecureRandomInt_1 = require(\"./cryptoSecureRandomInt\");\n/**\n * Hex encoding strategy.\n * Converts a word array to a hex string.\n * @param {WordArray} wordArray The word array.\n * @return {string} The hex string.\n * @static\n */\nfunction hexStringify(wordArray) {\n // Shortcuts\n const { words } = wordArray;\n const { sigBytes } = wordArray;\n // Convert\n const hexChars = [];\n for (let i = 0; i < sigBytes; i++) {\n const bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n hexChars.push((bite >>> 4).toString(16));\n hexChars.push((bite & 0x0f).toString(16));\n }\n return hexChars.join('');\n}\nclass WordArray {\n constructor(words, sigBytes) {\n this.words = [];\n let Words = words;\n Words = this.words = Words || [];\n if (sigBytes !== undefined) {\n this.sigBytes = sigBytes;\n }\n else {\n this.sigBytes = Words.length * 4;\n }\n }\n random(nBytes) {\n const words = [];\n for (let i = 0; i < nBytes; i += 4) {\n words.push((0, cryptoSecureRandomInt_1.cryptoSecureRandomInt)());\n }\n return new WordArray(words, nBytes);\n }\n toString() {\n return hexStringify(this);\n }\n}\nexports.default = WordArray;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,MAAM,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,YAAY,CAAC,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G,EAAE,CAAC;AACzB,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;AAC5C,YAAY,KAAK,CAAC,IAAI,CAAC,IAAI,uBAAuB,CAAC,qBAAqB,GAAG,CAAC,CAAC;AAC7E,SAAS;AACT,QAAQ,OAAO,IAAI,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC5C,KAAK;AACL,IAAI,QAAQ,GAAG;AACf,QAAQ,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;AAClC,KAAK;AACL,CAAC;AACD,OAAO,CAAC,OAAO,GAAG,SAAS;;"}
1
+ {"version":3,"file":"WordArray.js","sources":["../../../src/utils/WordArray.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WordArray = void 0;\nconst cryptoSecureRandomInt_1 = require(\"./cryptoSecureRandomInt\");\n/**\n * Hex encoding strategy.\n * Converts a word array to a hex string.\n * @param {WordArray} wordArray The word array.\n * @return {string} The hex string.\n * @static\n */\nfunction hexStringify(wordArray) {\n // Shortcuts\n const { words } = wordArray;\n const { sigBytes } = wordArray;\n // Convert\n const hexChars = [];\n for (let i = 0; i < sigBytes; i++) {\n const bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n hexChars.push((bite >>> 4).toString(16));\n hexChars.push((bite & 0x0f).toString(16));\n }\n return hexChars.join('');\n}\nclass WordArray {\n constructor(words, sigBytes) {\n this.words = [];\n let Words = words;\n Words = this.words = Words || [];\n if (sigBytes !== undefined) {\n this.sigBytes = sigBytes;\n }\n else {\n this.sigBytes = Words.length * 4;\n }\n }\n random(nBytes) {\n const words = [];\n for (let i = 0; i < nBytes; i += 4) {\n words.push((0, cryptoSecureRandomInt_1.cryptoSecureRandomInt)());\n }\n return new WordArray(words, nBytes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Q,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE,CAAC;AACzC,QAAQ,IAAI,QAAQ,KAAK,SAAS,EAAE;AACpC,YAAY,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACrC,SAAS;AACT,aAAa;AACb,YAAY,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AAC7C,SAAS;AACT,KAAK;AACL,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,MAAM,KAAK,GAAG,EAAE,CAAC;AACzB,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;AAC5C,YAAY,KAAK,CAAC,IAAI,CAAC,IAAI,uBAAuB,CAAC,qBAAqB,GAAG,CAAC,CAAC;AAC7E,SAAS;AACT,QAAQ,OAAO,IAAI,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC5C,KAAK;AACL,IAAI,QAAQ,GAAG;AACf,QAAQ,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;AAClC,KAAK;AACL,CAAC;AACD,OAAO,CAAC,SAAS,GAAG,SAAS;;"}
@@ -34,7 +34,7 @@ export declare class I18n {
34
34
  * @static
35
35
  * @method
36
36
  * Add vocabularies for one language
37
- * @param {String} langurage - Language of the dictionary
37
+ * @param {String} language - Language of the dictionary
38
38
  * @param {Object} vocabularies - Object that has key-value as dictionary entry
39
39
  */
40
40
  static putVocabulariesForLanguage(language: string, vocabularies: Record<string, string>): void;
@@ -68,7 +68,7 @@ class I18n {
68
68
  * @static
69
69
  * @method
70
70
  * Add vocabularies for one language
71
- * @param {String} langurage - Language of the dictionary
71
+ * @param {String} language - Language of the dictionary
72
72
  * @param {Object} vocabularies - Object that has key-value as dictionary entry
73
73
  */
74
74
  static putVocabulariesForLanguage(language, vocabularies) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/I18n/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ConsoleLogger } from '../Logger';\nimport { I18n as I18nClass } from './I18n';\nimport { I18nErrorCode, assert } from './errorHelpers';\nconst logger = new ConsoleLogger('I18n');\nlet _config = { language: null };\nlet _i18n = null;\n/**\n * Export I18n APIs\n */\nexport class I18n {\n /**\n * @static\n * @method\n * Configure I18n part\n * @param {Object} config - Configuration of the I18n\n */\n static configure(config) {\n logger.debug('configure I18n');\n if (!config) {\n return _config;\n }\n _config = Object.assign({}, _config, config.I18n || config);\n I18n.createInstance();\n return _config;\n }\n static getModuleName() {\n return 'I18n';\n }\n /**\n * @static\n * @method\n * Create an instance of I18n for the library\n */\n static createInstance() {\n logger.debug('create I18n instance');\n if (_i18n) {\n return;\n }\n _i18n = new I18nClass();\n }\n /**\n * @static @method\n * Explicitly setting language\n * @param {String} lang\n */\n static setLanguage(lang) {\n I18n.checkConfig();\n assert(!!_i18n, I18nErrorCode.NotConfigured);\n _i18n.setLanguage(lang);\n }\n /**\n * @static @method\n * Get value\n * @param {String} key\n * @param {String} defVal - Default value\n */\n static get(key, defVal) {\n if (!I18n.checkConfig()) {\n return typeof defVal === 'undefined' ? key : defVal;\n }\n assert(!!_i18n, I18nErrorCode.NotConfigured);\n return _i18n.get(key, defVal);\n }\n /**\n * @static\n * @method\n * Add vocabularies for one language\n * @param {String} langurage - Language of the dictionary\n * @param {Object} vocabularies - Object that has key-value as dictionary entry\n */\n static putVocabulariesForLanguage(language, vocabularies) {\n I18n.checkConfig();\n assert(!!_i18n, I18nErrorCode.NotConfigured);\n _i18n.putVocabulariesForLanguage(language, vocabularies);\n }\n /**\n * @static\n * @method\n * Add vocabularies for one language\n * @param {Object} vocabularies - Object that has language as key,\n * vocabularies of each language as value\n */\n static putVocabularies(vocabularies) {\n I18n.checkConfig();\n assert(!!_i18n, I18nErrorCode.NotConfigured);\n _i18n.putVocabularies(vocabularies);\n }\n static checkConfig() {\n if (!_i18n) {\n I18n.createInstance();\n }\n return true;\n }\n}\n// Create an instance of I18n in the static class\nI18n.createInstance();\n"],"names":["I18nClass"],"mappings":";;;;AAAA;AACA;AAIA,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;AACzC,IAAI,OAAO,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACjC,IAAI,KAAK,GAAG,IAAI,CAAC;AACjB;AACA;AACA;AACO,MAAM,IAAI,CAAC;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,SAAS,CAAC,MAAM,EAAE;AAC7B,QAAQ,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACvC,QAAQ,IAAI,CAAC,MAAM,EAAE;AACrB,YAAY,OAAO,OAAO,CAAC;AAC3B,SAAS;AACT,QAAQ,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC;AACpE,QAAQ,IAAI,CAAC,cAAc,EAAE,CAAC;AAC9B,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,OAAO,aAAa,GAAG;AAC3B,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,cAAc,GAAG;AAC5B,QAAQ,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAC7C,QAAQ,IAAI,KAAK,EAAE;AACnB,YAAY,OAAO;AACnB,SAAS;AACT,QAAQ,KAAK,GAAG,IAAIA,MAAS,EAAE,CAAC;AAChC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,WAAW,CAAC,IAAI,EAAE;AAC7B,QAAQ,IAAI,CAAC,WAAW,EAAE,CAAC;AAC3B,QAAQ,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,aAAa,CAAC,aA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Ac,EAAE;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../src/I18n/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ConsoleLogger } from '../Logger';\nimport { I18n as I18nClass } from './I18n';\nimport { I18nErrorCode, assert } from './errorHelpers';\nconst logger = new ConsoleLogger('I18n');\nlet _config = { language: null };\nlet _i18n = null;\n/**\n * Export I18n APIs\n */\nexport class I18n {\n /**\n * @static\n * @method\n * Configure I18n part\n * @param {Object} config - Configuration of the I18n\n */\n static configure(config) {\n logger.debug('configure I18n');\n if (!config) {\n return _config;\n }\n _config = Object.assign({}, _config, config.I18n || config);\n I18n.createInstance();\n return _config;\n }\n static getModuleName() {\n return 'I18n';\n }\n /**\n * @static\n * @method\n * Create an instance of I18n for the library\n */\n static createInstance() {\n logger.debug('create I18n instance');\n if (_i18n) {\n return;\n }\n _i18n = new I18nClass();\n }\n /**\n * @static @method\n * Explicitly setting language\n * @param {String} lang\n */\n static setLanguage(lang) {\n I18n.checkConfig();\n assert(!!_i18n, I18nErrorCode.NotConfigured);\n _i18n.setLanguage(lang);\n }\n /**\n * @static @method\n * Get value\n * @param {String} key\n * @param {String} defVal - Default value\n */\n static get(key, defVal) {\n if (!I18n.checkConfig()) {\n return typeof defVal === 'undefined' ? key : defVal;\n }\n assert(!!_i18n, I18nErrorCode.NotConfigured);\n return _i18n.get(key, defVal);\n }\n /**\n * @static\n * @method\n * Add vocabularies for one language\n * @param {String} language - Language of the dictionary\n * @param {Object} vocabularies - Object that has key-value as dictionary entry\n */\n static putVocabulariesForLanguage(language, vocabularies) {\n I18n.checkConfig();\n assert(!!_i18n, I18nErrorCode.NotConfigured);\n _i18n.putVocabulariesForLanguage(language, vocabularies);\n }\n /**\n * @static\n * @method\n * Add vocabularies for one language\n * @param {Object} vocabularies - Object that has language as key,\n * vocabularies of each language as value\n */\n static putVocabularies(vocabularies) {\n I18n.checkConfig();\n assert(!!_i18n, I18nErrorCode.NotConfigured);\n _i18n.putVocabularies(vocabularies);\n }\n static checkConfig() {\n if (!_i18n) {\n I18n.createInstance();\n }\n return true;\n }\n}\n// Create an instance of I18n in the static class\nI18n.createInstance();\n"],"names":["I18nClass"],"mappings":";;;;AAAA;AACA;AAIA,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;AACzC,IAAI,OAAO,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACjC,IAAI,KAAK,GAAG,IAAI,CAAC;AACjB;AACA;AACA;AACO,MAAM,IAAI,CAAC;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,SAAS,CAAC,MAAM,EAAE;AAC7B,QAAQ,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACvC,QAAQ,IAAI,CAAC,MAAM,EAAE;AACrB,YAAY,OAAO,OAAO,CAAC;AAC3B,SAAS;AACT,QAAQ,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC;AACpE,QAAQ,IAAI,CAAC,cAAc,EAAE,CAAC;AAC9B,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,OAAO,aAAa,GAAG;AAC3B,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,cAAc,GAAG;AAC5B,QAAQ,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAC7C,QAAQ,IAAI,KAAK,EAAE;AACnB,YAAY,OAAO;AACnB,SAAS;AACT,QAAQ,KAAK,GAAG,IAAIA,MAAS,EAAE,CAAC;AAChC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,WAAW,CAAC,IAAI,EAAE;AAC7B,QAAQ,IAAI,CAAC,WAAW,EAAE,CAAC;AAC3B,QAAQ,MAAM,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pB,KAAK;AACL,CAAC;AACD;AACA,IAAI,CAAC,cAAc,EAAE;;;;"}
@@ -14,6 +14,7 @@ export declare class ConsoleLogger implements Logger {
14
14
  */
15
15
  constructor(name: string, level?: LogType | string);
16
16
  static LOG_LEVEL: string | null;
17
+ static BIND_ALL_LOG_LEVELS: boolean;
17
18
  _padding(n: number): string;
18
19
  _ts(): string;
19
20
  configure(config?: object): object | undefined;
@@ -68,6 +68,14 @@ class ConsoleLogger {
68
68
  if (type === LogType.WARN && console.warn) {
69
69
  log = console.warn.bind(console);
70
70
  }
71
+ if (ConsoleLogger.BIND_ALL_LOG_LEVELS) {
72
+ if (type === LogType.INFO && console.info) {
73
+ log = console.info.bind(console);
74
+ }
75
+ if (type === LogType.DEBUG && console.debug) {
76
+ log = console.debug.bind(console);
77
+ }
78
+ }
71
79
  const prefix = `[${type}] ${this._ts()} ${this.name}`;
72
80
  let message = '';
73
81
  if (msg.length === 1 && typeof msg[0] === 'string') {
@@ -160,6 +168,7 @@ class ConsoleLogger {
160
168
  }
161
169
  }
162
170
  ConsoleLogger.LOG_LEVEL = null;
171
+ ConsoleLogger.BIND_ALL_LOG_LEVELS = false;
163
172
 
164
173
  export { ConsoleLogger };
165
174
  //# sourceMappingURL=ConsoleLogger.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConsoleLogger.mjs","sources":["../../../src/Logger/ConsoleLogger.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AWS_CLOUDWATCH_CATEGORY } from '../constants';\nimport { LogType } from './types';\nconst LOG_LEVELS = {\n VERBOSE: 1,\n DEBUG: 2,\n INFO: 3,\n WARN: 4,\n ERROR: 5,\n NONE: 6,\n};\n/**\n * Write logs\n * @class Logger\n */\nexport class ConsoleLogger {\n /**\n * @constructor\n * @param {string} name - Name of the logger\n */\n constructor(name, level = LogType.WARN) {\n this.name = name;\n this.level = level;\n this._pluggables = [];\n }\n _padding(n) {\n return n < 10 ? '0' + n : '' + n;\n }\n _ts() {\n const dt = new Date();\n return ([this._padding(dt.getMinutes()), this._padding(dt.getSeconds())].join(':') +\n '.' +\n dt.getMilliseconds());\n }\n configure(config) {\n if (!config)\n return this._config;\n this._config = config;\n return this._config;\n }\n /**\n * Write log\n * @method\n * @memeberof Logger\n * @param {LogType|string} type - log type, default INFO\n * @param {string|object} msg - Logging message or object\n */\n _log(type, ...msg) {\n let loggerLevelName = this.level;\n if (ConsoleLogger.LOG_LEVEL) {\n loggerLevelName = ConsoleLogger.LOG_LEVEL;\n }\n if (typeof window !== 'undefined' && window.LOG_LEVEL) {\n loggerLevelName = window.LOG_LEVEL;\n }\n const loggerLevel = LOG_LEVELS[loggerLevelName];\n const typeLevel = LOG_LEVELS[type];\n if (!(typeLevel >= loggerLevel)) {\n // Do nothing if type is not greater than or equal to logger level (handle undefined)\n return;\n }\n let log = console.log.bind(console);\n if (type === LogType.ERROR && console.error) {\n log = console.error.bind(console);\n }\n if (type === LogType.WARN && console.warn) {\n log = console.warn.bind(console);\n }\n const prefix = `[${type}] ${this._ts()} ${this.name}`;\n let message = '';\n if (msg.length === 1 && typeof msg[0] === 'string') {\n message = `${prefix} - ${msg[0]}`;\n log(message);\n }\n else if (msg.length === 1) {\n message = `${prefix} ${msg[0]}`;\n log(prefix, msg[0]);\n }\n else if (typeof msg[0] === 'string') {\n let obj = msg.slice(1);\n if (obj.length === 1) {\n obj = obj[0];\n }\n message = `${prefix} - ${msg[0]} ${obj}`;\n log(`${prefix} - ${msg[0]}`, obj);\n }\n else {\n message = `${prefix} ${msg}`;\n log(prefix, msg);\n }\n for (const plugin of this._pluggables) {\n const logEvent = { message, timestamp: Date.now() };\n plugin.pushLogs([logEvent]);\n }\n }\n /**\n * Write General log. Default to INFO\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n log(...msg) {\n this._log(LogType.INFO, ...msg);\n }\n /**\n * Write INFO log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n info(...msg) {\n this._log(LogType.INFO, ...msg);\n }\n /**\n * Write WARN log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n warn(...msg) {\n this._log(LogType.WARN, ...msg);\n }\n /**\n * Write ERROR log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n error(...msg) {\n this._log(LogType.ERROR, ...msg);\n }\n /**\n * Write DEBUG log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n debug(...msg) {\n this._log(LogType.DEBUG, ...msg);\n }\n /**\n * Write VERBOSE log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n verbose(...msg) {\n this._log(LogType.VERBOSE, ...msg);\n }\n addPluggable(pluggable) {\n if (pluggable && pluggable.getCategoryName() === AWS_CLOUDWATCH_CATEGORY) {\n this._pluggables.push(pluggable);\n pluggable.configure(this._config);\n }\n }\n listPluggables() {\n return this._pluggables;\n }\n}\nConsoleLogger.LOG_LEVEL = null;\n"],"names":[],"mappings":";;;AAAA;AACA;AAGA,MAAM,UAAU,GAAG;AACnB,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,IAAI,EAAE,CAAC;AACX,CAAC,CAAC;AACF;AACA;AACA;AACA;AACO,MAAM,aAAa,CAAC;AAC3B;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE;AAC5C,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACzB,QAAQ,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AAC3B,QAAQ,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;AAC9B,KAAK;AACL,IAAI,QAAQ,CAAC,CAAC,EAAE;AAChB,Q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;AACjB,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,CAAC;AACxC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,KAAK,CAAC,GAAG,GAAG,EAAE;AAClB,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC;AACzC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,KAAK,CAAC,GAAG,GAAG,EAAE;AAClB,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC;AACzC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,GAAG,EAAE;AACpB,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,CAAC;AAC3C,KAAK;AACL,IAAI,YAAY,CAAC,SAAS,EAAE;AAC5B,QAAQ,IAAI,SAAS,IAAI,SAAS,CAAC,eAAe,EAAE,KAAK,uBAAuB,EAAE;AAClF,YAAY,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC7C,YAAY,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC9C,SAAS;AACT,KAAK;AACL,IAAI,cAAc,GAAG;AACrB,QAAQ,OAAO,IAAI,CAAC,WAAW,CAAC;AAChC,KAAK;AACL,CAAC;AACD,aAAa,CAAC,SAAS,GAAG,IAAI;;;;"}
1
+ {"version":3,"file":"ConsoleLogger.mjs","sources":["../../../src/Logger/ConsoleLogger.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AWS_CLOUDWATCH_CATEGORY } from '../constants';\nimport { LogType } from './types';\nconst LOG_LEVELS = {\n VERBOSE: 1,\n DEBUG: 2,\n INFO: 3,\n WARN: 4,\n ERROR: 5,\n NONE: 6,\n};\n/**\n * Write logs\n * @class Logger\n */\nexport class ConsoleLogger {\n /**\n * @constructor\n * @param {string} name - Name of the logger\n */\n constructor(name, level = LogType.WARN) {\n this.name = name;\n this.level = level;\n this._pluggables = [];\n }\n _padding(n) {\n return n < 10 ? '0' + n : '' + n;\n }\n _ts() {\n const dt = new Date();\n return ([this._padding(dt.getMinutes()), this._padding(dt.getSeconds())].join(':') +\n '.' +\n dt.getMilliseconds());\n }\n configure(config) {\n if (!config)\n return this._config;\n this._config = config;\n return this._config;\n }\n /**\n * Write log\n * @method\n * @memeberof Logger\n * @param {LogType|string} type - log type, default INFO\n * @param {string|object} msg - Logging message or object\n */\n _log(type, ...msg) {\n let loggerLevelName = this.level;\n if (ConsoleLogger.LOG_LEVEL) {\n loggerLevelName = ConsoleLogger.LOG_LEVEL;\n }\n if (typeof window !== 'undefined' && window.LOG_LEVEL) {\n loggerLevelName = window.LOG_LEVEL;\n }\n const loggerLevel = LOG_LEVELS[loggerLevelName];\n const typeLevel = LOG_LEVELS[type];\n if (!(typeLevel >= loggerLevel)) {\n // Do nothing if type is not greater than or equal to logger level (handle undefined)\n return;\n }\n let log = console.log.bind(console);\n if (type === LogType.ERROR && console.error) {\n log = console.error.bind(console);\n }\n if (type === LogType.WARN && console.warn) {\n log = console.warn.bind(console);\n }\n if (ConsoleLogger.BIND_ALL_LOG_LEVELS) {\n if (type === LogType.INFO && console.info) {\n log = console.info.bind(console);\n }\n if (type === LogType.DEBUG && console.debug) {\n log = console.debug.bind(console);\n }\n }\n const prefix = `[${type}] ${this._ts()} ${this.name}`;\n let message = '';\n if (msg.length === 1 && typeof msg[0] === 'string') {\n message = `${prefix} - ${msg[0]}`;\n log(message);\n }\n else if (msg.length === 1) {\n message = `${prefix} ${msg[0]}`;\n log(prefix, msg[0]);\n }\n else if (typeof msg[0] === 'string') {\n let obj = msg.slice(1);\n if (obj.length === 1) {\n obj = obj[0];\n }\n message = `${prefix} - ${msg[0]} ${obj}`;\n log(`${prefix} - ${msg[0]}`, obj);\n }\n else {\n message = `${prefix} ${msg}`;\n log(prefix, msg);\n }\n for (const plugin of this._pluggables) {\n const logEvent = { message, timestamp: Date.now() };\n plugin.pushLogs([logEvent]);\n }\n }\n /**\n * Write General log. Default to INFO\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n log(...msg) {\n this._log(LogType.INFO, ...msg);\n }\n /**\n * Write INFO log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n info(...msg) {\n this._log(LogType.INFO, ...msg);\n }\n /**\n * Write WARN log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n warn(...msg) {\n this._log(LogType.WARN, ...msg);\n }\n /**\n * Write ERROR log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n error(...msg) {\n this._log(LogType.ERROR, ...msg);\n }\n /**\n * Write DEBUG log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n debug(...msg) {\n this._log(LogType.DEBUG, ...msg);\n }\n /**\n * Write VERBOSE log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n verbose(...msg) {\n this._log(LogType.VERBOSE, ...msg);\n }\n addPluggable(pluggable) {\n if (pluggable && pluggable.getCategoryName() === AWS_CLOUDWATCH_CATEGORY) {\n this._pluggables.push(pluggable);\n pluggable.configure(this._config);\n }\n }\n listPluggables() {\n return this._pluggables;\n }\n}\nConsoleLogger.LOG_LEVEL = null;\nConsoleLogger.BIND_ALL_LOG_LEVELS = false;\n"],"names":[],"mappings":";;;AAAA;AACA;AAGA,MAAM,UAAU,GAAG;AACnB,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,IAAI,E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