@automate.ax/api-contract 0.76.0 → 0.77.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/account.d.ts +372 -7
- package/dist/account.js +244 -13
- package/dist/api-key.d.ts +16 -8
- package/dist/api-key.js +3 -3
- package/dist/authorization.d.ts +4 -4
- package/dist/authorization.js +20 -4
- package/dist/automation.d.ts +170 -5
- package/dist/automation.js +82 -2
- package/dist/deployment.d.ts +165 -9
- package/dist/deployment.js +112 -43
- package/dist/events/google-meet.d.ts +20 -0
- package/dist/events/google-meet.js +38 -0
- package/dist/events/index.d.ts +17 -0
- package/dist/events/index.js +2 -0
- package/dist/execution-data.d.ts +90 -0
- package/dist/execution-data.js +53 -0
- package/dist/index.d.ts +2022 -392
- package/dist/index.js +30 -9
- package/dist/org.d.ts +43 -35
- package/dist/org.js +5 -5
- package/dist/project.d.ts +23 -15
- package/dist/project.js +5 -5
- package/dist/runtime.d.ts +36 -1
- package/dist/runtime.js +53 -1
- package/dist/schemas.d.ts +20 -0
- package/dist/schemas.js +19 -0
- package/package.json +2 -2
- package/src/account.ts +262 -17
- package/src/api-key.ts +7 -3
- package/src/authorization.ts +22 -4
- package/src/automation.ts +89 -2
- package/src/deployment.ts +118 -43
- package/src/events/google-meet.ts +48 -0
- package/src/events/index.ts +2 -0
- package/src/execution-data.ts +69 -0
- package/src/index.ts +61 -8
- package/src/org.ts +9 -5
- package/src/project.ts +9 -5
- package/src/runtime.ts +65 -1
- package/src/schemas.ts +22 -0
package/dist/automation.js
CHANGED
|
@@ -1,21 +1,75 @@
|
|
|
1
1
|
import { encodableSchema } from "@automate.ax/codec";
|
|
2
2
|
import { oc } from "@orpc/contract";
|
|
3
3
|
import * as z from "zod";
|
|
4
|
+
import { integrationAccountBindingOutputSchema } from "./account.js";
|
|
4
5
|
import { automationErrorSchema } from "./errors.js";
|
|
6
|
+
import { cursorPageOutputSchema, cursorPaginationInputSchema } from "./schemas.js";
|
|
7
|
+
const TRIGGER_PRESENTATION_VALUE_SCHEMA = z.object({
|
|
8
|
+
copyable: z.boolean().optional(),
|
|
9
|
+
value: z.string(),
|
|
10
|
+
});
|
|
11
|
+
export const automationOutputSchema = z.object({
|
|
12
|
+
accountBindings: z
|
|
13
|
+
.object({
|
|
14
|
+
account: integrationAccountBindingOutputSchema.nullable(),
|
|
15
|
+
binding: z.string(),
|
|
16
|
+
serviceId: z.string(),
|
|
17
|
+
})
|
|
18
|
+
.array(),
|
|
19
|
+
activeDeploymentId: z.string(),
|
|
20
|
+
createdAt: z.date(),
|
|
21
|
+
description: z.string(),
|
|
22
|
+
enabled: z.boolean(),
|
|
23
|
+
id: z.string(),
|
|
24
|
+
identityKey: z.string(),
|
|
25
|
+
project: z.object({
|
|
26
|
+
id: z.string(),
|
|
27
|
+
name: z.string(),
|
|
28
|
+
organization: z.object({
|
|
29
|
+
id: z.string(),
|
|
30
|
+
name: z.string(),
|
|
31
|
+
}),
|
|
32
|
+
}),
|
|
33
|
+
triggers: z
|
|
34
|
+
.object({
|
|
35
|
+
details: TRIGGER_PRESENTATION_VALUE_SCHEMA.extend({
|
|
36
|
+
label: z.string(),
|
|
37
|
+
}).array(),
|
|
38
|
+
hookSlot: z.number().int().nonnegative(),
|
|
39
|
+
id: z.string(),
|
|
40
|
+
name: z.string(),
|
|
41
|
+
primary: TRIGGER_PRESENTATION_VALUE_SCHEMA.optional(),
|
|
42
|
+
scopePath: z.number().int().nonnegative().array(),
|
|
43
|
+
type: z.string(),
|
|
44
|
+
})
|
|
45
|
+
.array(),
|
|
46
|
+
updatedAt: z.date(),
|
|
47
|
+
});
|
|
5
48
|
export const automationExecutionStatusSchema = z.enum([
|
|
6
49
|
"running",
|
|
7
|
-
"
|
|
50
|
+
"settled",
|
|
8
51
|
"failed",
|
|
9
52
|
]);
|
|
10
53
|
const EXECUTION_SUMMARY_SCHEMA = z.object({
|
|
11
|
-
completedAt: z.date().nullable(),
|
|
12
54
|
createdAt: z.date(),
|
|
13
55
|
eventTypes: z.string().array(),
|
|
14
56
|
failure: automationErrorSchema.nullable(),
|
|
15
57
|
id: z.string(),
|
|
58
|
+
settledAt: z.date().nullable(),
|
|
16
59
|
status: automationExecutionStatusSchema,
|
|
17
60
|
});
|
|
18
61
|
export const automationContract = {
|
|
62
|
+
get: oc
|
|
63
|
+
.route({
|
|
64
|
+
method: "GET",
|
|
65
|
+
path: "/automations/{automationId}",
|
|
66
|
+
operationId: "getAutomation",
|
|
67
|
+
summary: "Get automation",
|
|
68
|
+
description: "Returns an active automation with its triggers and integration account bindings.",
|
|
69
|
+
tags: ["Automations"],
|
|
70
|
+
})
|
|
71
|
+
.input(z.object({ automationId: z.string() }))
|
|
72
|
+
.output(automationOutputSchema),
|
|
19
73
|
getExecution: oc
|
|
20
74
|
.input(z.object({
|
|
21
75
|
automationId: z.string(),
|
|
@@ -55,6 +109,24 @@ export const automationContract = {
|
|
|
55
109
|
})
|
|
56
110
|
.array(),
|
|
57
111
|
})),
|
|
112
|
+
list: oc
|
|
113
|
+
.route({
|
|
114
|
+
method: "GET",
|
|
115
|
+
path: "/automations",
|
|
116
|
+
operationId: "listAutomations",
|
|
117
|
+
summary: "List automations",
|
|
118
|
+
description: "Lists active automations visible to the caller, optionally filtered by organization, project, state, or query.",
|
|
119
|
+
tags: ["Automations"],
|
|
120
|
+
})
|
|
121
|
+
.input(cursorPaginationInputSchema
|
|
122
|
+
.extend({
|
|
123
|
+
enabled: z.boolean().optional(),
|
|
124
|
+
organizationId: z.string().optional(),
|
|
125
|
+
projectId: z.string().optional(),
|
|
126
|
+
query: z.string().min(1).optional(),
|
|
127
|
+
})
|
|
128
|
+
.prefault({}))
|
|
129
|
+
.output(cursorPageOutputSchema(automationOutputSchema)),
|
|
58
130
|
listExecutions: oc
|
|
59
131
|
.input(z.object({
|
|
60
132
|
automationId: z.string(),
|
|
@@ -62,6 +134,14 @@ export const automationContract = {
|
|
|
62
134
|
}))
|
|
63
135
|
.output(EXECUTION_SUMMARY_SCHEMA.array()),
|
|
64
136
|
update: oc
|
|
137
|
+
.route({
|
|
138
|
+
method: "PATCH",
|
|
139
|
+
path: "/automations/{automationId}",
|
|
140
|
+
operationId: "updateAutomation",
|
|
141
|
+
summary: "Update automation",
|
|
142
|
+
description: "Enables or disables an automation. Requires project:update.",
|
|
143
|
+
tags: ["Automations"],
|
|
144
|
+
})
|
|
65
145
|
.input(z.object({
|
|
66
146
|
automationId: z.string(),
|
|
67
147
|
enabled: z.boolean(),
|
package/dist/deployment.d.ts
CHANGED
|
@@ -1,6 +1,73 @@
|
|
|
1
1
|
import * as 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 declare const deploymentStatusSchema: z.ZodEnum<{
|
|
5
|
+
succeeded: "succeeded";
|
|
6
|
+
failed: "failed";
|
|
7
|
+
awaiting_authorization: "awaiting_authorization";
|
|
8
|
+
configuring: "configuring";
|
|
9
|
+
publishing: "publishing";
|
|
10
|
+
planning: "planning";
|
|
11
|
+
cancelled: "cancelled";
|
|
12
|
+
}>;
|
|
13
|
+
export declare const deploymentOutputSchema: z.ZodObject<{
|
|
14
|
+
authorization: z.ZodNullable<z.ZodObject<{
|
|
15
|
+
requirements: z.ZodArray<z.ZodObject<{
|
|
16
|
+
binding: z.ZodString;
|
|
17
|
+
satisfied: z.ZodBoolean;
|
|
18
|
+
serviceId: z.ZodString;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
url: z.ZodURL;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
automations: z.ZodArray<z.ZodObject<{
|
|
23
|
+
description: z.ZodString;
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
identityKey: z.ZodString;
|
|
26
|
+
scopes: z.ZodArray<z.ZodObject<{
|
|
27
|
+
name: z.ZodOptional<z.ZodString>;
|
|
28
|
+
path: z.ZodArray<z.ZodNumber>;
|
|
29
|
+
presentation: z.ZodEnum<{
|
|
30
|
+
collapsed: "collapsed";
|
|
31
|
+
expanded: "expanded";
|
|
32
|
+
hidden: "hidden";
|
|
33
|
+
}>;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
subscriptions: z.ZodArray<z.ZodObject<{
|
|
36
|
+
config: z.ZodJSONSchema;
|
|
37
|
+
eventType: z.ZodString;
|
|
38
|
+
hookSlot: z.ZodNumber;
|
|
39
|
+
scopePath: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
|
|
40
|
+
}, z.core.$strip>>;
|
|
41
|
+
}, z.core.$strip>>;
|
|
42
|
+
createdAt: z.ZodDate;
|
|
43
|
+
failure: z.ZodNullable<z.ZodObject<{
|
|
44
|
+
message: z.ZodString;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
id: z.ZodString;
|
|
47
|
+
git: z.ZodNullable<z.ZodObject<{
|
|
48
|
+
commitSha: z.ZodString;
|
|
49
|
+
dirty: z.ZodBoolean;
|
|
50
|
+
projectPath: z.ZodString;
|
|
51
|
+
repositoryUrl: z.ZodString;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
project: z.ZodObject<{
|
|
54
|
+
id: z.ZodString;
|
|
55
|
+
name: z.ZodString;
|
|
56
|
+
organization: z.ZodObject<{
|
|
57
|
+
id: z.ZodString;
|
|
58
|
+
name: z.ZodString;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
status: z.ZodEnum<{
|
|
62
|
+
succeeded: "succeeded";
|
|
63
|
+
failed: "failed";
|
|
64
|
+
awaiting_authorization: "awaiting_authorization";
|
|
65
|
+
configuring: "configuring";
|
|
66
|
+
publishing: "publishing";
|
|
67
|
+
planning: "planning";
|
|
68
|
+
cancelled: "cancelled";
|
|
69
|
+
}>;
|
|
70
|
+
}, z.core.$strip>;
|
|
4
71
|
export declare const deploymentContract: {
|
|
5
72
|
cancel: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
6
73
|
deploymentId: z.ZodString;
|
|
@@ -32,10 +99,10 @@ export declare const deploymentContract: {
|
|
|
32
99
|
status: z.ZodEnum<{
|
|
33
100
|
succeeded: "succeeded";
|
|
34
101
|
failed: "failed";
|
|
35
|
-
planning: "planning";
|
|
36
102
|
awaiting_authorization: "awaiting_authorization";
|
|
37
103
|
configuring: "configuring";
|
|
38
104
|
publishing: "publishing";
|
|
105
|
+
planning: "planning";
|
|
39
106
|
cancelled: "cancelled";
|
|
40
107
|
}>;
|
|
41
108
|
}, z.core.$strip>;
|
|
@@ -46,6 +113,14 @@ export declare const deploymentContract: {
|
|
|
46
113
|
get: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
47
114
|
deploymentId: z.ZodString;
|
|
48
115
|
}, z.core.$strip>, z.ZodObject<{
|
|
116
|
+
authorization: z.ZodNullable<z.ZodObject<{
|
|
117
|
+
requirements: z.ZodArray<z.ZodObject<{
|
|
118
|
+
binding: z.ZodString;
|
|
119
|
+
satisfied: z.ZodBoolean;
|
|
120
|
+
serviceId: z.ZodString;
|
|
121
|
+
}, z.core.$strip>>;
|
|
122
|
+
url: z.ZodURL;
|
|
123
|
+
}, z.core.$strip>>;
|
|
49
124
|
automations: z.ZodArray<z.ZodObject<{
|
|
50
125
|
description: z.ZodString;
|
|
51
126
|
id: z.ZodString;
|
|
@@ -67,6 +142,9 @@ export declare const deploymentContract: {
|
|
|
67
142
|
}, z.core.$strip>>;
|
|
68
143
|
}, z.core.$strip>>;
|
|
69
144
|
createdAt: z.ZodDate;
|
|
145
|
+
failure: z.ZodNullable<z.ZodObject<{
|
|
146
|
+
message: z.ZodString;
|
|
147
|
+
}, z.core.$strip>>;
|
|
70
148
|
id: z.ZodString;
|
|
71
149
|
git: z.ZodNullable<z.ZodObject<{
|
|
72
150
|
commitSha: z.ZodString;
|
|
@@ -74,26 +152,104 @@ export declare const deploymentContract: {
|
|
|
74
152
|
projectPath: z.ZodString;
|
|
75
153
|
repositoryUrl: z.ZodString;
|
|
76
154
|
}, z.core.$strip>>;
|
|
77
|
-
job: z.ZodNullable<z.ZodObject<{
|
|
78
|
-
attempts: z.ZodNumber;
|
|
79
|
-
error: z.ZodNullable<z.ZodString>;
|
|
80
|
-
maxAttempts: z.ZodNumber;
|
|
81
|
-
nextRunAt: z.ZodDate;
|
|
82
|
-
}, z.core.$strip>>;
|
|
83
155
|
project: z.ZodObject<{
|
|
84
156
|
id: z.ZodString;
|
|
85
157
|
name: z.ZodString;
|
|
158
|
+
organization: z.ZodObject<{
|
|
159
|
+
id: z.ZodString;
|
|
160
|
+
name: z.ZodString;
|
|
161
|
+
}, z.core.$strip>;
|
|
86
162
|
}, z.core.$strip>;
|
|
87
163
|
status: z.ZodEnum<{
|
|
88
164
|
succeeded: "succeeded";
|
|
89
165
|
failed: "failed";
|
|
90
|
-
planning: "planning";
|
|
91
166
|
awaiting_authorization: "awaiting_authorization";
|
|
92
167
|
configuring: "configuring";
|
|
93
168
|
publishing: "publishing";
|
|
169
|
+
planning: "planning";
|
|
94
170
|
cancelled: "cancelled";
|
|
95
171
|
}>;
|
|
96
172
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
173
|
+
list: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodPrefault<z.ZodObject<{
|
|
174
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
175
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
176
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
177
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
178
|
+
since: z.ZodOptional<z.ZodDate>;
|
|
179
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
180
|
+
succeeded: "succeeded";
|
|
181
|
+
failed: "failed";
|
|
182
|
+
awaiting_authorization: "awaiting_authorization";
|
|
183
|
+
configuring: "configuring";
|
|
184
|
+
publishing: "publishing";
|
|
185
|
+
planning: "planning";
|
|
186
|
+
cancelled: "cancelled";
|
|
187
|
+
}>>;
|
|
188
|
+
until: z.ZodOptional<z.ZodDate>;
|
|
189
|
+
}, z.core.$strip>>, z.ZodObject<{
|
|
190
|
+
items: z.ZodArray<z.ZodObject<{
|
|
191
|
+
authorization: z.ZodNullable<z.ZodObject<{
|
|
192
|
+
requirements: z.ZodArray<z.ZodObject<{
|
|
193
|
+
binding: z.ZodString;
|
|
194
|
+
satisfied: z.ZodBoolean;
|
|
195
|
+
serviceId: z.ZodString;
|
|
196
|
+
}, z.core.$strip>>;
|
|
197
|
+
url: z.ZodURL;
|
|
198
|
+
}, z.core.$strip>>;
|
|
199
|
+
automations: z.ZodArray<z.ZodObject<{
|
|
200
|
+
description: z.ZodString;
|
|
201
|
+
id: z.ZodString;
|
|
202
|
+
identityKey: z.ZodString;
|
|
203
|
+
scopes: z.ZodArray<z.ZodObject<{
|
|
204
|
+
name: z.ZodOptional<z.ZodString>;
|
|
205
|
+
path: z.ZodArray<z.ZodNumber>;
|
|
206
|
+
presentation: z.ZodEnum<{
|
|
207
|
+
collapsed: "collapsed";
|
|
208
|
+
expanded: "expanded";
|
|
209
|
+
hidden: "hidden";
|
|
210
|
+
}>;
|
|
211
|
+
}, z.core.$strip>>;
|
|
212
|
+
subscriptions: z.ZodArray<z.ZodObject<{
|
|
213
|
+
config: z.ZodJSONSchema;
|
|
214
|
+
eventType: z.ZodString;
|
|
215
|
+
hookSlot: z.ZodNumber;
|
|
216
|
+
scopePath: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
|
|
217
|
+
}, z.core.$strip>>;
|
|
218
|
+
}, z.core.$strip>>;
|
|
219
|
+
createdAt: z.ZodDate;
|
|
220
|
+
failure: z.ZodNullable<z.ZodObject<{
|
|
221
|
+
message: z.ZodString;
|
|
222
|
+
}, z.core.$strip>>;
|
|
223
|
+
id: z.ZodString;
|
|
224
|
+
git: z.ZodNullable<z.ZodObject<{
|
|
225
|
+
commitSha: z.ZodString;
|
|
226
|
+
dirty: z.ZodBoolean;
|
|
227
|
+
projectPath: z.ZodString;
|
|
228
|
+
repositoryUrl: z.ZodString;
|
|
229
|
+
}, z.core.$strip>>;
|
|
230
|
+
project: z.ZodObject<{
|
|
231
|
+
id: z.ZodString;
|
|
232
|
+
name: z.ZodString;
|
|
233
|
+
organization: z.ZodObject<{
|
|
234
|
+
id: z.ZodString;
|
|
235
|
+
name: z.ZodString;
|
|
236
|
+
}, z.core.$strip>;
|
|
237
|
+
}, z.core.$strip>;
|
|
238
|
+
status: z.ZodEnum<{
|
|
239
|
+
succeeded: "succeeded";
|
|
240
|
+
failed: "failed";
|
|
241
|
+
awaiting_authorization: "awaiting_authorization";
|
|
242
|
+
configuring: "configuring";
|
|
243
|
+
publishing: "publishing";
|
|
244
|
+
planning: "planning";
|
|
245
|
+
cancelled: "cancelled";
|
|
246
|
+
}>;
|
|
247
|
+
}, z.core.$strip>>;
|
|
248
|
+
pageInfo: z.ZodObject<{
|
|
249
|
+
hasMore: z.ZodBoolean;
|
|
250
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
251
|
+
}, z.core.$strip>;
|
|
252
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
97
253
|
redeploy: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
98
254
|
bindings: z.ZodArray<z.ZodObject<{
|
|
99
255
|
accountId: z.ZodString;
|
|
@@ -111,10 +267,10 @@ export declare const deploymentContract: {
|
|
|
111
267
|
status: z.ZodEnum<{
|
|
112
268
|
succeeded: "succeeded";
|
|
113
269
|
failed: "failed";
|
|
114
|
-
planning: "planning";
|
|
115
270
|
awaiting_authorization: "awaiting_authorization";
|
|
116
271
|
configuring: "configuring";
|
|
117
272
|
publishing: "publishing";
|
|
273
|
+
planning: "planning";
|
|
118
274
|
cancelled: "cancelled";
|
|
119
275
|
}>;
|
|
120
276
|
}, z.core.$strip>;
|
package/dist/deployment.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
2
|
import * as z from "zod";
|
|
3
|
+
import { cursorPageOutputSchema, cursorPaginationInputSchema } from "./schemas.js";
|
|
3
4
|
/** SDK compatibility version used to select the immutable runtime image. */
|
|
4
5
|
export const AUTOMATION_SDK_VERSION = "2";
|
|
5
|
-
const
|
|
6
|
+
export const deploymentStatusSchema = z.enum([
|
|
6
7
|
"planning",
|
|
7
8
|
"awaiting_authorization",
|
|
8
9
|
"configuring",
|
|
@@ -14,7 +15,7 @@ const DEPLOYMENT_STATUS_SCHEMA = z.enum([
|
|
|
14
15
|
const DEPLOYMENT_IN_PROGRESS_ERROR = {
|
|
15
16
|
data: z.object({
|
|
16
17
|
deploymentId: z.string(),
|
|
17
|
-
status:
|
|
18
|
+
status: deploymentStatusSchema,
|
|
18
19
|
}),
|
|
19
20
|
message: "A deployment is already in progress.",
|
|
20
21
|
status: 409,
|
|
@@ -25,8 +26,67 @@ const GIT_SOURCE_SCHEMA = z.object({
|
|
|
25
26
|
projectPath: z.string(),
|
|
26
27
|
repositoryUrl: z.string().min(1),
|
|
27
28
|
});
|
|
29
|
+
const DEPLOYMENT_AUTHORIZATION_SCHEMA = z.object({
|
|
30
|
+
requirements: z
|
|
31
|
+
.object({
|
|
32
|
+
binding: z.string(),
|
|
33
|
+
satisfied: z.boolean(),
|
|
34
|
+
serviceId: z.string(),
|
|
35
|
+
})
|
|
36
|
+
.array(),
|
|
37
|
+
url: z.url(),
|
|
38
|
+
});
|
|
39
|
+
export const deploymentOutputSchema = z.object({
|
|
40
|
+
authorization: DEPLOYMENT_AUTHORIZATION_SCHEMA.nullable(),
|
|
41
|
+
automations: z
|
|
42
|
+
.object({
|
|
43
|
+
description: z.string(),
|
|
44
|
+
id: z.string(),
|
|
45
|
+
identityKey: z.string(),
|
|
46
|
+
scopes: z
|
|
47
|
+
.object({
|
|
48
|
+
name: z.string().optional(),
|
|
49
|
+
path: z.number().int().nonnegative().array().min(1),
|
|
50
|
+
presentation: z.enum(["collapsed", "expanded", "hidden"]),
|
|
51
|
+
})
|
|
52
|
+
.array(),
|
|
53
|
+
subscriptions: z
|
|
54
|
+
.object({
|
|
55
|
+
config: z.json(),
|
|
56
|
+
eventType: z.string(),
|
|
57
|
+
hookSlot: z.number().int().nonnegative(),
|
|
58
|
+
scopePath: z.number().int().nonnegative().array().default([]),
|
|
59
|
+
})
|
|
60
|
+
.array(),
|
|
61
|
+
})
|
|
62
|
+
.array(),
|
|
63
|
+
createdAt: z.date(),
|
|
64
|
+
failure: z.object({ message: z.string() }).nullable(),
|
|
65
|
+
id: z.string(),
|
|
66
|
+
git: GIT_SOURCE_SCHEMA.nullable(),
|
|
67
|
+
project: z.object({
|
|
68
|
+
id: z.string(),
|
|
69
|
+
name: z.string(),
|
|
70
|
+
organization: z.object({
|
|
71
|
+
id: z.string(),
|
|
72
|
+
name: z.string(),
|
|
73
|
+
}),
|
|
74
|
+
}),
|
|
75
|
+
status: deploymentStatusSchema,
|
|
76
|
+
});
|
|
28
77
|
export const deploymentContract = {
|
|
29
|
-
cancel: oc
|
|
78
|
+
cancel: oc
|
|
79
|
+
.route({
|
|
80
|
+
method: "DELETE",
|
|
81
|
+
path: "/deployments/{deploymentId}",
|
|
82
|
+
operationId: "cancelDeployment",
|
|
83
|
+
summary: "Cancel deployment",
|
|
84
|
+
description: "Cancels a deployment that is planning, awaiting authorization, or configuring.",
|
|
85
|
+
successStatus: 204,
|
|
86
|
+
tags: ["Deployments"],
|
|
87
|
+
})
|
|
88
|
+
.input(z.object({ deploymentId: z.string() }))
|
|
89
|
+
.output(z.void()),
|
|
30
90
|
create: oc
|
|
31
91
|
.errors({ DEPLOYMENT_IN_PROGRESS: DEPLOYMENT_IN_PROGRESS_ERROR })
|
|
32
92
|
.input(z.object({
|
|
@@ -56,48 +116,57 @@ export const deploymentContract = {
|
|
|
56
116
|
git: GIT_SOURCE_SCHEMA.optional(),
|
|
57
117
|
}))
|
|
58
118
|
.output(z.object({ id: z.string() })),
|
|
59
|
-
get: oc
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
})),
|
|
119
|
+
get: oc
|
|
120
|
+
.route({
|
|
121
|
+
method: "GET",
|
|
122
|
+
path: "/deployments/{deploymentId}",
|
|
123
|
+
operationId: "getDeployment",
|
|
124
|
+
summary: "Get deployment",
|
|
125
|
+
description: "Returns normalized deployment status, authorization requirements, and planned automations.",
|
|
126
|
+
tags: ["Deployments"],
|
|
127
|
+
})
|
|
128
|
+
.input(z.object({ deploymentId: z.string() }))
|
|
129
|
+
.output(deploymentOutputSchema),
|
|
130
|
+
list: oc
|
|
131
|
+
.route({
|
|
132
|
+
method: "GET",
|
|
133
|
+
path: "/deployments",
|
|
134
|
+
operationId: "listDeployments",
|
|
135
|
+
summary: "List deployments",
|
|
136
|
+
description: "Lists deployments visible to the caller, optionally filtered by organization, project, status, or creation time.",
|
|
137
|
+
tags: ["Deployments"],
|
|
138
|
+
})
|
|
139
|
+
.input(cursorPaginationInputSchema
|
|
140
|
+
.extend({
|
|
141
|
+
organizationId: z.string().optional(),
|
|
142
|
+
projectId: z.string().optional(),
|
|
143
|
+
since: z.date().optional(),
|
|
144
|
+
status: deploymentStatusSchema.optional(),
|
|
145
|
+
until: z.date().optional(),
|
|
146
|
+
})
|
|
147
|
+
.superRefine(({ since, until }, context) => {
|
|
148
|
+
if (since !== undefined && until !== undefined && since > until) {
|
|
149
|
+
context.addIssue({
|
|
150
|
+
code: "custom",
|
|
151
|
+
message: "Since must be before or equal to until.",
|
|
152
|
+
path: ["since"],
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
.prefault({}))
|
|
157
|
+
.output(cursorPageOutputSchema(deploymentOutputSchema)),
|
|
99
158
|
redeploy: oc
|
|
100
159
|
.errors({ DEPLOYMENT_IN_PROGRESS: DEPLOYMENT_IN_PROGRESS_ERROR })
|
|
160
|
+
.route({
|
|
161
|
+
method: "POST",
|
|
162
|
+
path: "/projects/{projectId}/deployments/redeploy",
|
|
163
|
+
operationId: "redeployProject",
|
|
164
|
+
summary: "Redeploy project",
|
|
165
|
+
description: "Creates a deployment from the project's active artifact and plans with explicit integration account bindings.",
|
|
166
|
+
successStatus: 201,
|
|
167
|
+
successDescription: "Redeployment created.",
|
|
168
|
+
tags: ["Deployments"],
|
|
169
|
+
})
|
|
101
170
|
.input(z.object({
|
|
102
171
|
bindings: z
|
|
103
172
|
.object({
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const googleMeetEventsContract: {
|
|
3
|
+
googleMeetPush: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
4
|
+
message: z.ZodObject<{
|
|
5
|
+
attributes: z.ZodObject<{
|
|
6
|
+
"ce-datacontenttype": z.ZodLiteral<"application/json">;
|
|
7
|
+
"ce-id": z.ZodString;
|
|
8
|
+
"ce-source": z.ZodString;
|
|
9
|
+
"ce-specversion": z.ZodLiteral<"1.0">;
|
|
10
|
+
"ce-subject": z.ZodString;
|
|
11
|
+
"ce-time": z.ZodISODateTime;
|
|
12
|
+
"ce-type": z.ZodString;
|
|
13
|
+
}, z.core.$loose>;
|
|
14
|
+
data: z.ZodString;
|
|
15
|
+
messageId: z.ZodString;
|
|
16
|
+
publishTime: z.ZodISODateTime;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
subscription: z.ZodLiteral<"projects/opkitty/subscriptions/automate-ax-google-meet-push">;
|
|
19
|
+
}, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { oc } from "@orpc/contract";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export const googleMeetEventsContract = {
|
|
4
|
+
googleMeetPush: oc
|
|
5
|
+
.route({
|
|
6
|
+
method: "POST",
|
|
7
|
+
path: "/events/google-meet",
|
|
8
|
+
operationId: "receiveGoogleMeetPush",
|
|
9
|
+
summary: "Receive a Google Meet push notification",
|
|
10
|
+
description: "Receives and authenticates Google Meet CloudEvents delivered by Google Cloud Pub/Sub.",
|
|
11
|
+
tags: ["Events"],
|
|
12
|
+
successStatus: 204,
|
|
13
|
+
})
|
|
14
|
+
.input(z.object({
|
|
15
|
+
/** Pub/Sub message containing one encoded Google Workspace CloudEvent. */
|
|
16
|
+
message: z.object({
|
|
17
|
+
/** CloudEvent routing attributes supplied by Pub/Sub. */
|
|
18
|
+
attributes: z.looseObject({
|
|
19
|
+
"ce-datacontenttype": z.literal("application/json"),
|
|
20
|
+
"ce-id": z.string().min(1),
|
|
21
|
+
"ce-source": z.string().min(1),
|
|
22
|
+
"ce-specversion": z.literal("1.0"),
|
|
23
|
+
"ce-subject": z.string().min(1),
|
|
24
|
+
"ce-time": z.iso.datetime({ offset: true }),
|
|
25
|
+
"ce-type": z.string().min(1),
|
|
26
|
+
}),
|
|
27
|
+
/** Base64-encoded CloudEvent data. */
|
|
28
|
+
data: z.string().min(1),
|
|
29
|
+
/** Pub/Sub message identifier. */
|
|
30
|
+
messageId: z.string().min(1),
|
|
31
|
+
/** RFC 3339 time at which Pub/Sub published the notification. */
|
|
32
|
+
publishTime: z.iso.datetime({ offset: true }),
|
|
33
|
+
}),
|
|
34
|
+
/** Pub/Sub subscription that delivered the message. */
|
|
35
|
+
subscription: z.literal("projects/opkitty/subscriptions/automate-ax-google-meet-push"),
|
|
36
|
+
}))
|
|
37
|
+
.output(z.void()),
|
|
38
|
+
};
|
package/dist/events/index.d.ts
CHANGED
|
@@ -64,6 +64,23 @@ export declare const eventsContract: {
|
|
|
64
64
|
}, import("zod/v4/core").$strip>;
|
|
65
65
|
subscription: import("zod").ZodLiteral<"projects/opkitty/subscriptions/automate-ax-gmail-push">;
|
|
66
66
|
}, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
67
|
+
googleMeetPush: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
68
|
+
message: import("zod").ZodObject<{
|
|
69
|
+
attributes: import("zod").ZodObject<{
|
|
70
|
+
"ce-datacontenttype": import("zod").ZodLiteral<"application/json">;
|
|
71
|
+
"ce-id": import("zod").ZodString;
|
|
72
|
+
"ce-source": import("zod").ZodString;
|
|
73
|
+
"ce-specversion": import("zod").ZodLiteral<"1.0">;
|
|
74
|
+
"ce-subject": import("zod").ZodString;
|
|
75
|
+
"ce-time": import("zod").ZodISODateTime;
|
|
76
|
+
"ce-type": import("zod").ZodString;
|
|
77
|
+
}, import("zod/v4/core").$loose>;
|
|
78
|
+
data: import("zod").ZodString;
|
|
79
|
+
messageId: import("zod").ZodString;
|
|
80
|
+
publishTime: import("zod").ZodISODateTime;
|
|
81
|
+
}, import("zod/v4/core").$strip>;
|
|
82
|
+
subscription: import("zod").ZodLiteral<"projects/opkitty/subscriptions/automate-ax-google-meet-push">;
|
|
83
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
67
84
|
googleFormsPush: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
68
85
|
message: import("zod").ZodObject<{
|
|
69
86
|
attributes: import("zod").ZodObject<{
|
package/dist/events/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { asanaEventsContract } from "./asana.js";
|
|
|
3
3
|
import { brevoEventsContract } from "./brevo.js";
|
|
4
4
|
import { googleCalendarEventsContract } from "./google-calendar.js";
|
|
5
5
|
import { googleFormsEventsContract } from "./google-forms.js";
|
|
6
|
+
import { googleMeetEventsContract } from "./google-meet.js";
|
|
6
7
|
import { gmailEventsContract } from "./gmail.js";
|
|
7
8
|
import { githubEventsContract } from "./github.js";
|
|
8
9
|
import { linearEventsContract } from "./linear.js";
|
|
@@ -19,6 +20,7 @@ export const eventsContract = {
|
|
|
19
20
|
...brevoEventsContract,
|
|
20
21
|
...googleCalendarEventsContract,
|
|
21
22
|
...googleFormsEventsContract,
|
|
23
|
+
...googleMeetEventsContract,
|
|
22
24
|
...gmailEventsContract,
|
|
23
25
|
...githubEventsContract,
|
|
24
26
|
...linearEventsContract,
|