@uniformdev/next-app-router 20.72.3-alpha.3 → 20.72.3-alpha.40

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,
@@ -1252,6 +1269,14 @@ function projectionToQuery(spec) {
1252
1269
  }
1253
1270
  return out;
1254
1271
  }
1272
+ var CANVAS_DRAFT_STATE = 0;
1273
+ var CANVAS_PUBLISHED_STATE = 64;
1274
+ var CANVAS_EDITOR_STATE = 63;
1275
+ var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
1276
+ var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
1277
+ var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
1278
+ var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
1279
+ var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
1255
1280
  var _contentTypesUrl;
1256
1281
  var _entriesUrl;
1257
1282
  var _ContentClient = class _ContentClient2 extends ApiClient {
@@ -1358,14 +1383,18 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
1358
1383
  constructor(options) {
1359
1384
  super(options);
1360
1385
  }
1361
- /** Fetches all DataTypes for a project */
1362
- async get(options) {
1386
+ /** Fetches a list of DataTypes for a project */
1387
+ async list(options) {
1363
1388
  const { projectId } = this.options;
1364
1389
  const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8), { ...options, projectId });
1365
1390
  return await this.apiClient(fetchUri);
1366
1391
  }
1392
+ /** @deprecated Use {@link list} instead. */
1393
+ async get(options) {
1394
+ return this.list(options);
1395
+ }
1367
1396
  /** Updates or creates (based on id) a DataType */
