@astrale-os/kernel-protocol 0.5.0-beta.70 → 0.5.0-beta.72
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/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/invocation/binding-codecs.d.ts +3 -2
- package/dist/invocation/delegate.d.ts +0 -11
- package/dist/invocation/delegate.js +2 -20
- package/dist/invocation/http/index.d.ts +1 -1
- package/dist/invocation/http/index.js +1 -1
- package/dist/invocation/http/request.d.ts +2 -0
- package/dist/invocation/http/request.js +8 -0
- package/dist/invocation/index.d.ts +0 -3
- package/dist/invocation/index.js +0 -2
- package/dist/invocation/redirect.d.ts +3 -8
- package/dist/invocation/redirect.js +4 -4
- package/dist/invocation/routing.d.ts +8 -12
- package/dist/invocation/routing.js +7 -22
- package/dist/invocation/stale-route.d.ts +3 -3
- package/dist/release/bindings/index.d.ts +1 -1
- package/dist/release/bindings/view.d.ts +0 -5
- package/dist/release/bindings/view.js +2 -96
- package/dist/release/bundle-admission.js +0 -6
- package/dist/release/delivery/index.d.ts +1 -2
- package/dist/release/delivery/index.js +1 -2
- package/dist/release/delivery/request.d.ts +2 -7
- package/dist/release/delivery/request.js +1 -10
- package/dist/release/index.d.ts +1 -5
- package/dist/release/index.js +0 -4
- package/dist/release/manifest.d.ts +2 -2
- package/dist/release/manifest.js +12 -20
- package/dist/release/release.js +2 -0
- package/dist/release/requirements.d.ts +1 -1
- package/dist/release/requirements.js +1 -1
- package/dist/release/served.d.ts +2 -1
- package/dist/release/served.js +1 -10
- package/dist/routes/compiler.js +1 -2
- package/dist/routes/credential.d.ts +0 -1
- package/dist/routes/credential.js +0 -3
- package/dist/routes/index.d.ts +0 -3
- package/dist/routes/index.js +0 -3
- package/dist/routes/request.d.ts +2 -2
- package/dist/routes/reservation.d.ts +2 -2
- package/dist/routes/reservation.js +8 -9
- package/dist/routes/routing.d.ts +4 -16
- package/dist/routes/routing.js +5 -11
- package/dist/routes/template.d.ts +0 -1
- package/dist/routes/template.js +0 -3
- package/dist/runtime/artifact.d.ts +2 -3
- package/dist/runtime/artifact.js +7 -17
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/schema/installation/codec.d.ts +1 -6
- package/dist/schema/installation/codec.js +2 -6
- package/dist/schema/installation/introspection/codec.d.ts +2 -11
- package/dist/schema/installation/introspection/codec.js +20 -38
- package/dist/schema/installation/introspection/result.d.ts +9 -36
- package/package.json +4 -88
- package/dist/invocation/legacy/index.d.ts +0 -29
- package/dist/invocation/legacy/index.js +0 -28
- package/dist/invocation/legacy/route.d.ts +0 -14
- package/dist/invocation/legacy/route.js +0 -25
- package/dist/invocation/legacy/via.d.ts +0 -30
- package/dist/invocation/legacy/via.js +0 -15
- package/dist/release/legacy/bindings.d.ts +0 -14
- package/dist/release/legacy/bindings.js +0 -11
- package/dist/release/legacy/bundle-admission.d.ts +0 -6
- package/dist/release/legacy/bundle-admission.js +0 -10
- package/dist/release/legacy/bundle-evidence.d.ts +0 -8
- package/dist/release/legacy/bundle-evidence.js +0 -11
- package/dist/release/legacy/bundle.d.ts +0 -24
- package/dist/release/legacy/bundle.js +0 -31
- package/dist/release/legacy/delivery/attestation.d.ts +0 -6
- package/dist/release/legacy/delivery/attestation.js +0 -1
- package/dist/release/legacy/delivery/claims.d.ts +0 -25
- package/dist/release/legacy/delivery/claims.js +0 -66
- package/dist/release/legacy/delivery/delivery.d.ts +0 -18
- package/dist/release/legacy/delivery/delivery.js +0 -33
- package/dist/release/legacy/delivery/error.d.ts +0 -16
- package/dist/release/legacy/delivery/error.js +0 -6
- package/dist/release/legacy/delivery/index.d.ts +0 -13
- package/dist/release/legacy/delivery/index.js +0 -13
- package/dist/release/legacy/delivery/limits.d.ts +0 -21
- package/dist/release/legacy/delivery/limits.js +0 -22
- package/dist/release/legacy/delivery/request.d.ts +0 -26
- package/dist/release/legacy/delivery/request.js +0 -57
- package/dist/release/legacy/delivery-declaration.d.ts +0 -9
- package/dist/release/legacy/delivery-declaration.js +0 -11
- package/dist/release/legacy/error.d.ts +0 -26
- package/dist/release/legacy/error.js +0 -114
- package/dist/release/legacy/etag.d.ts +0 -12
- package/dist/release/legacy/etag.js +0 -14
- package/dist/release/legacy/index.d.ts +0 -75
- package/dist/release/legacy/index.js +0 -15
- package/dist/release/legacy/profiles.d.ts +0 -23
- package/dist/release/legacy/profiles.js +0 -36
- package/dist/release/legacy/projection.d.ts +0 -13
- package/dist/release/legacy/projection.js +0 -25
- package/dist/release/legacy/publication.d.ts +0 -90
- package/dist/release/legacy/publication.js +0 -124
- package/dist/release/legacy/reference.d.ts +0 -47
- package/dist/release/legacy/reference.js +0 -92
- package/dist/release/legacy/requirements.d.ts +0 -30
- package/dist/release/legacy/requirements.js +0 -20
- package/dist/routes/legacy/index.d.ts +0 -29
- package/dist/routes/legacy/index.js +0 -29
- package/dist/routes/legacy/routing.d.ts +0 -24
- package/dist/routes/legacy/routing.js +0 -45
- package/dist/routes/legacy/table.d.ts +0 -34
- package/dist/routes/legacy/table.js +0 -50
- package/dist/schema/installation/legacy/index.d.ts +0 -39
- package/dist/schema/installation/legacy/index.js +0 -39
- package/dist/schema/installation/legacy/installation.d.ts +0 -9
- package/dist/schema/installation/legacy/installation.js +0 -28
- package/dist/schema/installation/legacy/introspection.d.ts +0 -10
- package/dist/schema/installation/legacy/introspection.js +0 -70
- package/dist/schema/installation/legacy/msgpack.d.ts +0 -1
- package/dist/schema/installation/legacy/msgpack.js +0 -143
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as release from '../../delivery/limits.js';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated Purpose of Delivery v1 attestations; Delivery v2
|
|
4
|
-
* (`@astrale-os/kernel-protocol/release/delivery`, added with `DomainRelease` v4) has its own
|
|
5
|
-
* purpose.
|
|
6
|
-
*/
|
|
7
|
-
export const PURPOSE = 'astrale.domain.delivery.v1';
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated Delivery v1 limit, the one Delivery v2 applies; use `NONCE_MIN_LENGTH` of
|
|
10
|
-
* `@astrale-os/kernel-protocol/release/delivery`.
|
|
11
|
-
*/
|
|
12
|
-
export const NONCE_MIN_LENGTH = release.NONCE_MIN_LENGTH;
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Delivery v1 limit, the one Delivery v2 applies; use `NONCE_MAX_LENGTH` of
|
|
15
|
-
* `@astrale-os/kernel-protocol/release/delivery`.
|
|
16
|
-
*/
|
|
17
|
-
export const NONCE_MAX_LENGTH = release.NONCE_MAX_LENGTH;
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated Delivery v1 limit, the one Delivery v2 applies; use `ATTESTATION_MAX_BYTES` of
|
|
20
|
-
* `@astrale-os/kernel-protocol/release/delivery`.
|
|
21
|
-
*/
|
|
22
|
-
export const ATTESTATION_MAX_BYTES = release.ATTESTATION_MAX_BYTES;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { type IssuerId } from '@astrale-os/kernel-core/auth/issuer';
|
|
2
|
-
import type { Token as ReleaseToken } from '../../delivery/request.js';
|
|
3
|
-
import type { Etag } from '../etag.js';
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated Delivery v1 request names a Publication ETag; use the Delivery v2 `Request` of
|
|
6
|
-
* `@astrale-os/kernel-protocol/release/delivery` (added with `DomainRelease` v4), which names a
|
|
7
|
-
* release digest.
|
|
8
|
-
*/
|
|
9
|
-
export interface Request {
|
|
10
|
-
readonly version: 1;
|
|
11
|
-
readonly kernel: IssuerId;
|
|
12
|
-
readonly nonce: string;
|
|
13
|
-
readonly etag: Etag;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated Bearer credential of a Delivery transport boundary, the one Delivery v2 admits; use
|
|
17
|
-
* `Token` of `@astrale-os/kernel-protocol/release/delivery`.
|
|
18
|
-
*/
|
|
19
|
-
export type Token = ReleaseToken;
|
|
20
|
-
/**
|
|
21
|
-
* Admit the exact request representation accepted by a Delivery transport boundary.
|
|
22
|
-
*
|
|
23
|
-
* @deprecated Admits Delivery v1 requests; use `acceptRequest` from
|
|
24
|
-
* `@astrale-os/kernel-protocol/release/delivery` (Delivery v2, added with `DomainRelease` v4).
|
|
25
|
-
*/
|
|
26
|
-
export declare function acceptRequest(input: unknown): Request;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { AuthValueError } from '@astrale-os/kernel-core/auth/error';
|
|
2
|
-
import { accept as acceptIssuer } from '@astrale-os/kernel-core/auth/issuer';
|
|
3
|
-
import { fail } from '../../delivery/error.js';
|
|
4
|
-
import { NONCE_MAX_LENGTH, NONCE_MIN_LENGTH } from '../../delivery/limits.js';
|
|
5
|
-
/**
|
|
6
|
-
* Admit the exact request representation accepted by a Delivery transport boundary.
|
|
7
|
-
*
|
|
8
|
-
* @deprecated Admits Delivery v1 requests; use `acceptRequest` from
|
|
9
|
-
* `@astrale-os/kernel-protocol/release/delivery` (Delivery v2, added with `DomainRelease` v4).
|
|
10
|
-
*/
|
|
11
|
-
export function acceptRequest(input) {
|
|
12
|
-
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
13
|
-
fail('DELIVERY_REQUEST_INVALID', 'Expected a Delivery request.');
|
|
14
|
-
}
|
|
15
|
-
const expected = ['version', 'kernel', 'nonce', 'etag'];
|
|
16
|
-
const value = {};
|
|
17
|
-
const fields = Reflect.ownKeys(input);
|
|
18
|
-
if (fields.length !== expected.length) {
|
|
19
|
-
fail('DELIVERY_REQUEST_INVALID', 'Delivery request is invalid.');
|
|
20
|
-
}
|
|
21
|
-
for (const field of fields) {
|
|
22
|
-
if (typeof field !== 'string' || !expected.includes(field)) {
|
|
23
|
-
fail('DELIVERY_REQUEST_INVALID', 'Delivery request is invalid.');
|
|
24
|
-
}
|
|
25
|
-
const descriptor = Object.getOwnPropertyDescriptor(input, field);
|
|
26
|
-
if (descriptor === undefined || !descriptor.enumerable || !('value' in descriptor)) {
|
|
27
|
-
fail('DELIVERY_REQUEST_INVALID', 'Delivery request is invalid.');
|
|
28
|
-
}
|
|
29
|
-
value[field] = descriptor.value;
|
|
30
|
-
}
|
|
31
|
-
if (expected.some((field) => !Object.hasOwn(value, field)) ||
|
|
32
|
-
value.version !== 1 ||
|
|
33
|
-
typeof value.kernel !== 'string' ||
|
|
34
|
-
typeof value.nonce !== 'string' ||
|
|
35
|
-
value.nonce.length < NONCE_MIN_LENGTH ||
|
|
36
|
-
value.nonce.length > NONCE_MAX_LENGTH ||
|
|
37
|
-
typeof value.etag !== 'string' ||
|
|
38
|
-
!/^sha256:[0-9a-f]{64}$/u.test(value.etag)) {
|
|
39
|
-
fail('DELIVERY_REQUEST_INVALID', 'Delivery request is invalid.');
|
|
40
|
-
}
|
|
41
|
-
let kernel;
|
|
42
|
-
try {
|
|
43
|
-
kernel = acceptIssuer(value.kernel);
|
|
44
|
-
}
|
|
45
|
-
catch (cause) {
|
|
46
|
-
if (cause instanceof AuthValueError) {
|
|
47
|
-
return fail('DELIVERY_REQUEST_INVALID', 'Delivery request issuer is invalid.', cause);
|
|
48
|
-
}
|
|
49
|
-
throw cause;
|
|
50
|
-
}
|
|
51
|
-
return Object.freeze({
|
|
52
|
-
version: 1,
|
|
53
|
-
kernel,
|
|
54
|
-
nonce: value.nonce,
|
|
55
|
-
etag: value.etag,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { DeliveryDeclaration } from '../declaration.js';
|
|
2
|
-
import type { Endpoint } from '../delivery-endpoint.js';
|
|
3
|
-
/**
|
|
4
|
-
* Place one provider-neutral Delivery declaration beneath an exact serving issuer.
|
|
5
|
-
*
|
|
6
|
-
* @deprecated Use `placeDelivery` from
|
|
7
|
-
* `@astrale-os/kernel-protocol/release/delivery-declaration`, which reports `ReleaseError`.
|
|
8
|
-
*/
|
|
9
|
-
export declare function placeDelivery(input: DeliveryDeclaration, issuer: string, bundleHref: string): Endpoint;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as declaration from '../delivery-declaration.js';
|
|
2
|
-
import { withPublicationError } from './error.js';
|
|
3
|
-
/**
|
|
4
|
-
* Place one provider-neutral Delivery declaration beneath an exact serving issuer.
|
|
5
|
-
*
|
|
6
|
-
* @deprecated Use `placeDelivery` from
|
|
7
|
-
* `@astrale-os/kernel-protocol/release/delivery-declaration`, which reports `ReleaseError`.
|
|
8
|
-
*/
|
|
9
|
-
export function placeDelivery(input, issuer, bundleHref) {
|
|
10
|
-
return withPublicationError(() => declaration.placeDelivery(input, issuer, bundleHref));
|
|
11
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Use `ReleaseErrorCode` from `@astrale-os/kernel-protocol/release`; only the legacy
|
|
3
|
-
* Publication surface reports these codes.
|
|
4
|
-
*/
|
|
5
|
-
export type PublicationErrorCode = 'PUBLICATION_INVALID' | 'PUBLICATION_ETAG_MISMATCH' | 'PUBLICATION_BINDING_INVALID' | 'PUBLICATION_ROUTE_INVALID' | 'PUBLICATION_VIEW_INVALID';
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Use `ReleaseError` from `@astrale-os/kernel-protocol/release`; only the legacy
|
|
8
|
-
* Publication surface throws it.
|
|
9
|
-
*/
|
|
10
|
-
export declare class PublicationError extends Error {
|
|
11
|
-
readonly code: PublicationErrorCode;
|
|
12
|
-
readonly name = "PublicationError";
|
|
13
|
-
constructor(code: PublicationErrorCode, message: string, options?: ErrorOptions);
|
|
14
|
-
}
|
|
15
|
-
/** Report a failure of a check only Publication v2/v3 performs. */
|
|
16
|
-
export declare function fail(code: PublicationErrorCode, message: string, cause?: unknown): never;
|
|
17
|
-
export declare function record(input: unknown, code: PublicationErrorCode, message: string): Record<string, unknown>;
|
|
18
|
-
export declare function exact(value: Record<string, unknown>, allowed: readonly string[], code: PublicationErrorCode): void;
|
|
19
|
-
export declare function array(input: unknown, code: PublicationErrorCode): readonly unknown[];
|
|
20
|
-
export declare function unique(values: readonly string[], code: PublicationErrorCode, label: string): void;
|
|
21
|
-
/**
|
|
22
|
-
* Run release validation and report its failure as the legacy surface always has:
|
|
23
|
-
* `PublicationError` with the corresponding `PUBLICATION_*` code, the historical message, and a
|
|
24
|
-
* translated cause chain. A `PublicationError` or any other failure passes through unchanged.
|
|
25
|
-
*/
|
|
26
|
-
export declare function withPublicationError<Result>(operation: () => Result): Result;
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { ReleaseError } from '../error.js';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated Use `ReleaseError` from `@astrale-os/kernel-protocol/release`; only the legacy
|
|
4
|
-
* Publication surface throws it.
|
|
5
|
-
*/
|
|
6
|
-
export class PublicationError extends Error {
|
|
7
|
-
code;
|
|
8
|
-
name = 'PublicationError';
|
|
9
|
-
constructor(code, message, options) {
|
|
10
|
-
super(message, options);
|
|
11
|
-
this.code = code;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
/** Report a failure of a check only Publication v2/v3 performs. */
|
|
15
|
-
export function fail(code, message, cause) {
|
|
16
|
-
throw new PublicationError(code, message, cause === undefined ? undefined : { cause });
|
|
17
|
-
}
|
|
18
|
-
/*
|
|
19
|
-
* Structural checks only Publication v2/v3 performs, reported as `PublicationError` directly. They
|
|
20
|
-
* are frozen copies of the release checks in `../shape.ts` and leave with this folder.
|
|
21
|
-
*/
|
|
22
|
-
export function record(input, code, message) {
|
|
23
|
-
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
24
|
-
fail(code, message);
|
|
25
|
-
return input;
|
|
26
|
-
}
|
|
27
|
-
export function exact(value, allowed, code) {
|
|
28
|
-
const admitted = new Set(allowed);
|
|
29
|
-
if (Object.keys(value).some((key) => !admitted.has(key))) {
|
|
30
|
-
fail(code, 'Object contains unknown fields.');
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export function array(input, code) {
|
|
34
|
-
if (!Array.isArray(input))
|
|
35
|
-
fail(code, 'Expected an array.');
|
|
36
|
-
return input;
|
|
37
|
-
}
|
|
38
|
-
export function unique(values, code, label) {
|
|
39
|
-
if (new Set(values).size !== values.length)
|
|
40
|
-
fail(code, `Duplicate ${label}.`);
|
|
41
|
-
}
|
|
42
|
-
const CODES = Object.freeze({
|
|
43
|
-
RELEASE_INVALID: 'PUBLICATION_INVALID',
|
|
44
|
-
RELEASE_DIGEST_MISMATCH: 'PUBLICATION_ETAG_MISMATCH',
|
|
45
|
-
RELEASE_BINDING_INVALID: 'PUBLICATION_BINDING_INVALID',
|
|
46
|
-
RELEASE_ROUTE_INVALID: 'PUBLICATION_ROUTE_INVALID',
|
|
47
|
-
RELEASE_VIEW_INVALID: 'PUBLICATION_VIEW_INVALID',
|
|
48
|
-
});
|
|
49
|
-
/**
|
|
50
|
-
* Frozen text the legacy surface reported for each release validator message that names the served
|
|
51
|
-
* document. Every other release message is reported unchanged.
|
|
52
|
-
*/
|
|
53
|
-
const MESSAGES = new Map([
|
|
54
|
-
['Release schema is invalid.', 'Published schema is invalid.'],
|
|
55
|
-
['Release schema revision is invalid.', 'Published schema revision is invalid.'],
|
|
56
|
-
['Release HTTP route is invalid.', 'Published HTTP route is invalid.'],
|
|
57
|
-
['Release View binding is invalid.', 'Published View binding is invalid.'],
|
|
58
|
-
['Release issuer is invalid.', 'Publication issuer is invalid.'],
|
|
59
|
-
['Release issuer is not an HTTP(S) URL.', 'Publication issuer is not an HTTP(S) URL.'],
|
|
60
|
-
['Release bundle is invalid.', 'Publication bundle is invalid.'],
|
|
61
|
-
['Release requirements are invalid.', 'Publication requirements are invalid.'],
|
|
62
|
-
[
|
|
63
|
-
'Release capability requirements are invalid.',
|
|
64
|
-
'Publication capability requirements are invalid.',
|
|
65
|
-
],
|
|
66
|
-
['Release bundle omits an exact dependency.', 'Publication Bundle omits an exact dependency.'],
|
|
67
|
-
[
|
|
68
|
-
'Bundle root does not match the release schema.',
|
|
69
|
-
'Bundle root does not match the Publication schema.',
|
|
70
|
-
],
|
|
71
|
-
['Release origin is invalid.', 'Publication origin is invalid.'],
|
|
72
|
-
['Release identity is invalid.', 'Publication identity is invalid.'],
|
|
73
|
-
[
|
|
74
|
-
'Release identity subject must equal its root origin.',
|
|
75
|
-
'Publication identity subject must equal its root origin.',
|
|
76
|
-
],
|
|
77
|
-
['Release bindings are invalid.', 'Publication bindings are invalid.'],
|
|
78
|
-
]);
|
|
79
|
-
/**
|
|
80
|
-
* Run release validation and report its failure as the legacy surface always has:
|
|
81
|
-
* `PublicationError` with the corresponding `PUBLICATION_*` code, the historical message, and a
|
|
82
|
-
* translated cause chain. A `PublicationError` or any other failure passes through unchanged.
|
|
83
|
-
*/
|
|
84
|
-
export function withPublicationError(operation) {
|
|
85
|
-
try {
|
|
86
|
-
return operation();
|
|
87
|
-
}
|
|
88
|
-
catch (cause) {
|
|
89
|
-
if (cause instanceof ReleaseError)
|
|
90
|
-
throw publicationError(cause);
|
|
91
|
-
throw cause;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
function publicationError(error) {
|
|
95
|
-
const cause = error.cause instanceof ReleaseError ? publicationError(error.cause) : error.cause;
|
|
96
|
-
const translated = new PublicationError(CODES[error.code], MESSAGES.get(error.message) ?? error.message, cause === undefined ? undefined : { cause });
|
|
97
|
-
const stack = validatorStack(error, translated);
|
|
98
|
-
if (stack !== undefined)
|
|
99
|
-
translated.stack = stack;
|
|
100
|
-
return translated;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Keep the frames of the release check that failed, under the translated header, so the legacy
|
|
104
|
-
* failure still points at the validator rather than at this translation.
|
|
105
|
-
*/
|
|
106
|
-
function validatorStack(error, translated) {
|
|
107
|
-
const stack = error.stack;
|
|
108
|
-
if (stack === undefined)
|
|
109
|
-
return undefined;
|
|
110
|
-
const header = `${error.name}: ${error.message}`;
|
|
111
|
-
return stack.startsWith(header)
|
|
112
|
-
? `${translated.name}: ${translated.message}${stack.slice(header.length)}`
|
|
113
|
-
: stack;
|
|
114
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Sha256Digest } from '../digest.js';
|
|
2
|
-
import type { EtagContent } from './publication.js';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Digest of one v2/v3 Publication; use `ReleaseDigest` from
|
|
5
|
-
* `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
|
|
6
|
-
*/
|
|
7
|
-
export type Etag = Sha256Digest;
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated Computes a v2/v3 Publication ETag; use the release `digestOf` from
|
|
10
|
-
* `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
|
|
11
|
-
*/
|
|
12
|
-
export declare function computeEtag(input: EtagContent): Etag;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as portable from '@astrale-os/kernel-dsl/value';
|
|
2
|
-
import { sha256Hex } from '../digest.js';
|
|
3
|
-
import { encodeLegacyRequirements } from './profiles.js';
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated Computes a v2/v3 Publication ETag; use the release `digestOf` from
|
|
6
|
-
* `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
|
|
7
|
-
*/
|
|
8
|
-
export function computeEtag(input) {
|
|
9
|
-
const wire = input.version === 2
|
|
10
|
-
? { ...input, requirements: encodeLegacyRequirements(input.requirements) }
|
|
11
|
-
: input;
|
|
12
|
-
const bytes = portable.json.encode(wire);
|
|
13
|
-
return `sha256:${sha256Hex(bytes)}`;
|
|
14
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Publication v2/v3 and Delivery v1 compatibility surface. Shared validators report failures as
|
|
3
|
-
* `PublicationError`, preserving historical codes, messages and cause chains.
|
|
4
|
-
*
|
|
5
|
-
* @deprecated Use `@astrale-os/kernel-protocol/release`, the version-neutral contracts to which
|
|
6
|
-
* `DomainRelease` v4 (`release.json`), `ReleaseRef` and Delivery v2 are added.
|
|
7
|
-
*
|
|
8
|
-
* Historical Publication subpaths resolve here. Persisted Runtime artifacts and installation
|
|
9
|
-
* fingerprints depend on the v2 `profiles` encoding.
|
|
10
|
-
*
|
|
11
|
-
* Short-term consumers:
|
|
12
|
-
* - the `./publication*` subpaths and the root `publication` namespace: the SDK, which seals,
|
|
13
|
-
* serves and admits v3 through them until it adopts the release names, and the CLI, Admin and
|
|
14
|
-
* the Issues Domain tests through `@astrale-os/sdk/publication`;
|
|
15
|
-
* - this folder: the astrale Host's existing v3 installations until their Domains are republished
|
|
16
|
-
* as releases, and the 1Pact path, where the client in GUI and Admin reads v3 documents for the
|
|
17
|
-
* Kernel .117 Host, whose instances pin the shell-v2 and services-v2 deployments.
|
|
18
|
-
*
|
|
19
|
-
* Removal, each in a separate breaking release: the subpaths and the namespace once no repository
|
|
20
|
-
* imports them; this folder once no supported Kernel predates v4, no installation pins a v2/v3
|
|
21
|
-
* document, no stable Worker serves one, and the Runtime artifact codec and the installation target
|
|
22
|
-
* digest own a frozen copy of the v2 `profiles` encoding. With the folder go the
|
|
23
|
-
* `withPublicationError` call sites outside it (`protocol/routes/compiler.ts`,
|
|
24
|
-
* `protocol/schema/installation/introspection/codec.ts`; `protocol/routes/legacy/table.ts` goes
|
|
25
|
-
* with `protocol/routes/legacy/`), whose callers then report `ReleaseError`, once
|
|
26
|
-
* `protocol/invocation`, `protocol/routes` and `protocol/schema/installation/introspection` no
|
|
27
|
-
* longer import this folder (`protocol/invocation/legacy/` and `protocol/routes/legacy/` go under
|
|
28
|
-
* their own headers), and the version-1 branch of the Delivery v2 `acceptRequest`, which then
|
|
29
|
-
* returns only its own `Request`. The installed listing's legacy pin goes with the folder: the
|
|
30
|
-
* `legacy` variant of `InstalledPin` and its `installedPin` branch in
|
|
31
|
-
* `protocol/schema/installation/introspection/codec.ts`, with the `publication` branch of
|
|
32
|
-
* `runtime/schema/installation/source/document.ts` `installedPin` that produces it.
|
|
33
|
-
*
|
|
34
|
-
* The frozen v3 projection of a `DomainRelease` (`projection.ts`, served at `domain.json` by v4
|
|
35
|
-
* deployments) and its golden vectors have their own, later deletion condition: no pre-v4 Kernel
|
|
36
|
-
* remains, 1Pact `install-domains.mjs` is gone, and the CLI and Admin read `release.json`.
|
|
37
|
-
*/
|
|
38
|
-
import type * as deliveryEndpoint from '../delivery-endpoint.js';
|
|
39
|
-
import type * as digest from '../digest.js';
|
|
40
|
-
import type * as manifest from '../manifest.js';
|
|
41
|
-
import type * as route from '../route.js';
|
|
42
|
-
export { MEDIA_TYPE, LEGACY_MEDIA_TYPE, mediaType, PATH, url, seal, accept, encode, type Content, type Publication, } from './publication.js';
|
|
43
|
-
export { publication } from './projection.js';
|
|
44
|
-
export { acceptBundle, decodeBundle } from './bundle-admission.js';
|
|
45
|
-
export { BUNDLE_MEDIA_TYPE, bundleUrl, describeBundle, type BundleDescriptor } from './bundle.js';
|
|
46
|
-
export { verifyBundleBytes } from './bundle-evidence.js';
|
|
47
|
-
export { placeDelivery } from './delivery-declaration.js';
|
|
48
|
-
/** @deprecated Use `Sha256Digest` from `@astrale-os/kernel-protocol/release`. */
|
|
49
|
-
export type Sha256Digest = digest.Sha256Digest;
|
|
50
|
-
export type { Etag } from './etag.js';
|
|
51
|
-
export { PublicationError, type PublicationErrorCode } from './error.js';
|
|
52
|
-
/**
|
|
53
|
-
* @deprecated Delivery v1; use Delivery v2 (`@astrale-os/kernel-protocol/release/delivery`, added
|
|
54
|
-
* with `DomainRelease` v4).
|
|
55
|
-
*/
|
|
56
|
-
export * as delivery from './delivery/index.js';
|
|
57
|
-
/** @deprecated Use `DeliveryEndpoint` from `@astrale-os/kernel-protocol/release`. */
|
|
58
|
-
export type DeliveryEndpoint = deliveryEndpoint.Endpoint;
|
|
59
|
-
/** @deprecated Use `Manifest` from `@astrale-os/kernel-protocol/release`. */
|
|
60
|
-
export type Manifest = manifest.Manifest;
|
|
61
|
-
export { admitRequirements, validateRequirements, type CapabilityAuthorityRequirements, type CoreCapabilityRequirement, type CapabilityRequirements, type ClassCapabilityRequirement, type ClassOperation, type NonEmpty, type PublicationRequirements, } from './requirements.js';
|
|
62
|
-
export { acceptReference, compareReference, compareReferences, matchesReference, reference, type PublicationRef, type PublicationReferenceRelation, } from './reference.js';
|
|
63
|
-
/** @deprecated Use `HttpRoute` from `@astrale-os/kernel-protocol/release`. */
|
|
64
|
-
export type HttpRoute = route.HttpRoute;
|
|
65
|
-
/** @deprecated Use `HttpRouteDeclaration` from `@astrale-os/kernel-protocol/release`. */
|
|
66
|
-
export type HttpRouteDeclaration = route.HttpRouteDeclaration;
|
|
67
|
-
/** @deprecated Use `HttpMethod` from `@astrale-os/kernel-protocol/release`. */
|
|
68
|
-
export type HttpMethod = route.HttpMethod;
|
|
69
|
-
/** @deprecated Use `RouteBody` from `@astrale-os/kernel-protocol/release`. */
|
|
70
|
-
export type RouteBody = route.RouteBody;
|
|
71
|
-
/** @deprecated Use `RouteHeaders` from `@astrale-os/kernel-protocol/release`. */
|
|
72
|
-
export type RouteHeaders = route.RouteHeaders;
|
|
73
|
-
/** @deprecated Use `CredentialSource` from `@astrale-os/kernel-protocol/release`. */
|
|
74
|
-
export type CredentialSource = route.CredentialSource;
|
|
75
|
-
export { acceptInvocationEndpoints, type CallableBinding, type InvocationEndpoints, type ViewBinding, } from './bindings.js';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { MEDIA_TYPE, LEGACY_MEDIA_TYPE, mediaType, PATH, url, seal, accept, encode, } from './publication.js';
|
|
2
|
-
export { publication } from './projection.js';
|
|
3
|
-
export { acceptBundle, decodeBundle } from './bundle-admission.js';
|
|
4
|
-
export { BUNDLE_MEDIA_TYPE, bundleUrl, describeBundle } from './bundle.js';
|
|
5
|
-
export { verifyBundleBytes } from './bundle-evidence.js';
|
|
6
|
-
export { placeDelivery } from './delivery-declaration.js';
|
|
7
|
-
export { PublicationError } from './error.js';
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated Delivery v1; use Delivery v2 (`@astrale-os/kernel-protocol/release/delivery`, added
|
|
10
|
-
* with `DomainRelease` v4).
|
|
11
|
-
*/
|
|
12
|
-
export * as delivery from './delivery/index.js';
|
|
13
|
-
export { admitRequirements, validateRequirements, } from './requirements.js';
|
|
14
|
-
export { acceptReference, compareReference, compareReferences, matchesReference, reference, } from './reference.js';
|
|
15
|
-
export { acceptInvocationEndpoints, } from './bindings.js';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Requirements } from '../requirements.js';
|
|
2
|
-
/**
|
|
3
|
-
* Read the retired v2 wire coordinate without exposing it in canonical requirements.
|
|
4
|
-
*
|
|
5
|
-
* @deprecated Only Publication v2 and Runtime artifact v2 carry `profiles`; use `admitRequirements`
|
|
6
|
-
* from `@astrale-os/kernel-protocol/release`, whose canonical requirements carry `core`.
|
|
7
|
-
*/
|
|
8
|
-
export declare function decodeLegacyRequirements(input: unknown): Requirements;
|
|
9
|
-
/**
|
|
10
|
-
* Preserve immutable v2 bytes and the historical installation-target digest vocabulary.
|
|
11
|
-
*
|
|
12
|
-
* @deprecated Only Publication v2 and Runtime artifact v2 carry `profiles`; use the canonical
|
|
13
|
-
* `Requirements` from `@astrale-os/kernel-protocol/release`, which carry `core` and are encoded as
|
|
14
|
-
* they are.
|
|
15
|
-
*/
|
|
16
|
-
export declare function encodeLegacyRequirements(input: Requirements): Readonly<{
|
|
17
|
-
capabilities: Readonly<{
|
|
18
|
-
functions?: import("../requirements.js").NonEmpty<import("@astrale-os/kernel-dsl/v1").Key.Callable>;
|
|
19
|
-
classes?: import("../requirements.js").NonEmpty<import("../requirements.js").ClassCapabilityRequirement>;
|
|
20
|
-
authority?: import("../requirements.js").CapabilityAuthorityRequirements;
|
|
21
|
-
profiles?: import("../requirements.js").NonEmpty<import("../requirements.js").CoreCapabilityRequirement> | undefined;
|
|
22
|
-
}>;
|
|
23
|
-
}>;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { admitRequirements } from '../requirements.js';
|
|
2
|
-
import { exact, record, withPublicationError } from './error.js';
|
|
3
|
-
/**
|
|
4
|
-
* Read the retired v2 wire coordinate without exposing it in canonical requirements.
|
|
5
|
-
*
|
|
6
|
-
* @deprecated Only Publication v2 and Runtime artifact v2 carry `profiles`; use `admitRequirements`
|
|
7
|
-
* from `@astrale-os/kernel-protocol/release`, whose canonical requirements carry `core`.
|
|
8
|
-
*/
|
|
9
|
-
export function decodeLegacyRequirements(input) {
|
|
10
|
-
return withPublicationError(() => {
|
|
11
|
-
const requirements = record(input, 'PUBLICATION_INVALID', 'Publication requirements are invalid.');
|
|
12
|
-
exact(requirements, ['capabilities'], 'PUBLICATION_INVALID');
|
|
13
|
-
const capabilities = record(requirements.capabilities, 'PUBLICATION_INVALID', 'Publication capability requirements are invalid.');
|
|
14
|
-
exact(capabilities, ['authority', 'classes', 'functions', 'profiles'], 'PUBLICATION_INVALID');
|
|
15
|
-
const { profiles, ...principal } = capabilities;
|
|
16
|
-
return admitRequirements({
|
|
17
|
-
capabilities: { ...principal, ...(profiles === undefined ? {} : { core: profiles }) },
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Preserve immutable v2 bytes and the historical installation-target digest vocabulary.
|
|
23
|
-
*
|
|
24
|
-
* @deprecated Only Publication v2 and Runtime artifact v2 carry `profiles`; use the canonical
|
|
25
|
-
* `Requirements` from `@astrale-os/kernel-protocol/release`, which carry `core` and are encoded as
|
|
26
|
-
* they are.
|
|
27
|
-
*/
|
|
28
|
-
export function encodeLegacyRequirements(input) {
|
|
29
|
-
const { core, ...principal } = input.capabilities;
|
|
30
|
-
return Object.freeze({
|
|
31
|
-
capabilities: Object.freeze({
|
|
32
|
-
...principal,
|
|
33
|
-
...(core === undefined ? {} : { profiles: core }),
|
|
34
|
-
}),
|
|
35
|
-
});
|
|
36
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { DomainRelease } from '../release.js';
|
|
2
|
-
import type { Publication } from './publication.js';
|
|
3
|
-
/**
|
|
4
|
-
* The v3 Publication a v4 deployment serves at `domain.json`, for the Kernels, Workers and tools
|
|
5
|
-
* that predate `DomainRelease` v4: the release's served content sealed as Publication v3. It drops
|
|
6
|
-
* `format`, `version`, `digest` and `build`, so its ETag covers what a v3 ETag always covered and
|
|
7
|
-
* never the code. Frozen forever: every party that projects a release (Kernel, Worker, tooling at
|
|
8
|
-
* any package version) must compute the same bytes, which the golden vectors pin.
|
|
9
|
-
*
|
|
10
|
-
* @deprecated Serves pre-v4 readers only; a v4 reader fetches the `DomainRelease` at `release.json`.
|
|
11
|
-
* Deleted with the projection row of `legacy/index.ts`.
|
|
12
|
-
*/
|
|
13
|
-
export declare function publication(release: DomainRelease): Publication;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { seal } from './publication.js';
|
|
2
|
-
/**
|
|
3
|
-
* The v3 Publication a v4 deployment serves at `domain.json`, for the Kernels, Workers and tools
|
|
4
|
-
* that predate `DomainRelease` v4: the release's served content sealed as Publication v3. It drops
|
|
5
|
-
* `format`, `version`, `digest` and `build`, so its ETag covers what a v3 ETag always covered and
|
|
6
|
-
* never the code. Frozen forever: every party that projects a release (Kernel, Worker, tooling at
|
|
7
|
-
* any package version) must compute the same bytes, which the golden vectors pin.
|
|
8
|
-
*
|
|
9
|
-
* @deprecated Serves pre-v4 readers only; a v4 reader fetches the `DomainRelease` at `release.json`.
|
|
10
|
-
* Deleted with the projection row of `legacy/index.ts`.
|
|
11
|
-
*/
|
|
12
|
-
export function publication(release) {
|
|
13
|
-
return seal({
|
|
14
|
-
format: 'astrale.domain.publication',
|
|
15
|
-
version: 3,
|
|
16
|
-
origin: release.origin,
|
|
17
|
-
identity: release.identity,
|
|
18
|
-
schema: release.schema,
|
|
19
|
-
requirements: release.requirements,
|
|
20
|
-
...(release.manifest === undefined ? {} : { manifest: release.manifest }),
|
|
21
|
-
bindings: release.bindings,
|
|
22
|
-
routes: release.routes,
|
|
23
|
-
...(release.delivery === undefined ? {} : { delivery: release.delivery }),
|
|
24
|
-
});
|
|
25
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { IssuerId } from '@astrale-os/kernel-core/auth/issuer';
|
|
2
|
-
import type { Key } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
3
|
-
import type { CallableBinding, ViewBinding } from '../bindings/index.js';
|
|
4
|
-
import type { Endpoint as DeliveryEndpoint } from '../delivery-endpoint.js';
|
|
5
|
-
import type { Manifest } from '../manifest.js';
|
|
6
|
-
import type { Requirements } from '../requirements.js';
|
|
7
|
-
import type { HttpRoute } from '../route.js';
|
|
8
|
-
import type { Schema } from '../schema.js';
|
|
9
|
-
import type { Etag } from './etag.js';
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated Path of the v2/v3 Publication; use the release `PATH` (`release.json`) from
|
|
12
|
-
* `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
|
|
13
|
-
*/
|
|
14
|
-
export declare const PATH: '/.well-known/astrale/domain.json';
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated Media type of Publication v3; use the release `MEDIA_TYPE` from
|
|
17
|
-
* `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
|
|
18
|
-
*/
|
|
19
|
-
export declare const MEDIA_TYPE: 'application/vnd.astrale.domain-publication+json;v=3';
|
|
20
|
-
/**
|
|
21
|
-
* @deprecated Media type of Publication v2; use the release `MEDIA_TYPE` from
|
|
22
|
-
* `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
|
|
23
|
-
*/
|
|
24
|
-
export declare const LEGACY_MEDIA_TYPE: 'application/vnd.astrale.domain-publication+json;v=2';
|
|
25
|
-
/**
|
|
26
|
-
* Select the media type of one v2 or v3 Publication.
|
|
27
|
-
*
|
|
28
|
-
* @deprecated Serves and retains v2/v3 Publications only; use the release `MEDIA_TYPE` from
|
|
29
|
-
* `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4), the one media type of a
|
|
30
|
-
* release.
|
|
31
|
-
*/
|
|
32
|
-
export declare function mediaType(input: Pick<Publication, 'version'>): typeof MEDIA_TYPE | typeof LEGACY_MEDIA_TYPE;
|
|
33
|
-
/**
|
|
34
|
-
* Resolve the canonical Publication URL beneath one exact HTTP(S) serving issuer.
|
|
35
|
-
*
|
|
36
|
-
* @deprecated Locates the v2/v3 Publication; use the release `url` (`release.json`) from
|
|
37
|
-
* `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
|
|
38
|
-
*/
|
|
39
|
-
export declare function url(input: string): string;
|
|
40
|
-
/**
|
|
41
|
-
* Immutable v2/v3 deployment snapshot of one root Domain.
|
|
42
|
-
*
|
|
43
|
-
* @deprecated Use `DomainRelease` from `@astrale-os/kernel-protocol/release` (added with
|
|
44
|
-
* `DomainRelease` v4). Kept to read and serve the documents of Kernels, Workers and installations
|
|
45
|
-
* that predate v4.
|
|
46
|
-
*/
|
|
47
|
-
export interface Publication {
|
|
48
|
-
readonly format: 'astrale.domain.publication';
|
|
49
|
-
readonly version: 2 | 3;
|
|
50
|
-
readonly origin: Key.Origin;
|
|
51
|
-
readonly identity: {
|
|
52
|
-
readonly issuer: IssuerId;
|
|
53
|
-
readonly subject: string;
|
|
54
|
-
};
|
|
55
|
-
readonly etag: Etag;
|
|
56
|
-
readonly schema: Schema;
|
|
57
|
-
readonly requirements: Requirements;
|
|
58
|
-
readonly manifest?: Manifest;
|
|
59
|
-
readonly bindings: {
|
|
60
|
-
readonly callables: readonly CallableBinding[];
|
|
61
|
-
readonly views: readonly ViewBinding[];
|
|
62
|
-
};
|
|
63
|
-
readonly routes: readonly HttpRoute[];
|
|
64
|
-
readonly delivery?: DeliveryEndpoint;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* @deprecated Content of a v2/v3 Publication before its ETag is computed; use the release
|
|
68
|
-
* `Content` from `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4). Only
|
|
69
|
-
* version 3 is sealed; version 2 is read-only retained evidence.
|
|
70
|
-
*/
|
|
71
|
-
export type Content = Omit<Publication, 'etag' | 'version'> & {
|
|
72
|
-
readonly version: 3;
|
|
73
|
-
};
|
|
74
|
-
/** The ETag-covered content of any admitted Publication, including retained version 2. */
|
|
75
|
-
export type EtagContent = Omit<Publication, 'etag'>;
|
|
76
|
-
/**
|
|
77
|
-
* @deprecated Seals a v2/v3 Publication; use the release `seal` from
|
|
78
|
-
* `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
|
|
79
|
-
*/
|
|
80
|
-
export declare function seal(input: Content): Publication;
|
|
81
|
-
/**
|
|
82
|
-
* @deprecated Admits a v2/v3 Publication; use the release `accept` from
|
|
83
|
-
* `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
|
|
84
|
-
*/
|
|
85
|
-
export declare function accept(input: unknown): Publication;
|
|
86
|
-
/**
|
|
87
|
-
* @deprecated Encodes a v2/v3 Publication byte-identically to its accepted wire form; use the
|
|
88
|
-
* release `encode` from `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
|
|
89
|
-
*/
|
|
90
|
-
export declare function encode(input: Publication): Uint8Array;
|