@substrat-run/contracts 0.49.0 → 0.51.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.
@@ -33,6 +33,7 @@ export declare const adminAction: z.ZodEnum<{
33
33
  rejectVersion: "rejectVersion";
34
34
  removeMember: "removeMember";
35
35
  requestPublish: "requestPublish";
36
+ restoreDirectory: "restoreDirectory";
36
37
  restoreScope: "restoreScope";
37
38
  revokeConnection: "revokeConnection";
38
39
  revokeEntitlement: "revokeEntitlement";
@@ -282,6 +283,7 @@ export declare const adminLogEntry: z.ZodObject<{
282
283
  rejectVersion: "rejectVersion";
283
284
  removeMember: "removeMember";
284
285
  requestPublish: "requestPublish";
286
+ restoreDirectory: "restoreDirectory";
285
287
  restoreScope: "restoreScope";
286
288
  revokeConnection: "revokeConnection";
287
289
  revokeEntitlement: "revokeEntitlement";
@@ -334,4 +336,262 @@ export declare const emailRelayRequest: z.ZodObject<{
334
336
  fromName: z.ZodOptional<z.ZodString>;
335
337
  }, z.core.$strip>;
336
338
  export type EmailRelayRequest = z.infer<typeof emailRelayRequest>;
339
+ /**
340
+ * A whole tenant, exported (#36) — GDPR Art. 20 portability, and the escrow handover.
341
+ *
342
+ * Deliberately a DIFFERENT shape from `directoryDump` (#40), because they answer
343
+ * different questions and one format cannot serve both honestly:
344
+ *
345
+ * - A **directory dump** is for RECOVERY. It is raw tables for one deployment's whole
346
+ * directory, complete and byte-faithful so it can be replayed back into a control
347
+ * plane. It is unreadable to a customer and useless as an answer to "give me my data".
348
+ * - A **tenant export** is for PORTABILITY. It is one tenant's slice, in the platform's
349
+ * own documented vocabulary (`tenant`, `scope`, `org`, `role`, …) rather than in
350
+ * SQLite's, so the receiving party can read it without knowing the schema — plus each
351
+ * scope's data as a `scopeDump`, which is the one part that IS raw, because that is
352
+ * what makes it reloadable.
353
+ *
354
+ * It is assembled from the SANCTIONED reads (`listScopes`, `listOrgs`, `listRoles`,
355
+ * `listEntitlements`, `listIdentityLinks`, `exportScope`, …), never from a back door
356
+ * into the directory database — control-plane.md §7 forbids the control plane acquiring
357
+ * one, and an export that quietly opened it would be exactly that.
358
+ *
359
+ * `masked` says which fidelity this file is. Masked is the default (the same posture as
360
+ * `scope pull`), so a full-fidelity export is a deliberate, audited act — and an Art. 20
361
+ * fulfilment is deliberate by definition.
362
+ */
363
+ export declare const tenantExport: z.ZodObject<{
364
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
365
+ capturedAt: z.ZodString;
366
+ masked: z.ZodBoolean;
367
+ tenant: z.ZodObject<{
368
+ id: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
369
+ slug: z.ZodString;
370
+ name: z.ZodString;
371
+ status: z.ZodEnum<{
372
+ active: "active";
373
+ deleting: "deleting";
374
+ reaped: "reaped";
375
+ suspended: "suspended";
376
+ }>;
377
+ createdAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
378
+ deletingAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
379
+ provisionedByTenant: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "TenantId", "out">>;
380
+ }, z.core.$strip>;
381
+ scopes: z.ZodArray<z.ZodObject<{
382
+ id: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
383
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
384
+ parentScopeId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "ScopeId", "out">>;
385
+ slug: z.ZodString;
386
+ kind: z.ZodString;
387
+ name: z.ZodString;
388
+ status: z.ZodEnum<{
389
+ active: "active";
390
+ archived: "archived";
391
+ archiving: "archiving";
392
+ provisioning: "provisioning";
393
+ reaped: "reaped";
394
+ suspended: "suspended";
395
+ }>;
396
+ storageShape: z.ZodEnum<{
397
+ A: "A";
398
+ B: "B";
399
+ }>;
400
+ jurisdiction: z.ZodEnum<{
401
+ eu: "eu";
402
+ global: "global";
403
+ us: "us";
404
+ }>;
405
+ vertical: z.ZodNullable<z.ZodString>;
406
+ verticalVersionId: z.ZodNullable<z.ZodString>;
407
+ schemaVersion: z.ZodString;
408
+ migrationFailure: z.ZodNullable<z.ZodObject<{
409
+ version: z.ZodString;
410
+ error: z.ZodString;
411
+ attempts: z.ZodNumber;
412
+ lastAttemptAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
413
+ }, z.core.$strip>>;
414
+ forkedFrom: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "ScopeId", "out">>;
415
+ forkedAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
416
+ expiresAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
417
+ servingRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
418
+ archivedAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
419
+ createdAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
420
+ }, z.core.$strip>>;
421
+ orgs: z.ZodArray<z.ZodObject<{
422
+ id: z.core.$ZodBranded<z.ZodString, "OrgId", "out">;
423
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
424
+ slug: z.ZodString;
425
+ name: z.ZodString;
426
+ createdAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
427
+ }, z.core.$strip>>;
428
+ members: z.ZodArray<z.ZodObject<{
429
+ principal: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
430
+ orgId: z.core.$ZodBranded<z.ZodString, "OrgId", "out">;
431
+ revokedAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
432
+ }, z.core.$strip>>;
433
+ roles: z.ZodArray<z.ZodObject<{
434
+ key: z.ZodString;
435
+ permissions: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">>;
436
+ source: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ModuleId", "out">, z.ZodLiteral<"vertical">]>;
437
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
438
+ }, z.core.$strip>>;
439
+ entitlements: z.ZodArray<z.ZodObject<{
440
+ entitlementKey: z.ZodString;
441
+ expiresAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
442
+ quota: z.ZodNullable<z.ZodNumber>;
443
+ plan: z.ZodNullable<z.ZodString>;
444
+ grantedAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
445
+ grantedBy: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "PlatformActorId", "out">>;
446
+ }, z.core.$strip>>;
447
+ identityLinks: z.ZodArray<z.ZodObject<{
448
+ provider: z.ZodString;
449
+ externalId: z.ZodString;
450
+ principal: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
451
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
452
+ scopeId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "ScopeId", "out">>;
453
+ }, z.core.$strip>>;
454
+ hostnames: z.ZodArray<z.ZodObject<{
455
+ hostname: z.ZodString;
456
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
457
+ scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
458
+ verticalSlug: z.ZodNullable<z.ZodString>;
459
+ surface: z.ZodString;
460
+ region: z.ZodNullable<z.ZodEnum<{
461
+ eu: "eu";
462
+ }>>;
463
+ status: z.ZodEnum<{
464
+ active: "active";
465
+ failed: "failed";
466
+ pending: "pending";
467
+ verifying: "verifying";
468
+ }>;
469
+ statusNote: z.ZodNullable<z.ZodString>;
470
+ canonical: z.ZodBoolean;
471
+ createdAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
472
+ customHostnameId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
473
+ validationRecords: z.ZodDefault<z.ZodArray<z.ZodObject<{
474
+ type: z.ZodEnum<{
475
+ hostname: "hostname";
476
+ txt: "txt";
477
+ }>;
478
+ name: z.ZodString;
479
+ value: z.ZodString;
480
+ status: z.ZodDefault<z.ZodNullable<z.ZodString>>;
481
+ }, z.core.$strip>>>;
482
+ }, z.core.$strip>>;
483
+ stores: z.ZodArray<z.ZodObject<{
484
+ kind: z.ZodEnum<{
485
+ blob: "blob";
486
+ relational: "relational";
487
+ }>;
488
+ vertical: z.ZodString;
489
+ binding: z.ZodString;
490
+ ref: z.ZodString;
491
+ createdAt: z.ZodString;
492
+ }, z.core.$strip>>;
493
+ connections: z.ZodArray<z.ZodObject<{
494
+ id: z.core.$ZodBranded<z.ZodString, "ConnectionId", "out">;
495
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
496
+ vertical: z.ZodString;
497
+ provider: z.ZodString;
498
+ label: z.ZodString;
499
+ status: z.ZodEnum<{
500
+ active: "active";
501
+ error: "error";
502
+ expired: "expired";
503
+ revoked: "revoked";
504
+ }>;
505
+ externalAccountRef: z.ZodNullable<z.ZodString>;
506
+ scopes: z.ZodArray<z.ZodString>;
507
+ expiresAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
508
+ lastOkAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
509
+ lastError: z.ZodNullable<z.ZodString>;
510
+ lastErrorAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
511
+ createdBy: z.ZodString;
512
+ createdAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
513
+ revokedAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
514
+ }, z.core.$strip>>;
515
+ adminLog: z.ZodNullable<z.ZodArray<z.ZodObject<{
516
+ id: z.ZodString;
517
+ actor: z.core.$ZodBranded<z.ZodString, "PlatformActorId", "out">;
518
+ action: z.ZodEnum<{
519
+ activateScope: "activateScope";
520
+ addMember: "addMember";
521
+ admitVersion: "admitVersion";
522
+ archiveScope: "archiveScope";
523
+ assignRole: "assignRole";
524
+ bindHostname: "bindHostname";
525
+ bindScopeVersion: "bindScopeVersion";
526
+ createConnection: "createConnection";
527
+ createOrg: "createOrg";
528
+ createTenant: "createTenant";
529
+ defineRole: "defineRole";
530
+ deleteSnapshot: "deleteSnapshot";
531
+ deleteVertical: "deleteVertical";
532
+ grant: "grant";
533
+ grantEntitlement: "grantEntitlement";
534
+ grantToConnection: "grantToConnection";
535
+ grantToOrg: "grantToOrg";
536
+ grantToSystem: "grantToSystem";
537
+ importScope: "importScope";
538
+ linkIdentity: "linkIdentity";
539
+ promoteVersion: "promoteVersion";
540
+ provisionBlobStore: "provisionBlobStore";
541
+ provisionScope: "provisionScope";
542
+ provisionTenantStore: "provisionTenantStore";
543
+ pruneAccessLog: "pruneAccessLog";
544
+ publishVersion: "publishVersion";
545
+ reapScope: "reapScope";
546
+ reapTenant: "reapTenant";
547
+ registerIdentityPool: "registerIdentityPool";
548
+ registerVertical: "registerVertical";
549
+ rejectVersion: "rejectVersion";
550
+ removeMember: "removeMember";
551
+ requestPublish: "requestPublish";
552
+ restoreDirectory: "restoreDirectory";
553
+ restoreScope: "restoreScope";
554
+ revokeConnection: "revokeConnection";
555
+ revokeEntitlement: "revokeEntitlement";
556
+ rewindScope: "rewindScope";
557
+ setHostnameIssuance: "setHostnameIssuance";
558
+ setHostnameStatus: "setHostnameStatus";
559
+ setScopeExpiresAt: "setScopeExpiresAt";
560
+ setScopeServingRef: "setScopeServingRef";
561
+ setTenantName: "setTenantName";
562
+ setTenantStatus: "setTenantStatus";
563
+ setVerticalEmailSender: "setVerticalEmailSender";
564
+ setVerticalInstallsBlocked: "setVerticalInstallsBlocked";
565
+ setVerticalListed: "setVerticalListed";
566
+ setVerticalServing: "setVerticalServing";
567
+ setVerticalTenantProvisioner: "setVerticalTenantProvisioner";
568
+ suspendScope: "suspendScope";
569
+ unarchiveScope: "unarchiveScope";
570
+ unassignRole: "unassignRole";
571
+ unbindHostname: "unbindHostname";
572
+ unlinkIdentity: "unlinkIdentity";
573
+ unsuspendScope: "unsuspendScope";
574
+ updateConnectionSecret: "updateConnectionSecret";
575
+ }>;
576
+ tenantId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "TenantId", "out">>;
577
+ scopeId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "ScopeId", "out">>;
578
+ vertical: z.ZodNullable<z.ZodString>;
579
+ before: z.ZodNullable<z.ZodUnknown>;
580
+ after: z.ZodNullable<z.ZodUnknown>;
581
+ causedBy: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "EventId", "out">>;
582
+ at: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
583
+ }, z.core.$strip>>>;
584
+ data: z.ZodArray<z.ZodObject<{
585
+ tenantId: z.ZodString;
586
+ scopeId: z.ZodString;
587
+ capturedAt: z.ZodString;
588
+ tables: z.ZodArray<z.ZodObject<{
589
+ name: z.ZodString;
590
+ ddl: z.ZodString;
591
+ columns: z.ZodArray<z.ZodString>;
592
+ rows: z.ZodArray<z.ZodArray<z.ZodUnknown>>;
593
+ }, z.core.$strip>>;
594
+ }, z.core.$strip>>;
595
+ }, z.core.$strip>;
596
+ export type TenantExport = z.infer<typeof tenantExport>;
337
597
  //# sourceMappingURL=control-plane.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"control-plane.d.ts","sourceRoot":"","sources":["../src/control-plane.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0EtB,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB;;;;;;;iBAa3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe;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G,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6CvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
@@ -1,5 +1,13 @@
1
1
  import { z } from 'zod';
2
2
  import { eventId, instant, orgId, platformActorId, principalId, scopeId, tenantId, } from './ids.js';
3
+ // #36's tenant export speaks the platform's own vocabulary rather than restating it, so
4
+ // it composes the schemas that already define these shapes. One-way imports only —
5
+ // none of these modules imports this one, so no cycle.
6
+ import { org, scope, tenant } from './tenancy.js';
7
+ import { tenantRole } from './permission.js';
8
+ import { hostnameBinding } from './routing.js';
9
+ import { connection } from './connections.js';
10
+ import { scopeDump } from './introspection.js';
3
11
  // The control plane — the shared layer across N per-vertical deployments (D-30,
4
12
  // control-plane.md). This file carries the audit contract that every effecting
5
13
  // mutation writes; the tenant registry, lifecycle, and entitlement store land in
@@ -80,6 +88,12 @@ export const adminAction = z.enum([
80
88
  // #383 — a module's system principal may hold a permission (for scheduled work),
81
89
  // so granting one is a named, audited mutation like every other grant.
82
90
  'grantToSystem',
91
+ // #40 — the directory's own disaster-recovery write: replace THE DIRECTORY (tenants,
92
+ // scopes, hostnames, verticals, identities) with a stored dump. Carries no tenant,
93
+ // because its blast radius is every tenant. The entry lands in the log it just
94
+ // replaced, which is exactly right: the restored log is the pre-restore history, and
95
+ // this row is the first thing after it — the seam is legible instead of silent.
96
+ 'restoreDirectory',
83
97
  ]);
84
98
  /**
85
99
  * One entitlement grant, widened from a bare SKU flag to express a plan (#33):
@@ -311,4 +325,72 @@ export const emailRelayRequest = z.object({
311
325
  /** Optional display name for the FROM (e.g. "Substrat Auth"); the address stays platform-owned. */
312
326
  fromName: z.string().min(1).optional(),
313
327
  });
