@fabrika/provider-zerops 0.8.2 → 0.9.0-cloudflare.2
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 +16 -14
- package/src/api/client.ts +6 -0
- package/src/api/types.ts +12 -0
- package/src/cli.ts +11 -0
- package/src/collaborators.ts +0 -14
- package/src/control.ts +33 -57
- package/src/execution.ts +113 -102
- package/src/installation/admin.ts +1 -1
- package/src/installation/deploy-options.ts +1 -2
- package/src/installation/deploy.ts +41 -75
- package/src/installation/generated/platform-console-schema.ts +3 -0
- package/src/installation/generated/platform-proxy-manifest.ts +21 -1
- package/src/installation/guide.md +9 -6
- package/src/installation/hosts.ts +1 -7
- package/src/installation/index.ts +0 -13
- package/src/installation/init-options.ts +2 -1
- package/src/installation/install-environment.ts +42 -106
- package/src/installation/install-options.ts +3 -1
- package/src/installation/install-secrets.ts +24 -68
- package/src/installation/install.ts +8 -4
- package/src/installation/sidecar.ts +5 -26
- package/src/installation/topology/setups.ts +5 -0
- package/src/installation/upgrade-options.ts +2 -2
- package/src/managed-env.ts +1 -174
- package/src/manifest.ts +11 -14
- package/src/namespace/claims.ts +56 -1
- package/src/namespace/errors.ts +1 -1
- package/src/namespace/manifest.ts +6 -19
- package/src/namespace/provisioning.ts +15 -3
- package/src/namespace/proxy-attempt.ts +43 -2
- package/src/namespace/proxy-reads.ts +12 -22
- package/src/namespace-cli.ts +152 -0
- package/src/plan.ts +2 -7
- package/src/provider.ts +128 -126
- package/src/proxy-manifest-carrier.ts +18 -0
- package/src/types.ts +0 -2
- package/types/src/api/client.d.ts +5 -0
- package/types/src/api/errors.d.ts +24 -0
- package/types/src/api/polling.d.ts +41 -0
- package/types/src/api/readers.d.ts +1115 -0
- package/types/src/api/service-env-limit.d.ts +17 -0
- package/types/src/api/service-env-response.d.ts +23 -0
- package/types/src/api/types.d.ts +687 -0
- package/types/src/api.d.ts +6 -0
- package/types/src/authoring.d.ts +9 -0
- package/types/src/cli-args.d.ts +19 -0
- package/types/src/cli.d.ts +13 -0
- package/types/src/collaborators.d.ts +16 -0
- package/types/src/compile.d.ts +91 -0
- package/types/src/control.d.ts +40 -0
- package/types/src/database-budget.d.ts +38 -0
- package/types/src/descriptor.d.ts +28 -0
- package/types/src/execution.d.ts +125 -0
- package/types/src/exposure.d.ts +47 -0
- package/types/src/index.d.ts +31 -0
- package/types/src/installation/admin-options.d.ts +24 -0
- package/types/src/installation/admin.d.ts +35 -0
- package/types/src/installation/checker-release.d.ts +12 -0
- package/types/src/installation/deploy-options.d.ts +37 -0
- package/types/src/installation/deploy.d.ts +136 -0
- package/types/src/installation/generated/platform-console-schema.d.ts +2 -0
- package/types/src/installation/generated/platform-proxy-manifest.d.ts +2 -0
- package/types/src/installation/hosts.d.ts +34 -0
- package/types/src/installation/index.d.ts +7 -0
- package/types/src/installation/init-options.d.ts +38 -0
- package/types/src/installation/init.d.ts +60 -0
- package/types/src/installation/install-collaborators.d.ts +24 -0
- package/types/src/installation/install-environment.d.ts +63 -0
- package/types/src/installation/install-options.d.ts +49 -0
- package/types/src/installation/install-project.d.ts +13 -0
- package/types/src/installation/install-provisioning.d.ts +58 -0
- package/types/src/installation/install-secrets.d.ts +17 -0
- package/types/src/installation/install-token.d.ts +10 -0
- package/types/src/installation/install.d.ts +23 -0
- package/types/src/installation/installation-source.d.ts +8 -0
- package/types/src/installation/log.d.ts +44 -0
- package/types/src/installation/machine-key.d.ts +19 -0
- package/types/src/installation/placement-options.d.ts +11 -0
- package/types/src/installation/platform-archive.d.ts +7 -0
- package/types/src/installation/platform-source.d.ts +8 -0
- package/types/src/installation/platform-upload.d.ts +3 -0
- package/types/src/installation/sidecar.d.ts +49 -0
- package/types/src/installation/source-options.d.ts +1 -0
- package/types/src/installation/topology/artifacts.d.ts +8 -0
- package/types/src/installation/topology/index.d.ts +5 -0
- package/types/src/installation/topology/installation-schemas.d.ts +2242 -0
- package/types/src/installation/topology/invariants.d.ts +23 -0
- package/types/src/installation/topology/setups.d.ts +59 -0
- package/types/src/installation/topology/topology.d.ts +153 -0
- package/types/src/installation/topology/validate.d.ts +11 -0
- package/types/src/installation/upgrade-options.d.ts +26 -0
- package/types/src/installation/upgrade-output.d.ts +6 -0
- package/types/src/installation/upgrade.d.ts +88 -0
- package/types/src/managed-env.d.ts +24 -0
- package/types/src/manifest.d.ts +204 -0
- package/types/src/namespace/claims.d.ts +16 -0
- package/types/src/namespace/codec.d.ts +334 -0
- package/types/src/namespace/constants.d.ts +25 -0
- package/types/src/namespace/errors.d.ts +15 -0
- package/types/src/namespace/manifest.d.ts +4 -0
- package/types/src/namespace/operator.d.ts +12 -0
- package/types/src/namespace/provisioning.d.ts +4 -0
- package/types/src/namespace/proxy-attempt.d.ts +39 -0
- package/types/src/namespace/proxy-reads.d.ts +22 -0
- package/types/src/namespace/proxy-secrets.d.ts +8 -0
- package/types/src/namespace/proxy-source.d.ts +74 -0
- package/types/src/namespace/topology.d.ts +9 -0
- package/types/src/namespace/types.d.ts +101 -0
- package/types/src/namespace/update.d.ts +6 -0
- package/types/src/namespace/validation.d.ts +12 -0
- package/types/src/namespace-cli.d.ts +2 -0
- package/types/src/namespace.d.ts +9 -0
- package/types/src/plan.d.ts +11 -0
- package/types/src/provider.d.ts +63 -0
- package/types/src/proxy-manifest-carrier.d.ts +24 -0
- package/types/src/schema.generated.d.ts +376 -0
- package/types/src/service-names.d.ts +4 -0
- package/types/src/service-references.d.ts +13 -0
- package/types/src/source/constants.d.ts +6 -0
- package/types/src/source/port.d.ts +60 -0
- package/types/src/source/types.d.ts +4 -0
- package/types/src/source/validation.d.ts +19 -0
- package/types/src/source.d.ts +2 -0
- package/types/src/types.d.ts +119 -0
- package/types/src/version-attempt.d.ts +8 -0
- package/src/installation/mcp.ts +0 -102
- package/src/installation/proxy-manifest.ts +0 -214
- package/src/installation/secrets.ts +0 -78
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const parsePlatformScheme: (raw: string | undefined) => "http" | "https";
|
|
2
|
+
export declare const parsePlatformHostname: (raw: string) => string;
|
|
3
|
+
export declare const parsePlatformHosts: (raw: {
|
|
4
|
+
iam: string | undefined;
|
|
5
|
+
control: string | undefined;
|
|
6
|
+
operations: string | undefined;
|
|
7
|
+
}) => {
|
|
8
|
+
iam: string;
|
|
9
|
+
control: string;
|
|
10
|
+
operations: string;
|
|
11
|
+
} | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ZeropsSourceDataFile } from '../source/port';
|
|
2
|
+
/**
|
|
3
|
+
* The prepared platform archive plus the one generated data file (ADR-0045): every entry of the commit is copied
|
|
4
|
+
* byte for byte, and the file is appended after the last one. A commit that already holds the path, as a file or
|
|
5
|
+
* as a directory, is refused rather than overridden.
|
|
6
|
+
*/
|
|
7
|
+
export declare const archiveWithDataFile: (compressed: Uint8Array<ArrayBuffer>, file: ZeropsSourceDataFile) => Uint8Array<ArrayBuffer>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ZeropsArtifactSourceDescriptor } from '../index';
|
|
2
|
+
export interface PreparedPlatformSource {
|
|
3
|
+
commitSha: string;
|
|
4
|
+
descriptor: ZeropsArtifactSourceDescriptor;
|
|
5
|
+
archivePath: string;
|
|
6
|
+
dispose(): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare function preparePlatformSource(sourceDir: string, signal: AbortSignal): Promise<PreparedPlatformSource>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type PlatformUploadFetch = (url: string, init: RequestInit) => Promise<Response>;
|
|
2
|
+
export declare const validatePlatformUploadUrl: (value: string) => void;
|
|
3
|
+
export declare const uploadPlatformArchive: (url: string, archive: Blob, signal: AbortSignal, uploadFetch: PlatformUploadFetch) => Promise<void>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** Everything the scaffold stages: the CLI-owned trio plus the operator-owned, write-once pin. */
|
|
2
|
+
export declare const SIDECAR_FILES: readonly [".gitignore", "README.md", "fabrika.ref", ".github/workflows/platform.yml"];
|
|
3
|
+
/** The file that pins which published fabrika tag this installation runs. */
|
|
4
|
+
export declare const FABRIKA_REF_FILE = "fabrika.ref";
|
|
5
|
+
/** The generated pipeline. CLI-owned: `init` and `upgrade` both rewrite it. */
|
|
6
|
+
export declare const SIDECAR_WORKFLOW_PATH = ".github/workflows/platform.yml";
|
|
7
|
+
/** What a rendered sidecar repository is named after. */
|
|
8
|
+
export interface SidecarValues {
|
|
9
|
+
/** The operator's name for this installation. The GitHub Environment is named after it too. */
|
|
10
|
+
readonly installation: string;
|
|
11
|
+
/** `<owner>/<name>` of the sidecar repository itself. */
|
|
12
|
+
readonly repo: string;
|
|
13
|
+
/** The published fabrika tag to pin, used only when `fabrika.ref` does not exist yet. */
|
|
14
|
+
readonly fabrikaRef: string;
|
|
15
|
+
}
|
|
16
|
+
/** The generated pipeline for one installation. Its only placeholder is the installation, which names its GitHub Environment. */
|
|
17
|
+
export declare const renderSidecarWorkflow: (installation: string) => Promise<string>;
|
|
18
|
+
/**
|
|
19
|
+
* The installation a sidecar's current workflow was rendered for, read back from its GitHub Environment.
|
|
20
|
+
*
|
|
21
|
+
* Not from the repository name: `init --repo` accepts any name, and a workflow rendered for the wrong
|
|
22
|
+
* Environment deploys with no credentials.
|
|
23
|
+
*/
|
|
24
|
+
export declare const readSidecarWorkflowInstallation: (dir: string) => Promise<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Write the sidecar files into `dir`.
|
|
27
|
+
*
|
|
28
|
+
* The workflow, the README and the `.gitignore` are CLI-owned and refreshed on every run, so a fix to
|
|
29
|
+
* the generated pipeline reaches every installation on its operator's next `init` (and the workflow on
|
|
30
|
+
* the next `upgrade`). `fabrika.ref` is
|
|
31
|
+
* written ONLY when absent: bumping it is how an operator rolls the installation forward, and a refresh
|
|
32
|
+
* that reset it would silently roll them back.
|
|
33
|
+
*
|
|
34
|
+
* An existing `fabrika.ref` is validated rather than ignored — a sidecar that has drifted onto a branch
|
|
35
|
+
* is exactly the case the two gates exist for, and finding it here beats finding it in a failed run.
|
|
36
|
+
*/
|
|
37
|
+
export declare const materializeSidecarScaffold: (dir: string, values: SidecarValues) => Promise<void>;
|
|
38
|
+
/** The pin a checkout carries, for the closing summary. */
|
|
39
|
+
export declare const readPinnedTag: (dir: string) => Promise<string>;
|
|
40
|
+
/**
|
|
41
|
+
* The default sidecar repository for an installation, following the predecessor's `vozka-platform-<account>`
|
|
42
|
+
* precedent: named so its relation to the installation is obvious. A parameter, never a constant — one
|
|
43
|
+
* operator's installations are not another's.
|
|
44
|
+
*/
|
|
45
|
+
export declare const defaultSidecarRepo: (installation: string) => string;
|
|
46
|
+
/** Where the sidecar is checked out locally: `./fabrika-zerops-<installation>` under the cwd. */
|
|
47
|
+
/** The sidecar checkout's directory name when `--checkout` is not given; `init` creates it and `upgrade` reads it. */
|
|
48
|
+
export declare const defaultCheckoutName: (installation: string) => string;
|
|
49
|
+
export declare const defaultCheckoutDir: (installation: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const readInstallationSourceDir: (argv: readonly string[], env: Record<string, string | undefined>) => string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** One file to write, with a path relative to the repository root. */
|
|
2
|
+
export interface Artifact {
|
|
3
|
+
/** Repo-relative, POSIX-separated. */
|
|
4
|
+
path: string;
|
|
5
|
+
content: string;
|
|
6
|
+
}
|
|
7
|
+
/** Every artifact this package generates, in a stable order. */
|
|
8
|
+
export declare const generatedArtifacts: () => Artifact[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { type Artifact, generatedArtifacts } from './artifacts';
|
|
2
|
+
export { assertCorePackageIsExplicit, assertOnlyPublicService, assertZeropsHostnames } from './invariants';
|
|
3
|
+
export { fabrikaZeropsYaml, PROXY_HEALTH_PORT, PROXY_PUBLIC_PORTS } from './setups';
|
|
4
|
+
export { appsTopology, type CompiledDocument, type CompiledTopology, compileTopology, fabrikaTopologies, platformTopology, PROXY_HOSTNAME, } from './topology';
|
|
5
|
+
export { assertArtifactMatchesSchema, parseYaml, validateYaml } from './validate';
|