@automate.ax/api-contract 0.6.0 → 0.7.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/deployment.d.ts +15 -6
- package/dist/deployment.js +39 -7
- package/dist/events/google-calendar.d.ts +4 -0
- package/dist/events/google-calendar.js +16 -0
- package/dist/events/google-forms.d.ts +18 -0
- package/dist/events/google-forms.js +32 -0
- package/dist/events/index.d.ts +16 -0
- package/dist/events/index.js +4 -0
- package/dist/index.d.ts +36 -6
- package/dist/runtime.d.ts +5 -0
- package/dist/runtime.js +5 -0
- package/package.json +2 -2
package/dist/deployment.d.ts
CHANGED
|
@@ -11,12 +11,21 @@ export declare const deploymentTriggerInfoSchema: z.ZodObject<{
|
|
|
11
11
|
}, z.core.$strip>;
|
|
12
12
|
export type DeploymentTriggerInfo = z.infer<typeof deploymentTriggerInfoSchema>;
|
|
13
13
|
export declare const deploymentContract: {
|
|
14
|
-
|
|
14
|
+
cancel: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
15
|
+
deploymentId: z.ZodString;
|
|
15
16
|
projectId: z.ZodString;
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
}, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
|
|
18
|
+
create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
19
|
+
artifact: z.ZodCustom<Blob, Blob>;
|
|
20
|
+
manifest: z.ZodArray<z.ZodObject<{
|
|
21
|
+
entrypoint: z.ZodString;
|
|
18
22
|
identityKey: z.ZodString;
|
|
19
23
|
}, z.core.$strip>>;
|
|
24
|
+
mode: z.ZodEnum<{
|
|
25
|
+
reconcile: "reconcile";
|
|
26
|
+
upsert: "upsert";
|
|
27
|
+
}>;
|
|
28
|
+
projectId: z.ZodString;
|
|
20
29
|
}, z.core.$strip>, z.ZodObject<{
|
|
21
30
|
id: z.ZodString;
|
|
22
31
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
@@ -51,10 +60,10 @@ export declare const deploymentContract: {
|
|
|
51
60
|
planning: "planning";
|
|
52
61
|
awaiting_authorization: "awaiting_authorization";
|
|
53
62
|
configuring: "configuring";
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
superseded: "superseded";
|
|
63
|
+
publishing: "publishing";
|
|
64
|
+
succeeded: "succeeded";
|
|
57
65
|
failed: "failed";
|
|
66
|
+
cancelled: "cancelled";
|
|
58
67
|
}>;
|
|
59
68
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
60
69
|
};
|
package/dist/deployment.js
CHANGED
|
@@ -13,16 +13,48 @@ export const deploymentTriggerInfoSchema = z.object({
|
|
|
13
13
|
type: z.string(),
|
|
14
14
|
});
|
|
15
15
|
export const deploymentContract = {
|
|
16
|
-
|
|
16
|
+
cancel: oc
|
|
17
17
|
.input(z.object({
|
|
18
|
+
deploymentId: z.string(),
|
|
18
19
|
projectId: z.string(),
|
|
19
|
-
|
|
20
|
+
}))
|
|
21
|
+
.output(z.void()),
|
|
22
|
+
create: oc
|
|
23
|
+
.input(z.object({
|
|
24
|
+
artifact: z.instanceof(Blob),
|
|
25
|
+
manifest: z
|
|
20
26
|
.object({
|
|
21
|
-
|
|
27
|
+
entrypoint: z.string().min(1),
|
|
22
28
|
identityKey: z.string().min(1),
|
|
23
29
|
})
|
|
24
30
|
.array()
|
|
25
|
-
.min(1, "Deployment must include at least one automation.")
|
|
31
|
+
.min(1, "Deployment must include at least one automation.")
|
|
32
|
+
.superRefine((manifest, context) => {
|
|
33
|
+
const identityKeys = new Set();
|
|
34
|
+
for (const [index, entry] of manifest.entries()) {
|
|
35
|
+
if (identityKeys.has(entry.identityKey)) {
|
|
36
|
+
context.addIssue({
|
|
37
|
+
code: "custom",
|
|
38
|
+
message: "Automation identity keys must be unique.",
|
|
39
|
+
path: [index, "identityKey"],
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
identityKeys.add(entry.identityKey);
|
|
43
|
+
if (entry.entrypoint.includes("\\") ||
|
|
44
|
+
entry.entrypoint.startsWith("/") ||
|
|
45
|
+
entry.entrypoint
|
|
46
|
+
.split("/")
|
|
47
|
+
.some((segment) => segment === "" || segment === "." || segment === "..")) {
|
|
48
|
+
context.addIssue({
|
|
49
|
+
code: "custom",
|
|
50
|
+
message: "Entrypoint must be a safe relative POSIX path.",
|
|
51
|
+
path: [index, "entrypoint"],
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}),
|
|
56
|
+
mode: z.enum(["reconcile", "upsert"]),
|
|
57
|
+
projectId: z.string(),
|
|
26
58
|
}))
|
|
27
59
|
.output(z.object({ id: z.string() })),
|
|
28
60
|
get: oc
|
|
@@ -55,10 +87,10 @@ export const deploymentContract = {
|
|
|
55
87
|
"planning",
|
|
56
88
|
"awaiting_authorization",
|
|
57
89
|
"configuring",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"superseded",
|
|
90
|
+
"publishing",
|
|
91
|
+
"succeeded",
|
|
61
92
|
"failed",
|
|
93
|
+
"cancelled",
|
|
62
94
|
]),
|
|
63
95
|
})),
|
|
64
96
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export const googleCalendarEventsContract = {
|
|
4
|
+
googleCalendarPush: oc
|
|
5
|
+
.route({
|
|
6
|
+
method: "POST",
|
|
7
|
+
path: "/events/google-calendar",
|
|
8
|
+
operationId: "receiveGoogleCalendarPush",
|
|
9
|
+
summary: "Receive a Google Calendar push notification",
|
|
10
|
+
description: "Receives header-only Google Calendar resource-change notifications.",
|
|
11
|
+
tags: ["Events"],
|
|
12
|
+
successStatus: 204,
|
|
13
|
+
})
|
|
14
|
+
.input(z.void())
|
|
15
|
+
.output(z.void()),
|
|
16
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const googleFormsEventsContract: {
|
|
3
|
+
googleFormsPush: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
4
|
+
message: z.ZodObject<{
|
|
5
|
+
attributes: z.ZodObject<{
|
|
6
|
+
eventType: z.ZodEnum<{
|
|
7
|
+
SCHEMA: "SCHEMA";
|
|
8
|
+
RESPONSES: "RESPONSES";
|
|
9
|
+
}>;
|
|
10
|
+
formId: z.ZodString;
|
|
11
|
+
watchId: z.ZodString;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
messageId: z.ZodString;
|
|
14
|
+
publishTime: z.ZodISODateTime;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
subscription: z.ZodLiteral<"projects/opkitty/subscriptions/automate-ax-google-forms-push">;
|
|
17
|
+
}, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export const googleFormsEventsContract = {
|
|
4
|
+
googleFormsPush: oc
|
|
5
|
+
.route({
|
|
6
|
+
method: "POST",
|
|
7
|
+
path: "/events/google-forms",
|
|
8
|
+
operationId: "receiveGoogleFormsPush",
|
|
9
|
+
summary: "Receive a Google Forms push notification",
|
|
10
|
+
description: "Receives and authenticates Google Forms notifications delivered by Google Cloud Pub/Sub.",
|
|
11
|
+
tags: ["Events"],
|
|
12
|
+
successStatus: 204,
|
|
13
|
+
})
|
|
14
|
+
.input(z.object({
|
|
15
|
+
/** Pub/Sub message containing Google Forms notification attributes. */
|
|
16
|
+
message: z.object({
|
|
17
|
+
/** Provider routing fields for the watched form. */
|
|
18
|
+
attributes: z.object({
|
|
19
|
+
eventType: z.enum(["SCHEMA", "RESPONSES"]),
|
|
20
|
+
formId: z.string().min(1),
|
|
21
|
+
watchId: z.string().min(1),
|
|
22
|
+
}),
|
|
23
|
+
/** Provider-assigned identifier used to deduplicate delivery. */
|
|
24
|
+
messageId: z.string().min(1),
|
|
25
|
+
/** RFC 3339 time at which Pub/Sub published the notification. */
|
|
26
|
+
publishTime: z.iso.datetime({ offset: true }),
|
|
27
|
+
}),
|
|
28
|
+
/** Pub/Sub subscription that delivered the message. */
|
|
29
|
+
subscription: z.literal("projects/opkitty/subscriptions/automate-ax-google-forms-push"),
|
|
30
|
+
}))
|
|
31
|
+
.output(z.void()),
|
|
32
|
+
};
|
package/dist/events/index.d.ts
CHANGED
|
@@ -6,4 +6,20 @@ export declare const eventsContract: {
|
|
|
6
6
|
}, import("zod/v4/core").$strip>;
|
|
7
7
|
subscription: import("zod").ZodLiteral<"projects/opkitty/subscriptions/automate-ax-gmail-push">;
|
|
8
8
|
}, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
9
|
+
googleFormsPush: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
10
|
+
message: import("zod").ZodObject<{
|
|
11
|
+
attributes: import("zod").ZodObject<{
|
|
12
|
+
eventType: import("zod").ZodEnum<{
|
|
13
|
+
SCHEMA: "SCHEMA";
|
|
14
|
+
RESPONSES: "RESPONSES";
|
|
15
|
+
}>;
|
|
16
|
+
formId: import("zod").ZodString;
|
|
17
|
+
watchId: import("zod").ZodString;
|
|
18
|
+
}, import("zod/v4/core").$strip>;
|
|
19
|
+
messageId: import("zod").ZodString;
|
|
20
|
+
publishTime: import("zod").ZodISODateTime;
|
|
21
|
+
}, import("zod/v4/core").$strip>;
|
|
22
|
+
subscription: import("zod").ZodLiteral<"projects/opkitty/subscriptions/automate-ax-google-forms-push">;
|
|
23
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
24
|
+
googleCalendarPush: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodVoid, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
9
25
|
};
|
package/dist/events/index.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { googleCalendarEventsContract } from "./google-calendar.js";
|
|
2
|
+
import { googleFormsEventsContract } from "./google-forms.js";
|
|
1
3
|
import { gmailEventsContract } from "./gmail.js";
|
|
2
4
|
export const eventsContract = {
|
|
5
|
+
...googleCalendarEventsContract,
|
|
6
|
+
...googleFormsEventsContract,
|
|
3
7
|
...gmailEventsContract,
|
|
4
8
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -146,12 +146,21 @@ export declare const contract: {
|
|
|
146
146
|
}, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
147
147
|
};
|
|
148
148
|
deployment: {
|
|
149
|
-
|
|
149
|
+
cancel: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
150
|
+
deploymentId: import("zod").ZodString;
|
|
150
151
|
projectId: import("zod").ZodString;
|
|
151
|
-
|
|
152
|
-
|
|
152
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
153
|
+
create: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
154
|
+
artifact: import("zod").ZodCustom<Blob, Blob>;
|
|
155
|
+
manifest: import("zod").ZodArray<import("zod").ZodObject<{
|
|
156
|
+
entrypoint: import("zod").ZodString;
|
|
153
157
|
identityKey: import("zod").ZodString;
|
|
154
158
|
}, import("zod/v4/core").$strip>>;
|
|
159
|
+
mode: import("zod").ZodEnum<{
|
|
160
|
+
reconcile: "reconcile";
|
|
161
|
+
upsert: "upsert";
|
|
162
|
+
}>;
|
|
163
|
+
projectId: import("zod").ZodString;
|
|
155
164
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
156
165
|
id: import("zod").ZodString;
|
|
157
166
|
}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
@@ -186,10 +195,10 @@ export declare const contract: {
|
|
|
186
195
|
planning: "planning";
|
|
187
196
|
awaiting_authorization: "awaiting_authorization";
|
|
188
197
|
configuring: "configuring";
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
superseded: "superseded";
|
|
198
|
+
publishing: "publishing";
|
|
199
|
+
succeeded: "succeeded";
|
|
192
200
|
failed: "failed";
|
|
201
|
+
cancelled: "cancelled";
|
|
193
202
|
}>;
|
|
194
203
|
}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
195
204
|
};
|
|
@@ -201,6 +210,22 @@ export declare const contract: {
|
|
|
201
210
|
}, import("zod/v4/core").$strip>;
|
|
202
211
|
subscription: import("zod").ZodLiteral<"projects/opkitty/subscriptions/automate-ax-gmail-push">;
|
|
203
212
|
}, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
213
|
+
googleFormsPush: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
214
|
+
message: import("zod").ZodObject<{
|
|
215
|
+
attributes: import("zod").ZodObject<{
|
|
216
|
+
eventType: import("zod").ZodEnum<{
|
|
217
|
+
SCHEMA: "SCHEMA";
|
|
218
|
+
RESPONSES: "RESPONSES";
|
|
219
|
+
}>;
|
|
220
|
+
formId: import("zod").ZodString;
|
|
221
|
+
watchId: import("zod").ZodString;
|
|
222
|
+
}, import("zod/v4/core").$strip>;
|
|
223
|
+
messageId: import("zod").ZodString;
|
|
224
|
+
publishTime: import("zod").ZodISODateTime;
|
|
225
|
+
}, import("zod/v4/core").$strip>;
|
|
226
|
+
subscription: import("zod").ZodLiteral<"projects/opkitty/subscriptions/automate-ax-google-forms-push">;
|
|
227
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
228
|
+
googleCalendarPush: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodVoid, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
204
229
|
};
|
|
205
230
|
org: {
|
|
206
231
|
canInvite: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
@@ -396,6 +421,7 @@ export declare const contract: {
|
|
|
396
421
|
actionDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
397
422
|
description: import("zod").ZodNullable<import("zod").ZodString>;
|
|
398
423
|
eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
424
|
+
inputHash: import("zod").ZodString;
|
|
399
425
|
name: import("zod").ZodString;
|
|
400
426
|
slot: import("zod").ZodNumber;
|
|
401
427
|
}, import("zod/v4/core").$strip>>>;
|
|
@@ -423,7 +449,11 @@ export declare const contract: {
|
|
|
423
449
|
nextBatch: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, import("zod").ZodObject<{
|
|
424
450
|
context: import("zod").ZodObject<{
|
|
425
451
|
actionOutputs: import("zod").ZodArray<import("zod").ZodObject<{
|
|
452
|
+
actionDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
426
453
|
actionInvocationId: import("zod").ZodString;
|
|
454
|
+
eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
455
|
+
inputHash: import("zod").ZodString;
|
|
456
|
+
name: import("zod").ZodString;
|
|
427
457
|
slot: import("zod").ZodNumber;
|
|
428
458
|
}, import("zod/v4/core").$strip>>;
|
|
429
459
|
contextId: import("zod").ZodString;
|
package/dist/runtime.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare const runtimeContract: {
|
|
|
5
5
|
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
6
6
|
description: z.ZodNullable<z.ZodString>;
|
|
7
7
|
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
8
|
+
inputHash: z.ZodString;
|
|
8
9
|
name: z.ZodString;
|
|
9
10
|
slot: z.ZodNumber;
|
|
10
11
|
}, z.core.$strip>>>;
|
|
@@ -32,7 +33,11 @@ export declare const runtimeContract: {
|
|
|
32
33
|
nextBatch: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
|
|
33
34
|
context: z.ZodObject<{
|
|
34
35
|
actionOutputs: z.ZodArray<z.ZodObject<{
|
|
36
|
+
actionDependencyIds: z.ZodArray<z.ZodString>;
|
|
35
37
|
actionInvocationId: z.ZodString;
|
|
38
|
+
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
39
|
+
inputHash: z.ZodString;
|
|
40
|
+
name: z.ZodString;
|
|
36
41
|
slot: z.ZodNumber;
|
|
37
42
|
}, z.core.$strip>>;
|
|
38
43
|
contextId: z.ZodString;
|
package/dist/runtime.js
CHANGED
|
@@ -9,6 +9,7 @@ export const runtimeContract = {
|
|
|
9
9
|
actionDependencyIds: z.string().array(),
|
|
10
10
|
description: z.string().nullable(),
|
|
11
11
|
eventDependencyIds: z.string().array(),
|
|
12
|
+
inputHash: z.string(),
|
|
12
13
|
name: z.string(),
|
|
13
14
|
slot: z.number().int().nonnegative(),
|
|
14
15
|
})
|
|
@@ -46,7 +47,11 @@ export const runtimeContract = {
|
|
|
46
47
|
context: z.object({
|
|
47
48
|
actionOutputs: z
|
|
48
49
|
.object({
|
|
50
|
+
actionDependencyIds: z.string().array(),
|
|
49
51
|
actionInvocationId: z.string(),
|
|
52
|
+
eventDependencyIds: z.string().array(),
|
|
53
|
+
inputHash: z.string(),
|
|
54
|
+
name: z.string(),
|
|
50
55
|
slot: z.number().int(),
|
|
51
56
|
})
|
|
52
57
|
.array(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automate.ax/api-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Public oRPC contract for the Automate.ax API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"cjs": false
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@automate.ax/codec": "0.
|
|
26
|
+
"@automate.ax/codec": "0.7.0",
|
|
27
27
|
"@orpc/contract": "1.13.14",
|
|
28
28
|
"zod": "^4.3.6"
|
|
29
29
|
},
|