328
+ /**
329
+ * A whole tenant, exported (#36) — GDPR Art. 20 portability, and the escrow handover.
330
+ *
331
+ * Deliberately a DIFFERENT shape from `directoryDump` (#40), because they answer
332
+ * different questions and one format cannot serve both honestly:
333
+ *
334
+ * - A **directory dump** is for RECOVERY. It is raw tables for one deployment's whole
335
+ * directory, complete and byte-faithful so it can be replayed back into a control
336
+ * plane. It is unreadable to a customer and useless as an answer to "give me my data".
337
+ * - A **tenant export** is for PORTABILITY. It is one tenant's slice, in the platform's
338
+ * own documented vocabulary (`tenant`, `scope`, `org`, `role`, …) rather than in
339
+ * SQLite's, so the receiving party can read it without knowing the schema — plus each
340
+ * scope's data as a `scopeDump`, which is the one part that IS raw, because that is
341
+ * what makes it reloadable.
342
+ *
343
+ * It is assembled from the SANCTIONED reads (`listScopes`, `listOrgs`, `listRoles`,
344
+ * `listEntitlements`, `listIdentityLinks`, `exportScope`, …), never from a back door
345
+ * into the directory database — control-plane.md §7 forbids the control plane acquiring
346
+ * one, and an export that quietly opened it would be exactly that.
347
+ *
348
+ * `masked` says which fidelity this file is. Masked is the default (the same posture as
349
+ * `scope pull`), so a full-fidelity export is a deliberate, audited act — and an Art. 20
350
+ * fulfilment is deliberate by definition.
351
+ */
352
+ export const tenantExport = z.object({
353
+ tenantId,
354
+ /** ISO 8601 — when the export was assembled. */
355
+ capturedAt: z.string().min(1),
356
+ /** False only for a `?full=true` break-glass export; true means PII was redacted. */
357
+ masked: z.boolean(),
358
+ /** The tenant record itself. */
359
+ tenant,
360
+ /** Every scope, including archived and reaped ones — the tombstones are part of the history. */
361
+ scopes: z.array(scope),
362
+ orgs: z.array(org),
363
+ /** Org membership across every org, revoked rows included (K-21 tombstones are the record). */
364
+ members: z.array(orgMembership),
365
+ roles: z.array(tenantRole),
366
+ entitlements: z.array(entitlementGrant),
367
+ /** External login links (D-16) — which identity provider subject maps to which principal. */
368
+ identityLinks: z.array(identityLink),
369
+ hostnames: z.array(hostnameBinding),
370
+ /**
371
+ * Inventory, NOT contents: the per-tenant relational and blob stores this tenant has.
372
+ * Their bytes are not in this file, and saying so explicitly is the point — an export
373
+ * that silently omitted them would misrepresent itself as complete.
374
+ */
375
+ stores: z.array(z.object({
376
+ kind: z.enum(['relational', 'blob']),
377
+ vertical: z.string(),
378
+ binding: z.string(),
379
+ ref: z.string(),
380
+ createdAt: z.string(),
381
+ })),
382
+ /** Third-party connections as metadata only — a sealed credential is never exported. */
383
+ connections: z.array(connection),
384
+ /**
385
+ * The tenant's admin-log entries — present only in a FULL export.
386
+ *
387
+ * Excluded from the masked default on purpose: this is the platform's record of what
388
+ * STAFF did, not data the customer provided, so it is not Art. 20 material, and it
389
+ * carries staff actor ids and internal action vocabulary. It is exactly what an escrow
390
+ * or a dispute needs, so break-glass keeps it reachable — and audited.
391
+ */
392
+ adminLog: z.array(adminLogEntry).nullable(),
393
+ /** Each scope's database, as the same `scopeDump` a fork or a pull produces. */
394
+ data: z.array(scopeDump),
395
+ });
314
396
  //# sourceMappingURL=control-plane.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"control-plane.js","sourceRoot":"","sources":["../src/control-plane.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,OAAO,EACP,OAAO,EACP,KAAK,EACL,eAAe,EACf,WAAW,EACX,OAAO,EACP,QAAQ,GACT,MAAM,UAAU,CAAC;AAElB,gFAAgF;AAChF,+EAA+E;AAC/E,iFAAiF;AACjF,4CAA4C;AAE5C,2EAA2E;AAC3E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC;IA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,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IACvC,6FAA6F;IAC7F,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;IACpC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC;IACnC;;;;OAIG;IACH,MAAM,EAAE,CAAC,CAAC,KAAK,CACb,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;QACpC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;QACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;KACtB,CAAC,CACH;IACD,wFAAwF;IACxF,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC;IAChC;;;;;;;OAOG;IACH,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE;IAC3C,gFAAgF;IAChF,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;CACzB,CAAC,CAAC"}
