@aws-amplify/core 6.10.6-unstable.cde36a7.0 → 6.10.7-unstable.b188564.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 (135) hide show
  1. package/dist/cjs/BackgroundProcessManager/BackgroundProcessManager.js +1 -0
  2. package/dist/cjs/BackgroundProcessManager/BackgroundProcessManager.js.map +1 -1
  3. package/dist/cjs/Logger/ConsoleLogger.js +1 -0
  4. package/dist/cjs/Logger/ConsoleLogger.js.map +1 -1
  5. package/dist/cjs/Platform/version.js +1 -1
  6. package/dist/cjs/Platform/version.js.map +1 -1
  7. package/dist/cjs/awsClients/pinpoint/getInAppMessages.js +1 -1
  8. package/dist/cjs/awsClients/pinpoint/getInAppMessages.js.map +1 -1
  9. package/dist/cjs/awsClients/pinpoint/putEvents.js +1 -1
  10. package/dist/cjs/awsClients/pinpoint/putEvents.js.map +1 -1
  11. package/dist/cjs/awsClients/pinpoint/updateEndpoint.js +1 -1
  12. package/dist/cjs/awsClients/pinpoint/updateEndpoint.js.map +1 -1
  13. package/dist/cjs/clients/handlers/{authenticated.js → aws/authenticated.js} +9 -7
  14. package/dist/cjs/clients/handlers/aws/authenticated.js.map +1 -0
  15. package/dist/cjs/clients/handlers/aws/unauthenticated.js +17 -0
  16. package/dist/cjs/clients/handlers/aws/unauthenticated.js.map +1 -0
  17. package/dist/cjs/clients/index.js +5 -3
  18. package/dist/cjs/clients/index.js.map +1 -1
  19. package/dist/cjs/clients/middleware/retry/amzSdkInvocationIdHeaderMiddleware.js +28 -0
  20. package/dist/cjs/clients/middleware/retry/amzSdkInvocationIdHeaderMiddleware.js.map +1 -0
  21. package/dist/cjs/clients/middleware/retry/amzSdkRequestHeaderMiddleware.js +27 -0
  22. package/dist/cjs/clients/middleware/retry/amzSdkRequestHeaderMiddleware.js.map +1 -0
  23. package/dist/cjs/clients/middleware/retry/constants.js +11 -0
  24. package/dist/cjs/clients/middleware/retry/constants.js.map +1 -0
  25. package/dist/cjs/clients/middleware/retry/index.js +7 -3
  26. package/dist/cjs/clients/middleware/retry/index.js.map +1 -1
  27. package/dist/cjs/clients/middleware/retry/jitteredBackoff.js +3 -3
  28. package/dist/cjs/clients/middleware/retry/jitteredBackoff.js.map +1 -1
  29. package/dist/cjs/clients/middleware/retry/{middleware.js → retryMiddleware.js} +4 -6
  30. package/dist/cjs/clients/middleware/retry/retryMiddleware.js.map +1 -0
  31. package/dist/cjs/clients/types/aws.js +0 -2
  32. package/dist/cjs/clients/types/aws.js.map +1 -1
  33. package/dist/cjs/errors/AmplifyError.js +6 -3
  34. package/dist/cjs/errors/AmplifyError.js.map +1 -1
  35. package/dist/cjs/types/errors.js +0 -2
  36. package/dist/cjs/types/errors.js.map +1 -1
  37. package/dist/esm/BackgroundProcessManager/BackgroundProcessManager.mjs +1 -0
  38. package/dist/esm/BackgroundProcessManager/BackgroundProcessManager.mjs.map +1 -1
  39. package/dist/esm/Logger/ConsoleLogger.mjs +1 -0
  40. package/dist/esm/Logger/ConsoleLogger.mjs.map +1 -1
  41. package/dist/esm/Platform/version.d.ts +1 -1
  42. package/dist/esm/Platform/version.mjs +1 -1
  43. package/dist/esm/Platform/version.mjs.map +1 -1
  44. package/dist/esm/ServiceWorker/ServiceWorker.mjs +9 -1
  45. package/dist/esm/ServiceWorker/ServiceWorker.mjs.map +1 -1
  46. package/dist/esm/awsClients/cognitoIdentity/base.d.ts +1 -1
  47. package/dist/esm/awsClients/cognitoIdentity/base.mjs +13 -3
  48. package/dist/esm/awsClients/cognitoIdentity/base.mjs.map +1 -1
  49. package/dist/esm/awsClients/cognitoIdentity/getCredentialsForIdentity.mjs +9 -0
  50. package/dist/esm/awsClients/cognitoIdentity/getCredentialsForIdentity.mjs.map +1 -1
  51. package/dist/esm/awsClients/cognitoIdentity/getId.mjs +9 -0
  52. package/dist/esm/awsClients/cognitoIdentity/getId.mjs.map +1 -1
  53. package/dist/esm/awsClients/pinpoint/base.mjs +16 -2
  54. package/dist/esm/awsClients/pinpoint/base.mjs.map +1 -1
  55. package/dist/esm/awsClients/pinpoint/getInAppMessages.d.ts +3 -3
  56. package/dist/esm/awsClients/pinpoint/getInAppMessages.mjs +1 -1
  57. package/dist/esm/awsClients/pinpoint/getInAppMessages.mjs.map +1 -1
  58. package/dist/esm/awsClients/pinpoint/putEvents.d.ts +3 -3
  59. package/dist/esm/awsClients/pinpoint/putEvents.mjs +1 -1
  60. package/dist/esm/awsClients/pinpoint/putEvents.mjs.map +1 -1
  61. package/dist/esm/awsClients/pinpoint/updateEndpoint.d.ts +3 -3
  62. package/dist/esm/awsClients/pinpoint/updateEndpoint.mjs +1 -1
  63. package/dist/esm/awsClients/pinpoint/updateEndpoint.mjs.map +1 -1
  64. package/dist/esm/clients/handlers/aws/authenticated.d.ts +5 -0
  65. package/dist/esm/clients/handlers/aws/authenticated.mjs +24 -0
  66. package/dist/esm/clients/handlers/aws/authenticated.mjs.map +1 -0
  67. package/dist/esm/clients/handlers/aws/unauthenticated.d.ts +4 -0
  68. package/dist/esm/clients/handlers/aws/unauthenticated.mjs +22 -0
  69. package/dist/esm/clients/handlers/aws/unauthenticated.mjs.map +1 -0
  70. package/dist/esm/clients/index.d.ts +4 -4
  71. package/dist/esm/clients/index.mjs +5 -3
  72. package/dist/esm/clients/index.mjs.map +1 -1
  73. package/dist/esm/clients/middleware/retry/amzSdkInvocationIdHeaderMiddleware.d.ts +12 -0
  74. package/dist/esm/clients/middleware/retry/amzSdkInvocationIdHeaderMiddleware.mjs +40 -0
  75. package/dist/esm/clients/middleware/retry/amzSdkInvocationIdHeaderMiddleware.mjs.map +1 -0
  76. package/dist/esm/clients/middleware/retry/amzSdkRequestHeaderMiddleware.d.ts +14 -0
  77. package/dist/esm/clients/middleware/retry/amzSdkRequestHeaderMiddleware.mjs +25 -0
  78. package/dist/esm/clients/middleware/retry/amzSdkRequestHeaderMiddleware.mjs.map +1 -0
  79. package/dist/esm/clients/middleware/retry/constants.d.ts +4 -0
  80. package/dist/esm/clients/middleware/retry/constants.mjs +9 -0
  81. package/dist/esm/clients/middleware/retry/constants.mjs.map +1 -0
  82. package/dist/esm/clients/middleware/retry/index.d.ts +3 -1
  83. package/dist/esm/clients/middleware/retry/index.mjs +3 -1
  84. package/dist/esm/clients/middleware/retry/index.mjs.map +1 -1
  85. package/dist/esm/clients/middleware/retry/jitteredBackoff.d.ts +1 -1
  86. package/dist/esm/clients/middleware/retry/jitteredBackoff.mjs +1 -1
  87. package/dist/esm/clients/middleware/retry/jitteredBackoff.mjs.map +1 -1
  88. package/dist/esm/clients/middleware/retry/{middleware.d.ts → retryMiddleware.d.ts} +4 -4
  89. package/dist/esm/clients/middleware/retry/{middleware.mjs → retryMiddleware.mjs} +4 -5
  90. package/dist/esm/clients/middleware/retry/retryMiddleware.mjs.map +1 -0
  91. package/dist/esm/clients/types/aws.d.ts +1 -1
  92. package/dist/esm/errors/AmplifyError.d.ts +8 -4
  93. package/dist/esm/errors/AmplifyError.mjs +6 -3
  94. package/dist/esm/errors/AmplifyError.mjs.map +1 -1
  95. package/dist/esm/providers/pinpoint/apis/updateEndpoint.mjs +9 -1
  96. package/dist/esm/providers/pinpoint/apis/updateEndpoint.mjs.map +1 -1
  97. package/dist/esm/providers/pinpoint/utils/PinpointEventBuffer.mjs +9 -0
  98. package/dist/esm/providers/pinpoint/utils/PinpointEventBuffer.mjs.map +1 -1
  99. package/dist/esm/singleton/Auth/types.d.ts +1 -1
  100. package/dist/esm/types/errors.d.ts +7 -6
  101. package/dist/esm/types/errors.mjs +0 -2
  102. package/dist/esm/types/errors.mjs.map +1 -1
  103. package/package.json +8 -8
  104. package/src/BackgroundProcessManager/BackgroundProcessManager.ts +1 -0
  105. package/src/Logger/ConsoleLogger.ts +1 -0
  106. package/src/Platform/version.ts +1 -1
  107. package/src/awsClients/pinpoint/getInAppMessages.ts +1 -1
  108. package/src/awsClients/pinpoint/putEvents.ts +1 -1
  109. package/src/awsClients/pinpoint/updateEndpoint.ts +1 -1
  110. package/src/clients/handlers/aws/authenticated.ts +39 -0
  111. package/src/clients/handlers/aws/unauthenticated.ts +34 -0
  112. package/src/clients/index.ts +7 -4
  113. package/src/clients/middleware/retry/amzSdkInvocationIdHeaderMiddleware.ts +31 -0
  114. package/src/clients/middleware/retry/amzSdkRequestHeaderMiddleware.ts +38 -0
  115. package/src/clients/middleware/retry/constants.ts +10 -0
  116. package/src/clients/middleware/retry/index.ts +6 -1
  117. package/src/clients/middleware/retry/jitteredBackoff.ts +2 -3
  118. package/src/clients/middleware/retry/{middleware.ts → retryMiddleware.ts} +10 -9
  119. package/src/clients/types/aws.ts +1 -5
  120. package/src/errors/AmplifyError.ts +13 -4
  121. package/src/singleton/Auth/types.ts +1 -5
  122. package/src/types/errors.ts +12 -4
  123. package/dist/cjs/clients/handlers/authenticated.js.map +0 -1
  124. package/dist/cjs/clients/handlers/unauthenticated.js +0 -12
  125. package/dist/cjs/clients/handlers/unauthenticated.js.map +0 -1
  126. package/dist/cjs/clients/middleware/retry/middleware.js.map +0 -1
  127. package/dist/esm/clients/handlers/authenticated.d.ts +0 -5
  128. package/dist/esm/clients/handlers/authenticated.mjs +0 -20
  129. package/dist/esm/clients/handlers/authenticated.mjs.map +0 -1
  130. package/dist/esm/clients/handlers/unauthenticated.d.ts +0 -4
  131. package/dist/esm/clients/handlers/unauthenticated.mjs +0 -15
  132. package/dist/esm/clients/handlers/unauthenticated.mjs.map +0 -1
  133. package/dist/esm/clients/middleware/retry/middleware.mjs.map +0 -1
  134. package/src/clients/handlers/authenticated.ts +0 -27
  135. package/src/clients/handlers/unauthenticated.ts +0 -19
@@ -251,6 +251,7 @@ class BackgroundProcessManager {
251
251
  // Due to potential races with a job's natural completion, it's
252
252
  // reasonable to expect the termination call to fail. Hence,
253
253
  // not logging as an error.
254
+ // eslint-disable-next-line no-console
254
255
  console.warn(`Failed to send termination signal to job. Error: ${error.message}`, job);
255
256
  }
