@automate.ax/catalog 0.65.0 → 0.66.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.
@@ -1,7 +1,7 @@
1
1
  import * as z from "zod/mini";
2
2
  export declare const DASHBOARD_RUN_CONFIG_SCHEMA: z.ZodMiniObject<{
3
3
  description: z.ZodMiniOptional<z.ZodMiniString<string>>;
4
- fields: z.ZodMiniPrefault<z.ZodMiniArray<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
4
+ fields: z.ZodMiniPrefault<z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
5
5
  defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
6
6
  maxLength: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
7
7
  minLength: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
@@ -15,7 +15,7 @@ export declare const DASHBOARD_RUN_CONFIG_SCHEMA: z.ZodMiniObject<{
15
15
  textarea: "textarea";
16
16
  }>;
17
17
  description: z.ZodMiniOptional<z.ZodMiniString<string>>;
18
- label: z.ZodMiniString<string>;
18
+ label: z.ZodMiniOptional<z.ZodMiniString<string>>;
19
19
  name: z.ZodMiniString<string>;
20
20
  }, z.core.$strip>, z.ZodMiniObject<{
21
21
  defaultValue: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
@@ -26,7 +26,7 @@ export declare const DASHBOARD_RUN_CONFIG_SCHEMA: z.ZodMiniObject<{
26
26
  step: z.ZodMiniPrefault<z.ZodMiniNumber<number>>;
27
27
  type: z.ZodMiniLiteral<"number">;
28
28
  description: z.ZodMiniOptional<z.ZodMiniString<string>>;
29
- label: z.ZodMiniString<string>;
29
+ label: z.ZodMiniOptional<z.ZodMiniString<string>>;
30
30
  name: z.ZodMiniString<string>;
31
31
  }, z.core.$strip>, z.ZodMiniObject<{
32
32
  defaultValue: z.ZodMiniOptional<z.iso.ZodMiniISODate>;
@@ -36,7 +36,7 @@ export declare const DASHBOARD_RUN_CONFIG_SCHEMA: z.ZodMiniObject<{
36
36
  step: z.ZodMiniPrefault<z.ZodMiniNumberFormat>;
37
37
  type: z.ZodMiniLiteral<"date">;
38
38
  description: z.ZodMiniOptional<z.ZodMiniString<string>>;
39
- label: z.ZodMiniString<string>;
39
+ label: z.ZodMiniOptional<z.ZodMiniString<string>>;
40
40
  name: z.ZodMiniString<string>;
41
41
  }, z.core.$strip>, z.ZodMiniObject<{
42
42
  defaultValue: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
@@ -46,7 +46,7 @@ export declare const DASHBOARD_RUN_CONFIG_SCHEMA: z.ZodMiniObject<{
46
46
  step: z.ZodMiniPrefault<z.ZodMiniNumber<number>>;
47
47
  type: z.ZodMiniLiteral<"datetime">;
48
48
  description: z.ZodMiniOptional<z.ZodMiniString<string>>;
49
- label: z.ZodMiniString<string>;
49
+ label: z.ZodMiniOptional<z.ZodMiniString<string>>;
50
50
  name: z.ZodMiniString<string>;
51
51
  }, z.core.$strip>, z.ZodMiniObject<{
52
52
  type: z.ZodMiniLiteral<"select">;
@@ -58,7 +58,7 @@ export declare const DASHBOARD_RUN_CONFIG_SCHEMA: z.ZodMiniObject<{
58
58
  placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
59
59
  required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
60
60
  description: z.ZodMiniOptional<z.ZodMiniString<string>>;
61
- label: z.ZodMiniString<string>;
61
+ label: z.ZodMiniOptional<z.ZodMiniString<string>>;
62
62
  name: z.ZodMiniString<string>;
63
63
  }, z.core.$strip>, z.ZodMiniObject<{
64
64
  type: z.ZodMiniLiteral<"radio">;
@@ -70,7 +70,7 @@ export declare const DASHBOARD_RUN_CONFIG_SCHEMA: z.ZodMiniObject<{
70
70
  placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
71
71
  required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
72
72
  description: z.ZodMiniOptional<z.ZodMiniString<string>>;
73
- label: z.ZodMiniString<string>;
73
+ label: z.ZodMiniOptional<z.ZodMiniString<string>>;
74
74
  name: z.ZodMiniString<string>;
75
75
  }, z.core.$strip>, z.ZodMiniObject<{
76
76
  defaultValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
@@ -82,16 +82,184 @@ export declare const DASHBOARD_RUN_CONFIG_SCHEMA: z.ZodMiniObject<{
82
82
  required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
83
83
  type: z.ZodMiniLiteral<"multi-select">;
84
84
  description: z.ZodMiniOptional<z.ZodMiniString<string>>;
85
- label: z.ZodMiniString<string>;
85
+ label: z.ZodMiniOptional<z.ZodMiniString<string>>;
86
86
  name: z.ZodMiniString<string>;
87
87
  }, z.core.$strip>, z.ZodMiniObject<{
88
88
  defaultValue: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
89
89
  required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
90
90
  type: z.ZodMiniLiteral<"checkbox">;
91
91
  description: z.ZodMiniOptional<z.ZodMiniString<string>>;
92
- label: z.ZodMiniString<string>;
92
+ label: z.ZodMiniOptional<z.ZodMiniString<string>>;
93
93
  name: z.ZodMiniString<string>;
94
- }, z.core.$strip>], "type">>>;
94
+ }, z.core.$strip>], "type">, z.ZodMiniTransform<{
95
+ label: string;
96
+ required: boolean;
97
+ type: "email" | "text" | "url" | "phone" | "textarea";
98
+ name: string;
99
+ defaultValue?: string | undefined;
100
+ maxLength?: number | undefined;
101
+ minLength?: number | undefined;
102
+ placeholder?: string | undefined;
103
+ description?: string | undefined;
104
+ } | {
105
+ label: string;
106
+ required: boolean;
107
+ step: number;
108
+ type: "number";
109
+ name: string;
110
+ defaultValue?: number | undefined;
111
+ max?: number | undefined;
112
+ min?: number | undefined;
113
+ placeholder?: string | undefined;
114
+ description?: string | undefined;
115
+ } | {
116
+ label: string;
117
+ required: boolean;
118
+ step: number;
119
+ type: "date";
120
+ name: string;
121
+ defaultValue?: string | undefined;
122
+ max?: string | undefined;
123
+ min?: string | undefined;
124
+ description?: string | undefined;
125
+ } | {
126
+ label: string;
127
+ required: boolean;
128
+ step: number;
129
+ type: "datetime";
130
+ name: string;
131
+ defaultValue?: string | undefined;
132
+ max?: string | undefined;
133
+ min?: string | undefined;
134
+ description?: string | undefined;
135
+ } | {
136
+ label: string;
137
+ type: "select";
138
+ options: {
139
+ label: string;
140
+ value: string;
141
+ }[];
142
+ required: boolean;
143
+ name: string;
144
+ defaultValue?: string | undefined;
145
+ placeholder?: string | undefined;
146
+ description?: string | undefined;
147
+ } | {
148
+ label: string;
149
+ type: "radio";
150
+ options: {
151
+ label: string;
152
+ value: string;
153
+ }[];
154
+ required: boolean;
155
+ name: string;
156
+ defaultValue?: string | undefined;
157
+ placeholder?: string | undefined;
158
+ description?: string | undefined;
159
+ } | {
160
+ label: string;
161
+ options: {
162
+ label: string;
163
+ value: string;
164
+ }[];
165
+ required: boolean;
166
+ type: "multi-select";
167
+ name: string;
168
+ defaultValue?: string[] | undefined;
169
+ placeholder?: string | undefined;
170
+ description?: string | undefined;
171
+ } | {
172
+ label: string;
173
+ defaultValue: boolean;
174
+ required: boolean;
175
+ type: "checkbox";
176
+ name: string;
177
+ description?: string | undefined;
178
+ }, {
179
+ required: boolean;
180
+ type: "email" | "text" | "url" | "phone" | "textarea";
181
+ name: string;
182
+ defaultValue?: string | undefined;
183
+ maxLength?: number | undefined;
184
+ minLength?: number | undefined;
185
+ placeholder?: string | undefined;
186
+ description?: string | undefined;
187
+ label?: string | undefined;
188
+ } | {
189
+ required: boolean;
190
+ step: number;
191
+ type: "number";
192
+ name: string;
193
+ defaultValue?: number | undefined;
194
+ max?: number | undefined;
195
+ min?: number | undefined;
196
+ placeholder?: string | undefined;
197
+ description?: string | undefined;
198
+ label?: string | undefined;
199
+ } | {
200
+ required: boolean;
201
+ step: number;
202
+ type: "date";
203
+ name: string;
204
+ defaultValue?: string | undefined;
205
+ max?: string | undefined;
206
+ min?: string | undefined;
207
+ description?: string | undefined;
208
+ label?: string | undefined;
209
+ } | {
210
+ required: boolean;
211
+ step: number;
212
+ type: "datetime";
213
+ name: string;
214
+ defaultValue?: string | undefined;
215
+ max?: string | undefined;
216
+ min?: string | undefined;
217
+ description?: string | undefined;
218
+ label?: string | undefined;
219
+ } | {
220
+ type: "select";
221
+ options: {
222
+ label: string;
223
+ value: string;
224
+ }[];
225
+ required: boolean;
226
+ name: string;
227
+ defaultValue?: string | undefined;
228
+ placeholder?: string | undefined;
229
+ description?: string | undefined;
230
+ label?: string | undefined;
231
+ } | {
232
+ type: "radio";
233
+ options: {
234
+ label: string;
235
+ value: string;
236
+ }[];
237
+ required: boolean;
238
+ name: string;
239
+ defaultValue?: string | undefined;
240
+ placeholder?: string | undefined;
241
+ description?: string | undefined;
242
+ label?: string | undefined;
243
+ } | {
244
+ options: {
245
+ label: string;
246
+ value: string;
247
+ }[];
248
+ required: boolean;
249
+ type: "multi-select";
250
+ name: string;
251
+ defaultValue?: string[] | undefined;
252
+ placeholder?: string | undefined;
253
+ description?: string | undefined;
254
+ label?: string | undefined;
255
+ } | {
256
+ defaultValue: boolean;
257
+ required: boolean;
258
+ type: "checkbox";
259
+ name: string;
260
+ description?: string | undefined;
261
+ label?: string | undefined;
262
+ }>>>>;
95
263
  submitLabel: z.ZodMiniPrefault<z.ZodMiniString<string>>;
96
264
  title: z.ZodMiniString<string>;
97
265
  }, z.core.$strip>;
@@ -145,8 +313,8 @@ export declare const coreTriggerDefinitions: {
145
313
  interface DashboardRunFieldBase {
146
314
  /** Supporting text shown below the field. */
147
315
  description?: string;
148
- /** Visible field label. */
149
- label: string;
316
+ /** Visible field label. Inferred from `name` when omitted. */
317
+ label?: string;
150
318
  /** Property name used in submitted trigger data. */
151
319
  name: string;
152
320
  /** Whether the form must contain a value. Defaults to true. */
@@ -287,4 +455,10 @@ export declare function getDashboardRunEndpoint(options: DashboardRunEndpointOpt
287
455
  * @param options - Trigger and owning automation identity.
288
456
  */
289
457
  export declare function getDashboardRunEndpointKey(options: Omit<DashboardRunEndpointOptions, "appOrigin">): string;
458
+ /**
459
+ * Converts a stable identifier to a sentence-cased display name.
460
+ *
461
+ * @param value - Stable identifier to format.
462
+ */
463
+ export declare function sentenceCase(value: string): string;
290
464
  export {};
@@ -25,7 +25,7 @@ const FIELD_DESCRIPTION_SCHEMA = z.string().check(z.maxLength(2_000));
25
25
  const FIELD_LENGTH_SCHEMA = z.int().check(z.nonnegative());
26
26
  const DASHBOARD_RUN_FIELD_BASE_SCHEMA = {
27
27
  description: z.optional(FIELD_DESCRIPTION_SCHEMA),
28
- label: FIELD_LABEL_SCHEMA,
28
+ label: z.optional(FIELD_LABEL_SCHEMA),
29
29
  name: FIELD_NAME_SCHEMA,
30
30
  };
31
31
  const DASHBOARD_RUN_TEXT_FIELD_SCHEMA = z.object({
@@ -104,7 +104,7 @@ const DASHBOARD_RUN_CHECKBOX_FIELD_SCHEMA = z.object({
104
104
  required: z.prefault(z.boolean(), false),
105
105
  type: z.literal("checkbox"),
106
106
  });
107
- const DASHBOARD_RUN_FIELD_SCHEMA = z.discriminatedUnion("type", [
107
+ const DASHBOARD_RUN_FIELD_SCHEMA = z.pipe(z.discriminatedUnion("type", [
108
108
  DASHBOARD_RUN_TEXT_FIELD_SCHEMA,
109
109
  DASHBOARD_RUN_NUMBER_FIELD_SCHEMA,
110
110
  DASHBOARD_RUN_DATE_FIELD_SCHEMA,
@@ -113,7 +113,11 @@ const DASHBOARD_RUN_FIELD_SCHEMA = z.discriminatedUnion("type", [
113
113
  DASHBOARD_RUN_RADIO_FIELD_SCHEMA,
114
114
  DASHBOARD_RUN_MULTI_SELECT_FIELD_SCHEMA,
115
115
  DASHBOARD_RUN_CHECKBOX_FIELD_SCHEMA,
116
- ]);
116
+ ]), z.transform((field) => ({
117
+ ...field,
118
+ label: field.label ??
119
+ `${sentenceCase(field.name)}${field.type === "checkbox" ? "?" : ""}`,
120
+ })));
117
121
  const DASHBOARD_RUN_FIELDS_SCHEMA = z.array(DASHBOARD_RUN_FIELD_SCHEMA).check(z.refine((fields) => new Set(fields.map((field) => field.name)).size === fields.length, "Dashboard run field names must be unique."), z.refine((fields) => fields.every(isDashboardRunFieldDefaultValid), "Dashboard run field defaults must satisfy their field constraints."));
118
122
  export const DASHBOARD_RUN_CONFIG_SCHEMA = z.object({
119
123
  description: z.optional(FIELD_DESCRIPTION_SCHEMA),
@@ -322,6 +326,18 @@ function isDashboardRunStepMismatch(value, base, step) {
322
326
  function parseDashboardRunDateValue(type, value) {
323
327
  return Date.parse(type === "date" ? `${value}T00:00:00Z` : `${value}Z`);
324
328
  }
329
+ /**
330
+ * Converts a stable identifier to a sentence-cased display name.
331
+ *
332
+ * @param value - Stable identifier to format.
333
+ */
334
+ export function sentenceCase(value) {
335
+ const words = value
336
+ .replaceAll(/([a-z\d])([A-Z])/g, "$1 $2")
337
+ .replaceAll(/[._-]+/g, " ")
338
+ .toLowerCase();
339
+ return words.charAt(0).toUpperCase() + words.slice(1);
340
+ }
325
341
  /**
326
342
  * Removes the redundant TypeID prefix from an address router.
327
343
  *
@@ -1,7 +1,7 @@
1
1
  import { airtableTriggerDefinitions } from "./airtable.js";
2
2
  import { asanaTriggerDefinitions } from "./asana.js";
3
3
  import { brevoTriggerDefinitions } from "./brevo.js";
4
- import { coreTriggerDefinitions } from "./core.js";
4
+ import { coreTriggerDefinitions, sentenceCase } from "./core.js";
5
5
  import { githubTriggerDefinitions } from "./github.js";
6
6
  import { googleTriggerDefinitions } from "./google.js";
7
7
  import { linearTriggerDefinitions } from "./linear.js";
@@ -99,15 +99,3 @@ function inferTriggerName(definition) {
99
99
  ? inferredName.replace(sentenceCase(namespace), service.name)
100
100
  : inferredName;
101
101
  }
102
- /**
103
- * Converts a stable identifier to a sentence-cased display name.
104
- *
105
- * @param value - Stable identifier to format.
106
- */
107
- function sentenceCase(value) {
108
- const words = value
109
- .replaceAll(/([a-z\d])([A-Z])/g, "$1 $2")
110
- .replaceAll(/[._-]+/g, " ")
111
- .toLowerCase();
112
- return words.charAt(0).toUpperCase() + words.slice(1);
113
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automate.ax/catalog",
3
- "version": "0.65.0",
3
+ "version": "0.66.0",
4
4
  "description": "Shared integration service and trigger definitions for Automate.ax.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -27,7 +27,7 @@ const FIELD_DESCRIPTION_SCHEMA = z.string().check(z.maxLength(2_000))
27
27
  const FIELD_LENGTH_SCHEMA = z.int().check(z.nonnegative())
28
28
  const DASHBOARD_RUN_FIELD_BASE_SCHEMA = {
29
29
  description: z.optional(FIELD_DESCRIPTION_SCHEMA),
30
- label: FIELD_LABEL_SCHEMA,
30
+ label: z.optional(FIELD_LABEL_SCHEMA),
31
31
  name: FIELD_NAME_SCHEMA,
32
32
  }
33
33
  const DASHBOARD_RUN_TEXT_FIELD_SCHEMA = z.object({
@@ -110,16 +110,24 @@ const DASHBOARD_RUN_CHECKBOX_FIELD_SCHEMA = z.object({
110
110
  required: z.prefault(z.boolean(), false),
111
111
  type: z.literal("checkbox"),
112
112
  })
113
- const DASHBOARD_RUN_FIELD_SCHEMA = z.discriminatedUnion("type", [
114
- DASHBOARD_RUN_TEXT_FIELD_SCHEMA,
115
- DASHBOARD_RUN_NUMBER_FIELD_SCHEMA,
116
- DASHBOARD_RUN_DATE_FIELD_SCHEMA,
117
- DASHBOARD_RUN_DATETIME_FIELD_SCHEMA,
118
- DASHBOARD_RUN_SELECT_FIELD_SCHEMA,
119
- DASHBOARD_RUN_RADIO_FIELD_SCHEMA,
120
- DASHBOARD_RUN_MULTI_SELECT_FIELD_SCHEMA,
121
- DASHBOARD_RUN_CHECKBOX_FIELD_SCHEMA,
122
- ])
113
+ const DASHBOARD_RUN_FIELD_SCHEMA = z.pipe(
114
+ z.discriminatedUnion("type", [
115
+ DASHBOARD_RUN_TEXT_FIELD_SCHEMA,
116
+ DASHBOARD_RUN_NUMBER_FIELD_SCHEMA,
117
+ DASHBOARD_RUN_DATE_FIELD_SCHEMA,
118
+ DASHBOARD_RUN_DATETIME_FIELD_SCHEMA,
119
+ DASHBOARD_RUN_SELECT_FIELD_SCHEMA,
120
+ DASHBOARD_RUN_RADIO_FIELD_SCHEMA,
121
+ DASHBOARD_RUN_MULTI_SELECT_FIELD_SCHEMA,
122
+ DASHBOARD_RUN_CHECKBOX_FIELD_SCHEMA,
123
+ ]),
124
+ z.transform((field) => ({
125
+ ...field,
126
+ label:
127
+ field.label ??
128
+ `${sentenceCase(field.name)}${field.type === "checkbox" ? "?" : ""}`,
129
+ })),
130
+ )
123
131
  const DASHBOARD_RUN_FIELDS_SCHEMA = z.array(DASHBOARD_RUN_FIELD_SCHEMA).check(
124
132
  z.refine(
125
133
  (fields) =>
@@ -222,8 +230,8 @@ interface DashboardRunFieldBase {
222
230
  /** Supporting text shown below the field. */
223
231
  description?: string
224
232
 
225
- /** Visible field label. */
226
- label: string
233
+ /** Visible field label. Inferred from `name` when omitted. */
234
+ label?: string
227
235
 
228
236
  /** Property name used in submitted trigger data. */
229
237
  name: string
@@ -516,6 +524,20 @@ function parseDashboardRunDateValue(type: "date" | "datetime", value: string) {
516
524
  return Date.parse(type === "date" ? `${value}T00:00:00Z` : `${value}Z`)
517
525
  }
518
526
 
527
+ /**
528
+ * Converts a stable identifier to a sentence-cased display name.
529
+ *
530
+ * @param value - Stable identifier to format.
531
+ */
532
+ export function sentenceCase(value: string) {
533
+ const words = value
534
+ .replaceAll(/([a-z\d])([A-Z])/g, "$1 $2")
535
+ .replaceAll(/[._-]+/g, " ")
536
+ .toLowerCase()
537
+
538
+ return words.charAt(0).toUpperCase() + words.slice(1)
539
+ }
540
+
519
541
  /**
520
542
  * Removes the redundant TypeID prefix from an address router.
521
543
  *
@@ -1,7 +1,7 @@
1
1
  import { airtableTriggerDefinitions } from "./airtable"
2
2
  import { asanaTriggerDefinitions } from "./asana"
3
3
  import { brevoTriggerDefinitions } from "./brevo"
4
- import { coreTriggerDefinitions } from "./core"
4
+ import { coreTriggerDefinitions, sentenceCase } from "./core"
5
5
  import { githubTriggerDefinitions } from "./github"
6
6
  import { googleTriggerDefinitions } from "./google"
7
7
  import { linearTriggerDefinitions } from "./linear"
@@ -148,17 +148,3 @@ function inferTriggerName(definition: TriggerDefinition) {
148
148
  ? inferredName.replace(sentenceCase(namespace), service.name)
149
149
  : inferredName
150
150
  }
151
-
152
- /**
153
- * Converts a stable identifier to a sentence-cased display name.
154
- *
155
- * @param value - Stable identifier to format.
156
- */
157
- function sentenceCase(value: string) {
158
- const words = value
159
- .replaceAll(/([a-z\d])([A-Z])/g, "$1 $2")
160
- .replaceAll(/[._-]+/g, " ")
161
- .toLowerCase()
162
-
163
- return words.charAt(0).toUpperCase() + words.slice(1)
164
- }