@@ -105,4 +105,70 @@ export declare const scopeDump: z.ZodObject<{
105
105
  }, z.core.$strip>>;
106
106
  }, z.core.$strip>;
107
107
  export type ScopeDump = z.infer<typeof scopeDump>;
108
+ /**
109
+ * One stored scope BACKUP, as the list/reap surfaces report it (#493) — metadata about a
110
+ * `scopeDump` the platform holds, never the dump itself, so listing a scope's copies is
111
+ * cheap and hands out no bytes.
112
+ *
113
+ * A backup is what makes the terminal reap survivable: reaping wipes a scope's Durable
114
+ * Object storage irreversibly, so the control plane stores a full-fidelity dump first and
115
+ * records this shape's address on the admin-log entry. Deliberately NOT a snapshot fork —
116
+ * a fork lives inside the vertical's own deployment, so it neither survives that
117
+ * vertical's retirement nor stops counting as a live scope against it.
118
+ *
119
+ * Addressed by (tenantId, scopeId, capturedAt): the store's own key scheme stays private
120
+ * to the store, so no caller builds a path into another tenant's copies.
121
+ */
122
+ export declare const scopeBackup: z.ZodObject<{
123
+ tenantId: z.ZodString;
124
+ scopeId: z.ZodString;
125
+ vertical: z.ZodNullable<z.ZodString>;
126
+ capturedAt: z.ZodString;
127
+ size: z.ZodNumber;
128
+ tables: z.ZodNumber;
129
+ }, z.core.$strip>;
130
+ export type ScopeBackup = z.infer<typeof scopeBackup>;
131
+ /**
132
+ * A COMPLETE dump of the DIRECTORY — the platform's own database (#40), not a tenant's.
133
+ *
134
+ * The same table shape as a `scopeDump`, and deliberately so: both are the logical
135
+ * row-dump of one SQLite database, so one reader, one writer, one wire shape. What
136
+ * differs is what is inside and what losing it costs. A scope database holds one
137
+ * customer's data and is protected by ~30-day DO point-in-time recovery; the directory
138
+ * holds tenants, scopes, hostnames, verticals, identities and the admin log — the
139
+ * mapping that makes every OTHER database addressable — and is unreconstructable from
140
+ * them. `control-plane.md` puts it plainly: losing it is losing the platform, not
141
+ * losing a cache.
142
+ *
143
+ * There is no (tenantId, scopeId) here because there is exactly ONE directory per
144
+ * deployment. `capturedAt` is therefore the whole address of a copy.
145
+ *
146
+ * PITR already covers corruption INSIDE the account, which is why this exists on a
147
+ * different axis: an off-DO copy is what survives a control-plane bug that deletes the
148
+ * Durable Object outright. It does NOT survive loss of the Cloudflare account itself
149
+ * while the store lives in that same account — see the honest scoping in
150
+ * control-plane.md §4.9.
151
+ */
152
+ export declare const directoryDump: z.ZodObject<{
153
+ capturedAt: z.ZodString;
154
+ tables: z.ZodArray<z.ZodObject<{
155
+ name: z.ZodString;
156
+ ddl: z.ZodString;
157
+ columns: z.ZodArray<z.ZodString>;
158
+ rows: z.ZodArray<z.ZodArray<z.ZodUnknown>>;
159
+ }, z.core.$strip>>;
160
+ }, z.core.$strip>;
161
+ export type DirectoryDump = z.infer<typeof directoryDump>;
162
+ /**
163
+ * One stored DIRECTORY backup, as the list surface reports it (#40) — metadata about a
164
+ * `directoryDump` the platform holds, never the dump itself. The scope-level analogue is
165
+ * `scopeBackup`; this one carries no tenant or scope because the directory is the thing
166
+ * that knows about tenants and scopes.
167
+ */
168
+ export declare const directoryBackup: z.ZodObject<{
169
+ capturedAt: z.ZodString;
170
+ size: z.ZodNumber;
171
+ tables: z.ZodNumber;
172
+ }, z.core.$strip>;
173
+ export type DirectoryBackup = z.infer<typeof directoryBackup>;
108
174
  //# sourceMappingURL=introspection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"introspection.d.ts","sourceRoot":"","sources":["../src/introspection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;GAUG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,UAAU;;;;iBAIrB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;;;iBAOzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAI5D,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAC3C,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;iBAI9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAKtE,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;;iBAE1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;iBAI3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAA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AO,gBAAgB,CAAC,CAAC;AAEhE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc;;;;;iBAYzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,eAAO,MAAM,SAAS;;;;;;;;;;iBAMpB,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAElD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,WAAW;;;;;;;iBAWtB,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,aAAa;;;;;;;;iBAIxB,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;;iBAO1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -106,4 +106,70 @@ export const scopeDump = z.object({
