@objectstack/rest 7.2.0 → 7.3.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
@@ -1487,6 +1487,8 @@ var RestServer = class {
1487
1487
  const actor = typeof actorHeader === "string" ? actorHeader : void 0;
1488
1488
  const forceRaw = req.query?.force;
1489
1489
  const force = typeof forceRaw === "string" ? ["true", "1", "yes", "on"].includes(forceRaw.toLowerCase()) : !!forceRaw;
1490
+ const packageRaw = req.query?.package;
1491
+ const packageId = typeof packageRaw === "string" && packageRaw && packageRaw !== "all" ? packageRaw : void 0;
1490
1492
  const result = await p.saveMetaItem({
1491
1493
  type: req.params.type,
1492
1494
  name: req.params.name,
@@ -1495,6 +1497,7 @@ var RestServer = class {
1495
1497
  ...parentVersion !== void 0 ? { parentVersion } : {},
1496
1498
  ...actor ? { actor } : {},
1497
1499
  ...force ? { force: true } : {},
1500
+ ...packageId ? { packageId } : {},
1498
1501
  ...typeof req.query?.mode === "string" && req.query.mode.toLowerCase() === "draft" ? { mode: "draft" } : {}
1499
1502
  });
1500
1503
  res.json(result);
@@ -1769,13 +1772,16 @@ var RestServer = class {
1769
1772
  const parentVersion = typeof ifMatchHeader === "string" ? ifMatchHeader.replace(/^"|"$/g, "") : void 0;
1770
1773
  const actorHeader = req.headers?.["x-actor"] ?? req.headers?.["X-Actor"] ?? req.user?.id ?? req.userId;
1771
1774
  const actor = typeof actorHeader === "string" ? actorHeader : void 0;
1775
+ const packageRaw = req.query?.package;
1776
+ const packageId = typeof packageRaw === "string" && packageRaw && packageRaw !== "all" ? packageRaw : void 0;
1772
1777
  const result = await p.saveMetaItem({
1773
1778
  type: req.params.type,
1774
1779
  name: compoundName,
1775
1780
  item: req.body,
1776
1781
  ...environmentId ? { environmentId } : {},
1777
1782
  ...parentVersion !== void 0 ? { parentVersion } : {},
1778
- ...actor ? { actor } : {}
1783
+ ...actor ? { actor } : {},
1784
+ ...packageId ? { packageId } : {}
1779
1785
  });
1780
1786
  res.json(result);
1781
1787
  } catch (error) {