@automate.ax/api-contract 0.54.0 → 0.56.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.
@@ -5,33 +5,6 @@ export declare const automationExecutionStatusSchema: z.ZodEnum<{
5
5
  completed: "completed";
6
6
  }>;
7
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
8
  getExecution: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
36
9
  automationId: z.ZodString;
37
10
  executionId: z.ZodString;
@@ -43,8 +16,8 @@ export declare const automationContract: {
43
16
  running: "running";
44
17
  completed: "completed";
45
18
  }>;
46
- createdAt: z.ZodDate;
47
19
  completedAt: z.ZodNullable<z.ZodDate>;
20
+ createdAt: z.ZodDate;
48
21
  failure: z.ZodNullable<z.ZodObject<{
49
22
  message: z.ZodString;
50
23
  name: z.ZodString;
@@ -1,7 +1,6 @@
1
1
  import { encodableSchema } from "@automate.ax/codec";
2
2
  import { oc } from "@orpc/contract";
3
3
  import { z } from "zod";
4
- import { deploymentTriggerInfoSchema } from "./deployment.js";
5
4
  export const automationExecutionStatusSchema = z.enum([
6
5
  "running",
7
6
  "completed",
@@ -20,30 +19,6 @@ const EXECUTION_SUMMARY_SCHEMA = z.object({
20
19
  status: automationExecutionStatusSchema,
21
20
  });
22
21
  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
22
  getExecution: oc
48
23
  .input(z.object({
49
24
  automationId: z.string(),
@@ -1,35 +1,6 @@
1
1
  import { z } from "zod";
2
2
  /** SDK compatibility version used to select the immutable runtime image. */
3
3
  export declare const AUTOMATION_SDK_VERSION = "2";
4
- export type HttpTriggerScope = "trigger" | "automation" | "project";
5
- export interface HttpTriggerEndpointOptions {
6
- appOrigin: string;
7
- automationId: string;
8
- hookSlot: number;
9
- projectId: string;
10
- scope: HttpTriggerScope;
11
- }
12
- /**
13
- * Returns the public URL for one deployed HTTP trigger.
14
- *
15
- * @param options - Public origin and trigger identity.
16
- */
17
- export declare function getHttpTriggerEndpoint(options: HttpTriggerEndpointOptions): string;
18
- /**
19
- * Returns the durable endpoint identity for one configured HTTP scope.
20
- *
21
- * @param options - Trigger and owning resource identity.
22
- */
23
- export declare function getHttpTriggerEndpointKey(options: Omit<HttpTriggerEndpointOptions, "appOrigin">): string;
24
- export declare const deploymentTriggerInfoSchema: z.ZodObject<{
25
- details: z.ZodArray<z.ZodObject<{
26
- label: z.ZodString;
27
- value: z.ZodString;
28
- }, z.core.$strip>>;
29
- name: z.ZodString;
30
- type: z.ZodString;
31
- }, z.core.$strip>;
32
- export type DeploymentTriggerInfo = z.infer<typeof deploymentTriggerInfoSchema>;
33
4
  export declare const deploymentContract: {
34
5
  cancel: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
35
6
  deploymentId: z.ZodString;
@@ -50,6 +21,7 @@ export declare const deploymentContract: {
50
21
  git: z.ZodOptional<z.ZodObject<{
51
22
  commitSha: z.ZodString;
52
23
  dirty: z.ZodBoolean;
24
+ projectPath: z.ZodString;
53
25
  repositoryUrl: z.ZodString;
54
26
  }, z.core.$strip>>;
55
27
  }, z.core.$strip>, z.ZodObject<{
@@ -80,13 +52,10 @@ export declare const deploymentContract: {
80
52
  description: z.ZodString;
81
53
  id: z.ZodString;
82
54
  identityKey: z.ZodString;
83
- triggers: z.ZodArray<z.ZodObject<{
84
- details: z.ZodArray<z.ZodObject<{
85
- label: z.ZodString;
86
- value: z.ZodString;
87
- }, z.core.$strip>>;
88
- name: z.ZodString;
89
- type: z.ZodString;
55
+ subscriptions: z.ZodArray<z.ZodObject<{
56
+ config: z.ZodJSONSchema;
57
+ eventType: z.ZodString;
58
+ hookSlot: z.ZodNumber;
90
59
  }, z.core.$strip>>;
91
60
  }, z.core.$strip>>;
92
61
  createdAt: z.ZodDate;
@@ -94,6 +63,7 @@ export declare const deploymentContract: {
94
63
  git: z.ZodNullable<z.ZodObject<{
95
64
  commitSha: z.ZodString;
96
65
  dirty: z.ZodBoolean;
66
+ projectPath: z.ZodString;
97
67
  repositoryUrl: z.ZodString;
98
68
  }, z.core.$strip>>;
99
69
  job: z.ZodNullable<z.ZodObject<{
@@ -2,36 +2,6 @@ import { oc } from "@orpc/contract";
2
2
  import { z } from "zod";
3
3
  /** SDK compatibility version used to select the immutable runtime image. */
4
4
  export const AUTOMATION_SDK_VERSION = "2";
5
- /**
6
- * Returns the public URL for one deployed HTTP trigger.
7
- *
8
- * @param options - Public origin and trigger identity.
9
- */
10
- export function getHttpTriggerEndpoint(options) {
11
- return new URL(`/x/${getHttpTriggerEndpointKey(options)}/`, options.appOrigin).toString();
12
- }
13
- /**
14
- * Returns the durable endpoint identity for one configured HTTP scope.
15
- *
16
- * @param options - Trigger and owning resource identity.
17
- */
18
- export function getHttpTriggerEndpointKey(options) {
19
- if (options.scope === "project")
20
- return options.projectId;
21
- if (options.scope === "automation")
22
- return options.automationId;
23
- return `${options.automationId}:${options.hookSlot}`;
24
- }
25
- export const deploymentTriggerInfoSchema = z.object({
26
- details: z
27
- .object({
28
- label: z.string(),
29
- value: z.string(),
30
- })
31
- .array(),
32
- name: z.string(),
33
- type: z.string(),
34
- });
35
5
  const DEPLOYMENT_STATUS_SCHEMA = z.enum([
36
6
  "planning",
37
7
  "awaiting_authorization",
@@ -52,6 +22,7 @@ const DEPLOYMENT_IN_PROGRESS_ERROR = {
52
22
  const GIT_SOURCE_SCHEMA = z.object({
53
23
  commitSha: z.string().regex(/^[0-9a-f]{40}(?:[0-9a-f]{24})?$/),
54
24
  dirty: z.boolean(),
25
+ projectPath: z.string(),
55
26
  repositoryUrl: z.string().min(1),
56
27
  });
57
28
  export const deploymentContract = {
@@ -101,7 +72,13 @@ export const deploymentContract = {
101
72
  description: z.string(),
102
73
  id: z.string(),
103
74
  identityKey: z.string(),
104
- triggers: deploymentTriggerInfoSchema.array(),
75
+ subscriptions: z
76
+ .object({
77
+ config: z.json(),
78
+ eventType: z.string(),
79
+ hookSlot: z.number().int().nonnegative(),
80
+ })
81
+ .array(),
105
82
  })
106
83
  .array(),
107
84
  createdAt: z.date(),