@objectstack/rest 9.3.0 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1585,9 +1585,11 @@ var RestServer = class {
|
|
|
1585
1585
|
const p = await this.resolveProtocol(environmentId, req);
|
|
1586
1586
|
const wantLayered = req.query?.layers !== void 0 && req.query?.layers !== "";
|
|
1587
1587
|
if (wantLayered && typeof p.getMetaItemLayered === "function") {
|
|
1588
|
+
const layeredPackageId = req.query?.package || void 0;
|
|
1588
1589
|
const layered = await p.getMetaItemLayered({
|
|
1589
1590
|
type: req.params.type,
|
|
1590
1591
|
name: req.params.name,
|
|
1592
|
+
...layeredPackageId ? { packageId: layeredPackageId } : {},
|
|
1591
1593
|
...environmentId ? { environmentId } : {}
|
|
1592
1594
|
});
|
|
1593
1595
|
res.json(layered);
|
|
@@ -1596,7 +1598,8 @@ var RestServer = class {
|
|
|
1596
1598
|
const isAppType = req.params.type === "app";
|
|
1597
1599
|
const isDraftRead = typeof req.query?.state === "string" && req.query.state.toLowerCase() === "draft";
|
|
1598
1600
|
const previewDrafts = typeof req.query?.preview === "string" && req.query.preview.toLowerCase() === "draft";
|
|
1599
|
-
|
|
1601
|
+
const packageScoped = typeof req.query?.package === "string" && req.query.package.length > 0;
|
|
1602
|
+
if (metadata.enableCache && p.getMetaItemCached && !isAppType && !isDraftRead && !previewDrafts && !packageScoped) {
|
|
1600
1603
|
const cacheRequest = {
|
|
1601
1604
|
ifNoneMatch: req.headers["if-none-match"],
|
|
1602
1605
|
ifModifiedSince: req.headers["if-modified-since"]
|