@dudousxd/nestjs-catalog 0.22.0 → 0.24.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.
@@ -24,7 +24,7 @@
24
24
  * its own durable keyspace ({@link durableKeyspaceFor}), for the reason spelled
25
25
  * out there.
26
26
  */
27
- import type { ConnectorKind, TransformLanguage, WorkflowEdge, WorkflowNode } from './catalog.pipeline';
27
+ import type { ConnectorKind, TransformLanguage, TransformMode, WorkflowEdge, WorkflowNode } from './catalog.pipeline';
28
28
  /**
29
29
  * Where a request declares its environment.
30
30
  *
@@ -337,6 +337,17 @@ export interface PromotableTransform {
337
337
  description?: string;
338
338
  language: TransformLanguage;
339
339
  code: string;
340
+ /**
341
+ * Whether the code is called once with the batch or once per record.
342
+ *
343
+ * Carried, and **resolved** rather than left absent, unlike most optional
344
+ * fields on this shape. The mode decides what the same text means, so a
345
+ * promotion that dropped it would run the identical transform under a
346
+ * different contract in production than in dev — the one failure a promotion
347
+ * exists to make impossible. Resolved because a plan is a description of what
348
+ * the apply will do, and "absent, and the target will decide" is not one.
349
+ */
350
+ mode: TransformMode;
340
351
  /** The source's version, carried for the record only — see {@link planPromotion}. */
341
352
  version: number;
342
353
  }
@@ -407,7 +407,18 @@ function planTransforms(source, target, selected) {
407
407
  if (!selected('transform', transform.id))
408
408
  continue;
409
409
  const existing = targetTransforms.get(transform.id);
410
- const fields = diffFields(existing, transform, ['name', 'description', 'language', 'code']);
410
+ // `mode` is compared, and forgetting it would be the quiet failure this
411
+ // whole field exists to prevent: a transform switched from batch to
412
+ // per-record with its code untouched is a real change to what it computes,
413
+ // and a plan that reported "nothing to release" would leave production
414
+ // running the other contract.
415
+ const fields = diffFields(existing, transform, [
416
+ 'name',
417
+ 'description',
418
+ 'language',
419
+ 'code',
420
+ 'mode',
421
+ ]);
411
422
  changes.push({
412
423
  kind: 'transform',
413
424
  id: transform.id,