@2112-lab/central-plant 0.3.22 → 0.3.23

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.
@@ -39385,7 +39385,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
39385
39385
  * Initialize the CentralPlant manager
39386
39386
  *
39387
39387
  * @constructor
39388
- * @version 0.3.22
39388
+ * @version 0.3.23
39389
39389
  * @updated 2025-10-22
39390
39390
  *
39391
39391
  * @description Creates a new CentralPlant instance and initializes internal managers and utilities.
@@ -46633,8 +46633,7 @@ function _measureS3Transfer() {
46633
46633
  duration,
46634
46634
  _args2 = arguments,
46635
46635
  _t,
46636
- _t2,
46637
- _t3;
46636
+ _t2;
46638
46637
  return _regenerator().w(function (_context2) {
46639
46638
  while (1) switch (_context2.n) {
46640
46639
  case 0:
@@ -46680,7 +46679,7 @@ function _measureS3Transfer() {
46680
46679
  // error.message is 'The provided token has expired.' (no 'ExpiredToken' substring).
46681
46680
  isExpiredToken = _t.code === 'ExpiredToken' || _t.Code === 'ExpiredToken' || _t.name === 'ExpiredToken' || _t.message && _t.message.toLowerCase().includes('token has expired');
46682
46681
  if (!isExpiredToken) {
46683
- _context2.n = 12;
46682
+ _context2.n = 9;
46684
46683
  break;
46685
46684
  }
46686
46685
  console.warn("\u26A0\uFE0F Token expired during ".concat(operation, ". Attempting session refresh and retry..."));
@@ -46693,50 +46692,38 @@ function _measureS3Transfer() {
46693
46692
  throw _t;
46694
46693
  case 4:
46695
46694
  _context2.p = 4;
46696
- _context2.p = 5;
46697
- _context2.n = 6;
46698
- return Auth.currentSession();
46699
- case 6:
46700
- console.log("\u2705 User Pool session refreshed for ".concat(operation, "."));
46701
- _context2.n = 8;
46702
- break;
46703
- case 7:
46704
- _context2.p = 7;
46705
- _t2 = _context2.v;
46706
- // If currentSession() fails the refresh token itself is expired —
46707
- // the user needs to sign in again. Surface that immediately.
46708
- console.error("\u274C Failed to refresh User Pool session during ".concat(operation, ":"), _t2);
46709
- throw _t2;
46710
- case 8:
46711
- _context2.n = 9;
46712
- return Auth.currentCredentials({
46695
+ _context2.n = 5;
46696
+ return Auth.currentSession({
46713
46697
  bypassCache: true
46714
46698
  });
46715
- case 9:
46716
- console.log("\u2705 STS credentials refreshed. Retrying ".concat(operation, "..."));
46699
+ case 5:
46700
+ _context2.n = 6;
46701
+ return Auth.currentCredentials();
46702
+ case 6:
46703
+ console.log("\u2705 Credentials refreshed. Retrying ".concat(operation, "..."));
46717
46704
 
46718
46705
  // Reset timer for the retry
46719
46706
  startTime = performance.now();
46720
- _context2.n = 10;
46707
+ _context2.n = 7;
46721
46708
  return executeTransfer();
46722
- case 10:
46709
+ case 7:
46723
46710
  return _context2.a(2, _context2.v);
46724
- case 11:
46725
- _context2.p = 11;
46726
- _t3 = _context2.v;
46727
- console.error("\u274C Retry failed for ".concat(operation, ":"), _t3);
46711
+ case 8:
46712
+ _context2.p = 8;
46713
+ _t2 = _context2.v;
46714
+ console.error("\u274C Retry failed for ".concat(operation, ":"), _t2);
46728
46715
  // If retry fails, throw the Retry Error (likely unrelated or persistent auth issue)
46729
- throw _t3;
46730
- case 12:
46716
+ throw _t2;
46717
+ case 9:
46731
46718
  // Standard error handling for non-expired tokens (or if logic above didn't catch it)
46732
46719
  endTime = performance.now();
46733
46720
  duration = ((endTime - startTime) / 1000).toFixed(3);
46734
46721
  console.error("\u274C S3 ".concat(operation, " failed after ").concat(duration, "s:"), _t);
46735
46722
  throw _t;
46736
- case 13:
46723
+ case 10:
46737
46724
  return _context2.a(2);
46738
46725
  }
46739
- }, _callee2, null, [[5, 7], [4, 11], [1, 3]]);
46726
+ }, _callee2, null, [[4, 8], [1, 3]]);
46740
46727
  }));
