@cadenza.io/service 2.17.10 → 2.17.11

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
@@ -6196,6 +6196,13 @@ function serializeFieldValueForQuery(value, field) {
6196
6196
  }
6197
6197
  return JSON.stringify(value);
6198
6198
  }
6199
+ function isSubOperationPayload(value) {
6200
+ if (!value || typeof value !== "object") {
6201
+ return false;
6202
+ }
6203
+ const candidate = value;
6204
+ return typeof candidate.subOperation === "string" && typeof candidate.table === "string" && candidate.table.trim().length > 0;
6205
+ }
6199
6206
  function readCustomIntentConfig(customIntent) {
6200
6207
  if (typeof customIntent === "string") {
6201
6208
  return {
@@ -7677,9 +7684,8 @@ var DatabaseController = class _DatabaseController {
7677
7684
  }
7678
7685
  const resolved = { ...data };
7679
7686
  for (const [key, value] of Object.entries(data)) {
7680
- if (typeof value === "object" && value !== null && "subOperation" in value) {
7681
- const subOperation = value;
7682
- resolved[key] = await this.executeSubOperation(registration, subOperation);
7687
+ if (isSubOperationPayload(value)) {
7688
+ resolved[key] = await this.executeSubOperation(registration, value);
7683
7689
  } else if (typeof value === "string" && ["increment", "decrement", "set"].includes(value)) {
7684
7690
  resolved[key] = { __effect: value };
7685
7691
  } else if (typeof value === "object" && value !== null) {