@substrat-run/contracts 0.222.0 → 0.224.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/control-plane.d.ts +10 -0
- package/dist/control-plane.d.ts.map +1 -1
- package/dist/control-plane.js +10 -0
- package/dist/control-plane.js.map +1 -1
- package/dist/operations.d.ts +1 -1
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +2 -2
- package/dist/operations.js.map +1 -1
- package/dist/rate-limit.d.ts +7 -0
- package/dist/rate-limit.d.ts.map +1 -1
- package/dist/rate-limit.js +9 -0
- package/dist/rate-limit.js.map +1 -1
- package/dist/registry.d.ts +43 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +39 -0
- package/dist/registry.js.map +1 -1
- package/dist/source-build.d.ts +181 -0
- package/dist/source-build.d.ts.map +1 -1
- package/dist/source-build.js +90 -6
- package/dist/source-build.js.map +1 -1
- package/dist/vertical-connector.d.ts +51 -5
- package/dist/vertical-connector.d.ts.map +1 -1
- package/dist/vertical-connector.js +25 -6
- package/dist/vertical-connector.js.map +1 -1
- package/package.json +1 -1
package/dist/source-build.d.ts
CHANGED
|
@@ -37,6 +37,66 @@ export declare const projectRepository: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
37
37
|
directory: z.ZodDefault<z.ZodUnion<[z.ZodString, z.ZodLiteral<".">]>>;
|
|
38
38
|
}, z.core.$strict>], "kind">;
|
|
39
39
|
export type ProjectRepository = z.infer<typeof projectRepository>;
|
|
40
|
+
/**
|
|
41
|
+
* A connected GitHub repository named as a vertical's project repository (#2953): the dashboard's
|
|
42
|
+
* CI setup sends the branch and package directory it set the workflow up with, so the project a
|
|
43
|
+
* pinned revision build fetches from is the repository the tenant connected.
|
|
44
|
+
*/
|
|
45
|
+
export declare const repositoryAssociation: z.ZodObject<{
|
|
46
|
+
owner: z.ZodString;
|
|
47
|
+
repo: z.ZodString;
|
|
48
|
+
branch: z.ZodString;
|
|
49
|
+
directory: z.ZodDefault<z.ZodUnion<[z.ZodString, z.ZodLiteral<".">]>>;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
export type RepositoryAssociation = z.infer<typeof repositoryAssociation>;
|
|
52
|
+
/**
|
|
53
|
+
* Which repository a vertical's project builds from. `none`: the vertical has no project yet, and a
|
|
54
|
+
* submitted source's first build would create a hosted one. `github`: the team's own repository.
|
|
55
|
+
* `artifacts`: a hosted repository, which a connected GitHub repository does not replace.
|
|
56
|
+
*/
|
|
57
|
+
export declare const projectRepositoryStatus: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
58
|
+
state: z.ZodLiteral<"none">;
|
|
59
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
60
|
+
state: z.ZodLiteral<"github">;
|
|
61
|
+
projectId: z.ZodString;
|
|
62
|
+
owner: z.ZodString;
|
|
63
|
+
repo: z.ZodString;
|
|
64
|
+
branch: z.ZodString;
|
|
65
|
+
directory: z.ZodString;
|
|
66
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
67
|
+
state: z.ZodLiteral<"artifacts">;
|
|
68
|
+
projectId: z.ZodString;
|
|
69
|
+
branch: z.ZodString;
|
|
70
|
+
}, z.core.$strip>], "state">;
|
|
71
|
+
export type ProjectRepositoryStatus = z.infer<typeof projectRepositoryStatus>;
|
|
72
|
+
/**
|
|
73
|
+
* What an association did. `created`: the vertical had no project, and now has a `github` one.
|
|
74
|
+
* `unchanged`: its project already builds from that repository, branch and directory. `refused`:
|
|
75
|
+
* its project builds from another repository, which is kept as it is; `reason` names it.
|
|
76
|
+
*/
|
|
77
|
+
export declare const repositoryAssociationResult: z.ZodObject<{
|
|
78
|
+
outcome: z.ZodEnum<{
|
|
79
|
+
created: "created";
|
|
80
|
+
refused: "refused";
|
|
81
|
+
unchanged: "unchanged";
|
|
82
|
+
}>;
|
|
83
|
+
status: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
84
|
+
state: z.ZodLiteral<"none">;
|
|
85
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
86
|
+
state: z.ZodLiteral<"github">;
|
|
87
|
+
projectId: z.ZodString;
|
|
88
|
+
owner: z.ZodString;
|
|
89
|
+
repo: z.ZodString;
|
|
90
|
+
branch: z.ZodString;
|
|
91
|
+
directory: z.ZodString;
|
|
92
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
93
|
+
state: z.ZodLiteral<"artifacts">;
|
|
94
|
+
projectId: z.ZodString;
|
|
95
|
+
branch: z.ZodString;
|
|
96
|
+
}, z.core.$strip>], "state">;
|
|
97
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
export type RepositoryAssociationResult = z.infer<typeof repositoryAssociationResult>;
|
|
40
100
|
export declare const sourceBuildRequest: z.ZodObject<{
|
|
41
101
|
version: z.ZodString;
|
|
42
102
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -53,6 +113,15 @@ export declare const sourceBuildRequest: z.ZodObject<{
|
|
|
53
113
|
passed: "passed";
|
|
54
114
|
skipped: "skipped";
|
|
55
115
|
}>>;
|
|
116
|
+
checks: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
117
|
+
status: z.ZodLiteral<"passed">;
|
|
118
|
+
ran: z.ZodArray<z.ZodString>;
|
|
119
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
120
|
+
status: z.ZodLiteral<"none">;
|
|
121
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
122
|
+
status: z.ZodLiteral<"skipped">;
|
|
123
|
+
reason: z.ZodString;
|
|
124
|
+
}, z.core.$strip>], "status">>;
|
|
56
125
|
}, z.core.$strip>>;
|
|
57
126
|
snapshot: z.ZodOptional<z.ZodObject<{
|
|
58
127
|
files: z.ZodArray<z.ZodObject<{
|
|
@@ -70,6 +139,20 @@ export declare const sourceBuildRequest: z.ZodObject<{
|
|
|
70
139
|
requireDataLossCheck: z.ZodDefault<z.ZodBoolean>;
|
|
71
140
|
}, z.core.$strict>;
|
|
72
141
|
export type SourceBuildRequest = z.infer<typeof sourceBuildRequest>;
|
|
142
|
+
/** What a build's data-loss replay (#2321) came to, as a release reports it. */
|
|
143
|
+
export declare const sourceDataLossCheck: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
144
|
+
status: z.ZodLiteral<"passed">;
|
|
145
|
+
authored: z.ZodNumber;
|
|
146
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
147
|
+
status: z.ZodLiteral<"skipped">;
|
|
148
|
+
why: z.ZodString;
|
|
149
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
150
|
+
status: z.ZodLiteral<"incomplete">;
|
|
151
|
+
authored: z.ZodNumber;
|
|
152
|
+
notReplayed: z.ZodNumber;
|
|
153
|
+
key: z.ZodString;
|
|
154
|
+
message: z.ZodString;
|
|
155
|
+
}, z.core.$strip>], "status">;
|
|
73
156
|
export declare const sourceBuildResult: z.ZodObject<{
|
|
74
157
|
projectId: z.ZodString;
|
|
75
158
|
revision: z.ZodString;
|
|
@@ -111,8 +194,86 @@ export declare const sourceBuildPublished: z.ZodObject<{
|
|
|
111
194
|
pending: "pending";
|
|
112
195
|
rejected: "rejected";
|
|
113
196
|
}>;
|
|
197
|
+
dataLoss: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
198
|
+
status: z.ZodLiteral<"passed">;
|
|
199
|
+
authored: z.ZodNumber;
|
|
200
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
201
|
+
status: z.ZodLiteral<"skipped">;
|
|
202
|
+
why: z.ZodString;
|
|
203
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
204
|
+
status: z.ZodLiteral<"incomplete">;
|
|
205
|
+
authored: z.ZodNumber;
|
|
206
|
+
notReplayed: z.ZodNumber;
|
|
207
|
+
key: z.ZodString;
|
|
208
|
+
message: z.ZodString;
|
|
209
|
+
}, z.core.$strip>], "status">>;
|
|
210
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
114
211
|
}, z.core.$strip>;
|
|
115
212
|
export type SourceBuildPublished = z.infer<typeof sourceBuildPublished>;
|
|
213
|
+
/**
|
|
214
|
+
* The `Prefer` token a deploy client sends to have `POST /verticals/:slug/deploy` accept the build
|
|
215
|
+
* and answer at once (RFC 7240), instead of answering once it has built and published. A control
|
|
216
|
+
* plane that cannot accept one ignores it and answers as it always has, which is what keeps a
|
|
217
|
+
* client asking for it working against an older one; it says it honoured it in `Preference-Applied`.
|
|
218
|
+
*/
|
|
219
|
+
export declare const RESPOND_ASYNC = "respond-async";
|
|
220
|
+
/**
|
|
221
|
+
* The deploy route's 202 when it accepted the build (#2951): the build's id, the registry id it
|
|
222
|
+
* deploys as, and `status`, the path (from the API root) its progress is read at.
|
|
223
|
+
*/
|
|
224
|
+
export declare const sourceDeployAccepted: z.ZodObject<{
|
|
225
|
+
buildId: z.ZodString;
|
|
226
|
+
slug: z.ZodString;
|
|
227
|
+
status: z.ZodString;
|
|
228
|
+
}, z.core.$strip>;
|
|
229
|
+
export type SourceDeployAccepted = z.infer<typeof sourceDeployAccepted>;
|
|
230
|
+
/**
|
|
231
|
+
* Where an accepted deploy has got to, as `GET /verticals/:slug/deploy/:buildId` answers it: what a
|
|
232
|
+
* client following the build reads, never the build's own record, whose output is staff's.
|
|
233
|
+
* `publishing` is a build that built and whose release is being handed to the control plane;
|
|
234
|
+
* `published` carries the version as a waited-for deploy answers it; `failed` carries the sentence a
|
|
235
|
+
* waited-for deploy would have refused with.
|
|
236
|
+
*/
|
|
237
|
+
export declare const sourceDeployProgress: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
238
|
+
state: z.ZodLiteral<"building">;
|
|
239
|
+
buildId: z.ZodString;
|
|
240
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
241
|
+
state: z.ZodLiteral<"publishing">;
|
|
242
|
+
buildId: z.ZodString;
|
|
243
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
244
|
+
state: z.ZodLiteral<"published">;
|
|
245
|
+
buildId: z.ZodString;
|
|
246
|
+
release: z.ZodObject<{
|
|
247
|
+
id: z.ZodString;
|
|
248
|
+
verticalSlug: z.ZodString;
|
|
249
|
+
version: z.ZodString;
|
|
250
|
+
admission: z.ZodEnum<{
|
|
251
|
+
admitted: "admitted";
|
|
252
|
+
pending: "pending";
|
|
253
|
+
rejected: "rejected";
|
|
254
|
+
}>;
|
|
255
|
+
deploymentRef: z.ZodNullable<z.ZodString>;
|
|
256
|
+
dataLoss: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
257
|
+
status: z.ZodLiteral<"passed">;
|
|
258
|
+
authored: z.ZodNumber;
|
|
259
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
260
|
+
status: z.ZodLiteral<"skipped">;
|
|
261
|
+
why: z.ZodString;
|
|
262
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
263
|
+
status: z.ZodLiteral<"incomplete">;
|
|
264
|
+
authored: z.ZodNumber;
|
|
265
|
+
notReplayed: z.ZodNumber;
|
|
266
|
+
key: z.ZodString;
|
|
267
|
+
message: z.ZodString;
|
|
268
|
+
}, z.core.$strip>], "status">>;
|
|
269
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
270
|
+
}, z.core.$loose>;
|
|
271
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
272
|
+
state: z.ZodLiteral<"failed">;
|
|
273
|
+
buildId: z.ZodString;
|
|
274
|
+
detail: z.ZodString;
|
|
275
|
+
}, z.core.$strip>], "state">;
|
|
276
|
+
export type SourceDeployProgress = z.infer<typeof sourceDeployProgress>;
|
|
116
277
|
export interface ProjectRecord {
|
|
117
278
|
id: string;
|
|
118
279
|
slug: string;
|
|
@@ -163,6 +324,20 @@ export declare const sourceBuildRecord: z.ZodObject<{
|
|
|
163
324
|
pending: "pending";
|
|
164
325
|
rejected: "rejected";
|
|
165
326
|
}>;
|
|
327
|
+
dataLoss: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
328
|
+
status: z.ZodLiteral<"passed">;
|
|
329
|
+
authored: z.ZodNumber;
|
|
330
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
331
|
+
status: z.ZodLiteral<"skipped">;
|
|
332
|
+
why: z.ZodString;
|
|
333
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
334
|
+
status: z.ZodLiteral<"incomplete">;
|
|
335
|
+
authored: z.ZodNumber;
|
|
336
|
+
notReplayed: z.ZodNumber;
|
|
337
|
+
key: z.ZodString;
|
|
338
|
+
message: z.ZodString;
|
|
339
|
+
}, z.core.$strip>], "status">>;
|
|
340
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
166
341
|
}, z.core.$strip>>;
|
|
167
342
|
}, z.core.$strip>;
|
|
168
343
|
export type SourceBuildRecord = z.infer<typeof sourceBuildRecord>;
|
|
@@ -198,5 +373,11 @@ export interface SourceBuildService {
|
|
|
198
373
|
record(tenantId: string, buildId: string): Promise<SourceBuildRecord | null>;
|
|
199
374
|
/** The tenant's studio project for `slug` and its open chat branches; `repository: null` when it keeps none. */
|
|
200
375
|
changes(tenantId: string, slug: string): Promise<HostedChanges>;
|
|
376
|
+
/**
|
|
377
|
+
* Which repository the tenant's project for `slug` builds from (#2953), and, given an
|
|
378
|
+
* association, the `github` project created for it when there was none. An existing project is
|
|
379
|
+
* never re-pointed. Optional: a control plane given a service without it answers 501.
|
|
380
|
+
*/
|
|
381
|
+
repository?(tenantId: string, slug: string, association?: RepositoryAssociation): Promise<RepositoryAssociationResult>;
|
|
201
382
|
}
|
|
202
383
|
//# sourceMappingURL=source-build.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-build.d.ts","sourceRoot":"","sources":["../src/source-build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,eAAO,M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;;;OAGG;IACH,SAAS,CAAC,IAAI,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAAC;IACrD,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACzF;;;;;;;OAOG;IACH,MAAM,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACnG,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChE,oEAAoE;IACpE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAC7E,gHAAgH;IAChH,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAChE;;;;OAIG;IACH,UAAU,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;CACxH"}
|
package/dist/source-build.js
CHANGED
|
@@ -51,6 +51,37 @@ export const projectRepository = z.discriminatedUnion('kind', [
|
|
|
51
51
|
z.object({ kind: z.literal('artifacts'), name: z.string().regex(/^[a-zA-Z0-9_-]+$/), remote: z.string().url(), branch: z.string().default('main') }).strict(),
|
|
52
52
|
z.object({ kind: z.literal('github'), owner: z.string().regex(/^[\w-]+$/), repo: z.string().regex(/^[\w.-]+$/), branch: z.string().min(1).max(200).default('main'), directory: sourcePath.or(z.literal('.')).default('.') }).strict(),
|
|
53
53
|
]);
|
|
54
|
+
/**
|
|
55
|
+
* A connected GitHub repository named as a vertical's project repository (#2953): the dashboard's
|
|
56
|
+
* CI setup sends the branch and package directory it set the workflow up with, so the project a
|
|
57
|
+
* pinned revision build fetches from is the repository the tenant connected.
|
|
58
|
+
*/
|
|
59
|
+
export const repositoryAssociation = z.object({
|
|
60
|
+
owner: z.string().regex(/^[\w-]+$/),
|
|
61
|
+
repo: z.string().regex(/^[\w.-]+$/),
|
|
62
|
+
branch: z.string().min(1).max(200),
|
|
63
|
+
directory: sourcePath.or(z.literal('.')).default('.'),
|
|
64
|
+
}).strict();
|
|
65
|
+
/**
|
|
66
|
+
* Which repository a vertical's project builds from. `none`: the vertical has no project yet, and a
|
|
67
|
+
* submitted source's first build would create a hosted one. `github`: the team's own repository.
|
|
68
|
+
* `artifacts`: a hosted repository, which a connected GitHub repository does not replace.
|
|
69
|
+
*/
|
|
70
|
+
export const projectRepositoryStatus = z.discriminatedUnion('state', [
|
|
71
|
+
z.object({ state: z.literal('none') }),
|
|
72
|
+
z.object({ state: z.literal('github'), projectId: z.string().min(1), owner: z.string(), repo: z.string(), branch: z.string(), directory: z.string() }),
|
|
73
|
+
z.object({ state: z.literal('artifacts'), projectId: z.string().min(1), branch: z.string() }),
|
|
74
|
+
]);
|
|
75
|
+
/**
|
|
76
|
+
* What an association did. `created`: the vertical had no project, and now has a `github` one.
|
|
77
|
+
* `unchanged`: its project already builds from that repository, branch and directory. `refused`:
|
|
78
|
+
* its project builds from another repository, which is kept as it is; `reason` names it.
|
|
79
|
+
*/
|
|
80
|
+
export const repositoryAssociationResult = z.object({
|
|
81
|
+
outcome: z.enum(['created', 'unchanged', 'refused']),
|
|
82
|
+
status: projectRepositoryStatus,
|
|
83
|
+
reason: z.string().optional(),
|
|
84
|
+
});
|
|
54
85
|
export const sourceBuildRequest = z.object({
|
|
55
86
|
version: z.string().min(1).max(100),
|
|
56
87
|
name: z.string().min(1).max(200).optional(),
|
|
@@ -63,14 +94,16 @@ export const sourceBuildRequest = z.object({
|
|
|
63
94
|
allowUnsweptSchedules: z.boolean().default(false),
|
|
64
95
|
requireDataLossCheck: z.boolean().default(false),
|
|
65
96
|
}).strict().refine((v) => Boolean(v.snapshot) !== Boolean(v.revision), 'supply exactly one of snapshot or revision');
|
|
97
|
+
/** What a build's data-loss replay (#2321) came to, as a release reports it. */
|
|
98
|
+
export const sourceDataLossCheck = z.discriminatedUnion('status', [
|
|
99
|
+
z.object({ status: z.literal('passed'), authored: z.number().int().nonnegative() }),
|
|
100
|
+
z.object({ status: z.literal('skipped'), why: z.string() }),
|
|
101
|
+
z.object({ status: z.literal('incomplete'), authored: z.number().int().nonnegative(), notReplayed: z.number().int().nonnegative(), key: z.string(), message: z.string() }),
|
|
102
|
+
]);
|
|
66
103
|
export const sourceBuildResult = z.object({
|
|
67
104
|
projectId: z.string().min(1),
|
|
68
105
|
revision: z.string().regex(/^[0-9a-f]{40}$/),
|
|
69
|
-
dataLoss:
|
|
70
|
-
z.object({ status: z.literal('passed'), authored: z.number().int().nonnegative() }),
|
|
71
|
-
z.object({ status: z.literal('skipped'), why: z.string() }),
|
|
72
|
-
z.object({ status: z.literal('incomplete'), authored: z.number().int().nonnegative(), notReplayed: z.number().int().nonnegative(), key: z.string(), message: z.string() }),
|
|
73
|
-
]),
|
|
106
|
+
dataLoss: sourceDataLossCheck,
|
|
74
107
|
/** What the build's meter records (#2946): the time it worked, queue left out. A builder older than this sends none. */
|
|
75
108
|
usage: z.object({ buildId: z.string().min(1), ms: z.number().int().nonnegative() }).optional(),
|
|
76
109
|
});
|
|
@@ -84,7 +117,58 @@ export const sourceBuildAccepted = z.object({ buildId: z.string().min(1) });
|
|
|
84
117
|
* hand-over (#2951): its id, and its admission when published. A private vertical's version admits
|
|
85
118
|
* itself; any other waits for the admit checkpoint, as a waited-for push's does.
|
|
86
119
|
*/
|
|
87
|
-
export const sourceBuildPublished = z.object({
|
|
120
|
+
export const sourceBuildPublished = z.object({
|
|
121
|
+
versionId: z.string().min(1),
|
|
122
|
+
admission: admissionStatus,
|
|
123
|
+
/**
|
|
124
|
+
* What the release's data-loss replay came to, and the deploy's advisory warnings, as the
|
|
125
|
+
* control plane answered them: what `substrat push` prints after a waited-for deploy, kept so a
|
|
126
|
+
* push following an accepted build prints the same. Absent from a builder older than that.
|
|
127
|
+
*/
|
|
128
|
+
dataLoss: sourceDataLossCheck.optional(),
|
|
129
|
+
warnings: z.array(z.string()).optional(),
|
|
130
|
+
});
|
|
131
|
+
/**
|
|
132
|
+
* The `Prefer` token a deploy client sends to have `POST /verticals/:slug/deploy` accept the build
|
|
133
|
+
* and answer at once (RFC 7240), instead of answering once it has built and published. A control
|
|
134
|
+
* plane that cannot accept one ignores it and answers as it always has, which is what keeps a
|
|
135
|
+
* client asking for it working against an older one; it says it honoured it in `Preference-Applied`.
|
|
136
|
+
*/
|
|
137
|
+
export const RESPOND_ASYNC = 'respond-async';
|
|
138
|
+
/**
|
|
139
|
+
* The deploy route's 202 when it accepted the build (#2951): the build's id, the registry id it
|
|
140
|
+
* deploys as, and `status`, the path (from the API root) its progress is read at.
|
|
141
|
+
*/
|
|
142
|
+
export const sourceDeployAccepted = z.object({
|
|
143
|
+
buildId: z.string().min(1),
|
|
144
|
+
slug: z.string().min(1),
|
|
145
|
+
status: z.string().min(1),
|
|
146
|
+
});
|
|
147
|
+
/**
|
|
148
|
+
* Where an accepted deploy has got to, as `GET /verticals/:slug/deploy/:buildId` answers it: what a
|
|
149
|
+
* client following the build reads, never the build's own record, whose output is staff's.
|
|
150
|
+
* `publishing` is a build that built and whose release is being handed to the control plane;
|
|
151
|
+
* `published` carries the version as a waited-for deploy answers it; `failed` carries the sentence a
|
|
152
|
+
* waited-for deploy would have refused with.
|
|
153
|
+
*/
|
|
154
|
+
export const sourceDeployProgress = z.discriminatedUnion('state', [
|
|
155
|
+
z.object({ state: z.literal('building'), buildId: z.string().min(1) }),
|
|
156
|
+
z.object({ state: z.literal('publishing'), buildId: z.string().min(1) }),
|
|
157
|
+
z.object({
|
|
158
|
+
state: z.literal('published'),
|
|
159
|
+
buildId: z.string().min(1),
|
|
160
|
+
release: z.object({
|
|
161
|
+
id: z.string().min(1),
|
|
162
|
+
verticalSlug: z.string().min(1),
|
|
163
|
+
version: z.string().min(1),
|
|
164
|
+
admission: admissionStatus,
|
|
165
|
+
deploymentRef: z.string().nullable(),
|
|
166
|
+
dataLoss: sourceDataLossCheck.optional(),
|
|
167
|
+
warnings: z.array(z.string()).optional(),
|
|
168
|
+
}).passthrough(),
|
|
169
|
+
}),
|
|
170
|
+
z.object({ state: z.literal('failed'), buildId: z.string().min(1), detail: z.string().min(1) }),
|
|
171
|
+
]);
|
|
88
172
|
/**
|
|
89
173
|
* A hosted build's own record, as the builder stores it (#2931). `interrupted` is a build the
|
|
90
174
|
* agent never answered for; `slug` is null when it stopped before writing a record of its own.
|
package/dist/source-build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-build.js","sourceRoot":"","sources":["../src/source-build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AACjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEvC;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GACjC,yMAAyM,CAAC;AAE5M,wFAAwF;AACxF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,CAC1D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC;IACvD,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAA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,MAAM,EAAE;QACrB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;KAC1H,CAAC,CAAC;IACH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,sGAAsG;IACtG,SAAS,EAAE,oBAAoB,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC;AAGH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC7B,CAAC,CAAC"}
|
|
@@ -118,8 +118,8 @@ export declare const verticalConnectorDeclarations: z.ZodArray<z.ZodObject<{
|
|
|
118
118
|
/** The platform-surface route the platform calls a vertical's connector through (§6.3). */
|
|
119
119
|
export declare const CONNECTOR_CALL_PATH = "/internal/connector-call";
|
|
120
120
|
/**
|
|
121
|
-
* The route the connection-level roles (`probe`, `probe-candidate`, `sweep-connection`)
|
|
122
|
-
* scope, no nonce (§6.3). None of them reaches a scope or writes anything in the vertical.
|
|
121
|
+
* The route the connection-level roles (`probe`, `probe-candidate`, `sweep-connection`, `activity`)
|
|
122
|
+
* take: no scope, no nonce (§6.3). None of them reaches a scope or writes anything in the vertical.
|
|
123
123
|
*/
|
|
124
124
|
export declare const CONNECTOR_PROBE_PATH = "/internal/connector-probe";
|
|
125
125
|
/** State per call, serialised, in and out (§6.2). */
|
|
@@ -133,7 +133,7 @@ export declare const CONNECTOR_CONNECTION_SWEEP_MAX_BINDINGS = 100;
|
|
|
133
133
|
/** Landing inputs one `sweep-connection` answer may carry, across every scope (#3376). More waits for `more`. */
|
|
134
134
|
export declare const CONNECTOR_CONNECTION_SWEEP_MAX_LANDS = 500;
|
|
135
135
|
/** The roles that serve no scope and change nothing in the vertical: the probe path's (§6.3). */
|
|
136
|
-
export declare const CONNECTION_LEVEL_CONNECTOR_ROLES: readonly ['probe-candidate', 'probe', 'sweep-connection'];
|
|
136
|
+
export declare const CONNECTION_LEVEL_CONNECTOR_ROLES: readonly ['probe-candidate', 'probe', 'sweep-connection', 'activity'];
|
|
137
137
|
export type ConnectionLevelConnectorRole = (typeof CONNECTION_LEVEL_CONNECTOR_ROLES)[number];
|
|
138
138
|
export declare function isConnectionLevelConnectorRole(role: string): role is ConnectionLevelConnectorRole;
|
|
139
139
|
/** The connector-state key the platform keeps a scope's binding under (§6.1). */
|
|
@@ -218,6 +218,27 @@ export declare const connectorCallRequest: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
218
218
|
key: z.ZodString;
|
|
219
219
|
value: z.ZodUnknown;
|
|
220
220
|
}, z.core.$strict>>;
|
|
221
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
222
|
+
role: z.ZodLiteral<"activity">;
|
|
223
|
+
provider: z.ZodString;
|
|
224
|
+
connection: z.ZodObject<{
|
|
225
|
+
id: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
226
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
227
|
+
vertical: z.ZodString;
|
|
228
|
+
provider: z.ZodString;
|
|
229
|
+
externalAccountRef: z.ZodNullable<z.ZodString>;
|
|
230
|
+
expiresAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
|
|
231
|
+
secret: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
232
|
+
}, z.core.$strict>;
|
|
233
|
+
state: z.ZodArray<z.ZodObject<{
|
|
234
|
+
key: z.ZodString;
|
|
235
|
+
value: z.ZodUnknown;
|
|
236
|
+
}, z.core.$strict>>;
|
|
237
|
+
source: z.ZodEnum<{
|
|
238
|
+
ledger: "ledger";
|
|
239
|
+
provider: "provider";
|
|
240
|
+
}>;
|
|
241
|
+
live: z.ZodBoolean;
|
|
221
242
|
}, z.core.$strict>, z.ZodObject<{
|
|
222
243
|
role: z.ZodLiteral<"bind">;
|
|
223
244
|
provider: z.ZodString;
|
|
@@ -362,7 +383,7 @@ export declare const connectorScriptConfig: z.ZodRecord<z.ZodString, z.ZodString
|
|
|
362
383
|
* run inside the control plane (docs/rfc/connector-scripts.md). The response is
|
|
363
384
|
* `connectorCallResponse`, unchanged.
|
|
364
385
|
*
|
|
365
|
-
* `config` rides on the probes and, since #3377, on the two scoped roles a first-party connector
|
|
386
|
+
* `config` rides on the probes (and the `activity` read, which takes the probes' extras) and, since #3377, on the two scoped roles a first-party connector
|
|
366
387
|
* needs the deployment's configuration for, so each is answered from the call alone rather than from
|
|
367
388
|
* configuration handed beside it: `dispatch` (which provider environment a lookup reaches) and `sweep`
|
|
368
389
|
* (which provider hosts one scope's poll reads, and the consent it is held to). Optional on each, so
|
|
@@ -391,6 +412,28 @@ export declare const connectorScriptCallRequest: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
391
412
|
value: z.ZodUnknown;
|
|
392
413
|
}, z.core.$strict>>;
|
|
393
414
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
415
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
416
|
+
role: z.ZodLiteral<"activity">;
|
|
417
|
+
provider: z.ZodString;
|
|
418
|
+
connection: z.ZodObject<{
|
|
419
|
+
id: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
|
|
420
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
421
|
+
vertical: z.ZodString;
|
|
422
|
+
provider: z.ZodString;
|
|
423
|
+
externalAccountRef: z.ZodNullable<z.ZodString>;
|
|
424
|
+
expiresAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
|
|
425
|
+
secret: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
426
|
+
}, z.core.$strict>;
|
|
427
|
+
state: z.ZodArray<z.ZodObject<{
|
|
428
|
+
key: z.ZodString;
|
|
429
|
+
value: z.ZodUnknown;
|
|
430
|
+
}, z.core.$strict>>;
|
|
431
|
+
source: z.ZodEnum<{
|
|
432
|
+
ledger: "ledger";
|
|
433
|
+
provider: "provider";
|
|
434
|
+
}>;
|
|
435
|
+
live: z.ZodBoolean;
|
|
436
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
394
437
|
}, z.core.$strict>, z.ZodObject<{
|
|
395
438
|
role: z.ZodLiteral<"bind">;
|
|
396
439
|
provider: z.ZodString;
|
|
@@ -630,7 +673,10 @@ export declare const connectorCallResponse: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
630
673
|
}>>;
|
|
631
674
|
}, z.core.$strict>], "ok">;
|
|
632
675
|
export type ConnectorCallResponse = z.infer<typeof connectorCallResponse>;
|
|
633
|
-
/**
|
|
676
|
+
/**
|
|
677
|
+
* `result` of a `sweep` call. A `probe` or `probe-candidate` call answers `connectionProbe`, and an
|
|
678
|
+
* `activity` call answers `connectionActivity`.
|
|
679
|
+
*/
|
|
634
680
|
export declare const connectorSweepResult: z.ZodObject<{
|
|
635
681
|
landed: z.ZodNumber;
|
|
636
682
|
more: z.ZodBoolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vertical-connector.d.ts","sourceRoot":"","sources":["../src/vertical-connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;;;;;;;;GASG;AAEH,yFAAyF;AACzF,wBAAgB,2BAA2B,CAAC,QA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AC,CAAC;AAE5F,mGAAmG;AACnG,eAAO,MAAM,mBAAmB;;iBAA2D,CAAC;AAC5F,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { instant, permissionKey, scopeId, tenantId } from './ids.js';
|
|
3
|
-
import { connectionId, connectionProvider } from './connections.js';
|
|
3
|
+
import { connectionActivitySource, connectionId, connectionProvider } from './connections.js';
|
|
4
4
|
import { connectionLandingOptions } from './connection-landing.js';
|
|
5
5
|
import { domainEvent, eventType } from './events.js';
|
|
6
6
|
import { credentialBinding } from './credential-binding.js';
|
|
@@ -101,8 +101,8 @@ export const verticalConnectorDeclarations = z
|
|
|
101
101
|
/** The platform-surface route the platform calls a vertical's connector through (§6.3). */
|
|
102
102
|
export const CONNECTOR_CALL_PATH = '/internal/connector-call';
|
|
103
103
|
/**
|
|
104
|
-
* The route the connection-level roles (`probe`, `probe-candidate`, `sweep-connection`)
|
|
105
|
-
* scope, no nonce (§6.3). None of them reaches a scope or writes anything in the vertical.
|
|
104
|
+
* The route the connection-level roles (`probe`, `probe-candidate`, `sweep-connection`, `activity`)
|
|
105
|
+
* take: no scope, no nonce (§6.3). None of them reaches a scope or writes anything in the vertical.
|
|
106
106
|
*/
|
|
107
107
|
export const CONNECTOR_PROBE_PATH = '/internal/connector-probe';
|
|
108
108
|
/** State per call, serialised, in and out (§6.2). */
|
|
@@ -116,7 +116,7 @@ export const CONNECTOR_CONNECTION_SWEEP_MAX_BINDINGS = 100;
|
|
|
116
116
|
/** Landing inputs one `sweep-connection` answer may carry, across every scope (#3376). More waits for `more`. */
|
|
117
117
|
export const CONNECTOR_CONNECTION_SWEEP_MAX_LANDS = 500;
|
|
118
118
|
/** The roles that serve no scope and change nothing in the vertical: the probe path's (§6.3). */
|
|
119
|
-
export const CONNECTION_LEVEL_CONNECTOR_ROLES = ['probe-candidate', 'probe', 'sweep-connection'];
|
|
119
|
+
export const CONNECTION_LEVEL_CONNECTOR_ROLES = ['probe-candidate', 'probe', 'sweep-connection', 'activity'];
|
|
120
120
|
export function isConnectionLevelConnectorRole(role) {
|
|
121
121
|
return CONNECTION_LEVEL_CONNECTOR_ROLES.includes(role);
|
|
122
122
|
}
|
|
@@ -207,6 +207,22 @@ function connectorCallRequestOf(provider, probeExtra, sweepExtra, dispatchExtra)
|
|
|
207
207
|
.discriminatedUnion('role', [
|
|
208
208
|
z.object({ role: z.literal('probe-candidate'), provider, secret: z.record(z.string(), z.string()), ...probeExtra }).strict(),
|
|
209
209
|
z.object({ role: z.literal('probe'), provider, connection, state: connectorCallState, ...probeExtra }).strict(),
|
|
210
|
+
// #3377 (Scrive first): a console's read of what one connection has done, where answering it
|
|
211
|
+
// calls the provider (the provider's own archive, or its current state joined onto the
|
|
212
|
+
// connector's records). Connection-level, like a probe: no scope, and nothing written. `source`
|
|
213
|
+
// and `live` are the console's own switches; the answer's `result` is `connectionActivity`. A
|
|
214
|
+
// read that calls no provider is no call: the platform projects the connector's state itself.
|
|
215
|
+
z
|
|
216
|
+
.object({
|
|
217
|
+
role: z.literal('activity'),
|
|
218
|
+
provider,
|
|
219
|
+
connection,
|
|
220
|
+
state: connectorCallState,
|
|
221
|
+
source: connectionActivitySource,
|
|
222
|
+
live: z.boolean(),
|
|
223
|
+
...probeExtra,
|
|
224
|
+
})
|
|
225
|
+
.strict(),
|
|
210
226
|
z
|
|
211
227
|
.object({
|
|
212
228
|
role: z.literal('bind'),
|
|
@@ -283,7 +299,7 @@ export const connectorScriptConfig = z
|
|
|
283
299
|
* run inside the control plane (docs/rfc/connector-scripts.md). The response is
|
|
284
300
|
* `connectorCallResponse`, unchanged.
|
|
285
301
|
*
|
|
286
|
-
* `config` rides on the probes and, since #3377, on the two scoped roles a first-party connector
|
|
302
|
+
* `config` rides on the probes (and the `activity` read, which takes the probes' extras) and, since #3377, on the two scoped roles a first-party connector
|
|
287
303
|
* needs the deployment's configuration for, so each is answered from the call alone rather than from
|
|
288
304
|
* configuration handed beside it: `dispatch` (which provider environment a lookup reaches) and `sweep`
|
|
289
305
|
* (which provider hosts one scope's poll reads, and the consent it is held to). Optional on each, so
|
|
@@ -327,7 +343,10 @@ export const connectorCallResponse = z.discriminatedUnion('ok', [
|
|
|
327
343
|
z.object({ ok: z.literal(true), result: z.unknown(), state: connectorCallStateWrites, uses }).strict(),
|
|
328
344
|
connectorCallFailure,
|
|
329
345
|
]);
|
|
330
|
-
/**
|
|
346
|
+
/**
|
|
347
|
+
* `result` of a `sweep` call. A `probe` or `probe-candidate` call answers `connectionProbe`, and an
|
|
348
|
+
* `activity` call answers `connectionActivity`.
|
|
349
|
+
*/
|
|
331
350
|
export const connectorSweepResult = z.object({ landed: z.number().int().nonnegative(), more: z.boolean() });
|
|
332
351
|
/**
|
|
333
352
|
* `result` of a `sweep-connection` call (#3376): per bound scope, the inputs the platform lands through
|