106
106
  capturedAt: z.string().min(1),
107
107
  tables: z.array(scopeDumpTable),
108
108
  });
109
+ /**
110
+ * One stored scope BACKUP, as the list/reap surfaces report it (#493) — metadata about a
111
+ * `scopeDump` the platform holds, never the dump itself, so listing a scope's copies is
112
+ * cheap and hands out no bytes.
113
+ *
114
+ * A backup is what makes the terminal reap survivable: reaping wipes a scope's Durable
115
+ * Object storage irreversibly, so the control plane stores a full-fidelity dump first and
116
+ * records this shape's address on the admin-log entry. Deliberately NOT a snapshot fork —
117
+ * a fork lives inside the vertical's own deployment, so it neither survives that
118
+ * vertical's retirement nor stops counting as a live scope against it.
119
+ *
120
+ * Addressed by (tenantId, scopeId, capturedAt): the store's own key scheme stays private
121
+ * to the store, so no caller builds a path into another tenant's copies.
122
+ */
123
+ export const scopeBackup = z.object({
124
+ tenantId: z.string().min(1),
125
+ scopeId: z.string().min(1),
126
+ /** The vertical the scope was bound to when the copy was taken, when it had one. */
127
+ vertical: z.string().nullable(),
128
+ /** ISO 8601 — the dump's own `capturedAt`, and this backup's address. */
129
+ capturedAt: z.string().min(1),
130
+ /** Serialized size in bytes — what tells a real copy from an empty one at a glance. */
131
+ size: z.number().int().nonnegative(),
132
+ /** Tables carried; zero means the copy is not restorable. */
133
+ tables: z.number().int().nonnegative(),
134
+ });
135
+ /**
136
+ * A COMPLETE dump of the DIRECTORY — the platform's own database (#40), not a tenant's.
137
+ *
138
+ * The same table shape as a `scopeDump`, and deliberately so: both are the logical
139
+ * row-dump of one SQLite database, so one reader, one writer, one wire shape. What
140
+ * differs is what is inside and what losing it costs. A scope database holds one
141
+ * customer's data and is protected by ~30-day DO point-in-time recovery; the directory
142
+ * holds tenants, scopes, hostnames, verticals, identities and the admin log — the
143
+ * mapping that makes every OTHER database addressable — and is unreconstructable from
144
+ * them. `control-plane.md` puts it plainly: losing it is losing the platform, not
145
+ * losing a cache.
146
+ *
147
+ * There is no (tenantId, scopeId) here because there is exactly ONE directory per
148
+ * deployment. `capturedAt` is therefore the whole address of a copy.
149
+ *
150
+ * PITR already covers corruption INSIDE the account, which is why this exists on a
151
+ * different axis: an off-DO copy is what survives a control-plane bug that deletes the
152
+ * Durable Object outright. It does NOT survive loss of the Cloudflare account itself
153
+ * while the store lives in that same account — see the honest scoping in
154
+ * control-plane.md §4.9.
155
+ */
156
+ export const directoryDump = z.object({
157
+ /** ISO 8601 capture time — and, since there is only one directory, the copy's address. */
158
+ capturedAt: z.string().min(1),
159
+ tables: z.array(scopeDumpTable),
160
+ });
161
+ /**
162
+ * One stored DIRECTORY backup, as the list surface reports it (#40) — metadata about a
163
+ * `directoryDump` the platform holds, never the dump itself. The scope-level analogue is
164
+ * `scopeBackup`; this one carries no tenant or scope because the directory is the thing
165
+ * that knows about tenants and scopes.
166
+ */
167
+ export const directoryBackup = z.object({
168
+ /** ISO 8601 — the dump's own `capturedAt`, and this backup's address. */
169
+ capturedAt: z.string().min(1),
170
+ /** Serialized size in bytes — what tells a real copy from an empty one at a glance. */
171
+ size: z.number().int().nonnegative(),
172
+ /** Tables carried; zero means the copy is not restorable. */
173
+ tables: z.number().int().nonnegative(),
174
+ });
109
175
  //# sourceMappingURL=introspection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"introspection.js","sourceRoot":"","sources":["../src/introspection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;GAUG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACxC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;CACpB,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC5B,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACxC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAClC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAA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EAAE,CAAC,WAAW,EAAE;IACpC,6DAA6D;IAC7D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;CACvC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@substrat-run/contracts",
3
- "version": "0.49.0",
3
+ "version": "0.51.0",
4
4
  "description": "Substrat kernel contract schemas — Zod is the source of truth (master plan D-22); OAS/JSON Schema are emitted artifacts",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {