@aws-amplify/core 6.0.1-mjs-test.6f5dab7.0 → 6.0.1-mjs-test.fc9412c.0

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 (54) hide show
  1. package/dist/cjs/Hub/index.js +2 -2
  2. package/dist/cjs/Hub/index.js.map +1 -1
  3. package/dist/cjs/Platform/version.js +1 -1
  4. package/dist/cjs/Platform/version.js.map +1 -1
  5. package/dist/cjs/Reachability/Reachability.js +2 -2
  6. package/dist/cjs/Reachability/Reachability.js.map +1 -1
  7. package/dist/cjs/constants.js +1 -9
  8. package/dist/cjs/constants.js.map +1 -1
  9. package/dist/cjs/libraryUtils.js +2 -3
  10. package/dist/cjs/libraryUtils.js.map +1 -1
  11. package/dist/cjs/providers/pinpoint/apis/updateEndpoint.js +4 -3
  12. package/dist/cjs/providers/pinpoint/apis/updateEndpoint.js.map +1 -1
  13. package/dist/cjs/providers/pinpoint/utils/cacheEndpointId.js +2 -2
  14. package/dist/cjs/providers/pinpoint/utils/cacheEndpointId.js.map +1 -1
  15. package/dist/cjs/providers/pinpoint/utils/getEndpointId.js +2 -2
  16. package/dist/cjs/providers/pinpoint/utils/getEndpointId.js.map +1 -1
  17. package/dist/cjs/providers/pinpoint/utils/resolveEndpointId.js +2 -2
  18. package/dist/cjs/providers/pinpoint/utils/resolveEndpointId.js.map +1 -1
  19. package/dist/esm/Hub/index.mjs +2 -2
  20. package/dist/esm/Hub/index.mjs.map +1 -1
  21. package/dist/esm/Platform/version.d.ts +1 -1
  22. package/dist/esm/Platform/version.mjs +1 -1
  23. package/dist/esm/Platform/version.mjs.map +1 -1
  24. package/dist/esm/Reachability/Reachability.mjs +0 -12
  25. package/dist/esm/Reachability/Reachability.mjs.map +1 -1
  26. package/dist/esm/ServiceWorker/ServiceWorker.mjs +2 -6
  27. package/dist/esm/ServiceWorker/ServiceWorker.mjs.map +1 -1
  28. package/dist/esm/constants.d.ts +0 -1
  29. package/dist/esm/constants.mjs +1 -9
  30. package/dist/esm/constants.mjs.map +1 -1
  31. package/dist/esm/libraryUtils.d.ts +1 -1
  32. package/dist/esm/libraryUtils.mjs +1 -1
  33. package/dist/esm/providers/pinpoint/apis/record.mjs +2 -18
  34. package/dist/esm/providers/pinpoint/apis/record.mjs.map +1 -1
  35. package/dist/esm/providers/pinpoint/apis/updateEndpoint.mjs +0 -4
  36. package/dist/esm/providers/pinpoint/apis/updateEndpoint.mjs.map +1 -1
  37. package/dist/esm/providers/pinpoint/index.mjs +0 -13
  38. package/dist/esm/providers/pinpoint/index.mjs.map +1 -1
  39. package/dist/esm/providers/pinpoint/utils/cacheEndpointId.mjs +0 -19
  40. package/dist/esm/providers/pinpoint/utils/cacheEndpointId.mjs.map +1 -1
  41. package/dist/esm/providers/pinpoint/utils/getEndpointId.mjs +0 -19
  42. package/dist/esm/providers/pinpoint/utils/getEndpointId.mjs.map +1 -1
  43. package/dist/esm/providers/pinpoint/utils/resolveEndpointId.mjs +0 -16
  44. package/dist/esm/providers/pinpoint/utils/resolveEndpointId.mjs.map +1 -1
  45. package/package.json +3 -3
  46. package/src/Hub/index.ts +2 -2
  47. package/src/Platform/version.ts +1 -1
  48. package/src/Reachability/Reachability.ts +1 -1
  49. package/src/constants.ts +0 -11
  50. package/src/libraryUtils.ts +1 -4
  51. package/src/providers/pinpoint/apis/updateEndpoint.ts +2 -1
  52. package/src/providers/pinpoint/utils/cacheEndpointId.ts +1 -1
  53. package/src/providers/pinpoint/utils/getEndpointId.ts +1 -1
  54. package/src/providers/pinpoint/utils/resolveEndpointId.ts +1 -1
@@ -7,8 +7,8 @@ exports.HubInternal = exports.Hub = exports.HubClass = exports.AMPLIFY_SYMBOL =
7
7
  const Logger_1 = require("../Logger");
8
8
  const constants_1 = require("../constants");
9
9
  const errors_1 = require("../errors");
10
- exports.AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'
11
- ? Symbol.for('amplify_default')
10
+ exports.AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined'
11
+ ? Symbol('amplify_default')
12
12
  : '@@amplify_default');
13
13
  const logger = new Logger_1.ConsoleLogger('Hub');
