@automate.ax/api-contract 0.143.8 → 0.144.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.
@@ -1,4 +1,5 @@
1
1
  import { oc } from "@orpc/contract";
2
+ import { DASHBOARD_RUN_FIELDS_SCHEMA } from "@automate.ax/catalog";
2
3
  import * as z from "zod";
3
4
  import { AUTOMATION_RUNTIME_PROTOCOL_VERSION } from "./runtime-protocol.js";
4
5
  import { cursorPageOutputSchema, cursorPaginationInputSchema } from "./schemas.js";
@@ -45,6 +46,25 @@ const DEPLOYMENT_AUTHORIZATION_SCHEMA = z.object({
45
46
  .array(),
46
47
  url: z.url(),
47
48
  });
49
+ const DEPLOYMENT_PARAMETER_VALUE_SCHEMA = z.object({
50
+ automationId: z.string(),
51
+ name: z.string().min(1),
52
+ value: z.base64(),
53
+ });
54
+ const DEPLOYMENT_PARAMETER_VALUES_SCHEMA = DEPLOYMENT_PARAMETER_VALUE_SCHEMA.array().superRefine((parameters, context) => {
55
+ const keys = new Set();
56
+ for (const [index, parameter] of parameters.entries()) {
57
+ const key = JSON.stringify([parameter.automationId, parameter.name]);
58
+ if (keys.has(key)) {
59
+ context.addIssue({
60
+ code: "custom",
61
+ message: "Automation parameter assignments must be unique.",
62
+ path: [index],
63
+ });
64
+ }
65
+ keys.add(key);
66
+ }
67
+ });
48
68
  export const deploymentOutputSchema = z.object({
49
69
  authorization: DEPLOYMENT_AUTHORIZATION_SCHEMA.nullable(),
50
70
  automations: z
@@ -52,6 +72,9 @@ export const deploymentOutputSchema = z.object({
52
72
  description: z.string(),
53
73
  id: z.string(),
54
74
  identityKey: z.string(),
75
+ parameterIssues: z.string().array().optional(),
76
+ parameters: z.optional(DASHBOARD_RUN_FIELDS_SCHEMA),
77
+ parameterValues: z.record(z.string(), z.base64()).optional(),
55
78
  scopes: z
56
79
  .object({
57
80
  name: z.string().optional(),
@@ -96,6 +119,20 @@ export const deploymentContract = {
96
119
  })
97
120
  .input(z.object({ deploymentId: z.string() }))
98
121
  .output(z.void()),
122
+ configureParameters: oc
123
+ .route({
124
+ method: "PUT",
125
+ path: "/deployments/{deploymentId}/parameters",
126
+ operationId: "configureDeploymentParameters",
127
+ summary: "Configure automation parameters",
128
+ description: "Assigns every unresolved automation parameter and resumes project planning.",
129
+ tags: ["Deployments"],
130
+ })
131
+ .input(z.object({
132
+ deploymentId: z.string(),
133
+ values: DEPLOYMENT_PARAMETER_VALUES_SCHEMA,
134
+ }))
135
+ .output(z.object({ txid: z.number().int().nonnegative() })),
99
136
  create: oc
100
137
  .errors({
101
138
  DEPLOYMENT_IN_PROGRESS: DEPLOYMENT_IN_PROGRESS_ERROR,
@@ -205,6 +242,7 @@ export const deploymentContract = {
205
242
  keys.add(key);
206
243
  }
207
244
  }),
245
+ parameters: DEPLOYMENT_PARAMETER_VALUES_SCHEMA.default([]),
208
246
  projectId: z.string(),
209
247
  }))
210
248
  .output(z.object({ id: z.string(), txid: z.number().int().nonnegative() })),
@@ -0,0 +1,16 @@
1
+ import * as z from "zod";
2
+ export declare const calendlyEventsContract: {
3
+ calendlyEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
4
+ event: z.ZodEnum<{
5
+ "event_type.created": "event_type.created";
6
+ "event_type.deleted": "event_type.deleted";
7
+ "event_type.updated": "event_type.updated";
8
+ "invitee.canceled": "invitee.canceled";
9
+ "invitee.created": "invitee.created";
10
+ "invitee_no_show.created": "invitee_no_show.created";
11
+ "invitee_no_show.deleted": "invitee_no_show.deleted";
12
+ "routing_form_submission.created": "routing_form_submission.created";
13
+ }>;
14
+ sourceId: z.ZodString;
15
+ }, z.core.$loose>, z.ZodVoid, Record<never, never>, Record<never, never>>;
16
+ };
@@ -0,0 +1,20 @@
1
+ import { oc } from "@orpc/contract";
2
+ import { CALENDLY_PROVIDER_EVENT_NAME_SCHEMA } from "@automate.ax/integration-contracts/calendly";
3
+ import * as z from "zod";
4
+ export const calendlyEventsContract = {
5
+ calendlyEvent: oc
6
+ .route({
7
+ description: "Receives and authenticates callbacks delivered by Calendly webhooks.",
8
+ method: "POST",
9
+ operationId: "receiveCalendlyEvent",
10
+ path: "/events/calendly/{sourceId}",
11
+ successStatus: 204,
12
+ summary: "Receive a Calendly scheduling event",
13
+ tags: ["Events"],
14
+ })
15
+ .input(z.looseObject({
16
+ event: CALENDLY_PROVIDER_EVENT_NAME_SCHEMA,
17
+ sourceId: z.string(),
18
+ }))
19
+ .output(z.void()),
20
+ };
@@ -3671,6 +3671,19 @@ export declare const eventsContract: {
3671
3671
  subscription: import("zod").ZodLiteral<"projects/opkitty/subscriptions/automate-ax-google-drive-push">;
3672
3672
  }, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
3673
3673
  googleCalendarPush: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodVoid, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
3674
+ calendlyEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
3675
+ event: import("zod").ZodEnum<{
3676
+ "event_type.created": "event_type.created";
3677
+ "event_type.deleted": "event_type.deleted";
3678
+ "event_type.updated": "event_type.updated";
3679
+ "invitee.canceled": "invitee.canceled";
3680
+ "invitee.created": "invitee.created";
3681
+ "invitee_no_show.created": "invitee_no_show.created";
3682
+ "invitee_no_show.deleted": "invitee_no_show.deleted";
3683
+ "routing_form_submission.created": "routing_form_submission.created";
3684
+ }>;
3685
+ sourceId: import("zod").ZodString;
3686
+ }, import("zod/v4/core").$loose>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
3674
3687
  clickUpEvent: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
3675
3688
  event: import("zod").ZodString;
3676
3689
  sourceId: import("zod").ZodString;
@@ -9,6 +9,7 @@ import { discordEventsContract } from "./discord.js";
9
9
  import { closeEventsContract } from "./close.js";
10
10
  import { cloudflareEventsContract } from "./cloudflare.js";
11
11
  import { clickUpEventsContract } from "./clickup.js";
12
+ import { calendlyEventsContract } from "./calendly.js";
12
13
  import { googleCalendarEventsContract } from "./google-calendar.js";
13
14
  import { googleFormsEventsContract } from "./google-forms.js";
14
15
  import { googleDriveEventsContract } from "./google-drive.js";
@@ -40,6 +41,7 @@ export const eventsContract = {
40
41
  ...closeEventsContract,
41
42
  ...cloudflareEventsContract,
42
43
  ...clickUpEventsContract,
44
+ ...calendlyEventsContract,
43
45
  ...googleCalendarEventsContract,
44
46
  ...googleDriveEventsContract,
45
47
  ...googleFormsEventsContract,