mito-ai 0.1.40__py3-none-any.whl → 0.1.41__py3-none-any.whl
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.
Potentially problematic release.
This version of mito-ai might be problematic. Click here for more details.
- mito_ai/__init__.py +12 -6
- mito_ai/_version.py +1 -1
- mito_ai/app_builder/handlers.py +1 -2
- mito_ai/completions/handlers.py +1 -1
- mito_ai/completions/message_history.py +9 -1
- mito_ai/completions/models.py +1 -1
- mito_ai/completions/prompt_builders/agent_execution_prompt.py +2 -0
- mito_ai/completions/prompt_builders/agent_smart_debug_prompt.py +8 -0
- mito_ai/completions/prompt_builders/agent_system_message.py +17 -0
- mito_ai/constants.py +3 -2
- mito_ai/file_uploads/__init__.py +3 -0
- mito_ai/file_uploads/handlers.py +225 -0
- mito_ai/file_uploads/urls.py +21 -0
- mito_ai/openai_client.py +1 -1
- mito_ai/tests/file_uploads/__init__.py +2 -0
- mito_ai/tests/file_uploads/test_handlers.py +267 -0
- mito_ai/tests/message_history/test_message_history_utils.py +57 -4
- mito_ai/utils/mito_server_utils.py +7 -0
- mito_ai/utils/server_limits.py +1 -1
- mito_ai/utils/telemetry_utils.py +26 -9
- {mito_ai-0.1.40.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/build_log.json +102 -100
- {mito_ai-0.1.40.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/package.json +4 -2
- {mito_ai-0.1.40.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/package.json.orig +3 -1
- mito_ai-0.1.40.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.55d9f8ca386d87856d2d.js → mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.01a962c68c8fae380f30.js +1782 -1027
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.01a962c68c8fae380f30.js.map +1 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/node_modules_aws-amplify_core_dist_esm_singleton_apis_fetchAuthSession_mjs.182232e7bc6311fe4528.js +63 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/node_modules_aws-amplify_core_dist_esm_singleton_apis_fetchAuthSession_mjs.182232e7bc6311fe4528.js.map +1 -0
- mito_ai-0.1.40.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.264103d9addd1e166113.js → mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.9a70f033717ba8689564.js +49 -25
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.9a70f033717ba8689564.js.map +1 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_mjs.16430abf3466c3153f59.js +4574 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_mjs.16430abf3466c3153f59.js.map +1 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_core_dist_esm_singleton_Amplify_mjs.3c0035b95fe369aede82.js +2345 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_core_dist_esm_singleton_Amplify_mjs.3c0035b95fe369aede82.js.map +1 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_core_dist_esm_singleton_apis_fetchAuthSession_mjs-node_modul-758875.dc495fd682071d97070c.js +7498 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_core_dist_esm_singleton_apis_fetchAuthSession_mjs-node_modul-758875.dc495fd682071d97070c.js.map +1 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js +1021 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js.map +1 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.61289bff0db44828605b.js +60178 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.61289bff0db44828605b.js.map +1 -0
- {mito_ai-0.1.40.dist-info → mito_ai-0.1.41.dist-info}/METADATA +1 -1
- {mito_ai-0.1.40.dist-info → mito_ai-0.1.41.dist-info}/RECORD +53 -36
- mito_ai-0.1.40.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.55d9f8ca386d87856d2d.js.map +0 -1
- mito_ai-0.1.40.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.264103d9addd1e166113.js.map +0 -1
- {mito_ai-0.1.40.data → mito_ai-0.1.41.data}/data/etc/jupyter/jupyter_server_config.d/mito_ai.json +0 -0
- {mito_ai-0.1.40.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/toolbar-buttons.json +0 -0
- {mito_ai-0.1.40.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/static/style.js +0 -0
- {mito_ai-0.1.40.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js +0 -0
- {mito_ai-0.1.40.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js.map +0 -0
- {mito_ai-0.1.40.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.9795f79265ddb416864b.js +0 -0
- {mito_ai-0.1.40.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.9795f79265ddb416864b.js.map +0 -0
- {mito_ai-0.1.40.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js +0 -0
- {mito_ai-0.1.40.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js.map +0 -0
- {mito_ai-0.1.40.dist-info → mito_ai-0.1.41.dist-info}/WHEEL +0 -0
- {mito_ai-0.1.40.dist-info → mito_ai-0.1.41.dist-info}/entry_points.txt +0 -0
- {mito_ai-0.1.40.dist-info → mito_ai-0.1.41.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,4574 @@
|
|
|
1
|
+
(self["webpackChunkmito_ai"] = self["webpackChunkmito_ai"] || []).push([["vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_mjs"],{
|
|
2
|
+
|
|
3
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/errors/AuthError.mjs":
|
|
4
|
+
/*!**********************************************************************!*\
|
|
5
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/errors/AuthError.mjs ***!
|
|
6
|
+
\**********************************************************************/
|
|
7
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
8
|
+
|
|
9
|
+
"use strict";
|
|
10
|
+
__webpack_require__.r(__webpack_exports__);
|
|
11
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12
|
+
/* harmony export */ AuthError: () => (/* binding */ AuthError)
|
|
13
|
+
/* harmony export */ });
|
|
14
|
+
/* harmony import */ var _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core/internals/utils */ "./node_modules/@aws-amplify/core/dist/esm/errors/AmplifyError.mjs");
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
18
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
19
|
+
class AuthError extends _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.AmplifyError {
|
|
20
|
+
constructor(params) {
|
|
21
|
+
super(params);
|
|
22
|
+
// Hack for making the custom error class work when transpiled to es5
|
|
23
|
+
// TODO: Delete the following 2 lines after we change the build target to >= es2015
|
|
24
|
+
this.constructor = AuthError;
|
|
25
|
+
Object.setPrototypeOf(this, AuthError.prototype);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=AuthError.mjs.map
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
/***/ }),
|
|
34
|
+
|
|
35
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/errors/constants.mjs":
|
|
36
|
+
/*!**********************************************************************!*\
|
|
37
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/errors/constants.mjs ***!
|
|
38
|
+
\**********************************************************************/
|
|
39
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
40
|
+
|
|
41
|
+
"use strict";
|
|
42
|
+
__webpack_require__.r(__webpack_exports__);
|
|
43
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
44
|
+
/* harmony export */ AUTO_SIGN_IN_EXCEPTION: () => (/* binding */ AUTO_SIGN_IN_EXCEPTION),
|
|
45
|
+
/* harmony export */ DEVICE_METADATA_NOT_FOUND_EXCEPTION: () => (/* binding */ DEVICE_METADATA_NOT_FOUND_EXCEPTION),
|
|
46
|
+
/* harmony export */ INVALID_APP_SCHEME_EXCEPTION: () => (/* binding */ INVALID_APP_SCHEME_EXCEPTION),
|
|
47
|
+
/* harmony export */ INVALID_ORIGIN_EXCEPTION: () => (/* binding */ INVALID_ORIGIN_EXCEPTION),
|
|
48
|
+
/* harmony export */ INVALID_PREFERRED_REDIRECT_EXCEPTION: () => (/* binding */ INVALID_PREFERRED_REDIRECT_EXCEPTION),
|
|
49
|
+
/* harmony export */ INVALID_REDIRECT_EXCEPTION: () => (/* binding */ INVALID_REDIRECT_EXCEPTION),
|
|
50
|
+
/* harmony export */ OAUTH_SIGNOUT_EXCEPTION: () => (/* binding */ OAUTH_SIGNOUT_EXCEPTION),
|
|
51
|
+
/* harmony export */ TOKEN_REFRESH_EXCEPTION: () => (/* binding */ TOKEN_REFRESH_EXCEPTION),
|
|
52
|
+
/* harmony export */ UNEXPECTED_SIGN_IN_INTERRUPTION_EXCEPTION: () => (/* binding */ UNEXPECTED_SIGN_IN_INTERRUPTION_EXCEPTION),
|
|
53
|
+
/* harmony export */ USER_ALREADY_AUTHENTICATED_EXCEPTION: () => (/* binding */ USER_ALREADY_AUTHENTICATED_EXCEPTION),
|
|
54
|
+
/* harmony export */ USER_UNAUTHENTICATED_EXCEPTION: () => (/* binding */ USER_UNAUTHENTICATED_EXCEPTION),
|
|
55
|
+
/* harmony export */ invalidAppSchemeException: () => (/* binding */ invalidAppSchemeException),
|
|
56
|
+
/* harmony export */ invalidOriginException: () => (/* binding */ invalidOriginException),
|
|
57
|
+
/* harmony export */ invalidPreferredRedirectUrlException: () => (/* binding */ invalidPreferredRedirectUrlException),
|
|
58
|
+
/* harmony export */ invalidRedirectException: () => (/* binding */ invalidRedirectException)
|
|
59
|
+
/* harmony export */ });
|
|
60
|
+
/* harmony import */ var _AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AuthError.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/errors/AuthError.mjs");
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
64
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
65
|
+
const USER_UNAUTHENTICATED_EXCEPTION = 'UserUnAuthenticatedException';
|
|
66
|
+
const USER_ALREADY_AUTHENTICATED_EXCEPTION = 'UserAlreadyAuthenticatedException';
|
|
67
|
+
const DEVICE_METADATA_NOT_FOUND_EXCEPTION = 'DeviceMetadataNotFoundException';
|
|
68
|
+
const AUTO_SIGN_IN_EXCEPTION = 'AutoSignInException';
|
|
69
|
+
const INVALID_REDIRECT_EXCEPTION = 'InvalidRedirectException';
|
|
70
|
+
const INVALID_APP_SCHEME_EXCEPTION = 'InvalidAppSchemeException';
|
|
71
|
+
const INVALID_PREFERRED_REDIRECT_EXCEPTION = 'InvalidPreferredRedirectUrlException';
|
|
72
|
+
const invalidRedirectException = new _AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthError({
|
|
73
|
+
name: INVALID_REDIRECT_EXCEPTION,
|
|
74
|
+
message: 'signInRedirect or signOutRedirect had an invalid format or was not found.',
|
|
75
|
+
recoverySuggestion: 'Please make sure the signIn/Out redirect in your oauth config is valid.',
|
|
76
|
+
});
|
|
77
|
+
const invalidAppSchemeException = new _AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthError({
|
|
78
|
+
name: INVALID_APP_SCHEME_EXCEPTION,
|
|
79
|
+
message: 'A valid non-http app scheme was not found in the config.',
|
|
80
|
+
recoverySuggestion: 'Please make sure a valid custom app scheme is present in the config.',
|
|
81
|
+
});
|
|
82
|
+
const invalidPreferredRedirectUrlException = new _AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthError({
|
|
83
|
+
name: INVALID_PREFERRED_REDIRECT_EXCEPTION,
|
|
84
|
+
message: 'The given preferredRedirectUrl does not match any items in the redirectSignOutUrls array from the config.',
|
|
85
|
+
recoverySuggestion: 'Please make sure a matching preferredRedirectUrl is provided.',
|
|
86
|
+
});
|
|
87
|
+
const INVALID_ORIGIN_EXCEPTION = 'InvalidOriginException';
|
|
88
|
+
const invalidOriginException = new _AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthError({
|
|
89
|
+
name: INVALID_ORIGIN_EXCEPTION,
|
|
90
|
+
message: 'redirect is coming from a different origin. The oauth flow needs to be initiated from the same origin',
|
|
91
|
+
recoverySuggestion: 'Please call signInWithRedirect from the same origin.',
|
|
92
|
+
});
|
|
93
|
+
const OAUTH_SIGNOUT_EXCEPTION = 'OAuthSignOutException';
|
|
94
|
+
const TOKEN_REFRESH_EXCEPTION = 'TokenRefreshException';
|
|
95
|
+
const UNEXPECTED_SIGN_IN_INTERRUPTION_EXCEPTION = 'UnexpectedSignInInterruptionException';
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
//# sourceMappingURL=constants.mjs.map
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
/***/ }),
|
|
102
|
+
|
|
103
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/errors/utils/assertServiceError.mjs":
|
|
104
|
+
/*!*************************************************************************************!*\
|
|
105
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/errors/utils/assertServiceError.mjs ***!
|
|
106
|
+
\*************************************************************************************/
|
|
107
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
108
|
+
|
|
109
|
+
"use strict";
|
|
110
|
+
__webpack_require__.r(__webpack_exports__);
|
|
111
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
112
|
+
/* harmony export */ assertServiceError: () => (/* binding */ assertServiceError)
|
|
113
|
+
/* harmony export */ });
|
|
114
|
+
/* harmony import */ var _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-amplify/core/internals/utils */ "./node_modules/@aws-amplify/core/dist/esm/types/errors.mjs");
|
|
115
|
+
/* harmony import */ var _AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../AuthError.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/errors/AuthError.mjs");
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
120
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
121
|
+
function assertServiceError(error) {
|
|
122
|
+
if (!error ||
|
|
123
|
+
error.name === 'Error' ||
|
|
124
|
+
error instanceof TypeError) {
|
|
125
|
+
throw new _AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthError({
|
|
126
|
+
name: _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_1__.AmplifyErrorCode.Unknown,
|
|
127
|
+
message: 'An unknown error has occurred.',
|
|
128
|
+
underlyingError: error,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
//# sourceMappingURL=assertServiceError.mjs.map
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
/***/ }),
|
|
138
|
+
|
|
139
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/foundation/cognitoUserPoolEndpointResolver.mjs":
|
|
140
|
+
/*!************************************************************************************************!*\
|
|
141
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/foundation/cognitoUserPoolEndpointResolver.mjs ***!
|
|
142
|
+
\************************************************************************************************/
|
|
143
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
144
|
+
|
|
145
|
+
"use strict";
|
|
146
|
+
__webpack_require__.r(__webpack_exports__);
|
|
147
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
148
|
+
/* harmony export */ cognitoUserPoolEndpointResolver: () => (/* binding */ cognitoUserPoolEndpointResolver)
|
|
149
|
+
/* harmony export */ });
|
|
150
|
+
/* harmony import */ var _aws_amplify_core_internals_aws_client_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @aws-amplify/core/internals/aws-client-utils */ "./node_modules/@aws-amplify/core/dist/esm/clients/endpoints/getDnsSuffix.mjs");
|
|
151
|
+
/* harmony import */ var _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core/internals/utils */ "./node_modules/@aws-amplify/core/dist/esm/utils/amplifyUrl/index.mjs");
|
|
152
|
+
/* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/foundation/constants.mjs");
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
158
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
159
|
+
const cognitoUserPoolEndpointResolver = ({ region, }) => ({
|
|
160
|
+
url: new _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.AmplifyUrl(`https://${_constants_mjs__WEBPACK_IMPORTED_MODULE_1__.COGNITO_IDP_SERVICE_NAME}.${region}.${(0,_aws_amplify_core_internals_aws_client_utils__WEBPACK_IMPORTED_MODULE_2__.getDnsSuffix)(region)}`),
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
//# sourceMappingURL=cognitoUserPoolEndpointResolver.mjs.map
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
/***/ }),
|
|
168
|
+
|
|
169
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/foundation/constants.mjs":
|
|
170
|
+
/*!**************************************************************************!*\
|
|
171
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/foundation/constants.mjs ***!
|
|
172
|
+
\**************************************************************************/
|
|
173
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
174
|
+
|
|
175
|
+
"use strict";
|
|
176
|
+
__webpack_require__.r(__webpack_exports__);
|
|
177
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
178
|
+
/* harmony export */ COGNITO_IDP_SERVICE_NAME: () => (/* binding */ COGNITO_IDP_SERVICE_NAME)
|
|
179
|
+
/* harmony export */ });
|
|
180
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
181
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
182
|
+
/**
|
|
183
|
+
* The service name used to sign requests if the API requires authentication.
|
|
184
|
+
*/
|
|
185
|
+
const COGNITO_IDP_SERVICE_NAME = 'cognito-idp';
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
//# sourceMappingURL=constants.mjs.map
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
/***/ }),
|
|
192
|
+
|
|
193
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs":
|
|
194
|
+
/*!***************************************************************************************************************************!*\
|
|
195
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs ***!
|
|
196
|
+
\***************************************************************************************************************************/
|
|
197
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
198
|
+
|
|
199
|
+
"use strict";
|
|
200
|
+
__webpack_require__.r(__webpack_exports__);
|
|
201
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
202
|
+
/* harmony export */ DEFAULT_SERVICE_CLIENT_API_CONFIG: () => (/* binding */ DEFAULT_SERVICE_CLIENT_API_CONFIG)
|
|
203
|
+
/* harmony export */ });
|
|
204
|
+
/* harmony import */ var _aws_amplify_core_internals_aws_client_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-amplify/core/internals/aws-client-utils */ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/defaultRetryDecider.mjs");
|
|
205
|
+
/* harmony import */ var _aws_amplify_core_internals_aws_client_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @aws-amplify/core/internals/aws-client-utils */ "./node_modules/@aws-amplify/core/dist/esm/clients/serde/json.mjs");
|
|
206
|
+
/* harmony import */ var _aws_amplify_core_internals_aws_client_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @aws-amplify/core/internals/aws-client-utils */ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/jitteredBackoff.mjs");
|
|
207
|
+
/* harmony import */ var _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @aws-amplify/core/internals/utils */ "./node_modules/@aws-amplify/core/dist/esm/Platform/index.mjs");
|
|
208
|
+
/* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../constants.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/foundation/constants.mjs");
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
214
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
215
|
+
const DEFAULT_SERVICE_CLIENT_API_CONFIG = {
|
|
216
|
+
service: _constants_mjs__WEBPACK_IMPORTED_MODULE_0__.COGNITO_IDP_SERVICE_NAME,
|
|
217
|
+
retryDecider: (0,_aws_amplify_core_internals_aws_client_utils__WEBPACK_IMPORTED_MODULE_1__.getRetryDecider)(_aws_amplify_core_internals_aws_client_utils__WEBPACK_IMPORTED_MODULE_2__.parseJsonError),
|
|
218
|
+
computeDelay: _aws_amplify_core_internals_aws_client_utils__WEBPACK_IMPORTED_MODULE_3__.jitteredBackoff,
|
|
219
|
+
get userAgentValue() {
|
|
220
|
+
return (0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_4__.getAmplifyUserAgent)();
|
|
221
|
+
},
|
|
222
|
+
cache: 'no-store',
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
//# sourceMappingURL=constants.mjs.map
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
/***/ }),
|
|
230
|
+
|
|
231
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGetTokensFromRefreshTokenClient.mjs":
|
|
232
|
+
/*!*******************************************************************************************************************************************************!*\
|
|
233
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGetTokensFromRefreshTokenClient.mjs ***!
|
|
234
|
+
\*******************************************************************************************************************************************************/
|
|
235
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
236
|
+
|
|
237
|
+
"use strict";
|
|
238
|
+
__webpack_require__.r(__webpack_exports__);
|
|
239
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
240
|
+
/* harmony export */ createGetTokensFromRefreshTokenClient: () => (/* binding */ createGetTokensFromRefreshTokenClient)
|
|
241
|
+
/* harmony export */ });
|
|
242
|
+
/* harmony import */ var _aws_amplify_core_internals_aws_client_utils_composers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core/internals/aws-client-utils/composers */ "./node_modules/@aws-amplify/core/dist/esm/clients/internal/composeServiceApi.mjs");
|
|
243
|
+
/* harmony import */ var _shared_serde_createUserPoolSerializer_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shared/serde/createUserPoolSerializer.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serde/createUserPoolSerializer.mjs");
|
|
244
|
+
/* harmony import */ var _shared_serde_createUserPoolDeserializer_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shared/serde/createUserPoolDeserializer.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serde/createUserPoolDeserializer.mjs");
|
|
245
|
+
/* harmony import */ var _shared_handler_cognitoUserPoolTransferHandler_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shared/handler/cognitoUserPoolTransferHandler.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs");
|
|
246
|
+
/* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs");
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
256
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
257
|
+
const createGetTokensFromRefreshTokenClient = (config) => (0,_aws_amplify_core_internals_aws_client_utils_composers__WEBPACK_IMPORTED_MODULE_0__.composeServiceApi)(_shared_handler_cognitoUserPoolTransferHandler_mjs__WEBPACK_IMPORTED_MODULE_1__.cognitoUserPoolTransferHandler, (0,_shared_serde_createUserPoolSerializer_mjs__WEBPACK_IMPORTED_MODULE_2__.createUserPoolSerializer)('GetTokensFromRefreshToken'), (0,_shared_serde_createUserPoolDeserializer_mjs__WEBPACK_IMPORTED_MODULE_3__.createUserPoolDeserializer)(), {
|
|
258
|
+
..._constants_mjs__WEBPACK_IMPORTED_MODULE_4__.DEFAULT_SERVICE_CLIENT_API_CONFIG,
|
|
259
|
+
...config,
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
//# sourceMappingURL=createGetTokensFromRefreshTokenClient.mjs.map
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
/***/ }),
|
|
267
|
+
|
|
268
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs":
|
|
269
|
+
/*!***************************************************************************************************************************************************************!*\
|
|
270
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs ***!
|
|
271
|
+
\***************************************************************************************************************************************************************/
|
|
272
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
273
|
+
|
|
274
|
+
"use strict";
|
|
275
|
+
__webpack_require__.r(__webpack_exports__);
|
|
276
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
277
|
+
/* harmony export */ cognitoUserPoolTransferHandler: () => (/* binding */ cognitoUserPoolTransferHandler)
|
|
278
|
+
/* harmony export */ });
|
|
279
|
+
/* harmony import */ var _aws_amplify_core_internals_aws_client_utils_composers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core/internals/aws-client-utils/composers */ "./node_modules/@aws-amplify/core/dist/esm/clients/internal/composeTransferHandler.mjs");
|
|
280
|
+
/* harmony import */ var _aws_amplify_core_internals_aws_client_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-amplify/core/internals/aws-client-utils */ "./node_modules/@aws-amplify/core/dist/esm/clients/handlers/aws/unauthenticated.mjs");
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
285
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
286
|
+
/**
|
|
287
|
+
* A Cognito Identity-specific middleware that disables caching for all requests.
|
|
288
|
+
*/
|
|
289
|
+
const disableCacheMiddlewareFactory = () => (next, _) => async function disableCacheMiddleware(request) {
|
|
290
|
+
request.headers['cache-control'] = 'no-store';
|
|
291
|
+
return next(request);
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* A Cognito Identity-specific transfer handler that does NOT sign requests, and
|
|
295
|
+
* disables caching.
|
|
296
|
+
*
|
|
297
|
+
* @internal
|
|
298
|
+
*/
|
|
299
|
+
const cognitoUserPoolTransferHandler = (0,_aws_amplify_core_internals_aws_client_utils_composers__WEBPACK_IMPORTED_MODULE_0__.composeTransferHandler)(_aws_amplify_core_internals_aws_client_utils__WEBPACK_IMPORTED_MODULE_1__.unauthenticatedHandler, [disableCacheMiddlewareFactory]);
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
//# sourceMappingURL=cognitoUserPoolTransferHandler.mjs.map
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
/***/ }),
|
|
306
|
+
|
|
307
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serde/createUserPoolDeserializer.mjs":
|
|
308
|
+
/*!*********************************************************************************************************************************************************!*\
|
|
309
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serde/createUserPoolDeserializer.mjs ***!
|
|
310
|
+
\*********************************************************************************************************************************************************/
|
|
311
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
312
|
+
|
|
313
|
+
"use strict";
|
|
314
|
+
__webpack_require__.r(__webpack_exports__);
|
|
315
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
316
|
+
/* harmony export */ createUserPoolDeserializer: () => (/* binding */ createUserPoolDeserializer)
|
|
317
|
+
/* harmony export */ });
|
|
318
|
+
/* harmony import */ var _aws_amplify_core_internals_aws_client_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core/internals/aws-client-utils */ "./node_modules/@aws-amplify/core/dist/esm/clients/serde/json.mjs");
|
|
319
|
+
/* harmony import */ var _errors_utils_assertServiceError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../../errors/utils/assertServiceError.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/errors/utils/assertServiceError.mjs");
|
|
320
|
+
/* harmony import */ var _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../../errors/AuthError.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/errors/AuthError.mjs");
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
326
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
327
|
+
const createUserPoolDeserializer = () => async (response) => {
|
|
328
|
+
if (response.statusCode >= 300) {
|
|
329
|
+
const error = await (0,_aws_amplify_core_internals_aws_client_utils__WEBPACK_IMPORTED_MODULE_0__.parseJsonError)(response);
|
|
330
|
+
(0,_errors_utils_assertServiceError_mjs__WEBPACK_IMPORTED_MODULE_1__.assertServiceError)(error);
|
|
331
|
+
throw new _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_2__.AuthError({
|
|
332
|
+
name: error.name,
|
|
333
|
+
message: error.message,
|
|
334
|
+
metadata: error.$metadata,
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
return (0,_aws_amplify_core_internals_aws_client_utils__WEBPACK_IMPORTED_MODULE_0__.parseJsonBody)(response);
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
//# sourceMappingURL=createUserPoolDeserializer.mjs.map
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
/***/ }),
|
|
345
|
+
|
|
346
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serde/createUserPoolSerializer.mjs":
|
|
347
|
+
/*!*******************************************************************************************************************************************************!*\
|
|
348
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serde/createUserPoolSerializer.mjs ***!
|
|
349
|
+
\*******************************************************************************************************************************************************/
|
|
350
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
351
|
+
|
|
352
|
+
"use strict";
|
|
353
|
+
__webpack_require__.r(__webpack_exports__);
|
|
354
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
355
|
+
/* harmony export */ createUserPoolSerializer: () => (/* binding */ createUserPoolSerializer)
|
|
356
|
+
/* harmony export */ });
|
|
357
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
358
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
359
|
+
const createUserPoolSerializer = (operation) => (input, endpoint) => {
|
|
360
|
+
const headers = getSharedHeaders(operation);
|
|
361
|
+
const body = JSON.stringify(input);
|
|
362
|
+
return buildHttpRpcRequest(endpoint, headers, body);
|
|
363
|
+
};
|
|
364
|
+
const getSharedHeaders = (operation) => ({
|
|
365
|
+
'content-type': 'application/x-amz-json-1.1',
|
|
366
|
+
'x-amz-target': `AWSCognitoIdentityProviderService.${operation}`,
|
|
367
|
+
});
|
|
368
|
+
const buildHttpRpcRequest = ({ url }, headers, body) => ({
|
|
369
|
+
headers,
|
|
370
|
+
url,
|
|
371
|
+
body,
|
|
372
|
+
method: 'POST',
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
//# sourceMappingURL=createUserPoolSerializer.mjs.map
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
/***/ }),
|
|
380
|
+
|
|
381
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/foundation/parsers/regionParsers.mjs":
|
|
382
|
+
/*!**************************************************************************************!*\
|
|
383
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/foundation/parsers/regionParsers.mjs ***!
|
|
384
|
+
\**************************************************************************************/
|
|
385
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
386
|
+
|
|
387
|
+
"use strict";
|
|
388
|
+
__webpack_require__.r(__webpack_exports__);
|
|
389
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
390
|
+
/* harmony export */ getRegionFromIdentityPoolId: () => (/* binding */ getRegionFromIdentityPoolId),
|
|
391
|
+
/* harmony export */ getRegionFromUserPoolId: () => (/* binding */ getRegionFromUserPoolId)
|
|
392
|
+
/* harmony export */ });
|
|
393
|
+
/* harmony import */ var _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../errors/AuthError.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/errors/AuthError.mjs");
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
397
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
398
|
+
function getRegionFromUserPoolId(userPoolId) {
|
|
399
|
+
const region = userPoolId?.split('_')[0];
|
|
400
|
+
if (!userPoolId ||
|
|
401
|
+
userPoolId.indexOf('_') < 0 ||
|
|
402
|
+
!region ||
|
|
403
|
+
typeof region !== 'string')
|
|
404
|
+
throw new _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthError({
|
|
405
|
+
name: 'InvalidUserPoolId',
|
|
406
|
+
message: 'Invalid user pool id provided.',
|
|
407
|
+
});
|
|
408
|
+
return region;
|
|
409
|
+
}
|
|
410
|
+
function getRegionFromIdentityPoolId(identityPoolId) {
|
|
411
|
+
if (!identityPoolId || !identityPoolId.includes(':')) {
|
|
412
|
+
throw new _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthError({
|
|
413
|
+
name: 'InvalidIdentityPoolIdException',
|
|
414
|
+
message: 'Invalid identity pool id provided.',
|
|
415
|
+
recoverySuggestion: 'Make sure a valid identityPoolId is given in the config.',
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
return identityPoolId.split(':')[0];
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
//# sourceMappingURL=regionParsers.mjs.map
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
/***/ }),
|
|
426
|
+
|
|
427
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/factories/createCognitoUserPoolEndpointResolver.mjs":
|
|
428
|
+
/*!***********************************************************************************************************************!*\
|
|
429
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/factories/createCognitoUserPoolEndpointResolver.mjs ***!
|
|
430
|
+
\***********************************************************************************************************************/
|
|
431
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
432
|
+
|
|
433
|
+
"use strict";
|
|
434
|
+
__webpack_require__.r(__webpack_exports__);
|
|
435
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
436
|
+
/* harmony export */ createCognitoUserPoolEndpointResolver: () => (/* binding */ createCognitoUserPoolEndpointResolver)
|
|
437
|
+
/* harmony export */ });
|
|
438
|
+
/* harmony import */ var _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core/internals/utils */ "./node_modules/@aws-amplify/core/dist/esm/utils/amplifyUrl/index.mjs");
|
|
439
|
+
/* harmony import */ var _foundation_cognitoUserPoolEndpointResolver_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../foundation/cognitoUserPoolEndpointResolver.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/foundation/cognitoUserPoolEndpointResolver.mjs");
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
const createCognitoUserPoolEndpointResolver = ({ endpointOverride }) => (input) => {
|
|
444
|
+
if (endpointOverride) {
|
|
445
|
+
return { url: new _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.AmplifyUrl(endpointOverride) };
|
|
446
|
+
}
|
|
447
|
+
return (0,_foundation_cognitoUserPoolEndpointResolver_mjs__WEBPACK_IMPORTED_MODULE_1__.cognitoUserPoolEndpointResolver)(input);
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
//# sourceMappingURL=createCognitoUserPoolEndpointResolver.mjs.map
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
/***/ }),
|
|
455
|
+
|
|
456
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/CognitoUserPoolsTokenProvider.mjs":
|
|
457
|
+
/*!*******************************************************************************************************************!*\
|
|
458
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/CognitoUserPoolsTokenProvider.mjs ***!
|
|
459
|
+
\*******************************************************************************************************************/
|
|
460
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
461
|
+
|
|
462
|
+
"use strict";
|
|
463
|
+
__webpack_require__.r(__webpack_exports__);
|
|
464
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
465
|
+
/* harmony export */ CognitoUserPoolsTokenProvider: () => (/* binding */ CognitoUserPoolsTokenProvider)
|
|
466
|
+
/* harmony export */ });
|
|
467
|
+
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-amplify/core */ "./node_modules/@aws-amplify/core/dist/esm/storage/index.mjs");
|
|
468
|
+
/* harmony import */ var _utils_refreshAuthTokens_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/refreshAuthTokens.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/refreshAuthTokens.mjs");
|
|
469
|
+
/* harmony import */ var _TokenStore_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TokenStore.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/TokenStore.mjs");
|
|
470
|
+
/* harmony import */ var _TokenOrchestrator_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TokenOrchestrator.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/TokenOrchestrator.mjs");
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
477
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
478
|
+
class CognitoUserPoolsTokenProvider {
|
|
479
|
+
constructor() {
|
|
480
|
+
this.authTokenStore = new _TokenStore_mjs__WEBPACK_IMPORTED_MODULE_0__.DefaultTokenStore();
|
|
481
|
+
this.authTokenStore.setKeyValueStorage(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__.defaultStorage);
|
|
482
|
+
this.tokenOrchestrator = new _TokenOrchestrator_mjs__WEBPACK_IMPORTED_MODULE_2__.TokenOrchestrator();
|
|
483
|
+
this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore);
|
|
484
|
+
this.tokenOrchestrator.setTokenRefresher(_utils_refreshAuthTokens_mjs__WEBPACK_IMPORTED_MODULE_3__.refreshAuthTokens);
|
|
485
|
+
}
|
|
486
|
+
getTokens({ forceRefresh } = { forceRefresh: false }) {
|
|
487
|
+
return this.tokenOrchestrator.getTokens({ forceRefresh });
|
|
488
|
+
}
|
|
489
|
+
setKeyValueStorage(keyValueStorage) {
|
|
490
|
+
this.authTokenStore.setKeyValueStorage(keyValueStorage);
|
|
491
|
+
}
|
|
492
|
+
setAuthConfig(authConfig) {
|
|
493
|
+
this.authTokenStore.setAuthConfig(authConfig);
|
|
494
|
+
this.tokenOrchestrator.setAuthConfig(authConfig);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
//# sourceMappingURL=CognitoUserPoolsTokenProvider.mjs.map
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
/***/ }),
|
|
503
|
+
|
|
504
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/TokenOrchestrator.mjs":
|
|
505
|
+
/*!*******************************************************************************************************!*\
|
|
506
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/TokenOrchestrator.mjs ***!
|
|
507
|
+
\*******************************************************************************************************/
|
|
508
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
509
|
+
|
|
510
|
+
"use strict";
|
|
511
|
+
__webpack_require__.r(__webpack_exports__);
|
|
512
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
513
|
+
/* harmony export */ TokenOrchestrator: () => (/* binding */ TokenOrchestrator)
|
|
514
|
+
/* harmony export */ });
|
|
515
|
+
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @aws-amplify/core/internals/utils */ "./node_modules/@aws-amplify/core/dist/esm/Hub/index.mjs");
|
|
516
|
+
/* harmony import */ var _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core/internals/utils */ "./node_modules/@aws-amplify/core/dist/esm/utils/isBrowser.mjs");
|
|
517
|
+
/* harmony import */ var _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @aws-amplify/core/internals/utils */ "./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/index.mjs");
|
|
518
|
+
/* harmony import */ var _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @aws-amplify/core/internals/utils */ "./node_modules/@aws-amplify/core/dist/esm/utils/isTokenExpired.mjs");
|
|
519
|
+
/* harmony import */ var _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @aws-amplify/core/internals/utils */ "./node_modules/@aws-amplify/core/dist/esm/types/errors.mjs");
|
|
520
|
+
/* harmony import */ var _errors_utils_assertServiceError_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../errors/utils/assertServiceError.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/errors/utils/assertServiceError.mjs");
|
|
521
|
+
/* harmony import */ var _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../errors/AuthError.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/errors/AuthError.mjs");
|
|
522
|
+
/* harmony import */ var _utils_oauth_oAuthStore_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/oauth/oAuthStore.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/oAuthStore.mjs");
|
|
523
|
+
/* harmony import */ var _utils_oauth_inflightPromise_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/oauth/inflightPromise.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/inflightPromise.mjs");
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
532
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
533
|
+
class TokenOrchestrator {
|
|
534
|
+
constructor() {
|
|
535
|
+
this.waitForInflightOAuth = (0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.isBrowser)()
|
|
536
|
+
? async () => {
|
|
537
|
+
if (!(await _utils_oauth_oAuthStore_mjs__WEBPACK_IMPORTED_MODULE_1__.oAuthStore.loadOAuthInFlight())) {
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
if (this.inflightPromise) {
|
|
541
|
+
return this.inflightPromise;
|
|
542
|
+
}
|
|
543
|
+
// when there is valid oauth config and there is an inflight oauth flow, try
|
|
544
|
+
// to block async calls that require fetching tokens before the oauth flow completes
|
|
545
|
+
// e.g. getCurrentUser, fetchAuthSession etc.
|
|
546
|
+
this.inflightPromise = new Promise((resolve, _reject) => {
|
|
547
|
+
(0,_utils_oauth_inflightPromise_mjs__WEBPACK_IMPORTED_MODULE_2__.addInflightPromise)(resolve);
|
|
548
|
+
});
|
|
549
|
+
return this.inflightPromise;
|
|
550
|
+
}
|
|
551
|
+
: async () => {
|
|
552
|
+
// no-op for non-browser environments
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
setAuthConfig(authConfig) {
|
|
556
|
+
_utils_oauth_oAuthStore_mjs__WEBPACK_IMPORTED_MODULE_1__.oAuthStore.setAuthConfig(authConfig.Cognito);
|
|
557
|
+
this.authConfig = authConfig;
|
|
558
|
+
}
|
|
559
|
+
setTokenRefresher(tokenRefresher) {
|
|
560
|
+
this.tokenRefresher = tokenRefresher;
|
|
561
|
+
}
|
|
562
|
+
setAuthTokenStore(tokenStore) {
|
|
563
|
+
this.tokenStore = tokenStore;
|
|
564
|
+
}
|
|
565
|
+
getTokenStore() {
|
|
566
|
+
if (!this.tokenStore) {
|
|
567
|
+
throw new _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_3__.AuthError({
|
|
568
|
+
name: 'EmptyTokenStoreException',
|
|
569
|
+
message: 'TokenStore not set',
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
return this.tokenStore;
|
|
573
|
+
}
|
|
574
|
+
getTokenRefresher() {
|
|
575
|
+
if (!this.tokenRefresher) {
|
|
576
|
+
throw new _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_3__.AuthError({
|
|
577
|
+
name: 'EmptyTokenRefresherException',
|
|
578
|
+
message: 'TokenRefresher not set',
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
return this.tokenRefresher;
|
|
582
|
+
}
|
|
583
|
+
async getTokens(options) {
|
|
584
|
+
let tokens;
|
|
585
|
+
try {
|
|
586
|
+
(0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_4__.assertTokenProviderConfig)(this.authConfig?.Cognito);
|
|
587
|
+
}
|
|
588
|
+
catch (_err) {
|
|
589
|
+
// Token provider not configured
|
|
590
|
+
return null;
|
|
591
|
+
}
|
|
592
|
+
await this.waitForInflightOAuth();
|
|
593
|
+
this.inflightPromise = undefined;
|
|
594
|
+
tokens = await this.getTokenStore().loadTokens();
|
|
595
|
+
const username = await this.getTokenStore().getLastAuthUser();
|
|
596
|
+
if (tokens === null) {
|
|
597
|
+
return null;
|
|
598
|
+
}
|
|
599
|
+
const idTokenExpired = !!tokens?.idToken &&
|
|
600
|
+
(0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_5__.isTokenExpired)({
|
|
601
|
+
expiresAt: (tokens.idToken?.payload?.exp ?? 0) * 1000,
|
|
602
|
+
clockDrift: tokens.clockDrift ?? 0,
|
|
603
|
+
});
|
|
604
|
+
const accessTokenExpired = (0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_5__.isTokenExpired)({
|
|
605
|
+
expiresAt: (tokens.accessToken?.payload?.exp ?? 0) * 1000,
|
|
606
|
+
clockDrift: tokens.clockDrift ?? 0,
|
|
607
|
+
});
|
|
608
|
+
if (options?.forceRefresh || idTokenExpired || accessTokenExpired) {
|
|
609
|
+
tokens = await this.refreshTokens({
|
|
610
|
+
tokens,
|
|
611
|
+
username,
|
|
612
|
+
});
|
|
613
|
+
if (tokens === null) {
|
|
614
|
+
return null;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
return {
|
|
618
|
+
accessToken: tokens?.accessToken,
|
|
619
|
+
idToken: tokens?.idToken,
|
|
620
|
+
signInDetails: tokens?.signInDetails,
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
async refreshTokens({ tokens, username, }) {
|
|
624
|
+
try {
|
|
625
|
+
const { signInDetails } = tokens;
|
|
626
|
+
const newTokens = await this.getTokenRefresher()({
|
|
627
|
+
tokens,
|
|
628
|
+
authConfig: this.authConfig,
|
|
629
|
+
username,
|
|
630
|
+
});
|
|
631
|
+
newTokens.signInDetails = signInDetails;
|
|
632
|
+
await this.setTokens({ tokens: newTokens });
|
|
633
|
+
_aws_amplify_core__WEBPACK_IMPORTED_MODULE_6__.Hub.dispatch('auth', { event: 'tokenRefresh' }, 'Auth', _aws_amplify_core__WEBPACK_IMPORTED_MODULE_6__.AMPLIFY_SYMBOL);
|
|
634
|
+
return newTokens;
|
|
635
|
+
}
|
|
636
|
+
catch (err) {
|
|
637
|
+
return this.handleErrors(err);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
handleErrors(err) {
|
|
641
|
+
(0,_errors_utils_assertServiceError_mjs__WEBPACK_IMPORTED_MODULE_7__.assertServiceError)(err);
|
|
642
|
+
if (err.name !== _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_8__.AmplifyErrorCode.NetworkError) {
|
|
643
|
+
// TODO(v6): Check errors on client
|
|
644
|
+
this.clearTokens();
|
|
645
|
+
}
|
|
646
|
+
_aws_amplify_core__WEBPACK_IMPORTED_MODULE_6__.Hub.dispatch('auth', {
|
|
647
|
+
event: 'tokenRefresh_failure',
|
|
648
|
+
data: { error: err },
|
|
649
|
+
}, 'Auth', _aws_amplify_core__WEBPACK_IMPORTED_MODULE_6__.AMPLIFY_SYMBOL);
|
|
650
|
+
if (err.name.startsWith('NotAuthorizedException')) {
|
|
651
|
+
return null;
|
|
652
|
+
}
|
|
653
|
+
throw err;
|
|
654
|
+
}
|
|
655
|
+
async setTokens({ tokens }) {
|
|
656
|
+
return this.getTokenStore().storeTokens(tokens);
|
|
657
|
+
}
|
|
658
|
+
async clearTokens() {
|
|
659
|
+
return this.getTokenStore().clearTokens();
|
|
660
|
+
}
|
|
661
|
+
getDeviceMetadata(username) {
|
|
662
|
+
return this.getTokenStore().getDeviceMetadata(username);
|
|
663
|
+
}
|
|
664
|
+
clearDeviceMetadata(username) {
|
|
665
|
+
return this.getTokenStore().clearDeviceMetadata(username);
|
|
666
|
+
}
|
|
667
|
+
setOAuthMetadata(metadata) {
|
|
668
|
+
return this.getTokenStore().setOAuthMetadata(metadata);
|
|
669
|
+
}
|
|
670
|
+
getOAuthMetadata() {
|
|
671
|
+
return this.getTokenStore().getOAuthMetadata();
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
//# sourceMappingURL=TokenOrchestrator.mjs.map
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
/***/ }),
|
|
680
|
+
|
|
681
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/TokenStore.mjs":
|
|
682
|
+
/*!************************************************************************************************!*\
|
|
683
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/TokenStore.mjs ***!
|
|
684
|
+
\************************************************************************************************/
|
|
685
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
686
|
+
|
|
687
|
+
"use strict";
|
|
688
|
+
__webpack_require__.r(__webpack_exports__);
|
|
689
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
690
|
+
/* harmony export */ DefaultTokenStore: () => (/* binding */ DefaultTokenStore),
|
|
691
|
+
/* harmony export */ createKeysForAuthStorage: () => (/* binding */ createKeysForAuthStorage),
|
|
692
|
+
/* harmony export */ getAuthStorageKeys: () => (/* binding */ getAuthStorageKeys)
|
|
693
|
+
/* harmony export */ });
|
|
694
|
+
/* harmony import */ var _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-amplify/core/internals/utils */ "./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/index.mjs");
|
|
695
|
+
/* harmony import */ var _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../errors/AuthError.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/errors/AuthError.mjs");
|
|
696
|
+
/* harmony import */ var _types_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./types.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/types.mjs");
|
|
697
|
+
/* harmony import */ var _errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./errorHelpers.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/errorHelpers.mjs");
|
|
698
|
+
/* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/constants.mjs");
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
class DefaultTokenStore {
|
|
706
|
+
getKeyValueStorage() {
|
|
707
|
+
if (!this.keyValueStorage) {
|
|
708
|
+
throw new _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthError({
|
|
709
|
+
name: 'KeyValueStorageNotFoundException',
|
|
710
|
+
message: 'KeyValueStorage was not found in TokenStore',
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
return this.keyValueStorage;
|
|
714
|
+
}
|
|
715
|
+
setKeyValueStorage(keyValueStorage) {
|
|
716
|
+
this.keyValueStorage = keyValueStorage;
|
|
717
|
+
}
|
|
718
|
+
setAuthConfig(authConfig) {
|
|
719
|
+
this.authConfig = authConfig;
|
|
720
|
+
}
|
|
721
|
+
async loadTokens() {
|
|
722
|
+
// TODO(v6): migration logic should be here
|
|
723
|
+
// Reading V5 tokens old format
|
|
724
|
+
try {
|
|
725
|
+
const authKeys = await this.getAuthKeys();
|
|
726
|
+
const accessTokenString = await this.getKeyValueStorage().getItem(authKeys.accessToken);
|
|
727
|
+
if (!accessTokenString) {
|
|
728
|
+
throw new _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthError({
|
|
729
|
+
name: 'NoSessionFoundException',
|
|
730
|
+
message: 'Auth session was not found. Make sure to call signIn.',
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
const accessToken = (0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_1__.decodeJWT)(accessTokenString);
|
|
734
|
+
const itString = await this.getKeyValueStorage().getItem(authKeys.idToken);
|
|
735
|
+
const idToken = itString ? (0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_1__.decodeJWT)(itString) : undefined;
|
|
736
|
+
const refreshToken = (await this.getKeyValueStorage().getItem(authKeys.refreshToken)) ??
|
|
737
|
+
undefined;
|
|
738
|
+
const clockDriftString = (await this.getKeyValueStorage().getItem(authKeys.clockDrift)) ?? '0';
|
|
739
|
+
const clockDrift = Number.parseInt(clockDriftString);
|
|
740
|
+
const signInDetails = await this.getKeyValueStorage().getItem(authKeys.signInDetails);
|
|
741
|
+
const tokens = {
|
|
742
|
+
accessToken,
|
|
743
|
+
idToken,
|
|
744
|
+
refreshToken,
|
|
745
|
+
deviceMetadata: (await this.getDeviceMetadata()) ?? undefined,
|
|
746
|
+
clockDrift,
|
|
747
|
+
username: await this.getLastAuthUser(),
|
|
748
|
+
};
|
|
749
|
+
if (signInDetails) {
|
|
750
|
+
tokens.signInDetails = JSON.parse(signInDetails);
|
|
751
|
+
}
|
|
752
|
+
return tokens;
|
|
753
|
+
}
|
|
754
|
+
catch (err) {
|
|
755
|
+
return null;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
async storeTokens(tokens) {
|
|
759
|
+
(0,_errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_2__.assert)(tokens !== undefined, _errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_2__.TokenProviderErrorCode.InvalidAuthTokens);
|
|
760
|
+
const lastAuthUser = tokens.username;
|
|
761
|
+
await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(), lastAuthUser);
|
|
762
|
+
const authKeys = await this.getAuthKeys();
|
|
763
|
+
await this.getKeyValueStorage().setItem(authKeys.accessToken, tokens.accessToken.toString());
|
|
764
|
+
if (tokens.idToken) {
|
|
765
|
+
await this.getKeyValueStorage().setItem(authKeys.idToken, tokens.idToken.toString());
|
|
766
|
+
}
|
|
767
|
+
else {
|
|
768
|
+
await this.getKeyValueStorage().removeItem(authKeys.idToken);
|
|
769
|
+
}
|
|
770
|
+
if (tokens.refreshToken) {
|
|
771
|
+
await this.getKeyValueStorage().setItem(authKeys.refreshToken, tokens.refreshToken);
|
|
772
|
+
}
|
|
773
|
+
else {
|
|
774
|
+
await this.getKeyValueStorage().removeItem(authKeys.refreshToken);
|
|
775
|
+
}
|
|
776
|
+
if (tokens.deviceMetadata) {
|
|
777
|
+
if (tokens.deviceMetadata.deviceKey) {
|
|
778
|
+
await this.getKeyValueStorage().setItem(authKeys.deviceKey, tokens.deviceMetadata.deviceKey);
|
|
779
|
+
}
|
|
780
|
+
if (tokens.deviceMetadata.deviceGroupKey) {
|
|
781
|
+
await this.getKeyValueStorage().setItem(authKeys.deviceGroupKey, tokens.deviceMetadata.deviceGroupKey);
|
|
782
|
+
}
|
|
783
|
+
await this.getKeyValueStorage().setItem(authKeys.randomPasswordKey, tokens.deviceMetadata.randomPassword);
|
|
784
|
+
}
|
|
785
|
+
if (tokens.signInDetails) {
|
|
786
|
+
await this.getKeyValueStorage().setItem(authKeys.signInDetails, JSON.stringify(tokens.signInDetails));
|
|
787
|
+
}
|
|
788
|
+
else {
|
|
789
|
+
await this.getKeyValueStorage().removeItem(authKeys.signInDetails);
|
|
790
|
+
}
|
|
791
|
+
await this.getKeyValueStorage().setItem(authKeys.clockDrift, `${tokens.clockDrift}`);
|
|
792
|
+
}
|
|
793
|
+
async clearTokens() {
|
|
794
|
+
const authKeys = await this.getAuthKeys();
|
|
795
|
+
// Not calling clear because it can remove data that is not managed by AuthTokenStore
|
|
796
|
+
await Promise.all([
|
|
797
|
+
this.getKeyValueStorage().removeItem(authKeys.accessToken),
|
|
798
|
+
this.getKeyValueStorage().removeItem(authKeys.idToken),
|
|
799
|
+
this.getKeyValueStorage().removeItem(authKeys.clockDrift),
|
|
800
|
+
this.getKeyValueStorage().removeItem(authKeys.refreshToken),
|
|
801
|
+
this.getKeyValueStorage().removeItem(authKeys.signInDetails),
|
|
802
|
+
this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),
|
|
803
|
+
this.getKeyValueStorage().removeItem(authKeys.oauthMetadata),
|
|
804
|
+
]);
|
|
805
|
+
}
|
|
806
|
+
async getDeviceMetadata(username) {
|
|
807
|
+
const authKeys = await this.getAuthKeys(username);
|
|
808
|
+
const deviceKey = await this.getKeyValueStorage().getItem(authKeys.deviceKey);
|
|
809
|
+
const deviceGroupKey = await this.getKeyValueStorage().getItem(authKeys.deviceGroupKey);
|
|
810
|
+
const randomPassword = await this.getKeyValueStorage().getItem(authKeys.randomPasswordKey);
|
|
811
|
+
return randomPassword && deviceGroupKey && deviceKey
|
|
812
|
+
? {
|
|
813
|
+
deviceKey,
|
|
814
|
+
deviceGroupKey,
|
|
815
|
+
randomPassword,
|
|
816
|
+
}
|
|
817
|
+
: null;
|
|
818
|
+
}
|
|
819
|
+
async clearDeviceMetadata(username) {
|
|
820
|
+
const authKeys = await this.getAuthKeys(username);
|
|
821
|
+
await Promise.all([
|
|
822
|
+
this.getKeyValueStorage().removeItem(authKeys.deviceKey),
|
|
823
|
+
this.getKeyValueStorage().removeItem(authKeys.deviceGroupKey),
|
|
824
|
+
this.getKeyValueStorage().removeItem(authKeys.randomPasswordKey),
|
|
825
|
+
]);
|
|
826
|
+
}
|
|
827
|
+
async getAuthKeys(username) {
|
|
828
|
+
(0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_1__.assertTokenProviderConfig)(this.authConfig?.Cognito);
|
|
829
|
+
const lastAuthUser = username ?? (await this.getLastAuthUser());
|
|
830
|
+
return createKeysForAuthStorage(_constants_mjs__WEBPACK_IMPORTED_MODULE_3__.AUTH_KEY_PREFIX, `${this.authConfig.Cognito.userPoolClientId}.${lastAuthUser}`);
|
|
831
|
+
}
|
|
832
|
+
getLastAuthUserKey() {
|
|
833
|
+
(0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_1__.assertTokenProviderConfig)(this.authConfig?.Cognito);
|
|
834
|
+
const identifier = this.authConfig.Cognito.userPoolClientId;
|
|
835
|
+
return `${_constants_mjs__WEBPACK_IMPORTED_MODULE_3__.AUTH_KEY_PREFIX}.${identifier}.LastAuthUser`;
|
|
836
|
+
}
|
|
837
|
+
async getLastAuthUser() {
|
|
838
|
+
const lastAuthUser = (await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())) ??
|
|
839
|
+
'username';
|
|
840
|
+
return lastAuthUser;
|
|
841
|
+
}
|
|
842
|
+
async setOAuthMetadata(metadata) {
|
|
843
|
+
const { oauthMetadata: oauthMetadataKey } = await this.getAuthKeys();
|
|
844
|
+
await this.getKeyValueStorage().setItem(oauthMetadataKey, JSON.stringify(metadata));
|
|
845
|
+
}
|
|
846
|
+
async getOAuthMetadata() {
|
|
847
|
+
const { oauthMetadata: oauthMetadataKey } = await this.getAuthKeys();
|
|
848
|
+
const oauthMetadata = await this.getKeyValueStorage().getItem(oauthMetadataKey);
|
|
849
|
+
return oauthMetadata && JSON.parse(oauthMetadata);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
const createKeysForAuthStorage = (provider, identifier) => {
|
|
853
|
+
return getAuthStorageKeys(_types_mjs__WEBPACK_IMPORTED_MODULE_4__.AuthTokenStorageKeys)(`${provider}`, identifier);
|
|
854
|
+
};
|
|
855
|
+
function getAuthStorageKeys(authKeys) {
|
|
856
|
+
const keys = Object.values({ ...authKeys });
|
|
857
|
+
return (prefix, identifier) => keys.reduce((acc, authKey) => ({
|
|
858
|
+
...acc,
|
|
859
|
+
[authKey]: `${prefix}.${identifier}.${authKey}`,
|
|
860
|
+
}), {});
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
//# sourceMappingURL=TokenStore.mjs.map
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
/***/ }),
|
|
868
|
+
|
|
869
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/constants.mjs":
|
|
870
|
+
/*!***********************************************************************************************!*\
|
|
871
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/constants.mjs ***!
|
|
872
|
+
\***********************************************************************************************/
|
|
873
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
874
|
+
|
|
875
|
+
"use strict";
|
|
876
|
+
__webpack_require__.r(__webpack_exports__);
|
|
877
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
878
|
+
/* harmony export */ AUTH_KEY_PREFIX: () => (/* binding */ AUTH_KEY_PREFIX)
|
|
879
|
+
/* harmony export */ });
|
|
880
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
881
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
882
|
+
const AUTH_KEY_PREFIX = 'CognitoIdentityServiceProvider';
|
|
883
|
+
|
|
884
|
+
|
|
885
|
+
//# sourceMappingURL=constants.mjs.map
|
|
886
|
+
|
|
887
|
+
|
|
888
|
+
/***/ }),
|
|
889
|
+
|
|
890
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/errorHelpers.mjs":
|
|
891
|
+
/*!**************************************************************************************************!*\
|
|
892
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/errorHelpers.mjs ***!
|
|
893
|
+
\**************************************************************************************************/
|
|
894
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
895
|
+
|
|
896
|
+
"use strict";
|
|
897
|
+
__webpack_require__.r(__webpack_exports__);
|
|
898
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
899
|
+
/* harmony export */ TokenProviderErrorCode: () => (/* binding */ TokenProviderErrorCode),
|
|
900
|
+
/* harmony export */ assert: () => (/* binding */ assert)
|
|
901
|
+
/* harmony export */ });
|
|
902
|
+
/* harmony import */ var _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core/internals/utils */ "./node_modules/@aws-amplify/core/dist/esm/errors/createAssertionFunction.mjs");
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
906
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
907
|
+
var TokenProviderErrorCode;
|
|
908
|
+
(function (TokenProviderErrorCode) {
|
|
909
|
+
TokenProviderErrorCode["InvalidAuthTokens"] = "InvalidAuthTokens";
|
|
910
|
+
})(TokenProviderErrorCode || (TokenProviderErrorCode = {}));
|
|
911
|
+
const tokenValidationErrorMap = {
|
|
912
|
+
[TokenProviderErrorCode.InvalidAuthTokens]: {
|
|
913
|
+
message: 'Invalid tokens.',
|
|
914
|
+
recoverySuggestion: 'Make sure the tokens are valid.',
|
|
915
|
+
},
|
|
916
|
+
};
|
|
917
|
+
const assert = (0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.createAssertionFunction)(tokenValidationErrorMap);
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
//# sourceMappingURL=errorHelpers.mjs.map
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
/***/ }),
|
|
924
|
+
|
|
925
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/tokenProvider.mjs":
|
|
926
|
+
/*!***************************************************************************************************!*\
|
|
927
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/tokenProvider.mjs ***!
|
|
928
|
+
\***************************************************************************************************/
|
|
929
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
930
|
+
|
|
931
|
+
"use strict";
|
|
932
|
+
__webpack_require__.r(__webpack_exports__);
|
|
933
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
934
|
+
/* harmony export */ cognitoUserPoolsTokenProvider: () => (/* binding */ cognitoUserPoolsTokenProvider),
|
|
935
|
+
/* harmony export */ tokenOrchestrator: () => (/* binding */ tokenOrchestrator)
|
|
936
|
+
/* harmony export */ });
|
|
937
|
+
/* harmony import */ var _CognitoUserPoolsTokenProvider_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CognitoUserPoolsTokenProvider.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/CognitoUserPoolsTokenProvider.mjs");
|
|
938
|
+
|
|
939
|
+
|
|
940
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
941
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
942
|
+
/**
|
|
943
|
+
* The default provider for the JWT access token and ID token issued from the configured Cognito user pool. It manages
|
|
944
|
+
* the refresh and storage of the tokens. It stores the tokens in `window.localStorage` if available, and falls back to
|
|
945
|
+
* in-memory storage if not.
|
|
946
|
+
*/
|
|
947
|
+
const cognitoUserPoolsTokenProvider = new _CognitoUserPoolsTokenProvider_mjs__WEBPACK_IMPORTED_MODULE_0__.CognitoUserPoolsTokenProvider();
|
|
948
|
+
const { tokenOrchestrator } = cognitoUserPoolsTokenProvider;
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
//# sourceMappingURL=tokenProvider.mjs.map
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
/***/ }),
|
|
955
|
+
|
|
956
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/types.mjs":
|
|
957
|
+
/*!*******************************************************************************************!*\
|
|
958
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/types.mjs ***!
|
|
959
|
+
\*******************************************************************************************/
|
|
960
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
961
|
+
|
|
962
|
+
"use strict";
|
|
963
|
+
__webpack_require__.r(__webpack_exports__);
|
|
964
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
965
|
+
/* harmony export */ AuthTokenStorageKeys: () => (/* binding */ AuthTokenStorageKeys)
|
|
966
|
+
/* harmony export */ });
|
|
967
|
+
const AuthTokenStorageKeys = {
|
|
968
|
+
accessToken: 'accessToken',
|
|
969
|
+
idToken: 'idToken',
|
|
970
|
+
oidcProvider: 'oidcProvider',
|
|
971
|
+
clockDrift: 'clockDrift',
|
|
972
|
+
refreshToken: 'refreshToken',
|
|
973
|
+
deviceKey: 'deviceKey',
|
|
974
|
+
randomPasswordKey: 'randomPasswordKey',
|
|
975
|
+
deviceGroupKey: 'deviceGroupKey',
|
|
976
|
+
signInDetails: 'signInDetails',
|
|
977
|
+
oauthMetadata: 'oauthMetadata',
|
|
978
|
+
};
|
|
979
|
+
|
|
980
|
+
|
|
981
|
+
//# sourceMappingURL=types.mjs.map
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
/***/ }),
|
|
985
|
+
|
|
986
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/inflightPromise.mjs":
|
|
987
|
+
/*!***************************************************************************************************!*\
|
|
988
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/inflightPromise.mjs ***!
|
|
989
|
+
\***************************************************************************************************/
|
|
990
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
991
|
+
|
|
992
|
+
"use strict";
|
|
993
|
+
__webpack_require__.r(__webpack_exports__);
|
|
994
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
995
|
+
/* harmony export */ addInflightPromise: () => (/* binding */ addInflightPromise),
|
|
996
|
+
/* harmony export */ resolveAndClearInflightPromises: () => (/* binding */ resolveAndClearInflightPromises)
|
|
997
|
+
/* harmony export */ });
|
|
998
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
999
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1000
|
+
const inflightPromises = [];
|
|
1001
|
+
const addInflightPromise = (resolver) => {
|
|
1002
|
+
inflightPromises.push(resolver);
|
|
1003
|
+
};
|
|
1004
|
+
const resolveAndClearInflightPromises = () => {
|
|
1005
|
+
while (inflightPromises.length) {
|
|
1006
|
+
inflightPromises.pop()?.();
|
|
1007
|
+
}
|
|
1008
|
+
};
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
//# sourceMappingURL=inflightPromise.mjs.map
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
/***/ }),
|
|
1015
|
+
|
|
1016
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/oAuthStore.mjs":
|
|
1017
|
+
/*!**********************************************************************************************!*\
|
|
1018
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/oAuthStore.mjs ***!
|
|
1019
|
+
\**********************************************************************************************/
|
|
1020
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1021
|
+
|
|
1022
|
+
"use strict";
|
|
1023
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1024
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1025
|
+
/* harmony export */ oAuthStore: () => (/* binding */ oAuthStore)
|
|
1026
|
+
/* harmony export */ });
|
|
1027
|
+
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-amplify/core */ "./node_modules/@aws-amplify/core/dist/esm/storage/index.mjs");
|
|
1028
|
+
/* harmony import */ var _signInWithRedirectStore_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../signInWithRedirectStore.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signInWithRedirectStore.mjs");
|
|
1029
|
+
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1033
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1034
|
+
const oAuthStore = new _signInWithRedirectStore_mjs__WEBPACK_IMPORTED_MODULE_0__.DefaultOAuthStore(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__.defaultStorage);
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
//# sourceMappingURL=oAuthStore.mjs.map
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
/***/ }),
|
|
1041
|
+
|
|
1042
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/refreshAuthTokens.mjs":
|
|
1043
|
+
/*!***********************************************************************************************!*\
|
|
1044
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/refreshAuthTokens.mjs ***!
|
|
1045
|
+
\***********************************************************************************************/
|
|
1046
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1047
|
+
|
|
1048
|
+
"use strict";
|
|
1049
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1050
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1051
|
+
/* harmony export */ refreshAuthTokens: () => (/* binding */ refreshAuthTokens),
|
|
1052
|
+
/* harmony export */ refreshAuthTokensWithoutDedupe: () => (/* binding */ refreshAuthTokensWithoutDedupe)
|
|
1053
|
+
/* harmony export */ });
|
|
1054
|
+
/* harmony import */ var _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core/internals/utils */ "./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/index.mjs");
|
|
1055
|
+
/* harmony import */ var _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @aws-amplify/core/internals/utils */ "./node_modules/@aws-amplify/core/dist/esm/utils/deDupeAsyncFunction.mjs");
|
|
1056
|
+
/* harmony import */ var _foundation_parsers_regionParsers_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../foundation/parsers/regionParsers.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/foundation/parsers/regionParsers.mjs");
|
|
1057
|
+
/* harmony import */ var _types_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/types.mjs");
|
|
1058
|
+
/* harmony import */ var _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../errors/AuthError.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/errors/AuthError.mjs");
|
|
1059
|
+
/* harmony import */ var _factories_createCognitoUserPoolEndpointResolver_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../factories/createCognitoUserPoolEndpointResolver.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/factories/createCognitoUserPoolEndpointResolver.mjs");
|
|
1060
|
+
/* harmony import */ var _foundation_factories_serviceClients_cognitoIdentityProvider_createGetTokensFromRefreshTokenClient_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../foundation/factories/serviceClients/cognitoIdentityProvider/createGetTokensFromRefreshTokenClient.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGetTokensFromRefreshTokenClient.mjs");
|
|
1061
|
+
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
|
|
1071
|
+
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1077
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1078
|
+
const refreshAuthTokensFunction = async ({ tokens, authConfig, username, }) => {
|
|
1079
|
+
(0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.assertTokenProviderConfig)(authConfig?.Cognito);
|
|
1080
|
+
const { userPoolId, userPoolClientId, userPoolEndpoint } = authConfig.Cognito;
|
|
1081
|
+
const region = (0,_foundation_parsers_regionParsers_mjs__WEBPACK_IMPORTED_MODULE_1__.getRegionFromUserPoolId)(userPoolId);
|
|
1082
|
+
(0,_types_mjs__WEBPACK_IMPORTED_MODULE_2__.assertAuthTokensWithRefreshToken)(tokens);
|
|
1083
|
+
const getTokensFromRefreshToken = (0,_foundation_factories_serviceClients_cognitoIdentityProvider_createGetTokensFromRefreshTokenClient_mjs__WEBPACK_IMPORTED_MODULE_3__.createGetTokensFromRefreshTokenClient)({
|
|
1084
|
+
endpointResolver: (0,_factories_createCognitoUserPoolEndpointResolver_mjs__WEBPACK_IMPORTED_MODULE_4__.createCognitoUserPoolEndpointResolver)({
|
|
1085
|
+
endpointOverride: userPoolEndpoint,
|
|
1086
|
+
}),
|
|
1087
|
+
});
|
|
1088
|
+
const { AuthenticationResult } = await getTokensFromRefreshToken({ region }, {
|
|
1089
|
+
ClientId: userPoolClientId,
|
|
1090
|
+
RefreshToken: tokens.refreshToken,
|
|
1091
|
+
DeviceKey: tokens.deviceMetadata?.deviceKey,
|
|
1092
|
+
});
|
|
1093
|
+
const accessToken = (0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.decodeJWT)(AuthenticationResult?.AccessToken ?? '');
|
|
1094
|
+
const idToken = AuthenticationResult?.IdToken
|
|
1095
|
+
? (0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.decodeJWT)(AuthenticationResult.IdToken)
|
|
1096
|
+
: undefined;
|
|
1097
|
+
const { iat } = accessToken.payload;
|
|
1098
|
+
// This should never happen. If it does, it's a bug from the service.
|
|
1099
|
+
if (!iat) {
|
|
1100
|
+
throw new _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_5__.AuthError({
|
|
1101
|
+
name: 'iatNotFoundException',
|
|
1102
|
+
message: 'iat not found in access token',
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
const clockDrift = iat * 1000 - new Date().getTime();
|
|
1106
|
+
return {
|
|
1107
|
+
accessToken,
|
|
1108
|
+
idToken,
|
|
1109
|
+
clockDrift,
|
|
1110
|
+
refreshToken: AuthenticationResult?.RefreshToken ?? tokens.refreshToken,
|
|
1111
|
+
username,
|
|
1112
|
+
};
|
|
1113
|
+
};
|
|
1114
|
+
const refreshAuthTokens = (0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_6__.deDupeAsyncFunction)(refreshAuthTokensFunction);
|
|
1115
|
+
const refreshAuthTokensWithoutDedupe = refreshAuthTokensFunction;
|
|
1116
|
+
|
|
1117
|
+
|
|
1118
|
+
//# sourceMappingURL=refreshAuthTokens.mjs.map
|
|
1119
|
+
|
|
1120
|
+
|
|
1121
|
+
/***/ }),
|
|
1122
|
+
|
|
1123
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signInWithRedirectStore.mjs":
|
|
1124
|
+
/*!*****************************************************************************************************!*\
|
|
1125
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signInWithRedirectStore.mjs ***!
|
|
1126
|
+
\*****************************************************************************************************/
|
|
1127
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1128
|
+
|
|
1129
|
+
"use strict";
|
|
1130
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1131
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1132
|
+
/* harmony export */ DefaultOAuthStore: () => (/* binding */ DefaultOAuthStore)
|
|
1133
|
+
/* harmony export */ });
|
|
1134
|
+
/* harmony import */ var _aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-amplify/core/internals/utils */ "./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/index.mjs");
|
|
1135
|
+
/* harmony import */ var _tokenProvider_TokenStore_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tokenProvider/TokenStore.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/TokenStore.mjs");
|
|
1136
|
+
/* harmony import */ var _types_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/types.mjs");
|
|
1137
|
+
|
|
1138
|
+
|
|
1139
|
+
|
|
1140
|
+
|
|
1141
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1142
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1143
|
+
const V5_HOSTED_UI_KEY = 'amplify-signin-with-hostedUI';
|
|
1144
|
+
const name = 'CognitoIdentityServiceProvider';
|
|
1145
|
+
class DefaultOAuthStore {
|
|
1146
|
+
constructor(keyValueStorage) {
|
|
1147
|
+
this.keyValueStorage = keyValueStorage;
|
|
1148
|
+
}
|
|
1149
|
+
async clearOAuthInflightData() {
|
|
1150
|
+
(0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.assertTokenProviderConfig)(this.cognitoConfig);
|
|
1151
|
+
const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);
|
|
1152
|
+
await Promise.all([
|
|
1153
|
+
this.keyValueStorage.removeItem(authKeys.inflightOAuth),
|
|
1154
|
+
this.keyValueStorage.removeItem(authKeys.oauthPKCE),
|
|
1155
|
+
this.keyValueStorage.removeItem(authKeys.oauthState),
|
|
1156
|
+
]);
|
|
1157
|
+
}
|
|
1158
|
+
async clearOAuthData() {
|
|
1159
|
+
(0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.assertTokenProviderConfig)(this.cognitoConfig);
|
|
1160
|
+
const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);
|
|
1161
|
+
await this.clearOAuthInflightData();
|
|
1162
|
+
await this.keyValueStorage.removeItem(V5_HOSTED_UI_KEY); // remove in case a customer migrated an App from v5 to v6
|
|
1163
|
+
return this.keyValueStorage.removeItem(authKeys.oauthSignIn);
|
|
1164
|
+
}
|
|
1165
|
+
loadOAuthState() {
|
|
1166
|
+
(0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.assertTokenProviderConfig)(this.cognitoConfig);
|
|
1167
|
+
const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);
|
|
1168
|
+
return this.keyValueStorage.getItem(authKeys.oauthState);
|
|
1169
|
+
}
|
|
1170
|
+
storeOAuthState(state) {
|
|
1171
|
+
(0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.assertTokenProviderConfig)(this.cognitoConfig);
|
|
1172
|
+
const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);
|
|
1173
|
+
return this.keyValueStorage.setItem(authKeys.oauthState, state);
|
|
1174
|
+
}
|
|
1175
|
+
loadPKCE() {
|
|
1176
|
+
(0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.assertTokenProviderConfig)(this.cognitoConfig);
|
|
1177
|
+
const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);
|
|
1178
|
+
return this.keyValueStorage.getItem(authKeys.oauthPKCE);
|
|
1179
|
+
}
|
|
1180
|
+
storePKCE(pkce) {
|
|
1181
|
+
(0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.assertTokenProviderConfig)(this.cognitoConfig);
|
|
1182
|
+
const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);
|
|
1183
|
+
return this.keyValueStorage.setItem(authKeys.oauthPKCE, pkce);
|
|
1184
|
+
}
|
|
1185
|
+
setAuthConfig(authConfigParam) {
|
|
1186
|
+
this.cognitoConfig = authConfigParam;
|
|
1187
|
+
}
|
|
1188
|
+
async loadOAuthInFlight() {
|
|
1189
|
+
(0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.assertTokenProviderConfig)(this.cognitoConfig);
|
|
1190
|
+
const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);
|
|
1191
|
+
return ((await this.keyValueStorage.getItem(authKeys.inflightOAuth)) === 'true');
|
|
1192
|
+
}
|
|
1193
|
+
async storeOAuthInFlight(inflight) {
|
|
1194
|
+
(0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.assertTokenProviderConfig)(this.cognitoConfig);
|
|
1195
|
+
const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);
|
|
1196
|
+
await this.keyValueStorage.setItem(authKeys.inflightOAuth, `${inflight}`);
|
|
1197
|
+
}
|
|
1198
|
+
async loadOAuthSignIn() {
|
|
1199
|
+
(0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.assertTokenProviderConfig)(this.cognitoConfig);
|
|
1200
|
+
const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);
|
|
1201
|
+
const isLegacyHostedUISignIn = await this.keyValueStorage.getItem(V5_HOSTED_UI_KEY);
|
|
1202
|
+
const [isOAuthSignIn, preferPrivateSession] = (await this.keyValueStorage.getItem(authKeys.oauthSignIn))?.split(',') ??
|
|
1203
|
+
[];
|
|
1204
|
+
return {
|
|
1205
|
+
isOAuthSignIn: isOAuthSignIn === 'true' || isLegacyHostedUISignIn === 'true',
|
|
1206
|
+
preferPrivateSession: preferPrivateSession === 'true',
|
|
1207
|
+
};
|
|
1208
|
+
}
|
|
1209
|
+
async storeOAuthSignIn(oauthSignIn, preferPrivateSession = false) {
|
|
1210
|
+
(0,_aws_amplify_core_internals_utils__WEBPACK_IMPORTED_MODULE_0__.assertTokenProviderConfig)(this.cognitoConfig);
|
|
1211
|
+
const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);
|
|
1212
|
+
await this.keyValueStorage.setItem(authKeys.oauthSignIn, `${oauthSignIn},${preferPrivateSession}`);
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
const createKeysForAuthStorage = (provider, identifier) => {
|
|
1216
|
+
return (0,_tokenProvider_TokenStore_mjs__WEBPACK_IMPORTED_MODULE_1__.getAuthStorageKeys)(_types_mjs__WEBPACK_IMPORTED_MODULE_2__.OAuthStorageKeys)(provider, identifier);
|
|
1217
|
+
};
|
|
1218
|
+
|
|
1219
|
+
|
|
1220
|
+
//# sourceMappingURL=signInWithRedirectStore.mjs.map
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
/***/ }),
|
|
1224
|
+
|
|
1225
|
+
/***/ "./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/types.mjs":
|
|
1226
|
+
/*!***********************************************************************************!*\
|
|
1227
|
+
!*** ./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/types.mjs ***!
|
|
1228
|
+
\***********************************************************************************/
|
|
1229
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1230
|
+
|
|
1231
|
+
"use strict";
|
|
1232
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1233
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1234
|
+
/* harmony export */ OAuthStorageKeys: () => (/* binding */ OAuthStorageKeys),
|
|
1235
|
+
/* harmony export */ assertAuthTokens: () => (/* binding */ assertAuthTokens),
|
|
1236
|
+
/* harmony export */ assertAuthTokensWithRefreshToken: () => (/* binding */ assertAuthTokensWithRefreshToken),
|
|
1237
|
+
/* harmony export */ assertDeviceMetadata: () => (/* binding */ assertDeviceMetadata),
|
|
1238
|
+
/* harmony export */ assertIdTokenInAuthTokens: () => (/* binding */ assertIdTokenInAuthTokens),
|
|
1239
|
+
/* harmony export */ isTypeUserPoolConfig: () => (/* binding */ isTypeUserPoolConfig),
|
|
1240
|
+
/* harmony export */ oAuthTokenRefreshException: () => (/* binding */ oAuthTokenRefreshException),
|
|
1241
|
+
/* harmony export */ tokenRefreshException: () => (/* binding */ tokenRefreshException)
|
|
1242
|
+
/* harmony export */ });
|
|
1243
|
+
/* harmony import */ var _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../errors/AuthError.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/errors/AuthError.mjs");
|
|
1244
|
+
/* harmony import */ var _errors_constants_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../errors/constants.mjs */ "./node_modules/@aws-amplify/auth/dist/esm/errors/constants.mjs");
|
|
1245
|
+
|
|
1246
|
+
|
|
1247
|
+
|
|
1248
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1249
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1250
|
+
function isTypeUserPoolConfig(authConfig) {
|
|
1251
|
+
if (authConfig &&
|
|
1252
|
+
authConfig.Cognito.userPoolId &&
|
|
1253
|
+
authConfig.Cognito.userPoolClientId) {
|
|
1254
|
+
return true;
|
|
1255
|
+
}
|
|
1256
|
+
return false;
|
|
1257
|
+
}
|
|
1258
|
+
function assertAuthTokens(tokens) {
|
|
1259
|
+
if (!tokens || !tokens.accessToken) {
|
|
1260
|
+
throw new _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthError({
|
|
1261
|
+
name: _errors_constants_mjs__WEBPACK_IMPORTED_MODULE_1__.USER_UNAUTHENTICATED_EXCEPTION,
|
|
1262
|
+
message: 'User needs to be authenticated to call this API.',
|
|
1263
|
+
recoverySuggestion: 'Sign in before calling this API again.',
|
|
1264
|
+
});
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
function assertIdTokenInAuthTokens(tokens) {
|
|
1268
|
+
if (!tokens || !tokens.idToken) {
|
|
1269
|
+
throw new _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthError({
|
|
1270
|
+
name: _errors_constants_mjs__WEBPACK_IMPORTED_MODULE_1__.USER_UNAUTHENTICATED_EXCEPTION,
|
|
1271
|
+
message: 'User needs to be authenticated to call this API.',
|
|
1272
|
+
recoverySuggestion: 'Sign in before calling this API again.',
|
|
1273
|
+
});
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
const oAuthTokenRefreshException = new _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthError({
|
|
1277
|
+
name: _errors_constants_mjs__WEBPACK_IMPORTED_MODULE_1__.TOKEN_REFRESH_EXCEPTION,
|
|
1278
|
+
message: `Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow.
|
|
1279
|
+
Please change your oauth configuration to use 'code grant' flow.`,
|
|
1280
|
+
recoverySuggestion: `Please logout and change your Amplify configuration to use "code grant" flow.
|
|
1281
|
+
E.g { responseType: 'code' }`,
|
|
1282
|
+
});
|
|
1283
|
+
const tokenRefreshException = new _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthError({
|
|
1284
|
+
name: _errors_constants_mjs__WEBPACK_IMPORTED_MODULE_1__.USER_UNAUTHENTICATED_EXCEPTION,
|
|
1285
|
+
message: 'User needs to be authenticated to call this API.',
|
|
1286
|
+
recoverySuggestion: 'Sign in before calling this API again.',
|
|
1287
|
+
});
|
|
1288
|
+
function assertAuthTokensWithRefreshToken(tokens) {
|
|
1289
|
+
if (isAuthenticatedWithImplicitOauthFlow(tokens)) {
|
|
1290
|
+
throw oAuthTokenRefreshException;
|
|
1291
|
+
}
|
|
1292
|
+
if (!isAuthenticatedWithRefreshToken(tokens)) {
|
|
1293
|
+
throw tokenRefreshException;
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
function assertDeviceMetadata(deviceMetadata) {
|
|
1297
|
+
if (!deviceMetadata ||
|
|
1298
|
+
!deviceMetadata.deviceKey ||
|
|
1299
|
+
!deviceMetadata.deviceGroupKey ||
|
|
1300
|
+
!deviceMetadata.randomPassword) {
|
|
1301
|
+
throw new _errors_AuthError_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthError({
|
|
1302
|
+
name: _errors_constants_mjs__WEBPACK_IMPORTED_MODULE_1__.DEVICE_METADATA_NOT_FOUND_EXCEPTION,
|
|
1303
|
+
message: 'Either deviceKey, deviceGroupKey or secretPassword were not found during the sign-in process.',
|
|
1304
|
+
recoverySuggestion: 'Make sure to not clear storage after calling the signIn API.',
|
|
1305
|
+
});
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
const OAuthStorageKeys = {
|
|
1309
|
+
inflightOAuth: 'inflightOAuth',
|
|
1310
|
+
oauthSignIn: 'oauthSignIn',
|
|
1311
|
+
oauthPKCE: 'oauthPKCE',
|
|
1312
|
+
oauthState: 'oauthState',
|
|
1313
|
+
};
|
|
1314
|
+
function isAuthenticated(tokens) {
|
|
1315
|
+
return tokens?.accessToken || tokens?.idToken;
|
|
1316
|
+
}
|
|
1317
|
+
function isAuthenticatedWithRefreshToken(tokens) {
|
|
1318
|
+
return isAuthenticated(tokens) && tokens?.refreshToken;
|
|
1319
|
+
}
|
|
1320
|
+
function isAuthenticatedWithImplicitOauthFlow(tokens) {
|
|
1321
|
+
return isAuthenticated(tokens) && !tokens?.refreshToken;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
|
|
1325
|
+
//# sourceMappingURL=types.mjs.map
|
|
1326
|
+
|
|
1327
|
+
|
|
1328
|
+
/***/ }),
|
|
1329
|
+
|
|
1330
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Platform/customUserAgent.mjs":
|
|
1331
|
+
/*!******************************************************************************!*\
|
|
1332
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Platform/customUserAgent.mjs ***!
|
|
1333
|
+
\******************************************************************************/
|
|
1334
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1335
|
+
|
|
1336
|
+
"use strict";
|
|
1337
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1338
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1339
|
+
/* harmony export */ getCustomUserAgent: () => (/* binding */ getCustomUserAgent),
|
|
1340
|
+
/* harmony export */ setCustomUserAgent: () => (/* binding */ setCustomUserAgent)
|
|
1341
|
+
/* harmony export */ });
|
|
1342
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1343
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1344
|
+
// Maintains custom user-agent state set by external consumers.
|
|
1345
|
+
const customUserAgentState = {};
|
|
1346
|
+
/**
|
|
1347
|
+
* Sets custom user agent state which will be appended to applicable requests. Returns a function that can be used to
|
|
1348
|
+
* clean up any custom state set with this API.
|
|
1349
|
+
*
|
|
1350
|
+
* @note
|
|
1351
|
+
* This API operates globally. Calling this API multiple times will result in the most recently set values for a
|
|
1352
|
+
* particular API being used.
|
|
1353
|
+
*
|
|
1354
|
+
* @note
|
|
1355
|
+
* This utility IS NOT compatible with SSR.
|
|
1356
|
+
*
|
|
1357
|
+
* @param input - SetCustomUserAgentInput that defines custom state to apply to the specified APIs.
|
|
1358
|
+
*/
|
|
1359
|
+
const setCustomUserAgent = (input) => {
|
|
1360
|
+
// Save custom user-agent state & increment reference counter
|
|
1361
|
+
// TODO Remove `any` when we upgrade to TypeScript 5.2, see: https://github.com/microsoft/TypeScript/issues/44373
|
|
1362
|
+
customUserAgentState[input.category] = input.apis.reduce((acc, api) => ({
|
|
1363
|
+
...acc,
|
|
1364
|
+
[api]: {
|
|
1365
|
+
refCount: acc[api]?.refCount ? acc[api].refCount + 1 : 1,
|
|
1366
|
+
additionalDetails: input.additionalDetails,
|
|
1367
|
+
},
|
|
1368
|
+
}), customUserAgentState[input.category] ?? {});
|
|
1369
|
+
// Callback that cleans up state for APIs recorded by this call
|
|
1370
|
+
let cleanUpCallbackCalled = false;
|
|
1371
|
+
const cleanUpCallback = () => {
|
|
1372
|
+
// Only allow the cleanup callback to be called once
|
|
1373
|
+
if (cleanUpCallbackCalled) {
|
|
1374
|
+
return;
|
|
1375
|
+
}
|
|
1376
|
+
cleanUpCallbackCalled = true;
|
|
1377
|
+
input.apis.forEach(api => {
|
|
1378
|
+
const apiRefCount = customUserAgentState[input.category][api].refCount;
|
|
1379
|
+
if (apiRefCount > 1) {
|
|
1380
|
+
customUserAgentState[input.category][api].refCount = apiRefCount - 1;
|
|
1381
|
+
}
|
|
1382
|
+
else {
|
|
1383
|
+
delete customUserAgentState[input.category][api];
|
|
1384
|
+
// Clean up category if no more APIs set
|
|
1385
|
+
if (!Object.keys(customUserAgentState[input.category]).length) {
|
|
1386
|
+
delete customUserAgentState[input.category];
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
});
|
|
1390
|
+
};
|
|
1391
|
+
return cleanUpCallback;
|
|
1392
|
+
};
|
|
1393
|
+
const getCustomUserAgent = (category, api) => customUserAgentState[category]?.[api]?.additionalDetails;
|
|
1394
|
+
|
|
1395
|
+
|
|
1396
|
+
//# sourceMappingURL=customUserAgent.mjs.map
|
|
1397
|
+
|
|
1398
|
+
|
|
1399
|
+
/***/ }),
|
|
1400
|
+
|
|
1401
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Platform/detectFramework.mjs":
|
|
1402
|
+
/*!******************************************************************************!*\
|
|
1403
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Platform/detectFramework.mjs ***!
|
|
1404
|
+
\******************************************************************************/
|
|
1405
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1406
|
+
|
|
1407
|
+
"use strict";
|
|
1408
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1409
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1410
|
+
/* harmony export */ clearCache: () => (/* binding */ clearCache),
|
|
1411
|
+
/* harmony export */ detectFramework: () => (/* binding */ detectFramework),
|
|
1412
|
+
/* harmony export */ frameworkChangeObservers: () => (/* binding */ frameworkChangeObservers),
|
|
1413
|
+
/* harmony export */ observeFrameworkChanges: () => (/* binding */ observeFrameworkChanges)
|
|
1414
|
+
/* harmony export */ });
|
|
1415
|
+
/* harmony import */ var _types_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/types.mjs");
|
|
1416
|
+
/* harmony import */ var _detection_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./detection/index.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/index.mjs");
|
|
1417
|
+
|
|
1418
|
+
|
|
1419
|
+
|
|
1420
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1421
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1422
|
+
// We want to cache detection since the framework won't change
|
|
1423
|
+
let frameworkCache;
|
|
1424
|
+
const frameworkChangeObservers = [];
|
|
1425
|
+
// Setup the detection reset tracking / timeout delays
|
|
1426
|
+
let resetTriggered = false;
|
|
1427
|
+
const SSR_RESET_TIMEOUT = 10; // ms
|
|
1428
|
+
const WEB_RESET_TIMEOUT = 10; // ms
|
|
1429
|
+
const PRIME_FRAMEWORK_DELAY = 1000; // ms
|
|
1430
|
+
const detectFramework = () => {
|
|
1431
|
+
if (!frameworkCache) {
|
|
1432
|
+
frameworkCache = (0,_detection_index_mjs__WEBPACK_IMPORTED_MODULE_0__.detect)();
|
|
1433
|
+
if (resetTriggered) {
|
|
1434
|
+
// The final run of detectFramework:
|
|
1435
|
+
// Starting from this point, the `frameworkCache` becomes "final".
|
|
1436
|
+
// So we don't need to notify the observers again so the observer
|
|
1437
|
+
// can be removed after the final notice.
|
|
1438
|
+
while (frameworkChangeObservers.length) {
|
|
1439
|
+
frameworkChangeObservers.pop()?.();
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
else {
|
|
1443
|
+
// The first run of detectFramework:
|
|
1444
|
+
// Every time we update the cache, call each observer function
|
|
1445
|
+
frameworkChangeObservers.forEach(fcn => {
|
|
1446
|
+
fcn();
|
|
1447
|
+
});
|
|
1448
|
+
}
|
|
1449
|
+
// Retry once for either Unknown type after a delay (explained below)
|
|
1450
|
+
resetTimeout(_types_mjs__WEBPACK_IMPORTED_MODULE_1__.Framework.ServerSideUnknown, SSR_RESET_TIMEOUT);
|
|
1451
|
+
resetTimeout(_types_mjs__WEBPACK_IMPORTED_MODULE_1__.Framework.WebUnknown, WEB_RESET_TIMEOUT);
|
|
1452
|
+
}
|
|
1453
|
+
return frameworkCache;
|
|
1454
|
+
};
|
|
1455
|
+
/**
|
|
1456
|
+
* @internal Setup observer callback that will be called everytime the framework changes
|
|
1457
|
+
*/
|
|
1458
|
+
const observeFrameworkChanges = (fcn) => {
|
|
1459
|
+
// When the `frameworkCache` won't be updated again, we ignore all incoming
|
|
1460
|
+
// observers.
|
|
1461
|
+
if (resetTriggered) {
|
|
1462
|
+
return;
|
|
1463
|
+
}
|
|
1464
|
+
frameworkChangeObservers.push(fcn);
|
|
1465
|
+
};
|
|
1466
|
+
function clearCache() {
|
|
1467
|
+
frameworkCache = undefined;
|
|
1468
|
+
}
|
|
1469
|
+
// For a framework type and a delay amount, setup the event to re-detect
|
|
1470
|
+
// During the runtime boot, it is possible that framework detection will
|
|
1471
|
+
// be triggered before the framework has made modifications to the
|
|
1472
|
+
// global/window/etc needed for detection. When no framework is detected
|
|
1473
|
+
// we will reset and try again to ensure we don't use a cached
|
|
1474
|
+
// non-framework detection result for all requests.
|
|
1475
|
+
function resetTimeout(framework, delay) {
|
|
1476
|
+
if (frameworkCache === framework && !resetTriggered) {
|
|
1477
|
+
setTimeout(() => {
|
|
1478
|
+
clearCache();
|
|
1479
|
+
resetTriggered = true;
|
|
1480
|
+
setTimeout(detectFramework, PRIME_FRAMEWORK_DELAY);
|
|
1481
|
+
}, delay);
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
|
|
1486
|
+
//# sourceMappingURL=detectFramework.mjs.map
|
|
1487
|
+
|
|
1488
|
+
|
|
1489
|
+
/***/ }),
|
|
1490
|
+
|
|
1491
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Angular.mjs":
|
|
1492
|
+
/*!********************************************************************************!*\
|
|
1493
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Angular.mjs ***!
|
|
1494
|
+
\********************************************************************************/
|
|
1495
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1496
|
+
|
|
1497
|
+
"use strict";
|
|
1498
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1499
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1500
|
+
/* harmony export */ angularSSRDetect: () => (/* binding */ angularSSRDetect),
|
|
1501
|
+
/* harmony export */ angularWebDetect: () => (/* binding */ angularWebDetect)
|
|
1502
|
+
/* harmony export */ });
|
|
1503
|
+
/* harmony import */ var _helpers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/helpers.mjs");
|
|
1504
|
+
/* provided dependency */ var process = __webpack_require__(/*! process/browser */ "./node_modules/process/browser.js");
|
|
1505
|
+
|
|
1506
|
+
|
|
1507
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1508
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1509
|
+
// Tested with @angular/core 16.0.0
|
|
1510
|
+
function angularWebDetect() {
|
|
1511
|
+
const angularVersionSetInDocument = Boolean((0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.documentExists)() && document.querySelector('[ng-version]'));
|
|
1512
|
+
const angularContentSetInWindow = Boolean((0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.windowExists)() && typeof window.ng !== 'undefined');
|
|
1513
|
+
return angularVersionSetInDocument || angularContentSetInWindow;
|
|
1514
|
+
}
|
|
1515
|
+
function angularSSRDetect() {
|
|
1516
|
+
return (((0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.processExists)() &&
|
|
1517
|
+
typeof process.env === 'object' &&
|
|
1518
|
+
process.env.npm_lifecycle_script?.startsWith('ng ')) ||
|
|
1519
|
+
false);
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
|
|
1523
|
+
//# sourceMappingURL=Angular.mjs.map
|
|
1524
|
+
|
|
1525
|
+
|
|
1526
|
+
/***/ }),
|
|
1527
|
+
|
|
1528
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Expo.mjs":
|
|
1529
|
+
/*!*****************************************************************************!*\
|
|
1530
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Expo.mjs ***!
|
|
1531
|
+
\*****************************************************************************/
|
|
1532
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1533
|
+
|
|
1534
|
+
"use strict";
|
|
1535
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1536
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1537
|
+
/* harmony export */ expoDetect: () => (/* binding */ expoDetect)
|
|
1538
|
+
/* harmony export */ });
|
|
1539
|
+
/* harmony import */ var _helpers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/helpers.mjs");
|
|
1540
|
+
|
|
1541
|
+
|
|
1542
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1543
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1544
|
+
// Tested with expo 48 / react-native 0.71.3
|
|
1545
|
+
function expoDetect() {
|
|
1546
|
+
return (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.globalExists)() && typeof __webpack_require__.g.expo !== 'undefined';
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
|
|
1550
|
+
//# sourceMappingURL=Expo.mjs.map
|
|
1551
|
+
|
|
1552
|
+
|
|
1553
|
+
/***/ }),
|
|
1554
|
+
|
|
1555
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Next.mjs":
|
|
1556
|
+
/*!*****************************************************************************!*\
|
|
1557
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Next.mjs ***!
|
|
1558
|
+
\*****************************************************************************/
|
|
1559
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1560
|
+
|
|
1561
|
+
"use strict";
|
|
1562
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1563
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1564
|
+
/* harmony export */ nextSSRDetect: () => (/* binding */ nextSSRDetect),
|
|
1565
|
+
/* harmony export */ nextWebDetect: () => (/* binding */ nextWebDetect)
|
|
1566
|
+
/* harmony export */ });
|
|
1567
|
+
/* harmony import */ var _helpers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/helpers.mjs");
|
|
1568
|
+
|
|
1569
|
+
|
|
1570
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1571
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1572
|
+
// Tested with next 13.4 / react 18.2
|
|
1573
|
+
function nextWebDetect() {
|
|
1574
|
+
return ((0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.windowExists)() &&
|
|
1575
|
+
window.next &&
|
|
1576
|
+
typeof window.next === 'object');
|
|
1577
|
+
}
|
|
1578
|
+
function nextSSRDetect() {
|
|
1579
|
+
return ((0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.globalExists)() &&
|
|
1580
|
+
((0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.keyPrefixMatch)(__webpack_require__.g, '__next') || (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.keyPrefixMatch)(__webpack_require__.g, '__NEXT')));
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
|
|
1584
|
+
//# sourceMappingURL=Next.mjs.map
|
|
1585
|
+
|
|
1586
|
+
|
|
1587
|
+
/***/ }),
|
|
1588
|
+
|
|
1589
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Nuxt.mjs":
|
|
1590
|
+
/*!*****************************************************************************!*\
|
|
1591
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Nuxt.mjs ***!
|
|
1592
|
+
\*****************************************************************************/
|
|
1593
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1594
|
+
|
|
1595
|
+
"use strict";
|
|
1596
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1597
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1598
|
+
/* harmony export */ nuxtSSRDetect: () => (/* binding */ nuxtSSRDetect),
|
|
1599
|
+
/* harmony export */ nuxtWebDetect: () => (/* binding */ nuxtWebDetect)
|
|
1600
|
+
/* harmony export */ });
|
|
1601
|
+
/* harmony import */ var _helpers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/helpers.mjs");
|
|
1602
|
+
|
|
1603
|
+
|
|
1604
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1605
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1606
|
+
// Tested with nuxt 2.15 / vue 2.7
|
|
1607
|
+
function nuxtWebDetect() {
|
|
1608
|
+
return ((0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.windowExists)() &&
|
|
1609
|
+
(window.__NUXT__ !== undefined ||
|
|
1610
|
+
window.$nuxt !== undefined));
|
|
1611
|
+
}
|
|
1612
|
+
function nuxtSSRDetect() {
|
|
1613
|
+
return ((0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.globalExists)() && typeof __webpack_require__.g.__NUXT_PATHS__ !== 'undefined');
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
|
|
1617
|
+
//# sourceMappingURL=Nuxt.mjs.map
|
|
1618
|
+
|
|
1619
|
+
|
|
1620
|
+
/***/ }),
|
|
1621
|
+
|
|
1622
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/React.mjs":
|
|
1623
|
+
/*!******************************************************************************!*\
|
|
1624
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Platform/detection/React.mjs ***!
|
|
1625
|
+
\******************************************************************************/
|
|
1626
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1627
|
+
|
|
1628
|
+
"use strict";
|
|
1629
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1630
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1631
|
+
/* harmony export */ reactSSRDetect: () => (/* binding */ reactSSRDetect),
|
|
1632
|
+
/* harmony export */ reactWebDetect: () => (/* binding */ reactWebDetect)
|
|
1633
|
+
/* harmony export */ });
|
|
1634
|
+
/* harmony import */ var _helpers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/helpers.mjs");
|
|
1635
|
+
/* provided dependency */ var process = __webpack_require__(/*! process/browser */ "./node_modules/process/browser.js");
|
|
1636
|
+
|
|
1637
|
+
|
|
1638
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1639
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1640
|
+
// Tested with react 18.2 - built using Vite
|
|
1641
|
+
function reactWebDetect() {
|
|
1642
|
+
const elementKeyPrefixedWithReact = (key) => {
|
|
1643
|
+
return key.startsWith('_react') || key.startsWith('__react');
|
|
1644
|
+
};
|
|
1645
|
+
const elementIsReactEnabled = (element) => {
|
|
1646
|
+
return Object.keys(element).find(elementKeyPrefixedWithReact);
|
|
1647
|
+
};
|
|
1648
|
+
const allElementsWithId = () => Array.from(document.querySelectorAll('[id]'));
|
|
1649
|
+
return (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.documentExists)() && allElementsWithId().some(elementIsReactEnabled);
|
|
1650
|
+
}
|
|
1651
|
+
function reactSSRDetect() {
|
|
1652
|
+
return ((0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.processExists)() &&
|
|
1653
|
+
typeof process.env !== 'undefined' &&
|
|
1654
|
+
!!Object.keys(process.env).find(key => key.includes('react')));
|
|
1655
|
+
}
|
|
1656
|
+
// use the some
|
|
1657
|
+
|
|
1658
|
+
|
|
1659
|
+
//# sourceMappingURL=React.mjs.map
|
|
1660
|
+
|
|
1661
|
+
|
|
1662
|
+
/***/ }),
|
|
1663
|
+
|
|
1664
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/ReactNative.mjs":
|
|
1665
|
+
/*!************************************************************************************!*\
|
|
1666
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Platform/detection/ReactNative.mjs ***!
|
|
1667
|
+
\************************************************************************************/
|
|
1668
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1669
|
+
|
|
1670
|
+
"use strict";
|
|
1671
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1672
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1673
|
+
/* harmony export */ reactNativeDetect: () => (/* binding */ reactNativeDetect)
|
|
1674
|
+
/* harmony export */ });
|
|
1675
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1676
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1677
|
+
// Tested with react-native 0.17.7
|
|
1678
|
+
function reactNativeDetect() {
|
|
1679
|
+
return (typeof navigator !== 'undefined' &&
|
|
1680
|
+
typeof navigator.product !== 'undefined' &&
|
|
1681
|
+
navigator.product === 'ReactNative');
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
|
|
1685
|
+
//# sourceMappingURL=ReactNative.mjs.map
|
|
1686
|
+
|
|
1687
|
+
|
|
1688
|
+
/***/ }),
|
|
1689
|
+
|
|
1690
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Svelte.mjs":
|
|
1691
|
+
/*!*******************************************************************************!*\
|
|
1692
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Svelte.mjs ***!
|
|
1693
|
+
\*******************************************************************************/
|
|
1694
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1695
|
+
|
|
1696
|
+
"use strict";
|
|
1697
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1698
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1699
|
+
/* harmony export */ svelteSSRDetect: () => (/* binding */ svelteSSRDetect),
|
|
1700
|
+
/* harmony export */ svelteWebDetect: () => (/* binding */ svelteWebDetect)
|
|
1701
|
+
/* harmony export */ });
|
|
1702
|
+
/* harmony import */ var _helpers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/helpers.mjs");
|
|
1703
|
+
/* provided dependency */ var process = __webpack_require__(/*! process/browser */ "./node_modules/process/browser.js");
|
|
1704
|
+
|
|
1705
|
+
|
|
1706
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1707
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1708
|
+
// Tested with svelte 3.59
|
|
1709
|
+
function svelteWebDetect() {
|
|
1710
|
+
return (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.windowExists)() && (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.keyPrefixMatch)(window, '__SVELTE');
|
|
1711
|
+
}
|
|
1712
|
+
function svelteSSRDetect() {
|
|
1713
|
+
return ((0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.processExists)() &&
|
|
1714
|
+
typeof process.env !== 'undefined' &&
|
|
1715
|
+
!!Object.keys(process.env).find(key => key.includes('svelte')));
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
|
|
1719
|
+
//# sourceMappingURL=Svelte.mjs.map
|
|
1720
|
+
|
|
1721
|
+
|
|
1722
|
+
/***/ }),
|
|
1723
|
+
|
|
1724
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Vue.mjs":
|
|
1725
|
+
/*!****************************************************************************!*\
|
|
1726
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Vue.mjs ***!
|
|
1727
|
+
\****************************************************************************/
|
|
1728
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1729
|
+
|
|
1730
|
+
"use strict";
|
|
1731
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1732
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1733
|
+
/* harmony export */ vueSSRDetect: () => (/* binding */ vueSSRDetect),
|
|
1734
|
+
/* harmony export */ vueWebDetect: () => (/* binding */ vueWebDetect)
|
|
1735
|
+
/* harmony export */ });
|
|
1736
|
+
/* harmony import */ var _helpers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/helpers.mjs");
|
|
1737
|
+
|
|
1738
|
+
|
|
1739
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1740
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1741
|
+
// Tested with vue 3.3.2
|
|
1742
|
+
function vueWebDetect() {
|
|
1743
|
+
return (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.windowExists)() && (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.keyPrefixMatch)(window, '__VUE');
|
|
1744
|
+
}
|
|
1745
|
+
function vueSSRDetect() {
|
|
1746
|
+
return (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.globalExists)() && (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.keyPrefixMatch)(__webpack_require__.g, '__VUE');
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
|
|
1750
|
+
//# sourceMappingURL=Vue.mjs.map
|
|
1751
|
+
|
|
1752
|
+
|
|
1753
|
+
/***/ }),
|
|
1754
|
+
|
|
1755
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Web.mjs":
|
|
1756
|
+
/*!****************************************************************************!*\
|
|
1757
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Web.mjs ***!
|
|
1758
|
+
\****************************************************************************/
|
|
1759
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1760
|
+
|
|
1761
|
+
"use strict";
|
|
1762
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1763
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1764
|
+
/* harmony export */ webDetect: () => (/* binding */ webDetect)
|
|
1765
|
+
/* harmony export */ });
|
|
1766
|
+
/* harmony import */ var _helpers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/helpers.mjs");
|
|
1767
|
+
|
|
1768
|
+
|
|
1769
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1770
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1771
|
+
function webDetect() {
|
|
1772
|
+
return (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.windowExists)();
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
|
|
1776
|
+
//# sourceMappingURL=Web.mjs.map
|
|
1777
|
+
|
|
1778
|
+
|
|
1779
|
+
/***/ }),
|
|
1780
|
+
|
|
1781
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/helpers.mjs":
|
|
1782
|
+
/*!********************************************************************************!*\
|
|
1783
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Platform/detection/helpers.mjs ***!
|
|
1784
|
+
\********************************************************************************/
|
|
1785
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1786
|
+
|
|
1787
|
+
"use strict";
|
|
1788
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1789
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1790
|
+
/* harmony export */ documentExists: () => (/* binding */ documentExists),
|
|
1791
|
+
/* harmony export */ globalExists: () => (/* binding */ globalExists),
|
|
1792
|
+
/* harmony export */ globalThisExists: () => (/* binding */ globalThisExists),
|
|
1793
|
+
/* harmony export */ keyPrefixMatch: () => (/* binding */ keyPrefixMatch),
|
|
1794
|
+
/* harmony export */ processExists: () => (/* binding */ processExists),
|
|
1795
|
+
/* harmony export */ windowExists: () => (/* binding */ windowExists)
|
|
1796
|
+
/* harmony export */ });
|
|
1797
|
+
/* provided dependency */ var process = __webpack_require__(/*! process/browser */ "./node_modules/process/browser.js");
|
|
1798
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1799
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1800
|
+
const globalExists = () => {
|
|
1801
|
+
return typeof __webpack_require__.g !== 'undefined';
|
|
1802
|
+
};
|
|
1803
|
+
const globalThisExists = () => {
|
|
1804
|
+
return typeof globalThis !== 'undefined';
|
|
1805
|
+
};
|
|
1806
|
+
const windowExists = () => {
|
|
1807
|
+
return typeof window !== 'undefined';
|
|
1808
|
+
};
|
|
1809
|
+
const documentExists = () => {
|
|
1810
|
+
return typeof document !== 'undefined';
|
|
1811
|
+
};
|
|
1812
|
+
const processExists = () => {
|
|
1813
|
+
return typeof process !== 'undefined';
|
|
1814
|
+
};
|
|
1815
|
+
const keyPrefixMatch = (object, prefix) => {
|
|
1816
|
+
return !!Object.keys(object).find(key => key.startsWith(prefix));
|
|
1817
|
+
};
|
|
1818
|
+
|
|
1819
|
+
|
|
1820
|
+
//# sourceMappingURL=helpers.mjs.map
|
|
1821
|
+
|
|
1822
|
+
|
|
1823
|
+
/***/ }),
|
|
1824
|
+
|
|
1825
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/index.mjs":
|
|
1826
|
+
/*!******************************************************************************!*\
|
|
1827
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Platform/detection/index.mjs ***!
|
|
1828
|
+
\******************************************************************************/
|
|
1829
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1830
|
+
|
|
1831
|
+
"use strict";
|
|
1832
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1833
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1834
|
+
/* harmony export */ detect: () => (/* binding */ detect)
|
|
1835
|
+
/* harmony export */ });
|
|
1836
|
+
/* harmony import */ var _types_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/types.mjs");
|
|
1837
|
+
/* harmony import */ var _React_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./React.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/React.mjs");
|
|
1838
|
+
/* harmony import */ var _Vue_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Vue.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Vue.mjs");
|
|
1839
|
+
/* harmony import */ var _Svelte_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Svelte.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Svelte.mjs");
|
|
1840
|
+
/* harmony import */ var _Next_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Next.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Next.mjs");
|
|
1841
|
+
/* harmony import */ var _Nuxt_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Nuxt.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Nuxt.mjs");
|
|
1842
|
+
/* harmony import */ var _Angular_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Angular.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Angular.mjs");
|
|
1843
|
+
/* harmony import */ var _ReactNative_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ReactNative.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/ReactNative.mjs");
|
|
1844
|
+
/* harmony import */ var _Expo_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Expo.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Expo.mjs");
|
|
1845
|
+
/* harmony import */ var _Web_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Web.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detection/Web.mjs");
|
|
1846
|
+
|
|
1847
|
+
|
|
1848
|
+
|
|
1849
|
+
|
|
1850
|
+
|
|
1851
|
+
|
|
1852
|
+
|
|
1853
|
+
|
|
1854
|
+
|
|
1855
|
+
|
|
1856
|
+
|
|
1857
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1858
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1859
|
+
// These are in the order of detection where when both are detectable, the early Framework will be reported
|
|
1860
|
+
const detectionMap = [
|
|
1861
|
+
// First, detect mobile
|
|
1862
|
+
{ platform: _types_mjs__WEBPACK_IMPORTED_MODULE_0__.Framework.Expo, detectionMethod: _Expo_mjs__WEBPACK_IMPORTED_MODULE_1__.expoDetect },
|
|
1863
|
+
{ platform: _types_mjs__WEBPACK_IMPORTED_MODULE_0__.Framework.ReactNative, detectionMethod: _ReactNative_mjs__WEBPACK_IMPORTED_MODULE_2__.reactNativeDetect },
|
|
1864
|
+
// Next, detect web frameworks
|
|
1865
|
+
{ platform: _types_mjs__WEBPACK_IMPORTED_MODULE_0__.Framework.NextJs, detectionMethod: _Next_mjs__WEBPACK_IMPORTED_MODULE_3__.nextWebDetect },
|
|
1866
|
+
{ platform: _types_mjs__WEBPACK_IMPORTED_MODULE_0__.Framework.Nuxt, detectionMethod: _Nuxt_mjs__WEBPACK_IMPORTED_MODULE_4__.nuxtWebDetect },
|
|
1867
|
+
{ platform: _types_mjs__WEBPACK_IMPORTED_MODULE_0__.Framework.Angular, detectionMethod: _Angular_mjs__WEBPACK_IMPORTED_MODULE_5__.angularWebDetect },
|
|
1868
|
+
{ platform: _types_mjs__WEBPACK_IMPORTED_MODULE_0__.Framework.React, detectionMethod: _React_mjs__WEBPACK_IMPORTED_MODULE_6__.reactWebDetect },
|
|
1869
|
+
{ platform: _types_mjs__WEBPACK_IMPORTED_MODULE_0__.Framework.VueJs, detectionMethod: _Vue_mjs__WEBPACK_IMPORTED_MODULE_7__.vueWebDetect },
|
|
1870
|
+
{ platform: _types_mjs__WEBPACK_IMPORTED_MODULE_0__.Framework.Svelte, detectionMethod: _Svelte_mjs__WEBPACK_IMPORTED_MODULE_8__.svelteWebDetect },
|
|
1871
|
+
{ platform: _types_mjs__WEBPACK_IMPORTED_MODULE_0__.Framework.WebUnknown, detectionMethod: _Web_mjs__WEBPACK_IMPORTED_MODULE_9__.webDetect },
|
|
1872
|
+
// Last, detect ssr frameworks
|
|
1873
|
+
{ platform: _types_mjs__WEBPACK_IMPORTED_MODULE_0__.Framework.NextJsSSR, detectionMethod: _Next_mjs__WEBPACK_IMPORTED_MODULE_3__.nextSSRDetect },
|
|
1874
|
+
{ platform: _types_mjs__WEBPACK_IMPORTED_MODULE_0__.Framework.NuxtSSR, detectionMethod: _Nuxt_mjs__WEBPACK_IMPORTED_MODULE_4__.nuxtSSRDetect },
|
|
1875
|
+
{ platform: _types_mjs__WEBPACK_IMPORTED_MODULE_0__.Framework.ReactSSR, detectionMethod: _React_mjs__WEBPACK_IMPORTED_MODULE_6__.reactSSRDetect },
|
|
1876
|
+
{ platform: _types_mjs__WEBPACK_IMPORTED_MODULE_0__.Framework.VueJsSSR, detectionMethod: _Vue_mjs__WEBPACK_IMPORTED_MODULE_7__.vueSSRDetect },
|
|
1877
|
+
{ platform: _types_mjs__WEBPACK_IMPORTED_MODULE_0__.Framework.AngularSSR, detectionMethod: _Angular_mjs__WEBPACK_IMPORTED_MODULE_5__.angularSSRDetect },
|
|
1878
|
+
{ platform: _types_mjs__WEBPACK_IMPORTED_MODULE_0__.Framework.SvelteSSR, detectionMethod: _Svelte_mjs__WEBPACK_IMPORTED_MODULE_8__.svelteSSRDetect },
|
|
1879
|
+
];
|
|
1880
|
+
function detect() {
|
|
1881
|
+
return (detectionMap.find(detectionEntry => detectionEntry.detectionMethod())
|
|
1882
|
+
?.platform || _types_mjs__WEBPACK_IMPORTED_MODULE_0__.Framework.ServerSideUnknown);
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
|
|
1886
|
+
//# sourceMappingURL=index.mjs.map
|
|
1887
|
+
|
|
1888
|
+
|
|
1889
|
+
/***/ }),
|
|
1890
|
+
|
|
1891
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Platform/index.mjs":
|
|
1892
|
+
/*!********************************************************************!*\
|
|
1893
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Platform/index.mjs ***!
|
|
1894
|
+
\********************************************************************/
|
|
1895
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1896
|
+
|
|
1897
|
+
"use strict";
|
|
1898
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1899
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1900
|
+
/* harmony export */ Platform: () => (/* binding */ Platform),
|
|
1901
|
+
/* harmony export */ getAmplifyUserAgent: () => (/* binding */ getAmplifyUserAgent),
|
|
1902
|
+
/* harmony export */ getAmplifyUserAgentObject: () => (/* binding */ getAmplifyUserAgentObject),
|
|
1903
|
+
/* harmony export */ sanitizeAmplifyVersion: () => (/* binding */ sanitizeAmplifyVersion)
|
|
1904
|
+
/* harmony export */ });
|
|
1905
|
+
/* harmony import */ var _types_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/types.mjs");
|
|
1906
|
+
/* harmony import */ var _version_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./version.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/version.mjs");
|
|
1907
|
+
/* harmony import */ var _detectFramework_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./detectFramework.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/detectFramework.mjs");
|
|
1908
|
+
/* harmony import */ var _customUserAgent_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./customUserAgent.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Platform/customUserAgent.mjs");
|
|
1909
|
+
|
|
1910
|
+
|
|
1911
|
+
|
|
1912
|
+
|
|
1913
|
+
|
|
1914
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1915
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1916
|
+
const BASE_USER_AGENT = `aws-amplify`;
|
|
1917
|
+
/** Sanitize Amplify version string be removing special character + and character post the special character */
|
|
1918
|
+
const sanitizeAmplifyVersion = (amplifyVersion) => amplifyVersion.replace(/\+.*/, '');
|
|
1919
|
+
class PlatformBuilder {
|
|
1920
|
+
constructor() {
|
|
1921
|
+
this.userAgent = `${BASE_USER_AGENT}/${sanitizeAmplifyVersion(_version_mjs__WEBPACK_IMPORTED_MODULE_0__.version)}`;
|
|
1922
|
+
}
|
|
1923
|
+
get framework() {
|
|
1924
|
+
return (0,_detectFramework_mjs__WEBPACK_IMPORTED_MODULE_1__.detectFramework)();
|
|
1925
|
+
}
|
|
1926
|
+
get isReactNative() {
|
|
1927
|
+
return (this.framework === _types_mjs__WEBPACK_IMPORTED_MODULE_2__.Framework.ReactNative ||
|
|
1928
|
+
this.framework === _types_mjs__WEBPACK_IMPORTED_MODULE_2__.Framework.Expo);
|
|
1929
|
+
}
|
|
1930
|
+
observeFrameworkChanges(fcn) {
|
|
1931
|
+
(0,_detectFramework_mjs__WEBPACK_IMPORTED_MODULE_1__.observeFrameworkChanges)(fcn);
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
const Platform = new PlatformBuilder();
|
|
1935
|
+
const getAmplifyUserAgentObject = ({ category, action, } = {}) => {
|
|
1936
|
+
const userAgent = [
|
|
1937
|
+
[BASE_USER_AGENT, sanitizeAmplifyVersion(_version_mjs__WEBPACK_IMPORTED_MODULE_0__.version)],
|
|
1938
|
+
];
|
|
1939
|
+
if (category) {
|
|
1940
|
+
userAgent.push([category, action]);
|
|
1941
|
+
}
|
|
1942
|
+
userAgent.push(['framework', (0,_detectFramework_mjs__WEBPACK_IMPORTED_MODULE_1__.detectFramework)()]);
|
|
1943
|
+
if (category && action) {
|
|
1944
|
+
const customState = (0,_customUserAgent_mjs__WEBPACK_IMPORTED_MODULE_3__.getCustomUserAgent)(category, action);
|
|
1945
|
+
if (customState) {
|
|
1946
|
+
customState.forEach(state => {
|
|
1947
|
+
userAgent.push(state);
|
|
1948
|
+
});
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
return userAgent;
|
|
1952
|
+
};
|
|
1953
|
+
const getAmplifyUserAgent = (customUserAgentDetails) => {
|
|
1954
|
+
const userAgent = getAmplifyUserAgentObject(customUserAgentDetails);
|
|
1955
|
+
const userAgentString = userAgent
|
|
1956
|
+
.map(([agentKey, agentValue]) => agentKey && agentValue ? `${agentKey}/${agentValue}` : agentKey)
|
|
1957
|
+
.join(' ');
|
|
1958
|
+
return userAgentString;
|
|
1959
|
+
};
|
|
1960
|
+
|
|
1961
|
+
|
|
1962
|
+
//# sourceMappingURL=index.mjs.map
|
|
1963
|
+
|
|
1964
|
+
|
|
1965
|
+
/***/ }),
|
|
1966
|
+
|
|
1967
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Platform/types.mjs":
|
|
1968
|
+
/*!********************************************************************!*\
|
|
1969
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Platform/types.mjs ***!
|
|
1970
|
+
\********************************************************************/
|
|
1971
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1972
|
+
|
|
1973
|
+
"use strict";
|
|
1974
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1975
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1976
|
+
/* harmony export */ AiAction: () => (/* binding */ AiAction),
|
|
1977
|
+
/* harmony export */ AnalyticsAction: () => (/* binding */ AnalyticsAction),
|
|
1978
|
+
/* harmony export */ ApiAction: () => (/* binding */ ApiAction),
|
|
1979
|
+
/* harmony export */ AuthAction: () => (/* binding */ AuthAction),
|
|
1980
|
+
/* harmony export */ Category: () => (/* binding */ Category),
|
|
1981
|
+
/* harmony export */ DataStoreAction: () => (/* binding */ DataStoreAction),
|
|
1982
|
+
/* harmony export */ Framework: () => (/* binding */ Framework),
|
|
1983
|
+
/* harmony export */ GeoAction: () => (/* binding */ GeoAction),
|
|
1984
|
+
/* harmony export */ InAppMessagingAction: () => (/* binding */ InAppMessagingAction),
|
|
1985
|
+
/* harmony export */ InteractionsAction: () => (/* binding */ InteractionsAction),
|
|
1986
|
+
/* harmony export */ PredictionsAction: () => (/* binding */ PredictionsAction),
|
|
1987
|
+
/* harmony export */ PubSubAction: () => (/* binding */ PubSubAction),
|
|
1988
|
+
/* harmony export */ PushNotificationAction: () => (/* binding */ PushNotificationAction),
|
|
1989
|
+
/* harmony export */ StorageAction: () => (/* binding */ StorageAction)
|
|
1990
|
+
/* harmony export */ });
|
|
1991
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1992
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1993
|
+
var Framework;
|
|
1994
|
+
(function (Framework) {
|
|
1995
|
+
// < 100 - Web frameworks
|
|
1996
|
+
Framework["WebUnknown"] = "0";
|
|
1997
|
+
Framework["React"] = "1";
|
|
1998
|
+
Framework["NextJs"] = "2";
|
|
1999
|
+
Framework["Angular"] = "3";
|
|
2000
|
+
Framework["VueJs"] = "4";
|
|
2001
|
+
Framework["Nuxt"] = "5";
|
|
2002
|
+
Framework["Svelte"] = "6";
|
|
2003
|
+
// 100s - Server side frameworks
|
|
2004
|
+
Framework["ServerSideUnknown"] = "100";
|
|
2005
|
+
Framework["ReactSSR"] = "101";
|
|
2006
|
+
Framework["NextJsSSR"] = "102";
|
|
2007
|
+
Framework["AngularSSR"] = "103";
|
|
2008
|
+
Framework["VueJsSSR"] = "104";
|
|
2009
|
+
Framework["NuxtSSR"] = "105";
|
|
2010
|
+
Framework["SvelteSSR"] = "106";
|
|
2011
|
+
// 200s - Mobile framework
|
|
2012
|
+
Framework["ReactNative"] = "201";
|
|
2013
|
+
Framework["Expo"] = "202";
|
|
2014
|
+
})(Framework || (Framework = {}));
|
|
2015
|
+
var Category;
|
|
2016
|
+
(function (Category) {
|
|
2017
|
+
Category["AI"] = "ai";
|
|
2018
|
+
Category["API"] = "api";
|
|
2019
|
+
Category["Auth"] = "auth";
|
|
2020
|
+
Category["Analytics"] = "analytics";
|
|
2021
|
+
Category["DataStore"] = "datastore";
|
|
2022
|
+
Category["Geo"] = "geo";
|
|
2023
|
+
Category["InAppMessaging"] = "inappmessaging";
|
|
2024
|
+
Category["Interactions"] = "interactions";
|
|
2025
|
+
Category["Predictions"] = "predictions";
|
|
2026
|
+
Category["PubSub"] = "pubsub";
|
|
2027
|
+
Category["PushNotification"] = "pushnotification";
|
|
2028
|
+
Category["Storage"] = "storage";
|
|
2029
|
+
})(Category || (Category = {}));
|
|
2030
|
+
var AiAction;
|
|
2031
|
+
(function (AiAction) {
|
|
2032
|
+
AiAction["CreateConversation"] = "1";
|
|
2033
|
+
AiAction["GetConversation"] = "2";
|
|
2034
|
+
AiAction["ListConversations"] = "3";
|
|
2035
|
+
AiAction["DeleteConversation"] = "4";
|
|
2036
|
+
AiAction["SendMessage"] = "5";
|
|
2037
|
+
AiAction["ListMessages"] = "6";
|
|
2038
|
+
AiAction["OnMessage"] = "7";
|
|
2039
|
+
AiAction["Generation"] = "8";
|
|
2040
|
+
AiAction["UpdateConversation"] = "9";
|
|
2041
|
+
})(AiAction || (AiAction = {}));
|
|
2042
|
+
var AnalyticsAction;
|
|
2043
|
+
(function (AnalyticsAction) {
|
|
2044
|
+
AnalyticsAction["Record"] = "1";
|
|
2045
|
+
AnalyticsAction["IdentifyUser"] = "2";
|
|
2046
|
+
})(AnalyticsAction || (AnalyticsAction = {}));
|
|
2047
|
+
var ApiAction;
|
|
2048
|
+
(function (ApiAction) {
|
|
2049
|
+
ApiAction["GraphQl"] = "1";
|
|
2050
|
+
ApiAction["Get"] = "2";
|
|
2051
|
+
ApiAction["Post"] = "3";
|
|
2052
|
+
ApiAction["Put"] = "4";
|
|
2053
|
+
ApiAction["Patch"] = "5";
|
|
2054
|
+
ApiAction["Del"] = "6";
|
|
2055
|
+
ApiAction["Head"] = "7";
|
|
2056
|
+
})(ApiAction || (ApiAction = {}));
|
|
2057
|
+
var AuthAction;
|
|
2058
|
+
(function (AuthAction) {
|
|
2059
|
+
AuthAction["SignUp"] = "1";
|
|
2060
|
+
AuthAction["ConfirmSignUp"] = "2";
|
|
2061
|
+
AuthAction["ResendSignUpCode"] = "3";
|
|
2062
|
+
AuthAction["SignIn"] = "4";
|
|
2063
|
+
AuthAction["FetchMFAPreference"] = "6";
|
|
2064
|
+
AuthAction["UpdateMFAPreference"] = "7";
|
|
2065
|
+
AuthAction["SetUpTOTP"] = "10";
|
|
2066
|
+
AuthAction["VerifyTOTPSetup"] = "11";
|
|
2067
|
+
AuthAction["ConfirmSignIn"] = "12";
|
|
2068
|
+
AuthAction["DeleteUserAttributes"] = "15";
|
|
2069
|
+
AuthAction["DeleteUser"] = "16";
|
|
2070
|
+
AuthAction["UpdateUserAttributes"] = "17";
|
|
2071
|
+
AuthAction["FetchUserAttributes"] = "18";
|
|
2072
|
+
AuthAction["ConfirmUserAttribute"] = "22";
|
|
2073
|
+
AuthAction["SignOut"] = "26";
|
|
2074
|
+
AuthAction["UpdatePassword"] = "27";
|
|
2075
|
+
AuthAction["ResetPassword"] = "28";
|
|
2076
|
+
AuthAction["ConfirmResetPassword"] = "29";
|
|
2077
|
+
AuthAction["FederatedSignIn"] = "30";
|
|
2078
|
+
AuthAction["RememberDevice"] = "32";
|
|
2079
|
+
AuthAction["ForgetDevice"] = "33";
|
|
2080
|
+
AuthAction["FetchDevices"] = "34";
|
|
2081
|
+
AuthAction["SendUserAttributeVerificationCode"] = "35";
|
|
2082
|
+
AuthAction["SignInWithRedirect"] = "36";
|
|
2083
|
+
AuthAction["StartWebAuthnRegistration"] = "37";
|
|
2084
|
+
AuthAction["CompleteWebAuthnRegistration"] = "38";
|
|
2085
|
+
AuthAction["ListWebAuthnCredentials"] = "39";
|
|
2086
|
+
AuthAction["DeleteWebAuthnCredential"] = "40";
|
|
2087
|
+
})(AuthAction || (AuthAction = {}));
|
|
2088
|
+
var DataStoreAction;
|
|
2089
|
+
(function (DataStoreAction) {
|
|
2090
|
+
DataStoreAction["Subscribe"] = "1";
|
|
2091
|
+
DataStoreAction["GraphQl"] = "2";
|
|
2092
|
+
})(DataStoreAction || (DataStoreAction = {}));
|
|
2093
|
+
var GeoAction;
|
|
2094
|
+
(function (GeoAction) {
|
|
2095
|
+
GeoAction["SearchByText"] = "0";
|
|
2096
|
+
GeoAction["SearchByCoordinates"] = "1";
|
|
2097
|
+
GeoAction["SearchForSuggestions"] = "2";
|
|
2098
|
+
GeoAction["SearchByPlaceId"] = "3";
|
|
2099
|
+
GeoAction["SaveGeofences"] = "4";
|
|
2100
|
+
GeoAction["GetGeofence"] = "5";
|
|
2101
|
+
GeoAction["ListGeofences"] = "6";
|
|
2102
|
+
GeoAction["DeleteGeofences"] = "7";
|
|
2103
|
+
})(GeoAction || (GeoAction = {}));
|
|
2104
|
+
var InAppMessagingAction;
|
|
2105
|
+
(function (InAppMessagingAction) {
|
|
2106
|
+
InAppMessagingAction["SyncMessages"] = "1";
|
|
2107
|
+
InAppMessagingAction["IdentifyUser"] = "2";
|
|
2108
|
+
InAppMessagingAction["NotifyMessageInteraction"] = "3";
|
|
2109
|
+
})(InAppMessagingAction || (InAppMessagingAction = {}));
|
|
2110
|
+
var InteractionsAction;
|
|
2111
|
+
(function (InteractionsAction) {
|
|
2112
|
+
InteractionsAction["None"] = "0";
|
|
2113
|
+
})(InteractionsAction || (InteractionsAction = {}));
|
|
2114
|
+
var PredictionsAction;
|
|
2115
|
+
(function (PredictionsAction) {
|
|
2116
|
+
PredictionsAction["Convert"] = "1";
|
|
2117
|
+
PredictionsAction["Identify"] = "2";
|
|
2118
|
+
PredictionsAction["Interpret"] = "3";
|
|
2119
|
+
})(PredictionsAction || (PredictionsAction = {}));
|
|
2120
|
+
var PubSubAction;
|
|
2121
|
+
(function (PubSubAction) {
|
|
2122
|
+
PubSubAction["Subscribe"] = "1";
|
|
2123
|
+
})(PubSubAction || (PubSubAction = {}));
|
|
2124
|
+
var PushNotificationAction;
|
|
2125
|
+
(function (PushNotificationAction) {
|
|
2126
|
+
PushNotificationAction["InitializePushNotifications"] = "1";
|
|
2127
|
+
PushNotificationAction["IdentifyUser"] = "2";
|
|
2128
|
+
})(PushNotificationAction || (PushNotificationAction = {}));
|
|
2129
|
+
var StorageAction;
|
|
2130
|
+
(function (StorageAction) {
|
|
2131
|
+
StorageAction["UploadData"] = "1";
|
|
2132
|
+
StorageAction["DownloadData"] = "2";
|
|
2133
|
+
StorageAction["List"] = "3";
|
|
2134
|
+
StorageAction["Copy"] = "4";
|
|
2135
|
+
StorageAction["Remove"] = "5";
|
|
2136
|
+
StorageAction["GetProperties"] = "6";
|
|
2137
|
+
StorageAction["GetUrl"] = "7";
|
|
2138
|
+
StorageAction["GetDataAccess"] = "8";
|
|
2139
|
+
StorageAction["ListCallerAccessGrants"] = "9";
|
|
2140
|
+
})(StorageAction || (StorageAction = {}));
|
|
2141
|
+
|
|
2142
|
+
|
|
2143
|
+
//# sourceMappingURL=types.mjs.map
|
|
2144
|
+
|
|
2145
|
+
|
|
2146
|
+
/***/ }),
|
|
2147
|
+
|
|
2148
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Platform/version.mjs":
|
|
2149
|
+
/*!**********************************************************************!*\
|
|
2150
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Platform/version.mjs ***!
|
|
2151
|
+
\**********************************************************************/
|
|
2152
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2153
|
+
|
|
2154
|
+
"use strict";
|
|
2155
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2156
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2157
|
+
/* harmony export */ version: () => (/* binding */ version)
|
|
2158
|
+
/* harmony export */ });
|
|
2159
|
+
// generated by genversion
|
|
2160
|
+
const version = '6.15.5';
|
|
2161
|
+
|
|
2162
|
+
|
|
2163
|
+
//# sourceMappingURL=version.mjs.map
|
|
2164
|
+
|
|
2165
|
+
|
|
2166
|
+
/***/ }),
|
|
2167
|
+
|
|
2168
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/clients/endpoints/getDnsSuffix.mjs":
|
|
2169
|
+
/*!************************************************************************************!*\
|
|
2170
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/clients/endpoints/getDnsSuffix.mjs ***!
|
|
2171
|
+
\************************************************************************************/
|
|
2172
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2173
|
+
|
|
2174
|
+
"use strict";
|
|
2175
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2176
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2177
|
+
/* harmony export */ getDnsSuffix: () => (/* binding */ getDnsSuffix)
|
|
2178
|
+
/* harmony export */ });
|
|
2179
|
+
/* harmony import */ var _partitions_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./partitions.mjs */ "./node_modules/@aws-amplify/core/dist/esm/clients/endpoints/partitions.mjs");
|
|
2180
|
+
|
|
2181
|
+
|
|
2182
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2183
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2184
|
+
/**
|
|
2185
|
+
* Get the AWS Services endpoint URL's DNS suffix for a given region. A typical AWS regional service endpoint URL will
|
|
2186
|
+
* follow this pattern: {endpointPrefix}.{region}.{dnsSuffix}. For example, the endpoint URL for Cognito Identity in
|
|
2187
|
+
* us-east-1 will be cognito-identity.us-east-1.amazonaws.com. Here the DnsSuffix is `amazonaws.com`.
|
|
2188
|
+
*
|
|
2189
|
+
* @param region
|
|
2190
|
+
* @returns The DNS suffix
|
|
2191
|
+
*
|
|
2192
|
+
* @internal
|
|
2193
|
+
*/
|
|
2194
|
+
const getDnsSuffix = (region) => {
|
|
2195
|
+
const { partitions } = _partitions_mjs__WEBPACK_IMPORTED_MODULE_0__.partitionsInfo;
|
|
2196
|
+
for (const { regions, outputs, regionRegex } of partitions) {
|
|
2197
|
+
const regex = new RegExp(regionRegex);
|
|
2198
|
+
if (regions.includes(region) || regex.test(region)) {
|
|
2199
|
+
return outputs.dnsSuffix;
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
return _partitions_mjs__WEBPACK_IMPORTED_MODULE_0__.defaultPartition.outputs.dnsSuffix;
|
|
2203
|
+
};
|
|
2204
|
+
|
|
2205
|
+
|
|
2206
|
+
//# sourceMappingURL=getDnsSuffix.mjs.map
|
|
2207
|
+
|
|
2208
|
+
|
|
2209
|
+
/***/ }),
|
|
2210
|
+
|
|
2211
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/clients/endpoints/partitions.mjs":
|
|
2212
|
+
/*!**********************************************************************************!*\
|
|
2213
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/clients/endpoints/partitions.mjs ***!
|
|
2214
|
+
\**********************************************************************************/
|
|
2215
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2216
|
+
|
|
2217
|
+
"use strict";
|
|
2218
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2219
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2220
|
+
/* harmony export */ defaultPartition: () => (/* binding */ defaultPartition),
|
|
2221
|
+
/* harmony export */ partitionsInfo: () => (/* binding */ partitionsInfo)
|
|
2222
|
+
/* harmony export */ });
|
|
2223
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2224
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2225
|
+
/**
|
|
2226
|
+
* Default partition for AWS services. This is used when the region is not provided or the region is not recognized.
|
|
2227
|
+
*
|
|
2228
|
+
* @internal
|
|
2229
|
+
*/
|
|
2230
|
+
const defaultPartition = {
|
|
2231
|
+
id: 'aws',
|
|
2232
|
+
outputs: {
|
|
2233
|
+
dnsSuffix: 'amazonaws.com',
|
|
2234
|
+
},
|
|
2235
|
+
regionRegex: '^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$',
|
|
2236
|
+
regions: ['aws-global'],
|
|
2237
|
+
};
|
|
2238
|
+
/**
|
|
2239
|
+
* This data is adapted from the partition file from AWS SDK shared utilities but remove some contents for bundle size
|
|
2240
|
+
* concern. Information removed are `dualStackDnsSuffix`, `supportDualStack`, `supportFIPS`, restricted partitions, and
|
|
2241
|
+
* list of regions for each partition other than global regions.
|
|
2242
|
+
*
|
|
2243
|
+
* * Ref: https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints
|
|
2244
|
+
* * Ref: https://github.com/aws/aws-sdk-js-v3/blob/0201baef03c2379f1f6f7150b9d401d4b230d488/packages/util-endpoints/src/lib/aws/partitions.json#L1
|
|
2245
|
+
*
|
|
2246
|
+
* @internal
|
|
2247
|
+
*/
|
|
2248
|
+
const partitionsInfo = {
|
|
2249
|
+
partitions: [
|
|
2250
|
+
defaultPartition,
|
|
2251
|
+
{
|
|
2252
|
+
id: 'aws-cn',
|
|
2253
|
+
outputs: {
|
|
2254
|
+
dnsSuffix: 'amazonaws.com.cn',
|
|
2255
|
+
},
|
|
2256
|
+
regionRegex: '^cn\\-\\w+\\-\\d+$',
|
|
2257
|
+
regions: ['aws-cn-global'],
|
|
2258
|
+
},
|
|
2259
|
+
],
|
|
2260
|
+
};
|
|
2261
|
+
|
|
2262
|
+
|
|
2263
|
+
//# sourceMappingURL=partitions.mjs.map
|
|
2264
|
+
|
|
2265
|
+
|
|
2266
|
+
/***/ }),
|
|
2267
|
+
|
|
2268
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/clients/handlers/aws/unauthenticated.mjs":
|
|
2269
|
+
/*!******************************************************************************************!*\
|
|
2270
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/clients/handlers/aws/unauthenticated.mjs ***!
|
|
2271
|
+
\******************************************************************************************/
|
|
2272
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2273
|
+
|
|
2274
|
+
"use strict";
|
|
2275
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2276
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2277
|
+
/* harmony export */ unauthenticatedHandler: () => (/* binding */ unauthenticatedHandler)
|
|
2278
|
+
/* harmony export */ });
|
|
2279
|
+
/* harmony import */ var _middleware_retry_retryMiddleware_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../middleware/retry/retryMiddleware.mjs */ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/retryMiddleware.mjs");
|
|
2280
|
+
/* harmony import */ var _middleware_retry_amzSdkInvocationIdHeaderMiddleware_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../middleware/retry/amzSdkInvocationIdHeaderMiddleware.mjs */ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/amzSdkInvocationIdHeaderMiddleware.mjs");
|
|
2281
|
+
/* harmony import */ var _middleware_retry_amzSdkRequestHeaderMiddleware_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../middleware/retry/amzSdkRequestHeaderMiddleware.mjs */ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/amzSdkRequestHeaderMiddleware.mjs");
|
|
2282
|
+
/* harmony import */ var _middleware_userAgent_middleware_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../middleware/userAgent/middleware.mjs */ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/userAgent/middleware.mjs");
|
|
2283
|
+
/* harmony import */ var _internal_composeTransferHandler_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../internal/composeTransferHandler.mjs */ "./node_modules/@aws-amplify/core/dist/esm/clients/internal/composeTransferHandler.mjs");
|
|
2284
|
+
/* harmony import */ var _fetch_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../fetch.mjs */ "./node_modules/@aws-amplify/core/dist/esm/clients/handlers/fetch.mjs");
|
|
2285
|
+
|
|
2286
|
+
|
|
2287
|
+
|
|
2288
|
+
|
|
2289
|
+
|
|
2290
|
+
|
|
2291
|
+
|
|
2292
|
+
|
|
2293
|
+
|
|
2294
|
+
|
|
2295
|
+
|
|
2296
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2297
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2298
|
+
const unauthenticatedHandler = (0,_internal_composeTransferHandler_mjs__WEBPACK_IMPORTED_MODULE_0__.composeTransferHandler)(_fetch_mjs__WEBPACK_IMPORTED_MODULE_1__.fetchTransferHandler, [
|
|
2299
|
+
_middleware_userAgent_middleware_mjs__WEBPACK_IMPORTED_MODULE_2__.userAgentMiddlewareFactory,
|
|
2300
|
+
_middleware_retry_amzSdkInvocationIdHeaderMiddleware_mjs__WEBPACK_IMPORTED_MODULE_3__.amzSdkInvocationIdHeaderMiddlewareFactory,
|
|
2301
|
+
_middleware_retry_retryMiddleware_mjs__WEBPACK_IMPORTED_MODULE_4__.retryMiddlewareFactory,
|
|
2302
|
+
_middleware_retry_amzSdkRequestHeaderMiddleware_mjs__WEBPACK_IMPORTED_MODULE_5__.amzSdkRequestHeaderMiddlewareFactory,
|
|
2303
|
+
]);
|
|
2304
|
+
|
|
2305
|
+
|
|
2306
|
+
//# sourceMappingURL=unauthenticated.mjs.map
|
|
2307
|
+
|
|
2308
|
+
|
|
2309
|
+
/***/ }),
|
|
2310
|
+
|
|
2311
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/clients/handlers/fetch.mjs":
|
|
2312
|
+
/*!****************************************************************************!*\
|
|
2313
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/clients/handlers/fetch.mjs ***!
|
|
2314
|
+
\****************************************************************************/
|
|
2315
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2316
|
+
|
|
2317
|
+
"use strict";
|
|
2318
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2319
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2320
|
+
/* harmony export */ fetchTransferHandler: () => (/* binding */ fetchTransferHandler)
|
|
2321
|
+
/* harmony export */ });
|
|
2322
|
+
/* harmony import */ var _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../errors/AmplifyError.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/AmplifyError.mjs");
|
|
2323
|
+
/* harmony import */ var _types_errors_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../types/errors.mjs */ "./node_modules/@aws-amplify/core/dist/esm/types/errors.mjs");
|
|
2324
|
+
/* harmony import */ var _utils_memoization_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/memoization.mjs */ "./node_modules/@aws-amplify/core/dist/esm/clients/utils/memoization.mjs");
|
|
2325
|
+
|
|
2326
|
+
|
|
2327
|
+
|
|
2328
|
+
|
|
2329
|
+
|
|
2330
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2331
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2332
|
+
const shouldSendBody = (method) => !['HEAD', 'GET'].includes(method.toUpperCase());
|
|
2333
|
+
// TODO[AllanZhengYP]: we need to provide isCanceledError utility
|
|
2334
|
+
const fetchTransferHandler = async ({ url, method, headers, body }, { abortSignal, cache, withCrossDomainCredentials }) => {
|
|
2335
|
+
let resp;
|
|
2336
|
+
try {
|
|
2337
|
+
resp = await fetch(url, {
|
|
2338
|
+
method,
|
|
2339
|
+
headers,
|
|
2340
|
+
body: shouldSendBody(method) ? body : undefined,
|
|
2341
|
+
signal: abortSignal,
|
|
2342
|
+
cache,
|
|
2343
|
+
credentials: withCrossDomainCredentials ? 'include' : 'same-origin',
|
|
2344
|
+
});
|
|
2345
|
+
}
|
|
2346
|
+
catch (e) {
|
|
2347
|
+
if (e instanceof TypeError) {
|
|
2348
|
+
throw new _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__.AmplifyError({
|
|
2349
|
+
name: _types_errors_mjs__WEBPACK_IMPORTED_MODULE_1__.AmplifyErrorCode.NetworkError,
|
|
2350
|
+
message: 'A network error has occurred.',
|
|
2351
|
+
underlyingError: e,
|
|
2352
|
+
});
|
|
2353
|
+
}
|
|
2354
|
+
throw e;
|
|
2355
|
+
}
|
|
2356
|
+
const responseHeaders = {};
|
|
2357
|
+
resp.headers?.forEach((value, key) => {
|
|
2358
|
+
responseHeaders[key.toLowerCase()] = value;
|
|
2359
|
+
});
|
|
2360
|
+
const httpResponse = {
|
|
2361
|
+
statusCode: resp.status,
|
|
2362
|
+
headers: responseHeaders,
|
|
2363
|
+
body: null,
|
|
2364
|
+
};
|
|
2365
|
+
// resp.body is a ReadableStream according to Fetch API spec, but React Native
|
|
2366
|
+
// does not implement it.
|
|
2367
|
+
const bodyWithMixin = Object.assign(resp.body ?? {}, {
|
|
2368
|
+
text: (0,_utils_memoization_mjs__WEBPACK_IMPORTED_MODULE_2__.withMemoization)(() => resp.text()),
|
|
2369
|
+
blob: (0,_utils_memoization_mjs__WEBPACK_IMPORTED_MODULE_2__.withMemoization)(() => resp.blob()),
|
|
2370
|
+
json: (0,_utils_memoization_mjs__WEBPACK_IMPORTED_MODULE_2__.withMemoization)(() => resp.json()),
|
|
2371
|
+
});
|
|
2372
|
+
return {
|
|
2373
|
+
...httpResponse,
|
|
2374
|
+
body: bodyWithMixin,
|
|
2375
|
+
};
|
|
2376
|
+
};
|
|
2377
|
+
|
|
2378
|
+
|
|
2379
|
+
//# sourceMappingURL=fetch.mjs.map
|
|
2380
|
+
|
|
2381
|
+
|
|
2382
|
+
/***/ }),
|
|
2383
|
+
|
|
2384
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/clients/internal/composeServiceApi.mjs":
|
|
2385
|
+
/*!****************************************************************************************!*\
|
|
2386
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/clients/internal/composeServiceApi.mjs ***!
|
|
2387
|
+
\****************************************************************************************/
|
|
2388
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2389
|
+
|
|
2390
|
+
"use strict";
|
|
2391
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2392
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2393
|
+
/* harmony export */ composeServiceApi: () => (/* binding */ composeServiceApi)
|
|
2394
|
+
/* harmony export */ });
|
|
2395
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2396
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2397
|
+
/**
|
|
2398
|
+
* Compose a service API handler that accepts input as defined shape and responds conforming to defined output shape.
|
|
2399
|
+
* A service API handler is composed with:
|
|
2400
|
+
* * A transfer handler
|
|
2401
|
+
* * A serializer function
|
|
2402
|
+
* * A deserializer function
|
|
2403
|
+
* * A default config object
|
|
2404
|
+
*
|
|
2405
|
+
* The returned service API handler, when called, will trigger the following workflow:
|
|
2406
|
+
* 1. When calling the service API handler function, the default config object is merged into the input config
|
|
2407
|
+
* object to assign the default values of some omitted configs, resulting to a resolved config object.
|
|
2408
|
+
* 2. The `endpointResolver` function from the default config object will be invoked with the resolved config object and
|
|
2409
|
+
* API input object resulting to an endpoint instance.
|
|
2410
|
+
* 3. The serializer function is invoked with API input object and the endpoint instance resulting to an HTTP request
|
|
2411
|
+
* instance.
|
|
2412
|
+
* 4. The HTTP request instance and the resolved config object is passed to the transfer handler function.
|
|
2413
|
+
* 5. The transfer handler function resolves to an HTTP response instance(can be either successful or failed status code).
|
|
2414
|
+
* 6. The deserializer function is invoked with the HTTP response instance resulting to the API output object, and
|
|
2415
|
+
* return to the caller.
|
|
2416
|
+
*
|
|
2417
|
+
*
|
|
2418
|
+
* @param transferHandler Async function for dispatching HTTP requests and returning HTTP response.
|
|
2419
|
+
* @param serializer Async function for converting object in defined input shape into HTTP request targeting a given
|
|
2420
|
+
* endpoint.
|
|
2421
|
+
* @param deserializer Async function for converting HTTP response into output object in defined output shape, or error
|
|
2422
|
+
* shape.
|
|
2423
|
+
* @param defaultConfig object containing default options to be consumed by transfer handler, serializer and
|
|
2424
|
+
* deserializer.
|
|
2425
|
+
* @returns a async service API handler function that accepts a config object and input object in defined shape, returns
|
|
2426
|
+
* an output object in defined shape. It may also throw error instance in defined shape in deserializer. The config
|
|
2427
|
+
* object type is composed with options type of transferHandler, endpointResolver function as well as endpointResolver
|
|
2428
|
+
* function's input options type, region string. The config object property will be marked as optional if it's also
|
|
2429
|
+
* defined in defaultConfig.
|
|
2430
|
+
*
|
|
2431
|
+
* @internal
|
|
2432
|
+
*/
|
|
2433
|
+
const composeServiceApi = (transferHandler, serializer, deserializer, defaultConfig) => {
|
|
2434
|
+
return async (config, input) => {
|
|
2435
|
+
const resolvedConfig = {
|
|
2436
|
+
...defaultConfig,
|
|
2437
|
+
...config,
|
|
2438
|
+
};
|
|
2439
|
+
// We need to allow different endpoints based on both given config(other than region) and input.
|
|
2440
|
+
// However for most of non-S3 services, region is the only input for endpoint resolver.
|
|
2441
|
+
const endpoint = await resolvedConfig.endpointResolver(resolvedConfig, input);
|
|
2442
|
+
// Unlike AWS SDK clients, a serializer should NOT populate the `host` or `content-length` headers.
|
|
2443
|
+
// Both of these headers are prohibited per Spec(https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name).
|
|
2444
|
+
// They will be populated automatically by browser, or node-fetch polyfill.
|
|
2445
|
+
const request = await serializer(input, endpoint);
|
|
2446
|
+
const response = await transferHandler(request, {
|
|
2447
|
+
...resolvedConfig,
|
|
2448
|
+
});
|
|
2449
|
+
return deserializer(response);
|
|
2450
|
+
};
|
|
2451
|
+
};
|
|
2452
|
+
|
|
2453
|
+
|
|
2454
|
+
//# sourceMappingURL=composeServiceApi.mjs.map
|
|
2455
|
+
|
|
2456
|
+
|
|
2457
|
+
/***/ }),
|
|
2458
|
+
|
|
2459
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/clients/internal/composeTransferHandler.mjs":
|
|
2460
|
+
/*!*********************************************************************************************!*\
|
|
2461
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/clients/internal/composeTransferHandler.mjs ***!
|
|
2462
|
+
\*********************************************************************************************/
|
|
2463
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2464
|
+
|
|
2465
|
+
"use strict";
|
|
2466
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2467
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2468
|
+
/* harmony export */ composeTransferHandler: () => (/* binding */ composeTransferHandler)
|
|
2469
|
+
/* harmony export */ });
|
|
2470
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2471
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2472
|
+
/**
|
|
2473
|
+
* Compose a transfer handler with a core transfer handler and a list of middleware.
|
|
2474
|
+
* @param coreHandler Core transfer handler
|
|
2475
|
+
* @param middleware List of middleware
|
|
2476
|
+
* @returns A transfer handler whose option type is the union of the core
|
|
2477
|
+
* transfer handler's option type and the middleware's option type.
|
|
2478
|
+
* @internal
|
|
2479
|
+
*/
|
|
2480
|
+
const composeTransferHandler = (coreHandler, middleware) => (request, options) => {
|
|
2481
|
+
const context = {};
|
|
2482
|
+
let composedHandler = (composeHandlerRequest) => coreHandler(composeHandlerRequest, options);
|
|
2483
|
+
for (let i = middleware.length - 1; i >= 0; i--) {
|
|
2484
|
+
const m = middleware[i];
|
|
2485
|
+
const resolvedMiddleware = m(options);
|
|
2486
|
+
composedHandler = resolvedMiddleware(composedHandler, context);
|
|
2487
|
+
}
|
|
2488
|
+
return composedHandler(request);
|
|
2489
|
+
};
|
|
2490
|
+
|
|
2491
|
+
|
|
2492
|
+
//# sourceMappingURL=composeTransferHandler.mjs.map
|
|
2493
|
+
|
|
2494
|
+
|
|
2495
|
+
/***/ }),
|
|
2496
|
+
|
|
2497
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/amzSdkInvocationIdHeaderMiddleware.mjs":
|
|
2498
|
+
/*!*****************************************************************************************************************!*\
|
|
2499
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/amzSdkInvocationIdHeaderMiddleware.mjs ***!
|
|
2500
|
+
\*****************************************************************************************************************/
|
|
2501
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2502
|
+
|
|
2503
|
+
"use strict";
|
|
2504
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2505
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2506
|
+
/* harmony export */ amzSdkInvocationIdHeaderMiddlewareFactory: () => (/* binding */ amzSdkInvocationIdHeaderMiddlewareFactory)
|
|
2507
|
+
/* harmony export */ });
|
|
2508
|
+
/* harmony import */ var _utils_amplifyUuid_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utils/amplifyUuid/index.mjs */ "./node_modules/@aws-amplify/core/dist/esm/utils/amplifyUuid/index.mjs");
|
|
2509
|
+
/* harmony import */ var _aws_crypto_sha256_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @aws-crypto/sha256-js */ "./node_modules/@aws-crypto/sha256-js/build/module/index.js");
|
|
2510
|
+
/* harmony import */ var _smithy_util_hex_encoding__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @smithy/util-hex-encoding */ "./node_modules/@aws-amplify/core/node_modules/@smithy/util-hex-encoding/dist-es/index.js");
|
|
2511
|
+
/* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants.mjs */ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/constants.mjs");
|
|
2512
|
+
|
|
2513
|
+
|
|
2514
|
+
|
|
2515
|
+
|
|
2516
|
+
|
|
2517
|
+
|
|
2518
|
+
|
|
2519
|
+
|
|
2520
|
+
|
|
2521
|
+
|
|
2522
|
+
|
|
2523
|
+
|
|
2524
|
+
|
|
2525
|
+
|
|
2526
|
+
|
|
2527
|
+
|
|
2528
|
+
|
|
2529
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2530
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2531
|
+
/**
|
|
2532
|
+
* Middleware injects a UUID string to `amz-sdk-invocation-id` header.
|
|
2533
|
+
* if the header is not set already. This header is helpful to provide
|
|
2534
|
+
* observability to group the requests caused by automatic retry.
|
|
2535
|
+
*
|
|
2536
|
+
* This middleware is standalone because of extra UUID dependency, we will
|
|
2537
|
+
* NOT use this middleware for API categories.
|
|
2538
|
+
*
|
|
2539
|
+
* 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
|
|
2540
|
+
*/
|
|
2541
|
+
const amzSdkInvocationIdHeaderMiddlewareFactory = () => next => {
|
|
2542
|
+
return async function amzSdkInvocationIdHeaderMiddleware(request) {
|
|
2543
|
+
if (!request.headers[_constants_mjs__WEBPACK_IMPORTED_MODULE_2__.AMZ_SDK_INVOCATION_ID_HEADER]) {
|
|
2544
|
+
request.headers[_constants_mjs__WEBPACK_IMPORTED_MODULE_2__.AMZ_SDK_INVOCATION_ID_HEADER] = (0,_utils_amplifyUuid_index_mjs__WEBPACK_IMPORTED_MODULE_3__.amplifyUuid)();
|
|
2545
|
+
}
|
|
2546
|
+
return next(request);
|
|
2547
|
+
};
|
|
2548
|
+
};
|
|
2549
|
+
|
|
2550
|
+
|
|
2551
|
+
//# sourceMappingURL=amzSdkInvocationIdHeaderMiddleware.mjs.map
|
|
2552
|
+
|
|
2553
|
+
|
|
2554
|
+
/***/ }),
|
|
2555
|
+
|
|
2556
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/amzSdkRequestHeaderMiddleware.mjs":
|
|
2557
|
+
/*!************************************************************************************************************!*\
|
|
2558
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/amzSdkRequestHeaderMiddleware.mjs ***!
|
|
2559
|
+
\************************************************************************************************************/
|
|
2560
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2561
|
+
|
|
2562
|
+
"use strict";
|
|
2563
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2564
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2565
|
+
/* harmony export */ amzSdkRequestHeaderMiddlewareFactory: () => (/* binding */ amzSdkRequestHeaderMiddlewareFactory)
|
|
2566
|
+
/* harmony export */ });
|
|
2567
|
+
/* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.mjs */ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/constants.mjs");
|
|
2568
|
+
|
|
2569
|
+
|
|
2570
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2571
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2572
|
+
/**
|
|
2573
|
+
* Middleware injects `amz-sdk-request` header to indicate the retry state at the time an HTTP request is made.
|
|
2574
|
+
* This middleware should co-exist with retryMiddleware as it relies on the retryAttempts value in middleware context
|
|
2575
|
+
* set by the retry middleware.
|
|
2576
|
+
*
|
|
2577
|
+
* Example header: `amz-sdk-request: attempt=1; max=3`.
|
|
2578
|
+
*
|
|
2579
|
+
* This middleware is standalone because of extra headers may conflict with custom endpoint settings(e.g. CORS), we will
|
|
2580
|
+
* NOT use this middleware for API categories.
|
|
2581
|
+
*/
|
|
2582
|
+
const amzSdkRequestHeaderMiddlewareFactory = ({ maxAttempts = _constants_mjs__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_RETRY_ATTEMPTS }) => (next, context) => {
|
|
2583
|
+
return async function amzSdkRequestHeaderMiddleware(request) {
|
|
2584
|
+
const attemptsCount = context.attemptsCount ?? 0;
|
|
2585
|
+
request.headers[_constants_mjs__WEBPACK_IMPORTED_MODULE_0__.AMZ_SDK_REQUEST_HEADER] =
|
|
2586
|
+
`attempt=${attemptsCount + 1}; max=${maxAttempts}`;
|
|
2587
|
+
return next(request);
|
|
2588
|
+
};
|
|
2589
|
+
};
|
|
2590
|
+
|
|
2591
|
+
|
|
2592
|
+
//# sourceMappingURL=amzSdkRequestHeaderMiddleware.mjs.map
|
|
2593
|
+
|
|
2594
|
+
|
|
2595
|
+
/***/ }),
|
|
2596
|
+
|
|
2597
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/constants.mjs":
|
|
2598
|
+
/*!****************************************************************************************!*\
|
|
2599
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/constants.mjs ***!
|
|
2600
|
+
\****************************************************************************************/
|
|
2601
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2602
|
+
|
|
2603
|
+
"use strict";
|
|
2604
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2605
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2606
|
+
/* harmony export */ AMZ_SDK_INVOCATION_ID_HEADER: () => (/* binding */ AMZ_SDK_INVOCATION_ID_HEADER),
|
|
2607
|
+
/* harmony export */ AMZ_SDK_REQUEST_HEADER: () => (/* binding */ AMZ_SDK_REQUEST_HEADER),
|
|
2608
|
+
/* harmony export */ DEFAULT_MAX_DELAY_MS: () => (/* binding */ DEFAULT_MAX_DELAY_MS),
|
|
2609
|
+
/* harmony export */ DEFAULT_RETRY_ATTEMPTS: () => (/* binding */ DEFAULT_RETRY_ATTEMPTS)
|
|
2610
|
+
/* harmony export */ });
|
|
2611
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2612
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2613
|
+
const DEFAULT_RETRY_ATTEMPTS = 3;
|
|
2614
|
+
const AMZ_SDK_INVOCATION_ID_HEADER = 'amz-sdk-invocation-id';
|
|
2615
|
+
const AMZ_SDK_REQUEST_HEADER = 'amz-sdk-request';
|
|
2616
|
+
const DEFAULT_MAX_DELAY_MS = 5 * 60 * 1000;
|
|
2617
|
+
|
|
2618
|
+
|
|
2619
|
+
//# sourceMappingURL=constants.mjs.map
|
|
2620
|
+
|
|
2621
|
+
|
|
2622
|
+
/***/ }),
|
|
2623
|
+
|
|
2624
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/defaultRetryDecider.mjs":
|
|
2625
|
+
/*!**************************************************************************************************!*\
|
|
2626
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/defaultRetryDecider.mjs ***!
|
|
2627
|
+
\**************************************************************************************************/
|
|
2628
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2629
|
+
|
|
2630
|
+
"use strict";
|
|
2631
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2632
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2633
|
+
/* harmony export */ getRetryDecider: () => (/* binding */ getRetryDecider)
|
|
2634
|
+
/* harmony export */ });
|
|
2635
|
+
/* harmony import */ var _types_errors_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../types/errors.mjs */ "./node_modules/@aws-amplify/core/dist/esm/types/errors.mjs");
|
|
2636
|
+
/* harmony import */ var _isClockSkewError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isClockSkewError.mjs */ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/isClockSkewError.mjs");
|
|
2637
|
+
|
|
2638
|
+
|
|
2639
|
+
|
|
2640
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2641
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2642
|
+
/**
|
|
2643
|
+
* Get retry decider function
|
|
2644
|
+
* @param errorParser Function to load JavaScript error from HTTP response
|
|
2645
|
+
*/
|
|
2646
|
+
const getRetryDecider = (errorParser) => async (response, error) => {
|
|
2647
|
+
const parsedError = error ??
|
|
2648
|
+
(await errorParser(response)) ??
|
|
2649
|
+
undefined;
|
|
2650
|
+
const errorCode = parsedError?.code || parsedError?.name;
|
|
2651
|
+
const statusCode = response?.statusCode;
|
|
2652
|
+
const isRetryable = isConnectionError(error) ||
|
|
2653
|
+
isThrottlingError(statusCode, errorCode) ||
|
|
2654
|
+
(0,_isClockSkewError_mjs__WEBPACK_IMPORTED_MODULE_0__.isClockSkewError)(errorCode) ||
|
|
2655
|
+
isServerSideError(statusCode, errorCode);
|
|
2656
|
+
return {
|
|
2657
|
+
retryable: isRetryable,
|
|
2658
|
+
};
|
|
2659
|
+
};
|
|
2660
|
+
// reference: https://github.com/aws/aws-sdk-js-v3/blob/ab0e7be36e7e7f8a0c04834357aaad643c7912c3/packages/service-error-classification/src/constants.ts#L22-L37
|
|
2661
|
+
const THROTTLING_ERROR_CODES = [
|
|
2662
|
+
'BandwidthLimitExceeded',
|
|
2663
|
+
'EC2ThrottledException',
|
|
2664
|
+
'LimitExceededException',
|
|
2665
|
+
'PriorRequestNotComplete',
|
|
2666
|
+
'ProvisionedThroughputExceededException',
|
|
2667
|
+
'RequestLimitExceeded',
|
|
2668
|
+
'RequestThrottled',
|
|
2669
|
+
'RequestThrottledException',
|
|
2670
|
+
'SlowDown',
|
|
2671
|
+
'ThrottledException',
|
|
2672
|
+
'Throttling',
|
|
2673
|
+
'ThrottlingException',
|
|
2674
|
+
'TooManyRequestsException',
|
|
2675
|
+
];
|
|
2676
|
+
const TIMEOUT_ERROR_CODES = [
|
|
2677
|
+
'TimeoutError',
|
|
2678
|
+
'RequestTimeout',
|
|
2679
|
+
'RequestTimeoutException',
|
|
2680
|
+
];
|
|
2681
|
+
const isThrottlingError = (statusCode, errorCode) => statusCode === 429 ||
|
|
2682
|
+
(!!errorCode && THROTTLING_ERROR_CODES.includes(errorCode));
|
|
2683
|
+
const isConnectionError = (error) => [
|
|
2684
|
+
_types_errors_mjs__WEBPACK_IMPORTED_MODULE_1__.AmplifyErrorCode.NetworkError,
|
|
2685
|
+
// TODO(vNext): unify the error code `ERR_NETWORK` used by the Storage XHR handler
|
|
2686
|
+
'ERR_NETWORK',
|
|
2687
|
+
].includes(error?.name);
|
|
2688
|
+
const isServerSideError = (statusCode, errorCode) => (!!statusCode && [500, 502, 503, 504].includes(statusCode)) ||
|
|
2689
|
+
(!!errorCode && TIMEOUT_ERROR_CODES.includes(errorCode));
|
|
2690
|
+
|
|
2691
|
+
|
|
2692
|
+
//# sourceMappingURL=defaultRetryDecider.mjs.map
|
|
2693
|
+
|
|
2694
|
+
|
|
2695
|
+
/***/ }),
|
|
2696
|
+
|
|
2697
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/isClockSkewError.mjs":
|
|
2698
|
+
/*!***********************************************************************************************!*\
|
|
2699
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/isClockSkewError.mjs ***!
|
|
2700
|
+
\***********************************************************************************************/
|
|
2701
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2702
|
+
|
|
2703
|
+
"use strict";
|
|
2704
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2705
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2706
|
+
/* harmony export */ isClockSkewError: () => (/* binding */ isClockSkewError)
|
|
2707
|
+
/* harmony export */ });
|
|
2708
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2709
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2710
|
+
// via https://github.com/aws/aws-sdk-js-v3/blob/ab0e7be36e7e7f8a0c04834357aaad643c7912c3/packages/service-error-classification/src/constants.ts#L8
|
|
2711
|
+
const CLOCK_SKEW_ERROR_CODES = [
|
|
2712
|
+
'AuthFailure',
|
|
2713
|
+
'InvalidSignatureException',
|
|
2714
|
+
'RequestExpired',
|
|
2715
|
+
'RequestInTheFuture',
|
|
2716
|
+
'RequestTimeTooSkewed',
|
|
2717
|
+
'SignatureDoesNotMatch',
|
|
2718
|
+
'BadRequestException', // API Gateway
|
|
2719
|
+
];
|
|
2720
|
+
/**
|
|
2721
|
+
* Given an error code, returns true if it is related to a clock skew error.
|
|
2722
|
+
*
|
|
2723
|
+
* @param errorCode String representation of some error.
|
|
2724
|
+
* @returns True if given error is present in `CLOCK_SKEW_ERROR_CODES`, false otherwise.
|
|
2725
|
+
*
|
|
2726
|
+
* @internal
|
|
2727
|
+
*/
|
|
2728
|
+
const isClockSkewError = (errorCode) => !!errorCode && CLOCK_SKEW_ERROR_CODES.includes(errorCode);
|
|
2729
|
+
|
|
2730
|
+
|
|
2731
|
+
//# sourceMappingURL=isClockSkewError.mjs.map
|
|
2732
|
+
|
|
2733
|
+
|
|
2734
|
+
/***/ }),
|
|
2735
|
+
|
|
2736
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/jitteredBackoff.mjs":
|
|
2737
|
+
/*!**********************************************************************************************!*\
|
|
2738
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/jitteredBackoff.mjs ***!
|
|
2739
|
+
\**********************************************************************************************/
|
|
2740
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2741
|
+
|
|
2742
|
+
"use strict";
|
|
2743
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2744
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2745
|
+
/* harmony export */ jitteredBackoff: () => (/* binding */ jitteredBackoff)
|
|
2746
|
+
/* harmony export */ });
|
|
2747
|
+
/* harmony import */ var _utils_retry_jitteredBackoff_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../utils/retry/jitteredBackoff.mjs */ "./node_modules/@aws-amplify/core/dist/esm/utils/retry/jitteredBackoff.mjs");
|
|
2748
|
+
/* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants.mjs */ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/constants.mjs");
|
|
2749
|
+
|
|
2750
|
+
|
|
2751
|
+
|
|
2752
|
+
|
|
2753
|
+
|
|
2754
|
+
|
|
2755
|
+
|
|
2756
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2757
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2758
|
+
// TODO: [v6] The separate retry utility is used by Data packages now and will replaced by retry middleware.
|
|
2759
|
+
const jitteredBackoff = attempt => {
|
|
2760
|
+
const delayFunction = (0,_utils_retry_jitteredBackoff_mjs__WEBPACK_IMPORTED_MODULE_0__.jitteredBackoff)(_constants_mjs__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_MAX_DELAY_MS);
|
|
2761
|
+
const delay = delayFunction(attempt);
|
|
2762
|
+
// The delayFunction returns false when the delay is greater than the max delay(5 mins).
|
|
2763
|
+
// In this case, the retry middleware will delay 5 mins instead, as a ceiling of the delay.
|
|
2764
|
+
return delay === false ? _constants_mjs__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_MAX_DELAY_MS : delay;
|
|
2765
|
+
};
|
|
2766
|
+
|
|
2767
|
+
|
|
2768
|
+
//# sourceMappingURL=jitteredBackoff.mjs.map
|
|
2769
|
+
|
|
2770
|
+
|
|
2771
|
+
/***/ }),
|
|
2772
|
+
|
|
2773
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/retryMiddleware.mjs":
|
|
2774
|
+
/*!**********************************************************************************************!*\
|
|
2775
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/retryMiddleware.mjs ***!
|
|
2776
|
+
\**********************************************************************************************/
|
|
2777
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2778
|
+
|
|
2779
|
+
"use strict";
|
|
2780
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2781
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2782
|
+
/* harmony export */ retryMiddlewareFactory: () => (/* binding */ retryMiddlewareFactory)
|
|
2783
|
+
/* harmony export */ });
|
|
2784
|
+
/* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.mjs */ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/retry/constants.mjs");
|
|
2785
|
+
|
|
2786
|
+
|
|
2787
|
+
/**
|
|
2788
|
+
* Middleware that executes the retry logic.
|
|
2789
|
+
*/
|
|
2790
|
+
const retryMiddlewareFactory = ({ maxAttempts = _constants_mjs__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_RETRY_ATTEMPTS, retryDecider, computeDelay, abortSignal, }) => {
|
|
2791
|
+
if (maxAttempts < 1) {
|
|
2792
|
+
throw new Error('maxAttempts must be greater than 0');
|
|
2793
|
+
}
|
|
2794
|
+
return (next, context) => async function retryMiddleware(request) {
|
|
2795
|
+
let error;
|
|
2796
|
+
let attemptsCount = context.attemptsCount ?? 0;
|
|
2797
|
+
let response;
|
|
2798
|
+
// When retry is not needed or max attempts is reached, either error or response will be set. This function handles either cases.
|
|
2799
|
+
const handleTerminalErrorOrResponse = () => {
|
|
2800
|
+
if (response) {
|
|
2801
|
+
addOrIncrementMetadataAttempts(response, attemptsCount);
|
|
2802
|
+
return response;
|
|
2803
|
+
}
|
|
2804
|
+
else {
|
|
2805
|
+
addOrIncrementMetadataAttempts(error, attemptsCount);
|
|
2806
|
+
throw error;
|
|
2807
|
+
}
|
|
2808
|
+
};
|
|
2809
|
+
while (!abortSignal?.aborted && attemptsCount < maxAttempts) {
|
|
2810
|
+
try {
|
|
2811
|
+
response = await next(request);
|
|
2812
|
+
error = undefined;
|
|
2813
|
+
}
|
|
2814
|
+
catch (e) {
|
|
2815
|
+
error = e;
|
|
2816
|
+
response = undefined;
|
|
2817
|
+
}
|
|
2818
|
+
// context.attemptsCount may be updated after calling next handler which may retry the request by itself.
|
|
2819
|
+
attemptsCount =
|
|
2820
|
+
(context.attemptsCount ?? 0) > attemptsCount
|
|
2821
|
+
? (context.attemptsCount ?? 0)
|
|
2822
|
+
: attemptsCount + 1;
|
|
2823
|
+
context.attemptsCount = attemptsCount;
|
|
2824
|
+
const { isCredentialsExpiredError, retryable } = await retryDecider(response, error, context);
|
|
2825
|
+
if (retryable) {
|
|
2826
|
+
// Setting isCredentialsInvalid flag to notify signing middleware to forceRefresh credentials provider.
|
|
2827
|
+
context.isCredentialsExpired = !!isCredentialsExpiredError;
|
|
2828
|
+
if (!abortSignal?.aborted && attemptsCount < maxAttempts) {
|
|
2829
|
+
// prevent sleep for last attempt or cancelled request;
|
|
2830
|
+
const delay = computeDelay(attemptsCount);
|
|
2831
|
+
await cancellableSleep(delay, abortSignal);
|
|
2832
|
+
}
|
|
2833
|
+
continue;
|
|
2834
|
+
}
|
|
2835
|
+
else {
|
|
2836
|
+
return handleTerminalErrorOrResponse();
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2839
|
+
if (abortSignal?.aborted) {
|
|
2840
|
+
throw new Error('Request aborted.');
|
|
2841
|
+
}
|
|
2842
|
+
else {
|
|
2843
|
+
return handleTerminalErrorOrResponse();
|
|
2844
|
+
}
|
|
2845
|
+
};
|
|
2846
|
+
};
|
|
2847
|
+
const cancellableSleep = (timeoutMs, abortSignal) => {
|
|
2848
|
+
if (abortSignal?.aborted) {
|
|
2849
|
+
return Promise.resolve();
|
|
2850
|
+
}
|
|
2851
|
+
let timeoutId;
|
|
2852
|
+
let sleepPromiseResolveFn;
|
|
2853
|
+
const sleepPromise = new Promise(resolve => {
|
|
2854
|
+
sleepPromiseResolveFn = resolve;
|
|
2855
|
+
timeoutId = setTimeout(resolve, timeoutMs);
|
|
2856
|
+
});
|
|
2857
|
+
abortSignal?.addEventListener('abort', function cancelSleep(_) {
|
|
2858
|
+
clearTimeout(timeoutId);
|
|
2859
|
+
abortSignal?.removeEventListener('abort', cancelSleep);
|
|
2860
|
+
sleepPromiseResolveFn();
|
|
2861
|
+
});
|
|
2862
|
+
return sleepPromise;
|
|
2863
|
+
};
|
|
2864
|
+
const addOrIncrementMetadataAttempts = (nextHandlerOutput, attempts) => {
|
|
2865
|
+
if (Object.prototype.toString.call(nextHandlerOutput) !== '[object Object]') {
|
|
2866
|
+
return;
|
|
2867
|
+
}
|
|
2868
|
+
nextHandlerOutput.$metadata = {
|
|
2869
|
+
...(nextHandlerOutput.$metadata ?? {}),
|
|
2870
|
+
attempts,
|
|
2871
|
+
};
|
|
2872
|
+
};
|
|
2873
|
+
|
|
2874
|
+
|
|
2875
|
+
//# sourceMappingURL=retryMiddleware.mjs.map
|
|
2876
|
+
|
|
2877
|
+
|
|
2878
|
+
/***/ }),
|
|
2879
|
+
|
|
2880
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/clients/middleware/userAgent/middleware.mjs":
|
|
2881
|
+
/*!*********************************************************************************************!*\
|
|
2882
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/clients/middleware/userAgent/middleware.mjs ***!
|
|
2883
|
+
\*********************************************************************************************/
|
|
2884
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2885
|
+
|
|
2886
|
+
"use strict";
|
|
2887
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2888
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2889
|
+
/* harmony export */ userAgentMiddlewareFactory: () => (/* binding */ userAgentMiddlewareFactory)
|
|
2890
|
+
/* harmony export */ });
|
|
2891
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2892
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2893
|
+
/**
|
|
2894
|
+
* Middleware injects user agent string to specified header(default to 'x-amz-user-agent'),
|
|
2895
|
+
* if the header is not set already.
|
|
2896
|
+
*
|
|
2897
|
+
* TODO: incorporate new user agent design
|
|
2898
|
+
*/
|
|
2899
|
+
const userAgentMiddlewareFactory = ({ userAgentHeader = 'x-amz-user-agent', userAgentValue = '', }) => next => {
|
|
2900
|
+
return async function userAgentMiddleware(request) {
|
|
2901
|
+
if (userAgentValue.trim().length === 0) {
|
|
2902
|
+
const result = await next(request);
|
|
2903
|
+
return result;
|
|
2904
|
+
}
|
|
2905
|
+
else {
|
|
2906
|
+
const headerName = userAgentHeader.toLowerCase();
|
|
2907
|
+
request.headers[headerName] = request.headers[headerName]
|
|
2908
|
+
? `${request.headers[headerName]} ${userAgentValue}`
|
|
2909
|
+
: userAgentValue;
|
|
2910
|
+
const response = await next(request);
|
|
2911
|
+
return response;
|
|
2912
|
+
}
|
|
2913
|
+
};
|
|
2914
|
+
};
|
|
2915
|
+
|
|
2916
|
+
|
|
2917
|
+
//# sourceMappingURL=middleware.mjs.map
|
|
2918
|
+
|
|
2919
|
+
|
|
2920
|
+
/***/ }),
|
|
2921
|
+
|
|
2922
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/clients/serde/json.mjs":
|
|
2923
|
+
/*!************************************************************************!*\
|
|
2924
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/clients/serde/json.mjs ***!
|
|
2925
|
+
\************************************************************************/
|
|
2926
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2927
|
+
|
|
2928
|
+
"use strict";
|
|
2929
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2930
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2931
|
+
/* harmony export */ parseJsonBody: () => (/* binding */ parseJsonBody),
|
|
2932
|
+
/* harmony export */ parseJsonError: () => (/* binding */ parseJsonError)
|
|
2933
|
+
/* harmony export */ });
|
|
2934
|
+
/* harmony import */ var _responseInfo_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./responseInfo.mjs */ "./node_modules/@aws-amplify/core/dist/esm/clients/serde/responseInfo.mjs");
|
|
2935
|
+
|
|
2936
|
+
|
|
2937
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2938
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2939
|
+
/**
|
|
2940
|
+
* Utility functions for serializing and deserializing of JSON protocol in general(including: REST-JSON, JSON-RPC, etc.)
|
|
2941
|
+
*/
|
|
2942
|
+
/**
|
|
2943
|
+
* Error parser for AWS JSON protocol.
|
|
2944
|
+
*/
|
|
2945
|
+
const parseJsonError = async (response) => {
|
|
2946
|
+
if (!response || response.statusCode < 300) {
|
|
2947
|
+
return;
|
|
2948
|
+
}
|
|
2949
|
+
const body = await parseJsonBody(response);
|
|
2950
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
2951
|
+
const [cleanValue] = rawValue.toString().split(/[,:]+/);
|
|
2952
|
+
if (cleanValue.includes('#')) {
|
|
2953
|
+
return cleanValue.split('#')[1];
|
|
2954
|
+
}
|
|
2955
|
+
return cleanValue;
|
|
2956
|
+
};
|
|
2957
|
+
const code = sanitizeErrorCode(response.headers['x-amzn-errortype'] ??
|
|
2958
|
+
body.code ??
|
|
2959
|
+
body.__type ??
|
|
2960
|
+
'UnknownError');
|
|
2961
|
+
const message = body.message ?? body.Message ?? 'Unknown error';
|
|
2962
|
+
const error = new Error(message);
|
|
2963
|
+
return Object.assign(error, {
|
|
2964
|
+
name: code,
|
|
2965
|
+
$metadata: (0,_responseInfo_mjs__WEBPACK_IMPORTED_MODULE_0__.parseMetadata)(response),
|
|
2966
|
+
});
|
|
2967
|
+
};
|
|
2968
|
+
/**
|
|
2969
|
+
* Parse JSON response body to JavaScript object.
|
|
2970
|
+
*/
|
|
2971
|
+
const parseJsonBody = async (response) => {
|
|
2972
|
+
if (!response.body) {
|
|
2973
|
+
throw new Error('Missing response payload');
|
|
2974
|
+
}
|
|
2975
|
+
const output = await response.body.json();
|
|
2976
|
+
return Object.assign(output, {
|
|
2977
|
+
$metadata: (0,_responseInfo_mjs__WEBPACK_IMPORTED_MODULE_0__.parseMetadata)(response),
|
|
2978
|
+
});
|
|
2979
|
+
};
|
|
2980
|
+
|
|
2981
|
+
|
|
2982
|
+
//# sourceMappingURL=json.mjs.map
|
|
2983
|
+
|
|
2984
|
+
|
|
2985
|
+
/***/ }),
|
|
2986
|
+
|
|
2987
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/clients/serde/responseInfo.mjs":
|
|
2988
|
+
/*!********************************************************************************!*\
|
|
2989
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/clients/serde/responseInfo.mjs ***!
|
|
2990
|
+
\********************************************************************************/
|
|
2991
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2992
|
+
|
|
2993
|
+
"use strict";
|
|
2994
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2995
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2996
|
+
/* harmony export */ parseMetadata: () => (/* binding */ parseMetadata)
|
|
2997
|
+
/* harmony export */ });
|
|
2998
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2999
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3000
|
+
const parseMetadata = (response) => {
|
|
3001
|
+
const { headers, statusCode } = response;
|
|
3002
|
+
return {
|
|
3003
|
+
...(isMetadataBearer(response) ? response.$metadata : {}),
|
|
3004
|
+
httpStatusCode: statusCode,
|
|
3005
|
+
requestId: headers['x-amzn-requestid'] ??
|
|
3006
|
+
headers['x-amzn-request-id'] ??
|
|
3007
|
+
headers['x-amz-request-id'],
|
|
3008
|
+
extendedRequestId: headers['x-amz-id-2'],
|
|
3009
|
+
cfId: headers['x-amz-cf-id'],
|
|
3010
|
+
};
|
|
3011
|
+
};
|
|
3012
|
+
const isMetadataBearer = (response) => typeof response?.$metadata === 'object';
|
|
3013
|
+
|
|
3014
|
+
|
|
3015
|
+
//# sourceMappingURL=responseInfo.mjs.map
|
|
3016
|
+
|
|
3017
|
+
|
|
3018
|
+
/***/ }),
|
|
3019
|
+
|
|
3020
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/clients/utils/memoization.mjs":
|
|
3021
|
+
/*!*******************************************************************************!*\
|
|
3022
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/clients/utils/memoization.mjs ***!
|
|
3023
|
+
\*******************************************************************************/
|
|
3024
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3025
|
+
|
|
3026
|
+
"use strict";
|
|
3027
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3028
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3029
|
+
/* harmony export */ withMemoization: () => (/* binding */ withMemoization)
|
|
3030
|
+
/* harmony export */ });
|
|
3031
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3032
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3033
|
+
/**
|
|
3034
|
+
* Cache the payload of a response body. It allows multiple calls to the body,
|
|
3035
|
+
* for example, when reading the body in both retry decider and error deserializer.
|
|
3036
|
+
* Caching body is allowed here because we call the body accessor(blob(), json(),
|
|
3037
|
+
* etc.) when body is small or streaming implementation is not available(RN).
|
|
3038
|
+
*
|
|
3039
|
+
* @internal
|
|
3040
|
+
*/
|
|
3041
|
+
const withMemoization = (payloadAccessor) => {
|
|
3042
|
+
let cached;
|
|
3043
|
+
return () => {
|
|
3044
|
+
if (!cached) {
|
|
3045
|
+
// Explicitly not awaiting. Intermediate await would add overhead and
|
|
3046
|
+
// introduce a possible race in the event that this wrapper is called
|
|
3047
|
+
// again before the first `payloadAccessor` call resolves.
|
|
3048
|
+
cached = payloadAccessor();
|
|
3049
|
+
}
|
|
3050
|
+
return cached;
|
|
3051
|
+
};
|
|
3052
|
+
};
|
|
3053
|
+
|
|
3054
|
+
|
|
3055
|
+
//# sourceMappingURL=memoization.mjs.map
|
|
3056
|
+
|
|
3057
|
+
|
|
3058
|
+
/***/ }),
|
|
3059
|
+
|
|
3060
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/errors/PlatformNotSupportedError.mjs":
|
|
3061
|
+
/*!**************************************************************************************!*\
|
|
3062
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/errors/PlatformNotSupportedError.mjs ***!
|
|
3063
|
+
\**************************************************************************************/
|
|
3064
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3065
|
+
|
|
3066
|
+
"use strict";
|
|
3067
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3068
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3069
|
+
/* harmony export */ PlatformNotSupportedError: () => (/* binding */ PlatformNotSupportedError)
|
|
3070
|
+
/* harmony export */ });
|
|
3071
|
+
/* harmony import */ var _types_errors_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../types/errors.mjs */ "./node_modules/@aws-amplify/core/dist/esm/types/errors.mjs");
|
|
3072
|
+
/* harmony import */ var _AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AmplifyError.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/AmplifyError.mjs");
|
|
3073
|
+
|
|
3074
|
+
|
|
3075
|
+
|
|
3076
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3077
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3078
|
+
class PlatformNotSupportedError extends _AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__.AmplifyError {
|
|
3079
|
+
constructor() {
|
|
3080
|
+
super({
|
|
3081
|
+
name: _types_errors_mjs__WEBPACK_IMPORTED_MODULE_1__.AmplifyErrorCode.PlatformNotSupported,
|
|
3082
|
+
message: 'Function not supported on current platform',
|
|
3083
|
+
});
|
|
3084
|
+
}
|
|
3085
|
+
}
|
|
3086
|
+
|
|
3087
|
+
|
|
3088
|
+
//# sourceMappingURL=PlatformNotSupportedError.mjs.map
|
|
3089
|
+
|
|
3090
|
+
|
|
3091
|
+
/***/ }),
|
|
3092
|
+
|
|
3093
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/errors/createAssertionFunction.mjs":
|
|
3094
|
+
/*!************************************************************************************!*\
|
|
3095
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/errors/createAssertionFunction.mjs ***!
|
|
3096
|
+
\************************************************************************************/
|
|
3097
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3098
|
+
|
|
3099
|
+
"use strict";
|
|
3100
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3101
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3102
|
+
/* harmony export */ createAssertionFunction: () => (/* binding */ createAssertionFunction)
|
|
3103
|
+
/* harmony export */ });
|
|
3104
|
+
/* harmony import */ var _AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AmplifyError.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/AmplifyError.mjs");
|
|
3105
|
+
|
|
3106
|
+
|
|
3107
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3108
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3109
|
+
const createAssertionFunction = (errorMap, AssertionError = _AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__.AmplifyError) => (assertion, name, additionalContext) => {
|
|
3110
|
+
const { message, recoverySuggestion } = errorMap[name];
|
|
3111
|
+
if (!assertion) {
|
|
3112
|
+
throw new AssertionError({
|
|
3113
|
+
name,
|
|
3114
|
+
message: additionalContext
|
|
3115
|
+
? `${message} ${additionalContext}`
|
|
3116
|
+
: message,
|
|
3117
|
+
recoverySuggestion,
|
|
3118
|
+
});
|
|
3119
|
+
}
|
|
3120
|
+
};
|
|
3121
|
+
|
|
3122
|
+
|
|
3123
|
+
//# sourceMappingURL=createAssertionFunction.mjs.map
|
|
3124
|
+
|
|
3125
|
+
|
|
3126
|
+
/***/ }),
|
|
3127
|
+
|
|
3128
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/errorHelpers.mjs":
|
|
3129
|
+
/*!***************************************************************************************!*\
|
|
3130
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/errorHelpers.mjs ***!
|
|
3131
|
+
\***************************************************************************************/
|
|
3132
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3133
|
+
|
|
3134
|
+
"use strict";
|
|
3135
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3136
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3137
|
+
/* harmony export */ AuthConfigurationErrorCode: () => (/* binding */ AuthConfigurationErrorCode),
|
|
3138
|
+
/* harmony export */ assert: () => (/* binding */ assert)
|
|
3139
|
+
/* harmony export */ });
|
|
3140
|
+
/* harmony import */ var _errors_createAssertionFunction_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../errors/createAssertionFunction.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/createAssertionFunction.mjs");
|
|
3141
|
+
|
|
3142
|
+
|
|
3143
|
+
|
|
3144
|
+
|
|
3145
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3146
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3147
|
+
var AuthConfigurationErrorCode;
|
|
3148
|
+
(function (AuthConfigurationErrorCode) {
|
|
3149
|
+
AuthConfigurationErrorCode["AuthTokenConfigException"] = "AuthTokenConfigException";
|
|
3150
|
+
AuthConfigurationErrorCode["AuthUserPoolAndIdentityPoolException"] = "AuthUserPoolAndIdentityPoolException";
|
|
3151
|
+
AuthConfigurationErrorCode["AuthUserPoolException"] = "AuthUserPoolException";
|
|
3152
|
+
AuthConfigurationErrorCode["InvalidIdentityPoolIdException"] = "InvalidIdentityPoolIdException";
|
|
3153
|
+
AuthConfigurationErrorCode["OAuthNotConfigureException"] = "OAuthNotConfigureException";
|
|
3154
|
+
})(AuthConfigurationErrorCode || (AuthConfigurationErrorCode = {}));
|
|
3155
|
+
const authConfigurationErrorMap = {
|
|
3156
|
+
[AuthConfigurationErrorCode.AuthTokenConfigException]: {
|
|
3157
|
+
message: 'Auth Token Provider not configured.',
|
|
3158
|
+
recoverySuggestion: 'Make sure to call Amplify.configure in your app.',
|
|
3159
|
+
},
|
|
3160
|
+
[AuthConfigurationErrorCode.AuthUserPoolAndIdentityPoolException]: {
|
|
3161
|
+
message: 'Auth UserPool or IdentityPool not configured.',
|
|
3162
|
+
recoverySuggestion: 'Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId.',
|
|
3163
|
+
},
|
|
3164
|
+
[AuthConfigurationErrorCode.AuthUserPoolException]: {
|
|
3165
|
+
message: 'Auth UserPool not configured.',
|
|
3166
|
+
recoverySuggestion: 'Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId.',
|
|
3167
|
+
},
|
|
3168
|
+
[AuthConfigurationErrorCode.InvalidIdentityPoolIdException]: {
|
|
3169
|
+
message: 'Invalid identity pool id provided.',
|
|
3170
|
+
recoverySuggestion: 'Make sure a valid identityPoolId is given in the config.',
|
|
3171
|
+
},
|
|
3172
|
+
[AuthConfigurationErrorCode.OAuthNotConfigureException]: {
|
|
3173
|
+
message: 'oauth param not configured.',
|
|
3174
|
+
recoverySuggestion: 'Make sure to call Amplify.configure with oauth parameter in your app.',
|
|
3175
|
+
},
|
|
3176
|
+
};
|
|
3177
|
+
const assert = (0,_errors_createAssertionFunction_mjs__WEBPACK_IMPORTED_MODULE_0__.createAssertionFunction)(authConfigurationErrorMap);
|
|
3178
|
+
|
|
3179
|
+
|
|
3180
|
+
//# sourceMappingURL=errorHelpers.mjs.map
|
|
3181
|
+
|
|
3182
|
+
|
|
3183
|
+
/***/ }),
|
|
3184
|
+
|
|
3185
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/index.mjs":
|
|
3186
|
+
/*!********************************************************************************!*\
|
|
3187
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/index.mjs ***!
|
|
3188
|
+
\********************************************************************************/
|
|
3189
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3190
|
+
|
|
3191
|
+
"use strict";
|
|
3192
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3193
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3194
|
+
/* harmony export */ assertIdentityPoolIdConfig: () => (/* binding */ assertIdentityPoolIdConfig),
|
|
3195
|
+
/* harmony export */ assertOAuthConfig: () => (/* binding */ assertOAuthConfig),
|
|
3196
|
+
/* harmony export */ assertTokenProviderConfig: () => (/* binding */ assertTokenProviderConfig),
|
|
3197
|
+
/* harmony export */ decodeJWT: () => (/* binding */ decodeJWT)
|
|
3198
|
+
/* harmony export */ });
|
|
3199
|
+
/* harmony import */ var _utils_convert_base64_base64Decoder_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../utils/convert/base64/base64Decoder.mjs */ "./node_modules/@aws-amplify/core/dist/esm/utils/convert/base64/base64Decoder.mjs");
|
|
3200
|
+
/* harmony import */ var _errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errorHelpers.mjs */ "./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/utils/errorHelpers.mjs");
|
|
3201
|
+
|
|
3202
|
+
|
|
3203
|
+
|
|
3204
|
+
|
|
3205
|
+
|
|
3206
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3207
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3208
|
+
function assertTokenProviderConfig(cognitoConfig) {
|
|
3209
|
+
let assertionValid = true; // assume valid until otherwise proveed
|
|
3210
|
+
if (!cognitoConfig) {
|
|
3211
|
+
assertionValid = false;
|
|
3212
|
+
}
|
|
3213
|
+
else {
|
|
3214
|
+
assertionValid =
|
|
3215
|
+
!!cognitoConfig.userPoolId && !!cognitoConfig.userPoolClientId;
|
|
3216
|
+
}
|
|
3217
|
+
(0,_errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.assert)(assertionValid, _errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthConfigurationErrorCode.AuthUserPoolException);
|
|
3218
|
+
}
|
|
3219
|
+
function assertOAuthConfig(cognitoConfig) {
|
|
3220
|
+
const validOAuthConfig = !!cognitoConfig?.loginWith?.oauth?.domain &&
|
|
3221
|
+
!!cognitoConfig?.loginWith?.oauth?.redirectSignOut &&
|
|
3222
|
+
!!cognitoConfig?.loginWith?.oauth?.redirectSignIn &&
|
|
3223
|
+
!!cognitoConfig?.loginWith?.oauth?.responseType;
|
|
3224
|
+
(0,_errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.assert)(validOAuthConfig, _errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthConfigurationErrorCode.OAuthNotConfigureException);
|
|
3225
|
+
}
|
|
3226
|
+
function assertIdentityPoolIdConfig(cognitoConfig) {
|
|
3227
|
+
const validConfig = !!cognitoConfig?.identityPoolId;
|
|
3228
|
+
(0,_errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.assert)(validConfig, _errorHelpers_mjs__WEBPACK_IMPORTED_MODULE_0__.AuthConfigurationErrorCode.InvalidIdentityPoolIdException);
|
|
3229
|
+
}
|
|
3230
|
+
/**
|
|
3231
|
+
* Decodes payload of JWT token
|
|
3232
|
+
*
|
|
3233
|
+
* @param {String} token A string representing a token to be decoded
|
|
3234
|
+
* @throws {@link Error} - Throws error when token is invalid or payload malformed.
|
|
3235
|
+
*/
|
|
3236
|
+
function decodeJWT(token) {
|
|
3237
|
+
const tokenParts = token.split('.');
|
|
3238
|
+
if (tokenParts.length !== 3) {
|
|
3239
|
+
throw new Error('Invalid token');
|
|
3240
|
+
}
|
|
3241
|
+
try {
|
|
3242
|
+
const base64WithUrlSafe = tokenParts[1];
|
|
3243
|
+
const base64 = base64WithUrlSafe.replace(/-/g, '+').replace(/_/g, '/');
|
|
3244
|
+
const jsonStr = decodeURIComponent(_utils_convert_base64_base64Decoder_mjs__WEBPACK_IMPORTED_MODULE_1__.base64Decoder
|
|
3245
|
+
.convert(base64)
|
|
3246
|
+
.split('')
|
|
3247
|
+
.map(char => `%${`00${char.charCodeAt(0).toString(16)}`.slice(-2)}`)
|
|
3248
|
+
.join(''));
|
|
3249
|
+
const payload = JSON.parse(jsonStr);
|
|
3250
|
+
return {
|
|
3251
|
+
toString: () => token,
|
|
3252
|
+
payload,
|
|
3253
|
+
};
|
|
3254
|
+
}
|
|
3255
|
+
catch (err) {
|
|
3256
|
+
throw new Error('Invalid token payload');
|
|
3257
|
+
}
|
|
3258
|
+
}
|
|
3259
|
+
|
|
3260
|
+
|
|
3261
|
+
//# sourceMappingURL=index.mjs.map
|
|
3262
|
+
|
|
3263
|
+
|
|
3264
|
+
/***/ }),
|
|
3265
|
+
|
|
3266
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/storage/CookieStorage.mjs":
|
|
3267
|
+
/*!***************************************************************************!*\
|
|
3268
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/storage/CookieStorage.mjs ***!
|
|
3269
|
+
\***************************************************************************/
|
|
3270
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3271
|
+
|
|
3272
|
+
"use strict";
|
|
3273
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3274
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3275
|
+
/* harmony export */ CookieStorage: () => (/* binding */ CookieStorage)
|
|
3276
|
+
/* harmony export */ });
|
|
3277
|
+
/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! js-cookie */ "./node_modules/js-cookie/dist/js.cookie.mjs");
|
|
3278
|
+
|
|
3279
|
+
|
|
3280
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3281
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3282
|
+
class CookieStorage {
|
|
3283
|
+
constructor(data = {}) {
|
|
3284
|
+
const { path, domain, expires, sameSite, secure } = data;
|
|
3285
|
+
this.domain = domain;
|
|
3286
|
+
this.path = path || '/';
|
|
3287
|
+
this.expires = Object.prototype.hasOwnProperty.call(data, 'expires')
|
|
3288
|
+
? expires
|
|
3289
|
+
: 365;
|
|
3290
|
+
this.secure = Object.prototype.hasOwnProperty.call(data, 'secure')
|
|
3291
|
+
? secure
|
|
3292
|
+
: true;
|
|
3293
|
+
if (Object.prototype.hasOwnProperty.call(data, 'sameSite')) {
|
|
3294
|
+
if (!sameSite || !['strict', 'lax', 'none'].includes(sameSite)) {
|
|
3295
|
+
throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');
|
|
3296
|
+
}
|
|
3297
|
+
if (sameSite === 'none' && !this.secure) {
|
|
3298
|
+
throw new Error('sameSite = None requires the Secure attribute in latest browser versions.');
|
|
3299
|
+
}
|
|
3300
|
+
this.sameSite = sameSite;
|
|
3301
|
+
}
|
|
3302
|
+
}
|
|
3303
|
+
async setItem(key, value) {
|
|
3304
|
+
js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].set(key, value, this.getData());
|
|
3305
|
+
}
|
|
3306
|
+
async getItem(key) {
|
|
3307
|
+
const item = js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].get(key);
|
|
3308
|
+
return item ?? null;
|
|
3309
|
+
}
|
|
3310
|
+
async removeItem(key) {
|
|
3311
|
+
js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].remove(key, this.getData());
|
|
3312
|
+
}
|
|
3313
|
+
async clear() {
|
|
3314
|
+
const cookie = js_cookie__WEBPACK_IMPORTED_MODULE_0__["default"].get();
|
|
3315
|
+
const promises = Object.keys(cookie).map(key => this.removeItem(key));
|
|
3316
|
+
await Promise.all(promises);
|
|
3317
|
+
}
|
|
3318
|
+
getData() {
|
|
3319
|
+
return {
|
|
3320
|
+
path: this.path,
|
|
3321
|
+
expires: this.expires,
|
|
3322
|
+
domain: this.domain,
|
|
3323
|
+
secure: this.secure,
|
|
3324
|
+
...(this.sameSite && { sameSite: this.sameSite }),
|
|
3325
|
+
};
|
|
3326
|
+
}
|
|
3327
|
+
}
|
|
3328
|
+
|
|
3329
|
+
|
|
3330
|
+
//# sourceMappingURL=CookieStorage.mjs.map
|
|
3331
|
+
|
|
3332
|
+
|
|
3333
|
+
/***/ }),
|
|
3334
|
+
|
|
3335
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/storage/DefaultStorage.mjs":
|
|
3336
|
+
/*!****************************************************************************!*\
|
|
3337
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/storage/DefaultStorage.mjs ***!
|
|
3338
|
+
\****************************************************************************/
|
|
3339
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3340
|
+
|
|
3341
|
+
"use strict";
|
|
3342
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3343
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3344
|
+
/* harmony export */ DefaultStorage: () => (/* binding */ DefaultStorage)
|
|
3345
|
+
/* harmony export */ });
|
|
3346
|
+
/* harmony import */ var _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./KeyValueStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/KeyValueStorage.mjs");
|
|
3347
|
+
/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/utils.mjs");
|
|
3348
|
+
|
|
3349
|
+
|
|
3350
|
+
|
|
3351
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3352
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3353
|
+
/**
|
|
3354
|
+
* @internal
|
|
3355
|
+
*/
|
|
3356
|
+
class DefaultStorage extends _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__.KeyValueStorage {
|
|
3357
|
+
constructor() {
|
|
3358
|
+
super((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocalStorageWithFallback)());
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3362
|
+
|
|
3363
|
+
//# sourceMappingURL=DefaultStorage.mjs.map
|
|
3364
|
+
|
|
3365
|
+
|
|
3366
|
+
/***/ }),
|
|
3367
|
+
|
|
3368
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/storage/InMemoryStorage.mjs":
|
|
3369
|
+
/*!*****************************************************************************!*\
|
|
3370
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/storage/InMemoryStorage.mjs ***!
|
|
3371
|
+
\*****************************************************************************/
|
|
3372
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3373
|
+
|
|
3374
|
+
"use strict";
|
|
3375
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3376
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3377
|
+
/* harmony export */ InMemoryStorage: () => (/* binding */ InMemoryStorage)
|
|
3378
|
+
/* harmony export */ });
|
|
3379
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3380
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3381
|
+
/**
|
|
3382
|
+
* @internal
|
|
3383
|
+
*/
|
|
3384
|
+
class InMemoryStorage {
|
|
3385
|
+
constructor() {
|
|
3386
|
+
this.storage = new Map();
|
|
3387
|
+
}
|
|
3388
|
+
get length() {
|
|
3389
|
+
return this.storage.size;
|
|
3390
|
+
}
|
|
3391
|
+
key(index) {
|
|
3392
|
+
if (index > this.length - 1) {
|
|
3393
|
+
return null;
|
|
3394
|
+
}
|
|
3395
|
+
return Array.from(this.storage.keys())[index];
|
|
3396
|
+
}
|
|
3397
|
+
setItem(key, value) {
|
|
3398
|
+
this.storage.set(key, value);
|
|
3399
|
+
}
|
|
3400
|
+
getItem(key) {
|
|
3401
|
+
return this.storage.get(key) ?? null;
|
|
3402
|
+
}
|
|
3403
|
+
removeItem(key) {
|
|
3404
|
+
this.storage.delete(key);
|
|
3405
|
+
}
|
|
3406
|
+
clear() {
|
|
3407
|
+
this.storage.clear();
|
|
3408
|
+
}
|
|
3409
|
+
}
|
|
3410
|
+
|
|
3411
|
+
|
|
3412
|
+
//# sourceMappingURL=InMemoryStorage.mjs.map
|
|
3413
|
+
|
|
3414
|
+
|
|
3415
|
+
/***/ }),
|
|
3416
|
+
|
|
3417
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/storage/KeyValueStorage.mjs":
|
|
3418
|
+
/*!*****************************************************************************!*\
|
|
3419
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/storage/KeyValueStorage.mjs ***!
|
|
3420
|
+
\*****************************************************************************/
|
|
3421
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3422
|
+
|
|
3423
|
+
"use strict";
|
|
3424
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3425
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3426
|
+
/* harmony export */ KeyValueStorage: () => (/* binding */ KeyValueStorage)
|
|
3427
|
+
/* harmony export */ });
|
|
3428
|
+
/* harmony import */ var _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors/PlatformNotSupportedError.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/PlatformNotSupportedError.mjs");
|
|
3429
|
+
|
|
3430
|
+
|
|
3431
|
+
|
|
3432
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3433
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3434
|
+
/**
|
|
3435
|
+
* @internal
|
|
3436
|
+
*/
|
|
3437
|
+
class KeyValueStorage {
|
|
3438
|
+
constructor(storage) {
|
|
3439
|
+
this.storage = storage;
|
|
3440
|
+
}
|
|
3441
|
+
/**
|
|
3442
|
+
* This is used to set a specific item in storage
|
|
3443
|
+
* @param {string} key - the key for the item
|
|
3444
|
+
* @param {object} value - the value
|
|
3445
|
+
* @returns {string} value that was set
|
|
3446
|
+
*/
|
|
3447
|
+
async setItem(key, value) {
|
|
3448
|
+
if (!this.storage)
|
|
3449
|
+
throw new _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__.PlatformNotSupportedError();
|
|
3450
|
+
this.storage.setItem(key, value);
|
|
3451
|
+
}
|
|
3452
|
+
/**
|
|
3453
|
+
* This is used to get a specific key from storage
|
|
3454
|
+
* @param {string} key - the key for the item
|
|
3455
|
+
* This is used to clear the storage
|
|
3456
|
+
* @returns {string} the data item
|
|
3457
|
+
*/
|
|
3458
|
+
async getItem(key) {
|
|
3459
|
+
if (!this.storage)
|
|
3460
|
+
throw new _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__.PlatformNotSupportedError();
|
|
3461
|
+
return this.storage.getItem(key);
|
|
3462
|
+
}
|
|
3463
|
+
/**
|
|
3464
|
+
* This is used to remove an item from storage
|
|
3465
|
+
* @param {string} key - the key being set
|
|
3466
|
+
* @returns {string} value - value that was deleted
|
|
3467
|
+
*/
|
|
3468
|
+
async removeItem(key) {
|
|
3469
|
+
if (!this.storage)
|
|
3470
|
+
throw new _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__.PlatformNotSupportedError();
|
|
3471
|
+
this.storage.removeItem(key);
|
|
3472
|
+
}
|
|
3473
|
+
/**
|
|
3474
|
+
* This is used to clear the storage
|
|
3475
|
+
* @returns {string} nothing
|
|
3476
|
+
*/
|
|
3477
|
+
async clear() {
|
|
3478
|
+
if (!this.storage)
|
|
3479
|
+
throw new _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__.PlatformNotSupportedError();
|
|
3480
|
+
this.storage.clear();
|
|
3481
|
+
}
|
|
3482
|
+
}
|
|
3483
|
+
|
|
3484
|
+
|
|
3485
|
+
//# sourceMappingURL=KeyValueStorage.mjs.map
|
|
3486
|
+
|
|
3487
|
+
|
|
3488
|
+
/***/ }),
|
|
3489
|
+
|
|
3490
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/storage/SessionStorage.mjs":
|
|
3491
|
+
/*!****************************************************************************!*\
|
|
3492
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/storage/SessionStorage.mjs ***!
|
|
3493
|
+
\****************************************************************************/
|
|
3494
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3495
|
+
|
|
3496
|
+
"use strict";
|
|
3497
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3498
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3499
|
+
/* harmony export */ SessionStorage: () => (/* binding */ SessionStorage)
|
|
3500
|
+
/* harmony export */ });
|
|
3501
|
+
/* harmony import */ var _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./KeyValueStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/KeyValueStorage.mjs");
|
|
3502
|
+
/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/utils.mjs");
|
|
3503
|
+
|
|
3504
|
+
|
|
3505
|
+
|
|
3506
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3507
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3508
|
+
/**
|
|
3509
|
+
* @internal
|
|
3510
|
+
*/
|
|
3511
|
+
class SessionStorage extends _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__.KeyValueStorage {
|
|
3512
|
+
constructor() {
|
|
3513
|
+
super((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.getSessionStorageWithFallback)());
|
|
3514
|
+
}
|
|
3515
|
+
}
|
|
3516
|
+
|
|
3517
|
+
|
|
3518
|
+
//# sourceMappingURL=SessionStorage.mjs.map
|
|
3519
|
+
|
|
3520
|
+
|
|
3521
|
+
/***/ }),
|
|
3522
|
+
|
|
3523
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/storage/SyncKeyValueStorage.mjs":
|
|
3524
|
+
/*!*********************************************************************************!*\
|
|
3525
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/storage/SyncKeyValueStorage.mjs ***!
|
|
3526
|
+
\*********************************************************************************/
|
|
3527
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3528
|
+
|
|
3529
|
+
"use strict";
|
|
3530
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3531
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3532
|
+
/* harmony export */ SyncKeyValueStorage: () => (/* binding */ SyncKeyValueStorage)
|
|
3533
|
+
/* harmony export */ });
|
|
3534
|
+
/* harmony import */ var _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors/PlatformNotSupportedError.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/PlatformNotSupportedError.mjs");
|
|
3535
|
+
|
|
3536
|
+
|
|
3537
|
+
|
|
3538
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3539
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3540
|
+
/**
|
|
3541
|
+
* @internal
|
|
3542
|
+
*/
|
|
3543
|
+
class SyncKeyValueStorage {
|
|
3544
|
+
constructor(storage) {
|
|
3545
|
+
this._storage = storage;
|
|
3546
|
+
}
|
|
3547
|
+
get storage() {
|
|
3548
|
+
if (!this._storage)
|
|
3549
|
+
throw new _errors_PlatformNotSupportedError_mjs__WEBPACK_IMPORTED_MODULE_0__.PlatformNotSupportedError();
|
|
3550
|
+
return this._storage;
|
|
3551
|
+
}
|
|
3552
|
+
/**
|
|
3553
|
+
* This is used to set a specific item in storage
|
|
3554
|
+
* @param {string} key - the key for the item
|
|
3555
|
+
* @param {object} value - the value
|
|
3556
|
+
* @returns {string} value that was set
|
|
3557
|
+
*/
|
|
3558
|
+
setItem(key, value) {
|
|
3559
|
+
this.storage.setItem(key, value);
|
|
3560
|
+
}
|
|
3561
|
+
/**
|
|
3562
|
+
* This is used to get a specific key from storage
|
|
3563
|
+
* @param {string} key - the key for the item
|
|
3564
|
+
* This is used to clear the storage
|
|
3565
|
+
* @returns {string} the data item
|
|
3566
|
+
*/
|
|
3567
|
+
getItem(key) {
|
|
3568
|
+
return this.storage.getItem(key);
|
|
3569
|
+
}
|
|
3570
|
+
/**
|
|
3571
|
+
* This is used to remove an item from storage
|
|
3572
|
+
* @param {string} key - the key being set
|
|
3573
|
+
* @returns {string} value - value that was deleted
|
|
3574
|
+
*/
|
|
3575
|
+
removeItem(key) {
|
|
3576
|
+
this.storage.removeItem(key);
|
|
3577
|
+
}
|
|
3578
|
+
/**
|
|
3579
|
+
* This is used to clear the storage
|
|
3580
|
+
* @returns {string} nothing
|
|
3581
|
+
*/
|
|
3582
|
+
clear() {
|
|
3583
|
+
this.storage.clear();
|
|
3584
|
+
}
|
|
3585
|
+
}
|
|
3586
|
+
|
|
3587
|
+
|
|
3588
|
+
//# sourceMappingURL=SyncKeyValueStorage.mjs.map
|
|
3589
|
+
|
|
3590
|
+
|
|
3591
|
+
/***/ }),
|
|
3592
|
+
|
|
3593
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/storage/SyncSessionStorage.mjs":
|
|
3594
|
+
/*!********************************************************************************!*\
|
|
3595
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/storage/SyncSessionStorage.mjs ***!
|
|
3596
|
+
\********************************************************************************/
|
|
3597
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3598
|
+
|
|
3599
|
+
"use strict";
|
|
3600
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3601
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3602
|
+
/* harmony export */ SyncSessionStorage: () => (/* binding */ SyncSessionStorage)
|
|
3603
|
+
/* harmony export */ });
|
|
3604
|
+
/* harmony import */ var _SyncKeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SyncKeyValueStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/SyncKeyValueStorage.mjs");
|
|
3605
|
+
/* harmony import */ var _utils_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/utils.mjs");
|
|
3606
|
+
|
|
3607
|
+
|
|
3608
|
+
|
|
3609
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3610
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3611
|
+
/**
|
|
3612
|
+
* @internal
|
|
3613
|
+
*/
|
|
3614
|
+
class SyncSessionStorage extends _SyncKeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_0__.SyncKeyValueStorage {
|
|
3615
|
+
constructor() {
|
|
3616
|
+
super((0,_utils_mjs__WEBPACK_IMPORTED_MODULE_1__.getSessionStorageWithFallback)());
|
|
3617
|
+
}
|
|
3618
|
+
}
|
|
3619
|
+
|
|
3620
|
+
|
|
3621
|
+
//# sourceMappingURL=SyncSessionStorage.mjs.map
|
|
3622
|
+
|
|
3623
|
+
|
|
3624
|
+
/***/ }),
|
|
3625
|
+
|
|
3626
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/storage/index.mjs":
|
|
3627
|
+
/*!*******************************************************************!*\
|
|
3628
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/storage/index.mjs ***!
|
|
3629
|
+
\*******************************************************************/
|
|
3630
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3631
|
+
|
|
3632
|
+
"use strict";
|
|
3633
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3634
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3635
|
+
/* harmony export */ CookieStorage: () => (/* reexport safe */ _CookieStorage_mjs__WEBPACK_IMPORTED_MODULE_0__.CookieStorage),
|
|
3636
|
+
/* harmony export */ defaultStorage: () => (/* binding */ defaultStorage),
|
|
3637
|
+
/* harmony export */ sessionStorage: () => (/* binding */ sessionStorage),
|
|
3638
|
+
/* harmony export */ sharedInMemoryStorage: () => (/* binding */ sharedInMemoryStorage),
|
|
3639
|
+
/* harmony export */ syncSessionStorage: () => (/* binding */ syncSessionStorage)
|
|
3640
|
+
/* harmony export */ });
|
|
3641
|
+
/* harmony import */ var _DefaultStorage_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DefaultStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/DefaultStorage.mjs");
|
|
3642
|
+
/* harmony import */ var _InMemoryStorage_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./InMemoryStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/InMemoryStorage.mjs");
|
|
3643
|
+
/* harmony import */ var _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./KeyValueStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/KeyValueStorage.mjs");
|
|
3644
|
+
/* harmony import */ var _SessionStorage_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SessionStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/SessionStorage.mjs");
|
|
3645
|
+
/* harmony import */ var _SyncSessionStorage_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SyncSessionStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/SyncSessionStorage.mjs");
|
|
3646
|
+
/* harmony import */ var _CookieStorage_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CookieStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/CookieStorage.mjs");
|
|
3647
|
+
|
|
3648
|
+
|
|
3649
|
+
|
|
3650
|
+
|
|
3651
|
+
|
|
3652
|
+
|
|
3653
|
+
|
|
3654
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3655
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3656
|
+
const defaultStorage = new _DefaultStorage_mjs__WEBPACK_IMPORTED_MODULE_1__.DefaultStorage();
|
|
3657
|
+
const sessionStorage = new _SessionStorage_mjs__WEBPACK_IMPORTED_MODULE_2__.SessionStorage();
|
|
3658
|
+
const syncSessionStorage = new _SyncSessionStorage_mjs__WEBPACK_IMPORTED_MODULE_3__.SyncSessionStorage();
|
|
3659
|
+
const sharedInMemoryStorage = new _KeyValueStorage_mjs__WEBPACK_IMPORTED_MODULE_4__.KeyValueStorage(new _InMemoryStorage_mjs__WEBPACK_IMPORTED_MODULE_5__.InMemoryStorage());
|
|
3660
|
+
|
|
3661
|
+
|
|
3662
|
+
//# sourceMappingURL=index.mjs.map
|
|
3663
|
+
|
|
3664
|
+
|
|
3665
|
+
/***/ }),
|
|
3666
|
+
|
|
3667
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/storage/utils.mjs":
|
|
3668
|
+
/*!*******************************************************************!*\
|
|
3669
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/storage/utils.mjs ***!
|
|
3670
|
+
\*******************************************************************/
|
|
3671
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3672
|
+
|
|
3673
|
+
"use strict";
|
|
3674
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3675
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3676
|
+
/* harmony export */ getLocalStorageWithFallback: () => (/* binding */ getLocalStorageWithFallback),
|
|
3677
|
+
/* harmony export */ getSessionStorageWithFallback: () => (/* binding */ getSessionStorageWithFallback)
|
|
3678
|
+
/* harmony export */ });
|
|
3679
|
+
/* harmony import */ var _Logger_ConsoleLogger_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Logger/ConsoleLogger.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Logger/ConsoleLogger.mjs");
|
|
3680
|
+
/* harmony import */ var _InMemoryStorage_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./InMemoryStorage.mjs */ "./node_modules/@aws-amplify/core/dist/esm/storage/InMemoryStorage.mjs");
|
|
3681
|
+
|
|
3682
|
+
|
|
3683
|
+
|
|
3684
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3685
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3686
|
+
/**
|
|
3687
|
+
* @internal
|
|
3688
|
+
* @returns Either a reference to window.localStorage or an in-memory storage as fallback
|
|
3689
|
+
*/
|
|
3690
|
+
const logger = new _Logger_ConsoleLogger_mjs__WEBPACK_IMPORTED_MODULE_0__.ConsoleLogger('CoreStorageUtils');
|
|
3691
|
+
const getLocalStorageWithFallback = () => {
|
|
3692
|
+
try {
|
|
3693
|
+
// Attempt to use localStorage directly
|
|
3694
|
+
if (typeof window !== 'undefined' && window.localStorage) {
|
|
3695
|
+
return window.localStorage;
|
|
3696
|
+
}
|
|
3697
|
+
}
|
|
3698
|
+
catch (e) {
|
|
3699
|
+
// Handle any errors related to localStorage access
|
|
3700
|
+
logger.info('localStorage not found. InMemoryStorage is used as a fallback.');
|
|
3701
|
+
}
|
|
3702
|
+
// Return in-memory storage as a fallback if localStorage is not accessible
|
|
3703
|
+
return new _InMemoryStorage_mjs__WEBPACK_IMPORTED_MODULE_1__.InMemoryStorage();
|
|
3704
|
+
};
|
|
3705
|
+
/**
|
|
3706
|
+
* @internal
|
|
3707
|
+
* @returns Either a reference to window.sessionStorage or an in-memory storage as fallback
|
|
3708
|
+
*/
|
|
3709
|
+
const getSessionStorageWithFallback = () => {
|
|
3710
|
+
try {
|
|
3711
|
+
// Attempt to use sessionStorage directly
|
|
3712
|
+
if (typeof window !== 'undefined' && window.sessionStorage) {
|
|
3713
|
+
// Verify we can actually use it by testing access
|
|
3714
|
+
window.sessionStorage.getItem('test');
|
|
3715
|
+
return window.sessionStorage;
|
|
3716
|
+
}
|
|
3717
|
+
throw new Error('sessionStorage is not defined');
|
|
3718
|
+
}
|
|
3719
|
+
catch (e) {
|
|
3720
|
+
// Handle any errors related to sessionStorage access
|
|
3721
|
+
logger.info('sessionStorage not found. InMemoryStorage is used as a fallback.');
|
|
3722
|
+
return new _InMemoryStorage_mjs__WEBPACK_IMPORTED_MODULE_1__.InMemoryStorage();
|
|
3723
|
+
}
|
|
3724
|
+
};
|
|
3725
|
+
|
|
3726
|
+
|
|
3727
|
+
//# sourceMappingURL=utils.mjs.map
|
|
3728
|
+
|
|
3729
|
+
|
|
3730
|
+
/***/ }),
|
|
3731
|
+
|
|
3732
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/types/errors.mjs":
|
|
3733
|
+
/*!******************************************************************!*\
|
|
3734
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/types/errors.mjs ***!
|
|
3735
|
+
\******************************************************************/
|
|
3736
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3737
|
+
|
|
3738
|
+
"use strict";
|
|
3739
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3740
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3741
|
+
/* harmony export */ AmplifyErrorCode: () => (/* binding */ AmplifyErrorCode)
|
|
3742
|
+
/* harmony export */ });
|
|
3743
|
+
var AmplifyErrorCode;
|
|
3744
|
+
(function (AmplifyErrorCode) {
|
|
3745
|
+
AmplifyErrorCode["NoEndpointId"] = "NoEndpointId";
|
|
3746
|
+
AmplifyErrorCode["PlatformNotSupported"] = "PlatformNotSupported";
|
|
3747
|
+
AmplifyErrorCode["Unknown"] = "Unknown";
|
|
3748
|
+
AmplifyErrorCode["NetworkError"] = "NetworkError";
|
|
3749
|
+
})(AmplifyErrorCode || (AmplifyErrorCode = {}));
|
|
3750
|
+
|
|
3751
|
+
|
|
3752
|
+
//# sourceMappingURL=errors.mjs.map
|
|
3753
|
+
|
|
3754
|
+
|
|
3755
|
+
/***/ }),
|
|
3756
|
+
|
|
3757
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/utils/amplifyUrl/index.mjs":
|
|
3758
|
+
/*!****************************************************************************!*\
|
|
3759
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/utils/amplifyUrl/index.mjs ***!
|
|
3760
|
+
\****************************************************************************/
|
|
3761
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3762
|
+
|
|
3763
|
+
"use strict";
|
|
3764
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3765
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3766
|
+
/* harmony export */ AmplifyUrl: () => (/* binding */ AmplifyUrl),
|
|
3767
|
+
/* harmony export */ AmplifyUrlSearchParams: () => (/* binding */ AmplifyUrlSearchParams)
|
|
3768
|
+
/* harmony export */ });
|
|
3769
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3770
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3771
|
+
const AmplifyUrl = URL;
|
|
3772
|
+
const AmplifyUrlSearchParams = URLSearchParams;
|
|
3773
|
+
|
|
3774
|
+
|
|
3775
|
+
//# sourceMappingURL=index.mjs.map
|
|
3776
|
+
|
|
3777
|
+
|
|
3778
|
+
/***/ }),
|
|
3779
|
+
|
|
3780
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/utils/amplifyUuid/index.mjs":
|
|
3781
|
+
/*!*****************************************************************************!*\
|
|
3782
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/utils/amplifyUuid/index.mjs ***!
|
|
3783
|
+
\*****************************************************************************/
|
|
3784
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3785
|
+
|
|
3786
|
+
"use strict";
|
|
3787
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3788
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3789
|
+
/* harmony export */ amplifyUuid: () => (/* binding */ amplifyUuid)
|
|
3790
|
+
/* harmony export */ });
|
|
3791
|
+
/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uuid */ "./node_modules/uuid/dist/esm-browser/v4.js");
|
|
3792
|
+
|
|
3793
|
+
|
|
3794
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3795
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3796
|
+
const amplifyUuid = uuid__WEBPACK_IMPORTED_MODULE_0__["default"];
|
|
3797
|
+
|
|
3798
|
+
|
|
3799
|
+
//# sourceMappingURL=index.mjs.map
|
|
3800
|
+
|
|
3801
|
+
|
|
3802
|
+
/***/ }),
|
|
3803
|
+
|
|
3804
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/utils/convert/base64/base64Decoder.mjs":
|
|
3805
|
+
/*!****************************************************************************************!*\
|
|
3806
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/utils/convert/base64/base64Decoder.mjs ***!
|
|
3807
|
+
\****************************************************************************************/
|
|
3808
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3809
|
+
|
|
3810
|
+
"use strict";
|
|
3811
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3812
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3813
|
+
/* harmony export */ base64Decoder: () => (/* binding */ base64Decoder)
|
|
3814
|
+
/* harmony export */ });
|
|
3815
|
+
/* harmony import */ var _globalHelpers_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../globalHelpers/index.mjs */ "./node_modules/@aws-amplify/core/dist/esm/utils/globalHelpers/index.mjs");
|
|
3816
|
+
|
|
3817
|
+
|
|
3818
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3819
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3820
|
+
const base64Decoder = {
|
|
3821
|
+
convert(input, options) {
|
|
3822
|
+
let inputStr = input;
|
|
3823
|
+
// urlSafe character replacement options conform to the base64 url spec
|
|
3824
|
+
// https://datatracker.ietf.org/doc/html/rfc4648#page-7
|
|
3825
|
+
if (options?.urlSafe) {
|
|
3826
|
+
inputStr = inputStr.replace(/-/g, '+').replace(/_/g, '/');
|
|
3827
|
+
}
|
|
3828
|
+
return (0,_globalHelpers_index_mjs__WEBPACK_IMPORTED_MODULE_0__.getAtob)()(inputStr);
|
|
3829
|
+
},
|
|
3830
|
+
};
|
|
3831
|
+
|
|
3832
|
+
|
|
3833
|
+
//# sourceMappingURL=base64Decoder.mjs.map
|
|
3834
|
+
|
|
3835
|
+
|
|
3836
|
+
/***/ }),
|
|
3837
|
+
|
|
3838
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/utils/deDupeAsyncFunction.mjs":
|
|
3839
|
+
/*!*******************************************************************************!*\
|
|
3840
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/utils/deDupeAsyncFunction.mjs ***!
|
|
3841
|
+
\*******************************************************************************/
|
|
3842
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3843
|
+
|
|
3844
|
+
"use strict";
|
|
3845
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3846
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3847
|
+
/* harmony export */ deDupeAsyncFunction: () => (/* binding */ deDupeAsyncFunction)
|
|
3848
|
+
/* harmony export */ });
|
|
3849
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3850
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3851
|
+
/**
|
|
3852
|
+
* returns in-flight promise if there is one
|
|
3853
|
+
*
|
|
3854
|
+
* @param asyncFunction - asyncFunction to be deduped.
|
|
3855
|
+
* @returns - the return type of the callback
|
|
3856
|
+
*/
|
|
3857
|
+
const deDupeAsyncFunction = (asyncFunction) => {
|
|
3858
|
+
let inflightPromise;
|
|
3859
|
+
return async (...args) => {
|
|
3860
|
+
if (inflightPromise)
|
|
3861
|
+
return inflightPromise;
|
|
3862
|
+
inflightPromise = new Promise((resolve, reject) => {
|
|
3863
|
+
asyncFunction(...args)
|
|
3864
|
+
.then(result => {
|
|
3865
|
+
resolve(result);
|
|
3866
|
+
})
|
|
3867
|
+
.catch(error => {
|
|
3868
|
+
reject(error);
|
|
3869
|
+
})
|
|
3870
|
+
.finally(() => {
|
|
3871
|
+
inflightPromise = undefined;
|
|
3872
|
+
});
|
|
3873
|
+
});
|
|
3874
|
+
return inflightPromise;
|
|
3875
|
+
};
|
|
3876
|
+
};
|
|
3877
|
+
|
|
3878
|
+
|
|
3879
|
+
//# sourceMappingURL=deDupeAsyncFunction.mjs.map
|
|
3880
|
+
|
|
3881
|
+
|
|
3882
|
+
/***/ }),
|
|
3883
|
+
|
|
3884
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/utils/globalHelpers/index.mjs":
|
|
3885
|
+
/*!*******************************************************************************!*\
|
|
3886
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/utils/globalHelpers/index.mjs ***!
|
|
3887
|
+
\*******************************************************************************/
|
|
3888
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3889
|
+
|
|
3890
|
+
"use strict";
|
|
3891
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3892
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3893
|
+
/* harmony export */ getAtob: () => (/* binding */ getAtob),
|
|
3894
|
+
/* harmony export */ getBtoa: () => (/* binding */ getBtoa),
|
|
3895
|
+
/* harmony export */ getCrypto: () => (/* binding */ getCrypto)
|
|
3896
|
+
/* harmony export */ });
|
|
3897
|
+
/* harmony import */ var _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../errors/AmplifyError.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/AmplifyError.mjs");
|
|
3898
|
+
|
|
3899
|
+
|
|
3900
|
+
|
|
3901
|
+
|
|
3902
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3903
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3904
|
+
const getCrypto = () => {
|
|
3905
|
+
if (typeof window === 'object' && typeof window.crypto === 'object') {
|
|
3906
|
+
return window.crypto;
|
|
3907
|
+
}
|
|
3908
|
+
// Next.js global polyfill
|
|
3909
|
+
if (typeof crypto === 'object') {
|
|
3910
|
+
return crypto;
|
|
3911
|
+
}
|
|
3912
|
+
throw new _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__.AmplifyError({
|
|
3913
|
+
name: 'MissingPolyfill',
|
|
3914
|
+
message: 'Cannot resolve the `crypto` function from the environment.',
|
|
3915
|
+
});
|
|
3916
|
+
};
|
|
3917
|
+
const getBtoa = () => {
|
|
3918
|
+
// browser
|
|
3919
|
+
if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
|
|
3920
|
+
return window.btoa;
|
|
3921
|
+
}
|
|
3922
|
+
// Next.js global polyfill
|
|
3923
|
+
if (typeof btoa === 'function') {
|
|
3924
|
+
return btoa;
|
|
3925
|
+
}
|
|
3926
|
+
throw new _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__.AmplifyError({
|
|
3927
|
+
name: 'Base64EncoderError',
|
|
3928
|
+
message: 'Cannot resolve the `btoa` function from the environment.',
|
|
3929
|
+
});
|
|
3930
|
+
};
|
|
3931
|
+
const getAtob = () => {
|
|
3932
|
+
// browser
|
|
3933
|
+
if (typeof window !== 'undefined' && typeof window.atob === 'function') {
|
|
3934
|
+
return window.atob;
|
|
3935
|
+
}
|
|
3936
|
+
// Next.js global polyfill
|
|
3937
|
+
if (typeof atob === 'function') {
|
|
3938
|
+
return atob;
|
|
3939
|
+
}
|
|
3940
|
+
throw new _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_0__.AmplifyError({
|
|
3941
|
+
name: 'Base64EncoderError',
|
|
3942
|
+
message: 'Cannot resolve the `atob` function from the environment.',
|
|
3943
|
+
});
|
|
3944
|
+
};
|
|
3945
|
+
|
|
3946
|
+
|
|
3947
|
+
//# sourceMappingURL=index.mjs.map
|
|
3948
|
+
|
|
3949
|
+
|
|
3950
|
+
/***/ }),
|
|
3951
|
+
|
|
3952
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/utils/isBrowser.mjs":
|
|
3953
|
+
/*!*********************************************************************!*\
|
|
3954
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/utils/isBrowser.mjs ***!
|
|
3955
|
+
\*********************************************************************/
|
|
3956
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3957
|
+
|
|
3958
|
+
"use strict";
|
|
3959
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3960
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3961
|
+
/* harmony export */ isBrowser: () => (/* binding */ isBrowser)
|
|
3962
|
+
/* harmony export */ });
|
|
3963
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3964
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3965
|
+
const isBrowser = () => typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
3966
|
+
|
|
3967
|
+
|
|
3968
|
+
//# sourceMappingURL=isBrowser.mjs.map
|
|
3969
|
+
|
|
3970
|
+
|
|
3971
|
+
/***/ }),
|
|
3972
|
+
|
|
3973
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/utils/isTokenExpired.mjs":
|
|
3974
|
+
/*!**************************************************************************!*\
|
|
3975
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/utils/isTokenExpired.mjs ***!
|
|
3976
|
+
\**************************************************************************/
|
|
3977
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3978
|
+
|
|
3979
|
+
"use strict";
|
|
3980
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3981
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3982
|
+
/* harmony export */ isTokenExpired: () => (/* binding */ isTokenExpired)
|
|
3983
|
+
/* harmony export */ });
|
|
3984
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3985
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3986
|
+
function isTokenExpired({ expiresAt, clockDrift, tolerance = 5000, }) {
|
|
3987
|
+
const currentTime = Date.now();
|
|
3988
|
+
return currentTime + clockDrift + tolerance > expiresAt;
|
|
3989
|
+
}
|
|
3990
|
+
|
|
3991
|
+
|
|
3992
|
+
//# sourceMappingURL=isTokenExpired.mjs.map
|
|
3993
|
+
|
|
3994
|
+
|
|
3995
|
+
/***/ }),
|
|
3996
|
+
|
|
3997
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/utils/retry/constants.mjs":
|
|
3998
|
+
/*!***************************************************************************!*\
|
|
3999
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/utils/retry/constants.mjs ***!
|
|
4000
|
+
\***************************************************************************/
|
|
4001
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4002
|
+
|
|
4003
|
+
"use strict";
|
|
4004
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4005
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4006
|
+
/* harmony export */ MAX_DELAY_MS: () => (/* binding */ MAX_DELAY_MS)
|
|
4007
|
+
/* harmony export */ });
|
|
4008
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4009
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4010
|
+
const MAX_DELAY_MS = 5 * 60 * 1000;
|
|
4011
|
+
|
|
4012
|
+
|
|
4013
|
+
//# sourceMappingURL=constants.mjs.map
|
|
4014
|
+
|
|
4015
|
+
|
|
4016
|
+
/***/ }),
|
|
4017
|
+
|
|
4018
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/utils/retry/jitteredBackoff.mjs":
|
|
4019
|
+
/*!*********************************************************************************!*\
|
|
4020
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/utils/retry/jitteredBackoff.mjs ***!
|
|
4021
|
+
\*********************************************************************************/
|
|
4022
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4023
|
+
|
|
4024
|
+
"use strict";
|
|
4025
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4026
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4027
|
+
/* harmony export */ jitteredBackoff: () => (/* binding */ jitteredBackoff)
|
|
4028
|
+
/* harmony export */ });
|
|
4029
|
+
/* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.mjs */ "./node_modules/@aws-amplify/core/dist/esm/utils/retry/constants.mjs");
|
|
4030
|
+
|
|
4031
|
+
|
|
4032
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4033
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4034
|
+
/**
|
|
4035
|
+
* @private
|
|
4036
|
+
* Internal use of Amplify only
|
|
4037
|
+
*/
|
|
4038
|
+
function jitteredBackoff(maxDelayMs = _constants_mjs__WEBPACK_IMPORTED_MODULE_0__.MAX_DELAY_MS) {
|
|
4039
|
+
const BASE_TIME_MS = 100;
|
|
4040
|
+
const JITTER_FACTOR = 100;
|
|
4041
|
+
return attempt => {
|
|
4042
|
+
const delay = 2 ** attempt * BASE_TIME_MS + JITTER_FACTOR * Math.random();
|
|
4043
|
+
return delay > maxDelayMs ? false : delay;
|
|
4044
|
+
};
|
|
4045
|
+
}
|
|
4046
|
+
|
|
4047
|
+
|
|
4048
|
+
//# sourceMappingURL=jitteredBackoff.mjs.map
|
|
4049
|
+
|
|
4050
|
+
|
|
4051
|
+
/***/ }),
|
|
4052
|
+
|
|
4053
|
+
/***/ "./node_modules/js-cookie/dist/js.cookie.mjs":
|
|
4054
|
+
/*!***************************************************!*\
|
|
4055
|
+
!*** ./node_modules/js-cookie/dist/js.cookie.mjs ***!
|
|
4056
|
+
\***************************************************/
|
|
4057
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4058
|
+
|
|
4059
|
+
"use strict";
|
|
4060
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4061
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4062
|
+
/* harmony export */ "default": () => (/* binding */ api)
|
|
4063
|
+
/* harmony export */ });
|
|
4064
|
+
/*! js-cookie v3.0.5 | MIT */
|
|
4065
|
+
/* eslint-disable no-var */
|
|
4066
|
+
function assign (target) {
|
|
4067
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
4068
|
+
var source = arguments[i];
|
|
4069
|
+
for (var key in source) {
|
|
4070
|
+
target[key] = source[key];
|
|
4071
|
+
}
|
|
4072
|
+
}
|
|
4073
|
+
return target
|
|
4074
|
+
}
|
|
4075
|
+
/* eslint-enable no-var */
|
|
4076
|
+
|
|
4077
|
+
/* eslint-disable no-var */
|
|
4078
|
+
var defaultConverter = {
|
|
4079
|
+
read: function (value) {
|
|
4080
|
+
if (value[0] === '"') {
|
|
4081
|
+
value = value.slice(1, -1);
|
|
4082
|
+
}
|
|
4083
|
+
return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent)
|
|
4084
|
+
},
|
|
4085
|
+
write: function (value) {
|
|
4086
|
+
return encodeURIComponent(value).replace(
|
|
4087
|
+
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
|
|
4088
|
+
decodeURIComponent
|
|
4089
|
+
)
|
|
4090
|
+
}
|
|
4091
|
+
};
|
|
4092
|
+
/* eslint-enable no-var */
|
|
4093
|
+
|
|
4094
|
+
/* eslint-disable no-var */
|
|
4095
|
+
|
|
4096
|
+
function init (converter, defaultAttributes) {
|
|
4097
|
+
function set (name, value, attributes) {
|
|
4098
|
+
if (typeof document === 'undefined') {
|
|
4099
|
+
return
|
|
4100
|
+
}
|
|
4101
|
+
|
|
4102
|
+
attributes = assign({}, defaultAttributes, attributes);
|
|
4103
|
+
|
|
4104
|
+
if (typeof attributes.expires === 'number') {
|
|
4105
|
+
attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
|
|
4106
|
+
}
|
|
4107
|
+
if (attributes.expires) {
|
|
4108
|
+
attributes.expires = attributes.expires.toUTCString();
|
|
4109
|
+
}
|
|
4110
|
+
|
|
4111
|
+
name = encodeURIComponent(name)
|
|
4112
|
+
.replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
|
|
4113
|
+
.replace(/[()]/g, escape);
|
|
4114
|
+
|
|
4115
|
+
var stringifiedAttributes = '';
|
|
4116
|
+
for (var attributeName in attributes) {
|
|
4117
|
+
if (!attributes[attributeName]) {
|
|
4118
|
+
continue
|
|
4119
|
+
}
|
|
4120
|
+
|
|
4121
|
+
stringifiedAttributes += '; ' + attributeName;
|
|
4122
|
+
|
|
4123
|
+
if (attributes[attributeName] === true) {
|
|
4124
|
+
continue
|
|
4125
|
+
}
|
|
4126
|
+
|
|
4127
|
+
// Considers RFC 6265 section 5.2:
|
|
4128
|
+
// ...
|
|
4129
|
+
// 3. If the remaining unparsed-attributes contains a %x3B (";")
|
|
4130
|
+
// character:
|
|
4131
|
+
// Consume the characters of the unparsed-attributes up to,
|
|
4132
|
+
// not including, the first %x3B (";") character.
|
|
4133
|
+
// ...
|
|
4134
|
+
stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
|
|
4135
|
+
}
|
|
4136
|
+
|
|
4137
|
+
return (document.cookie =
|
|
4138
|
+
name + '=' + converter.write(value, name) + stringifiedAttributes)
|
|
4139
|
+
}
|
|
4140
|
+
|
|
4141
|
+
function get (name) {
|
|
4142
|
+
if (typeof document === 'undefined' || (arguments.length && !name)) {
|
|
4143
|
+
return
|
|
4144
|
+
}
|
|
4145
|
+
|
|
4146
|
+
// To prevent the for loop in the first place assign an empty array
|
|
4147
|
+
// in case there are no cookies at all.
|
|
4148
|
+
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
|
4149
|
+
var jar = {};
|
|
4150
|
+
for (var i = 0; i < cookies.length; i++) {
|
|
4151
|
+
var parts = cookies[i].split('=');
|
|
4152
|
+
var value = parts.slice(1).join('=');
|
|
4153
|
+
|
|
4154
|
+
try {
|
|
4155
|
+
var found = decodeURIComponent(parts[0]);
|
|
4156
|
+
jar[found] = converter.read(value, found);
|
|
4157
|
+
|
|
4158
|
+
if (name === found) {
|
|
4159
|
+
break
|
|
4160
|
+
}
|
|
4161
|
+
} catch (e) {}
|
|
4162
|
+
}
|
|
4163
|
+
|
|
4164
|
+
return name ? jar[name] : jar
|
|
4165
|
+
}
|
|
4166
|
+
|
|
4167
|
+
return Object.create(
|
|
4168
|
+
{
|
|
4169
|
+
set,
|
|
4170
|
+
get,
|
|
4171
|
+
remove: function (name, attributes) {
|
|
4172
|
+
set(
|
|
4173
|
+
name,
|
|
4174
|
+
'',
|
|
4175
|
+
assign({}, attributes, {
|
|
4176
|
+
expires: -1
|
|
4177
|
+
})
|
|
4178
|
+
);
|
|
4179
|
+
},
|
|
4180
|
+
withAttributes: function (attributes) {
|
|
4181
|
+
return init(this.converter, assign({}, this.attributes, attributes))
|
|
4182
|
+
},
|
|
4183
|
+
withConverter: function (converter) {
|
|
4184
|
+
return init(assign({}, this.converter, converter), this.attributes)
|
|
4185
|
+
}
|
|
4186
|
+
},
|
|
4187
|
+
{
|
|
4188
|
+
attributes: { value: Object.freeze(defaultAttributes) },
|
|
4189
|
+
converter: { value: Object.freeze(converter) }
|
|
4190
|
+
}
|
|
4191
|
+
)
|
|
4192
|
+
}
|
|
4193
|
+
|
|
4194
|
+
var api = init(defaultConverter, { path: '/' });
|
|
4195
|
+
/* eslint-enable no-var */
|
|
4196
|
+
|
|
4197
|
+
|
|
4198
|
+
|
|
4199
|
+
|
|
4200
|
+
/***/ }),
|
|
4201
|
+
|
|
4202
|
+
/***/ "./node_modules/process/browser.js":
|
|
4203
|
+
/*!*****************************************!*\
|
|
4204
|
+
!*** ./node_modules/process/browser.js ***!
|
|
4205
|
+
\*****************************************/
|
|
4206
|
+
/***/ ((module) => {
|
|
4207
|
+
|
|
4208
|
+
// shim for using process in browser
|
|
4209
|
+
var process = module.exports = {};
|
|
4210
|
+
|
|
4211
|
+
// cached from whatever global is present so that test runners that stub it
|
|
4212
|
+
// don't break things. But we need to wrap it in a try catch in case it is
|
|
4213
|
+
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
|
4214
|
+
// function because try/catches deoptimize in certain engines.
|
|
4215
|
+
|
|
4216
|
+
var cachedSetTimeout;
|
|
4217
|
+
var cachedClearTimeout;
|
|
4218
|
+
|
|
4219
|
+
function defaultSetTimout() {
|
|
4220
|
+
throw new Error('setTimeout has not been defined');
|
|
4221
|
+
}
|
|
4222
|
+
function defaultClearTimeout () {
|
|
4223
|
+
throw new Error('clearTimeout has not been defined');
|
|
4224
|
+
}
|
|
4225
|
+
(function () {
|
|
4226
|
+
try {
|
|
4227
|
+
if (typeof setTimeout === 'function') {
|
|
4228
|
+
cachedSetTimeout = setTimeout;
|
|
4229
|
+
} else {
|
|
4230
|
+
cachedSetTimeout = defaultSetTimout;
|
|
4231
|
+
}
|
|
4232
|
+
} catch (e) {
|
|
4233
|
+
cachedSetTimeout = defaultSetTimout;
|
|
4234
|
+
}
|
|
4235
|
+
try {
|
|
4236
|
+
if (typeof clearTimeout === 'function') {
|
|
4237
|
+
cachedClearTimeout = clearTimeout;
|
|
4238
|
+
} else {
|
|
4239
|
+
cachedClearTimeout = defaultClearTimeout;
|
|
4240
|
+
}
|
|
4241
|
+
} catch (e) {
|
|
4242
|
+
cachedClearTimeout = defaultClearTimeout;
|
|
4243
|
+
}
|
|
4244
|
+
} ())
|
|
4245
|
+
function runTimeout(fun) {
|
|
4246
|
+
if (cachedSetTimeout === setTimeout) {
|
|
4247
|
+
//normal enviroments in sane situations
|
|
4248
|
+
return setTimeout(fun, 0);
|
|
4249
|
+
}
|
|
4250
|
+
// if setTimeout wasn't available but was latter defined
|
|
4251
|
+
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
|
4252
|
+
cachedSetTimeout = setTimeout;
|
|
4253
|
+
return setTimeout(fun, 0);
|
|
4254
|
+
}
|
|
4255
|
+
try {
|
|
4256
|
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
4257
|
+
return cachedSetTimeout(fun, 0);
|
|
4258
|
+
} catch(e){
|
|
4259
|
+
try {
|
|
4260
|
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
4261
|
+
return cachedSetTimeout.call(null, fun, 0);
|
|
4262
|
+
} catch(e){
|
|
4263
|
+
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
|
4264
|
+
return cachedSetTimeout.call(this, fun, 0);
|
|
4265
|
+
}
|
|
4266
|
+
}
|
|
4267
|
+
|
|
4268
|
+
|
|
4269
|
+
}
|
|
4270
|
+
function runClearTimeout(marker) {
|
|
4271
|
+
if (cachedClearTimeout === clearTimeout) {
|
|
4272
|
+
//normal enviroments in sane situations
|
|
4273
|
+
return clearTimeout(marker);
|
|
4274
|
+
}
|
|
4275
|
+
// if clearTimeout wasn't available but was latter defined
|
|
4276
|
+
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
|
4277
|
+
cachedClearTimeout = clearTimeout;
|
|
4278
|
+
return clearTimeout(marker);
|
|
4279
|
+
}
|
|
4280
|
+
try {
|
|
4281
|
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
4282
|
+
return cachedClearTimeout(marker);
|
|
4283
|
+
} catch (e){
|
|
4284
|
+
try {
|
|
4285
|
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
4286
|
+
return cachedClearTimeout.call(null, marker);
|
|
4287
|
+
} catch (e){
|
|
4288
|
+
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
|
4289
|
+
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
|
4290
|
+
return cachedClearTimeout.call(this, marker);
|
|
4291
|
+
}
|
|
4292
|
+
}
|
|
4293
|
+
|
|
4294
|
+
|
|
4295
|
+
|
|
4296
|
+
}
|
|
4297
|
+
var queue = [];
|
|
4298
|
+
var draining = false;
|
|
4299
|
+
var currentQueue;
|
|
4300
|
+
var queueIndex = -1;
|
|
4301
|
+
|
|
4302
|
+
function cleanUpNextTick() {
|
|
4303
|
+
if (!draining || !currentQueue) {
|
|
4304
|
+
return;
|
|
4305
|
+
}
|
|
4306
|
+
draining = false;
|
|
4307
|
+
if (currentQueue.length) {
|
|
4308
|
+
queue = currentQueue.concat(queue);
|
|
4309
|
+
} else {
|
|
4310
|
+
queueIndex = -1;
|
|
4311
|
+
}
|
|
4312
|
+
if (queue.length) {
|
|
4313
|
+
drainQueue();
|
|
4314
|
+
}
|
|
4315
|
+
}
|
|
4316
|
+
|
|
4317
|
+
function drainQueue() {
|
|
4318
|
+
if (draining) {
|
|
4319
|
+
return;
|
|
4320
|
+
}
|
|
4321
|
+
var timeout = runTimeout(cleanUpNextTick);
|
|
4322
|
+
draining = true;
|
|
4323
|
+
|
|
4324
|
+
var len = queue.length;
|
|
4325
|
+
while(len) {
|
|
4326
|
+
currentQueue = queue;
|
|
4327
|
+
queue = [];
|
|
4328
|
+
while (++queueIndex < len) {
|
|
4329
|
+
if (currentQueue) {
|
|
4330
|
+
currentQueue[queueIndex].run();
|
|
4331
|
+
}
|
|
4332
|
+
}
|
|
4333
|
+
queueIndex = -1;
|
|
4334
|
+
len = queue.length;
|
|
4335
|
+
}
|
|
4336
|
+
currentQueue = null;
|
|
4337
|
+
draining = false;
|
|
4338
|
+
runClearTimeout(timeout);
|
|
4339
|
+
}
|
|
4340
|
+
|
|
4341
|
+
process.nextTick = function (fun) {
|
|
4342
|
+
var args = new Array(arguments.length - 1);
|
|
4343
|
+
if (arguments.length > 1) {
|
|
4344
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
4345
|
+
args[i - 1] = arguments[i];
|
|
4346
|
+
}
|
|
4347
|
+
}
|
|
4348
|
+
queue.push(new Item(fun, args));
|
|
4349
|
+
if (queue.length === 1 && !draining) {
|
|
4350
|
+
runTimeout(drainQueue);
|
|
4351
|
+
}
|
|
4352
|
+
};
|
|
4353
|
+
|
|
4354
|
+
// v8 likes predictible objects
|
|
4355
|
+
function Item(fun, array) {
|
|
4356
|
+
this.fun = fun;
|
|
4357
|
+
this.array = array;
|
|
4358
|
+
}
|
|
4359
|
+
Item.prototype.run = function () {
|
|
4360
|
+
this.fun.apply(null, this.array);
|
|
4361
|
+
};
|
|
4362
|
+
process.title = 'browser';
|
|
4363
|
+
process.browser = true;
|
|
4364
|
+
process.env = {};
|
|
4365
|
+
process.argv = [];
|
|
4366
|
+
process.version = ''; // empty string to avoid regexp issues
|
|
4367
|
+
process.versions = {};
|
|
4368
|
+
|
|
4369
|
+
function noop() {}
|
|
4370
|
+
|
|
4371
|
+
process.on = noop;
|
|
4372
|
+
process.addListener = noop;
|
|
4373
|
+
process.once = noop;
|
|
4374
|
+
process.off = noop;
|
|
4375
|
+
process.removeListener = noop;
|
|
4376
|
+
process.removeAllListeners = noop;
|
|
4377
|
+
process.emit = noop;
|
|
4378
|
+
process.prependListener = noop;
|
|
4379
|
+
process.prependOnceListener = noop;
|
|
4380
|
+
|
|
4381
|
+
process.listeners = function (name) { return [] }
|
|
4382
|
+
|
|
4383
|
+
process.binding = function (name) {
|
|
4384
|
+
throw new Error('process.binding is not supported');
|
|
4385
|
+
};
|
|
4386
|
+
|
|
4387
|
+
process.cwd = function () { return '/' };
|
|
4388
|
+
process.chdir = function (dir) {
|
|
4389
|
+
throw new Error('process.chdir is not supported');
|
|
4390
|
+
};
|
|
4391
|
+
process.umask = function() { return 0; };
|
|
4392
|
+
|
|
4393
|
+
|
|
4394
|
+
/***/ }),
|
|
4395
|
+
|
|
4396
|
+
/***/ "./node_modules/uuid/dist/esm-browser/native.js":
|
|
4397
|
+
/*!******************************************************!*\
|
|
4398
|
+
!*** ./node_modules/uuid/dist/esm-browser/native.js ***!
|
|
4399
|
+
\******************************************************/
|
|
4400
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4401
|
+
|
|
4402
|
+
"use strict";
|
|
4403
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4404
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4405
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
4406
|
+
/* harmony export */ });
|
|
4407
|
+
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
4408
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ randomUUID });
|
|
4409
|
+
|
|
4410
|
+
|
|
4411
|
+
/***/ }),
|
|
4412
|
+
|
|
4413
|
+
/***/ "./node_modules/uuid/dist/esm-browser/regex.js":
|
|
4414
|
+
/*!*****************************************************!*\
|
|
4415
|
+
!*** ./node_modules/uuid/dist/esm-browser/regex.js ***!
|
|
4416
|
+
\*****************************************************/
|
|
4417
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4418
|
+
|
|
4419
|
+
"use strict";
|
|
4420
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4421
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4422
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
4423
|
+
/* harmony export */ });
|
|
4424
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i);
|
|
4425
|
+
|
|
4426
|
+
|
|
4427
|
+
/***/ }),
|
|
4428
|
+
|
|
4429
|
+
/***/ "./node_modules/uuid/dist/esm-browser/rng.js":
|
|
4430
|
+
/*!***************************************************!*\
|
|
4431
|
+
!*** ./node_modules/uuid/dist/esm-browser/rng.js ***!
|
|
4432
|
+
\***************************************************/
|
|
4433
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4434
|
+
|
|
4435
|
+
"use strict";
|
|
4436
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4437
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4438
|
+
/* harmony export */ "default": () => (/* binding */ rng)
|
|
4439
|
+
/* harmony export */ });
|
|
4440
|
+
let getRandomValues;
|
|
4441
|
+
const rnds8 = new Uint8Array(16);
|
|
4442
|
+
function rng() {
|
|
4443
|
+
if (!getRandomValues) {
|
|
4444
|
+
if (typeof crypto === 'undefined' || !crypto.getRandomValues) {
|
|
4445
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
4446
|
+
}
|
|
4447
|
+
getRandomValues = crypto.getRandomValues.bind(crypto);
|
|
4448
|
+
}
|
|
4449
|
+
return getRandomValues(rnds8);
|
|
4450
|
+
}
|
|
4451
|
+
|
|
4452
|
+
|
|
4453
|
+
/***/ }),
|
|
4454
|
+
|
|
4455
|
+
/***/ "./node_modules/uuid/dist/esm-browser/stringify.js":
|
|
4456
|
+
/*!*********************************************************!*\
|
|
4457
|
+
!*** ./node_modules/uuid/dist/esm-browser/stringify.js ***!
|
|
4458
|
+
\*********************************************************/
|
|
4459
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4460
|
+
|
|
4461
|
+
"use strict";
|
|
4462
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4463
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4464
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
|
|
4465
|
+
/* harmony export */ unsafeStringify: () => (/* binding */ unsafeStringify)
|
|
4466
|
+
/* harmony export */ });
|
|
4467
|
+
/* harmony import */ var _validate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validate.js */ "./node_modules/uuid/dist/esm-browser/validate.js");
|
|
4468
|
+
|
|
4469
|
+
const byteToHex = [];
|
|
4470
|
+
for (let i = 0; i < 256; ++i) {
|
|
4471
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
4472
|
+
}
|
|
4473
|
+
function unsafeStringify(arr, offset = 0) {
|
|
4474
|
+
return (byteToHex[arr[offset + 0]] +
|
|
4475
|
+
byteToHex[arr[offset + 1]] +
|
|
4476
|
+
byteToHex[arr[offset + 2]] +
|
|
4477
|
+
byteToHex[arr[offset + 3]] +
|
|
4478
|
+
'-' +
|
|
4479
|
+
byteToHex[arr[offset + 4]] +
|
|
4480
|
+
byteToHex[arr[offset + 5]] +
|
|
4481
|
+
'-' +
|
|
4482
|
+
byteToHex[arr[offset + 6]] +
|
|
4483
|
+
byteToHex[arr[offset + 7]] +
|
|
4484
|
+
'-' +
|
|
4485
|
+
byteToHex[arr[offset + 8]] +
|
|
4486
|
+
byteToHex[arr[offset + 9]] +
|
|
4487
|
+
'-' +
|
|
4488
|
+
byteToHex[arr[offset + 10]] +
|
|
4489
|
+
byteToHex[arr[offset + 11]] +
|
|
4490
|
+
byteToHex[arr[offset + 12]] +
|
|
4491
|
+
byteToHex[arr[offset + 13]] +
|
|
4492
|
+
byteToHex[arr[offset + 14]] +
|
|
4493
|
+
byteToHex[arr[offset + 15]]).toLowerCase();
|
|
4494
|
+
}
|
|
4495
|
+
function stringify(arr, offset = 0) {
|
|
4496
|
+
const uuid = unsafeStringify(arr, offset);
|
|
4497
|
+
if (!(0,_validate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(uuid)) {
|
|
4498
|
+
throw TypeError('Stringified UUID is invalid');
|
|
4499
|
+
}
|
|
4500
|
+
return uuid;
|
|
4501
|
+
}
|
|
4502
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stringify);
|
|
4503
|
+
|
|
4504
|
+
|
|
4505
|
+
/***/ }),
|
|
4506
|
+
|
|
4507
|
+
/***/ "./node_modules/uuid/dist/esm-browser/v4.js":
|
|
4508
|
+
/*!**************************************************!*\
|
|
4509
|
+
!*** ./node_modules/uuid/dist/esm-browser/v4.js ***!
|
|
4510
|
+
\**************************************************/
|
|
4511
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4512
|
+
|
|
4513
|
+
"use strict";
|
|
4514
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4515
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4516
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
4517
|
+
/* harmony export */ });
|
|
4518
|
+
/* harmony import */ var _native_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./native.js */ "./node_modules/uuid/dist/esm-browser/native.js");
|
|
4519
|
+
/* harmony import */ var _rng_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rng.js */ "./node_modules/uuid/dist/esm-browser/rng.js");
|
|
4520
|
+
/* harmony import */ var _stringify_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stringify.js */ "./node_modules/uuid/dist/esm-browser/stringify.js");
|
|
4521
|
+
|
|
4522
|
+
|
|
4523
|
+
|
|
4524
|
+
function v4(options, buf, offset) {
|
|
4525
|
+
if (_native_js__WEBPACK_IMPORTED_MODULE_0__["default"].randomUUID && !buf && !options) {
|
|
4526
|
+
return _native_js__WEBPACK_IMPORTED_MODULE_0__["default"].randomUUID();
|
|
4527
|
+
}
|
|
4528
|
+
options = options || {};
|
|
4529
|
+
const rnds = options.random ?? options.rng?.() ?? (0,_rng_js__WEBPACK_IMPORTED_MODULE_1__["default"])();
|
|
4530
|
+
if (rnds.length < 16) {
|
|
4531
|
+
throw new Error('Random bytes length must be >= 16');
|
|
4532
|
+
}
|
|
4533
|
+
rnds[6] = (rnds[6] & 0x0f) | 0x40;
|
|
4534
|
+
rnds[8] = (rnds[8] & 0x3f) | 0x80;
|
|
4535
|
+
if (buf) {
|
|
4536
|
+
offset = offset || 0;
|
|
4537
|
+
if (offset < 0 || offset + 16 > buf.length) {
|
|
4538
|
+
throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
|
|
4539
|
+
}
|
|
4540
|
+
for (let i = 0; i < 16; ++i) {
|
|
4541
|
+
buf[offset + i] = rnds[i];
|
|
4542
|
+
}
|
|
4543
|
+
return buf;
|
|
4544
|
+
}
|
|
4545
|
+
return (0,_stringify_js__WEBPACK_IMPORTED_MODULE_2__.unsafeStringify)(rnds);
|
|
4546
|
+
}
|
|
4547
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (v4);
|
|
4548
|
+
|
|
4549
|
+
|
|
4550
|
+
/***/ }),
|
|
4551
|
+
|
|
4552
|
+
/***/ "./node_modules/uuid/dist/esm-browser/validate.js":
|
|
4553
|
+
/*!********************************************************!*\
|
|
4554
|
+
!*** ./node_modules/uuid/dist/esm-browser/validate.js ***!
|
|
4555
|
+
\********************************************************/
|
|
4556
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4557
|
+
|
|
4558
|
+
"use strict";
|
|
4559
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4560
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4561
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
4562
|
+
/* harmony export */ });
|
|
4563
|
+
/* harmony import */ var _regex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./regex.js */ "./node_modules/uuid/dist/esm-browser/regex.js");
|
|
4564
|
+
|
|
4565
|
+
function validate(uuid) {
|
|
4566
|
+
return typeof uuid === 'string' && _regex_js__WEBPACK_IMPORTED_MODULE_0__["default"].test(uuid);
|
|
4567
|
+
}
|
|
4568
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (validate);
|
|
4569
|
+
|
|
4570
|
+
|
|
4571
|
+
/***/ })
|
|
4572
|
+
|
|
4573
|
+
}]);
|
|
4574
|
+
//# sourceMappingURL=vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_mjs.16430abf3466c3153f59.js.map
|