@astrale-os/sdk 0.6.0-beta.23 → 0.6.0-beta.24
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/README.md +30 -36
- package/dist/application/define.d.ts +3 -1
- package/dist/application/define.js +16 -2
- package/dist/application/domain.d.ts +3 -1
- package/dist/application/index.d.ts +1 -1
- package/dist/application/mutation/index.d.ts +1 -1
- package/dist/application/query/composite/plan.d.ts +0 -4
- package/dist/application/query/composite/plan.js +0 -2
- package/dist/application/view/define.js +4 -6
- package/dist/application/view/frontend.d.ts +2 -2
- package/dist/application/view/index.d.ts +1 -1
- package/dist/application/view/route.d.ts +0 -14
- package/dist/application/view/route.js +1 -64
- package/dist/deployment/adapter/adapter.d.ts +3 -20
- package/dist/deployment/adapter/bundle/file.d.ts +1 -1
- package/dist/deployment/adapter/define.d.ts +4 -25
- package/dist/deployment/adapter/define.js +12 -44
- package/dist/deployment/adapter/index.d.ts +0 -2
- package/dist/deployment/adapter/release/list.d.ts +1 -2
- package/dist/deployment/address/summary.d.ts +3 -7
- package/dist/deployment/authoring.d.ts +0 -2
- package/dist/deployment/authoring.js +0 -1
- package/dist/deployment/build/build.d.ts +6 -0
- package/dist/deployment/build/compile.js +2 -0
- package/dist/deployment/build/frontend/compilation.d.ts +2 -4
- package/dist/deployment/build/frontend/compilation.js +0 -5
- package/dist/deployment/build/frontend/digest.js +1 -5
- package/dist/deployment/build/material.d.ts +2 -2
- package/dist/deployment/build/material.js +28 -13
- package/dist/deployment/deployment.d.ts +4 -8
- package/dist/deployment/index.d.ts +3 -5
- package/dist/deployment/index.js +1 -2
- package/dist/deployment/release/addressing.d.ts +2 -9
- package/dist/deployment/release/addressing.js +2 -3
- package/dist/deployment/release/index.d.ts +0 -2
- package/dist/deployment/release/index.js +0 -2
- package/dist/deployment/release/release.d.ts +1 -1
- package/dist/deployment/release/runtime.d.ts +0 -2
- package/dist/deployment/release/runtime.js +0 -2
- package/dist/deployment/release/served/index.d.ts +1 -2
- package/dist/deployment/release/served/index.js +7 -3
- package/dist/deployment/release/served/views.js +0 -1
- package/dist/deployment/verify/index.d.ts +2 -4
- package/dist/deployment/verify/index.js +1 -3
- package/dist/deployment/verify/preflight/index.d.ts +0 -12
- package/dist/deployment/verify/preflight/index.js +0 -12
- package/dist/deployment/verify/readiness/index.d.ts +2 -6
- package/dist/deployment/verify/readiness/index.js +3 -12
- package/dist/deployment/worker/response.d.ts +1 -4
- package/dist/deployment/worker/response.js +2 -8
- package/dist/execution/identity/delivery.d.ts +2 -7
- package/dist/execution/identity/delivery.js +1 -23
- package/dist/execution/identity/identity.d.ts +2 -3
- package/dist/execution/index.d.ts +1 -3
- package/dist/execution/index.js +1 -2
- package/dist/execution/invocation/admission/authority.d.ts +4 -5
- package/dist/execution/invocation/admission/authority.js +1 -2
- package/dist/execution/invocation/index.d.ts +2 -2
- package/dist/execution/invocation/index.js +1 -1
- package/dist/execution/invocation/invocation.js +3 -12
- package/dist/execution/invocation/result/errors.d.ts +0 -10
- package/dist/execution/invocation/result/errors.js +0 -17
- package/dist/execution/invocation/result/index.d.ts +2 -2
- package/dist/execution/invocation/result/index.js +1 -1
- package/dist/execution/runtime/release.d.ts +6 -11
- package/dist/execution/runtime/release.js +2 -9
- package/dist/execution/service/create.js +3 -1
- package/dist/execution/service/service.d.ts +2 -3
- package/dist/execution/service/serving/delivery.d.ts +1 -2
- package/dist/execution/service/serving/delivery.js +1 -2
- package/dist/execution/service/serving/source.d.ts +3 -10
- package/dist/execution/service/serving/source.js +1 -5
- package/dist/execution/workflows/index.d.ts +1 -1
- package/dist/execution/workflows/index.js +1 -1
- package/dist/execution/workflows/options.d.ts +0 -6
- package/dist/execution/workflows/options.js +0 -18
- package/dist/execution/workflows/receiver.d.ts +1 -2
- package/dist/execution/workflows/receiver.js +13 -20
- package/dist/execution/workflows/route.d.ts +1 -3
- package/dist/execution/workflows/route.js +4 -9
- package/dist/execution/workflows/run.d.ts +1 -1
- package/dist/execution/workflows/run.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/platform/graph/alias.d.ts +1 -5
- package/dist/platform/graph/alias.js +1 -5
- package/dist/platform/graph/document/index.d.ts +1 -1
- package/dist/platform/graph/document/index.js +1 -1
- package/dist/platform/graph/index.d.ts +1 -1
- package/dist/platform/graph/index.js +1 -1
- package/dist/platform/release/index.d.ts +1 -26
- package/dist/platform/release/index.js +1 -26
- package/dist/platform/schema/class-icon-svg.d.ts +9 -0
- package/dist/platform/schema/class-icon-svg.js +29 -0
- package/dist/platform/schema/class-icon.d.ts +3 -8
- package/dist/platform/schema/class-icon.js +2 -29
- package/dist/platform/schema/index.d.ts +1 -1
- package/dist/platform/schema/schema-authoring.d.ts +14 -7
- package/dist/platform/schema/schema-authoring.js +5 -1
- package/dist/project/admit.js +0 -4
- package/dist/project/install-command.d.ts +0 -4
- package/dist/project/install-command.js +1 -5
- package/dist/tooling/cli/deploy-mode.d.ts +3 -59
- package/dist/tooling/cli/deploy-mode.js +46 -122
- package/dist/tooling/cli/deploy-result.d.ts +10 -15
- package/dist/tooling/cli/help.js +9 -16
- package/dist/tooling/cli/immutable-deployment.d.ts +3 -3
- package/dist/tooling/cli/index.d.ts +1 -1
- package/dist/tooling/cli/list.d.ts +5 -7
- package/dist/tooling/cli/list.js +9 -61
- package/dist/tooling/cli/orchestrate.js +6 -16
- package/dist/tooling/cli/publish/index.d.ts +2 -2
- package/dist/tooling/cli/registry/client.js +1 -1
- package/dist/tooling/cli/secrets.d.ts +2 -2
- package/dist/tooling/linter/implementations/source/global.js +0 -1
- package/dist/tooling/linter/implementations/source/verifiers.js +0 -2
- package/dist/tooling/linter/policy/generated.js +2 -51
- package/dist/tooling/linter/requirements/registry.js +0 -6
- package/package.json +6 -6
- package/dist/application/query/execution/projection.d.ts +0 -3
- package/dist/application/query/execution/projection.js +0 -3
- package/dist/deployment/adapter/legacy/adapter.d.ts +0 -40
- package/dist/deployment/adapter/legacy/adapter.js +0 -1
- package/dist/deployment/adapter/legacy/deploy/context.d.ts +0 -19
- package/dist/deployment/adapter/legacy/deploy/context.js +0 -1
- package/dist/deployment/adapter/legacy/deploy/index.d.ts +0 -2
- package/dist/deployment/adapter/legacy/deploy/index.js +0 -1
- package/dist/deployment/adapter/legacy/deploy/result.d.ts +0 -89
- package/dist/deployment/adapter/legacy/deploy/result.js +0 -1
- package/dist/deployment/adapter/legacy/index.d.ts +0 -24
- package/dist/deployment/adapter/legacy/index.js +0 -1
- package/dist/deployment/adapter/legacy/prepare/artifact.d.ts +0 -43
- package/dist/deployment/adapter/legacy/prepare/artifact.js +0 -1
- package/dist/deployment/adapter/legacy/prepare/context.d.ts +0 -33
- package/dist/deployment/adapter/legacy/prepare/context.js +0 -1
- package/dist/deployment/adapter/legacy/prepare/index.d.ts +0 -2
- package/dist/deployment/adapter/legacy/prepare/index.js +0 -1
- package/dist/deployment/deploy.d.ts +0 -20
- package/dist/deployment/deploy.js +0 -31
- package/dist/deployment/release/legacy/admission.d.ts +0 -3
- package/dist/deployment/release/legacy/admission.js +0 -8
- package/dist/deployment/release/legacy/assemble.d.ts +0 -5
- package/dist/deployment/release/legacy/assemble.js +0 -20
- package/dist/deployment/release/legacy/index.d.ts +0 -35
- package/dist/deployment/release/legacy/index.js +0 -34
- package/dist/deployment/release/legacy/release.d.ts +0 -12
- package/dist/deployment/release/legacy/release.js +0 -1
- package/dist/deployment/release/legacy/seal.d.ts +0 -10
- package/dist/deployment/release/legacy/seal.js +0 -17
- package/dist/deployment/verify/preflight/artifact.d.ts +0 -6
- package/dist/deployment/verify/preflight/artifact.js +0 -122
- package/dist/deployment/verify/preflight/publication.d.ts +0 -4
- package/dist/deployment/verify/preflight/publication.js +0 -15
- package/dist/deployment/verify/readiness/deployment.d.ts +0 -3
- package/dist/deployment/verify/readiness/deployment.js +0 -143
- package/dist/deployment/verify/readiness/legacy/index.d.ts +0 -2
- package/dist/deployment/verify/readiness/legacy/index.js +0 -2
- package/dist/deployment/verify/readiness/legacy/publication.d.ts +0 -12
- package/dist/deployment/verify/readiness/legacy/publication.js +0 -23
- package/dist/execution/service/errors.d.ts +0 -3
- package/dist/execution/service/errors.js +0 -3
- package/dist/execution/service/serving/legacy/index.d.ts +0 -15
- package/dist/execution/service/serving/legacy/index.js +0 -19
- package/dist/tooling/cli/deprecations.d.ts +0 -9
- package/dist/tooling/cli/deprecations.js +0 -15
- package/dist/tooling/cli/legacy/deploy-result.d.ts +0 -28
- package/dist/tooling/cli/legacy/deploy-result.js +0 -37
- package/dist/tooling/cli/legacy/stable-target-adapter.d.ts +0 -21
- package/dist/tooling/cli/legacy/stable-target-adapter.js +0 -14
- package/dist/tooling/cli/legacy/stable-target-deploy.d.ts +0 -40
- package/dist/tooling/cli/legacy/stable-target-deploy.js +0 -102
- package/dist/tooling/cli/legacy/uploaded-build.d.ts +0 -11
- package/dist/tooling/cli/legacy/uploaded-build.js +0 -22
- package/dist/tooling/linter/implementations/source/migrations.d.ts +0 -2
- package/dist/tooling/linter/implementations/source/migrations.js +0 -113
- package/dist/tooling/linter/qualification/index.d.ts +0 -10
- package/dist/tooling/linter/qualification/index.js +0 -2
- package/dist/tooling/linter/qualification/query-fixtures.d.ts +0 -2
- package/dist/tooling/linter/qualification/query-fixtures.js +0 -68
- package/dist/tooling/linter/qualification/runner.d.ts +0 -3
- package/dist/tooling/linter/qualification/runner.js +0 -6
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as protocolPublication from '@astrale-os/kernel-protocol/release/legacy';
|
|
2
|
-
import * as routes from '@astrale-os/kernel-protocol/routes';
|
|
3
|
-
import { evidenceOf } from '../../build/admission.js';
|
|
4
|
-
import { assemble } from '../../release/legacy/index.js';
|
|
5
|
-
/** Verify locally assemblable Publication evidence before any provider mutation. */
|
|
6
|
-
export function publication(artifact) {
|
|
7
|
-
if (artifact.addressing.kind !== 'configured')
|
|
8
|
-
return undefined;
|
|
9
|
-
const release = assemble(artifact.build, artifact.addressing.addressing);
|
|
10
|
-
const admitted = protocolPublication.accept(release.publication);
|
|
11
|
-
protocolPublication.verifyBundleBytes(admitted, artifact.build.schema.bundle.bytes());
|
|
12
|
-
const { domain } = evidenceOf(artifact.build);
|
|
13
|
-
routes.legacy.verifyTable(release.routes, admitted, domain);
|
|
14
|
-
return release;
|
|
15
|
-
}
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { isRelease } from '../../release/legacy/index.js';
|
|
2
|
-
import { isPreparedArtifact } from '../preflight/artifact.js';
|
|
3
|
-
/** Admit adapter-reported progress without changing its mutation knowledge. */
|
|
4
|
-
export function verifyDeployment(artifact, input) {
|
|
5
|
-
if (!isPreparedArtifact(artifact))
|
|
6
|
-
throw new TypeError('PreparedArtifact is not admitted.');
|
|
7
|
-
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
8
|
-
invalid();
|
|
9
|
-
const release = input.release === undefined ? undefined : verifyRelease(artifact, input.release);
|
|
10
|
-
const progress = verifyProgress(artifact, input.progress, release);
|
|
11
|
-
if (input.status === 'ready') {
|
|
12
|
-
exact(input, ['status', 'phase', 'progress', 'release']);
|
|
13
|
-
if (input.phase !== 'complete' ||
|
|
14
|
-
release === undefined ||
|
|
15
|
-
progress.provider.kind !== 'applied' ||
|
|
16
|
-
progress.provider.evidence.issuer === undefined ||
|
|
17
|
-
!terminal(progress.prerequisite) ||
|
|
18
|
-
!terminal(progress.configuration)) {
|
|
19
|
-
invalid();
|
|
20
|
-
}
|
|
21
|
-
return Object.freeze({ status: 'ready', phase: 'complete', progress, release });
|
|
22
|
-
}
|
|
23
|
-
if (input.status === 'failed') {
|
|
24
|
-
exact(input, ['status', 'phase', 'progress', 'error'], ['release']);
|
|
25
|
-
if (!['prerequisite', 'provider', 'addressing', 'release', 'configuration', 'readiness'].includes(input.phase) ||
|
|
26
|
-
!(input.error instanceof Error)) {
|
|
27
|
-
invalid();
|
|
28
|
-
}
|
|
29
|
-
return Object.freeze({
|
|
30
|
-
status: 'failed',
|
|
31
|
-
phase: input.phase,
|
|
32
|
-
progress,
|
|
33
|
-
error: input.error,
|
|
34
|
-
...(release === undefined ? {} : { release }),
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
return invalid();
|
|
38
|
-
}
|
|
39
|
-
function verifyRelease(artifact, release) {
|
|
40
|
-
if (!isRelease(release) || release.build !== artifact.build) {
|
|
41
|
-
throw new TypeError('DeployResult Release differs from the PreparedArtifact Build.');
|
|
42
|
-
}
|
|
43
|
-
if (artifact.addressing.kind === 'configured' &&
|
|
44
|
-
(release.addressing.issuer !== artifact.addressing.addressing.issuer ||
|
|
45
|
-
release.addressing.publicUrl !== artifact.addressing.addressing.publicUrl)) {
|
|
46
|
-
throw new TypeError('DeployResult Release differs from configured Addressing.');
|
|
47
|
-
}
|
|
48
|
-
return release;
|
|
49
|
-
}
|
|
50
|
-
function verifyProgress(artifact, input, release) {
|
|
51
|
-
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
52
|
-
invalid();
|
|
53
|
-
exact(input, ['prerequisite', 'provider', 'configuration']);
|
|
54
|
-
return Object.freeze({
|
|
55
|
-
prerequisite: knowledge(input.prerequisite),
|
|
56
|
-
provider: providerKnowledge(artifact, input.provider, release),
|
|
57
|
-
configuration: knowledge(input.configuration),
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
function providerKnowledge(artifact, input, release) {
|
|
61
|
-
if (input?.kind === 'partial') {
|
|
62
|
-
exact(input, ['kind'], ['evidence']);
|
|
63
|
-
if (input.evidence === undefined)
|
|
64
|
-
return Object.freeze({ kind: 'partial' });
|
|
65
|
-
const evidence = providerEvidence(input.evidence);
|
|
66
|
-
if (evidence.artifact !== artifact.digest) {
|
|
67
|
-
throw new TypeError('Provider deployment evidence differs from the PreparedArtifact digest.');
|
|
68
|
-
}
|
|
69
|
-
if (release !== undefined &&
|
|
70
|
-
evidence.issuer !== undefined &&
|
|
71
|
-
evidence.issuer !== release.addressing.issuer) {
|
|
72
|
-
throw new TypeError('Provider deployment evidence differs from the Release issuer.');
|
|
73
|
-
}
|
|
74
|
-
return Object.freeze({ kind: 'partial', evidence });
|
|
75
|
-
}
|
|
76
|
-
if (input?.kind !== 'applied')
|
|
77
|
-
return knowledge(input);
|
|
78
|
-
exact(input, ['kind', 'evidence']);
|
|
79
|
-
const evidence = providerEvidence(input.evidence);
|
|
80
|
-
if (evidence.artifact !== artifact.digest) {
|
|
81
|
-
throw new TypeError('Provider deployment evidence differs from the PreparedArtifact digest.');
|
|
82
|
-
}
|
|
83
|
-
if (release !== undefined &&
|
|
84
|
-
evidence.issuer !== undefined &&
|
|
85
|
-
evidence.issuer !== release.addressing.issuer) {
|
|
86
|
-
throw new TypeError('Provider deployment evidence differs from the Release issuer.');
|
|
87
|
-
}
|
|
88
|
-
return Object.freeze({ kind: 'applied', evidence });
|
|
89
|
-
}
|
|
90
|
-
function terminal(input) {
|
|
91
|
-
return input.kind === 'none' || input.kind === 'applied';
|
|
92
|
-
}
|
|
93
|
-
function providerEvidence(input) {
|
|
94
|
-
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
95
|
-
invalid();
|
|
96
|
-
exact(input, ['provider', 'deployment', 'artifact'], ['build', 'issuer', 'preflight']);
|
|
97
|
-
if (typeof input.provider !== 'string' ||
|
|
98
|
-
input.provider.length === 0 ||
|
|
99
|
-
input.provider.trim() !== input.provider ||
|
|
100
|
-
typeof input.deployment !== 'string' ||
|
|
101
|
-
input.deployment.length === 0 ||
|
|
102
|
-
input.deployment.trim() !== input.deployment ||
|
|
103
|
-
typeof input.artifact !== 'string' ||
|
|
104
|
-
(input.build !== undefined &&
|
|
105
|
-
(typeof input.build !== 'string' || !/^sha256:[0-9a-f]{64}$/u.test(input.build))) ||
|
|
106
|
-
(input.issuer !== undefined && typeof input.issuer !== 'string') ||
|
|
107
|
-
(input.preflight !== undefined &&
|
|
108
|
-
input.preflight !== 'passed' &&
|
|
109
|
-
input.preflight !== 'unavailable')) {
|
|
110
|
-
invalid();
|
|
111
|
-
}
|
|
112
|
-
return Object.freeze({ ...input });
|
|
113
|
-
}
|
|
114
|
-
function knowledge(input) {
|
|
115
|
-
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
116
|
-
invalid();
|
|
117
|
-
if (input.kind === 'applied') {
|
|
118
|
-
exact(input, ['kind', 'evidence']);
|
|
119
|
-
return Object.freeze({ kind: 'applied', evidence: input.evidence });
|
|
120
|
-
}
|
|
121
|
-
if (input.kind === 'partial') {
|
|
122
|
-
exact(input, ['kind'], ['evidence']);
|
|
123
|
-
return Object.freeze({
|
|
124
|
-
kind: 'partial',
|
|
125
|
-
...(input.evidence === undefined ? {} : { evidence: input.evidence }),
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
if (input.kind === 'none' || input.kind === 'unknown') {
|
|
129
|
-
exact(input, ['kind']);
|
|
130
|
-
return Object.freeze({ kind: input.kind });
|
|
131
|
-
}
|
|
132
|
-
return invalid();
|
|
133
|
-
}
|
|
134
|
-
function exact(input, required, optional = []) {
|
|
135
|
-
const allowed = new Set([...required, ...optional]);
|
|
136
|
-
if (required.some((key) => !Object.hasOwn(input, key)) ||
|
|
137
|
-
Reflect.ownKeys(input).some((key) => typeof key !== 'string' || !allowed.has(key))) {
|
|
138
|
-
invalid();
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
function invalid() {
|
|
142
|
-
throw new TypeError('DeployResult is invalid.');
|
|
143
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as publication from '@astrale-os/kernel-protocol/release/legacy';
|
|
2
|
-
import type * as legacy from '../../../release/legacy/index.js';
|
|
3
|
-
import type { ReadinessOptions } from '../fetch.js';
|
|
4
|
-
/**
|
|
5
|
-
* Fetch and verify the exact live Publication and Bundle a stable target serves at `domain.json`.
|
|
6
|
-
*
|
|
7
|
-
* @deprecated Replacement: `verifyRelease`, the readiness of an immutable deployment at
|
|
8
|
-
* `release.json` (release digest and build digest). Consumer: the direct-mode deploy path of
|
|
9
|
-
* adapter-cloudflare (the consumers of `deployment/release/legacy/index.ts`).
|
|
10
|
-
* Removal: D10, with that path.
|
|
11
|
-
*/
|
|
12
|
-
export declare function verifyPublication(release: legacy.Release, options?: ReadinessOptions): Promise<publication.Publication>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as publication from '@astrale-os/kernel-protocol/release/legacy';
|
|
2
|
-
import { bounded, fetchRequired, MAXIMUM_BUNDLE_BYTES, MAXIMUM_DOCUMENT_BYTES, text, } from '../fetch.js';
|
|
3
|
-
/**
|
|
4
|
-
* Fetch and verify the exact live Publication and Bundle a stable target serves at `domain.json`.
|
|
5
|
-
*
|
|
6
|
-
* @deprecated Replacement: `verifyRelease`, the readiness of an immutable deployment at
|
|
7
|
-
* `release.json` (release digest and build digest). Consumer: the direct-mode deploy path of
|
|
8
|
-
* adapter-cloudflare (the consumers of `deployment/release/legacy/index.ts`).
|
|
9
|
-
* Removal: D10, with that path.
|
|
10
|
-
*/
|
|
11
|
-
export async function verifyPublication(release, options = {}) {
|
|
12
|
-
const fetcher = options.fetch ?? globalThis.fetch;
|
|
13
|
-
const publicationUrl = publication.url(release.addressing.publicUrl);
|
|
14
|
-
const response = await fetchRequired(fetcher, publicationUrl, options.signal);
|
|
15
|
-
const deployed = publication.accept(JSON.parse(await text(response, publicationUrl, MAXIMUM_DOCUMENT_BYTES)));
|
|
16
|
-
if (!publication.matchesReference(deployed, publication.reference(release.publication))) {
|
|
17
|
-
throw new Error('Live Publication differs from the expected Release.');
|
|
18
|
-
}
|
|
19
|
-
const bundleResponse = await fetchRequired(fetcher, deployed.schema.bundle.href, options.signal);
|
|
20
|
-
const bytes = new Uint8Array(await bounded(bundleResponse, deployed.schema.bundle.href, MAXIMUM_BUNDLE_BYTES));
|
|
21
|
-
publication.decodeBundle(deployed, bytes);
|
|
22
|
-
return deployed;
|
|
23
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { PublicationSource } from '@astrale-os/kernel-server';
|
|
2
|
-
import type * as legacy from '../../../../deployment/release/legacy/index.js';
|
|
3
|
-
import type { LoadedRuntime } from '../../../runtime/index.js';
|
|
4
|
-
/**
|
|
5
|
-
* Serve a stable target's v3 Publication through the Kernel Server's v3-input source: `domain.json`
|
|
6
|
-
* only (404 at `release.json`), with the same-schema continuity of a stable Worker.
|
|
7
|
-
*
|
|
8
|
-
* @deprecated Replacement: the release source of `../source.ts`, which serves an immutable
|
|
9
|
-
* deployment's `DomainRelease` v4. Consumer: the stable Worker of the direct-mode path (the
|
|
10
|
-
* consumers of `deployment/release/legacy/index.ts`), whose host binds no build digest. Removal:
|
|
11
|
-
* D10, with `deployment/release/legacy/` and Kernel Server's `publication` source.
|
|
12
|
-
*/
|
|
13
|
-
export declare function publicationSource(runtime: LoadedRuntime, served: legacy.Release): {
|
|
14
|
-
readonly publication: PublicationSource;
|
|
15
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { preparePublicationSnapshot } from '@astrale-os/kernel-server';
|
|
2
|
-
/**
|
|
3
|
-
* Serve a stable target's v3 Publication through the Kernel Server's v3-input source: `domain.json`
|
|
4
|
-
* only (404 at `release.json`), with the same-schema continuity of a stable Worker.
|
|
5
|
-
*
|
|
6
|
-
* @deprecated Replacement: the release source of `../source.ts`, which serves an immutable
|
|
7
|
-
* deployment's `DomainRelease` v4. Consumer: the stable Worker of the direct-mode path (the
|
|
8
|
-
* consumers of `deployment/release/legacy/index.ts`), whose host binds no build digest. Removal:
|
|
9
|
-
* D10, with `deployment/release/legacy/` and Kernel Server's `publication` source.
|
|
10
|
-
*/
|
|
11
|
-
export function publicationSource(runtime, served) {
|
|
12
|
-
const snapshot = preparePublicationSnapshot({
|
|
13
|
-
publication: served.publication,
|
|
14
|
-
bundle: served.build.schema.bundle.bytes(),
|
|
15
|
-
table: served.routes,
|
|
16
|
-
domain: runtime.domain,
|
|
17
|
-
});
|
|
18
|
-
return Object.freeze({ publication: Object.freeze({ current: () => snapshot }) });
|
|
19
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { FrontendCompilation } from '../../deployment/build/frontend/index.js';
|
|
2
|
-
/**
|
|
3
|
-
* What a build still declares that the SDK has deprecated, one line each for its author. A View's
|
|
4
|
-
* iframe requirements change nothing it receives: every trusted View gets the Shell's shared browser
|
|
5
|
-
* profile, and Astrale hosts refuse requirements beyond it.
|
|
6
|
-
*/
|
|
7
|
-
export declare function deprecationWarnings(build: {
|
|
8
|
-
readonly frontend?: FrontendCompilation;
|
|
9
|
-
}): readonly string[];
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What a build still declares that the SDK has deprecated, one line each for its author. A View's
|
|
3
|
-
* iframe requirements change nothing it receives: every trusted View gets the Shell's shared browser
|
|
4
|
-
* profile, and Astrale hosts refuse requirements beyond it.
|
|
5
|
-
*/
|
|
6
|
-
export function deprecationWarnings(build) {
|
|
7
|
-
return (build.frontend?.routes ?? []).flatMap(({ view, iframe }) => {
|
|
8
|
-
if (iframe === undefined)
|
|
9
|
-
return [];
|
|
10
|
-
const declared = [...(iframe.sandbox ?? []), ...(iframe.allow ?? [])].join(', ');
|
|
11
|
-
return [
|
|
12
|
-
`View ${view} declares iframe requirements (${declared}), which are deprecated: every trusted View receives the Shell's shared browser profile, and Astrale hosts refuse requirements beyond it. Remove its \`iframe\` field.`,
|
|
13
|
-
];
|
|
14
|
-
});
|
|
15
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { ReadyDeployResult } from '../../../deployment/index.js';
|
|
2
|
-
import type { DeployResultV1 } from '../deploy-result.js';
|
|
3
|
-
/**
|
|
4
|
-
* The deploy result of a stable target: the legacy direct-mode path (`prepare`/`deploy` adapter
|
|
5
|
-
* operations) replaces the code its stable target runs in place and serves a v3 Publication, so
|
|
6
|
-
* the result names no release, no build digest, no provider script, no secrets state and no commit.
|
|
7
|
-
* Those operations report a provider deployment identifier (a Worker version id, a Services
|
|
8
|
-
* deployment digest), never the script they replace; that identifier stays on the stderr
|
|
9
|
-
* `Deployment:` progress line and never fills `deployment.script`. Its URL is the public URL
|
|
10
|
-
* `astrale domain install` fetches, which differs from the issuer only under adapter-cloudflare
|
|
11
|
-
* `identityIssuer`.
|
|
12
|
-
*
|
|
13
|
-
* @deprecated Stable-target deploy path only. Replacement: `deployResult`, the result of an
|
|
14
|
-
* immutable deployment. Consumers: the direct-mode configurations of domains ai-gateway, closing,
|
|
15
|
-
* grc, integrations and issues (until SV15), domains organization (until it leaves direct mode,
|
|
16
|
-
* AM-147), the Services `beta` and `prod` (until SV12), `development` (until SV9) and frozen
|
|
17
|
-
* `admin-beta` (until D19) environments, shell (until SH2) and its frozen `legacy-v3` (until D22),
|
|
18
|
-
* and ui:domain (until UI1). Deleted with the legacy deploy path (D10), once no configuration on
|
|
19
|
-
* any repository's main selects it (CT33, AM-147).
|
|
20
|
-
*/
|
|
21
|
-
export declare function stableTargetDeployResult(input: {
|
|
22
|
-
readonly environment: string;
|
|
23
|
-
readonly adapter: {
|
|
24
|
-
readonly name: string;
|
|
25
|
-
readonly version: string;
|
|
26
|
-
};
|
|
27
|
-
readonly deployment: ReadyDeployResult;
|
|
28
|
-
}): DeployResultV1;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The deploy result of a stable target: the legacy direct-mode path (`prepare`/`deploy` adapter
|
|
3
|
-
* operations) replaces the code its stable target runs in place and serves a v3 Publication, so
|
|
4
|
-
* the result names no release, no build digest, no provider script, no secrets state and no commit.
|
|
5
|
-
* Those operations report a provider deployment identifier (a Worker version id, a Services
|
|
6
|
-
* deployment digest), never the script they replace; that identifier stays on the stderr
|
|
7
|
-
* `Deployment:` progress line and never fills `deployment.script`. Its URL is the public URL
|
|
8
|
-
* `astrale domain install` fetches, which differs from the issuer only under adapter-cloudflare
|
|
9
|
-
* `identityIssuer`.
|
|
10
|
-
*
|
|
11
|
-
* @deprecated Stable-target deploy path only. Replacement: `deployResult`, the result of an
|
|
12
|
-
* immutable deployment. Consumers: the direct-mode configurations of domains ai-gateway, closing,
|
|
13
|
-
* grc, integrations and issues (until SV15), domains organization (until it leaves direct mode,
|
|
14
|
-
* AM-147), the Services `beta` and `prod` (until SV12), `development` (until SV9) and frozen
|
|
15
|
-
* `admin-beta` (until D19) environments, shell (until SH2) and its frozen `legacy-v3` (until D22),
|
|
16
|
-
* and ui:domain (until UI1). Deleted with the legacy deploy path (D10), once no configuration on
|
|
17
|
-
* any repository's main selects it (CT33, AM-147).
|
|
18
|
-
*/
|
|
19
|
-
export function stableTargetDeployResult(input) {
|
|
20
|
-
const { publication, addressing } = input.deployment.release;
|
|
21
|
-
return Object.freeze({
|
|
22
|
-
format: 'astrale.deploy-result',
|
|
23
|
-
version: 1,
|
|
24
|
-
origin: publication.origin,
|
|
25
|
-
environment: input.environment,
|
|
26
|
-
url: addressing.publicUrl,
|
|
27
|
-
release: null,
|
|
28
|
-
build: null,
|
|
29
|
-
schema: Object.freeze({ revision: publication.schema.revision }),
|
|
30
|
-
deployment: Object.freeze({
|
|
31
|
-
adapter: `${input.adapter.name}@${input.adapter.version}`,
|
|
32
|
-
script: null,
|
|
33
|
-
state: 'replaced',
|
|
34
|
-
}),
|
|
35
|
-
commit: null,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Adapter, LegacyAdapter } from '../../../deployment/adapter/index.js';
|
|
2
|
-
/**
|
|
3
|
-
* An adapter that serves the legacy direct-mode path: a `LegacyAdapter`, or an adapter interface
|
|
4
|
-
* v2 that keeps `prepare` and `deploy` for its direct-mode Environments.
|
|
5
|
-
*
|
|
6
|
-
* @deprecated Stable-target deploy path only. Replacement: `deployRelease` of adapter interface
|
|
7
|
-
* v2. Consumers: `astrale-domain deploy` on the direct-mode
|
|
8
|
-
* configurations of domains ai-gateway, closing, grc, integrations and issues (until SV15), domains
|
|
9
|
-
* organization (until it leaves direct mode, AM-147), the Services `beta` and `prod` (until SV12),
|
|
10
|
-
* `development` (until SV9) and frozen `admin-beta` (until D19) environments, shell (until SH2)
|
|
11
|
-
* and its frozen `legacy-v3` (until D22), and ui:domain (until UI1). Deleted with the legacy
|
|
12
|
-
* deploy path (D10), once no configuration on any repository's main selects it (CT33, AM-147).
|
|
13
|
-
*/
|
|
14
|
-
export type StableTargetAdapter<Parameters extends object = object> = (Adapter<Parameters> | LegacyAdapter<Parameters>) & Pick<LegacyAdapter<Parameters>, 'prepare' | 'deploy'>;
|
|
15
|
-
/**
|
|
16
|
-
* The adapter of an Environment the stable-target path deploys, with its `prepare` and `deploy`.
|
|
17
|
-
* An adapter that implements only adapter interface v2 has neither, and this path cannot deploy it.
|
|
18
|
-
*
|
|
19
|
-
* @deprecated Stable-target deploy path only; see `StableTargetAdapter`.
|
|
20
|
-
*/
|
|
21
|
-
export declare function stableTargetAdapter<Parameters extends object>(adapter: Adapter<Parameters> | LegacyAdapter<Parameters>): StableTargetAdapter<Parameters>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The adapter of an Environment the stable-target path deploys, with its `prepare` and `deploy`.
|
|
3
|
-
* An adapter that implements only adapter interface v2 has neither, and this path cannot deploy it.
|
|
4
|
-
*
|
|
5
|
-
* @deprecated Stable-target deploy path only; see `StableTargetAdapter`.
|
|
6
|
-
*/
|
|
7
|
-
export function stableTargetAdapter(adapter) {
|
|
8
|
-
if (typeof adapter.prepare !== 'function' || typeof adapter.deploy !== 'function') {
|
|
9
|
-
throw new TypeError(`Adapter ${adapter.name}@${adapter.version} implements only adapter interface v2 ` +
|
|
10
|
-
'(deployRelease); this astrale-domain deploys through prepare and deploy, the legacy ' +
|
|
11
|
-
'direct-mode path, and never calls deployRelease.');
|
|
12
|
-
}
|
|
13
|
-
return adapter;
|
|
14
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { Build, ResolvedRuntimeReference } from '../../../deployment/index.js';
|
|
2
|
-
import type { LegacyDirectReason } from '../deploy-mode.js';
|
|
3
|
-
import type { DeployResultV1 } from '../deploy-result.js';
|
|
4
|
-
import type { LoadedEnvironment } from '../project.js';
|
|
5
|
-
/**
|
|
6
|
-
* What a direct-mode deploy prints on stderr before any effect (AM-59): its Environment replaces
|
|
7
|
-
* one stable target in place and serves a v3 Publication only, which the deployment model
|
|
8
|
-
* replaces with one immutable deployment per release.
|
|
9
|
-
*
|
|
10
|
-
* @deprecated Stable-target deploy path only; see `deployStableTarget`.
|
|
11
|
-
*/
|
|
12
|
-
export declare function directModeDeprecation(environment: string, reasons: readonly LegacyDirectReason[]): string;
|
|
13
|
-
/**
|
|
14
|
-
* Deploy one Environment on the legacy direct-mode path (CT33): bundle exactly as
|
|
15
|
-
* `astrale-domain build` does, let `prepare` place that Bundle at the Environment's stable target
|
|
16
|
-
* and `deploy` replace the code it runs, then verify the v3 Publication it serves. It warns first,
|
|
17
|
-
* then behaves exactly as before. The SDK never installs the deployed Domain here and makes no
|
|
18
|
-
* Kernel call of its own.
|
|
19
|
-
*
|
|
20
|
-
* Returns the deploy result, or nothing once a failure is reported on stderr.
|
|
21
|
-
*
|
|
22
|
-
* @deprecated Stable-target deploy path only. Replacement: `deployImmutable`, the immutable
|
|
23
|
-
* deployment of one sealed release through `deployRelease`. Consumers: the direct-mode
|
|
24
|
-
* configurations of domains ai-gateway, closing, grc, integrations and issues (until SV15), domains
|
|
25
|
-
* organization (until it leaves direct mode, AM-147), the Services `beta` and `prod` (until SV12),
|
|
26
|
-
* `development` (until SV9) and frozen `admin-beta` (until D19) environments, shell (until SH2)
|
|
27
|
-
* and its frozen `legacy-v3` (until D22), and ui:domain (until UI1). Deleted with the legacy deploy
|
|
28
|
-
* path (D10), once no configuration on any repository's main selects it (CT33, AM-147).
|
|
29
|
-
*/
|
|
30
|
-
export declare function deployStableTarget(input: {
|
|
31
|
-
readonly projectDir: string;
|
|
32
|
-
readonly environment: string;
|
|
33
|
-
readonly definition: LoadedEnvironment;
|
|
34
|
-
readonly reasons: readonly LegacyDirectReason[];
|
|
35
|
-
readonly build: Build;
|
|
36
|
-
readonly runtime: ResolvedRuntimeReference;
|
|
37
|
-
readonly identity?: string;
|
|
38
|
-
readonly signal: AbortSignal;
|
|
39
|
-
readonly report: (line: string) => void;
|
|
40
|
-
}): Promise<DeployResultV1 | undefined>;
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { verifyDeployment, verifyPreflight } from '../../../deployment/index.js';
|
|
2
|
-
import { bundleBuild } from '../build.js';
|
|
3
|
-
import { error, warn } from '../log.js';
|
|
4
|
-
import { environmentSecrets } from '../secrets.js';
|
|
5
|
-
import { stableTargetDeployResult } from './deploy-result.js';
|
|
6
|
-
import { stableTargetAdapter } from './stable-target-adapter.js';
|
|
7
|
-
import { stableTargetBuildWarning } from './uploaded-build.js';
|
|
8
|
-
/**
|
|
9
|
-
* What a direct-mode deploy prints on stderr before any effect (AM-59): its Environment replaces
|
|
10
|
-
* one stable target in place and serves a v3 Publication only, which the deployment model
|
|
11
|
-
* replaces with one immutable deployment per release.
|
|
12
|
-
*
|
|
13
|
-
* @deprecated Stable-target deploy path only; see `deployStableTarget`.
|
|
14
|
-
*/
|
|
15
|
-
export function directModeDeprecation(environment, reasons) {
|
|
16
|
-
const selected = reasons.map((reason) => {
|
|
17
|
-
if (reason.reason === 'direct-parameter')
|
|
18
|
-
return reason.parameter;
|
|
19
|
-
return reason.reason === 'no-namespace' ? 'no namespace' : 'no deployRelease';
|
|
20
|
-
});
|
|
21
|
-
return (`Environment ${environment} deploys in direct mode (${selected.join(', ')}), which is ` +
|
|
22
|
-
'deprecated and will be removed: it replaces one stable target in place and serves a v3 ' +
|
|
23
|
-
'Publication only. Its replacement deploys one immutable deployment per release, through an ' +
|
|
24
|
-
'adapter that implements deployRelease.');
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Deploy one Environment on the legacy direct-mode path (CT33): bundle exactly as
|
|
28
|
-
* `astrale-domain build` does, let `prepare` place that Bundle at the Environment's stable target
|
|
29
|
-
* and `deploy` replace the code it runs, then verify the v3 Publication it serves. It warns first,
|
|
30
|
-
* then behaves exactly as before. The SDK never installs the deployed Domain here and makes no
|
|
31
|
-
* Kernel call of its own.
|
|
32
|
-
*
|
|
33
|
-
* Returns the deploy result, or nothing once a failure is reported on stderr.
|
|
34
|
-
*
|
|
35
|
-
* @deprecated Stable-target deploy path only. Replacement: `deployImmutable`, the immutable
|
|
36
|
-
* deployment of one sealed release through `deployRelease`. Consumers: the direct-mode
|
|
37
|
-
* configurations of domains ai-gateway, closing, grc, integrations and issues (until SV15), domains
|
|
38
|
-
* organization (until it leaves direct mode, AM-147), the Services `beta` and `prod` (until SV12),
|
|
39
|
-
* `development` (until SV9) and frozen `admin-beta` (until D19) environments, shell (until SH2)
|
|
40
|
-
* and its frozen `legacy-v3` (until D22), and ui:domain (until UI1). Deleted with the legacy deploy
|
|
41
|
-
* path (D10), once no configuration on any repository's main selects it (CT33, AM-147).
|
|
42
|
-
*/
|
|
43
|
-
export async function deployStableTarget(input) {
|
|
44
|
-
const { build, signal, report } = input;
|
|
45
|
-
warn(directModeDeprecation(input.environment, input.reasons));
|
|
46
|
-
const adapter = stableTargetAdapter(input.definition.deployment.adapter);
|
|
47
|
-
const parameters = input.definition.deployment.parameters;
|
|
48
|
-
// `deploy` rebuilds exactly as `build` does; preparation then only places that Bundle.
|
|
49
|
-
const bundle = await bundleBuild({
|
|
50
|
-
bundler: adapter.bundler,
|
|
51
|
-
projectDir: input.projectDir,
|
|
52
|
-
build,
|
|
53
|
-
runtime: input.runtime,
|
|
54
|
-
signal,
|
|
55
|
-
});
|
|
56
|
-
const source = await adapter.prepare(parameters, {
|
|
57
|
-
projectDir: input.projectDir,
|
|
58
|
-
environment: input.environment,
|
|
59
|
-
mode: 'release',
|
|
60
|
-
signal,
|
|
61
|
-
build,
|
|
62
|
-
runtime: input.runtime,
|
|
63
|
-
bundle,
|
|
64
|
-
});
|
|
65
|
-
const artifact = verifyPreflight({ build, runtime: input.runtime, source });
|
|
66
|
-
const secrets = environmentSecrets(adapter, parameters, input.projectDir, input.runtime.runtime);
|
|
67
|
-
const deployed = await adapter.deploy(parameters, {
|
|
68
|
-
projectDir: input.projectDir,
|
|
69
|
-
environment: input.environment,
|
|
70
|
-
...(input.identity === undefined ? {} : { identity: input.identity }),
|
|
71
|
-
secrets,
|
|
72
|
-
artifact,
|
|
73
|
-
signal,
|
|
74
|
-
});
|
|
75
|
-
const result = verifyDeployment(artifact, deployed);
|
|
76
|
-
if (result.status === 'failed') {
|
|
77
|
-
error(`Deployment failed during ${result.phase}: ${result.error.message}`);
|
|
78
|
-
return undefined;
|
|
79
|
-
}
|
|
80
|
-
const uploaded = result.progress.provider.evidence.build;
|
|
81
|
-
if (uploaded !== undefined) {
|
|
82
|
-
// prepare/deploy places a stable target: a differing upload only warns.
|
|
83
|
-
const warning = stableTargetBuildWarning(bundle, uploaded);
|
|
84
|
-
if (warning !== undefined)
|
|
85
|
-
warn(warning);
|
|
86
|
-
}
|
|
87
|
-
report(`Domain: ${result.release.publication.origin}`);
|
|
88
|
-
report(`Environment: ${input.environment}`);
|
|
89
|
-
report(`Adapter: ${adapter.name}@${adapter.version}`);
|
|
90
|
-
report(`Deployment: ${result.progress.provider.evidence.deployment}`);
|
|
91
|
-
if (result.progress.provider.evidence.preflight !== undefined) {
|
|
92
|
-
report(`Preflight: ${result.progress.provider.evidence.preflight}; public readiness verified`);
|
|
93
|
-
}
|
|
94
|
-
report(`Public: ${result.release.addressing.publicUrl}`);
|
|
95
|
-
report(`Publication: ${result.release.publication.schema.revision} · ${result.release.publication.etag}`);
|
|
96
|
-
report('Ready: deployment verified');
|
|
97
|
-
return stableTargetDeployResult({
|
|
98
|
-
environment: input.environment,
|
|
99
|
-
adapter,
|
|
100
|
-
deployment: result,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Bundle, BuildDigest } from '../../../deployment/index.js';
|
|
2
|
-
/**
|
|
3
|
-
* What a stable-target deploy prints when its upload does not carry the build digest
|
|
4
|
-
* `astrale-domain build` gives for the same tree. A stable target never serves a build digest, so
|
|
5
|
-
* the deployment proceeds with this warning where an immutable deployment refuses the upload.
|
|
6
|
-
*
|
|
7
|
-
* @deprecated Stable-target deploy path (`prepare`/`deploy` adapter operations) only. Replacement:
|
|
8
|
-
* `verifyUploadedBuild`, which refuses the upload of an immutable deployment. Deleted with the
|
|
9
|
-
* legacy deploy path, once no supported configuration selects it (CT33).
|
|
10
|
-
*/
|
|
11
|
-
export declare function stableTargetBuildWarning(bundle: Bundle, uploaded: BuildDigest): string | undefined;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { verifyUploadedBuild } from '../../../deployment/index.js';
|
|
2
|
-
import { isBundle } from '../../../deployment/verify/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* What a stable-target deploy prints when its upload does not carry the build digest
|
|
5
|
-
* `astrale-domain build` gives for the same tree. A stable target never serves a build digest, so
|
|
6
|
-
* the deployment proceeds with this warning where an immutable deployment refuses the upload.
|
|
7
|
-
*
|
|
8
|
-
* @deprecated Stable-target deploy path (`prepare`/`deploy` adapter operations) only. Replacement:
|
|
9
|
-
* `verifyUploadedBuild`, which refuses the upload of an immutable deployment. Deleted with the
|
|
10
|
-
* legacy deploy path, once no supported configuration selects it (CT33).
|
|
11
|
-
*/
|
|
12
|
-
export function stableTargetBuildWarning(bundle, uploaded) {
|
|
13
|
-
if (!isBundle(bundle))
|
|
14
|
-
throw new TypeError('Uploaded build check requires an admitted Bundle.');
|
|
15
|
-
try {
|
|
16
|
-
verifyUploadedBuild(bundle, uploaded);
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
catch (refusal) {
|
|
20
|
-
return `${refusal.message} A stable target never serves a build digest, so this deployment proceeds; an immutable deployment refuses this upload.`;
|
|
21
|
-
}
|
|
22
|
-
}
|