@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.
- package/dist/account.d.ts +373 -8
- package/dist/account.js +245 -14
- package/dist/api-key.d.ts +17 -9
- package/dist/api-key.js +4 -4
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +1 -1
- package/dist/authorization.d.ts +5 -5
- package/dist/authorization.js +21 -5
- package/dist/automation.d.ts +171 -6
- package/dist/automation.js +83 -3
- package/dist/deployment.d.ts +166 -10
- package/dist/deployment.js +113 -44
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +1 -1
- package/dist/events/airtable.d.ts +1 -1
- package/dist/events/airtable.js +1 -1
- package/dist/events/asana.d.ts +1 -1
- package/dist/events/asana.js +1 -1
- package/dist/events/brevo.d.ts +1 -1
- package/dist/events/brevo.js +1 -1
- package/dist/events/github.d.ts +1 -1
- package/dist/events/github.js +1 -1
- package/dist/events/gmail.d.ts +1 -1
- package/dist/events/gmail.js +1 -1
- package/dist/events/google-calendar.d.ts +1 -1
- package/dist/events/google-calendar.js +1 -1
- package/dist/events/google-forms.d.ts +1 -1
- package/dist/events/google-forms.js +1 -1
- 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/events/linear.d.ts +1 -1
- package/dist/events/linear.js +1 -1
- package/dist/events/mailhook.d.ts +1 -1
- package/dist/events/mailhook.js +1 -1
- package/dist/events/microsoft.d.ts +1 -1
- package/dist/events/microsoft.js +1 -1
- package/dist/events/resend.d.ts +1 -1
- package/dist/events/resend.js +1 -1
- package/dist/events/slack.d.ts +1 -1
- package/dist/events/slack.js +1 -1
- package/dist/events/trello.d.ts +1 -1
- package/dist/events/trello.js +1 -1
- package/dist/events/vercel.d.ts +1 -1
- package/dist/events/vercel.js +1 -1
- package/dist/events/whatsapp.d.ts +1 -1
- package/dist/events/whatsapp.js +1 -1
- 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 +44 -36
- package/dist/org.js +6 -6
- package/dist/project.d.ts +24 -16
- package/dist/project.js +6 -6
- package/dist/runtime.d.ts +38 -3
- package/dist/runtime.js +54 -2
- package/dist/schemas.d.ts +21 -1
- package/dist/schemas.js +20 -1
- package/package.json +17 -6
- package/src/account.ts +263 -18
- package/src/api-key.ts +8 -4
- package/src/auth.ts +1 -1
- package/src/authorization.ts +23 -5
- package/src/automation.ts +90 -3
- package/src/deployment.ts +119 -44
- package/src/errors.ts +1 -1
- package/src/events/airtable.ts +1 -1
- package/src/events/asana.ts +1 -1
- package/src/events/brevo.ts +1 -1
- package/src/events/github.ts +1 -1
- package/src/events/gmail.ts +1 -1
- package/src/events/google-calendar.ts +1 -1
- package/src/events/google-forms.ts +1 -1
- package/src/events/google-meet.ts +48 -0
- package/src/events/index.ts +2 -0
- package/src/events/linear.ts +1 -1
- package/src/events/mailhook.ts +1 -1
- package/src/events/microsoft.ts +1 -1
- package/src/events/resend.ts +1 -1
- package/src/events/slack.ts +1 -1
- package/src/events/trello.ts +1 -1
- package/src/events/vercel.ts +1 -1
- package/src/events/whatsapp.ts +1 -1
- package/src/execution-data.ts +69 -0
- package/src/index.ts +61 -8
- package/src/org.ts +10 -6
- package/src/project.ts +10 -6
- package/src/runtime.ts +68 -2
- package/src/schemas.ts +23 -1
package/dist/account.js
CHANGED
|
@@ -1,8 +1,83 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
import { cursorPageOutputSchema, cursorPaginationInputSchema } from "./schemas.js";
|
|
4
|
+
const INTEGRATION_FORM_FIELD_SCHEMA = z.discriminatedUnion("input", [
|
|
5
|
+
z.object({
|
|
6
|
+
default: z.boolean().optional(),
|
|
7
|
+
description: z.string().optional(),
|
|
8
|
+
input: z.literal("boolean"),
|
|
9
|
+
label: z.string(),
|
|
10
|
+
name: z.string(),
|
|
11
|
+
required: z.boolean(),
|
|
12
|
+
}),
|
|
13
|
+
z.object({
|
|
14
|
+
default: z.number().optional(),
|
|
15
|
+
description: z.string().optional(),
|
|
16
|
+
input: z.literal("number"),
|
|
17
|
+
label: z.string(),
|
|
18
|
+
name: z.string(),
|
|
19
|
+
placeholder: z.string().optional(),
|
|
20
|
+
required: z.boolean(),
|
|
21
|
+
}),
|
|
22
|
+
z.object({
|
|
23
|
+
description: z.string().optional(),
|
|
24
|
+
input: z.literal("password"),
|
|
25
|
+
label: z.string(),
|
|
26
|
+
name: z.string(),
|
|
27
|
+
placeholder: z.string().optional(),
|
|
28
|
+
required: z.boolean(),
|
|
29
|
+
}),
|
|
30
|
+
z.object({
|
|
31
|
+
default: z.string().optional(),
|
|
32
|
+
description: z.string().optional(),
|
|
33
|
+
input: z.enum(["email", "text", "url"]),
|
|
34
|
+
label: z.string(),
|
|
35
|
+
name: z.string(),
|
|
36
|
+
placeholder: z.string().optional(),
|
|
37
|
+
required: z.boolean(),
|
|
38
|
+
}),
|
|
39
|
+
]);
|
|
40
|
+
export const integrationServiceOutputSchema = z.object({
|
|
41
|
+
connectionMethods: z
|
|
42
|
+
.discriminatedUnion("type", [
|
|
43
|
+
z.object({
|
|
44
|
+
description: z.string().optional(),
|
|
45
|
+
id: z.string(),
|
|
46
|
+
name: z.string(),
|
|
47
|
+
type: z.literal("redirect"),
|
|
48
|
+
}),
|
|
49
|
+
z.object({
|
|
50
|
+
description: z.string().optional(),
|
|
51
|
+
fields: INTEGRATION_FORM_FIELD_SCHEMA.array(),
|
|
52
|
+
id: z.string(),
|
|
53
|
+
name: z.string(),
|
|
54
|
+
type: z.literal("form"),
|
|
55
|
+
}),
|
|
56
|
+
])
|
|
57
|
+
.array(),
|
|
58
|
+
connectionNotice: z
|
|
59
|
+
.object({
|
|
60
|
+
action: z.object({ href: z.string(), label: z.string() }),
|
|
61
|
+
description: z.string(),
|
|
62
|
+
title: z.string(),
|
|
63
|
+
})
|
|
64
|
+
.optional(),
|
|
65
|
+
description: z.string().optional(),
|
|
66
|
+
icon: z.string().optional(),
|
|
67
|
+
id: z.string(),
|
|
68
|
+
name: z.string(),
|
|
69
|
+
preferredConnectionMethodId: z.string().optional(),
|
|
70
|
+
});
|
|
71
|
+
export const integrationAccountRevocationOutputSchema = z.object({
|
|
72
|
+
completedAt: z.date().nullable(),
|
|
73
|
+
error: z.string().nullable(),
|
|
74
|
+
id: z.string(),
|
|
75
|
+
requestedAt: z.date(),
|
|
76
|
+
status: z.enum(["pending", "succeeded", "failed", "unsupported"]),
|
|
77
|
+
});
|
|
78
|
+
export const integrationAccountBindingOutputSchema = z.object({
|
|
4
79
|
checkedAt: z.date().nullable(),
|
|
5
|
-
|
|
80
|
+
connectionMethodId: z.string().min(1),
|
|
6
81
|
error: z
|
|
7
82
|
.object({
|
|
8
83
|
code: z.string(),
|
|
@@ -15,40 +90,196 @@ export const integrationAccountOutputSchema = z.object({
|
|
|
15
90
|
serviceId: z.string(),
|
|
16
91
|
serviceSub: z.string(),
|
|
17
92
|
});
|
|
93
|
+
export const integrationAccountOutputSchema = integrationAccountBindingOutputSchema.extend({
|
|
94
|
+
revokedAt: z.date().nullable(),
|
|
95
|
+
revocation: integrationAccountRevocationOutputSchema.nullable(),
|
|
96
|
+
status: z.enum([
|
|
97
|
+
"active",
|
|
98
|
+
"revocation_pending",
|
|
99
|
+
"revocation_failed",
|
|
100
|
+
"revoked",
|
|
101
|
+
]),
|
|
102
|
+
});
|
|
103
|
+
export const integrationAccountRevocationImpactOutputSchema = z.object({
|
|
104
|
+
accessibleOrganizations: z
|
|
105
|
+
.object({
|
|
106
|
+
id: z.string(),
|
|
107
|
+
name: z.string(),
|
|
108
|
+
projects: z
|
|
109
|
+
.object({
|
|
110
|
+
automations: z
|
|
111
|
+
.object({
|
|
112
|
+
enabled: z.boolean(),
|
|
113
|
+
id: z.string(),
|
|
114
|
+
identityKey: z.string(),
|
|
115
|
+
})
|
|
116
|
+
.array(),
|
|
117
|
+
id: z.string(),
|
|
118
|
+
name: z.string(),
|
|
119
|
+
pendingDeployments: z
|
|
120
|
+
.object({
|
|
121
|
+
id: z.string(),
|
|
122
|
+
status: z.enum([
|
|
123
|
+
"awaiting_authorization",
|
|
124
|
+
"configuring",
|
|
125
|
+
"publishing",
|
|
126
|
+
]),
|
|
127
|
+
})
|
|
128
|
+
.array(),
|
|
129
|
+
})
|
|
130
|
+
.array(),
|
|
131
|
+
})
|
|
132
|
+
.array(),
|
|
133
|
+
account: integrationAccountOutputSchema
|
|
134
|
+
.pick({
|
|
135
|
+
id: true,
|
|
136
|
+
label: true,
|
|
137
|
+
revokedAt: true,
|
|
138
|
+
revocation: true,
|
|
139
|
+
serviceId: true,
|
|
140
|
+
serviceSub: true,
|
|
141
|
+
status: true,
|
|
142
|
+
})
|
|
143
|
+
.extend({
|
|
144
|
+
connectionMethodId: z.string(),
|
|
145
|
+
providerRevocationSupported: z.boolean(),
|
|
146
|
+
}),
|
|
147
|
+
hiddenOrganizationCount: z.number().int().nonnegative(),
|
|
148
|
+
totals: z.object({
|
|
149
|
+
automations: z.number().int().nonnegative(),
|
|
150
|
+
organizations: z.number().int().positive(),
|
|
151
|
+
pendingDeployments: z.number().int().nonnegative(),
|
|
152
|
+
projects: z.number().int().nonnegative(),
|
|
153
|
+
}),
|
|
154
|
+
});
|
|
155
|
+
const organizationAccountInputSchema = z.object({
|
|
156
|
+
accountId: z.string(),
|
|
157
|
+
organizationId: z.string(),
|
|
158
|
+
});
|
|
18
159
|
export const accountContract = {
|
|
19
160
|
beginConnection: oc
|
|
161
|
+
.route({
|
|
162
|
+
description: "Starts an OAuth-style organization account connection.",
|
|
163
|
+
method: "POST",
|
|
164
|
+
operationId: "beginIntegrationAccountConnection",
|
|
165
|
+
path: "/organizations/{organizationId}/integration-account-connections",
|
|
166
|
+
successStatus: 201,
|
|
167
|
+
summary: "Begin integration account connection",
|
|
168
|
+
tags: ["Integration Accounts"],
|
|
169
|
+
})
|
|
20
170
|
.input(z.object({
|
|
21
|
-
|
|
171
|
+
connectionMethodId: z.string().min(1),
|
|
22
172
|
organizationId: z.string(),
|
|
23
173
|
scopes: z.string().array().default([]),
|
|
24
174
|
serviceId: z.string().min(1),
|
|
25
175
|
}))
|
|
26
176
|
.output(z.object({ flowId: z.string(), url: z.url() })),
|
|
27
177
|
connectionStatus: oc
|
|
178
|
+
.route({
|
|
179
|
+
description: "Returns the current state of a redirect connection flow.",
|
|
180
|
+
method: "GET",
|
|
181
|
+
operationId: "getIntegrationAccountConnection",
|
|
182
|
+
path: "/organizations/{organizationId}/integration-account-connections/{flowId}",
|
|
183
|
+
summary: "Get integration account connection",
|
|
184
|
+
tags: ["Integration Accounts"],
|
|
185
|
+
})
|
|
28
186
|
.input(z.object({
|
|
29
187
|
flowId: z.string(),
|
|
30
188
|
organizationId: z.string(),
|
|
31
189
|
}))
|
|
32
190
|
.output(z.discriminatedUnion("status", [
|
|
33
191
|
z.object({ status: z.literal("pending") }),
|
|
34
|
-
z.object({
|
|
192
|
+
z.object({
|
|
193
|
+
accountId: z.string().nullable(),
|
|
194
|
+
status: z.literal("succeeded"),
|
|
195
|
+
}),
|
|
35
196
|
z.object({ message: z.string(), status: z.literal("failed") }),
|
|
36
197
|
])),
|
|
37
|
-
|
|
38
|
-
.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
198
|
+
disconnect: oc
|
|
199
|
+
.route({
|
|
200
|
+
description: "Removes an integration account from one organization without revoking it elsewhere.",
|
|
201
|
+
method: "DELETE",
|
|
202
|
+
operationId: "disconnectIntegrationAccount",
|
|
203
|
+
path: "/organizations/{organizationId}/integration-accounts/{accountId}",
|
|
204
|
+
summary: "Disconnect integration account",
|
|
205
|
+
tags: ["Integration Accounts"],
|
|
206
|
+
})
|
|
207
|
+
.input(organizationAccountInputSchema)
|
|
42
208
|
.output(z.object({ txid: z.number().int().nonnegative() })),
|
|
43
|
-
get: oc
|
|
44
|
-
|
|
209
|
+
get: oc
|
|
210
|
+
.route({
|
|
211
|
+
description: "Returns one integration account linked to an organization.",
|
|
212
|
+
method: "GET",
|
|
213
|
+
operationId: "getIntegrationAccount",
|
|
214
|
+
path: "/organizations/{organizationId}/integration-accounts/{accountId}",
|
|
215
|
+
summary: "Get integration account",
|
|
216
|
+
tags: ["Integration Accounts"],
|
|
217
|
+
})
|
|
218
|
+
.input(organizationAccountInputSchema)
|
|
219
|
+
.output(integrationAccountOutputSchema),
|
|
220
|
+
list: oc
|
|
221
|
+
.route({
|
|
222
|
+
description: "Lists integration accounts linked to an organization.",
|
|
223
|
+
method: "GET",
|
|
224
|
+
operationId: "listIntegrationAccounts",
|
|
225
|
+
path: "/organizations/{organizationId}/integration-accounts",
|
|
226
|
+
summary: "List integration accounts",
|
|
227
|
+
tags: ["Integration Accounts"],
|
|
228
|
+
})
|
|
229
|
+
.input(cursorPaginationInputSchema.extend({ organizationId: z.string() }))
|
|
230
|
+
.output(cursorPageOutputSchema(integrationAccountOutputSchema.extend({ createdAt: z.date() }))),
|
|
231
|
+
listServices: oc
|
|
232
|
+
.route({
|
|
233
|
+
description: "Lists enabled integration services and their connection methods.",
|
|
234
|
+
method: "GET",
|
|
235
|
+
operationId: "listIntegrationServices",
|
|
236
|
+
path: "/integration-services",
|
|
237
|
+
summary: "List integration services",
|
|
238
|
+
tags: ["Integration Accounts"],
|
|
239
|
+
})
|
|
240
|
+
.input(z.object({}).default({}))
|
|
241
|
+
.output(integrationServiceOutputSchema.array()),
|
|
242
|
+
revocationImpact: oc
|
|
243
|
+
.route({
|
|
244
|
+
description: "Previews platform-wide revocation while redacting inaccessible organizations.",
|
|
245
|
+
method: "GET",
|
|
246
|
+
operationId: "getIntegrationAccountRevocationImpact",
|
|
247
|
+
path: "/organizations/{organizationId}/integration-accounts/{accountId}/revocation-impact",
|
|
248
|
+
summary: "Preview integration account revocation",
|
|
249
|
+
tags: ["Integration Accounts"],
|
|
250
|
+
})
|
|
251
|
+
.input(organizationAccountInputSchema)
|
|
252
|
+
.output(integrationAccountRevocationImpactOutputSchema),
|
|
253
|
+
revoke: oc
|
|
254
|
+
.route({
|
|
255
|
+
description: "Immediately blocks and globally revokes a shared integration account.",
|
|
256
|
+
method: "POST",
|
|
257
|
+
operationId: "revokeIntegrationAccount",
|
|
258
|
+
path: "/organizations/{organizationId}/integration-accounts/{accountId}/revoke",
|
|
259
|
+
successStatus: 202,
|
|
260
|
+
summary: "Revoke integration account",
|
|
261
|
+
tags: ["Integration Accounts"],
|
|
262
|
+
})
|
|
263
|
+
.input(organizationAccountInputSchema)
|
|
264
|
+
.output(z.object({
|
|
265
|
+
revocation: integrationAccountRevocationOutputSchema,
|
|
266
|
+
txid: z.number().int().nonnegative(),
|
|
45
267
|
})),
|
|
46
268
|
submitCredentials: oc
|
|
269
|
+
.route({
|
|
270
|
+
description: "Validates secret form credentials and links the resulting account.",
|
|
271
|
+
method: "POST",
|
|
272
|
+
operationId: "connectIntegrationAccountCredentials",
|
|
273
|
+
path: "/organizations/{organizationId}/integration-account-credentials",
|
|
274
|
+
successStatus: 201,
|
|
275
|
+
summary: "Connect integration account credentials",
|
|
276
|
+
tags: ["Integration Accounts"],
|
|
277
|
+
})
|
|
47
278
|
.input(z.object({
|
|
48
|
-
|
|
279
|
+
connectionMethodId: z.string().min(1),
|
|
49
280
|
data: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])),
|
|
50
281
|
organizationId: z.string(),
|
|
51
282
|
serviceId: z.string().min(1),
|
|
52
283
|
}))
|
|
53
|
-
.output(z.
|
|
284
|
+
.output(z.object({ accountId: z.string() })),
|
|
54
285
|
};
|
package/dist/api-key.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
export declare const organizationApiKeyOutputSchema: z.ZodObject<{
|
|
3
3
|
id: z.ZodString;
|
|
4
4
|
name: z.ZodNullable<z.ZodString>;
|
|
@@ -33,15 +33,23 @@ export declare const apiKeyContract: {
|
|
|
33
33
|
keyId: z.ZodString;
|
|
34
34
|
}, z.core.$strip>, z.ZodVoid, Record<never, never>, Record<never, never>>;
|
|
35
35
|
list: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
36
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
37
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
36
38
|
organizationId: z.ZodString;
|
|
37
|
-
}, z.core.$strip>, z.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
40
|
+
items: z.ZodArray<z.ZodObject<{
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
name: z.ZodNullable<z.ZodString>;
|
|
43
|
+
start: z.ZodNullable<z.ZodString>;
|
|
44
|
+
createdAt: z.ZodDate;
|
|
45
|
+
updatedAt: z.ZodDate;
|
|
46
|
+
expiresAt: z.ZodNullable<z.ZodDate>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
pageInfo: z.ZodObject<{
|
|
49
|
+
hasMore: z.ZodBoolean;
|
|
50
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
45
53
|
update: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
46
54
|
keyId: z.ZodString;
|
|
47
55
|
name: z.ZodString;
|
package/dist/api-key.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
-
import
|
|
3
|
-
import { reasonableNameSchema } from "./schemas.js";
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
import { cursorPageOutputSchema, cursorPaginationInputSchema, reasonableNameSchema, } from "./schemas.js";
|
|
4
4
|
export const organizationApiKeyOutputSchema = z.object({
|
|
5
5
|
id: z.string(),
|
|
6
6
|
name: z.string().nullable(),
|
|
@@ -50,8 +50,8 @@ export const apiKeyContract = {
|
|
|
50
50
|
description: "Lists API keys owned by an organization. Requires apiKey:read.",
|
|
51
51
|
tags: ["API Keys"],
|
|
52
52
|
})
|
|
53
|
-
.input(
|
|
54
|
-
.output(organizationApiKeyOutputSchema
|
|
53
|
+
.input(cursorPaginationInputSchema.extend({ organizationId: z.string() }))
|
|
54
|
+
.output(cursorPageOutputSchema(organizationApiKeyOutputSchema)),
|
|
55
55
|
update: oc
|
|
56
56
|
.route({
|
|
57
57
|
method: "PATCH",
|
package/dist/auth.d.ts
CHANGED
package/dist/auth.js
CHANGED
package/dist/authorization.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
type ScopeRequirement = string | {
|
|
3
3
|
requirements: ScopeRequirement[];
|
|
4
4
|
type: "and" | "or";
|
|
@@ -6,7 +6,7 @@ type ScopeRequirement = string | {
|
|
|
6
6
|
export declare const authorizationContract: {
|
|
7
7
|
beginConnection: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
8
8
|
binding: z.ZodString;
|
|
9
|
-
|
|
9
|
+
connectionMethodId: z.ZodString;
|
|
10
10
|
deploymentId: z.ZodString;
|
|
11
11
|
serviceId: z.ZodString;
|
|
12
12
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -24,7 +24,7 @@ export declare const authorizationContract: {
|
|
|
24
24
|
}, z.core.$strip>, z.ZodObject<{
|
|
25
25
|
accounts: z.ZodArray<z.ZodObject<{
|
|
26
26
|
checkedAt: z.ZodNullable<z.ZodDate>;
|
|
27
|
-
|
|
27
|
+
connectionMethodId: z.ZodString;
|
|
28
28
|
error: z.ZodNullable<z.ZodObject<{
|
|
29
29
|
code: z.ZodString;
|
|
30
30
|
message: z.ZodString;
|
|
@@ -39,7 +39,7 @@ export declare const authorizationContract: {
|
|
|
39
39
|
accountId: z.ZodNullable<z.ZodString>;
|
|
40
40
|
binding: z.ZodString;
|
|
41
41
|
connections: z.ZodArray<z.ZodObject<{
|
|
42
|
-
|
|
42
|
+
connectionMethodId: z.ZodString;
|
|
43
43
|
minimalScopes: z.ZodArray<z.ZodString>;
|
|
44
44
|
requiredScopes: z.ZodArray<z.ZodType<ScopeRequirement, unknown, z.core.$ZodTypeInternals<ScopeRequirement, unknown>>>;
|
|
45
45
|
}, z.core.$strip>>;
|
|
@@ -55,7 +55,7 @@ export declare const authorizationContract: {
|
|
|
55
55
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
56
56
|
submitCredentials: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
57
57
|
binding: z.ZodString;
|
|
58
|
-
|
|
58
|
+
connectionMethodId: z.ZodString;
|
|
59
59
|
data: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
60
60
|
deploymentId: z.ZodString;
|
|
61
61
|
serviceId: z.ZodString;
|
package/dist/authorization.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
-
import
|
|
2
|
+
import * as z from "zod";
|
|
3
3
|
const SCOPE_REQUIREMENT_SCHEMA = z.lazy(() => z.union([
|
|
4
4
|
z.string(),
|
|
5
5
|
z.strictObject({
|
|
@@ -11,7 +11,7 @@ export const authorizationContract = {
|
|
|
11
11
|
beginConnection: oc
|
|
12
12
|
.input(z.object({
|
|
13
13
|
binding: z.string().min(1),
|
|
14
|
-
|
|
14
|
+
connectionMethodId: z.string().min(1),
|
|
15
15
|
deploymentId: z.string(),
|
|
16
16
|
serviceId: z.string().min(1),
|
|
17
17
|
}))
|
|
@@ -33,6 +33,14 @@ export const authorizationContract = {
|
|
|
33
33
|
headers: z.object({ location: z.url() }),
|
|
34
34
|
})),
|
|
35
35
|
get: oc
|
|
36
|
+
.route({
|
|
37
|
+
method: "GET",
|
|
38
|
+
path: "/deployments/{deploymentId}/authorization",
|
|
39
|
+
operationId: "getDeploymentAuthorization",
|
|
40
|
+
summary: "Get deployment authorization",
|
|
41
|
+
description: "Returns connected accounts and the authorization requirements for a deployment.",
|
|
42
|
+
tags: ["Deployments"],
|
|
43
|
+
})
|
|
36
44
|
.input(z.object({
|
|
37
45
|
deploymentId: z.string(),
|
|
38
46
|
}))
|
|
@@ -40,7 +48,7 @@ export const authorizationContract = {
|
|
|
40
48
|
accounts: z
|
|
41
49
|
.object({
|
|
42
50
|
checkedAt: z.date().nullable(),
|
|
43
|
-
|
|
51
|
+
connectionMethodId: z.string().min(1),
|
|
44
52
|
error: z
|
|
45
53
|
.object({
|
|
46
54
|
code: z.string(),
|
|
@@ -60,7 +68,7 @@ export const authorizationContract = {
|
|
|
60
68
|
binding: z.string(),
|
|
61
69
|
connections: z
|
|
62
70
|
.object({
|
|
63
|
-
|
|
71
|
+
connectionMethodId: z.string().min(1),
|
|
64
72
|
minimalScopes: z.string().array(),
|
|
65
73
|
requiredScopes: SCOPE_REQUIREMENT_SCHEMA.array(),
|
|
66
74
|
})
|
|
@@ -73,12 +81,20 @@ export const authorizationContract = {
|
|
|
73
81
|
.array(),
|
|
74
82
|
})),
|
|
75
83
|
proceed: oc
|
|
84
|
+
.route({
|
|
85
|
+
method: "POST",
|
|
86
|
+
path: "/deployments/{deploymentId}/authorization/proceed",
|
|
87
|
+
operationId: "proceedWithDeploymentAuthorization",
|
|
88
|
+
summary: "Proceed with deployment authorization",
|
|
89
|
+
description: "Continues a deployment after every integration requirement is satisfied.",
|
|
90
|
+
tags: ["Deployments"],
|
|
91
|
+
})
|
|
76
92
|
.input(z.object({ deploymentId: z.string() }))
|
|
77
93
|
.output(z.object({ txid: z.number().int().nonnegative() })),
|
|
78
94
|
submitCredentials: oc
|
|
79
95
|
.input(z.object({
|
|
80
96
|
binding: z.string().min(1),
|
|
81
|
-
|
|
97
|
+
connectionMethodId: z.string().min(1),
|
|
82
98
|
data: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])),
|
|
83
99
|
deploymentId: z.string(),
|
|
84
100
|
serviceId: z.string().min(1),
|