@automate.ax/catalog 0.74.0 → 0.76.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.
- package/dist/authoring.d.ts +1 -0
- package/dist/authoring.js +1 -0
- package/dist/triggers/airtable.js +1 -2
- package/dist/triggers/asana.js +1 -2
- package/dist/triggers/brevo.js +1 -2
- package/dist/triggers/core-dashboard.d.ts +374 -0
- package/dist/triggers/core-dashboard.js +202 -0
- package/dist/triggers/core-http.d.ts +30 -0
- package/dist/triggers/core-http.js +43 -0
- package/dist/triggers/core-invocation.d.ts +9 -0
- package/dist/triggers/core-invocation.js +15 -0
- package/dist/triggers/core-mailhook.d.ts +35 -0
- package/dist/triggers/core-mailhook.js +63 -0
- package/dist/triggers/core-schedule.d.ts +9 -0
- package/dist/triggers/core-schedule.js +17 -0
- package/dist/triggers/core.d.ts +15 -426
- package/dist/triggers/core.js +16 -346
- package/dist/triggers/github.js +4 -5
- package/dist/triggers/google.js +4 -5
- package/dist/triggers/index.d.ts +20 -20
- package/dist/triggers/index.js +2 -1
- package/dist/triggers/linear.js +1 -2
- package/dist/triggers/microsoft.js +3 -4
- package/dist/triggers/name.d.ts +13 -0
- package/dist/triggers/name.js +31 -0
- package/dist/triggers/resend.js +1 -2
- package/dist/triggers/slack.js +3 -4
- package/dist/triggers/trello.js +1 -2
- package/dist/triggers/vercel.js +5 -6
- package/dist/triggers/whatsapp.js +1 -2
- package/package.json +118 -5
- package/src/authoring.ts +8 -0
- package/src/triggers/airtable.ts +1 -2
- package/src/triggers/asana.ts +1 -2
- package/src/triggers/brevo.ts +1 -2
- package/src/triggers/core-dashboard.ts +361 -0
- package/src/triggers/core-http.ts +69 -0
- package/src/triggers/core-invocation.ts +18 -0
- package/src/triggers/core-mailhook.ts +83 -0
- package/src/triggers/core-schedule.ts +21 -0
- package/src/triggers/core.ts +38 -544
- package/src/triggers/github.ts +4 -5
- package/src/triggers/google.ts +4 -5
- package/src/triggers/index.ts +2 -1
- package/src/triggers/linear.ts +1 -2
- package/src/triggers/microsoft.ts +3 -4
- package/src/triggers/name.ts +37 -0
- package/src/triggers/resend.ts +1 -2
- package/src/triggers/slack.ts +3 -4
- package/src/triggers/trello.ts +1 -2
- package/src/triggers/vercel.ts +5 -6
- package/src/triggers/whatsapp.ts +1 -2
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
|
+
const HTTP_PRESENTATION_CONFIG_SCHEMA = z.object({
|
|
3
|
+
scope: z.prefault(z.enum(["trigger", "automation", "project"]), "trigger"),
|
|
4
|
+
});
|
|
5
|
+
export const httpRequestTriggerDefinition = {
|
|
6
|
+
getPrimary: ({ appOrigin, automationId, config, hookSlot, projectId, scopePath, }) => ({
|
|
7
|
+
copyable: true,
|
|
8
|
+
value: getHttpTriggerEndpoint({
|
|
9
|
+
appOrigin,
|
|
10
|
+
automationId,
|
|
11
|
+
hookSlot,
|
|
12
|
+
projectId,
|
|
13
|
+
scope: HTTP_PRESENTATION_CONFIG_SCHEMA.parse(config).scope,
|
|
14
|
+
scopePath,
|
|
15
|
+
}),
|
|
16
|
+
}),
|
|
17
|
+
icon: "webhook",
|
|
18
|
+
name: "HTTP request",
|
|
19
|
+
type: "http.request",
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Returns the public URL for one deployed HTTP trigger.
|
|
23
|
+
*
|
|
24
|
+
* @param options - Public origin and trigger identity.
|
|
25
|
+
*/
|
|
26
|
+
export function getHttpTriggerEndpoint(options) {
|
|
27
|
+
return new URL(`/x/${getHttpTriggerEndpointKey(options)}/`, options.appOrigin).toString();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Returns the durable endpoint identity for one configured HTTP scope.
|
|
31
|
+
*
|
|
32
|
+
* @param options - Trigger and owning resource identity.
|
|
33
|
+
*/
|
|
34
|
+
export function getHttpTriggerEndpointKey(options) {
|
|
35
|
+
if (options.scope === "project")
|
|
36
|
+
return options.projectId;
|
|
37
|
+
if (options.scope === "automation")
|
|
38
|
+
return options.automationId;
|
|
39
|
+
return `${options.automationId}:${[
|
|
40
|
+
...(options.scopePath ?? []),
|
|
41
|
+
options.hookSlot,
|
|
42
|
+
].join(".")}`;
|
|
43
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const automationInvokedTriggerDefinition: {
|
|
2
|
+
readonly getDetails: ({ config }: import("..").TriggerPresentationContext) => {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}[];
|
|
6
|
+
readonly icon: "automation";
|
|
7
|
+
readonly name: "Invocation";
|
|
8
|
+
readonly type: "automation.invoked";
|
|
9
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
|
+
const INVOCATION_PRESENTATION_CONFIG_SCHEMA = z.object({
|
|
3
|
+
entrypoint: z.string(),
|
|
4
|
+
});
|
|
5
|
+
export const automationInvokedTriggerDefinition = {
|
|
6
|
+
getDetails: ({ config }) => [
|
|
7
|
+
{
|
|
8
|
+
label: "Entrypoint",
|
|
9
|
+
value: INVOCATION_PRESENTATION_CONFIG_SCHEMA.parse(config).entrypoint,
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
icon: "automation",
|
|
13
|
+
name: "Invocation",
|
|
14
|
+
type: "automation.invoked",
|
|
15
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { HttpTriggerScope } from "./core-http.js";
|
|
2
|
+
export declare const PLATFORM_EMAIL_DOMAIN = "automations.automate.ax";
|
|
3
|
+
export declare const mailhookEmailReceivedTriggerDefinition: {
|
|
4
|
+
readonly getPrimary: ({ automationId, config, hookSlot, projectId, scopePath }: import("..").TriggerPresentationContext) => {
|
|
5
|
+
copyable: true;
|
|
6
|
+
value: string;
|
|
7
|
+
};
|
|
8
|
+
readonly icon: "webhook";
|
|
9
|
+
readonly name: "Mailhook";
|
|
10
|
+
readonly type: "mailhook.email.received";
|
|
11
|
+
};
|
|
12
|
+
export type MailhookScope = HttpTriggerScope;
|
|
13
|
+
export interface MailhookAddressOptions {
|
|
14
|
+
automationId: string;
|
|
15
|
+
hookSlot: number;
|
|
16
|
+
plusPath?: string;
|
|
17
|
+
projectId: string;
|
|
18
|
+
scope: MailhookScope;
|
|
19
|
+
scopePath?: readonly number[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Returns the unique inbound address for one deployed mailhook.
|
|
23
|
+
*
|
|
24
|
+
* Add `+suffix` before the `@` to carry a routing value into the event.
|
|
25
|
+
*
|
|
26
|
+
* @param options - Mailhook identity and sharing scope.
|
|
27
|
+
* @throws When the generated local part exceeds the email size limit.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getMailhookAddress(options: MailhookAddressOptions): string;
|
|
30
|
+
/**
|
|
31
|
+
* Returns the local-part router key for one configured mailhook scope.
|
|
32
|
+
*
|
|
33
|
+
* @param options - Mailhook identity and sharing scope.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getMailhookAddressKey(options: MailhookAddressOptions): string;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
|
+
const MAX_EMAIL_LOCAL_PART_BYTES = 64;
|
|
3
|
+
const EMAIL_SCHEMA = z.email();
|
|
4
|
+
const MAILHOOK_PRESENTATION_CONFIG_SCHEMA = z.object({
|
|
5
|
+
scope: z.prefault(z.enum(["trigger", "automation", "project"]), "trigger"),
|
|
6
|
+
});
|
|
7
|
+
export const PLATFORM_EMAIL_DOMAIN = "automations.automate.ax";
|
|
8
|
+
export const mailhookEmailReceivedTriggerDefinition = {
|
|
9
|
+
getPrimary: ({ automationId, config, hookSlot, projectId, scopePath }) => ({
|
|
10
|
+
copyable: true,
|
|
11
|
+
value: getMailhookAddress({
|
|
12
|
+
automationId,
|
|
13
|
+
hookSlot,
|
|
14
|
+
projectId,
|
|
15
|
+
scope: MAILHOOK_PRESENTATION_CONFIG_SCHEMA.parse(config).scope,
|
|
16
|
+
scopePath,
|
|
17
|
+
}),
|
|
18
|
+
}),
|
|
19
|
+
icon: "webhook",
|
|
20
|
+
name: "Mailhook",
|
|
21
|
+
type: "mailhook.email.received",
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Returns the unique inbound address for one deployed mailhook.
|
|
25
|
+
*
|
|
26
|
+
* Add `+suffix` before the `@` to carry a routing value into the event.
|
|
27
|
+
*
|
|
28
|
+
* @param options - Mailhook identity and sharing scope.
|
|
29
|
+
* @throws When the generated local part exceeds the email size limit.
|
|
30
|
+
*/
|
|
31
|
+
export function getMailhookAddress(options) {
|
|
32
|
+
const localPart = `${getMailhookAddressKey(options)}${options.plusPath ? `+${options.plusPath}` : ""}`;
|
|
33
|
+
if (new TextEncoder().encode(localPart).length > MAX_EMAIL_LOCAL_PART_BYTES) {
|
|
34
|
+
throw new RangeError("Mailhook address local part exceeds 64 bytes.");
|
|
35
|
+
}
|
|
36
|
+
return EMAIL_SCHEMA.parse(`${localPart}@${PLATFORM_EMAIL_DOMAIN}`);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Returns the local-part router key for one configured mailhook scope.
|
|
40
|
+
*
|
|
41
|
+
* @param options - Mailhook identity and sharing scope.
|
|
42
|
+
*/
|
|
43
|
+
export function getMailhookAddressKey(options) {
|
|
44
|
+
if (options.scope === "project")
|
|
45
|
+
return `p${typeIdSuffix(options.projectId)}`;
|
|
46
|
+
if (options.scope === "automation") {
|
|
47
|
+
return `a${typeIdSuffix(options.automationId)}`;
|
|
48
|
+
}
|
|
49
|
+
return `a${typeIdSuffix(options.automationId)}.${[
|
|
50
|
+
...(options.scopePath ?? []),
|
|
51
|
+
options.hookSlot,
|
|
52
|
+
]
|
|
53
|
+
.map((segment) => segment.toString(36))
|
|
54
|
+
.join(".")}`;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Removes the redundant TypeID prefix from an address router.
|
|
58
|
+
*
|
|
59
|
+
* @param id - Project or automation TypeID.
|
|
60
|
+
*/
|
|
61
|
+
function typeIdSuffix(id) {
|
|
62
|
+
return id.includes("_") ? id.slice(id.indexOf("_") + 1) : id;
|
|
63
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const cronTickTriggerDefinition: {
|
|
2
|
+
readonly getDetails: ({ config }: import("..").TriggerPresentationContext) => {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}[];
|
|
6
|
+
readonly icon: "schedule";
|
|
7
|
+
readonly name: "Cron schedule";
|
|
8
|
+
readonly type: "cron.tick";
|
|
9
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
|
+
const CRON_PRESENTATION_CONFIG_SCHEMA = z.object({
|
|
3
|
+
schedule: z.string(),
|
|
4
|
+
timeZone: z.prefault(z.string(), "UTC"),
|
|
5
|
+
});
|
|
6
|
+
export const cronTickTriggerDefinition = {
|
|
7
|
+
getDetails: ({ config }) => {
|
|
8
|
+
const parsedConfig = CRON_PRESENTATION_CONFIG_SCHEMA.parse(config);
|
|
9
|
+
return [
|
|
10
|
+
{ label: "Schedule", value: parsedConfig.schedule },
|
|
11
|
+
{ label: "Time zone", value: parsedConfig.timeZone },
|
|
12
|
+
];
|
|
13
|
+
},
|
|
14
|
+
icon: "schedule",
|
|
15
|
+
name: "Cron schedule",
|
|
16
|
+
type: "cron.tick",
|
|
17
|
+
};
|
package/dist/triggers/core.d.ts
CHANGED
|
@@ -1,268 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
minLength: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
8
|
-
placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
9
|
-
required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
10
|
-
type: z.ZodMiniEnum<{
|
|
11
|
-
email: "email";
|
|
12
|
-
text: "text";
|
|
13
|
-
url: "url";
|
|
14
|
-
phone: "phone";
|
|
15
|
-
textarea: "textarea";
|
|
16
|
-
}>;
|
|
17
|
-
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
18
|
-
label: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
19
|
-
name: z.ZodMiniString<string>;
|
|
20
|
-
}, z.core.$strip>, z.ZodMiniObject<{
|
|
21
|
-
defaultValue: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
22
|
-
max: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
23
|
-
min: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
24
|
-
placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
25
|
-
required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
26
|
-
step: z.ZodMiniPrefault<z.ZodMiniNumber<number>>;
|
|
27
|
-
type: z.ZodMiniLiteral<"number">;
|
|
28
|
-
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
29
|
-
label: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
30
|
-
name: z.ZodMiniString<string>;
|
|
31
|
-
}, z.core.$strip>, z.ZodMiniObject<{
|
|
32
|
-
defaultValue: z.ZodMiniOptional<z.iso.ZodMiniISODate>;
|
|
33
|
-
max: z.ZodMiniOptional<z.iso.ZodMiniISODate>;
|
|
34
|
-
min: z.ZodMiniOptional<z.iso.ZodMiniISODate>;
|
|
35
|
-
required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
36
|
-
step: z.ZodMiniPrefault<z.ZodMiniNumberFormat>;
|
|
37
|
-
type: z.ZodMiniLiteral<"date">;
|
|
38
|
-
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
39
|
-
label: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
40
|
-
name: z.ZodMiniString<string>;
|
|
41
|
-
}, z.core.$strip>, z.ZodMiniObject<{
|
|
42
|
-
defaultValue: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
43
|
-
max: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
44
|
-
min: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
45
|
-
required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
46
|
-
step: z.ZodMiniPrefault<z.ZodMiniNumber<number>>;
|
|
47
|
-
type: z.ZodMiniLiteral<"datetime">;
|
|
48
|
-
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
49
|
-
label: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
50
|
-
name: z.ZodMiniString<string>;
|
|
51
|
-
}, z.core.$strip>, z.ZodMiniObject<{
|
|
52
|
-
type: z.ZodMiniLiteral<"select">;
|
|
53
|
-
defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
54
|
-
options: z.ZodMiniArray<z.ZodMiniObject<{
|
|
55
|
-
label: z.ZodMiniString<string>;
|
|
56
|
-
value: z.ZodMiniString<string>;
|
|
57
|
-
}, z.core.$strip>>;
|
|
58
|
-
placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
59
|
-
required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
60
|
-
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
61
|
-
label: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
62
|
-
name: z.ZodMiniString<string>;
|
|
63
|
-
}, z.core.$strip>, z.ZodMiniObject<{
|
|
64
|
-
type: z.ZodMiniLiteral<"radio">;
|
|
65
|
-
defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
66
|
-
options: z.ZodMiniArray<z.ZodMiniObject<{
|
|
67
|
-
label: z.ZodMiniString<string>;
|
|
68
|
-
value: z.ZodMiniString<string>;
|
|
69
|
-
}, z.core.$strip>>;
|
|
70
|
-
placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
71
|
-
required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
72
|
-
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
73
|
-
label: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
74
|
-
name: z.ZodMiniString<string>;
|
|
75
|
-
}, z.core.$strip>, z.ZodMiniObject<{
|
|
76
|
-
defaultValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
77
|
-
options: z.ZodMiniArray<z.ZodMiniObject<{
|
|
78
|
-
label: z.ZodMiniString<string>;
|
|
79
|
-
value: z.ZodMiniString<string>;
|
|
80
|
-
}, z.core.$strip>>;
|
|
81
|
-
placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
82
|
-
required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
83
|
-
type: z.ZodMiniLiteral<"multi-select">;
|
|
84
|
-
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
85
|
-
label: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
86
|
-
name: z.ZodMiniString<string>;
|
|
87
|
-
}, z.core.$strip>, z.ZodMiniObject<{
|
|
88
|
-
defaultValue: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
89
|
-
required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
90
|
-
type: z.ZodMiniLiteral<"checkbox">;
|
|
91
|
-
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
92
|
-
label: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
93
|
-
name: z.ZodMiniString<string>;
|
|
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
|
-
}>>>>;
|
|
263
|
-
submitLabel: z.ZodMiniPrefault<z.ZodMiniString<string>>;
|
|
264
|
-
title: z.ZodMiniString<string>;
|
|
265
|
-
}, z.core.$strip>;
|
|
1
|
+
export { DASHBOARD_RUN_CONFIG_SCHEMA, dashboardRunTriggerDefinition, getDashboardRunEndpoint, getDashboardRunEndpointKey, type DashboardRunConfig, type DashboardRunEndpointOptions, type DashboardRunField, } from "./core-dashboard.js";
|
|
2
|
+
export { getHttpTriggerEndpoint, getHttpTriggerEndpointKey, httpRequestTriggerDefinition, type HttpTriggerEndpointOptions, type HttpTriggerScope, } from "./core-http.js";
|
|
3
|
+
export { automationInvokedTriggerDefinition } from "./core-invocation.js";
|
|
4
|
+
export { getMailhookAddress, getMailhookAddressKey, mailhookEmailReceivedTriggerDefinition, PLATFORM_EMAIL_DOMAIN, type MailhookAddressOptions, type MailhookScope, } from "./core-mailhook.js";
|
|
5
|
+
export { cronTickTriggerDefinition } from "./core-schedule.js";
|
|
6
|
+
export { sentenceCase } from "./name.js";
|
|
266
7
|
export declare const coreTriggerDefinitions: {
|
|
267
8
|
readonly automationInvoked: {
|
|
268
9
|
readonly getDetails: ({ config }: import("..").TriggerPresentationContext) => {
|
|
@@ -282,6 +23,15 @@ export declare const coreTriggerDefinitions: {
|
|
|
282
23
|
readonly name: "Cron schedule";
|
|
283
24
|
readonly type: "cron.tick";
|
|
284
25
|
};
|
|
26
|
+
readonly dashboardRun: {
|
|
27
|
+
readonly getDetails: ({ config }: import("..").TriggerPresentationContext) => {
|
|
28
|
+
label: string;
|
|
29
|
+
value: string;
|
|
30
|
+
}[];
|
|
31
|
+
readonly icon: "automation";
|
|
32
|
+
readonly name: "Dashboard run";
|
|
33
|
+
readonly type: "dashboard.run";
|
|
34
|
+
};
|
|
285
35
|
readonly httpRequest: {
|
|
286
36
|
readonly getPrimary: ({ appOrigin, automationId, config, hookSlot, projectId, scopePath, }: import("..").TriggerPresentationContext) => {
|
|
287
37
|
copyable: true;
|
|
@@ -300,165 +50,4 @@ export declare const coreTriggerDefinitions: {
|
|
|
300
50
|
readonly name: "Mailhook";
|
|
301
51
|
readonly type: "mailhook.email.received";
|
|
302
52
|
};
|
|
303
|
-
readonly dashboardRun: {
|
|
304
|
-
readonly getDetails: ({ config }: import("..").TriggerPresentationContext) => {
|
|
305
|
-
label: string;
|
|
306
|
-
value: string;
|
|
307
|
-
}[];
|
|
308
|
-
readonly icon: "automation";
|
|
309
|
-
readonly name: "Dashboard run";
|
|
310
|
-
readonly type: "dashboard.run";
|
|
311
|
-
};
|
|
312
53
|
};
|
|
313
|
-
interface DashboardRunFieldBase {
|
|
314
|
-
/** Supporting text shown below the field. */
|
|
315
|
-
description?: string;
|
|
316
|
-
/** Visible field label. Inferred from `name` when omitted. */
|
|
317
|
-
label?: string;
|
|
318
|
-
/** Property name used in submitted trigger data. */
|
|
319
|
-
name: string;
|
|
320
|
-
/** Whether the form must contain a value. Defaults to true. */
|
|
321
|
-
required?: boolean;
|
|
322
|
-
}
|
|
323
|
-
export type DashboardRunField = (DashboardRunFieldBase & {
|
|
324
|
-
defaultValue?: string;
|
|
325
|
-
maxLength?: number;
|
|
326
|
-
minLength?: number;
|
|
327
|
-
placeholder?: string;
|
|
328
|
-
type: "email" | "phone" | "text" | "textarea" | "url";
|
|
329
|
-
}) | (DashboardRunFieldBase & {
|
|
330
|
-
defaultValue?: number;
|
|
331
|
-
max?: number;
|
|
332
|
-
min?: number;
|
|
333
|
-
placeholder?: string;
|
|
334
|
-
/** Increment used by the number input. Defaults to 1. */
|
|
335
|
-
step?: number;
|
|
336
|
-
type: "number";
|
|
337
|
-
}) | (DashboardRunFieldBase & {
|
|
338
|
-
/** Initial local date in `YYYY-MM-DD` format. */
|
|
339
|
-
defaultValue?: string;
|
|
340
|
-
max?: string;
|
|
341
|
-
min?: string;
|
|
342
|
-
/** Allowed increment in days. Defaults to 1. */
|
|
343
|
-
step?: number;
|
|
344
|
-
type: "date";
|
|
345
|
-
}) | (DashboardRunFieldBase & {
|
|
346
|
-
/** Initial local date and time in `YYYY-MM-DDTHH:mm` format. */
|
|
347
|
-
defaultValue?: string;
|
|
348
|
-
max?: string;
|
|
349
|
-
min?: string;
|
|
350
|
-
/** Allowed increment in seconds. Defaults to 60. */
|
|
351
|
-
step?: number;
|
|
352
|
-
type: "datetime";
|
|
353
|
-
}) | (DashboardRunFieldBase & {
|
|
354
|
-
defaultValue?: string;
|
|
355
|
-
options: readonly {
|
|
356
|
-
label: string;
|
|
357
|
-
value: string;
|
|
358
|
-
}[];
|
|
359
|
-
placeholder?: string;
|
|
360
|
-
type: "select";
|
|
361
|
-
}) | (DashboardRunFieldBase & {
|
|
362
|
-
defaultValue?: string;
|
|
363
|
-
options: readonly {
|
|
364
|
-
label: string;
|
|
365
|
-
value: string;
|
|
366
|
-
}[];
|
|
367
|
-
type: "radio";
|
|
368
|
-
}) | (DashboardRunFieldBase & {
|
|
369
|
-
defaultValue?: readonly string[];
|
|
370
|
-
options: readonly {
|
|
371
|
-
label: string;
|
|
372
|
-
value: string;
|
|
373
|
-
}[];
|
|
374
|
-
placeholder?: string;
|
|
375
|
-
type: "multi-select";
|
|
376
|
-
}) | (DashboardRunFieldBase & {
|
|
377
|
-
/** Initial checked state. Defaults to false. */
|
|
378
|
-
defaultValue?: boolean;
|
|
379
|
-
/** Whether the checkbox must be checked. Defaults to false. */
|
|
380
|
-
required?: boolean;
|
|
381
|
-
type: "checkbox";
|
|
382
|
-
});
|
|
383
|
-
export interface DashboardRunConfig<TFields extends readonly DashboardRunField[] = readonly DashboardRunField[]> {
|
|
384
|
-
/** Supporting text shown below the form title. */
|
|
385
|
-
description?: string;
|
|
386
|
-
/** Ordered fields. Omit to run immediately. */
|
|
387
|
-
fields?: TFields;
|
|
388
|
-
/** Submit button text. Defaults to "Run". */
|
|
389
|
-
submitLabel?: string;
|
|
390
|
-
/** Form heading. */
|
|
391
|
-
title: string;
|
|
392
|
-
}
|
|
393
|
-
export interface DashboardRunEndpointOptions {
|
|
394
|
-
appOrigin: string;
|
|
395
|
-
automationId: string;
|
|
396
|
-
hookSlot: number;
|
|
397
|
-
scopePath?: readonly number[];
|
|
398
|
-
}
|
|
399
|
-
export type HttpTriggerScope = "trigger" | "automation" | "project";
|
|
400
|
-
export type MailhookScope = HttpTriggerScope;
|
|
401
|
-
export declare const PLATFORM_EMAIL_DOMAIN = "automations.automate.ax";
|
|
402
|
-
export interface HttpTriggerEndpointOptions {
|
|
403
|
-
appOrigin: string;
|
|
404
|
-
automationId: string;
|
|
405
|
-
hookSlot: number;
|
|
406
|
-
projectId: string;
|
|
407
|
-
scope: HttpTriggerScope;
|
|
408
|
-
scopePath?: readonly number[];
|
|
409
|
-
}
|
|
410
|
-
export interface MailhookAddressOptions {
|
|
411
|
-
automationId: string;
|
|
412
|
-
hookSlot: number;
|
|
413
|
-
plusPath?: string;
|
|
414
|
-
projectId: string;
|
|
415
|
-
scope: MailhookScope;
|
|
416
|
-
scopePath?: readonly number[];
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
* Returns the public URL for one deployed HTTP trigger.
|
|
420
|
-
*
|
|
421
|
-
* @param options - Public origin and trigger identity.
|
|
422
|
-
*/
|
|
423
|
-
export declare function getHttpTriggerEndpoint(options: HttpTriggerEndpointOptions): string;
|
|
424
|
-
/**
|
|
425
|
-
* Returns the durable endpoint identity for one configured HTTP scope.
|
|
426
|
-
*
|
|
427
|
-
* @param options - Trigger and owning resource identity.
|
|
428
|
-
*/
|
|
429
|
-
export declare function getHttpTriggerEndpointKey(options: Omit<HttpTriggerEndpointOptions, "appOrigin">): string;
|
|
430
|
-
/**
|
|
431
|
-
* Returns the unique inbound address for one deployed mailhook.
|
|
432
|
-
*
|
|
433
|
-
* Add `+suffix` before the `@` to carry a routing value into the event.
|
|
434
|
-
*
|
|
435
|
-
* @param options - Mailhook identity and sharing scope.
|
|
436
|
-
* @throws When the generated local part exceeds the email size limit.
|
|
437
|
-
*/
|
|
438
|
-
export declare function getMailhookAddress(options: MailhookAddressOptions): string;
|
|
439
|
-
/**
|
|
440
|
-
* Returns the local-part router key for one configured mailhook scope.
|
|
441
|
-
*
|
|
442
|
-
* @param options - Mailhook identity and sharing scope.
|
|
443
|
-
*/
|
|
444
|
-
export declare function getMailhookAddressKey(options: MailhookAddressOptions): string;
|
|
445
|
-
/**
|
|
446
|
-
* Returns the organization-authenticated submission endpoint for one dashboard
|
|
447
|
-
* run.
|
|
448
|
-
*
|
|
449
|
-
* @param options - Public origin and trigger identity.
|
|
450
|
-
*/
|
|
451
|
-
export declare function getDashboardRunEndpoint(options: DashboardRunEndpointOptions): string;
|
|
452
|
-
/**
|
|
453
|
-
* Returns the durable endpoint identity for one dashboard run trigger.
|
|
454
|
-
*
|
|
455
|
-
* @param options - Trigger and owning automation identity.
|
|
456
|
-
*/
|
|
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;
|
|
464
|
-
export {};
|