@automate.ax/api-contract 0.50.0 → 0.50.2
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 +21 -1
- package/dist/deployment.js +21 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.js +1 -1
- package/dist/runtime.d.ts +15 -4
- package/dist/runtime.js +11 -1
- package/package.json +2 -2
- package/src/deployment.ts +36 -1
- package/src/index.ts +4 -0
- package/src/runtime.ts +13 -1
package/dist/deployment.d.ts
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
/** SDK compatibility version used to select the immutable runtime image. */
|
|
3
|
-
export declare const AUTOMATION_SDK_VERSION = "
|
|
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;
|
|
4
24
|
export declare const deploymentTriggerInfoSchema: z.ZodObject<{
|
|
5
25
|
details: z.ZodArray<z.ZodObject<{
|
|
6
26
|
label: z.ZodString;
|
package/dist/deployment.js
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
/** SDK compatibility version used to select the immutable runtime image. */
|
|
4
|
-
export const AUTOMATION_SDK_VERSION = "
|
|
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
|
+
}
|
|
5
25
|
export const deploymentTriggerInfoSchema = z.object({
|
|
6
26
|
details: z
|
|
7
27
|
.object({
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { automationExecutionStatusSchema } from "./automation.js";
|
|
2
|
-
export { AUTOMATION_SDK_VERSION, deploymentTriggerInfoSchema, type DeploymentTriggerInfo, } from "./deployment.js";
|
|
2
|
+
export { AUTOMATION_SDK_VERSION, deploymentTriggerInfoSchema, getHttpTriggerEndpoint, getHttpTriggerEndpointKey, type DeploymentTriggerInfo, type HttpTriggerEndpointOptions, type HttpTriggerScope, } 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";
|
|
@@ -1420,6 +1420,7 @@ export declare const contract: {
|
|
|
1420
1420
|
eventDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
1421
1421
|
signalDependencyIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
1422
1422
|
slot: import("zod").ZodNumber;
|
|
1423
|
+
continueFrom: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1423
1424
|
key: import("zod").ZodOptional<import("zod").ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
|
|
1424
1425
|
outcomeSeq: import("zod").ZodNumber;
|
|
1425
1426
|
streamName: import("zod").ZodString;
|
|
@@ -1576,11 +1577,16 @@ export declare const contract: {
|
|
|
1576
1577
|
type: import("zod").ZodLiteral<"other">;
|
|
1577
1578
|
}, import("zod/v4/core").$strip>], "type">>>;
|
|
1578
1579
|
}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
|
1579
|
-
invokeAutomation: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodIntersection<import("zod").ZodObject<{
|
|
1580
|
-
automationName: import("zod").ZodString;
|
|
1580
|
+
invokeAutomation: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodIntersection<import("zod").ZodIntersection<import("zod").ZodObject<{
|
|
1581
1581
|
entrypoint: import("zod").ZodDefault<import("zod").ZodString>;
|
|
1582
1582
|
payload: import("zod").ZodOptional<import("zod").ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
|
|
1583
1583
|
}, import("zod/v4/core").$strip>, import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
1584
|
+
automationId: import("zod").ZodString;
|
|
1585
|
+
automationName: import("zod").ZodOptional<import("zod").ZodNever>;
|
|
1586
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
1587
|
+
automationId: import("zod").ZodOptional<import("zod").ZodNever>;
|
|
1588
|
+
automationName: import("zod").ZodString;
|
|
1589
|
+
}, import("zod/v4/core").$strip>]>>, import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
1584
1590
|
runAt: import("zod").ZodUnion<readonly [import("zod").ZodDate, import("zod").ZodString, import("zod").ZodNumber]>;
|
|
1585
1591
|
runIn: import("zod").ZodOptional<import("zod").ZodNever>;
|
|
1586
1592
|
}, import("zod/v4/core").$strip>, 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, deploymentTriggerInfoSchema, } from "./deployment.js";
|
|
12
|
+
export { AUTOMATION_SDK_VERSION, deploymentTriggerInfoSchema, getHttpTriggerEndpoint, getHttpTriggerEndpointKey, } 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/dist/runtime.d.ts
CHANGED
|
@@ -19,11 +19,16 @@ export declare const automationInvocationOutputSchema: z.ZodObject<{
|
|
|
19
19
|
id: z.ZodString;
|
|
20
20
|
runAt: z.ZodDate;
|
|
21
21
|
}, z.core.$strip>;
|
|
22
|
-
export declare const automationInvocationInputSchema: z.ZodIntersection<z.ZodObject<{
|
|
23
|
-
automationName: z.ZodString;
|
|
22
|
+
export declare const automationInvocationInputSchema: z.ZodIntersection<z.ZodIntersection<z.ZodObject<{
|
|
24
23
|
entrypoint: z.ZodDefault<z.ZodString>;
|
|
25
24
|
payload: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
|
|
26
25
|
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
|
|
26
|
+
automationId: z.ZodString;
|
|
27
|
+
automationName: z.ZodOptional<z.ZodNever>;
|
|
28
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
29
|
+
automationId: z.ZodOptional<z.ZodNever>;
|
|
30
|
+
automationName: z.ZodString;
|
|
31
|
+
}, z.core.$strip>]>>, z.ZodUnion<readonly [z.ZodObject<{
|
|
27
32
|
runAt: z.ZodUnion<readonly [z.ZodDate, z.ZodString, z.ZodNumber]>;
|
|
28
33
|
runIn: z.ZodOptional<z.ZodNever>;
|
|
29
34
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -223,6 +228,7 @@ export declare const runtimeContract: {
|
|
|
223
228
|
eventDependencyIds: z.ZodArray<z.ZodString>;
|
|
224
229
|
signalDependencyIds: z.ZodArray<z.ZodString>;
|
|
225
230
|
slot: z.ZodNumber;
|
|
231
|
+
continueFrom: z.ZodOptional<z.ZodString>;
|
|
226
232
|
key: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
|
|
227
233
|
outcomeSeq: z.ZodNumber;
|
|
228
234
|
streamName: z.ZodString;
|
|
@@ -379,11 +385,16 @@ export declare const runtimeContract: {
|
|
|
379
385
|
type: z.ZodLiteral<"other">;
|
|
380
386
|
}, z.core.$strip>], "type">>>;
|
|
381
387
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
382
|
-
invokeAutomation: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodIntersection<z.ZodObject<{
|
|
383
|
-
automationName: z.ZodString;
|
|
388
|
+
invokeAutomation: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodIntersection<z.ZodIntersection<z.ZodObject<{
|
|
384
389
|
entrypoint: z.ZodDefault<z.ZodString>;
|
|
385
390
|
payload: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
|
|
386
391
|
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
|
|
392
|
+
automationId: z.ZodString;
|
|
393
|
+
automationName: z.ZodOptional<z.ZodNever>;
|
|
394
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
395
|
+
automationId: z.ZodOptional<z.ZodNever>;
|
|
396
|
+
automationName: z.ZodString;
|
|
397
|
+
}, z.core.$strip>]>>, z.ZodUnion<readonly [z.ZodObject<{
|
|
387
398
|
runAt: z.ZodUnion<readonly [z.ZodDate, z.ZodString, z.ZodNumber]>;
|
|
388
399
|
runIn: z.ZodOptional<z.ZodNever>;
|
|
389
400
|
}, z.core.$strip>, z.ZodObject<{
|
package/dist/runtime.js
CHANGED
|
@@ -41,13 +41,22 @@ export const automationInvocationOutputSchema = z.object({
|
|
|
41
41
|
});
|
|
42
42
|
export const automationInvocationInputSchema = z
|
|
43
43
|
.object({
|
|
44
|
-
automationName: z.string().min(1),
|
|
45
44
|
entrypoint: z
|
|
46
45
|
.string()
|
|
47
46
|
.min(1)
|
|
48
47
|
.default(AUTOMATION_INVOCATION_DEFAULT_ENTRYPOINT),
|
|
49
48
|
payload: encodableSchema,
|
|
50
49
|
})
|
|
50
|
+
.and(z.union([
|
|
51
|
+
z.object({
|
|
52
|
+
automationId: z.string().min(1),
|
|
53
|
+
automationName: z.never().optional(),
|
|
54
|
+
}),
|
|
55
|
+
z.object({
|
|
56
|
+
automationId: z.never().optional(),
|
|
57
|
+
automationName: z.string().min(1),
|
|
58
|
+
}),
|
|
59
|
+
]))
|
|
51
60
|
.and(automationInvocationScheduleSchema);
|
|
52
61
|
const ACTION_INVOCATION_BASE_SCHEMA = z.object({
|
|
53
62
|
actionDependencyIds: z.string().array(),
|
|
@@ -103,6 +112,7 @@ const SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA = z.object({
|
|
|
103
112
|
slot: z.number().int().nonnegative(),
|
|
104
113
|
});
|
|
105
114
|
const CORRELATION_ENTRY_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
115
|
+
continueFrom: z.string().min(1).optional(),
|
|
106
116
|
key: encodableSchema,
|
|
107
117
|
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
108
118
|
streamName: z.string().min(1),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automate.ax/api-contract",
|
|
3
|
-
"version": "0.50.
|
|
3
|
+
"version": "0.50.2",
|
|
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.50.
|
|
31
|
+
"@automate.ax/codec": "0.50.2",
|
|
32
32
|
"@orpc/contract": "1.15.0",
|
|
33
33
|
"zod": "^4.3.6"
|
|
34
34
|
},
|
package/src/deployment.ts
CHANGED
|
@@ -2,7 +2,42 @@ import { oc } from "@orpc/contract"
|
|
|
2
2
|
import { z } from "zod"
|
|
3
3
|
|
|
4
4
|
/** SDK compatibility version used to select the immutable runtime image. */
|
|
5
|
-
export const AUTOMATION_SDK_VERSION = "
|
|
5
|
+
export const AUTOMATION_SDK_VERSION = "2"
|
|
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
|
+
}
|
|
6
41
|
|
|
7
42
|
export const deploymentTriggerInfoSchema = z.object({
|
|
8
43
|
details: z
|
package/src/index.ts
CHANGED
|
@@ -13,7 +13,11 @@ export { automationExecutionStatusSchema } from "./automation"
|
|
|
13
13
|
export {
|
|
14
14
|
AUTOMATION_SDK_VERSION,
|
|
15
15
|
deploymentTriggerInfoSchema,
|
|
16
|
+
getHttpTriggerEndpoint,
|
|
17
|
+
getHttpTriggerEndpointKey,
|
|
16
18
|
type DeploymentTriggerInfo,
|
|
19
|
+
type HttpTriggerEndpointOptions,
|
|
20
|
+
type HttpTriggerScope,
|
|
17
21
|
} from "./deployment"
|
|
18
22
|
export { integrationAccountOutputSchema } from "./account"
|
|
19
23
|
export {
|
package/src/runtime.ts
CHANGED
|
@@ -50,13 +50,24 @@ export const automationInvocationOutputSchema = z.object({
|
|
|
50
50
|
|
|
51
51
|
export const automationInvocationInputSchema = z
|
|
52
52
|
.object({
|
|
53
|
-
automationName: z.string().min(1),
|
|
54
53
|
entrypoint: z
|
|
55
54
|
.string()
|
|
56
55
|
.min(1)
|
|
57
56
|
.default(AUTOMATION_INVOCATION_DEFAULT_ENTRYPOINT),
|
|
58
57
|
payload: encodableSchema,
|
|
59
58
|
})
|
|
59
|
+
.and(
|
|
60
|
+
z.union([
|
|
61
|
+
z.object({
|
|
62
|
+
automationId: z.string().min(1),
|
|
63
|
+
automationName: z.never().optional(),
|
|
64
|
+
}),
|
|
65
|
+
z.object({
|
|
66
|
+
automationId: z.never().optional(),
|
|
67
|
+
automationName: z.string().min(1),
|
|
68
|
+
}),
|
|
69
|
+
]),
|
|
70
|
+
)
|
|
60
71
|
.and(automationInvocationScheduleSchema)
|
|
61
72
|
|
|
62
73
|
const ACTION_INVOCATION_BASE_SCHEMA = z.object({
|
|
@@ -118,6 +129,7 @@ const SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA = z.object({
|
|
|
118
129
|
})
|
|
119
130
|
|
|
120
131
|
const CORRELATION_ENTRY_SCHEMA = SIGNAL_INVOCATION_DEPENDENCIES_SCHEMA.extend({
|
|
132
|
+
continueFrom: z.string().min(1).optional(),
|
|
121
133
|
key: encodableSchema,
|
|
122
134
|
outcomeSeq: OUTCOME_SEQUENCE_SCHEMA,
|
|
123
135
|
streamName: z.string().min(1),
|