@uniformdev/next-app-router 20.72.3-alpha.2 → 20.72.3-alpha.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.
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();
@@ -899,11 +936,11 @@ var ATTRIBUTE_PARAMETER_ID = "data-uniform-parameter-id";
899
936
  var ATTRIBUTE_PARAMETER_TYPE = "data-uniform-parameter-type";
900
937
 
901
938
  // src/components/UniformRichText.tsx
902
- var import_richtext5 = require("@uniformdev/richtext");
939
+ var import_richtext6 = require("@uniformdev/richtext");
903
940
  var import_react12 = __toESM(require("react"));
904
941
 
905
942
  // src/components/UniformRichTextNode.tsx
906
- var import_richtext4 = require("@uniformdev/richtext");
943
+ var import_richtext5 = require("@uniformdev/richtext");
907
944
  var import_react11 = __toESM(require("react"));
908
945
 
909
946
  // src/components/nodes/AssetRichTextNode.tsx
@@ -941,11 +978,11 @@ var LinebreakRichTextNode = () => {
941
978
  };
942
979
 
943
980
  // src/components/nodes/LinkRichTextNode.tsx
944
- var import_canvas_react = require("@uniformdev/canvas-react");
981
+ var import_richtext = require("@uniformdev/richtext");
945
982
  var import_react4 = __toESM(require("react"));
946
983
  var LinkRichTextNode = ({ children, node }) => {
947
984
  const { link } = node;
948
- return /* @__PURE__ */ import_react4.default.createElement("a", { ...(0, import_canvas_react.linkParamValueToAnchorProps)(link) }, children);
985
+ return /* @__PURE__ */ import_react4.default.createElement("a", { ...(0, import_richtext.linkParamValueToAnchorProps)(link) }, children);
949
986
  };
950
987
 
951
988
  // src/components/nodes/ListItemRichTextNode.tsx
@@ -964,26 +1001,26 @@ var ListRichTextNode = ({ children, node }) => {
964
1001
  };
965
1002
 
966
1003
  // src/components/nodes/ParagraphRichTextNode.tsx
967
- var import_richtext = require("@uniformdev/richtext");
1004
+ var import_richtext2 = require("@uniformdev/richtext");
968
1005
  var import_react7 = __toESM(require("react"));
969
1006
  var ParagraphRichTextNode = ({ children, node }) => {
970
1007
  const { format, direction } = node;
971
1008
  return /* @__PURE__ */ import_react7.default.createElement(
972
1009
  "p",
973
1010
  {
974
- dir: (0, import_richtext.isPureDirection)(direction) ? direction : void 0,
975
- style: (0, import_richtext.isPureTextAlign)(format) ? { textAlign: format } : void 0
1011
+ dir: (0, import_richtext2.isPureDirection)(direction) ? direction : void 0,
1012
+ style: (0, import_richtext2.isPureTextAlign)(format) ? { textAlign: format } : void 0
976
1013
  },
977
1014
  children
978
1015
  );
979
1016
  };
980
1017
 
981
1018
  // src/components/nodes/TableCellRichTextNode.tsx
982
- var import_richtext2 = require("@uniformdev/richtext");
1019
+ var import_richtext3 = require("@uniformdev/richtext");
983
1020
  var import_react8 = __toESM(require("react"));
984
1021
  var TableCellRichTextNode = ({ children, node }) => {
985
1022
  const { headerState } = node;
986
- const TableCellTag = (0, import_richtext2.getRichTextTagFromTableCellHeaderState)(headerState);
1023
+ const TableCellTag = (0, import_richtext3.getRichTextTagFromTableCellHeaderState)(headerState);
987
1024
  return /* @__PURE__ */ import_react8.default.createElement(TableCellTag, null, children);
988
1025
  };
989
1026
 
@@ -994,18 +1031,18 @@ var TabRichTextNode = () => {
994
1031
  };
995
1032
 
996
1033
  // src/components/nodes/TextRichTextNode.tsx
997
- var import_richtext3 = require("@uniformdev/richtext");
1034
+ var import_richtext4 = require("@uniformdev/richtext");
998
1035
  var import_react10 = __toESM(require("react"));
999
1036
  var TextRichTextNode = ({ node }) => {
1000
1037
  const { text, format } = node;
1001
- const tags = (0, import_richtext3.getRichTextTagsFromTextFormat)(format);
1038
+ const tags = (0, import_richtext4.getRichTextTagsFromTextFormat)(format);
1002
1039
  return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ import_react10.default.createElement(Tag, null, children), text) : text);
1003
1040
  };
1004
1041
 
1005
1042
  // src/components/UniformRichTextNode.tsx
1006
1043
  function UniformRichTextNode({ node, ...props }) {
1007
1044
  var _a;
1008
- if (!(0, import_richtext4.isRichTextNode)(node)) return null;
1045
+ if (!(0, import_richtext5.isRichTextNode)(node)) return null;
1009
1046
  let NodeRenderer = (_a = props.resolveRichTextRenderer) == null ? void 0 : _a.call(props, node);
1010
1047
  if (typeof NodeRenderer === "undefined") {
1011
1048
  NodeRenderer = resolveRichTextDefaultRenderer(node);
@@ -1059,8 +1096,8 @@ var UniformRichText = import_react12.default.forwardRef(function UniformRichText
1059
1096
  }
1060
1097
  const computedPlaceholder = typeof placeholder === "function" ? placeholder({ id: parameter.parameterId }) : placeholder;
1061
1098
  const value = parameter.value;
1062
- if (!value || !(0, import_richtext5.isRichTextValue)(value)) return null;
1063
- if (!isContextualEditing && (0, import_richtext5.isRichTextValueConsideredEmpty)(value)) return null;
1099
+ if (!value || !(0, import_richtext6.isRichTextValue)(value)) return null;
1100
+ if (!isContextualEditing && (0, import_richtext6.isRichTextValueConsideredEmpty)(value)) return null;
1064
1101
  return Tag === null ? /* @__PURE__ */ import_react12.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react12.default.createElement(
1065
1102
  Tag,
1066
1103
  {
@@ -1072,7 +1109,7 @@ var UniformRichText = import_react12.default.forwardRef(function UniformRichText
1072
1109
  [ATTRIBUTE_PARAMETER_TYPE]: "richText"
1073
1110
  } : {}
1074
1111
  },
1075
- (0, import_richtext5.isRichTextValueConsideredEmpty)(value) ? /* @__PURE__ */ import_react12.default.createElement("p", null, /* @__PURE__ */ import_react12.default.createElement("i", null, computedPlaceholder)) : /* @__PURE__ */ import_react12.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
1112
+ (0, import_richtext6.isRichTextValueConsideredEmpty)(value) ? /* @__PURE__ */ import_react12.default.createElement("p", null, /* @__PURE__ */ import_react12.default.createElement("i", null, computedPlaceholder)) : /* @__PURE__ */ import_react12.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
1076
1113
  );
1077
1114
  });
1078
1115