@uniformdev/next-app-router 20.74.6-alpha.3 → 20.74.7-alpha.12
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 +48 -18
- package/dist/cache.mjs +48 -18
- package/dist/component.js +30 -10
- package/dist/component.mjs +30 -10
- package/dist/handler.js +132 -141
- package/dist/handler.mjs +132 -141
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.esm.js +167 -40
- package/dist/index.js +168 -40
- package/dist/index.mjs +167 -40
- package/dist/middleware.js +146 -151
- package/dist/middleware.mjs +146 -151
- package/package.json +8 -8
package/dist/handler.mjs
CHANGED
|
@@ -1208,6 +1208,16 @@ function createLimitPolicy({
|
|
|
1208
1208
|
return currentFunc();
|
|
1209
1209
|
};
|
|
1210
1210
|
}
|
|
1211
|
+
var ContentClientBase = class extends ApiClient {
|
|
1212
|
+
constructor(options, defaultBypassCache) {
|
|
1213
|
+
var _a, _b;
|
|
1214
|
+
super({
|
|
1215
|
+
...options,
|
|
1216
|
+
limitPolicy: (_a = options.limitPolicy) != null ? _a : createLimitPolicy({}),
|
|
1217
|
+
bypassCache: (_b = options.bypassCache) != null ? _b : defaultBypassCache
|
|
1218
|
+
});
|
|
1219
|
+
}
|
|
1220
|
+
};
|
|
1211
1221
|
var SELECT_QUERY_PREFIX = "select.";
|
|
1212
1222
|
function appendCsv(out, key, values) {
|
|
1213
1223
|
if (values === void 0) {
|
|
@@ -1252,130 +1262,94 @@ function projectionToQuery(spec) {
|
|
|
1252
1262
|
}
|
|
1253
1263
|
return out;
|
|
1254
1264
|
}
|
|
1255
|
-
var
|
|
1256
|
-
var
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
projectId,
|
|
1276
|
-
...rewrittenFilters,
|
|
1277
|
-
...rewrittenSelect
|
|
1278
|
-
});
|
|
1279
|
-
return this.apiClient(fetchUri);
|
|
1280
|
-
}
|
|
1281
|
-
const edgeParams = {
|
|
1282
|
-
...originParams,
|
|
1283
|
-
projectId,
|
|
1284
|
-
diagnostics: typeof params.diagnostics === "boolean" ? params.diagnostics : params.diagnostics === "no-data" ? "no-data" : void 0,
|
|
1285
|
-
...rewrittenFilters,
|
|
1286
|
-
...rewrittenSelect
|
|
1265
|
+
var CANVAS_DRAFT_STATE = 0;
|
|
1266
|
+
var CANVAS_PUBLISHED_STATE = 64;
|
|
1267
|
+
var CANVAS_EDITOR_STATE = 63;
|
|
1268
|
+
var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
|
|
1269
|
+
var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
|
|
1270
|
+
var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
|
|
1271
|
+
var SECRET_QUERY_STRING_PARAM = "secret";
|
|
1272
|
+
var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
|
|
1273
|
+
var IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM = "is_incontext_editing_playground";
|
|
1274
|
+
var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
|
|
1275
|
+
function resolveCompositionSelector(args) {
|
|
1276
|
+
if ("compositionId" in args) {
|
|
1277
|
+
const { compositionId, editionId, versionId, ...readOptions } = args;
|
|
1278
|
+
return {
|
|
1279
|
+
readOptions,
|
|
1280
|
+
// raw mode matches on composition OR edition id via the compositionId param
|
|
1281
|
+
compositionId: editionId != null ? editionId : compositionId,
|
|
1282
|
+
versionId,
|
|
1283
|
+
hasCompositionId: true,
|
|
1284
|
+
pinnedEdition: editionId !== void 0
|
|
1287
1285
|
};
|
|
1288
|
-
const edgeUrl = this.createUrl("/api/v1/compositions", edgeParams, this.edgeApiHost);
|
|
1289
|
-
return this.apiClient(edgeUrl, this.edgeApiRequestInit);
|
|
1290
|
-
}
|
|
1291
|
-
getCompositionByNodePath(options) {
|
|
1292
|
-
return this.getOneComposition(options);
|
|
1293
|
-
}
|
|
1294
|
-
getCompositionByNodeId(options) {
|
|
1295
|
-
return this.getOneComposition(options);
|
|
1296
|
-
}
|
|
1297
|
-
getCompositionBySlug(options) {
|
|
1298
|
-
return this.getOneComposition(options);
|
|
1299
1286
|
}
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
}
|
|
1314
|
-
getOneComposition({
|
|
1315
|
-
skipDataResolution,
|
|
1316
|
-
diagnostics,
|
|
1317
|
-
...params
|
|
1318
|
-
}) {
|
|
1319
|
-
const { projectId } = this.options;
|
|
1320
|
-
if (skipDataResolution) {
|
|
1321
|
-
return this.apiClient(this.createUrl(CANVAS_URL, { ...params, projectId }));
|
|
1322
|
-
}
|
|
1323
|
-
const edgeParams = {
|
|
1324
|
-
...params,
|
|
1325
|
-
projectId,
|
|
1326
|
-
diagnostics: typeof diagnostics === "boolean" ? diagnostics : diagnostics === "no-data" ? "no-data" : void 0
|
|
1327
|
-
};
|
|
1328
|
-
const edgeUrl = this.createUrl("/api/v1/composition", edgeParams, this.edgeApiHost);
|
|
1329
|
-
return this.apiClient(edgeUrl, this.edgeApiRequestInit);
|
|
1287
|
+
return { readOptions: args, hasCompositionId: false, pinnedEdition: false };
|
|
1288
|
+
}
|
|
1289
|
+
var DEFAULT_EDGE_API_HOST = "https://uniform.global";
|
|
1290
|
+
var DeliveryClientBase = class extends ContentClientBase {
|
|
1291
|
+
constructor(options) {
|
|
1292
|
+
var _a;
|
|
1293
|
+
super(
|
|
1294
|
+
options,
|
|
1295
|
+
/* defaultBypassCache */
|
|
1296
|
+
false
|
|
1297
|
+
);
|
|
1298
|
+
this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : DEFAULT_EDGE_API_HOST;
|
|
1299
|
+
this.edgeRequestInit = options.disableSWR ? { headers: { "x-disable-swr": "true" } } : void 0;
|
|
1330
1300
|
}
|
|
1331
|
-
/**
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
const headers = {};
|
|
1335
|
-
if (options == null ? void 0 : options.ifUnmodifiedSince) {
|
|
1336
|
-
headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
|
|
1337
|
-
}
|
|
1338
|
-
const { response } = await this.apiClientWithResponse(fetchUri, {
|
|
1339
|
-
method: "PUT",
|
|
1340
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
1341
|
-
expectNoContent: true,
|
|
1342
|
-
headers
|
|
1343
|
-
});
|
|
1344
|
-
return { modified: response.headers.get("x-modified-at") };
|
|
1301
|
+
/** Coerces the `diagnostics` option into the shape the edge endpoints accept. */
|
|
1302
|
+
coerceDiagnostics(diagnostics) {
|
|
1303
|
+
return typeof diagnostics === "boolean" ? diagnostics : diagnostics === "no-data" ? "no-data" : void 0;
|
|
1345
1304
|
}
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
body: JSON.stringify({ ...body, projectId }),
|
|
1353
|
-
expectNoContent: true
|
|
1354
|
-
});
|
|
1355
|
-
}
|
|
1356
|
-
/** Fetches all Canvas component definitions */
|
|
1357
|
-
async getComponentDefinitions(options) {
|
|
1358
|
-
const { projectId } = this.options;
|
|
1359
|
-
const fetchUri = this.createUrl("/api/v1/canvas-definitions", { ...options, projectId });
|
|
1360
|
-
return this.apiClient(fetchUri);
|
|
1305
|
+
};
|
|
1306
|
+
var EDGE_SINGLE_URL = "/api/v1/composition";
|
|
1307
|
+
var EDGE_LIST_URL = "/api/v1/compositions";
|
|
1308
|
+
var CompositionDeliveryClient = class extends DeliveryClientBase {
|
|
1309
|
+
constructor(options) {
|
|
1310
|
+
super(options);
|
|
1361
1311
|
}
|
|
1362
|
-
/**
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1312
|
+
/** Fetches exactly one composition (throws `ApiClientError(404)` if absent). */
|
|
1313
|
+
get(args) {
|
|
1314
|
+
var _a;
|
|
1315
|
+
const { diagnostics, select, ...rest } = args;
|
|
1316
|
+
const { readOptions, compositionId, versionId, pinnedEdition } = resolveCompositionSelector(rest);
|
|
1317
|
+
const url = this.createUrl(
|
|
1318
|
+
EDGE_SINGLE_URL,
|
|
1319
|
+
{
|
|
1320
|
+
...readOptions,
|
|
1321
|
+
...projectionToQuery(select),
|
|
1322
|
+
// A pinned edition is folded into compositionId (raw matches edition or
|
|
1323
|
+
// composition id); there is no editionId query param on this endpoint.
|
|
1324
|
+
compositionId,
|
|
1325
|
+
versionId,
|
|
1326
|
+
projectId: this.options.projectId,
|
|
1327
|
+
state: (_a = args.state) != null ? _a : CANVAS_PUBLISHED_STATE,
|
|
1328
|
+
// editionId pins a specific edition for preview; otherwise locale-best.
|
|
1329
|
+
editions: pinnedEdition ? "raw" : "auto",
|
|
1330
|
+
diagnostics: this.coerceDiagnostics(diagnostics)
|
|
1331
|
+
},
|
|
1332
|
+
this.edgeApiHost
|
|
1333
|
+
);
|
|
1334
|
+
return this.apiClient(url, this.edgeRequestInit);
|
|
1370
1335
|
}
|
|
1371
|
-
/**
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1336
|
+
/** Fetches a list of compositions, optionally filtered. */
|
|
1337
|
+
list(args = {}) {
|
|
1338
|
+
var _a;
|
|
1339
|
+
const { diagnostics, filters, select, ...rest } = args;
|
|
1340
|
+
const url = this.createUrl(
|
|
1341
|
+
EDGE_LIST_URL,
|
|
1342
|
+
{
|
|
1343
|
+
...rest,
|
|
1344
|
+
...rewriteFiltersForApi(filters),
|
|
1345
|
+
...projectionToQuery(select),
|
|
1346
|
+
projectId: this.options.projectId,
|
|
1347
|
+
state: (_a = args.state) != null ? _a : CANVAS_PUBLISHED_STATE,
|
|
1348
|
+
diagnostics: this.coerceDiagnostics(diagnostics)
|
|
1349
|
+
},
|
|
1350
|
+
this.edgeApiHost
|
|
1351
|
+
);
|
|
1352
|
+
return this.apiClient(url, this.edgeRequestInit);
|
|
1379
1353
|
}
|
|
1380
1354
|
};
|
|
1381
1355
|
var _contentTypesUrl;
|
|
@@ -1484,14 +1458,18 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1484
1458
|
constructor(options) {
|
|
1485
1459
|
super(options);
|
|
1486
1460
|
}
|
|
1487
|
-
/** Fetches
|
|
1488
|
-
async
|
|
1461
|
+
/** Fetches a list of DataTypes for a project */
|
|
1462
|
+
async list(options) {
|
|
1489
1463
|
const { projectId } = this.options;
|
|
1490
1464
|
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8), { ...options, projectId });
|
|
1491
1465
|
return await this.apiClient(fetchUri);
|
|
1492
1466
|
}
|
|
1467
|
+
/** @deprecated Use {@link list} instead. */
|
|
1468
|
+
async get(options) {
|
|
1469
|
+
return this.list(options);
|
|
1470
|
+
}
|
|
1493
1471
|
/** Updates or creates (based on id) a DataType */
|
|
1494
|
-
async
|
|
1472
|
+
async save(body) {
|
|
1495
1473
|
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
|
|
1496
1474
|
await this.apiClient(fetchUri, {
|
|
1497
1475
|
method: "PUT",
|
|
@@ -1499,6 +1477,10 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1499
1477
|
expectNoContent: true
|
|
1500
1478
|
});
|
|
1501
1479
|
}
|
|
1480
|
+
/** @deprecated Use {@link save} instead. */
|
|
1481
|
+
async upsert(body) {
|
|
1482
|
+
return this.save(body);
|
|
1483
|
+
}
|
|
1502
1484
|
/** Deletes a DataType */
|
|
1503
1485
|
async remove(body) {
|
|
1504
1486
|
const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
|
|
@@ -1511,15 +1493,6 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
1511
1493
|
};
|
|
1512
1494
|
_url8 = /* @__PURE__ */ new WeakMap();
|
|
1513
1495
|
__privateAdd3(_DataTypeClient, _url8, "/api/v1/data-types");
|
|
1514
|
-
var CANVAS_DRAFT_STATE = 0;
|
|
1515
|
-
var CANVAS_EDITOR_STATE = 63;
|
|
1516
|
-
var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
|
|
1517
|
-
var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
|
|
1518
|
-
var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
|
|
1519
|
-
var SECRET_QUERY_STRING_PARAM = "secret";
|
|
1520
|
-
var IN_CONTEXT_EDITOR_QUERY_STRING_PARAM = "is_incontext_editing_mode";
|
|
1521
|
-
var IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM = "is_incontext_editing_playground";
|
|
1522
|
-
var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
|
|
1523
1496
|
var escapeCharacter = "\\";
|
|
1524
1497
|
var variablePrefix = "${";
|
|
1525
1498
|
var variableSuffix = "}";
|
|
@@ -1653,20 +1626,28 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1653
1626
|
* When teamId is provided, returns a single team with its projects.
|
|
1654
1627
|
* When omitted, returns all accessible teams and their projects.
|
|
1655
1628
|
*/
|
|
1656
|
-
async
|
|
1629
|
+
async list(options) {
|
|
1657
1630
|
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
|
|
1658
1631
|
return await this.apiClient(fetchUri);
|
|
1659
1632
|
}
|
|
1633
|
+
/** @deprecated Use {@link list} instead. */
|
|
1634
|
+
async getProjects(options) {
|
|
1635
|
+
return this.list(options);
|
|
1636
|
+
}
|
|
1660
1637
|
/** Updates or creates (based on id) a Project */
|
|
1661
|
-
async
|
|
1638
|
+
async save(body) {
|
|
1662
1639
|
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
1663
1640
|
return await this.apiClient(fetchUri, {
|
|
1664
1641
|
method: "PUT",
|
|
1665
1642
|
body: JSON.stringify({ ...body })
|
|
1666
1643
|
});
|
|
1667
1644
|
}
|
|
1645
|
+
/** @deprecated Use {@link save} instead. */
|
|
1646
|
+
async upsert(body) {
|
|
1647
|
+
return this.save(body);
|
|
1648
|
+
}
|
|
1668
1649
|
/** Deletes a Project */
|
|
1669
|
-
async
|
|
1650
|
+
async remove(body) {
|
|
1670
1651
|
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
1671
1652
|
await this.apiClient(fetchUri, {
|
|
1672
1653
|
method: "DELETE",
|
|
@@ -1674,15 +1655,22 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1674
1655
|
expectNoContent: true
|
|
1675
1656
|
});
|
|
1676
1657
|
}
|
|
1658
|
+
/** @deprecated Use {@link remove} instead. */
|
|
1659
|
+
async delete(body) {
|
|
1660
|
+
return this.remove(body);
|
|
1661
|
+
}
|
|
1677
1662
|
};
|
|
1678
1663
|
_url22 = /* @__PURE__ */ new WeakMap();
|
|
1679
1664
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
1680
1665
|
__privateAdd3(_ProjectClient, _url22, "/api/v1/project");
|
|
1681
1666
|
__privateAdd3(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
1667
|
+
var ALLOWED_REFERRER_ORIGIN = /^https:\/\/([\w-]+\.)*(uniform\.(app|wtf)|uniformcode\.ai)$|^https?:\/\/localhost:\d{4}$/;
|
|
1682
1668
|
var isAllowedReferrer = (referrer) => {
|
|
1683
|
-
|
|
1684
|
-
referrer
|
|
1685
|
-
)
|
|
1669
|
+
try {
|
|
1670
|
+
return ALLOWED_REFERRER_ORIGIN.test(new URL(referrer != null ? referrer : "").origin);
|
|
1671
|
+
} catch (e) {
|
|
1672
|
+
return false;
|
|
1673
|
+
}
|
|
1686
1674
|
};
|
|
1687
1675
|
|
|
1688
1676
|
// src/handler/createPreviewGETRouteHandler.ts
|
|
@@ -2134,9 +2122,9 @@ function createLimitPolicy2({
|
|
|
2134
2122
|
}
|
|
2135
2123
|
|
|
2136
2124
|
// src/clients/canvas.ts
|
|
2137
|
-
var
|
|
2125
|
+
var buildCanvasClientOptions = (options) => {
|
|
2138
2126
|
const cache = resolveCanvasCache(options);
|
|
2139
|
-
return
|
|
2127
|
+
return {
|
|
2140
2128
|
projectId: env.getProjectId(),
|
|
2141
2129
|
apiHost: env.getApiHost(),
|
|
2142
2130
|
apiKey: env.getApiKey(),
|
|
@@ -2184,7 +2172,10 @@ var getCanvasClient = (options) => {
|
|
|
2184
2172
|
}
|
|
2185
2173
|
});
|
|
2186
2174
|
}
|
|
2187
|
-
}
|
|
2175
|
+
};
|
|
2176
|
+
};
|
|
2177
|
+
var getCompositionDeliveryClient = (options) => {
|
|
2178
|
+
return new CompositionDeliveryClient(buildCanvasClientOptions(options));
|
|
2188
2179
|
};
|
|
2189
2180
|
|
|
2190
2181
|
// src/clients/projectMap.ts
|
|
@@ -2580,13 +2571,13 @@ var processCompositionChange = async (compositionId) => {
|
|
|
2580
2571
|
};
|
|
2581
2572
|
};
|
|
2582
2573
|
var getComposition = async ({ compositionId }) => {
|
|
2583
|
-
const canvasClient =
|
|
2574
|
+
const canvasClient = getCompositionDeliveryClient({
|
|
2584
2575
|
cache: {
|
|
2585
2576
|
type: "no-cache"
|
|
2586
2577
|
}
|
|
2587
2578
|
});
|
|
2588
2579
|
try {
|
|
2589
|
-
const composition = await canvasClient.
|
|
2580
|
+
const composition = await canvasClient.get({
|
|
2590
2581
|
compositionId
|
|
2591
2582
|
});
|
|
2592
2583
|
return composition;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CanvasClient, RouteClient, ComponentInstance } from '@uniformdev/canvas';
|
|
1
|
+
import { CanvasClient, CompositionDeliveryClient, RouteClient, ComponentInstance } from '@uniformdev/canvas';
|
|
2
2
|
import { CacheMode, CanvasCacheMode, ManifestCacheMode, ProjectMapCacheMode, RewriteRequestPathResult } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import { ManifestClient } from '@uniformdev/context/api';
|
|
4
4
|
import { ProjectMapClient } from '@uniformdev/project-map';
|
|
@@ -24,7 +24,12 @@ type DetectCacheMode = {
|
|
|
24
24
|
type ResolvableCacheOptions<TCacheMode extends CacheMode> = SpecificCacheMode<TCacheMode> | StateCacheMode | DetectCacheMode;
|
|
25
25
|
|
|
26
26
|
type GetCanvasClientOptions = ResolvableCacheOptions<CanvasCacheMode>;
|
|
27
|
+
type GetCompositionDeliveryClientOptions = GetCanvasClientOptions;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Use {@link getCompositionDeliveryClient} instead
|
|
30
|
+
*/
|
|
27
31
|
declare const getCanvasClient: (options?: GetCanvasClientOptions) => CanvasClient;
|
|
32
|
+
declare const getCompositionDeliveryClient: (options?: GetCompositionDeliveryClientOptions) => CompositionDeliveryClient;
|
|
28
33
|
|
|
29
34
|
type GetManifestClientOptions = ResolvableCacheOptions<ManifestCacheMode>;
|
|
30
35
|
declare const getManifestClient: (options?: GetManifestClientOptions) => ManifestClient;
|
|
@@ -271,4 +276,4 @@ declare const findRouteMatch: (routes: CustomRoute[], path: string) => RouteMatc
|
|
|
271
276
|
|
|
272
277
|
declare const serverContext: <T>(defaultValue?: T) => [() => T | undefined, (v: T) => void];
|
|
273
278
|
|
|
274
|
-
export { type AwaitedUniformPageParameters, type CreateStaticParamsOptions, type CustomRoute, type GetCanvasClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, type PlaygroundParameters, type RouteMatch, UniformCompositionProps, type UniformPageParameters, UniformPlayground, createUniformPlaygroundStaticParams, createUniformStaticParams, findRouteMatch, getCanvasClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, precomputeComposition, resolvePlaygroundRoute, serverContext };
|
|
279
|
+
export { type AwaitedUniformPageParameters, type CreateStaticParamsOptions, type CustomRoute, type GetCanvasClientOptions, type GetCompositionDeliveryClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, type PlaygroundParameters, type RouteMatch, UniformCompositionProps, type UniformPageParameters, UniformPlayground, createUniformPlaygroundStaticParams, createUniformStaticParams, findRouteMatch, getCanvasClient, getCompositionDeliveryClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, precomputeComposition, resolvePlaygroundRoute, serverContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CanvasClient, RouteClient, ComponentInstance } from '@uniformdev/canvas';
|
|
1
|
+
import { CanvasClient, CompositionDeliveryClient, RouteClient, ComponentInstance } from '@uniformdev/canvas';
|
|
2
2
|
import { CacheMode, CanvasCacheMode, ManifestCacheMode, ProjectMapCacheMode, RewriteRequestPathResult } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import { ManifestClient } from '@uniformdev/context/api';
|
|
4
4
|
import { ProjectMapClient } from '@uniformdev/project-map';
|
|
@@ -24,7 +24,12 @@ type DetectCacheMode = {
|
|
|
24
24
|
type ResolvableCacheOptions<TCacheMode extends CacheMode> = SpecificCacheMode<TCacheMode> | StateCacheMode | DetectCacheMode;
|
|
25
25
|
|
|
26
26
|
type GetCanvasClientOptions = ResolvableCacheOptions<CanvasCacheMode>;
|
|
27
|
+
type GetCompositionDeliveryClientOptions = GetCanvasClientOptions;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Use {@link getCompositionDeliveryClient} instead
|
|
30
|
+
*/
|
|
27
31
|
declare const getCanvasClient: (options?: GetCanvasClientOptions) => CanvasClient;
|
|
32
|
+
declare const getCompositionDeliveryClient: (options?: GetCompositionDeliveryClientOptions) => CompositionDeliveryClient;
|
|
28
33
|
|
|
29
34
|
type GetManifestClientOptions = ResolvableCacheOptions<ManifestCacheMode>;
|
|
30
35
|
declare const getManifestClient: (options?: GetManifestClientOptions) => ManifestClient;
|
|
@@ -271,4 +276,4 @@ declare const findRouteMatch: (routes: CustomRoute[], path: string) => RouteMatc
|
|
|
271
276
|
|
|
272
277
|
declare const serverContext: <T>(defaultValue?: T) => [() => T | undefined, (v: T) => void];
|
|
273
278
|
|
|
274
|
-
export { type AwaitedUniformPageParameters, type CreateStaticParamsOptions, type CustomRoute, type GetCanvasClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, type PlaygroundParameters, type RouteMatch, UniformCompositionProps, type UniformPageParameters, UniformPlayground, createUniformPlaygroundStaticParams, createUniformStaticParams, findRouteMatch, getCanvasClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, precomputeComposition, resolvePlaygroundRoute, serverContext };
|
|
279
|
+
export { type AwaitedUniformPageParameters, type CreateStaticParamsOptions, type CustomRoute, type GetCanvasClientOptions, type GetCompositionDeliveryClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, type PlaygroundParameters, type RouteMatch, UniformCompositionProps, type UniformPageParameters, UniformPlayground, createUniformPlaygroundStaticParams, createUniformStaticParams, findRouteMatch, getCanvasClient, getCompositionDeliveryClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, precomputeComposition, resolvePlaygroundRoute, serverContext };
|