@serve.zone/interfaces 32.92.0 → 32.93.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/changelog.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026-11-15 - 32.93.0
4
+
5
+ ### Features
6
+
7
+ - The operator row writer (AGL-1183, Linus rulings 117 §4 criterion 4 and §6, 121 §6 item 7, 123 D1, 166 points 2 and 4, 171): once a gateway is taken over, an administrator changes its tables one row at a time. `requests.gatewayconnector.IReq_Admin_Cloudly_GetGatewayAreaRows` (`getGatewayAreaRows`) reads one area table (revision, digest, and per row its address, compare token `digest`, `owner` and write form with every secret as `keep`, never a value), answered by `data.TGatewayAreaRowsReport`; `requests.gatewayconnector.IReq_Admin_Cloudly_WriteGatewayAreaRow` (`writeGatewayAreaRow`) puts one row or singleton value, or deletes one list row, with compare-and-swap on that digest (`data.TGatewayAreaRowWrite`), answered by `data.TGatewayAreaRowWriteReport`. Both are declared beside `takeOverGateway` and take its caller: a human administrator who signed in within the last five minutes, with neither a delegated admin temp token nor a machine identity, refused otherwise with an error naming the requirement before anything is read (the write judges it again inside its transaction); no delegated admin scope names either. Their report codes are the closed lists `data.gatewayAreaRowsRefusals` (`gateway-not-found`, `gateway-not-taken-over`) and `data.gatewayAreaRowWriteRefusals` (in judging order), all names of `data.gatewayIntentRefusals`, which gains `intent-row-stale` (the row moved since the read) and `kept-secret-unknown` (the written row keeps a secret the row does not hold: fix the row, do not re-read) after `intent-revision-stale`; a reader shows a name it does not know as text, so no reader gate is needed. The write form (`data.IGatewayAreaRowWrites`, nine `…Write` row types) replaces every secret with `data.TGatewaySealedValueWrite` (`keep` a stored version, `set` a value whose version the controller mints with `data.createGatewaySealedVersion`; a request never states a version) or `data.TGatewayVerifierWrite`. The compare token is `data.computeGatewayAreaRowDigest` (`data.createGatewayAreaRowDigestInput`, domain `data.gatewayAreaRowContract.rowDigestDomain`): it takes every sealed member by its version only and a verifier as stored, so a reader who holds every other input cannot test a guess at a sealed value against it. `data.validateGatewayAreaRowWrite` is the one check of a write's envelope and secret forms, which the controller runs before it reads and a client before it signs in; `data.projectGatewayAreaRow` and `data.resolveGatewayAreaRowWrite` project a stored row and resolve a write form, and `data.gatewayAreaSingletonMembers`, `data.isGatewayAreaMember`, `data.isGatewayAreaSingletonMember` and `data.isGatewayAreaRowId` name the row addresses. `data.gatewayAreaSecretPaths` is now the one list of where a table holds a secret: `data.listGatewayAreaSecrets` is computed from it with its output unchanged, and the row helpers walk it. Apart from the two refusal names, no shape an earlier release declared changes. Spec: `test.gatewayarearows` (method pins and no delegated scope, the refusal lists, the write form names every member, the lister against a copy of the hand-written one, the token is equal for two values under one version and moves with the version, the envelope validator, projection and resolution), `test.gatewayareas` (the computed lister equals the hand-written one over the hub fixture), `test.gatewayconnector` (the method and refusal pins).
8
+
3
9
  ## 2026-11-15 - 32.92.0
4
10
 
