@automate.ax/api-contract 0.75.0 → 0.77.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.
Files changed (91) hide show
  1. package/dist/account.d.ts +373 -8
  2. package/dist/account.js +245 -14
  3. package/dist/api-key.d.ts +17 -9
  4. package/dist/api-key.js +4 -4
  5. package/dist/auth.d.ts +1 -1
  6. package/dist/auth.js +1 -1
  7. package/dist/authorization.d.ts +5 -5
  8. package/dist/authorization.js +21 -5
  9. package/dist/automation.d.ts +171 -6
  10. package/dist/automation.js +83 -3
  11. package/dist/deployment.d.ts +166 -10
  12. package/dist/deployment.js +113 -44
  13. package/dist/errors.d.ts +1 -1
  14. package/dist/errors.js +1 -1
  15. package/dist/events/airtable.d.ts +1 -1
  16. package/dist/events/airtable.js +1 -1
  17. package/dist/events/asana.d.ts +1 -1
  18. package/dist/events/asana.js +1 -1
  19. package/dist/events/brevo.d.ts +1 -1
  20. package/dist/events/brevo.js +1 -1
  21. package/dist/events/github.d.ts +1 -1
  22. package/dist/events/github.js +1 -1
  23. package/dist/events/gmail.d.ts +1 -1
  24. package/dist/events/gmail.js +1 -1
  25. package/dist/events/google-calendar.d.ts +1 -1
  26. package/dist/events/google-calendar.js +1 -1
  27. package/dist/events/google-forms.d.ts +1 -1
  28. package/dist/events/google-forms.js +1 -1
  29. package/dist/events/google-meet.d.ts +20 -0
  30. package/dist/events/google-meet.js +38 -0
  31. package/dist/events/index.d.ts +17 -0
  32. package/dist/events/index.js +2 -0
  33. package/dist/events/linear.d.ts +1 -1
  34. package/dist/events/linear.js +1 -1
  35. package/dist/events/mailhook.d.ts +1 -1
  36. package/dist/events/mailhook.js +1 -1
  37. package/dist/events/microsoft.d.ts +1 -1
  38. package/dist/events/microsoft.js +1 -1
  39. package/dist/events/resend.d.ts +1 -1
  40. package/dist/events/resend.js +1 -1
  41. package/dist/events/slack.d.ts +1 -1
  42. package/dist/events/slack.js +1 -1
  43. package/dist/events/trello.d.ts +1 -1
  44. package/dist/events/trello.js +1 -1
  45. package/dist/events/vercel.d.ts +1 -1
  46. package/dist/events/vercel.js +1 -1
  47. package/dist/events/whatsapp.d.ts +1 -1
  48. package/dist/events/whatsapp.js +1 -1
  49. package/dist/execution-data.d.ts +90 -0
  50. package/dist/execution-data.js +53 -0
  51. package/dist/index.d.ts +2022 -392
  52. package/dist/index.js +30 -9
  53. package/dist/org.d.ts +44 -36
  54. package/dist/org.js +6 -6
  55. package/dist/project.d.ts +24 -16
  56. package/dist/project.js +6 -6
  57. package/dist/runtime.d.ts +38 -3
  58. package/dist/runtime.js +54 -2
  59. package/dist/schemas.d.ts +21 -1
  60. package/dist/schemas.js +20 -1
  61. package/package.json +17 -6
  62. package/src/account.ts +263 -18
  63. package/src/api-key.ts +8 -4
  64. package/src/auth.ts +1 -1
  65. package/src/authorization.ts +23 -5
  66. package/src/automation.ts +90 -3
  67. package/src/deployment.ts +119 -44
  68. package/src/errors.ts +1 -1
  69. package/src/events/airtable.ts +1 -1
  70. package/src/events/asana.ts +1 -1
  71. package/src/events/brevo.ts +1 -1
  72. package/src/events/github.ts +1 -1
  73. package/src/events/gmail.ts +1 -1
  74. package/src/events/google-calendar.ts +1 -1
  75. package/src/events/google-forms.ts +1 -1
  76. package/src/events/google-meet.ts +48 -0
  77. package/src/events/index.ts +2 -0
  78. package/src/events/linear.ts +1 -1
  79. package/src/events/mailhook.ts +1 -1
  80. package/src/events/microsoft.ts +1 -1
  81. package/src/events/resend.ts +1 -1
  82. package/src/events/slack.ts +1 -1
  83. package/src/events/trello.ts +1 -1
  84. package/src/events/vercel.ts +1 -1
  85. package/src/events/whatsapp.ts +1 -1
  86. package/src/execution-data.ts +69 -0
  87. package/src/index.ts +61 -8
  88. package/src/org.ts +10 -6
  89. package/src/project.ts +10 -6
  90. package/src/runtime.ts +68 -2
  91. package/src/schemas.ts +23 -1