46741
46728
  return _measureS3Transfer.apply(this, arguments);
46742
46729
  }
@@ -35,7 +35,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
35
35
  * Initialize the CentralPlant manager
36
36
  *
37
37
  * @constructor
38
- * @version 0.3.22
38
+ * @version 0.3.23
39
39
  * @updated 2025-10-22
40
40
  *
41
41
  * @description Creates a new CentralPlant instance and initializes internal managers and utilities.
@@ -34,8 +34,7 @@ function _measureS3Transfer() {
34
34
  duration,
35
35
  _args2 = arguments,
36
36
  _t,
37
- _t2,
38
- _t3;
37
+ _t2;
39
38
  return _rollupPluginBabelHelpers.regenerator().w(function (_context2) {
40
39
  while (1) switch (_context2.n) {
41
40
  case 0:
@@ -81,7 +80,7 @@ function _measureS3Transfer() {
81
80
  // error.message is 'The provided token has expired.' (no 'ExpiredToken' substring).
82
81
  isExpiredToken = _t.code === 'ExpiredToken' || _t.Code === 'ExpiredToken' || _t.name === 'ExpiredToken' || _t.message && _t.message.toLowerCase().includes('token has expired');
83
82
  if (!isExpiredToken) {
84
- _context2.n = 12;
83
+ _context2.n = 9;
85
84
  break;
86
85
  }
87
86
  console.warn("\u26A0\uFE0F Token expired during ".concat(operation, ". Attempting session refresh and retry..."));
@@ -94,50 +93,38 @@ function _measureS3Transfer() {
94
93
  throw _t;
95
94
  case 4:
96
95
  _context2.p = 4;
97
- _context2.p = 5;
98
- _context2.n = 6;
99
- return Auth.currentSession();
100
- case 6:
101
- console.log("\u2705 User Pool session refreshed for ".concat(operation, "."));
102
- _context2.n = 8;
103
- break;
104
- case 7:
105
- _context2.p = 7;
106
- _t2 = _context2.v;
107
- // If currentSession() fails the refresh token itself is expired —
108
- // the user needs to sign in again. Surface that immediately.
109
- console.error("\u274C Failed to refresh User Pool session during ".concat(operation, ":"), _t2);
110
- throw _t2;
111
- case 8:
112
- _context2.n = 9;
113
- return Auth.currentCredentials({
96
+ _context2.n = 5;
97
+ return Auth.currentSession({
114
98
  bypassCache: true
115
99
  });
116
- case 9:
117
- console.log("\u2705 STS credentials refreshed. Retrying ".concat(operation, "..."));
100
+ case 5:
101
+ _context2.n = 6;
102
+ return Auth.currentCredentials();
103
+ case 6:
104
+ console.log("\u2705 Credentials refreshed. Retrying ".concat(operation, "..."));
118
105
 
119
106
  // Reset timer for the retry
120
107
  startTime = performance.now();
121
- _context2.n = 10;
108
+ _context2.n = 7;
122
109
  return executeTransfer();
123
- case 10:
110
+ case 7:
124
111
  return _context2.a(2, _context2.v);
125
- case 11:
126
- _context2.p = 11;
127
- _t3 = _context2.v;
128
- console.error("\u274C Retry failed for ".concat(operation, ":"), _t3);
112
+ case 8:
113
+ _context2.p = 8;
114
+ _t2 = _context2.v;
115
+ console.error("\u274C Retry failed for ".concat(operation, ":"), _t2);
129
116
  // If retry fails, throw the Retry Error (likely unrelated or persistent auth issue)
130
- throw _t3;
131
- case 12:
117
+ throw _t2;
118
+ case 9:
132
119
  // Standard error handling for non-expired tokens (or if logic above didn't catch it)
133
120
  endTime = performance.now();
134
121
  duration = ((endTime - startTime) / 1000).toFixed(3);
135
122
  console.error("\u274C S3 ".concat(operation, " failed after ").concat(duration, "s:"), _t);
136
123
  throw _t;
137
- case 13:
124
+ case 10:
138
125
  return _context2.a(2);
139
126
  }
140
- }, _callee2, null, [[5, 7], [4, 11], [1, 3]]);
127
+ }, _callee2, null, [[4, 8], [1, 3]]);
141
128
  }));