256
257
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BackgroundProcessManager.js","sources":["../../../src/BackgroundProcessManager/BackgroundProcessManager.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.BackgroundProcessManager = void 0;\nconst BackgroundManagerNotOpenError_1 = require(\"./BackgroundManagerNotOpenError\");\nconst types_1 = require(\"./types\");\n/**\n * @private For internal Amplify use.\n *\n * Creates a new scope for promises, observables, and other types of work or\n * processes that may be running in the background. This manager provides\n * an singular entrypoint to request termination and await completion.\n *\n * As work completes on its own prior to close, the manager removes them\n * from the registry to avoid holding references to completed jobs.\n */\nclass BackgroundProcessManager {\n constructor() {\n /**\n * A string indicating whether the manager is accepting new work (\"Open\"),\n * waiting for work to complete (\"Closing\"), or fully done with all\n * submitted work and *not* accepting new jobs (\"Closed\").\n */\n this._state = types_1.BackgroundProcessManagerState.Open;\n /**\n * The list of outstanding jobs we'll need to wait for upon `close()`\n */\n this.jobs = new Set();\n }\n add(jobOrDescription, optionalDescription) {\n let job;\n let description;\n if (typeof jobOrDescription === 'string') {\n job = undefined;\n description = jobOrDescription;\n }\n else {\n job = jobOrDescription;\n description = optionalDescription;\n }\n const error = this.closedFailure(description);\n if (error)\n return error;\n if (job === undefined) {\n return this.addHook(description);\n }\n else if (typeof job === 'function') {\n return this.addFunction(job, description);\n }\n else if (job instanceof BackgroundProcessManager) {\n this.addManager(job, description);\n }\n else {\n throw new Error('If `job` is provided, it must be an Observable, Function, or BackgroundProcessManager.');\n }\n }\n /**\n * Adds a **cleaner** function that doesn't immediately get executed.\n * Instead, the caller gets a **terminate** function back. The *cleaner* is\n * invoked only once the mananger *closes* or the returned **terminate**\n * function is called.\n *\n * @param clean The cleanup function.\n * @param description Optional description to help identify pending jobs.\n * @returns A terminate function.\n */\n addCleaner(clean, description) {\n const { resolve, onTerminate } = this.addHook(description);\n const proxy = async () => {\n await clean();\n resolve();\n };\n onTerminate.then(proxy);\n return proxy;\n }\n addFunction(job, description) {\n // the function we call when we want to try to terminate this job.\n let terminate;\n // the promise the job can opt into listening to for termination.\n const onTerminate = new Promise(resolve => {\n terminate = resolve;\n });\n // finally! start the job.\n const jobResult = job(onTerminate);\n // depending on what the job gives back, register the result\n // so we can monitor for completion.\n if (typeof jobResult?.then === 'function') {\n this.registerPromise(jobResult, terminate, description);\n }\n // At the end of the day, or you know, method call, it doesn't matter\n // what the return value is at all; we just pass it through to the\n // caller.\n return jobResult;\n }\n addManager(manager, description) {\n this.addCleaner(async () => manager.close(), description);\n }\n /**\n * Creates and registers a fabricated job for processes that need to operate\n * with callbacks/hooks. The returned `resolve` and `reject`\n * functions can be used to signal the job is done successfully or not.\n * The returned `onTerminate` is a promise that will resolve when the\n * manager is requesting the termination of the job.\n *\n * @param description Optional description to help identify pending jobs.\n * @returns `{ resolve, reject, onTerminate }`\n */\n addHook(description) {\n // the resolve/reject functions we'll provide to the caller to signal\n // the state of the job.\n let promiseResolve;\n let promiseReject;\n // the underlying promise we'll use to manage it, pretty much like\n // any other promise.\n const promise = new Promise((resolve, reject) => {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n // the function we call when we want to try to terminate this job.\n let terminate;\n // the promise the job can opt into listening to for termination.\n const onTerminate = new Promise(resolve => {\n terminate = resolve;\n });\n this.registerPromise(promise, terminate, description);\n return {\n resolve: promiseResolve,\n reject: promiseReject,\n onTerminate,\n };\n }\n /**\n * Adds a Promise based job to the list of jobs for monitoring and listens\n * for either a success or failure, upon which the job is considered \"done\"\n * and removed from the registry.\n *\n * @param promise A promise that is on its way to being returned to a\n * caller, which needs to be tracked as a background job.\n * @param terminate The termination function to register, which can be\n * invoked to request the job stop.\n * @param description Optional description to help identify pending jobs.\n */\n registerPromise(promise, terminate, description) {\n const jobEntry = { promise, terminate, description };\n this.jobs.add(jobEntry);\n // in all of my testing, it is safe to multi-subscribe to a promise.\n // so, rather than create another layer of promising, we're just going\n // to hook into the promise we already have, and when it's done\n // (successfully or not), we no longer need to wait for it upon close.\n //\n // sorry this is a bit hand-wavy:\n //\n // i believe we use `.then` and `.catch` instead of `.finally` because\n // `.finally` is invoked in a different order in the sequence, and this\n // breaks assumptions throughout and causes failures.\n promise\n .then(() => {\n this.jobs.delete(jobEntry);\n })\n .catch(() => {\n this.jobs.delete(jobEntry);\n });\n }\n /**\n * The number of jobs being waited on.\n *\n * We don't use this for anything. It's just informational for the caller,\n * and can be used in logging and testing.\n *\n * @returns the number of jobs.\n */\n get length() {\n return this.jobs.size;\n }\n /**\n * The execution state of the manager. One of:\n *\n * 1. \"Open\" -> Accepting new jobs\n * 1. \"Closing\" -> Not accepting new work. Waiting for jobs to complete.\n * 1. \"Closed\" -> Not accepting new work. All submitted jobs are complete.\n */\n get state() {\n return this._state;\n }\n /**\n * The registered `description` of all still-pending jobs.\n *\n * @returns descriptions as an array.\n */\n get pending() {\n return Array.from(this.jobs).map(job => job.description);\n }\n /**\n * Whether the manager is accepting new jobs.\n */\n get isOpen() {\n return this._state === types_1.BackgroundProcessManagerState.Open;\n }\n /**\n * Whether the manager is rejecting new work, but still waiting for\n * submitted work to complete.\n */\n get isClosing() {\n return this._state === types_1.BackgroundProcessManagerState.Closing;\n }\n /**\n * Whether the manager is rejecting work and done waiting for submitted\n * work to complete.\n */\n get isClosed() {\n return this._state === types_1.BackgroundProcessManagerState.Closed;\n }\n closedFailure(description) {\n if (!this.isOpen) {\n return Promise.reject(new BackgroundManagerNotOpenError_1.BackgroundManagerNotOpenError([\n `The manager is ${this.state}.`,\n `You tried to add \"${description}\".`,\n `Pending jobs: [\\n${this.pending\n .map(t => ' ' + t)\n .join(',\\n')}\\n]`,\n ].join('\\n')));\n }\n }\n /**\n * Signals jobs to stop (for those that accept interruptions) and waits\n * for confirmation that jobs have stopped.\n *\n * This immediately puts the manager into a closing state and just begins\n * to reject new work. After all work in the manager is complete, the\n * manager goes into a `Completed` state and `close()` returns.\n *\n * This call is idempotent.\n *\n * If the manager is already closing or closed, `finalCleaup` is not executed.\n *\n * @param onClosed\n * @returns The settled results of each still-running job's promise. If the\n * manager is already closed, this will contain the results as of when the\n * manager's `close()` was called in an `Open` state.\n */\n async close() {\n if (this.isOpen) {\n this._state = types_1.BackgroundProcessManagerState.Closing;\n for (const job of Array.from(this.jobs)) {\n try {\n job.terminate();\n }\n catch (error) {\n // Due to potential races with a job's natural completion, it's\n // reasonable to expect the termination call to fail. Hence,\n // not logging as an error.\n console.warn(`Failed to send termination signal to job. Error: ${error.message}`, job);\n }\n }\n // Use `allSettled()` because we want to wait for all to finish. We do\n // not want to stop waiting if there is a failure.\n this._closingPromise = Promise.allSettled(Array.from(this.jobs).map(j => j.promise));\n await this._closingPromise;\n this._state = types_1.BackgroundProcessManagerState.Closed;\n }\n return this._closingPromise;\n }\n /**\n * Signals the manager to start accepting work (again) and returns once\n * the manager is ready to do so.\n *\n * If the state is already `Open`, this call is a no-op.\n *\n * If the state is `Closed`, this call simply updates state and returns.\n *\n * If the state is `Closing`, this call waits for completion before it\n * updates the state and returns.\n */\n async open() {\n if (this.isClosing) {\n await this.close();\n }\n this._state = types_1.BackgroundProcessManagerState.Open;\n }\n}\nexports.BackgroundProcessManager = BackgroundProcessManager;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,wBAAwB,GAAG,MAAM;AACzC,MAAM,+BAA+B,GAAG,OAAO,CAAC,iCAAiC,CAAC;AAClF,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,wBAAwB,CAAC;AAC/B,IAAI,WAAW,GAAG;AAClB;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,6BAA6B,CAAC,IAAI;AAChE;AACA;AACA;AACA,QAAQ,IAAI,CAAC,IAAI,GAAG,I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AI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;AAChG,YAAY,MAAM,IAAI,CAAC,eAAe;AACtC,YAAY,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,6BAA6B,CAAC,MAAM;AACtE;AACA,QAAQ,OAAO,IAAI,CAAC,eAAe;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,IAAI,GAAG;AACjB,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE;AAC5B,YAAY,MAAM,IAAI,CAAC,KAAK,EAAE;AAC9B;AACA,QAAQ,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,6BAA6B,CAAC,IAAI;AAChE;AACA;AACA,OAAO,CAAC,wBAAwB,GAAG,wBAAwB;;"}
1
+ {"version":3,"file":"BackgroundProcessManager.js","sources":["../../../src/BackgroundProcessManager/BackgroundProcessManager.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.BackgroundProcessManager = void 0;\nconst BackgroundManagerNotOpenError_1 = require(\"./BackgroundManagerNotOpenError\");\nconst types_1 = require(\"./types\");\n/**\n * @private For internal Amplify use.\n *\n * Creates a new scope for promises, observables, and other types of work or\n * processes that may be running in the background. This manager provides\n * an singular entrypoint to request termination and await completion.\n *\n * As work completes on its own prior to close, the manager removes them\n * from the registry to avoid holding references to completed jobs.\n */\nclass BackgroundProcessManager {\n constructor() {\n /**\n * A string indicating whether the manager is accepting new work (\"Open\"),\n * waiting for work to complete (\"Closing\"), or fully done with all\n * submitted work and *not* accepting new jobs (\"Closed\").\n */\n this._state = types_1.BackgroundProcessManagerState.Open;\n /**\n * The list of outstanding jobs we'll need to wait for upon `close()`\n */\n this.jobs = new Set();\n }\n add(jobOrDescription, optionalDescription) {\n let job;\n let description;\n if (typeof jobOrDescription === 'string') {\n job = undefined;\n description = jobOrDescription;\n }\n else {\n job = jobOrDescription;\n description = optionalDescription;\n }\n const error = this.closedFailure(description);\n if (error)\n return error;\n if (job === undefined) {\n return this.addHook(description);\n }\n else if (typeof job === 'function') {\n return this.addFunction(job, description);\n }\n else if (job instanceof BackgroundProcessManager) {\n this.addManager(job, description);\n }\n else {\n throw new Error('If `job` is provided, it must be an Observable, Function, or BackgroundProcessManager.');\n }\n }\n /**\n * Adds a **cleaner** function that doesn't immediately get executed.\n * Instead, the caller gets a **terminate** function back. The *cleaner* is\n * invoked only once the mananger *closes* or the returned **terminate**\n * function is called.\n *\n * @param clean The cleanup function.\n * @param description Optional description to help identify pending jobs.\n * @returns A terminate function.\n */\n addCleaner(clean, description) {\n const { resolve, onTerminate } = this.addHook(description);\n const proxy = async () => {\n await clean();\n resolve();\n };\n onTerminate.then(proxy);\n return proxy;\n }\n addFunction(job, description) {\n // the function we call when we want to try to terminate this job.\n let terminate;\n // the promise the job can opt into listening to for termination.\n const onTerminate = new Promise(resolve => {\n terminate = resolve;\n });\n // finally! start the job.\n const jobResult = job(onTerminate);\n // depending on what the job gives back, register the result\n // so we can monitor for completion.\n if (typeof jobResult?.then === 'function') {\n this.registerPromise(jobResult, terminate, description);\n }\n // At the end of the day, or you know, method call, it doesn't matter\n // what the return value is at all; we just pass it through to the\n // caller.\n return jobResult;\n }\n addManager(manager, description) {\n this.addCleaner(async () => manager.close(), description);\n }\n /**\n * Creates and registers a fabricated job for processes that need to operate\n * with callbacks/hooks. The returned `resolve` and `reject`\n * functions can be used to signal the job is done successfully or not.\n * The returned `onTerminate` is a promise that will resolve when the\n * manager is requesting the termination of the job.\n *\n * @param description Optional description to help identify pending jobs.\n * @returns `{ resolve, reject, onTerminate }`\n */\n addHook(description) {\n // the resolve/reject functions we'll provide to the caller to signal\n // the state of the job.\n let promiseResolve;\n let promiseReject;\n // the underlying promise we'll use to manage it, pretty much like\n // any other promise.\n const promise = new Promise((resolve, reject) => {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n // the function we call when we want to try to terminate this job.\n let terminate;\n // the promise the job can opt into listening to for termination.\n const onTerminate = new Promise(resolve => {\n terminate = resolve;\n });\n this.registerPromise(promise, terminate, description);\n return {\n resolve: promiseResolve,\n reject: promiseReject,\n onTerminate,\n };\n }\n /**\n * Adds a Promise based job to the list of jobs for monitoring and listens\n * for either a success or failure, upon which the job is considered \"done\"\n * and removed from the registry.\n *\n * @param promise A promise that is on its way to being returned to a\n * caller, which needs to be tracked as a background job.\n * @param terminate The termination function to register, which can be\n * invoked to request the job stop.\n * @param description Optional description to help identify pending jobs.\n */\n registerPromise(promise, terminate, description) {\n const jobEntry = { promise, terminate, description };\n this.jobs.add(jobEntry);\n // in all of my testing, it is safe to multi-subscribe to a promise.\n // so, rather than create another layer of promising, we're just going\n // to hook into the promise we already have, and when it's done\n // (successfully or not), we no longer need to wait for it upon close.\n //\n // sorry this is a bit hand-wavy:\n //\n // i believe we use `.then` and `.catch` instead of `.finally` because\n // `.finally` is invoked in a different order in the sequence, and this\n // breaks assumptions throughout and causes failures.\n promise\n .then(() => {\n this.jobs.delete(jobEntry);\n })\n .catch(() => {\n this.jobs.delete(jobEntry);\n });\n }\n /**\n * The number of jobs being waited on.\n *\n * We don't use this for anything. It's just informational for the caller,\n * and can be used in logging and testing.\n *\n * @returns the number of jobs.\n */\n get length() {\n return this.jobs.size;\n }\n /**\n * The execution state of the manager. One of:\n *\n * 1. \"Open\" -> Accepting new jobs\n * 1. \"Closing\" -> Not accepting new work. Waiting for jobs to complete.\n * 1. \"Closed\" -> Not accepting new work. All submitted jobs are complete.\n */\n get state() {\n return this._state;\n }\n /**\n * The registered `description` of all still-pending jobs.\n *\n * @returns descriptions as an array.\n */\n get pending() {\n return Array.from(this.jobs).map(job => job.description);\n }\n /**\n * Whether the manager is accepting new jobs.\n */\n get isOpen() {\n return this._state === types_1.BackgroundProcessManagerState.Open;\n }\n /**\n * Whether the manager is rejecting new work, but still waiting for\n * submitted work to complete.\n */\n get isClosing() {\n return this._state === types_1.BackgroundProcessManagerState.Closing;\n }\n /**\n * Whether the manager is rejecting work and done waiting for submitted\n * work to complete.\n */\n get isClosed() {\n return this._state === types_1.BackgroundProcessManagerState.Closed;\n }\n closedFailure(description) {\n if (!this.isOpen) {\n return Promise.reject(new BackgroundManagerNotOpenError_1.BackgroundManagerNotOpenError([\n `The manager is ${this.state}.`,\n `You tried to add \"${description}\".`,\n `Pending jobs: [\\n${this.pending\n .map(t => ' ' + t)\n .join(',\\n')}\\n]`,\n ].join('\\n')));\n }\n }\n /**\n * Signals jobs to stop (for those that accept interruptions) and waits\n * for confirmation that jobs have stopped.\n *\n * This immediately puts the manager into a closing state and just begins\n * to reject new work. After all work in the manager is complete, the\n * manager goes into a `Completed` state and `close()` returns.\n *\n * This call is idempotent.\n *\n * If the manager is already closing or closed, `finalCleaup` is not executed.\n *\n * @param onClosed\n * @returns The settled results of each still-running job's promise. If the\n * manager is already closed, this will contain the results as of when the\n * manager's `close()` was called in an `Open` state.\n */\n async close() {\n if (this.isOpen) {\n this._state = types_1.BackgroundProcessManagerState.Closing;\n for (const job of Array.from(this.jobs)) {\n try {\n job.terminate();\n }\n catch (error) {\n // Due to potential races with a job's natural completion, it's\n // reasonable to expect the termination call to fail. Hence,\n // not logging as an error.\n // eslint-disable-next-line no-console\n console.warn(`Failed to send termination signal to job. Error: ${error.message}`, job);\n }\n }\n // Use `allSettled()` because we want to wait for all to finish. We do\n // not want to stop waiting if there is a failure.\n this._closingPromise = Promise.allSettled(Array.from(this.jobs).map(j => j.promise));\n await this._closingPromise;\n this._state = types_1.BackgroundProcessManagerState.Closed;\n }\n return this._closingPromise;\n }\n /**\n * Signals the manager to start accepting work (again) and returns once\n * the manager is ready to do so.\n *\n * If the state is already `Open`, this call is a no-op.\n *\n * If the state is `Closed`, this call simply updates state and returns.\n *\n * If the state is `Closing`, this call waits for completion before it\n * updates the state and returns.\n */\n async open() {\n if (this.isClosing) {\n await this.close();\n }\n this._state = types_1.BackgroundProcessManagerState.Open;\n }\n}\nexports.BackgroundProcessManager = BackgroundProcessManager;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,wBAAwB,GAAG,MAAM;AACzC,MAAM,+BAA+B,GAAG,OAAO,CAAC,iCAAiC,CAAC;AAClF,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,wBAAwB,CAAC;AAC/B,IAAI,WAAW,GAAG;AAClB;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,6BAA6B,CAAC,IAAI;AAChE;AACA;AACA;AACA,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,EAAE;AAC7B;AACA,IAAI,GAAG,CAAC,gBAAgB,EAAE,mBAAmB,EAAE;AAC/C,QAAQ,IAAI,GAAG;AACf,QAAQ,IAAI,WAAW;AACvB,QAAQ,IAAI,OAAO,gBAAgB,KAAK,QAAQ,EAAE;AAClD,YAAY,GAAG,GAAG,SAAS;AAC3B,YAAY,WAAW,GAAG,gBAAgB;AAC1C;AACA,aAAa;AACb,YAAY,GAAG,GAAG,gBAAgB;AAClC,YAAY,WAAW,GAAG,mBAAmB;AAC7C;AACA,QAAQ,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;AACrD,QAAQ,IAAI,KAAK;AACjB,YAAY,OAAO,KAAK;AACxB,QAAQ,IAAI,GAAG,KAAK,SAAS,EAAE;AAC/B,YAAY,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;AAC5C;AACA,aAAa,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;AAC5C,YAAY,OAAO,IAAI,C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on.com, Inc. or its affiliates. All Rights Reserved.
4
5
  // SPDX-License-Identifier: Apache-2.0
5
6
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1 @@
1
- {"version":3,"file":"ConsoleLogger.js","sources":["../../../src/Logger/ConsoleLogger.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConsoleLogger = void 0;\nconst constants_1 = require(\"../constants\");\nconst types_1 = require(\"./types\");\nconst LOG_LEVELS = {\n VERBOSE: 1,\n DEBUG: 2,\n INFO: 3,\n WARN: 4,\n ERROR: 5,\n NONE: 6,\n};\n/**\n * Write logs\n * @class Logger\n */\nclass ConsoleLogger {\n /**\n * @constructor\n * @param {string} name - Name of the logger\n */\n constructor(name, level = types_1.LogType.WARN) {\n this.name = name;\n this.level = level;\n this._pluggables = [];\n }\n _padding(n) {\n return n < 10 ? '0' + n : '' + n;\n }\n _ts() {\n const dt = new Date();\n return ([this._padding(dt.getMinutes()), this._padding(dt.getSeconds())].join(':') +\n '.' +\n dt.getMilliseconds());\n }\n configure(config) {\n if (!config)\n return this._config;\n this._config = config;\n return this._config;\n }\n /**\n * Write log\n * @method\n * @memeberof Logger\n * @param {LogType|string} type - log type, default INFO\n * @param {string|object} msg - Logging message or object\n */\n _log(type, ...msg) {\n let loggerLevelName = this.level;\n if (ConsoleLogger.LOG_LEVEL) {\n loggerLevelName = ConsoleLogger.LOG_LEVEL;\n }\n if (typeof window !== 'undefined' && window.LOG_LEVEL) {\n loggerLevelName = window.LOG_LEVEL;\n }\n const loggerLevel = LOG_LEVELS[loggerLevelName];\n const typeLevel = LOG_LEVELS[type];\n if (!(typeLevel >= loggerLevel)) {\n // Do nothing if type is not greater than or equal to logger level (handle undefined)\n return;\n }\n let log = console.log.bind(console);\n if (type === types_1.LogType.ERROR && console.error) {\n log = console.error.bind(console);\n }\n if (type === types_1.LogType.WARN && console.warn) {\n log = console.warn.bind(console);\n }\n if (ConsoleLogger.BIND_ALL_LOG_LEVELS) {\n if (type === types_1.LogType.INFO && console.info) {\n log = console.info.bind(console);\n }\n if (type === types_1.LogType.DEBUG && console.debug) {\n log = console.debug.bind(console);\n }\n }\n const prefix = `[${type}] ${this._ts()} ${this.name}`;\n let message = '';\n if (msg.length === 1 && typeof msg[0] === 'string') {\n message = `${prefix} - ${msg[0]}`;\n log(message);\n }\n else if (msg.length === 1) {\n message = `${prefix} ${msg[0]}`;\n log(prefix, msg[0]);\n }\n else if (typeof msg[0] === 'string') {\n let obj = msg.slice(1);\n if (obj.length === 1) {\n obj = obj[0];\n }\n message = `${prefix} - ${msg[0]} ${obj}`;\n log(`${prefix} - ${msg[0]}`, obj);\n }\n else {\n message = `${prefix} ${msg}`;\n log(prefix, msg);\n }\n for (const plugin of this._pluggables) {\n const logEvent = { message, timestamp: Date.now() };\n plugin.pushLogs([logEvent]);\n }\n }\n /**\n * Write General log. Default to INFO\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n log(...msg) {\n this._log(types_1.LogType.INFO, ...msg);\n }\n /**\n * Write INFO log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n info(...msg) {\n this._log(types_1.LogType.INFO, ...msg);\n }\n /**\n * Write WARN log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n warn(...msg) {\n this._log(types_1.LogType.WARN, ...msg);\n }\n /**\n * Write ERROR log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n error(...msg) {\n this._log(types_1.LogType.ERROR, ...msg);\n }\n /**\n * Write DEBUG log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n debug(...msg) {\n this._log(types_1.LogType.DEBUG, ...msg);\n }\n /**\n * Write VERBOSE log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n verbose(...msg) {\n this._log(types_1.LogType.VERBOSE, ...msg);\n }\n addPluggable(pluggable) {\n if (pluggable && pluggable.getCategoryName() === constants_1.AWS_CLOUDWATCH_CATEGORY) {\n this._pluggables.push(pluggable);\n pluggable.configure(this._config);\n }\n }\n listPluggables() {\n return this._pluggables;\n }\n}\nexports.ConsoleLogger = ConsoleLogger;\nConsoleLogger.LOG_LEVEL = null;\nConsoleLogger.BIND_ALL_LOG_LEVELS = false;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,MAAM;AAC9B,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC;AAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAClC,MAAM,UAAU,GAAG;AACnB,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,IAAI,EAAE,CAAC;AACX,CAAC;AACD;AACA;AACA;AACA;AACA,MAAM,aAAa,CAAC;AACpB;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE;AACpD,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI;AACxB,QAAQ,IAAI,CAAC,KAAK,GAAG,KAAK;AAC1B,QAAQ,IAAI,CAAC,WAAW,GAAG,EAAE;AAC7B;AACA,IAAI,QAAQ,CAAC,CAAC,EAAE;AAChB,QAAQ,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC;AACxC;AACA,IAAI,GAAG,GAAG;AACV,QAAQ,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE;AAC7B,QAAQ,QAAQ,CAAC,I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C,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,KAAK,CAAC,GAAG,GAAG,EAAE;AAClB,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,KAAK,CAAC,GAAG,GAAG,EAAE;AAClB,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,GAAG,EAAE;AACpB,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC;AAClD;AACA,IAAI,YAAY,CAAC,SAAS,EAAE;AAC5B,QAAQ,IAAI,SAAS,IAAI,SAAS,CAAC,eAAe,EAAE,KAAK,WAAW,CAAC,uBAAuB,EAAE;AAC9F,YAAY,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC;AAC5C,YAAY,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;AAC7C;AACA;AACA,IAAI,cAAc,GAAG;AACrB,QAAQ,OAAO,IAAI,CAAC,WAAW;AAC/B;AACA;AACA,OAAO,CAAC,aAAa,GAAG,aAAa;AACrC,aAAa,CAAC,SAAS,GAAG,IAAI;AAC9B,aAAa,CAAC,mBAAmB,GAAG,KAAK;;"}
1
+ {"version":3,"file":"ConsoleLogger.js","sources":["../../../src/Logger/ConsoleLogger.ts"],"sourcesContent":["\"use strict\";\n/* eslint-disable no-console */\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConsoleLogger = void 0;\nconst constants_1 = require(\"../constants\");\nconst types_1 = require(\"./types\");\nconst LOG_LEVELS = {\n VERBOSE: 1,\n DEBUG: 2,\n INFO: 3,\n WARN: 4,\n ERROR: 5,\n NONE: 6,\n};\n/**\n * Write logs\n * @class Logger\n */\nclass ConsoleLogger {\n /**\n * @constructor\n * @param {string} name - Name of the logger\n */\n constructor(name, level = types_1.LogType.WARN) {\n this.name = name;\n this.level = level;\n this._pluggables = [];\n }\n _padding(n) {\n return n < 10 ? '0' + n : '' + n;\n }\n _ts() {\n const dt = new Date();\n return ([this._padding(dt.getMinutes()), this._padding(dt.getSeconds())].join(':') +\n '.' +\n dt.getMilliseconds());\n }\n configure(config) {\n if (!config)\n return this._config;\n this._config = config;\n return this._config;\n }\n /**\n * Write log\n * @method\n * @memeberof Logger\n * @param {LogType|string} type - log type, default INFO\n * @param {string|object} msg - Logging message or object\n */\n _log(type, ...msg) {\n let loggerLevelName = this.level;\n if (ConsoleLogger.LOG_LEVEL) {\n loggerLevelName = ConsoleLogger.LOG_LEVEL;\n }\n if (typeof window !== 'undefined' && window.LOG_LEVEL) {\n loggerLevelName = window.LOG_LEVEL;\n }\n const loggerLevel = LOG_LEVELS[loggerLevelName];\n const typeLevel = LOG_LEVELS[type];\n if (!(typeLevel >= loggerLevel)) {\n // Do nothing if type is not greater than or equal to logger level (handle undefined)\n return;\n }\n let log = console.log.bind(console);\n if (type === types_1.LogType.ERROR && console.error) {\n log = console.error.bind(console);\n }\n if (type === types_1.LogType.WARN && console.warn) {\n log = console.warn.bind(console);\n }\n if (ConsoleLogger.BIND_ALL_LOG_LEVELS) {\n if (type === types_1.LogType.INFO && console.info) {\n log = console.info.bind(console);\n }\n if (type === types_1.LogType.DEBUG && console.debug) {\n log = console.debug.bind(console);\n }\n }\n const prefix = `[${type}] ${this._ts()} ${this.name}`;\n let message = '';\n if (msg.length === 1 && typeof msg[0] === 'string') {\n message = `${prefix} - ${msg[0]}`;\n log(message);\n }\n else if (msg.length === 1) {\n message = `${prefix} ${msg[0]}`;\n log(prefix, msg[0]);\n }\n else if (typeof msg[0] === 'string') {\n let obj = msg.slice(1);\n if (obj.length === 1) {\n obj = obj[0];\n }\n message = `${prefix} - ${msg[0]} ${obj}`;\n log(`${prefix} - ${msg[0]}`, obj);\n }\n else {\n message = `${prefix} ${msg}`;\n log(prefix, msg);\n }\n for (const plugin of this._pluggables) {\n const logEvent = { message, timestamp: Date.now() };\n plugin.pushLogs([logEvent]);\n }\n }\n /**\n * Write General log. Default to INFO\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n log(...msg) {\n this._log(types_1.LogType.INFO, ...msg);\n }\n /**\n * Write INFO log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n info(...msg) {\n this._log(types_1.LogType.INFO, ...msg);\n }\n /**\n * Write WARN log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n warn(...msg) {\n this._log(types_1.LogType.WARN, ...msg);\n }\n /**\n * Write ERROR log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n error(...msg) {\n this._log(types_1.LogType.ERROR, ...msg);\n }\n /**\n * Write DEBUG log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n debug(...msg) {\n this._log(types_1.LogType.DEBUG, ...msg);\n }\n /**\n * Write VERBOSE log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n verbose(...msg) {\n this._log(types_1.LogType.VERBOSE, ...msg);\n }\n addPluggable(pluggable) {\n if (pluggable && pluggable.getCategoryName() === constants_1.AWS_CLOUDWATCH_CATEGORY) {\n this._pluggables.push(pluggable);\n pluggable.configure(this._config);\n }\n }\n listPluggables() {\n return this._pluggables;\n }\n}\nexports.ConsoleLogger = ConsoleLogger;\nConsoleLogger.LOG_LEVEL = null;\nConsoleLogger.BIND_ALL_LOG_LEVELS = false;\n"],"names":[],"mappings":";;AACA;AACA;AACA;AACA,MAAM,C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AAG,GAAG,EAAE;AAClB,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,GAAG,EAAE;AACpB,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC;AAClD;AACA,IAAI,YAAY,CAAC,SAAS,EAAE;AAC5B,QAAQ,IAAI,SAAS,IAAI,SAAS,CAAC,eAAe,EAAE,KAAK,WAAW,CAAC,uBAAuB,EAAE;AAC9F,YAAY,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC;AAC5C,YAAY,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;AAC7C;AACA;AACA,IAAI,cAAc,GAAG;AACrB,QAAQ,OAAO,IAAI,CAAC,WAAW;AAC/B;AACA;AACA,OAAO,CAAC,aAAa,GAAG,aAAa;AACrC,aAAa,CAAC,SAAS,GAAG,IAAI;AAC9B,aAAa,CAAC,mBAAmB,GAAG,KAAK;;"}
@@ -3,5 +3,5 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.version = void 0;
5
5
  // generated by genversion
6
- exports.version = '6.13.6-unstable.cde36a7.0+cde36a7';
6
+ exports.version = '6.13.7-unstable.b188564.0+b188564';
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.13.6-unstable.cde36a7.0+cde36a7';\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,OAAO,GAAG,MAAM;AACxB;AACA,OAAO,CAAC,OAAO,GAAG,mCAAmC;;"}
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.13.7-unstable.b188564.0+b188564';\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,OAAO,GAAG,MAAM;AACxB;AACA,OAAO,CAAC,OAAO,GAAG,mCAAmC;;"}
@@ -4,7 +4,7 @@
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getInAppMessages = void 0;
7
- const authenticated_1 = require("../../clients/handlers/authenticated");
7
+ const authenticated_1 = require("../../clients/handlers/aws/authenticated");
8
8
  const composeServiceApi_1 = require("../../clients/internal/composeServiceApi");
9
9
  const extendedEncodeURIComponent_1 = require("../../clients/middleware/signing/utils/extendedEncodeURIComponent");
10
10
  const serde_1 = require("../../clients/serde");
@@ -1 +1 @@
1
- {"version":3,"file":"getInAppMessages.js","sources":["../../../../src/awsClients/pinpoint/getInAppMessages.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.getInAppMessages = void 0;\nconst authenticated_1 = require(\"../../clients/handlers/authenticated\");\nconst composeServiceApi_1 = require(\"../../clients/internal/composeServiceApi\");\nconst extendedEncodeURIComponent_1 = require(\"../../clients/middleware/signing/utils/extendedEncodeURIComponent\");\nconst serde_1 = require(\"../../clients/serde\");\nconst amplifyUrl_1 = require(\"../../utils/amplifyUrl\");\nconst base_1 = require(\"./base\");\nconst getInAppMessagesSerializer = ({ ApplicationId = '', EndpointId = '' }, endpoint) => {\n const headers = (0, base_1.getSharedHeaders)();\n const url = new amplifyUrl_1.AmplifyUrl(endpoint.url);\n url.pathname = `v1/apps/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(ApplicationId)}/endpoints/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(EndpointId)}/inappmessages`;\n return { method: 'GET', headers, url };\n};\nconst getInAppMessagesDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = await (0, serde_1.parseJsonError)(response);\n throw error;\n }\n else {\n const { InAppMessageCampaigns } = await (0, serde_1.parseJsonBody)(response);\n return {\n InAppMessagesResponse: { InAppMessageCampaigns },\n $metadata: (0, serde_1.parseMetadata)(response),\n };\n }\n};\n/**\n * @internal\n */\nexports.getInAppMessages = (0, composeServiceApi_1.composeServiceApi)(authenticated_1.authenticatedHandler, getInAppMessagesSerializer, getInAppMessagesDeserializer, base_1.defaultConfig);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,gBAAgB,GAAG,MAAM;AACjC,MAAM,eAAe,GAAG,OAAO,CAAC,sCAAsC,CAAC;AACvE,MAAM,mBAAmB,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC/E,MAAM,4BAA4B,GAAG,OAAO,CAAC,mEAAmE,CAAC;AACjH,MAAM,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAC9C,MAAM,YAAY,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACtD,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;AAChC,MAAM,0BAA0B,GAAG,CAAC,EAAE,aAAa,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,EAAE,EAAE,QAAQ,KAAK;AAC1F,IAAI,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,gBAAgB,GAAG;AAClD,IAAI,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;AACzD,IAAI,GAAG,CAAC,QAAQ,GAAG,CAAC,QAAQ,EAAE,IAAI,4BAA4B,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAC,WAAW,EAAE,IAAI,4BAA4B,CAAC,0BAA0B,EAAE,UAAU,CAAC,CAAC,cAAc,CAAC;AAC/M,IAAI,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE;AAC1C,CAAC;AACD,MAAM,4BAA4B,GAAG,OAAO,QAAQ,KAAK;AACzD,IAAI,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,EAAE;AACpC,QAAQ,MAAM,KAAK,GAAG,MAAM,IAAI,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC;AACjE,QAAQ,MAAM,KAAK;AACnB;AACA,SAAS;AACT,QAAQ,MAAM,EAAE,qBAAqB,EAAE,GAAG,MAAM,IAAI,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC;AACpF,QAAQ,OAAO;AACf,YAAY,qBAAqB,EAAE,EAAE,qBAAqB,EAAE;AAC5D,YAAY,SAAS,EAAE,IAAI,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC;AAC3D,SAAS;AACT;AACA,CAAC;AACD;AACA;AACA;AACA,OAAO,CAAC,gBAAgB,GAAG,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,eAAe,CAAC,oBAAoB,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,CAAC,aAAa,CAAC;;"}
1
+ {"version":3,"file":"getInAppMessages.js","sources":["../../../../src/awsClients/pinpoint/getInAppMessages.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.getInAppMessages = void 0;\nconst authenticated_1 = require(\"../../clients/handlers/aws/authenticated\");\nconst composeServiceApi_1 = require(\"../../clients/internal/composeServiceApi\");\nconst extendedEncodeURIComponent_1 = require(\"../../clients/middleware/signing/utils/extendedEncodeURIComponent\");\nconst serde_1 = require(\"../../clients/serde\");\nconst amplifyUrl_1 = require(\"../../utils/amplifyUrl\");\nconst base_1 = require(\"./base\");\nconst getInAppMessagesSerializer = ({ ApplicationId = '', EndpointId = '' }, endpoint) => {\n const headers = (0, base_1.getSharedHeaders)();\n const url = new amplifyUrl_1.AmplifyUrl(endpoint.url);\n url.pathname = `v1/apps/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(ApplicationId)}/endpoints/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(EndpointId)}/inappmessages`;\n return { method: 'GET', headers, url };\n};\nconst getInAppMessagesDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = await (0, serde_1.parseJsonError)(response);\n throw error;\n }\n else {\n const { InAppMessageCampaigns } = await (0, serde_1.parseJsonBody)(response);\n return {\n InAppMessagesResponse: { InAppMessageCampaigns },\n $metadata: (0, serde_1.parseMetadata)(response),\n };\n }\n};\n/**\n * @internal\n */\nexports.getInAppMessages = (0, composeServiceApi_1.composeServiceApi)(authenticated_1.authenticatedHandler, getInAppMessagesSerializer, getInAppMessagesDeserializer, base_1.defaultConfig);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,gBAAgB,GAAG,MAAM;AACjC,MAAM,eAAe,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC3E,MAAM,mBAAmB,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC/E,MAAM,4BAA4B,GAAG,OAAO,CAAC,mEAAmE,CAAC;AACjH,MAAM,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAC9C,MAAM,YAAY,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACtD,MAAM,MAAM,GAAG,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Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.putEvents = void 0;
7
- const authenticated_1 = require("../../clients/handlers/authenticated");
7
+ const authenticated_1 = require("../../clients/handlers/aws/authenticated");
8
8
  const composeServiceApi_1 = require("../../clients/internal/composeServiceApi");
9
9
  const extendedEncodeURIComponent_1 = require("../../clients/middleware/signing/utils/extendedEncodeURIComponent");
10
10
  const serde_1 = require("../../clients/serde");
@@ -1 +1 @@
1
- {"version":3,"file":"putEvents.js","sources":["../../../../src/awsClients/pinpoint/putEvents.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.putEvents = void 0;\nconst authenticated_1 = require(\"../../clients/handlers/authenticated\");\nconst composeServiceApi_1 = require(\"../../clients/internal/composeServiceApi\");\nconst extendedEncodeURIComponent_1 = require(\"../../clients/middleware/signing/utils/extendedEncodeURIComponent\");\nconst serde_1 = require(\"../../clients/serde\");\nconst amplifyUrl_1 = require(\"../../utils/amplifyUrl\");\nconst base_1 = require(\"./base\");\nconst errorHelpers_1 = require(\"./errorHelpers\");\nconst putEventsSerializer = ({ ApplicationId, EventsRequest }, endpoint) => {\n (0, errorHelpers_1.assert)(!!ApplicationId, errorHelpers_1.PinpointValidationErrorCode.NoAppId);\n const headers = (0, base_1.getSharedHeaders)();\n const url = new amplifyUrl_1.AmplifyUrl(endpoint.url);\n url.pathname = `v1/apps/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(ApplicationId)}/events`;\n const body = JSON.stringify(EventsRequest ?? {});\n return { method: 'POST', headers, url, body };\n};\nconst putEventsDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = await (0, serde_1.parseJsonError)(response);\n throw error;\n }\n else {\n const { Results } = await (0, serde_1.parseJsonBody)(response);\n return {\n EventsResponse: { Results },\n $metadata: (0, serde_1.parseMetadata)(response),\n };\n }\n};\n/**\n * @internal\n */\nexports.putEvents = (0, composeServiceApi_1.composeServiceApi)(authenticated_1.authenticatedHandler, putEventsSerializer, putEventsDeserializer, base_1.defaultConfig);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,SAAS,GAAG,MAAM;AAC1B,MAAM,eAAe,GAAG,OAAO,CAAC,sCAAsC,CAAC;AACvE,MAAM,mBAAmB,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC/E,MAAM,4BAA4B,GAAG,OAAO,CAAC,mEAAmE,CAAC;AACjH,MAAM,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAC9C,MAAM,YAAY,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACtD,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;AAChC,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAChD,MAAM,mBAAmB,GAAG,CAAC,EAAE,aAAa,EAAE,aAAa,EAAE,EAAE,QAAQ,KAAK;AAC5E,IAAI,IAAI,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,aAAa,EAAE,cAAc,CAAC,2BAA2B,CAAC,OAAO,CAAC;AACnG,IAAI,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,gBAAgB,GAAG;AAClD,IAAI,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;AACzD,IAAI,GAAG,CAAC,QAAQ,GAAG,CAAC,QAAQ,EAAE,IAAI,4BAA4B,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC;AAClH,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,IAAI,EAAE,CAAC;AACpD,IAAI,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE;AACjD,CAAC;AACD,MAAM,qBAAqB,GAAG,OAAO,QAAQ,KAAK;AAClD,IAAI,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,EAAE;AACpC,QAAQ,MAAM,KAAK,GAAG,MAAM,IAAI,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC;AACjE,QAAQ,MAAM,KAAK;AACnB;AACA,SAAS;AACT,QAAQ,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC;AACtE,QAAQ,OAAO;AACf,YAAY,cAAc,EAAE,EAAE,OAAO,EAAE;AACvC,YAAY,SAAS,EAAE,IAAI,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC;AAC3D,SAAS;AACT;AACA,CAAC;AACD;AACA;AACA;AACA,OAAO,CAAC,SAAS,GAAG,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,eAAe,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,CAAC,aAAa,CAAC;;"}
1
+ {"version":3,"file":"putEvents.js","sources":["../../../../src/awsClients/pinpoint/putEvents.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.putEvents = void 0;\nconst authenticated_1 = require(\"../../clients/handlers/aws/authenticated\");\nconst composeServiceApi_1 = require(\"../../clients/internal/composeServiceApi\");\nconst extendedEncodeURIComponent_1 = require(\"../../clients/middleware/signing/utils/extendedEncodeURIComponent\");\nconst serde_1 = require(\"../../clients/serde\");\nconst amplifyUrl_1 = require(\"../../utils/amplifyUrl\");\nconst base_1 = require(\"./base\");\nconst errorHelpers_1 = require(\"./errorHelpers\");\nconst putEventsSerializer = ({ ApplicationId, EventsRequest }, endpoint) => {\n (0, errorHelpers_1.assert)(!!ApplicationId, errorHelpers_1.PinpointValidationErrorCode.NoAppId);\n const headers = (0, base_1.getSharedHeaders)();\n const url = new amplifyUrl_1.AmplifyUrl(endpoint.url);\n url.pathname = `v1/apps/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(ApplicationId)}/events`;\n const body = JSON.stringify(EventsRequest ?? {});\n return { method: 'POST', headers, url, body };\n};\nconst putEventsDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = await (0, serde_1.parseJsonError)(response);\n throw error;\n }\n else {\n const { Results } = await (0, serde_1.parseJsonBody)(response);\n return {\n EventsResponse: { Results },\n $metadata: (0, serde_1.parseMetadata)(response),\n };\n }\n};\n/**\n * @internal\n */\nexports.putEvents = (0, composeServiceApi_1.composeServiceApi)(authenticated_1.authenticatedHandler, putEventsSerializer, putEventsDeserializer, base_1.defaultConfig);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,SAAS,GAAG,MAAM;AAC1B,MAAM,eAAe,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC3E,MAAM,mBAAmB,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC/E,MAAM,4BAA4B,GAAG,OAAO,CAAC,mEAAmE,CAAC;AACjH,MAAM,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAC9C,MAAM,YAAY,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACtD,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;AAChC,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAChD,MAAM,mBAAmB,GAAG,CAAC,EAAE,aAAa,EAAE,aAAa,EAAE,EAAE,QAAQ,KAAK;AAC5E,IAAI,IAAI,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,aAAa,EAAE,cAAc,CAAC,2BAA2B,CAAC,OAAO,CAAC;AACnG,IAAI,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,gBAAgB,GAAG;AAClD,IAAI,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;AACzD,IAAI,GAAG,CAAC,QAAQ,GAAG,CAAC,QAAQ,EAAE,IAAI,4BAA4B,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC;AAClH,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,IAAI,EAAE,CAAC;AACpD,IAAI,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE;AACjD,CAAC;AACD,MAAM,qBAAqB,GAAG,OAAO,QAAQ,KAAK;AAClD,IAAI,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,EAAE;AACpC,QAAQ,MAAM,KAAK,GAAG,MAAM,IAAI,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC;AACjE,QAAQ,MAAM,KAAK;AACnB;AACA,SAAS;AACT,QAAQ,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC;AACtE,QAAQ,OAAO;AACf,YAAY,cAAc,EAAE,EAAE,OAAO,EAAE;AACvC,YAAY,SAAS,EAAE,IAAI,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC;AAC3D,SAAS;AACT;AACA,CAAC;AACD;AACA;AACA;AACA,OAAO,CAAC,SAAS,GAAG,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,eAAe,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,CAAC,aAAa,CAAC;;"}
@@ -4,7 +4,7 @@
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.updateEndpoint = void 0;
7
- const authenticated_1 = require("../../clients/handlers/authenticated");
7
+ const authenticated_1 = require("../../clients/handlers/aws/authenticated");
8
8
  const composeServiceApi_1 = require("../../clients/internal/composeServiceApi");
9
9
  const extendedEncodeURIComponent_1 = require("../../clients/middleware/signing/utils/extendedEncodeURIComponent");
10
10
  const serde_1 = require("../../clients/serde");
@@ -1 +1 @@
1
- {"version":3,"file":"updateEndpoint.js","sources":["../../../../src/awsClients/pinpoint/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 authenticated_1 = require(\"../../clients/handlers/authenticated\");\nconst composeServiceApi_1 = require(\"../../clients/internal/composeServiceApi\");\nconst extendedEncodeURIComponent_1 = require(\"../../clients/middleware/signing/utils/extendedEncodeURIComponent\");\nconst serde_1 = require(\"../../clients/serde\");\nconst amplifyUrl_1 = require(\"../../utils/amplifyUrl\");\nconst base_1 = require(\"./base\");\nconst updateEndpointSerializer = ({ ApplicationId = '', EndpointId = '', EndpointRequest }, endpoint) => {\n const headers = (0, base_1.getSharedHeaders)();\n const url = new amplifyUrl_1.AmplifyUrl(endpoint.url);\n url.pathname = `v1/apps/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(ApplicationId)}/endpoints/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(EndpointId)}`;\n const body = JSON.stringify(EndpointRequest);\n return { method: 'PUT', headers, url, body };\n};\nconst updateEndpointDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = await (0, serde_1.parseJsonError)(response);\n throw error;\n }\n else {\n const { Message, RequestID } = await (0, serde_1.parseJsonBody)(response);\n return {\n MessageBody: {\n Message,\n RequestID,\n },\n $metadata: (0, serde_1.parseMetadata)(response),\n };\n }\n};\n/**\n * @internal\n */\nexports.updateEndpoint = (0, composeServiceApi_1.composeServiceApi)(authenticated_1.authenticatedHandler, updateEndpointSerializer, updateEndpointDeserializer, base_1.defaultConfig);\n"],"names":[],"m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Q,CAAC;AACjE,QAAQ,MAAM,KAAK;AACnB;AACA,SAAS;AACT,QAAQ,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,IAAI,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC;AACjF,QAAQ,OAAO;AACf,YAAY,WAAW,EAAE;AACzB,gBAAgB,OAAO;AACvB,gBAAgB,SAAS;AACzB,aAAa;AACb,YAAY,SAAS,EAAE,IAAI,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC;AAC3D,SAAS;AACT;AACA,CAAC;AACD;AACA;AACA;AACA,OAAO,CAAC,cAAc,GAAG,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,eAAe,CAAC,oBAAoB,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,CAAC,aAAa,CAAC;;"}
1
+ {"version":3,"file":"updateEndpoint.js","sources":["../../../../src/awsClients/pinpoint/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 authenticated_1 = require(\"../../clients/handlers/aws/authenticated\");\nconst composeServiceApi_1 = require(\"../../clients/internal/composeServiceApi\");\nconst extendedEncodeURIComponent_1 = require(\"../../clients/middleware/signing/utils/extendedEncodeURIComponent\");\nconst serde_1 = require(\"../../clients/serde\");\nconst amplifyUrl_1 = require(\"../../utils/amplifyUrl\");\nconst base_1 = require(\"./base\");\nconst updateEndpointSerializer = ({ ApplicationId = '', EndpointId = '', EndpointRequest }, endpoint) => {\n const headers = (0, base_1.getSharedHeaders)();\n const url = new amplifyUrl_1.AmplifyUrl(endpoint.url);\n url.pathname = `v1/apps/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(ApplicationId)}/endpoints/${(0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(EndpointId)}`;\n const body = JSON.stringify(EndpointRequest);\n return { method: 'PUT', headers, url, body };\n};\nconst updateEndpointDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = await (0, serde_1.parseJsonError)(response);\n throw error;\n }\n else {\n const { Message, RequestID } = await (0, serde_1.parseJsonBody)(response);\n return {\n MessageBody: {\n Message,\n RequestID,\n },\n $metadata: (0, serde_1.parseMetadata)(response),\n };\n }\n};\n/**\n * @internal\n */\nexports.updateEndpoint = (0, composeServiceApi_1.composeServiceApi)(authenticated_1.authenticatedHandler, updateEndpointSerializer, updateEndpointDeserializer, base_1.defaultConfig);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,cAAc,GAAG,MAAM;AAC/B,MAAM,eAAe,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC3E,MAAM,mBAAmB,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAC/E,MAAM,4BAA4B,GAAG,OAAO,CAAC,mEAAmE,CAAC;AACjH,MAAM,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAC9C,MAAM,YAAY,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACtD,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;AAChC,MAAM,wBAAwB,GAAG,CAAC,EAAE,aAAa,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,EAAE,eAAe,EAAE,EAAE,QAAQ,KAAK;AACzG,IAAI,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,gBAAgB,GAAG;AAClD,IAAI,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;AACzD,IAAI,GAAG,CAAC,QAAQ,GAAG,CAAC,QAAQ,EAAE,IAAI,4BAA4B,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAC,WAAW,EAAE,IAAI,4BAA4B,CAAC,0BAA0B,EAAE,UAAU,CAAC,CAAC,CAAC;AACjM,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC;AAChD,IAAI,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE;AAChD,CAAC;AACD,MAAM,0BAA0B,GAAG,OAAO,QAAQ,KAAK;AACvD,IAAI,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,EAAE;AACpC,QAAQ,MAAM,KAAK,GAAG,MAAM,IAAI,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC;AACjE,QAAQ,MAAM,KAAK;AACnB;AACA,SAAS;AACT,QAAQ,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,IAAI,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC;AACjF,QAAQ,OAAO;AACf,YAAY,WAAW,EAAE;AACzB,gBAAgB,OAAO;AACvB,gBAAgB,SAAS;AACzB,aAAa;AACb,YAAY,SAAS,EAAE,IAAI,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC;AAC3D,SAAS;AACT;AACA,CAAC;AACD;AACA;AACA;AACA,OAAO,CAAC,cAAc,GAAG,IAAI,mBAAmB,CAAC,iBAAiB,EAAE,eAAe,CAAC,oBAAoB,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,CAAC,aAAa,CAAC;;"}
@@ -1,17 +1,19 @@
1
1
  'use strict';
2
2
 
3
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
- // SPDX-License-Identifier: Apache-2.0
5
3
  Object.defineProperty(exports, "__esModule", { value: true });
6
4
  exports.authenticatedHandler = void 0;
7
- const retry_1 = require("../middleware/retry");
8
- const signing_1 = require("../middleware/signing");
9
- const userAgent_1 = require("../middleware/userAgent");
10
- const composeTransferHandler_1 = require("../internal/composeTransferHandler");
11
- const fetch_1 = require("./fetch");
5
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
6
+ // SPDX-License-Identifier: Apache-2.0
7
+ const retry_1 = require("../../middleware/retry");
8
+ const signing_1 = require("../../middleware/signing");
9
+ const userAgent_1 = require("../../middleware/userAgent");
10
+ const composeTransferHandler_1 = require("../../internal/composeTransferHandler");
11
+ const fetch_1 = require("../fetch");
12
12
  exports.authenticatedHandler = (0, composeTransferHandler_1.composeTransferHandler)(fetch_1.fetchTransferHandler, [
13
13
  userAgent_1.userAgentMiddlewareFactory,
14
+ retry_1.amzSdkInvocationIdHeaderMiddlewareFactory,
14
15
  retry_1.retryMiddlewareFactory,
16
+ retry_1.amzSdkRequestHeaderMiddlewareFactory,
15
17
  signing_1.signingMiddlewareFactory,
16
18
  ]);
17
19
  //# sourceMappingURL=authenticated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authenticated.js","sources":["../../../../../src/clients/handlers/aws/authenticated.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.authenticatedHandler = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst retry_1 = require(\"../../middleware/retry\");\nconst signing_1 = require(\"../../middleware/signing\");\nconst userAgent_1 = require(\"../../middleware/userAgent\");\nconst composeTransferHandler_1 = require(\"../../internal/composeTransferHandler\");\nconst fetch_1 = require(\"../fetch\");\nexports.authenticatedHandler = (0, composeTransferHandler_1.composeTransferHandler)(fetch_1.fetchTransferHandler, [\n userAgent_1.userAgentMiddlewareFactory,\n retry_1.amzSdkInvocationIdHeaderMiddlewareFactory,\n retry_1.retryMiddlewareFactory,\n retry_1.amzSdkRequestHeaderMiddlewareFactory,\n signing_1.signingMiddlewareFactory,\n]);\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,oBAAoB,GAAG,MAAM;AACrC;AACA;AACA,MAAM,OAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACjD,MAAM,SAAS,GAAG,OAAO,CAAC,0BAA0B,CAAC;AACrD,MAAM,WAAW,GAAG,OAAO,CAAC,4BAA4B,CAAC;AACzD,MAAM,wBAAwB,GAAG,OAAO,CAAC,uCAAuC,CAAC;AACjF,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,OAAO,CAAC,oBAAoB,GAAG,IAAI,wBAAwB,CAAC,sBAAsB,EAAE,OAAO,CAAC,oBAAoB,EAAE;AAClH,IAAI,WAAW,CAAC,0BAA0B;AAC1C,IAAI,OAAO,CAAC,yCAAyC;AACrD,IAAI,OAAO,CAAC,sBAAsB;AAClC,IAAI,OAAO,CAAC,oCAAoC;AAChD,IAAI,SAAS,CAAC,wBAAwB;AACtC,CAAC,CAAC;;"}
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.unauthenticatedHandler = void 0;
7
+ const retry_1 = require("../../middleware/retry");
8
+ const userAgent_1 = require("../../middleware/userAgent");
9
+ const composeTransferHandler_1 = require("../../internal/composeTransferHandler");
10
+ const fetch_1 = require("../fetch");
11
+ exports.unauthenticatedHandler = (0, composeTransferHandler_1.composeTransferHandler)(fetch_1.fetchTransferHandler, [
12
+ userAgent_1.userAgentMiddlewareFactory,
13
+ retry_1.amzSdkInvocationIdHeaderMiddlewareFactory,
14
+ retry_1.retryMiddlewareFactory,
15
+ retry_1.amzSdkRequestHeaderMiddlewareFactory,
16
+ ]);
17
+ //# sourceMappingURL=unauthenticated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unauthenticated.js","sources":["../../../../../src/clients/handlers/aws/unauthenticated.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.unauthenticatedHandler = void 0;\nconst retry_1 = require(\"../../middleware/retry\");\nconst userAgent_1 = require(\"../../middleware/userAgent\");\nconst composeTransferHandler_1 = require(\"../../internal/composeTransferHandler\");\nconst fetch_1 = require(\"../fetch\");\nexports.unauthenticatedHandler = (0, composeTransferHandler_1.composeTransferHandler)(fetch_1.fetchTransferHandler, [\n userAgent_1.userAgentMiddlewareFactory,\n retry_1.amzSdkInvocationIdHeaderMiddlewareFactory,\n retry_1.retryMiddlewareFactory,\n retry_1.amzSdkRequestHeaderMiddlewareFactory,\n]);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,sBAAsB,GAAG,MAAM;AACvC,MAAM,OAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACjD,MAAM,WAAW,GAAG,OAAO,CAAC,4BAA4B,CAAC;AACzD,MAAM,wBAAwB,GAAG,OAAO,CAAC,uCAAuC,CAAC;AACjF,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,OAAO,CAAC,sBAAsB,GAAG,IAAI,wBAAwB,CAAC,sBAAsB,EAAE,OAAO,CAAC,oBAAoB,EAAE;AACpH,IAAI,WAAW,CAAC,0BAA0B;AAC1C,IAAI,OAAO,CAAC,yCAAyC;AACrD,IAAI,OAAO,CAAC,sBAAsB;AAClC,IAAI,OAAO,CAAC,oCAAoC;AAChD,CAAC,CAAC;;"}
@@ -3,15 +3,15 @@
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.withMemoization = exports.parseMetadata = exports.parseJsonError = exports.parseJsonBody = exports.userAgentMiddlewareFactory = exports.retryMiddlewareFactory = exports.jitteredBackoff = exports.getRetryDecider = exports.signingMiddlewareFactory = exports.extendedEncodeURIComponent = exports.EMPTY_SHA256_HASH = exports.signRequest = exports.presignUrl = exports.getHashedPayload = exports.authenticatedHandler = exports.unauthenticatedHandler = exports.fetchTransferHandler = exports.getDnsSuffix = void 0;
6
+ exports.withMemoization = exports.parseMetadata = exports.parseJsonError = exports.parseJsonBody = exports.userAgentMiddlewareFactory = exports.amzSdkRequestHeaderMiddlewareFactory = exports.amzSdkInvocationIdHeaderMiddlewareFactory = exports.retryMiddlewareFactory = exports.jitteredBackoff = exports.getRetryDecider = exports.signingMiddlewareFactory = exports.extendedEncodeURIComponent = exports.EMPTY_SHA256_HASH = exports.signRequest = exports.presignUrl = exports.getHashedPayload = exports.authenticatedHandler = exports.unauthenticatedHandler = exports.fetchTransferHandler = exports.getDnsSuffix = void 0;
7
7
  const tslib_1 = require("tslib");
8
8
  var endpoints_1 = require("./endpoints");
9
9
  Object.defineProperty(exports, "getDnsSuffix", { enumerable: true, get: function () { return endpoints_1.getDnsSuffix; } });
10
10
  var fetch_1 = require("./handlers/fetch");
11
11
  Object.defineProperty(exports, "fetchTransferHandler", { enumerable: true, get: function () { return fetch_1.fetchTransferHandler; } });
12
- var unauthenticated_1 = require("./handlers/unauthenticated");
12
+ var unauthenticated_1 = require("./handlers/aws/unauthenticated");
13
13
  Object.defineProperty(exports, "unauthenticatedHandler", { enumerable: true, get: function () { return unauthenticated_1.unauthenticatedHandler; } });
14
- var authenticated_1 = require("./handlers/authenticated");
14
+ var authenticated_1 = require("./handlers/aws/authenticated");
15
15
  Object.defineProperty(exports, "authenticatedHandler", { enumerable: true, get: function () { return authenticated_1.authenticatedHandler; } });
16
16
  var signatureV4_1 = require("./middleware/signing/signer/signatureV4");
17
17
  Object.defineProperty(exports, "getHashedPayload", { enumerable: true, get: function () { return signatureV4_1.getHashedPayload; } });
@@ -27,6 +27,8 @@ var retry_1 = require("./middleware/retry");
27
27
  Object.defineProperty(exports, "getRetryDecider", { enumerable: true, get: function () { return retry_1.getRetryDecider; } });
28
28
  Object.defineProperty(exports, "jitteredBackoff", { enumerable: true, get: function () { return retry_1.jitteredBackoff; } });
29
29
  Object.defineProperty(exports, "retryMiddlewareFactory", { enumerable: true, get: function () { return retry_1.retryMiddlewareFactory; } });
30
+ Object.defineProperty(exports, "amzSdkInvocationIdHeaderMiddlewareFactory", { enumerable: true, get: function () { return retry_1.amzSdkInvocationIdHeaderMiddlewareFactory; } });
31
+ Object.defineProperty(exports, "amzSdkRequestHeaderMiddlewareFactory", { enumerable: true, get: function () { return retry_1.amzSdkRequestHeaderMiddlewareFactory; } });
30
32
  var userAgent_1 = require("./middleware/userAgent");
31
33
  Object.defineProperty(exports, "userAgentMiddlewareFactory", { enumerable: true, get: function () { return userAgent_1.userAgentMiddlewareFactory; } });
32
34
  var serde_1 = require("./serde");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/clients/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.withMemoization = exports.parseMetadata = exports.parseJsonError = exports.parseJsonBody = exports.userAgentMiddlewareFactory = exports.retryMiddlewareFactory = exports.jitteredBackoff = exports.getRetryDecider = exports.signingMiddlewareFactory = exports.extendedEncodeURIComponent = exports.EMPTY_SHA256_HASH = exports.signRequest = exports.presignUrl = exports.getHashedPayload = exports.authenticatedHandler = exports.unauthenticatedHandler = exports.fetchTransferHandler = exports.getDnsSuffix = void 0;\nconst tslib_1 = require(\"tslib\");\nvar endpoints_1 = require(\"./endpoints\");\nObject.defineProperty(exports, \"getDnsSuffix\", { enumerable: true, get: function () { return endpoints_1.getDnsSuffix; } });\nvar fetch_1 = require(\"./handlers/fetch\");\nObject.defineProperty(exports, \"fetchTransferHandler\", { enumerable: true, get: function () { return fetch_1.fetchTransferHandler; } });\nvar unauthenticated_1 = require(\"./handlers/unauthenticated\");\nObject.defineProperty(exports, \"unauthenticatedHandler\", { enumerable: true, get: function () { return unauthenticated_1.unauthenticatedHandler; } });\nvar authenticated_1 = require(\"./handlers/authenticated\");\nObject.defineProperty(exports, \"authenticatedHandler\", { enumerable: true, get: function () { return authenticated_1.authenticatedHandler; } });\nvar signatureV4_1 = require(\"./middleware/signing/signer/signatureV4\");\nObject.defineProperty(exports, \"getHashedPayload\", { enumerable: true, get: function () { return signatureV4_1.getHashedPayload; } });\nObject.defineProperty(exports, \"presignUrl\", { enumerable: true, get: function () { return signatureV4_1.presignUrl; } });\nObject.defineProperty(exports, \"signRequest\", { enumerable: true, get: function () { return signatureV4_1.signRequest; } });\nvar constants_1 = require(\"./middleware/signing/signer/signatureV4/constants\");\nObject.defineProperty(exports, \"EMPTY_SHA256_HASH\", { enumerable: true, get: function () { return constants_1.EMPTY_HASH; } });\nvar extendedEncodeURIComponent_1 = require(\"./middleware/signing/utils/extendedEncodeURIComponent\");\nObject.defineProperty(exports, \"extendedEncodeURIComponent\", { enumerable: true, get: function () { return extendedEncodeURIComponent_1.extendedEncodeURIComponent; } });\nvar signing_1 = require(\"./middleware/signing\");\nObject.defineProperty(exports, \"signingMiddlewareFactory\", { enumerable: true, get: function () { return signing_1.signingMiddlewareFactory; } });\nvar retry_1 = require(\"./middleware/retry\");\nObject.defineProperty(exports, \"getRetryDecider\", { enumerable: true, get: function () { return retry_1.getRetryDecider; } });\nObject.defineProperty(exports, \"jitteredBackoff\", { enumerable: true, get: function () { return retry_1.jitteredBackoff; } });\nObject.defineProperty(exports, \"retryMiddlewareFactory\", { enumerable: true, get: function () { return retry_1.retryMiddlewareFactory; } });\nvar userAgent_1 = require(\"./middleware/userAgent\");\nObject.defineProperty(exports, \"userAgentMiddlewareFactory\", { enumerable: true, get: function () { return userAgent_1.userAgentMiddlewareFactory; } });\nvar serde_1 = require(\"./serde\");\nObject.defineProperty(exports, \"parseJsonBody\", { enumerable: true, get: function () { return serde_1.parseJsonBody; } });\nObject.defineProperty(exports, \"parseJsonError\", { enumerable: true, get: function () { return serde_1.parseJsonError; } });\nObject.defineProperty(exports, \"parseMetadata\", { enumerable: true, get: function () { return serde_1.parseMetadata; } });\nvar memoization_1 = require(\"./utils/memoization\");\nObject.defineProperty(exports, \"withMemoization\", { enumerable: true, get: function () { return memoization_1.withMemoization; } });\ntslib_1.__exportStar(require(\"./types\"), exports);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,YAAY,GAAG,MAAM;AACngB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAChC,IAAI,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AACxC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,WAAW,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC;AAC3H,IAAI,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC;AACzC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAA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c,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;AACzH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC;AAC3H,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;AACzH,IAAI,aAAa,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAClD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,aAAa,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC;AACnI,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/clients/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.withMemoization = exports.parseMetadata = exports.parseJsonError = exports.parseJsonBody = exports.userAgentMiddlewareFactory = exports.amzSdkRequestHeaderMiddlewareFactory = exports.amzSdkInvocationIdHeaderMiddlewareFactory = exports.retryMiddlewareFactory = exports.jitteredBackoff = exports.getRetryDecider = exports.signingMiddlewareFactory = exports.extendedEncodeURIComponent = exports.EMPTY_SHA256_HASH = exports.signRequest = exports.presignUrl = exports.getHashedPayload = exports.authenticatedHandler = exports.unauthenticatedHandler = exports.fetchTransferHandler = exports.getDnsSuffix = void 0;\nconst tslib_1 = require(\"tslib\");\nvar endpoints_1 = require(\"./endpoints\");\nObject.defineProperty(exports, \"getDnsSuffix\", { enumerable: true, get: function () { return endpoints_1.getDnsSuffix; } });\nvar fetch_1 = require(\"./handlers/fetch\");\nObject.defineProperty(exports, \"fetchTransferHandler\", { enumerable: true, get: function () { return fetch_1.fetchTransferHandler; } });\nvar unauthenticated_1 = require(\"./handlers/aws/unauthenticated\");\nObject.defineProperty(exports, \"unauthenticatedHandler\", { enumerable: true, get: function () { return unauthenticated_1.unauthenticatedHandler; } });\nvar authenticated_1 = require(\"./handlers/aws/authenticated\");\nObject.defineProperty(exports, \"authenticatedHandler\", { enumerable: true, get: function () { return authenticated_1.authenticatedHandler; } });\nvar signatureV4_1 = require(\"./middleware/signing/signer/signatureV4\");\nObject.defineProperty(exports, \"getHashedPayload\", { enumerable: true, get: function () { return signatureV4_1.getHashedPayload; } });\nObject.defineProperty(exports, \"presignUrl\", { enumerable: true, get: function () { return signatureV4_1.presignUrl; } });\nObject.defineProperty(exports, \"signRequest\", { enumerable: true, get: function () { return signatureV4_1.signRequest; } });\nvar constants_1 = require(\"./middleware/signing/signer/signatureV4/constants\");\nObject.defineProperty(exports, \"EMPTY_SHA256_HASH\", { enumerable: true, get: function () { return constants_1.EMPTY_HASH; } });\nvar extendedEncodeURIComponent_1 = require(\"./middleware/signing/utils/extendedEncodeURIComponent\");\nObject.defineProperty(exports, \"extendedEncodeURIComponent\", { enumerable: true, get: function () { return extendedEncodeURIComponent_1.extendedEncodeURIComponent; } });\nvar signing_1 = require(\"./middleware/signing\");\nObject.defineProperty(exports, \"signingMiddlewareFactory\", { enumerable: true, get: function () { return signing_1.signingMiddlewareFactory; } });\nvar retry_1 = require(\"./middleware/retry\");\nObject.defineProperty(exports, \"getRetryDecider\", { enumerable: true, get: function () { return retry_1.getRetryDecider; } });\nObject.defineProperty(exports, \"jitteredBackoff\", { enumerable: true, get: function () { return retry_1.jitteredBackoff; } });\nObject.defineProperty(exports, \"retryMiddlewareFactory\", { enumerable: true, get: function () { return retry_1.retryMiddlewareFactory; } });\nObject.defineProperty(exports, \"amzSdkInvocationIdHeaderMiddlewareFactory\", { enumerable: true, get: function () { return retry_1.amzSdkInvocationIdHeaderMiddlewareFactory; } });\nObject.defineProperty(exports, \"amzSdkRequestHeaderMiddlewareFactory\", { enumerable: true, get: function () { return retry_1.amzSdkRequestHeaderMiddlewareFactory; } });\nvar userAgent_1 = require(\"./middleware/userAgent\");\nObject.defineProperty(exports, \"userAgentMiddlewareFactory\", { enumerable: true, get: function () { return userAgent_1.userAgentMiddlewareFactory; } });\nvar serde_1 = require(\"./serde\");\nObject.defineProperty(exports, \"parseJsonBody\", { enumerable: true, get: function () { return serde_1.parseJsonBody; } });\nObject.defineProperty(exports, \"parseJsonError\", { enumerable: true, get: function () { return serde_1.parseJsonError; } });\nObject.defineProperty(exports, \"parseMetadata\", { enumerable: true, get: function () { return serde_1.parseMetadata; } });\nvar memoization_1 = require(\"./utils/memoization\");\nObject.defineProperty(exports, \"withMemoization\", { enumerable: true, get: function () { return memoization_1.withMemoization; } });\ntslib_1.__exportStar(require(\"./types\"), exports);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,oCAAoC,GAAG,OAAO,CAAC,yCAAyC,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,gBA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AI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;AACzH,IAAI,aAAa,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAClD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,aAAa,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC;AACnI,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;;"}
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.amzSdkInvocationIdHeaderMiddlewareFactory = void 0;
7
+ const libraryUtils_1 = require("../../../libraryUtils");
8
+ const constants_1 = require("./constants");
9
+ /**
10
+ * Middleware injects a UUID string to `amz-sdk-invocation-id` header.
11
+ * if the header is not set already. This header is helpful to provide
12
+ * observability to group the requests caused by automatic retry.
13
+ *
14
+ * This middleware is standalone because of extra UUID dependency, we will
15
+ * NOT use this middleware for API categories.
16
+ *
17
+ * Ref: https://sdk.amazonaws.com/kotlin/api/smithy-kotlin/api/1.0.9/http-client/aws.smithy.kotlin.runtime.http.operation/-http-operation-context/-sdk-invocation-id.html
18
+ */
19
+ const amzSdkInvocationIdHeaderMiddlewareFactory = () => next => {
20
+ return async function amzSdkInvocationIdHeaderMiddleware(request) {
21
+ if (!request.headers[constants_1.AMZ_SDK_INVOCATION_ID_HEADER]) {
22
+ request.headers[constants_1.AMZ_SDK_INVOCATION_ID_HEADER] = (0, libraryUtils_1.amplifyUuid)();
23
+ }
24
+ return next(request);
25
+ };
26
+ };
27
+ exports.amzSdkInvocationIdHeaderMiddlewareFactory = amzSdkInvocationIdHeaderMiddlewareFactory;
28
+ //# sourceMappingURL=amzSdkInvocationIdHeaderMiddleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amzSdkInvocationIdHeaderMiddleware.js","sources":["../../../../../src/clients/middleware/retry/amzSdkInvocationIdHeaderMiddleware.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.amzSdkInvocationIdHeaderMiddlewareFactory = void 0;\nconst libraryUtils_1 = require(\"../../../libraryUtils\");\nconst constants_1 = require(\"./constants\");\n/**\n * Middleware injects a UUID string to `amz-sdk-invocation-id` header.\n * if the header is not set already. This header is helpful to provide\n * observability to group the requests caused by automatic retry.\n *\n * This middleware is standalone because of extra UUID dependency, we will\n * NOT use this middleware for API categories.\n *\n * Ref: https://sdk.amazonaws.com/kotlin/api/smithy-kotlin/api/1.0.9/http-client/aws.smithy.kotlin.runtime.http.operation/-http-operation-context/-sdk-invocation-id.html\n */\nconst amzSdkInvocationIdHeaderMiddlewareFactory = () => next => {\n return async function amzSdkInvocationIdHeaderMiddleware(request) {\n if (!request.headers[constants_1.AMZ_SDK_INVOCATION_ID_HEADER]) {\n request.headers[constants_1.AMZ_SDK_INVOCATION_ID_HEADER] = (0, libraryUtils_1.amplifyUuid)();\n }\n return next(request);\n };\n};\nexports.amzSdkInvocationIdHeaderMiddlewareFactory = amzSdkInvocationIdHeaderMiddlewareFactory;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,yCAAyC,GAAG,MAAM;AAC1D,MAAM,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC;AACvD,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,yCAAyC,GAAG,MAAM,IAAI,IAAI;AAChE,IAAI,OAAO,eAAe,kCAAkC,CAAC,OAAO,EAAE;AACtE,QAAQ,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,4BAA4B,CAAC,EAAE;AACxE,YAAY,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,4BAA4B,CAAC,GAAG,IAAI,cAAc,CAAC,WAAW,GAAG;AACzG;AACA,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,CAAC;AACD,OAAO,CAAC,yCAAyC,GAAG,yCAAyC;;"}
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.amzSdkRequestHeaderMiddlewareFactory = void 0;
7
+ const constants_1 = require("./constants");
8
+ /**
9
+ * Middleware injects `amz-sdk-request` header to indicate the retry state at the time an HTTP request is made.
10
+ * This middleware should co-exist with retryMiddleware as it relies on the retryAttempts value in middleware context
11
+ * set by the retry middleware.
12
+ *
13
+ * Example header: `amz-sdk-request: attempt=1; max=3`.
14
+ *
15
+ * This middleware is standalone because of extra headers may conflict with custom endpoint settings(e.g. CORS), we will
16
+ * NOT use this middleware for API categories.
17
+ */
18
+ const amzSdkRequestHeaderMiddlewareFactory = ({ maxAttempts = constants_1.DEFAULT_RETRY_ATTEMPTS }) => (next, context) => {
19
+ return async function amzSdkRequestHeaderMiddleware(request) {
20
+ const attemptsCount = context.attemptsCount ?? 0;
21
+ request.headers[constants_1.AMZ_SDK_REQUEST_HEADER] =
22
+ `attempt=${attemptsCount + 1}; max=${maxAttempts}`;
23
+ return next(request);
24
+ };
25
+ };
26
+ exports.amzSdkRequestHeaderMiddlewareFactory = amzSdkRequestHeaderMiddlewareFactory;
27
+ //# sourceMappingURL=amzSdkRequestHeaderMiddleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amzSdkRequestHeaderMiddleware.js","sources":["../../../../../src/clients/middleware/retry/amzSdkRequestHeaderMiddleware.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.amzSdkRequestHeaderMiddlewareFactory = void 0;\nconst constants_1 = require(\"./constants\");\n/**\n * Middleware injects `amz-sdk-request` header to indicate the retry state at the time an HTTP request is made.\n * This middleware should co-exist with retryMiddleware as it relies on the retryAttempts value in middleware context\n * set by the retry middleware.\n *\n * Example header: `amz-sdk-request: attempt=1; max=3`.\n *\n * This middleware is standalone because of extra headers may conflict with custom endpoint settings(e.g. CORS), we will\n * NOT use this middleware for API categories.\n */\nconst amzSdkRequestHeaderMiddlewareFactory = ({ maxAttempts = constants_1.DEFAULT_RETRY_ATTEMPTS }) => (next, context) => {\n return async function amzSdkRequestHeaderMiddleware(request) {\n const attemptsCount = context.attemptsCount ?? 0;\n request.headers[constants_1.AMZ_SDK_REQUEST_HEADER] =\n `attempt=${attemptsCount + 1}; max=${maxAttempts}`;\n return next(request);\n };\n};\nexports.amzSdkRequestHeaderMiddlewareFactory = amzSdkRequestHeaderMiddlewareFactory;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,oCAAoC,GAAG,MAAM;AACrD,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,oCAAoC,GAAG,CAAC,EAAE,WAAW,GAAG,WAAW,CAAC,sBAAsB,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,KAAK;AAC1H,IAAI,OAAO,eAAe,6BAA6B,CAAC,OAAO,EAAE;AACjE,QAAQ,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,IAAI,CAAC;AACxD,QAAQ,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC;AAC3D,YAAY,CAAC,QAAQ,EAAE,aAAa,GAAG,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAC9D,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,CAAC;AACD,OAAO,CAAC,oCAAoC,GAAG,oCAAoC;;"}
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ // SPDX-License-Identifier: Apache-2.0
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DEFAULT_MAX_DELAY_MS = exports.AMZ_SDK_REQUEST_HEADER = exports.AMZ_SDK_INVOCATION_ID_HEADER = exports.DEFAULT_RETRY_ATTEMPTS = void 0;
7
+ exports.DEFAULT_RETRY_ATTEMPTS = 3;
8
+ exports.AMZ_SDK_INVOCATION_ID_HEADER = 'amz-sdk-invocation-id';
9
+ exports.AMZ_SDK_REQUEST_HEADER = 'amz-sdk-request';
10
+ exports.DEFAULT_MAX_DELAY_MS = 5 * 60 * 1000;
11
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../../../../src/clients/middleware/retry/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.DEFAULT_MAX_DELAY_MS = exports.AMZ_SDK_REQUEST_HEADER = exports.AMZ_SDK_INVOCATION_ID_HEADER = exports.DEFAULT_RETRY_ATTEMPTS = void 0;\nexports.DEFAULT_RETRY_ATTEMPTS = 3;\nexports.AMZ_SDK_INVOCATION_ID_HEADER = 'amz-sdk-invocation-id';\nexports.AMZ_SDK_REQUEST_HEADER = 'amz-sdk-request';\nexports.DEFAULT_MAX_DELAY_MS = 5 * 60 * 1000;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,4BAA4B,GAAG,OAAO,CAAC,sBAAsB,GAAG,MAAM;AAC9I,OAAO,CAAC,sBAAsB,GAAG,CAAC;AAClC,OAAO,CAAC,4BAA4B,GAAG,uBAAuB;AAC9D,OAAO,CAAC,sBAAsB,GAAG,iBAAiB;AAClD,OAAO,CAAC,oBAAoB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI;;"}
@@ -3,11 +3,15 @@
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.getRetryDecider = exports.jitteredBackoff = exports.retryMiddlewareFactory = void 0;
7
- var middleware_1 = require("./middleware");
8
- Object.defineProperty(exports, "retryMiddlewareFactory", { enumerable: true, get: function () { return middleware_1.retryMiddlewareFactory; } });
6
+ exports.amzSdkRequestHeaderMiddlewareFactory = exports.amzSdkInvocationIdHeaderMiddlewareFactory = exports.getRetryDecider = exports.jitteredBackoff = exports.retryMiddlewareFactory = void 0;
7
+ var retryMiddleware_1 = require("./retryMiddleware");
8
+ Object.defineProperty(exports, "retryMiddlewareFactory", { enumerable: true, get: function () { return retryMiddleware_1.retryMiddlewareFactory; } });
9
9
  var jitteredBackoff_1 = require("./jitteredBackoff");
10
10
  Object.defineProperty(exports, "jitteredBackoff", { enumerable: true, get: function () { return jitteredBackoff_1.jitteredBackoff; } });
11
11
  var defaultRetryDecider_1 = require("./defaultRetryDecider");
12
12
  Object.defineProperty(exports, "getRetryDecider", { enumerable: true, get: function () { return defaultRetryDecider_1.getRetryDecider; } });
13
+ var amzSdkInvocationIdHeaderMiddleware_1 = require("./amzSdkInvocationIdHeaderMiddleware");
14
+ Object.defineProperty(exports, "amzSdkInvocationIdHeaderMiddlewareFactory", { enumerable: true, get: function () { return amzSdkInvocationIdHeaderMiddleware_1.amzSdkInvocationIdHeaderMiddlewareFactory; } });
15
+ var amzSdkRequestHeaderMiddleware_1 = require("./amzSdkRequestHeaderMiddleware");
16
+ Object.defineProperty(exports, "amzSdkRequestHeaderMiddlewareFactory", { enumerable: true, get: function () { return amzSdkRequestHeaderMiddleware_1.amzSdkRequestHeaderMiddlewareFactory; } });
13
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/clients/middleware/retry/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.getRetryDecider = exports.jitteredBackoff = exports.retryMiddlewareFactory = void 0;\nvar middleware_1 = require(\"./middleware\");\nObject.defineProperty(exports, \"retryMiddlewareFactory\", { enumerable: true, get: function () { return middleware_1.retryMiddlewareFactory; } });\nvar jitteredBackoff_1 = require(\"./jitteredBackoff\");\nObject.defineProperty(exports, \"jitteredBackoff\", { enumerable: true, get: function () { return jitteredBackoff_1.jitteredBackoff; } });\nvar defaultRetryDecider_1 = require(\"./defaultRetryDecider\");\nObject.defineProperty(exports, \"getRetryDecider\", { enumerable: true, get: function () { return defaultRetryDecider_1.getRetryDecider; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,sBAAsB,GAAG,MAAM;AAC3F,IAAI,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;AAC1C,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,wBAAwB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,YAAY,CAAC,sBAAsB,CAAC,EAAE,EAAE,CAAC;AAChJ,IAAI,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACpD,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;AACvI,IAAI,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC;AAC5D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,qBAAqB,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/clients/middleware/retry/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.amzSdkRequestHeaderMiddlewareFactory = exports.amzSdkInvocationIdHeaderMiddlewareFactory = exports.getRetryDecider = exports.jitteredBackoff = exports.retryMiddlewareFactory = void 0;\nvar retryMiddleware_1 = require(\"./retryMiddleware\");\nObject.defineProperty(exports, \"retryMiddlewareFactory\", { enumerable: true, get: function () { return retryMiddleware_1.retryMiddlewareFactory; } });\nvar jitteredBackoff_1 = require(\"./jitteredBackoff\");\nObject.defineProperty(exports, \"jitteredBackoff\", { enumerable: true, get: function () { return jitteredBackoff_1.jitteredBackoff; } });\nvar defaultRetryDecider_1 = require(\"./defaultRetryDecider\");\nObject.defineProperty(exports, \"getRetryDecider\", { enumerable: true, get: function () { return defaultRetryDecider_1.getRetryDecider; } });\nvar amzSdkInvocationIdHeaderMiddleware_1 = require(\"./amzSdkInvocationIdHeaderMiddleware\");\nObject.defineProperty(exports, \"amzSdkInvocationIdHeaderMiddlewareFactory\", { enumerable: true, get: function () { return amzSdkInvocationIdHeaderMiddleware_1.amzSdkInvocationIdHeaderMiddlewareFactory; } });\nvar amzSdkRequestHeaderMiddleware_1 = require(\"./amzSdkRequestHeaderMiddleware\");\nObject.defineProperty(exports, \"amzSdkRequestHeaderMiddlewareFactory\", { enumerable: true, get: function () { return amzSdkRequestHeaderMiddleware_1.amzSdkRequestHeaderMiddlewareFactory; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,oCAAoC,GAAG,OAAO,CAAC,yCAAyC,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,sBAAsB,GAAG,MAAM;AAC9L,IAAI,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACpD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,wBAAwB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,iBAAiB,CAAC,sBAAsB,CAAC,EAAE,EAAE,CAAC;AACrJ,IAAI,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACpD,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;AACvI,IAAI,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC;AAC5D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,qBAAqB,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC;AAC3I,IAAI,oCAAoC,GAAG,OAAO,CAAC,sCAAsC,CAAC;AAC1F,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,2CAA2C,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,oCAAoC,CAAC,yCAAyC,CAAC,EAAE,EAAE,CAAC;AAC9M,IAAI,+BAA+B,GAAG,OAAO,CAAC,iCAAiC,CAAC;AAChF,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,sCAAsC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,+BAA+B,CAAC,oCAAoC,CAAC,EAAE,EAAE,CAAC;;"}
@@ -5,14 +5,14 @@
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.jitteredBackoff = void 0;
7
7
  const utils_1 = require("../../../utils");
8
+ const constants_1 = require("./constants");
8
9
  // TODO: [v6] The separate retry utility is used by Data packages now and will replaced by retry middleware.
9
- const DEFAULT_MAX_DELAY_MS = 5 * 60 * 1000;
10
10
  const jitteredBackoff = attempt => {
11
- const delayFunction = (0, utils_1.jitteredBackoff)(DEFAULT_MAX_DELAY_MS);
11
+ const delayFunction = (0, utils_1.jitteredBackoff)(constants_1.DEFAULT_MAX_DELAY_MS);
12
12
  const delay = delayFunction(attempt);
13
13
  // The delayFunction returns false when the delay is greater than the max delay(5 mins).
14
14
  // In this case, the retry middleware will delay 5 mins instead, as a ceiling of the delay.
15
- return delay === false ? DEFAULT_MAX_DELAY_MS : delay;
15
+ return delay === false ? constants_1.DEFAULT_MAX_DELAY_MS : delay;
16
16
  };
17
17
  exports.jitteredBackoff = jitteredBackoff;
18
18
  //# sourceMappingURL=jitteredBackoff.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"jitteredBackoff.js","sources":["../../../../../src/clients/middleware/retry/jitteredBackoff.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.jitteredBackoff = void 0;\nconst utils_1 = require(\"../../../utils\");\n// TODO: [v6] The separate retry utility is used by Data packages now and will replaced by retry middleware.\nconst DEFAULT_MAX_DELAY_MS = 5 * 60 * 1000;\nconst jitteredBackoff = attempt => {\n const delayFunction = (0, utils_1.jitteredBackoff)(DEFAULT_MAX_DELAY_MS);\n const delay = delayFunction(attempt);\n // The delayFunction returns false when the delay is greater than the max delay(5 mins).\n // In this case, the retry middleware will delay 5 mins instead, as a ceiling of the delay.\n return delay === false ? DEFAULT_MAX_DELAY_MS : delay;\n};\nexports.jitteredBackoff = jitteredBackoff;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,eAAe,GAAG,MAAM;AAChC,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC;AACA,MAAM,oBAAoB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI;AAC1C,MAAM,eAAe,GAAG,OAAO,IAAI;AACnC,IAAI,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,eAAe,EAAE,oBAAoB,CAAC;AAC5E,IAAI,MAAM,KAAK,GAAG,aAAa,CAAC,OAAO,CAAC;AACxC;AACA;AACA,IAAI,OAAO,KAAK,KAAK,KAAK,GAAG,oBAAoB,GAAG,KAAK;AACzD,CAAC;AACD,OAAO,CAAC,eAAe,GAAG,eAAe;;"}
1
+ {"version":3,"file":"jitteredBackoff.js","sources":["../../../../../src/clients/middleware/retry/jitteredBackoff.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.jitteredBackoff = void 0;\nconst utils_1 = require(\"../../../utils\");\nconst constants_1 = require(\"./constants\");\n// TODO: [v6] The separate retry utility is used by Data packages now and will replaced by retry middleware.\nconst jitteredBackoff = attempt => {\n const delayFunction = (0, utils_1.jitteredBackoff)(constants_1.DEFAULT_MAX_DELAY_MS);\n const delay = delayFunction(attempt);\n // The delayFunction returns false when the delay is greater than the max delay(5 mins).\n // In this case, the retry middleware will delay 5 mins instead, as a ceiling of the delay.\n return delay === false ? constants_1.DEFAULT_MAX_DELAY_MS : delay;\n};\nexports.jitteredBackoff = jitteredBackoff;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,eAAe,GAAG,MAAM;AAChC,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C;AACA,MAAM,eAAe,GAAG,OAAO,IAAI;AACnC,IAAI,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,eAAe,EAAE,WAAW,CAAC,oBAAoB,CAAC;AACxF,IAAI,MAAM,KAAK,GAAG,aAAa,CAAC,OAAO,CAAC;AACxC;AACA;AACA,IAAI,OAAO,KAAK,KAAK,KAAK,GAAG,WAAW,CAAC,oBAAoB,GAAG,KAAK;AACrE,CAAC;AACD,OAAO,CAAC,eAAe,GAAG,eAAe;;"}
@@ -1,14 +1,12 @@
1
1
  'use strict';
2
2
 
3
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
- // SPDX-License-Identifier: Apache-2.0
5
3
  Object.defineProperty(exports, "__esModule", { value: true });
6
4
  exports.retryMiddlewareFactory = void 0;
7
- const DEFAULT_RETRY_ATTEMPTS = 3;
5
+ const constants_1 = require("./constants");
8
6
  /**
9
- * Retry middleware
7
+ * Middleware that executes the retry logic.
10
8
  */
11
- const retryMiddlewareFactory = ({ maxAttempts = DEFAULT_RETRY_ATTEMPTS, retryDecider, computeDelay, abortSignal, }) => {
9
+ const retryMiddlewareFactory = ({ maxAttempts = constants_1.DEFAULT_RETRY_ATTEMPTS, retryDecider, computeDelay, abortSignal, }) => {
12
10
  if (maxAttempts < 1) {
13
11
  throw new Error('maxAttempts must be greater than 0');
14
12
  }
@@ -92,4 +90,4 @@ const addOrIncrementMetadataAttempts = (nextHandlerOutput, attempts) => {
92
90
  attempts,
93
91
  };
94
92
  };
95
- //# sourceMappingURL=middleware.js.map
93
+ //# sourceMappingURL=retryMiddleware.js.map