mito-ai 0.1.39__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.39.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/build_log.json +102 -100
- {mito_ai-0.1.39.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/package.json +4 -2
- {mito_ai-0.1.39.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.39.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.16b532b655cd2906e04a.js → mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.01a962c68c8fae380f30.js +1782 -891
- 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.39.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.606207904e6aaa42b1bf.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.39.dist-info → mito_ai-0.1.41.dist-info}/METADATA +1 -1
- {mito_ai-0.1.39.dist-info → mito_ai-0.1.41.dist-info}/RECORD +53 -36
- mito_ai-0.1.39.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.16b532b655cd2906e04a.js.map +0 -1
- mito_ai-0.1.39.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.606207904e6aaa42b1bf.js.map +0 -1
- {mito_ai-0.1.39.data → mito_ai-0.1.41.data}/data/etc/jupyter/jupyter_server_config.d/mito_ai.json +0 -0
- {mito_ai-0.1.39.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.39.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/static/style.js +0 -0
- {mito_ai-0.1.39.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.39.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.39.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.39.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.39.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.39.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.39.dist-info → mito_ai-0.1.41.dist-info}/WHEEL +0 -0
- {mito_ai-0.1.39.dist-info → mito_ai-0.1.41.dist-info}/entry_points.txt +0 -0
- {mito_ai-0.1.39.dist-info → mito_ai-0.1.41.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,2345 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
(self["webpackChunkmito_ai"] = self["webpackChunkmito_ai"] || []).push([["vendors-node_modules_aws-amplify_core_dist_esm_singleton_Amplify_mjs"],{
|
|
3
|
+
|
|
4
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Hub/index.mjs":
|
|
5
|
+
/*!***************************************************************!*\
|
|
6
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Hub/index.mjs ***!
|
|
7
|
+
\***************************************************************/
|
|
8
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
9
|
+
|
|
10
|
+
__webpack_require__.r(__webpack_exports__);
|
|
11
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12
|
+
/* harmony export */ AMPLIFY_SYMBOL: () => (/* binding */ AMPLIFY_SYMBOL),
|
|
13
|
+
/* harmony export */ Hub: () => (/* binding */ Hub),
|
|
14
|
+
/* harmony export */ HubClass: () => (/* binding */ HubClass),
|
|
15
|
+
/* harmony export */ HubInternal: () => (/* binding */ HubInternal)
|
|
16
|
+
/* harmony export */ });
|
|
17
|
+
/* 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");
|
|
18
|
+
/* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants.mjs */ "./node_modules/@aws-amplify/core/dist/esm/constants.mjs");
|
|
19
|
+
/* harmony import */ var _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../errors/AmplifyError.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/AmplifyError.mjs");
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
27
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
28
|
+
const AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined'
|
|
29
|
+
? Symbol('amplify_default')
|
|
30
|
+
: '@@amplify_default');
|
|
31
|
+
const logger = new _Logger_ConsoleLogger_mjs__WEBPACK_IMPORTED_MODULE_0__.ConsoleLogger('Hub');
|
|
32
|
+
class HubClass {
|
|
33
|
+
constructor(name) {
|
|
34
|
+
this.listeners = new Map();
|
|
35
|
+
this.protectedChannels = [
|
|
36
|
+
'core',
|
|
37
|
+
'auth',
|
|
38
|
+
'api',
|
|
39
|
+
'analytics',
|
|
40
|
+
'interactions',
|
|
41
|
+
'pubsub',
|
|
42
|
+
'storage',
|
|
43
|
+
'ui',
|
|
44
|
+
'xr',
|
|
45
|
+
];
|
|
46
|
+
this.name = name;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Used internally to remove a Hub listener.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* This private method is for internal use only. Instead of calling Hub.remove, call the result of Hub.listen.
|
|
53
|
+
*/
|
|
54
|
+
_remove(channel, listener) {
|
|
55
|
+
const holder = this.listeners.get(channel);
|
|
56
|
+
if (!holder) {
|
|
57
|
+
logger.warn(`No listeners for ${channel}`);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.listeners.set(channel, [
|
|
61
|
+
...holder.filter(({ callback }) => callback !== listener),
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
64
|
+
dispatch(channel, payload, source, ampSymbol) {
|
|
65
|
+
if (typeof channel === 'string' &&
|
|
66
|
+
this.protectedChannels.indexOf(channel) > -1) {
|
|
67
|
+
const hasAccess = ampSymbol === AMPLIFY_SYMBOL;
|
|
68
|
+
if (!hasAccess) {
|
|
69
|
+
logger.warn(`WARNING: ${channel} is protected and dispatching on it can have unintended consequences`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const capsule = {
|
|
73
|
+
channel,
|
|
74
|
+
payload: { ...payload },
|
|
75
|
+
source,
|
|
76
|
+
patternInfo: [],
|
|
77
|
+
};
|
|
78
|
+
try {
|
|
79
|
+
this._toListeners(capsule);
|
|
80
|
+
}
|
|
81
|
+
catch (e) {
|
|
82
|
+
logger.error(e);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
listen(channel, callback, listenerName = 'noname') {
|
|
86
|
+
let cb;
|
|
87
|
+
if (typeof callback !== 'function') {
|
|
88
|
+
throw new _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_1__.AmplifyError({
|
|
89
|
+
name: _constants_mjs__WEBPACK_IMPORTED_MODULE_2__.NO_HUBCALLBACK_PROVIDED_EXCEPTION,
|
|
90
|
+
message: 'No callback supplied to Hub',
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
// Needs to be casted as a more generic type
|
|
95
|
+
cb = callback;
|
|
96
|
+
}
|
|
97
|
+
let holder = this.listeners.get(channel);
|
|
98
|
+
if (!holder) {
|
|
99
|
+
holder = [];
|
|
100
|
+
this.listeners.set(channel, holder);
|
|
101
|
+
}
|
|
102
|
+
holder.push({
|
|
103
|
+
name: listenerName,
|
|
104
|
+
callback: cb,
|
|
105
|
+
});
|
|
106
|
+
return () => {
|
|
107
|
+
this._remove(channel, cb);
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
_toListeners(capsule) {
|
|
111
|
+
const { channel, payload } = capsule;
|
|
112
|
+
const holder = this.listeners.get(channel);
|
|
113
|
+
if (holder) {
|
|
114
|
+
holder.forEach(listener => {
|
|
115
|
+
logger.debug(`Dispatching to ${channel} with `, payload);
|
|
116
|
+
try {
|
|
117
|
+
listener.callback(capsule);
|
|
118
|
+
}
|
|
119
|
+
catch (e) {
|
|
120
|
+
logger.error(e);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/* We export a __default__ instance of HubClass to use it as a
|
|
127
|
+
pseudo Singleton for the main messaging bus, however you can still create
|
|
128
|
+
your own instance of HubClass() for a separate "private bus" of events. */
|
|
129
|
+
const Hub = new HubClass('__default__');
|
|
130
|
+
/**
|
|
131
|
+
* @internal
|
|
132
|
+
*
|
|
133
|
+
* Internal hub used for core Amplify functionality. Not intended for use outside of Amplify.
|
|
134
|
+
*
|
|
135
|
+
*/
|
|
136
|
+
const HubInternal = new HubClass('internal-hub');
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
//# sourceMappingURL=index.mjs.map
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
/***/ }),
|
|
143
|
+
|
|
144
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Logger/ConsoleLogger.mjs":
|
|
145
|
+
/*!**************************************************************************!*\
|
|
146
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Logger/ConsoleLogger.mjs ***!
|
|
147
|
+
\**************************************************************************/
|
|
148
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
149
|
+
|
|
150
|
+
__webpack_require__.r(__webpack_exports__);
|
|
151
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
152
|
+
/* harmony export */ ConsoleLogger: () => (/* binding */ ConsoleLogger)
|
|
153
|
+
/* harmony export */ });
|
|
154
|
+
/* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants.mjs */ "./node_modules/@aws-amplify/core/dist/esm/constants.mjs");
|
|
155
|
+
/* harmony import */ var _types_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Logger/types.mjs");
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
/* eslint-disable no-console */
|
|
160
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
161
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
162
|
+
const LOG_LEVELS = {
|
|
163
|
+
VERBOSE: 1,
|
|
164
|
+
DEBUG: 2,
|
|
165
|
+
INFO: 3,
|
|
166
|
+
WARN: 4,
|
|
167
|
+
ERROR: 5,
|
|
168
|
+
NONE: 6,
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Write logs
|
|
172
|
+
* @class Logger
|
|
173
|
+
*/
|
|
174
|
+
class ConsoleLogger {
|
|
175
|
+
/**
|
|
176
|
+
* @constructor
|
|
177
|
+
* @param {string} name - Name of the logger
|
|
178
|
+
*/
|
|
179
|
+
constructor(name, level = _types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.WARN) {
|
|
180
|
+
this.name = name;
|
|
181
|
+
this.level = level;
|
|
182
|
+
this._pluggables = [];
|
|
183
|
+
}
|
|
184
|
+
_padding(n) {
|
|
185
|
+
return n < 10 ? '0' + n : '' + n;
|
|
186
|
+
}
|
|
187
|
+
_ts() {
|
|
188
|
+
const dt = new Date();
|
|
189
|
+
return ([this._padding(dt.getMinutes()), this._padding(dt.getSeconds())].join(':') +
|
|
190
|
+
'.' +
|
|
191
|
+
dt.getMilliseconds());
|
|
192
|
+
}
|
|
193
|
+
configure(config) {
|
|
194
|
+
if (!config)
|
|
195
|
+
return this._config;
|
|
196
|
+
this._config = config;
|
|
197
|
+
return this._config;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Write log
|
|
201
|
+
* @method
|
|
202
|
+
* @memeberof Logger
|
|
203
|
+
* @param {LogType|string} type - log type, default INFO
|
|
204
|
+
* @param {string|object} msg - Logging message or object
|
|
205
|
+
*/
|
|
206
|
+
_log(type, ...msg) {
|
|
207
|
+
let loggerLevelName = this.level;
|
|
208
|
+
if (ConsoleLogger.LOG_LEVEL) {
|
|
209
|
+
loggerLevelName = ConsoleLogger.LOG_LEVEL;
|
|
210
|
+
}
|
|
211
|
+
if (typeof window !== 'undefined' && window.LOG_LEVEL) {
|
|
212
|
+
loggerLevelName = window.LOG_LEVEL;
|
|
213
|
+
}
|
|
214
|
+
const loggerLevel = LOG_LEVELS[loggerLevelName];
|
|
215
|
+
const typeLevel = LOG_LEVELS[type];
|
|
216
|
+
if (!(typeLevel >= loggerLevel)) {
|
|
217
|
+
// Do nothing if type is not greater than or equal to logger level (handle undefined)
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
let log = console.log.bind(console);
|
|
221
|
+
if (type === _types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.ERROR && console.error) {
|
|
222
|
+
log = console.error.bind(console);
|
|
223
|
+
}
|
|
224
|
+
if (type === _types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.WARN && console.warn) {
|
|
225
|
+
log = console.warn.bind(console);
|
|
226
|
+
}
|
|
227
|
+
if (ConsoleLogger.BIND_ALL_LOG_LEVELS) {
|
|
228
|
+
if (type === _types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.INFO && console.info) {
|
|
229
|
+
log = console.info.bind(console);
|
|
230
|
+
}
|
|
231
|
+
if (type === _types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.DEBUG && console.debug) {
|
|
232
|
+
log = console.debug.bind(console);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
const prefix = `[${type}] ${this._ts()} ${this.name}`;
|
|
236
|
+
let message = '';
|
|
237
|
+
if (msg.length === 1 && typeof msg[0] === 'string') {
|
|
238
|
+
message = `${prefix} - ${msg[0]}`;
|
|
239
|
+
log(message);
|
|
240
|
+
}
|
|
241
|
+
else if (msg.length === 1) {
|
|
242
|
+
message = `${prefix} ${msg[0]}`;
|
|
243
|
+
log(prefix, msg[0]);
|
|
244
|
+
}
|
|
245
|
+
else if (typeof msg[0] === 'string') {
|
|
246
|
+
let obj = msg.slice(1);
|
|
247
|
+
if (obj.length === 1) {
|
|
248
|
+
obj = obj[0];
|
|
249
|
+
}
|
|
250
|
+
message = `${prefix} - ${msg[0]} ${obj}`;
|
|
251
|
+
log(`${prefix} - ${msg[0]}`, obj);
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
message = `${prefix} ${msg}`;
|
|
255
|
+
log(prefix, msg);
|
|
256
|
+
}
|
|
257
|
+
for (const plugin of this._pluggables) {
|
|
258
|
+
const logEvent = { message, timestamp: Date.now() };
|
|
259
|
+
plugin.pushLogs([logEvent]);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Write General log. Default to INFO
|
|
264
|
+
* @method
|
|
265
|
+
* @memeberof Logger
|
|
266
|
+
* @param {string|object} msg - Logging message or object
|
|
267
|
+
*/
|
|
268
|
+
log(...msg) {
|
|
269
|
+
this._log(_types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.INFO, ...msg);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Write INFO log
|
|
273
|
+
* @method
|
|
274
|
+
* @memeberof Logger
|
|
275
|
+
* @param {string|object} msg - Logging message or object
|
|
276
|
+
*/
|
|
277
|
+
info(...msg) {
|
|
278
|
+
this._log(_types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.INFO, ...msg);
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Write WARN log
|
|
282
|
+
* @method
|
|
283
|
+
* @memeberof Logger
|
|
284
|
+
* @param {string|object} msg - Logging message or object
|
|
285
|
+
*/
|
|
286
|
+
warn(...msg) {
|
|
287
|
+
this._log(_types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.WARN, ...msg);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Write ERROR log
|
|
291
|
+
* @method
|
|
292
|
+
* @memeberof Logger
|
|
293
|
+
* @param {string|object} msg - Logging message or object
|
|
294
|
+
*/
|
|
295
|
+
error(...msg) {
|
|
296
|
+
this._log(_types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.ERROR, ...msg);
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Write DEBUG log
|
|
300
|
+
* @method
|
|
301
|
+
* @memeberof Logger
|
|
302
|
+
* @param {string|object} msg - Logging message or object
|
|
303
|
+
*/
|
|
304
|
+
debug(...msg) {
|
|
305
|
+
this._log(_types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.DEBUG, ...msg);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Write VERBOSE log
|
|
309
|
+
* @method
|
|
310
|
+
* @memeberof Logger
|
|
311
|
+
* @param {string|object} msg - Logging message or object
|
|
312
|
+
*/
|
|
313
|
+
verbose(...msg) {
|
|
314
|
+
this._log(_types_mjs__WEBPACK_IMPORTED_MODULE_0__.LogType.VERBOSE, ...msg);
|
|
315
|
+
}
|
|
316
|
+
addPluggable(pluggable) {
|
|
317
|
+
if (pluggable && pluggable.getCategoryName() === _constants_mjs__WEBPACK_IMPORTED_MODULE_1__.AWS_CLOUDWATCH_CATEGORY) {
|
|
318
|
+
this._pluggables.push(pluggable);
|
|
319
|
+
pluggable.configure(this._config);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
listPluggables() {
|
|
323
|
+
return this._pluggables;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
ConsoleLogger.LOG_LEVEL = null;
|
|
327
|
+
ConsoleLogger.BIND_ALL_LOG_LEVELS = false;
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
//# sourceMappingURL=ConsoleLogger.mjs.map
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
/***/ }),
|
|
334
|
+
|
|
335
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/Logger/types.mjs":
|
|
336
|
+
/*!******************************************************************!*\
|
|
337
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/Logger/types.mjs ***!
|
|
338
|
+
\******************************************************************/
|
|
339
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
340
|
+
|
|
341
|
+
__webpack_require__.r(__webpack_exports__);
|
|
342
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
343
|
+
/* harmony export */ LogType: () => (/* binding */ LogType)
|
|
344
|
+
/* harmony export */ });
|
|
345
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
346
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
347
|
+
var LogType;
|
|
348
|
+
(function (LogType) {
|
|
349
|
+
LogType["DEBUG"] = "DEBUG";
|
|
350
|
+
LogType["ERROR"] = "ERROR";
|
|
351
|
+
LogType["INFO"] = "INFO";
|
|
352
|
+
LogType["WARN"] = "WARN";
|
|
353
|
+
LogType["VERBOSE"] = "VERBOSE";
|
|
354
|
+
LogType["NONE"] = "NONE";
|
|
355
|
+
})(LogType || (LogType = {}));
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
//# sourceMappingURL=types.mjs.map
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
/***/ }),
|
|
362
|
+
|
|
363
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/constants.mjs":
|
|
364
|
+
/*!***************************************************************!*\
|
|
365
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/constants.mjs ***!
|
|
366
|
+
\***************************************************************/
|
|
367
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
368
|
+
|
|
369
|
+
__webpack_require__.r(__webpack_exports__);
|
|
370
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
371
|
+
/* harmony export */ AWS_CLOUDWATCH_CATEGORY: () => (/* binding */ AWS_CLOUDWATCH_CATEGORY),
|
|
372
|
+
/* harmony export */ NO_HUBCALLBACK_PROVIDED_EXCEPTION: () => (/* binding */ NO_HUBCALLBACK_PROVIDED_EXCEPTION),
|
|
373
|
+
/* harmony export */ USER_AGENT_HEADER: () => (/* binding */ USER_AGENT_HEADER)
|
|
374
|
+
/* harmony export */ });
|
|
375
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
376
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
377
|
+
// Logging constants
|
|
378
|
+
const AWS_CLOUDWATCH_CATEGORY = 'Logging';
|
|
379
|
+
const USER_AGENT_HEADER = 'x-amz-user-agent';
|
|
380
|
+
// Error exception code constants
|
|
381
|
+
const NO_HUBCALLBACK_PROVIDED_EXCEPTION = 'NoHubcallbackProvidedException';
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
//# sourceMappingURL=constants.mjs.map
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
/***/ }),
|
|
388
|
+
|
|
389
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/errors/AmplifyError.mjs":
|
|
390
|
+
/*!*************************************************************************!*\
|
|
391
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/errors/AmplifyError.mjs ***!
|
|
392
|
+
\*************************************************************************/
|
|
393
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
394
|
+
|
|
395
|
+
__webpack_require__.r(__webpack_exports__);
|
|
396
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
397
|
+
/* harmony export */ AmplifyError: () => (/* binding */ AmplifyError)
|
|
398
|
+
/* harmony export */ });
|
|
399
|
+
class AmplifyError extends Error {
|
|
400
|
+
/**
|
|
401
|
+
* Constructs an AmplifyError.
|
|
402
|
+
*
|
|
403
|
+
* @param message text that describes the main problem.
|
|
404
|
+
* @param underlyingError the underlying cause of the error.
|
|
405
|
+
* @param recoverySuggestion suggestion to recover from the error.
|
|
406
|
+
*
|
|
407
|
+
*/
|
|
408
|
+
constructor({ message, name, recoverySuggestion, underlyingError, metadata, }) {
|
|
409
|
+
super(message);
|
|
410
|
+
this.name = name;
|
|
411
|
+
this.underlyingError = underlyingError;
|
|
412
|
+
this.recoverySuggestion = recoverySuggestion;
|
|
413
|
+
if (metadata) {
|
|
414
|
+
// If metadata exists, explicitly only record the following properties.
|
|
415
|
+
const { extendedRequestId, httpStatusCode, requestId } = metadata;
|
|
416
|
+
this.metadata = { extendedRequestId, httpStatusCode, requestId };
|
|
417
|
+
}
|
|
418
|
+
// Hack for making the custom error class work when transpiled to es5
|
|
419
|
+
// TODO: Delete the following 2 lines after we change the build target to >= es2015
|
|
420
|
+
this.constructor = AmplifyError;
|
|
421
|
+
Object.setPrototypeOf(this, AmplifyError.prototype);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
//# sourceMappingURL=AmplifyError.mjs.map
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
/***/ }),
|
|
430
|
+
|
|
431
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/parseAWSExports.mjs":
|
|
432
|
+
/*!*********************************************************************!*\
|
|
433
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/parseAWSExports.mjs ***!
|
|
434
|
+
\*********************************************************************/
|
|
435
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
436
|
+
|
|
437
|
+
__webpack_require__.r(__webpack_exports__);
|
|
438
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
439
|
+
/* harmony export */ parseAWSExports: () => (/* binding */ parseAWSExports)
|
|
440
|
+
/* harmony export */ });
|
|
441
|
+
/* 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");
|
|
442
|
+
/* harmony import */ var _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./errors/AmplifyError.mjs */ "./node_modules/@aws-amplify/core/dist/esm/errors/AmplifyError.mjs");
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
449
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
450
|
+
const logger = new _Logger_ConsoleLogger_mjs__WEBPACK_IMPORTED_MODULE_0__.ConsoleLogger('parseAWSExports');
|
|
451
|
+
const authTypeMapping = {
|
|
452
|
+
API_KEY: 'apiKey',
|
|
453
|
+
AWS_IAM: 'iam',
|
|
454
|
+
AMAZON_COGNITO_USER_POOLS: 'userPool',
|
|
455
|
+
OPENID_CONNECT: 'oidc',
|
|
456
|
+
NONE: 'none',
|
|
457
|
+
AWS_LAMBDA: 'lambda',
|
|
458
|
+
// `LAMBDA` is an incorrect value that was added during the v6 rewrite.
|
|
459
|
+
// Keeping it as a valid value until v7 to prevent breaking customers who might
|
|
460
|
+
// be relying on it as a workaround.
|
|
461
|
+
// ref: https://github.com/aws-amplify/amplify-js/pull/12922
|
|
462
|
+
// TODO: @v7 remove next line
|
|
463
|
+
LAMBDA: 'lambda',
|
|
464
|
+
};
|
|
465
|
+
/**
|
|
466
|
+
* Converts the object imported from `aws-exports.js` or `amplifyconfiguration.json` files generated by
|
|
467
|
+
* the Amplify CLI into an object that conforms to the {@link ResourcesConfig}.
|
|
468
|
+
*
|
|
469
|
+
* @param config A configuration object imported from `aws-exports.js` or `amplifyconfiguration.json`.
|
|
470
|
+
*
|
|
471
|
+
* @returns An object that conforms to the {@link ResourcesConfig} .
|
|
472
|
+
*/
|
|
473
|
+
const parseAWSExports = (config = {}) => {
|
|
474
|
+
if (!Object.prototype.hasOwnProperty.call(config, 'aws_project_region')) {
|
|
475
|
+
throw new _errors_AmplifyError_mjs__WEBPACK_IMPORTED_MODULE_1__.AmplifyError({
|
|
476
|
+
name: 'InvalidParameterException',
|
|
477
|
+
message: 'Invalid config parameter.',
|
|
478
|
+
recoverySuggestion: 'Ensure passing the config object imported from `amplifyconfiguration.json`.',
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
const { aws_appsync_apiKey, aws_appsync_authenticationType, aws_appsync_graphqlEndpoint, aws_appsync_region, aws_bots_config, aws_cognito_identity_pool_id, aws_cognito_sign_up_verification_method, aws_cognito_mfa_configuration, aws_cognito_mfa_types, aws_cognito_password_protection_settings, aws_cognito_verification_mechanisms, aws_cognito_signup_attributes, aws_cognito_social_providers, aws_cognito_username_attributes, aws_mandatory_sign_in, aws_mobile_analytics_app_id, aws_mobile_analytics_app_region, aws_user_files_s3_bucket, aws_user_files_s3_bucket_region, aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing, aws_user_pools_id, aws_user_pools_web_client_id, geo, oauth, predictions, aws_cloud_logic_custom, Notifications, modelIntrospection, } = config;
|
|
482
|
+
const amplifyConfig = {};
|
|
483
|
+
// Analytics
|
|
484
|
+
if (aws_mobile_analytics_app_id) {
|
|
485
|
+
amplifyConfig.Analytics = {
|
|
486
|
+
Pinpoint: {
|
|
487
|
+
appId: aws_mobile_analytics_app_id,
|
|
488
|
+
region: aws_mobile_analytics_app_region,
|
|
489
|
+
},
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
// Notifications
|
|
493
|
+
const { InAppMessaging, Push } = Notifications ?? {};
|
|
494
|
+
if (InAppMessaging?.AWSPinpoint || Push?.AWSPinpoint) {
|
|
495
|
+
if (InAppMessaging?.AWSPinpoint) {
|
|
496
|
+
const { appId, region } = InAppMessaging.AWSPinpoint;
|
|
497
|
+
amplifyConfig.Notifications = {
|
|
498
|
+
InAppMessaging: {
|
|
499
|
+
Pinpoint: {
|
|
500
|
+
appId,
|
|
501
|
+
region,
|
|
502
|
+
},
|
|
503
|
+
},
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
if (Push?.AWSPinpoint) {
|
|
507
|
+
const { appId, region } = Push.AWSPinpoint;
|
|
508
|
+
amplifyConfig.Notifications = {
|
|
509
|
+
...amplifyConfig.Notifications,
|
|
510
|
+
PushNotification: {
|
|
511
|
+
Pinpoint: {
|
|
512
|
+
appId,
|
|
513
|
+
region,
|
|
514
|
+
},
|
|
515
|
+
},
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
// Interactions
|
|
520
|
+
if (Array.isArray(aws_bots_config)) {
|
|
521
|
+
amplifyConfig.Interactions = {
|
|
522
|
+
LexV1: Object.fromEntries(aws_bots_config.map(bot => [bot.name, bot])),
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
// API
|
|
526
|
+
if (aws_appsync_graphqlEndpoint) {
|
|
527
|
+
const defaultAuthMode = authTypeMapping[aws_appsync_authenticationType];
|
|
528
|
+
if (!defaultAuthMode) {
|
|
529
|
+
logger.debug(`Invalid authentication type ${aws_appsync_authenticationType}. Falling back to IAM.`);
|
|
530
|
+
}
|
|
531
|
+
amplifyConfig.API = {
|
|
532
|
+
GraphQL: {
|
|
533
|
+
endpoint: aws_appsync_graphqlEndpoint,
|
|
534
|
+
apiKey: aws_appsync_apiKey,
|
|
535
|
+
region: aws_appsync_region,
|
|
536
|
+
defaultAuthMode: defaultAuthMode ?? 'iam',
|
|
537
|
+
},
|
|
538
|
+
};
|
|
539
|
+
if (modelIntrospection) {
|
|
540
|
+
amplifyConfig.API.GraphQL.modelIntrospection = modelIntrospection;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
// Auth
|
|
544
|
+
const mfaConfig = aws_cognito_mfa_configuration
|
|
545
|
+
? {
|
|
546
|
+
status: aws_cognito_mfa_configuration &&
|
|
547
|
+
aws_cognito_mfa_configuration.toLowerCase(),
|
|
548
|
+
totpEnabled: aws_cognito_mfa_types?.includes('TOTP') ?? false,
|
|
549
|
+
smsEnabled: aws_cognito_mfa_types?.includes('SMS') ?? false,
|
|
550
|
+
}
|
|
551
|
+
: undefined;
|
|
552
|
+
const passwordFormatConfig = aws_cognito_password_protection_settings
|
|
553
|
+
? {
|
|
554
|
+
minLength: aws_cognito_password_protection_settings.passwordPolicyMinLength,
|
|
555
|
+
requireLowercase: aws_cognito_password_protection_settings.passwordPolicyCharacters?.includes('REQUIRES_LOWERCASE') ?? false,
|
|
556
|
+
requireUppercase: aws_cognito_password_protection_settings.passwordPolicyCharacters?.includes('REQUIRES_UPPERCASE') ?? false,
|
|
557
|
+
requireNumbers: aws_cognito_password_protection_settings.passwordPolicyCharacters?.includes('REQUIRES_NUMBERS') ?? false,
|
|
558
|
+
requireSpecialCharacters: aws_cognito_password_protection_settings.passwordPolicyCharacters?.includes('REQUIRES_SYMBOLS') ?? false,
|
|
559
|
+
}
|
|
560
|
+
: undefined;
|
|
561
|
+
const mergedUserAttributes = Array.from(new Set([
|
|
562
|
+
...(aws_cognito_verification_mechanisms ?? []),
|
|
563
|
+
...(aws_cognito_signup_attributes ?? []),
|
|
564
|
+
]));
|
|
565
|
+
const userAttributes = mergedUserAttributes.reduce((attributes, key) => ({
|
|
566
|
+
...attributes,
|
|
567
|
+
// All user attributes generated by the CLI are required
|
|
568
|
+
[key.toLowerCase()]: { required: true },
|
|
569
|
+
}), {});
|
|
570
|
+
const loginWithEmailEnabled = aws_cognito_username_attributes?.includes('EMAIL') ?? false;
|
|
571
|
+
const loginWithPhoneEnabled = aws_cognito_username_attributes?.includes('PHONE_NUMBER') ?? false;
|
|
572
|
+
if (aws_cognito_identity_pool_id || aws_user_pools_id) {
|
|
573
|
+
amplifyConfig.Auth = {
|
|
574
|
+
Cognito: {
|
|
575
|
+
identityPoolId: aws_cognito_identity_pool_id,
|
|
576
|
+
allowGuestAccess: aws_mandatory_sign_in !== 'enable',
|
|
577
|
+
signUpVerificationMethod: aws_cognito_sign_up_verification_method,
|
|
578
|
+
userAttributes,
|
|
579
|
+
userPoolClientId: aws_user_pools_web_client_id,
|
|
580
|
+
userPoolId: aws_user_pools_id,
|
|
581
|
+
mfa: mfaConfig,
|
|
582
|
+
passwordFormat: passwordFormatConfig,
|
|
583
|
+
loginWith: {
|
|
584
|
+
username: !(loginWithEmailEnabled || loginWithPhoneEnabled),
|
|
585
|
+
email: loginWithEmailEnabled,
|
|
586
|
+
phone: loginWithPhoneEnabled,
|
|
587
|
+
},
|
|
588
|
+
},
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
const hasOAuthConfig = oauth ? Object.keys(oauth).length > 0 : false;
|
|
592
|
+
const hasSocialProviderConfig = aws_cognito_social_providers
|
|
593
|
+
? aws_cognito_social_providers.length > 0
|
|
594
|
+
: false;
|
|
595
|
+
if (amplifyConfig.Auth && hasOAuthConfig) {
|
|
596
|
+
amplifyConfig.Auth.Cognito.loginWith = {
|
|
597
|
+
...amplifyConfig.Auth.Cognito.loginWith,
|
|
598
|
+
oauth: {
|
|
599
|
+
...getOAuthConfig(oauth),
|
|
600
|
+
...(hasSocialProviderConfig && {
|
|
601
|
+
providers: parseSocialProviders(aws_cognito_social_providers),
|
|
602
|
+
}),
|
|
603
|
+
},
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
// Storage
|
|
607
|
+
if (aws_user_files_s3_bucket) {
|
|
608
|
+
amplifyConfig.Storage = {
|
|
609
|
+
S3: {
|
|
610
|
+
bucket: aws_user_files_s3_bucket,
|
|
611
|
+
region: aws_user_files_s3_bucket_region,
|
|
612
|
+
dangerouslyConnectToHttpEndpointForTesting: aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing,
|
|
613
|
+
},
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
// Geo
|
|
617
|
+
if (geo) {
|
|
618
|
+
const { amazon_location_service } = geo;
|
|
619
|
+
amplifyConfig.Geo = {
|
|
620
|
+
LocationService: {
|
|
621
|
+
maps: amazon_location_service.maps,
|
|
622
|
+
geofenceCollections: amazon_location_service.geofenceCollections,
|
|
623
|
+
searchIndices: amazon_location_service.search_indices,
|
|
624
|
+
region: amazon_location_service.region,
|
|
625
|
+
},
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
// REST API
|
|
629
|
+
if (aws_cloud_logic_custom) {
|
|
630
|
+
amplifyConfig.API = {
|
|
631
|
+
...amplifyConfig.API,
|
|
632
|
+
REST: aws_cloud_logic_custom.reduce((acc, api) => {
|
|
633
|
+
const { name, endpoint, region, service } = api;
|
|
634
|
+
return {
|
|
635
|
+
...acc,
|
|
636
|
+
[name]: {
|
|
637
|
+
endpoint,
|
|
638
|
+
...(service ? { service } : undefined),
|
|
639
|
+
...(region ? { region } : undefined),
|
|
640
|
+
},
|
|
641
|
+
};
|
|
642
|
+
}, {}),
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
// Predictions
|
|
646
|
+
if (predictions) {
|
|
647
|
+
// map VoiceId from speechGenerator defaults to voiceId
|
|
648
|
+
const { VoiceId: voiceId } = predictions?.convert?.speechGenerator?.defaults ?? {};
|
|
649
|
+
amplifyConfig.Predictions = voiceId
|
|
650
|
+
? {
|
|
651
|
+
...predictions,
|
|
652
|
+
convert: {
|
|
653
|
+
...predictions.convert,
|
|
654
|
+
speechGenerator: {
|
|
655
|
+
...predictions.convert.speechGenerator,
|
|
656
|
+
defaults: { voiceId },
|
|
657
|
+
},
|
|
658
|
+
},
|
|
659
|
+
}
|
|
660
|
+
: predictions;
|
|
661
|
+
}
|
|
662
|
+
return amplifyConfig;
|
|
663
|
+
};
|
|
664
|
+
const getRedirectUrl = (redirectStr) => redirectStr?.split(',') ?? [];
|
|
665
|
+
const getOAuthConfig = ({ domain, scope, redirectSignIn, redirectSignOut, responseType, }) => ({
|
|
666
|
+
domain,
|
|
667
|
+
scopes: scope,
|
|
668
|
+
redirectSignIn: getRedirectUrl(redirectSignIn),
|
|
669
|
+
redirectSignOut: getRedirectUrl(redirectSignOut),
|
|
670
|
+
responseType,
|
|
671
|
+
});
|
|
672
|
+
const parseSocialProviders = (aws_cognito_social_providers) => {
|
|
673
|
+
return aws_cognito_social_providers.map((provider) => {
|
|
674
|
+
const updatedProvider = provider.toLowerCase();
|
|
675
|
+
return updatedProvider.charAt(0).toUpperCase() + updatedProvider.slice(1);
|
|
676
|
+
});
|
|
677
|
+
};
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
//# sourceMappingURL=parseAWSExports.mjs.map
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
/***/ }),
|
|
684
|
+
|
|
685
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/parseAmplifyOutputs.mjs":
|
|
686
|
+
/*!*************************************************************************!*\
|
|
687
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/parseAmplifyOutputs.mjs ***!
|
|
688
|
+
\*************************************************************************/
|
|
689
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
690
|
+
|
|
691
|
+
__webpack_require__.r(__webpack_exports__);
|
|
692
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
693
|
+
/* harmony export */ isAmplifyOutputs: () => (/* binding */ isAmplifyOutputs),
|
|
694
|
+
/* harmony export */ parseAmplifyOutputs: () => (/* binding */ parseAmplifyOutputs),
|
|
695
|
+
/* harmony export */ parseAnalytics: () => (/* binding */ parseAnalytics)
|
|
696
|
+
/* harmony export */ });
|
|
697
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
698
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
699
|
+
function isAmplifyOutputs(config) {
|
|
700
|
+
// version format initially will be '1' but is expected to be something like x.y where x is major and y minor version
|
|
701
|
+
const { version } = config;
|
|
702
|
+
if (!version) {
|
|
703
|
+
return false;
|
|
704
|
+
}
|
|
705
|
+
return version.startsWith('1');
|
|
706
|
+
}
|
|
707
|
+
function parseStorage(amplifyOutputsStorageProperties) {
|
|
708
|
+
if (!amplifyOutputsStorageProperties) {
|
|
709
|
+
return undefined;
|
|
710
|
+
}
|
|
711
|
+
const { bucket_name, aws_region, buckets } = amplifyOutputsStorageProperties;
|
|
712
|
+
return {
|
|
713
|
+
S3: {
|
|
714
|
+
bucket: bucket_name,
|
|
715
|
+
region: aws_region,
|
|
716
|
+
buckets: buckets && createBucketInfoMap(buckets),
|
|
717
|
+
},
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
function parseAuth(amplifyOutputsAuthProperties) {
|
|
721
|
+
if (!amplifyOutputsAuthProperties) {
|
|
722
|
+
return undefined;
|
|
723
|
+
}
|
|
724
|
+
const { user_pool_id, user_pool_client_id, identity_pool_id, password_policy, mfa_configuration, mfa_methods, unauthenticated_identities_enabled, oauth, username_attributes, standard_required_attributes, groups, } = amplifyOutputsAuthProperties;
|
|
725
|
+
const authConfig = {
|
|
726
|
+
Cognito: {
|
|
727
|
+
userPoolId: user_pool_id,
|
|
728
|
+
userPoolClientId: user_pool_client_id,
|
|
729
|
+
groups,
|
|
730
|
+
},
|
|
731
|
+
};
|
|
732
|
+
if (identity_pool_id) {
|
|
733
|
+
authConfig.Cognito = {
|
|
734
|
+
...authConfig.Cognito,
|
|
735
|
+
identityPoolId: identity_pool_id,
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
if (password_policy) {
|
|
739
|
+
authConfig.Cognito.passwordFormat = {
|
|
740
|
+
requireLowercase: password_policy.require_lowercase,
|
|
741
|
+
requireNumbers: password_policy.require_numbers,
|
|
742
|
+
requireUppercase: password_policy.require_uppercase,
|
|
743
|
+
requireSpecialCharacters: password_policy.require_symbols,
|
|
744
|
+
minLength: password_policy.min_length ?? 6,
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
if (mfa_configuration) {
|
|
748
|
+
authConfig.Cognito.mfa = {
|
|
749
|
+
status: getMfaStatus(mfa_configuration),
|
|
750
|
+
smsEnabled: mfa_methods?.includes('SMS'),
|
|
751
|
+
totpEnabled: mfa_methods?.includes('TOTP'),
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
if (unauthenticated_identities_enabled) {
|
|
755
|
+
authConfig.Cognito.allowGuestAccess = unauthenticated_identities_enabled;
|
|
756
|
+
}
|
|
757
|
+
if (oauth) {
|
|
758
|
+
authConfig.Cognito.loginWith = {
|
|
759
|
+
oauth: {
|
|
760
|
+
domain: oauth.domain,
|
|
761
|
+
redirectSignIn: oauth.redirect_sign_in_uri,
|
|
762
|
+
redirectSignOut: oauth.redirect_sign_out_uri,
|
|
763
|
+
responseType: oauth.response_type === 'token' ? 'token' : 'code',
|
|
764
|
+
scopes: oauth.scopes,
|
|
765
|
+
providers: getOAuthProviders(oauth.identity_providers),
|
|
766
|
+
},
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
if (username_attributes) {
|
|
770
|
+
authConfig.Cognito.loginWith = {
|
|
771
|
+
...authConfig.Cognito.loginWith,
|
|
772
|
+
email: username_attributes.includes('email'),
|
|
773
|
+
phone: username_attributes.includes('phone_number'),
|
|
774
|
+
// Signing in with a username is not currently supported in Gen2, this should always evaluate to false
|
|
775
|
+
username: username_attributes.includes('username'),
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
if (standard_required_attributes) {
|
|
779
|
+
authConfig.Cognito.userAttributes = standard_required_attributes.reduce((acc, curr) => ({ ...acc, [curr]: { required: true } }), {});
|
|
780
|
+
}
|
|
781
|
+
return authConfig;
|
|
782
|
+
}
|
|
783
|
+
function parseAnalytics(amplifyOutputsAnalyticsProperties) {
|
|
784
|
+
if (!amplifyOutputsAnalyticsProperties?.amazon_pinpoint) {
|
|
785
|
+
return undefined;
|
|
786
|
+
}
|
|
787
|
+
const { amazon_pinpoint } = amplifyOutputsAnalyticsProperties;
|
|
788
|
+
return {
|
|
789
|
+
Pinpoint: {
|
|
790
|
+
appId: amazon_pinpoint.app_id,
|
|
791
|
+
region: amazon_pinpoint.aws_region,
|
|
792
|
+
},
|
|
793
|
+
};
|
|
794
|
+
}
|
|
795
|
+
function parseGeo(amplifyOutputsAnalyticsProperties) {
|
|
796
|
+
if (!amplifyOutputsAnalyticsProperties) {
|
|
797
|
+
return undefined;
|
|
798
|
+
}
|
|
799
|
+
const { aws_region, geofence_collections, maps, search_indices } = amplifyOutputsAnalyticsProperties;
|
|
800
|
+
return {
|
|
801
|
+
LocationService: {
|
|
802
|
+
region: aws_region,
|
|
803
|
+
searchIndices: search_indices,
|
|
804
|
+
geofenceCollections: geofence_collections,
|
|
805
|
+
maps,
|
|
806
|
+
},
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
function parseData(amplifyOutputsDataProperties) {
|
|
810
|
+
if (!amplifyOutputsDataProperties) {
|
|
811
|
+
return undefined;
|
|
812
|
+
}
|
|
813
|
+
const { aws_region, default_authorization_type, url, api_key, model_introspection, } = amplifyOutputsDataProperties;
|
|
814
|
+
const GraphQL = {
|
|
815
|
+
endpoint: url,
|
|
816
|
+
defaultAuthMode: getGraphQLAuthMode(default_authorization_type),
|
|
817
|
+
region: aws_region,
|
|
818
|
+
apiKey: api_key,
|
|
819
|
+
modelIntrospection: model_introspection,
|
|
820
|
+
};
|
|
821
|
+
return {
|
|
822
|
+
GraphQL,
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
function parseCustom(amplifyOutputsCustomProperties) {
|
|
826
|
+
if (!amplifyOutputsCustomProperties?.events) {
|
|
827
|
+
return undefined;
|
|
828
|
+
}
|
|
829
|
+
const { url, aws_region, api_key, default_authorization_type } = amplifyOutputsCustomProperties.events;
|
|
830
|
+
const Events = {
|
|
831
|
+
endpoint: url,
|
|
832
|
+
defaultAuthMode: getGraphQLAuthMode(default_authorization_type),
|
|
833
|
+
region: aws_region,
|
|
834
|
+
apiKey: api_key,
|
|
835
|
+
};
|
|
836
|
+
return {
|
|
837
|
+
Events,
|
|
838
|
+
};
|
|
839
|
+
}
|
|
840
|
+
function parseNotifications(amplifyOutputsNotificationsProperties) {
|
|
841
|
+
if (!amplifyOutputsNotificationsProperties) {
|
|
842
|
+
return undefined;
|
|
843
|
+
}
|
|
844
|
+
const { aws_region, channels, amazon_pinpoint_app_id } = amplifyOutputsNotificationsProperties;
|
|
845
|
+
const hasInAppMessaging = channels.includes('IN_APP_MESSAGING');
|
|
846
|
+
const hasPushNotification = channels.includes('APNS') || channels.includes('FCM');
|
|
847
|
+
if (!(hasInAppMessaging || hasPushNotification)) {
|
|
848
|
+
return undefined;
|
|
849
|
+
}
|
|
850
|
+
// At this point, we know the Amplify outputs contains at least one supported channel
|
|
851
|
+
const notificationsConfig = {};
|
|
852
|
+
if (hasInAppMessaging) {
|
|
853
|
+
notificationsConfig.InAppMessaging = {
|
|
854
|
+
Pinpoint: {
|
|
855
|
+
appId: amazon_pinpoint_app_id,
|
|
856
|
+
region: aws_region,
|
|
857
|
+
},
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
if (hasPushNotification) {
|
|
861
|
+
notificationsConfig.PushNotification = {
|
|
862
|
+
Pinpoint: {
|
|
863
|
+
appId: amazon_pinpoint_app_id,
|
|
864
|
+
region: aws_region,
|
|
865
|
+
},
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
return notificationsConfig;
|
|
869
|
+
}
|
|
870
|
+
function parseAmplifyOutputs(amplifyOutputs) {
|
|
871
|
+
const resourcesConfig = {};
|
|
872
|
+
if (amplifyOutputs.storage) {
|
|
873
|
+
resourcesConfig.Storage = parseStorage(amplifyOutputs.storage);
|
|
874
|
+
}
|
|
875
|
+
if (amplifyOutputs.auth) {
|
|
876
|
+
resourcesConfig.Auth = parseAuth(amplifyOutputs.auth);
|
|
877
|
+
}
|
|
878
|
+
if (amplifyOutputs.analytics) {
|
|
879
|
+
resourcesConfig.Analytics = parseAnalytics(amplifyOutputs.analytics);
|
|
880
|
+
}
|
|
881
|
+
if (amplifyOutputs.geo) {
|
|
882
|
+
resourcesConfig.Geo = parseGeo(amplifyOutputs.geo);
|
|
883
|
+
}
|
|
884
|
+
if (amplifyOutputs.data) {
|
|
885
|
+
resourcesConfig.API = parseData(amplifyOutputs.data);
|
|
886
|
+
}
|
|
887
|
+
if (amplifyOutputs.custom) {
|
|
888
|
+
const customConfig = parseCustom(amplifyOutputs.custom);
|
|
889
|
+
if (customConfig && 'Events' in customConfig) {
|
|
890
|
+
resourcesConfig.API = { ...resourcesConfig.API, ...customConfig };
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
if (amplifyOutputs.notifications) {
|
|
894
|
+
resourcesConfig.Notifications = parseNotifications(amplifyOutputs.notifications);
|
|
895
|
+
}
|
|
896
|
+
return resourcesConfig;
|
|
897
|
+
}
|
|
898
|
+
const authModeNames = {
|
|
899
|
+
AMAZON_COGNITO_USER_POOLS: 'userPool',
|
|
900
|
+
API_KEY: 'apiKey',
|
|
901
|
+
AWS_IAM: 'iam',
|
|
902
|
+
AWS_LAMBDA: 'lambda',
|
|
903
|
+
OPENID_CONNECT: 'oidc',
|
|
904
|
+
};
|
|
905
|
+
function getGraphQLAuthMode(authType) {
|
|
906
|
+
return authModeNames[authType];
|
|
907
|
+
}
|
|
908
|
+
const providerNames = {
|
|
909
|
+
GOOGLE: 'Google',
|
|
910
|
+
LOGIN_WITH_AMAZON: 'Amazon',
|
|
911
|
+
FACEBOOK: 'Facebook',
|
|
912
|
+
SIGN_IN_WITH_APPLE: 'Apple',
|
|
913
|
+
};
|
|
914
|
+
function getOAuthProviders(providers = []) {
|
|
915
|
+
return providers.reduce((oAuthProviders, provider) => {
|
|
916
|
+
if (providerNames[provider] !== undefined) {
|
|
917
|
+
oAuthProviders.push(providerNames[provider]);
|
|
918
|
+
}
|
|
919
|
+
return oAuthProviders;
|
|
920
|
+
}, []);
|
|
921
|
+
}
|
|
922
|
+
function getMfaStatus(mfaConfiguration) {
|
|
923
|
+
if (mfaConfiguration === 'OPTIONAL')
|
|
924
|
+
return 'optional';
|
|
925
|
+
if (mfaConfiguration === 'REQUIRED')
|
|
926
|
+
return 'on';
|
|
927
|
+
return 'off';
|
|
928
|
+
}
|
|
929
|
+
function createBucketInfoMap(buckets) {
|
|
930
|
+
const mappedBuckets = {};
|
|
931
|
+
buckets.forEach(({ name, bucket_name: bucketName, aws_region: region, paths }) => {
|
|
932
|
+
if (name in mappedBuckets) {
|
|
933
|
+
throw new Error(`Duplicate friendly name found: ${name}. Name must be unique.`);
|
|
934
|
+
}
|
|
935
|
+
const sanitizedPaths = paths
|
|
936
|
+
? Object.entries(paths).reduce((acc, [key, value]) => {
|
|
937
|
+
if (value !== undefined) {
|
|
938
|
+
acc[key] = value;
|
|
939
|
+
}
|
|
940
|
+
return acc;
|
|
941
|
+
}, {})
|
|
942
|
+
: undefined;
|
|
943
|
+
mappedBuckets[name] = {
|
|
944
|
+
bucketName,
|
|
945
|
+
region,
|
|
946
|
+
paths: sanitizedPaths,
|
|
947
|
+
};
|
|
948
|
+
});
|
|
949
|
+
return mappedBuckets;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
//# sourceMappingURL=parseAmplifyOutputs.mjs.map
|
|
954
|
+
|
|
955
|
+
|
|
956
|
+
/***/ }),
|
|
957
|
+
|
|
958
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/singleton/Amplify.mjs":
|
|
959
|
+
/*!***********************************************************************!*\
|
|
960
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/singleton/Amplify.mjs ***!
|
|
961
|
+
\***********************************************************************/
|
|
962
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
963
|
+
|
|
964
|
+
__webpack_require__.r(__webpack_exports__);
|
|
965
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
966
|
+
/* harmony export */ Amplify: () => (/* binding */ Amplify),
|
|
967
|
+
/* harmony export */ AmplifyClass: () => (/* binding */ AmplifyClass)
|
|
968
|
+
/* harmony export */ });
|
|
969
|
+
/* harmony import */ var _Hub_index_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Hub/index.mjs */ "./node_modules/@aws-amplify/core/dist/esm/Hub/index.mjs");
|
|
970
|
+
/* harmony import */ var _utils_deepFreeze_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/deepFreeze.mjs */ "./node_modules/@aws-amplify/core/dist/esm/utils/deepFreeze.mjs");
|
|
971
|
+
/* harmony import */ var _constants_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./constants.mjs */ "./node_modules/@aws-amplify/core/dist/esm/singleton/constants.mjs");
|
|
972
|
+
/* harmony import */ var _utils_parseAmplifyConfig_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/parseAmplifyConfig.mjs */ "./node_modules/@aws-amplify/core/dist/esm/utils/parseAmplifyConfig.mjs");
|
|
973
|
+
/* 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");
|
|
974
|
+
/* 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");
|
|
975
|
+
/* harmony import */ var _Auth_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Auth/index.mjs */ "./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/index.mjs");
|
|
976
|
+
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
997
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
998
|
+
class AmplifyClass {
|
|
999
|
+
constructor() {
|
|
1000
|
+
this.oAuthListener = undefined;
|
|
1001
|
+
this.isConfigured = false;
|
|
1002
|
+
this.resourcesConfig = {};
|
|
1003
|
+
this.libraryOptions = {};
|
|
1004
|
+
this.Auth = new _Auth_index_mjs__WEBPACK_IMPORTED_MODULE_2__.AuthClass();
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* Configures Amplify for use with your back-end resources.
|
|
1008
|
+
*
|
|
1009
|
+
* @remarks
|
|
1010
|
+
* This API does not perform any merging of either `resourcesConfig` or `libraryOptions`. The most recently
|
|
1011
|
+
* provided values will be used after configuration.
|
|
1012
|
+
*
|
|
1013
|
+
* @remarks
|
|
1014
|
+
* `configure` can be used to specify additional library options where available for supported categories.
|
|
1015
|
+
*
|
|
1016
|
+
* @param resourceConfig - Back-end resource configuration. Typically provided via the `aws-exports.js` file.
|
|
1017
|
+
* @param libraryOptions - Additional options for customizing the behavior of the library.
|
|
1018
|
+
*/
|
|
1019
|
+
configure(resourcesConfig, libraryOptions) {
|
|
1020
|
+
const resolvedResourceConfig = (0,_utils_parseAmplifyConfig_mjs__WEBPACK_IMPORTED_MODULE_3__.parseAmplifyConfig)(resourcesConfig);
|
|
1021
|
+
this.resourcesConfig = resolvedResourceConfig;
|
|
1022
|
+
if (libraryOptions) {
|
|
1023
|
+
this.libraryOptions = libraryOptions;
|
|
1024
|
+
}
|
|
1025
|
+
// Make resource config immutable
|
|
1026
|
+
this.resourcesConfig = (0,_utils_deepFreeze_mjs__WEBPACK_IMPORTED_MODULE_4__.deepFreeze)(this.resourcesConfig);
|
|
1027
|
+
this.Auth.configure(this.resourcesConfig.Auth, this.libraryOptions.Auth);
|
|
1028
|
+
_Hub_index_mjs__WEBPACK_IMPORTED_MODULE_5__.Hub.dispatch('core', {
|
|
1029
|
+
event: 'configure',
|
|
1030
|
+
data: this.resourcesConfig,
|
|
1031
|
+
}, 'Configure', _Hub_index_mjs__WEBPACK_IMPORTED_MODULE_5__.AMPLIFY_SYMBOL);
|
|
1032
|
+
this.notifyOAuthListener();
|
|
1033
|
+
this.isConfigured = true;
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* Provides access to the current back-end resource configuration for the Library.
|
|
1037
|
+
*
|
|
1038
|
+
* @returns Returns the immutable back-end resource configuration.
|
|
1039
|
+
*/
|
|
1040
|
+
getConfig() {
|
|
1041
|
+
if (!this.isConfigured) {
|
|
1042
|
+
// eslint-disable-next-line no-console
|
|
1043
|
+
console.warn(`Amplify has not been configured. Please call Amplify.configure() before using this service.`);
|
|
1044
|
+
}
|
|
1045
|
+
return this.resourcesConfig;
|
|
1046
|
+
}
|
|
1047
|
+
/** @internal */
|
|
1048
|
+
[_constants_mjs__WEBPACK_IMPORTED_MODULE_6__.ADD_OAUTH_LISTENER](listener) {
|
|
1049
|
+
if (this.resourcesConfig.Auth?.Cognito.loginWith?.oauth) {
|
|
1050
|
+
// when Amplify has been configured with a valid OAuth config while adding the listener, run it directly
|
|
1051
|
+
listener(this.resourcesConfig.Auth?.Cognito);
|
|
1052
|
+
}
|
|
1053
|
+
else {
|
|
1054
|
+
// otherwise register the listener and run it later when Amplify gets configured with a valid oauth config
|
|
1055
|
+
this.oAuthListener = listener;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
notifyOAuthListener() {
|
|
1059
|
+
if (!this.resourcesConfig.Auth?.Cognito.loginWith?.oauth ||
|
|
1060
|
+
!this.oAuthListener) {
|
|
1061
|
+
return;
|
|
1062
|
+
}
|
|
1063
|
+
this.oAuthListener(this.resourcesConfig.Auth?.Cognito);
|
|
1064
|
+
// the listener should only be notified once with a valid oauth config
|
|
1065
|
+
this.oAuthListener = undefined;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
/**
|
|
1069
|
+
* The `Amplify` utility is used to configure the library.
|
|
1070
|
+
*
|
|
1071
|
+
* @remarks
|
|
1072
|
+
* `Amplify` orchestrates cross-category communication within the library.
|
|
1073
|
+
*/
|
|
1074
|
+
const Amplify = new AmplifyClass();
|
|
1075
|
+
|
|
1076
|
+
|
|
1077
|
+
//# sourceMappingURL=Amplify.mjs.map
|
|
1078
|
+
|
|
1079
|
+
|
|
1080
|
+
/***/ }),
|
|
1081
|
+
|
|
1082
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/index.mjs":
|
|
1083
|
+
/*!**************************************************************************!*\
|
|
1084
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/singleton/Auth/index.mjs ***!
|
|
1085
|
+
\**************************************************************************/
|
|
1086
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1087
|
+
|
|
1088
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1089
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1090
|
+
/* harmony export */ AuthClass: () => (/* binding */ AuthClass)
|
|
1091
|
+
/* harmony export */ });
|
|
1092
|
+
/* 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");
|
|
1093
|
+
|
|
1094
|
+
|
|
1095
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1096
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1097
|
+
const logger = new _Logger_ConsoleLogger_mjs__WEBPACK_IMPORTED_MODULE_0__.ConsoleLogger('Auth');
|
|
1098
|
+
class AuthClass {
|
|
1099
|
+
/**
|
|
1100
|
+
* Configure Auth category
|
|
1101
|
+
*
|
|
1102
|
+
* @internal
|
|
1103
|
+
*
|
|
1104
|
+
* @param authResourcesConfig - Resources configurations required by Auth providers.
|
|
1105
|
+
* @param authOptions - Client options used by library
|
|
1106
|
+
*
|
|
1107
|
+
* @returns void
|
|
1108
|
+
*/
|
|
1109
|
+
configure(authResourcesConfig, authOptions) {
|
|
1110
|
+
this.authConfig = authResourcesConfig;
|
|
1111
|
+
this.authOptions = authOptions;
|
|
1112
|
+
if (authResourcesConfig && authResourcesConfig.Cognito?.userPoolEndpoint) {
|
|
1113
|
+
logger.warn(getCustomEndpointWarningMessage('Amazon Cognito User Pool'));
|
|
1114
|
+
}
|
|
1115
|
+
if (authResourcesConfig &&
|
|
1116
|
+
authResourcesConfig.Cognito?.identityPoolEndpoint) {
|
|
1117
|
+
logger.warn(getCustomEndpointWarningMessage('Amazon Cognito Identity Pool'));
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
/**
|
|
1121
|
+
* Fetch the auth tokens, and the temporary AWS credentials and identity if they are configured. By default it
|
|
1122
|
+
* will automatically refresh expired auth tokens if a valid refresh token is present. You can force a refresh
|
|
1123
|
+
* of non-expired tokens with `{ forceRefresh: true }` input.
|
|
1124
|
+
*
|
|
1125
|
+
* @param options - Options configuring the fetch behavior.
|
|
1126
|
+
*
|
|
1127
|
+
* @returns Promise of current auth session {@link AuthSession}.
|
|
1128
|
+
*/
|
|
1129
|
+
async fetchAuthSession(options = {}) {
|
|
1130
|
+
let credentialsAndIdentityId;
|
|
1131
|
+
let userSub;
|
|
1132
|
+
// Get tokens will throw if session cannot be refreshed (network or service error) or return null if not available
|
|
1133
|
+
const tokens = await this.getTokens(options);
|
|
1134
|
+
if (tokens) {
|
|
1135
|
+
userSub = tokens.accessToken?.payload?.sub;
|
|
1136
|
+
// getCredentialsAndIdentityId will throw if cannot get credentials (network or service error)
|
|
1137
|
+
credentialsAndIdentityId =
|
|
1138
|
+
await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({
|
|
1139
|
+
authConfig: this.authConfig,
|
|
1140
|
+
tokens,
|
|
1141
|
+
authenticated: true,
|
|
1142
|
+
forceRefresh: options.forceRefresh,
|
|
1143
|
+
});
|
|
1144
|
+
}
|
|
1145
|
+
else {
|
|
1146
|
+
// getCredentialsAndIdentityId will throw if cannot get credentials (network or service error)
|
|
1147
|
+
credentialsAndIdentityId =
|
|
1148
|
+
await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({
|
|
1149
|
+
authConfig: this.authConfig,
|
|
1150
|
+
authenticated: false,
|
|
1151
|
+
forceRefresh: options.forceRefresh,
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
return {
|
|
1155
|
+
tokens,
|
|
1156
|
+
credentials: credentialsAndIdentityId?.credentials,
|
|
1157
|
+
identityId: credentialsAndIdentityId?.identityId,
|
|
1158
|
+
userSub,
|
|
1159
|
+
};
|
|
1160
|
+
}
|
|
1161
|
+
async clearCredentials() {
|
|
1162
|
+
await this.authOptions?.credentialsProvider?.clearCredentialsAndIdentityId();
|
|
1163
|
+
}
|
|
1164
|
+
async getTokens(options) {
|
|
1165
|
+
return ((await this.authOptions?.tokenProvider?.getTokens(options)) ?? undefined);
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
const getCustomEndpointWarningMessage = (target) => `You are using a custom Amazon ${target} endpoint, ensure the endpoint is correct.`;
|
|
1169
|
+
|
|
1170
|
+
|
|
1171
|
+
//# sourceMappingURL=index.mjs.map
|
|
1172
|
+
|
|
1173
|
+
|
|
1174
|
+
/***/ }),
|
|
1175
|
+
|
|
1176
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/singleton/constants.mjs":
|
|
1177
|
+
/*!*************************************************************************!*\
|
|
1178
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/singleton/constants.mjs ***!
|
|
1179
|
+
\*************************************************************************/
|
|
1180
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1181
|
+
|
|
1182
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1183
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1184
|
+
/* harmony export */ ADD_OAUTH_LISTENER: () => (/* binding */ ADD_OAUTH_LISTENER)
|
|
1185
|
+
/* harmony export */ });
|
|
1186
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1187
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1188
|
+
const ADD_OAUTH_LISTENER = Symbol('oauth-listener');
|
|
1189
|
+
|
|
1190
|
+
|
|
1191
|
+
//# sourceMappingURL=constants.mjs.map
|
|
1192
|
+
|
|
1193
|
+
|
|
1194
|
+
/***/ }),
|
|
1195
|
+
|
|
1196
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/utils/deepFreeze.mjs":
|
|
1197
|
+
/*!**********************************************************************!*\
|
|
1198
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/utils/deepFreeze.mjs ***!
|
|
1199
|
+
\**********************************************************************/
|
|
1200
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1201
|
+
|
|
1202
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1203
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1204
|
+
/* harmony export */ deepFreeze: () => (/* binding */ deepFreeze)
|
|
1205
|
+
/* harmony export */ });
|
|
1206
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1207
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1208
|
+
const deepFreeze = (object) => {
|
|
1209
|
+
const propNames = Reflect.ownKeys(object);
|
|
1210
|
+
for (const name of propNames) {
|
|
1211
|
+
const value = object[name];
|
|
1212
|
+
if ((value && typeof value === 'object') || typeof value === 'function') {
|
|
1213
|
+
deepFreeze(value);
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
return Object.freeze(object);
|
|
1217
|
+
};
|
|
1218
|
+
|
|
1219
|
+
|
|
1220
|
+
//# sourceMappingURL=deepFreeze.mjs.map
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
/***/ }),
|
|
1224
|
+
|
|
1225
|
+
/***/ "./node_modules/@aws-amplify/core/dist/esm/utils/parseAmplifyConfig.mjs":
|
|
1226
|
+
/*!******************************************************************************!*\
|
|
1227
|
+
!*** ./node_modules/@aws-amplify/core/dist/esm/utils/parseAmplifyConfig.mjs ***!
|
|
1228
|
+
\******************************************************************************/
|
|
1229
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1230
|
+
|
|
1231
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1232
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1233
|
+
/* harmony export */ parseAmplifyConfig: () => (/* binding */ parseAmplifyConfig)
|
|
1234
|
+
/* harmony export */ });
|
|
1235
|
+
/* harmony import */ var _parseAWSExports_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseAWSExports.mjs */ "./node_modules/@aws-amplify/core/dist/esm/parseAWSExports.mjs");
|
|
1236
|
+
/* harmony import */ var _parseAmplifyOutputs_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../parseAmplifyOutputs.mjs */ "./node_modules/@aws-amplify/core/dist/esm/parseAmplifyOutputs.mjs");
|
|
1237
|
+
|
|
1238
|
+
|
|
1239
|
+
|
|
1240
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1241
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1242
|
+
/**
|
|
1243
|
+
* Parses the variety of configuration shapes that Amplify can accept into a ResourcesConfig.
|
|
1244
|
+
*
|
|
1245
|
+
* @param amplifyConfig An Amplify configuration object conforming to one of the supported schemas.
|
|
1246
|
+
* @return A ResourcesConfig for the provided configuration object.
|
|
1247
|
+
*/
|
|
1248
|
+
const parseAmplifyConfig = (amplifyConfig) => {
|
|
1249
|
+
if (Object.keys(amplifyConfig).some(key => key.startsWith('aws_'))) {
|
|
1250
|
+
return (0,_parseAWSExports_mjs__WEBPACK_IMPORTED_MODULE_0__.parseAWSExports)(amplifyConfig);
|
|
1251
|
+
}
|
|
1252
|
+
else if ((0,_parseAmplifyOutputs_mjs__WEBPACK_IMPORTED_MODULE_1__.isAmplifyOutputs)(amplifyConfig)) {
|
|
1253
|
+
return (0,_parseAmplifyOutputs_mjs__WEBPACK_IMPORTED_MODULE_1__.parseAmplifyOutputs)(amplifyConfig);
|
|
1254
|
+
}
|
|
1255
|
+
else {
|
|
1256
|
+
return amplifyConfig;
|
|
1257
|
+
}
|
|
1258
|
+
};
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
//# sourceMappingURL=parseAmplifyConfig.mjs.map
|
|
1262
|
+
|
|
1263
|
+
|
|
1264
|
+
/***/ }),
|
|
1265
|
+
|
|
1266
|
+
/***/ "./node_modules/@aws-amplify/core/node_modules/@smithy/util-hex-encoding/dist-es/index.js":
|
|
1267
|
+
/*!************************************************************************************************!*\
|
|
1268
|
+
!*** ./node_modules/@aws-amplify/core/node_modules/@smithy/util-hex-encoding/dist-es/index.js ***!
|
|
1269
|
+
\************************************************************************************************/
|
|
1270
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1271
|
+
|
|
1272
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1273
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1274
|
+
/* harmony export */ fromHex: () => (/* binding */ fromHex),
|
|
1275
|
+
/* harmony export */ toHex: () => (/* binding */ toHex)
|
|
1276
|
+
/* harmony export */ });
|
|
1277
|
+
const SHORT_TO_HEX = {};
|
|
1278
|
+
const HEX_TO_SHORT = {};
|
|
1279
|
+
for (let i = 0; i < 256; i++) {
|
|
1280
|
+
let encodedByte = i.toString(16).toLowerCase();
|
|
1281
|
+
if (encodedByte.length === 1) {
|
|
1282
|
+
encodedByte = `0${encodedByte}`;
|
|
1283
|
+
}
|
|
1284
|
+
SHORT_TO_HEX[i] = encodedByte;
|
|
1285
|
+
HEX_TO_SHORT[encodedByte] = i;
|
|
1286
|
+
}
|
|
1287
|
+
function fromHex(encoded) {
|
|
1288
|
+
if (encoded.length % 2 !== 0) {
|
|
1289
|
+
throw new Error("Hex encoded strings must have an even number length");
|
|
1290
|
+
}
|
|
1291
|
+
const out = new Uint8Array(encoded.length / 2);
|
|
1292
|
+
for (let i = 0; i < encoded.length; i += 2) {
|
|
1293
|
+
const encodedByte = encoded.slice(i, i + 2).toLowerCase();
|
|
1294
|
+
if (encodedByte in HEX_TO_SHORT) {
|
|
1295
|
+
out[i / 2] = HEX_TO_SHORT[encodedByte];
|
|
1296
|
+
}
|
|
1297
|
+
else {
|
|
1298
|
+
throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`);
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
return out;
|
|
1302
|
+
}
|
|
1303
|
+
function toHex(bytes) {
|
|
1304
|
+
let out = "";
|
|
1305
|
+
for (let i = 0; i < bytes.byteLength; i++) {
|
|
1306
|
+
out += SHORT_TO_HEX[bytes[i]];
|
|
1307
|
+
}
|
|
1308
|
+
return out;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
|
|
1312
|
+
/***/ }),
|
|
1313
|
+
|
|
1314
|
+
/***/ "./node_modules/@aws-crypto/sha256-js/build/module/RawSha256.js":
|
|
1315
|
+
/*!**********************************************************************!*\
|
|
1316
|
+
!*** ./node_modules/@aws-crypto/sha256-js/build/module/RawSha256.js ***!
|
|
1317
|
+
\**********************************************************************/
|
|
1318
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1319
|
+
|
|
1320
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1321
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1322
|
+
/* harmony export */ RawSha256: () => (/* binding */ RawSha256)
|
|
1323
|
+
/* harmony export */ });
|
|
1324
|
+
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./node_modules/@aws-crypto/sha256-js/build/module/constants.js");
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* @internal
|
|
1328
|
+
*/
|
|
1329
|
+
var RawSha256 = /** @class */ (function () {
|
|
1330
|
+
function RawSha256() {
|
|
1331
|
+
this.state = Int32Array.from(_constants__WEBPACK_IMPORTED_MODULE_0__.INIT);
|
|
1332
|
+
this.temp = new Int32Array(64);
|
|
1333
|
+
this.buffer = new Uint8Array(64);
|
|
1334
|
+
this.bufferLength = 0;
|
|
1335
|
+
this.bytesHashed = 0;
|
|
1336
|
+
/**
|
|
1337
|
+
* @internal
|
|
1338
|
+
*/
|
|
1339
|
+
this.finished = false;
|
|
1340
|
+
}
|
|
1341
|
+
RawSha256.prototype.update = function (data) {
|
|
1342
|
+
if (this.finished) {
|
|
1343
|
+
throw new Error("Attempted to update an already finished hash.");
|
|
1344
|
+
}
|
|
1345
|
+
var position = 0;
|
|
1346
|
+
var byteLength = data.byteLength;
|
|
1347
|
+
this.bytesHashed += byteLength;
|
|
1348
|
+
if (this.bytesHashed * 8 > _constants__WEBPACK_IMPORTED_MODULE_0__.MAX_HASHABLE_LENGTH) {
|
|
1349
|
+
throw new Error("Cannot hash more than 2^53 - 1 bits");
|
|
1350
|
+
}
|
|
1351
|
+
while (byteLength > 0) {
|
|
1352
|
+
this.buffer[this.bufferLength++] = data[position++];
|
|
1353
|
+
byteLength--;
|
|
1354
|
+
if (this.bufferLength === _constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE) {
|
|
1355
|
+
this.hashBuffer();
|
|
1356
|
+
this.bufferLength = 0;
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
};
|
|
1360
|
+
RawSha256.prototype.digest = function () {
|
|
1361
|
+
if (!this.finished) {
|
|
1362
|
+
var bitsHashed = this.bytesHashed * 8;
|
|
1363
|
+
var bufferView = new DataView(this.buffer.buffer, this.buffer.byteOffset, this.buffer.byteLength);
|
|
1364
|
+
var undecoratedLength = this.bufferLength;
|
|
1365
|
+
bufferView.setUint8(this.bufferLength++, 0x80);
|
|
1366
|
+
// Ensure the final block has enough room for the hashed length
|
|
1367
|
+
if (undecoratedLength % _constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE >= _constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE - 8) {
|
|
1368
|
+
for (var i = this.bufferLength; i < _constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE; i++) {
|
|
1369
|
+
bufferView.setUint8(i, 0);
|
|
1370
|
+
}
|
|
1371
|
+
this.hashBuffer();
|
|
1372
|
+
this.bufferLength = 0;
|
|
1373
|
+
}
|
|
1374
|
+
for (var i = this.bufferLength; i < _constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE - 8; i++) {
|
|
1375
|
+
bufferView.setUint8(i, 0);
|
|
1376
|
+
}
|
|
1377
|
+
bufferView.setUint32(_constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE - 8, Math.floor(bitsHashed / 0x100000000), true);
|
|
1378
|
+
bufferView.setUint32(_constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE - 4, bitsHashed);
|
|
1379
|
+
this.hashBuffer();
|
|
1380
|
+
this.finished = true;
|
|
1381
|
+
}
|
|
1382
|
+
// The value in state is little-endian rather than big-endian, so flip
|
|
1383
|
+
// each word into a new Uint8Array
|
|
1384
|
+
var out = new Uint8Array(_constants__WEBPACK_IMPORTED_MODULE_0__.DIGEST_LENGTH);
|
|
1385
|
+
for (var i = 0; i < 8; i++) {
|
|
1386
|
+
out[i * 4] = (this.state[i] >>> 24) & 0xff;
|
|
1387
|
+
out[i * 4 + 1] = (this.state[i] >>> 16) & 0xff;
|
|
1388
|
+
out[i * 4 + 2] = (this.state[i] >>> 8) & 0xff;
|
|
1389
|
+
out[i * 4 + 3] = (this.state[i] >>> 0) & 0xff;
|
|
1390
|
+
}
|
|
1391
|
+
return out;
|
|
1392
|
+
};
|
|
1393
|
+
RawSha256.prototype.hashBuffer = function () {
|
|
1394
|
+
var _a = this, buffer = _a.buffer, state = _a.state;
|
|
1395
|
+
var state0 = state[0], state1 = state[1], state2 = state[2], state3 = state[3], state4 = state[4], state5 = state[5], state6 = state[6], state7 = state[7];
|
|
1396
|
+
for (var i = 0; i < _constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE; i++) {
|
|
1397
|
+
if (i < 16) {
|
|
1398
|
+
this.temp[i] =
|
|
1399
|
+
((buffer[i * 4] & 0xff) << 24) |
|
|
1400
|
+
((buffer[i * 4 + 1] & 0xff) << 16) |
|
|
1401
|
+
((buffer[i * 4 + 2] & 0xff) << 8) |
|
|
1402
|
+
(buffer[i * 4 + 3] & 0xff);
|
|
1403
|
+
}
|
|
1404
|
+
else {
|
|
1405
|
+
var u = this.temp[i - 2];
|
|
1406
|
+
var t1_1 = ((u >>> 17) | (u << 15)) ^ ((u >>> 19) | (u << 13)) ^ (u >>> 10);
|
|
1407
|
+
u = this.temp[i - 15];
|
|
1408
|
+
var t2_1 = ((u >>> 7) | (u << 25)) ^ ((u >>> 18) | (u << 14)) ^ (u >>> 3);
|
|
1409
|
+
this.temp[i] =
|
|
1410
|
+
((t1_1 + this.temp[i - 7]) | 0) + ((t2_1 + this.temp[i - 16]) | 0);
|
|
1411
|
+
}
|
|
1412
|
+
var t1 = ((((((state4 >>> 6) | (state4 << 26)) ^
|
|
1413
|
+
((state4 >>> 11) | (state4 << 21)) ^
|
|
1414
|
+
((state4 >>> 25) | (state4 << 7))) +
|
|
1415
|
+
((state4 & state5) ^ (~state4 & state6))) |
|
|
1416
|
+
0) +
|
|
1417
|
+
((state7 + ((_constants__WEBPACK_IMPORTED_MODULE_0__.KEY[i] + this.temp[i]) | 0)) | 0)) |
|
|
1418
|
+
0;
|
|
1419
|
+
var t2 = ((((state0 >>> 2) | (state0 << 30)) ^
|
|
1420
|
+
((state0 >>> 13) | (state0 << 19)) ^
|
|
1421
|
+
((state0 >>> 22) | (state0 << 10))) +
|
|
1422
|
+
((state0 & state1) ^ (state0 & state2) ^ (state1 & state2))) |
|
|
1423
|
+
0;
|
|
1424
|
+
state7 = state6;
|
|
1425
|
+
state6 = state5;
|
|
1426
|
+
state5 = state4;
|
|
1427
|
+
state4 = (state3 + t1) | 0;
|
|
1428
|
+
state3 = state2;
|
|
1429
|
+
state2 = state1;
|
|
1430
|
+
state1 = state0;
|
|
1431
|
+
state0 = (t1 + t2) | 0;
|
|
1432
|
+
}
|
|
1433
|
+
state[0] += state0;
|
|
1434
|
+
state[1] += state1;
|
|
1435
|
+
state[2] += state2;
|
|
1436
|
+
state[3] += state3;
|
|
1437
|
+
state[4] += state4;
|
|
1438
|
+
state[5] += state5;
|
|
1439
|
+
state[6] += state6;
|
|
1440
|
+
state[7] += state7;
|
|
1441
|
+
};
|
|
1442
|
+
return RawSha256;
|
|
1443
|
+
}());
|
|
1444
|
+
|
|
1445
|
+
|
|
1446
|
+
|
|
1447
|
+
/***/ }),
|
|
1448
|
+
|
|
1449
|
+
/***/ "./node_modules/@aws-crypto/sha256-js/build/module/constants.js":
|
|
1450
|
+
/*!**********************************************************************!*\
|
|
1451
|
+
!*** ./node_modules/@aws-crypto/sha256-js/build/module/constants.js ***!
|
|
1452
|
+
\**********************************************************************/
|
|
1453
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1454
|
+
|
|
1455
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1456
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1457
|
+
/* harmony export */ BLOCK_SIZE: () => (/* binding */ BLOCK_SIZE),
|
|
1458
|
+
/* harmony export */ DIGEST_LENGTH: () => (/* binding */ DIGEST_LENGTH),
|
|
1459
|
+
/* harmony export */ INIT: () => (/* binding */ INIT),
|
|
1460
|
+
/* harmony export */ KEY: () => (/* binding */ KEY),
|
|
1461
|
+
/* harmony export */ MAX_HASHABLE_LENGTH: () => (/* binding */ MAX_HASHABLE_LENGTH)
|
|
1462
|
+
/* harmony export */ });
|
|
1463
|
+
/**
|
|
1464
|
+
* @internal
|
|
1465
|
+
*/
|
|
1466
|
+
var BLOCK_SIZE = 64;
|
|
1467
|
+
/**
|
|
1468
|
+
* @internal
|
|
1469
|
+
*/
|
|
1470
|
+
var DIGEST_LENGTH = 32;
|
|
1471
|
+
/**
|
|
1472
|
+
* @internal
|
|
1473
|
+
*/
|
|
1474
|
+
var KEY = new Uint32Array([
|
|
1475
|
+
0x428a2f98,
|
|
1476
|
+
0x71374491,
|
|
1477
|
+
0xb5c0fbcf,
|
|
1478
|
+
0xe9b5dba5,
|
|
1479
|
+
0x3956c25b,
|
|
1480
|
+
0x59f111f1,
|
|
1481
|
+
0x923f82a4,
|
|
1482
|
+
0xab1c5ed5,
|
|
1483
|
+
0xd807aa98,
|
|
1484
|
+
0x12835b01,
|
|
1485
|
+
0x243185be,
|
|
1486
|
+
0x550c7dc3,
|
|
1487
|
+
0x72be5d74,
|
|
1488
|
+
0x80deb1fe,
|
|
1489
|
+
0x9bdc06a7,
|
|
1490
|
+
0xc19bf174,
|
|
1491
|
+
0xe49b69c1,
|
|
1492
|
+
0xefbe4786,
|
|
1493
|
+
0x0fc19dc6,
|
|
1494
|
+
0x240ca1cc,
|
|
1495
|
+
0x2de92c6f,
|
|
1496
|
+
0x4a7484aa,
|
|
1497
|
+
0x5cb0a9dc,
|
|
1498
|
+
0x76f988da,
|
|
1499
|
+
0x983e5152,
|
|
1500
|
+
0xa831c66d,
|
|
1501
|
+
0xb00327c8,
|
|
1502
|
+
0xbf597fc7,
|
|
1503
|
+
0xc6e00bf3,
|
|
1504
|
+
0xd5a79147,
|
|
1505
|
+
0x06ca6351,
|
|
1506
|
+
0x14292967,
|
|
1507
|
+
0x27b70a85,
|
|
1508
|
+
0x2e1b2138,
|
|
1509
|
+
0x4d2c6dfc,
|
|
1510
|
+
0x53380d13,
|
|
1511
|
+
0x650a7354,
|
|
1512
|
+
0x766a0abb,
|
|
1513
|
+
0x81c2c92e,
|
|
1514
|
+
0x92722c85,
|
|
1515
|
+
0xa2bfe8a1,
|
|
1516
|
+
0xa81a664b,
|
|
1517
|
+
0xc24b8b70,
|
|
1518
|
+
0xc76c51a3,
|
|
1519
|
+
0xd192e819,
|
|
1520
|
+
0xd6990624,
|
|
1521
|
+
0xf40e3585,
|
|
1522
|
+
0x106aa070,
|
|
1523
|
+
0x19a4c116,
|
|
1524
|
+
0x1e376c08,
|
|
1525
|
+
0x2748774c,
|
|
1526
|
+
0x34b0bcb5,
|
|
1527
|
+
0x391c0cb3,
|
|
1528
|
+
0x4ed8aa4a,
|
|
1529
|
+
0x5b9cca4f,
|
|
1530
|
+
0x682e6ff3,
|
|
1531
|
+
0x748f82ee,
|
|
1532
|
+
0x78a5636f,
|
|
1533
|
+
0x84c87814,
|
|
1534
|
+
0x8cc70208,
|
|
1535
|
+
0x90befffa,
|
|
1536
|
+
0xa4506ceb,
|
|
1537
|
+
0xbef9a3f7,
|
|
1538
|
+
0xc67178f2
|
|
1539
|
+
]);
|
|
1540
|
+
/**
|
|
1541
|
+
* @internal
|
|
1542
|
+
*/
|
|
1543
|
+
var INIT = [
|
|
1544
|
+
0x6a09e667,
|
|
1545
|
+
0xbb67ae85,
|
|
1546
|
+
0x3c6ef372,
|
|
1547
|
+
0xa54ff53a,
|
|
1548
|
+
0x510e527f,
|
|
1549
|
+
0x9b05688c,
|
|
1550
|
+
0x1f83d9ab,
|
|
1551
|
+
0x5be0cd19
|
|
1552
|
+
];
|
|
1553
|
+
/**
|
|
1554
|
+
* @internal
|
|
1555
|
+
*/
|
|
1556
|
+
var MAX_HASHABLE_LENGTH = Math.pow(2, 53) - 1;
|
|
1557
|
+
|
|
1558
|
+
|
|
1559
|
+
/***/ }),
|
|
1560
|
+
|
|
1561
|
+
/***/ "./node_modules/@aws-crypto/sha256-js/build/module/index.js":
|
|
1562
|
+
/*!******************************************************************!*\
|
|
1563
|
+
!*** ./node_modules/@aws-crypto/sha256-js/build/module/index.js ***!
|
|
1564
|
+
\******************************************************************/
|
|
1565
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1566
|
+
|
|
1567
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1568
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1569
|
+
/* harmony export */ Sha256: () => (/* reexport safe */ _jsSha256__WEBPACK_IMPORTED_MODULE_0__.Sha256)
|
|
1570
|
+
/* harmony export */ });
|
|
1571
|
+
/* harmony import */ var _jsSha256__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jsSha256 */ "./node_modules/@aws-crypto/sha256-js/build/module/jsSha256.js");
|
|
1572
|
+
|
|
1573
|
+
|
|
1574
|
+
|
|
1575
|
+
/***/ }),
|
|
1576
|
+
|
|
1577
|
+
/***/ "./node_modules/@aws-crypto/sha256-js/build/module/jsSha256.js":
|
|
1578
|
+
/*!*********************************************************************!*\
|
|
1579
|
+
!*** ./node_modules/@aws-crypto/sha256-js/build/module/jsSha256.js ***!
|
|
1580
|
+
\*********************************************************************/
|
|
1581
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1582
|
+
|
|
1583
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1584
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1585
|
+
/* harmony export */ Sha256: () => (/* binding */ Sha256)
|
|
1586
|
+
/* harmony export */ });
|
|
1587
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.mjs");
|
|
1588
|
+
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./node_modules/@aws-crypto/sha256-js/build/module/constants.js");
|
|
1589
|
+
/* harmony import */ var _RawSha256__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RawSha256 */ "./node_modules/@aws-crypto/sha256-js/build/module/RawSha256.js");
|
|
1590
|
+
/* harmony import */ var _aws_crypto_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @aws-crypto/util */ "./node_modules/@aws-crypto/util/build/module/index.js");
|
|
1591
|
+
|
|
1592
|
+
|
|
1593
|
+
|
|
1594
|
+
|
|
1595
|
+
var Sha256 = /** @class */ (function () {
|
|
1596
|
+
function Sha256(secret) {
|
|
1597
|
+
this.secret = secret;
|
|
1598
|
+
this.hash = new _RawSha256__WEBPACK_IMPORTED_MODULE_1__.RawSha256();
|
|
1599
|
+
this.reset();
|
|
1600
|
+
}
|
|
1601
|
+
Sha256.prototype.update = function (toHash) {
|
|
1602
|
+
if ((0,_aws_crypto_util__WEBPACK_IMPORTED_MODULE_2__.isEmptyData)(toHash) || this.error) {
|
|
1603
|
+
return;
|
|
1604
|
+
}
|
|
1605
|
+
try {
|
|
1606
|
+
this.hash.update((0,_aws_crypto_util__WEBPACK_IMPORTED_MODULE_2__.convertToBuffer)(toHash));
|
|
1607
|
+
}
|
|
1608
|
+
catch (e) {
|
|
1609
|
+
this.error = e;
|
|
1610
|
+
}
|
|
1611
|
+
};
|
|
1612
|
+
/* This synchronous method keeps compatibility
|
|
1613
|
+
* with the v2 aws-sdk.
|
|
1614
|
+
*/
|
|
1615
|
+
Sha256.prototype.digestSync = function () {
|
|
1616
|
+
if (this.error) {
|
|
1617
|
+
throw this.error;
|
|
1618
|
+
}
|
|
1619
|
+
if (this.outer) {
|
|
1620
|
+
if (!this.outer.finished) {
|
|
1621
|
+
this.outer.update(this.hash.digest());
|
|
1622
|
+
}
|
|
1623
|
+
return this.outer.digest();
|
|
1624
|
+
}
|
|
1625
|
+
return this.hash.digest();
|
|
1626
|
+
};
|
|
1627
|
+
/* The underlying digest method here is synchronous.
|
|
1628
|
+
* To keep the same interface with the other hash functions
|
|
1629
|
+
* the default is to expose this as an async method.
|
|
1630
|
+
* However, it can sometimes be useful to have a sync method.
|
|
1631
|
+
*/
|
|
1632
|
+
Sha256.prototype.digest = function () {
|
|
1633
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__awaiter)(this, void 0, void 0, function () {
|
|
1634
|
+
return (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__generator)(this, function (_a) {
|
|
1635
|
+
return [2 /*return*/, this.digestSync()];
|
|
1636
|
+
});
|
|
1637
|
+
});
|
|
1638
|
+
};
|
|
1639
|
+
Sha256.prototype.reset = function () {
|
|
1640
|
+
this.hash = new _RawSha256__WEBPACK_IMPORTED_MODULE_1__.RawSha256();
|
|
1641
|
+
if (this.secret) {
|
|
1642
|
+
this.outer = new _RawSha256__WEBPACK_IMPORTED_MODULE_1__.RawSha256();
|
|
1643
|
+
var inner = bufferFromSecret(this.secret);
|
|
1644
|
+
var outer = new Uint8Array(_constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE);
|
|
1645
|
+
outer.set(inner);
|
|
1646
|
+
for (var i = 0; i < _constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE; i++) {
|
|
1647
|
+
inner[i] ^= 0x36;
|
|
1648
|
+
outer[i] ^= 0x5c;
|
|
1649
|
+
}
|
|
1650
|
+
this.hash.update(inner);
|
|
1651
|
+
this.outer.update(outer);
|
|
1652
|
+
// overwrite the copied key in memory
|
|
1653
|
+
for (var i = 0; i < inner.byteLength; i++) {
|
|
1654
|
+
inner[i] = 0;
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
};
|
|
1658
|
+
return Sha256;
|
|
1659
|
+
}());
|
|
1660
|
+
|
|
1661
|
+
function bufferFromSecret(secret) {
|
|
1662
|
+
var input = (0,_aws_crypto_util__WEBPACK_IMPORTED_MODULE_2__.convertToBuffer)(secret);
|
|
1663
|
+
if (input.byteLength > _constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE) {
|
|
1664
|
+
var bufferHash = new _RawSha256__WEBPACK_IMPORTED_MODULE_1__.RawSha256();
|
|
1665
|
+
bufferHash.update(input);
|
|
1666
|
+
input = bufferHash.digest();
|
|
1667
|
+
}
|
|
1668
|
+
var buffer = new Uint8Array(_constants__WEBPACK_IMPORTED_MODULE_0__.BLOCK_SIZE);
|
|
1669
|
+
buffer.set(input);
|
|
1670
|
+
return buffer;
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
|
|
1674
|
+
/***/ }),
|
|
1675
|
+
|
|
1676
|
+
/***/ "./node_modules/@aws-crypto/util/build/module/convertToBuffer.js":
|
|
1677
|
+
/*!***********************************************************************!*\
|
|
1678
|
+
!*** ./node_modules/@aws-crypto/util/build/module/convertToBuffer.js ***!
|
|
1679
|
+
\***********************************************************************/
|
|
1680
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1681
|
+
|
|
1682
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1683
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1684
|
+
/* harmony export */ convertToBuffer: () => (/* binding */ convertToBuffer)
|
|
1685
|
+
/* harmony export */ });
|
|
1686
|
+
/* harmony import */ var _smithy_util_utf8__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @smithy/util-utf8 */ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/index.js");
|
|
1687
|
+
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
|
|
1688
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1689
|
+
|
|
1690
|
+
// Quick polyfill
|
|
1691
|
+
var fromUtf8 = typeof Buffer !== "undefined" && Buffer.from
|
|
1692
|
+
? function (input) { return Buffer.from(input, "utf8"); }
|
|
1693
|
+
: _smithy_util_utf8__WEBPACK_IMPORTED_MODULE_0__.fromUtf8;
|
|
1694
|
+
function convertToBuffer(data) {
|
|
1695
|
+
// Already a Uint8, do nothing
|
|
1696
|
+
if (data instanceof Uint8Array)
|
|
1697
|
+
return data;
|
|
1698
|
+
if (typeof data === "string") {
|
|
1699
|
+
return fromUtf8(data);
|
|
1700
|
+
}
|
|
1701
|
+
if (ArrayBuffer.isView(data)) {
|
|
1702
|
+
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
|
|
1703
|
+
}
|
|
1704
|
+
return new Uint8Array(data);
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
|
|
1708
|
+
/***/ }),
|
|
1709
|
+
|
|
1710
|
+
/***/ "./node_modules/@aws-crypto/util/build/module/index.js":
|
|
1711
|
+
/*!*************************************************************!*\
|
|
1712
|
+
!*** ./node_modules/@aws-crypto/util/build/module/index.js ***!
|
|
1713
|
+
\*************************************************************/
|
|
1714
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1715
|
+
|
|
1716
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1717
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1718
|
+
/* harmony export */ convertToBuffer: () => (/* reexport safe */ _convertToBuffer__WEBPACK_IMPORTED_MODULE_0__.convertToBuffer),
|
|
1719
|
+
/* harmony export */ isEmptyData: () => (/* reexport safe */ _isEmptyData__WEBPACK_IMPORTED_MODULE_1__.isEmptyData),
|
|
1720
|
+
/* harmony export */ numToUint8: () => (/* reexport safe */ _numToUint8__WEBPACK_IMPORTED_MODULE_2__.numToUint8),
|
|
1721
|
+
/* harmony export */ uint32ArrayFrom: () => (/* reexport safe */ _uint32ArrayFrom__WEBPACK_IMPORTED_MODULE_3__.uint32ArrayFrom)
|
|
1722
|
+
/* harmony export */ });
|
|
1723
|
+
/* harmony import */ var _convertToBuffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./convertToBuffer */ "./node_modules/@aws-crypto/util/build/module/convertToBuffer.js");
|
|
1724
|
+
/* harmony import */ var _isEmptyData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isEmptyData */ "./node_modules/@aws-crypto/util/build/module/isEmptyData.js");
|
|
1725
|
+
/* harmony import */ var _numToUint8__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./numToUint8 */ "./node_modules/@aws-crypto/util/build/module/numToUint8.js");
|
|
1726
|
+
/* harmony import */ var _uint32ArrayFrom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./uint32ArrayFrom */ "./node_modules/@aws-crypto/util/build/module/uint32ArrayFrom.js");
|
|
1727
|
+
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
|
|
1728
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1729
|
+
|
|
1730
|
+
|
|
1731
|
+
|
|
1732
|
+
|
|
1733
|
+
|
|
1734
|
+
|
|
1735
|
+
/***/ }),
|
|
1736
|
+
|
|
1737
|
+
/***/ "./node_modules/@aws-crypto/util/build/module/isEmptyData.js":
|
|
1738
|
+
/*!*******************************************************************!*\
|
|
1739
|
+
!*** ./node_modules/@aws-crypto/util/build/module/isEmptyData.js ***!
|
|
1740
|
+
\*******************************************************************/
|
|
1741
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1742
|
+
|
|
1743
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1744
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1745
|
+
/* harmony export */ isEmptyData: () => (/* binding */ isEmptyData)
|
|
1746
|
+
/* harmony export */ });
|
|
1747
|
+
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
|
|
1748
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1749
|
+
function isEmptyData(data) {
|
|
1750
|
+
if (typeof data === "string") {
|
|
1751
|
+
return data.length === 0;
|
|
1752
|
+
}
|
|
1753
|
+
return data.byteLength === 0;
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
|
|
1757
|
+
/***/ }),
|
|
1758
|
+
|
|
1759
|
+
/***/ "./node_modules/@aws-crypto/util/build/module/numToUint8.js":
|
|
1760
|
+
/*!******************************************************************!*\
|
|
1761
|
+
!*** ./node_modules/@aws-crypto/util/build/module/numToUint8.js ***!
|
|
1762
|
+
\******************************************************************/
|
|
1763
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1764
|
+
|
|
1765
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1766
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1767
|
+
/* harmony export */ numToUint8: () => (/* binding */ numToUint8)
|
|
1768
|
+
/* harmony export */ });
|
|
1769
|
+
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
|
|
1770
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1771
|
+
function numToUint8(num) {
|
|
1772
|
+
return new Uint8Array([
|
|
1773
|
+
(num & 0xff000000) >> 24,
|
|
1774
|
+
(num & 0x00ff0000) >> 16,
|
|
1775
|
+
(num & 0x0000ff00) >> 8,
|
|
1776
|
+
num & 0x000000ff,
|
|
1777
|
+
]);
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
|
|
1781
|
+
/***/ }),
|
|
1782
|
+
|
|
1783
|
+
/***/ "./node_modules/@aws-crypto/util/build/module/uint32ArrayFrom.js":
|
|
1784
|
+
/*!***********************************************************************!*\
|
|
1785
|
+
!*** ./node_modules/@aws-crypto/util/build/module/uint32ArrayFrom.js ***!
|
|
1786
|
+
\***********************************************************************/
|
|
1787
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1788
|
+
|
|
1789
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1790
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1791
|
+
/* harmony export */ uint32ArrayFrom: () => (/* binding */ uint32ArrayFrom)
|
|
1792
|
+
/* harmony export */ });
|
|
1793
|
+
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
|
|
1794
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1795
|
+
// IE 11 does not support Array.from, so we do it manually
|
|
1796
|
+
function uint32ArrayFrom(a_lookUpTable) {
|
|
1797
|
+
if (!Uint32Array.from) {
|
|
1798
|
+
var return_array = new Uint32Array(a_lookUpTable.length);
|
|
1799
|
+
var a_index = 0;
|
|
1800
|
+
while (a_index < a_lookUpTable.length) {
|
|
1801
|
+
return_array[a_index] = a_lookUpTable[a_index];
|
|
1802
|
+
a_index += 1;
|
|
1803
|
+
}
|
|
1804
|
+
return return_array;
|
|
1805
|
+
}
|
|
1806
|
+
return Uint32Array.from(a_lookUpTable);
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
|
|
1810
|
+
/***/ }),
|
|
1811
|
+
|
|
1812
|
+
/***/ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js":
|
|
1813
|
+
/*!**************************************************************************************************!*\
|
|
1814
|
+
!*** ./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js ***!
|
|
1815
|
+
\**************************************************************************************************/
|
|
1816
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1817
|
+
|
|
1818
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1819
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1820
|
+
/* harmony export */ fromUtf8: () => (/* binding */ fromUtf8)
|
|
1821
|
+
/* harmony export */ });
|
|
1822
|
+
const fromUtf8 = (input) => new TextEncoder().encode(input);
|
|
1823
|
+
|
|
1824
|
+
|
|
1825
|
+
/***/ }),
|
|
1826
|
+
|
|
1827
|
+
/***/ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/index.js":
|
|
1828
|
+
/*!***************************************************************************************!*\
|
|
1829
|
+
!*** ./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/index.js ***!
|
|
1830
|
+
\***************************************************************************************/
|
|
1831
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1832
|
+
|
|
1833
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1834
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1835
|
+
/* harmony export */ fromUtf8: () => (/* reexport safe */ _fromUtf8__WEBPACK_IMPORTED_MODULE_0__.fromUtf8),
|
|
1836
|
+
/* harmony export */ toUint8Array: () => (/* reexport safe */ _toUint8Array__WEBPACK_IMPORTED_MODULE_1__.toUint8Array),
|
|
1837
|
+
/* harmony export */ toUtf8: () => (/* reexport safe */ _toUtf8__WEBPACK_IMPORTED_MODULE_2__.toUtf8)
|
|
1838
|
+
/* harmony export */ });
|
|
1839
|
+
/* harmony import */ var _fromUtf8__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fromUtf8 */ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js");
|
|
1840
|
+
/* harmony import */ var _toUint8Array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toUint8Array */ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js");
|
|
1841
|
+
/* harmony import */ var _toUtf8__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toUtf8 */ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUtf8.browser.js");
|
|
1842
|
+
|
|
1843
|
+
|
|
1844
|
+
|
|
1845
|
+
|
|
1846
|
+
|
|
1847
|
+
/***/ }),
|
|
1848
|
+
|
|
1849
|
+
/***/ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js":
|
|
1850
|
+
/*!**********************************************************************************************!*\
|
|
1851
|
+
!*** ./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js ***!
|
|
1852
|
+
\**********************************************************************************************/
|
|
1853
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1854
|
+
|
|
1855
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1856
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1857
|
+
/* harmony export */ toUint8Array: () => (/* binding */ toUint8Array)
|
|
1858
|
+
/* harmony export */ });
|
|
1859
|
+
/* harmony import */ var _fromUtf8__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fromUtf8 */ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js");
|
|
1860
|
+
|
|
1861
|
+
const toUint8Array = (data) => {
|
|
1862
|
+
if (typeof data === "string") {
|
|
1863
|
+
return (0,_fromUtf8__WEBPACK_IMPORTED_MODULE_0__.fromUtf8)(data);
|
|
1864
|
+
}
|
|
1865
|
+
if (ArrayBuffer.isView(data)) {
|
|
1866
|
+
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
|
|
1867
|
+
}
|
|
1868
|
+
return new Uint8Array(data);
|
|
1869
|
+
};
|
|
1870
|
+
|
|
1871
|
+
|
|
1872
|
+
/***/ }),
|
|
1873
|
+
|
|
1874
|
+
/***/ "./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUtf8.browser.js":
|
|
1875
|
+
/*!************************************************************************************************!*\
|
|
1876
|
+
!*** ./node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-es/toUtf8.browser.js ***!
|
|
1877
|
+
\************************************************************************************************/
|
|
1878
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1879
|
+
|
|
1880
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1881
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1882
|
+
/* harmony export */ toUtf8: () => (/* binding */ toUtf8)
|
|
1883
|
+
/* harmony export */ });
|
|
1884
|
+
const toUtf8 = (input) => {
|
|
1885
|
+
if (typeof input === "string") {
|
|
1886
|
+
return input;
|
|
1887
|
+
}
|
|
1888
|
+
if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") {
|
|
1889
|
+
throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");
|
|
1890
|
+
}
|
|
1891
|
+
return new TextDecoder("utf-8").decode(input);
|
|
1892
|
+
};
|
|
1893
|
+
|
|
1894
|
+
|
|
1895
|
+
/***/ }),
|
|
1896
|
+
|
|
1897
|
+
/***/ "./node_modules/tslib/tslib.es6.mjs":
|
|
1898
|
+
/*!******************************************!*\
|
|
1899
|
+
!*** ./node_modules/tslib/tslib.es6.mjs ***!
|
|
1900
|
+
\******************************************/
|
|
1901
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1902
|
+
|
|
1903
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1904
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1905
|
+
/* harmony export */ __addDisposableResource: () => (/* binding */ __addDisposableResource),
|
|
1906
|
+
/* harmony export */ __assign: () => (/* binding */ __assign),
|
|
1907
|
+
/* harmony export */ __asyncDelegator: () => (/* binding */ __asyncDelegator),
|
|
1908
|
+
/* harmony export */ __asyncGenerator: () => (/* binding */ __asyncGenerator),
|
|
1909
|
+
/* harmony export */ __asyncValues: () => (/* binding */ __asyncValues),
|
|
1910
|
+
/* harmony export */ __await: () => (/* binding */ __await),
|
|
1911
|
+
/* harmony export */ __awaiter: () => (/* binding */ __awaiter),
|
|
1912
|
+
/* harmony export */ __classPrivateFieldGet: () => (/* binding */ __classPrivateFieldGet),
|
|
1913
|
+
/* harmony export */ __classPrivateFieldIn: () => (/* binding */ __classPrivateFieldIn),
|
|
1914
|
+
/* harmony export */ __classPrivateFieldSet: () => (/* binding */ __classPrivateFieldSet),
|
|
1915
|
+
/* harmony export */ __createBinding: () => (/* binding */ __createBinding),
|
|
1916
|
+
/* harmony export */ __decorate: () => (/* binding */ __decorate),
|
|
1917
|
+
/* harmony export */ __disposeResources: () => (/* binding */ __disposeResources),
|
|
1918
|
+
/* harmony export */ __esDecorate: () => (/* binding */ __esDecorate),
|
|
1919
|
+
/* harmony export */ __exportStar: () => (/* binding */ __exportStar),
|
|
1920
|
+
/* harmony export */ __extends: () => (/* binding */ __extends),
|
|
1921
|
+
/* harmony export */ __generator: () => (/* binding */ __generator),
|
|
1922
|
+
/* harmony export */ __importDefault: () => (/* binding */ __importDefault),
|
|
1923
|
+
/* harmony export */ __importStar: () => (/* binding */ __importStar),
|
|
1924
|
+
/* harmony export */ __makeTemplateObject: () => (/* binding */ __makeTemplateObject),
|
|
1925
|
+
/* harmony export */ __metadata: () => (/* binding */ __metadata),
|
|
1926
|
+
/* harmony export */ __param: () => (/* binding */ __param),
|
|
1927
|
+
/* harmony export */ __propKey: () => (/* binding */ __propKey),
|
|
1928
|
+
/* harmony export */ __read: () => (/* binding */ __read),
|
|
1929
|
+
/* harmony export */ __rest: () => (/* binding */ __rest),
|
|
1930
|
+
/* harmony export */ __rewriteRelativeImportExtension: () => (/* binding */ __rewriteRelativeImportExtension),
|
|
1931
|
+
/* harmony export */ __runInitializers: () => (/* binding */ __runInitializers),
|
|
1932
|
+
/* harmony export */ __setFunctionName: () => (/* binding */ __setFunctionName),
|
|
1933
|
+
/* harmony export */ __spread: () => (/* binding */ __spread),
|
|
1934
|
+
/* harmony export */ __spreadArray: () => (/* binding */ __spreadArray),
|
|
1935
|
+
/* harmony export */ __spreadArrays: () => (/* binding */ __spreadArrays),
|
|
1936
|
+
/* harmony export */ __values: () => (/* binding */ __values),
|
|
1937
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
1938
|
+
/* harmony export */ });
|
|
1939
|
+
/******************************************************************************
|
|
1940
|
+
Copyright (c) Microsoft Corporation.
|
|
1941
|
+
|
|
1942
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
1943
|
+
purpose with or without fee is hereby granted.
|
|
1944
|
+
|
|
1945
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1946
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1947
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1948
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1949
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1950
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1951
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
1952
|
+
***************************************************************************** */
|
|
1953
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
1954
|
+
|
|
1955
|
+
var extendStatics = function(d, b) {
|
|
1956
|
+
extendStatics = Object.setPrototypeOf ||
|
|
1957
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1958
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
1959
|
+
return extendStatics(d, b);
|
|
1960
|
+
};
|
|
1961
|
+
|
|
1962
|
+
function __extends(d, b) {
|
|
1963
|
+
if (typeof b !== "function" && b !== null)
|
|
1964
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1965
|
+
extendStatics(d, b);
|
|
1966
|
+
function __() { this.constructor = d; }
|
|
1967
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
var __assign = function() {
|
|
1971
|
+
__assign = Object.assign || function __assign(t) {
|
|
1972
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1973
|
+
s = arguments[i];
|
|
1974
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
1975
|
+
}
|
|
1976
|
+
return t;
|
|
1977
|
+
}
|
|
1978
|
+
return __assign.apply(this, arguments);
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
function __rest(s, e) {
|
|
1982
|
+
var t = {};
|
|
1983
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1984
|
+
t[p] = s[p];
|
|
1985
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1986
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1987
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1988
|
+
t[p[i]] = s[p[i]];
|
|
1989
|
+
}
|
|
1990
|
+
return t;
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
function __decorate(decorators, target, key, desc) {
|
|
1994
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1995
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1996
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1997
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1998
|
+
}
|
|
1999
|
+
|
|
2000
|
+
function __param(paramIndex, decorator) {
|
|
2001
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2005
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
2006
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
2007
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
2008
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
2009
|
+
var _, done = false;
|
|
2010
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
2011
|
+
var context = {};
|
|
2012
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
2013
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
2014
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
2015
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
2016
|
+
if (kind === "accessor") {
|
|
2017
|
+
if (result === void 0) continue;
|
|
2018
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
2019
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
2020
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
2021
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
2022
|
+
}
|
|
2023
|
+
else if (_ = accept(result)) {
|
|
2024
|
+
if (kind === "field") initializers.unshift(_);
|
|
2025
|
+
else descriptor[key] = _;
|
|
2026
|
+
}
|
|
2027
|
+
}
|
|
2028
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
2029
|
+
done = true;
|
|
2030
|
+
};
|
|
2031
|
+
|
|
2032
|
+
function __runInitializers(thisArg, initializers, value) {
|
|
2033
|
+
var useValue = arguments.length > 2;
|
|
2034
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
2035
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
2036
|
+
}
|
|
2037
|
+
return useValue ? value : void 0;
|
|
2038
|
+
};
|
|
2039
|
+
|
|
2040
|
+
function __propKey(x) {
|
|
2041
|
+
return typeof x === "symbol" ? x : "".concat(x);
|
|
2042
|
+
};
|
|
2043
|
+
|
|
2044
|
+
function __setFunctionName(f, name, prefix) {
|
|
2045
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
2046
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
2047
|
+
};
|
|
2048
|
+
|
|
2049
|
+
function __metadata(metadataKey, metadataValue) {
|
|
2050
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
2054
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2055
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2056
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
2057
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
2058
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
2059
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2060
|
+
});
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
function __generator(thisArg, body) {
|
|
2064
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
2065
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
2066
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
2067
|
+
function step(op) {
|
|
2068
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
2069
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
2070
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
2071
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
2072
|
+
switch (op[0]) {
|
|
2073
|
+
case 0: case 1: t = op; break;
|
|
2074
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
2075
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
2076
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
2077
|
+
default:
|
|
2078
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
2079
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
2080
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
2081
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
2082
|
+
if (t[2]) _.ops.pop();
|
|
2083
|
+
_.trys.pop(); continue;
|
|
2084
|
+
}
|
|
2085
|
+
op = body.call(thisArg, _);
|
|
2086
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
2087
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
var __createBinding = Object.create ? (function(o, m, k, k2) {
|
|
2092
|
+
if (k2 === undefined) k2 = k;
|
|
2093
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2094
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
2095
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
2096
|
+
}
|
|
2097
|
+
Object.defineProperty(o, k2, desc);
|
|
2098
|
+
}) : (function(o, m, k, k2) {
|
|
2099
|
+
if (k2 === undefined) k2 = k;
|
|
2100
|
+
o[k2] = m[k];
|
|
2101
|
+
});
|
|
2102
|
+
|
|
2103
|
+
function __exportStar(m, o) {
|
|
2104
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
function __values(o) {
|
|
2108
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
2109
|
+
if (m) return m.call(o);
|
|
2110
|
+
if (o && typeof o.length === "number") return {
|
|
2111
|
+
next: function () {
|
|
2112
|
+
if (o && i >= o.length) o = void 0;
|
|
2113
|
+
return { value: o && o[i++], done: !o };
|
|
2114
|
+
}
|
|
2115
|
+
};
|
|
2116
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
function __read(o, n) {
|
|
2120
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
2121
|
+
if (!m) return o;
|
|
2122
|
+
var i = m.call(o), r, ar = [], e;
|
|
2123
|
+
try {
|
|
2124
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
2125
|
+
}
|
|
2126
|
+
catch (error) { e = { error: error }; }
|
|
2127
|
+
finally {
|
|
2128
|
+
try {
|
|
2129
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
2130
|
+
}
|
|
2131
|
+
finally { if (e) throw e.error; }
|
|
2132
|
+
}
|
|
2133
|
+
return ar;
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
/** @deprecated */
|
|
2137
|
+
function __spread() {
|
|
2138
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
2139
|
+
ar = ar.concat(__read(arguments[i]));
|
|
2140
|
+
return ar;
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
/** @deprecated */
|
|
2144
|
+
function __spreadArrays() {
|
|
2145
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
2146
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
2147
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
2148
|
+
r[k] = a[j];
|
|
2149
|
+
return r;
|
|
2150
|
+
}
|
|
2151
|
+
|
|
2152
|
+
function __spreadArray(to, from, pack) {
|
|
2153
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
2154
|
+
if (ar || !(i in from)) {
|
|
2155
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
2156
|
+
ar[i] = from[i];
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
function __await(v) {
|
|
2163
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
2167
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
2168
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
2169
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
2170
|
+
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
2171
|
+
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
|
2172
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
2173
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
2174
|
+
function fulfill(value) { resume("next", value); }
|
|
2175
|
+
function reject(value) { resume("throw", value); }
|
|
2176
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
2177
|
+
}
|
|
2178
|
+
|
|
2179
|
+
function __asyncDelegator(o) {
|
|
2180
|
+
var i, p;
|
|
2181
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
2182
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2185
|
+
function __asyncValues(o) {
|
|
2186
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
2187
|
+
var m = o[Symbol.asyncIterator], i;
|
|
2188
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
2189
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
2190
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
function __makeTemplateObject(cooked, raw) {
|
|
2194
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
2195
|
+
return cooked;
|
|
2196
|
+
};
|
|
2197
|
+
|
|
2198
|
+
var __setModuleDefault = Object.create ? (function(o, v) {
|
|
2199
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
2200
|
+
}) : function(o, v) {
|
|
2201
|
+
o["default"] = v;
|
|
2202
|
+
};
|
|
2203
|
+
|
|
2204
|
+
var ownKeys = function(o) {
|
|
2205
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
2206
|
+
var ar = [];
|
|
2207
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
2208
|
+
return ar;
|
|
2209
|
+
};
|
|
2210
|
+
return ownKeys(o);
|
|
2211
|
+
};
|
|
2212
|
+
|
|
2213
|
+
function __importStar(mod) {
|
|
2214
|
+
if (mod && mod.__esModule) return mod;
|
|
2215
|
+
var result = {};
|
|
2216
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
2217
|
+
__setModuleDefault(result, mod);
|
|
2218
|
+
return result;
|
|
2219
|
+
}
|
|
2220
|
+
|
|
2221
|
+
function __importDefault(mod) {
|
|
2222
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
2226
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
2227
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2228
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
2232
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
2233
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
2234
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
2235
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
function __classPrivateFieldIn(state, receiver) {
|
|
2239
|
+
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
|
2240
|
+
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
function __addDisposableResource(env, value, async) {
|
|
2244
|
+
if (value !== null && value !== void 0) {
|
|
2245
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
2246
|
+
var dispose, inner;
|
|
2247
|
+
if (async) {
|
|
2248
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
2249
|
+
dispose = value[Symbol.asyncDispose];
|
|
2250
|
+
}
|
|
2251
|
+
if (dispose === void 0) {
|
|
2252
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
2253
|
+
dispose = value[Symbol.dispose];
|
|
2254
|
+
if (async) inner = dispose;
|
|
2255
|
+
}
|
|
2256
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
2257
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
2258
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
2259
|
+
}
|
|
2260
|
+
else if (async) {
|
|
2261
|
+
env.stack.push({ async: true });
|
|
2262
|
+
}
|
|
2263
|
+
return value;
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
2267
|
+
var e = new Error(message);
|
|
2268
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
2269
|
+
};
|
|
2270
|
+
|
|
2271
|
+
function __disposeResources(env) {
|
|
2272
|
+
function fail(e) {
|
|
2273
|
+
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
2274
|
+
env.hasError = true;
|
|
2275
|
+
}
|
|
2276
|
+
var r, s = 0;
|
|
2277
|
+
function next() {
|
|
2278
|
+
while (r = env.stack.pop()) {
|
|
2279
|
+
try {
|
|
2280
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
2281
|
+
if (r.dispose) {
|
|
2282
|
+
var result = r.dispose.call(r.value);
|
|
2283
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
2284
|
+
}
|
|
2285
|
+
else s |= 1;
|
|
2286
|
+
}
|
|
2287
|
+
catch (e) {
|
|
2288
|
+
fail(e);
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
2292
|
+
if (env.hasError) throw env.error;
|
|
2293
|
+
}
|
|
2294
|
+
return next();
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
function __rewriteRelativeImportExtension(path, preserveJsx) {
|
|
2298
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
2299
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
2300
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
2301
|
+
});
|
|
2302
|
+
}
|
|
2303
|
+
return path;
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
|
2307
|
+
__extends,
|
|
2308
|
+
__assign,
|
|
2309
|
+
__rest,
|
|
2310
|
+
__decorate,
|
|
2311
|
+
__param,
|
|
2312
|
+
__esDecorate,
|
|
2313
|
+
__runInitializers,
|
|
2314
|
+
__propKey,
|
|
2315
|
+
__setFunctionName,
|
|
2316
|
+
__metadata,
|
|
2317
|
+
__awaiter,
|
|
2318
|
+
__generator,
|
|
2319
|
+
__createBinding,
|
|
2320
|
+
__exportStar,
|
|
2321
|
+
__values,
|
|
2322
|
+
__read,
|
|
2323
|
+
__spread,
|
|
2324
|
+
__spreadArrays,
|
|
2325
|
+
__spreadArray,
|
|
2326
|
+
__await,
|
|
2327
|
+
__asyncGenerator,
|
|
2328
|
+
__asyncDelegator,
|
|
2329
|
+
__asyncValues,
|
|
2330
|
+
__makeTemplateObject,
|
|
2331
|
+
__importStar,
|
|
2332
|
+
__importDefault,
|
|
2333
|
+
__classPrivateFieldGet,
|
|
2334
|
+
__classPrivateFieldSet,
|
|
2335
|
+
__classPrivateFieldIn,
|
|
2336
|
+
__addDisposableResource,
|
|
2337
|
+
__disposeResources,
|
|
2338
|
+
__rewriteRelativeImportExtension,
|
|
2339
|
+
});
|
|
2340
|
+
|
|
2341
|
+
|
|
2342
|
+
/***/ })
|
|
2343
|
+
|
|
2344
|
+
}]);
|
|
2345
|
+
//# sourceMappingURL=vendors-node_modules_aws-amplify_core_dist_esm_singleton_Amplify_mjs.3c0035b95fe369aede82.js.map
|