@automate.ax/api-contract 0.14.0 → 0.15.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/authorization.d.ts +71 -6
- package/dist/authorization.js +28 -12
- package/dist/index.d.ts +46 -21
- package/dist/index.js +1 -1
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.js +1 -0
- package/package.json +2 -2
- package/src/authorization.ts +29 -6
- package/src/index.ts +2 -0
- package/src/runtime.ts +1 -0
package/dist/authorization.d.ts
CHANGED
|
@@ -1,8 +1,58 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export declare const integrationConnectionManifestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
description: z.ZodOptional<z.ZodString>;
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
type: z.ZodLiteral<"redirect">;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
description: z.ZodOptional<z.ZodString>;
|
|
9
|
+
fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
10
|
+
description: z.ZodOptional<z.ZodString>;
|
|
11
|
+
label: z.ZodString;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
required: z.ZodBoolean;
|
|
14
|
+
default: z.ZodOptional<z.ZodString>;
|
|
15
|
+
input: z.ZodEnum<{
|
|
16
|
+
email: "email";
|
|
17
|
+
text: "text";
|
|
18
|
+
url: "url";
|
|
19
|
+
}>;
|
|
20
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
22
|
+
description: z.ZodOptional<z.ZodString>;
|
|
23
|
+
label: z.ZodString;
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
required: z.ZodBoolean;
|
|
26
|
+
input: z.ZodLiteral<"password">;
|
|
27
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
29
|
+
description: z.ZodOptional<z.ZodString>;
|
|
30
|
+
label: z.ZodString;
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
required: z.ZodBoolean;
|
|
33
|
+
default: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
input: z.ZodLiteral<"number">;
|
|
35
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
37
|
+
description: z.ZodOptional<z.ZodString>;
|
|
38
|
+
label: z.ZodString;
|
|
39
|
+
name: z.ZodString;
|
|
40
|
+
required: z.ZodBoolean;
|
|
41
|
+
default: z.ZodOptional<z.ZodBoolean>;
|
|
42
|
+
input: z.ZodLiteral<"boolean">;
|
|
43
|
+
}, z.core.$strip>], "input">>;
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
type: z.ZodLiteral<"form">;
|
|
47
|
+
}, z.core.$strip>], "type">;
|
|
2
48
|
export declare const integrationServiceManifestSchema: z.ZodObject<{
|
|
3
|
-
|
|
49
|
+
connections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
50
|
+
description: z.ZodOptional<z.ZodString>;
|
|
51
|
+
id: z.ZodString;
|
|
52
|
+
name: z.ZodString;
|
|
4
53
|
type: z.ZodLiteral<"redirect">;
|
|
5
54
|
}, z.core.$strip>, z.ZodObject<{
|
|
55
|
+
description: z.ZodOptional<z.ZodString>;
|
|
6
56
|
fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
57
|
description: z.ZodOptional<z.ZodString>;
|
|
8
58
|
label: z.ZodString;
|
|
@@ -38,12 +88,15 @@ export declare const integrationServiceManifestSchema: z.ZodObject<{
|
|
|
38
88
|
default: z.ZodOptional<z.ZodBoolean>;
|
|
39
89
|
input: z.ZodLiteral<"boolean">;
|
|
40
90
|
}, z.core.$strip>], "input">>;
|
|
91
|
+
id: z.ZodString;
|
|
92
|
+
name: z.ZodString;
|
|
41
93
|
type: z.ZodLiteral<"form">;
|
|
42
|
-
}, z.core.$strip>], "type"
|
|
94
|
+
}, z.core.$strip>], "type">>;
|
|
43
95
|
description: z.ZodOptional<z.ZodString>;
|
|
44
96
|
name: z.ZodString;
|
|
45
97
|
}, z.core.$strip>;
|
|
46
98
|
export type IntegrationServiceManifest = z.infer<typeof integrationServiceManifestSchema>;
|
|
99
|
+
export type IntegrationConnectionManifest = z.infer<typeof integrationConnectionManifestSchema>;
|
|
47
100
|
type ScopeRequirement = string | {
|
|
48
101
|
requirements: ScopeRequirement[];
|
|
49
102
|
type: "and" | "or";
|
|
@@ -51,6 +104,7 @@ type ScopeRequirement = string | {
|
|
|
51
104
|
export declare const authorizationContract: {
|
|
52
105
|
beginConnection: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
53
106
|
binding: z.ZodString;
|
|
107
|
+
connectionId: z.ZodString;
|
|
54
108
|
deploymentId: z.ZodString;
|
|
55
109
|
serviceId: z.ZodString;
|
|
56
110
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -64,6 +118,7 @@ export declare const authorizationContract: {
|
|
|
64
118
|
}, z.core.$strip>, z.ZodObject<{
|
|
65
119
|
accounts: z.ZodArray<z.ZodObject<{
|
|
66
120
|
checkedAt: z.ZodNullable<z.ZodDate>;
|
|
121
|
+
connectionId: z.ZodString;
|
|
67
122
|
error: z.ZodNullable<z.ZodObject<{
|
|
68
123
|
code: z.ZodString;
|
|
69
124
|
message: z.ZodString;
|
|
@@ -77,16 +132,23 @@ export declare const authorizationContract: {
|
|
|
77
132
|
requirements: z.ZodArray<z.ZodObject<{
|
|
78
133
|
accountId: z.ZodNullable<z.ZodString>;
|
|
79
134
|
binding: z.ZodString;
|
|
135
|
+
connections: z.ZodArray<z.ZodObject<{
|
|
136
|
+
connectionId: z.ZodString;
|
|
137
|
+
minimalScopes: z.ZodArray<z.ZodString>;
|
|
138
|
+
requiredScopes: z.ZodArray<z.ZodType<ScopeRequirement, unknown, z.core.$ZodTypeInternals<ScopeRequirement, unknown>>>;
|
|
139
|
+
}, z.core.$strip>>;
|
|
80
140
|
eligibleAccountIds: z.ZodArray<z.ZodString>;
|
|
81
|
-
minimalScopes: z.ZodArray<z.ZodString>;
|
|
82
|
-
requiredScopes: z.ZodArray<z.ZodType<ScopeRequirement, unknown, z.core.$ZodTypeInternals<ScopeRequirement, unknown>>>;
|
|
83
141
|
satisfied: z.ZodBoolean;
|
|
84
142
|
serviceId: z.ZodString;
|
|
85
143
|
}, z.core.$strip>>;
|
|
86
144
|
services: z.ZodArray<z.ZodObject<{
|
|
87
|
-
|
|
145
|
+
connections: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
146
|
+
description: z.ZodOptional<z.ZodString>;
|
|
147
|
+
id: z.ZodString;
|
|
148
|
+
name: z.ZodString;
|
|
88
149
|
type: z.ZodLiteral<"redirect">;
|
|
89
150
|
}, z.core.$strip>, z.ZodObject<{
|
|
151
|
+
description: z.ZodOptional<z.ZodString>;
|
|
90
152
|
fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
91
153
|
description: z.ZodOptional<z.ZodString>;
|
|
92
154
|
label: z.ZodString;
|
|
@@ -122,8 +184,10 @@ export declare const authorizationContract: {
|
|
|
122
184
|
default: z.ZodOptional<z.ZodBoolean>;
|
|
123
185
|
input: z.ZodLiteral<"boolean">;
|
|
124
186
|
}, z.core.$strip>], "input">>;
|
|
187
|
+
id: z.ZodString;
|
|
188
|
+
name: z.ZodString;
|
|
125
189
|
type: z.ZodLiteral<"form">;
|
|
126
|
-
}, z.core.$strip>], "type"
|
|
190
|
+
}, z.core.$strip>], "type">>;
|
|
127
191
|
description: z.ZodOptional<z.ZodString>;
|
|
128
192
|
name: z.ZodString;
|
|
129
193
|
id: z.ZodString;
|
|
@@ -131,6 +195,7 @@ export declare const authorizationContract: {
|
|
|
131
195
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
132
196
|
submitCredentials: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
133
197
|
binding: z.ZodString;
|
|
198
|
+
connectionId: z.ZodString;
|
|
134
199
|
data: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
135
200
|
deploymentId: z.ZodString;
|
|
136
201
|
serviceId: z.ZodString;
|
package/dist/authorization.js
CHANGED
|
@@ -26,16 +26,23 @@ const INTEGRATION_FORM_FIELD_SCHEMA = z.discriminatedUnion("input", [
|
|
|
26
26
|
input: z.literal("boolean"),
|
|
27
27
|
}),
|
|
28
28
|
]);
|
|
29
|
+
export const integrationConnectionManifestSchema = z.discriminatedUnion("type", [
|
|
30
|
+
z.object({
|
|
31
|
+
description: z.string().optional(),
|
|
32
|
+
id: z.string().min(1),
|
|
33
|
+
name: z.string().min(1),
|
|
34
|
+
type: z.literal("redirect"),
|
|
35
|
+
}),
|
|
36
|
+
z.object({
|
|
37
|
+
description: z.string().optional(),
|
|
38
|
+
fields: INTEGRATION_FORM_FIELD_SCHEMA.array().min(1),
|
|
39
|
+
id: z.string().min(1),
|
|
40
|
+
name: z.string().min(1),
|
|
41
|
+
type: z.literal("form"),
|
|
42
|
+
}),
|
|
43
|
+
]);
|
|
29
44
|
export const integrationServiceManifestSchema = z.object({
|
|
30
|
-
|
|
31
|
-
z.object({
|
|
32
|
-
type: z.literal("redirect"),
|
|
33
|
-
}),
|
|
34
|
-
z.object({
|
|
35
|
-
fields: INTEGRATION_FORM_FIELD_SCHEMA.array().min(1),
|
|
36
|
-
type: z.literal("form"),
|
|
37
|
-
}),
|
|
38
|
-
]),
|
|
45
|
+
connections: integrationConnectionManifestSchema.array().min(1),
|
|
39
46
|
description: z.string().optional(),
|
|
40
47
|
name: z.string().min(1),
|
|
41
48
|
});
|
|
@@ -50,6 +57,7 @@ export const authorizationContract = {
|
|
|
50
57
|
beginConnection: oc
|
|
51
58
|
.input(z.object({
|
|
52
59
|
binding: z.string().min(1),
|
|
60
|
+
connectionId: z.string().min(1),
|
|
53
61
|
deploymentId: z.string(),
|
|
54
62
|
serviceId: z.string().min(1),
|
|
55
63
|
}))
|
|
@@ -73,6 +81,7 @@ export const authorizationContract = {
|
|
|
73
81
|
accounts: z
|
|
74
82
|
.object({
|
|
75
83
|
checkedAt: z.date().nullable(),
|
|
84
|
+
connectionId: z.string().min(1),
|
|
76
85
|
error: z
|
|
77
86
|
.object({
|
|
78
87
|
code: z.string(),
|
|
@@ -90,11 +99,17 @@ export const authorizationContract = {
|
|
|
90
99
|
.object({
|
|
91
100
|
accountId: z.string().nullable(),
|
|
92
101
|
binding: z.string(),
|
|
102
|
+
connections: z
|
|
103
|
+
.object({
|
|
104
|
+
connectionId: z.string().min(1),
|
|
105
|
+
minimalScopes: z.string().array(),
|
|
106
|
+
requiredScopes: SCOPE_REQUIREMENT_SCHEMA.array(),
|
|
107
|
+
})
|
|
108
|
+
.array()
|
|
109
|
+
.min(1),
|
|
93
110
|
eligibleAccountIds: z.string().array(),
|
|
94
|
-
minimalScopes: z.string().array(),
|
|
95
|
-
requiredScopes: SCOPE_REQUIREMENT_SCHEMA.array(),
|
|
96
111
|
satisfied: z.boolean(),
|
|
97
|
-
serviceId: z.string(),
|
|
112
|
+
serviceId: z.string().min(1),
|
|
98
113
|
})
|
|
99
114
|
.array(),
|
|
100
115
|
services: integrationServiceManifestSchema
|
|
@@ -106,6 +121,7 @@ export const authorizationContract = {
|
|
|
106
121
|
submitCredentials: oc
|
|
107
122
|
.input(z.object({
|
|
108
123
|
binding: z.string().min(1),
|
|
124
|
+
connectionId: z.string().min(1),
|
|
109
125
|
data: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])),
|
|
110
126
|
deploymentId: z.string(),
|
|
111
127
|
serviceId: z.string().min(1),
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { AUTOMATION_SDK_VERSION, deploymentTriggerInfoSchema, type DeploymentTriggerInfo, } from "./deployment.js";
|
|
2
2
|
export { runtimeContract } from "./runtime.js";
|
|
3
3
|
export { createdOrganizationApiKeyOutputSchema, organizationApiKeyOutputSchema, } from "./api-key.js";
|
|
4
|
-
export { integrationServiceManifestSchema, type IntegrationServiceManifest, } from "./authorization.js";
|
|
4
|
+
export { integrationConnectionManifestSchema, integrationServiceManifestSchema, type IntegrationConnectionManifest, type IntegrationServiceManifest, } from "./authorization.js";
|
|
5
5
|
export { activeSubscriptionOutputSchema, createdInvitationOutputSchema, organizationDetailsOutputSchema, organizationInvitationOutputSchema, organizationMemberOutputSchema, organizationProjectOutputSchema, organizationRoleSchema, organizationSummaryOutputSchema, publicOrganizationOutputSchema, } from "./org.js";
|
|
6
6
|
export { projectOutputSchema, projectWithOrganizationOutputSchema, } from "./project.js";
|
|
7
7
|
export { reasonableNameSchema } from "./schemas.js";
|
|
@@ -250,6 +250,7 @@ export declare const firstPartyContract: {
|
|
|
250
250
|
authorization: {
|
|
251
251
|
beginConnection: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
252
252
|
binding: import("zod").ZodString;
|
|
253
|
+
connectionId: import("zod").ZodString;
|
|
253
254
|
deploymentId: import("zod").ZodString;
|
|
254
255
|
serviceId: import("zod").ZodString;
|
|
255
256
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -260,6 +261,7 @@ export declare const firstPartyContract: {
|
|
|
260
261
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
261
262
|
accounts: import("zod").ZodArray<import("zod").ZodObject<{
|
|
262
263
|
checkedAt: import("zod").ZodNullable<import("zod").ZodDate>;
|
|
264
|
+
connectionId: import("zod").ZodString;
|
|
263
265
|
error: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
264
266
|
code: import("zod").ZodString;
|
|
265
267
|
message: import("zod").ZodString;
|
|
@@ -273,22 +275,29 @@ export declare const firstPartyContract: {
|
|
|
273
275
|
requirements: import("zod").ZodArray<import("zod").ZodObject<{
|
|
274
276
|
accountId: import("zod").ZodNullable<import("zod").ZodString>;
|
|
275
277
|
binding: import("zod").ZodString;
|
|
278
|
+
connections: import("zod").ZodArray<import("zod").ZodObject<{
|
|
279
|
+
connectionId: import("zod").ZodString;
|
|
280
|
+
minimalScopes: import("zod").ZodArray<import("zod").ZodString>;
|
|
281
|
+
requiredScopes: import("zod").ZodArray<import("zod").ZodType<string | {
|
|
282
|
+
requirements: (string | /*elided*/ any)[];
|
|
283
|
+
type: "and" | "or";
|
|
284
|
+
}, unknown, import("zod/v4/core").$ZodTypeInternals<string | {
|
|
285
|
+
requirements: (string | /*elided*/ any)[];
|
|
286
|
+
type: "and" | "or";
|
|
287
|
+
}, unknown>>>;
|
|
288
|
+
}, import("zod/v4/core").$strip>>;
|
|
276
289
|
eligibleAccountIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
277
|
-
minimalScopes: import("zod").ZodArray<import("zod").ZodString>;
|
|
278
|
-
requiredScopes: import("zod").ZodArray<import("zod").ZodType<string | {
|
|
279
|
-
requirements: (string | /*elided*/ any)[];
|
|
280
|
-
type: "and" | "or";
|
|
281
|
-
}, unknown, import("zod/v4/core").$ZodTypeInternals<string | {
|
|
282
|
-
requirements: (string | /*elided*/ any)[];
|
|
283
|
-
type: "and" | "or";
|
|
284
|
-
}, unknown>>>;
|
|
285
290
|
satisfied: import("zod").ZodBoolean;
|
|
286
291
|
serviceId: import("zod").ZodString;
|
|
287
292
|
}, import("zod/v4/core").$strip>>;
|
|
288
293
|
services: import("zod").ZodArray<import("zod").ZodObject<{
|
|
289
|
-
|
|
294
|
+
connections: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
295
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
296
|
+
id: import("zod").ZodString;
|
|
297
|
+
name: import("zod").ZodString;
|
|
290
298
|
type: import("zod").ZodLiteral<"redirect">;
|
|
291
299
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
300
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
292
301
|
fields: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
293
302
|
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
294
303
|
label: import("zod").ZodString;
|
|
@@ -324,8 +333,10 @@ export declare const firstPartyContract: {
|
|
|
324
333
|
default: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
325
334
|
input: import("zod").ZodLiteral<"boolean">;
|
|
326
335
|
}, import("zod/v4/core").$strip>], "input">>;
|
|
336
|
+
id: import("zod").ZodString;
|
|
337
|
+
name: import("zod").ZodString;
|
|
327
338
|
type: import("zod").ZodLiteral<"form">;
|
|
328
|
-
}, import("zod/v4/core").$strip>], "type"
|
|
339
|
+
}, import("zod/v4/core").$strip>], "type">>;
|
|
329
340
|
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
330
341
|
name: import("zod").ZodString;
|
|
331
342
|
id: import("zod").ZodString;
|
|
@@ -338,6 +349,7 @@ export declare const firstPartyContract: {
|
|
|
338
349
|
}, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
339
350
|
submitCredentials: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
340
351
|
binding: import("zod").ZodString;
|
|
352
|
+
connectionId: import("zod").ZodString;
|
|
341
353
|
data: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean]>>;
|
|
342
354
|
deploymentId: import("zod").ZodString;
|
|
343
355
|
serviceId: import("zod").ZodString;
|
|
@@ -648,6 +660,7 @@ export declare const contract: {
|
|
|
648
660
|
}, import("zod/v4/core").$strip>, import("zod").ZodString, Record<never, never>, Record<never, never>>;
|
|
649
661
|
beginConnection: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
650
662
|
binding: import("zod").ZodString;
|
|
663
|
+
connectionId: import("zod").ZodString;
|
|
651
664
|
deploymentId: import("zod").ZodString;
|
|
652
665
|
serviceId: import("zod").ZodString;
|
|
653
666
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -658,6 +671,7 @@ export declare const contract: {
|
|
|
658
671
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
659
672
|
accounts: import("zod").ZodArray<import("zod").ZodObject<{
|
|
660
673
|
checkedAt: import("zod").ZodNullable<import("zod").ZodDate>;
|
|
674
|
+
connectionId: import("zod").ZodString;
|
|
661
675
|
error: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
662
676
|
code: import("zod").ZodString;
|
|
663
677
|
message: import("zod").ZodString;
|
|
@@ -671,22 +685,29 @@ export declare const contract: {
|
|
|
671
685
|
requirements: import("zod").ZodArray<import("zod").ZodObject<{
|
|
672
686
|
accountId: import("zod").ZodNullable<import("zod").ZodString>;
|
|
673
687
|
binding: import("zod").ZodString;
|
|
688
|
+
connections: import("zod").ZodArray<import("zod").ZodObject<{
|
|
689
|
+
connectionId: import("zod").ZodString;
|
|
690
|
+
minimalScopes: import("zod").ZodArray<import("zod").ZodString>;
|
|
691
|
+
requiredScopes: import("zod").ZodArray<import("zod").ZodType<string | {
|
|
692
|
+
requirements: (string | /*elided*/ any)[];
|
|
693
|
+
type: "and" | "or";
|
|
694
|
+
}, unknown, import("zod/v4/core").$ZodTypeInternals<string | {
|
|
695
|
+
requirements: (string | /*elided*/ any)[];
|
|
696
|
+
type: "and" | "or";
|
|
697
|
+
}, unknown>>>;
|
|
698
|
+
}, import("zod/v4/core").$strip>>;
|
|
674
699
|
eligibleAccountIds: import("zod").ZodArray<import("zod").ZodString>;
|
|
675
|
-
minimalScopes: import("zod").ZodArray<import("zod").ZodString>;
|
|
676
|
-
requiredScopes: import("zod").ZodArray<import("zod").ZodType<string | {
|
|
677
|
-
requirements: (string | /*elided*/ any)[];
|
|
678
|
-
type: "and" | "or";
|
|
679
|
-
}, unknown, import("zod/v4/core").$ZodTypeInternals<string | {
|
|
680
|
-
requirements: (string | /*elided*/ any)[];
|
|
681
|
-
type: "and" | "or";
|
|
682
|
-
}, unknown>>>;
|
|
683
700
|
satisfied: import("zod").ZodBoolean;
|
|
684
701
|
serviceId: import("zod").ZodString;
|
|
685
702
|
}, import("zod/v4/core").$strip>>;
|
|
686
703
|
services: import("zod").ZodArray<import("zod").ZodObject<{
|
|
687
|
-
|
|
704
|
+
connections: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
705
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
706
|
+
id: import("zod").ZodString;
|
|
707
|
+
name: import("zod").ZodString;
|
|
688
708
|
type: import("zod").ZodLiteral<"redirect">;
|
|
689
709
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
710
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
690
711
|
fields: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
691
712
|
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
692
713
|
label: import("zod").ZodString;
|
|
@@ -722,8 +743,10 @@ export declare const contract: {
|
|
|
722
743
|
default: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
723
744
|
input: import("zod").ZodLiteral<"boolean">;
|
|
724
745
|
}, import("zod/v4/core").$strip>], "input">>;
|
|
746
|
+
id: import("zod").ZodString;
|
|
747
|
+
name: import("zod").ZodString;
|
|
725
748
|
type: import("zod").ZodLiteral<"form">;
|
|
726
|
-
}, import("zod/v4/core").$strip>], "type"
|
|
749
|
+
}, import("zod/v4/core").$strip>], "type">>;
|
|
727
750
|
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
728
751
|
name: import("zod").ZodString;
|
|
729
752
|
id: import("zod").ZodString;
|
|
@@ -736,6 +759,7 @@ export declare const contract: {
|
|
|
736
759
|
}, import("zod/v4/core").$strip>, import("zod").ZodVoid, Record<never, never>, Record<never, never>>;
|
|
737
760
|
submitCredentials: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
738
761
|
binding: import("zod").ZodString;
|
|
762
|
+
connectionId: import("zod").ZodString;
|
|
739
763
|
data: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean]>>;
|
|
740
764
|
deploymentId: import("zod").ZodString;
|
|
741
765
|
serviceId: import("zod").ZodString;
|
|
@@ -850,6 +874,7 @@ export declare const contract: {
|
|
|
850
874
|
binding: import("zod").ZodString;
|
|
851
875
|
serviceId: import("zod").ZodString;
|
|
852
876
|
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
877
|
+
connectionId: import("zod").ZodString;
|
|
853
878
|
secret: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
854
879
|
serviceId: import("zod").ZodString;
|
|
855
880
|
}, import("zod/v4/core").$strip>, Record<never, never>, Record<never, never>>;
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { runtimeContract } from "./runtime.js";
|
|
|
9
9
|
export { AUTOMATION_SDK_VERSION, deploymentTriggerInfoSchema, } from "./deployment.js";
|
|
10
10
|
export { runtimeContract } from "./runtime.js";
|
|
11
11
|
export { createdOrganizationApiKeyOutputSchema, organizationApiKeyOutputSchema, } from "./api-key.js";
|
|
12
|
-
export { integrationServiceManifestSchema, } from "./authorization.js";
|
|
12
|
+
export { integrationConnectionManifestSchema, integrationServiceManifestSchema, } from "./authorization.js";
|
|
13
13
|
export { activeSubscriptionOutputSchema, createdInvitationOutputSchema, organizationDetailsOutputSchema, organizationInvitationOutputSchema, organizationMemberOutputSchema, organizationProjectOutputSchema, organizationRoleSchema, organizationSummaryOutputSchema, publicOrganizationOutputSchema, } from "./org.js";
|
|
14
14
|
export { projectOutputSchema, projectWithOrganizationOutputSchema, } from "./project.js";
|
|
15
15
|
export { reasonableNameSchema } from "./schemas.js";
|
package/dist/runtime.d.ts
CHANGED
|
@@ -78,6 +78,7 @@ export declare const runtimeContract: {
|
|
|
78
78
|
binding: z.ZodString;
|
|
79
79
|
serviceId: z.ZodString;
|
|
80
80
|
}, z.core.$strict>, z.ZodObject<{
|
|
81
|
+
connectionId: z.ZodString;
|
|
81
82
|
secret: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
82
83
|
serviceId: z.ZodString;
|
|
83
84
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
package/dist/runtime.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automate.ax/api-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Public oRPC contract for the Automate.ax API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@automate.ax/codec": "0.
|
|
29
|
+
"@automate.ax/codec": "0.15.0",
|
|
30
30
|
"@orpc/contract": "1.13.14",
|
|
31
31
|
"zod": "^4.3.6"
|
|
32
32
|
},
|
package/src/authorization.ts
CHANGED
|
@@ -29,16 +29,27 @@ const INTEGRATION_FORM_FIELD_SCHEMA = z.discriminatedUnion("input", [
|
|
|
29
29
|
}),
|
|
30
30
|
])
|
|
31
31
|
|
|
32
|
-
export const
|
|
33
|
-
|
|
32
|
+
export const integrationConnectionManifestSchema = z.discriminatedUnion(
|
|
33
|
+
"type",
|
|
34
|
+
[
|
|
34
35
|
z.object({
|
|
36
|
+
description: z.string().optional(),
|
|
37
|
+
id: z.string().min(1),
|
|
38
|
+
name: z.string().min(1),
|
|
35
39
|
type: z.literal("redirect"),
|
|
36
40
|
}),
|
|
37
41
|
z.object({
|
|
42
|
+
description: z.string().optional(),
|
|
38
43
|
fields: INTEGRATION_FORM_FIELD_SCHEMA.array().min(1),
|
|
44
|
+
id: z.string().min(1),
|
|
45
|
+
name: z.string().min(1),
|
|
39
46
|
type: z.literal("form"),
|
|
40
47
|
}),
|
|
41
|
-
]
|
|
48
|
+
],
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
export const integrationServiceManifestSchema = z.object({
|
|
52
|
+
connections: integrationConnectionManifestSchema.array().min(1),
|
|
42
53
|
description: z.string().optional(),
|
|
43
54
|
name: z.string().min(1),
|
|
44
55
|
})
|
|
@@ -46,6 +57,9 @@ export const integrationServiceManifestSchema = z.object({
|
|
|
46
57
|
export type IntegrationServiceManifest = z.infer<
|
|
47
58
|
typeof integrationServiceManifestSchema
|
|
48
59
|
>
|
|
60
|
+
export type IntegrationConnectionManifest = z.infer<
|
|
61
|
+
typeof integrationConnectionManifestSchema
|
|
62
|
+
>
|
|
49
63
|
|
|
50
64
|
type ScopeRequirement =
|
|
51
65
|
| string
|
|
@@ -68,6 +82,7 @@ export const authorizationContract = {
|
|
|
68
82
|
.input(
|
|
69
83
|
z.object({
|
|
70
84
|
binding: z.string().min(1),
|
|
85
|
+
connectionId: z.string().min(1),
|
|
71
86
|
deploymentId: z.string(),
|
|
72
87
|
serviceId: z.string().min(1),
|
|
73
88
|
}),
|
|
@@ -95,6 +110,7 @@ export const authorizationContract = {
|
|
|
95
110
|
accounts: z
|
|
96
111
|
.object({
|
|
97
112
|
checkedAt: z.date().nullable(),
|
|
113
|
+
connectionId: z.string().min(1),
|
|
98
114
|
error: z
|
|
99
115
|
.object({
|
|
100
116
|
code: z.string(),
|
|
@@ -112,11 +128,17 @@ export const authorizationContract = {
|
|
|
112
128
|
.object({
|
|
113
129
|
accountId: z.string().nullable(),
|
|
114
130
|
binding: z.string(),
|
|
131
|
+
connections: z
|
|
132
|
+
.object({
|
|
133
|
+
connectionId: z.string().min(1),
|
|
134
|
+
minimalScopes: z.string().array(),
|
|
135
|
+
requiredScopes: SCOPE_REQUIREMENT_SCHEMA.array(),
|
|
136
|
+
})
|
|
137
|
+
.array()
|
|
138
|
+
.min(1),
|
|
115
139
|
eligibleAccountIds: z.string().array(),
|
|
116
|
-
minimalScopes: z.string().array(),
|
|
117
|
-
requiredScopes: SCOPE_REQUIREMENT_SCHEMA.array(),
|
|
118
140
|
satisfied: z.boolean(),
|
|
119
|
-
serviceId: z.string(),
|
|
141
|
+
serviceId: z.string().min(1),
|
|
120
142
|
})
|
|
121
143
|
.array(),
|
|
122
144
|
services: integrationServiceManifestSchema
|
|
@@ -130,6 +152,7 @@ export const authorizationContract = {
|
|
|
130
152
|
.input(
|
|
131
153
|
z.object({
|
|
132
154
|
binding: z.string().min(1),
|
|
155
|
+
connectionId: z.string().min(1),
|
|
133
156
|
data: z.record(
|
|
134
157
|
z.string(),
|
|
135
158
|
z.union([z.string(), z.number(), z.boolean()]),
|
package/src/index.ts
CHANGED
|
@@ -18,7 +18,9 @@ export {
|
|
|
18
18
|
organizationApiKeyOutputSchema,
|
|
19
19
|
} from "./api-key"
|
|
20
20
|
export {
|
|
21
|
+
integrationConnectionManifestSchema,
|
|
21
22
|
integrationServiceManifestSchema,
|
|
23
|
+
type IntegrationConnectionManifest,
|
|
22
24
|
type IntegrationServiceManifest,
|
|
23
25
|
} from "./authorization"
|
|
24
26
|
export {
|