@substrat-run/contracts 0.135.0 → 0.137.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/control-plane.d.ts +42 -0
- package/dist/control-plane.d.ts.map +1 -1
- package/dist/control-plane.js +39 -0
- package/dist/control-plane.js.map +1 -1
- package/dist/deploy.d.ts +34 -0
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +79 -2
- package/dist/deploy.js.map +1 -1
- package/dist/errors.d.ts +18 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +26 -2
- package/dist/errors.js.map +1 -1
- package/dist/ids.d.ts +2 -0
- package/dist/ids.d.ts.map +1 -1
- package/dist/ids.js +2 -0
- package/dist/ids.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/invocation-record.d.ts +27 -11
- package/dist/invocation-record.d.ts.map +1 -1
- package/dist/invocation-record.js +27 -11
- package/dist/invocation-record.js.map +1 -1
- package/dist/lifecycle.d.ts +9 -1
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +9 -1
- package/dist/lifecycle.js.map +1 -1
- package/dist/manifest.d.ts +51 -5
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +42 -5
- package/dist/manifest.js.map +1 -1
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +15 -2
- package/dist/operations.js.map +1 -1
- package/dist/pagination.d.ts +0 -0
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +0 -0
- package/dist/pagination.js.map +1 -1
- package/dist/permission.d.ts +2 -0
- package/dist/permission.d.ts.map +1 -1
- package/dist/permission.js +7 -0
- package/dist/permission.js.map +1 -1
- package/dist/refusal.d.ts +49 -6
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +82 -13
- package/dist/refusal.js.map +1 -1
- package/dist/registry.d.ts +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +11 -0
- package/dist/registry.js.map +1 -1
- package/dist/routing.d.ts +8 -0
- package/dist/routing.d.ts.map +1 -1
- package/dist/routing.js +22 -0
- package/dist/routing.js.map +1 -1
- package/dist/script-names.d.ts +33 -0
- package/dist/script-names.d.ts.map +1 -0
- package/dist/script-names.js +59 -0
- package/dist/script-names.js.map +1 -0
- package/dist/tenancy.d.ts +109 -0
- package/dist/tenancy.d.ts.map +1 -1
- package/dist/tenancy.js +52 -0
- package/dist/tenancy.js.map +1 -1
- package/dist/wire-headers.d.ts +75 -0
- package/dist/wire-headers.d.ts.map +1 -0
- package/dist/wire-headers.js +69 -0
- package/dist/wire-headers.js.map +1 -0
- package/package.json +5 -1
package/dist/tenancy.d.ts
CHANGED
|
@@ -66,6 +66,115 @@ export declare const scopeStatus: z.ZodEnum<{
|
|
|
66
66
|
suspended: "suspended";
|
|
67
67
|
}>;
|
|
68
68
|
export type ScopeStatus = z.infer<typeof scopeStatus>;
|
|
69
|
+
/**
|
|
70
|
+
* The directory's revision of a scope's lifecycle (#1713), compared in order:
|
|
71
|
+
*
|
|
72
|
+
* - `epoch`: which history of the directory this is. Every directory restore mints a newer one,
|
|
73
|
+
* so a restored directory, whose counters went back with it, still outranks everything the
|
|
74
|
+
* history it replaced delivered. 0 for a directory never restored.
|
|
75
|
+
* - `scope` counts the scope's status transitions and `tenant` its tenant's status changes, each
|
|
76
|
+
* bumped in the same directory transaction as the change it counts.
|
|
77
|
+
*
|
|
78
|
+
* A deployment keeps a delivery from a newer epoch whatever its counters; within one epoch, only
|
|
79
|
+
* one strictly newer on one counter and older on neither. Never a clock.
|
|
80
|
+
*/
|
|
81
|
+
export declare const lifecycleRevision: z.ZodObject<{
|
|
82
|
+
epoch: z.ZodNumber;
|
|
83
|
+
scope: z.ZodNumber;
|
|
84
|
+
tenant: z.ZodNumber;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
export type LifecycleRevision = z.infer<typeof lifecycleRevision>;
|
|
87
|
+
/**
|
|
88
|
+
* A scope's lifecycle as the directory holds it, delivered to the deployment that serves it
|
|
89
|
+
* (#1713). A CP-less vertical has no directory to read, so the platform pushes this on every
|
|
90
|
+
* transition and its heal sweep re-pushes any scope whose last delivered state differs. It is a
|
|
91
|
+
* STATE, never a toggle, ordered by `revision`: the deployment keeps only a delivery strictly
|
|
92
|
+
* newer than the one it holds, so a late delivery cannot undo a later one. `at` is when the
|
|
93
|
+
* platform read the directory, kept for the reader and never compared.
|
|
94
|
+
*/
|
|
95
|
+
export declare const scopeLifecycle: z.ZodObject<{
|
|
96
|
+
scope: z.ZodEnum<{
|
|
97
|
+
active: "active";
|
|
98
|
+
archived: "archived";
|
|
99
|
+
archiving: "archiving";
|
|
100
|
+
provisioning: "provisioning";
|
|
101
|
+
reaped: "reaped";
|
|
102
|
+
suspended: "suspended";
|
|
103
|
+
}>;
|
|
104
|
+
tenant: z.ZodEnum<{
|
|
105
|
+
active: "active";
|
|
106
|
+
deleting: "deleting";
|
|
107
|
+
reaped: "reaped";
|
|
108
|
+
suspended: "suspended";
|
|
109
|
+
}>;
|
|
110
|
+
at: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
111
|
+
revision: z.ZodObject<{
|
|
112
|
+
epoch: z.ZodNumber;
|
|
113
|
+
scope: z.ZodNumber;
|
|
114
|
+
tenant: z.ZodNumber;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
export type ScopeLifecycle = z.infer<typeof scopeLifecycle>;
|
|
118
|
+
/**
|
|
119
|
+
* A lifecycle as a scope may HOLD it: one delivered before revisions existed carries none, and is
|
|
120
|
+
* older than any delivery that does. Its statuses still hold the scope.
|
|
121
|
+
*/
|
|
122
|
+
export declare const storedScopeLifecycle: z.ZodObject<{
|
|
123
|
+
scope: z.ZodEnum<{
|
|
124
|
+
active: "active";
|
|
125
|
+
archived: "archived";
|
|
126
|
+
archiving: "archiving";
|
|
127
|
+
provisioning: "provisioning";
|
|
128
|
+
reaped: "reaped";
|
|
129
|
+
suspended: "suspended";
|
|
130
|
+
}>;
|
|
131
|
+
tenant: z.ZodEnum<{
|
|
132
|
+
active: "active";
|
|
133
|
+
deleting: "deleting";
|
|
134
|
+
reaped: "reaped";
|
|
135
|
+
suspended: "suspended";
|
|
136
|
+
}>;
|
|
137
|
+
at: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
138
|
+
revision: z.ZodOptional<z.ZodObject<{
|
|
139
|
+
epoch: z.ZodNumber;
|
|
140
|
+
scope: z.ZodNumber;
|
|
141
|
+
tenant: z.ZodNumber;
|
|
142
|
+
}, z.core.$strip>>;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
export type StoredScopeLifecycle = z.infer<typeof storedScopeLifecycle>;
|
|
145
|
+
/**
|
|
146
|
+
* What a deployment answers a lifecycle delivery with (#1713). `applied`: the delivery is now the
|
|
147
|
+
* stored state (false when the scope already held one as new or newer). `changed`: whether the
|
|
148
|
+
* scope's work is held now moved with it. `lifecycle`: what the scope holds after the call.
|
|
149
|
+
*/
|
|
150
|
+
export declare const lifecycleDelivery: z.ZodObject<{
|
|
151
|
+
applied: z.ZodBoolean;
|
|
152
|
+
changed: z.ZodBoolean;
|
|
153
|
+
lifecycle: z.ZodObject<{
|
|
154
|
+
scope: z.ZodEnum<{
|
|
155
|
+
active: "active";
|
|
156
|
+
archived: "archived";
|
|
157
|
+
archiving: "archiving";
|
|
158
|
+
provisioning: "provisioning";
|
|
159
|
+
reaped: "reaped";
|
|
160
|
+
suspended: "suspended";
|
|
161
|
+
}>;
|
|
162
|
+
tenant: z.ZodEnum<{
|
|
163
|
+
active: "active";
|
|
164
|
+
deleting: "deleting";
|
|
165
|
+
reaped: "reaped";
|
|
166
|
+
suspended: "suspended";
|
|
167
|
+
}>;
|
|
168
|
+
at: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
|
|
169
|
+
revision: z.ZodOptional<z.ZodObject<{
|
|
170
|
+
epoch: z.ZodNumber;
|
|
171
|
+
scope: z.ZodNumber;
|
|
172
|
+
tenant: z.ZodNumber;
|
|
173
|
+
}, z.core.$strip>>;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
tenantRecorded: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
+
}, z.core.$strip>;
|
|
177
|
+
export type LifecycleDelivery = z.infer<typeof lifecycleDelivery>;
|
|
69
178
|
export declare const storageShape: z.ZodEnum<{
|
|
70
179
|
A: "A";
|
|
71
180
|
B: "B";
|
package/dist/tenancy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenancy.d.ts","sourceRoot":"","sources":["../src/tenancy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,YAAY;;;;;EAevB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,eAAO,MAAM,MAAM;;;;;;;;;;;;;iBAiBjB,CAAC;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AAM5C,eAAO,MAAM,iBAAiB;;;;;iBAEoC,CAAC;AACnE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,GAAG;;;;;;iBAMd,CAAC;AACH,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC;AAGtC,eAAO,MAAM,cAAc;;;;;iBAAiE,CAAC;AAC7F,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,eAAO,MAAM,WAAW;;;;;;;EAYtB,CAAC;AACH,MAAM,MAAM,WAAW,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;;;;;;;;;;;;;;;;;;;;;;;;iBAS5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgFhB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC"}
|
package/dist/tenancy.js
CHANGED
|
@@ -77,6 +77,58 @@ export const scopeStatus = z.enum([
|
|
|
77
77
|
// missing scope. Reached only from `archived` via the audited `reapScope` action.
|
|
78
78
|
'reaped',
|
|
79
79
|
]);
|
|
80
|
+
/**
|
|
81
|
+
* The directory's revision of a scope's lifecycle (#1713), compared in order:
|
|
82
|
+
*
|
|
83
|
+
* - `epoch`: which history of the directory this is. Every directory restore mints a newer one,
|
|
84
|
+
* so a restored directory, whose counters went back with it, still outranks everything the
|
|
85
|
+
* history it replaced delivered. 0 for a directory never restored.
|
|
86
|
+
* - `scope` counts the scope's status transitions and `tenant` its tenant's status changes, each
|
|
87
|
+
* bumped in the same directory transaction as the change it counts.
|
|
88
|
+
*
|
|
89
|
+
* A deployment keeps a delivery from a newer epoch whatever its counters; within one epoch, only
|
|
90
|
+
* one strictly newer on one counter and older on neither. Never a clock.
|
|
91
|
+
*/
|
|
92
|
+
export const lifecycleRevision = z.object({
|
|
93
|
+
epoch: z.number().int().nonnegative(),
|
|
94
|
+
scope: z.number().int().nonnegative(),
|
|
95
|
+
tenant: z.number().int().nonnegative(),
|
|
96
|
+
});
|
|
97
|
+
/**
|
|
98
|
+
* A scope's lifecycle as the directory holds it, delivered to the deployment that serves it
|
|
99
|
+
* (#1713). A CP-less vertical has no directory to read, so the platform pushes this on every
|
|
100
|
+
* transition and its heal sweep re-pushes any scope whose last delivered state differs. It is a
|
|
101
|
+
* STATE, never a toggle, ordered by `revision`: the deployment keeps only a delivery strictly
|
|
102
|
+
* newer than the one it holds, so a late delivery cannot undo a later one. `at` is when the
|
|
103
|
+
* platform read the directory, kept for the reader and never compared.
|
|
104
|
+
*/
|
|
105
|
+
export const scopeLifecycle = z.object({
|
|
106
|
+
scope: scopeStatus,
|
|
107
|
+
tenant: tenantStatus,
|
|
108
|
+
at: instant,
|
|
109
|
+
revision: lifecycleRevision,
|
|
110
|
+
});
|
|
111
|
+
/**
|
|
112
|
+
* A lifecycle as a scope may HOLD it: one delivered before revisions existed carries none, and is
|
|
113
|
+
* older than any delivery that does. Its statuses still hold the scope.
|
|
114
|
+
*/
|
|
115
|
+
export const storedScopeLifecycle = scopeLifecycle.extend({ revision: lifecycleRevision.optional() });
|
|
116
|
+
/**
|
|
117
|
+
* What a deployment answers a lifecycle delivery with (#1713). `applied`: the delivery is now the
|
|
118
|
+
* stored state (false when the scope already held one as new or newer). `changed`: whether the
|
|
119
|
+
* scope's work is held now moved with it. `lifecycle`: what the scope holds after the call.
|
|
120
|
+
*/
|
|
121
|
+
export const lifecycleDelivery = z.object({
|
|
122
|
+
applied: z.boolean(),
|
|
123
|
+
changed: z.boolean(),
|
|
124
|
+
lifecycle: storedScopeLifecycle,
|
|
125
|
+
/**
|
|
126
|
+
* #2016: whether the scope holds a record of its tenant (`provisioned_for`) after the call. The
|
|
127
|
+
* platform keeps delivering to a scope that answers false until it answers true. Absent from a
|
|
128
|
+
* deployment built before it, which reads as not recorded.
|
|
129
|
+
*/
|
|
130
|
+
tenantRecorded: z.boolean().optional(),
|
|
131
|
+
});
|
|
80
132
|
// §5.2 of the design doc: A = DO-embedded SQLite is primary; B = DO control plane + D1
|
|
81
133
|
export const storageShape = z.enum(['A', 'B']);
|
|
82
134
|
// Fixed at provisioning; a DO can never relocate (design K-7). `global` is the
|
package/dist/tenancy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenancy.js","sourceRoot":"","sources":["../src/tenancy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,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+EAA+E;IAC/E,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,gBAAgB;IAChB;;;;;;OAMG;IACH,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE;IAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE;IAC5B;;;;;OAKG;IACH,SAAS,EAAE,OAAO,CAAC,QAAQ,EAAE;IAC7B;;;;;;OAMG;IACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;IACvC;;;;;OAKG;IACH,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE;IAC9B,SAAS,EAAE,OAAO;CACnB,CAAC,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire names shared by the router, the platform and a vertical: the headers a request or a
|
|
3
|
+
* response carries between them (#1978).
|
|
4
|
+
*
|
|
5
|
+
* Constants rather than code, so they sit in the shared vocabulary rather than in the
|
|
6
|
+
* kernel, and every end that has to spell one imports it from here. This module imports
|
|
7
|
+
* nothing, which is what lets the platform's entry bundle (`withInvocationLog`) reach it
|
|
8
|
+
* through `@substrat-run/contracts/wire-headers` without pulling the rest of this package,
|
|
9
|
+
* and zod, in behind it.
|
|
10
|
+
*/
|
|
11
|
+
/** The header the platform presents. */
|
|
12
|
+
export declare const PLATFORM_SECRET_HEADER = "x-substrat-platform";
|
|
13
|
+
/**
|
|
14
|
+
* The RESPONSE header carrying an attachment's metadata record when the vertical
|
|
15
|
+
* hands its bytes back over the connector seam (#711).
|
|
16
|
+
*
|
|
17
|
+
* The bytes are the body — a rendered contract is megabytes, and base64 in a JSON
|
|
18
|
+
* envelope would inflate and re-encode it on both ends for nothing. The record is
|
|
19
|
+
* small, fixed-shape and needs no streaming, so it rides a header. Not a secret and
|
|
20
|
+
* not a privilege: the caller has already passed the platform-secret gate, and the
|
|
21
|
+
* far end has already run the permission check that decided it may see any of this.
|
|
22
|
+
*/
|
|
23
|
+
export declare const CONNECTOR_ATTACHMENT_RECORD_HEADER = "x-substrat-attachment";
|
|
24
|
+
/**
|
|
25
|
+
* The RESPONSE header a vertical sets when the operation it just ran enqueued
|
|
26
|
+
* platform requests (`ctx.requestPlatform`). The router — the one hop that sees
|
|
27
|
+
* every response — reads it and kicks an immediate drain of that scope (#381),
|
|
28
|
+
* so provisioning settles in seconds instead of at the sweep. Carries no payload
|
|
29
|
+
* and no privilege: a forged or spurious flag costs the platform one wasted
|
|
30
|
+
* pull, nothing more. Fed by `ScopeStubOptions.onPlatformRequests` (#458).
|
|
31
|
+
*/
|
|
32
|
+
export declare const PLATFORM_REQUEST_HEADER = "x-substrat-platform-request";
|
|
33
|
+
/**
|
|
34
|
+
* The RESPONSE header a vertical sets when the operation it just ran committed an event of a
|
|
35
|
+
* type this deployment EXPORTS to other verticals (#1705). The router reads it beside
|
|
36
|
+
* {@link PLATFORM_REQUEST_HEADER} and asks the control plane to run this producer's outgoing
|
|
37
|
+
* edges now, so a consumer in another vertical receives the event in seconds rather than at
|
|
38
|
+
* the next sweep. Like its sibling it carries no payload and no privilege: the control plane
|
|
39
|
+
* takes the tenant and scope from the route the router resolved, never from the response, and a
|
|
40
|
+
* spurious flag costs one pass over that producer's own edges. The router strips every
|
|
41
|
+
* `x-substrat-*` header from an inbound request, so only a response can raise it. Fed by
|
|
42
|
+
* `ScopeStubOptions.onExportedEvents`.
|
|
43
|
+
*/
|
|
44
|
+
export declare const EXPORTED_EVENTS_HEADER = "x-substrat-exported-events";
|
|
45
|
+
/**
|
|
46
|
+
* Set on every refusal a live-read door returns, so a client can tell "no push here,
|
|
47
|
+
* poll" from "your request was wrong" without parsing a body or guessing from a status.
|
|
48
|
+
*
|
|
49
|
+
* Here rather than in the hosted adapter because both ends of a refusal need to spell it
|
|
50
|
+
* the same way: the hosted adapter sets it on its own refusals, and a vertical's mount
|
|
51
|
+
* sets it on the pure host's `501` (the ask-don't-assume recipe on `ScopeHost.liveReads`).
|
|
52
|
+
* A dev server should not have to import the Cloudflare adapter to say "poll".
|
|
53
|
+
*/
|
|
54
|
+
export declare const LIVE_MODE_HEADER = "x-substrat-live";
|
|
55
|
+
/** Why a subscription was refused — the value of `LIVE_MODE_HEADER` on a refusal. */
|
|
56
|
+
export type LiveRefusal =
|
|
57
|
+
/** This host or connection cannot carry a WebSocket; the client should keep polling. */
|
|
58
|
+
'poll'
|
|
59
|
+
/** The request was not an upgrade at all — a programming error at the caller. */
|
|
60
|
+
| 'not-an-upgrade';
|
|
61
|
+
/**
|
|
62
|
+
* The RESPONSE header on `/internal/export` carrying the scope store's load stamp, read in the
|
|
63
|
+
* same call as the dump it rides beside (#1722). A carry's fenced wipe of the copy it leaves
|
|
64
|
+
* behind expects exactly this stamp, so the wipe is refused when anything was loaded into the
|
|
65
|
+
* store since. The stamp itself never travels inside a dump.
|
|
66
|
+
*/
|
|
67
|
+
export declare const LOAD_STAMP_HEADER = "x-substrat-load-stamp";
|
|
68
|
+
/**
|
|
69
|
+
* The RESPONSE header on `/internal/export` carrying the scope store's write revision, read in
|
|
70
|
+
* the same call as the dump and the load stamp (#1722). The carry's fenced wipe of the copy it
|
|
71
|
+
* leaves expects it too, so a write that reached the old copy after the export (a request still
|
|
72
|
+
* routed there before the bind) refuses the wipe and the copy is kept for recovery.
|
|
73
|
+
*/
|
|
74
|
+
export declare const WRITE_REVISION_HEADER = "x-substrat-write-revision";
|
|
75
|
+
//# sourceMappingURL=wire-headers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-headers.d.ts","sourceRoot":"","sources":["../src/wire-headers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,wCAAwC;AACxC,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAE5D;;;;;;;;;GASG;AACH,eAAO,MAAM,kCAAkC,0BAA0B,CAAC;AAE1E;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AAErE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,+BAA+B,CAAC;AAEnE;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,oBAAoB,CAAC;AAElD,qFAAqF;AACrF,MAAM,MAAM,WAAW;AACrB,wFAAwF;AACtF,MAAM;AACR,iFAAiF;GAC/E,gBAAgB,CAAC;AAErB;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire names shared by the router, the platform and a vertical: the headers a request or a
|
|
3
|
+
* response carries between them (#1978).
|
|
4
|
+
*
|
|
5
|
+
* Constants rather than code, so they sit in the shared vocabulary rather than in the
|
|
6
|
+
* kernel, and every end that has to spell one imports it from here. This module imports
|
|
7
|
+
* nothing, which is what lets the platform's entry bundle (`withInvocationLog`) reach it
|
|
8
|
+
* through `@substrat-run/contracts/wire-headers` without pulling the rest of this package,
|
|
9
|
+
* and zod, in behind it.
|
|
10
|
+
*/
|
|
11
|
+
/** The header the platform presents. */
|
|
12
|
+
export const PLATFORM_SECRET_HEADER = 'x-substrat-platform';
|
|
13
|
+
/**
|
|
14
|
+
* The RESPONSE header carrying an attachment's metadata record when the vertical
|
|
15
|
+
* hands its bytes back over the connector seam (#711).
|
|
16
|
+
*
|
|
17
|
+
* The bytes are the body — a rendered contract is megabytes, and base64 in a JSON
|
|
18
|
+
* envelope would inflate and re-encode it on both ends for nothing. The record is
|
|
19
|
+
* small, fixed-shape and needs no streaming, so it rides a header. Not a secret and
|
|
20
|
+
* not a privilege: the caller has already passed the platform-secret gate, and the
|
|
21
|
+
* far end has already run the permission check that decided it may see any of this.
|
|
22
|
+
*/
|
|
23
|
+
export const CONNECTOR_ATTACHMENT_RECORD_HEADER = 'x-substrat-attachment';
|
|
24
|
+
/**
|
|
25
|
+
* The RESPONSE header a vertical sets when the operation it just ran enqueued
|
|
26
|
+
* platform requests (`ctx.requestPlatform`). The router — the one hop that sees
|
|
27
|
+
* every response — reads it and kicks an immediate drain of that scope (#381),
|
|
28
|
+
* so provisioning settles in seconds instead of at the sweep. Carries no payload
|
|
29
|
+
* and no privilege: a forged or spurious flag costs the platform one wasted
|
|
30
|
+
* pull, nothing more. Fed by `ScopeStubOptions.onPlatformRequests` (#458).
|
|
31
|
+
*/
|
|
32
|
+
export const PLATFORM_REQUEST_HEADER = 'x-substrat-platform-request';
|
|
33
|
+
/**
|
|
34
|
+
* The RESPONSE header a vertical sets when the operation it just ran committed an event of a
|
|
35
|
+
* type this deployment EXPORTS to other verticals (#1705). The router reads it beside
|
|
36
|
+
* {@link PLATFORM_REQUEST_HEADER} and asks the control plane to run this producer's outgoing
|
|
37
|
+
* edges now, so a consumer in another vertical receives the event in seconds rather than at
|
|
38
|
+
* the next sweep. Like its sibling it carries no payload and no privilege: the control plane
|
|
39
|
+
* takes the tenant and scope from the route the router resolved, never from the response, and a
|
|
40
|
+
* spurious flag costs one pass over that producer's own edges. The router strips every
|
|
41
|
+
* `x-substrat-*` header from an inbound request, so only a response can raise it. Fed by
|
|
42
|
+
* `ScopeStubOptions.onExportedEvents`.
|
|
43
|
+
*/
|
|
44
|
+
export const EXPORTED_EVENTS_HEADER = 'x-substrat-exported-events';
|
|
45
|
+
/**
|
|
46
|
+
* Set on every refusal a live-read door returns, so a client can tell "no push here,
|
|
47
|
+
* poll" from "your request was wrong" without parsing a body or guessing from a status.
|
|
48
|
+
*
|
|
49
|
+
* Here rather than in the hosted adapter because both ends of a refusal need to spell it
|
|
50
|
+
* the same way: the hosted adapter sets it on its own refusals, and a vertical's mount
|
|
51
|
+
* sets it on the pure host's `501` (the ask-don't-assume recipe on `ScopeHost.liveReads`).
|
|
52
|
+
* A dev server should not have to import the Cloudflare adapter to say "poll".
|
|
53
|
+
*/
|
|
54
|
+
export const LIVE_MODE_HEADER = 'x-substrat-live';
|
|
55
|
+
/**
|
|
56
|
+
* The RESPONSE header on `/internal/export` carrying the scope store's load stamp, read in the
|
|
57
|
+
* same call as the dump it rides beside (#1722). A carry's fenced wipe of the copy it leaves
|
|
58
|
+
* behind expects exactly this stamp, so the wipe is refused when anything was loaded into the
|
|
59
|
+
* store since. The stamp itself never travels inside a dump.
|
|
60
|
+
*/
|
|
61
|
+
export const LOAD_STAMP_HEADER = 'x-substrat-load-stamp';
|
|
62
|
+
/**
|
|
63
|
+
* The RESPONSE header on `/internal/export` carrying the scope store's write revision, read in
|
|
64
|
+
* the same call as the dump and the load stamp (#1722). The carry's fenced wipe of the copy it
|
|
65
|
+
* leaves expects it too, so a write that reached the old copy after the export (a request still
|
|
66
|
+
* routed there before the bind) refuses the wipe and the copy is kept for recovery.
|
|
67
|
+
*/
|
|
68
|
+
export const WRITE_REVISION_HEADER = 'x-substrat-write-revision';
|
|
69
|
+
//# sourceMappingURL=wire-headers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-headers.js","sourceRoot":"","sources":["../src/wire-headers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,wCAAwC;AACxC,MAAM,CAAC,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AAE5D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,uBAAuB,CAAC;AAE1E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,6BAA6B,CAAC;AAErE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AAEnE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AASlD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@substrat-run/contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.137.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": {
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
"./invocation-record": {
|
|
21
21
|
"types": "./dist/invocation-record.d.ts",
|
|
22
22
|
"default": "./dist/invocation-record.js"
|
|
23
|
+
},
|
|
24
|
+
"./wire-headers": {
|
|
25
|
+
"types": "./dist/wire-headers.d.ts",
|
|
26
|
+
"default": "./dist/wire-headers.js"
|
|
23
27
|
}
|
|
24
28
|
},
|
|
25
29
|
"files": [
|