@uniformdev/next-app-router 20.72.4-alpha.6 → 20.73.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cache.js CHANGED
@@ -418,6 +418,7 @@ var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cann
418
418
  var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
419
419
  var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
420
420
  var defaultLimitPolicy = (0, import_p_limit.default)(6);
421
+ var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
421
422
  var ApiClientError = class _ApiClientError extends Error {
422
423
  constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
423
424
  super(
@@ -433,6 +434,12 @@ var ApiClientError = class _ApiClientError extends Error {
433
434
  Object.setPrototypeOf(this, _ApiClientError.prototype);
434
435
  }
435
436
  };
437
+ var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
438
+ constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
439
+ super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
440
+ Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
441
+ }
442
+ };
436
443
  var ApiClient = class _ApiClient {
437
444
  constructor(options) {
438
445
  __publicField2(this, "options");
@@ -466,7 +473,7 @@ var ApiClient = class _ApiClient {
466
473
  }
467
474
  async apiClientWithResponse(fetchUri, options) {
468
475
  return this.options.limitPolicy(async () => {
469
- var _a;
476
+ var _a, _b;
470
477
  const coreHeaders = this.options.apiKey ? {
471
478
  "x-api-key": this.options.apiKey
472
479
  } : {
@@ -502,9 +509,19 @@ var ApiClient = class _ApiClient {
502
509
  } catch (e) {
503
510
  message = `General error`;
504
511
  }
512
+ if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
513
+ throw new BearerTokenNotValidOrExpiredError(
514
+ message,
515
+ (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
516
+ fetchUri.toString(),
517
+ apiResponse.status,
518
+ apiResponse.statusText,
519
+ _ApiClient.getRequestId(apiResponse)
520
+ );
521
+ }
505
522
  throw new ApiClientError(
506
523
  message,
507
- (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
524
+ (_b = options == null ? void 0 : options.method) != null ? _b : "GET",
508
525
  fetchUri.toString(),
509
526
  apiResponse.status,
510
527
  apiResponse.statusText,
package/dist/cache.mjs CHANGED
@@ -405,6 +405,7 @@ var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cann
405
405
  var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
406
406
  var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
407
407
  var defaultLimitPolicy = (0, import_p_limit.default)(6);
408
+ var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
408
409
  var ApiClientError = class _ApiClientError extends Error {
409
410
  constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
410
411
  super(
@@ -420,6 +421,12 @@ var ApiClientError = class _ApiClientError extends Error {
420
421
  Object.setPrototypeOf(this, _ApiClientError.prototype);
421
422
  }
422
423
  };
424
+ var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
425
+ constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
426
+ super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
427
+ Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
428
+ }
429
+ };
423
430
  var ApiClient = class _ApiClient {
424
431
  constructor(options) {
425
432
  __publicField2(this, "options");
@@ -453,7 +460,7 @@ var ApiClient = class _ApiClient {
453
460
  }
454
461
  async apiClientWithResponse(fetchUri, options) {
455
462
  return this.options.limitPolicy(async () => {
456
- var _a;
463
+ var _a, _b;
457
464
  const coreHeaders = this.options.apiKey ? {
458
465
  "x-api-key": this.options.apiKey
459
466
  } : {
@@ -489,9 +496,19 @@ var ApiClient = class _ApiClient {
489
496
  } catch (e) {
490
497
  message = `General error`;
491
498
  }
499
+ if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
500
+ throw new BearerTokenNotValidOrExpiredError(
501
+ message,
502
+ (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
503
+ fetchUri.toString(),
504
+ apiResponse.status,
505
+ apiResponse.statusText,
506
+ _ApiClient.getRequestId(apiResponse)
507
+ );
508
+ }
492
509
  throw new ApiClientError(
493
510
  message,
494
- (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
511
+ (_b = options == null ? void 0 : options.method) != null ? _b : "GET",
495
512
  fetchUri.toString(),
496
513
  apiResponse.status,
497
514
  apiResponse.statusText,
package/dist/component.js CHANGED
@@ -225,6 +225,7 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
225
225
  var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
226
226
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
227
227
  var defaultLimitPolicy = (0, import_p_limit.default)(6);
228
+ var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
228
229
  var ApiClientError = class _ApiClientError extends Error {
229
230
  constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
230
231
  super(
@@ -240,6 +241,12 @@ var ApiClientError = class _ApiClientError extends Error {
240
241
  Object.setPrototypeOf(this, _ApiClientError.prototype);
241
242
  }
242
243
  };
244
+ var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
245
+ constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
246
+ super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
247
+ Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
248
+ }
249
+ };
243
250
  var ApiClient = class _ApiClient {
244
251
  constructor(options) {
245
252
  __publicField(this, "options");
@@ -273,7 +280,7 @@ var ApiClient = class _ApiClient {
273
280
  }
274
281
  async apiClientWithResponse(fetchUri, options) {
275
282
  return this.options.limitPolicy(async () => {
276
- var _a;
283
+ var _a, _b;
277
284
  const coreHeaders = this.options.apiKey ? {
278
285
  "x-api-key": this.options.apiKey
279
286
  } : {
@@ -309,9 +316,19 @@ var ApiClient = class _ApiClient {
309
316
  } catch (e) {
310
317
  message = `General error`;
311
318
  }
319
+ if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
320
+ throw new BearerTokenNotValidOrExpiredError(
321
+ message,
322
+ (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
323
+ fetchUri.toString(),
324
+ apiResponse.status,
325
+ apiResponse.statusText,
326
+ _ApiClient.getRequestId(apiResponse)
327
+ );
328
+ }
312
329
  throw new ApiClientError(
313
330
  message,
314
- (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
331
+ (_b = options == null ? void 0 : options.method) != null ? _b : "GET",
315
332
  fetchUri.toString(),
316
333
  apiResponse.status,
317
334
  apiResponse.statusText,
@@ -210,6 +210,7 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
210
210
  var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
211
211
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
212
212
  var defaultLimitPolicy = (0, import_p_limit.default)(6);
213
+ var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
213
214
  var ApiClientError = class _ApiClientError extends Error {
214
215
  constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
215
216
  super(
@@ -225,6 +226,12 @@ var ApiClientError = class _ApiClientError extends Error {
225
226
  Object.setPrototypeOf(this, _ApiClientError.prototype);
226
227
  }
227
228
  };
229
+ var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
230
+ constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
231
+ super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
232
+ Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
233
+ }
234
+ };
228
235
  var ApiClient = class _ApiClient {
229
236
  constructor(options) {
230
237
  __publicField(this, "options");
@@ -258,7 +265,7 @@ var ApiClient = class _ApiClient {
258
265
  }
259
266
  async apiClientWithResponse(fetchUri, options) {
260
267
  return this.options.limitPolicy(async () => {
261
- var _a;
268
+ var _a, _b;
262
269
  const coreHeaders = this.options.apiKey ? {
263
270
  "x-api-key": this.options.apiKey
264
271
  } : {
@@ -294,9 +301,19 @@ var ApiClient = class _ApiClient {
294
301
  } catch (e) {
295
302
  message = `General error`;
296
303
  }
304
+ if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
305
+ throw new BearerTokenNotValidOrExpiredError(
306
+ message,
307
+ (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
308
+ fetchUri.toString(),
309
+ apiResponse.status,
310
+ apiResponse.statusText,
311
+ _ApiClient.getRequestId(apiResponse)
312
+ );
313
+ }
297
314
  throw new ApiClientError(
298
315
  message,
299
- (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
316
+ (_b = options == null ? void 0 : options.method) != null ? _b : "GET",
300
317
  fetchUri.toString(),
301
318
  apiResponse.status,
302
319
  apiResponse.statusText,
package/dist/handler.js CHANGED
@@ -417,6 +417,7 @@ var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cann
417
417
  var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
418
418
  var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
419
419
  var defaultLimitPolicy = (0, import_p_limit.default)(6);
420
+ var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
420
421
  var ApiClientError = class _ApiClientError extends Error {
421
422
  constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
422
423
  super(
@@ -432,6 +433,12 @@ var ApiClientError = class _ApiClientError extends Error {
432
433
  Object.setPrototypeOf(this, _ApiClientError.prototype);
433
434
  }
434
435
  };
436
+ var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
437
+ constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
438
+ super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
439
+ Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
440
+ }
441
+ };
435
442
  var ApiClient = class _ApiClient {
436
443
  constructor(options) {
437
444
  __publicField2(this, "options");
@@ -465,7 +472,7 @@ var ApiClient = class _ApiClient {
465
472
  }
466
473
  async apiClientWithResponse(fetchUri, options) {
467
474
  return this.options.limitPolicy(async () => {
468
- var _a;
475
+ var _a, _b;
469
476
  const coreHeaders = this.options.apiKey ? {
470
477
  "x-api-key": this.options.apiKey
471
478
  } : {
@@ -501,9 +508,19 @@ var ApiClient = class _ApiClient {
501
508
  } catch (e) {
502
509
  message = `General error`;
503
510
  }
511
+ if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
512
+ throw new BearerTokenNotValidOrExpiredError(
513
+ message,
514
+ (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
515
+ fetchUri.toString(),
516
+ apiResponse.status,
517
+ apiResponse.statusText,
518
+ _ApiClient.getRequestId(apiResponse)
519
+ );
520
+ }
504
521
  throw new ApiClientError(
505
522
  message,
506
- (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
523
+ (_b = options == null ? void 0 : options.method) != null ? _b : "GET",
507
524
  fetchUri.toString(),
508
525
  apiResponse.status,
509
526
  apiResponse.statusText,
package/dist/handler.mjs CHANGED
@@ -402,6 +402,7 @@ var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cann
402
402
  var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
403
403
  var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
404
404
  var defaultLimitPolicy = (0, import_p_limit.default)(6);
405
+ var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
405
406
  var ApiClientError = class _ApiClientError extends Error {
406
407
  constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
407
408
  super(
@@ -417,6 +418,12 @@ var ApiClientError = class _ApiClientError extends Error {
417
418
  Object.setPrototypeOf(this, _ApiClientError.prototype);
418
419
  }
419
420
  };
421
+ var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
422
+ constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
423
+ super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
424
+ Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
425
+ }
426
+ };
420
427
  var ApiClient = class _ApiClient {
421
428
  constructor(options) {
422
429
  __publicField2(this, "options");
@@ -450,7 +457,7 @@ var ApiClient = class _ApiClient {
450
457
  }
451
458
  async apiClientWithResponse(fetchUri, options) {
452
459
  return this.options.limitPolicy(async () => {
453
- var _a;
460
+ var _a, _b;
454
461
  const coreHeaders = this.options.apiKey ? {
455
462
  "x-api-key": this.options.apiKey
456
463
  } : {
@@ -486,9 +493,19 @@ var ApiClient = class _ApiClient {
486
493
  } catch (e) {
487
494
  message = `General error`;
488
495
  }
496
+ if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
497
+ throw new BearerTokenNotValidOrExpiredError(
498
+ message,
499
+ (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
500
+ fetchUri.toString(),
501
+ apiResponse.status,
502
+ apiResponse.statusText,
503
+ _ApiClient.getRequestId(apiResponse)
504
+ );
505
+ }
489
506
  throw new ApiClientError(
490
507
  message,
491
- (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
508
+ (_b = options == null ? void 0 : options.method) != null ? _b : "GET",
492
509
  fetchUri.toString(),
493
510
  apiResponse.status,
494
511
  apiResponse.statusText,
package/dist/index.esm.js CHANGED
@@ -408,6 +408,7 @@ var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cann
408
408
  var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
409
409
  var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
410
410
  var defaultLimitPolicy = (0, import_p_limit.default)(6);
411
+ var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
411
412
  var ApiClientError = class _ApiClientError extends Error {
412
413
  constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
413
414
  super(
@@ -423,6 +424,12 @@ var ApiClientError = class _ApiClientError extends Error {
423
424
  Object.setPrototypeOf(this, _ApiClientError.prototype);
424
425
  }
425
426
  };
427
+ var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
428
+ constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
429
+ super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
430
+ Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
431
+ }
432
+ };
426
433
  var ApiClient = class _ApiClient {
427
434
  constructor(options) {
428
435
  __publicField2(this, "options");
@@ -456,7 +463,7 @@ var ApiClient = class _ApiClient {
456
463
  }
457
464
  async apiClientWithResponse(fetchUri, options) {
458
465
  return this.options.limitPolicy(async () => {
459
- var _a;
466
+ var _a, _b;
460
467
  const coreHeaders = this.options.apiKey ? {
461
468
  "x-api-key": this.options.apiKey
462
469
  } : {
@@ -492,9 +499,19 @@ var ApiClient = class _ApiClient {
492
499
  } catch (e) {
493
500
  message = `General error`;
494
501
  }
502
+ if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
503
+ throw new BearerTokenNotValidOrExpiredError(
504
+ message,
505
+ (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
506
+ fetchUri.toString(),
507
+ apiResponse.status,
508
+ apiResponse.statusText,
509
+ _ApiClient.getRequestId(apiResponse)
510
+ );
511
+ }
495
512
  throw new ApiClientError(
496
513
  message,
497
- (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
514
+ (_b = options == null ? void 0 : options.method) != null ? _b : "GET",
498
515
  fetchUri.toString(),
499
516
  apiResponse.status,
500
517
  apiResponse.statusText,
package/dist/index.js CHANGED
@@ -435,6 +435,7 @@ var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cann
435
435
  var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
436
436
  var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
437
437
  var defaultLimitPolicy = (0, import_p_limit.default)(6);
438
+ var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
438
439
  var ApiClientError = class _ApiClientError extends Error {
439
440
  constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
440
441
  super(
@@ -450,6 +451,12 @@ var ApiClientError = class _ApiClientError extends Error {
450
451
  Object.setPrototypeOf(this, _ApiClientError.prototype);
451
452
  }
452
453
  };
454
+ var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
455
+ constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
456
+ super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
457
+ Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
458
+ }
459
+ };
453
460
  var ApiClient = class _ApiClient {
454
461
  constructor(options) {
455
462
  __publicField2(this, "options");
@@ -483,7 +490,7 @@ var ApiClient = class _ApiClient {
483
490
  }
484
491
  async apiClientWithResponse(fetchUri, options) {
485
492
  return this.options.limitPolicy(async () => {
486
- var _a;
493
+ var _a, _b;
487
494
  const coreHeaders = this.options.apiKey ? {
488
495
  "x-api-key": this.options.apiKey
489
496
  } : {
@@ -519,9 +526,19 @@ var ApiClient = class _ApiClient {
519
526
  } catch (e) {
520
527
  message = `General error`;
521
528
  }
529
+ if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
530
+ throw new BearerTokenNotValidOrExpiredError(
531
+ message,
532
+ (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
533
+ fetchUri.toString(),
534
+ apiResponse.status,
535
+ apiResponse.statusText,
536
+ _ApiClient.getRequestId(apiResponse)
537
+ );
538
+ }
522
539
  throw new ApiClientError(
523
540
  message,
524
- (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
541
+ (_b = options == null ? void 0 : options.method) != null ? _b : "GET",
525
542
  fetchUri.toString(),
526
543
  apiResponse.status,
527
544
  apiResponse.statusText,
package/dist/index.mjs CHANGED
@@ -408,6 +408,7 @@ var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cann
408
408
  var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
409
409
  var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
410
410
  var defaultLimitPolicy = (0, import_p_limit.default)(6);
411
+ var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
411
412
  var ApiClientError = class _ApiClientError extends Error {
412
413
  constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
413
414
  super(
@@ -423,6 +424,12 @@ var ApiClientError = class _ApiClientError extends Error {
423
424
  Object.setPrototypeOf(this, _ApiClientError.prototype);
424
425
  }
425
426
  };
427
+ var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
428
+ constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
429
+ super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
430
+ Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
431
+ }
432
+ };
426
433
  var ApiClient = class _ApiClient {
427
434
  constructor(options) {
428
435
  __publicField2(this, "options");
@@ -456,7 +463,7 @@ var ApiClient = class _ApiClient {
456
463
  }
457
464
  async apiClientWithResponse(fetchUri, options) {
458
465
  return this.options.limitPolicy(async () => {
459
- var _a;
466
+ var _a, _b;
460
467
  const coreHeaders = this.options.apiKey ? {
461
468
  "x-api-key": this.options.apiKey
462
469
  } : {
@@ -492,9 +499,19 @@ var ApiClient = class _ApiClient {
492
499
  } catch (e) {
493
500
  message = `General error`;
494
501
  }
502
+ if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
503
+ throw new BearerTokenNotValidOrExpiredError(
504
+ message,
505
+ (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
506
+ fetchUri.toString(),
507
+ apiResponse.status,
508
+ apiResponse.statusText,
509
+ _ApiClient.getRequestId(apiResponse)
510
+ );
511
+ }
495
512
  throw new ApiClientError(
496
513
  message,
497
- (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
514
+ (_b = options == null ? void 0 : options.method) != null ? _b : "GET",
498
515
  fetchUri.toString(),
499
516
  apiResponse.status,
500
517
  apiResponse.statusText,
@@ -606,6 +606,7 @@ var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cann
606
606
  var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
607
607
  var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
608
608
  var defaultLimitPolicy = (0, import_p_limit.default)(6);
609
+ var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
609
610
  var ApiClientError = class _ApiClientError extends Error {
610
611
  constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
611
612
  super(
@@ -621,6 +622,12 @@ var ApiClientError = class _ApiClientError extends Error {
621
622
  Object.setPrototypeOf(this, _ApiClientError.prototype);
622
623
  }
623
624
  };
625
+ var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
626
+ constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
627
+ super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
628
+ Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
629
+ }
630
+ };
624
631
  var ApiClient = class _ApiClient {
625
632
  constructor(options) {
626
633
  __publicField2(this, "options");
@@ -654,7 +661,7 @@ var ApiClient = class _ApiClient {
654
661
  }
655
662
  async apiClientWithResponse(fetchUri, options) {
656
663
  return this.options.limitPolicy(async () => {
657
- var _a;
664
+ var _a, _b;
658
665
  const coreHeaders = this.options.apiKey ? {
659
666
  "x-api-key": this.options.apiKey
660
667
  } : {
@@ -690,9 +697,19 @@ var ApiClient = class _ApiClient {
690
697
  } catch (e) {
691
698
  message = `General error`;
692
699
  }
700
+ if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
701
+ throw new BearerTokenNotValidOrExpiredError(
702
+ message,
703
+ (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
704
+ fetchUri.toString(),
705
+ apiResponse.status,
706
+ apiResponse.statusText,
707
+ _ApiClient.getRequestId(apiResponse)
708
+ );
709
+ }
693
710
  throw new ApiClientError(
694
711
  message,
695
- (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
712
+ (_b = options == null ? void 0 : options.method) != null ? _b : "GET",
696
713
  fetchUri.toString(),
697
714
  apiResponse.status,
698
715
  apiResponse.statusText,
@@ -591,6 +591,7 @@ var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cann
591
591
  var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
592
592
  var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
593
593
  var defaultLimitPolicy = (0, import_p_limit.default)(6);
594
+ var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
594
595
  var ApiClientError = class _ApiClientError extends Error {
595
596
  constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
596
597
  super(
@@ -606,6 +607,12 @@ var ApiClientError = class _ApiClientError extends Error {
606
607
  Object.setPrototypeOf(this, _ApiClientError.prototype);
607
608
  }
608
609
  };
610
+ var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
611
+ constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
612
+ super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
613
+ Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
614
+ }
615
+ };
609
616
  var ApiClient = class _ApiClient {
610
617
  constructor(options) {
611
618
  __publicField2(this, "options");
@@ -639,7 +646,7 @@ var ApiClient = class _ApiClient {
639
646
  }
640
647
  async apiClientWithResponse(fetchUri, options) {
641
648
  return this.options.limitPolicy(async () => {
642
- var _a;
649
+ var _a, _b;
643
650
  const coreHeaders = this.options.apiKey ? {
644
651
  "x-api-key": this.options.apiKey
645
652
  } : {
@@ -675,9 +682,19 @@ var ApiClient = class _ApiClient {
675
682
  } catch (e) {
676
683
  message = `General error`;
677
684
  }
685
+ if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
686
+ throw new BearerTokenNotValidOrExpiredError(
687
+ message,
688
+ (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
689
+ fetchUri.toString(),
690
+ apiResponse.status,
691
+ apiResponse.statusText,
692
+ _ApiClient.getRequestId(apiResponse)
693
+ );
694
+ }
678
695
  throw new ApiClientError(
679
696
  message,
680
- (_a = options == null ? void 0 : options.method) != null ? _a : "GET",
697
+ (_b = options == null ? void 0 : options.method) != null ? _b : "GET",
681
698
  fetchUri.toString(),
682
699
  apiResponse.status,
683
700
  apiResponse.statusText,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/next-app-router",
3
- "version": "20.72.4-alpha.6+93c66ff08a",
3
+ "version": "20.73.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "scripts": {
6
6
  "build": "tsup",
@@ -98,12 +98,12 @@
98
98
  "vitest": "4.1.9"
99
99
  },
100
100
  "dependencies": {
101
- "@uniformdev/canvas-react": "20.72.4-alpha.6+93c66ff08a",
102
- "@uniformdev/next-app-router-client": "20.72.4-alpha.6+93c66ff08a",
103
- "@uniformdev/next-app-router-shared": "20.72.4-alpha.6+93c66ff08a",
104
- "@uniformdev/redirect": "20.72.4-alpha.6+93c66ff08a",
105
- "@uniformdev/richtext": "20.72.4-alpha.6+93c66ff08a",
106
- "@uniformdev/webhooks": "20.72.4-alpha.6+93c66ff08a",
101
+ "@uniformdev/canvas-react": "20.73.0",
102
+ "@uniformdev/next-app-router-client": "20.73.0",
103
+ "@uniformdev/next-app-router-shared": "20.73.0",
104
+ "@uniformdev/redirect": "20.73.0",
105
+ "@uniformdev/richtext": "20.73.0",
106
+ "@uniformdev/webhooks": "20.73.0",
107
107
  "@vercel/functions": "^3.7.2",
108
108
  "encoding": "^0.1.13",
109
109
  "server-only": "^0.0.1",
@@ -120,5 +120,5 @@
120
120
  "publishConfig": {
121
121
  "access": "public"
122
122
  },
123
- "gitHead": "93c66ff08aa52bcdf60dd38e32e6e39f6ddebab6"
123
+ "gitHead": "23833095a08c168a489a81cab138bd1ad45344cc"
124
124
  }