5
11
  ### Features
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@serve.zone/interfaces',
6
- version: '32.92.0',
6
+ version: '32.93.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLFNBQVM7SUFDbEIsV0FBVyxFQUFFLHVGQUF1RjtDQUNyRyxDQUFBIn0=
@@ -0,0 +1,379 @@
1
+ import type { IGatewayAcmeSettings, IGatewayAreaKeyRow, IGatewayApiTokenRow, IGatewayBlockRuleRow, IGatewayCoreMailCredentialVerifier, IGatewayCoreMailPeerRow, IGatewayDnsClientHostnameRow, IGatewayDnsDomainRow, IGatewayDnsProtectedHostnameRow, IGatewayDnsProviderRow, IGatewayDnsRecordRow, IGatewayDnsServerSettings, IGatewayDnsStaticRecordRow, IGatewayEdgeHubSettings, IGatewayEdgeRow, IGatewayHttp3Settings, IGatewayMailDomainRow, IGatewayMailIdentityRow, IGatewayMailServerSettings, IGatewayNetworkTargetRow, IGatewayRouteRow, IGatewayScramVerifier, IGatewaySmtpAccountRow, IGatewaySourceProfileRow, IGatewayTargetProfileRow, IGatewayTokenHash, TGatewayEngineConfig } from './gatewayareas.js';
2
+ import { type TGatewayConfigArea } from './gatewayconnector.js';
3
+ import { type TSha256Digest } from './immutableimage.js';
4
+ /** A sealed member (`IGatewaySealedValue`) in a row's write form. */
5
+ export type TGatewaySealedValueWrite =
6
+ /**
7
+ * Keep the value the stored row holds at this path under this version: the form a read answers.
8
+ * A version the stored row does not hold there is refused `kept-secret-unknown`: the written row
9
+ * keeps a secret this row does not hold (a new row, a member stored `null`, another row's
10
+ * version), so the row is fixed, not read again; a row another write moved answers
11
+ * `intent-row-stale` first.
12
+ */
13
+ {
14
+ kind: 'keep';
15
+ version: string;
16
+ }
17
+ /** A new value; the controller mints its version. */
18
+ | {
19
+ kind: 'set';
20
+ value: string;
21
+ };
22
+ /** A verifier member in a row's write form; the secret it verifies never travels. */
23
+ export type TGatewayVerifierWrite<TVerifier> =
24
+ /**
25
+ * Keep the verifier the stored row holds at this path: the form a read answers. A row that holds
26
+ * none there (a new row, a member stored `null`) is refused `kept-secret-unknown`.
27
+ */
28
+ {
29
+ kind: 'keep';
30
+ }
31
+ /** A verifier the operator derived (`deriveGatewayScramVerifier`, a token's SHA-256). */
32
+ | {
33
+ kind: 'set';
34
+ verifier: TVerifier;
35
+ };
36
+ /** `IGatewayApiTokenRow` with its verifier as a keep-or-set choice. */
37
+ export interface IGatewayApiTokenRowWrite extends Omit<IGatewayApiTokenRow, 'credential'> {
38
+ credential: TGatewayVerifierWrite<IGatewayTokenHash>;
39
+ }
40
+ /** `IGatewayDnsProviderRow` with its API token as a keep-or-set choice. */
41
+ export interface IGatewayDnsProviderRowWrite extends Omit<IGatewayDnsProviderRow, 'credentials'> {
42
+ credentials: {
43
+ type: 'cloudflare';
44
+ apiToken: TGatewaySealedValueWrite;
45
+ };
46
+ }
47
+ /** `IGatewayRouteSecrets` with every set secret as a keep-or-set choice. */
48
+ export interface IGatewayRouteSecretsWrite {
49
+ tlsKey: TGatewaySealedValueWrite | null;
50
+ basicAuthUsers: TGatewaySealedValueWrite | null;
51
+ jwtSecret: TGatewaySealedValueWrite | null;
52
+ requestHeaders: TGatewaySealedValueWrite | null;
53
+ }
54
+ /** `IGatewayRouteRow` with its secrets as keep-or-set choices. */
55
+ export interface IGatewayRouteRowWrite extends Omit<IGatewayRouteRow, 'secrets'> {
56
+ secrets: IGatewayRouteSecretsWrite;
57
+ }
58
+ /** `IGatewaySourceProfileSecrets` with every set secret as a keep-or-set choice. */
59
+ export interface IGatewaySourceProfileSecretsWrite {
60
+ basicAuthUsers: TGatewaySealedValueWrite | null;
61
+ jwtSecret: TGatewaySealedValueWrite | null;
62
+ }
63
+ /** `IGatewaySourceProfileRow` with its secrets as keep-or-set choices. */
64
+ export interface IGatewaySourceProfileRowWrite extends Omit<IGatewaySourceProfileRow, 'secrets'> {
65
+ secrets: IGatewaySourceProfileSecretsWrite;
66
+ }
67
+ /** `IGatewayMailServerSettings` with its TLS key as a keep-or-set choice. */
68
+ export interface IGatewayMailServerSettingsWrite extends Omit<IGatewayMailServerSettings, 'tlsKey'> {
69
+ tlsKey: TGatewaySealedValueWrite | null;
70
+ }
71
+ /** `IGatewaySmtpAccountRow` with its verifier as a keep-or-set choice. */
72
+ export interface IGatewaySmtpAccountRowWrite extends Omit<IGatewaySmtpAccountRow, 'credential'> {
73
+ credential: TGatewayVerifierWrite<IGatewayScramVerifier>;
74
+ }
75
+ /** `IGatewayMailIdentityRow` with its verifier as a keep-or-set choice. */
76
+ export interface IGatewayMailIdentityRowWrite extends Omit<IGatewayMailIdentityRow, 'credential'> {
77
+ credential: TGatewayVerifierWrite<IGatewayScramVerifier>;
78
+ }
79
+ /** `IGatewayCoreMailPeerRow` with its verifier list as one keep-or-set choice. */
80
+ export interface IGatewayCoreMailPeerRowWrite extends Omit<IGatewayCoreMailPeerRow, 'credentials'> {
81
+ credentials: TGatewayVerifierWrite<IGatewayCoreMailCredentialVerifier[]>;
82
+ }
83
+ /** `IGatewayEdgeRow` with its tunnel secret as a keep-or-set choice. */
84
+ export interface IGatewayEdgeRowWrite extends Omit<IGatewayEdgeRow, 'secret'> {
85
+ secret: TGatewaySealedValueWrite;
86
+ }
87
+ /**
88
+ * The write form of one row of every member, by area and member: a list member's row, or a
89
+ * singleton's value. A member without secrets writes its table type unchanged.
90
+ */
91
+ export interface IGatewayAreaRowWrites {
92
+ security: {
93
+ blockRules: IGatewayBlockRuleRow;
94
+ apiTokens: IGatewayApiTokenRowWrite;
95
+ proxyPolicy: TGatewayEngineConfig | null;
96
+ };
97
+ dns: {
98
+ server: IGatewayDnsServerSettings | null;
99
+ nameservers: IGatewayAreaKeyRow;
100
+ acme: IGatewayAcmeSettings | null;
101
+ providers: IGatewayDnsProviderRowWrite;
102
+ domains: IGatewayDnsDomainRow;
103
+ records: IGatewayDnsRecordRow;
104
+ staticRecords: IGatewayDnsStaticRecordRow;
105
+ protectedHostnames: IGatewayDnsProtectedHostnameRow;
106
+ authorityZones: IGatewayAreaKeyRow;
107
+ clientHostnames: IGatewayDnsClientHostnameRow;
108
+ };
109
+ routes: {
110
+ routes: IGatewayRouteRowWrite;
111
+ sourceProfiles: IGatewaySourceProfileRowWrite;
112
+ networkTargets: IGatewayNetworkTargetRow;
113
+ targetProfiles: IGatewayTargetProfileRow;
114
+ disabledSystemRoutes: IGatewayAreaKeyRow;
115
+ http3: IGatewayHttp3Settings | null;
116
+ };
117
+ mail: {
118
+ server: IGatewayMailServerSettingsWrite;
119
+ domains: IGatewayMailDomainRow;
120
+ smtpAccounts: IGatewaySmtpAccountRowWrite;
121
+ identities: IGatewayMailIdentityRowWrite;
122
+ coreMailPeers: IGatewayCoreMailPeerRowWrite;
123
+ };
124
+ edges: {
125
+ hub: IGatewayEdgeHubSettings;
126
+ edges: IGatewayEdgeRowWrite;
127
+ };
128
+ }
129
+ /** The member names of an area (those of `IGatewayAreaContents`, which `test.gatewayarearows` pins). */
130
+ export type TGatewayAreaMember<TArea extends TGatewayConfigArea = TGatewayConfigArea> = TArea extends TGatewayConfigArea ? keyof IGatewayAreaRowWrites[TArea] & string : never;
131
+ /**
132
+ * The members of each area that hold one value rather than rows (an object or `null`, never a list),
133
+ * addressed with `id: null`: the singletons of `gatewayAreaMembers`.
134
+ */
135
+ export declare const gatewayAreaSingletonMembers: Readonly<{
136
+ readonly security: readonly ["proxyPolicy"];
137
+ readonly dns: readonly ["server", "acme"];
138
+ readonly routes: readonly ["http3"];
139
+ readonly mail: readonly ["server"];
140
+ readonly edges: readonly ["hub"];
141
+ }>;
142
+ /** A singleton member of an area. */
143
+ export type TGatewayAreaSingletonMember<TArea extends TGatewayConfigArea = TGatewayConfigArea> = TArea extends TGatewayConfigArea ? typeof gatewayAreaSingletonMembers[TArea][number] : never;
144
+ /** A list member of an area: its rows carry an `id`. */
145
+ export type TGatewayAreaListMember<TArea extends TGatewayConfigArea = TGatewayConfigArea> = TArea extends TGatewayConfigArea ? Exclude<TGatewayAreaMember<TArea>, TGatewayAreaSingletonMember<TArea>> : never;
146
+ /** Whether `memberArg` is a member of the area (`gatewayAreaMembers`). */
147
+ export declare const isGatewayAreaMember: <TArea extends TGatewayConfigArea>(areaArg: TArea, memberArg: unknown) => memberArg is TGatewayAreaMember<TArea>;
148
+ /** Whether a member of the area is a singleton, addressed with `id: null`. */
149
+ export declare const isGatewayAreaSingletonMember: (areaArg: TGatewayConfigArea, memberArg: string) => boolean;
150
+ /**
151
+ * The gateway intent refusals a row read answers in its report: the controller records no such
152
+ * gateway, or did not take it over. A caller who is not a fresh human administrator is refused
153
+ * before this (a `TypedResponseError` naming the requirement), and an area or member the contract
154
+ * does not name is the thrown connector refusal `request-invalid`; neither is a report.
155
+ */
156
+ export declare const gatewayAreaRowsRefusals: readonly ["gateway-not-found", "gateway-not-taken-over"];
157
+ /** A refusal a row read answers. */
158
+ export type TGatewayAreaRowsRefusal = typeof gatewayAreaRowsRefusals[number];
159
+ /**
160
+ * The gateway intent refusals a row write answers in its report, in the order the controller judges
161
+ * them: the gateway (`gateway-not-found`, `gateway-not-taken-over`); `row-compile-owned` (the stored
162
+ * row is a claim of the controller's records, or the put row names the controller's own gateway
163
+ * client, whose rows only the compile writes); then a write whose outcome the table already states
164
+ * answers `ok` with `revision: null`; `intent-row-stale` (the row is not the one `expectedDigest`
165
+ * names); `kept-secret-unknown`; `area-table-invalid` (the resolved table, the whole document or the
166
+ * change rule `validateGatewayAreaContentChange`); `controller-origin-unserved` and
167
+ * `lifeline-unjudged` (a routes write); `gateway-vocabulary-newer`; `intent-revision-stale` (the
168
+ * tables kept moving through the controller's attempts). A caller who is not a fresh human
169
+ * administrator and a write `validateGatewayAreaRowWrite` refuses are refused before any of them,
170
+ * and neither is a report.
171
+ */
172
+ export declare const gatewayAreaRowWriteRefusals: readonly ["gateway-not-found", "gateway-not-taken-over", "row-compile-owned", "intent-row-stale", "kept-secret-unknown", "area-table-invalid", "controller-origin-unserved", "lifeline-unjudged", "gateway-vocabulary-newer", "intent-revision-stale"];
173
+ /** A refusal a row write answers. */
174
+ export type TGatewayAreaRowWriteRefusal = typeof gatewayAreaRowWriteRefusals[number];
175
+ /** The constants of the row read and write. */
176
+ export declare const gatewayAreaRowContract: Readonly<{
177
+ /** The digest domain of `computeGatewayAreaRowDigest`. */
178
+ rowDigestDomain: "serve.zone/gateway-area-row";
179
+ }>;
180
+ /**
181
+ * The canonical JSON a row's compare token hashes (Linus ruling 171 D2): the digest domain, the
182
+ * row's address and the stored row (or singleton value) with every sealed member as its version
183
+ * only (`{ version }`), never its value; a verifier enters as stored and a `null` member as `null`.
184
+ * A version names exactly one value (a writer mints a new one for every new value), so the token
185
+ * moves with every change of the row, a secret's included, while a reader who holds every other
186
+ * input (the read answers the row and the versions) cannot test a guess at a sealed value against
187
+ * it. Throws, naming no value, for an unknown area or member, an `id` that is not `null` exactly
188
+ * for a singleton, and a row that is not strict JSON or lacks a sealed member or its version, which
189
+ * a valid table never holds.
190
+ */
191
+ export declare const createGatewayAreaRowDigestInput: (inputArg: {
192
+ area: TGatewayConfigArea;
193
+ member: string;
194
+ id: string | null;
195
+ row: unknown;
196
+ }) => string;
197
+ /**
198
+ * A row's compare token: `sha256:<hex>` of `createGatewayAreaRowDigestInput`, through Web Crypto.
199
+ * The controller answers it for every row a read answers and for the row a write leaves, and judges
200
+ * a write's `expectedDigest` against it. A reader compares it for equality only.
201
+ */
202
+ export declare const computeGatewayAreaRowDigest: (inputArg: {
203
+ area: TGatewayConfigArea;
204
+ member: string;
205
+ id: string | null;
206
+ row: unknown;
207
+ }) => Promise<TSha256Digest>;
208
+ /**
209
+ * Who a row is the author of: `compile` for a row the controller's own records compile (its claim;
210
+ * an operator write refuses it `row-compile-owned`), `operator` for every other row.
211
+ */
212
+ export type TGatewayAreaRowOwner = 'operator' | 'compile';
213
+ /** One row of a table as an administrator reads it: its address, compare token, author and write form. */
214
+ export type TGatewayAreaRowRead<TArea extends TGatewayConfigArea = TGatewayConfigArea> = TArea extends TGatewayConfigArea ? {
215
+ [TMember in TGatewayAreaMember<TArea>]: {
216
+ member: TMember;
217
+ /** The row's `id`; `null` for a singleton. */
218
+ id: TMember extends TGatewayAreaSingletonMember<TArea> ? null : string;
219
+ /**
220
+ * The compare token a write of this row names (`expectedDigest`): `computeGatewayAreaRowDigest`
221
+ * of the stored row, which takes every sealed member by its version only. A reader compares it
222
+ * for equality only.
223
+ */
224
+ digest: TSha256Digest;
225
+ owner: TGatewayAreaRowOwner;
226
+ /** The write form, every secret as `keep`: a sealed member with its version, never its value. */
227
+ row: IGatewayAreaRowWrites[TArea][TMember];
228
+ };
229
+ }[TGatewayAreaMember<TArea>] : never;
230
+ /** One area table of a taken-over gateway as an administrator reads it: revision, digest and rows. */
231
+ export interface IGatewayAreaRowsRead {
232
+ gatewayId: string;
233
+ area: TGatewayConfigArea;
234
+ /** The controller revision that wrote the table last. */
235
+ revision: number;
236
+ /** `computeGatewayAreaTableDigest` of the table: what the gateway reports applied once it applied it. */
237
+ tableDigest: TSha256Digest;
238
+ /**
239
+ * The rows of the member asked for (every member when none was): members ascending by
240
+ * `compareWireTokens`, each member's rows in the table's order (ascending by id).
241
+ */
242
+ rows: TGatewayAreaRowRead[];
243
+ }
244
+ /** A table read's answer: the table, or why there is none. No secret value. */
245
+ export type TGatewayAreaRowsReport = {
246
+ ok: true;
247
+ table: IGatewayAreaRowsRead;
248
+ } | {
249
+ ok: false;
250
+ code: TGatewayAreaRowsRefusal;
251
+ };
252
+ /**
253
+ * Put one row: create or replace a list row (its `row.id` is `id`), or replace a singleton's value
254
+ * (`id: null`; `row: null` for a nullable singleton). `expectedDigest` is the row's `digest` as the
255
+ * administrator read it, or `null` for a list row that must be absent.
256
+ */
257
+ export type TGatewayAreaRowPut = {
258
+ [TArea in TGatewayConfigArea]: {
259
+ [TMember in TGatewayAreaMember<TArea>]: {
260
+ operation: 'put';
261
+ area: TArea;
262
+ member: TMember;
263
+ id: TMember extends TGatewayAreaSingletonMember<TArea> ? null : string;
264
+ expectedDigest: TSha256Digest | null;
265
+ row: IGatewayAreaRowWrites[TArea][TMember];
266
+ };
267
+ }[TGatewayAreaMember<TArea>];
268
+ }[TGatewayConfigArea];
269
+ /** Delete one list row; `expectedDigest` is its `digest` as the administrator read it. A singleton is never deleted. */
270
+ export type TGatewayAreaRowDelete = {
271
+ [TArea in TGatewayConfigArea]: {
272
+ operation: 'delete';
273
+ area: TArea;
274
+ member: TGatewayAreaListMember<TArea>;
275
+ id: string;
276
+ expectedDigest: TSha256Digest;
277
+ };
278
+ }[TGatewayConfigArea];
279
+ /** One row-level compare-and-swap write. */
280
+ export type TGatewayAreaRowWrite = TGatewayAreaRowPut | TGatewayAreaRowDelete;
281
+ /** A sealed version a put minted, by the secret's path inside the row. */
282
+ export interface IGatewayAreaRowMintedVersion {
283
+ path: string;
284
+ version: string;
285
+ }
286
+ /** What a row write changed. */
287
+ export interface IGatewayAreaRowWritten {
288
+ gatewayId: string;
289
+ area: TGatewayConfigArea;
290
+ member: string;
291
+ id: string | null;
292
+ operation: 'put' | 'delete';
293
+ /**
294
+ * The controller revision the write appended; `null` when the table already stated what the
295
+ * write asked (the put row equals the stored one, or the deleted row is absent) and nothing was
296
+ * written.
297
+ */
298
+ revision: number | null;
299
+ /** The row's compare token now; `null` after a delete. */
300
+ digest: TSha256Digest | null;
301
+ /** The table's digest now: what the gateway reports applied once it applied the write. */
302
+ tableDigest: TSha256Digest;
303
+ /** Every sealed version this put minted, ascending by path; never a value. */
304
+ mintedVersions: IGatewayAreaRowMintedVersion[];
305
+ }
306
+ /**
307
+ * A row write's answer: what it changed, or the refusal that left every table as it was, with the
308
+ * validator lines that name why (area, member, row id, path and code; never a value).
309
+ */
310
+ export type TGatewayAreaRowWriteReport = {
311
+ ok: true;
312
+ written: IGatewayAreaRowWritten;
313
+ } | {
314
+ ok: false;
315
+ code: TGatewayAreaRowWriteRefusal;
316
+ problems: string[];
317
+ };
318
+ /**
319
+ * The one check of a row write's envelope (Linus ruling 171 section 4), which the controller runs
320
+ * before it reads anything and a client runs before it signs in: exact keys per operation, a
321
+ * configuration area and one of its members, `id` `null` exactly for a singleton (which is never
322
+ * deleted) and a row id (`isGatewayAreaRowId`) for a list member, a `sha256:` `expectedDigest`
323
+ * (`null` only for a put), and for a put a strict JSON row whose `id` is the address's (a list
324
+ * member) and whose every secret member (`gatewayAreaSecretPaths`) is `null` or one of its
325
+ * keep-or-set forms. The controller answers any problem as the thrown connector refusal
326
+ * `request-invalid`. The row's other members are the area validator's, judged with its table once
327
+ * the write is resolved. Problems name keys and paths, never a value.
328
+ */
329
+ export declare const validateGatewayAreaRowWrite: (valueArg: unknown, pathArg?: string) => string[];
330
+ /**
331
+ * A stored row (or singleton value) of a valid table in its write form, every secret as `keep`: a
332
+ * sealed member as its version, a verifier as `{ kind: 'keep' }`, a `null` member as `null`. Throws
333
+ * for a row that is not strict JSON or lacks a secret member's parent, which a valid table never
334
+ * holds.
335
+ */
336
+ export declare const projectGatewayAreaRow: <TArea extends TGatewayConfigArea, TMember extends TGatewayAreaMember<TArea>>(areaArg: TArea, memberArg: TMember, storedArg: unknown) => IGatewayAreaRowWrites[TArea][TMember];
337
+ /**
338
+ * Why a row's write form cannot be resolved, by the secret's path: `invalid-write-form` for a
339
+ * secret member that is not one of its keep-or-set forms (a write `validateGatewayAreaRowWrite`
340
+ * refuses), or `kept-secret-unknown` for a `keep` the stored row does not hold there. Never a value.
341
+ */
342
+ export interface IGatewayAreaRowWriteFormRefusal {
343
+ /** The secret's dotted path inside the row; `''` for the row as a whole. */
344
+ path: string;
345
+ code: 'invalid-write-form' | 'kept-secret-unknown';
346
+ }
347
+ /** A resolved write: the row in its stored form, and every version minted for it. */
348
+ export type TGatewayAreaRowResolution = {
349
+ ok: true;
350
+ row: unknown;
351
+ mintedVersions: IGatewayAreaRowMintedVersion[];
352
+ } | {
353
+ ok: false;
354
+ refusals: IGatewayAreaRowWriteFormRefusal[];
355
+ };
356
+ /**
357
+ * Resolves a row's write form against the row stored at the same address (`null` when there is
358
+ * none) into its stored form: a sealed `keep` becomes the stored `{ version, value }` at that path
359
+ * when the stored row holds that version there, a verifier `keep` the stored verifier when the row
360
+ * holds one; a sealed `set` becomes `{ version: mintVersionArg(), value }`, a verifier `set` the
361
+ * stated verifier; `null` stays `null`. Every other member is copied as written; the area validator
362
+ * judges the resolved row as part of its table. Judges the forms with the rule
363
+ * `validateGatewayAreaRowWrite` applies and never reads a value into a refusal. The minted
364
+ * versions are answered ascending by path. `mintVersionArg` is the writer's
365
+ * (`createGatewaySealedVersion`).
366
+ */
367
+ export declare const resolveGatewayAreaRowWrite: (inputArg: {
368
+ area: TGatewayConfigArea;
369
+ member: string;
370
+ written: unknown;
371
+ stored: unknown | null;
372
+ mintVersion: () => string;
373
+ }) => TGatewayAreaRowResolution;
374
+ /**
375
+ * A new sealed version: 22 base64url characters of 128 random bits (`IGatewaySealedValue.version`),
376
+ * drawn with Web Crypto. The writer that sets a secret mints one for every new value (Linus ruling
377
+ * 121 Q9); a version is never reused for another value.
378
+ */
379
+ export declare const createGatewaySealedVersion: () => string;