@substrat-run/contracts 0.147.0 → 0.149.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/assistant-stream.d.ts +311 -0
- package/dist/assistant-stream.d.ts.map +1 -0
- package/dist/assistant-stream.js +360 -0
- package/dist/assistant-stream.js.map +1 -0
- package/dist/attachments.d.ts +184 -1
- package/dist/attachments.d.ts.map +1 -1
- package/dist/attachments.js +146 -2
- package/dist/attachments.js.map +1 -1
- package/dist/connections.d.ts +5 -6
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +11 -2
- package/dist/connections.js.map +1 -1
- package/dist/control-plane.d.ts +92 -3
- package/dist/control-plane.d.ts.map +1 -1
- package/dist/control-plane.js +79 -7
- package/dist/control-plane.js.map +1 -1
- package/dist/deploy.d.ts +165 -32
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +260 -48
- package/dist/deploy.js.map +1 -1
- package/dist/errors.d.ts +1 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +6 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/introspection.d.ts +12 -3
- package/dist/introspection.d.ts.map +1 -1
- package/dist/introspection.js +10 -2
- package/dist/introspection.js.map +1 -1
- package/dist/invocation-record.d.ts +17 -0
- package/dist/invocation-record.d.ts.map +1 -1
- package/dist/invocation-record.js +20 -0
- package/dist/invocation-record.js.map +1 -1
- package/dist/kernel-events.d.ts.map +1 -1
- package/dist/kernel-events.js +4 -1
- package/dist/kernel-events.js.map +1 -1
- package/dist/lake.d.ts +109 -0
- package/dist/lake.d.ts.map +1 -0
- package/dist/lake.js +85 -0
- package/dist/lake.js.map +1 -0
- package/dist/manifest.d.ts +4 -0
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +5 -0
- package/dist/manifest.js.map +1 -1
- package/dist/migration-diff.d.ts +48 -7
- package/dist/migration-diff.d.ts.map +1 -1
- package/dist/migration-diff.js +61 -17
- package/dist/migration-diff.js.map +1 -1
- package/dist/model.d.ts +4 -0
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js.map +1 -1
- package/dist/registry.d.ts +48 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +74 -0
- package/dist/registry.js.map +1 -1
- package/dist/review-text.d.ts +49 -0
- package/dist/review-text.d.ts.map +1 -0
- package/dist/review-text.js +87 -0
- package/dist/review-text.js.map +1 -0
- package/dist/routing.d.ts +1 -1
- package/dist/routing.js +2 -2
- package/dist/routing.js.map +1 -1
- package/dist/scope-store-envelope.d.ts +187 -0
- package/dist/scope-store-envelope.d.ts.map +1 -0
- package/dist/scope-store-envelope.js +438 -0
- package/dist/scope-store-envelope.js.map +1 -0
- package/dist/scope-store-transport.d.ts +1 -1
- package/dist/scope-store-transport.js +2 -2
- package/dist/scope-store-transport.js.map +1 -1
- package/dist/script-names.d.ts +19 -8
- package/dist/script-names.d.ts.map +1 -1
- package/dist/script-names.js +27 -11
- package/dist/script-names.js.map +1 -1
- package/dist/sql-tokens.d.ts +7 -0
- package/dist/sql-tokens.d.ts.map +1 -1
- package/dist/sql-tokens.js +2 -2
- package/dist/sql-tokens.js.map +1 -1
- package/package.json +8 -4
- package/dist/scope-store-mac.d.ts +0 -24
- package/dist/scope-store-mac.d.ts.map +0 -1
- package/dist/scope-store-mac.js +0 -61
- package/dist/scope-store-mac.js.map +0 -1
package/dist/registry.d.ts
CHANGED
|
@@ -287,8 +287,13 @@ export declare const promotionAcknowledgement: z.ZodObject<{
|
|
|
287
287
|
permissionChange: z.ZodOptional<z.ZodBoolean>;
|
|
288
288
|
migrationChange: z.ZodOptional<z.ZodBoolean>;
|
|
289
289
|
exportBreak: z.ZodOptional<z.ZodBoolean>;
|
|
290
|
+
review: z.ZodOptional<z.ZodObject<{
|
|
291
|
+
base: z.ZodNullable<z.ZodString>;
|
|
292
|
+
digest: z.ZodString;
|
|
293
|
+
}, z.core.$strict>>;
|
|
290
294
|
}, z.core.$strip>;
|
|
291
295
|
export type PromotionAcknowledgement = z.infer<typeof promotionAcknowledgement>;
|
|
296
|
+
export type PromotionReviewBinding = NonNullable<PromotionAcknowledgement['review']>;
|
|
292
297
|
/**
|
|
293
298
|
* #1756: what a scope bind may acknowledge. Only `exportBreak` — a bind has no digest
|
|
294
299
|
* checkpoint of its own (those are promotion's), but pointing one install at a version that
|
|
@@ -299,4 +304,47 @@ export declare const bindAcknowledgement: z.ZodObject<{
|
|
|
299
304
|
exportBreak: z.ZodOptional<z.ZodBoolean>;
|
|
300
305
|
}, z.core.$strict>;
|
|
301
306
|
export type BindAcknowledgement = z.infer<typeof bindAcknowledgement>;
|
|
307
|
+
/**
|
|
308
|
+
* #2333: the `reason` on the promote gate's two refusals of a review binding (both
|
|
309
|
+
* `precondition_failed`): `stale`, the binding's base or digest no longer holds, and `unbound`, a
|
|
310
|
+
* migration acknowledgement sent without one. A client answers either by reading the review again.
|
|
311
|
+
*/
|
|
312
|
+
export declare const PROMOTE_REVIEW_REASONS: {
|
|
313
|
+
readonly stale: 'promote_review_stale';
|
|
314
|
+
readonly unbound: 'promote_review_unbound';
|
|
315
|
+
};
|
|
316
|
+
export type PromoteReviewReason = (typeof PROMOTE_REVIEW_REASONS)[keyof typeof PROMOTE_REVIEW_REASONS];
|
|
317
|
+
/**
|
|
318
|
+
* Which review refusal a problem body is, read from its `reason`, or undefined for any other
|
|
319
|
+
* answer. Takes the body as text (a transport's raw body) or already parsed.
|
|
320
|
+
*/
|
|
321
|
+
export declare function promoteReviewReasonIn(body: unknown): PromoteReviewReason | undefined;
|
|
322
|
+
/**
|
|
323
|
+
* #2347: what a scope rebind across lineages may acknowledge. `exportBreak` as a bind, and
|
|
324
|
+
* `review`: the rebind review its `ackMigrations` answers (`GET …/scopes/:id/rebind-review`),
|
|
325
|
+
* computed from the target lineage's serving version over the scope's bound version. Same shape
|
|
326
|
+
* and same rule as a promote's: the host refuses a binding whose base is no longer the scope's
|
|
327
|
+
* bound version, or whose digest the stored rows of both sides no longer give
|
|
328
|
+
* (`rebind_review_stale`), and an `ackMigrations` sent without one where the digests differ
|
|
329
|
+
* (`rebind_review_unbound`).
|
|
330
|
+
*/
|
|
331
|
+
export declare const rebindAcknowledgement: z.ZodObject<{
|
|
332
|
+
exportBreak: z.ZodOptional<z.ZodBoolean>;
|
|
333
|
+
review: z.ZodOptional<z.ZodObject<{
|
|
334
|
+
base: z.ZodNullable<z.ZodString>;
|
|
335
|
+
digest: z.ZodString;
|
|
336
|
+
}, z.core.$strict>>;
|
|
337
|
+
}, z.core.$strict>;
|
|
338
|
+
export type RebindAcknowledgement = z.infer<typeof rebindAcknowledgement>;
|
|
339
|
+
/**
|
|
340
|
+
* #2347: the `reason` on a rebind's two refusals of its review binding (both
|
|
341
|
+
* `precondition_failed`), named apart from the promote's so a client knows which review to read again.
|
|
342
|
+
*/
|
|
343
|
+
export declare const REBIND_REVIEW_REASONS: {
|
|
344
|
+
readonly stale: 'rebind_review_stale';
|
|
345
|
+
readonly unbound: 'rebind_review_unbound';
|
|
346
|
+
};
|
|
347
|
+
export type RebindReviewReason = (typeof REBIND_REVIEW_REASONS)[keyof typeof REBIND_REVIEW_REASONS];
|
|
348
|
+
/** Which rebind review refusal a problem body is, as `promoteReviewReasonIn` reads a promote's. */
|
|
349
|
+
export declare function rebindReviewReasonIn(body: unknown): RebindReviewReason | undefined;
|
|
302
350
|
//# sourceMappingURL=registry.d.ts.map
|
package/dist/registry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;;;;;;GAUG;AAEH,yFAAyF;AACzF,eAAO,MAAM,cAAc;;;;EAAoC,CAAC;AAChE,MAAM,MAAM,cAAc,GAAG,CAA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AsB,GAAG,WAAW,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAErF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;kBAAgE,CAAC;AACjG,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;aACjC,KAAK,EAAE,sBAAsB;aAC7B,OAAO,EAAE,wBAAwB;CACzB,CAAC;AACX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,OAAO,sBAAsB,CAAC,CAAC;AAEvG;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,mBAAmB,GAAG,SAAS,CAEpF;AAgBD;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB;;;;;;kBAA8E,CAAC;AACjH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,qBAAqB;aAChC,KAAK,EAAE,qBAAqB;aAC5B,OAAO,EAAE,uBAAuB;CACxB,CAAC;AACX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AAEpG,mGAAmG;AACnG,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS,CAElF"}
|
package/dist/registry.js
CHANGED
|
@@ -350,6 +350,28 @@ export const promotionAcknowledgement = z.object({
|
|
|
350
350
|
* also trips: this one is about OTHER apps' deployed code, and the refusal lists them.
|
|
351
351
|
*/
|
|
352
352
|
exportBreak: z.boolean().optional(),
|
|
353
|
+
/**
|
|
354
|
+
* #2333: the review these acknowledgements were given against. A promote review is computed
|
|
355
|
+
* from the version being promoted over the channel's CURRENT version, and a concurrent promote
|
|
356
|
+
* between showing it and acknowledging it changes that base — so a bare flag would acknowledge
|
|
357
|
+
* a diff that is no longer the one applied. The binding names what was shown, as the
|
|
358
|
+
* migrations read answered it (`/versions/:id/migrations?base=` → `review`): the base version
|
|
359
|
+
* (null for a first promote) and the digest of the stored rows that review was computed from.
|
|
360
|
+
*
|
|
361
|
+
* The host recomputes the digest from its own stored rows and refuses (`precondition_failed`,
|
|
362
|
+
* reason `promote_review_stale`) when the channel no longer points at `base` or the digest
|
|
363
|
+
* differs. The sent digest is only ever compared, never read as the diff. A consumed
|
|
364
|
+
* `migrationChange` without a binding is refused too (`promote_review_unbound`); a
|
|
365
|
+
* permission-only acknowledgement without one is still honoured, so an older client keeps
|
|
366
|
+
* promoting wherever no migration — and so no declared data loss — is involved.
|
|
367
|
+
*/
|
|
368
|
+
review: z
|
|
369
|
+
.object({
|
|
370
|
+
base: z.string().min(1).nullable(),
|
|
371
|
+
digest: z.string().regex(/^[0-9a-f]{64}$/),
|
|
372
|
+
})
|
|
373
|
+
.strict()
|
|
374
|
+
.optional(),
|
|
353
375
|
});
|
|
354
376
|
/**
|
|
355
377
|
* #1756: what a scope bind may acknowledge. Only `exportBreak` — a bind has no digest
|
|
@@ -358,4 +380,56 @@ export const promotionAcknowledgement = z.object({
|
|
|
358
380
|
* Strict, so a caller that sends `permissionChange` here learns it means nothing on a bind.
|
|
359
381
|
*/
|
|
360
382
|
export const bindAcknowledgement = promotionAcknowledgement.pick({ exportBreak: true }).strict();
|
|
383
|
+
/**
|
|
384
|
+
* #2333: the `reason` on the promote gate's two refusals of a review binding (both
|
|
385
|
+
* `precondition_failed`): `stale`, the binding's base or digest no longer holds, and `unbound`, a
|
|
386
|
+
* migration acknowledgement sent without one. A client answers either by reading the review again.
|
|
387
|
+
*/
|
|
388
|
+
export const PROMOTE_REVIEW_REASONS = {
|
|
389
|
+
stale: 'promote_review_stale',
|
|
390
|
+
unbound: 'promote_review_unbound',
|
|
391
|
+
};
|
|
392
|
+
/**
|
|
393
|
+
* Which review refusal a problem body is, read from its `reason`, or undefined for any other
|
|
394
|
+
* answer. Takes the body as text (a transport's raw body) or already parsed.
|
|
395
|
+
*/
|
|
396
|
+
export function promoteReviewReasonIn(body) {
|
|
397
|
+
return reasonIn(body, PROMOTE_REVIEW_REASONS);
|
|
398
|
+
}
|
|
399
|
+
/** A problem body's `reason`, when it is one of `reasons`. Text (a transport's raw body) or parsed. */
|
|
400
|
+
function reasonIn(body, reasons) {
|
|
401
|
+
let parsed = body;
|
|
402
|
+
if (typeof body === 'string') {
|
|
403
|
+
try {
|
|
404
|
+
parsed = JSON.parse(body);
|
|
405
|
+
}
|
|
406
|
+
catch {
|
|
407
|
+
return undefined;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
const reason = parsed?.reason;
|
|
411
|
+
return reason === reasons.stale || reason === reasons.unbound ? reason : undefined;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* #2347: what a scope rebind across lineages may acknowledge. `exportBreak` as a bind, and
|
|
415
|
+
* `review`: the rebind review its `ackMigrations` answers (`GET …/scopes/:id/rebind-review`),
|
|
416
|
+
* computed from the target lineage's serving version over the scope's bound version. Same shape
|
|
417
|
+
* and same rule as a promote's: the host refuses a binding whose base is no longer the scope's
|
|
418
|
+
* bound version, or whose digest the stored rows of both sides no longer give
|
|
419
|
+
* (`rebind_review_stale`), and an `ackMigrations` sent without one where the digests differ
|
|
420
|
+
* (`rebind_review_unbound`).
|
|
421
|
+
*/
|
|
422
|
+
export const rebindAcknowledgement = promotionAcknowledgement.pick({ exportBreak: true, review: true }).strict();
|
|
423
|
+
/**
|
|
424
|
+
* #2347: the `reason` on a rebind's two refusals of its review binding (both
|
|
425
|
+
* `precondition_failed`), named apart from the promote's so a client knows which review to read again.
|
|
426
|
+
*/
|
|
427
|
+
export const REBIND_REVIEW_REASONS = {
|
|
428
|
+
stale: 'rebind_review_stale',
|
|
429
|
+
unbound: 'rebind_review_unbound',
|
|
430
|
+
};
|
|
431
|
+
/** Which rebind review refusal a problem body is, as `promoteReviewReasonIn` reads a promote's. */
|
|
432
|
+
export function rebindReviewReasonIn(body) {
|
|
433
|
+
return reasonIn(body, REBIND_REVIEW_REASONS);
|
|
434
|
+
}
|
|
361
435
|
//# sourceMappingURL=registry.js.map
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAEnF;;;;;;;;;;GAUG;AAEH,yFAAyF;AACzF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAGhE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE,YAAY,EAAE,iFAAiF;IACrG,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,MAAM,EAAE,cAAc;IACtB;;;;;OAKG;IACH,WAAW,EAAE,QAAQ,CAAC,QAAQ,EAAE;IAChC;;;;;;OAMG;IACH,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;IACvC;;;;;;OAMG;IACH,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC5C,WAAW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Aa,EAAE,OAAiD;IAClG,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAI,MAAsC,EAAE,MAAM,CAAC;IAC/D,OAAO,MAAM,KAAK,OAAO,CAAC,KAAK,IAAI,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAAE,MAAY,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5F,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAGjH;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK,EAAE,qBAAqB;IAC5B,OAAO,EAAE,uBAAuB;CACxB,CAAC;AAGX,mGAAmG;AACnG,MAAM,UAAU,oBAAoB,CAAC,IAAa;IAChD,OAAO,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text a vertical's author wrote, as a person reviewing it is shown it (#2322): a discard's
|
|
3
|
+
* reason, a declared table or column, a migration's id and its SQL. The promote review shows it
|
|
4
|
+
* in a terminal (`substrat promote`), the dashboard and the console, and in each the author's
|
|
5
|
+
* text must read as what is stored, no more and no less.
|
|
6
|
+
*
|
|
7
|
+
* Shared by every surface, so one rule decides what a reviewer sees, and by the push boundary
|
|
8
|
+
* and the kernel's data-loss fence, so a reason they accept is one a review can show.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Author-written text with every invisible or acting character replaced by a visible
|
|
12
|
+
* `<U+XXXX>`, so it cannot reorder, hide or forge what a reviewer reads, nor drive a terminal.
|
|
13
|
+
* Newlines and tabs are kept. Everything else is verbatim; each surface still escapes for its
|
|
14
|
+
* own medium (React's text node, the CLI's quoting).
|
|
15
|
+
*/
|
|
16
|
+
export declare function reviewText(text: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Author-written text for a position that is ONE line — an id, a table or column name — where a
|
|
19
|
+
* kept newline or tab would forge another line: {@link reviewText}, with those made visible too.
|
|
20
|
+
*/
|
|
21
|
+
export declare function reviewLine(text: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* A migration's SQL as a review shows it: {@link reviewText} after a CRLF line ending is read as
|
|
24
|
+
* the line break it is, so SQL saved with Windows line endings does not end every line with a
|
|
25
|
+
* mark. A lone CR still shows, since it returns to the line's start without breaking it.
|
|
26
|
+
*/
|
|
27
|
+
export declare function reviewSql(sql: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Whether a reason says nothing a reviewer could read: empty once whitespace and every
|
|
30
|
+
* invisible character are removed. The push boundary (`declaredMigration`) and the kernel's
|
|
31
|
+
* data-loss fence both refuse a discard whose reason is blank by this one rule.
|
|
32
|
+
*/
|
|
33
|
+
export declare function blankReason(text: string): boolean;
|
|
34
|
+
/** How much of a discard's reason a review shows before it asks to be expanded: characters… */
|
|
35
|
+
export declare const REVIEW_TEXT_SHOWN_MAX = 280;
|
|
36
|
+
/** …and lines, whichever comes first, so a reason of many short lines is bounded in height too. */
|
|
37
|
+
export declare const REVIEW_TEXT_SHOWN_LINES = 6;
|
|
38
|
+
/**
|
|
39
|
+
* A reason as a review first shows it: {@link reviewText}, cut at
|
|
40
|
+
* {@link REVIEW_TEXT_SHOWN_MAX} characters (never inside a surrogate pair) or
|
|
41
|
+
* {@link REVIEW_TEXT_SHOWN_LINES} lines, whichever comes first, with `clipped` set, so a long
|
|
42
|
+
* reason cannot push the rest of the review out of sight. The full text is shown on request.
|
|
43
|
+
*/
|
|
44
|
+
export declare function clipReviewText(text: string): {
|
|
45
|
+
full: string;
|
|
46
|
+
shown: string;
|
|
47
|
+
clipped: boolean;
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=review-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-text.d.ts","sourceRoot":"","sources":["../src/review-text.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAyBH;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,+FAA+F;AAC/F,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,mGAAmG;AACnG,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAa9F"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text a vertical's author wrote, as a person reviewing it is shown it (#2322): a discard's
|
|
3
|
+
* reason, a declared table or column, a migration's id and its SQL. The promote review shows it
|
|
4
|
+
* in a terminal (`substrat promote`), the dashboard and the console, and in each the author's
|
|
5
|
+
* text must read as what is stored, no more and no less.
|
|
6
|
+
*
|
|
7
|
+
* Shared by every surface, so one rule decides what a reviewer sees, and by the push boundary
|
|
8
|
+
* and the kernel's data-loss fence, so a reason they accept is one a review can show.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Every character a reviewer cannot see, or that acts instead of printing:
|
|
12
|
+
* - `\p{Cc}`: the C0 controls (ESC, CR, BEL, backspace…), DEL and the C1 controls (U+0080–U+009F,
|
|
13
|
+
* CSI U+009B among them), which a terminal may act on;
|
|
14
|
+
* - `\p{Cf}`: the format characters — the bidirectional embeddings, overrides, isolates and marks
|
|
15
|
+
* (U+202A–U+202E, U+2066–U+2069, U+200E, U+200F, U+061C), which reorder what is read, and the
|
|
16
|
+
* zero-width ones (U+200B–U+200D, U+2060, U+FEFF, the soft hyphen…), which hide;
|
|
17
|
+
* - U+2028 and U+2029, the line and paragraph separators, which break a line without being one;
|
|
18
|
+
* - the letters that render as nothing: the Hangul fillers (U+115F, U+1160, U+3164, U+FFA0), the
|
|
19
|
+
* Khmer inherent vowels (U+17B4, U+17B5) and the blank Braille pattern (U+2800), which are not
|
|
20
|
+
* format characters but read exactly like one.
|
|
21
|
+
*/
|
|
22
|
+
const INVISIBLE = /[\p{Cc}\p{Cf}\u2028\u2029\u115F\u1160\u17B4\u17B5\u2800\u3164\uFFA0]/gu;
|
|
23
|
+
/**
|
|
24
|
+
* The two layout characters kept as they are: a newline (the CLI prints SQL line by line and a
|
|
25
|
+
* quoted reason escapes it; the web shows it as a line break, bounded by {@link clipReviewText})
|
|
26
|
+
* and a tab, which only moves to the next column.
|
|
27
|
+
*/
|
|
28
|
+
const LAYOUT = new Set(['\n', '\t']);
|
|
29
|
+
const codePoint = (c) => `<U+${c.codePointAt(0).toString(16).toUpperCase().padStart(4, '0')}>`;
|
|
30
|
+
/**
|
|
31
|
+
* Author-written text with every invisible or acting character replaced by a visible
|
|
32
|
+
* `<U+XXXX>`, so it cannot reorder, hide or forge what a reviewer reads, nor drive a terminal.
|
|
33
|
+
* Newlines and tabs are kept. Everything else is verbatim; each surface still escapes for its
|
|
34
|
+
* own medium (React's text node, the CLI's quoting).
|
|
35
|
+
*/
|
|
36
|
+
export function reviewText(text) {
|
|
37
|
+
return text.replace(INVISIBLE, (c) => (LAYOUT.has(c) ? c : codePoint(c)));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Author-written text for a position that is ONE line — an id, a table or column name — where a
|
|
41
|
+
* kept newline or tab would forge another line: {@link reviewText}, with those made visible too.
|
|
42
|
+
*/
|
|
43
|
+
export function reviewLine(text) {
|
|
44
|
+
return text.replace(INVISIBLE, codePoint);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A migration's SQL as a review shows it: {@link reviewText} after a CRLF line ending is read as
|
|
48
|
+
* the line break it is, so SQL saved with Windows line endings does not end every line with a
|
|
49
|
+
* mark. A lone CR still shows, since it returns to the line's start without breaking it.
|
|
50
|
+
*/
|
|
51
|
+
export function reviewSql(sql) {
|
|
52
|
+
return reviewText(sql.replace(/\r\n/g, '\n'));
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Whether a reason says nothing a reviewer could read: empty once whitespace and every
|
|
56
|
+
* invisible character are removed. The push boundary (`declaredMigration`) and the kernel's
|
|
57
|
+
* data-loss fence both refuse a discard whose reason is blank by this one rule.
|
|
58
|
+
*/
|
|
59
|
+
export function blankReason(text) {
|
|
60
|
+
return text.replace(INVISIBLE, '').replace(/\s/gu, '') === '';
|
|
61
|
+
}
|
|
62
|
+
/** How much of a discard's reason a review shows before it asks to be expanded: characters… */
|
|
63
|
+
export const REVIEW_TEXT_SHOWN_MAX = 280;
|
|
64
|
+
/** …and lines, whichever comes first, so a reason of many short lines is bounded in height too. */
|
|
65
|
+
export const REVIEW_TEXT_SHOWN_LINES = 6;
|
|
66
|
+
/**
|
|
67
|
+
* A reason as a review first shows it: {@link reviewText}, cut at
|
|
68
|
+
* {@link REVIEW_TEXT_SHOWN_MAX} characters (never inside a surrogate pair) or
|
|
69
|
+
* {@link REVIEW_TEXT_SHOWN_LINES} lines, whichever comes first, with `clipped` set, so a long
|
|
70
|
+
* reason cannot push the rest of the review out of sight. The full text is shown on request.
|
|
71
|
+
*/
|
|
72
|
+
export function clipReviewText(text) {
|
|
73
|
+
const full = reviewText(text);
|
|
74
|
+
const chars = Array.from(full);
|
|
75
|
+
let end = Math.min(chars.length, REVIEW_TEXT_SHOWN_MAX);
|
|
76
|
+
let lines = 1;
|
|
77
|
+
for (let i = 0; i < end; i++) {
|
|
78
|
+
if (chars[i] === '\n' && ++lines > REVIEW_TEXT_SHOWN_LINES) {
|
|
79
|
+
end = i;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (end === chars.length)
|
|
84
|
+
return { full, shown: full, clipped: false };
|
|
85
|
+
return { full, shown: chars.slice(0, end).join(''), clipped: true };
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=review-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-text.js","sourceRoot":"","sources":["../src/review-text.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,SAAS,GAAG,wEAAwE,CAAC;AAE3F;;;;GAIG;AACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAErC,MAAM,SAAS,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,CAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC;AAEhH;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC;AA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O,EAAE,KAAK,EAAE,CAAC;IACvE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACtE,CAAC"}
|
package/dist/routing.d.ts
CHANGED
|
@@ -188,7 +188,7 @@ export declare const routeTarget: z.ZodObject<{
|
|
|
188
188
|
calls: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
189
189
|
scopeStores: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
190
190
|
binding: z.ZodString;
|
|
191
|
-
|
|
191
|
+
driver: z.ZodString;
|
|
192
192
|
}, z.core.$strip>>>;
|
|
193
193
|
primary: z.ZodDefault<z.ZodBoolean>;
|
|
194
194
|
hostnames: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
package/dist/routing.js
CHANGED
|
@@ -199,12 +199,12 @@ export const routeTarget = z.object({
|
|
|
199
199
|
*/
|
|
200
200
|
calls: z.array(verticalSlug).nullable().default(null),
|
|
201
201
|
/**
|
|
202
|
-
* Scope stores the dispatched version declares (#2207): `{ binding,
|
|
202
|
+
* Scope stores the dispatched version declares (#2207): `{ binding, driver }` from
|
|
203
203
|
* the same manifest. The router hands the list to egress, which is what a store
|
|
204
204
|
* call is judged against. Defaulted to `[]`, so a resolver that predates the
|
|
205
205
|
* field parses, and a store call is refused until a version declares one.
|
|
206
206
|
*/
|
|
207
|
-
scopeStores: z.array(z.object({ binding: z.string(),
|
|
207
|
+
scopeStores: z.array(z.object({ binding: z.string(), driver: z.string() })).default([]),
|
|
208
208
|
/**
|
|
209
209
|
* Whether the scope is the real install (`isPrimaryScope`, #2005) — false for a fork, a
|
|
210
210
|
* snapshot or a preview of either kind. The router hands it to the egress worker, which
|
package/dist/routing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.js","sourceRoot":"","sources":["../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,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACvF;;;;;;;OAOG;IACH,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAClC;;;;;OAKG;IACH,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CAC3C,CAAC,CAAC"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The signed envelope a scope-store call carries (#2287, RFC scope-stores §10.3).
|
|
3
|
+
*
|
|
4
|
+
* Ed25519 over a canonical encoding of every field the store acts on. The router signs
|
|
5
|
+
* audience `caller` and the control plane signs audience `platform`, each with its own
|
|
6
|
+
* private key. A store script holds only public keys, a list per audience, so a key can be
|
|
7
|
+
* rotated without a moment where no key verifies. The encoding is nine lines joined by
|
|
8
|
+
* `\n`, with no trailing newline, so a verifier in another language can rebuild it:
|
|
9
|
+
*
|
|
10
|
+
* ```
|
|
11
|
+
* 1
|
|
12
|
+
* caller|platform
|
|
13
|
+
* <kid: base64url of the first 8 bytes of SHA-256 over the raw public key>
|
|
14
|
+
* <store script name>
|
|
15
|
+
* <object name>
|
|
16
|
+
* <operation>
|
|
17
|
+
* <sha256 hex of the exact request body>
|
|
18
|
+
* <iat, unix seconds>
|
|
19
|
+
* <nonce, base64url of 16 bytes>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* The signature is base64url over those exact UTF-8 bytes. An envelope is fresh for
|
|
23
|
+
* {@link SCOPE_STORE_ENVELOPE_WINDOW_SECONDS} on either side of the verifier's clock. A
|
|
24
|
+
* store does not remember nonces (RFC Q2): an envelope replayed inside the window, at the
|
|
25
|
+
* same script and object with the same body, is accepted again. The reserved operations are
|
|
26
|
+
* idempotent, and a driver operation's retry safety is the vertical's.
|
|
27
|
+
*
|
|
28
|
+
* The script line is an opaque string compared for equality: the signer builds it, the
|
|
29
|
+
* verifier is told its own. Nothing here parses it.
|
|
30
|
+
*
|
|
31
|
+
* This module imports nothing, so a store entry can load it as one file.
|
|
32
|
+
*/
|
|
33
|
+
export declare const SCOPE_STORE_ENVELOPE_VERSION = 1;
|
|
34
|
+
export declare const SCOPE_STORE_ENVELOPE_WINDOW_SECONDS = 60;
|
|
35
|
+
/** The request header carrying base64url of the canonical bytes. */
|
|
36
|
+
export declare const SCOPE_STORE_ENVELOPE_HEADER = "x-substrat-store-envelope";
|
|
37
|
+
/** The request header carrying the base64url signature. */
|
|
38
|
+
export declare const SCOPE_STORE_SIGNATURE_HEADER = "x-substrat-store-signature";
|
|
39
|
+
/**
|
|
40
|
+
* The operations only the platform may send to a scope store (#2207). A vertical's
|
|
41
|
+
* stub refuses every one of them. A driver's registration has to answer all of them,
|
|
42
|
+
* `substrat.erase` included, before a hosted deploy may store tenant data.
|
|
43
|
+
*/
|
|
44
|
+
export declare const RESERVED_STORE_OPERATIONS: readonly ['substrat.export', 'substrat.import', 'substrat.size', 'substrat.wipe', 'substrat.erase'];
|
|
45
|
+
export type ReservedStoreOperation = (typeof RESERVED_STORE_OPERATIONS)[number];
|
|
46
|
+
export type ScopeStoreAudience = 'caller' | 'platform';
|
|
47
|
+
export interface ScopeStoreEnvelope {
|
|
48
|
+
readonly v: 1;
|
|
49
|
+
readonly aud: ScopeStoreAudience;
|
|
50
|
+
readonly kid: string;
|
|
51
|
+
readonly script: string;
|
|
52
|
+
readonly name: string;
|
|
53
|
+
readonly op: string;
|
|
54
|
+
readonly digest: string;
|
|
55
|
+
readonly iat: number;
|
|
56
|
+
readonly nonce: string;
|
|
57
|
+
}
|
|
58
|
+
/** Whether this version admits `op` from `aud`. */
|
|
59
|
+
export declare function scopeStoreEnvelopeAdmits(v: number, aud: string, op: string): boolean;
|
|
60
|
+
export declare function bytesToBase64Url(bytes: Uint8Array): string;
|
|
61
|
+
export declare function base64UrlToBytes(value: string): Uint8Array | undefined;
|
|
62
|
+
/** Nine lines, no trailing newline. Throws on a field the parser would refuse. */
|
|
63
|
+
export declare function canonicalScopeStoreEnvelope(envelope: ScopeStoreEnvelope): string;
|
|
64
|
+
/** The envelope those bytes name, or undefined when they are not exactly what the encoder emits. */
|
|
65
|
+
export declare function parseScopeStoreEnvelope(canonical: string): ScopeStoreEnvelope | undefined;
|
|
66
|
+
/** SHA-256 of the exact request body, lowercase hex. */
|
|
67
|
+
export declare function scopeStoreBodyDigest(body: string): Promise<string>;
|
|
68
|
+
/** Whether `iat` is inside the freshness window of `nowSeconds`. */
|
|
69
|
+
export declare function scopeStoreEnvelopeFresh(iat: number, nowSeconds: number, windowSeconds?: number): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* The key id of a raw Ed25519 public key (base64url): base64url of SHA-256's first 8 bytes.
|
|
72
|
+
* Throws on a key that is not 32 bytes or encodes a small-order point, so a verifier given one
|
|
73
|
+
* never matches it.
|
|
74
|
+
*/
|
|
75
|
+
export declare function scopeStoreKeyId(publicKey: string): Promise<string>;
|
|
76
|
+
/** What is wrong with one configured public key, as a code a tool can switch on. */
|
|
77
|
+
export type ScopeStorePublicKeyProblem = 'empty' | 'length' | 'small-order' | 'non-canonical';
|
|
78
|
+
/**
|
|
79
|
+
* Why a store refuses one configured public key, or undefined when it accepts it: empty, not
|
|
80
|
+
* 32 bytes of base64url, a small-order point, or not in canonical base64url (its unused trailing
|
|
81
|
+
* bits set, so two spellings would name one key).
|
|
82
|
+
*/
|
|
83
|
+
export declare function scopeStorePublicKeyProblem(key: string): ScopeStorePublicKeyProblem | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* A store's public keys for one audience, as configured: raw Ed25519 keys, base64url,
|
|
86
|
+
* separated by commas (whitespace around each is ignored). Throws on an empty list, any key
|
|
87
|
+
* {@link scopeStorePublicKeyProblem} refuses, or the same key twice. Rotation is: add the new
|
|
88
|
+
* key, switch the signer, then drop the old key.
|
|
89
|
+
*/
|
|
90
|
+
export declare function parseScopeStorePublicKeys(text: string): readonly string[];
|
|
91
|
+
/**
|
|
92
|
+
* Both audiences' public keys, from their configured lists. Throws on anything
|
|
93
|
+
* {@link parseScopeStorePublicKeys} refuses, and on a key listed for both audiences: whoever
|
|
94
|
+
* holds the `caller` private key could then sign `platform` envelopes, `substrat.erase`
|
|
95
|
+
* included (L16). A store builds its keys only through this.
|
|
96
|
+
*/
|
|
97
|
+
export declare function scopeStorePublicKeysFrom(config: {
|
|
98
|
+
readonly caller: string;
|
|
99
|
+
readonly platform: string;
|
|
100
|
+
}): ScopeStorePublicKeys;
|
|
101
|
+
/**
|
|
102
|
+
* A fresh Ed25519 pair in the shapes this module takes: the PKCS8 private key a signer holds
|
|
103
|
+
* and the raw public key a store lists, both base64url, with the key id the envelope names.
|
|
104
|
+
*/
|
|
105
|
+
export declare function generateScopeStoreKeyPair(): Promise<{
|
|
106
|
+
readonly privateKey: string;
|
|
107
|
+
readonly publicKey: string;
|
|
108
|
+
readonly kid: string;
|
|
109
|
+
}>;
|
|
110
|
+
/**
|
|
111
|
+
* The raw public key and key id a PKCS8 Ed25519 private key (base64url) signs under, derived the
|
|
112
|
+
* way {@link issueScopeStoreEnvelope} derives them. Throws {@link ScopeStoreKeyError} when the key
|
|
113
|
+
* is unusable, whose message never carries the key.
|
|
114
|
+
*/
|
|
115
|
+
export declare function scopeStoreSignerPublicKey(pkcs8: string): Promise<{
|
|
116
|
+
readonly publicKey: string;
|
|
117
|
+
readonly kid: string;
|
|
118
|
+
}>;
|
|
119
|
+
/** Why a signing key cannot be used. */
|
|
120
|
+
export type ScopeStoreKeyProblem = 'encoding' | 'not-pkcs8-v1' | 'not-ed25519' | 'no-public-half' | 'small-order';
|
|
121
|
+
/** A signing key that is present but cannot be used. Its message never carries the key. */
|
|
122
|
+
export declare class ScopeStoreKeyError extends Error {
|
|
123
|
+
readonly reason: ScopeStoreKeyProblem;
|
|
124
|
+
readonly name = "ScopeStoreKeyError";
|
|
125
|
+
constructor(message: string, reason: ScopeStoreKeyProblem);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Whether `signature` is the Ed25519 signature of `canonical` under the raw public key.
|
|
129
|
+
* A malformed key or signature is false.
|
|
130
|
+
*/
|
|
131
|
+
export declare function verifyScopeStoreEnvelope(publicKey: string, canonical: string, signature: string): Promise<boolean>;
|
|
132
|
+
export interface IssuedScopeStoreEnvelope {
|
|
133
|
+
readonly envelope: ScopeStoreEnvelope;
|
|
134
|
+
readonly canonical: string;
|
|
135
|
+
/** base64url of the canonical UTF-8 bytes. {@link SCOPE_STORE_ENVELOPE_HEADER} carries it. */
|
|
136
|
+
readonly header: string;
|
|
137
|
+
/** {@link SCOPE_STORE_SIGNATURE_HEADER} carries it. */
|
|
138
|
+
readonly signature: string;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Build, digest and sign one envelope. `iat` and `nonce` default to now and 16 random bytes.
|
|
142
|
+
* Throws {@link ScopeStoreKeyError} when the key is unusable, and an Error when a field is.
|
|
143
|
+
*/
|
|
144
|
+
export declare function issueScopeStoreEnvelope(input: {
|
|
145
|
+
readonly privateKey: string;
|
|
146
|
+
readonly aud: ScopeStoreAudience;
|
|
147
|
+
readonly script: string;
|
|
148
|
+
readonly name: string;
|
|
149
|
+
readonly op: string;
|
|
150
|
+
readonly body: string;
|
|
151
|
+
readonly iat?: number;
|
|
152
|
+
readonly nonce?: string;
|
|
153
|
+
}): Promise<IssuedScopeStoreEnvelope>;
|
|
154
|
+
/** The public keys a store verifies with, per audience. */
|
|
155
|
+
export interface ScopeStorePublicKeys {
|
|
156
|
+
readonly caller: readonly string[];
|
|
157
|
+
readonly platform: readonly string[];
|
|
158
|
+
}
|
|
159
|
+
/** Why a call was refused. A store answers every one of them the same way, 401. */
|
|
160
|
+
export type ScopeStoreRefusal = 'missing' | 'malformed' | 'audience' | 'kid' | 'signature' | 'digest' | 'stale' | 'script' | 'body' | 'keys';
|
|
161
|
+
export type ScopeStoreCallVerdict = {
|
|
162
|
+
readonly ok: true;
|
|
163
|
+
readonly envelope: ScopeStoreEnvelope;
|
|
164
|
+
} | {
|
|
165
|
+
readonly ok: false;
|
|
166
|
+
readonly refusal: ScopeStoreRefusal;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Every envelope check a store makes on a call before the driver's class runs (RFC §10.3
|
|
170
|
+
* checks 1–4, L4, L5), in one place, so a store entry carries no copy. The object binding
|
|
171
|
+
* (check 5: the object's id is `idFromName` of the signed name) is the entry's, because it
|
|
172
|
+
* needs the object's id; so is reading the configured keys and script name.
|
|
173
|
+
*
|
|
174
|
+
* `script` is the store script's own name, compared with the signed line for equality.
|
|
175
|
+
* The body must be JSON naming the signed operation as `operation` and the signed object
|
|
176
|
+
* as `objectName`, so the signed name is the one the driver is asked about.
|
|
177
|
+
*/
|
|
178
|
+
export declare function verifyScopeStoreCall(input: {
|
|
179
|
+
readonly envelope: string | null | undefined;
|
|
180
|
+
readonly signature: string | null | undefined;
|
|
181
|
+
readonly body: string;
|
|
182
|
+
readonly keys: ScopeStorePublicKeys;
|
|
183
|
+
readonly script: string;
|
|
184
|
+
readonly nowSeconds: number;
|
|
185
|
+
readonly windowSeconds?: number;
|
|
186
|
+
}): Promise<ScopeStoreCallVerdict>;
|
|
187
|
+
//# sourceMappingURL=scope-store-envelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-store-envelope.d.ts","sourceRoot":"","sources":["../src/scope-store-envelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAC9C,eAAO,MAAM,mCAAmC,KAAK,CAAC;AACtD,oEAAoE;AACpE,eAAO,MAAM,2BAA2B,8BAA8B,CAAC;AACvE,2DAA2D;AAC3D,eAAO,MAAM,4BAA4B,+BAA+B,CAAC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