@fabrika/provider-cloudflare 0.9.0-dev.4 → 0.9.0-dev.6
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/package.json +11 -10
- package/src/authoring.ts +56 -6
- package/src/bounds.ts +145 -4
- package/src/cli.ts +14 -0
- package/src/command.ts +29 -4
- package/src/contract-support.ts +235 -0
- package/src/control.ts +55 -118
- package/src/deploy-order.ts +35 -0
- package/src/index.ts +19 -3
- package/src/installation/init.ts +11 -18
- package/src/installation/installation.ts +2 -4
- package/src/installation/scaffold.ts +29 -2
- package/src/installation/templates/README.md +29 -11
- package/src/installation/templates/platform.yml +9 -5
- package/src/managed-secrets.ts +61 -0
- package/src/plan.ts +13 -3
- package/src/provider.ts +455 -64
- package/src/proxy-worker.ts +40 -16
- package/src/proxy.ts +48 -16
- package/src/runner-protocol.ts +35 -2
- package/src/spa-assets.ts +176 -0
- package/types/src/authoring.d.ts +27 -5
- package/types/src/bounds.d.ts +19 -0
- package/types/src/cli.d.ts +6 -0
- package/types/src/command.d.ts +8 -3
- package/types/src/contract-support.d.ts +80 -0
- package/types/src/control.d.ts +108 -69
- package/types/src/deploy-order.d.ts +8 -0
- package/types/src/index.d.ts +3 -3
- package/types/src/managed-secrets.d.ts +19 -0
- package/types/src/plan.d.ts +2 -1
- package/types/src/provider.d.ts +38 -1
- package/types/src/proxy-worker.d.ts +1 -0
- package/types/src/proxy.d.ts +21 -0
- package/types/src/runner-protocol.d.ts +32 -0
- package/types/src/spa-assets.d.ts +28 -0
|
@@ -24,6 +24,27 @@ export declare const RUNNER_OUTCOME_FILE_ENV = "FABRIKA_RUNNER_OUTCOME_FILE";
|
|
|
24
24
|
export declare const INSTALLATION_APPS_ENV = "FABRIKA_INSTALLATION_APPS";
|
|
25
25
|
/** The executor's copy of `CloudflareRunnerJob.crossOrigins`: a JSON array of the environment's exact origins. */
|
|
26
26
|
export declare const CROSS_ORIGINS_ENV = "FABRIKA_CROSS_ORIGINS";
|
|
27
|
+
/** The executor's copy of `CloudflareRunnerJob.operationsOrigin`: the origin of the environment's Operations ingest. */
|
|
28
|
+
export declare const OPERATIONS_ORIGIN_ENV = "FABRIKA_OPERATIONS_ORIGIN";
|
|
29
|
+
/** The executor's copy of `CloudflareRunnerJob.applicationObjects`: JSON `{ object, objects }`, the pointer Control records. */
|
|
30
|
+
export declare const APPLICATION_OBJECTS_ENV = "FABRIKA_RUNNER_APPLICATION_OBJECTS";
|
|
31
|
+
/**
|
|
32
|
+
* The serving object and the listed objects as the job and the executor carry them: the shape `parseApplicationObjects`
|
|
33
|
+
* accepts, so a pointer the application would refuse never reaches a deploy.
|
|
34
|
+
*/
|
|
35
|
+
export declare const applicationObjectsSchema: z.ZodEffects<z.ZodObject<{
|
|
36
|
+
object: z.ZodString;
|
|
37
|
+
objects: z.ZodArray<z.ZodString, "many">;
|
|
38
|
+
}, "strict", z.ZodTypeAny, {
|
|
39
|
+
object: string;
|
|
40
|
+
objects: string[];
|
|
41
|
+
}, {
|
|
42
|
+
object: string;
|
|
43
|
+
objects: string[];
|
|
44
|
+
}>, import("@fabrika/auth-core").ApplicationObjects, {
|
|
45
|
+
object: string;
|
|
46
|
+
objects: string[];
|
|
47
|
+
}>;
|
|
27
48
|
/**
|
|
28
49
|
* The access Control approved for a run (ADR-0050): the contract it read at the commit, in this release's model, and
|
|
29
50
|
* the digest the application's own framework release computes for it. The proxy table and `FABRIKA_CONTRACT_DIGEST`
|
|
@@ -34,23 +55,34 @@ export interface RunnerApprovedAccess {
|
|
|
34
55
|
readonly kind: 'contract';
|
|
35
56
|
readonly contract: ContractArtifact;
|
|
36
57
|
readonly contractDigest: string;
|
|
58
|
+
/**
|
|
59
|
+
* The framework release the application pins (`applicationRelease`), which every release gate of the deployer reads:
|
|
60
|
+
* the Durable Object from 0.9, the stateless Worker before it. An older Control sends its reader's
|
|
61
|
+
* release here, a newer patch of the same minor. Absent from a Control older than the runner, which deploys the
|
|
62
|
+
* older shape.
|
|
63
|
+
*/
|
|
64
|
+
readonly framework?: string;
|
|
37
65
|
}
|
|
38
66
|
export declare const runnerApprovedAccessSchema: z.ZodEffects<z.ZodObject<{
|
|
39
67
|
kind: z.ZodLiteral<"contract">;
|
|
40
68
|
contract: z.ZodUnknown;
|
|
41
69
|
contractDigest: z.ZodEffects<z.ZodString, string, string>;
|
|
70
|
+
framework: z.ZodOptional<z.ZodString>;
|
|
42
71
|
}, "strict", z.ZodTypeAny, {
|
|
43
72
|
kind: "contract";
|
|
44
73
|
contractDigest: string;
|
|
45
74
|
contract?: unknown;
|
|
75
|
+
framework?: string | undefined;
|
|
46
76
|
}, {
|
|
47
77
|
kind: "contract";
|
|
48
78
|
contractDigest: string;
|
|
49
79
|
contract?: unknown;
|
|
80
|
+
framework?: string | undefined;
|
|
50
81
|
}>, RunnerApprovedAccess, {
|
|
51
82
|
kind: "contract";
|
|
52
83
|
contractDigest: string;
|
|
53
84
|
contract?: unknown;
|
|
85
|
+
framework?: string | undefined;
|
|
54
86
|
}>;
|
|
55
87
|
/** Where the runner leaves the job's `RunnerApprovedAccess` as JSON for the executor — beside the checkout, never inside it. */
|
|
56
88
|
export declare const APPROVED_ACCESS_FILE_ENV = "FABRIKA_APPROVED_ACCESS_FILE";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ContractArtifact } from '@fabrika/auth-core';
|
|
2
|
+
/** Where the deploy stages the mounts' files, beside the generated `wrangler.jsonc` of the application Worker. */
|
|
3
|
+
export declare const SPA_ASSETS_DIRECTORY = "fabrika/assets";
|
|
4
|
+
/** The `assets` the platform writes into an application Worker that declares none and has a mount with files. */
|
|
5
|
+
export declare const SPA_ASSETS: {
|
|
6
|
+
readonly directory: "fabrika/assets";
|
|
7
|
+
readonly binding: "ASSETS";
|
|
8
|
+
readonly run_worker_first: true;
|
|
9
|
+
};
|
|
10
|
+
/** A mount that serves files: its prefix, and its build directory relative to the application's root. */
|
|
11
|
+
export interface AssetMount {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly prefix: string;
|
|
14
|
+
readonly dir: string;
|
|
15
|
+
}
|
|
16
|
+
/** Every SPA and link mount of the contract with the directory its files come from, the most specific prefix first. */
|
|
17
|
+
export declare const assetMounts: (contract: ContractArtifact) => readonly AssetMount[];
|
|
18
|
+
/**
|
|
19
|
+
* Copy each mount's build directory under `root` into `target` at its prefix, after removing whatever `target` held. A
|
|
20
|
+
* file of a mount that lies under a longer mount's prefix is that mount's path, so it is left out; a source map is never
|
|
21
|
+
* served (the platform build uploads it to Operations), so it is left out too, and so is Workers Assets' own
|
|
22
|
+
* configuration at the root (`ASSET_CONFIG_PATHS`), what the mount's `.assetsignore` excludes, and version control
|
|
23
|
+
* metadata (`VCS_NAMES`) at any depth. A mount whose directory is missing, a symbolic link anywhere on
|
|
24
|
+
* its path or in its tree, or anything but a regular file or a directory is refused: the staged tree is uploaded
|
|
25
|
+
* publicly, and a link would publish its target. `target` is `SPA_ASSETS_DIRECTORY` under `base`, with no link on the
|
|
26
|
+
* way either. Returns how many files it staged.
|
|
27
|
+
*/
|
|
28
|
+
export declare const stageSpaAssets: (mounts: readonly AssetMount[], root: string, base: string) => Promise<number>;
|