@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 CHANGED
@@ -1114,7 +1114,7 @@ async function prepareImportRequest(body, opts) {
1114
1114
  const dryRun = body?.dryRun === true;
1115
1115
  let writeMode = body?.writeMode === "update" || body?.writeMode === "upsert" ? body.writeMode : "insert";
1116
1116
  let matchFields = Array.isArray(body?.matchFields) ? body.matchFields.filter((f) => typeof f === "string" && f.length > 0) : [];
1117
- const runAutomations = body?.runAutomations === true;
1117
+ const runAutomations = body?.runAutomations !== false;
1118
1118
  const trimWhitespace = body?.trimWhitespace !== false;
1119
1119
  const nullValues = Array.isArray(body?.nullValues) ? body.nullValues.filter((v) => typeof v === "string") : void 0;
1120
1120
  const createMissingOptions = body?.createMissingOptions === true;
@@ -4906,12 +4906,15 @@ var RestServer = class _RestServer {
4906
4906
  const parsed = ExplainRequestSchema.safeParse({
4907
4907
  object: src.object,
4908
4908
  operation: src.operation ?? "read",
4909
- ...src.userId != null && src.userId !== "" ? { userId: src.userId } : {}
4909
+ ...src.userId != null && src.userId !== "" ? { userId: src.userId } : {},
4910
+ // [C2 / ADR-0095] Optional record id — explains ONE concrete
4911
+ // row at record granularity; omitted stays object-level.
4912
+ ...src.recordId != null && src.recordId !== "" ? { recordId: src.recordId } : {}
4910
4913
  });
4911
4914
  if (!parsed.success) {
4912
4915
  return res.status(400).json({
4913
4916
  code: "VALIDATION_FAILED",
4914
- message: "Invalid explain request \u2014 expected { object: string, operation: read|create|update|delete|transfer|restore|purge, userId?: string }.",
4917
+ message: "Invalid explain request \u2014 expected { object: string, operation: read|create|update|delete|transfer|restore|purge, userId?: string, recordId?: string }.",
4915
4918
  detail: String(parsed.error?.message ?? "").slice(0, 1e3)
4916
4919
  });
4917
4920
  }