@cadenza.io/service 2.17.39 → 2.17.41

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.mjs CHANGED
@@ -8648,10 +8648,10 @@ function buildSyncInsertQueryData(ctx, queryData = {}) {
8648
8648
  };
8649
8649
  const resolvedData = Object.prototype.hasOwnProperty.call(ctx, "data") || ctx.data !== void 0 ? ctx.data : getJoinedContextValue(ctx, "data");
8650
8650
  const resolvedBatch = Object.prototype.hasOwnProperty.call(ctx, "batch") || ctx.batch !== void 0 ? ctx.batch : getJoinedContextValue(ctx, "batch");
8651
- if (!("data" in nextQueryData) && resolvedData !== void 0) {
8651
+ if (resolvedData !== void 0) {
8652
8652
  nextQueryData.data = resolvedData && typeof resolvedData === "object" && !Array.isArray(resolvedData) ? { ...resolvedData } : resolvedData;
8653
8653
  }
8654
- if (!("batch" in nextQueryData) && resolvedBatch !== void 0) {
8654
+ if (resolvedBatch !== void 0) {
8655
8655
  nextQueryData.batch = Array.isArray(resolvedBatch) ? resolvedBatch.map(
8656
8656
  (row) => row && typeof row === "object" ? { ...row } : row
8657
8657
  ) : resolvedBatch;
@@ -8672,6 +8672,13 @@ function resolveSyncInsertTask(isCadenzaDBReady, tableName, queryData = {}, opti
8672
8672
  `Prepare graph sync insert execution for ${tableName}`,
8673
8673
  (ctx) => ({
8674
8674
  ...ctx,
8675
+ __resolverOriginalContext: {
8676
+ ...ctx
8677
+ },
8678
+ __resolverQueryData: buildSyncInsertQueryData(
8679
+ ctx,
8680
+ queryData
8681
+ ),
8675
8682
  queryData: buildSyncInsertQueryData(
8676
8683
  ctx,
8677
8684
  queryData
@@ -8689,8 +8696,15 @@ function resolveSyncInsertTask(isCadenzaDBReady, tableName, queryData = {}, opti
8689
8696
  if (!ctx.__resolverRequestId) {
8690
8697
  return false;
8691
8698
  }
8692
- emit(executionResolvedSignal, ctx);
8693
- return ctx;
8699
+ const originalContext = ctx.__resolverOriginalContext && typeof ctx.__resolverOriginalContext === "object" ? ctx.__resolverOriginalContext : {};
8700
+ const originalQueryData = ctx.__resolverQueryData && typeof ctx.__resolverQueryData === "object" ? ctx.__resolverQueryData : void 0;
8701
+ const normalizedContext = {
8702
+ ...originalContext,
8703
+ ...ctx,
8704
+ queryData: ctx.queryData && typeof ctx.queryData === "object" ? ctx.queryData : originalQueryData
8705
+ };
8706
+ emit(executionResolvedSignal, normalizedContext);
8707
+ return normalizedContext;
8694
8708
  },
8695
8709
  `Resolves signal-driven ${tableName} graph-sync insert execution.`,
8696
8710
  {