142
129
  return _measureS3Transfer.apply(this, arguments);
143
130
  }
@@ -31,7 +31,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
31
31
  * Initialize the CentralPlant manager
32
32
  *
33
33
  * @constructor
34
- * @version 0.3.22
34
+ * @version 0.3.23
35
35
  * @updated 2025-10-22
36
36
  *
37
37
  * @description Creates a new CentralPlant instance and initializes internal managers and utilities.
@@ -30,8 +30,7 @@ function _measureS3Transfer() {
30
30
  duration,
31
31
  _args2 = arguments,
32
32
  _t,
33
- _t2,
34
- _t3;
33
+ _t2;
35
34
  return _regenerator().w(function (_context2) {
36
35
  while (1) switch (_context2.n) {
37
36
  case 0:
@@ -77,7 +76,7 @@ function _measureS3Transfer() {
77
76
  // error.message is 'The provided token has expired.' (no 'ExpiredToken' substring).
78
77
  isExpiredToken = _t.code === 'ExpiredToken' || _t.Code === 'ExpiredToken' || _t.name === 'ExpiredToken' || _t.message && _t.message.toLowerCase().includes('token has expired');
79
78
  if (!isExpiredToken) {
80
- _context2.n = 12;
79
+ _context2.n = 9;
81
80
  break;
82
81
  }
83
82
  console.warn("\u26A0\uFE0F Token expired during ".concat(operation, ". Attempting session refresh and retry..."));
@@ -90,50 +89,38 @@ function _measureS3Transfer() {
90
89
  throw _t;
91
90
  case 4:
92
91
  _context2.p = 4;
93
- _context2.p = 5;
94
- _context2.n = 6;
95
- return Auth.currentSession();
96
- case 6:
97
- console.log("\u2705 User Pool session refreshed for ".concat(operation, "."));
98
- _context2.n = 8;
99
- break;
100
- case 7:
101
- _context2.p = 7;
102
- _t2 = _context2.v;
103
- // If currentSession() fails the refresh token itself is expired —
104
- // the user needs to sign in again. Surface that immediately.
105
- console.error("\u274C Failed to refresh User Pool session during ".concat(operation, ":"), _t2);
106
- throw _t2;
107
- case 8:
108
- _context2.n = 9;
109
- return Auth.currentCredentials({
92
+ _context2.n = 5;
93
+ return Auth.currentSession({
110
94
  bypassCache: true
111
95
  });
112
- case 9:
113
- console.log("\u2705 STS credentials refreshed. Retrying ".concat(operation, "..."));
96
+ case 5:
97
+ _context2.n = 6;
98
+ return Auth.currentCredentials();
99
+ case 6:
100
+ console.log("\u2705 Credentials refreshed. Retrying ".concat(operation, "..."));
114
101
 
115
102
  // Reset timer for the retry
116
103
  startTime = performance.now();
117
- _context2.n = 10;
104
+ _context2.n = 7;
118
105
  return executeTransfer();
119
- case 10:
106
+ case 7:
120
107
  return _context2.a(2, _context2.v);
121
- case 11:
122
- _context2.p = 11;
123
- _t3 = _context2.v;
124
- console.error("\u274C Retry failed for ".concat(operation, ":"), _t3);
108
+ case 8:
109
+ _context2.p = 8;
110
+ _t2 = _context2.v;
111
+ console.error("\u274C Retry failed for ".concat(operation, ":"), _t2);
125
112
  // If retry fails, throw the Retry Error (likely unrelated or persistent auth issue)
126
- throw _t3;
127
- case 12:
113
+ throw _t2;
114
+ case 9:
128
115
  // Standard error handling for non-expired tokens (or if logic above didn't catch it)
129
116
  endTime = performance.now();
130
117
  duration = ((endTime - startTime) / 1000).toFixed(3);
131
118
  console.error("\u274C S3 ".concat(operation, " failed after ").concat(duration, "s:"), _t);
132
119
  throw _t;
133
- case 13:
120
+ case 10:
134
121
  return _context2.a(2);
135
122
  }
136
- }, _callee2, null, [[5, 7], [4, 11], [1, 3]]);
123
+ }, _callee2, null, [[4, 8], [1, 3]]);
137
124
  }));
138
125
  return _measureS3Transfer.apply(this, arguments);
139
126
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2112-lab/central-plant",
3
- "version": "0.3.22",
3
+ "version": "0.3.23",
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",