@substrat-run/contracts 0.117.0 → 0.119.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/auth-delivery.d.ts +17 -0
- package/dist/auth-delivery.d.ts.map +1 -0
- package/dist/auth-delivery.js +17 -0
- package/dist/auth-delivery.js.map +1 -0
- 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 +21 -1
- package/dist/control-plane.d.ts.map +1 -1
- package/dist/control-plane.js +33 -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 +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -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/places.d.ts +98 -0
- package/dist/places.d.ts.map +1 -0
- package/dist/places.js +103 -0
- package/dist/places.js.map +1 -0
- 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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AM,oBAAoB;;;;;;;;;;;;;;iBAS/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/dist/permission.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from '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;AAC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AC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAC3F,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,WAAW;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"}
|
package/dist/places.d.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A login's PLACES — where it holds a principal, across every app that signs in at one
|
|
4
|
+
* identity pool (#1670).
|
|
5
|
+
*
|
|
6
|
+
* K-22 makes a login a different principal in every scope, and each tenant's directory can
|
|
7
|
+
* say who a `sub` is *there*. Nothing could say where *else*. The answer lives with the
|
|
8
|
+
* pool, not with any vertical: the issuer that mints the `sub` keeps an index keyed on it
|
|
9
|
+
* (K-23, K-25), and shows it only to the login it belongs to, on the issuer's own origin.
|
|
10
|
+
* Verticals never read it. Three parties write to it, and this module is the vocabulary
|
|
11
|
+
* they share:
|
|
12
|
+
*
|
|
13
|
+
* - **The platform** says which apps are places at all. The dashboard delivers, per team,
|
|
14
|
+
* the whole set of its apps that sign in at this issuer, each with the client id it
|
|
15
|
+
* registered there, the hostname it answers on and its name. A vertical never names a
|
|
16
|
+
* tenant, a hostname or a display name; those are the platform's facts.
|
|
17
|
+
* - **A vertical** says only "this `sub` is, or is no longer, bound in my scope",
|
|
18
|
+
* authenticated as the client the platform registered for it. The issuer keeps an
|
|
19
|
+
* addition only when it has itself issued to that client for that `sub`.
|
|
20
|
+
* - **The issuer** answers the signed-in login with its own entries, each exactly a
|
|
21
|
+
* `place`, and nothing about any other login or tenant.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* The delivered-config key through which the platform tells a team auth-server which of a
|
|
25
|
+
* team's apps sign in there: `${PLACES_CONFIG_PREFIX}<tenant id>`, whose value is that
|
|
26
|
+
* team's WHOLE set as a JSON array of `placeRegistration`, or `""` for none. Keyed by team
|
|
27
|
+
* rather than by app so that an app the team deleted, or moved to another issuer, drops out
|
|
28
|
+
* of the next delivery by itself; one team's delivery never touches another team's rows.
|
|
29
|
+
*/
|
|
30
|
+
export declare const PLACES_CONFIG_PREFIX = "substrat:places:";
|
|
31
|
+
/** One app, as the platform registers it at the issuer it signs in with. */
|
|
32
|
+
export declare const placeRegistration: z.ZodObject<{
|
|
33
|
+
appScopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
34
|
+
clientId: z.ZodString;
|
|
35
|
+
hostname: z.ZodString;
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
export type PlaceRegistration = z.infer<typeof placeRegistration>;
|
|
39
|
+
/** More apps than any team signs in at one issuer; a bound on what one delivery writes. */
|
|
40
|
+
export declare const MAX_PLACE_REGISTRATIONS = 500;
|
|
41
|
+
export declare const placeRegistrations: z.ZodArray<z.ZodObject<{
|
|
42
|
+
appScopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
43
|
+
clientId: z.ZodString;
|
|
44
|
+
hostname: z.ZodString;
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
}, z.core.$strict>>;
|
|
47
|
+
/**
|
|
48
|
+
* ONE ENTRY of a login's places, and the whole of what the account surface says about it:
|
|
49
|
+
* enough to deep-link, nothing more about the tenant (#1670's Decision). The issuer
|
|
50
|
+
* projects to exactly these keys and a test pins the set.
|
|
51
|
+
*/
|
|
52
|
+
export declare const place: z.ZodObject<{
|
|
53
|
+
tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
|
|
54
|
+
scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
55
|
+
hostname: z.ZodString;
|
|
56
|
+
name: z.ZodString;
|
|
57
|
+
}, z.core.$strict>;
|
|
58
|
+
export type Place = z.infer<typeof place>;
|
|
59
|
+
/**
|
|
60
|
+
* Where an issuer says it keeps a places index: `${issuer}${PLACES_DISCOVERY_PATH}`. A
|
|
61
|
+
* vertical reports only to an issuer that answers it, so an external issuer (Supabase,
|
|
62
|
+
* Auth0, …) never receives a report: its pool is not one the platform keeps an index for.
|
|
63
|
+
*/
|
|
64
|
+
export declare const PLACES_DISCOVERY_PATH = "/.well-known/substrat-places";
|
|
65
|
+
export declare const placesDiscovery: z.ZodObject<{
|
|
66
|
+
report_endpoint: z.ZodString;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
/**
|
|
69
|
+
* The most subjects one whole-set report may carry. A scope with more is refused and
|
|
70
|
+
* logged rather than half-reported: a partial replace would REMOVE every entry it left out.
|
|
71
|
+
*/
|
|
72
|
+
export declare const MAX_PLACE_MEMBERS = 10000;
|
|
73
|
+
/**
|
|
74
|
+
* What a vertical tells the issuer. `present` / `absent` follow one binding as it changes;
|
|
75
|
+
* `replace` is the repair, the WHOLE set of subjects bound in the scope, which drops every
|
|
76
|
+
* entry it does not name and so heals a lost `absent` as well as a lost `present`.
|
|
77
|
+
*/
|
|
78
|
+
export declare const placeReport: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
79
|
+
client_id: z.ZodString;
|
|
80
|
+
client_secret: z.ZodString;
|
|
81
|
+
scope_id: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
82
|
+
op: z.ZodLiteral<"present">;
|
|
83
|
+
sub: z.ZodString;
|
|
84
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
85
|
+
client_id: z.ZodString;
|
|
86
|
+
client_secret: z.ZodString;
|
|
87
|
+
scope_id: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
88
|
+
op: z.ZodLiteral<"absent">;
|
|
89
|
+
sub: z.ZodString;
|
|
90
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
91
|
+
client_id: z.ZodString;
|
|
92
|
+
client_secret: z.ZodString;
|
|
93
|
+
scope_id: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
|
|
94
|
+
op: z.ZodLiteral<"replace">;
|
|
95
|
+
subs: z.ZodArray<z.ZodString>;
|
|
96
|
+
}, z.core.$strict>], "op">;
|
|
97
|
+
export type PlaceReport = z.infer<typeof placeReport>;
|
|
98
|
+
//# sourceMappingURL=places.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"places.d.ts","sourceRoot":"","sources":["../src/places.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AAgBvD,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB;;;;;kBAWnB,CAAC;AAEZ,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,2FAA2F;AAC3F,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,eAAO,MAAM,kBAAkB;;;;;mBAA0D,CAAC;AAE1F;;;;GAIG;AACH,eAAO,MAAM,KAAK;;;;;kBAOP,CAAC;AAEZ,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC;AAE1C;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,iCAAiC,CAAC;AAEpE,eAAO,MAAM,eAAe;;iBAAkD,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAS,CAAC;AAYxC;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;0BAItB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
package/dist/places.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { scopeId, tenantId } from './ids.js';
|
|
3
|
+
/**
|
|
4
|
+
* A login's PLACES — where it holds a principal, across every app that signs in at one
|
|
5
|
+
* identity pool (#1670).
|
|
6
|
+
*
|
|
7
|
+
* K-22 makes a login a different principal in every scope, and each tenant's directory can
|
|
8
|
+
* say who a `sub` is *there*. Nothing could say where *else*. The answer lives with the
|
|
9
|
+
* pool, not with any vertical: the issuer that mints the `sub` keeps an index keyed on it
|
|
10
|
+
* (K-23, K-25), and shows it only to the login it belongs to, on the issuer's own origin.
|
|
11
|
+
* Verticals never read it. Three parties write to it, and this module is the vocabulary
|
|
12
|
+
* they share:
|
|
13
|
+
*
|
|
14
|
+
* - **The platform** says which apps are places at all. The dashboard delivers, per team,
|
|
15
|
+
* the whole set of its apps that sign in at this issuer, each with the client id it
|
|
16
|
+
* registered there, the hostname it answers on and its name. A vertical never names a
|
|
17
|
+
* tenant, a hostname or a display name; those are the platform's facts.
|
|
18
|
+
* - **A vertical** says only "this `sub` is, or is no longer, bound in my scope",
|
|
19
|
+
* authenticated as the client the platform registered for it. The issuer keeps an
|
|
20
|
+
* addition only when it has itself issued to that client for that `sub`.
|
|
21
|
+
* - **The issuer** answers the signed-in login with its own entries, each exactly a
|
|
22
|
+
* `place`, and nothing about any other login or tenant.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* The delivered-config key through which the platform tells a team auth-server which of a
|
|
26
|
+
* team's apps sign in there: `${PLACES_CONFIG_PREFIX}<tenant id>`, whose value is that
|
|
27
|
+
* team's WHOLE set as a JSON array of `placeRegistration`, or `""` for none. Keyed by team
|
|
28
|
+
* rather than by app so that an app the team deleted, or moved to another issuer, drops out
|
|
29
|
+
* of the next delivery by itself; one team's delivery never touches another team's rows.
|
|
30
|
+
*/
|
|
31
|
+
export const PLACES_CONFIG_PREFIX = 'substrat:places:';
|
|
32
|
+
/** A hostname as a deep link names it: lowercase labels, an optional port, no scheme. */
|
|
33
|
+
const placeHostname = z
|
|
34
|
+
.string()
|
|
35
|
+
.max(253)
|
|
36
|
+
.regex(/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*(?::\d{1,5})?$/, 'a bare hostname');
|
|
37
|
+
/** A display name: one line of plain text, bounded. */
|
|
38
|
+
const placeName = z
|
|
39
|
+
.string()
|
|
40
|
+
.trim()
|
|
41
|
+
.min(1)
|
|
42
|
+
.max(120)
|
|
43
|
+
.refine((s) => !/[\u0000-\u001f\u007f]/.test(s), 'no control characters');
|
|
44
|
+
/** One app, as the platform registers it at the issuer it signs in with. */
|
|
45
|
+
export const placeRegistration = z
|
|
46
|
+
.object({
|
|
47
|
+
/** The app's own scope, which is also the scope its entries name. */
|
|
48
|
+
appScopeId: scopeId,
|
|
49
|
+
/** The OIDC client the platform registered for this app at this issuer. */
|
|
50
|
+
clientId: z.string().min(1).max(256),
|
|
51
|
+
/** Where the app answers — the deep link. */
|
|
52
|
+
hostname: placeHostname,
|
|
53
|
+
/** What the app is called, as the team named it. */
|
|
54
|
+
name: placeName,
|
|
55
|
+
})
|
|
56
|
+
.strict();
|
|
57
|
+
/** More apps than any team signs in at one issuer; a bound on what one delivery writes. */
|
|
58
|
+
export const MAX_PLACE_REGISTRATIONS = 500;
|
|
59
|
+
export const placeRegistrations = z.array(placeRegistration).max(MAX_PLACE_REGISTRATIONS);
|
|
60
|
+
/**
|
|
61
|
+
* ONE ENTRY of a login's places, and the whole of what the account surface says about it:
|
|
62
|
+
* enough to deep-link, nothing more about the tenant (#1670's Decision). The issuer
|
|
63
|
+
* projects to exactly these keys and a test pins the set.
|
|
64
|
+
*/
|
|
65
|
+
export const place = z
|
|
66
|
+
.object({
|
|
67
|
+
tenantId,
|
|
68
|
+
scopeId,
|
|
69
|
+
hostname: placeHostname,
|
|
70
|
+
name: placeName,
|
|
71
|
+
})
|
|
72
|
+
.strict();
|
|
73
|
+
/**
|
|
74
|
+
* Where an issuer says it keeps a places index: `${issuer}${PLACES_DISCOVERY_PATH}`. A
|
|
75
|
+
* vertical reports only to an issuer that answers it, so an external issuer (Supabase,
|
|
76
|
+
* Auth0, …) never receives a report: its pool is not one the platform keeps an index for.
|
|
77
|
+
*/
|
|
78
|
+
export const PLACES_DISCOVERY_PATH = '/.well-known/substrat-places';
|
|
79
|
+
export const placesDiscovery = z.object({ report_endpoint: z.string().url() });
|
|
80
|
+
/**
|
|
81
|
+
* The most subjects one whole-set report may carry. A scope with more is refused and
|
|
82
|
+
* logged rather than half-reported: a partial replace would REMOVE every entry it left out.
|
|
83
|
+
*/
|
|
84
|
+
export const MAX_PLACE_MEMBERS = 10_000;
|
|
85
|
+
const subject = z.string().min(1).max(256);
|
|
86
|
+
const reportAuth = {
|
|
87
|
+
/** The client the platform registered for this app at the issuer, and its secret. */
|
|
88
|
+
client_id: z.string().min(1).max(256),
|
|
89
|
+
client_secret: z.string().min(1).max(512),
|
|
90
|
+
/** The scope the report is about. It must be the app scope the platform registered. */
|
|
91
|
+
scope_id: scopeId,
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* What a vertical tells the issuer. `present` / `absent` follow one binding as it changes;
|
|
95
|
+
* `replace` is the repair, the WHOLE set of subjects bound in the scope, which drops every
|
|
96
|
+
* entry it does not name and so heals a lost `absent` as well as a lost `present`.
|
|
97
|
+
*/
|
|
98
|
+
export const placeReport = z.discriminatedUnion('op', [
|
|
99
|
+
z.object({ ...reportAuth, op: z.literal('present'), sub: subject }).strict(),
|
|
100
|
+
z.object({ ...reportAuth, op: z.literal('absent'), sub: subject }).strict(),
|
|
101
|
+
z.object({ ...reportAuth, op: z.literal('replace'), subs: z.array(subject).max(MAX_PLACE_MEMBERS) }).strict(),
|
|
102
|
+
]);
|
|
103
|
+
//# sourceMappingURL=places.js.map
|
|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AAG,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3E,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;CAC9G,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,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BAAqB,qBAAqB,CAAC;AAExD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;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,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