@automate.ax/api-contract 0.101.1 → 0.103.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/automation.d.ts +129 -0
- package/dist/automation.js +101 -39
- package/dist/index.d.ts +596 -420
- package/dist/index.js +4 -6
- package/package.json +3 -3
- package/src/automation.ts +111 -41
- package/src/index.ts +6 -5
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { executionDataContract } from "./execution-data.js";
|
|
|
9
9
|
import { orgContract } from "./org.js";
|
|
10
10
|
import { projectContract } from "./project.js";
|
|
11
11
|
import { runtimeContract } from "./runtime.js";
|
|
12
|
-
export { automationExecutionStatusSchema, automationOutputSchema, } from "./automation.js";
|
|
12
|
+
export { automationExecutionOutputSchema, automationExecutionSummarySchema, automationExecutionStatusSchema, automationManagementInvocationInputSchema, automationOutputSchema, } from "./automation.js";
|
|
13
13
|
export { EXECUTION_DATASET_VERSION, executionDatasetManifestSchema, executionDatasetProfileIdSchema, executionDatasetResourceSchema, executionDatasetScopeSchema, executionDataContract, } from "./execution-data.js";
|
|
14
14
|
export { AUTOMATION_SDK_VERSION, deploymentOutputSchema, deploymentStatusSchema, } from "./deployment.js";
|
|
15
15
|
export { AUTOMATION_RUNTIME_PROTOCOL_VERSION } from "./runtime-protocol.js";
|
|
@@ -27,7 +27,10 @@ export const publicContract = {
|
|
|
27
27
|
account: accountContract,
|
|
28
28
|
automation: {
|
|
29
29
|
get: automationContract.get,
|
|
30
|
+
getExecution: automationContract.getExecution,
|
|
31
|
+
invoke: automationContract.invoke,
|
|
30
32
|
list: automationContract.list,
|
|
33
|
+
listExecutions: automationContract.listExecutions,
|
|
31
34
|
update: automationContract.update,
|
|
32
35
|
},
|
|
33
36
|
apiKey: apiKeyContract,
|
|
@@ -66,11 +69,6 @@ export const publicContract = {
|
|
|
66
69
|
/** Procedures used by first-party control-plane clients. */
|
|
67
70
|
export const firstPartyContract = {
|
|
68
71
|
...publicContract,
|
|
69
|
-
automation: {
|
|
70
|
-
...publicContract.automation,
|
|
71
|
-
getExecution: automationContract.getExecution,
|
|
72
|
-
listExecutions: automationContract.listExecutions,
|
|
73
|
-
},
|
|
74
72
|
authorization: {
|
|
75
73
|
...publicContract.authorization,
|
|
76
74
|
beginConnection: authorizationContract.beginConnection,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automate.ax/api-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.103.0",
|
|
4
4
|
"description": "Public oRPC contract for the Automate.ax API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@ai-sdk/gateway": "4.0.46",
|
|
34
|
-
"@automate.ax/codec": "0.
|
|
35
|
-
"@automate.ax/integration-contracts": "0.
|
|
34
|
+
"@automate.ax/codec": "0.103.0",
|
|
35
|
+
"@automate.ax/integration-contracts": "0.103.0",
|
|
36
36
|
"@orpc/contract": "1.15.0",
|
|
37
37
|
"fast-json-stable-stringify": "^2.1.0",
|
|
38
38
|
"zod": "^4.3.6"
|
package/src/automation.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { codecEnvelopeSchema } from "@automate.ax/codec/rpc"
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
actionReplaySafetySchema,
|
|
4
|
+
AUTOMATION_INVOCATION_DEFAULT_ENTRYPOINT,
|
|
5
|
+
automationInvocationOutputSchema,
|
|
6
|
+
automationInvocationScheduleSchema,
|
|
7
|
+
sensitivityMaskSchema,
|
|
8
|
+
} from "./runtime"
|
|
3
9
|
import { oc } from "@orpc/contract"
|
|
4
10
|
import * as z from "zod"
|
|
5
11
|
import { integrationAccountBindingOutputSchema } from "./account"
|
|
@@ -55,7 +61,7 @@ export const automationExecutionStatusSchema = z.enum([
|
|
|
55
61
|
"failed",
|
|
56
62
|
])
|
|
57
63
|
|
|
58
|
-
const
|
|
64
|
+
export const automationExecutionSummarySchema = z.object({
|
|
59
65
|
createdAt: z.date(),
|
|
60
66
|
eventTypes: z.string().array(),
|
|
61
67
|
failure: automationErrorSchema.nullable(),
|
|
@@ -64,6 +70,76 @@ const EXECUTION_SUMMARY_SCHEMA = z.object({
|
|
|
64
70
|
status: automationExecutionStatusSchema,
|
|
65
71
|
})
|
|
66
72
|
|
|
73
|
+
export const automationExecutionOutputSchema = automationExecutionSummarySchema
|
|
74
|
+
.omit({ eventTypes: true })
|
|
75
|
+
.extend({
|
|
76
|
+
actions: z
|
|
77
|
+
.object({
|
|
78
|
+
attempts: z
|
|
79
|
+
.object({
|
|
80
|
+
completedAt: z.date().nullable(),
|
|
81
|
+
failure: automationErrorSchema.nullable(),
|
|
82
|
+
id: z.string(),
|
|
83
|
+
ordinal: z.number().int().positive(),
|
|
84
|
+
retryAt: z.date().nullable(),
|
|
85
|
+
startedAt: z.date(),
|
|
86
|
+
status: z.enum([
|
|
87
|
+
"running",
|
|
88
|
+
"retrying",
|
|
89
|
+
"succeeded",
|
|
90
|
+
"failed",
|
|
91
|
+
"indeterminate",
|
|
92
|
+
]),
|
|
93
|
+
})
|
|
94
|
+
.array(),
|
|
95
|
+
completedAt: z.date().nullable(),
|
|
96
|
+
createdAt: z.date(),
|
|
97
|
+
description: z.string().nullable(),
|
|
98
|
+
failure: automationErrorSchema.nullable(),
|
|
99
|
+
hasOutput: z.boolean(),
|
|
100
|
+
id: z.string(),
|
|
101
|
+
maxAttempts: z.number().int().positive(),
|
|
102
|
+
name: z.string(),
|
|
103
|
+
output: codecEnvelopeSchema.optional(),
|
|
104
|
+
outputSensitivity: sensitivityMaskSchema.nullable().optional(),
|
|
105
|
+
replaySafety: actionReplaySafetySchema.nullable(),
|
|
106
|
+
slot: z.number().int().nonnegative(),
|
|
107
|
+
status: z.enum(["pending", "succeeded", "skipped", "failed"]),
|
|
108
|
+
})
|
|
109
|
+
.array(),
|
|
110
|
+
events: z
|
|
111
|
+
.object({
|
|
112
|
+
createdAt: z.date(),
|
|
113
|
+
id: z.string(),
|
|
114
|
+
payload: codecEnvelopeSchema,
|
|
115
|
+
type: z.string(),
|
|
116
|
+
})
|
|
117
|
+
.array(),
|
|
118
|
+
outputs: z
|
|
119
|
+
.object({
|
|
120
|
+
actionInvocationId: z.string(),
|
|
121
|
+
createdAt: z.date(),
|
|
122
|
+
data: codecEnvelopeSchema,
|
|
123
|
+
id: z.string(),
|
|
124
|
+
sensitivity: sensitivityMaskSchema.nullable().optional(),
|
|
125
|
+
outputIndex: z.number().int().nonnegative(),
|
|
126
|
+
type: z.string(),
|
|
127
|
+
})
|
|
128
|
+
.array(),
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
export const automationManagementInvocationInputSchema = z
|
|
132
|
+
.object({
|
|
133
|
+
automationId: z.string().min(1),
|
|
134
|
+
entrypoint: z
|
|
135
|
+
.string()
|
|
136
|
+
.min(1)
|
|
137
|
+
.default(AUTOMATION_INVOCATION_DEFAULT_ENTRYPOINT),
|
|
138
|
+
idempotencyKey: z.string().min(1).max(255).optional(),
|
|
139
|
+
payload: codecEnvelopeSchema,
|
|
140
|
+
})
|
|
141
|
+
.and(automationInvocationScheduleSchema)
|
|
142
|
+
|
|
67
143
|
export const automationContract = {
|
|
68
144
|
get: oc
|
|
69
145
|
.route({
|
|
@@ -78,50 +154,36 @@ export const automationContract = {
|
|
|
78
154
|
.input(z.object({ automationId: z.string() }))
|
|
79
155
|
.output(automationOutputSchema),
|
|
80
156
|
getExecution: oc
|
|
157
|
+
.route({
|
|
158
|
+
method: "GET",
|
|
159
|
+
path: "/automations/{automationId}/executions/{executionId}",
|
|
160
|
+
operationId: "getAutomationExecution",
|
|
161
|
+
summary: "Get automation execution",
|
|
162
|
+
description:
|
|
163
|
+
"Returns one execution with decoded events, outputs, actions, and durable logical attempt history.",
|
|
164
|
+
tags: ["Automations"],
|
|
165
|
+
})
|
|
81
166
|
.input(
|
|
82
167
|
z.object({
|
|
83
168
|
automationId: z.string(),
|
|
84
169
|
executionId: z.string(),
|
|
85
170
|
}),
|
|
86
171
|
)
|
|
87
|
-
.output(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
})
|
|
103
|
-
.array(),
|
|
104
|
-
events: z
|
|
105
|
-
.object({
|
|
106
|
-
createdAt: z.date(),
|
|
107
|
-
id: z.string(),
|
|
108
|
-
payload: codecEnvelopeSchema,
|
|
109
|
-
type: z.string(),
|
|
110
|
-
})
|
|
111
|
-
.array(),
|
|
112
|
-
outputs: z
|
|
113
|
-
.object({
|
|
114
|
-
actionInvocationId: z.string(),
|
|
115
|
-
createdAt: z.date(),
|
|
116
|
-
data: codecEnvelopeSchema,
|
|
117
|
-
id: z.string(),
|
|
118
|
-
sensitivity: sensitivityMaskSchema.nullable().optional(),
|
|
119
|
-
outputIndex: z.number().int().nonnegative(),
|
|
120
|
-
type: z.string(),
|
|
121
|
-
})
|
|
122
|
-
.array(),
|
|
123
|
-
}),
|
|
124
|
-
),
|
|
172
|
+
.output(automationExecutionOutputSchema),
|
|
173
|
+
invoke: oc
|
|
174
|
+
.route({
|
|
175
|
+
method: "POST",
|
|
176
|
+
path: "/automations/{automationId}/invocations",
|
|
177
|
+
operationId: "invokeAutomation",
|
|
178
|
+
summary: "Invoke automation",
|
|
179
|
+
description:
|
|
180
|
+
"Schedules an invocation for an active automation. Runtime callers use the active action as the idempotency identity; other callers must provide idempotencyKey.",
|
|
181
|
+
successStatus: 202,
|
|
182
|
+
successDescription: "Invocation accepted.",
|
|
183
|
+
tags: ["Automations"],
|
|
184
|
+
})
|
|
185
|
+
.input(automationManagementInvocationInputSchema)
|
|
186
|
+
.output(automationInvocationOutputSchema),
|
|
125
187
|
list: oc
|
|
126
188
|
.route({
|
|
127
189
|
method: "GET",
|
|
@@ -144,13 +206,21 @@ export const automationContract = {
|
|
|
144
206
|
)
|
|
145
207
|
.output(cursorPageOutputSchema(automationOutputSchema)),
|
|
146
208
|
listExecutions: oc
|
|
209
|
+
.route({
|
|
210
|
+
method: "GET",
|
|
211
|
+
path: "/automations/{automationId}/executions",
|
|
212
|
+
operationId: "listAutomationExecutions",
|
|
213
|
+
summary: "List automation executions",
|
|
214
|
+
description: "Lists recent execution summaries for one automation.",
|
|
215
|
+
tags: ["Automations"],
|
|
216
|
+
})
|
|
147
217
|
.input(
|
|
148
218
|
z.object({
|
|
149
219
|
automationId: z.string(),
|
|
150
220
|
limit: z.number().int().min(1).max(100).default(50),
|
|
151
221
|
}),
|
|
152
222
|
)
|
|
153
|
-
.output(
|
|
223
|
+
.output(automationExecutionSummarySchema.array()),
|
|
154
224
|
update: oc
|
|
155
225
|
.route({
|
|
156
226
|
method: "PATCH",
|
package/src/index.ts
CHANGED
|
@@ -11,7 +11,10 @@ import { projectContract } from "./project"
|
|
|
11
11
|
import { runtimeContract } from "./runtime"
|
|
12
12
|
|
|
13
13
|
export {
|
|
14
|
+
automationExecutionOutputSchema,
|
|
15
|
+
automationExecutionSummarySchema,
|
|
14
16
|
automationExecutionStatusSchema,
|
|
17
|
+
automationManagementInvocationInputSchema,
|
|
15
18
|
automationOutputSchema,
|
|
16
19
|
} from "./automation"
|
|
17
20
|
export {
|
|
@@ -115,7 +118,10 @@ export const publicContract = {
|
|
|
115
118
|
account: accountContract,
|
|
116
119
|
automation: {
|
|
117
120
|
get: automationContract.get,
|
|
121
|
+
getExecution: automationContract.getExecution,
|
|
122
|
+
invoke: automationContract.invoke,
|
|
118
123
|
list: automationContract.list,
|
|
124
|
+
listExecutions: automationContract.listExecutions,
|
|
119
125
|
update: automationContract.update,
|
|
120
126
|
},
|
|
121
127
|
apiKey: apiKeyContract,
|
|
@@ -155,11 +161,6 @@ export const publicContract = {
|
|
|
155
161
|
/** Procedures used by first-party control-plane clients. */
|
|
156
162
|
export const firstPartyContract = {
|
|
157
163
|
...publicContract,
|
|
158
|
-
automation: {
|
|
159
|
-
...publicContract.automation,
|
|
160
|
-
getExecution: automationContract.getExecution,
|
|
161
|
-
listExecutions: automationContract.listExecutions,
|
|
162
|
-
},
|
|
163
164
|
authorization: {
|
|
164
165
|
...publicContract.authorization,
|
|
165
166
|
beginConnection: authorizationContract.beginConnection,
|