@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.js CHANGED
@@ -1545,9 +1545,11 @@ var RestServer = class {
1545
1545
  const p = await this.resolveProtocol(environmentId, req);
1546
1546
  const wantLayered = req.query?.layers !== void 0 && req.query?.layers !== "";
1547
1547
  if (wantLayered && typeof p.getMetaItemLayered === "function") {
1548
+ const layeredPackageId = req.query?.package || void 0;
1548
1549
  const layered = await p.getMetaItemLayered({
1549
1550
  type: req.params.type,
1550
1551
  name: req.params.name,
1552
+ ...layeredPackageId ? { packageId: layeredPackageId } : {},
1551
1553
  ...environmentId ? { environmentId } : {}
1552
1554
  });
1553
1555
  res.json(layered);
@@ -1556,7 +1558,8 @@ var RestServer = class {
1556
1558
  const isAppType = req.params.type === "app";
1557
1559
  const isDraftRead = typeof req.query?.state === "string" && req.query.state.toLowerCase() === "draft";
1558
1560
  const previewDrafts = typeof req.query?.preview === "string" && req.query.preview.toLowerCase() === "draft";
1559
- if (metadata.enableCache && p.getMetaItemCached && !isAppType && !isDraftRead && !previewDrafts) {
1561
+ const packageScoped = typeof req.query?.package === "string" && req.query.package.length > 0;
1562
+ if (metadata.enableCache && p.getMetaItemCached && !isAppType && !isDraftRead && !previewDrafts && !packageScoped) {
1560
1563
  const cacheRequest = {
1561
1564
  ifNoneMatch: req.headers["if-none-match"],
1562
1565
  ifModifiedSince: req.headers["if-modified-since"]