package/src/deployment.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
2
+ import * as z from "zod"
3
+ import { cursorPageOutputSchema, cursorPaginationInputSchema } from "./schemas"
3
4
 
4
5
  /** SDK compatibility version used to select the immutable runtime image. */
5
6
  export const AUTOMATION_SDK_VERSION = "2"
6
7
 
7
- const DEPLOYMENT_STATUS_SCHEMA = z.enum([
8
+ export const deploymentStatusSchema = z.enum([
8
9
  "planning",
9
10
  "awaiting_authorization",
10
11
  "configuring",
@@ -17,7 +18,7 @@ const DEPLOYMENT_STATUS_SCHEMA = z.enum([
17
18
  const DEPLOYMENT_IN_PROGRESS_ERROR = {
18
19
  data: z.object({
19
20
  deploymentId: z.string(),
20
- status: DEPLOYMENT_STATUS_SCHEMA,
21
+ status: deploymentStatusSchema,
21
22
  }),
22
23
  message: "A deployment is already in progress.",
23
24
  status: 409,
@@ -30,8 +31,70 @@ const GIT_SOURCE_SCHEMA = z.object({
30
31
  repositoryUrl: z.string().min(1),
31
32
  })
32
33
 
34
+ const DEPLOYMENT_AUTHORIZATION_SCHEMA = z.object({
35
+ requirements: z
36
+ .object({
37
+ binding: z.string(),
38
+ satisfied: z.boolean(),
39
+ serviceId: z.string(),
40
+ })
41
+ .array(),
42
+ url: z.url(),
43
+ })
44
+
45
+ export const deploymentOutputSchema = z.object({
46
+ authorization: DEPLOYMENT_AUTHORIZATION_SCHEMA.nullable(),
47
+ automations: z
48
+ .object({
49
+ description: z.string(),
50
+ id: z.string(),
51
+ identityKey: z.string(),
52
+ scopes: z
53
+ .object({
54
+ name: z.string().optional(),
55
+ path: z.number().int().nonnegative().array().min(1),
56
+ presentation: z.enum(["collapsed", "expanded", "hidden"]),
57
+ })
58
+ .array(),
59
+ subscriptions: z
60
+ .object({
61
+ config: z.json(),
62
+ eventType: z.string(),
63
+ hookSlot: z.number().int().nonnegative(),
64
+ scopePath: z.number().int().nonnegative().array().default([]),
65
+ })
66
+ .array(),
67
+ })
68
+ .array(),
69
+ createdAt: z.date(),
70
+ failure: z.object({ message: z.string() }).nullable(),
71
+ id: z.string(),
72
+ git: GIT_SOURCE_SCHEMA.nullable(),
73
+ project: z.object({
74
+ id: z.string(),
75
+ name: z.string(),
76
+ organization: z.object({
77
+ id: z.string(),
78
+ name: z.string(),
79
+ }),
80
+ }),
81
+ status: deploymentStatusSchema,
82
+ })
83
+
33
84
  export const deploymentContract = {
34
- cancel: oc.input(z.object({ deploymentId: z.string() })).output(z.void()),
85
+ cancel: oc
86
+ .route({
87
+ method: "DELETE",
88
+ path: "/deployments/{deploymentId}",
89
+ operationId: "cancelDeployment",
90
+ summary: "Cancel deployment",
91
+ description:
92
+ "Cancels a deployment that is planning, awaiting authorization, or configuring.",
93
+ successStatus: 204,
94
+ tags: ["Deployments"],
95
+ })
96
+ .input(z.object({ deploymentId: z.string() }))
97
+ .output(z.void()),
35
98
  create: oc
36
99
  .errors({ DEPLOYMENT_IN_PROGRESS: DEPLOYMENT_IN_PROGRESS_ERROR })
37
100
  .input(
@@ -64,50 +127,62 @@ export const deploymentContract = {
64
127
  }),
65
128
  )
66
129
  .output(z.object({ id: z.string() })),
67
- get: oc.input(z.object({ deploymentId: z.string() })).output(
68
- z.object({
69
- automations: z
70
- .object({
71
- description: z.string(),
72
- id: z.string(),
73
- identityKey: z.string(),
74
- scopes: z
75
- .object({
76
- name: z.string().optional(),
77
- path: z.number().int().nonnegative().array().min(1),
78
- presentation: z.enum(["collapsed", "expanded", "hidden"]),
79
- })
80
- .array(),
81
- subscriptions: z
82
- .object({
83
- config: z.json(),
84
- eventType: z.string(),
85
- hookSlot: z.number().int().nonnegative(),
86
- scopePath: z.number().int().nonnegative().array().default([]),
87
- })
88
- .array(),
130
+ get: oc
131
+ .route({
132
+ method: "GET",
133
+ path: "/deployments/{deploymentId}",
134
+ operationId: "getDeployment",
135
+ summary: "Get deployment",
136
+ description:
137
+ "Returns normalized deployment status, authorization requirements, and planned automations.",
138
+ tags: ["Deployments"],
139
+ })
140
+ .input(z.object({ deploymentId: z.string() }))
141
+ .output(deploymentOutputSchema),
142
+ list: oc
143
+ .route({
144
+ method: "GET",
145
+ path: "/deployments",
146
+ operationId: "listDeployments",
147
+ summary: "List deployments",
148
+ description:
149
+ "Lists deployments visible to the caller, optionally filtered by organization, project, status, or creation time.",
150
+ tags: ["Deployments"],
151
+ })
152
+ .input(
153
+ cursorPaginationInputSchema
154
+ .extend({
155
+ organizationId: z.string().optional(),
156
+ projectId: z.string().optional(),
157
+ since: z.date().optional(),
158
+ status: deploymentStatusSchema.optional(),
159
+ until: z.date().optional(),
89
160
  })
90
- .array(),
91
- createdAt: z.date(),
92
- id: z.string(),
93
- git: GIT_SOURCE_SCHEMA.nullable(),
94
- job: z
95
- .object({
96
- attempts: z.number().int().nonnegative(),
97
- error: z.string().nullable(),
98
- maxAttempts: z.number().int().positive(),
99
- nextRunAt: z.date(),
161
+ .superRefine(({ since, until }, context) => {
162
+ if (since !== undefined && until !== undefined && since > until) {
163
+ context.addIssue({
164
+ code: "custom",
165
+ message: "Since must be before or equal to until.",
166
+ path: ["since"],
167
+ })
168
+ }
100
169
  })
101
- .nullable(),
102
- project: z.object({
103
- id: z.string(),
104
- name: z.string(),
105
- }),
106
- status: DEPLOYMENT_STATUS_SCHEMA,
107
- }),
108
- ),
170
+ .prefault({}),
171
+ )
172
+ .output(cursorPageOutputSchema(deploymentOutputSchema)),
109
173
  redeploy: oc
110
174
  .errors({ DEPLOYMENT_IN_PROGRESS: DEPLOYMENT_IN_PROGRESS_ERROR })
175
+ .route({
176
+ method: "POST",
177
+ path: "/projects/{projectId}/deployments/redeploy",
178
+ operationId: "redeployProject",
179
+ summary: "Redeploy project",
180
+ description:
181
+ "Creates a deployment from the project's active artifact and plans with explicit integration account bindings.",
182
+ successStatus: 201,
183
+ successDescription: "Redeployment created.",
184
+ tags: ["Deployments"],
185
+ })
111
186
  .input(
112
187
  z.object({
113
188
  bindings: z
package/src/errors.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { z } from "zod"
1
+ import * as z from "zod"
2
2
 
3
3
  const AUTOMATION_ERROR_BASE_SCHEMA = z.object({
4
4
  code: z.string().min(1),
@@ -1,5 +1,5 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
2
+ import * as z from "zod"
3
3
 
4
4
  export const airtableEventsContract = {
5
5
  airtableEvent: oc
@@ -1,5 +1,5 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
2
+ import * as z from "zod"
3
3
 
4
4
  export const asanaEventsContract = {
5
5
  asanaEvent: oc
@@ -1,5 +1,5 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
2
+ import * as z from "zod"
3
3
 
4
4
  export const brevoEventsContract = {
5
5
  brevoEvent: oc
@@ -1,5 +1,5 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
2
+ import * as z from "zod"
3
3
 
4
4
  export const githubEventsContract = {
5
5
  githubEvent: oc
@@ -1,5 +1,5 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
2
+ import * as z from "zod"
3
3
 
4
4
  export const gmailEventsContract = {
5
5
  gmailPush: oc
@@ -1,5 +1,5 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
2
+ import * as z from "zod"
3
3
 
4
4
  export const googleCalendarEventsContract = {
5
5
  googleCalendarPush: oc
@@ -1,5 +1,5 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
2
+ import * as z from "zod"
3
3
 
4
4
  export const googleFormsEventsContract = {
5
5
  googleFormsPush: oc
@@ -0,0 +1,48 @@
1
+ import { oc } from "@orpc/contract"
2
+ import { z } from "zod"
3
+
4
+ export const googleMeetEventsContract = {
5
+ googleMeetPush: oc
6
+ .route({
7
+ method: "POST",
8
+ path: "/events/google-meet",
9
+ operationId: "receiveGoogleMeetPush",
10
+ summary: "Receive a Google Meet push notification",
11
+ description:
12
+ "Receives and authenticates Google Meet CloudEvents delivered by Google Cloud Pub/Sub.",
13
+ tags: ["Events"],
14
+ successStatus: 204,
15
+ })
16
+ .input(
17
+ z.object({
18
+ /** Pub/Sub message containing one encoded Google Workspace CloudEvent. */
19
+ message: z.object({
20
+ /** CloudEvent routing attributes supplied by Pub/Sub. */
21
+ attributes: z.looseObject({
22
+ "ce-datacontenttype": z.literal("application/json"),
23
+ "ce-id": z.string().min(1),
24
+ "ce-source": z.string().min(1),
25
+ "ce-specversion": z.literal("1.0"),
26
+ "ce-subject": z.string().min(1),
27
+ "ce-time": z.iso.datetime({ offset: true }),
28
+ "ce-type": z.string().min(1),
29
+ }),
30
+
31
+ /** Base64-encoded CloudEvent data. */
32
+ data: z.string().min(1),
33
+
34
+ /** Pub/Sub message identifier. */
35
+ messageId: z.string().min(1),
36
+
37
+ /** RFC 3339 time at which Pub/Sub published the notification. */
38
+ publishTime: z.iso.datetime({ offset: true }),
39
+ }),
40
+
41
+ /** Pub/Sub subscription that delivered the message. */
42
+ subscription: z.literal(
43
+ "projects/opkitty/subscriptions/automate-ax-google-meet-push",
44
+ ),
45
+ }),
46
+ )
47
+ .output(z.void()),
48
+ }
@@ -3,6 +3,7 @@ import { asanaEventsContract } from "./asana"
3
3
  import { brevoEventsContract } from "./brevo"
4
4
  import { googleCalendarEventsContract } from "./google-calendar"
5
5
  import { googleFormsEventsContract } from "./google-forms"
6
+ import { googleMeetEventsContract } from "./google-meet"
6
7
  import { gmailEventsContract } from "./gmail"
7
8
  import { githubEventsContract } from "./github"
8
9
  import { linearEventsContract } from "./linear"
@@ -20,6 +21,7 @@ export const eventsContract = {
20
21
  ...brevoEventsContract,
21
22
  ...googleCalendarEventsContract,
22
23
  ...googleFormsEventsContract,
24
+ ...googleMeetEventsContract,
23
25
  ...gmailEventsContract,
24
26
  ...githubEventsContract,
25
27
  ...linearEventsContract,
@@ -1,5 +1,5 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
2
+ import * as z from "zod"
3
3
 
4
4
  export const linearEventsContract = {
5
5
  linearEvent: oc
@@ -1,5 +1,5 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
2
+ import * as z from "zod"
3
3
 
4
4
  export const mailhookEventsContract = {
5
5
  mailhookEvent: oc
@@ -1,5 +1,5 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
2
+ import * as z from "zod"
3
3
 
4
4
  export const microsoftEventsContract = {
5
5
  microsoftGraphNotification: oc
@@ -1,5 +1,5 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
2
+ import * as z from "zod"
3
3
 
4
4
  export const resendEventsContract = {
5
5
  resendEvent: oc
@@ -1,5 +1,5 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
2
+ import * as z from "zod"
3
3
 
4
4
  export const slackEventsContract = {
5
5
  slackEvent: oc
@@ -1,5 +1,5 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
2
+ import * as z from "zod"
3
3
 
4
4
  /** Source path shared by Trello's callback probe and event delivery. */
5
5
  const trelloWebhookPathInput = z.looseObject({ sourceId: z.string() })
@@ -1,5 +1,5 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
2
+ import * as z from "zod"
3
3
 
4
4
  export const vercelEventsContract = {
5
5
  vercelEvent: oc
@@ -1,5 +1,5 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
2
+ import * as z from "zod"
3
3
 
4
4
  export const whatsappEventsContract = {
5
5
  whatsappEvent: oc
@@ -0,0 +1,69 @@
1
+ import { oc } from "@orpc/contract"
2
+ import { z } from "zod"
3
+
4
+ export const EXECUTION_DATASET_VERSION = 4
5
+
6
+ export const executionDatasetResourceSchema = z.enum([
7
+ "projects",
8
+ "automations",
9
+ "contexts",
10
+ "context-parents",
11
+ "event-links",
12
+ "events",
13
+ "actions",
14
+ "signal-invocations",
15
+ "signal-coordinators",
16
+ "signal-offers",
17
+ "signal-decisions",
18
+ "logs",
19
+ "outputs",
20
+ "trace-spans",
21
+ ])
22
+
23
+ export const executionDatasetScopeSchema = z.object({
24
+ organizationId: z.string().nullable(),
25
+ projectId: z.string().nullable(),
26
+ since: z.iso.datetime({ offset: true }).nullable(),
27
+ })
28
+
29
+ export const executionDatasetManifestSchema = z.object({
30
+ consistency: z.literal("eventual"),
31
+ profileId: z.string().min(1),
32
+ resources: z
33
+ .object({
34
+ name: executionDatasetResourceSchema,
35
+ url: z.url(),
36
+ })
37
+ .array(),
38
+ schemaVersion: z.literal(EXECUTION_DATASET_VERSION),
39
+ scope: executionDatasetScopeSchema,
40
+ })
41
+
42
+ export type ExecutionDatasetManifest = z.infer<
43
+ typeof executionDatasetManifestSchema
44
+ >
45
+ export type ExecutionDatasetResource = z.infer<
46
+ typeof executionDatasetResourceSchema
47
+ >
48
+ export type ExecutionDatasetScope = z.infer<typeof executionDatasetScopeSchema>
49
+
50
+ export const executionDataContract = {
51
+ manifest: oc
52
+ .route({
53
+ method: "GET",
54
+ path: "/execution-data/manifest",
55
+ operationId: "getExecutionDataManifest",
56
+ summary: "Get execution data manifest",
57
+ description:
58
+ "Returns authenticated Electric shape resources for a validated execution-data scope.",
59
+ tags: ["Execution data"],
60
+ })
61
+ .input(
62
+ z.object({
63
+ organizationId: z.string().optional(),
64
+ projectId: z.string().optional(),
65
+ since: z.iso.datetime({ offset: true }).optional(),
66
+ }),
67
+ )
68
+ .output(executionDatasetManifestSchema),
69
+ }
package/src/index.ts CHANGED
@@ -5,21 +5,50 @@ import { authContract } from "./auth"
5
5
  import { authorizationContract } from "./authorization"
6
6
  import { deploymentContract } from "./deployment"
7
7
  import { eventsContract } from "./events"
8
+ import { executionDataContract } from "./execution-data"
8
9
  import { orgContract } from "./org"
9
10
  import { projectContract } from "./project"
10
11
  import { runtimeContract } from "./runtime"
11
12
 
12
- export { automationExecutionStatusSchema } from "./automation"
13
- export { AUTOMATION_SDK_VERSION } from "./deployment"
13
+ export {
14
+ automationExecutionStatusSchema,
15
+ automationOutputSchema,
16
+ } from "./automation"
17
+ export {
18
+ EXECUTION_DATASET_VERSION,
19
+ executionDatasetManifestSchema,
20
+ executionDatasetResourceSchema,
21
+ executionDatasetScopeSchema,
22
+ type ExecutionDatasetManifest,
23
+ type ExecutionDatasetResource,
24
+ type ExecutionDatasetScope,
25
+ executionDataContract,
26
+ } from "./execution-data"
27
+ export {
28
+ AUTOMATION_SDK_VERSION,
29
+ deploymentOutputSchema,
30
+ deploymentStatusSchema,
31
+ } from "./deployment"
14
32
  export {
15
33
  AUTOMATION_ERROR_CAUSE_DEPTH,
16
34
  automationErrorSchema,
17
35
  type AutomationErrorValue,
18
36
  } from "./errors"
19
- export { integrationAccountOutputSchema } from "./account"
37
+ export {
38
+ integrationAccountOutputSchema,
39
+ integrationAccountRevocationImpactOutputSchema,
40
+ integrationAccountRevocationOutputSchema,
41
+ integrationServiceOutputSchema,
42
+ } from "./account"
20
43
  export {
21
44
  AUTOMATION_INVOCATION_DEFAULT_ENTRYPOINT,
22
45
  AUTOMATION_INVOCATION_RESERVED_ENTRYPOINT_PREFIX,
46
+ AUTOMATION_LOG_MAX_ENTRIES,
47
+ AUTOMATION_LOG_MAX_MESSAGE_LENGTH,
48
+ AUTOMATION_OBSERVABILITY_MAX_ENCODED_BYTES,
49
+ AUTOMATION_OBSERVABILITY_MAX_FIELDS,
50
+ AUTOMATION_TRACE_MAX_NAME_LENGTH,
51
+ AUTOMATION_TRACE_MAX_SPANS,
23
52
  DEFAULT_GATEWAY_MODEL_ID,
24
53
  automationInvocationInputSchema,
25
54
  automationInvocationOutputSchema,
@@ -50,7 +79,12 @@ export {
50
79
  publicOrganizationOutputSchema,
51
80
  } from "./org"
52
81
  export { projectOutputSchema } from "./project"
53
- export { reasonableNameSchema } from "./schemas"
82
+ export {
83
+ cursorPageInfoSchema,
84
+ cursorPageOutputSchema,
85
+ cursorPaginationInputSchema,
86
+ reasonableNameSchema,
87
+ } from "./schemas"
54
88
  export { userOutputSchema } from "./auth"
55
89
  export {
56
90
  managementPermissionStatement,
@@ -61,7 +95,24 @@ export {
61
95
 
62
96
  /** Procedures exposed by the public Node client and OpenAPI document. */
63
97
  export const publicContract = {
98
+ account: accountContract,
99
+ automation: {
100
+ get: automationContract.get,
101
+ list: automationContract.list,
102
+ update: automationContract.update,
103
+ },
64
104
  apiKey: apiKeyContract,
105
+ authorization: {
106
+ get: authorizationContract.get,
107
+ proceed: authorizationContract.proceed,
108
+ },
109
+ deployment: {
110
+ cancel: deploymentContract.cancel,
111
+ get: deploymentContract.get,
112
+ list: deploymentContract.list,
113
+ redeploy: deploymentContract.redeploy,
114
+ },
115
+ executionData: executionDataContract,
65
116
  org: {
66
117
  create: orgContract.create,
67
118
  delete: orgContract.delete,
@@ -87,12 +138,14 @@ export const publicContract = {
87
138
  /** Procedures used by first-party control-plane clients. */
88
139
  export const firstPartyContract = {
89
140
  ...publicContract,
90
- account: accountContract,
91
- automation: automationContract,
141
+ automation: {
142
+ ...publicContract.automation,
143
+ getExecution: automationContract.getExecution,
144
+ listExecutions: automationContract.listExecutions,
145
+ },
92
146
  authorization: {
147
+ ...publicContract.authorization,
93
148
  beginConnection: authorizationContract.beginConnection,
94
- get: authorizationContract.get,
95
- proceed: authorizationContract.proceed,
96
149
  selectAccount: authorizationContract.selectAccount,
97
150
  submitCredentials: authorizationContract.submitCredentials,
98
151
  },
package/src/org.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
3
- import { reasonableNameSchema } from "./schemas"
2
+ import * as z from "zod"
3
+ import {
4
+ cursorPageOutputSchema,
5
+ cursorPaginationInputSchema,
6
+ reasonableNameSchema,
7
+ } from "./schemas"
4
8
 
5
9
  export const organizationRoleSchema = z.enum(["member", "admin", "owner"])
6
10
 
@@ -185,13 +189,13 @@ export const orgContract = {
185
189
  tags: ["Organizations"],
186
190
  })
187
191
  .input(
188
- z
189
- .object({
192
+ cursorPaginationInputSchema
193
+ .extend({
190
194
  query: z.string().min(1).optional(),
191
195
  })
192
- .default({}),
196
+ .prefault({}),
193
197
  )
194
- .output(organizationSummaryOutputSchema.array()),
198
+ .output(cursorPageOutputSchema(organizationSummaryOutputSchema)),
195
199
  remove: oc
196
200
  .route({
197
201
  method: "DELETE",
package/src/project.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  import { oc } from "@orpc/contract"
2
- import { z } from "zod"
3
- import { reasonableNameSchema } from "./schemas"
2
+ import * as z from "zod"
3
+ import {
4
+ cursorPageOutputSchema,
5
+ cursorPaginationInputSchema,
6
+ reasonableNameSchema,
7
+ } from "./schemas"
4
8
 
5
9
  const TRANSACTION_OUTPUT_SCHEMA = z.object({
6
10
  txid: z.number().int().nonnegative(),
@@ -61,14 +65,14 @@ export const projectContract = {
61
65
  tags: ["Projects"],
62
66
  })
63
67
  .input(
64
- z
65
- .object({
68
+ cursorPaginationInputSchema
69
+ .extend({
66
70
  organizationId: z.string().optional(),
67
71
  query: z.string().min(1).optional(),
68
72
  })
69
- .optional(),
73
+ .prefault({}),
70
74
  )
71
- .output(projectOutputSchema.array()),
75
+ .output(cursorPageOutputSchema(projectOutputSchema)),
72
76
  get: oc
73
77
  .route({
74
78
  method: "GET",