@automate.ax/api-contract 0.54.0 → 0.55.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 +1 -28
- package/dist/automation.js +0 -25
- package/dist/deployment.d.ts +6 -36
- package/dist/deployment.js +8 -31
- package/dist/index.d.ts +15 -71
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/automation.ts +0 -29
- package/src/deployment.ts +8 -49
- package/src/index.ts +1 -9
package/dist/automation.d.ts
CHANGED
|
@@ -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;
|
package/dist/automation.js
CHANGED
|
@@ -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(),
|
package/dist/deployment.d.ts
CHANGED
|
@@ -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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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<{
|
package/dist/deployment.js
CHANGED
|
@@ -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
|
-
|
|
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(),
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { automationExecutionStatusSchema } from "./automation.js";
|
|
2
|
-
export { AUTOMATION_SDK_VERSION
|
|
2
|
+
export { AUTOMATION_SDK_VERSION } from "./deployment.js";
|
|
3
3
|
export { integrationAccountOutputSchema } from "./account.js";
|
|
4
4
|
export { AUTOMATION_INVOCATION_DEFAULT_ENTRYPOINT, AUTOMATION_INVOCATION_RESERVED_ENTRYPOINT_PREFIX, DEFAULT_GATEWAY_MODEL_ID, automationInvocationInputSchema, automationInvocationOutputSchema, automationInvocationScheduleSchema, generationInputSchema, generationResultSchema, runtimeContract, type GenerationInput, type GenerationResult, type RuntimeGenerationInput, } from "./runtime.js";
|
|
5
5
|
export type { GatewayModelId } from "@ai-sdk/gateway";
|
|
@@ -343,33 +343,6 @@ export declare const firstPartyContract: {
|
|
|
343
343
|
}, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
344
344
|
};
|
|
345
345
|
automation: {
|
|
346
|
-
get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
347
|
-
automationId: import("zod").ZodString;
|
|
348
|
-
projectId: import("zod").ZodString;
|
|
349
|
-
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
350
|
-
activeDeployment: import("zod").ZodObject<{
|
|
351
|
-
createdAt: import("zod").ZodDate;
|
|
352
|
-
git: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
353
|
-
commitSha: import("zod").ZodString;
|
|
354
|
-
dirty: import("zod").ZodBoolean;
|
|
355
|
-
repositoryUrl: import("zod").ZodString;
|
|
356
|
-
}, import("zod/v4/core").$strip>>;
|
|
357
|
-
id: import("zod").ZodString;
|
|
358
|
-
}, import("zod/v4/core").$strip>;
|
|
359
|
-
createdAt: import("zod").ZodDate;
|
|
360
|
-
description: import("zod").ZodString;
|
|
361
|
-
id: import("zod").ZodString;
|
|
362
|
-
identityKey: import("zod").ZodString;
|
|
363
|
-
triggers: import("zod").ZodArray<import("zod").ZodObject<{
|
|
364
|
-
details: import("zod").ZodArray<import("zod").ZodObject<{
|
|
365
|
-
label: import("zod").ZodString;
|
|
366
|
-
value: import("zod").ZodString;
|
|
367
|
-
}, import("zod/v4/core").$strip>>;
|
|
368
|
-
name: import("zod").ZodString;
|
|
369
|
-
type: import("zod").ZodString;
|
|
370
|
-
}, import("zod/v4/core").$strip>>;
|
|
371
|
-
updatedAt: import("zod").ZodDate;
|
|
372
|
-
}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
373
346
|
getExecution: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
374
347
|
automationId: import("zod").ZodString;
|
|
375
348
|
executionId: import("zod").ZodString;
|
|
@@ -381,8 +354,8 @@ export declare const firstPartyContract: {
|
|
|
381
354
|
running: "running";
|
|
382
355
|
completed: "completed";
|
|
383
356
|
}>;
|
|
384
|
-
createdAt: import("zod").ZodDate;
|
|
385
357
|
completedAt: import("zod").ZodNullable<import("zod").ZodDate>;
|
|
358
|
+
createdAt: import("zod").ZodDate;
|
|
386
359
|
failure: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
387
360
|
message: import("zod").ZodString;
|
|
388
361
|
name: import("zod").ZodString;
|
|
@@ -519,6 +492,7 @@ export declare const firstPartyContract: {
|
|
|
519
492
|
git: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
520
493
|
commitSha: import("zod").ZodString;
|
|
521
494
|
dirty: import("zod").ZodBoolean;
|
|
495
|
+
projectPath: import("zod").ZodString;
|
|
522
496
|
repositoryUrl: import("zod").ZodString;
|
|
523
497
|
}, import("zod/v4/core").$strip>>;
|
|
524
498
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -549,13 +523,10 @@ export declare const firstPartyContract: {
|
|
|
549
523
|
description: import("zod").ZodString;
|
|
550
524
|
id: import("zod").ZodString;
|
|
551
525
|
identityKey: import("zod").ZodString;
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
}, import("zod/v4/core").$strip>>;
|
|
557
|
-
name: import("zod").ZodString;
|
|
558
|
-
type: import("zod").ZodString;
|
|
526
|
+
subscriptions: import("zod").ZodArray<import("zod").ZodObject<{
|
|
527
|
+
config: import("zod").ZodJSONSchema;
|
|
528
|
+
eventType: import("zod").ZodString;
|
|
529
|
+
hookSlot: import("zod").ZodNumber;
|
|
559
530
|
}, import("zod/v4/core").$strip>>;
|
|
560
531
|
}, import("zod/v4/core").$strip>>;
|
|
561
532
|
createdAt: import("zod").ZodDate;
|
|
@@ -563,6 +534,7 @@ export declare const firstPartyContract: {
|
|
|
563
534
|
git: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
564
535
|
commitSha: import("zod").ZodString;
|
|
565
536
|
dirty: import("zod").ZodBoolean;
|
|
537
|
+
projectPath: import("zod").ZodString;
|
|
566
538
|
repositoryUrl: import("zod").ZodString;
|
|
567
539
|
}, import("zod/v4/core").$strip>>;
|
|
568
540
|
job: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
@@ -1644,33 +1616,6 @@ export declare const contract: {
|
|
|
1644
1616
|
}, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
1645
1617
|
};
|
|
1646
1618
|
automation: {
|
|
1647
|
-
get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
1648
|
-
automationId: import("zod").ZodString;
|
|
1649
|
-
projectId: import("zod").ZodString;
|
|
1650
|
-
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
1651
|
-
activeDeployment: import("zod").ZodObject<{
|
|
1652
|
-
createdAt: import("zod").ZodDate;
|
|
1653
|
-
git: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
1654
|
-
commitSha: import("zod").ZodString;
|
|
1655
|
-
dirty: import("zod").ZodBoolean;
|
|
1656
|
-
repositoryUrl: import("zod").ZodString;
|
|
1657
|
-
}, import("zod/v4/core").$strip>>;
|
|
1658
|
-
id: import("zod").ZodString;
|
|
1659
|
-
}, import("zod/v4/core").$strip>;
|
|
1660
|
-
createdAt: import("zod").ZodDate;
|
|
1661
|
-
description: import("zod").ZodString;
|
|
1662
|
-
id: import("zod").ZodString;
|
|
1663
|
-
identityKey: import("zod").ZodString;
|
|
1664
|
-
triggers: import("zod").ZodArray<import("zod").ZodObject<{
|
|
1665
|
-
details: import("zod").ZodArray<import("zod").ZodObject<{
|
|
1666
|
-
label: import("zod").ZodString;
|
|
1667
|
-
value: import("zod").ZodString;
|
|
1668
|
-
}, import("zod/v4/core").$strip>>;
|
|
1669
|
-
name: import("zod").ZodString;
|
|
1670
|
-
type: import("zod").ZodString;
|
|
1671
|
-
}, import("zod/v4/core").$strip>>;
|
|
1672
|
-
updatedAt: import("zod").ZodDate;
|
|
1673
|
-
}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
1674
1619
|
getExecution: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
1675
1620
|
automationId: import("zod").ZodString;
|
|
1676
1621
|
executionId: import("zod").ZodString;
|
|
@@ -1682,8 +1627,8 @@ export declare const contract: {
|
|
|
1682
1627
|
running: "running";
|
|
1683
1628
|
completed: "completed";
|
|
1684
1629
|
}>;
|
|
1685
|
-
createdAt: import("zod").ZodDate;
|
|
1686
1630
|
completedAt: import("zod").ZodNullable<import("zod").ZodDate>;
|
|
1631
|
+
createdAt: import("zod").ZodDate;
|
|
1687
1632
|
failure: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
1688
1633
|
message: import("zod").ZodString;
|
|
1689
1634
|
name: import("zod").ZodString;
|
|
@@ -1763,6 +1708,7 @@ export declare const contract: {
|
|
|
1763
1708
|
git: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
1764
1709
|
commitSha: import("zod").ZodString;
|
|
1765
1710
|
dirty: import("zod").ZodBoolean;
|
|
1711
|
+
projectPath: import("zod").ZodString;
|
|
1766
1712
|
repositoryUrl: import("zod").ZodString;
|
|
1767
1713
|
}, import("zod/v4/core").$strip>>;
|
|
1768
1714
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -1793,13 +1739,10 @@ export declare const contract: {
|
|
|
1793
1739
|
description: import("zod").ZodString;
|
|
1794
1740
|
id: import("zod").ZodString;
|
|
1795
1741
|
identityKey: import("zod").ZodString;
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
}, import("zod/v4/core").$strip>>;
|
|
1801
|
-
name: import("zod").ZodString;
|
|
1802
|
-
type: import("zod").ZodString;
|
|
1742
|
+
subscriptions: import("zod").ZodArray<import("zod").ZodObject<{
|
|
1743
|
+
config: import("zod").ZodJSONSchema;
|
|
1744
|
+
eventType: import("zod").ZodString;
|
|
1745
|
+
hookSlot: import("zod").ZodNumber;
|
|
1803
1746
|
}, import("zod/v4/core").$strip>>;
|
|
1804
1747
|
}, import("zod/v4/core").$strip>>;
|
|
1805
1748
|
createdAt: import("zod").ZodDate;
|
|
@@ -1807,6 +1750,7 @@ export declare const contract: {
|
|
|
1807
1750
|
git: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
1808
1751
|
commitSha: import("zod").ZodString;
|
|
1809
1752
|
dirty: import("zod").ZodBoolean;
|
|
1753
|
+
projectPath: import("zod").ZodString;
|
|
1810
1754
|
repositoryUrl: import("zod").ZodString;
|
|
1811
1755
|
}, import("zod/v4/core").$strip>>;
|
|
1812
1756
|
job: import("zod").ZodNullable<import("zod").ZodObject<{
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { orgContract } from "./org.js";
|
|
|
9
9
|
import { projectContract } from "./project.js";
|
|
10
10
|
import { runtimeContract } from "./runtime.js";
|
|
11
11
|
export { automationExecutionStatusSchema } from "./automation.js";
|
|
12
|
-
export { AUTOMATION_SDK_VERSION
|
|
12
|
+
export { AUTOMATION_SDK_VERSION } from "./deployment.js";
|
|
13
13
|
export { integrationAccountOutputSchema } from "./account.js";
|
|
14
14
|
export { AUTOMATION_INVOCATION_DEFAULT_ENTRYPOINT, AUTOMATION_INVOCATION_RESERVED_ENTRYPOINT_PREFIX, DEFAULT_GATEWAY_MODEL_ID, automationInvocationInputSchema, automationInvocationOutputSchema, automationInvocationScheduleSchema, generationInputSchema, generationResultSchema, runtimeContract, } from "./runtime.js";
|
|
15
15
|
export { createdOrganizationApiKeyOutputSchema, organizationApiKeyOutputSchema, } from "./api-key.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automate.ax/api-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.55.0",
|
|
4
4
|
"description": "Public oRPC contract for the Automate.ax API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@ai-sdk/gateway": "^4.0.46",
|
|
31
|
-
"@automate.ax/codec": "0.
|
|
31
|
+
"@automate.ax/codec": "0.55.0",
|
|
32
32
|
"@orpc/contract": "1.15.0",
|
|
33
33
|
"zod": "^4.3.6"
|
|
34
34
|
},
|
package/src/automation.ts
CHANGED
|
@@ -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"
|
|
5
4
|
|
|
6
5
|
export const automationExecutionStatusSchema = z.enum([
|
|
7
6
|
"running",
|
|
@@ -24,34 +23,6 @@ const EXECUTION_SUMMARY_SCHEMA = z.object({
|
|
|
24
23
|
})
|
|
25
24
|
|
|
26
25
|
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
26
|
getExecution: oc
|
|
56
27
|
.input(
|
|
57
28
|
z.object({
|
package/src/deployment.ts
CHANGED
|
@@ -4,54 +4,6 @@ import { z } from "zod"
|
|
|
4
4
|
/** SDK compatibility version used to select the immutable runtime image. */
|
|
5
5
|
export const AUTOMATION_SDK_VERSION = "2"
|
|
6
6
|
|
|
7
|
-
export type HttpTriggerScope = "trigger" | "automation" | "project"
|
|
8
|
-
|
|
9
|
-
export interface HttpTriggerEndpointOptions {
|
|
10
|
-
appOrigin: string
|
|
11
|
-
automationId: string
|
|
12
|
-
hookSlot: number
|
|
13
|
-
projectId: string
|
|
14
|
-
scope: HttpTriggerScope
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Returns the public URL for one deployed HTTP trigger.
|
|
19
|
-
*
|
|
20
|
-
* @param options - Public origin and trigger identity.
|
|
21
|
-
*/
|
|
22
|
-
export function getHttpTriggerEndpoint(options: HttpTriggerEndpointOptions) {
|
|
23
|
-
return new URL(
|
|
24
|
-
`/x/${getHttpTriggerEndpointKey(options)}/`,
|
|
25
|
-
options.appOrigin,
|
|
26
|
-
).toString()
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Returns the durable endpoint identity for one configured HTTP scope.
|
|
31
|
-
*
|
|
32
|
-
* @param options - Trigger and owning resource identity.
|
|
33
|
-
*/
|
|
34
|
-
export function getHttpTriggerEndpointKey(
|
|
35
|
-
options: Omit<HttpTriggerEndpointOptions, "appOrigin">,
|
|
36
|
-
) {
|
|
37
|
-
if (options.scope === "project") return options.projectId
|
|
38
|
-
if (options.scope === "automation") return options.automationId
|
|
39
|
-
return `${options.automationId}:${options.hookSlot}`
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const deploymentTriggerInfoSchema = z.object({
|
|
43
|
-
details: z
|
|
44
|
-
.object({
|
|
45
|
-
label: z.string(),
|
|
46
|
-
value: z.string(),
|
|
47
|
-
})
|
|
48
|
-
.array(),
|
|
49
|
-
name: z.string(),
|
|
50
|
-
type: z.string(),
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
export type DeploymentTriggerInfo = z.infer<typeof deploymentTriggerInfoSchema>
|
|
54
|
-
|
|
55
7
|
const DEPLOYMENT_STATUS_SCHEMA = z.enum([
|
|
56
8
|
"planning",
|
|
57
9
|
"awaiting_authorization",
|
|
@@ -74,6 +26,7 @@ const DEPLOYMENT_IN_PROGRESS_ERROR = {
|
|
|
74
26
|
const GIT_SOURCE_SCHEMA = z.object({
|
|
75
27
|
commitSha: z.string().regex(/^[0-9a-f]{40}(?:[0-9a-f]{24})?$/),
|
|
76
28
|
dirty: z.boolean(),
|
|
29
|
+
projectPath: z.string(),
|
|
77
30
|
repositoryUrl: z.string().min(1),
|
|
78
31
|
})
|
|
79
32
|
|
|
@@ -132,7 +85,13 @@ export const deploymentContract = {
|
|
|
132
85
|
description: z.string(),
|
|
133
86
|
id: z.string(),
|
|
134
87
|
identityKey: z.string(),
|
|
135
|
-
|
|
88
|
+
subscriptions: z
|
|
89
|
+
.object({
|
|
90
|
+
config: z.json(),
|
|
91
|
+
eventType: z.string(),
|
|
92
|
+
hookSlot: z.number().int().nonnegative(),
|
|
93
|
+
})
|
|
94
|
+
.array(),
|
|
136
95
|
})
|
|
137
96
|
.array(),
|
|
138
97
|
createdAt: z.date(),
|
package/src/index.ts
CHANGED
|
@@ -10,15 +10,7 @@ import { projectContract } from "./project"
|
|
|
10
10
|
import { runtimeContract } from "./runtime"
|
|
11
11
|
|
|
12
12
|
export { automationExecutionStatusSchema } from "./automation"
|
|
13
|
-
export {
|
|
14
|
-
AUTOMATION_SDK_VERSION,
|
|
15
|
-
deploymentTriggerInfoSchema,
|
|
16
|
-
getHttpTriggerEndpoint,
|
|
17
|
-
getHttpTriggerEndpointKey,
|
|
18
|
-
type DeploymentTriggerInfo,
|
|
19
|
-
type HttpTriggerEndpointOptions,
|
|
20
|
-
type HttpTriggerScope,
|
|
21
|
-
} from "./deployment"
|
|
13
|
+
export { AUTOMATION_SDK_VERSION } from "./deployment"
|
|
22
14
|
export { integrationAccountOutputSchema } from "./account"
|
|
23
15
|
export {
|
|
24
16
|
AUTOMATION_INVOCATION_DEFAULT_ENTRYPOINT,
|