14
14
  class HubClass {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/Hub/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.HubInternal = exports.Hub = exports.HubClass = exports.AMPLIFY_SYMBOL = void 0;\nconst Logger_1 = require(\"../Logger\");\nconst constants_1 = require(\"../constants\");\nconst errors_1 = require(\"../errors\");\nexports.AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'\n ? Symbol.for('amplify_default')\n : '@@amplify_default');\nconst logger = new Logger_1.ConsoleLogger('Hub');\nclass HubClass {\n constructor(name) {\n this.listeners = new Map();\n this.protectedChannels = [\n 'core',\n 'auth',\n 'api',\n 'analytics',\n 'interactions',\n 'pubsub',\n 'storage',\n 'ui',\n 'xr',\n ];\n this.name = name;\n }\n /**\n * Used internally to remove a Hub listener.\n *\n * @remarks\n * This private method is for internal use only. Instead of calling Hub.remove, call the result of Hub.listen.\n */\n _remove(channel, listener) {\n const holder = this.listeners.get(channel);\n if (!holder) {\n logger.warn(`No listeners for ${channel}`);\n return;\n }\n this.listeners.set(channel, [\n ...holder.filter(({ callback }) => callback !== listener),\n ]);\n }\n dispatch(channel, payload, source, ampSymbol) {\n if (typeof channel === 'string' &&\n this.protectedChannels.indexOf(channel) > -1) {\n const hasAccess = ampSymbol === exports.AMPLIFY_SYMBOL;\n if (!hasAccess) {\n logger.warn(`WARNING: ${channel} is protected and dispatching on it can have unintended consequences`);\n }\n }\n const capsule = {\n channel,\n payload: { ...payload },\n source,\n patternInfo: [],\n };\n try {\n this._toListeners(capsule);\n }\n catch (e) {\n logger.error(e);\n }\n }\n listen(channel, callback, listenerName = 'noname') {\n let cb;\n if (typeof callback !== 'function') {\n throw new errors_1.AmplifyError({\n name: constants_1.NO_HUBCALLBACK_PROVIDED_EXCEPTION,\n message: 'No callback supplied to Hub',\n });\n }\n else {\n // Needs to be casted as a more generic type\n cb = callback;\n }\n let holder = this.listeners.get(channel);\n if (!holder) {\n holder = [];\n this.listeners.set(channel, holder);\n }\n holder.push({\n name: listenerName,\n callback: cb,\n });\n return () => {\n this._remove(channel, cb);\n };\n }\n _toListeners(capsule) {\n const { channel, payload } = capsule;\n const holder = this.listeners.get(channel);\n if (holder) {\n holder.forEach(listener => {\n logger.debug(`Dispatching to ${channel} with `, payload);\n try {\n listener.callback(capsule);\n }\n catch (e) {\n logger.error(e);\n }\n });\n }\n }\n}\nexports.HubClass = HubClass;\n/*We export a __default__ instance of HubClass to use it as a\npseudo Singleton for the main messaging bus, however you can still create\nyour own instance of HubClass() for a separate \"private bus\" of events.*/\nexports.Hub = new HubClass('__default__');\n/**\n * @internal\n *\n * Internal hub used for core Amplify functionality. Not intended for use outside of Amplify.\n *\n */\nexports.HubInternal = new HubClass('internal-hub');\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC;AACvF,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACtC,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACtC,OAAO,CAAC,cAAc,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,UAAU;AAC3F,MAAM,MAAM,CAAC,GAAG,CAAC,iBAAiB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M,CAAC,IAAI,CAAC;AACpB,YAAY,IAAI,EAAE,YAAY;AAC9B,YAAY,QAAQ,EAAE,EAAE;AACxB,SAAS,CAAC,CAAC;AACX,QAAQ,OAAO,MAAM;AACrB,YAAY,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACtC,SAAS,CAAC;AACV,KAAK;AACL,IAAI,YAAY,CAAC,OAAO,EAAE;AAC1B,QAAQ,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;AAC7C,QAAQ,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACnD,QAAQ,IAAI,MAAM,EAAE;AACpB,YAAY,MAAM,CAAC,OAAO,CAAC,QAAQ,IAAI;AACvC,gBAAgB,MAAM,CAAC,KAAK,CAAC,CAAC,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;AACzE,gBAAgB,IAAI;AACpB,oBAAoB,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC/C,iBAAiB;AACjB,gBAAgB,OAAO,CAAC,EAAE;AAC1B,oBAAoB,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpC,iBAAiB;AACjB,aAAa,CAAC,CAAC;AACf,SAAS;AACT,KAAK;AACL,CAAC;AACD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5B;AACA;AACA;AACA,OAAO,CAAC,GAAG,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC,WAAW,GAAG,IAAI,QAAQ,CAAC,cAAc,CAAC;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/Hub/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.HubInternal = exports.Hub = exports.HubClass = exports.AMPLIFY_SYMBOL = void 0;\nconst Logger_1 = require(\"../Logger\");\nconst constants_1 = require(\"../constants\");\nconst errors_1 = require(\"../errors\");\nexports.AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined'\n ? Symbol('amplify_default')\n : '@@amplify_default');\nconst logger = new Logger_1.ConsoleLogger('Hub');\nclass HubClass {\n constructor(name) {\n this.listeners = new Map();\n this.protectedChannels = [\n 'core',\n 'auth',\n 'api',\n 'analytics',\n 'interactions',\n 'pubsub',\n 'storage',\n 'ui',\n 'xr',\n ];\n this.name = name;\n }\n /**\n * Used internally to remove a Hub listener.\n *\n * @remarks\n * This private method is for internal use only. Instead of calling Hub.remove, call the result of Hub.listen.\n */\n _remove(channel, listener) {\n const holder = this.listeners.get(channel);\n if (!holder) {\n logger.warn(`No listeners for ${channel}`);\n return;\n }\n this.listeners.set(channel, [\n ...holder.filter(({ callback }) => callback !== listener),\n ]);\n }\n dispatch(channel, payload, source, ampSymbol) {\n if (typeof channel === 'string' &&\n this.protectedChannels.indexOf(channel) > -1) {\n const hasAccess = ampSymbol === exports.AMPLIFY_SYMBOL;\n if (!hasAccess) {\n logger.warn(`WARNING: ${channel} is protected and dispatching on it can have unintended consequences`);\n }\n }\n const capsule = {\n channel,\n payload: { ...payload },\n source,\n patternInfo: [],\n };\n try {\n this._toListeners(capsule);\n }\n catch (e) {\n logger.error(e);\n }\n }\n listen(channel, callback, listenerName = 'noname') {\n let cb;\n if (typeof callback !== 'function') {\n throw new errors_1.AmplifyError({\n name: constants_1.NO_HUBCALLBACK_PROVIDED_EXCEPTION,\n message: 'No callback supplied to Hub',\n });\n }\n else {\n // Needs to be casted as a more generic type\n cb = callback;\n }\n let holder = this.listeners.get(channel);\n if (!holder) {\n holder = [];\n this.listeners.set(channel, holder);\n }\n holder.push({\n name: listenerName,\n callback: cb,\n });\n return () => {\n this._remove(channel, cb);\n };\n }\n _toListeners(capsule) {\n const { channel, payload } = capsule;\n const holder = this.listeners.get(channel);\n if (holder) {\n holder.forEach(listener => {\n logger.debug(`Dispatching to ${channel} with `, payload);\n try {\n listener.callback(capsule);\n }\n catch (e) {\n logger.error(e);\n }\n });\n }\n }\n}\nexports.HubClass = HubClass;\n/*We export a __default__ instance of HubClass to use it as a\npseudo Singleton for the main messaging bus, however you can still create\nyour own instance of HubClass() for a separate \"private bus\" of events.*/\nexports.Hub = new HubClass('__default__');\n/**\n * @internal\n *\n * Internal hub used for core Amplify functionality. Not intended for use outside of Amplify.\n *\n */\nexports.HubInternal = new HubClass('internal-hub');\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC;AACvF,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACtC,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACtC,OAAO,CAAC,cAAc,IAAI,OAAO,MAAM,KAAK,WAAW;AACvD,MAAM,MAAM,CAAC,iBAAiB,CAAC;AAC/B,MAAM,mBAAmB,CAAC,CAAC;AAC3B,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AACjD,MAAM,QAAQ,CAAC;AACf,IAAI,WAAW,CAAC,IAAI,EAAE;AACtB,QAAQ,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;AACnC,QAAQ,IAAI,CAAC,iBAAiB,GAAG;AACjC,YAAY,MAAM;AAClB,YAAY,MAAM;AAClB,YAAY,KAAK;AACjB,YAAY,WAAW;AACvB,YAAY,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G,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACnD,QAAQ,IAAI,MAAM,EAAE;AACpB,YAAY,MAAM,CAAC,OAAO,CAAC,QAAQ,IAAI;AACvC,gBAAgB,MAAM,CAAC,KAAK,CAAC,CAAC,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;AACzE,gBAAgB,IAAI;AACpB,oBAAoB,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC/C,iBAAiB;AACjB,gBAAgB,OAAO,CAAC,EAAE;AAC1B,oBAAoB,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpC,iBAAiB;AACjB,aAAa,CAAC,CAAC;AACf,SAAS;AACT,KAAK;AACL,CAAC;AACD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5B;AACA;AACA;AACA,OAAO,CAAC,GAAG,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC,WAAW,GAAG,IAAI,QAAQ,CAAC,cAAc,CAAC;;"}
@@ -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.1-mjs-test.6f5dab7.0+6f5dab7';
6
+ exports.version = '6.0.1-mjs-test.fc9412c.0+fc9412c';
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.1-mjs-test.6f5dab7.0+6f5dab7';\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,kCAAkC;;"}
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.1-mjs-test.fc9412c.0+fc9412c';\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,kCAAkC;;"}
@@ -5,10 +5,10 @@
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Reachability = void 0;
7
7
  const rxjs_1 = require("rxjs");
8
- const libraryUtils_1 = require("../libraryUtils");
8
+ const utils_1 = require("../utils");
9
9
  class Reachability {
10
10
  networkMonitor(_) {
11
- const globalObj = (0, libraryUtils_1.isWebWorker)()
11
+ const globalObj = (0, utils_1.isWebWorker)()
12
12
  ? self
13
13
  : typeof window !== 'undefined' && window;
14
14
  if (!globalObj) {
@@ -1 +1 @@
1
- {"version":3,"file":"Reachability.js","sources":["../../../src/Reachability/Reachability.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.Reachability = void 0;\nconst rxjs_1 = require(\"rxjs\");\nconst libraryUtils_1 = require(\"../libraryUtils\");\nclass Reachability {\n networkMonitor(_) {\n const globalObj = (0, libraryUtils_1.isWebWorker)()\n ? self\n : typeof window !== 'undefined' && window;\n if (!globalObj) {\n return (0, rxjs_1.from)([{ online: true }]);\n }\n return new rxjs_1.Observable(observer => {\n observer.next({ online: globalObj.navigator.onLine });\n const notifyOnline = () => observer.next({ online: true });\n const notifyOffline = () => observer.next({ online: false });\n globalObj.addEventListener('online', notifyOnline);\n globalObj.addEventListener('offline', notifyOffline);\n Reachability._observers.push(observer);\n return () => {\n globalObj.removeEventListener('online', notifyOnline);\n globalObj.removeEventListener('offline', notifyOffline);\n Reachability._observers = Reachability._observers.filter(_observer => _observer !== observer);\n };\n });\n }\n // expose observers to simulate offline mode for integration testing\n static _observerOverride(status) {\n for (const observer of this._observers) {\n if (observer.closed) {\n this._observers = this._observers.filter(_observer => _observer !== observer);\n continue;\n }\n observer?.next && observer.next(status);\n }\n }\n}\nReachability._observers = [];\nexports.Reachability = Reachability;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,YAAY,GAAG,KAAK,CAAC,CAAC;AAC9B,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC/B,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAClD,MAAM,YAAY,CAAC;AACnB,IAAI,cAAc,CAAC,CAAC,EAAE;AACtB,QAAQ,MAAM,SAAS,GAAG,IAAI,cAAc,CAAC,WAAW,GAAG;AAC3D,cAAc,IAAI;AAClB,cAAc,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC;AACtD,QAAQ,IAAI,CAAC,SAAS,EAAE;AACxB,YAAY,OAAO,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACxD,SAAS;AACT,QAAQ,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,IAAI;AACjD,YAAY,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;AAClE,YAAY,MAAM,YAAY,GAAG,MAAM,QAAQ,C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js","sources":["../../../src/Reachability/Reachability.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.Reachability = void 0;\nconst rxjs_1 = require(\"rxjs\");\nconst utils_1 = require(\"../utils\");\nclass Reachability {\n networkMonitor(_) {\n const globalObj = (0, utils_1.isWebWorker)()\n ? self\n : typeof window !== 'undefined' && window;\n if (!globalObj) {\n return (0, rxjs_1.from)([{ online: true }]);\n }\n return new rxjs_1.Observable(observer => {\n observer.next({ online: globalObj.navigator.onLine });\n const notifyOnline = () => observer.next({ online: true });\n const notifyOffline = () => observer.next({ online: false });\n globalObj.addEventListener('online', notifyOnline);\n globalObj.addEventListener('offline', notifyOffline);\n Reachability._observers.push(observer);\n return () => {\n globalObj.removeEventListener('online', notifyOnline);\n globalObj.removeEventListener('offline', notifyOffline);\n Reachability._observers = Reachability._observers.filter(_observer => _observer !== observer);\n };\n });\n }\n // expose observers to simulate offline mode for integration testing\n static _observerOverride(status) {\n for (const observer of this._observers) {\n if (observer.closed) {\n this._observers = this._observers.filter(_observer => _observer !== observer);\n continue;\n }\n observer?.next && observer.next(status);\n }\n }\n}\nReachability._observers = [];\nexports.Reachability = Reachability;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,YAAY,GAAG,KAAK,CAAC,CAAC;AAC9B,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACpC,MAAM,YAAY,CAAC;AACnB,IAAI,cAAc,CAAC,CAAC,EAAE;AACtB,QAAQ,MAAM,SAAS,GAAG,IAAI,OAAO,CAAC,WAAW,GAAG;AACpD,cAAc,IAAI;AACl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ChD,YAAY,IAAI,QAAQ,CAAC,MAAM,EAAE;AACjC,gBAAgB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,IAAI,SAAS,KAAK,QAAQ,CAAC,CAAC;AAC9F,gBAAgB,SAAS;AACzB,aAAa;AACb,YAAY,QAAQ,EAAE,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACpD,SAAS;AACT,KAAK;AACL,CAAC;AACD,YAAY,CAAC,UAAU,GAAG,EAAE,CAAC;AAC7B,OAAO,CAAC,YAAY,GAAG,YAAY;;"}
@@ -3,17 +3,9 @@
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.NO_HUBCALLBACK_PROVIDED_EXCEPTION = exports.USER_AGENT_HEADER = exports.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = exports.AWS_CLOUDWATCH_CATEGORY = void 0;
6
+ exports.NO_HUBCALLBACK_PROVIDED_EXCEPTION = exports.USER_AGENT_HEADER = exports.AWS_CLOUDWATCH_CATEGORY = void 0;
7
7
  // Logging constants
8
8
  exports.AWS_CLOUDWATCH_CATEGORY = 'Logging';
9
- /**
10
- * This Symbol is used to reference an internal-only PubSub provider that
11
- * is used for AppSync/GraphQL subscriptions in the API category.
12
- */
13
- const hasSymbol = typeof Symbol !== 'undefined' && typeof Symbol.for === 'function';
14
- exports.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = hasSymbol
15
- ? Symbol.for('INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER')
16
- : '@@INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER';
17
9
  exports.USER_AGENT_HEADER = 'x-amz-user-agent';
18
10
  // Error exception code constants
19
11
  exports.NO_HUBCALLBACK_PROVIDED_EXCEPTION = 'NoHubcallbackProvidedException';
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../src/constants.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.NO_HUBCALLBACK_PROVIDED_EXCEPTION = exports.USER_AGENT_HEADER = exports.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = exports.AWS_CLOUDWATCH_CATEGORY = void 0;\n// Logging constants\nexports.AWS_CLOUDWATCH_CATEGORY = 'Logging';\n/**\n * This Symbol is used to reference an internal-only PubSub provider that\n * is used for AppSync/GraphQL subscriptions in the API category.\n */\nconst hasSymbol = typeof Symbol !== 'undefined' && typeof Symbol.for === 'function';\nexports.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = hasSymbol\n ? Symbol.for('INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER')\n : '@@INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER';\nexports.USER_AGENT_HEADER = 'x-amz-user-agent';\n// Error exception code constants\nexports.NO_HUBCALLBACK_PROVIDED_EXCEPTION = 'NoHubcallbackProvidedException';\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,iCAAiC,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,6CAA6C,GAAG,OAAO,CAAC,uBAAuB,GAAG,KAAK,CAAC,CAAC;AACzK;AACA,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC;AAC5C;AACA;AACA;AACA;AACA,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,UAAU,CAAC;AACpF,OAAO,CAAC,6CAA6C,GAAG,SAAS;AACjE,MAAM,MAAM,CAAC,GAAG,CAAC,+CAA+C,CAAC;AACjE,MAAM,iDAAiD,CAAC;AACxD,OAAO,CAAC,iBAAiB,GAAG,kBAAkB,CAAC;AAC/C;AACA,OAAO,CAAC,iCAAiC,GAAG,gCAAgC;;"}
1
+ {"version":3,"file":"constants.js","sources":["../../src/constants.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.NO_HUBCALLBACK_PROVIDED_EXCEPTION = exports.USER_AGENT_HEADER = exports.AWS_CLOUDWATCH_CATEGORY = void 0;\n// Logging constants\nexports.AWS_CLOUDWATCH_CATEGORY = 'Logging';\nexports.USER_AGENT_HEADER = 'x-amz-user-agent';\n// Error exception code constants\nexports.NO_HUBCALLBACK_PROVIDED_EXCEPTION = 'NoHubcallbackProvidedException';\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,iCAAiC,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,uBAAuB,GAAG,KAAK,CAAC,CAAC;AACjH;AACA,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC;AAC5C,OAAO,CAAC,iBAAiB,GAAG,kBAAkB,CAAC;AAC/C;AACA,OAAO,CAAC,iCAAiC,GAAG,gCAAgC;;"}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.base64Encoder = exports.base64Decoder = exports.AMPLIFY_SYMBOL = exports.fetchAuthSession = exports.USER_AGENT_HEADER = exports.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = exports.Reachability = exports.Mutex = exports.BackgroundProcessManager = exports.AmplifyErrorCode = 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.Signer = exports.isTokenExpired = exports.assertOAuthConfig = exports.assertIdentityPoolIdConfig = exports.assertTokenProviderConfig = exports.decodeJWT = exports.AmplifyUrlSearchParams = exports.AmplifyUrl = exports.amplifyUuid = exports.parseAWSExports = exports.urlSafeEncode = exports.urlSafeDecode = exports.retry = exports.NonRetryableError = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isWebWorker = exports.isNonRetryableError = exports.isBrowser = exports.generateRandomString = void 0;
5
- exports.SESSION_STOP_EVENT = exports.SESSION_START_EVENT = exports.sessionListener = exports.HubInternal = exports.WordArray = exports.cryptoSecureRandomInt = exports.getCrypto = void 0;
4
+ exports.getCrypto = exports.base64Encoder = exports.base64Decoder = exports.AMPLIFY_SYMBOL = exports.fetchAuthSession = exports.USER_AGENT_HEADER = exports.Reachability = exports.Mutex = exports.BackgroundProcessManager = exports.AmplifyErrorCode = 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.Signer = exports.isTokenExpired = exports.assertOAuthConfig = exports.assertIdentityPoolIdConfig = exports.assertTokenProviderConfig = exports.decodeJWT = exports.AmplifyUrlSearchParams = exports.AmplifyUrl = exports.amplifyUuid = exports.parseAWSExports = exports.urlSafeEncode = exports.urlSafeDecode = exports.retry = exports.NonRetryableError = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isWebWorker = exports.isNonRetryableError = exports.isBrowser = exports.generateRandomString = void 0;
5
+ exports.SESSION_STOP_EVENT = exports.SESSION_START_EVENT = exports.sessionListener = exports.HubInternal = exports.WordArray = exports.cryptoSecureRandomInt = void 0;
6
6
  const tslib_1 = require("tslib");
7
7
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
8
8
  // SPDX-License-Identifier: Apache-2.0
@@ -77,7 +77,6 @@ Object.defineProperty(exports, "Mutex", { enumerable: true, get: function () { r
77
77
  var Reachability_1 = require("./Reachability");
78
78
  Object.defineProperty(exports, "Reachability", { enumerable: true, get: function () { return Reachability_1.Reachability; } });
79
79
  var constants_1 = require("./constants");
80
- Object.defineProperty(exports, "INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER", { enumerable: true, get: function () { return constants_1.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER; } });
81
80
  Object.defineProperty(exports, "USER_AGENT_HEADER", { enumerable: true, get: function () { return constants_1.USER_AGENT_HEADER; } });
82
81
  var fetchAuthSession_1 = require("./singleton/apis/internal/fetchAuthSession");
83
82
  Object.defineProperty(exports, "fetchAuthSession", { enumerable: true, get: function () { return fetchAuthSession_1.fetchAuthSession; } });
@@ -1 +1 @@
1
- {"version":3,"file":"libraryUtils.js","sources":["../../src/libraryUtils.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.base64Encoder = exports.base64Decoder = exports.AMPLIFY_SYMBOL = exports.fetchAuthSession = exports.USER_AGENT_HEADER = exports.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = exports.Reachability = exports.Mutex = exports.BackgroundProcessManager = exports.AmplifyErrorCode = 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.Signer = exports.isTokenExpired = exports.assertOAuthConfig = exports.assertIdentityPoolIdConfig = exports.assertTokenProviderConfig = exports.decodeJWT = exports.AmplifyUrlSearchParams = exports.AmplifyUrl = exports.amplifyUuid = exports.parseAWSExports = 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 = 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; } });\nvar parseAWSExports_1 = require(\"./parseAWSExports\");\nObject.defineProperty(exports, \"parseAWSExports\", { enumerable: true, get: function () { return parseAWSExports_1.parseAWSExports; } });\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; } });\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; } });\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_1 = require(\"./constants\");\nObject.defineProperty(exports, \"INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER\", { enumerable: true, get: function () { return constants_1.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER; } });\nObject.defineProperty(exports, \"USER_AGENT_HEADER\", { enumerable: true, get: function () { return constants_1.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,aAAa,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,6CAA6C,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,gBAAgB,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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,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,KAAK,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC;AACpH;AACA,IAAI,iBAAiB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC3D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,iBAAiB,CAAC,eAAe,CAAC,EAAE,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\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getCrypto = exports.base64Encoder = exports.base64Decoder = exports.AMPLIFY_SYMBOL = exports.fetchAuthSession = exports.USER_AGENT_HEADER = exports.Reachability = exports.Mutex = exports.BackgroundProcessManager = exports.AmplifyErrorCode = 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.Signer = exports.isTokenExpired = exports.assertOAuthConfig = exports.assertIdentityPoolIdConfig = exports.assertTokenProviderConfig = exports.decodeJWT = exports.AmplifyUrlSearchParams = exports.AmplifyUrl = exports.amplifyUuid = exports.parseAWSExports = 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 = 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; } });\nvar parseAWSExports_1 = require(\"./parseAWSExports\");\nObject.defineProperty(exports, \"parseAWSExports\", { enumerable: true, get: function () { return parseAWSExports_1.parseAWSExports; } });\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; } });\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; } });\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_1 = require(\"./constants\");\nObject.defineProperty(exports, \"USER_AGENT_HEADER\", { enumerable: true, get: function () { return constants_1.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,SAAS,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,cAAc,GAAG,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,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,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,0BAA0B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AAI,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;;"}
@@ -7,12 +7,13 @@ exports.updateEndpoint = void 0;
7
7
  const amplifyUuid_1 = require("../../../utils/amplifyUuid");
8
8
  const getClientInfo_1 = require("../../../utils/getClientInfo");
9
9
  const pinpoint_1 = require("../../../awsClients/pinpoint");
10
- const utils_1 = require("../utils");
10
+ const cacheEndpointId_1 = require("../utils/cacheEndpointId");
11
+ const getEndpointId_1 = require("../utils/getEndpointId");
11
12
  /**
12
13
  * @internal
13
14
  */
14
15
  const updateEndpoint = async ({ address, appId, category, channelType, credentials, identityId, optOut, region, userAttributes, userId, userProfile, userAgentValue, }) => {
15
- const endpointId = await (0, utils_1.getEndpointId)(appId, category);
16
+ const endpointId = await (0, getEndpointId_1.getEndpointId)(appId, category);
16
17
  // only generate a new endpoint id if one was not found in cache
17
18
  const createdEndpointId = !endpointId ? (0, amplifyUuid_1.amplifyUuid)() : undefined;
18
19
  const { customProperties, demographic, email, location, metrics, name, plan, } = userProfile ?? {};
@@ -70,7 +71,7 @@ const updateEndpoint = async ({ address, appId, category, channelType, credentia
70
71
  await (0, pinpoint_1.updateEndpoint)({ credentials, region, userAgentValue }, input);
71
72
  // if we had to create an endpoint id, we need to now cache it
72
73
  if (!!createdEndpointId) {
73
- return (0, utils_1.cacheEndpointId)(appId, category, createdEndpointId);
74
+ return (0, cacheEndpointId_1.cacheEndpointId)(appId, category, createdEndpointId);
74
75
  }
75
76
  };
76
77
  exports.updateEndpoint = updateEndpoint;
@@ -1 +1 @@
1
- {"version":3,"file":"updateEndpoint.js","sources":["../../../../../src/providers/pinpoint/apis/updateEndpoint.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.updateEndpoint = void 0;\nconst amplifyUuid_1 = require(\"../../../utils/amplifyUuid\");\nconst getClientInfo_1 = require(\"../../../utils/getClientInfo\");\nconst pinpoint_1 = require(\"../../../awsClients/pinpoint\");\nconst utils_1 = require(\"../utils\");\n/**\n * @internal\n */\nconst updateEndpoint = async ({ address, appId, category, channelType, credentials, identityId, optOut, region, userAttributes, userId, userProfile, userAgentValue, }) => {\n const endpointId = await (0, utils_1.getEndpointId)(appId, category);\n // only generate a new endpoint id if one was not found in cache\n const createdEndpointId = !endpointId ? (0, amplifyUuid_1.amplifyUuid)() : undefined;\n const { customProperties, demographic, email, location, metrics, name, plan, } = userProfile ?? {};\n const clientInfo = (0, getClientInfo_1.getClientInfo)();\n const mergedDemographic = {\n appVersion: clientInfo.appVersion,\n make: clientInfo.make,\n model: clientInfo.model,\n modelVersion: clientInfo.version,\n platform: clientInfo.platform,\n ...demographic,\n };\n const shouldAddAttributes = email || customProperties || name || plan;\n const attributes = {\n ...(email && { email: [email] }),\n ...(name && { name: [name] }),\n ...(plan && { plan: [plan] }),\n ...customProperties,\n };\n const input = {\n ApplicationId: appId,\n EndpointId: endpointId ?? createdEndpointId,\n EndpointRequest: {\n RequestId: (0, amplifyUuid_1.amplifyUuid)(),\n EffectiveDate: new Date().toISOString(),\n ChannelType: channelType,\n Address: address,\n Attributes: shouldAddAttributes ? attributes : undefined,\n Demographic: {\n AppVersion: mergedDemographic.appVersion,\n Locale: mergedDemographic.locale,\n Make: mergedDemographic.make,\n Model: mergedDemographic.model,\n ModelVersion: mergedDemographic.modelVersion,\n Platform: mergedDemographic.platform,\n PlatformVersion: mergedDemographic.platformVersion,\n Timezone: mergedDemographic.timezone,\n },\n Location: {\n City: location?.city,\n Country: location?.country,\n Latitude: location?.latitude,\n Longitude: location?.longitude,\n PostalCode: location?.postalCode,\n Region: location?.region,\n },\n Metrics: metrics,\n OptOut: optOut,\n User: {\n UserId: userId ?? identityId,\n UserAttributes: userAttributes,\n },\n },\n };\n await (0, pinpoint_1.updateEndpoint)({ credentials, region, userAgentValue }, input);\n // if we had to create an endpoint id, we need to now cache it\n if (!!createdEndpointId) {\n return (0, utils_1.cacheEndpointId)(appId, category, createdEndpointId);\n }\n};\nexports.updateEndpoint = updateEndpoint;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC;AAChC,MAAM,aAAa,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAC5D,MAAM,eAAe,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAChE,MAAM,UAAU,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAC3D,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACpC;AACA;AACA;AACA,MAAM,cAAc,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,GAAG,KAAK;AAC3K,IAAI,MAAM,UAAU,GAAG,MAAM,IAAI,OAAO,CAAC,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AACzE;AACA,IAAI,MAAM,iBAAiB,GAAG,CAAC,UAAU,GAAG,IAAI,aAAa,CAAC,WAAW,GAAG,GAAG,SAAS,CAAC;AACzF,IAAI,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,GAAG,WAAW,IAAI,EAAE,CAAC;AAC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],"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.updateEndpoint = void 0;\nconst amplifyUuid_1 = require(\"../../../utils/amplifyUuid\");\nconst getClientInfo_1 = require(\"../../../utils/getClientInfo\");\nconst pinpoint_1 = require(\"../../../awsClients/pinpoint\");\nconst cacheEndpointId_1 = require(\"../utils/cacheEndpointId\");\nconst getEndpointId_1 = require(\"../utils/getEndpointId\");\n/**\n * @internal\n */\nconst updateEndpoint = async ({ address, appId, category, channelType, credentials, identityId, optOut, region, userAttributes, userId, userProfile, userAgentValue, }) => {\n const endpointId = await (0, getEndpointId_1.getEndpointId)(appId, category);\n // only generate a new endpoint id if one was not found in cache\n const createdEndpointId = !endpointId ? (0, amplifyUuid_1.amplifyUuid)() : undefined;\n const { customProperties, demographic, email, location, metrics, name, plan, } = userProfile ?? {};\n const clientInfo = (0, getClientInfo_1.getClientInfo)();\n const mergedDemographic = {\n appVersion: clientInfo.appVersion,\n make: clientInfo.make,\n model: clientInfo.model,\n modelVersion: clientInfo.version,\n platform: clientInfo.platform,\n ...demographic,\n };\n const shouldAddAttributes = email || customProperties || name || plan;\n const attributes = {\n ...(email && { email: [email] }),\n ...(name && { name: [name] }),\n ...(plan && { plan: [plan] }),\n ...customProperties,\n };\n const input = {\n ApplicationId: appId,\n EndpointId: endpointId ?? createdEndpointId,\n EndpointRequest: {\n RequestId: (0, amplifyUuid_1.amplifyUuid)(),\n EffectiveDate: new Date().toISOString(),\n ChannelType: channelType,\n Address: address,\n Attributes: shouldAddAttributes ? attributes : undefined,\n Demographic: {\n AppVersion: mergedDemographic.appVersion,\n Locale: mergedDemographic.locale,\n Make: mergedDemographic.make,\n Model: mergedDemographic.model,\n ModelVersion: mergedDemographic.modelVersion,\n Platform: mergedDemographic.platform,\n PlatformVersion: mergedDemographic.platformVersion,\n Timezone: mergedDemographic.timezone,\n },\n Location: {\n City: location?.city,\n Country: location?.country,\n Latitude: location?.latitude,\n Longitude: location?.longitude,\n PostalCode: location?.postalCode,\n Region: location?.region,\n },\n Metrics: metrics,\n OptOut: optOut,\n User: {\n UserId: userId ?? identityId,\n UserAttributes: userAttributes,\n },\n },\n };\n await (0, pinpoint_1.updateEndpoint)({ credentials, region, userAgentValue }, input);\n // if we had to create an endpoint id, we need to now cache it\n if (!!createdEndpointId) {\n return (0, cacheEndpointId_1.cacheEndpointId)(appId, category, createdEndpointId);\n }\n};\nexports.updateEndpoint = updateEndpoint;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC;AAChC,MAAM,aAAa,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAC5D,MAAM,eAAe,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAChE,MAAM,UAAU,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAC3D,MAAM,iBAAiB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAC9D,MAAM,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAC1D;AACA;AACA;AACA,MAAM,cAAc,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,GAAG,KAAK;AAC3K,IAAI,MAAM,UAAU,GAAG,MAAM,IAAI,eAAe,CAAC,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AACjF;AACA,IAAI,MAAM,iBAAiB,GAAG,CAAC,UAAU,GAAG,IAAI,aAAa,CAAC,WAAW,GAAG,GAAG,SAAS,CAAC;AACzF,IAAI,MAAM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AAK;AACL,CAAC,CAAC;AACF,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
@@ -4,7 +4,7 @@
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.cacheEndpointId = void 0;
7
- const __1 = require("../../..");
7
+ const Cache_1 = require("../../../Cache");
8
8
  const getCacheKey_1 = require("./getCacheKey");
9
9
  /**
10
10
  * Writes an endpoint id to a long-lived cache.
@@ -17,7 +17,7 @@ const cacheEndpointId = async (appId, category, endpointId) => {
17
17
  // Also set its priority to the highest to reduce its chance of being deleted when cache is full
18
18
  const ttl = 1000 * 60 * 60 * 24 * 365 * 100; // 100 years
19
19
  const expiration = new Date().getTime() + ttl;
20
- return __1.Cache.setItem(cacheKey, endpointId, {
20
+ return Cache_1.Cache.setItem(cacheKey, endpointId, {
21
21
  expires: expiration,
22
22
  priority: 1,
23
23
  });
@@ -1 +1 @@
1
- {"version":3,"file":"cacheEndpointId.js","sources":["../../../../../src/providers/pinpoint/utils/cacheEndpointId.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.cacheEndpointId = void 0;\nconst __1 = require(\"../../..\");\nconst getCacheKey_1 = require(\"./getCacheKey\");\n/**\n * Writes an endpoint id to a long-lived cache.\n *\n * @internal\n */\nconst cacheEndpointId = async (appId, category, endpointId) => {\n const cacheKey = (0, getCacheKey_1.getCacheKey)(appId, category);\n // Set a longer TTL to avoid endpoint id being deleted after the default TTL (3 days)\n // Also set its priority to the highest to reduce its chance of being deleted when cache is full\n const ttl = 1000 * 60 * 60 * 24 * 365 * 100; // 100 years\n const expiration = new Date().getTime() + ttl;\n return __1.Cache.setItem(cacheKey, endpointId, {\n expires: expiration,\n priority: 1,\n });\n};\nexports.cacheEndpointId = cacheEndpointId;\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,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAChC,MAAM,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA,MAAM,eAAe,GAAG,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,KAAK;AAC/D,IAAI,MAAM,QAAQ,GAAG,IAAI,aAAa,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AACrE;AACA;AACA,IAAI,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,CAAC;AAChD,IAAI,MAAM,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC;AAClD,IAAI,OAAO,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAU,EAAE;AACnD,QAAQ,OAAO,EAAE,UAAU;AAC3B,QAAQ,QAAQ,EAAE,CAAC;AACnB,KAAK,CAAC,CAAC;AACP,CAAC,CAAC;AACF,OAAO,CAAC,eAAe,GAAG,eAAe;;"}
1
+ {"version":3,"file":"cacheEndpointId.js","sources":["../../../../../src/providers/pinpoint/utils/cacheEndpointId.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.cacheEndpointId = void 0;\nconst Cache_1 = require(\"../../../Cache\");\nconst getCacheKey_1 = require(\"./getCacheKey\");\n/**\n * Writes an endpoint id to a long-lived cache.\n *\n * @internal\n */\nconst cacheEndpointId = async (appId, category, endpointId) => {\n const cacheKey = (0, getCacheKey_1.getCacheKey)(appId, category);\n // Set a longer TTL to avoid endpoint id being deleted after the default TTL (3 days)\n // Also set its priority to the highest to reduce its chance of being deleted when cache is full\n const ttl = 1000 * 60 * 60 * 24 * 365 * 100; // 100 years\n const expiration = new Date().getTime() + ttl;\n return Cache_1.Cache.setItem(cacheKey, endpointId, {\n expires: expiration,\n priority: 1,\n });\n};\nexports.cacheEndpointId = cacheEndpointId;\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,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC1C,MAAM,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA,MAAM,eAAe,GAAG,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,KAAK;AAC/D,IAAI,MAAM,QAAQ,GAAG,IAAI,aAAa,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AACrE;AACA;AACA,IAAI,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,CAAC;AAChD,IAAI,MAAM,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC;AAClD,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAU,EAAE;AACvD,QAAQ,OAAO,EAAE,UAAU;AAC3B,QAAQ,QAAQ,EAAE,CAAC;AACnB,KAAK,CAAC,CAAC;AACP,CAAC,CAAC;AACF,OAAO,CAAC,eAAe,GAAG,eAAe;;"}
@@ -4,7 +4,7 @@
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getEndpointId = void 0;
7
- const __1 = require("../../..");
7
+ const Cache_1 = require("../../../Cache");
8
8
  const getCacheKey_1 = require("./getCacheKey");
9
9
  /**
10
10
  * Returns an endpoint id from cache or `undefined` if not found.
@@ -13,7 +13,7 @@ const getCacheKey_1 = require("./getCacheKey");
13
13
  */
14
14
  const getEndpointId = async (appId, category) => {
15
15
  const cacheKey = (0, getCacheKey_1.getCacheKey)(appId, category);
16
- const cachedEndpointId = await __1.Cache.getItem(cacheKey);
16
+ const cachedEndpointId = await Cache_1.Cache.getItem(cacheKey);
17
17
  return cachedEndpointId ?? undefined;
18
18
  };
19
19
  exports.getEndpointId = getEndpointId;
@@ -1 +1 @@
1
- {"version":3,"file":"getEndpointId.js","sources":["../../../../../src/providers/pinpoint/utils/getEndpointId.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.getEndpointId = void 0;\nconst __1 = require(\"../../..\");\nconst getCacheKey_1 = require(\"./getCacheKey\");\n/**\n * Returns an endpoint id from cache or `undefined` if not found.\n *\n * @internal\n */\nconst getEndpointId = async (appId, category) => {\n const cacheKey = (0, getCacheKey_1.getCacheKey)(appId, category);\n const cachedEndpointId = await __1.Cache.getItem(cacheKey);\n return cachedEndpointId ?? undefined;\n};\nexports.getEndpointId = getEndpointId;\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,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAChC,MAAM,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,OAAO,KAAK,EAAE,QAAQ,KAAK;AACjD,IAAI,MAAM,QAAQ,GAAG,IAAI,aAAa,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AACrE,IAAI,MAAM,gBAAgB,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC/D,IAAI,OAAO,gBAAgB,IAAI,SAAS,CAAC;AACzC,CAAC,CAAC;AACF,OAAO,CAAC,aAAa,GAAG,aAAa;;"}
1
+ {"version":3,"file":"getEndpointId.js","sources":["../../../../../src/providers/pinpoint/utils/getEndpointId.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.getEndpointId = void 0;\nconst Cache_1 = require(\"../../../Cache\");\nconst getCacheKey_1 = require(\"./getCacheKey\");\n/**\n * Returns an endpoint id from cache or `undefined` if not found.\n *\n * @internal\n */\nconst getEndpointId = async (appId, category) => {\n const cacheKey = (0, getCacheKey_1.getCacheKey)(appId, category);\n const cachedEndpointId = await Cache_1.Cache.getItem(cacheKey);\n return cachedEndpointId ?? undefined;\n};\nexports.getEndpointId = getEndpointId;\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,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC1C,MAAM,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,OAAO,KAAK,EAAE,QAAQ,KAAK;AACjD,IAAI,MAAM,QAAQ,GAAG,IAAI,aAAa,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AACrE,IAAI,MAAM,gBAAgB,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AACnE,IAAI,OAAO,gBAAgB,IAAI,SAAS,CAAC;AACzC,CAAC,CAAC;AACF,OAAO,CAAC,aAAa,GAAG,aAAa;;"}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.resolveEndpointId = void 0;
7
7
  const errors_1 = require("../../../errors");
8
8
  const types_1 = require("../../../types");
9
- const apis_1 = require("../apis");
9
+ const updateEndpoint_1 = require("../apis/updateEndpoint");
10
10
  const getEndpointId_1 = require("./getEndpointId");
11
11
  /**
12
12
  * Resolves an endpoint id from cache or prepare via updateEndpoint if one does not already exist,
@@ -17,7 +17,7 @@ const getEndpointId_1 = require("./getEndpointId");
17
17
  const resolveEndpointId = async ({ address, appId, category, channelType, credentials, identityId, region, userAgentValue, }) => {
18
18
  let endpointId = await (0, getEndpointId_1.getEndpointId)(appId, category);
19
19
  if (!endpointId) {
20
- await (0, apis_1.updateEndpoint)({
20
+ await (0, updateEndpoint_1.updateEndpoint)({
21
21
  address,
22
22
  appId,
23
23
  category,
@@ -1 +1 @@
1
- {"version":3,"file":"resolveEndpointId.js","sources":["../../../../../src/providers/pinpoint/utils/resolveEndpointId.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.resolveEndpointId = void 0;\nconst errors_1 = require(\"../../../errors\");\nconst types_1 = require(\"../../../types\");\nconst apis_1 = require(\"../apis\");\nconst getEndpointId_1 = require(\"./getEndpointId\");\n/**\n * Resolves an endpoint id from cache or prepare via updateEndpoint if one does not already exist,\n * which will generate and cache an endpoint id between calls.\n *\n * @internal\n */\nconst resolveEndpointId = async ({ address, appId, category, channelType, credentials, identityId, region, userAgentValue, }) => {\n let endpointId = await (0, getEndpointId_1.getEndpointId)(appId, category);\n if (!endpointId) {\n await (0, apis_1.updateEndpoint)({\n address,\n appId,\n category,\n channelType,\n credentials,\n identityId,\n region,\n userAgentValue,\n });\n endpointId = await (0, getEndpointId_1.getEndpointId)(appId, category);\n }\n (0, errors_1.assert)(!!endpointId, types_1.AmplifyErrorCode.NoEndpointId);\n return endpointId;\n};\nexports.resolveEndpointId = resolveEndpointId;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,iBAAiB,GAAG,KAAK,CAAC,CAAC;AACnC,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC1C,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,iBAAiB,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,GAAG,KAAK;AACjI,IAAI,IAAI,UAAU,GAAG,MAAM,IAAI,eAAe,CAAC,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC/E,IAAI,IAAI,CAAC,UAAU,EAAE;AACrB,QAAQ,MAAM,IAAI,MAAM,CAAC,cAAc,EAAE;AACzC,YAAY,OAAO;AACnB,YAAY,KAAK;AACjB,YAAY,QAAQ;AACpB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB,YAAY,UAAU;AACtB,YAAY,MAAM;AAClB,YAAY,cAAc;AAC1B,SAAS,CAAC,CAAC;AACX,QAAQ,UAAU,GAAG,MAAM,IAAI,eAAe,CAAC,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC/E,KAAK;AACL,IAAI,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;AAC9E,IAAI,OAAO,UAAU,CAAC;AACtB,CAAC,CAAC;AACF,OAAO,CAAC,iBAAiB,GAAG,iBAAiB;;"}
1
+ {"version":3,"file":"resolveEndpointId.js","sources":["../../../../../src/providers/pinpoint/utils/resolveEndpointId.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.resolveEndpointId = void 0;\nconst errors_1 = require(\"../../../errors\");\nconst types_1 = require(\"../../../types\");\nconst updateEndpoint_1 = require(\"../apis/updateEndpoint\");\nconst getEndpointId_1 = require(\"./getEndpointId\");\n/**\n * Resolves an endpoint id from cache or prepare via updateEndpoint if one does not already exist,\n * which will generate and cache an endpoint id between calls.\n *\n * @internal\n */\nconst resolveEndpointId = async ({ address, appId, category, channelType, credentials, identityId, region, userAgentValue, }) => {\n let endpointId = await (0, getEndpointId_1.getEndpointId)(appId, category);\n if (!endpointId) {\n await (0, updateEndpoint_1.updateEndpoint)({\n address,\n appId,\n category,\n channelType,\n credentials,\n identityId,\n region,\n userAgentValue,\n });\n endpointId = await (0, getEndpointId_1.getEndpointId)(appId, category);\n }\n (0, errors_1.assert)(!!endpointId, types_1.AmplifyErrorCode.NoEndpointId);\n return endpointId;\n};\nexports.resolveEndpointId = resolveEndpointId;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,iBAAiB,GAAG,KAAK,CAAC,CAAC;AACnC,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC1C,MAAM,gBAAgB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAC3D,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,iBAAiB,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,GAAG,KAAK;AACjI,IAAI,IAAI,UAAU,GAAG,MAAM,IAAI,eAAe,CAAC,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC/E,IAAI,IAAI,CAAC,UAAU,EAAE;AACrB,QAAQ,MAAM,IAAI,gBAAgB,CAAC,cAAc,EAAE;AACnD,YAAY,OAAO;AACnB,YAAY,KAAK;AACjB,YAAY,QAAQ;AACpB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB,YAAY,UAAU;AACtB,YAAY,MAAM;AAClB,YAAY,cAAc;AAC1B,SAAS,CAAC,CAAC;AACX,QAAQ,UAAU,GAAG,MAAM,IAAI,eAAe,CAAC,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC/E,KAAK;AACL,IAAI,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;AAC9E,IAAI,OAAO,UAAU,CAAC;AACtB,CAAC,CAAC;AACF,OAAO,CAAC,iBAAiB,GAAG,iBAAiB;;"}
@@ -6,8 +6,8 @@ import '../errors/errorHelpers.mjs';
6
6
 
7
7
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
8
8
  // SPDX-License-Identifier: Apache-2.0
9
- const AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'
10
- ? Symbol.for('amplify_default')
9
+ const AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined'
10
+ ? Symbol('amplify_default')
11
11
  : '@@amplify_default');
12
12
  const logger = new ConsoleLogger('Hub');
13
13
  class HubClass {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/Hub/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ConsoleLogger as Logger } from '../Logger';\nimport { NO_HUBCALLBACK_PROVIDED_EXCEPTION } from '../constants';\nimport { AmplifyError } from '../errors';\nexport const AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'\n ? Symbol.for('amplify_default')\n : '@@amplify_default');\nconst logger = new Logger('Hub');\nexport class HubClass {\n constructor(name) {\n this.listeners = new Map();\n this.protectedChannels = [\n 'core',\n 'auth',\n 'api',\n 'analytics',\n 'interactions',\n 'pubsub',\n 'storage',\n 'ui',\n 'xr',\n ];\n this.name = name;\n }\n /**\n * Used internally to remove a Hub listener.\n *\n * @remarks\n * This private method is for internal use only. Instead of calling Hub.remove, call the result of Hub.listen.\n */\n _remove(channel, listener) {\n const holder = this.listeners.get(channel);\n if (!holder) {\n logger.warn(`No listeners for ${channel}`);\n return;\n }\n this.listeners.set(channel, [\n ...holder.filter(({ callback }) => callback !== listener),\n ]);\n }\n dispatch(channel, payload, source, ampSymbol) {\n if (typeof channel === 'string' &&\n this.protectedChannels.indexOf(channel) > -1) {\n const hasAccess = ampSymbol === AMPLIFY_SYMBOL;\n if (!hasAccess) {\n logger.warn(`WARNING: ${channel} is protected and dispatching on it can have unintended consequences`);\n }\n }\n const capsule = {\n channel,\n payload: { ...payload },\n source,\n patternInfo: [],\n };\n try {\n this._toListeners(capsule);\n }\n catch (e) {\n logger.error(e);\n }\n }\n listen(channel, callback, listenerName = 'noname') {\n let cb;\n if (typeof callback !== 'function') {\n throw new AmplifyError({\n name: NO_HUBCALLBACK_PROVIDED_EXCEPTION,\n message: 'No callback supplied to Hub',\n });\n }\n else {\n // Needs to be casted as a more generic type\n cb = callback;\n }\n let holder = this.listeners.get(channel);\n if (!holder) {\n holder = [];\n this.listeners.set(channel, holder);\n }\n holder.push({\n name: listenerName,\n callback: cb,\n });\n return () => {\n this._remove(channel, cb);\n };\n }\n _toListeners(capsule) {\n const { channel, payload } = capsule;\n const holder = this.listeners.get(channel);\n if (holder) {\n holder.forEach(listener => {\n logger.debug(`Dispatching to ${channel} with `, payload);\n try {\n listener.callback(capsule);\n }\n catch (e) {\n logger.error(e);\n }\n });\n }\n }\n}\n/*We export a __default__ instance of HubClass to use it as a\npseudo Singleton for the main messaging bus, however you can still create\nyour own instance of HubClass() for a separate \"private bus\" of events.*/\nexport const Hub = new HubClass('__default__');\n/**\n * @internal\n *\n * Internal hub used for core Amplify functionality. Not intended for use outside of Amplify.\n *\n */\nexport const HubInternal = new HubClass('internal-hub');\n"],"names":["Logger"],"mappings":";;;;;;AAAA;AACA;AAIY,MAAC,cAAc,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,UAAU;AAChG,MAAM,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC;AACnC,MAAM,mBAAmB,EAAE;AAC3B,MAAM,MAAM,GAAG,IAAIA,aAAM,CAAC,KAAK,CAAC,CAAC;AAC1B,MAAM,QAAQ,CAAC;AACtB,IAAI,WAAW,CAAC,IAAI,EAAE;AACtB,QAAQ,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;AACnC,QAAQ,IAAI,CAAC,iBAAiB,GAAG;AACjC,YAAY,MAAM;AAClB,YAAY,MAAM;AAClB,YAAY,KAAK;AACjB,YAAY,WAAW;AACvB,YAAY,cAAc;AAC1B,YAAY,QAAQ;AACpB,YAAY,SAAS;AACrB,YAAY,IAAI;AAChB,YAAY,IAAI;AAChB,SAAS,CAAC;AACV,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI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AAC,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;AACzE,gBAAgB,IAAI;AACpB,oBAAoB,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC/C,iBAAiB;AACjB,gBAAgB,OAAO,CAAC,EAAE;AAC1B,oBAAoB,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpC,iBAAiB;AACjB,aAAa,CAAC,CAAC;AACf,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACY,MAAC,GAAG,GAAG,IAAI,QAAQ,CAAC,aAAa,EAAE;AAC/C;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,WAAW,GAAG,IAAI,QAAQ,CAAC,cAAc;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../src/Hub/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ConsoleLogger as Logger } from '../Logger';\nimport { NO_HUBCALLBACK_PROVIDED_EXCEPTION } from '../constants';\nimport { AmplifyError } from '../errors';\nexport const AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined'\n ? Symbol('amplify_default')\n : '@@amplify_default');\nconst logger = new Logger('Hub');\nexport class HubClass {\n constructor(name) {\n this.listeners = new Map();\n this.protectedChannels = [\n 'core',\n 'auth',\n 'api',\n 'analytics',\n 'interactions',\n 'pubsub',\n 'storage',\n 'ui',\n 'xr',\n ];\n this.name = name;\n }\n /**\n * Used internally to remove a Hub listener.\n *\n * @remarks\n * This private method is for internal use only. Instead of calling Hub.remove, call the result of Hub.listen.\n */\n _remove(channel, listener) {\n const holder = this.listeners.get(channel);\n if (!holder) {\n logger.warn(`No listeners for ${channel}`);\n return;\n }\n this.listeners.set(channel, [\n ...holder.filter(({ callback }) => callback !== listener),\n ]);\n }\n dispatch(channel, payload, source, ampSymbol) {\n if (typeof channel === 'string' &&\n this.protectedChannels.indexOf(channel) > -1) {\n const hasAccess = ampSymbol === AMPLIFY_SYMBOL;\n if (!hasAccess) {\n logger.warn(`WARNING: ${channel} is protected and dispatching on it can have unintended consequences`);\n }\n }\n const capsule = {\n channel,\n payload: { ...payload },\n source,\n patternInfo: [],\n };\n try {\n this._toListeners(capsule);\n }\n catch (e) {\n logger.error(e);\n }\n }\n listen(channel, callback, listenerName = 'noname') {\n let cb;\n if (typeof callback !== 'function') {\n throw new AmplifyError({\n name: NO_HUBCALLBACK_PROVIDED_EXCEPTION,\n message: 'No callback supplied to Hub',\n });\n }\n else {\n // Needs to be casted as a more generic type\n cb = callback;\n }\n let holder = this.listeners.get(channel);\n if (!holder) {\n holder = [];\n this.listeners.set(channel, holder);\n }\n holder.push({\n name: listenerName,\n callback: cb,\n });\n return () => {\n this._remove(channel, cb);\n };\n }\n _toListeners(capsule) {\n const { channel, payload } = capsule;\n const holder = this.listeners.get(channel);\n if (holder) {\n holder.forEach(listener => {\n logger.debug(`Dispatching to ${channel} with `, payload);\n try {\n listener.callback(capsule);\n }\n catch (e) {\n logger.error(e);\n }\n });\n }\n }\n}\n/*We export a __default__ instance of HubClass to use it as a\npseudo Singleton for the main messaging bus, however you can still create\nyour own instance of HubClass() for a separate \"private bus\" of events.*/\nexport const Hub = new HubClass('__default__');\n/**\n * @internal\n *\n * Internal hub used for core Amplify functionality. Not intended for use outside of Amplify.\n *\n */\nexport const HubInternal = new HubClass('internal-hub');\n"],"names":["Logger"],"mappings":";;;;;;AAAA;AACA;AAIY,MAAC,cAAc,IAAI,OAAO,MAAM,KAAK,WAAW;AAC5D,MAAM,MAAM,CAAC,iBAAiB,CAAC;AAC/B,MAAM,mBAAmB,EAAE;AAC3B,MAAM,MAAM,GAAG,IAAIA,aAAM,CAAC,KAAK,CAAC,CAAC;AAC1B,MAAM,QAAQ,CAAC;AACtB,IAAI,WAAW,CAAC,IAAI,EAAE;AACtB,QAAQ,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;AACnC,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M,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;AAC7C,QAAQ,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACnD,QAAQ,IAAI,MAAM,EAAE;AACpB,YAAY,MAAM,CAAC,OAAO,CAAC,QAAQ,IAAI;AACvC,gBAAgB,MAAM,CAAC,KAAK,CAAC,CAAC,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;AACzE,gBAAgB,IAAI;AACpB,oBAAoB,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC/C,iBAAiB;AACjB,gBAAgB,OAAO,CAAC,EAAE;AAC1B,oBAAoB,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpC,iBAAiB;AACjB,aAAa,CAAC,CAAC;AACf,SAAS;AACT,KAAK;AACL,CAAC;AACD;AACA;AACA;AACY,MAAC,GAAG,GAAG,IAAI,QAAQ,CAAC,aAAa,EAAE;AAC/C;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,WAAW,GAAG,IAAI,QAAQ,CAAC,cAAc;;;;"}
@@ -1 +1 @@
1
- export declare const version = "6.0.1-mjs-test.6f5dab7.0+6f5dab7";
1
+ export declare const version = "6.0.1-mjs-test.fc9412c.0+fc9412c";
@@ -1,5 +1,5 @@
1
1
  // generated by genversion
2
- const version = '6.0.1-mjs-test.6f5dab7.0+6f5dab7';
2
+ const version = '6.0.1-mjs-test.fc9412c.0+fc9412c';
3
3
 
4
4
  export { version };
5
5
  //# sourceMappingURL=version.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sources":["../../../src/Platform/version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '6.0.1-mjs-test.6f5dab7.0+6f5dab7';\n"],"names":[],"mappings":"AAAA;AACY,MAAC,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"version.mjs","sources":["../../../src/Platform/version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '6.0.1-mjs-test.fc9412c.0+fc9412c';\n"],"names":[],"mappings":"AAAA;AACY,MAAC,OAAO,GAAG;;;;"}
@@ -1,19 +1,7 @@
1
1
  import { from, Observable } from 'rxjs';
2
- import '../types/errors.mjs';
3
- import '../errors/errorHelpers.mjs';
4
2
  import '../utils/getClientInfo/getClientInfo.mjs';
5
3
  import { isWebWorker } from '../utils/isWebWorker.mjs';
6
4
  import '../utils/retry/retry.mjs';
7
- import '../parseAWSExports.mjs';
8
- import 'uuid';
9
- import '../singleton/Auth/utils/errorHelpers.mjs';
10
- import '@aws-crypto/sha256-js';
11
- import '@smithy/util-hex-encoding';
12
- import '../Platform/types.mjs';
13
- import '../Platform/detection/index.mjs';
14
- import '../BackgroundProcessManager/types.mjs';
15
- import '../Hub/index.mjs';
16
- import '../utils/sessionListener/index.mjs';
17
5
 
18
6
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
19
7
  // SPDX-License-Identifier: Apache-2.0
@@ -1 +1 @@
1
- {"version":3,"file":"Reachability.mjs","sources":["../../../src/Reachability/Reachability.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Observable, from } from 'rxjs';\nimport { isWebWorker } from '../libraryUtils';\nclass Reachability {\n networkMonitor(_) {\n const globalObj = isWebWorker()\n ? self\n : typeof window !== 'undefined' && window;\n if (!globalObj) {\n return from([{ online: true }]);\n }\n return new Observable(observer => {\n observer.next({ online: globalObj.navigator.onLine });\n const notifyOnline = () => observer.next({ online: true });\n const notifyOffline = () => observer.next({ online: false });\n globalObj.addEventListener('online', notifyOnline);\n globalObj.addEventListener('offline', notifyOffline);\n Reachability._observers.push(observer);\n return () => {\n globalObj.removeEventListener('online', notifyOnline);\n globalObj.removeEventListener('offline', notifyOffline);\n Reachability._observers = Reachability._observers.filter(_observer => _observer !== observer);\n };\n });\n }\n // expose observers to simulate offline mode for integration testing\n static _observerOverride(status) {\n for (const observer of this._observers) {\n if (observer.closed) {\n this._observers = this._observers.filter(_observer => _observer !== observer);\n continue;\n }\n observer?.next && observer.next(status);\n }\n }\n}\nReachability._observers = [];\nexport { Reachability };\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AAGA,MAAM,YAAY,CAAC;AACnB,IAAI,cAAc,CAAC,CAAC,EAAE;AACtB,QAAQ,MAAM,SAAS,GAAG,WAAW,EAAE;AACvC,cAAc,IAAI;AAClB,cAAc,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC;AACtD,QAAQ,IAAI,CAAC,SAAS,EAAE;AACxB,YAAY,OAAO,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC5C,SAAS;AACT,QAAQ,OAAO,IAAI,UAAU,CAAC,QAAQ,IAAI;AAC1C,YAAY,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;AAClE,YAAY,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AACvE,YAAY,MAAM,aAAa,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;AACzE,YAAY,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AAC/D,YAAY,SAAS,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AACjE,YAAY,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACnD,YAAY,OAAO,MAAM;AACzB,gBAAgB,SAAS,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AACtE,gBAAgB,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AACxE,gBAAgB,YAAY,CAAC,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,IAAI,SAAS,KAAK,QAAQ,CAAC,CAAC;AAC9G,aAAa,CAAC;AACd,SAAS,CAAC,CAAC;AACX,KAAK;AACL;AACA,IAAI,OAAO,iBAAiB,CAAC,MAAM,EAAE;AACrC,QAAQ,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE;AAChD,YAAY,IAAI,QAAQ,CAAC,MAAM,EAAE;AACjC,gBAAgB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,IAAI,SAAS,KAAK,QAAQ,CAAC,CAAC;AAC9F,gBAAgB,SAAS;AACzB,aAAa;AACb,YAAY,QAAQ,EAAE,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACpD,SAAS;AACT,KAAK;AACL,CAAC;AACD,YAAY,CAAC,UAAU,GAAG,EAAE;;;;"}
1
+ {"version":3,"file":"Reachability.mjs","sources":["../../../src/Reachability/Reachability.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Observable, from } from 'rxjs';\nimport { isWebWorker } from '../utils';\nclass Reachability {\n networkMonitor(_) {\n const globalObj = isWebWorker()\n ? self\n : typeof window !== 'undefined' && window;\n if (!globalObj) {\n return from([{ online: true }]);\n }\n return new Observable(observer => {\n observer.next({ online: globalObj.navigator.onLine });\n const notifyOnline = () => observer.next({ online: true });\n const notifyOffline = () => observer.next({ online: false });\n globalObj.addEventListener('online', notifyOnline);\n globalObj.addEventListener('offline', notifyOffline);\n Reachability._observers.push(observer);\n return () => {\n globalObj.removeEventListener('online', notifyOnline);\n globalObj.removeEventListener('offline', notifyOffline);\n Reachability._observers = Reachability._observers.filter(_observer => _observer !== observer);\n };\n });\n }\n // expose observers to simulate offline mode for integration testing\n static _observerOverride(status) {\n for (const observer of this._observers) {\n if (observer.closed) {\n this._observers = this._observers.filter(_observer => _observer !== observer);\n continue;\n }\n observer?.next && observer.next(status);\n }\n }\n}\nReachability._observers = [];\nexport { Reachability };\n"],"names":[],"mappings":";;;;;AAAA;AACA;AAGA,MAAM,YAAY,CAAC;AACnB,IAAI,cAAc,CAAC,CAAC,EAAE;AACtB,QAAQ,MAAM,SAAS,GAAG,WAAW,EAAE;AACvC,cAAc,IAAI;AAClB,cAAc,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC;AACtD,QAAQ,IAAI,CAAC,SAAS,EAAE;AACxB,YAAY,OAAO,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC5C,SAAS;AACT,QAAQ,OAAO,IAAI,UAAU,CAAC,QAAQ,IAAI;AAC1C,YAAY,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;AAClE,YAAY,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AACvE,YAAY,MAAM,aAAa,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;AACzE,YAAY,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AAC/D,YAAY,SAAS,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AACjE,YAAY,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACnD,YAAY,OAAO,MAAM;AACzB,gBAAgB,SAAS,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AACtE,gBAAgB,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;AACxE,gBAAgB,YAAY,CAAC,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,IAAI,SAAS,KAAK,QAAQ,CAAC,CAAC;AAC9G,aAAa,CAAC;AACd,SAAS,CAAC,CAAC;AACX,KAAK;AACL;AACA,IAAI,OAAO,iBAAiB,CAAC,MAAM,EAAE;AACrC,QAAQ,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE;AAChD,YAAY,IAAI,QAAQ,CAAC,MAAM,EAAE;AACjC,gBAAgB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,IAAI,SAAS,KAAK,QAAQ,CAAC,CAAC;AAC9F,gBAAgB,SAAS;AACzB,aAAa;AACb,YAAY,QAAQ,EAAE,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACpD,SAAS;AACT,KAAK;AACL,CAAC;AACD,YAAY,CAAC,UAAU,GAAG,EAAE;;;;"}
@@ -11,16 +11,12 @@ import '@aws-crypto/sha256-js';
11
11
  import '@smithy/util-hex-encoding';
12
12
  import '../awsClients/pinpoint/base.mjs';
13
13
  import '../awsClients/pinpoint/errorHelpers.mjs';
14
- import '../Hub/index.mjs';
15
- import { Amplify } from '../singleton/Amplify.mjs';
16
- import { fetchAuthSession } from '../singleton/apis/fetchAuthSession.mjs';
17
- import '../awsClients/cognitoIdentity/base.mjs';
18
- import '../storage/index.mjs';
19
14
  import '../Cache/index.mjs';
20
- import '../I18n/index.mjs';
21
15
  import { record } from '../providers/pinpoint/apis/record.mjs';
22
16
  import '../providers/pinpoint/utils/PinpointEventBuffer.mjs';
23
17
  import '../providers/pinpoint/types/errors.mjs';
18
+ import { Amplify } from '../singleton/Amplify.mjs';
19
+ import { fetchAuthSession } from '../singleton/apis/fetchAuthSession.mjs';
24
20
 
25
21
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
26
22
  // SPDX-License-Identifier: Apache-2.0
@@ -1 +1 @@
1
- {"version":3,"file":"ServiceWorker.mjs","sources":["../../../src/ServiceWorker/ServiceWorker.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ConsoleLogger as Logger } from '../Logger';\nimport { isBrowser } from '../utils';\nimport { AmplifyError } from '../errors';\nimport { assert, ServiceWorkerErrorCode } from './errorHelpers';\nimport { record } from '../providers/pinpoint';\nimport { Amplify, fetchAuthSession } from '../singleton';\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 */\nexport class ServiceWorkerClass {\n constructor() {\n // The AWS Amplify logger\n this._logger = new Logger('ServiceWorker');\n }\n /**\n * Get the currently active service worker\n */\n get serviceWorker() {\n assert(this._serviceWorker !== undefined, 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 return resolve(registration);\n })\n .catch(error => {\n this._logger.debug(`Service Worker Registration Failed ${error}`);\n return reject(new AmplifyError({\n name: ServiceWorkerErrorCode.Unavailable,\n message: 'Service Worker not available',\n underlyingError: error,\n }));\n });\n }\n else {\n return reject(new AmplifyError({\n name: 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 assert(this._registration !== undefined, ServiceWorkerErrorCode.UndefinedRegistration);\n this._publicKey = publicKey;\n return new Promise((resolve, reject) => {\n if (isBrowser()) {\n assert(this._registration !== undefined, 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(subscription => {\n this._subscription = subscription;\n this._logger.debug(`User subscribed: ${JSON.stringify(subscription)}`);\n resolve(subscription);\n })\n .catch(error => {\n this._logger.error(error);\n });\n }\n });\n }\n else {\n return reject(new AmplifyError({\n name: 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 (event) => {\n const currentState = this.serviceWorker.state;\n this._logger.debug(`ServiceWorker statechange: ${currentState}`);\n const { appId, region } = Amplify.getConfig().Analytics?.Pinpoint ?? {};\n const { credentials } = await fetchAuthSession();\n if (appId && region && credentials) {\n // Pinpoint is configured, record an event\n record({\n appId,\n region,\n category: 'Core',\n credentials,\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}\n"],"names":["Logger"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAkB,CAAC;AAChC,IAAI,WAAW,GAAG;AAClB;AACA,QAAQ,IAAI,CAAC,OAAO,GAAG,IAAIA,aAAM,CAAC,eAAe,CAAC,CAAC;AACnD,KAAK;AACL;AACA;AACA;AACA,IAAI,IAAI,aAAa,GAAG;AACx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AAE,OAAO,KAAK,KAAK;AAC5E,YAAY,MAAM,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;AAC1D,YAAY,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,2BAA2B,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;AAC7E,YAAY,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,QAAQ,IAAI,EAAE,CAAC;AACpF,YAAY,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,gBAAgB,EAAE,CAAC;AAC7D,YAAY,IAAI,KAAK,IAAI,MAAM,IAAI,WAAW,EAAE;AAChD;AACA,gBAAgB,MAAM,CAAC;AACvB,oBAAoB,KAAK;AACzB,oBAAoB,MAAM;AAC1B,oBAAoB,QAAQ,EAAE,MAAM;AACpC,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;;;;"}
1
+ {"version":3,"file":"ServiceWorker.mjs","sources":["../../../src/ServiceWorker/ServiceWorker.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ConsoleLogger as Logger } from '../Logger';\nimport { isBrowser } from '../utils';\nimport { AmplifyError } from '../errors';\nimport { assert, ServiceWorkerErrorCode } from './errorHelpers';\nimport { record } from '../providers/pinpoint';\nimport { Amplify, fetchAuthSession } from '../singleton';\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 */\nexport class ServiceWorkerClass {\n constructor() {\n // The AWS Amplify logger\n this._logger = new Logger('ServiceWorker');\n }\n /**\n * Get the currently active service worker\n */\n get serviceWorker() {\n assert(this._serviceWorker !== undefined, 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 return resolve(registration);\n })\n .catch(error => {\n this._logger.debug(`Service Worker Registration Failed ${error}`);\n return reject(new AmplifyError({\n name: ServiceWorkerErrorCode.Unavailable,\n message: 'Service Worker not available',\n underlyingError: error,\n }));\n });\n }\n else {\n return reject(new AmplifyError({\n name: 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 assert(this._registration !== undefined, ServiceWorkerErrorCode.UndefinedRegistration);\n this._publicKey = publicKey;\n return new Promise((resolve, reject) => {\n if (isBrowser()) {\n assert(this._registration !== undefined, 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(subscription => {\n this._subscription = subscription;\n this._logger.debug(`User subscribed: ${JSON.stringify(subscription)}`);\n resolve(subscription);\n })\n .catch(error => {\n this._logger.error(error);\n });\n }\n });\n }\n else {\n return reject(new AmplifyError({\n name: 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 (event) => {\n const currentState = this.serviceWorker.state;\n this._logger.debug(`ServiceWorker statechange: ${currentState}`);\n const { appId, region } = Amplify.getConfig().Analytics?.Pinpoint ?? {};\n const { credentials } = await fetchAuthSession();\n if (appId && region && credentials) {\n // Pinpoint is configured, record an event\n record({\n appId,\n region,\n category: 'Core',\n credentials,\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}\n"],"names":["Logger"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAkB,CAAC;AAChC,IAAI,WAAW,GAAG;AAClB;AACA,QAAQ,IAAI,CAAC,OAAO,GAAG,IAAIA,aAAM,CAAC,eAAe,CAAC,CAAC;AACnD,KAAK;AACL;AACA;AACA;AACA,IAAI,IAAI,aAAa,GAAG;AACxB,QAAQ,MAAM,CAAC,IAAI,CAAC,cAAc,KAAK,SAAS,EAAE,sBAAsB,CAAC,iBAAiB,CAAC,CAAC;AAC5F,QAAQ,OAAO,IAAI,CAAC,cAAc,CAAC;AACnC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,QAAQ,CAAC,QAAQ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E,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,QAAQ,IAAI,EAAE,CAAC;AACpF,YAAY,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,gBAAgB,EAAE,CAAC;AAC7D,YAAY,IAAI,KAAK,IAAI,MAAM,IAAI,WAAW,EAAE;AAChD;AACA,gBAAgB,MAAM,CAAC;AACvB,oBAAoB,KAAK;AACzB,oBAAoB,MAAM;AAC1B,oBAAoB,QAAQ,EAAE,MAAM;AACpC,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;;;;"}
@@ -1,4 +1,3 @@
1
1
  export declare const AWS_CLOUDWATCH_CATEGORY = "Logging";
2
- export declare const INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER: string | symbol;
3
2
  export declare const USER_AGENT_HEADER = "x-amz-user-agent";
4
3
  export declare const NO_HUBCALLBACK_PROVIDED_EXCEPTION = "NoHubcallbackProvidedException";
@@ -2,17 +2,9 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  // Logging constants
4
4
  const AWS_CLOUDWATCH_CATEGORY = 'Logging';
5
- /**
6
- * This Symbol is used to reference an internal-only PubSub provider that
7
- * is used for AppSync/GraphQL subscriptions in the API category.
8
- */
9
- const hasSymbol = typeof Symbol !== 'undefined' && typeof Symbol.for === 'function';
10
- const INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = hasSymbol
11
- ? Symbol.for('INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER')
12
- : '@@INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER';
13
5
  const USER_AGENT_HEADER = 'x-amz-user-agent';
14
6
  // Error exception code constants
15
7
  const NO_HUBCALLBACK_PROVIDED_EXCEPTION = 'NoHubcallbackProvidedException';
16
8
 
17
- export { AWS_CLOUDWATCH_CATEGORY, INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, NO_HUBCALLBACK_PROVIDED_EXCEPTION, USER_AGENT_HEADER };
9
+ export { AWS_CLOUDWATCH_CATEGORY, NO_HUBCALLBACK_PROVIDED_EXCEPTION, USER_AGENT_HEADER };
18
10
  //# sourceMappingURL=constants.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.mjs","sources":["../../src/constants.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n// Logging constants\nexport const AWS_CLOUDWATCH_CATEGORY = 'Logging';\n/**\n * This Symbol is used to reference an internal-only PubSub provider that\n * is used for AppSync/GraphQL subscriptions in the API category.\n */\nconst hasSymbol = typeof Symbol !== 'undefined' && typeof Symbol.for === 'function';\nexport const INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = hasSymbol\n ? Symbol.for('INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER')\n : '@@INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER';\nexport const USER_AGENT_HEADER = 'x-amz-user-agent';\n// Error exception code constants\nexport const NO_HUBCALLBACK_PROVIDED_EXCEPTION = 'NoHubcallbackProvidedException';\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACY,MAAC,uBAAuB,GAAG,UAAU;AACjD;AACA;AACA;AACA;AACA,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,UAAU,CAAC;AACxE,MAAC,6CAA6C,GAAG,SAAS;AACtE,MAAM,MAAM,CAAC,GAAG,CAAC,+CAA+C,CAAC;AACjE,MAAM,kDAAkD;AAC5C,MAAC,iBAAiB,GAAG,mBAAmB;AACpD;AACY,MAAC,iCAAiC,GAAG;;;;"}
1
+ {"version":3,"file":"constants.mjs","sources":["../../src/constants.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n// Logging constants\nexport const AWS_CLOUDWATCH_CATEGORY = 'Logging';\nexport const USER_AGENT_HEADER = 'x-amz-user-agent';\n// Error exception code constants\nexport const NO_HUBCALLBACK_PROVIDED_EXCEPTION = 'NoHubcallbackProvidedException';\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACY,MAAC,uBAAuB,GAAG,UAAU;AACrC,MAAC,iBAAiB,GAAG,mBAAmB;AACpD;AACY,MAAC,iCAAiC,GAAG;;;;"}
@@ -17,7 +17,7 @@ export { AmplifyErrorCode, AmplifyErrorMap, AmplifyErrorParams, AssertionFunctio
17
17
  export { BackgroundProcessManager } from './BackgroundProcessManager';
18
18
  export { Mutex } from './Mutex';
19
19
  export { Reachability } from './Reachability';
20
- export { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './constants';
20
+ export { USER_AGENT_HEADER } from './constants';
21
21
  export { fetchAuthSession } from './singleton/apis/internal/fetchAuthSession';
22
22
  export { AMPLIFY_SYMBOL } from './Hub';
23
23
  export { base64Decoder, base64Encoder } from './utils/convert';
@@ -27,7 +27,7 @@ export { AmplifyErrorCode } from './types/errors.mjs';
27
27
  export { BackgroundProcessManager } from './BackgroundProcessManager/BackgroundProcessManager.mjs';
28
28
  export { Mutex } from './Mutex/Mutex.mjs';
29
29
  export { Reachability } from './Reachability/Reachability.mjs';
30
- export { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER } from './constants.mjs';
30
+ export { USER_AGENT_HEADER } from './constants.mjs';
31
31
  export { fetchAuthSession } from './singleton/apis/internal/fetchAuthSession.mjs';
32
32
  export { AMPLIFY_SYMBOL, HubInternal } from './Hub/index.mjs';
33
33
  export { base64Decoder } from './utils/convert/base64/base64Decoder.mjs';
@@ -1,25 +1,9 @@
1
1
  import { amplifyUuid } from '../../../utils/amplifyUuid/index.mjs';
2
- import '../../../Hub/index.mjs';
3
- import '../../../parseAWSExports.mjs';
4
- import '../../../utils/getClientInfo/getClientInfo.mjs';
5
- import '../../../utils/retry/retry.mjs';
6
- import '../../../awsClients/cognitoIdentity/base.mjs';
7
- import '@aws-crypto/sha256-js';
8
- import '@smithy/util-hex-encoding';
9
- import '../../../storage/index.mjs';
10
2
  import '../../../Cache/index.mjs';
11
- import '../../../I18n/index.mjs';
12
- import '../../../Logger/ConsoleLogger.mjs';
13
- import '../../../types/errors.mjs';
14
- import '../../../errors/errorHelpers.mjs';
15
- import '../../../ServiceWorker/errorHelpers.mjs';
16
- import '../../../awsClients/pinpoint/base.mjs';
17
- import '../../../awsClients/pinpoint/errorHelpers.mjs';
18
- import { getEventBuffer } from '../utils/getEventBuffer.mjs';
19
- import { BUFFER_SIZE, FLUSH_INTERVAL, FLUSH_SIZE, RESEND_LIMIT } from '../utils/constants.mjs';
20
- import '../types/errors.mjs';
21
3
  import { resolveEndpointId } from '../utils/resolveEndpointId.mjs';
22
4
  import '../../../utils/sessionListener/index.mjs';
5
+ import { BUFFER_SIZE, FLUSH_INTERVAL, FLUSH_SIZE, RESEND_LIMIT } from '../utils/constants.mjs';
6
+ import { getEventBuffer } from '../utils/getEventBuffer.mjs';
23
7
  import { SESSION_STOP_EVENT, SESSION_START_EVENT } from '../../../utils/sessionListener/constants.mjs';
24
8
 
25
9
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
@@ -1 +1 @@
1
- {"version":3,"file":"record.mjs","sources":["../../../../../src/providers/pinpoint/apis/record.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { amplifyUuid } from '../../../utils/amplifyUuid';\nimport { resolveEndpointId } from '../utils';\nimport { SESSION_START_EVENT, SESSION_STOP_EVENT, } from '../../../utils/sessionListener';\nimport { BUFFER_SIZE, FLUSH_INTERVAL, FLUSH_SIZE, RESEND_LIMIT, } from '../utils/constants';\nimport { getEventBuffer } from '../utils/getEventBuffer';\nlet session;\n/**\n * @internal\n */\nexport const record = async ({ appId, category, channelType, credentials, event, identityId, region, userAgentValue, }) => {\n let eventSession = session;\n const currentTime = new Date();\n const timestampISOString = currentTime.toISOString();\n const eventId = amplifyUuid();\n // Prepare event buffer if required\n const buffer = getEventBuffer({\n appId,\n bufferSize: BUFFER_SIZE,\n credentials,\n flushInterval: FLUSH_INTERVAL,\n flushSize: FLUSH_SIZE,\n identityId,\n region,\n resendLimit: RESEND_LIMIT,\n userAgentValue,\n });\n const endpointId = await resolveEndpointId({\n appId,\n category,\n channelType,\n credentials,\n identityId,\n region,\n userAgentValue,\n });\n // Generate session if required\n if (!eventSession || event.name === SESSION_START_EVENT) {\n const sessionId = amplifyUuid();\n session = {\n Id: sessionId,\n StartTimestamp: timestampISOString,\n };\n eventSession = session;\n }\n // Terminate session when required\n if (session && event.name === SESSION_STOP_EVENT) {\n eventSession = {\n ...session,\n StopTimestamp: timestampISOString,\n Duration: currentTime.getTime() - new Date(session.StartTimestamp).getTime(),\n };\n session = undefined;\n }\n // Push event to buffer\n buffer.push({\n eventId,\n endpointId,\n event,\n session: eventSession,\n timestamp: timestampISOString,\n resendLimit: RESEND_LIMIT,\n });\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAMA,IAAI,OAAO,CAAC;AACZ;AACA;AACA;AACY,MAAC,MAAM,GAAG,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW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AY,QAAQ,EAAE,WAAW,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE;AACxF,SAAS,CAAC;AACV,QAAQ,OAAO,GAAG,SAAS,CAAC;AAC5B,KAAK;AACL;AACA,IAAI,MAAM,CAAC,IAAI,CAAC;AAChB,QAAQ,OAAO;AACf,QAAQ,UAAU;AAClB,QAAQ,KAAK;AACb,QAAQ,OAAO,EAAE,YAAY;AAC7B,QAAQ,SAAS,EAAE,kBAAkB;AACrC,QAAQ,WAAW,EAAE,YAAY;AACjC,KAAK,CAAC,CAAC;AACP;;;;"}
1
+ {"version":3,"file":"record.mjs","sources":["../../../../../src/providers/pinpoint/apis/record.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { amplifyUuid } from '../../../utils/amplifyUuid';\nimport { resolveEndpointId } from '../utils';\nimport { SESSION_START_EVENT, SESSION_STOP_EVENT, } from '../../../utils/sessionListener';\nimport { BUFFER_SIZE, FLUSH_INTERVAL, FLUSH_SIZE, RESEND_LIMIT, } from '../utils/constants';\nimport { getEventBuffer } from '../utils/getEventBuffer';\nlet session;\n/**\n * @internal\n */\nexport const record = async ({ appId, category, channelType, credentials, event, identityId, region, userAgentValue, }) => {\n let eventSession = session;\n const currentTime = new Date();\n const timestampISOString = currentTime.toISOString();\n const eventId = amplifyUuid();\n // Prepare event buffer if required\n const buffer = getEventBuffer({\n appId,\n bufferSize: BUFFER_SIZE,\n credentials,\n flushInterval: FLUSH_INTERVAL,\n flushSize: FLUSH_SIZE,\n identityId,\n region,\n resendLimit: RESEND_LIMIT,\n userAgentValue,\n });\n const endpointId = await resolveEndpointId({\n appId,\n category,\n channelType,\n credentials,\n identityId,\n region,\n userAgentValue,\n });\n // Generate session if required\n if (!eventSession || event.name === SESSION_START_EVENT) {\n const sessionId = amplifyUuid();\n session = {\n Id: sessionId,\n StartTimestamp: timestampISOString,\n };\n eventSession = session;\n }\n // Terminate session when required\n if (session && event.name === SESSION_STOP_EVENT) {\n eventSession = {\n ...session,\n StopTimestamp: timestampISOString,\n Duration: currentTime.getTime() - new Date(session.StartTimestamp).getTime(),\n };\n session = undefined;\n }\n // Push event to buffer\n buffer.push({\n eventId,\n endpointId,\n event,\n session: eventSession,\n timestamp: timestampISOString,\n resendLimit: RESEND_LIMIT,\n });\n};\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AAMA,IAAI,OAAO,CAAC;AACZ;AACA;AACA;AACY,MAAC,MAAM,GAAG,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,GAAG,KAAK;AAC3H,IAAI,IAAI,YAAY,GAAG,OAAO,CAAC;AAC/B,IAAI,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC;AACnC,IAAI,MAAM,kBAAkB,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC;AACzD,IAAI,MAAM,OAAO,GAAG,WAAW,EAAE,CAAC;AAClC;AACA,IAAI,MAAM,MAAM,GAAG,cAAc,CAAC;AAClC,QAAQ,KAAK;AACb,QAAQ,UAAU,EAAE,WAAW;AAC/B,QAAQ,WAAW;AACnB,QAAQ,aAAa,EAAE,cAAc;AACrC,QAAQ,SAAS,EAAE,UAAU;AAC7B,QAAQ,UAAU;AAClB,QAAQ,MAAM;AACd,QAAQ,WAAW,EAAE,YAAY;AACjC,QAAQ,cAAc;AACtB,KAAK,CAAC,CAAC;AACP,IAAI,MAAM,UAAU,GAAG,MAAM,iBAAiB,CAAC;AAC/C,QAAQ,KAAK;AACb,QAAQ,QAAQ;AAChB,QAAQ,WAAW;AACnB,QAAQ,WAAW;AACnB,QAAQ,UAAU;AAClB,QAAQ,MAAM;AACd,QAAQ,cAAc;AACtB,KAAK,CAAC,CAAC;AACP;AACA,IAAI,IAAI,CAAC,YAAY,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAmB,EAAE;AAC7D,QAAQ,MAAM,SAAS,GAAG,WAAW,EAAE,CAAC;AACxC,QAAQ,OAAO,GAAG;AAClB,YAAY,EAAE,EAAE,SAAS;AACzB,YAAY,cAAc,EAAE,kBAAkB;AAC9C,SAAS,CAAC;AACV,QAAQ,YAAY,GAAG,OAAO,CAAC;AAC/B,KAAK;AACL;AACA,IAAI,IAAI,OAAO,IAAI,KAAK,CAAC,IAAI,KAAK,kBAAkB,EAAE;AACtD,QAAQ,YAAY,GAAG;AACvB,YAAY,GAAG,OAAO;AACtB,YAAY,aAAa,EAAE,kBAAkB;AAC7C,YAAY,QAAQ,EAAE,WAAW,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE;AACxF,SAAS,CAAC;AACV,QAAQ,OAAO,GAAG,SAAS,CAAC;AAC5B,KAAK;AACL;AACA,IAAI,MAAM,CAAC,IAAI,CAAC;AAChB,QAAQ,OAAO;AACf,QAAQ,UAAU;AAClB,QAAQ,KAAK;AACb,QAAQ,OAAO,EAAE,YAAY;AAC7B,QAAQ,SAAS,EAAE,kBAAkB;AACrC,QAAQ,WAAW,EAAE,YAAY;AACjC,KAAK,CAAC,CAAC;AACP;;;;"}
@@ -8,10 +8,6 @@ import '../../../awsClients/pinpoint/errorHelpers.mjs';
8
8
  import { updateEndpoint as updateEndpoint$1 } from '../../../awsClients/pinpoint/updateEndpoint.mjs';
9
9
  import { cacheEndpointId } from '../utils/cacheEndpointId.mjs';
10
10
  import { getEndpointId } from '../utils/getEndpointId.mjs';
11
- import '../../../types/errors.mjs';
12
- import '../../../errors/errorHelpers.mjs';
13
- import '../../../utils/sessionListener/index.mjs';
14
- import '../utils/PinpointEventBuffer.mjs';
15
11
 
16
12
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
17
13
  // SPDX-License-Identifier: Apache-2.0
@@ -1 +1 @@
1
- {"version":3,"file":"updateEndpoint.mjs","sources":["../../../../../src/providers/pinpoint/apis/updateEndpoint.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { amplifyUuid } from '../../../utils/amplifyUuid';\nimport { getClientInfo } from '../../../utils/getClientInfo';\nimport { updateEndpoint as clientUpdateEndpoint, } from '../../../awsClients/pinpoint';\nimport { cacheEndpointId, getEndpointId } from '../utils';\n/**\n * @internal\n */\nexport const updateEndpoint = async ({ address, appId, category, channelType, credentials, identityId, optOut, region, userAttributes, userId, userProfile, userAgentValue, }) => {\n const endpointId = await getEndpointId(appId, category);\n // only generate a new endpoint id if one was not found in cache\n const createdEndpointId = !endpointId ? amplifyUuid() : undefined;\n const { customProperties, demographic, email, location, metrics, name, plan, } = userProfile ?? {};\n const clientInfo = getClientInfo();\n const mergedDemographic = {\n appVersion: clientInfo.appVersion,\n make: clientInfo.make,\n model: clientInfo.model,\n modelVersion: clientInfo.version,\n platform: clientInfo.platform,\n ...demographic,\n };\n const shouldAddAttributes = email || customProperties || name || plan;\n const attributes = {\n ...(email && { email: [email] }),\n ...(name && { name: [name] }),\n ...(plan && { plan: [plan] }),\n ...customProperties,\n };\n const input = {\n ApplicationId: appId,\n EndpointId: endpointId ?? createdEndpointId,\n EndpointRequest: {\n RequestId: amplifyUuid(),\n EffectiveDate: new Date().toISOString(),\n ChannelType: channelType,\n Address: address,\n Attributes: shouldAddAttributes ? attributes : undefined,\n Demographic: {\n AppVersion: mergedDemographic.appVersion,\n Locale: mergedDemographic.locale,\n Make: mergedDemographic.make,\n Model: mergedDemographic.model,\n ModelVersion: mergedDemographic.modelVersion,\n Platform: mergedDemographic.platform,\n PlatformVersion: mergedDemographic.platformVersion,\n Timezone: mergedDemographic.timezone,\n },\n Location: {\n City: location?.city,\n Country: location?.country,\n Latitude: location?.latitude,\n Longitude: location?.longitude,\n PostalCode: location?.postalCode,\n Region: location?.region,\n },\n Metrics: metrics,\n OptOut: optOut,\n User: {\n UserId: userId ?? identityId,\n UserAttributes: userAttributes,\n },\n },\n };\n await clientUpdateEndpoint({ credentials, region, userAgentValue }, input);\n // if we had to create an endpoint id, we need to now cache it\n if (!!createdEndpointId) {\n return cacheEndpointId(appId, category, createdEndpointId);\n }\n};\n"],"names":["clientUpdateEndpoint"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AAKA;AACA;AACA;AACY,MAAC,cAAc,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,GAAG,KAAK;AAClL,IAAI,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC5D;AACA,IAAI,MAAM,iBAAiB,GAAG,CAAC,UAAU,GAAG,WAAW,EAAE,GAAG,SAAS,CAAC;AACtE,IAAI,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,GAAG,WAAW,IAAI,EAAE,CAAC;AACvG,IAAI,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;AACvC,IAAI,MAAM,iBAAiB,GAAG;AAC9B,QAAQ,UAAU,EAAE,UAAU,CAAC,UAAU;AACzC,QAAQ,IAAI,EAAE,UAAU,CAAC,IAAI;AAC7B,QAAQ,KAAK,EAAE,UAAU,CAAC,KAAK;AAC/B,QAAQ,YAAY,EAAE,UAAU,CAAC,OAAO;AACxC,QAAQ,QAAQ,EAAE,UAAU,CAAC,QAAQ;AACrC,QAAQ,GAAG,WAAW;AACtB,KAAK,CAAC;AACN,IAAI,MAAM,mBAAmB,GAAG,KAAK,IAAI,gBAAgB,IAAI,IAAI,IAAI,IAAI,CAAC;AAC1E,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,IAAI,KA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AE,SAAS;AAC9C,gBAAgB,UAAU,EAAE,QAAQ,EAAE,UAAU;AAChD,gBAAgB,MAAM,EAAE,QAAQ,EAAE,MAAM;AACxC,aAAa;AACb,YAAY,OAAO,EAAE,OAAO;AAC5B,YAAY,MAAM,EAAE,MAAM;AAC1B,YAAY,IAAI,EAAE;AAClB,gBAAgB,MAAM,EAAE,MAAM,IAAI,UAAU;AAC5C,gBAAgB,cAAc,EAAE,cAAc;AAC9C,aAAa;AACb,SAAS;AACT,KAAK,CAAC;AACN,IAAI,MAAMA,gBAAoB,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,EAAE,KAAK,CAAC,CAAC;AAC/E;AACA,IAAI,IAAI,CAAC,CAAC,iBAAiB,EAAE;AAC7B,QAAQ,OAAO,eAAe,CAAC,KAAK,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;AACnE,KAAK;AACL;;;;"}
1
+ {"version":3,"file":"updateEndpoint.mjs","sources":["../../../../../src/providers/pinpoint/apis/updateEndpoint.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { amplifyUuid } from '../../../utils/amplifyUuid';\nimport { getClientInfo } from '../../../utils/getClientInfo';\nimport { updateEndpoint as clientUpdateEndpoint, } from '../../../awsClients/pinpoint';\nimport { cacheEndpointId } from '../utils/cacheEndpointId';\nimport { getEndpointId } from '../utils/getEndpointId';\n/**\n * @internal\n */\nexport const updateEndpoint = async ({ address, appId, category, channelType, credentials, identityId, optOut, region, userAttributes, userId, userProfile, userAgentValue, }) => {\n const endpointId = await getEndpointId(appId, category);\n // only generate a new endpoint id if one was not found in cache\n const createdEndpointId = !endpointId ? amplifyUuid() : undefined;\n const { customProperties, demographic, email, location, metrics, name, plan, } = userProfile ?? {};\n const clientInfo = getClientInfo();\n const mergedDemographic = {\n appVersion: clientInfo.appVersion,\n make: clientInfo.make,\n model: clientInfo.model,\n modelVersion: clientInfo.version,\n platform: clientInfo.platform,\n ...demographic,\n };\n const shouldAddAttributes = email || customProperties || name || plan;\n const attributes = {\n ...(email && { email: [email] }),\n ...(name && { name: [name] }),\n ...(plan && { plan: [plan] }),\n ...customProperties,\n };\n const input = {\n ApplicationId: appId,\n EndpointId: endpointId ?? createdEndpointId,\n EndpointRequest: {\n RequestId: amplifyUuid(),\n EffectiveDate: new Date().toISOString(),\n ChannelType: channelType,\n Address: address,\n Attributes: shouldAddAttributes ? attributes : undefined,\n Demographic: {\n AppVersion: mergedDemographic.appVersion,\n Locale: mergedDemographic.locale,\n Make: mergedDemographic.make,\n Model: mergedDemographic.model,\n ModelVersion: mergedDemographic.modelVersion,\n Platform: mergedDemographic.platform,\n PlatformVersion: mergedDemographic.platformVersion,\n Timezone: mergedDemographic.timezone,\n },\n Location: {\n City: location?.city,\n Country: location?.country,\n Latitude: location?.latitude,\n Longitude: location?.longitude,\n PostalCode: location?.postalCode,\n Region: location?.region,\n },\n Metrics: metrics,\n OptOut: optOut,\n User: {\n UserId: userId ?? identityId,\n UserAttributes: userAttributes,\n },\n },\n };\n await clientUpdateEndpoint({ credentials, region, userAgentValue }, input);\n // if we had to create an endpoint id, we need to now cache it\n if (!!createdEndpointId) {\n return cacheEndpointId(appId, category, createdEndpointId);\n }\n};\n"],"names":["clientUpdateEndpoint"],"mappings":";;;;;;;;;;;AAAA;AACA;AAMA;AACA;AACA;AACY,MAAC,cAAc,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,GAAG,KAAK;AAClL,IAAI,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC5D;AACA,IAAI,MAAM,iBAAiB,GAAG,CAAC,UAAU,GAAG,WAAW,EAAE,GAAG,SAAS,CAAC;AACtE,IAAI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s';
2
2
  export { record } from './apis/record.mjs';
3
3
  export { flushEvents } from './apis/flushEvents.mjs';
4
4
  export { UpdateEndpointException } from './types/errors.mjs';
5
- import '../../Hub/index.mjs';
6
- import '../../parseAWSExports.mjs';
7
- import '../../utils/getClientInfo/getClientInfo.mjs';
8
- import '../../utils/retry/retry.mjs';
9
- import '../../awsClients/cognitoIdentity/base.mjs';
10
- import '@aws-crypto/sha256-js';
11
- import '@smithy/util-hex-encoding';
12
- import '../../storage/index.mjs';
13
5
  import '../../Cache/index.mjs';
14
- import '../../I18n/index.mjs';
15
- import '../../Logger/ConsoleLogger.mjs';
16
- import '../../types/errors.mjs';
17
- import '../../errors/errorHelpers.mjs';
18
- import '../../ServiceWorker/errorHelpers.mjs';
19
6
  export { resolveEndpointId } from './utils/resolveEndpointId.mjs';
20
7
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1,24 +1,5 @@
1
- import '../../../Hub/index.mjs';
2
- import '../../../parseAWSExports.mjs';
3
- import '../../../utils/getClientInfo/getClientInfo.mjs';
4
- import '../../../utils/retry/retry.mjs';
5
- import '../../../awsClients/cognitoIdentity/base.mjs';
6
- import '@aws-crypto/sha256-js';
7
- import '@smithy/util-hex-encoding';
8
- import '../../../storage/index.mjs';
9
1
  import { Cache } from '../../../Cache/index.mjs';
10
- import '../../../I18n/index.mjs';
11
- import '../../../Logger/ConsoleLogger.mjs';
12
- import '../../../types/errors.mjs';
13
- import '../../../errors/errorHelpers.mjs';
14
- import '../../../ServiceWorker/errorHelpers.mjs';
15
- import 'uuid';
16
- import '../../../awsClients/pinpoint/base.mjs';
17
- import '../../../awsClients/pinpoint/errorHelpers.mjs';
18
2
  import { getCacheKey } from './getCacheKey.mjs';
19
- import '../../../utils/sessionListener/index.mjs';
20
- import './PinpointEventBuffer.mjs';
21
- import '../types/errors.mjs';
22
3
 
23
4
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
24
5
  // SPDX-License-Identifier: Apache-2.0
@@ -1 +1 @@
1
- {"version":3,"file":"cacheEndpointId.mjs","sources":["../../../../../src/providers/pinpoint/utils/cacheEndpointId.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Cache } from '../../..';\nimport { getCacheKey } from './getCacheKey';\n/**\n * Writes an endpoint id to a long-lived cache.\n *\n * @internal\n */\nexport const cacheEndpointId = async (appId, category, endpointId) => {\n const cacheKey = getCacheKey(appId, category);\n // Set a longer TTL to avoid endpoint id being deleted after the default TTL (3 days)\n // Also set its priority to the highest to reduce its chance of being deleted when cache is full\n const ttl = 1000 * 60 * 60 * 24 * 365 * 100; // 100 years\n const expiration = new Date().getTime() + ttl;\n return Cache.setItem(cacheKey, endpointId, {\n expires: expiration,\n priority: 1,\n });\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACY,MAAC,eAAe,GAAG,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,KAAK;AACtE,IAAI,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAClD;AACA;AACA,IAAI,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,CAAC;AAChD,IAAI,MAAM,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC;AAClD,IAAI,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAU,EAAE;AAC/C,QAAQ,OAAO,EAAE,UAAU;AAC3B,QAAQ,QAAQ,EAAE,CAAC;AACnB,KAAK,CAAC,CAAC;AACP;;;;"}
1
+ {"version":3,"file":"cacheEndpointId.mjs","sources":["../../../../../src/providers/pinpoint/utils/cacheEndpointId.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Cache } from '../../../Cache';\nimport { getCacheKey } from './getCacheKey';\n/**\n * Writes an endpoint id to a long-lived cache.\n *\n * @internal\n */\nexport const cacheEndpointId = async (appId, category, endpointId) => {\n const cacheKey = getCacheKey(appId, category);\n // Set a longer TTL to avoid endpoint id being deleted after the default TTL (3 days)\n // Also set its priority to the highest to reduce its chance of being deleted when cache is full\n const ttl = 1000 * 60 * 60 * 24 * 365 * 100; // 100 years\n const expiration = new Date().getTime() + ttl;\n return Cache.setItem(cacheKey, endpointId, {\n expires: expiration,\n priority: 1,\n });\n};\n"],"names":[],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACY,MAAC,eAAe,GAAG,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,KAAK;AACtE,IAAI,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAClD;AACA;AACA,IAAI,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,CAAC;AAChD,IAAI,MAAM,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC;AAClD,IAAI,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAU,EAAE;AAC/C,QAAQ,OAAO,EAAE,UAAU;AAC3B,QAAQ,QAAQ,EAAE,CAAC;AACnB,KAAK,CAAC,CAAC;AACP;;;;"}
@@ -1,24 +1,5 @@
1
- import '../../../Hub/index.mjs';
2
- import '../../../parseAWSExports.mjs';
3
- import '../../../utils/getClientInfo/getClientInfo.mjs';
4
- import '../../../utils/retry/retry.mjs';
5
- import '../../../awsClients/cognitoIdentity/base.mjs';
6
- import '@aws-crypto/sha256-js';
7
- import '@smithy/util-hex-encoding';
8
- import '../../../storage/index.mjs';
9
1
  import { Cache } from '../../../Cache/index.mjs';
10
- import '../../../I18n/index.mjs';
11
- import '../../../Logger/ConsoleLogger.mjs';
12
- import '../../../types/errors.mjs';
13
- import '../../../errors/errorHelpers.mjs';
14
- import '../../../ServiceWorker/errorHelpers.mjs';
15
- import 'uuid';
16
- import '../../../awsClients/pinpoint/base.mjs';
17
- import '../../../awsClients/pinpoint/errorHelpers.mjs';
18
2
  import { getCacheKey } from './getCacheKey.mjs';
19
- import '../../../utils/sessionListener/index.mjs';
20
- import './PinpointEventBuffer.mjs';
21
- import '../types/errors.mjs';
22
3
 
23
4
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
24
5
  // SPDX-License-Identifier: Apache-2.0
@@ -1 +1 @@
1
- {"version":3,"file":"getEndpointId.mjs","sources":["../../../../../src/providers/pinpoint/utils/getEndpointId.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Cache } from '../../..';\nimport { getCacheKey } from './getCacheKey';\n/**\n * Returns an endpoint id from cache or `undefined` if not found.\n *\n * @internal\n */\nexport const getEndpointId = async (appId, category) => {\n const cacheKey = getCacheKey(appId, category);\n const cachedEndpointId = await Cache.getItem(cacheKey);\n return cachedEndpointId ?? undefined;\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACY,MAAC,aAAa,GAAG,OAAO,KAAK,EAAE,QAAQ,KAAK;AACxD,IAAI,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAClD,IAAI,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC3D,IAAI,OAAO,gBAAgB,IAAI,SAAS,CAAC;AACzC;;;;"}
1
+ {"version":3,"file":"getEndpointId.mjs","sources":["../../../../../src/providers/pinpoint/utils/getEndpointId.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Cache } from '../../../Cache';\nimport { getCacheKey } from './getCacheKey';\n/**\n * Returns an endpoint id from cache or `undefined` if not found.\n *\n * @internal\n */\nexport const getEndpointId = async (appId, category) => {\n const cacheKey = getCacheKey(appId, category);\n const cachedEndpointId = await Cache.getItem(cacheKey);\n return cachedEndpointId ?? undefined;\n};\n"],"names":[],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACY,MAAC,aAAa,GAAG,OAAO,KAAK,EAAE,QAAQ,KAAK;AACxD,IAAI,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAClD,IAAI,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC3D,IAAI,OAAO,gBAAgB,IAAI,SAAS,CAAC;AACzC;;;;"}
@@ -1,23 +1,7 @@
1
1
  import { AmplifyErrorCode } from '../../../types/errors.mjs';
2
2
  import { assert } from '../../../errors/errorHelpers.mjs';
3
3
  import { updateEndpoint } from '../apis/updateEndpoint.mjs';
4
- import 'uuid';
5
- import '../../../Hub/index.mjs';
6
- import '../../../parseAWSExports.mjs';
7
- import '../../../utils/getClientInfo/getClientInfo.mjs';
8
- import '../../../utils/retry/retry.mjs';
9
- import '../../../awsClients/cognitoIdentity/base.mjs';
10
- import '@aws-crypto/sha256-js';
11
- import '@smithy/util-hex-encoding';
12
- import '../../../storage/index.mjs';
13
- import '../../../Cache/index.mjs';
14
- import '../../../I18n/index.mjs';
15
- import '../../../Logger/ConsoleLogger.mjs';
16
- import '../../../ServiceWorker/errorHelpers.mjs';
17
- import '../types/errors.mjs';
18
4
  import { getEndpointId } from './getEndpointId.mjs';
19
- import '../../../utils/sessionListener/index.mjs';
20
- import './PinpointEventBuffer.mjs';
21
5
 
22
6
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
23
7
  // SPDX-License-Identifier: Apache-2.0
@@ -1 +1 @@
1
- {"version":3,"file":"resolveEndpointId.mjs","sources":["../../../../../src/providers/pinpoint/utils/resolveEndpointId.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { assert } from '../../../errors';\nimport { AmplifyErrorCode } from '../../../types';\nimport { updateEndpoint } from '../apis';\nimport { getEndpointId } from './getEndpointId';\n/**\n * Resolves an endpoint id from cache or prepare via updateEndpoint if one does not already exist,\n * which will generate and cache an endpoint id between calls.\n *\n * @internal\n */\nexport const resolveEndpointId = async ({ address, appId, category, channelType, credentials, identityId, region, userAgentValue, }) => {\n let endpointId = await getEndpointId(appId, category);\n if (!endpointId) {\n await updateEndpoint({\n address,\n appId,\n category,\n channelType,\n credentials,\n identityId,\n region,\n userAgentValue,\n });\n endpointId = await getEndpointId(appId, category);\n }\n assert(!!endpointId, AmplifyErrorCode.NoEndpointId);\n return endpointId;\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,iBAAiB,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,GAAG,KAAK;AACxI,IAAI,IAAI,UAAU,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC1D,IAAI,IAAI,CAAC,UAAU,EAAE;AACrB,QAAQ,MAAM,cAAc,CAAC;AAC7B,YAAY,OAAO;AACnB,YAAY,KAAK;AACjB,YAAY,QAAQ;AACpB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB,YAAY,UAAU;AACtB,YAAY,MAAM;AAClB,YAAY,cAAc;AAC1B,SAAS,CAAC,CAAC;AACX,QAAQ,UAAU,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC1D,KAAK;AACL,IAAI,MAAM,CAAC,CAAC,CAAC,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;AACxD,IAAI,OAAO,UAAU,CAAC;AACtB;;;;"}
1
+ {"version":3,"file":"resolveEndpointId.mjs","sources":["../../../../../src/providers/pinpoint/utils/resolveEndpointId.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { assert } from '../../../errors';\nimport { AmplifyErrorCode } from '../../../types';\nimport { updateEndpoint } from '../apis/updateEndpoint';\nimport { getEndpointId } from './getEndpointId';\n/**\n * Resolves an endpoint id from cache or prepare via updateEndpoint if one does not already exist,\n * which will generate and cache an endpoint id between calls.\n *\n * @internal\n */\nexport const resolveEndpointId = async ({ address, appId, category, channelType, credentials, identityId, region, userAgentValue, }) => {\n let endpointId = await getEndpointId(appId, category);\n if (!endpointId) {\n await updateEndpoint({\n address,\n appId,\n category,\n channelType,\n credentials,\n identityId,\n region,\n userAgentValue,\n });\n endpointId = await getEndpointId(appId, category);\n }\n assert(!!endpointId, AmplifyErrorCode.NoEndpointId);\n return endpointId;\n};\n"],"names":[],"mappings":";;;;;AAAA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,iBAAiB,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,GAAG,KAAK;AACxI,IAAI,IAAI,UAAU,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC1D,IAAI,IAAI,CAAC,UAAU,EAAE;AACrB,QAAQ,MAAM,cAAc,CAAC;AAC7B,YAAY,OAAO;AACnB,YAAY,KAAK;AACjB,YAAY,QAAQ;AACpB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB,YAAY,UAAU;AACtB,YAAY,MAAM;AAClB,YAAY,cAAc;AAC1B,SAAS,CAAC,CAAC;AACX,QAAQ,UAAU,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC1D,KAAK;AACL,IAAI,MAAM,CAAC,CAAC,CAAC,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;AACxD,IAAI,OAAO,UAAU,CAAC;AACtB;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/core",
3
- "version": "6.0.1-mjs-test.6f5dab7.0+6f5dab7",
3
+ "version": "6.0.1-mjs-test.fc9412c.0+fc9412c",
4
4
  "description": "Core category of aws-amplify",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.mjs",
@@ -60,7 +60,7 @@
60
60
  "uuid": "^9.0.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@aws-amplify/react-native": "1.0.1-mjs-test.6f5dab7.0+6f5dab7",
63
+ "@aws-amplify/react-native": "1.0.1-mjs-test.fc9412c.0+fc9412c",
64
64
  "@rollup/plugin-typescript": "11.1.5",
65
65
  "@types/js-cookie": "3.0.2",
66
66
  "genversion": "^2.2.0",
@@ -234,5 +234,5 @@
234
234
  "dist"
235
235
  ]
236
236
  },
237
- "gitHead": "6f5dab7f07d1781d39217d1e5a253c6a5165c8b2"
237
+ "gitHead": "fc9412ce1c1d7557b8b83ee4ba09a57afd1e36a1"
238
238
  }
package/src/Hub/index.ts CHANGED
@@ -16,8 +16,8 @@ import {
16
16
  } from './types';
17
17
 
18
18
  export const AMPLIFY_SYMBOL = (
19
- typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'
20
- ? Symbol.for('amplify_default')
19
+ typeof Symbol !== 'undefined'
20
+ ? Symbol('amplify_default')
21
21
  : '@@amplify_default'
22
22
  ) as Symbol;
23
23
 
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- export const version = '6.0.1-mjs-test.6f5dab7.0+6f5dab7';
2
+ export const version = '6.0.1-mjs-test.fc9412c.0+fc9412c';
@@ -2,8 +2,8 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { CompletionObserver, Observable, from } from 'rxjs';
5
- import { isWebWorker } from '../libraryUtils';
6
5
  import { NetworkStatus } from './types';
6
+ import { isWebWorker } from '../utils';
7
7
 
8
8
  export class Reachability {
9
9
  private static _observers: Array<CompletionObserver<NetworkStatus>> = [];
package/src/constants.ts CHANGED
@@ -4,17 +4,6 @@
4
4
  // Logging constants
5
5
  export const AWS_CLOUDWATCH_CATEGORY = 'Logging';
6
6
 
7
- /**
8
- * This Symbol is used to reference an internal-only PubSub provider that
9
- * is used for AppSync/GraphQL subscriptions in the API category.
10
- */
11
- const hasSymbol =
12
- typeof Symbol !== 'undefined' && typeof Symbol.for === 'function';
13
-
14
- export const INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = hasSymbol
15
- ? Symbol.for('INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER')
16
- : '@@INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER';
17
-
18
7
  export const USER_AGENT_HEADER = 'x-amz-user-agent';
19
8
 
20
9
  // Error exception code constants
@@ -90,10 +90,7 @@ export {
90
90
  export { BackgroundProcessManager } from './BackgroundProcessManager';
91
91
  export { Mutex } from './Mutex';
92
92
  export { Reachability } from './Reachability';
93
- export {
94
- INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER,
95
- USER_AGENT_HEADER,
96
- } from './constants';
93
+ export { USER_AGENT_HEADER } from './constants';
97
94
  export { fetchAuthSession } from './singleton/apis/internal/fetchAuthSession';
98
95
  export { AMPLIFY_SYMBOL } from './Hub';
99
96
  export { base64Decoder, base64Encoder } from './utils/convert';
@@ -8,7 +8,8 @@ import {
8
8
  UpdateEndpointInput,
9
9
  } from '../../../awsClients/pinpoint';
10
10
  import { PinpointUpdateEndpointInput } from '../types';
11
- import { cacheEndpointId, getEndpointId } from '../utils';
11
+ import { cacheEndpointId } from '../utils/cacheEndpointId';
12
+ import { getEndpointId } from '../utils/getEndpointId';
12
13
 
13
14
  /**
14
15
  * @internal
@@ -1,7 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { Cache } from '../../..';
4
+ import { Cache } from '../../../Cache';
5
5
  import { SupportedCategory } from '../types';
6
6
  import { getCacheKey } from './getCacheKey';
7
7
 
@@ -1,7 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { Cache } from '../../..';
4
+ import { Cache } from '../../../Cache';
5
5
  import { SupportedCategory } from '../types';
6
6
  import { getCacheKey } from './getCacheKey';
7
7
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  import { assert } from '../../../errors';
5
5
  import { AmplifyErrorCode } from '../../../types';
6
- import { updateEndpoint } from '../apis';
6
+ import { updateEndpoint } from '../apis/updateEndpoint';
7
7
  import { PinpointUpdateEndpointInput } from '../types';
8
8
  import { getEndpointId } from './getEndpointId';
9
9