@objectstack/rest 7.7.0 → 7.8.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 +31 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1350,6 +1350,37 @@ var RestServer = class {
|
|
|
1350
1350
|
}
|
|
1351
1351
|
});
|
|
1352
1352
|
}
|
|
1353
|
+
if (metadata.endpoints.items !== false) {
|
|
1354
|
+
this.routeManager.register({
|
|
1355
|
+
method: "GET",
|
|
1356
|
+
path: `${metaPath}/_drafts`,
|
|
1357
|
+
handler: async (req, res) => {
|
|
1358
|
+
try {
|
|
1359
|
+
const environmentId = isScoped ? req.params?.environmentId : void 0;
|
|
1360
|
+
const p = await this.resolveProtocol(environmentId, req);
|
|
1361
|
+
if (typeof p.listDrafts !== "function") {
|
|
1362
|
+
res.status(501).json({
|
|
1363
|
+
error: "not_implemented",
|
|
1364
|
+
message: "protocol.listDrafts() is not available in this kernel"
|
|
1365
|
+
});
|
|
1366
|
+
return;
|
|
1367
|
+
}
|
|
1368
|
+
const result = await p.listDrafts({
|
|
1369
|
+
packageId: req.query?.packageId || void 0,
|
|
1370
|
+
type: req.query?.type || void 0
|
|
1371
|
+
});
|
|
1372
|
+
res.json(result);
|
|
1373
|
+
} catch (error) {
|
|
1374
|
+
logError("[REST] Unhandled error:", error);
|
|
1375
|
+
sendError(res, error);
|
|
1376
|
+
}
|
|
1377
|
+
},
|
|
1378
|
+
metadata: {
|
|
1379
|
+
summary: "List pending draft metadata items",
|
|
1380
|
+
tags: ["metadata"]
|
|
1381
|
+
}
|
|
1382
|
+
});
|
|
1383
|
+
}
|
|
1353
1384
|
if (metadata.endpoints.items !== false) {
|
|
1354
1385
|
this.routeManager.register({
|
|
1355
1386
|
method: "GET",
|