@uniformdev/next-app-router 20.72.2 → 20.72.3-alpha.14
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 +95 -23
- package/dist/cache.mjs +95 -23
- package/dist/component.js +92 -30
- package/dist/component.mjs +78 -16
- package/dist/handler.js +182 -155
- package/dist/handler.mjs +182 -155
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.esm.js +223 -57
- package/dist/index.js +224 -57
- package/dist/index.mjs +223 -57
- package/dist/middleware.js +200 -163
- package/dist/middleware.mjs +200 -163
- package/package.json +8 -8
package/dist/cache.js
CHANGED
|
@@ -1252,6 +1252,14 @@ function projectionToQuery(spec) {
|
|
|
1252
1252
|
}
|
|
1253
1253
|
return out;
|
|
1254
1254
|
}
|
|
1255
|
+
var CANVAS_DRAFT_STATE = 0;
|
|
1256
|
+
var CANVAS_PUBLISHED_STATE = 64;
|
|
1257
|
+
var CANVAS_EDITOR_STATE = 63;
|
|
1258
|
+
var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
|
|
1259
|
+
var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
|
|
1260
|
+
var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
|
|
1261
|
+
var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
|
|
1262
|
+
var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
|
|
1255
1263
|
var _contentTypesUrl;
|
|
1256
1264
|
var _entriesUrl;
|
|
1257
1265
|
var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
@@ -1358,14 +1366,18 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1358
1366
|
constructor(options) {
|
|
1359
1367
|
super(options);
|
|
1360
1368
|
}
|
|
1361
|
-
/** Fetches
|
|
1362
|
-
async
|
|
1369
|
+
/** Fetches a list of DataTypes for a project */
|
|
1370
|
+
async list(options) {
|
|
1363
1371
|
const { projectId } = this.options;
|
|
1364
1372
|
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8), { ...options, projectId });
|
|
1365
1373
|
return await this.apiClient(fetchUri);
|
|
1366
1374
|
}
|
|
1375
|
+
/** @deprecated Use {@link list} instead. */
|
|
1376
|
+
async get(options) {
|
|
1377
|
+
return this.list(options);
|
|
1378
|
+
}
|
|
1367
1379
|
/** Updates or creates (based on id) a DataType */
|
|
1368
|
-
async
|
|
1380
|
+
async save(body) {
|
|
1369
1381
|
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
|
|
1370
1382
|
await this.apiClient(fetchUri, {
|
|
1371
1383
|
method: "PUT",
|
|
@@ -1373,6 +1385,10 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1373
1385
|
expectNoContent: true
|
|
1374
1386
|
});
|
|
1375
1387
|
}
|
|
1388
|
+
/** @deprecated Use {@link save} instead. */
|
|
1389
|
+
async upsert(body) {
|
|
1390
|
+
return this.save(body);
|
|
1391
|
+
}
|
|
1376
1392
|
/** Deletes a DataType */
|
|
1377
1393
|
async remove(body) {
|
|
1378
1394
|
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
|
|
@@ -1385,14 +1401,6 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1385
1401
|
};
|
|
1386
1402
|
_url8 = /* @__PURE__ */ new WeakMap();
|
|
1387
1403
|
__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
1404
|
var _baseUrl;
|
|
1397
1405
|
var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2 extends ApiClient {
|
|
1398
1406
|
constructor(options) {
|
|
@@ -1435,6 +1443,48 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1435
1443
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
1436
1444
|
__privateAdd3(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
1437
1445
|
var _url22;
|
|
1446
|
+
var _NotificationsClient = class _NotificationsClient2 extends ApiClient {
|
|
1447
|
+
constructor(options) {
|
|
1448
|
+
super(options);
|
|
1449
|
+
}
|
|
1450
|
+
/**
|
|
1451
|
+
* Lists notifications for the current user.
|
|
1452
|
+
*
|
|
1453
|
+
* @deprecated This API is experimental and may change without notice.
|
|
1454
|
+
*/
|
|
1455
|
+
async list(options) {
|
|
1456
|
+
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22), options);
|
|
1457
|
+
return await this.apiClient(fetchUri);
|
|
1458
|
+
}
|
|
1459
|
+
/**
|
|
1460
|
+
* Creates a notification for one or more recipients.
|
|
1461
|
+
*
|
|
1462
|
+
* @deprecated This API is experimental and may change without notice.
|
|
1463
|
+
*/
|
|
1464
|
+
async create(body) {
|
|
1465
|
+
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22));
|
|
1466
|
+
return await this.apiClient(fetchUri, {
|
|
1467
|
+
method: "POST",
|
|
1468
|
+
body: JSON.stringify(body)
|
|
1469
|
+
});
|
|
1470
|
+
}
|
|
1471
|
+
/**
|
|
1472
|
+
* Updates the read state of the current user's notifications.
|
|
1473
|
+
*
|
|
1474
|
+
* @deprecated This API is experimental and may change without notice.
|
|
1475
|
+
*/
|
|
1476
|
+
async setReadState(body) {
|
|
1477
|
+
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22));
|
|
1478
|
+
await this.apiClient(fetchUri, {
|
|
1479
|
+
method: "PATCH",
|
|
1480
|
+
body: JSON.stringify(body),
|
|
1481
|
+
expectNoContent: true
|
|
1482
|
+
});
|
|
1483
|
+
}
|
|
1484
|
+
};
|
|
1485
|
+
_url22 = /* @__PURE__ */ new WeakMap();
|
|
1486
|
+
__privateAdd3(_NotificationsClient, _url22, "/api/v1/notifications");
|
|
1487
|
+
var _url32;
|
|
1438
1488
|
var _projectsUrl;
|
|
1439
1489
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
1440
1490
|
constructor(options) {
|
|
@@ -1442,7 +1492,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1442
1492
|
}
|
|
1443
1493
|
/** Fetches single Project */
|
|
1444
1494
|
async get(options) {
|
|
1445
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
1495
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url32), { ...options });
|
|
1446
1496
|
return await this.apiClient(fetchUri);
|
|
1447
1497
|
}
|
|
1448
1498
|
/**
|
|
@@ -1450,31 +1500,43 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1450
1500
|
* When teamId is provided, returns a single team with its projects.
|
|
1451
1501
|
* When omitted, returns all accessible teams and their projects.
|
|
1452
1502
|
*/
|
|
1453
|
-
async
|
|
1503
|
+
async list(options) {
|
|
1454
1504
|
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
|
|
1455
1505
|
return await this.apiClient(fetchUri);
|
|
1456
1506
|
}
|
|
1507
|
+
/** @deprecated Use {@link list} instead. */
|
|
1508
|
+
async getProjects(options) {
|
|
1509
|
+
return this.list(options);
|
|
1510
|
+
}
|
|
1457
1511
|
/** Updates or creates (based on id) a Project */
|
|
1458
|
-
async
|
|
1459
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
1512
|
+
async save(body) {
|
|
1513
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url32));
|
|
1460
1514
|
return await this.apiClient(fetchUri, {
|
|
1461
1515
|
method: "PUT",
|
|
1462
1516
|
body: JSON.stringify({ ...body })
|
|
1463
1517
|
});
|
|
1464
1518
|
}
|
|
1519
|
+
/** @deprecated Use {@link save} instead. */
|
|
1520
|
+
async upsert(body) {
|
|
1521
|
+
return this.save(body);
|
|
1522
|
+
}
|
|
1465
1523
|
/** Deletes a Project */
|
|
1466
|
-
async
|
|
1467
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
1524
|
+
async remove(body) {
|
|
1525
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url32));
|
|
1468
1526
|
await this.apiClient(fetchUri, {
|
|
1469
1527
|
method: "DELETE",
|
|
1470
1528
|
body: JSON.stringify({ ...body }),
|
|
1471
1529
|
expectNoContent: true
|
|
1472
1530
|
});
|
|
1473
1531
|
}
|
|
1532
|
+
/** @deprecated Use {@link remove} instead. */
|
|
1533
|
+
async delete(body) {
|
|
1534
|
+
return this.remove(body);
|
|
1535
|
+
}
|
|
1474
1536
|
};
|
|
1475
|
-
|
|
1537
|
+
_url32 = /* @__PURE__ */ new WeakMap();
|
|
1476
1538
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
1477
|
-
__privateAdd3(_ProjectClient,
|
|
1539
|
+
__privateAdd3(_ProjectClient, _url32, "/api/v1/project");
|
|
1478
1540
|
__privateAdd3(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
1479
1541
|
var ROUTE_URL = "/api/v1/route";
|
|
1480
1542
|
var RouteClient = class extends ApiClient {
|
|
@@ -1486,8 +1548,14 @@ var RouteClient = class extends ApiClient {
|
|
|
1486
1548
|
super(options);
|
|
1487
1549
|
this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
|
|
1488
1550
|
}
|
|
1489
|
-
/**
|
|
1490
|
-
|
|
1551
|
+
/**
|
|
1552
|
+
* Resolves a route to a composition, redirect, or not-found result.
|
|
1553
|
+
*
|
|
1554
|
+
* An optional `select` projection applies to the resolved composition when
|
|
1555
|
+
* the route matches one; redirect / notFound responses pass through
|
|
1556
|
+
* untouched.
|
|
1557
|
+
*/
|
|
1558
|
+
async get(options) {
|
|
1491
1559
|
const { projectId } = this.options;
|
|
1492
1560
|
const { select, ...rest } = options != null ? options : {};
|
|
1493
1561
|
const rewrittenSelect = projectionToQuery(select);
|
|
@@ -1497,6 +1565,10 @@ var RouteClient = class extends ApiClient {
|
|
|
1497
1565
|
this.options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0
|
|
1498
1566
|
);
|
|
1499
1567
|
}
|
|
1568
|
+
/** @deprecated use {@link RouteClient.get} instead (renamed). */
|
|
1569
|
+
async getRoute(options) {
|
|
1570
|
+
return this.get(options);
|
|
1571
|
+
}
|
|
1500
1572
|
};
|
|
1501
1573
|
var getDataSourceVariantFromRouteGetParams = (params, defaultPreviewState) => {
|
|
1502
1574
|
var _a, _b;
|
|
@@ -1957,14 +2029,14 @@ var DefaultDataClient = class {
|
|
|
1957
2029
|
if (oldCachedRoute) {
|
|
1958
2030
|
(0, import_functions.waitUntil)(
|
|
1959
2031
|
(async () => {
|
|
1960
|
-
const result2 = await routeClient.
|
|
2032
|
+
const result2 = await routeClient.get(route);
|
|
1961
2033
|
await cacheNewRoute(result2);
|
|
1962
2034
|
})()
|
|
1963
2035
|
);
|
|
1964
2036
|
return oldCachedRoute;
|
|
1965
2037
|
}
|
|
1966
2038
|
}
|
|
1967
|
-
const result = await routeClient.
|
|
2039
|
+
const result = await routeClient.get(route);
|
|
1968
2040
|
(0, import_functions.waitUntil)(
|
|
1969
2041
|
(async () => {
|
|
1970
2042
|
await Promise.all([
|
package/dist/cache.mjs
CHANGED
|
@@ -1239,6 +1239,14 @@ function projectionToQuery(spec) {
|
|
|
1239
1239
|
}
|
|
1240
1240
|
return out;
|
|
1241
1241
|
}
|
|
1242
|
+
var CANVAS_DRAFT_STATE = 0;
|
|
1243
|
+
var CANVAS_PUBLISHED_STATE = 64;
|
|
1244
|
+
var CANVAS_EDITOR_STATE = 63;
|
|
1245
|
+
var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
|
|
1246
|
+
var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
|
|
1247
|
+
var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
|
|
1248
|
+
var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
|
|
1249
|
+
var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
|
|
1242
1250
|
var _contentTypesUrl;
|
|
1243
1251
|
var _entriesUrl;
|
|
1244
1252
|
var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
@@ -1345,14 +1353,18 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1345
1353
|
constructor(options) {
|
|
1346
1354
|
super(options);
|
|
1347
1355
|
}
|
|
1348
|
-
/** Fetches
|
|
1349
|
-
async
|
|
1356
|
+
/** Fetches a list of DataTypes for a project */
|
|
1357
|
+
async list(options) {
|
|
1350
1358
|
const { projectId } = this.options;
|
|
1351
1359
|
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8), { ...options, projectId });
|
|
1352
1360
|
return await this.apiClient(fetchUri);
|
|
1353
1361
|
}
|
|
1362
|
+
/** @deprecated Use {@link list} instead. */
|
|
1363
|
+
async get(options) {
|
|
1364
|
+
return this.list(options);
|
|
1365
|
+
}
|
|
1354
1366
|
/** Updates or creates (based on id) a DataType */
|
|
1355
|
-
async
|
|
1367
|
+
async save(body) {
|
|
1356
1368
|
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
|
|
1357
1369
|
await this.apiClient(fetchUri, {
|
|
1358
1370
|
method: "PUT",
|
|
@@ -1360,6 +1372,10 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1360
1372
|
expectNoContent: true
|
|
1361
1373
|
});
|
|
1362
1374
|
}
|
|
1375
|
+
/** @deprecated Use {@link save} instead. */
|
|
1376
|
+
async upsert(body) {
|
|
1377
|
+
return this.save(body);
|
|
1378
|
+
}
|
|
1363
1379
|
/** Deletes a DataType */
|
|
1364
1380
|
async remove(body) {
|
|
1365
1381
|
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
|
|
@@ -1372,14 +1388,6 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1372
1388
|
};
|
|
1373
1389
|
_url8 = /* @__PURE__ */ new WeakMap();
|
|
1374
1390
|
__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
1391
|
var _baseUrl;
|
|
1384
1392
|
var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2 extends ApiClient {
|
|
1385
1393
|
constructor(options) {
|
|
@@ -1422,6 +1430,48 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1422
1430
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
1423
1431
|
__privateAdd3(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
1424
1432
|
var _url22;
|
|
1433
|
+
var _NotificationsClient = class _NotificationsClient2 extends ApiClient {
|
|
1434
|
+
constructor(options) {
|
|
1435
|
+
super(options);
|
|
1436
|
+
}
|
|
1437
|
+
/**
|
|
1438
|
+
* Lists notifications for the current user.
|
|
1439
|
+
*
|
|
1440
|
+
* @deprecated This API is experimental and may change without notice.
|
|
1441
|
+
*/
|
|
1442
|
+
async list(options) {
|
|
1443
|
+
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22), options);
|
|
1444
|
+
return await this.apiClient(fetchUri);
|
|
1445
|
+
}
|
|
1446
|
+
/**
|
|
1447
|
+
* Creates a notification for one or more recipients.
|
|
1448
|
+
*
|
|
1449
|
+
* @deprecated This API is experimental and may change without notice.
|
|
1450
|
+
*/
|
|
1451
|
+
async create(body) {
|
|
1452
|
+
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22));
|
|
1453
|
+
return await this.apiClient(fetchUri, {
|
|
1454
|
+
method: "POST",
|
|
1455
|
+
body: JSON.stringify(body)
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
1458
|
+
/**
|
|
1459
|
+
* Updates the read state of the current user's notifications.
|
|
1460
|
+
*
|
|
1461
|
+
* @deprecated This API is experimental and may change without notice.
|
|
1462
|
+
*/
|
|
1463
|
+
async setReadState(body) {
|
|
1464
|
+
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22));
|
|
1465
|
+
await this.apiClient(fetchUri, {
|
|
1466
|
+
method: "PATCH",
|
|
1467
|
+
body: JSON.stringify(body),
|
|
1468
|
+
expectNoContent: true
|
|
1469
|
+
});
|
|
1470
|
+
}
|
|
1471
|
+
};
|
|
1472
|
+
_url22 = /* @__PURE__ */ new WeakMap();
|
|
1473
|
+
__privateAdd3(_NotificationsClient, _url22, "/api/v1/notifications");
|
|
1474
|
+
var _url32;
|
|
1425
1475
|
var _projectsUrl;
|
|
1426
1476
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
1427
1477
|
constructor(options) {
|
|
@@ -1429,7 +1479,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1429
1479
|
}
|
|
1430
1480
|
/** Fetches single Project */
|
|
1431
1481
|
async get(options) {
|
|
1432
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
1482
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url32), { ...options });
|
|
1433
1483
|
return await this.apiClient(fetchUri);
|
|
1434
1484
|
}
|
|
1435
1485
|
/**
|
|
@@ -1437,31 +1487,43 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1437
1487
|
* When teamId is provided, returns a single team with its projects.
|
|
1438
1488
|
* When omitted, returns all accessible teams and their projects.
|
|
1439
1489
|
*/
|
|
1440
|
-
async
|
|
1490
|
+
async list(options) {
|
|
1441
1491
|
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
|
|
1442
1492
|
return await this.apiClient(fetchUri);
|
|
1443
1493
|
}
|
|
1494
|
+
/** @deprecated Use {@link list} instead. */
|
|
1495
|
+
async getProjects(options) {
|
|
1496
|
+
return this.list(options);
|
|
1497
|
+
}
|
|
1444
1498
|
/** Updates or creates (based on id) a Project */
|
|
1445
|
-
async
|
|
1446
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
1499
|
+
async save(body) {
|
|
1500
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url32));
|
|
1447
1501
|
return await this.apiClient(fetchUri, {
|
|
1448
1502
|
method: "PUT",
|
|
1449
1503
|
body: JSON.stringify({ ...body })
|
|
1450
1504
|
});
|
|
1451
1505
|
}
|
|
1506
|
+
/** @deprecated Use {@link save} instead. */
|
|
1507
|
+
async upsert(body) {
|
|
1508
|
+
return this.save(body);
|
|
1509
|
+
}
|
|
1452
1510
|
/** Deletes a Project */
|
|
1453
|
-
async
|
|
1454
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
1511
|
+
async remove(body) {
|
|
1512
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url32));
|
|
1455
1513
|
await this.apiClient(fetchUri, {
|
|
1456
1514
|
method: "DELETE",
|
|
1457
1515
|
body: JSON.stringify({ ...body }),
|
|
1458
1516
|
expectNoContent: true
|
|
1459
1517
|
});
|
|
1460
1518
|
}
|
|
1519
|
+
/** @deprecated Use {@link remove} instead. */
|
|
1520
|
+
async delete(body) {
|
|
1521
|
+
return this.remove(body);
|
|
1522
|
+
}
|
|
1461
1523
|
};
|
|
1462
|
-
|
|
1524
|
+
_url32 = /* @__PURE__ */ new WeakMap();
|
|
1463
1525
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
1464
|
-
__privateAdd3(_ProjectClient,
|
|
1526
|
+
__privateAdd3(_ProjectClient, _url32, "/api/v1/project");
|
|
1465
1527
|
__privateAdd3(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
1466
1528
|
var ROUTE_URL = "/api/v1/route";
|
|
1467
1529
|
var RouteClient = class extends ApiClient {
|
|
@@ -1473,8 +1535,14 @@ var RouteClient = class extends ApiClient {
|
|
|
1473
1535
|
super(options);
|
|
1474
1536
|
this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
|
|
1475
1537
|
}
|
|
1476
|
-
/**
|
|
1477
|
-
|
|
1538
|
+
/**
|
|
1539
|
+
* Resolves a route to a composition, redirect, or not-found result.
|
|
1540
|
+
*
|
|
1541
|
+
* An optional `select` projection applies to the resolved composition when
|
|
1542
|
+
* the route matches one; redirect / notFound responses pass through
|
|
1543
|
+
* untouched.
|
|
1544
|
+
*/
|
|
1545
|
+
async get(options) {
|
|
1478
1546
|
const { projectId } = this.options;
|
|
1479
1547
|
const { select, ...rest } = options != null ? options : {};
|
|
1480
1548
|
const rewrittenSelect = projectionToQuery(select);
|
|
@@ -1484,6 +1552,10 @@ var RouteClient = class extends ApiClient {
|
|
|
1484
1552
|
this.options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0
|
|
1485
1553
|
);
|
|
1486
1554
|
}
|
|
1555
|
+
/** @deprecated use {@link RouteClient.get} instead (renamed). */
|
|
1556
|
+
async getRoute(options) {
|
|
1557
|
+
return this.get(options);
|
|
1558
|
+
}
|
|
1487
1559
|
};
|
|
1488
1560
|
var getDataSourceVariantFromRouteGetParams = (params, defaultPreviewState) => {
|
|
1489
1561
|
var _a, _b;
|
|
@@ -1944,14 +2016,14 @@ var DefaultDataClient = class {
|
|
|
1944
2016
|
if (oldCachedRoute) {
|
|
1945
2017
|
waitUntil(
|
|
1946
2018
|
(async () => {
|
|
1947
|
-
const result2 = await routeClient.
|
|
2019
|
+
const result2 = await routeClient.get(route);
|
|
1948
2020
|
await cacheNewRoute(result2);
|
|
1949
2021
|
})()
|
|
1950
2022
|
);
|
|
1951
2023
|
return oldCachedRoute;
|
|
1952
2024
|
}
|
|
1953
2025
|
}
|
|
1954
|
-
const result = await routeClient.
|
|
2026
|
+
const result = await routeClient.get(route);
|
|
1955
2027
|
waitUntil(
|
|
1956
2028
|
(async () => {
|
|
1957
2029
|
await Promise.all([
|