@diagonal-hq/cli 0.41.4 → 0.41.5

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
@@ -613,7 +613,7 @@ async function checkSources() {
613
613
  if (existsSync4(DATA_FILE) && existsSync4(SDK_FILE)) {
614
614
  return { dataFile: DATA_FILE, sdkFile: SDK_FILE };
615
615
  }
616
- const { checkData, scriptSdk } = await import("./cli-check-data-PQDHTVM6.mjs");
616
+ const { checkData, scriptSdk } = await import("./cli-check-data-PIXADUF2.mjs");
617
617
  return { data: checkData(), sdk: scriptSdk() };
618
618
  }
619
619
  function isScriptTestPath(path) {
package/dist/index.d.ts CHANGED
@@ -1224,14 +1224,28 @@ export type NotificationTemplateEmail = {
1224
1224
  /** Defaults to `'default'`, the built-in layout with one field, `content`. */
1225
1225
  layout?: EmailLayoutReference;
1226
1226
  /**
1227
- * A value for each field of the layout: Liquid, or for a field with a
1228
- * `type`, `{ variable: '<path>' }`, the value at a path of the send. The
1229
- * path starts with a variable of the type, `record` (the recipient), or
1230
- * `workspace`, such as `{ variable: 'record.company.name' }`.
1227
+ * A value for each field of the layout. A Liquid, text, url, email, or phone
1228
+ * field takes Liquid. A field of another type renders no Liquid, so it takes
1229
+ * `{ value: <value> }`, a literal of that type, such as `{ value: true }`.
1230
+ * A field with a type also takes `{ variable: '<path>' }`, the value at a
1231
+ * path of the send. The path starts with a variable of the type, `record`
1232
+ * (the recipient), or `workspace`, such as
1233
+ * `{ variable: 'record.company.name' }`.
1231
1234
  */
1232
- fields: { readonly [field: string]: LiquidSource | { variable: string } };
1235
+ fields: {
1236
+ readonly [field: string]: LiquidSource | { variable: string } | { value: EmailFieldValue };
1237
+ };
1233
1238
  };
1234
1239
 
1240
+ /** The literal value of a typed email field: JSON data. */
1241
+ export type EmailFieldValue =
1242
+ | string
1243
+ | number
1244
+ | boolean
1245
+ | null
1246
+ | readonly EmailFieldValue[]
1247
+ | { readonly [key: string]: EmailFieldValue };
1248
+
1235
1249
  export type NotificationTemplateSms = { body: LiquidSource };
1236
1250
 
1237
1251
  /**
@@ -1260,17 +1274,25 @@ export declare function defineNotificationTemplate<const T extends NotificationT
1260
1274
  ): T;
1261
1275
 
1262
1276
  /**
1263
- * A slot in the layout body. A template fills it with Liquid. A field with a
1264
- * `type` holds a value of that type: a template fills it with Liquid text or
1265
- * binds it to a variable with `{ variable: '<path>' }`.
1277
+ * A slot in the layout body. An object declares a Liquid field, which a
1278
+ * template fills with Liquid, or a text, url, email, or phone field. A
1279
+ * `field.<type>({...})` call declares a field of any type but a relation,
1280
+ * with the settings of the type, as a variable of a notification type does.
1281
+ * It takes a label, a description, `required`, and the settings, and none of
1282
+ * the options of a stored field, such as `default` and `guard`. A template
1283
+ * fills a text, url, email, or phone field with Liquid text, gives a field of
1284
+ * another type `{ value: <value> }`, or binds a field with a type to a
1285
+ * variable with `{ variable: '<path>' }`.
1266
1286
  */
1267
- export type EmailLayoutFieldDefinition = {
1268
- label: string;
1269
- description?: string | null;
1270
- required?: boolean;
1271
- /** Leave it out for a Liquid field. */
1272
- type?: 'text' | 'url' | 'email' | 'phone';
1273
- };
1287
+ export type EmailLayoutFieldDefinition =
1288
+ | {
1289
+ label: string;
1290
+ description?: string | null;
1291
+ required?: boolean;
1292
+ /** Leave it out for a Liquid field. */
1293
+ type?: 'text' | 'url' | 'email' | 'phone';
1294
+ }
1295
+ | FieldDefinition<Exclude<FieldType, 'relation' | 'liquid'>>;
1274
1296
 
1275
1297
  /**
1276
1298
  * An email layout. The build reads it only from an
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diagonal-hq/cli",
3
- "version": "0.41.4",
3
+ "version": "0.41.5",
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-h794cfa98b141",
55
- "@diagonal-hq/workflow-script-compiler-linux-x64": "0.1.0-h794cfa98b141",
56
- "@diagonal-hq/workflow-script-compiler-linux-arm64": "0.1.0-h794cfa98b141"
54
+ "@diagonal-hq/workflow-script-compiler-darwin-arm64": "0.1.0-h7a3d82a29750",
55
+ "@diagonal-hq/workflow-script-compiler-linux-x64": "0.1.0-h7a3d82a29750",
56
+ "@diagonal-hq/workflow-script-compiler-linux-arm64": "0.1.0-h7a3d82a29750"
57
57
  }
58
58
  }