@automate.ax/api-contract 0.143.9 → 0.144.1

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/index.js CHANGED
@@ -40,6 +40,7 @@ export const publicContract = {
40
40
  },
41
41
  deployment: {
42
42
  cancel: deploymentContract.cancel,
43
+ configureParameters: deploymentContract.configureParameters,
43
44
  get: deploymentContract.get,
44
45
  list: deploymentContract.list,
45
46
  redeploy: deploymentContract.redeploy,
@@ -1,2 +1,2 @@
1
1
  /** Runtime protocol required by newly built automation bundles. */
2
- export declare const AUTOMATION_RUNTIME_PROTOCOL_VERSION = 5;
2
+ export declare const AUTOMATION_RUNTIME_PROTOCOL_VERSION = 6;
@@ -1,2 +1,2 @@
1
1
  /** Runtime protocol required by newly built automation bundles. */
2
- export const AUTOMATION_RUNTIME_PROTOCOL_VERSION = 5;
2
+ export const AUTOMATION_RUNTIME_PROTOCOL_VERSION = 6;
package/dist/runtime.d.ts CHANGED
@@ -2150,6 +2150,10 @@ export declare const runtimeContract: {
2150
2150
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
2151
2151
  googleAdsRequest: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
2152
2152
  accountId: z.ZodString;
2153
+ api: z.ZodDefault<z.ZodEnum<{
2154
+ googleAds: "googleAds";
2155
+ dataManager: "dataManager";
2156
+ }>>;
2153
2157
  body: z.ZodOptional<z.ZodJSONSchema>;
2154
2158
  loginCustomerId: z.ZodOptional<z.ZodString>;
2155
2159
  method: z.ZodOptional<z.ZodEnum<{
package/dist/runtime.js CHANGED
@@ -963,6 +963,7 @@ export const runtimeContract = {
963
963
  googleAdsRequest: oc
964
964
  .input(z.strictObject({
965
965
  accountId: z.string().min(1),
966
+ api: z.enum(["googleAds", "dataManager"]).default("googleAds"),
966
967
  body: z.json().optional(),
967
968
  loginCustomerId: z.string().optional(),
968
969
  method: z.enum(["GET", "POST"]).optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automate.ax/api-contract",
3
- "version": "0.143.9",
3
+ "version": "0.144.1",
4
4
  "description": "Public oRPC contract for the Automate.ax API.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -31,8 +31,9 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@ai-sdk/gateway": "4.0.46",
34
- "@automate.ax/codec": "0.143.9",
35
- "@automate.ax/integration-contracts": "0.143.9",
34
+ "@automate.ax/catalog": "0.144.1",
35
+ "@automate.ax/codec": "0.144.1",
36
+ "@automate.ax/integration-contracts": "0.144.1",
36
37
  "@orpc/contract": "1.15.0",
37
38
  "fast-json-stable-stringify": "^2.1.0",
38
39
  "zod": "^4.3.6"
package/src/deployment.ts CHANGED
@@ -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"
4
5
  import { cursorPageOutputSchema, cursorPaginationInputSchema } from "./schemas"
@@ -52,6 +53,31 @@ const DEPLOYMENT_AUTHORIZATION_SCHEMA = z.object({
52
53
  url: z.url(),
53
54
  })
54
55
 
56
+ const DEPLOYMENT_PARAMETER_VALUE_SCHEMA = z.object({
57
+ automationId: z.string(),
58
+ name: z.string().min(1),
59
+ value: z.base64(),
60
+ })
61
+
62
+ const DEPLOYMENT_PARAMETER_VALUES_SCHEMA =
63
+ DEPLOYMENT_PARAMETER_VALUE_SCHEMA.array().superRefine(
64
+ (parameters, context) => {
65
+ const keys = new Set<string>()
66
+
67
+ for (const [index, parameter] of parameters.entries()) {
68
+ const key = JSON.stringify([parameter.automationId, parameter.name])
69
+ if (keys.has(key)) {
70
+ context.addIssue({
71
+ code: "custom",
72
+ message: "Automation parameter assignments must be unique.",
73
+ path: [index],
74
+ })
75
+ }
76
+ keys.add(key)
77
+ }
78
+ },
79
+ )
80
+
55
81
  export const deploymentOutputSchema = z.object({
56
82
  authorization: DEPLOYMENT_AUTHORIZATION_SCHEMA.nullable(),
57
83
  automations: z
@@ -59,6 +85,9 @@ export const deploymentOutputSchema = z.object({
59
85
  description: z.string(),
60
86
  id: z.string(),
61
87
  identityKey: z.string(),
88
+ parameterIssues: z.string().array().optional(),
89
+ parameters: z.optional(DASHBOARD_RUN_FIELDS_SCHEMA),
90
+ parameterValues: z.record(z.string(), z.base64()).optional(),
62
91
  scopes: z
63
92
  .object({
64
93
  name: z.string().optional(),
@@ -105,6 +134,23 @@ export const deploymentContract = {
105
134
  })
106
135
  .input(z.object({ deploymentId: z.string() }))
107
136
  .output(z.void()),
137
+ configureParameters: oc
138
+ .route({
139
+ method: "PUT",
140
+ path: "/deployments/{deploymentId}/parameters",
141
+ operationId: "configureDeploymentParameters",
142
+ summary: "Configure automation parameters",
143
+ description:
144
+ "Assigns every unresolved automation parameter and resumes project planning.",
145
+ tags: ["Deployments"],
146
+ })
147
+ .input(
148
+ z.object({
149
+ deploymentId: z.string(),
150
+ values: DEPLOYMENT_PARAMETER_VALUES_SCHEMA,
151
+ }),
152
+ )
153
+ .output(z.object({ txid: z.number().int().nonnegative() })),
108
154
  create: oc
109
155
  .errors({
110
156
  DEPLOYMENT_IN_PROGRESS: DEPLOYMENT_IN_PROGRESS_ERROR,
@@ -224,6 +270,7 @@ export const deploymentContract = {
224
270
  keys.add(key)
225
271
  }
226
272
  }),
273
+ parameters: DEPLOYMENT_PARAMETER_VALUES_SCHEMA.default([]),
227
274
  projectId: z.string(),
228
275
  }),
229
276
  )
@@ -0,0 +1,24 @@
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
+
5
+ export const calendlyEventsContract = {
6
+ calendlyEvent: oc
7
+ .route({
8
+ description:
9
+ "Receives and authenticates callbacks delivered by Calendly webhooks.",
10
+ method: "POST",
11
+ operationId: "receiveCalendlyEvent",
12
+ path: "/events/calendly/{sourceId}",
13
+ successStatus: 204,
14
+ summary: "Receive a Calendly scheduling event",
15
+ tags: ["Events"],
16
+ })
17
+ .input(
18
+ z.looseObject({
19
+ event: CALENDLY_PROVIDER_EVENT_NAME_SCHEMA,
20
+ sourceId: z.string(),
21
+ }),
22
+ )
23
+ .output(z.void()),
24
+ }
@@ -9,6 +9,7 @@ import { discordEventsContract } from "./discord"
9
9
  import { closeEventsContract } from "./close"
10
10
  import { cloudflareEventsContract } from "./cloudflare"
11
11
  import { clickUpEventsContract } from "./clickup"
12
+ import { calendlyEventsContract } from "./calendly"
12
13
  import { googleCalendarEventsContract } from "./google-calendar"
13
14
  import { googleFormsEventsContract } from "./google-forms"
14
15
  import { googleDriveEventsContract } from "./google-drive"
@@ -41,6 +42,7 @@ export const eventsContract = {
41
42
  ...closeEventsContract,
42
43
  ...cloudflareEventsContract,
43
44
  ...clickUpEventsContract,
45
+ ...calendlyEventsContract,
44
46
  ...googleCalendarEventsContract,
45
47
  ...googleDriveEventsContract,
46
48
  ...googleFormsEventsContract,
package/src/index.ts CHANGED
@@ -134,6 +134,7 @@ export const publicContract = {
134
134
  },
135
135
  deployment: {
136
136
  cancel: deploymentContract.cancel,
137
+ configureParameters: deploymentContract.configureParameters,
137
138
  get: deploymentContract.get,
138
139
  list: deploymentContract.list,
139
140
  redeploy: deploymentContract.redeploy,
@@ -1,2 +1,2 @@
1
1
  /** Runtime protocol required by newly built automation bundles. */
2
- export const AUTOMATION_RUNTIME_PROTOCOL_VERSION = 5
2
+ export const AUTOMATION_RUNTIME_PROTOCOL_VERSION = 6
package/src/runtime.ts CHANGED
@@ -1179,6 +1179,7 @@ export const runtimeContract = {
1179
1179
  .input(
1180
1180
  z.strictObject({
1181
1181
  accountId: z.string().min(1),
1182
+ api: z.enum(["googleAds", "dataManager"]).default("googleAds"),
1182
1183
  body: z.json().optional(),
1183
1184
  loginCustomerId: z.string().optional(),
1184
1185
  method: z.enum(["GET", "POST"]).optional(),