1368
- async upsert(body) {
1397
+ async save(body) {
1369
1398
  const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
1370
1399
  await this.apiClient(fetchUri, {
1371
1400
  method: "PUT",
@@ -1373,6 +1402,10 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
1373
1402
  expectNoContent: true
1374
1403
  });
1375
1404
  }
1405
+ /** @deprecated Use {@link save} instead. */
1406
+ async upsert(body) {
1407
+ return this.save(body);
1408
+ }
1376
1409
  /** Deletes a DataType */
1377
1410
  async remove(body) {
1378
1411
  const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
@@ -1385,14 +1418,6 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
1385
1418
  };
1386
1419
  _url8 = /* @__PURE__ */ new WeakMap();
1387
1420
  __privateAdd3(_DataTypeClient, _url8, "/api/v1/data-types");
1388
- var CANVAS_DRAFT_STATE = 0;
1389
- var CANVAS_PUBLISHED_STATE = 64;
1390
- var CANVAS_EDITOR_STATE = 63;
1391
- var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
1392
- var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
1393
- var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
1394
- var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
1395
- var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
1396
1421
  var _baseUrl;
1397
1422
  var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2 extends ApiClient {
1398
1423
  constructor(options) {
@@ -1450,20 +1475,28 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
1450
1475
  * When teamId is provided, returns a single team with its projects.
1451
1476
  * When omitted, returns all accessible teams and their projects.
1452
1477
  */
1453
- async getProjects(options) {
1478
+ async list(options) {
1454
1479
  const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
1455
1480
  return await this.apiClient(fetchUri);
1456
1481
  }
1482
+ /** @deprecated Use {@link list} instead. */
1483
+ async getProjects(options) {
1484
+ return this.list(options);
1485
+ }
1457
1486
  /** Updates or creates (based on id) a Project */
1458
- async upsert(body) {
1487
+ async save(body) {
1459
1488
  const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
1460
1489
  return await this.apiClient(fetchUri, {
1461
1490
  method: "PUT",
1462
1491
  body: JSON.stringify({ ...body })
1463
1492
  });
1464
1493
  }
1494
+ /** @deprecated Use {@link save} instead. */
1495
+ async upsert(body) {
1496
+ return this.save(body);
1497
+ }
1465
1498
  /** Deletes a Project */
1466
- async delete(body) {
1499
+ async remove(body) {
1467
1500
  const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
1468
1501
  await this.apiClient(fetchUri, {
1469
1502
  method: "DELETE",
@@ -1471,6 +1504,10 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
1471
1504
  expectNoContent: true
1472
1505
  });
1473
1506
  }
1507
+ /** @deprecated Use {@link remove} instead. */
1508
+ async delete(body) {
1509
+ return this.remove(body);
1510
+ }
1474
1511
  };
1475
1512
  _url22 = /* @__PURE__ */ new WeakMap();
1476
1513
  _projectsUrl = /* @__PURE__ */ new WeakMap();
@@ -1486,8 +1523,14 @@ var RouteClient = class extends ApiClient {
1486
1523
  super(options);
1487
1524
  this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
1488
1525
  }
1489
- /** Fetches lists of Canvas compositions, optionally by type */
1490
- async getRoute(options) {
1526
+ /**
1527
+ * Resolves a route to a composition, redirect, or not-found result.
1528
+ *
1529
+ * An optional `select` projection applies to the resolved composition when
1530
+ * the route matches one; redirect / notFound responses pass through
1531
+ * untouched.
1532
+ */
1533
+ async get(options) {
1491
1534
  const { projectId } = this.options;
1492
1535
  const { select, ...rest } = options != null ? options : {};
1493
1536
  const rewrittenSelect = projectionToQuery(select);
@@ -1497,6 +1540,10 @@ var RouteClient = class extends ApiClient {
1497
1540
  this.options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0
1498
1541
  );
1499
1542
  }
1543
+ /** @deprecated use {@link RouteClient.get} instead (renamed). */
1544
+ async getRoute(options) {
1545
+ return this.get(options);
1546
+ }
1500
1547
  };
1501
1548
  var getDataSourceVariantFromRouteGetParams = (params, defaultPreviewState) => {
1502
1549
  var _a, _b;
@@ -1957,14 +2004,14 @@ var DefaultDataClient = class {
1957
2004
  if (oldCachedRoute) {
1958
2005
  (0, import_functions.waitUntil)(
1959
2006
  (async () => {
1960
- const result2 = await routeClient.getRoute(route);
2007
+ const result2 = await routeClient.get(route);
1961
2008
  await cacheNewRoute(result2);
1962
2009
  })()
1963
2010
  );
1964
2011
  return oldCachedRoute;
1965
2012
  }
1966
2013
  }
1967
- const result = await routeClient.getRoute(route);
2014
+ const result = await routeClient.get(route);
1968
2015
  (0, import_functions.waitUntil)(
1969
2016
  (async () => {
1970
2017
  await Promise.all([
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,
@@ -1239,6 +1256,14 @@ function projectionToQuery(spec) {
1239
1256
  }
1240
1257
  return out;
1241
1258
  }
1259
+ var CANVAS_DRAFT_STATE = 0;
1260
+ var CANVAS_PUBLISHED_STATE = 64;
1261
+ var CANVAS_EDITOR_STATE = 63;
1262
+ var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
1263
+ var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
1264
+ var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
1265
+ var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
1266
+ var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
1242
1267
  var _contentTypesUrl;
1243
1268
  var _entriesUrl;
1244
1269
  var _ContentClient = class _ContentClient2 extends ApiClient {
@@ -1345,14 +1370,18 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
1345
1370
  constructor(options) {
1346
1371
  super(options);
1347
1372
  }
1348
- /** Fetches all DataTypes for a project */
1349
- async get(options) {
1373
+ /** Fetches a list of DataTypes for a project */
1374
+ async list(options) {
1350
1375
  const { projectId } = this.options;
1351
1376
  const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8), { ...options, projectId });
1352
1377
  return await this.apiClient(fetchUri);
1353
1378
  }
1379
+ /** @deprecated Use {@link list} instead. */
1380
+ async get(options) {
1381
+ return this.list(options);
1382
+ }
1354
1383
  /** Updates or creates (based on id) a DataType */
1355
- async upsert(body) {
1384
+ async save(body) {
1356
1385
  const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
1357
1386
  await this.apiClient(fetchUri, {
1358
1387
  method: "PUT",
@@ -1360,6 +1389,10 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
1360
1389
  expectNoContent: true
1361
1390
  });
1362
1391
  }
1392
+ /** @deprecated Use {@link save} instead. */
1393
+ async upsert(body) {
1394
+ return this.save(body);
1395
+ }
1363
1396
  /** Deletes a DataType */
1364
1397
  async remove(body) {
1365
1398
  const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
@@ -1372,14 +1405,6 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
1372
1405
  };
1373
1406
  _url8 = /* @__PURE__ */ new WeakMap();
1374
1407
  __privateAdd3(_DataTypeClient, _url8, "/api/v1/data-types");
1375
- var CANVAS_DRAFT_STATE = 0;
1376
- var CANVAS_PUBLISHED_STATE = 64;
1377
- var CANVAS_EDITOR_STATE = 63;
1378
- var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
1379
- var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
1380
- var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
1381
- var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
1382
- var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
1383
1408
  var _baseUrl;
1384
1409
  var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2 extends ApiClient {
1385
1410
  constructor(options) {
@@ -1437,20 +1462,28 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
1437
1462
  * When teamId is provided, returns a single team with its projects.
1438
1463
  * When omitted, returns all accessible teams and their projects.
1439
1464
  */
1440
- async getProjects(options) {
1465
+ async list(options) {
1441
1466
  const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
1442
1467
  return await this.apiClient(fetchUri);
1443
1468
  }
1469
+ /** @deprecated Use {@link list} instead. */
1470
+ async getProjects(options) {
1471
+ return this.list(options);
1472
+ }
1444
1473
  /** Updates or creates (based on id) a Project */
1445
- async upsert(body) {
1474
+ async save(body) {
1446
1475
  const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
1447
1476
  return await this.apiClient(fetchUri, {
1448
1477
  method: "PUT",
1449
1478
  body: JSON.stringify({ ...body })
1450
1479
  });
1451
1480
  }
1481
+ /** @deprecated Use {@link save} instead. */
1482
+ async upsert(body) {
1483
+ return this.save(body);
1484
+ }
1452
1485
  /** Deletes a Project */
1453
- async delete(body) {
1486
+ async remove(body) {
1454
1487
  const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
1455
1488
  await this.apiClient(fetchUri, {
1456
1489
  method: "DELETE",
@@ -1458,6 +1491,10 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
1458
1491
  expectNoContent: true
1459
1492
  });
1460
1493
  }
1494
+ /** @deprecated Use {@link remove} instead. */
1495
+ async delete(body) {
1496
+ return this.remove(body);
1497
+ }
1461
1498
  };
1462
1499
  _url22 = /* @__PURE__ */ new WeakMap();
1463
1500
  _projectsUrl = /* @__PURE__ */ new WeakMap();
@@ -1473,8 +1510,14 @@ var RouteClient = class extends ApiClient {
1473
1510
  super(options);
1474
1511
  this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
1475
1512
  }
1476
- /** Fetches lists of Canvas compositions, optionally by type */
1477
- async getRoute(options) {
1513
+ /**
1514
+ * Resolves a route to a composition, redirect, or not-found result.
1515
+ *
1516
+ * An optional `select` projection applies to the resolved composition when
1517
+ * the route matches one; redirect / notFound responses pass through
1518
+ * untouched.
1519
+ */
1520
+ async get(options) {
1478
1521
  const { projectId } = this.options;
1479
1522
  const { select, ...rest } = options != null ? options : {};
1480
1523
  const rewrittenSelect = projectionToQuery(select);
@@ -1484,6 +1527,10 @@ var RouteClient = class extends ApiClient {
1484
1527
  this.options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0
1485
1528
  );
1486
1529
  }
1530
+ /** @deprecated use {@link RouteClient.get} instead (renamed). */
1531
+ async getRoute(options) {
1532
+ return this.get(options);
1533
+ }
1487
1534
  };
1488
1535
  var getDataSourceVariantFromRouteGetParams = (params, defaultPreviewState) => {
1489
1536
  var _a, _b;
@@ -1944,14 +1991,14 @@ var DefaultDataClient = class {
1944
1991
  if (oldCachedRoute) {
1945
1992
  waitUntil(
1946
1993
  (async () => {
1947
- const result2 = await routeClient.getRoute(route);
1994
+ const result2 = await routeClient.get(route);
1948
1995
  await cacheNewRoute(result2);
1949
1996
  })()
1950
1997
  );
1951
1998
  return oldCachedRoute;
1952
1999
  }
1953
2000
  }
1954
- const result = await routeClient.getRoute(route);
2001
+ const result = await routeClient.get(route);
1955
2002
  waitUntil(
1956
2003
  (async () => {
1957
2004
  await Promise.all([
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,
@@ -674,6 +691,10 @@ function projectionToQuery(spec) {
674
691
  }
675
692
  return out;
676
693
  }
694
+ var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
695
+ var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
696
+ var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
697
+ var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
677
698
  var _contentTypesUrl;
678
699
  var _entriesUrl;
679
700
  var _ContentClient = class _ContentClient2 extends ApiClient {
@@ -780,14 +801,18 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
780
801
  constructor(options) {
781
802
  super(options);
782
803
  }
783
- /** Fetches all DataTypes for a project */
784
- async get(options) {
804
+ /** Fetches a list of DataTypes for a project */
805
+ async list(options) {
785
806
  const { projectId } = this.options;
786
807
  const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8), { ...options, projectId });
787
808
  return await this.apiClient(fetchUri);
788
809
  }
810
+ /** @deprecated Use {@link list} instead. */
811
+ async get(options) {
812
+ return this.list(options);
813
+ }
789
814
  /** Updates or creates (based on id) a DataType */
790
- async upsert(body) {
815
+ async save(body) {
791
816
  const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
792
817
  await this.apiClient(fetchUri, {
793
818
  method: "PUT",
@@ -795,6 +820,10 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
795
820
  expectNoContent: true
796
821
  });
797
822
  }
823
+ /** @deprecated Use {@link save} instead. */
824
+ async upsert(body) {
825
+ return this.save(body);
826
+ }
798
827
  /** Deletes a DataType */
799
828
  async remove(body) {
800
829
  const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
@@ -807,10 +836,6 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
807
836
  };
808
837
  _url8 = /* @__PURE__ */ new WeakMap();
809
838
  __privateAdd2(_DataTypeClient, _url8, "/api/v1/data-types");
810
- var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
811
- var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
812
- var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
813
- var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
814
839
  var _baseUrl;
815
840
  var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2 extends ApiClient {
816
841
  constructor(options) {
@@ -868,20 +893,28 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
868
893
  * When teamId is provided, returns a single team with its projects.
869
894
  * When omitted, returns all accessible teams and their projects.
870
895
  */
871
- async getProjects(options) {
896
+ async list(options) {
872
897
  const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
873
898
  return await this.apiClient(fetchUri);
874
899
  }
900
+ /** @deprecated Use {@link list} instead. */
901
+ async getProjects(options) {
902
+ return this.list(options);
903
+ }
875
904
  /** Updates or creates (based on id) a Project */
876
- async upsert(body) {
905
+ async save(body) {
877
906
  const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22));
878
907
  return await this.apiClient(fetchUri, {
879
908
  method: "PUT",
880
909
  body: JSON.stringify({ ...body })
881
910
  });
882
911
  }
912
+ /** @deprecated Use {@link save} instead. */
913
+ async upsert(body) {
914
+ return this.save(body);
915
+ }
883
916
  /** Deletes a Project */
884
- async delete(body) {
917
+ async remove(body) {
885
918
  const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22));
886
919
  await this.apiClient(fetchUri, {
887
920
  method: "DELETE",
@@ -889,6 +922,10 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
889
922
  expectNoContent: true
890
923
  });
891
924
  }
925
+ /** @deprecated Use {@link remove} instead. */
926
+ async delete(body) {
927
+ return this.remove(body);
928
+ }
892
929
  };
893
930
  _url22 = /* @__PURE__ */ new WeakMap();
894
931
  _projectsUrl = /* @__PURE__ */ new WeakMap();
@@ -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,
@@ -659,6 +676,10 @@ function projectionToQuery(spec) {
659
676
  }
660
677
  return out;
661
678
  }
679
+ var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
680
+ var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
681
+ var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
682
+ var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
662
683
  var _contentTypesUrl;
663
684
  var _entriesUrl;
664
685
  var _ContentClient = class _ContentClient2 extends ApiClient {
@@ -765,14 +786,18 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
765
786
  constructor(options) {
766
787
  super(options);
767
788
  }
768
- /** Fetches all DataTypes for a project */
769
- async get(options) {
789
+ /** Fetches a list of DataTypes for a project */
790
+ async list(options) {
770
791
  const { projectId } = this.options;
771
792
  const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8), { ...options, projectId });
772
793
  return await this.apiClient(fetchUri);
773
794
  }
795
+ /** @deprecated Use {@link list} instead. */
796
+ async get(options) {
797
+ return this.list(options);
798
+ }
774
799
  /** Updates or creates (based on id) a DataType */
775
- async upsert(body) {
800
+ async save(body) {
776
801
  const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
777
802
  await this.apiClient(fetchUri, {
778
803
  method: "PUT",
@@ -780,6 +805,10 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
780
805
  expectNoContent: true
781
806
  });
782
807
  }
808
+ /** @deprecated Use {@link save} instead. */
809
+ async upsert(body) {
810
+ return this.save(body);
811
+ }
783
812
  /** Deletes a DataType */
784
813
  async remove(body) {
785
814
  const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
@@ -792,10 +821,6 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
792
821
  };
793
822
  _url8 = /* @__PURE__ */ new WeakMap();
794
823
  __privateAdd2(_DataTypeClient, _url8, "/api/v1/data-types");
795
- var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
796
- var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
797
- var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
798
- var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
799
824
  var _baseUrl;
800
825
  var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2 extends ApiClient {
801
826
  constructor(options) {
@@ -853,20 +878,28 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
853
878
  * When teamId is provided, returns a single team with its projects.
854
879
  * When omitted, returns all accessible teams and their projects.
855
880
  */
856
- async getProjects(options) {
881
+ async list(options) {
857
882
  const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
858
883
  return await this.apiClient(fetchUri);
859
884
  }
885
+ /** @deprecated Use {@link list} instead. */
886
+ async getProjects(options) {
887
+ return this.list(options);
888
+ }
860
889
  /** Updates or creates (based on id) a Project */
861
- async upsert(body) {
890
+ async save(body) {
862
891
  const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22));
863
892
  return await this.apiClient(fetchUri, {
864
893
  method: "PUT",
865
894
  body: JSON.stringify({ ...body })
866
895
  });
867
896
  }
897
+ /** @deprecated Use {@link save} instead. */
898
+ async upsert(body) {
899
+ return this.save(body);
900
+ }
868
901
  /** Deletes a Project */
869
- async delete(body) {
902
+ async remove(body) {
870
903
  const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22));
871
904
  await this.apiClient(fetchUri, {
872
905
  method: "DELETE",
@@ -874,6 +907,10 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
874
907
  expectNoContent: true
875
908
  });
876
909
  }
910
+ /** @deprecated Use {@link remove} instead. */
911
+ async delete(body) {
912
+ return this.remove(body);
913
+ }
877
914
  };
878
915
  _url22 = /* @__PURE__ */ new WeakMap();
879
916
  _projectsUrl = /* @__PURE__ */ new WeakMap();