@automate.ax/api-contract 0.44.0 → 0.45.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.
@@ -0,0 +1,106 @@
1
+ import { z } from "zod";
2
+ export declare const automationExecutionStatusSchema: z.ZodEnum<{
3
+ failed: "failed";
4
+ running: "running";
5
+ completed: "completed";
6
+ }>;
7
+ export declare const automationContract: {
8
+ get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
9
+ automationId: z.ZodString;
10
+ projectId: z.ZodString;
11
+ }, z.core.$strip>, z.ZodObject<{
12
+ activeDeployment: z.ZodObject<{
13
+ createdAt: z.ZodDate;
14
+ git: z.ZodNullable<z.ZodObject<{
15
+ commitSha: z.ZodString;
16
+ dirty: z.ZodBoolean;
17
+ repositoryUrl: z.ZodString;
18
+ }, z.core.$strip>>;
19
+ id: z.ZodString;
20
+ }, z.core.$strip>;
21
+ createdAt: z.ZodDate;
22
+ description: z.ZodString;
23
+ id: z.ZodString;
24
+ identityKey: z.ZodString;
25
+ triggers: z.ZodArray<z.ZodObject<{
26
+ details: z.ZodArray<z.ZodObject<{
27
+ label: z.ZodString;
28
+ value: z.ZodString;
29
+ }, z.core.$strip>>;
30
+ name: z.ZodString;
31
+ type: z.ZodString;
32
+ }, z.core.$strip>>;
33
+ updatedAt: z.ZodDate;
34
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
35
+ getExecution: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
36
+ automationId: z.ZodString;
37
+ executionId: z.ZodString;
38
+ projectId: z.ZodString;
39
+ }, z.core.$strip>, z.ZodObject<{
40
+ id: z.ZodString;
41
+ status: z.ZodEnum<{
42
+ failed: "failed";
43
+ running: "running";
44
+ completed: "completed";
45
+ }>;
46
+ createdAt: z.ZodDate;
47
+ completedAt: z.ZodNullable<z.ZodDate>;
48
+ failure: z.ZodNullable<z.ZodObject<{
49
+ message: z.ZodString;
50
+ name: z.ZodString;
51
+ }, z.core.$strip>>;
52
+ actions: z.ZodArray<z.ZodObject<{
53
+ completedAt: z.ZodNullable<z.ZodDate>;
54
+ createdAt: z.ZodDate;
55
+ description: z.ZodNullable<z.ZodString>;
56
+ failure: z.ZodNullable<z.ZodObject<{
57
+ message: z.ZodString;
58
+ name: z.ZodString;
59
+ }, z.core.$strip>>;
60
+ hasOutput: z.ZodBoolean;
61
+ id: z.ZodString;
62
+ name: z.ZodString;
63
+ output: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
64
+ slot: z.ZodNumber;
65
+ status: z.ZodEnum<{
66
+ pending: "pending";
67
+ succeeded: "succeeded";
68
+ failed: "failed";
69
+ closed: "closed";
70
+ }>;
71
+ }, z.core.$strip>>;
72
+ events: z.ZodArray<z.ZodObject<{
73
+ createdAt: z.ZodDate;
74
+ id: z.ZodString;
75
+ payload: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
76
+ type: z.ZodString;
77
+ }, z.core.$strip>>;
78
+ outputs: z.ZodArray<z.ZodObject<{
79
+ actionInvocationId: z.ZodString;
80
+ createdAt: z.ZodDate;
81
+ data: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
82
+ id: z.ZodString;
83
+ outputIndex: z.ZodNumber;
84
+ type: z.ZodString;
85
+ }, z.core.$strip>>;
86
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
87
+ listExecutions: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
88
+ automationId: z.ZodString;
89
+ limit: z.ZodDefault<z.ZodNumber>;
90
+ projectId: z.ZodString;
91
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
92
+ completedAt: z.ZodNullable<z.ZodDate>;
93
+ createdAt: z.ZodDate;
94
+ eventTypes: z.ZodArray<z.ZodString>;
95
+ failure: z.ZodNullable<z.ZodObject<{
96
+ message: z.ZodString;
97
+ name: z.ZodString;
98
+ }, z.core.$strip>>;
99
+ id: z.ZodString;
100
+ status: z.ZodEnum<{
101
+ failed: "failed";
102
+ running: "running";
103
+ completed: "completed";
104
+ }>;
105
+ }, z.core.$strip>>, Record<never, never>, Record<never, never>>;
106
+ };
@@ -0,0 +1,94 @@
1
+ import { encodableSchema } from "@automate.ax/codec";
2
+ import { oc } from "@orpc/contract";
3
+ import { z } from "zod";
4
+ import { deploymentTriggerInfoSchema } from "./deployment.js";
5
+ export const automationExecutionStatusSchema = z.enum([
6
+ "running",
7
+ "completed",
8
+ "failed",
9
+ ]);
10
+ const EXECUTION_FAILURE_SCHEMA = z.object({
11
+ message: z.string(),
12
+ name: z.string(),
13
+ });
14
+ const EXECUTION_SUMMARY_SCHEMA = z.object({
15
+ completedAt: z.date().nullable(),
16
+ createdAt: z.date(),
17
+ eventTypes: z.string().array(),
18
+ failure: EXECUTION_FAILURE_SCHEMA.nullable(),
19
+ id: z.string(),
20
+ status: automationExecutionStatusSchema,
21
+ });
22
+ export const automationContract = {
23
+ get: oc
24
+ .input(z.object({
25
+ automationId: z.string(),
26
+ projectId: z.string(),
27
+ }))
28
+ .output(z.object({
29
+ activeDeployment: z.object({
30
+ createdAt: z.date(),
31
+ git: z
32
+ .object({
33
+ commitSha: z.string(),
34
+ dirty: z.boolean(),
35
+ repositoryUrl: z.string(),
36
+ })
37
+ .nullable(),
38
+ id: z.string(),
39
+ }),
40
+ createdAt: z.date(),
41
+ description: z.string(),
42
+ id: z.string(),
43
+ identityKey: z.string(),
44
+ triggers: deploymentTriggerInfoSchema.array(),
45
+ updatedAt: z.date(),
46
+ })),
47
+ getExecution: oc
48
+ .input(z.object({
49
+ automationId: z.string(),
50
+ executionId: z.string(),
51
+ projectId: z.string(),
52
+ }))
53
+ .output(EXECUTION_SUMMARY_SCHEMA.omit({ eventTypes: true }).extend({
54
+ actions: z
55
+ .object({
56
+ completedAt: z.date().nullable(),
57
+ createdAt: z.date(),
58
+ description: z.string().nullable(),
59
+ failure: EXECUTION_FAILURE_SCHEMA.nullable(),
60
+ hasOutput: z.boolean(),
61
+ id: z.string(),
62
+ name: z.string(),
63
+ output: encodableSchema,
64
+ slot: z.number().int().nonnegative(),
65
+ status: z.enum(["pending", "succeeded", "closed", "failed"]),
66
+ })
67
+ .array(),
68
+ events: z
69
+ .object({
70
+ createdAt: z.date(),
71
+ id: z.string(),
72
+ payload: encodableSchema,
73
+ type: z.string(),
74
+ })
75
+ .array(),
76
+ outputs: z
77
+ .object({
78
+ actionInvocationId: z.string(),
79
+ createdAt: z.date(),
80
+ data: encodableSchema,
81
+ id: z.string(),
82
+ outputIndex: z.number().int().nonnegative(),
83
+ type: z.string(),
84
+ })
85
+ .array(),
86
+ })),
87
+ listExecutions: oc
88
+ .input(z.object({
89
+ automationId: z.string(),
90
+ limit: z.number().int().min(1).max(100).default(50),
91
+ projectId: z.string(),
92
+ }))
93
+ .output(EXECUTION_SUMMARY_SCHEMA.array()),
94
+ };
@@ -58,6 +58,7 @@ export declare const deploymentContract: {
58
58
  }, z.core.$strip>, z.ZodObject<{
59
59
  automations: z.ZodArray<z.ZodObject<{
60
60
  description: z.ZodString;
61
+ id: z.ZodString;
61
62
  identityKey: z.ZodString;
62
63
  triggers: z.ZodArray<z.ZodObject<{
63
64
  details: z.ZodArray<z.ZodObject<{
@@ -68,6 +69,7 @@ export declare const deploymentContract: {
68
69
  type: z.ZodString;
69
70
  }, z.core.$strip>>;
70
71
  }, z.core.$strip>>;
72
+ createdAt: z.ZodDate;
71
73
  id: z.ZodString;
72
74
  git: z.ZodNullable<z.ZodObject<{
73
75
  commitSha: z.ZodString;
@@ -79,10 +79,12 @@ export const deploymentContract = {
79
79
  automations: z
80
80
  .object({
81
81
  description: z.string(),
82
+ id: z.string(),
82
83
  identityKey: z.string(),
83
84
  triggers: deploymentTriggerInfoSchema.array(),
84
85
  })
85
86
  .array(),
87
+ createdAt: z.date(),
86
88
  id: z.string(),
87
89
  git: GIT_SOURCE_SCHEMA.nullable(),
88
90
  job: z
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { automationExecutionStatusSchema } from "./automation.js";
1
2
  export { AUTOMATION_SDK_VERSION, deploymentTriggerInfoSchema, type DeploymentTriggerInfo, } from "./deployment.js";
2
3
  export { integrationAccountOutputSchema } from "./account.js";
3
4
  export { DEFAULT_GATEWAY_MODEL_ID, generationInputSchema, generationResultSchema, runtimeContract, type GenerationInput, type GenerationResult, type RuntimeGenerationInput, } from "./runtime.js";
@@ -204,6 +205,7 @@ export declare const publicContract: {
204
205
  organizationId: import("zod").ZodString;
205
206
  name: import("zod").ZodString;
206
207
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
208
+ activeDeploymentId: import("zod").ZodNullable<import("zod").ZodString>;
207
209
  id: import("zod").ZodString;
208
210
  name: import("zod").ZodString;
209
211
  organizationId: import("zod").ZodString;
@@ -215,6 +217,7 @@ export declare const publicContract: {
215
217
  }, import("zod/v4/core").$strip>;
216
218
  activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
217
219
  description: import("zod").ZodString;
220
+ id: import("zod").ZodString;
218
221
  identityKey: import("zod").ZodString;
219
222
  }, import("zod/v4/core").$strip>>;
220
223
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
@@ -224,6 +227,7 @@ export declare const publicContract: {
224
227
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
225
228
  projectId: import("zod").ZodString;
226
229
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
230
+ activeDeploymentId: import("zod").ZodNullable<import("zod").ZodString>;
227
231
  id: import("zod").ZodString;
228
232
  name: import("zod").ZodString;
229
233
  organizationId: import("zod").ZodString;
@@ -235,6 +239,7 @@ export declare const publicContract: {
235
239
  }, import("zod/v4/core").$strip>;
236
240
  activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
237
241
  description: import("zod").ZodString;
242
+ id: import("zod").ZodString;
238
243
  identityKey: import("zod").ZodString;
239
244
  }, import("zod/v4/core").$strip>>;
240
245
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
@@ -242,6 +247,7 @@ export declare const publicContract: {
242
247
  organizationId: import("zod").ZodOptional<import("zod").ZodString>;
243
248
  query: import("zod").ZodOptional<import("zod").ZodString>;
244
249
  }, import("zod/v4/core").$strip>>, import("zod").ZodArray<import("zod").ZodObject<{
250
+ activeDeploymentId: import("zod").ZodNullable<import("zod").ZodString>;
245
251
  id: import("zod").ZodString;
246
252
  name: import("zod").ZodString;
247
253
  organizationId: import("zod").ZodString;
@@ -253,6 +259,7 @@ export declare const publicContract: {
253
259
  }, import("zod/v4/core").$strip>;
254
260
  activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
255
261
  description: import("zod").ZodString;
262
+ id: import("zod").ZodString;
256
263
  identityKey: import("zod").ZodString;
257
264
  }, import("zod/v4/core").$strip>>;
258
265
  }, import("zod/v4/core").$strip>>, Record<never, never>, Record<never, never>>;
@@ -374,6 +381,106 @@ export declare const firstPartyContract: {
374
381
  serviceId: import("zod").ZodString;
375
382
  }, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
376
383
  };
384
+ automation: {
385
+ get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
386
+ automationId: import("zod").ZodString;
387
+ projectId: import("zod").ZodString;
388
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
389
+ activeDeployment: import("zod").ZodObject<{
390
+ createdAt: import("zod").ZodDate;
391
+ git: import("zod").ZodNullable<import("zod").ZodObject<{
392
+ commitSha: import("zod").ZodString;
393
+ dirty: import("zod").ZodBoolean;
394
+ repositoryUrl: import("zod").ZodString;
395
+ }, import("zod/v4/core").$strip>>;
396
+ id: import("zod").ZodString;
397
+ }, import("zod/v4/core").$strip>;
398
+ createdAt: import("zod").ZodDate;
399
+ description: import("zod").ZodString;
400
+ id: import("zod").ZodString;
401
+ identityKey: import("zod").ZodString;
402
+ triggers: import("zod").ZodArray<import("zod").ZodObject<{
403
+ details: import("zod").ZodArray<import("zod").ZodObject<{
404
+ label: import("zod").ZodString;
405
+ value: import("zod").ZodString;
406
+ }, import("zod/v4/core").$strip>>;
407
+ name: import("zod").ZodString;
408
+ type: import("zod").ZodString;
409
+ }, import("zod/v4/core").$strip>>;
410
+ updatedAt: import("zod").ZodDate;
411
+ }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
412
+ getExecution: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
413
+ automationId: import("zod").ZodString;
414
+ executionId: import("zod").ZodString;
415
+ projectId: import("zod").ZodString;
416
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
417
+ id: import("zod").ZodString;
418
+ status: import("zod").ZodEnum<{
419
+ failed: "failed";
420
+ running: "running";
421
+ completed: "completed";
422
+ }>;
423
+ createdAt: import("zod").ZodDate;
424
+ completedAt: import("zod").ZodNullable<import("zod").ZodDate>;
425
+ failure: import("zod").ZodNullable<import("zod").ZodObject<{
426
+ message: import("zod").ZodString;
427
+ name: import("zod").ZodString;
428
+ }, import("zod/v4/core").$strip>>;
429
+ actions: import("zod").ZodArray<import("zod").ZodObject<{
430
+ completedAt: import("zod").ZodNullable<import("zod").ZodDate>;
431
+ createdAt: import("zod").ZodDate;
432
+ description: import("zod").ZodNullable<import("zod").ZodString>;
433
+ failure: import("zod").ZodNullable<import("zod").ZodObject<{
434
+ message: import("zod").ZodString;
435
+ name: import("zod").ZodString;
436
+ }, import("zod/v4/core").$strip>>;
437
+ hasOutput: import("zod").ZodBoolean;
438
+ id: import("zod").ZodString;
439
+ name: import("zod").ZodString;
440
+ output: import("zod").ZodOptional<import("zod").ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
441
+ slot: import("zod").ZodNumber;
442
+ status: import("zod").ZodEnum<{
443
+ pending: "pending";
444
+ succeeded: "succeeded";
445
+ failed: "failed";
446
+ closed: "closed";
447
+ }>;
448
+ }, import("zod/v4/core").$strip>>;
449
+ events: import("zod").ZodArray<import("zod").ZodObject<{
450
+ createdAt: import("zod").ZodDate;
451
+ id: import("zod").ZodString;
452
+ payload: import("zod").ZodOptional<import("zod").ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
453
+ type: import("zod").ZodString;
454
+ }, import("zod/v4/core").$strip>>;
455
+ outputs: import("zod").ZodArray<import("zod").ZodObject<{
456
+ actionInvocationId: import("zod").ZodString;
457
+ createdAt: import("zod").ZodDate;
458
+ data: import("zod").ZodOptional<import("zod").ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
459
+ id: import("zod").ZodString;
460
+ outputIndex: import("zod").ZodNumber;
461
+ type: import("zod").ZodString;
462
+ }, import("zod/v4/core").$strip>>;
463
+ }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
464
+ listExecutions: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
465
+ automationId: import("zod").ZodString;
466
+ limit: import("zod").ZodDefault<import("zod").ZodNumber>;
467
+ projectId: import("zod").ZodString;
468
+ }, import("zod/v4/core").$strip>, import("zod").ZodArray<import("zod").ZodObject<{
469
+ completedAt: import("zod").ZodNullable<import("zod").ZodDate>;
470
+ createdAt: import("zod").ZodDate;
471
+ eventTypes: import("zod").ZodArray<import("zod").ZodString>;
472
+ failure: import("zod").ZodNullable<import("zod").ZodObject<{
473
+ message: import("zod").ZodString;
474
+ name: import("zod").ZodString;
475
+ }, import("zod/v4/core").$strip>>;
476
+ id: import("zod").ZodString;
477
+ status: import("zod").ZodEnum<{
478
+ failed: "failed";
479
+ running: "running";
480
+ completed: "completed";
481
+ }>;
482
+ }, import("zod/v4/core").$strip>>, Record<never, never>, Record<never, never>>;
483
+ };
377
484
  authorization: {
378
485
  beginConnection: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
379
486
  binding: import("zod").ZodString;
@@ -530,6 +637,7 @@ export declare const firstPartyContract: {
530
637
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
531
638
  automations: import("zod").ZodArray<import("zod").ZodObject<{
532
639
  description: import("zod").ZodString;
640
+ id: import("zod").ZodString;
533
641
  identityKey: import("zod").ZodString;
534
642
  triggers: import("zod").ZodArray<import("zod").ZodObject<{
535
643
  details: import("zod").ZodArray<import("zod").ZodObject<{
@@ -540,6 +648,7 @@ export declare const firstPartyContract: {
540
648
  type: import("zod").ZodString;
541
649
  }, import("zod/v4/core").$strip>>;
542
650
  }, import("zod/v4/core").$strip>>;
651
+ createdAt: import("zod").ZodDate;
543
652
  id: import("zod").ZodString;
544
653
  git: import("zod").ZodNullable<import("zod").ZodObject<{
545
654
  commitSha: import("zod").ZodString;
@@ -736,6 +845,7 @@ export declare const firstPartyContract: {
736
845
  organizationId: import("zod").ZodString;
737
846
  name: import("zod").ZodString;
738
847
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
848
+ activeDeploymentId: import("zod").ZodNullable<import("zod").ZodString>;
739
849
  id: import("zod").ZodString;
740
850
  name: import("zod").ZodString;
741
851
  organizationId: import("zod").ZodString;
@@ -747,6 +857,7 @@ export declare const firstPartyContract: {
747
857
  }, import("zod/v4/core").$strip>;
748
858
  activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
749
859
  description: import("zod").ZodString;
860
+ id: import("zod").ZodString;
750
861
  identityKey: import("zod").ZodString;
751
862
  }, import("zod/v4/core").$strip>>;
752
863
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
@@ -756,6 +867,7 @@ export declare const firstPartyContract: {
756
867
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
757
868
  projectId: import("zod").ZodString;
758
869
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
870
+ activeDeploymentId: import("zod").ZodNullable<import("zod").ZodString>;
759
871
  id: import("zod").ZodString;
760
872
  name: import("zod").ZodString;
761
873
  organizationId: import("zod").ZodString;
@@ -767,6 +879,7 @@ export declare const firstPartyContract: {
767
879
  }, import("zod/v4/core").$strip>;
768
880
  activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
769
881
  description: import("zod").ZodString;
882
+ id: import("zod").ZodString;
770
883
  identityKey: import("zod").ZodString;
771
884
  }, import("zod/v4/core").$strip>>;
772
885
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
@@ -774,6 +887,7 @@ export declare const firstPartyContract: {
774
887
  organizationId: import("zod").ZodOptional<import("zod").ZodString>;
775
888
  query: import("zod").ZodOptional<import("zod").ZodString>;
776
889
  }, import("zod/v4/core").$strip>>, import("zod").ZodArray<import("zod").ZodObject<{
890
+ activeDeploymentId: import("zod").ZodNullable<import("zod").ZodString>;
777
891
  id: import("zod").ZodString;
778
892
  name: import("zod").ZodString;
779
893
  organizationId: import("zod").ZodString;
@@ -785,6 +899,7 @@ export declare const firstPartyContract: {
785
899
  }, import("zod/v4/core").$strip>;
786
900
  activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
787
901
  description: import("zod").ZodString;
902
+ id: import("zod").ZodString;
788
903
  identityKey: import("zod").ZodString;
789
904
  }, import("zod/v4/core").$strip>>;
790
905
  }, import("zod/v4/core").$strip>>, Record<never, never>, Record<never, never>>;
@@ -1363,6 +1478,106 @@ export declare const contract: {
1363
1478
  serviceId: import("zod").ZodString;
1364
1479
  }, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
1365
1480
  };
1481
+ automation: {
1482
+ get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1483
+ automationId: import("zod").ZodString;
1484
+ projectId: import("zod").ZodString;
1485
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1486
+ activeDeployment: import("zod").ZodObject<{
1487
+ createdAt: import("zod").ZodDate;
1488
+ git: import("zod").ZodNullable<import("zod").ZodObject<{
1489
+ commitSha: import("zod").ZodString;
1490
+ dirty: import("zod").ZodBoolean;
1491
+ repositoryUrl: import("zod").ZodString;
1492
+ }, import("zod/v4/core").$strip>>;
1493
+ id: import("zod").ZodString;
1494
+ }, import("zod/v4/core").$strip>;
1495
+ createdAt: import("zod").ZodDate;
1496
+ description: import("zod").ZodString;
1497
+ id: import("zod").ZodString;
1498
+ identityKey: import("zod").ZodString;
1499
+ triggers: import("zod").ZodArray<import("zod").ZodObject<{
1500
+ details: import("zod").ZodArray<import("zod").ZodObject<{
1501
+ label: import("zod").ZodString;
1502
+ value: import("zod").ZodString;
1503
+ }, import("zod/v4/core").$strip>>;
1504
+ name: import("zod").ZodString;
1505
+ type: import("zod").ZodString;
1506
+ }, import("zod/v4/core").$strip>>;
1507
+ updatedAt: import("zod").ZodDate;
1508
+ }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
1509
+ getExecution: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1510
+ automationId: import("zod").ZodString;
1511
+ executionId: import("zod").ZodString;
1512
+ projectId: import("zod").ZodString;
1513
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1514
+ id: import("zod").ZodString;
1515
+ status: import("zod").ZodEnum<{
1516
+ failed: "failed";
1517
+ running: "running";
1518
+ completed: "completed";
1519
+ }>;
1520
+ createdAt: import("zod").ZodDate;
1521
+ completedAt: import("zod").ZodNullable<import("zod").ZodDate>;
1522
+ failure: import("zod").ZodNullable<import("zod").ZodObject<{
1523
+ message: import("zod").ZodString;
1524
+ name: import("zod").ZodString;
1525
+ }, import("zod/v4/core").$strip>>;
1526
+ actions: import("zod").ZodArray<import("zod").ZodObject<{
1527
+ completedAt: import("zod").ZodNullable<import("zod").ZodDate>;
1528
+ createdAt: import("zod").ZodDate;
1529
+ description: import("zod").ZodNullable<import("zod").ZodString>;
1530
+ failure: import("zod").ZodNullable<import("zod").ZodObject<{
1531
+ message: import("zod").ZodString;
1532
+ name: import("zod").ZodString;
1533
+ }, import("zod/v4/core").$strip>>;
1534
+ hasOutput: import("zod").ZodBoolean;
1535
+ id: import("zod").ZodString;
1536
+ name: import("zod").ZodString;
1537
+ output: import("zod").ZodOptional<import("zod").ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
1538
+ slot: import("zod").ZodNumber;
1539
+ status: import("zod").ZodEnum<{
1540
+ pending: "pending";
1541
+ succeeded: "succeeded";
1542
+ failed: "failed";
1543
+ closed: "closed";
1544
+ }>;
1545
+ }, import("zod/v4/core").$strip>>;
1546
+ events: import("zod").ZodArray<import("zod").ZodObject<{
1547
+ createdAt: import("zod").ZodDate;
1548
+ id: import("zod").ZodString;
1549
+ payload: import("zod").ZodOptional<import("zod").ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
1550
+ type: import("zod").ZodString;
1551
+ }, import("zod/v4/core").$strip>>;
1552
+ outputs: import("zod").ZodArray<import("zod").ZodObject<{
1553
+ actionInvocationId: import("zod").ZodString;
1554
+ createdAt: import("zod").ZodDate;
1555
+ data: import("zod").ZodOptional<import("zod").ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
1556
+ id: import("zod").ZodString;
1557
+ outputIndex: import("zod").ZodNumber;
1558
+ type: import("zod").ZodString;
1559
+ }, import("zod/v4/core").$strip>>;
1560
+ }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
1561
+ listExecutions: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1562
+ automationId: import("zod").ZodString;
1563
+ limit: import("zod").ZodDefault<import("zod").ZodNumber>;
1564
+ projectId: import("zod").ZodString;
1565
+ }, import("zod/v4/core").$strip>, import("zod").ZodArray<import("zod").ZodObject<{
1566
+ completedAt: import("zod").ZodNullable<import("zod").ZodDate>;
1567
+ createdAt: import("zod").ZodDate;
1568
+ eventTypes: import("zod").ZodArray<import("zod").ZodString>;
1569
+ failure: import("zod").ZodNullable<import("zod").ZodObject<{
1570
+ message: import("zod").ZodString;
1571
+ name: import("zod").ZodString;
1572
+ }, import("zod/v4/core").$strip>>;
1573
+ id: import("zod").ZodString;
1574
+ status: import("zod").ZodEnum<{
1575
+ failed: "failed";
1576
+ running: "running";
1577
+ completed: "completed";
1578
+ }>;
1579
+ }, import("zod/v4/core").$strip>>, Record<never, never>, Record<never, never>>;
1580
+ };
1366
1581
  deployment: {
1367
1582
  cancel: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1368
1583
  deploymentId: import("zod").ZodString;
@@ -1411,6 +1626,7 @@ export declare const contract: {
1411
1626
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1412
1627
  automations: import("zod").ZodArray<import("zod").ZodObject<{
1413
1628
  description: import("zod").ZodString;
1629
+ id: import("zod").ZodString;
1414
1630
  identityKey: import("zod").ZodString;
1415
1631
  triggers: import("zod").ZodArray<import("zod").ZodObject<{
1416
1632
  details: import("zod").ZodArray<import("zod").ZodObject<{
@@ -1421,6 +1637,7 @@ export declare const contract: {
1421
1637
  type: import("zod").ZodString;
1422
1638
  }, import("zod/v4/core").$strip>>;
1423
1639
  }, import("zod/v4/core").$strip>>;
1640
+ createdAt: import("zod").ZodDate;
1424
1641
  id: import("zod").ZodString;
1425
1642
  git: import("zod").ZodNullable<import("zod").ZodObject<{
1426
1643
  commitSha: import("zod").ZodString;
@@ -1617,6 +1834,7 @@ export declare const contract: {
1617
1834
  organizationId: import("zod").ZodString;
1618
1835
  name: import("zod").ZodString;
1619
1836
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1837
+ activeDeploymentId: import("zod").ZodNullable<import("zod").ZodString>;
1620
1838
  id: import("zod").ZodString;
1621
1839
  name: import("zod").ZodString;
1622
1840
  organizationId: import("zod").ZodString;
@@ -1628,6 +1846,7 @@ export declare const contract: {
1628
1846
  }, import("zod/v4/core").$strip>;
1629
1847
  activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
1630
1848
  description: import("zod").ZodString;
1849
+ id: import("zod").ZodString;
1631
1850
  identityKey: import("zod").ZodString;
1632
1851
  }, import("zod/v4/core").$strip>>;
1633
1852
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
@@ -1637,6 +1856,7 @@ export declare const contract: {
1637
1856
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
1638
1857
  projectId: import("zod").ZodString;
1639
1858
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
1859
+ activeDeploymentId: import("zod").ZodNullable<import("zod").ZodString>;
1640
1860
  id: import("zod").ZodString;
1641
1861
  name: import("zod").ZodString;
1642
1862
  organizationId: import("zod").ZodString;
@@ -1648,6 +1868,7 @@ export declare const contract: {
1648
1868
  }, import("zod/v4/core").$strip>;
1649
1869
  activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
1650
1870
  description: import("zod").ZodString;
1871
+ id: import("zod").ZodString;
1651
1872
  identityKey: import("zod").ZodString;
1652
1873
  }, import("zod/v4/core").$strip>>;
1653
1874
  }, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
@@ -1655,6 +1876,7 @@ export declare const contract: {
1655
1876
  organizationId: import("zod").ZodOptional<import("zod").ZodString>;
1656
1877
  query: import("zod").ZodOptional<import("zod").ZodString>;
1657
1878
  }, import("zod/v4/core").$strip>>, import("zod").ZodArray<import("zod").ZodObject<{
1879
+ activeDeploymentId: import("zod").ZodNullable<import("zod").ZodString>;
1658
1880
  id: import("zod").ZodString;
1659
1881
  name: import("zod").ZodString;
1660
1882
  organizationId: import("zod").ZodString;
@@ -1666,6 +1888,7 @@ export declare const contract: {
1666
1888
  }, import("zod/v4/core").$strip>;
1667
1889
  activeAutomations: import("zod").ZodArray<import("zod").ZodObject<{
1668
1890
  description: import("zod").ZodString;
1891
+ id: import("zod").ZodString;
1669
1892
  identityKey: import("zod").ZodString;
1670
1893
  }, import("zod/v4/core").$strip>>;
1671
1894
  }, import("zod/v4/core").$strip>>, Record<never, never>, Record<never, never>>;
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { accountContract } from "./account.js";
2
+ import { automationContract } from "./automation.js";
2
3
  import { apiKeyContract } from "./api-key.js";
3
4
  import { authContract } from "./auth.js";
4
5
  import { authorizationContract } from "./authorization.js";
@@ -7,6 +8,7 @@ import { eventsContract } from "./events/index.js";
7
8
  import { orgContract } from "./org.js";
8
9
  import { projectContract } from "./project.js";
9
10
  import { runtimeContract } from "./runtime.js";
11
+ export { automationExecutionStatusSchema } from "./automation.js";
10
12
  export { AUTOMATION_SDK_VERSION, deploymentTriggerInfoSchema, } from "./deployment.js";
11
13
  export { integrationAccountOutputSchema } from "./account.js";
12
14
  export { DEFAULT_GATEWAY_MODEL_ID, generationInputSchema, generationResultSchema, runtimeContract, } from "./runtime.js";
@@ -45,6 +47,7 @@ export const publicContract = {
45
47
  export const firstPartyContract = {
46
48
  ...publicContract,
47
49
  account: accountContract,
50
+ automation: automationContract,
48
51
  authorization: {
49
52
  beginConnection: authorizationContract.beginConnection,
50
53
  get: authorizationContract.get,
package/dist/project.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  export declare const projectOutputSchema: z.ZodObject<{
3
+ activeDeploymentId: z.ZodNullable<z.ZodString>;
3
4
  id: z.ZodString;
4
5
  name: z.ZodString;
5
6
  organizationId: z.ZodString;
@@ -11,6 +12,7 @@ export declare const projectOutputSchema: z.ZodObject<{
11
12
  }, z.core.$strip>;
12
13
  activeAutomations: z.ZodArray<z.ZodObject<{
13
14
  description: z.ZodString;
15
+ id: z.ZodString;
14
16
  identityKey: z.ZodString;
15
17
  }, z.core.$strip>>;
16
18
  }, z.core.$strip>;
@@ -22,6 +24,7 @@ export declare const projectContract: {
22
24
  organizationId: z.ZodString;
23
25
  name: z.ZodString;
24
26
  }, z.core.$strip>, z.ZodObject<{
27
+ activeDeploymentId: z.ZodNullable<z.ZodString>;
25
28
  id: z.ZodString;
26
29
  name: z.ZodString;
27
30
  organizationId: z.ZodString;
@@ -33,6 +36,7 @@ export declare const projectContract: {
33
36
  }, z.core.$strip>;
34
37
  activeAutomations: z.ZodArray<z.ZodObject<{
35
38
  description: z.ZodString;
39
+ id: z.ZodString;
36
40
  identityKey: z.ZodString;
37
41
  }, z.core.$strip>>;
38
42
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
@@ -40,6 +44,7 @@ export declare const projectContract: {
40
44
  organizationId: z.ZodOptional<z.ZodString>;
41
45
  query: z.ZodOptional<z.ZodString>;
42
46
  }, z.core.$strip>>, z.ZodArray<z.ZodObject<{
47
+ activeDeploymentId: z.ZodNullable<z.ZodString>;
43
48
  id: z.ZodString;
44
49
  name: z.ZodString;
45
50
  organizationId: z.ZodString;
@@ -51,12 +56,14 @@ export declare const projectContract: {
51
56
  }, z.core.$strip>;
52
57
  activeAutomations: z.ZodArray<z.ZodObject<{
53
58
  description: z.ZodString;
59
+ id: z.ZodString;
54
60
  identityKey: z.ZodString;
55
61
  }, z.core.$strip>>;
56
62
  }, z.core.$strip>>, Record<never, never>, Record<never, never>>;
57
63
  get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
58
64
  projectId: z.ZodString;
59
65
  }, z.core.$strip>, z.ZodObject<{
66
+ activeDeploymentId: z.ZodNullable<z.ZodString>;
60
67
  id: z.ZodString;
61
68
  name: z.ZodString;
62
69
  organizationId: z.ZodString;
@@ -68,6 +75,7 @@ export declare const projectContract: {
68
75
  }, z.core.$strip>;
69
76
  activeAutomations: z.ZodArray<z.ZodObject<{
70
77
  description: z.ZodString;
78
+ id: z.ZodString;
71
79
  identityKey: z.ZodString;
72
80
  }, z.core.$strip>>;
73
81
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
package/dist/project.js CHANGED
@@ -2,6 +2,7 @@ import { oc } from "@orpc/contract";
2
2
  import { z } from "zod";
3
3
  import { reasonableNameSchema } from "./schemas.js";
4
4
  export const projectOutputSchema = z.object({
5
+ activeDeploymentId: z.string().nullable(),
5
6
  id: z.string(),
6
7
  name: z.string(),
7
8
  organizationId: z.string(),
@@ -14,6 +15,7 @@ export const projectOutputSchema = z.object({
14
15
  activeAutomations: z
15
16
  .object({
16
17
  description: z.string(),
18
+ id: z.string(),
17
19
  identityKey: z.string(),
18
20
  })
19
21
  .array(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automate.ax/api-contract",
3
- "version": "0.44.0",
3
+ "version": "0.45.0",
4
4
  "description": "Public oRPC contract for the Automate.ax API.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@ai-sdk/gateway": "^4.0.46",
30
- "@automate.ax/codec": "0.44.0",
30
+ "@automate.ax/codec": "0.45.0",
31
31
  "@orpc/contract": "1.13.14",
32
32
  "zod": "^4.3.6"
33
33
  },
@@ -0,0 +1,108 @@
1
+ import { encodableSchema } from "@automate.ax/codec"
2
+ import { oc } from "@orpc/contract"
3
+ import { z } from "zod"
4
+ import { deploymentTriggerInfoSchema } from "./deployment"
5
+
6
+ export const automationExecutionStatusSchema = z.enum([
7
+ "running",
8
+ "completed",
9
+ "failed",
10
+ ])
11
+
12
+ const EXECUTION_FAILURE_SCHEMA = z.object({
13
+ message: z.string(),
14
+ name: z.string(),
15
+ })
16
+
17
+ const EXECUTION_SUMMARY_SCHEMA = z.object({
18
+ completedAt: z.date().nullable(),
19
+ createdAt: z.date(),
20
+ eventTypes: z.string().array(),
21
+ failure: EXECUTION_FAILURE_SCHEMA.nullable(),
22
+ id: z.string(),
23
+ status: automationExecutionStatusSchema,
24
+ })
25
+
26
+ export const automationContract = {
27
+ get: oc
28
+ .input(
29
+ z.object({
30
+ automationId: z.string(),
31
+ projectId: z.string(),
32
+ }),
33
+ )
34
+ .output(
35
+ z.object({
36
+ activeDeployment: z.object({
37
+ createdAt: z.date(),
38
+ git: z
39
+ .object({
40
+ commitSha: z.string(),
41
+ dirty: z.boolean(),
42
+ repositoryUrl: z.string(),
43
+ })
44
+ .nullable(),
45
+ id: z.string(),
46
+ }),
47
+ createdAt: z.date(),
48
+ description: z.string(),
49
+ id: z.string(),
50
+ identityKey: z.string(),
51
+ triggers: deploymentTriggerInfoSchema.array(),
52
+ updatedAt: z.date(),
53
+ }),
54
+ ),
55
+ getExecution: oc
56
+ .input(
57
+ z.object({
58
+ automationId: z.string(),
59
+ executionId: z.string(),
60
+ projectId: z.string(),
61
+ }),
62
+ )
63
+ .output(
64
+ EXECUTION_SUMMARY_SCHEMA.omit({ eventTypes: true }).extend({
65
+ actions: z
66
+ .object({
67
+ completedAt: z.date().nullable(),
68
+ createdAt: z.date(),
69
+ description: z.string().nullable(),
70
+ failure: EXECUTION_FAILURE_SCHEMA.nullable(),
71
+ hasOutput: z.boolean(),
72
+ id: z.string(),
73
+ name: z.string(),
74
+ output: encodableSchema,
75
+ slot: z.number().int().nonnegative(),
76
+ status: z.enum(["pending", "succeeded", "closed", "failed"]),
77
+ })
78
+ .array(),
79
+ events: z
80
+ .object({
81
+ createdAt: z.date(),
82
+ id: z.string(),
83
+ payload: encodableSchema,
84
+ type: z.string(),
85
+ })
86
+ .array(),
87
+ outputs: z
88
+ .object({
89
+ actionInvocationId: z.string(),
90
+ createdAt: z.date(),
91
+ data: encodableSchema,
92
+ id: z.string(),
93
+ outputIndex: z.number().int().nonnegative(),
94
+ type: z.string(),
95
+ })
96
+ .array(),
97
+ }),
98
+ ),
99
+ listExecutions: oc
100
+ .input(
101
+ z.object({
102
+ automationId: z.string(),
103
+ limit: z.number().int().min(1).max(100).default(50),
104
+ projectId: z.string(),
105
+ }),
106
+ )
107
+ .output(EXECUTION_SUMMARY_SCHEMA.array()),
108
+ }
package/src/deployment.ts CHANGED
@@ -95,10 +95,12 @@ export const deploymentContract = {
95
95
  automations: z
96
96
  .object({
97
97
  description: z.string(),
98
+ id: z.string(),
98
99
  identityKey: z.string(),
99
100
  triggers: deploymentTriggerInfoSchema.array(),
100
101
  })
101
102
  .array(),
103
+ createdAt: z.date(),
102
104
  id: z.string(),
103
105
  git: GIT_SOURCE_SCHEMA.nullable(),
104
106
  job: z
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { accountContract } from "./account"
2
+ import { automationContract } from "./automation"
2
3
  import { apiKeyContract } from "./api-key"
3
4
  import { authContract } from "./auth"
4
5
  import { authorizationContract } from "./authorization"
@@ -8,6 +9,7 @@ import { orgContract } from "./org"
8
9
  import { projectContract } from "./project"
9
10
  import { runtimeContract } from "./runtime"
10
11
 
12
+ export { automationExecutionStatusSchema } from "./automation"
11
13
  export {
12
14
  AUTOMATION_SDK_VERSION,
13
15
  deploymentTriggerInfoSchema,
@@ -84,6 +86,7 @@ export const publicContract = {
84
86
  export const firstPartyContract = {
85
87
  ...publicContract,
86
88
  account: accountContract,
89
+ automation: automationContract,
87
90
  authorization: {
88
91
  beginConnection: authorizationContract.beginConnection,
89
92
  get: authorizationContract.get,
package/src/project.ts CHANGED
@@ -3,6 +3,7 @@ import { z } from "zod"
3
3
  import { reasonableNameSchema } from "./schemas"
4
4
 
5
5
  export const projectOutputSchema = z.object({
6
+ activeDeploymentId: z.string().nullable(),
6
7
  id: z.string(),
7
8
  name: z.string(),
8
9
  organizationId: z.string(),
@@ -15,6 +16,7 @@ export const projectOutputSchema = z.object({
15
16
  activeAutomations: z
16
17
  .object({
17
18
  description: z.string(),
19
+ id: z.string(),
18
20
  identityKey: z.string(),
19
21
  })
20
22
  .array(),