@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.js CHANGED
@@ -8697,10 +8697,10 @@ function buildSyncInsertQueryData(ctx, queryData = {}) {
8697
8697
  };
8698
8698
  const resolvedData = Object.prototype.hasOwnProperty.call(ctx, "data") || ctx.data !== void 0 ? ctx.data : getJoinedContextValue(ctx, "data");
8699
8699
  const resolvedBatch = Object.prototype.hasOwnProperty.call(ctx, "batch") || ctx.batch !== void 0 ? ctx.batch : getJoinedContextValue(ctx, "batch");
8700
- if (!("data" in nextQueryData) && resolvedData !== void 0) {
8700
+ if (resolvedData !== void 0) {
8701
8701
  nextQueryData.data = resolvedData && typeof resolvedData === "object" && !Array.isArray(resolvedData) ? { ...resolvedData } : resolvedData;
8702
8702
  }
8703
- if (!("batch" in nextQueryData) && resolvedBatch !== void 0) {
8703
+ if (resolvedBatch !== void 0) {
8704
8704
  nextQueryData.batch = Array.isArray(resolvedBatch) ? resolvedBatch.map(
8705
8705
  (row) => row && typeof row === "object" ? { ...row } : row
8706
8706
  ) : resolvedBatch;
@@ -8721,6 +8721,13 @@ function resolveSyncInsertTask(isCadenzaDBReady, tableName, queryData = {}, opti
8721
8721
  `Prepare graph sync insert execution for ${tableName}`,
8722
8722
  (ctx) => ({
8723
8723
  ...ctx,
8724
+ __resolverOriginalContext: {
8725
+ ...ctx
8726
+ },
8727
+ __resolverQueryData: buildSyncInsertQueryData(
8728
+ ctx,
8729
+ queryData
8730
+ ),
8724
8731
  queryData: buildSyncInsertQueryData(
8725
8732
  ctx,
8726
8733
  queryData
@@ -8738,8 +8745,15 @@ function resolveSyncInsertTask(isCadenzaDBReady, tableName, queryData = {}, opti
8738
8745
  if (!ctx.__resolverRequestId) {
8739
8746
  return false;
8740
8747
  }
8741
- emit(executionResolvedSignal, ctx);
8742
- return ctx;
8748
+ const originalContext = ctx.__resolverOriginalContext && typeof ctx.__resolverOriginalContext === "object" ? ctx.__resolverOriginalContext : {};
8749
+ const originalQueryData = ctx.__resolverQueryData && typeof ctx.__resolverQueryData === "object" ? ctx.__resolverQueryData : void 0;
8750
+ const normalizedContext = {
8751
+ ...originalContext,
8752
+ ...ctx,
8753
+ queryData: ctx.queryData && typeof ctx.queryData === "object" ? ctx.queryData : originalQueryData
8754
+ };
8755
+ emit(executionResolvedSignal, normalizedContext);
8756
+ return normalizedContext;
8743
8757
  },
8744
8758
  `Resolves signal-driven ${tableName} graph-sync insert execution.`,
8745
8759
  {