@automate.ax/api-contract 0.81.0 → 0.83.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 +17 -0
- package/dist/deployment.js +18 -2
- package/dist/events/convex.d.ts +10 -0
- package/dist/events/convex.js +22 -0
- package/dist/events/index.d.ts +7 -0
- package/dist/events/index.js +2 -0
- package/dist/execution-data.d.ts +6 -3
- package/dist/execution-data.js +2 -1
- package/dist/index.d.ts +549 -6
- package/dist/index.js +1 -0
- package/dist/org.d.ts +10 -1
- package/dist/org.js +14 -3
- package/dist/runtime-protocol.d.ts +2 -0
- package/dist/runtime-protocol.js +2 -0
- package/dist/runtime.d.ts +631 -0
- package/dist/runtime.js +53 -2
- package/package.json +10 -3
- package/src/deployment.ts +19 -2
- package/src/events/convex.ts +26 -0
- package/src/events/index.ts +2 -0
- package/src/execution-data.ts +2 -1
- package/src/index.ts +1 -0
- package/src/org.ts +19 -4
- package/src/runtime-protocol.ts +2 -0
- package/src/runtime.ts +61 -2
package/dist/deployment.d.ts
CHANGED
|
@@ -84,6 +84,7 @@ export declare const deploymentContract: {
|
|
|
84
84
|
}>;
|
|
85
85
|
projectId: z.ZodString;
|
|
86
86
|
rebindAccounts: z.ZodDefault<z.ZodBoolean>;
|
|
87
|
+
runtimeProtocolVersion: z.ZodOptional<z.ZodNumber>;
|
|
87
88
|
git: z.ZodOptional<z.ZodObject<{
|
|
88
89
|
commitSha: z.ZodString;
|
|
89
90
|
dirty: z.ZodBoolean;
|
|
@@ -109,6 +110,14 @@ export declare const deploymentContract: {
|
|
|
109
110
|
readonly message: "A deployment is already in progress.";
|
|
110
111
|
readonly status: 409;
|
|
111
112
|
};
|
|
113
|
+
UNSUPPORTED_RUNTIME_PROTOCOL: {
|
|
114
|
+
readonly data: z.ZodObject<{
|
|
115
|
+
receivedVersion: z.ZodNullable<z.ZodNumber>;
|
|
116
|
+
supportedVersion: z.ZodLiteral<1>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
readonly message: "The automation bundle uses an unsupported runtime protocol.";
|
|
119
|
+
readonly status: 400;
|
|
120
|
+
};
|
|
112
121
|
}>, Record<never, never>>;
|
|
113
122
|
get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
114
123
|
deploymentId: z.ZodString;
|
|
@@ -277,5 +286,13 @@ export declare const deploymentContract: {
|
|
|
277
286
|
readonly message: "A deployment is already in progress.";
|
|
278
287
|
readonly status: 409;
|
|
279
288
|
};
|
|
289
|
+
UNSUPPORTED_RUNTIME_PROTOCOL: {
|
|
290
|
+
readonly data: z.ZodObject<{
|
|
291
|
+
receivedVersion: z.ZodNullable<z.ZodNumber>;
|
|
292
|
+
supportedVersion: z.ZodLiteral<1>;
|
|
293
|
+
}, z.core.$strip>;
|
|
294
|
+
readonly message: "The automation bundle uses an unsupported runtime protocol.";
|
|
295
|
+
readonly status: 400;
|
|
296
|
+
};
|
|
280
297
|
}>, Record<never, never>>;
|
|
281
298
|
};
|
package/dist/deployment.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
2
|
import * as z from "zod";
|
|
3
|
+
import { AUTOMATION_RUNTIME_PROTOCOL_VERSION } from "./runtime-protocol.js";
|
|
3
4
|
import { cursorPageOutputSchema, cursorPaginationInputSchema } from "./schemas.js";
|
|
4
5
|
/** SDK compatibility version used to select the immutable runtime image. */
|
|
5
6
|
export const AUTOMATION_SDK_VERSION = "2";
|
|
@@ -20,6 +21,14 @@ const DEPLOYMENT_IN_PROGRESS_ERROR = {
|
|
|
20
21
|
message: "A deployment is already in progress.",
|
|
21
22
|
status: 409,
|
|
22
23
|
};
|
|
24
|
+
const UNSUPPORTED_RUNTIME_PROTOCOL_ERROR = {
|
|
25
|
+
data: z.object({
|
|
26
|
+
receivedVersion: z.number().int().positive().nullable(),
|
|
27
|
+
supportedVersion: z.literal(AUTOMATION_RUNTIME_PROTOCOL_VERSION),
|
|
28
|
+
}),
|
|
29
|
+
message: "The automation bundle uses an unsupported runtime protocol.",
|
|
30
|
+
status: 400,
|
|
31
|
+
};
|
|
23
32
|
const GIT_SOURCE_SCHEMA = z.object({
|
|
24
33
|
commitSha: z.string().regex(/^[0-9a-f]{40}(?:[0-9a-f]{24})?$/),
|
|
25
34
|
dirty: z.boolean(),
|
|
@@ -88,7 +97,10 @@ export const deploymentContract = {
|
|
|
88
97
|
.input(z.object({ deploymentId: z.string() }))
|
|
89
98
|
.output(z.void()),
|
|
90
99
|
create: oc
|
|
91
|
-
.errors({
|
|
100
|
+
.errors({
|
|
101
|
+
DEPLOYMENT_IN_PROGRESS: DEPLOYMENT_IN_PROGRESS_ERROR,
|
|
102
|
+
UNSUPPORTED_RUNTIME_PROTOCOL: UNSUPPORTED_RUNTIME_PROTOCOL_ERROR,
|
|
103
|
+
})
|
|
92
104
|
.input(z.object({
|
|
93
105
|
artifact: z.instanceof(Blob),
|
|
94
106
|
cancelExisting: z.boolean().default(false),
|
|
@@ -113,6 +125,7 @@ export const deploymentContract = {
|
|
|
113
125
|
mode: z.enum(["reconcile", "upsert"]),
|
|
114
126
|
projectId: z.string(),
|
|
115
127
|
rebindAccounts: z.boolean().default(false),
|
|
128
|
+
runtimeProtocolVersion: z.number().int().positive().optional(),
|
|
116
129
|
git: GIT_SOURCE_SCHEMA.optional(),
|
|
117
130
|
}))
|
|
118
131
|
.output(z.object({ id: z.string() })),
|
|
@@ -156,7 +169,10 @@ export const deploymentContract = {
|
|
|
156
169
|
.prefault({}))
|
|
157
170
|
.output(cursorPageOutputSchema(deploymentOutputSchema)),
|
|
158
171
|
redeploy: oc
|
|
159
|
-
.errors({
|
|
172
|
+
.errors({
|
|
173
|
+
DEPLOYMENT_IN_PROGRESS: DEPLOYMENT_IN_PROGRESS_ERROR,
|
|
174
|
+
UNSUPPORTED_RUNTIME_PROTOCOL: UNSUPPORTED_RUNTIME_PROTOCOL_ERROR,
|
|
175
|
+
})
|
|
160
176
|
.route({
|
|
161
177
|
method: "POST",
|
|
162
178
|
path: "/projects/{projectId}/deployments/redeploy",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const convexEventsContract: {
|
|
3
|
+
convexEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
4
|
+
emittedAt: z.ZodISODateTime;
|
|
5
|
+
endpointKey: z.ZodString;
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
payload: z.ZodJSONSchema;
|
|
9
|
+
}, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract";
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
export const convexEventsContract = {
|
|
4
|
+
convexEvent: oc
|
|
5
|
+
.route({
|
|
6
|
+
description: "Authenticates and ingests a semantic event emitted by a Convex action.",
|
|
7
|
+
method: "POST",
|
|
8
|
+
operationId: "receiveConvexEvent",
|
|
9
|
+
path: "/events/convex/{endpointKey}",
|
|
10
|
+
successStatus: 204,
|
|
11
|
+
summary: "Receive a signed Convex event",
|
|
12
|
+
tags: ["Events"],
|
|
13
|
+
})
|
|
14
|
+
.input(z.object({
|
|
15
|
+
emittedAt: z.iso.datetime({ offset: true }),
|
|
16
|
+
endpointKey: z.string(),
|
|
17
|
+
id: z.string(),
|
|
18
|
+
name: z.string(),
|
|
19
|
+
payload: z.json(),
|
|
20
|
+
}))
|
|
21
|
+
.output(z.void()),
|
|
22
|
+
};
|
package/dist/events/index.d.ts
CHANGED
|
@@ -97,6 +97,13 @@ export declare const eventsContract: {
|
|
|
97
97
|
subscription: import("zod").ZodLiteral<"projects/opkitty/subscriptions/automate-ax-google-forms-push">;
|
|
98
98
|
}, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
99
99
|
googleCalendarPush: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodVoid, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
100
|
+
convexEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
101
|
+
emittedAt: import("zod").ZodISODateTime;
|
|
102
|
+
endpointKey: import("zod").ZodString;
|
|
103
|
+
id: import("zod").ZodString;
|
|
104
|
+
name: import("zod").ZodString;
|
|
105
|
+
payload: import("zod").ZodJSONSchema;
|
|
106
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
100
107
|
brevoEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
101
108
|
event: import("zod").ZodString;
|
|
102
109
|
id: import("zod").ZodNumber;
|
package/dist/events/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { airtableEventsContract } from "./airtable.js";
|
|
2
2
|
import { asanaEventsContract } from "./asana.js";
|
|
3
3
|
import { brevoEventsContract } from "./brevo.js";
|
|
4
|
+
import { convexEventsContract } from "./convex.js";
|
|
4
5
|
import { googleCalendarEventsContract } from "./google-calendar.js";
|
|
5
6
|
import { googleFormsEventsContract } from "./google-forms.js";
|
|
6
7
|
import { googleMeetEventsContract } from "./google-meet.js";
|
|
@@ -18,6 +19,7 @@ export const eventsContract = {
|
|
|
18
19
|
...airtableEventsContract,
|
|
19
20
|
...asanaEventsContract,
|
|
20
21
|
...brevoEventsContract,
|
|
22
|
+
...convexEventsContract,
|
|
21
23
|
...googleCalendarEventsContract,
|
|
22
24
|
...googleFormsEventsContract,
|
|
23
25
|
...googleMeetEventsContract,
|
package/dist/execution-data.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const EXECUTION_DATASET_VERSION =
|
|
2
|
+
export declare const EXECUTION_DATASET_VERSION = 6;
|
|
3
3
|
export declare const executionDatasetResourceSchema: z.ZodEnum<{
|
|
4
4
|
automations: "automations";
|
|
5
5
|
projects: "projects";
|
|
6
6
|
actions: "actions";
|
|
7
7
|
events: "events";
|
|
8
8
|
outputs: "outputs";
|
|
9
|
+
"automation-invocations": "automation-invocations";
|
|
9
10
|
contexts: "contexts";
|
|
10
11
|
"context-parents": "context-parents";
|
|
11
12
|
"event-links": "event-links";
|
|
@@ -31,6 +32,7 @@ export declare const executionDatasetManifestSchema: z.ZodObject<{
|
|
|
31
32
|
actions: "actions";
|
|
32
33
|
events: "events";
|
|
33
34
|
outputs: "outputs";
|
|
35
|
+
"automation-invocations": "automation-invocations";
|
|
34
36
|
contexts: "contexts";
|
|
35
37
|
"context-parents": "context-parents";
|
|
36
38
|
"event-links": "event-links";
|
|
@@ -43,7 +45,7 @@ export declare const executionDatasetManifestSchema: z.ZodObject<{
|
|
|
43
45
|
}>;
|
|
44
46
|
url: z.ZodURL;
|
|
45
47
|
}, z.core.$strip>>;
|
|
46
|
-
schemaVersion: z.ZodLiteral<
|
|
48
|
+
schemaVersion: z.ZodLiteral<6>;
|
|
47
49
|
scope: z.ZodObject<{
|
|
48
50
|
organizationId: z.ZodNullable<z.ZodString>;
|
|
49
51
|
projectId: z.ZodNullable<z.ZodString>;
|
|
@@ -68,6 +70,7 @@ export declare const executionDataContract: {
|
|
|
68
70
|
actions: "actions";
|
|
69
71
|
events: "events";
|
|
70
72
|
outputs: "outputs";
|
|
73
|
+
"automation-invocations": "automation-invocations";
|
|
71
74
|
contexts: "contexts";
|
|
72
75
|
"context-parents": "context-parents";
|
|
73
76
|
"event-links": "event-links";
|
|
@@ -80,7 +83,7 @@ export declare const executionDataContract: {
|
|
|
80
83
|
}>;
|
|
81
84
|
url: z.ZodURL;
|
|
82
85
|
}, z.core.$strip>>;
|
|
83
|
-
schemaVersion: z.ZodLiteral<
|
|
86
|
+
schemaVersion: z.ZodLiteral<6>;
|
|
84
87
|
scope: z.ZodObject<{
|
|
85
88
|
organizationId: z.ZodNullable<z.ZodString>;
|
|
86
89
|
projectId: z.ZodNullable<z.ZodString>;
|
package/dist/execution-data.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
export const EXECUTION_DATASET_VERSION =
|
|
3
|
+
export const EXECUTION_DATASET_VERSION = 6;
|
|
4
4
|
export const executionDatasetResourceSchema = z.enum([
|
|
5
5
|
"projects",
|
|
6
6
|
"automations",
|
|
7
|
+
"automation-invocations",
|
|
7
8
|
"contexts",
|
|
8
9
|
"context-parents",
|
|
9
10
|
"event-links",
|