@objectstack/rest 7.2.1 → 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.cjs +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1527,6 +1527,8 @@ var RestServer = class {
|
|
|
1527
1527
|
const actor = typeof actorHeader === "string" ? actorHeader : void 0;
|
|
1528
1528
|
const forceRaw = req.query?.force;
|
|
1529
1529
|
const force = typeof forceRaw === "string" ? ["true", "1", "yes", "on"].includes(forceRaw.toLowerCase()) : !!forceRaw;
|
|
1530
|
+
const packageRaw = req.query?.package;
|
|
1531
|
+
const packageId = typeof packageRaw === "string" && packageRaw && packageRaw !== "all" ? packageRaw : void 0;
|
|
1530
1532
|
const result = await p.saveMetaItem({
|
|
1531
1533
|
type: req.params.type,
|
|
1532
1534
|
name: req.params.name,
|
|
@@ -1535,6 +1537,7 @@ var RestServer = class {
|
|
|
1535
1537
|
...parentVersion !== void 0 ? { parentVersion } : {},
|
|
1536
1538
|
...actor ? { actor } : {},
|
|
1537
1539
|
...force ? { force: true } : {},
|
|
1540
|
+
...packageId ? { packageId } : {},
|
|
1538
1541
|
...typeof req.query?.mode === "string" && req.query.mode.toLowerCase() === "draft" ? { mode: "draft" } : {}
|
|
1539
1542
|
});
|
|
1540
1543
|
res.json(result);
|
|
@@ -1809,13 +1812,16 @@ var RestServer = class {
|
|
|
1809
1812
|
const parentVersion = typeof ifMatchHeader === "string" ? ifMatchHeader.replace(/^"|"$/g, "") : void 0;
|
|
1810
1813
|
const actorHeader = req.headers?.["x-actor"] ?? req.headers?.["X-Actor"] ?? req.user?.id ?? req.userId;
|
|
1811
1814
|
const actor = typeof actorHeader === "string" ? actorHeader : void 0;
|
|
1815
|
+
const packageRaw = req.query?.package;
|
|
1816
|
+
const packageId = typeof packageRaw === "string" && packageRaw && packageRaw !== "all" ? packageRaw : void 0;
|
|
1812
1817
|
const result = await p.saveMetaItem({
|
|
1813
1818
|
type: req.params.type,
|
|
1814
1819
|
name: compoundName,
|
|
1815
1820
|
item: req.body,
|
|
1816
1821
|
...environmentId ? { environmentId } : {},
|
|
1817
1822
|
...parentVersion !== void 0 ? { parentVersion } : {},
|
|
1818
|
-
...actor ? { actor } : {}
|
|
1823
|
+
...actor ? { actor } : {},
|
|
1824
|
+
...packageId ? { packageId } : {}
|
|
1819
1825
|
});
|
|
1820
1826
|
res.json(result);
|
|
1821
1827
|
} catch (error) {
|