@diagonal-hq/cli 0.42.9 → 0.42.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/cli.mjs CHANGED
@@ -9450,6 +9450,15 @@ function filtersOf(value, key = "filters") {
9450
9450
  }
9451
9451
  return { [key]: value };
9452
9452
  }
9453
+ function relationsOf(value) {
9454
+ if (value === void 0 || value === null) {
9455
+ return {};
9456
+ }
9457
+ if (!Array.isArray(value) || value.some((relation) => typeof relation !== "string" || relation === "")) {
9458
+ throw new SourceError('"trigger.relations" must be a list of relation paths or null.');
9459
+ }
9460
+ return value.length === 0 ? {} : { relations: value };
9461
+ }
9453
9462
  function referenceWriter(ast, resources) {
9454
9463
  const locals = {
9455
9464
  resources: generatedBindingLocal(ast, GENERATED_RESOURCES_MODULE, RESOURCES_EXPORT),
@@ -9531,7 +9540,8 @@ function triggerOf(trigger, references2) {
9531
9540
  resource: references2.resource(trigger.resource),
9532
9541
  event: oneOf(trigger.event, RECORD_EVENTS, "trigger.event"),
9533
9542
  ...filtersOf(trigger.filters),
9534
- ...filtersOf(trigger.previousFilters, "previousFilters")
9543
+ ...filtersOf(trigger.previousFilters, "previousFilters"),
9544
+ ...relationsOf(trigger.relations)
9535
9545
  };
9536
9546
  case "recordLifecycle":
9537
9547
  return {
@@ -11139,7 +11149,7 @@ async function checkSources() {
11139
11149
  if (existsSync4(DATA_FILE) && existsSync4(SDK_FILE)) {
11140
11150
  return { dataFile: DATA_FILE, sdkFile: SDK_FILE };
11141
11151
  }
11142
- const { checkData, scriptSdk } = await import("./cli-check-data-YUN3PNMM.mjs");
11152
+ const { checkData, scriptSdk } = await import("./cli-check-data-NOJMQBO5.mjs");
11143
11153
  return { data: checkData(), sdk: scriptSdk() };
11144
11154
  }
11145
11155
  function isScriptTestPath(path) {
package/dist/index.d.ts CHANGED
@@ -1024,6 +1024,12 @@ export type RecordEventTrigger = {
1024
1024
  event: 'created' | 'updated' | 'deleted' | 'restored' | 'saved';
1025
1025
  /** Runs the workflow only for the records that match. */
1026
1026
  filters?: FilterGroup;
1027
+ /**
1028
+ * The relations to load with the trigger record, as relation field keys of
1029
+ * the resource. A dot goes one relation further, for example
1030
+ * `['member', 'member.company']`.
1031
+ */
1032
+ relations?: readonly string[];
1027
1033
  /**
1028
1034
  * Runs the workflow only when the record before the change matches, for
1029
1035
  * example a status that was `'pending'`. Only the `'updated'` event takes it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diagonal-hq/cli",
3
- "version": "0.42.9",
3
+ "version": "0.42.11",
4
4
  "description": "The diagonal CLI and the configuration helpers for file-based Diagonal workspaces.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
@@ -51,8 +51,8 @@
51
51
  "bun": "1.4.4"
52
52
  },
53
53
  "optionalDependencies": {
54
- "@diagonal-hq/workflow-script-compiler-darwin-arm64": "0.1.0-h716e936d4f5c",
55
- "@diagonal-hq/workflow-script-compiler-linux-x64": "0.1.0-h716e936d4f5c",
56
- "@diagonal-hq/workflow-script-compiler-linux-arm64": "0.1.0-h716e936d4f5c"
54
+ "@diagonal-hq/workflow-script-compiler-darwin-arm64": "0.1.0-hfa5df7377e59",
55
+ "@diagonal-hq/workflow-script-compiler-linux-x64": "0.1.0-hfa5df7377e59",
56
+ "@diagonal-hq/workflow-script-compiler-linux-arm64": "0.1.0-hfa5df7377e59"
57
57
  }
58
58
  }