@objectstack/rest 14.8.0 → 15.0.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 +6 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1068,7 +1068,7 @@ async function prepareImportRequest(body, opts) {
|
|
|
1068
1068
|
const dryRun = body?.dryRun === true;
|
|
1069
1069
|
let writeMode = body?.writeMode === "update" || body?.writeMode === "upsert" ? body.writeMode : "insert";
|
|
1070
1070
|
let matchFields = Array.isArray(body?.matchFields) ? body.matchFields.filter((f) => typeof f === "string" && f.length > 0) : [];
|
|
1071
|
-
const runAutomations = body?.runAutomations
|
|
1071
|
+
const runAutomations = body?.runAutomations !== false;
|
|
1072
1072
|
const trimWhitespace = body?.trimWhitespace !== false;
|
|
1073
1073
|
const nullValues = Array.isArray(body?.nullValues) ? body.nullValues.filter((v) => typeof v === "string") : void 0;
|
|
1074
1074
|
const createMissingOptions = body?.createMissingOptions === true;
|
|
@@ -4859,12 +4859,15 @@ var RestServer = class _RestServer {
|
|
|
4859
4859
|
const parsed = ExplainRequestSchema.safeParse({
|
|
4860
4860
|
object: src.object,
|
|
4861
4861
|
operation: src.operation ?? "read",
|
|
4862
|
-
...src.userId != null && src.userId !== "" ? { userId: src.userId } : {}
|
|
4862
|
+
...src.userId != null && src.userId !== "" ? { userId: src.userId } : {},
|
|
4863
|
+
// [C2 / ADR-0095] Optional record id — explains ONE concrete
|
|
4864
|
+
// row at record granularity; omitted stays object-level.
|
|
4865
|
+
...src.recordId != null && src.recordId !== "" ? { recordId: src.recordId } : {}
|
|
4863
4866
|
});
|
|
4864
4867
|
if (!parsed.success) {
|
|
4865
4868
|
return res.status(400).json({
|
|
4866
4869
|
code: "VALIDATION_FAILED",
|
|
4867
|
-
message: "Invalid explain request \u2014 expected { object: string, operation: read|create|update|delete|transfer|restore|purge, userId?: string }.",
|
|
4870
|
+
message: "Invalid explain request \u2014 expected { object: string, operation: read|create|update|delete|transfer|restore|purge, userId?: string, recordId?: string }.",
|
|
4868
4871
|
detail: String(parsed.error?.message ?? "").slice(0, 1e3)
|
|
4869
4872
|
});
|
|
4870
4873
|
}
|