@diagonal-hq/cli 0.41.4 → 0.41.6

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.d.ts CHANGED
@@ -91,6 +91,22 @@ export type UidOption = { uid?: DefinitionUid };
91
91
  */
92
92
  export type SlugOption = { slug?: DefinitionSlug };
93
93
 
94
+ export type PackageInputValue =
95
+ | null
96
+ | boolean
97
+ | number
98
+ | string
99
+ | readonly PackageInputValue[]
100
+ | { readonly [key: string]: PackageInputValue };
101
+
102
+ export type PackageInputChoices = {
103
+ readonly [key: `resource:${string}` | `role:${string}` | `permission:${string}`]: DefinitionUid;
104
+ readonly [key: `workspace_field:${string}`]:
105
+ | DefinitionUid
106
+ | { value: PackageInputValue }
107
+ | { secret: DefinitionUid | null };
108
+ };
109
+
94
110
  /**
95
111
  * The workspace config in `diagonal.config.ts`. Each deploy writes `name`,
96
112
  * `brand`, and `settings` to the workspace. Custom workspace fields are files
@@ -104,6 +120,8 @@ export type ConfigDefinition = {
104
120
  * `@app/generated/assets`, such as `Assets.WordmarkLight.key`.
105
121
  */
106
122
  brand?: BrandKit;
123
+ /** Destination choices for installed packages, by npm package name and input identity. */
124
+ packages?: { readonly [name: string]: PackageInputChoices };
107
125
  /**
108
126
  * The built-in workspace settings by their stored keys. Each
109
127
  * `custom_<status>_error_page` setting takes `Pages.<Name>.uid` from
@@ -1224,14 +1242,28 @@ export type NotificationTemplateEmail = {
1224
1242
  /** Defaults to `'default'`, the built-in layout with one field, `content`. */
1225
1243
  layout?: EmailLayoutReference;
1226
1244
  /**
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' }`.
1245
+ * A value for each field of the layout. A Liquid, text, url, email, or phone
1246
+ * field takes Liquid. A field of another type renders no Liquid, so it takes
1247
+ * `{ value: <value> }`, a literal of that type, such as `{ value: true }`.
1248
+ * A field with a type also takes `{ variable: '<path>' }`, the value at a
1249
+ * path of the send. The path starts with a variable of the type, `record`
1250
+ * (the recipient), or `workspace`, such as
1251
+ * `{ variable: 'record.company.name' }`.
1231
1252
  */
1232
- fields: { readonly [field: string]: LiquidSource | { variable: string } };
1253
+ fields: {
1254
+ readonly [field: string]: LiquidSource | { variable: string } | { value: EmailFieldValue };
1255
+ };
1233
1256
  };
1234
1257
 
1258
+ /** The literal value of a typed email field: JSON data. */
1259
+ export type EmailFieldValue =
1260
+ | string
1261
+ | number
1262
+ | boolean
1263
+ | null
1264
+ | readonly EmailFieldValue[]
1265
+ | { readonly [key: string]: EmailFieldValue };
1266
+
1235
1267
  export type NotificationTemplateSms = { body: LiquidSource };
1236
1268
 
1237
1269
  /**
@@ -1260,17 +1292,25 @@ export declare function defineNotificationTemplate<const T extends NotificationT
1260
1292
  ): T;
1261
1293
 
1262
1294
  /**
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>' }`.
1295
+ * A slot in the layout body. An object declares a Liquid field, which a
1296
+ * template fills with Liquid, or a text, url, email, or phone field. A
1297
+ * `field.<type>({...})` call declares a field of any type but a relation,
1298
+ * with the settings of the type, as a variable of a notification type does.
1299
+ * It takes a label, a description, `required`, and the settings, and none of
1300
+ * the options of a stored field, such as `default` and `guard`. A template
1301
+ * fills a text, url, email, or phone field with Liquid text, gives a field of
1302
+ * another type `{ value: <value> }`, or binds a field with a type to a
1303
+ * variable with `{ variable: '<path>' }`.
1266
1304
  */
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
- };
1305
+ export type EmailLayoutFieldDefinition =
1306
+ | {
1307
+ label: string;
1308
+ description?: string | null;
1309
+ required?: boolean;
1310
+ /** Leave it out for a Liquid field. */
1311
+ type?: 'text' | 'url' | 'email' | 'phone';
1312
+ }
1313
+ | FieldDefinition<Exclude<FieldType, 'relation' | 'liquid'>>;
1274
1314
 
1275
1315
  /**
1276
1316
  * An email layout. The build reads it only from an
@@ -2984,6 +2984,8 @@ type SdkWorkspace = {
2984
2984
  } | null;
2985
2985
 
2986
2986
  type SdkWorkspaceField = {
2987
+ /** A credential is saved. Its value is not needed to keep it unchanged. */
2988
+ has_stored_value?: boolean;
2987
2989
  id: string | null;
2988
2990
  key: string;
2989
2991
  type: string;
@@ -8887,7 +8889,8 @@ type SdkUseWorkspaceFieldsFormOptions = {
8887
8889
  /** Workspace field definitions to render, in order. Omit to render every field that is
8888
8890
  * not hidden and not read-only. Undefined, read-only, and hidden entries are dropped. */
8889
8891
  fields?: Array<SdkWorkspaceField | undefined>;
8890
- /** Editable seed values that override the workspace's current values. */
8892
+ /** Editable seed values that override the workspace's current values. Passwords are
8893
+ * omitted until changed; provide a string to replace one or null to clear it. */
8891
8894
  initialValues?: Record<string, any>;
8892
8895
  /** Locked values submitted even when omitted from `fields`; rendered disabled. Keys of
8893
8896
  * read-only or hidden definitions are dropped. */
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.6",
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-h100528fb8775",
55
+ "@diagonal-hq/workflow-script-compiler-linux-x64": "0.1.0-h100528fb8775",
56
+ "@diagonal-hq/workflow-script-compiler-linux-arm64": "0.1.0-h100528fb8775"
57
57
  }
58
58
  }