@fabrika/control-contract 0.9.0-dev.3 → 0.9.0-dev.5
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/package.json +4 -4
- package/src/access.ts +12 -0
- package/src/approval-view.ts +265 -0
- package/src/index.ts +113 -4
- package/src/mail.ts +2 -0
- package/src/rpc.ts +207 -1
- package/types/src/access.d.ts +12 -0
- package/types/src/approval-view.d.ts +79 -0
- package/types/src/builder-connections.d.ts +15 -15
- package/types/src/index.d.ts +73 -4
- package/types/src/mail.d.ts +2 -0
- package/types/src/rpc.d.ts +225 -2
package/src/rpc.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RpcProcedureContract } from '@fabrika/app'
|
|
2
|
-
import type { ExportDescription } from '@fabrika/auth-core'
|
|
2
|
+
import type { ExportDescription, OpsContentView, OpsView } from '@fabrika/auth-core'
|
|
3
|
+
import { z } from 'zod'
|
|
3
4
|
import type { BuilderConnectionReceiptDto, CreateBuilderConnectionReceiptRequest, GetBuilderConnectionReceiptRequest } from './builder-connections.js'
|
|
4
5
|
import type {
|
|
5
6
|
ApproveDeviceAuthorizationResult,
|
|
@@ -36,9 +37,12 @@ import type {
|
|
|
36
37
|
PutAppVarRequest,
|
|
37
38
|
RegisterAppRequest,
|
|
38
39
|
RegisterAppResponse,
|
|
40
|
+
ReleaseNamespaceClaimsResponse,
|
|
39
41
|
RemoveDeploymentNamespaceResponse,
|
|
42
|
+
RepublishAllNamespacesResponse,
|
|
40
43
|
RunDto,
|
|
41
44
|
RunLogResponse,
|
|
45
|
+
RunStatus,
|
|
42
46
|
RunTailResponse,
|
|
43
47
|
SetEnvironmentProtectionRequest,
|
|
44
48
|
StartGitHubSourceConnectionRequest,
|
|
@@ -119,9 +123,17 @@ export interface UpdateNamespaceInput extends NamespaceIdInput {
|
|
|
119
123
|
readonly namespace: UpdateDeploymentNamespaceRequest
|
|
120
124
|
}
|
|
121
125
|
|
|
126
|
+
/** The app environment whose claims in the namespace are released. */
|
|
127
|
+
export interface ReleaseNamespaceClaimsInput extends NamespaceIdInput {
|
|
128
|
+
readonly appId: string
|
|
129
|
+
readonly env: string
|
|
130
|
+
}
|
|
131
|
+
|
|
122
132
|
export interface RunListInput {
|
|
123
133
|
readonly appId?: string
|
|
124
134
|
readonly env?: string
|
|
135
|
+
/** Filter before pagination, so an old queued or running deploy is not hidden by newer finished runs. */
|
|
136
|
+
readonly statuses?: RunStatus[]
|
|
125
137
|
readonly before?: string
|
|
126
138
|
readonly limit?: number
|
|
127
139
|
}
|
|
@@ -207,6 +219,16 @@ export interface ControlRpcContract {
|
|
|
207
219
|
update: RpcProcedure<UpdateNamespaceInput, DeploymentNamespaceDetailDto>
|
|
208
220
|
/** Free a namespace id. Refused while any app environment is registered in it (backlog 73). */
|
|
209
221
|
remove: RpcProcedure<NamespaceIdInput, RemoveDeploymentNamespaceResponse>
|
|
222
|
+
/**
|
|
223
|
+
* Republish the proxy of every ready namespace, as after a change of the installation's client logo (ADR-0066).
|
|
224
|
+
* Returns once each rebuild is submitted; a failure is a 502 naming the namespaces to reconcile.
|
|
225
|
+
*/
|
|
226
|
+
republishAll: RpcProcedure<void, RepublishAllNamespacesResponse>
|
|
227
|
+
/**
|
|
228
|
+
* Release one app environment's resource claims in the namespace, only when the provider confirms every claimed
|
|
229
|
+
* resource gone. The operator deletes the resources first; fabrika deletes none (ADR-0034).
|
|
230
|
+
*/
|
|
231
|
+
releaseClaims: RpcProcedure<ReleaseNamespaceClaimsInput, ReleaseNamespaceClaimsResponse>
|
|
210
232
|
}
|
|
211
233
|
runs: {
|
|
212
234
|
list: RpcProcedure<RunListInput, CursorList<RunDto>>
|
|
@@ -249,6 +271,27 @@ export interface ControlRpcContract {
|
|
|
249
271
|
remove: RpcProcedure<MailRuleIdInput, OkResponse>
|
|
250
272
|
}
|
|
251
273
|
}
|
|
274
|
+
/**
|
|
275
|
+
* An application environment's data (ADR-0069): `data.read` and `data.manage` at the coordinates,
|
|
276
|
+
* `data.content.read` as a global grant only; every denial is the 404 of an absent environment.
|
|
277
|
+
*/
|
|
278
|
+
data: {
|
|
279
|
+
operations: {
|
|
280
|
+
list: RpcProcedure<DataOperationListInput, CursorList<DataOperationDto>>
|
|
281
|
+
get: RpcProcedure<{ operationId: string }, DataOperationDto>
|
|
282
|
+
}
|
|
283
|
+
/** The metadata view; never content. */
|
|
284
|
+
view: RpcProcedure<AppEnvironmentInput, OpsView>
|
|
285
|
+
content: RpcProcedure<AppEnvironmentInput, OpsContentView>
|
|
286
|
+
start: RpcProcedure<StartDataOperationInput, DataOperationDto>
|
|
287
|
+
recover: RpcProcedure<RecoverDataOperationInput, DataOperationDto>
|
|
288
|
+
/** Consistent backups (ADR-0070): listed and their schedule read under `data.read`, the schedule set under `data.manage`. */
|
|
289
|
+
backups: {
|
|
290
|
+
list: RpcProcedure<DataOperationListInput, CursorList<DataBackupDto>>
|
|
291
|
+
schedule: RpcProcedure<AppEnvironmentInput, DataBackupScheduleDto>
|
|
292
|
+
setSchedule: RpcProcedure<SetDataBackupScheduleInput, DataBackupScheduleDto>
|
|
293
|
+
}
|
|
294
|
+
}
|
|
252
295
|
}
|
|
253
296
|
|
|
254
297
|
/**
|
|
@@ -262,3 +305,166 @@ export interface DescribeConnectorRequest {
|
|
|
262
305
|
readonly export: string
|
|
263
306
|
readonly version: number
|
|
264
307
|
}
|
|
308
|
+
|
|
309
|
+
// ── Data operations (ADR-0069) ───────────────────────────────────────────────
|
|
310
|
+
|
|
311
|
+
/** What an application environment's object admits (ADR-0069 §3). */
|
|
312
|
+
export type MaintenanceMode = 'open' | 'read-only' | 'closed' | 'inspect'
|
|
313
|
+
|
|
314
|
+
export type DataOperationKind = 'maintenance' | 'backup' | 'migrate' | 'recovery' | 'restore'
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Where an operation stands: `reconcile` reads the record and the object's published state (a recovery's first step),
|
|
318
|
+
* `restrict` publishes a generation in a restricting mode, `backup` and `verify` take and check a consistent backup,
|
|
319
|
+
* `deploy` runs the operation's own deploy, `migrate` runs the pending migrations, `resume` continues the interrupted
|
|
320
|
+
* operation from its recorded step, and `open` publishes the generation that opens the object. A side restore (ADR-0070
|
|
321
|
+
* §9) also `list`s its clone with a deploy, `import`s the backup into it, `promote`s it (the clone `open`, the original
|
|
322
|
+
* `inspect`), `point`s ordinary traffic at it with a deploy, waits for it to `serve`, `rewind`s the original to the
|
|
323
|
+
* target time and `check`s the original's schema; `revert` points traffic back at the original with a deploy.
|
|
324
|
+
*/
|
|
325
|
+
export type DataOperationStep =
|
|
326
|
+
| 'reconcile'
|
|
327
|
+
| 'restrict'
|
|
328
|
+
| 'backup'
|
|
329
|
+
| 'verify'
|
|
330
|
+
| 'deploy'
|
|
331
|
+
| 'migrate'
|
|
332
|
+
| 'resume'
|
|
333
|
+
| 'open'
|
|
334
|
+
| 'list'
|
|
335
|
+
| 'import'
|
|
336
|
+
| 'promote'
|
|
337
|
+
| 'point'
|
|
338
|
+
| 'serve'
|
|
339
|
+
| 'rewind'
|
|
340
|
+
| 'check'
|
|
341
|
+
| 'revert'
|
|
342
|
+
|
|
343
|
+
export type DataOperationState = 'running' | 'succeeded' | 'failed'
|
|
344
|
+
|
|
345
|
+
/** What a recovery does after its closed fence: resume the interrupted operation, or open the object. */
|
|
346
|
+
export type DataOperationResolution = 'resume' | 'open'
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* One operation as `data.read` shows it: an allowlisted projection of Control's record, with identifiers, states,
|
|
350
|
+
* codes and timestamps only. It carries no free text and no content.
|
|
351
|
+
*/
|
|
352
|
+
export interface DataOperationDto {
|
|
353
|
+
readonly id: string
|
|
354
|
+
readonly appId: string
|
|
355
|
+
readonly env: string
|
|
356
|
+
readonly kind: DataOperationKind
|
|
357
|
+
readonly step: DataOperationStep
|
|
358
|
+
/** The mode the operation requires of the object at its step; a successor publishes its fresh generation in it. */
|
|
359
|
+
readonly targetMode: MaintenanceMode
|
|
360
|
+
/** The latest generation the operation reserved. */
|
|
361
|
+
readonly generation: number
|
|
362
|
+
readonly state: DataOperationState
|
|
363
|
+
/** A code once it failed, never an error message. */
|
|
364
|
+
readonly errorCode: string | null
|
|
365
|
+
/** An opaque principal id (as `runActor`), never an email or label. */
|
|
366
|
+
readonly actor: string
|
|
367
|
+
readonly createdAt: number
|
|
368
|
+
readonly updatedAt: number
|
|
369
|
+
readonly finishedAt: number | null
|
|
370
|
+
/** A recovery's interrupted operation, of the same environment; `null` for every other kind. */
|
|
371
|
+
readonly recoversOperationId: string | null
|
|
372
|
+
/** A recovery's choice after its closed fence; `null` for every other kind. */
|
|
373
|
+
readonly resolution: DataOperationResolution | null
|
|
374
|
+
/** A `migrate` operation's deploy run; `null` for every other kind. */
|
|
375
|
+
readonly runId: string | null
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export const DATA_OPERATION_MAX_PAGE_SIZE = 100
|
|
379
|
+
|
|
380
|
+
const nonEmpty = z.string().min(1)
|
|
381
|
+
const maintenanceMode = z.enum(['open', 'read-only', 'closed', 'inspect'])
|
|
382
|
+
|
|
383
|
+
/** One environment's operations, newest first; `before` is the last id of the previous page. */
|
|
384
|
+
export const dataOperationListInputSchema = z.object({
|
|
385
|
+
appId: nonEmpty,
|
|
386
|
+
env: nonEmpty,
|
|
387
|
+
before: nonEmpty.optional(),
|
|
388
|
+
limit: z.number().int().min(1).max(DATA_OPERATION_MAX_PAGE_SIZE).optional(),
|
|
389
|
+
}).strict()
|
|
390
|
+
|
|
391
|
+
export type DataOperationListInput = z.infer<typeof dataOperationListInputSchema>
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* An operation a person starts. A migration starts inside a deploy and a recovery has its own request, so neither is
|
|
395
|
+
* started here. A restore names the time `at` (ISO 8601 with an offset) its environment's data is recovered as of.
|
|
396
|
+
*/
|
|
397
|
+
export const startDataOperationInputSchema = z.discriminatedUnion('kind', [
|
|
398
|
+
z.object({ appId: nonEmpty, env: nonEmpty, kind: z.literal('maintenance'), mode: maintenanceMode }).strict(),
|
|
399
|
+
z.object({ appId: nonEmpty, env: nonEmpty, kind: z.literal('backup') }).strict(),
|
|
400
|
+
z.object({ appId: nonEmpty, env: nonEmpty, kind: z.literal('restore'), at: z.string().datetime({ offset: true }) }).strict(),
|
|
401
|
+
])
|
|
402
|
+
|
|
403
|
+
export type StartDataOperationInput = z.infer<typeof startDataOperationInputSchema>
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Recover an environment whose operation `operationId` is stuck: fence it with a fresh generation in `closed`, then
|
|
407
|
+
* resume that operation from its recorded step, or open the object at a new generation.
|
|
408
|
+
*/
|
|
409
|
+
export const recoverDataOperationInputSchema = z.object({
|
|
410
|
+
appId: nonEmpty,
|
|
411
|
+
env: nonEmpty,
|
|
412
|
+
operationId: nonEmpty,
|
|
413
|
+
resolution: z.enum(['resume', 'open']),
|
|
414
|
+
}).strict()
|
|
415
|
+
|
|
416
|
+
export type RecoverDataOperationInput = z.infer<typeof recoverDataOperationInputSchema>
|
|
417
|
+
|
|
418
|
+
/** `succeeded` only once its rehearsal passed. */
|
|
419
|
+
export type DataBackupState = 'running' | 'succeeded' | 'failed'
|
|
420
|
+
|
|
421
|
+
export type DataRehearsalOutcome = 'pending' | 'passed' | 'failed'
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* One consistent backup as `data.read` shows it: identifiers, states, codes, sizes and timestamps. It carries no free
|
|
425
|
+
* text and no content; downloading a dump is `data.content.read`.
|
|
426
|
+
*/
|
|
427
|
+
export interface DataBackupDto {
|
|
428
|
+
/** The backup's record. */
|
|
429
|
+
readonly id: string
|
|
430
|
+
readonly appId: string
|
|
431
|
+
readonly env: string
|
|
432
|
+
/** The `backup` operation that took it. */
|
|
433
|
+
readonly operationId: string
|
|
434
|
+
/** The object it was taken from. */
|
|
435
|
+
readonly object: string
|
|
436
|
+
/** The dump's key in the bucket; a resumed backup whose dump started again carries the new one. */
|
|
437
|
+
readonly dumpId: string
|
|
438
|
+
/** Taken by a deploy's migration phase, not by the daily schedule. */
|
|
439
|
+
readonly preMigration: boolean
|
|
440
|
+
readonly state: DataBackupState
|
|
441
|
+
/** A code once it failed, never an error message. */
|
|
442
|
+
readonly errorCode: string | null
|
|
443
|
+
readonly createdAt: number
|
|
444
|
+
readonly finishedAt: number | null
|
|
445
|
+
/** The object's bookmark when the dump began. */
|
|
446
|
+
readonly bookmark: string | null
|
|
447
|
+
/** Set once the upload completed. */
|
|
448
|
+
readonly sizeBytes: number | null
|
|
449
|
+
readonly parts: number | null
|
|
450
|
+
/** How many tables the manifest lists. */
|
|
451
|
+
readonly tables: number | null
|
|
452
|
+
readonly rehearsal: DataRehearsalOutcome
|
|
453
|
+
/** The code the rehearsal failed with. */
|
|
454
|
+
readonly rehearsalCode: string | null
|
|
455
|
+
/** Past its 30-day retention: never offered for a restore. */
|
|
456
|
+
readonly expired: boolean
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/** Whether the environment takes daily backups: on unless it opted out. Opting out leaves the pre-migration backup. */
|
|
460
|
+
export interface DataBackupScheduleDto {
|
|
461
|
+
readonly appId: string
|
|
462
|
+
readonly env: string
|
|
463
|
+
readonly daily: boolean
|
|
464
|
+
/** When it was last set; `null` while it keeps the default. */
|
|
465
|
+
readonly updatedAt: number | null
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export interface SetDataBackupScheduleInput extends AppEnvironmentInput {
|
|
469
|
+
readonly daily: boolean
|
|
470
|
+
}
|
package/types/src/access.d.ts
CHANGED
|
@@ -43,6 +43,18 @@ export declare const CONTROL_ACTIONS: Readonly<{
|
|
|
43
43
|
MAIL_CONTENT_READ: "mail.content.read";
|
|
44
44
|
/** Release or drop a held message, requeue a final one, and change the gate's rules. Global. */
|
|
45
45
|
MAIL_MANAGE: "mail.manage";
|
|
46
|
+
/**
|
|
47
|
+
* Read an application environment's data as a metadata projection: sizes, counts, state and the backup list
|
|
48
|
+
* (ADR-0069 §2). Scoped by app/environment.
|
|
49
|
+
*/
|
|
50
|
+
DATA_READ: "data.read";
|
|
51
|
+
/**
|
|
52
|
+
* Read row contents, exports, backup downloads and content fields of every tenant of an environment. Checked as a
|
|
53
|
+
* global grant only, so a grant scoped to an app never carries it: content is for the installation's operators.
|
|
54
|
+
*/
|
|
55
|
+
DATA_CONTENT_READ: "data.content.read";
|
|
56
|
+
/** Run maintenance transitions, backups and restores, and recover an interrupted operation. Scoped by app/environment. */
|
|
57
|
+
DATA_MANAGE: "data.manage";
|
|
46
58
|
}>;
|
|
47
59
|
/**
|
|
48
60
|
* The scope dimensions Control authorizes within (flat + independent IAM semantics):
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type AccessChangeDto, type ChangeAudienceDto, type ChangeSubjectDto, type ChangeSubjectKind, type SurfaceReach } from './index.js';
|
|
2
|
+
/** The endpoints of one caller group: everyone a reach admits, or the holders of one link mount's share links. */
|
|
3
|
+
export interface CallerGroup {
|
|
4
|
+
readonly kind: 'caller';
|
|
5
|
+
readonly key: string;
|
|
6
|
+
readonly reach: SurfaceReach;
|
|
7
|
+
readonly mount?: string;
|
|
8
|
+
}
|
|
9
|
+
/** The lines about one kind of subject other than an endpoint: tables, roles, migrations, the application. */
|
|
10
|
+
export interface SubjectGroup {
|
|
11
|
+
readonly kind: 'subject';
|
|
12
|
+
readonly key: string;
|
|
13
|
+
readonly subject: ChangeSubjectKind;
|
|
14
|
+
}
|
|
15
|
+
/** One subject and its lines, most important first. */
|
|
16
|
+
export interface SubjectRow {
|
|
17
|
+
readonly kind: 'subject';
|
|
18
|
+
readonly subject: ChangeSubjectDto;
|
|
19
|
+
readonly audience?: ChangeAudienceDto;
|
|
20
|
+
readonly changes: readonly AccessChangeDto[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Quiet subjects that changed alike: each has lines of exactly these rules and effects, and none of them widens or needs
|
|
24
|
+
* closer review (`rules` in order, as `rule` and `effect`).
|
|
25
|
+
*/
|
|
26
|
+
export interface FoldedRow {
|
|
27
|
+
readonly kind: 'folded';
|
|
28
|
+
readonly rules: readonly {
|
|
29
|
+
readonly rule: string;
|
|
30
|
+
readonly effect: 'narrows' | 'neutral';
|
|
31
|
+
}[];
|
|
32
|
+
readonly subjects: readonly SubjectRow[];
|
|
33
|
+
}
|
|
34
|
+
export type ChangeRow = SubjectRow | FoldedRow;
|
|
35
|
+
export interface EffectTally {
|
|
36
|
+
readonly widens: number;
|
|
37
|
+
readonly narrows: number;
|
|
38
|
+
readonly neutral: number;
|
|
39
|
+
readonly closer: number;
|
|
40
|
+
}
|
|
41
|
+
export type ChangeGroup = (CallerGroup | SubjectGroup) & {
|
|
42
|
+
readonly rows: readonly ChangeRow[];
|
|
43
|
+
/** How many subjects the group holds, folded ones included. */
|
|
44
|
+
readonly subjects: number;
|
|
45
|
+
readonly tally: EffectTally;
|
|
46
|
+
/** Whether the page collapses the group by default: only when it holds no widening line. */
|
|
47
|
+
readonly collapsed: boolean;
|
|
48
|
+
};
|
|
49
|
+
export interface ApprovalView {
|
|
50
|
+
/**
|
|
51
|
+
* Per caller group the endpoints that change, apart from the removed endpoints and mounts its paths reach (a removal
|
|
52
|
+
* that widens stands with whoever its paths reach now), and the migration files the change adds or edits.
|
|
53
|
+
*/
|
|
54
|
+
readonly impact: {
|
|
55
|
+
readonly callers: readonly {
|
|
56
|
+
readonly key: string;
|
|
57
|
+
readonly reach: SurfaceReach;
|
|
58
|
+
readonly mount?: string;
|
|
59
|
+
readonly endpoints: number;
|
|
60
|
+
readonly removedEndpoints: number;
|
|
61
|
+
readonly removedMounts: number;
|
|
62
|
+
}[];
|
|
63
|
+
readonly migrations: number;
|
|
64
|
+
};
|
|
65
|
+
readonly callers: readonly ChangeGroup[];
|
|
66
|
+
readonly data: readonly ChangeGroup[];
|
|
67
|
+
/** The lines of a run classified before lines carried facts, in their stored order. */
|
|
68
|
+
readonly unsorted: readonly AccessChangeDto[];
|
|
69
|
+
}
|
|
70
|
+
/** Quiet subjects that changed alike fold from this many on. */
|
|
71
|
+
export declare const FOLD_AT = 3;
|
|
72
|
+
/**
|
|
73
|
+
* A line's rank: a widening for closer review first, then a widening, a narrowing for closer review, a line that leaves
|
|
74
|
+
* access unchanged, a narrowing. Nothing else enters it, so it cannot disagree with the classification.
|
|
75
|
+
*/
|
|
76
|
+
export declare function changeRank(change: Pick<AccessChangeDto, 'effect' | 'review'>): number;
|
|
77
|
+
export declare function approvalView(changes: readonly AccessChangeDto[]): ApprovalView;
|
|
78
|
+
/** Every line a row holds. */
|
|
79
|
+
export declare function rowChanges(row: ChangeRow): readonly AccessChangeDto[];
|
|
@@ -41,23 +41,23 @@ export declare const builderConnectionAppSchema: z.ZodEffects<z.ZodObject<{
|
|
|
41
41
|
createdAt: z.ZodNumber;
|
|
42
42
|
}, "strict", z.ZodTypeAny, {
|
|
43
43
|
id: string;
|
|
44
|
+
createdAt: number;
|
|
44
45
|
repoUrl: string;
|
|
45
46
|
defaultBranch: string;
|
|
46
47
|
workerDir: string | null;
|
|
47
48
|
buildCmd: string | null;
|
|
48
49
|
configPath: string | null;
|
|
49
50
|
githubInstallationId: number | null;
|
|
50
|
-
createdAt: number;
|
|
51
51
|
githubConnectionId?: string | null | undefined;
|
|
52
52
|
}, {
|
|
53
53
|
id: string;
|
|
54
|
+
createdAt: number;
|
|
54
55
|
repoUrl: string;
|
|
55
56
|
defaultBranch: string;
|
|
56
57
|
workerDir: string | null;
|
|
57
58
|
buildCmd: string | null;
|
|
58
59
|
configPath: string | null;
|
|
59
60
|
githubInstallationId: number | null;
|
|
60
|
-
createdAt: number;
|
|
61
61
|
githubConnectionId?: string | null | undefined;
|
|
62
62
|
}>, {
|
|
63
63
|
githubInstallationId: number | null;
|
|
@@ -71,13 +71,13 @@ export declare const builderConnectionAppSchema: z.ZodEffects<z.ZodObject<{
|
|
|
71
71
|
configPath: string | null;
|
|
72
72
|
}, {
|
|
73
73
|
id: string;
|
|
74
|
+
createdAt: number;
|
|
74
75
|
repoUrl: string;
|
|
75
76
|
defaultBranch: string;
|
|
76
77
|
workerDir: string | null;
|
|
77
78
|
buildCmd: string | null;
|
|
78
79
|
configPath: string | null;
|
|
79
80
|
githubInstallationId: number | null;
|
|
80
|
-
createdAt: number;
|
|
81
81
|
githubConnectionId?: string | null | undefined;
|
|
82
82
|
}>;
|
|
83
83
|
export declare const builderConnectionEnvironmentSchema: z.ZodObject<{
|
|
@@ -88,16 +88,16 @@ export declare const builderConnectionEnvironmentSchema: z.ZodObject<{
|
|
|
88
88
|
triggerRef: z.ZodNullable<z.ZodString>;
|
|
89
89
|
}, "strict", z.ZodTypeAny, {
|
|
90
90
|
env: string;
|
|
91
|
+
namespaceId: string | null;
|
|
91
92
|
domain: string | null;
|
|
92
93
|
publicOrigin: string | null;
|
|
93
94
|
triggerRef: string | null;
|
|
94
|
-
namespaceId: string | null;
|
|
95
95
|
}, {
|
|
96
96
|
env: string;
|
|
97
|
+
namespaceId: string | null;
|
|
97
98
|
domain: string | null;
|
|
98
99
|
publicOrigin: string | null;
|
|
99
100
|
triggerRef: string | null;
|
|
100
|
-
namespaceId: string | null;
|
|
101
101
|
}>;
|
|
102
102
|
export declare const builderConnectionReceiptSchema: z.ZodObject<{
|
|
103
103
|
version: z.ZodLiteral<1>;
|
|
@@ -115,23 +115,23 @@ export declare const builderConnectionReceiptSchema: z.ZodObject<{
|
|
|
115
115
|
createdAt: z.ZodNumber;
|
|
116
116
|
}, "strict", z.ZodTypeAny, {
|
|
117
117
|
id: string;
|
|
118
|
+
createdAt: number;
|
|
118
119
|
repoUrl: string;
|
|
119
120
|
defaultBranch: string;
|
|
120
121
|
workerDir: string | null;
|
|
121
122
|
buildCmd: string | null;
|
|
122
123
|
configPath: string | null;
|
|
123
124
|
githubInstallationId: number | null;
|
|
124
|
-
createdAt: number;
|
|
125
125
|
githubConnectionId?: string | null | undefined;
|
|
126
126
|
}, {
|
|
127
127
|
id: string;
|
|
128
|
+
createdAt: number;
|
|
128
129
|
repoUrl: string;
|
|
129
130
|
defaultBranch: string;
|
|
130
131
|
workerDir: string | null;
|
|
131
132
|
buildCmd: string | null;
|
|
132
133
|
configPath: string | null;
|
|
133
134
|
githubInstallationId: number | null;
|
|
134
|
-
createdAt: number;
|
|
135
135
|
githubConnectionId?: string | null | undefined;
|
|
136
136
|
}>, {
|
|
137
137
|
githubInstallationId: number | null;
|
|
@@ -145,13 +145,13 @@ export declare const builderConnectionReceiptSchema: z.ZodObject<{
|
|
|
145
145
|
configPath: string | null;
|
|
146
146
|
}, {
|
|
147
147
|
id: string;
|
|
148
|
+
createdAt: number;
|
|
148
149
|
repoUrl: string;
|
|
149
150
|
defaultBranch: string;
|
|
150
151
|
workerDir: string | null;
|
|
151
152
|
buildCmd: string | null;
|
|
152
153
|
configPath: string | null;
|
|
153
154
|
githubInstallationId: number | null;
|
|
154
|
-
createdAt: number;
|
|
155
155
|
githubConnectionId?: string | null | undefined;
|
|
156
156
|
}>;
|
|
157
157
|
environment: z.ZodObject<{
|
|
@@ -162,16 +162,16 @@ export declare const builderConnectionReceiptSchema: z.ZodObject<{
|
|
|
162
162
|
triggerRef: z.ZodNullable<z.ZodString>;
|
|
163
163
|
}, "strict", z.ZodTypeAny, {
|
|
164
164
|
env: string;
|
|
165
|
+
namespaceId: string | null;
|
|
165
166
|
domain: string | null;
|
|
166
167
|
publicOrigin: string | null;
|
|
167
168
|
triggerRef: string | null;
|
|
168
|
-
namespaceId: string | null;
|
|
169
169
|
}, {
|
|
170
170
|
env: string;
|
|
171
|
+
namespaceId: string | null;
|
|
171
172
|
domain: string | null;
|
|
172
173
|
publicOrigin: string | null;
|
|
173
174
|
triggerRef: string | null;
|
|
174
|
-
namespaceId: string | null;
|
|
175
175
|
}>;
|
|
176
176
|
createdAt: z.ZodNumber;
|
|
177
177
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -188,36 +188,36 @@ export declare const builderConnectionReceiptSchema: z.ZodObject<{
|
|
|
188
188
|
};
|
|
189
189
|
environment: {
|
|
190
190
|
env: string;
|
|
191
|
+
namespaceId: string | null;
|
|
191
192
|
domain: string | null;
|
|
192
193
|
publicOrigin: string | null;
|
|
193
194
|
triggerRef: string | null;
|
|
194
|
-
namespaceId: string | null;
|
|
195
195
|
};
|
|
196
196
|
attemptId: string;
|
|
197
197
|
version: 1;
|
|
198
|
-
provider: string;
|
|
199
198
|
createdAt: number;
|
|
199
|
+
provider: string;
|
|
200
200
|
}, {
|
|
201
201
|
app: {
|
|
202
202
|
id: string;
|
|
203
|
+
createdAt: number;
|
|
203
204
|
repoUrl: string;
|
|
204
205
|
defaultBranch: string;
|
|
205
206
|
workerDir: string | null;
|
|
206
207
|
buildCmd: string | null;
|
|
207
208
|
configPath: string | null;
|
|
208
209
|
githubInstallationId: number | null;
|
|
209
|
-
createdAt: number;
|
|
210
210
|
githubConnectionId?: string | null | undefined;
|
|
211
211
|
};
|
|
212
212
|
environment: {
|
|
213
213
|
env: string;
|
|
214
|
+
namespaceId: string | null;
|
|
214
215
|
domain: string | null;
|
|
215
216
|
publicOrigin: string | null;
|
|
216
217
|
triggerRef: string | null;
|
|
217
|
-
namespaceId: string | null;
|
|
218
218
|
};
|
|
219
219
|
attemptId: string;
|
|
220
220
|
version: 1;
|
|
221
|
-
provider: string;
|
|
222
221
|
createdAt: number;
|
|
222
|
+
provider: string;
|
|
223
223
|
}>;
|
package/types/src/index.d.ts
CHANGED
|
@@ -116,7 +116,7 @@ export interface GitHubSourceConnectionListResponse {
|
|
|
116
116
|
export interface GitHubSourceConnectionRepairRequiredDto extends GitHubSourceConnectionBaseDto {
|
|
117
117
|
readonly state: 'repair-required';
|
|
118
118
|
readonly connectionId: string;
|
|
119
|
-
readonly reason: 'interrupted-setup' | 'credential-activation' | 'installation-verification';
|
|
119
|
+
readonly reason: 'interrupted-setup' | 'credential-activation' | 'installation-verification' | 'rate-limited';
|
|
120
120
|
readonly app?: GitHubSourceConnectionAppDto;
|
|
121
121
|
}
|
|
122
122
|
/** Browser-safe setup state. It never carries a private key, webhook secret, token, or source RPC key. */
|
|
@@ -345,6 +345,14 @@ export interface DeploymentNamespaceListResponse {
|
|
|
345
345
|
export interface RemoveDeploymentNamespaceResponse {
|
|
346
346
|
readonly removed: DeploymentNamespaceDetailDto;
|
|
347
347
|
}
|
|
348
|
+
/** The namespaces whose proxy rebuild `namespaces.republishAll` submitted. */
|
|
349
|
+
export interface RepublishAllNamespacesResponse {
|
|
350
|
+
readonly namespaceIds: readonly string[];
|
|
351
|
+
}
|
|
352
|
+
/** The resource keys released; each was confirmed gone at the provider in the same call. */
|
|
353
|
+
export interface ReleaseNamespaceClaimsResponse {
|
|
354
|
+
readonly released: readonly string[];
|
|
355
|
+
}
|
|
348
356
|
export interface PlanDeploymentNamespaceRequest {
|
|
349
357
|
id: string;
|
|
350
358
|
env: string;
|
|
@@ -430,18 +438,59 @@ export interface RunDto {
|
|
|
430
438
|
createdAt: number;
|
|
431
439
|
startedAt: number | null;
|
|
432
440
|
finishedAt: number | null;
|
|
441
|
+
/** When someone asked to cancel the run; a run that finished with it set was cancelled, unless it succeeded first. */
|
|
442
|
+
cancelRequestedAt: number | null;
|
|
443
|
+
}
|
|
444
|
+
/** What a change line is about (ADR-0050 §3). */
|
|
445
|
+
export declare const CHANGE_SUBJECT_KINDS: readonly ["application", "endpoint", "mount", "dimension", "action", "role", "table", "file-collection", "file-kind", "job", "export", "import", "token", "csp", "migration"];
|
|
446
|
+
export type ChangeSubjectKind = (typeof CHANGE_SUBJECT_KINDS)[number];
|
|
447
|
+
export interface ChangeSubjectDto {
|
|
448
|
+
kind: ChangeSubjectKind;
|
|
449
|
+
/** The endpoint id, the table, the role, the migration file, the CSP directive; the application's id for `application`. */
|
|
450
|
+
name: string;
|
|
451
|
+
/** An endpoint's route: the candidate's row, or the baseline's for a removed endpoint. */
|
|
452
|
+
method?: EndpointMethod;
|
|
453
|
+
path?: string;
|
|
454
|
+
}
|
|
455
|
+
/** Who reaches an endpoint: the candidate's row, or the baseline's for a removed endpoint, in the surface's terms. */
|
|
456
|
+
export interface ChangeAudienceDto {
|
|
457
|
+
reach: SurfaceReach;
|
|
458
|
+
/** The link mount whose share links reach it, for a `link` reach. */
|
|
459
|
+
mount?: string;
|
|
460
|
+
/** What a caller must hold, as `SurfaceEndpointDto.requirement` words it; null for an anonymous kind. */
|
|
461
|
+
requirement: string | null;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Why a line needs closer review: a step off the paved road, something anyone without signing in sets off, a mutation
|
|
465
|
+
* served on `GET`, people becoming visible, a file collection adopted or released, or the application naming who signs
|
|
466
|
+
* in at an enrolled terminal.
|
|
467
|
+
*/
|
|
468
|
+
export declare const REVIEW_REASONS: readonly ["off-road", "anyone-calls", "get-mutation", "people", "adoption", "terminal"];
|
|
469
|
+
export type ReviewReason = (typeof REVIEW_REASONS)[number];
|
|
470
|
+
/** What a call sets off, when the line says so. */
|
|
471
|
+
export interface ChangeConsequenceDto {
|
|
472
|
+
kind: 'starts-job';
|
|
473
|
+
job: string;
|
|
433
474
|
}
|
|
434
475
|
/**
|
|
435
476
|
* One plain-language line of an access change. `effect` is `widens` when it can grant access the baseline did not,
|
|
436
477
|
* `narrows` when it can only take access away, and `neutral` when it admits no one new and takes nothing away.
|
|
437
|
-
* `review: 'closer'` marks a
|
|
478
|
+
* `review: 'closer'` marks a line the approver reads the code behind (a step off the paved road, a call anyone sets off,
|
|
479
|
+
* …), and `reason` says which. A line classified before lines carried facts has no `rule`, `subject` or `reason`.
|
|
438
480
|
*/
|
|
439
481
|
export interface AccessChangeDto {
|
|
440
482
|
effect: 'widens' | 'narrows' | 'neutral';
|
|
441
483
|
line: string;
|
|
442
484
|
review?: 'closer';
|
|
485
|
+
reason?: ReviewReason;
|
|
443
486
|
/** The line opens an endpoint to the pages on the origins the environment lists; `ApprovalDto.crossOrigins` names them. */
|
|
444
487
|
environmentOrigins?: true;
|
|
488
|
+
/** The comparison that produced the line, a stable code (`endpoint.body-limit`); it never holds an application's name. */
|
|
489
|
+
rule?: string;
|
|
490
|
+
subject?: ChangeSubjectDto;
|
|
491
|
+
/** Who reaches the endpoint, on an endpoint subject. */
|
|
492
|
+
audience?: ChangeAudienceDto;
|
|
493
|
+
consequence?: ChangeConsequenceDto;
|
|
445
494
|
}
|
|
446
495
|
/** A run's access change against its environment's active snapshot (ADR-0050 §3). */
|
|
447
496
|
export interface ApprovalDto {
|
|
@@ -462,12 +511,28 @@ export interface ApprovalDto {
|
|
|
462
511
|
* empty when the environment lists none.
|
|
463
512
|
*/
|
|
464
513
|
crossOrigins?: string[];
|
|
465
|
-
/**
|
|
514
|
+
/**
|
|
515
|
+
* The candidate's endpoints the change names, as the environment page's surface words them: who reaches each, what it
|
|
516
|
+
* requires, and what else opens it or stands in front of it (another origin, a body limit, rate buckets, a challenge).
|
|
517
|
+
* A removed endpoint is not among them. Empty for a run that stored no snapshot, and on the approvals list.
|
|
518
|
+
*/
|
|
519
|
+
endpoints: SurfaceEndpointDto[];
|
|
520
|
+
/**
|
|
521
|
+
* The human who approved it, once one did. `holds` is false once the approval lapsed: an older run of the environment
|
|
522
|
+
* published another change first, the change still widens against it, and the run waits for a new approval (ADR-0050
|
|
523
|
+
* §2). A refusal or a cancellation of such a run drops the approval, so a decided run's approval always held.
|
|
524
|
+
*/
|
|
466
525
|
approval: {
|
|
467
526
|
principalId: string;
|
|
468
527
|
label: string;
|
|
469
528
|
approvedAt: number;
|
|
529
|
+
holds: boolean;
|
|
470
530
|
} | null;
|
|
531
|
+
/**
|
|
532
|
+
* The newer run of the environment whose success stopped this one before it started: an older run never deploys over
|
|
533
|
+
* a newer one (ADR-0050 §6). Only on one approval read, of a run that failed without starting.
|
|
534
|
+
*/
|
|
535
|
+
supersededBy?: string;
|
|
471
536
|
}
|
|
472
537
|
/** Approve or refuse one parked run. The digests are the ones the approver read; a reclassified run refuses them. */
|
|
473
538
|
export interface CompleteApprovalRequest {
|
|
@@ -497,4 +562,8 @@ export interface RunLogResponse {
|
|
|
497
562
|
lines: RunLogLine[];
|
|
498
563
|
status?: RunStatus;
|
|
499
564
|
}
|
|
500
|
-
export
|
|
565
|
+
export { OPS_ROW_COUNT_CAP, type OpsContentView, type OpsView } from '@fabrika/auth-core';
|
|
566
|
+
export * from './approval-view.js';
|
|
567
|
+
export type { AdoptNamespaceInput, AppEnvironmentInput, AppIdInput, AppNamedValueInput, ControlRpcContract, CreateAppRequest, DescribeConnectorRequest, GitHubSourceConnectionInput, GitHubSourceConnectionRpcContract, NamespaceIdInput, OkResponse, PutAppEnvironmentInput, PutAppSecretInput, PutAppVarInput, ReleaseNamespaceClaimsInput, RotateTokenKeyResponse, RunIdInput, RunListInput, SecretValueInput, SecretValueResponse, TailRunInput, UpdateNamespaceInput, } from './rpc.js';
|
|
568
|
+
export type { DataBackupDto, DataBackupScheduleDto, DataBackupState, DataOperationDto, DataOperationKind, DataOperationListInput, DataOperationResolution, DataOperationState, DataOperationStep, DataRehearsalOutcome, MaintenanceMode, RecoverDataOperationInput, SetDataBackupScheduleInput, StartDataOperationInput, } from './rpc.js';
|
|
569
|
+
export { DATA_OPERATION_MAX_PAGE_SIZE, dataOperationListInputSchema, recoverDataOperationInputSchema, startDataOperationInputSchema } from './rpc.js';
|
package/types/src/mail.d.ts
CHANGED
|
@@ -42,6 +42,8 @@ export interface MailMessageContentDto {
|
|
|
42
42
|
readonly replyTo?: string;
|
|
43
43
|
readonly fromName?: string;
|
|
44
44
|
readonly unsubscribeUrl?: string;
|
|
45
|
+
/** A message of a send to many recipients, which the provider keeps apart from transactional mail. */
|
|
46
|
+
readonly broadcast?: true;
|
|
45
47
|
readonly attachments: readonly MailAttachmentDto[];
|
|
46
48
|
}
|
|
47
49
|
/** `withheld`: the caller does not hold `mail.content.read`. `purged`: the relay no longer keeps it. */
|