@substrat-run/contracts 0.118.0 → 0.120.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/connection-health.d.ts +132 -0
- package/dist/connection-health.d.ts.map +1 -0
- package/dist/connection-health.js +132 -0
- package/dist/connection-health.js.map +1 -0
- package/dist/control-plane.d.ts +20 -1
- package/dist/control-plane.d.ts.map +1 -1
- package/dist/control-plane.js +26 -2
- package/dist/control-plane.js.map +1 -1
- package/dist/denial.d.ts +12 -0
- package/dist/denial.d.ts.map +1 -1
- package/dist/deploy.d.ts +68 -0
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +91 -1
- package/dist/deploy.js.map +1 -1
- package/dist/events.d.ts +42 -0
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +26 -2
- package/dist/events.js.map +1 -1
- package/dist/ids.d.ts +1 -0
- package/dist/ids.d.ts.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/manifest.d.ts +58 -0
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +109 -3
- package/dist/manifest.js.map +1 -1
- package/dist/operations.d.ts +67 -0
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +111 -0
- package/dist/operations.js.map +1 -1
- package/dist/peer-transport.d.ts +81 -0
- package/dist/peer-transport.d.ts.map +1 -0
- package/dist/peer-transport.js +87 -0
- package/dist/peer-transport.js.map +1 -0
- package/dist/peer.d.ts +183 -0
- package/dist/peer.d.ts.map +1 -0
- package/dist/peer.js +155 -0
- package/dist/peer.js.map +1 -0
- package/dist/permission.d.ts +42 -1
- package/dist/permission.d.ts.map +1 -1
- package/dist/permission.js +36 -2
- package/dist/permission.js.map +1 -1
- package/dist/platform-request.d.ts +50 -0
- package/dist/platform-request.d.ts.map +1 -1
- package/dist/platform-request.js +53 -1
- package/dist/platform-request.js.map +1 -1
- package/dist/preview-client.d.ts +154 -0
- package/dist/preview-client.d.ts.map +1 -0
- package/dist/preview-client.js +157 -0
- package/dist/preview-client.js.map +1 -0
- package/dist/registry.d.ts +1 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +7 -0
- package/dist/registry.js.map +1 -1
- package/dist/routing.d.ts +1 -0
- package/dist/routing.d.ts.map +1 -1
- package/dist/routing.js +9 -0
- package/dist/routing.js.map +1 -1
- package/dist/vertical-events.d.ts +265 -0
- package/dist/vertical-events.d.ts.map +1 -0
- package/dist/vertical-events.js +167 -0
- package/dist/vertical-events.js.map +1 -0
- package/package.json +1 -1
package/dist/permission.d.ts
CHANGED
|
@@ -58,11 +58,16 @@ export declare const checkSubject: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
58
58
|
}, z.core.$strip>, z.ZodObject<{
|
|
59
59
|
kind: z.ZodLiteral<"capability">;
|
|
60
60
|
id: z.core.$ZodBranded<z.ZodString, "CapabilityId", "out">;
|
|
61
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
62
|
+
kind: z.ZodLiteral<"vertical">;
|
|
63
|
+
id: z.ZodString;
|
|
64
|
+
scope: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
61
65
|
}, z.core.$strip>]>;
|
|
62
66
|
export type CheckSubject = z.infer<typeof checkSubject>;
|
|
63
67
|
/**
|
|
64
68
|
* The tuple-store ref for a subject: `principal:01J…` / `connection:01J…` /
|
|
65
|
-
* `system:@scope/mod` / `capability:01J
|
|
69
|
+
* `system:@scope/mod` / `capability:01J…` / `vertical:acme/board-room` — for a vertical the
|
|
70
|
+
* SLUG only, never the calling instance (see `checkSubject`).
|
|
66
71
|
*/
|
|
67
72
|
export declare const subjectRef: (subject: CheckSubject) => string;
|
|
68
73
|
/**
|
|
@@ -215,6 +220,42 @@ export declare const systemSwitchResult: z.ZodObject<{
|
|
|
215
220
|
permissions: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">>;
|
|
216
221
|
}, z.core.$strip>;
|
|
217
222
|
export type SystemSwitchResult = z.infer<typeof systemSwitchResult>;
|
|
223
|
+
/**
|
|
224
|
+
* One module's schedule-switch position on a scope (#1674) — bare, with no audit join.
|
|
225
|
+
* The wire shape of `/internal/system-grants`, the vertical's own honest answer: it holds
|
|
226
|
+
* no admin log, so it cannot say who switched a module off or why, only where it stands —
|
|
227
|
+
* the kernel's `systemScheduleState`, the SAME predicate the runner gates on.
|
|
228
|
+
*/
|
|
229
|
+
export declare const systemScheduleEntry: z.ZodObject<{
|
|
230
|
+
moduleId: z.core.$ZodBranded<z.ZodString, "ModuleId", "out">;
|
|
231
|
+
schedules: z.ZodEnum<{
|
|
232
|
+
off: "off";
|
|
233
|
+
on: "on";
|
|
234
|
+
ungranted: "ungranted";
|
|
235
|
+
}>;
|
|
236
|
+
}, z.core.$strip>;
|
|
237
|
+
export type SystemScheduleEntry = z.infer<typeof systemScheduleEntry>;
|
|
238
|
+
/**
|
|
239
|
+
* The per-scope status read (#1674) — `GET /tenants/:t/scopes/:s/system-grants`, one entry
|
|
240
|
+
* per module the scope holds or has ever held system authority for. Adds the one thing a
|
|
241
|
+
* hosted deployment cannot answer for itself: while off, who switched it off, when, and
|
|
242
|
+
* why — the control plane's own admin log, joined by moduleId to the `intent` row of the
|
|
243
|
+
* `revokeFromSystem` that put it there.
|
|
244
|
+
*/
|
|
245
|
+
export declare const systemGrantsStatusEntry: z.ZodObject<{
|
|
246
|
+
moduleId: z.core.$ZodBranded<z.ZodString, "ModuleId", "out">;
|
|
247
|
+
schedules: z.ZodEnum<{
|
|
248
|
+
off: "off";
|
|
249
|
+
on: "on";
|
|
250
|
+
ungranted: "ungranted";
|
|
251
|
+
}>;
|
|
252
|
+
switchedOff: z.ZodNullable<z.ZodObject<{
|
|
253
|
+
actor: z.core.$ZodBranded<z.ZodString, "PlatformActorId", "out">;
|
|
254
|
+
reason: z.ZodString;
|
|
255
|
+
at: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
256
|
+
}, z.core.$strip>>;
|
|
257
|
+
}, z.core.$strip>;
|
|
258
|
+
export type SystemGrantsStatusEntry = z.infer<typeof systemGrantsStatusEntry>;
|
|
218
259
|
export declare const objectRef: z.core.$ZodBranded<z.ZodString, "ObjectRef", "out">;
|
|
219
260
|
export type ObjectRef = z.infer<typeof objectRef>;
|
|
220
261
|
export declare const relationName: z.ZodString;
|
package/dist/permission.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../src/permission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../src/permission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,eAAO,MAAM,IAAI;;;iBAGf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,OAAO,aAAwD,CAAC;AAE7E,eAAO,MAAM,cAAc;;;;iBAUzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,UAAU;;;;;iBAAsC,CAAC;AAC9D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,eAAO,MAAM,cAAc;;;;;;;iBAIzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAM5D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;mBAuBvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CA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zod';
|
|
2
|
-
import { capabilityId, instant, moduleId, permissionKey, platformActorId, principalId, scopeId, tenantId, } from './ids.js';
|
|
2
|
+
import { capabilityId, instant, moduleId, permissionKey, platformActorId, principalId, scopeId, tenantId, verticalSlug, } from './ids.js';
|
|
3
3
|
import { entityRef } from './events.js';
|
|
4
4
|
// ============================================================================
|
|
5
5
|
// Authored surface — what humans and agents write (design doc §4.1).
|
|
@@ -66,10 +66,18 @@ export const checkSubject = z.union([
|
|
|
66
66
|
// ever written, and the minter's own authority is re-checked on every use — so a
|
|
67
67
|
// capability can never hold more than the principal who minted it holds right now.
|
|
68
68
|
z.object({ kind: z.literal('capability'), id: capabilityId }),
|
|
69
|
+
// ANOTHER VERTICAL of the same tenant (#1706), calling through the platform. Resolved by
|
|
70
|
+
// the ordinary tuple path, like a connection or a schedule: its authority is exactly the
|
|
71
|
+
// `vertical:<slug>` grants THIS vertical's manifest declares for it (`peers`), seated at
|
|
72
|
+
// provisioning. `scope` names the calling INSTANCE — it is what the spine records beside
|
|
73
|
+
// the slug — and takes no part in the tuple ref: every live instance of the caller holds
|
|
74
|
+
// the same grants. No memberships (§ the checker expands membership for principals only).
|
|
75
|
+
z.object({ kind: z.literal('vertical'), id: verticalSlug, scope: scopeId }),
|
|
69
76
|
]);
|
|
70
77
|
/**
|
|
71
78
|
* The tuple-store ref for a subject: `principal:01J…` / `connection:01J…` /
|
|
72
|
-
* `system:@scope/mod` / `capability:01J
|
|
79
|
+
* `system:@scope/mod` / `capability:01J…` / `vertical:acme/board-room` — for a vertical the
|
|
80
|
+
* SLUG only, never the calling instance (see `checkSubject`).
|
|
73
81
|
*/
|
|
74
82
|
export const subjectRef = (subject) => `${subject.kind}:${subject.id}`;
|
|
75
83
|
/**
|
|
@@ -201,6 +209,32 @@ export const systemSwitchResult = z.object({
|
|
|
201
209
|
changed: z.boolean(),
|
|
202
210
|
permissions: z.array(permissionKey),
|
|
203
211
|
});
|
|
212
|
+
/**
|
|
213
|
+
* One module's schedule-switch position on a scope (#1674) — bare, with no audit join.
|
|
214
|
+
* The wire shape of `/internal/system-grants`, the vertical's own honest answer: it holds
|
|
215
|
+
* no admin log, so it cannot say who switched a module off or why, only where it stands —
|
|
216
|
+
* the kernel's `systemScheduleState`, the SAME predicate the runner gates on.
|
|
217
|
+
*/
|
|
218
|
+
export const systemScheduleEntry = z.object({
|
|
219
|
+
moduleId,
|
|
220
|
+
schedules: z.enum(['on', 'off', 'ungranted']),
|
|
221
|
+
});
|
|
222
|
+
/**
|
|
223
|
+
* The per-scope status read (#1674) — `GET /tenants/:t/scopes/:s/system-grants`, one entry
|
|
224
|
+
* per module the scope holds or has ever held system authority for. Adds the one thing a
|
|
225
|
+
* hosted deployment cannot answer for itself: while off, who switched it off, when, and
|
|
226
|
+
* why — the control plane's own admin log, joined by moduleId to the `intent` row of the
|
|
227
|
+
* `revokeFromSystem` that put it there.
|
|
228
|
+
*/
|
|
229
|
+
export const systemGrantsStatusEntry = systemScheduleEntry.extend({
|
|
230
|
+
switchedOff: z
|
|
231
|
+
.object({
|
|
232
|
+
actor: platformActorId,
|
|
233
|
+
reason: z.string(),
|
|
234
|
+
at: instant,
|
|
235
|
+
})
|
|
236
|
+
.nullable(),
|
|
237
|
+
});
|
|
204
238
|
// ============================================================================
|
|
205
239
|
// Evaluation representation — relationship tuples (design doc §4.2, plan D-23).
|
|
206
240
|
// Internal to the checker; verticals never author these. The fixed derivation
|
package/dist/permission.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission.js","sourceRoot":"","sources":["../src/permission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,aAAa,EACb,eAAe,EACf,WAAW,EACX,OAAO,EACP,QAAQ,
|
|
1
|
+
{"version":3,"file":"permission.js","sourceRoot":"","sources":["../src/permission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CA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IACX,IAAI;IACJ,WAAW,EAAE,CAAC,CAAC,KAAK,CAClB,CAAC,CAAC,MAAM,CAAC;QACP,UAAU,EAAE,aAAa;QACzB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;KACrC,CAAC,CACH;CACF,CAAC,CAAC"}
|
|
@@ -92,6 +92,9 @@ export declare const platformRequest: z.ZodObject<{
|
|
|
92
92
|
connection: z.ZodString;
|
|
93
93
|
}, z.core.$strip>, z.ZodObject<{
|
|
94
94
|
capability: z.core.$ZodBranded<z.ZodString, "CapabilityId", "out">;
|
|
95
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
96
|
+
vertical: z.ZodString;
|
|
97
|
+
scope: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
95
98
|
}, z.core.$strip>]>;
|
|
96
99
|
impersonation: z.ZodNullable<z.ZodObject<{
|
|
97
100
|
session: z.core.$ZodBranded<z.ZodString, "ImpersonationSessionId", "out">;
|
|
@@ -182,6 +185,29 @@ export declare const archiveScopePayload: z.ZodObject<{
|
|
|
182
185
|
export type ArchiveScopePayload = z.infer<typeof archiveScopePayload>;
|
|
183
186
|
/** The well-known intent kind string for `archiveScopePayload`. */
|
|
184
187
|
export declare const ARCHIVE_SCOPE_KIND = "archive-scope";
|
|
188
|
+
/**
|
|
189
|
+
* The `peer-invoke` intent (#1706): module code asking the platform to invoke an operation on
|
|
190
|
+
* another vertical of the same tenant.
|
|
191
|
+
*
|
|
192
|
+
* **Why an intent rather than a call.** Operations, consumers and schedules run inside the
|
|
193
|
+
* scope's Durable Object, where module code has no network by rule — and where a fetch would
|
|
194
|
+
* not pass the egress worker that names the caller. So a handler enqueues this instead, inside
|
|
195
|
+
* its own transaction, and the platform delivers it: at-least-once, with the intent id as the
|
|
196
|
+
* idempotency key, and with the caller taken from the SCOPE the intent was drained from. The
|
|
197
|
+
* payload names the target and the operation; it cannot name a caller, and one would not be
|
|
198
|
+
* believed if it did.
|
|
199
|
+
*
|
|
200
|
+
* The synchronous leg (a harness route, through egress and the router) is the same door with a
|
|
201
|
+
* different transport — `peer-transport.ts`.
|
|
202
|
+
*/
|
|
203
|
+
export declare const peerInvokePayload: z.ZodObject<{
|
|
204
|
+
vertical: z.ZodString;
|
|
205
|
+
operation: z.ZodString;
|
|
206
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
207
|
+
}, z.core.$strip>;
|
|
208
|
+
export type PeerInvokePayload = z.infer<typeof peerInvokePayload>;
|
|
209
|
+
/** The well-known intent kind string for `peerInvokePayload`. */
|
|
210
|
+
export declare const PEER_INVOKE_KIND = "peer-invoke";
|
|
185
211
|
/**
|
|
186
212
|
* One entitlement a manager vertical asks the platform to grant (#412) — the SKU key plus
|
|
187
213
|
* its tier grouping. `plan: null` = an ungrouped on/off flag. Deliberately NOT the full
|
|
@@ -283,6 +309,9 @@ export declare const connectorDispatchPayload: z.ZodObject<{
|
|
|
283
309
|
connection: z.ZodString;
|
|
284
310
|
}, z.core.$strip>, z.ZodObject<{
|
|
285
311
|
capability: z.core.$ZodBranded<z.ZodString, "CapabilityId", "out">;
|
|
312
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
313
|
+
vertical: z.ZodString;
|
|
314
|
+
scope: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
286
315
|
}, z.core.$strip>]>;
|
|
287
316
|
entity: z.ZodObject<{
|
|
288
317
|
entityType: z.ZodString;
|
|
@@ -307,4 +336,25 @@ export declare const connectorDispatchPayload: z.ZodObject<{
|
|
|
307
336
|
}, z.core.$strip>;
|
|
308
337
|
}, z.core.$strip>;
|
|
309
338
|
export type ConnectorDispatchPayload = z.infer<typeof connectorDispatchPayload>;
|
|
339
|
+
/**
|
|
340
|
+
* `GET /platform-requests/backlog` (#1690 §2) — how many platform-intent deliveries have
|
|
341
|
+
* GIVEN UP terminally across the fleet, over a window. Counted from the ops-failure record
|
|
342
|
+
* (platform-drain.ts records `operation: intent.<kind>` at the attempt ceiling and on a
|
|
343
|
+
* terminal refusal), one bounded query per known kind — the same technique
|
|
344
|
+
* `/connections/health` already uses for its per-provider connector dead-letter count.
|
|
345
|
+
*
|
|
346
|
+
* This is a count of FAILURES, never a queue depth: a still-`pending` intent lives in the
|
|
347
|
+
* vertical's own scope DO (K-31), and nothing indexes it fleet-wide — walking every active
|
|
348
|
+
* scope to count it is the fan-out the sweep itself already pays for on its own cadence, not
|
|
349
|
+
* something a console page should repeat on every load. So `total` only ever answers "how
|
|
350
|
+
* much has this given up on lately", never "how much is waiting" — a caller that reads it as
|
|
351
|
+
* a backlog depth is reading a claim this number does not make.
|
|
352
|
+
*/
|
|
353
|
+
export declare const platformRequestBacklog: z.ZodObject<{
|
|
354
|
+
total: z.ZodNumber;
|
|
355
|
+
capped: z.ZodBoolean;
|
|
356
|
+
since: z.ZodString;
|
|
357
|
+
windowDays: z.ZodNumber;
|
|
358
|
+
}, z.core.$strip>;
|
|
359
|
+
export type PlatformRequestBacklog = z.infer<typeof platformRequestBacklog>;
|
|
310
360
|
//# sourceMappingURL=platform-request.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-request.d.ts","sourceRoot":"","sources":["../src/platform-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;;GAMG;AAEH,eAAO,MAAM,qBAAqB;;;;EAAwC,CAAC;AAC3E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,4BAA4B;;;;EAA8C,CAAC;AACxF,MAAM,MAAM,4BAA4B,GAAG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;;;;iBAKjC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E,sEAAsE;AACtE,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,8BAA8B,eAAe,CAAC;AAE3D,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,aAAc,MAAM,KAAG,MACT,CAAC;AAEjD;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGnC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEhF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB;;;;;iBASjC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
package/dist/platform-request.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { instant, platformRequestId, scopeId } from './ids.js';
|
|
2
|
+
import { instant, platformRequestId, scopeId, verticalSlug } from './ids.js';
|
|
3
3
|
import { actor, domainEvent } from './events.js';
|
|
4
4
|
import { impersonationStamp } from './impersonation.js';
|
|
5
5
|
import { errorCode } from './errors.js';
|
|
@@ -143,6 +143,34 @@ export const PROVISION_SIBLING_KIND = 'provision-sibling';
|
|
|
143
143
|
export const archiveScopePayload = z.object({ scopeId });
|
|
144
144
|
/** The well-known intent kind string for `archiveScopePayload`. */
|
|
145
145
|
export const ARCHIVE_SCOPE_KIND = 'archive-scope';
|
|
146
|
+
/**
|
|
147
|
+
* The `peer-invoke` intent (#1706): module code asking the platform to invoke an operation on
|
|
148
|
+
* another vertical of the same tenant.
|
|
149
|
+
*
|
|
150
|
+
* **Why an intent rather than a call.** Operations, consumers and schedules run inside the
|
|
151
|
+
* scope's Durable Object, where module code has no network by rule — and where a fetch would
|
|
152
|
+
* not pass the egress worker that names the caller. So a handler enqueues this instead, inside
|
|
153
|
+
* its own transaction, and the platform delivers it: at-least-once, with the intent id as the
|
|
154
|
+
* idempotency key, and with the caller taken from the SCOPE the intent was drained from. The
|
|
155
|
+
* payload names the target and the operation; it cannot name a caller, and one would not be
|
|
156
|
+
* believed if it did.
|
|
157
|
+
*
|
|
158
|
+
* The synchronous leg (a harness route, through egress and the router) is the same door with a
|
|
159
|
+
* different transport — `peer-transport.ts`.
|
|
160
|
+
*/
|
|
161
|
+
export const peerInvokePayload = z.object({
|
|
162
|
+
/**
|
|
163
|
+
* The target vertical's registry slug, held to the slug grammar here rather than at
|
|
164
|
+
* delivery (#1719 review): a malformed target would otherwise pass the enqueue, sit in the
|
|
165
|
+
* outbox and fail a drain pass later, where the author who wrote it is no longer looking.
|
|
166
|
+
* The synchronous leg's `peerCallRequest` parses the same way.
|
|
167
|
+
*/
|
|
168
|
+
vertical: verticalSlug,
|
|
169
|
+
operation: z.string().min(1),
|
|
170
|
+
input: z.unknown().optional(),
|
|
171
|
+
});
|
|
172
|
+
/** The well-known intent kind string for `peerInvokePayload`. */
|
|
173
|
+
export const PEER_INVOKE_KIND = 'peer-invoke';
|
|
146
174
|
/**
|
|
147
175
|
* One entitlement a manager vertical asks the platform to grant (#412) — the SKU key plus
|
|
148
176
|
* its tier grouping. `plan: null` = an ungrouped on/off flag. Deliberately NOT the full
|
|
@@ -227,4 +255,28 @@ export const connectorDispatchPayload = z.object({
|
|
|
227
255
|
executorId: z.string().min(1),
|
|
228
256
|
event: domainEvent,
|
|
229
257
|
});
|
|
258
|
+
/**
|
|
259
|
+
* `GET /platform-requests/backlog` (#1690 §2) — how many platform-intent deliveries have
|
|
260
|
+
* GIVEN UP terminally across the fleet, over a window. Counted from the ops-failure record
|
|
261
|
+
* (platform-drain.ts records `operation: intent.<kind>` at the attempt ceiling and on a
|
|
262
|
+
* terminal refusal), one bounded query per known kind — the same technique
|
|
263
|
+
* `/connections/health` already uses for its per-provider connector dead-letter count.
|
|
264
|
+
*
|
|
265
|
+
* This is a count of FAILURES, never a queue depth: a still-`pending` intent lives in the
|
|
266
|
+
* vertical's own scope DO (K-31), and nothing indexes it fleet-wide — walking every active
|
|
267
|
+
* scope to count it is the fan-out the sweep itself already pays for on its own cadence, not
|
|
268
|
+
* something a console page should repeat on every load. So `total` only ever answers "how
|
|
269
|
+
* much has this given up on lately", never "how much is waiting" — a caller that reads it as
|
|
270
|
+
* a backlog depth is reading a claim this number does not make.
|
|
271
|
+
*/
|
|
272
|
+
export const platformRequestBacklog = z.object({
|
|
273
|
+
total: z.number().int().nonnegative(),
|
|
274
|
+
/** `total` hit the per-kind read bound and is a floor, not an exact count. */
|
|
275
|
+
capped: z.boolean(),
|
|
276
|
+
// A plain ISO string, like `ConnectionHealthPage.deadLettersSince` — stamped server-side
|
|
277
|
+
// from `Date#toISOString`, never parsed from the wire, so the branded `instant` (which a
|
|
278
|
+
// response body never round-trips through) buys this field nothing.
|
|
279
|
+
since: z.string(),
|
|
280
|
+
windowDays: z.number().int().positive(),
|
|
281
|
+
});
|
|
230
282
|
//# sourceMappingURL=platform-request.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-request.js","sourceRoot":"","sources":["../src/platform-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"platform-request.js","sourceRoot":"","sources":["../src/platform-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,EAAE,KAAK,E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CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,YAAY,CAAC;AAE3D,8EAA8E;AAC9E,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAAgB,EAAU,EAAE,CAChE,GAAG,8BAA8B,GAAG,QAAQ,EAAE,CAAC;AAEjD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,KAAK,EAAE,WAAW;CACnB,CAAC,CAAC;AAGH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACrC,8EAA8E;IAC9E,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,yFAAyF;IACzF,yFAAyF;IACzF,oEAAoE;IACpE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A preview's OWN sign-in client at the team auth-server its parent signs in with (#1704).
|
|
4
|
+
*
|
|
5
|
+
* A preview forks a prod scope into a new scope, bound to the PR's version. That version is
|
|
6
|
+
* its own dispatch script, and a Durable Object namespace belongs to its script, so the
|
|
7
|
+
* fork's config store starts empty and nothing of the parent's delivered config reaches it
|
|
8
|
+
* — not at create, and not after any later push, which binds yet another script. The
|
|
9
|
+
* parent's `substrat:auth` holds a client secret, and the platform neither keeps a copy of
|
|
10
|
+
* delivered config nor reads one back. So a preview is not handed the parent's client: it
|
|
11
|
+
* gets a client of its own, minted at the same issuer, and delivered through the ordinary
|
|
12
|
+
* `/internal/configure`. Prod's client is never touched and never learns a preview's
|
|
13
|
+
* callback. Reaping the preview deletes its client.
|
|
14
|
+
*
|
|
15
|
+
* This module is the vocabulary between the two ends of that protocol: the control plane,
|
|
16
|
+
* which decides when, and the team auth-server (`demos/auth-server`), which mints and
|
|
17
|
+
* deletes. Three platform-gated routes on the issuer, each addressed by the issuer's OWN
|
|
18
|
+
* scope and refused unless that scope is the named tenant's instance:
|
|
19
|
+
*
|
|
20
|
+
* - `POST /internal/preview-client/check` — does the parent sign in HERE? Read-only.
|
|
21
|
+
* - `POST /internal/preview-client` — mint the preview's client (re-checks first).
|
|
22
|
+
* - `DELETE /internal/preview-client` — delete the preview's clients, and only those.
|
|
23
|
+
*
|
|
24
|
+
* ## "The parent signs in here" is a platform fact, not a URI match
|
|
25
|
+
*
|
|
26
|
+
* Dynamic client registration is open at a team auth-server, and a callback URL is public.
|
|
27
|
+
* So "some client redirects to the parent's callback" proves nothing by itself: anybody can
|
|
28
|
+
* register one. The issuer claims a parent only when it holds a binding for the parent
|
|
29
|
+
* scope that ONLY the platform writes — a `place_app` row (#1670) or an `oauth_resource`
|
|
30
|
+
* row marked for that scope (#1619), both delivered by the dashboard through the
|
|
31
|
+
* platform-gated `/internal/configure` — AND an enabled client whose redirect URIs contain
|
|
32
|
+
* one of the parent's callbacks. The control plane asks every auth-server of the tenant and
|
|
33
|
+
* mints only where exactly one claims.
|
|
34
|
+
*
|
|
35
|
+
* ## Deletion is by tag, and by generation
|
|
36
|
+
*
|
|
37
|
+
* Every client minted here is recorded in the issuer's own `preview_client` table with the
|
|
38
|
+
* preview scope it belongs to and a generation the issuer assigns (monotonic per issuer, so
|
|
39
|
+
* the order is the issuer's own). A delete selects from that table and nothing else, so no
|
|
40
|
+
* delete can reach a client the platform did not mint for that preview — prod's included.
|
|
41
|
+
* A delete that keeps one client removes only the tagged clients OLDER than it, and says
|
|
42
|
+
* whether a newer one exists (`superseded`) or the kept one is gone (`kept: false`).
|
|
43
|
+
*/
|
|
44
|
+
/** Where a vertical's OIDC relying party receives the issuer's redirect. */
|
|
45
|
+
export declare const OIDC_CALLBACK_PATH = "/api/auth/callback";
|
|
46
|
+
/** The callback a relying party at `hostname` registers — exact-match, as issuers compare it. */
|
|
47
|
+
export declare function oidcCallbackUrl(hostname: string): string;
|
|
48
|
+
/** The issuer-side path of all three verbs (the check hangs off it as `/check`). */
|
|
49
|
+
export declare const PREVIEW_CLIENT_PATH = "/internal/preview-client";
|
|
50
|
+
/** `POST /internal/preview-client/check` — read-only: does the parent sign in here? */
|
|
51
|
+
export declare const previewClientCheck: z.ZodObject<{
|
|
52
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
53
|
+
scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
54
|
+
parentScopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
55
|
+
parentRedirectUris: z.ZodArray<z.ZodString>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
export type PreviewClientCheck = z.infer<typeof previewClientCheck>;
|
|
58
|
+
/** The check's answer. */
|
|
59
|
+
export declare const previewClientClaim: z.ZodObject<{
|
|
60
|
+
claimed: z.ZodBoolean;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
export type PreviewClientClaim = z.infer<typeof previewClientClaim>;
|
|
63
|
+
/**
|
|
64
|
+
* `POST /internal/preview-client` — mint the preview's client. The issuer re-runs the check
|
|
65
|
+
* first and refuses (409) a parent it does not claim. The client it registers carries
|
|
66
|
+
* EXACTLY `redirectUri` and `postLogoutRedirectUri`; either one equal to a parent callback
|
|
67
|
+
* is refused, so a preview client can never stand in for prod's.
|
|
68
|
+
*/
|
|
69
|
+
export declare const previewClientMint: z.ZodObject<{
|
|
70
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
71
|
+
scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
72
|
+
parentScopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
73
|
+
parentRedirectUris: z.ZodArray<z.ZodString>;
|
|
74
|
+
previewScopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
75
|
+
redirectUri: z.ZodString;
|
|
76
|
+
postLogoutRedirectUri: z.ZodString;
|
|
77
|
+
clientName: z.ZodString;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
export type PreviewClientMint = z.infer<typeof previewClientMint>;
|
|
80
|
+
/** What a mint answers — ONCE. The issuer stores the secret hashed, and nobody stores it here. */
|
|
81
|
+
export declare const mintedPreviewClient: z.ZodObject<{
|
|
82
|
+
clientId: z.ZodString;
|
|
83
|
+
clientSecret: z.ZodString;
|
|
84
|
+
generation: z.ZodNumber;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
export type MintedPreviewClient = z.infer<typeof mintedPreviewClient>;
|
|
87
|
+
/**
|
|
88
|
+
* `DELETE /internal/preview-client` — delete a preview's clients. With neither option, every
|
|
89
|
+
* client minted for the preview (the reap). With `keep`, the ones minted BEFORE it (a push
|
|
90
|
+
* that has just delivered its own). With `only`, that one client if it is the preview's (a
|
|
91
|
+
* mint whose delivery failed cleaning up after itself).
|
|
92
|
+
*/
|
|
93
|
+
export declare const previewClientRetire: z.ZodObject<{
|
|
94
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
95
|
+
scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
96
|
+
previewScopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
97
|
+
keep: z.ZodOptional<z.ZodString>;
|
|
98
|
+
only: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
export type PreviewClientRetire = z.infer<typeof previewClientRetire>;
|
|
101
|
+
/**
|
|
102
|
+
* What a delete did. `kept` is null without `keep`; otherwise whether the kept client still
|
|
103
|
+
* exists. `superseded` is true when a client NEWER than the kept one exists for the preview:
|
|
104
|
+
* another push minted after this one, and it — not this one — owns what happens next.
|
|
105
|
+
*/
|
|
106
|
+
export declare const retiredPreviewClients: z.ZodObject<{
|
|
107
|
+
deleted: z.ZodArray<z.ZodString>;
|
|
108
|
+
kept: z.ZodNullable<z.ZodBoolean>;
|
|
109
|
+
superseded: z.ZodBoolean;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
export type RetiredPreviewClients = z.infer<typeof retiredPreviewClients>;
|
|
112
|
+
/**
|
|
113
|
+
* What `preview create` reports about the preview's login — the `auth` field of its answer.
|
|
114
|
+
* Never a secret: the client id and issuer, and the callback, are all the output carries.
|
|
115
|
+
*
|
|
116
|
+
* - `wired` — a team auth-server claimed the parent; the preview has its own client there.
|
|
117
|
+
* - `unregistered` — no team auth-server claimed the parent: an external issuer, a builtin
|
|
118
|
+
* login, or a team install whose binding the dashboard has not delivered yet.
|
|
119
|
+
* - `ambiguous` — more than one claimed, so the platform chose none.
|
|
120
|
+
* - `unknown` — some auth-server could not be asked (it predates this, or did not answer),
|
|
121
|
+
* and none that could claimed the parent.
|
|
122
|
+
* - `superseded` — a newer push owns the preview; this push delivered nothing to it.
|
|
123
|
+
* - `not-applicable` — a clean-room preview has no parent to sign in like.
|
|
124
|
+
*/
|
|
125
|
+
export declare const previewAuthStatus: z.ZodEnum<{
|
|
126
|
+
ambiguous: "ambiguous";
|
|
127
|
+
"not-applicable": "not-applicable";
|
|
128
|
+
superseded: "superseded";
|
|
129
|
+
unknown: "unknown";
|
|
130
|
+
unregistered: "unregistered";
|
|
131
|
+
wired: "wired";
|
|
132
|
+
}>;
|
|
133
|
+
export type PreviewAuthStatus = z.infer<typeof previewAuthStatus>;
|
|
134
|
+
export declare const previewAuth: z.ZodObject<{
|
|
135
|
+
status: z.ZodEnum<{
|
|
136
|
+
ambiguous: "ambiguous";
|
|
137
|
+
"not-applicable": "not-applicable";
|
|
138
|
+
superseded: "superseded";
|
|
139
|
+
unknown: "unknown";
|
|
140
|
+
unregistered: "unregistered";
|
|
141
|
+
wired: "wired";
|
|
142
|
+
}>;
|
|
143
|
+
callbackUrl: z.ZodNullable<z.ZodString>;
|
|
144
|
+
issuer: z.ZodOptional<z.ZodString>;
|
|
145
|
+
issuerScopeId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "ScopeId", "out">>;
|
|
146
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
147
|
+
issuers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
148
|
+
issuerScopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
149
|
+
problem: z.ZodOptional<z.ZodString>;
|
|
150
|
+
}, z.core.$strip>>>;
|
|
151
|
+
note: z.ZodString;
|
|
152
|
+
}, z.core.$strip>;
|
|
153
|
+
export type PreviewAuth = z.infer<typeof previewAuth>;
|
|
154
|
+
//# sourceMappingURL=preview-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-client.d.ts","sourceRoot":"","sources":["../src/preview-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAEvD,iGAAiG;AACjG,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,oFAAoF;AACpF,eAAO,MAAM,mBAAmB,6BAA6B,CAAC;AA+B9D,uFAAuF;AACvF,eAAO,MAAM,kBAAkB;;;;;iBAI7B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,0BAA0B;AAC1B,eAAO,MAAM,kBAAkB;;iBAAqC,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