@2112-lab/central-plant 0.3.0 → 0.3.2
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.
- package/dist/bundle/index.js +125 -66
- package/dist/cjs/src/core/centralPlant.js +1 -1
- package/dist/cjs/src/managers/cache/CacheManager.js +14 -3
- package/dist/cjs/src/managers/cache/S3CacheService.js +92 -61
- package/dist/cjs/src/managers/cache/s3Timing.js +19 -2
- package/dist/esm/src/core/centralPlant.js +1 -1
- package/dist/esm/src/managers/cache/CacheManager.js +14 -3
- package/dist/esm/src/managers/cache/S3CacheService.js +86 -55
- package/dist/esm/src/managers/cache/s3Timing.js +18 -1
- package/package.json +2 -2
package/dist/bundle/index.js
CHANGED
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
7
7
|
|
|
8
8
|
var THREE = require('three');
|
|
9
9
|
var pathfinder = require('@2112-lab/pathfinder');
|
|
10
|
-
var awsAmplify = require('aws-amplify');
|
|
11
10
|
|
|
12
11
|
function _interopNamespace(e) {
|
|
13
12
|
if (e && e.__esModule) return e;
|
|
@@ -37841,7 +37840,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
37841
37840
|
* Initialize the CentralPlant manager
|
|
37842
37841
|
*
|
|
37843
37842
|
* @constructor
|
|
37844
|
-
* @version 0.3.
|
|
37843
|
+
* @version 0.3.2
|
|
37845
37844
|
* @updated 2025-10-22
|
|
37846
37845
|
*
|
|
37847
37846
|
* @description Creates a new CentralPlant instance and initializes internal managers and utilities.
|
|
@@ -42102,9 +42101,14 @@ var CacheManager = /*#__PURE__*/function () {
|
|
|
42102
42101
|
}
|
|
42103
42102
|
return getUser;
|
|
42104
42103
|
}(),
|
|
42105
|
-
//
|
|
42104
|
+
// Injected Amplify Auth instance (set by consuming app via configure())
|
|
42105
|
+
auth: null,
|
|
42106
|
+
// Injected Amplify Storage instance (set by consuming app via configure())
|
|
42107
|
+
storage: null,
|
|
42108
|
+
// Default error logger — suppresses expected not-authenticated errors
|
|
42106
42109
|
onError: function onError(error) {
|
|
42107
|
-
|
|
42110
|
+
if ((error === null || error === void 0 ? void 0 : error.code) === 'S3CacheNotAuthenticated') return;
|
|
42111
|
+
console.error('CacheManager Error:', error);
|
|
42108
42112
|
}
|
|
42109
42113
|
};
|
|
42110
42114
|
}
|
|
@@ -42336,7 +42340,13 @@ var CacheManager = /*#__PURE__*/function () {
|
|
|
42336
42340
|
this.stats.errors++;
|
|
42337
42341
|
this.config.onError(_t2);
|
|
42338
42342
|
|
|
42339
|
-
//
|
|
42343
|
+
// If the error is marked noRetry, propagate immediately without a second fetch attempt
|
|
42344
|
+
if (!_t2.noRetry) {
|
|
42345
|
+
_context4.n = 14;
|
|
42346
|
+
break;
|
|
42347
|
+
}
|
|
42348
|
+
throw _t2;
|
|
42349
|
+
case 14:
|
|
42340
42350
|
_context4.p = 14;
|
|
42341
42351
|
_context4.n = 15;
|
|
42342
42352
|
return fetcher();
|
|
@@ -43119,39 +43129,61 @@ var CacheManager = /*#__PURE__*/function () {
|
|
|
43119
43129
|
}();
|
|
43120
43130
|
var cacheManager = new CacheManager();
|
|
43121
43131
|
|
|
43122
|
-
|
|
43123
|
-
|
|
43124
|
-
|
|
43125
|
-
|
|
43126
|
-
|
|
43127
|
-
|
|
43128
|
-
|
|
43129
|
-
|
|
43130
|
-
|
|
43131
|
-
|
|
43132
|
-
|
|
43133
|
-
|
|
43134
|
-
|
|
43135
|
-
|
|
43136
|
-
|
|
43137
|
-
|
|
43138
|
-
|
|
43139
|
-
}, _callee, null, [[0, 2]]);
|
|
43140
|
-
}));
|
|
43141
|
-
function getUser() {
|
|
43142
|
-
return _getUser.apply(this, arguments);
|
|
43143
|
-
}
|
|
43144
|
-
return getUser;
|
|
43145
|
-
}(),
|
|
43146
|
-
onError: function onError(error) {
|
|
43147
|
-
console.error('S3Cache Error:', error);
|
|
43148
|
-
}
|
|
43149
|
-
});
|
|
43132
|
+
/**
|
|
43133
|
+
* Retrieve the injected Auth instance. Throws if not configured.
|
|
43134
|
+
*/
|
|
43135
|
+
function getAuth$1() {
|
|
43136
|
+
var auth = cacheManager.config.auth;
|
|
43137
|
+
if (!auth) throw new Error('cacheManager.configure({ auth }) must be called before using S3 cache functions');
|
|
43138
|
+
return auth;
|
|
43139
|
+
}
|
|
43140
|
+
|
|
43141
|
+
/**
|
|
43142
|
+
* Retrieve the injected Storage instance. Throws if not configured.
|
|
43143
|
+
*/
|
|
43144
|
+
function getStorage() {
|
|
43145
|
+
var storage = cacheManager.config.storage;
|
|
43146
|
+
if (!storage) throw new Error('cacheManager.configure({ storage }) must be called before using S3 cache functions');
|
|
43147
|
+
return storage;
|
|
43148
|
+
}
|
|
43150
43149
|
|
|
43150
|
+
/**
|
|
43151
|
+
* Guard used inside S3 fetchers. Throws a noRetry error (suppressed by onError)
|
|
43152
|
+
* instead of letting Storage.get() fail with an Amplify credential warning.
|
|
43153
|
+
*/
|
|
43154
|
+
function requireAuthentication() {
|
|
43155
|
+
return _requireAuthentication.apply(this, arguments);
|
|
43156
|
+
}
|
|
43151
43157
|
/**
|
|
43152
43158
|
* Reset the cache manager identity.
|
|
43153
43159
|
* Call this when auth state changes to ensure the correct cache partition is used.
|
|
43154
43160
|
*/
|
|
43161
|
+
function _requireAuthentication() {
|
|
43162
|
+
_requireAuthentication = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
43163
|
+
var err;
|
|
43164
|
+
return _regenerator().w(function (_context) {
|
|
43165
|
+
while (1) switch (_context.n) {
|
|
43166
|
+
case 0:
|
|
43167
|
+
_context.p = 0;
|
|
43168
|
+
_context.n = 1;
|
|
43169
|
+
return getAuth$1().currentAuthenticatedUser();
|
|
43170
|
+
case 1:
|
|
43171
|
+
_context.n = 3;
|
|
43172
|
+
break;
|
|
43173
|
+
case 2:
|
|
43174
|
+
_context.p = 2;
|
|
43175
|
+
_context.v;
|
|
43176
|
+
err = new Error('S3 access requires authentication');
|
|
43177
|
+
err.code = 'S3CacheNotAuthenticated';
|
|
43178
|
+
err.noRetry = true;
|
|
43179
|
+
throw err;
|
|
43180
|
+
case 3:
|
|
43181
|
+
return _context.a(2);
|
|
43182
|
+
}
|
|
43183
|
+
}, _callee, null, [[0, 2]]);
|
|
43184
|
+
}));
|
|
43185
|
+
return _requireAuthentication.apply(this, arguments);
|
|
43186
|
+
}
|
|
43155
43187
|
function resetCacheIdentity() {
|
|
43156
43188
|
cacheManager.resetIdentity();
|
|
43157
43189
|
console.log('🔄 Cache identity reset - will re-evaluate on next cache access');
|
|
@@ -43971,44 +44003,49 @@ function _getCachedS3Object() {
|
|
|
43971
44003
|
expiryMs: expiry,
|
|
43972
44004
|
fetcher: function () {
|
|
43973
44005
|
var _fetcher = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17() {
|
|
43974
|
-
var result, _result, _t12;
|
|
44006
|
+
var Storage, Auth, result, _result, _t12;
|
|
43975
44007
|
return _regenerator().w(function (_context17) {
|
|
43976
44008
|
while (1) switch (_context17.n) {
|
|
43977
44009
|
case 0:
|
|
43978
|
-
_context17.p = 0;
|
|
43979
44010
|
_context17.n = 1;
|
|
43980
|
-
return
|
|
44011
|
+
return requireAuthentication();
|
|
44012
|
+
case 1:
|
|
44013
|
+
Storage = getStorage();
|
|
44014
|
+
Auth = getAuth$1();
|
|
44015
|
+
_context17.p = 2;
|
|
44016
|
+
_context17.n = 3;
|
|
44017
|
+
return Storage.get(s3Key, _objectSpread2(_objectSpread2({}, storageOptions), {}, {
|
|
43981
44018
|
download: true
|
|
43982
44019
|
}));
|
|
43983
|
-
case
|
|
44020
|
+
case 3:
|
|
43984
44021
|
result = _context17.v;
|
|
43985
44022
|
return _context17.a(2, result.Body);
|
|
43986
|
-
case
|
|
43987
|
-
_context17.p =
|
|
44023
|
+
case 4:
|
|
44024
|
+
_context17.p = 4;
|
|
43988
44025
|
_t12 = _context17.v;
|
|
43989
44026
|
if (!(_t12.code === 'ExpiredToken' || _t12.message && _t12.message.includes('ExpiredToken'))) {
|
|
43990
|
-
_context17.n =
|
|
44027
|
+
_context17.n = 7;
|
|
43991
44028
|
break;
|
|
43992
44029
|
}
|
|
43993
44030
|
console.warn("\u26A0\uFE0F Token expired fetching S3 object. Refreshing credentials and retrying...");
|
|
43994
|
-
_context17.n =
|
|
43995
|
-
return
|
|
44031
|
+
_context17.n = 5;
|
|
44032
|
+
return Auth.currentCredentials({
|
|
43996
44033
|
bypassCache: true
|
|
43997
44034
|
});
|
|
43998
|
-
case
|
|
43999
|
-
_context17.n =
|
|
44000
|
-
return
|
|
44035
|
+
case 5:
|
|
44036
|
+
_context17.n = 6;
|
|
44037
|
+
return Storage.get(s3Key, _objectSpread2(_objectSpread2({}, storageOptions), {}, {
|
|
44001
44038
|
download: true
|
|
44002
44039
|
}));
|
|
44003
|
-
case
|
|
44040
|
+
case 6:
|
|
44004
44041
|
_result = _context17.v;
|
|
44005
44042
|
return _context17.a(2, _result.Body);
|
|
44006
|
-
case
|
|
44043
|
+
case 7:
|
|
44007
44044
|
throw _t12;
|
|
44008
|
-
case
|
|
44045
|
+
case 8:
|
|
44009
44046
|
return _context17.a(2);
|
|
44010
44047
|
}
|
|
44011
|
-
}, _callee17, null, [[
|
|
44048
|
+
}, _callee17, null, [[2, 4]]);
|
|
44012
44049
|
}));
|
|
44013
44050
|
function fetcher() {
|
|
44014
44051
|
return _fetcher.apply(this, arguments);
|
|
@@ -44144,48 +44181,53 @@ function _getCachedS3Json() {
|
|
|
44144
44181
|
expiryMs: expiryMs || cacheManager.getExpiryForPath(s3Key),
|
|
44145
44182
|
fetcher: function () {
|
|
44146
44183
|
var _fetcher2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23() {
|
|
44147
|
-
var signedUrl, _signedUrl, _t14;
|
|
44184
|
+
var Storage, Auth, signedUrl, _signedUrl, _t14;
|
|
44148
44185
|
return _regenerator().w(function (_context23) {
|
|
44149
44186
|
while (1) switch (_context23.n) {
|
|
44150
44187
|
case 0:
|
|
44151
|
-
_context23.p = 0;
|
|
44152
44188
|
_context23.n = 1;
|
|
44153
|
-
return
|
|
44189
|
+
return requireAuthentication();
|
|
44190
|
+
case 1:
|
|
44191
|
+
Storage = getStorage();
|
|
44192
|
+
Auth = getAuth$1();
|
|
44193
|
+
_context23.p = 2;
|
|
44194
|
+
_context23.n = 3;
|
|
44195
|
+
return Storage.get(s3Key, _objectSpread2(_objectSpread2({}, storageOptions), {}, {
|
|
44154
44196
|
customPrefix: {
|
|
44155
44197
|
public: ''
|
|
44156
44198
|
}
|
|
44157
44199
|
}));
|
|
44158
|
-
case
|
|
44200
|
+
case 3:
|
|
44159
44201
|
signedUrl = _context23.v;
|
|
44160
44202
|
return _context23.a(2, fetch(signedUrl));
|
|
44161
|
-
case
|
|
44162
|
-
_context23.p =
|
|
44203
|
+
case 4:
|
|
44204
|
+
_context23.p = 4;
|
|
44163
44205
|
_t14 = _context23.v;
|
|
44164
44206
|
if (!(_t14.code === 'ExpiredToken' || _t14.message && _t14.message.includes('ExpiredToken'))) {
|
|
44165
|
-
_context23.n =
|
|
44207
|
+
_context23.n = 7;
|
|
44166
44208
|
break;
|
|
44167
44209
|
}
|
|
44168
44210
|
console.warn("\u26A0\uFE0F Token expired fetching S3 JSON. Refreshing credentials and retrying...");
|
|
44169
|
-
_context23.n =
|
|
44170
|
-
return
|
|
44211
|
+
_context23.n = 5;
|
|
44212
|
+
return Auth.currentCredentials({
|
|
44171
44213
|
bypassCache: true
|
|
44172
44214
|
});
|
|
44173
|
-
case
|
|
44174
|
-
_context23.n =
|
|
44175
|
-
return
|
|
44215
|
+
case 5:
|
|
44216
|
+
_context23.n = 6;
|
|
44217
|
+
return Storage.get(s3Key, _objectSpread2(_objectSpread2({}, storageOptions), {}, {
|
|
44176
44218
|
customPrefix: {
|
|
44177
44219
|
public: ''
|
|
44178
44220
|
}
|
|
44179
44221
|
}));
|
|
44180
|
-
case
|
|
44222
|
+
case 6:
|
|
44181
44223
|
_signedUrl = _context23.v;
|
|
44182
44224
|
return _context23.a(2, fetch(_signedUrl));
|
|
44183
|
-
case
|
|
44225
|
+
case 7:
|
|
44184
44226
|
throw _t14;
|
|
44185
|
-
case
|
|
44227
|
+
case 8:
|
|
44186
44228
|
return _context23.a(2);
|
|
44187
44229
|
}
|
|
44188
|
-
}, _callee23, null, [[
|
|
44230
|
+
}, _callee23, null, [[2, 4]]);
|
|
44189
44231
|
}));
|
|
44190
44232
|
function fetcher() {
|
|
44191
44233
|
return _fetcher2.apply(this, arguments);
|
|
@@ -45017,6 +45059,14 @@ var S3MetadataCacheService = /*#__PURE__*/function () {
|
|
|
45017
45059
|
}(); // Export singleton instance
|
|
45018
45060
|
var s3MetadataCache = new S3MetadataCacheService();
|
|
45019
45061
|
|
|
45062
|
+
/**
|
|
45063
|
+
* Retrieve the injected Auth instance from cacheManager config.
|
|
45064
|
+
* Falls back gracefully if not configured (skip credential refresh).
|
|
45065
|
+
*/
|
|
45066
|
+
function getAuth() {
|
|
45067
|
+
return cacheManager.config.auth || null;
|
|
45068
|
+
}
|
|
45069
|
+
|
|
45020
45070
|
/**
|
|
45021
45071
|
* Measure S3 operation time and log results
|
|
45022
45072
|
* @param {string} operation - Operation name (e.g., "Upload GLB", "Download JSON")
|
|
@@ -45032,6 +45082,7 @@ function _measureS3Transfer() {
|
|
|
45032
45082
|
var fileSize,
|
|
45033
45083
|
startTime,
|
|
45034
45084
|
executeTransfer,
|
|
45085
|
+
Auth,
|
|
45035
45086
|
endTime,
|
|
45036
45087
|
duration,
|
|
45037
45088
|
_args2 = arguments,
|
|
@@ -45082,9 +45133,17 @@ function _measureS3Transfer() {
|
|
|
45082
45133
|
break;
|
|
45083
45134
|
}
|
|
45084
45135
|
console.warn("\u26A0\uFE0F Token expired during ".concat(operation, ". Attempting session refresh and retry..."));
|
|
45136
|
+
Auth = getAuth();
|
|
45137
|
+
if (Auth) {
|
|
45138
|
+
_context2.n = 4;
|
|
45139
|
+
break;
|
|
45140
|
+
}
|
|
45141
|
+
console.error("\u274C Cannot refresh credentials: Auth not injected via cacheManager.configure({ auth })");
|
|
45142
|
+
throw _t;
|
|
45143
|
+
case 4:
|
|
45085
45144
|
_context2.p = 4;
|
|
45086
45145
|
_context2.n = 5;
|
|
45087
|
-
return
|
|
45146
|
+
return Auth.currentCredentials({
|
|
45088
45147
|
bypassCache: true
|
|
45089
45148
|
});
|
|
45090
45149
|
case 5:
|
|
@@ -35,7 +35,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
35
35
|
* Initialize the CentralPlant manager
|
|
36
36
|
*
|
|
37
37
|
* @constructor
|
|
38
|
-
* @version 0.3.
|
|
38
|
+
* @version 0.3.2
|
|
39
39
|
* @updated 2025-10-22
|
|
40
40
|
*
|
|
41
41
|
* @description Creates a new CentralPlant instance and initializes internal managers and utilities.
|
|
@@ -54,9 +54,14 @@ var CacheManager = /*#__PURE__*/function () {
|
|
|
54
54
|
}
|
|
55
55
|
return getUser;
|
|
56
56
|
}(),
|
|
57
|
-
//
|
|
57
|
+
// Injected Amplify Auth instance (set by consuming app via configure())
|
|
58
|
+
auth: null,
|
|
59
|
+
// Injected Amplify Storage instance (set by consuming app via configure())
|
|
60
|
+
storage: null,
|
|
61
|
+
// Default error logger — suppresses expected not-authenticated errors
|
|
58
62
|
onError: function onError(error) {
|
|
59
|
-
|
|
63
|
+
if ((error === null || error === void 0 ? void 0 : error.code) === 'S3CacheNotAuthenticated') return;
|
|
64
|
+
console.error('CacheManager Error:', error);
|
|
60
65
|
}
|
|
61
66
|
};
|
|
62
67
|
}
|
|
@@ -288,7 +293,13 @@ var CacheManager = /*#__PURE__*/function () {
|
|
|
288
293
|
this.stats.errors++;
|
|
289
294
|
this.config.onError(_t2);
|
|
290
295
|
|
|
291
|
-
//
|
|
296
|
+
// If the error is marked noRetry, propagate immediately without a second fetch attempt
|
|
297
|
+
if (!_t2.noRetry) {
|
|
298
|
+
_context4.n = 14;
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
throw _t2;
|
|
302
|
+
case 14:
|
|
292
303
|
_context4.p = 14;
|
|
293
304
|
_context4.n = 15;
|
|
294
305
|
return fetcher();
|
|
@@ -3,42 +3,63 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
|
-
var awsAmplify = require('aws-amplify');
|
|
7
6
|
var CacheManager = require('./CacheManager.js');
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
_context.n = 1;
|
|
18
|
-
return awsAmplify.Auth.currentAuthenticatedUser();
|
|
19
|
-
case 1:
|
|
20
|
-
return _context.a(2, _context.v);
|
|
21
|
-
case 2:
|
|
22
|
-
_context.p = 2;
|
|
23
|
-
_context.v;
|
|
24
|
-
return _context.a(2, null);
|
|
25
|
-
}
|
|
26
|
-
}, _callee, null, [[0, 2]]);
|
|
27
|
-
}));
|
|
28
|
-
function getUser() {
|
|
29
|
-
return _getUser.apply(this, arguments);
|
|
30
|
-
}
|
|
31
|
-
return getUser;
|
|
32
|
-
}(),
|
|
33
|
-
onError: function onError(error) {
|
|
34
|
-
console.error('S3Cache Error:', error);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
8
|
+
/**
|
|
9
|
+
* Retrieve the injected Auth instance. Throws if not configured.
|
|
10
|
+
*/
|
|
11
|
+
function getAuth() {
|
|
12
|
+
var auth = CacheManager.cacheManager.config.auth;
|
|
13
|
+
if (!auth) throw new Error('cacheManager.configure({ auth }) must be called before using S3 cache functions');
|
|
14
|
+
return auth;
|
|
15
|
+
}
|
|
37
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Retrieve the injected Storage instance. Throws if not configured.
|
|
19
|
+
*/
|
|
20
|
+
function getStorage() {
|
|
21
|
+
var storage = CacheManager.cacheManager.config.storage;
|
|
22
|
+
if (!storage) throw new Error('cacheManager.configure({ storage }) must be called before using S3 cache functions');
|
|
23
|
+
return storage;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Guard used inside S3 fetchers. Throws a noRetry error (suppressed by onError)
|
|
28
|
+
* instead of letting Storage.get() fail with an Amplify credential warning.
|
|
29
|
+
*/
|
|
30
|
+
function requireAuthentication() {
|
|
31
|
+
return _requireAuthentication.apply(this, arguments);
|
|
32
|
+
}
|
|
38
33
|
/**
|
|
39
34
|
* Reset the cache manager identity.
|
|
40
35
|
* Call this when auth state changes to ensure the correct cache partition is used.
|
|
41
36
|
*/
|
|
37
|
+
function _requireAuthentication() {
|
|
38
|
+
_requireAuthentication = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee() {
|
|
39
|
+
var err;
|
|
40
|
+
return _rollupPluginBabelHelpers.regenerator().w(function (_context) {
|
|
41
|
+
while (1) switch (_context.n) {
|
|
42
|
+
case 0:
|
|
43
|
+
_context.p = 0;
|
|
44
|
+
_context.n = 1;
|
|
45
|
+
return getAuth().currentAuthenticatedUser();
|
|
46
|
+
case 1:
|
|
47
|
+
_context.n = 3;
|
|
48
|
+
break;
|
|
49
|
+
case 2:
|
|
50
|
+
_context.p = 2;
|
|
51
|
+
_context.v;
|
|
52
|
+
err = new Error('S3 access requires authentication');
|
|
53
|
+
err.code = 'S3CacheNotAuthenticated';
|
|
54
|
+
err.noRetry = true;
|
|
55
|
+
throw err;
|
|
56
|
+
case 3:
|
|
57
|
+
return _context.a(2);
|
|
58
|
+
}
|
|
59
|
+
}, _callee, null, [[0, 2]]);
|
|
60
|
+
}));
|
|
61
|
+
return _requireAuthentication.apply(this, arguments);
|
|
62
|
+
}
|
|
42
63
|
function resetCacheIdentity() {
|
|
43
64
|
CacheManager.cacheManager.resetIdentity();
|
|
44
65
|
console.log('🔄 Cache identity reset - will re-evaluate on next cache access');
|
|
@@ -858,44 +879,49 @@ function _getCachedS3Object() {
|
|
|
858
879
|
expiryMs: expiry,
|
|
859
880
|
fetcher: function () {
|
|
860
881
|
var _fetcher = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee17() {
|
|
861
|
-
var result, _result, _t12;
|
|
882
|
+
var Storage, Auth, result, _result, _t12;
|
|
862
883
|
return _rollupPluginBabelHelpers.regenerator().w(function (_context17) {
|
|
863
884
|
while (1) switch (_context17.n) {
|
|
864
885
|
case 0:
|
|
865
|
-
_context17.p = 0;
|
|
866
886
|
_context17.n = 1;
|
|
867
|
-
return
|
|
887
|
+
return requireAuthentication();
|
|
888
|
+
case 1:
|
|
889
|
+
Storage = getStorage();
|
|
890
|
+
Auth = getAuth();
|
|
891
|
+
_context17.p = 2;
|
|
892
|
+
_context17.n = 3;
|
|
893
|
+
return Storage.get(s3Key, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, storageOptions), {}, {
|
|
868
894
|
download: true
|
|
869
895
|
}));
|
|
870
|
-
case
|
|
896
|
+
case 3:
|
|
871
897
|
result = _context17.v;
|
|
872
898
|
return _context17.a(2, result.Body);
|
|
873
|
-
case
|
|
874
|
-
_context17.p =
|
|
899
|
+
case 4:
|
|
900
|
+
_context17.p = 4;
|
|
875
901
|
_t12 = _context17.v;
|
|
876
902
|
if (!(_t12.code === 'ExpiredToken' || _t12.message && _t12.message.includes('ExpiredToken'))) {
|
|
877
|
-
_context17.n =
|
|
903
|
+
_context17.n = 7;
|
|
878
904
|
break;
|
|
879
905
|
}
|
|
880
906
|
console.warn("\u26A0\uFE0F Token expired fetching S3 object. Refreshing credentials and retrying...");
|
|
881
|
-
_context17.n =
|
|
882
|
-
return
|
|
907
|
+
_context17.n = 5;
|
|
908
|
+
return Auth.currentCredentials({
|
|
883
909
|
bypassCache: true
|
|
884
910
|
});
|
|
885
|
-
case
|
|
886
|
-
_context17.n =
|
|
887
|
-
return
|
|
911
|
+
case 5:
|
|
912
|
+
_context17.n = 6;
|
|
913
|
+
return Storage.get(s3Key, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, storageOptions), {}, {
|
|
888
914
|
download: true
|
|
889
915
|
}));
|
|
890
|
-
case
|
|
916
|
+
case 6:
|
|
891
917
|
_result = _context17.v;
|
|
892
918
|
return _context17.a(2, _result.Body);
|
|
893
|
-
case
|
|
919
|
+
case 7:
|
|
894
920
|
throw _t12;
|
|
895
|
-
case
|
|
921
|
+
case 8:
|
|
896
922
|
return _context17.a(2);
|
|
897
923
|
}
|
|
898
|
-
}, _callee17, null, [[
|
|
924
|
+
}, _callee17, null, [[2, 4]]);
|
|
899
925
|
}));
|
|
900
926
|
function fetcher() {
|
|
901
927
|
return _fetcher.apply(this, arguments);
|
|
@@ -1031,48 +1057,53 @@ function _getCachedS3Json() {
|
|
|
1031
1057
|
expiryMs: expiryMs || CacheManager.cacheManager.getExpiryForPath(s3Key),
|
|
1032
1058
|
fetcher: function () {
|
|
1033
1059
|
var _fetcher2 = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee23() {
|
|
1034
|
-
var signedUrl, _signedUrl, _t14;
|
|
1060
|
+
var Storage, Auth, signedUrl, _signedUrl, _t14;
|
|
1035
1061
|
return _rollupPluginBabelHelpers.regenerator().w(function (_context23) {
|
|
1036
1062
|
while (1) switch (_context23.n) {
|
|
1037
1063
|
case 0:
|
|
1038
|
-
_context23.p = 0;
|
|
1039
1064
|
_context23.n = 1;
|
|
1040
|
-
return
|
|
1065
|
+
return requireAuthentication();
|
|
1066
|
+
case 1:
|
|
1067
|
+
Storage = getStorage();
|
|
1068
|
+
Auth = getAuth();
|
|
1069
|
+
_context23.p = 2;
|
|
1070
|
+
_context23.n = 3;
|
|
1071
|
+
return Storage.get(s3Key, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, storageOptions), {}, {
|
|
1041
1072
|
customPrefix: {
|
|
1042
1073
|
public: ''
|
|
1043
1074
|
}
|
|
1044
1075
|
}));
|
|
1045
|
-
case
|
|
1076
|
+
case 3:
|
|
1046
1077
|
signedUrl = _context23.v;
|
|
1047
1078
|
return _context23.a(2, fetch(signedUrl));
|
|
1048
|
-
case
|
|
1049
|
-
_context23.p =
|
|
1079
|
+
case 4:
|
|
1080
|
+
_context23.p = 4;
|
|
1050
1081
|
_t14 = _context23.v;
|
|
1051
1082
|
if (!(_t14.code === 'ExpiredToken' || _t14.message && _t14.message.includes('ExpiredToken'))) {
|
|
1052
|
-
_context23.n =
|
|
1083
|
+
_context23.n = 7;
|
|
1053
1084
|
break;
|
|
1054
1085
|
}
|
|
1055
1086
|
console.warn("\u26A0\uFE0F Token expired fetching S3 JSON. Refreshing credentials and retrying...");
|
|
1056
|
-
_context23.n =
|
|
1057
|
-
return
|
|
1087
|
+
_context23.n = 5;
|
|
1088
|
+
return Auth.currentCredentials({
|
|
1058
1089
|
bypassCache: true
|
|
1059
1090
|
});
|
|
1060
|
-
case
|
|
1061
|
-
_context23.n =
|
|
1062
|
-
return
|
|
1091
|
+
case 5:
|
|
1092
|
+
_context23.n = 6;
|
|
1093
|
+
return Storage.get(s3Key, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, storageOptions), {}, {
|
|
1063
1094
|
customPrefix: {
|
|
1064
1095
|
public: ''
|
|
1065
1096
|
}
|
|
1066
1097
|
}));
|
|
1067
|
-
case
|
|
1098
|
+
case 6:
|
|
1068
1099
|
_signedUrl = _context23.v;
|
|
1069
1100
|
return _context23.a(2, fetch(_signedUrl));
|
|
1070
|
-
case
|
|
1101
|
+
case 7:
|
|
1071
1102
|
throw _t14;
|
|
1072
|
-
case
|
|
1103
|
+
case 8:
|
|
1073
1104
|
return _context23.a(2);
|
|
1074
1105
|
}
|
|
1075
|
-
}, _callee23, null, [[
|
|
1106
|
+
}, _callee23, null, [[2, 4]]);
|
|
1076
1107
|
}));
|
|
1077
1108
|
function fetcher() {
|
|
1078
1109
|
return _fetcher2.apply(this, arguments);
|
|
@@ -3,7 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
|
-
var
|
|
6
|
+
var CacheManager = require('./CacheManager.js');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Retrieve the injected Auth instance from cacheManager config.
|
|
10
|
+
* Falls back gracefully if not configured (skip credential refresh).
|
|
11
|
+
*/
|
|
12
|
+
function getAuth() {
|
|
13
|
+
return CacheManager.cacheManager.config.auth || null;
|
|
14
|
+
}
|
|
7
15
|
|
|
8
16
|
/**
|
|
9
17
|
* Measure S3 operation time and log results
|
|
@@ -20,6 +28,7 @@ function _measureS3Transfer() {
|
|
|
20
28
|
var fileSize,
|
|
21
29
|
startTime,
|
|
22
30
|
executeTransfer,
|
|
31
|
+
Auth,
|
|
23
32
|
endTime,
|
|
24
33
|
duration,
|
|
25
34
|
_args2 = arguments,
|
|
@@ -70,9 +79,17 @@ function _measureS3Transfer() {
|
|
|
70
79
|
break;
|
|
71
80
|
}
|
|
72
81
|
console.warn("\u26A0\uFE0F Token expired during ".concat(operation, ". Attempting session refresh and retry..."));
|
|
82
|
+
Auth = getAuth();
|
|
83
|
+
if (Auth) {
|
|
84
|
+
_context2.n = 4;
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
console.error("\u274C Cannot refresh credentials: Auth not injected via cacheManager.configure({ auth })");
|
|
88
|
+
throw _t;
|
|
89
|
+
case 4:
|
|
73
90
|
_context2.p = 4;
|
|
74
91
|
_context2.n = 5;
|
|
75
|
-
return
|
|
92
|
+
return Auth.currentCredentials({
|
|
76
93
|
bypassCache: true
|
|
77
94
|
});
|
|
78
95
|
case 5:
|
|
@@ -31,7 +31,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
31
31
|
* Initialize the CentralPlant manager
|
|
32
32
|
*
|
|
33
33
|
* @constructor
|
|
34
|
-
* @version 0.3.
|
|
34
|
+
* @version 0.3.2
|
|
35
35
|
* @updated 2025-10-22
|
|
36
36
|
*
|
|
37
37
|
* @description Creates a new CentralPlant instance and initializes internal managers and utilities.
|
|
@@ -50,9 +50,14 @@ var CacheManager = /*#__PURE__*/function () {
|
|
|
50
50
|
}
|
|
51
51
|
return getUser;
|
|
52
52
|
}(),
|
|
53
|
-
//
|
|
53
|
+
// Injected Amplify Auth instance (set by consuming app via configure())
|
|
54
|
+
auth: null,
|
|
55
|
+
// Injected Amplify Storage instance (set by consuming app via configure())
|
|
56
|
+
storage: null,
|
|
57
|
+
// Default error logger — suppresses expected not-authenticated errors
|
|
54
58
|
onError: function onError(error) {
|
|
55
|
-
|
|
59
|
+
if ((error === null || error === void 0 ? void 0 : error.code) === 'S3CacheNotAuthenticated') return;
|
|
60
|
+
console.error('CacheManager Error:', error);
|
|
56
61
|
}
|
|
57
62
|
};
|
|
58
63
|
}
|
|
@@ -284,7 +289,13 @@ var CacheManager = /*#__PURE__*/function () {
|
|
|
284
289
|
this.stats.errors++;
|
|
285
290
|
this.config.onError(_t2);
|
|
286
291
|
|
|
287
|
-
//
|
|
292
|
+
// If the error is marked noRetry, propagate immediately without a second fetch attempt
|
|
293
|
+
if (!_t2.noRetry) {
|
|
294
|
+
_context4.n = 14;
|
|
295
|
+
break;
|
|
296
|
+
}
|
|
297
|
+
throw _t2;
|
|
298
|
+
case 14:
|
|
288
299
|
_context4.p = 14;
|
|
289
300
|
_context4.n = 15;
|
|
290
301
|
return fetcher();
|
|
@@ -1,40 +1,61 @@
|
|
|
1
1
|
import { asyncToGenerator as _asyncToGenerator, regenerator as _regenerator, objectSpread2 as _objectSpread2, toConsumableArray as _toConsumableArray, createForOfIteratorHelper as _createForOfIteratorHelper } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import { Auth, Storage } from 'aws-amplify';
|
|
3
2
|
import { cacheManager, CACHE_NAME_PREFIX, CACHE_EXPIRY } from './CacheManager.js';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
_context.n = 1;
|
|
14
|
-
return Auth.currentAuthenticatedUser();
|
|
15
|
-
case 1:
|
|
16
|
-
return _context.a(2, _context.v);
|
|
17
|
-
case 2:
|
|
18
|
-
_context.p = 2;
|
|
19
|
-
_context.v;
|
|
20
|
-
return _context.a(2, null);
|
|
21
|
-
}
|
|
22
|
-
}, _callee, null, [[0, 2]]);
|
|
23
|
-
}));
|
|
24
|
-
function getUser() {
|
|
25
|
-
return _getUser.apply(this, arguments);
|
|
26
|
-
}
|
|
27
|
-
return getUser;
|
|
28
|
-
}(),
|
|
29
|
-
onError: function onError(error) {
|
|
30
|
-
console.error('S3Cache Error:', error);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
4
|
+
/**
|
|
5
|
+
* Retrieve the injected Auth instance. Throws if not configured.
|
|
6
|
+
*/
|
|
7
|
+
function getAuth() {
|
|
8
|
+
var auth = cacheManager.config.auth;
|
|
9
|
+
if (!auth) throw new Error('cacheManager.configure({ auth }) must be called before using S3 cache functions');
|
|
10
|
+
return auth;
|
|
11
|
+
}
|
|
33
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Retrieve the injected Storage instance. Throws if not configured.
|
|
15
|
+
*/
|
|
16
|
+
function getStorage() {
|
|
17
|
+
var storage = cacheManager.config.storage;
|
|
18
|
+
if (!storage) throw new Error('cacheManager.configure({ storage }) must be called before using S3 cache functions');
|
|
19
|
+
return storage;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Guard used inside S3 fetchers. Throws a noRetry error (suppressed by onError)
|
|
24
|
+
* instead of letting Storage.get() fail with an Amplify credential warning.
|
|
25
|
+
*/
|
|
26
|
+
function requireAuthentication() {
|
|
27
|
+
return _requireAuthentication.apply(this, arguments);
|
|
28
|
+
}
|
|
34
29
|
/**
|
|
35
30
|
* Reset the cache manager identity.
|
|
36
31
|
* Call this when auth state changes to ensure the correct cache partition is used.
|
|
37
32
|
*/
|
|
33
|
+
function _requireAuthentication() {
|
|
34
|
+
_requireAuthentication = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
35
|
+
var err;
|
|
36
|
+
return _regenerator().w(function (_context) {
|
|
37
|
+
while (1) switch (_context.n) {
|
|
38
|
+
case 0:
|
|
39
|
+
_context.p = 0;
|
|
40
|
+
_context.n = 1;
|
|
41
|
+
return getAuth().currentAuthenticatedUser();
|
|
42
|
+
case 1:
|
|
43
|
+
_context.n = 3;
|
|
44
|
+
break;
|
|
45
|
+
case 2:
|
|
46
|
+
_context.p = 2;
|
|
47
|
+
_context.v;
|
|
48
|
+
err = new Error('S3 access requires authentication');
|
|
49
|
+
err.code = 'S3CacheNotAuthenticated';
|
|
50
|
+
err.noRetry = true;
|
|
51
|
+
throw err;
|
|
52
|
+
case 3:
|
|
53
|
+
return _context.a(2);
|
|
54
|
+
}
|
|
55
|
+
}, _callee, null, [[0, 2]]);
|
|
56
|
+
}));
|
|
57
|
+
return _requireAuthentication.apply(this, arguments);
|
|
58
|
+
}
|
|
38
59
|
function resetCacheIdentity() {
|
|
39
60
|
cacheManager.resetIdentity();
|
|
40
61
|
console.log('🔄 Cache identity reset - will re-evaluate on next cache access');
|
|
@@ -854,44 +875,49 @@ function _getCachedS3Object() {
|
|
|
854
875
|
expiryMs: expiry,
|
|
855
876
|
fetcher: function () {
|
|
856
877
|
var _fetcher = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee17() {
|
|
857
|
-
var result, _result, _t12;
|
|
878
|
+
var Storage, Auth, result, _result, _t12;
|
|
858
879
|
return _regenerator().w(function (_context17) {
|
|
859
880
|
while (1) switch (_context17.n) {
|
|
860
881
|
case 0:
|
|
861
|
-
_context17.p = 0;
|
|
862
882
|
_context17.n = 1;
|
|
883
|
+
return requireAuthentication();
|
|
884
|
+
case 1:
|
|
885
|
+
Storage = getStorage();
|
|
886
|
+
Auth = getAuth();
|
|
887
|
+
_context17.p = 2;
|
|
888
|
+
_context17.n = 3;
|
|
863
889
|
return Storage.get(s3Key, _objectSpread2(_objectSpread2({}, storageOptions), {}, {
|
|
864
890
|
download: true
|
|
865
891
|
}));
|
|
866
|
-
case
|
|
892
|
+
case 3:
|
|
867
893
|
result = _context17.v;
|
|
868
894
|
return _context17.a(2, result.Body);
|
|
869
|
-
case
|
|
870
|
-
_context17.p =
|
|
895
|
+
case 4:
|
|
896
|
+
_context17.p = 4;
|
|
871
897
|
_t12 = _context17.v;
|
|
872
898
|
if (!(_t12.code === 'ExpiredToken' || _t12.message && _t12.message.includes('ExpiredToken'))) {
|
|
873
|
-
_context17.n =
|
|
899
|
+
_context17.n = 7;
|
|
874
900
|
break;
|
|
875
901
|
}
|
|
876
902
|
console.warn("\u26A0\uFE0F Token expired fetching S3 object. Refreshing credentials and retrying...");
|
|
877
|
-
_context17.n =
|
|
903
|
+
_context17.n = 5;
|
|
878
904
|
return Auth.currentCredentials({
|
|
879
905
|
bypassCache: true
|
|
880
906
|
});
|
|
881
|
-
case
|
|
882
|
-
_context17.n =
|
|
907
|
+
case 5:
|
|
908
|
+
_context17.n = 6;
|
|
883
909
|
return Storage.get(s3Key, _objectSpread2(_objectSpread2({}, storageOptions), {}, {
|
|
884
910
|
download: true
|
|
885
911
|
}));
|
|
886
|
-
case
|
|
912
|
+
case 6:
|
|
887
913
|
_result = _context17.v;
|
|
888
914
|
return _context17.a(2, _result.Body);
|
|
889
|
-
case
|
|
915
|
+
case 7:
|
|
890
916
|
throw _t12;
|
|
891
|
-
case
|
|
917
|
+
case 8:
|
|
892
918
|
return _context17.a(2);
|
|
893
919
|
}
|
|
894
|
-
}, _callee17, null, [[
|
|
920
|
+
}, _callee17, null, [[2, 4]]);
|
|
895
921
|
}));
|
|
896
922
|
function fetcher() {
|
|
897
923
|
return _fetcher.apply(this, arguments);
|
|
@@ -1027,48 +1053,53 @@ function _getCachedS3Json() {
|
|
|
1027
1053
|
expiryMs: expiryMs || cacheManager.getExpiryForPath(s3Key),
|
|
1028
1054
|
fetcher: function () {
|
|
1029
1055
|
var _fetcher2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23() {
|
|
1030
|
-
var signedUrl, _signedUrl, _t14;
|
|
1056
|
+
var Storage, Auth, signedUrl, _signedUrl, _t14;
|
|
1031
1057
|
return _regenerator().w(function (_context23) {
|
|
1032
1058
|
while (1) switch (_context23.n) {
|
|
1033
1059
|
case 0:
|
|
1034
|
-
_context23.p = 0;
|
|
1035
1060
|
_context23.n = 1;
|
|
1061
|
+
return requireAuthentication();
|
|
1062
|
+
case 1:
|
|
1063
|
+
Storage = getStorage();
|
|
1064
|
+
Auth = getAuth();
|
|
1065
|
+
_context23.p = 2;
|
|
1066
|
+
_context23.n = 3;
|
|
1036
1067
|
return Storage.get(s3Key, _objectSpread2(_objectSpread2({}, storageOptions), {}, {
|
|
1037
1068
|
customPrefix: {
|
|
1038
1069
|
public: ''
|
|
1039
1070
|
}
|
|
1040
1071
|
}));
|
|
1041
|
-
case
|
|
1072
|
+
case 3:
|
|
1042
1073
|
signedUrl = _context23.v;
|
|
1043
1074
|
return _context23.a(2, fetch(signedUrl));
|
|
1044
|
-
case
|
|
1045
|
-
_context23.p =
|
|
1075
|
+
case 4:
|
|
1076
|
+
_context23.p = 4;
|
|
1046
1077
|
_t14 = _context23.v;
|
|
1047
1078
|
if (!(_t14.code === 'ExpiredToken' || _t14.message && _t14.message.includes('ExpiredToken'))) {
|
|
1048
|
-
_context23.n =
|
|
1079
|
+
_context23.n = 7;
|
|
1049
1080
|
break;
|
|
1050
1081
|
}
|
|
1051
1082
|
console.warn("\u26A0\uFE0F Token expired fetching S3 JSON. Refreshing credentials and retrying...");
|
|
1052
|
-
_context23.n =
|
|
1083
|
+
_context23.n = 5;
|
|
1053
1084
|
return Auth.currentCredentials({
|
|
1054
1085
|
bypassCache: true
|
|
1055
1086
|
});
|
|
1056
|
-
case
|
|
1057
|
-
_context23.n =
|
|
1087
|
+
case 5:
|
|
1088
|
+
_context23.n = 6;
|
|
1058
1089
|
return Storage.get(s3Key, _objectSpread2(_objectSpread2({}, storageOptions), {}, {
|
|
1059
1090
|
customPrefix: {
|
|
1060
1091
|
public: ''
|
|
1061
1092
|
}
|
|
1062
1093
|
}));
|
|
1063
|
-
case
|
|
1094
|
+
case 6:
|
|
1064
1095
|
_signedUrl = _context23.v;
|
|
1065
1096
|
return _context23.a(2, fetch(_signedUrl));
|
|
1066
|
-
case
|
|
1097
|
+
case 7:
|
|
1067
1098
|
throw _t14;
|
|
1068
|
-
case
|
|
1099
|
+
case 8:
|
|
1069
1100
|
return _context23.a(2);
|
|
1070
1101
|
}
|
|
1071
|
-
}, _callee23, null, [[
|
|
1102
|
+
}, _callee23, null, [[2, 4]]);
|
|
1072
1103
|
}));
|
|
1073
1104
|
function fetcher() {
|
|
1074
1105
|
return _fetcher2.apply(this, arguments);
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { asyncToGenerator as _asyncToGenerator, regenerator as _regenerator } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import {
|
|
2
|
+
import { cacheManager } from './CacheManager.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Retrieve the injected Auth instance from cacheManager config.
|
|
6
|
+
* Falls back gracefully if not configured (skip credential refresh).
|
|
7
|
+
*/
|
|
8
|
+
function getAuth() {
|
|
9
|
+
return cacheManager.config.auth || null;
|
|
10
|
+
}
|
|
3
11
|
|
|
4
12
|
/**
|
|
5
13
|
* Measure S3 operation time and log results
|
|
@@ -16,6 +24,7 @@ function _measureS3Transfer() {
|
|
|
16
24
|
var fileSize,
|
|
17
25
|
startTime,
|
|
18
26
|
executeTransfer,
|
|
27
|
+
Auth,
|
|
19
28
|
endTime,
|
|
20
29
|
duration,
|
|
21
30
|
_args2 = arguments,
|
|
@@ -66,6 +75,14 @@ function _measureS3Transfer() {
|
|
|
66
75
|
break;
|
|
67
76
|
}
|
|
68
77
|
console.warn("\u26A0\uFE0F Token expired during ".concat(operation, ". Attempting session refresh and retry..."));
|
|
78
|
+
Auth = getAuth();
|
|
79
|
+
if (Auth) {
|
|
80
|
+
_context2.n = 4;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
console.error("\u274C Cannot refresh credentials: Auth not injected via cacheManager.configure({ auth })");
|
|
84
|
+
throw _t;
|
|
85
|
+
case 4:
|
|
69
86
|
_context2.p = 4;
|
|
70
87
|
_context2.n = 5;
|
|
71
88
|
return Auth.currentCredentials({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@2112-lab/central-plant",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Utility modules for the Central Plant Application",
|
|
5
5
|
"main": "dist/bundle/index.js",
|
|
6
6
|
"module": "dist/esm/src/index.js",
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@2112-lab/pathfinder": "^1.0.38",
|
|
35
|
-
"aws-amplify": "^5.3.33",
|
|
36
35
|
"stats.js": "^0.17.0",
|
|
37
36
|
"three": "^0.177.0"
|
|
38
37
|
},
|
|
@@ -44,6 +43,7 @@
|
|
|
44
43
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
45
44
|
"@rollup/plugin-replace": "^6.0.2",
|
|
46
45
|
"docdash": "^2.0.2",
|
|
46
|
+
"regenerator-runtime": "^0.14.1",
|
|
47
47
|
"rollup": "^2.79.1",
|
|
48
48
|
"rollup-plugin-copy": "^3.5.0",
|
|
49
49
|
"rollup-plugin-terser": "^7.0.2"
|