@wtfalch/foundry 0.59.0 → 0.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apps/cloudflare.d.ts +173 -0
- package/dist/apps/cloudflare.js +17 -0
- package/dist/apps/deploy.d.ts +116 -0
- package/dist/apps/deploy.js +791 -0
- package/dist/apps/github.d.ts +47 -0
- package/dist/apps/github.js +201 -0
- package/dist/apps/index.d.ts +9 -0
- package/dist/apps/index.js +9 -0
- package/dist/apps/migrations.d.ts +110 -0
- package/dist/apps/migrations.js +458 -0
- package/dist/audit/connector.d.ts +43 -0
- package/dist/audit/connector.js +22 -0
- package/dist/audit/evidence.d.ts +49 -0
- package/dist/audit/evidence.js +56 -0
- package/dist/audit/index.d.ts +9 -0
- package/dist/audit/index.js +9 -0
- package/dist/audit/migrations.d.ts +5 -0
- package/dist/audit/migrations.js +5 -0
- package/dist/audit/registry.d.ts +49 -0
- package/dist/audit/registry.js +44 -0
- package/dist/audit/seal.d.ts +49 -0
- package/dist/audit/seal.js +131 -0
- package/dist/audit/sealer-role.d.ts +33 -0
- package/dist/audit/sealer-role.js +56 -0
- package/dist/audit/signer.d.ts +40 -0
- package/dist/audit/signer.js +78 -0
- package/dist/audit/tick.d.ts +36 -0
- package/dist/audit/tick.js +87 -0
- package/dist/catalogue/copy-en.d.ts +1 -0
- package/dist/catalogue/copy-en.js +129 -0
- package/dist/catalogue/index.d.ts +9 -0
- package/dist/catalogue/index.js +21 -0
- package/dist/catalogue/integrations.d.ts +4 -0
- package/dist/catalogue/integrations.js +104 -0
- package/dist/catalogue/systems.d.ts +7 -0
- package/dist/catalogue/systems.js +31 -0
- package/dist/catalogue/types.d.ts +110 -0
- package/dist/catalogue/types.js +1 -0
- package/dist/entry-rules.d.ts +53 -0
- package/dist/entry-rules.js +71 -0
- package/dist/hosted-label.d.ts +13 -0
- package/dist/hosted-label.js +81 -0
- package/dist/index.d.ts +10 -5
- package/dist/index.js +5 -3
- package/dist/migrations/0062_hosting_github.sql +6 -0
- package/dist/migrations/0063_boule_apps.sql +7 -0
- package/dist/migrations/0064_requested_changes_boule_apps.sql +6 -0
- package/dist/modules/ai.d.ts +3 -0
- package/dist/modules/ai.js +64 -0
- package/dist/modules/assistants.d.ts +3 -0
- package/dist/modules/assistants.js +72 -0
- package/dist/modules/audit-ledger.d.ts +29 -0
- package/dist/modules/audit-ledger.js +49 -0
- package/dist/modules/audit.d.ts +7 -0
- package/dist/modules/audit.js +44 -0
- package/dist/modules/database.d.ts +23 -0
- package/dist/modules/database.js +189 -0
- package/dist/modules/email.d.ts +3 -0
- package/dist/modules/email.js +18 -0
- package/dist/modules/entry-parts.d.ts +23 -0
- package/dist/modules/entry-parts.js +63 -0
- package/dist/modules/files.d.ts +3 -0
- package/dist/modules/files.js +64 -0
- package/dist/modules/index.d.ts +74 -0
- package/dist/modules/index.js +774 -0
- package/dist/modules/jobs.d.ts +3 -0
- package/dist/modules/jobs.js +23 -0
- package/dist/modules/organisations.d.ts +3 -0
- package/dist/modules/organisations.js +20 -0
- package/dist/modules/outputs.d.ts +9 -0
- package/dist/modules/outputs.js +38 -0
- package/dist/modules/sign-in.d.ts +3 -0
- package/dist/modules/sign-in.js +197 -0
- package/dist/modules/signed-records.d.ts +3 -0
- package/dist/modules/signed-records.js +32 -0
- package/dist/modules/types.d.ts +194 -0
- package/dist/modules/types.js +1 -0
- package/dist/modules/workspaces.d.ts +3 -0
- package/dist/modules/workspaces.js +75 -0
- package/dist/org.d.ts +163 -22
- package/dist/org.js +419 -47
- package/dist/plan/apps-db-route.d.ts +90 -0
- package/dist/plan/apps-db-route.js +168 -0
- package/dist/plan/apps-zones.d.ts +56 -0
- package/dist/plan/apps-zones.js +118 -0
- package/dist/plan/archon-blue-green.js +11 -1
- package/dist/plan/blue-green-apply.d.ts +37 -1
- package/dist/plan/blue-green-apply.js +55 -15
- package/dist/plan/blue-green.d.ts +41 -1
- package/dist/plan/blue-green.js +80 -2
- package/dist/plan/boule.d.ts +23 -1
- package/dist/plan/boule.js +35 -2
- package/dist/plan/broker-entries.d.ts +28 -3
- package/dist/plan/broker-entries.js +74 -3
- package/dist/plan/broker-registrar.d.ts +168 -0
- package/dist/plan/broker-registrar.js +440 -0
- package/dist/plan/broker-workspaces-database.d.ts +48 -0
- package/dist/plan/broker-workspaces-database.js +87 -0
- package/dist/plan/desktop-callback.js +12 -7
- package/dist/plan/diff.d.ts +8 -2
- package/dist/plan/diff.js +373 -42
- package/dist/plan/edge-access.d.ts +6 -0
- package/dist/plan/edge-dns.d.ts +6 -0
- package/dist/plan/edge-dns.js +9 -7
- package/dist/plan/entry-ai-key.d.ts +1 -1
- package/dist/plan/entry-ai-key.js +2 -2
- package/dist/plan/entry-audit.d.ts +58 -0
- package/dist/plan/entry-audit.js +122 -0
- package/dist/plan/entry-customer-grants.d.ts +75 -0
- package/dist/plan/entry-customer-grants.js +154 -0
- package/dist/plan/entry-edge-key.d.ts +26 -1
- package/dist/plan/entry-edge-key.js +42 -3
- package/dist/plan/entry-jobs.d.ts +64 -0
- package/dist/plan/entry-jobs.js +92 -0
- package/dist/plan/entry-repo-key-apply.d.ts +55 -0
- package/dist/plan/entry-repo-key-apply.js +185 -0
- package/dist/plan/entry-repo-key.d.ts +92 -0
- package/dist/plan/entry-repo-key.js +235 -0
- package/dist/plan/entry-workspaces.d.ts +55 -0
- package/dist/plan/entry-workspaces.js +90 -0
- package/dist/plan/executor.d.ts +191 -1
- package/dist/plan/executor.js +1505 -90
- package/dist/plan/gates.d.ts +1 -1
- package/dist/plan/gates.js +62 -9
- package/dist/plan/github-deploy-keys.d.ts +78 -0
- package/dist/plan/github-deploy-keys.js +305 -0
- package/dist/plan/github-source.d.ts +53 -0
- package/dist/plan/github-source.js +140 -0
- package/dist/plan/held-key-refs.d.ts +12 -0
- package/dist/plan/held-key-refs.js +12 -0
- package/dist/plan/hostnames.d.ts +9 -0
- package/dist/plan/hostnames.js +28 -1
- package/dist/plan/index.d.ts +9 -0
- package/dist/plan/index.js +6 -0
- package/dist/plan/jobs-scheduler-http.js +3 -0
- package/dist/plan/keys-registrar-http.d.ts +32 -0
- package/dist/plan/keys-registrar-http.js +105 -0
- package/dist/plan/keys-registrar.d.ts +67 -0
- package/dist/plan/keys-registrar.js +103 -0
- package/dist/plan/live.d.ts +1 -1
- package/dist/plan/locked-hostnames.d.ts +2 -2
- package/dist/plan/locked-hostnames.js +2 -2
- package/dist/plan/login-host.js +11 -5
- package/dist/plan/machine-paths.d.ts +36 -0
- package/dist/plan/machine-paths.js +137 -0
- package/dist/plan/mcp.d.ts +1 -1
- package/dist/plan/mcp.js +49 -17
- package/dist/plan/org-apps-admin.d.ts +108 -0
- package/dist/plan/org-apps-admin.js +434 -0
- package/dist/plan/org-names.js +12 -1
- package/dist/plan/own-diff.d.ts +23 -0
- package/dist/plan/own-diff.js +53 -0
- package/dist/plan/own-hostnames.d.ts +2 -0
- package/dist/plan/own-hostnames.js +1 -0
- package/dist/plan/own-jobs-route.d.ts +47 -0
- package/dist/plan/own-jobs-route.js +91 -0
- package/dist/plan/own-services.d.ts +4 -0
- package/dist/plan/own-services.js +4 -0
- package/dist/plan/plan-apply.d.ts +39 -0
- package/dist/plan/plan-apply.js +163 -9
- package/dist/plan/platform-diff.d.ts +2 -2
- package/dist/plan/platform-diff.js +7 -2
- package/dist/plan/platform-org.d.ts +30 -0
- package/dist/plan/platform-org.js +12 -1
- package/dist/plan/platform-providers.d.ts +2 -0
- package/dist/plan/platform-providers.js +7 -2
- package/dist/plan/post-logout-uris.js +7 -1
- package/dist/plan/private-pages.d.ts +26 -0
- package/dist/plan/private-pages.js +39 -0
- package/dist/plan/proxy-labels.d.ts +12 -1
- package/dist/plan/proxy-labels.js +32 -2
- package/dist/plan/release-host.d.ts +6 -2
- package/dist/plan/release-host.js +36 -8
- package/dist/plan/stage-env.d.ts +19 -1
- package/dist/plan/stage-env.js +25 -1
- package/dist/plan/stage-guards.d.ts +20 -0
- package/dist/plan/stage-guards.js +24 -0
- package/dist/plan/stage-isolation.d.ts +24 -0
- package/dist/plan/stage-isolation.js +29 -1
- package/dist/plan/worker-app-database.d.ts +47 -40
- package/dist/plan/worker-app-database.js +150 -152
- package/dist/plan/worker-app.d.ts +6 -65
- package/dist/plan/worker-app.js +29 -105
- package/dist/plan/worker.d.ts +2 -2
- package/dist/plan/worker.js +2 -1
- package/dist/plan/workspace-client.d.ts +25 -0
- package/dist/plan/workspace-client.js +48 -0
- package/dist/plan/workspace-sign-in.d.ts +55 -0
- package/dist/plan/workspace-sign-in.js +273 -0
- package/dist/plan/workspace-worker.d.ts +4 -0
- package/dist/plan/workspace-worker.js +13 -0
- package/dist/plan/workspace.d.ts +101 -0
- package/dist/plan/workspace.js +305 -0
- package/dist/release/decide.d.ts +30 -1
- package/dist/release/decide.js +73 -11
- package/dist/release/health.d.ts +8 -3
- package/dist/release/health.js +58 -5
- package/dist/release/run.d.ts +2 -5
- package/dist/release/run.js +4 -0
- package/dist/release/state.d.ts +3 -1
- package/dist/release/state.js +6 -0
- package/dist/release/types.d.ts +20 -0
- package/dist/requested-changes.d.ts +11 -2
- package/dist/requested-changes.js +11 -0
- package/dist/service-labels.d.ts +4 -0
- package/dist/service-labels.js +11 -0
- package/dist/slug.d.ts +2 -0
- package/dist/slug.js +10 -6
- package/dist/store/postgres.js +12 -2
- package/dist/store/schema.d.ts +37 -1
- package/dist/store/schema.js +4 -0
- package/dist/worker-app-config.d.ts +6 -10
- package/dist/worker-app-config.js +22 -17
- package/dist/worker-app-migrations.d.ts +105 -0
- package/dist/worker-app-migrations.js +166 -0
- package/dist/worker-app-upload.d.ts +103 -0
- package/dist/worker-app-upload.js +128 -0
- package/package.json +18 -1
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Cloudflare calls `deployWorkerApp` and `removeWorkerApp` make in a company's own account:
|
|
3
|
+
* the methods of `@wtfalch/providers/cloudflare`'s `CloudflareClient` they use, repeated
|
|
4
|
+
* structurally, so `new CloudflareClient(token, accountId)` from providers 0.15.0 is passed
|
|
5
|
+
* straight in and a test passes a fake. Every id here is one the account itself holds.
|
|
6
|
+
*
|
|
7
|
+
* Every list call returns every page (providers 0.15.0 walks `result_info`).
|
|
8
|
+
*
|
|
9
|
+
* A failed call throws an error that carries the HTTP `status` (providers' `CloudflareApiError`);
|
|
10
|
+
* foundry reads only the status, never the message, so nothing the API echoes reaches a result.
|
|
11
|
+
*/
|
|
12
|
+
export interface AppsCloudflare {
|
|
13
|
+
/** The zone of the account whose name is the longest suffix of `domain`, or `undefined`. */
|
|
14
|
+
findZoneByApex(domain: string): Promise<{
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
status: string;
|
|
18
|
+
} | undefined>;
|
|
19
|
+
listDnsRecords(zoneId: string, opts?: {
|
|
20
|
+
type?: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
}): Promise<{
|
|
23
|
+
id: string;
|
|
24
|
+
type: string;
|
|
25
|
+
content: string;
|
|
26
|
+
name: string;
|
|
27
|
+
}[]>;
|
|
28
|
+
createDnsRecord(zoneId: string, record: {
|
|
29
|
+
type: string;
|
|
30
|
+
name: string;
|
|
31
|
+
content: string;
|
|
32
|
+
proxied?: boolean;
|
|
33
|
+
}): Promise<{
|
|
34
|
+
id: string;
|
|
35
|
+
}>;
|
|
36
|
+
deleteDnsRecord(zoneId: string, recordId: string): Promise<void>;
|
|
37
|
+
listWorkerScripts(): Promise<{
|
|
38
|
+
id: string;
|
|
39
|
+
migrationTag?: string;
|
|
40
|
+
}[]>;
|
|
41
|
+
uploadWorkerModule(name: string, upload: {
|
|
42
|
+
module: Uint8Array;
|
|
43
|
+
mainModule?: string;
|
|
44
|
+
metadata: Record<string, unknown>;
|
|
45
|
+
}): Promise<void>;
|
|
46
|
+
/** A no-op when the script is gone. Removes its secrets and Durable Object namespaces. */
|
|
47
|
+
deleteWorkerScript(name: string): Promise<void>;
|
|
48
|
+
listWorkerSecrets(name: string): Promise<{
|
|
49
|
+
name: string;
|
|
50
|
+
type: string;
|
|
51
|
+
}[]>;
|
|
52
|
+
putWorkerSecret(name: string, secretName: string, text: string): Promise<void>;
|
|
53
|
+
deleteWorkerSecret(name: string, secretName: string): Promise<void>;
|
|
54
|
+
/** The account's `<name>.workers.dev` name, or `undefined` when it has none. */
|
|
55
|
+
getWorkersSubdomain(): Promise<string | undefined>;
|
|
56
|
+
setWorkerScriptSubdomain(name: string, enabled: boolean): Promise<void>;
|
|
57
|
+
listWorkerRoutes(zoneId: string): Promise<{
|
|
58
|
+
id: string;
|
|
59
|
+
pattern: string;
|
|
60
|
+
script?: string;
|
|
61
|
+
}[]>;
|
|
62
|
+
createWorkerRoute(zoneId: string, route: {
|
|
63
|
+
pattern: string;
|
|
64
|
+
script: string;
|
|
65
|
+
}): Promise<{
|
|
66
|
+
id: string;
|
|
67
|
+
}>;
|
|
68
|
+
deleteWorkerRoute(zoneId: string, routeId: string): Promise<void>;
|
|
69
|
+
listDurableObjectNamespaces(): Promise<{
|
|
70
|
+
id: string;
|
|
71
|
+
className: string;
|
|
72
|
+
script: string;
|
|
73
|
+
}[]>;
|
|
74
|
+
listContainerApplications(): Promise<{
|
|
75
|
+
id: string;
|
|
76
|
+
name: string;
|
|
77
|
+
image: string;
|
|
78
|
+
instanceType: string;
|
|
79
|
+
maxInstances: number;
|
|
80
|
+
namespaceId: string;
|
|
81
|
+
}[]>;
|
|
82
|
+
createContainerApplication(input: {
|
|
83
|
+
name: string;
|
|
84
|
+
image: string;
|
|
85
|
+
instanceType: string;
|
|
86
|
+
maxInstances: number;
|
|
87
|
+
namespaceId: string;
|
|
88
|
+
}): Promise<{
|
|
89
|
+
id: string;
|
|
90
|
+
}>;
|
|
91
|
+
updateContainerApplication(id: string, input: {
|
|
92
|
+
maxInstances: number;
|
|
93
|
+
}): Promise<void>;
|
|
94
|
+
rolloutContainerApplication(id: string, input: {
|
|
95
|
+
image: string;
|
|
96
|
+
instanceType: string;
|
|
97
|
+
description?: string;
|
|
98
|
+
}): Promise<{
|
|
99
|
+
id: string;
|
|
100
|
+
}>;
|
|
101
|
+
getContainerRollout(applicationId: string, rolloutId: string): Promise<{
|
|
102
|
+
status: string;
|
|
103
|
+
}>;
|
|
104
|
+
deleteContainerApplication(id: string): Promise<void>;
|
|
105
|
+
listHyperdriveConfigs(): Promise<{
|
|
106
|
+
id: string;
|
|
107
|
+
name: string;
|
|
108
|
+
}[]>;
|
|
109
|
+
createHyperdriveConfig(name: string, origin: HyperdriveConnection): Promise<{
|
|
110
|
+
id: string;
|
|
111
|
+
}>;
|
|
112
|
+
updateHyperdriveConfig(id: string, name: string, origin: HyperdriveConnection): Promise<{
|
|
113
|
+
id: string;
|
|
114
|
+
}>;
|
|
115
|
+
deleteHyperdriveConfig(id: string): Promise<void>;
|
|
116
|
+
listAccessApps(): Promise<{
|
|
117
|
+
id: string;
|
|
118
|
+
name: string;
|
|
119
|
+
domain: string;
|
|
120
|
+
type: string;
|
|
121
|
+
}[]>;
|
|
122
|
+
createAccessApp(app: {
|
|
123
|
+
name: string;
|
|
124
|
+
domain: string;
|
|
125
|
+
type: string;
|
|
126
|
+
session_duration?: string;
|
|
127
|
+
}): Promise<{
|
|
128
|
+
id: string;
|
|
129
|
+
}>;
|
|
130
|
+
deleteAccessApp(appId: string): Promise<void>;
|
|
131
|
+
listAccessPolicies(appId: string): Promise<{
|
|
132
|
+
id: string;
|
|
133
|
+
name: string;
|
|
134
|
+
decision: string;
|
|
135
|
+
include: unknown[];
|
|
136
|
+
}[]>;
|
|
137
|
+
createAccessPolicy(appId: string, policy: {
|
|
138
|
+
name: string;
|
|
139
|
+
decision: string;
|
|
140
|
+
include: unknown[];
|
|
141
|
+
precedence?: number;
|
|
142
|
+
}): Promise<{
|
|
143
|
+
id: string;
|
|
144
|
+
}>;
|
|
145
|
+
updateAccessPolicy(appId: string, policyId: string, policy: {
|
|
146
|
+
name: string;
|
|
147
|
+
decision: string;
|
|
148
|
+
include: unknown[];
|
|
149
|
+
precedence?: number;
|
|
150
|
+
}): Promise<{
|
|
151
|
+
id: string;
|
|
152
|
+
}>;
|
|
153
|
+
/** A no-op when the policy is gone. */
|
|
154
|
+
deleteAccessPolicy(appId: string, policyId: string): Promise<void>;
|
|
155
|
+
}
|
|
156
|
+
/** A Postgres origin for Hyperdrive, as providers sends it. */
|
|
157
|
+
export interface HyperdriveConnection {
|
|
158
|
+
host: string;
|
|
159
|
+
port: number;
|
|
160
|
+
database: string;
|
|
161
|
+
user: string;
|
|
162
|
+
password: string;
|
|
163
|
+
scheme?: 'postgres' | 'postgresql';
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* The permissions the company's API token needs, for Boule's Connections page. Names as
|
|
167
|
+
* Cloudflare's token page shows them.
|
|
168
|
+
*/
|
|
169
|
+
export declare const APPS_CLOUDFLARE_TOKEN_PERMISSIONS: readonly {
|
|
170
|
+
scope: 'Account' | 'Zone';
|
|
171
|
+
name: string;
|
|
172
|
+
why: string;
|
|
173
|
+
}[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The permissions the company's API token needs, for Boule's Connections page. Names as
|
|
3
|
+
* Cloudflare's token page shows them.
|
|
4
|
+
*/
|
|
5
|
+
export const APPS_CLOUDFLARE_TOKEN_PERMISSIONS = [
|
|
6
|
+
{ scope: 'Account', name: 'Workers Scripts: Edit', why: 'upload the app and its secrets' },
|
|
7
|
+
{ scope: 'Account', name: 'Containers: Edit', why: 'run the app’s containers' },
|
|
8
|
+
{ scope: 'Account', name: 'Hyperdrive: Edit', why: 'connect the app to its database' },
|
|
9
|
+
{
|
|
10
|
+
scope: 'Account',
|
|
11
|
+
name: 'Access: Apps and Policies: Edit',
|
|
12
|
+
why: 'keep the workspace for the people you choose',
|
|
13
|
+
},
|
|
14
|
+
{ scope: 'Zone', name: 'Zone: Read', why: 'find the domain the app is served on' },
|
|
15
|
+
{ scope: 'Zone', name: 'DNS: Edit', why: 'point the address at the app' },
|
|
16
|
+
{ scope: 'Zone', name: 'Workers Routes: Edit', why: 'send the address to the app' },
|
|
17
|
+
];
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { type HostingEntry } from '../org.js';
|
|
2
|
+
import type { AppsCloudflare } from './cloudflare.js';
|
|
3
|
+
/**
|
|
4
|
+
* One Worker app in a company's own Cloudflare account (campaign 2026-10-20, FM3). Boule calls
|
|
5
|
+
* this in-process with the company's own token; there is no org plan and no recorded state: every
|
|
6
|
+
* run reads the account and makes it match, so a rerun converges and a run that failed halfway is
|
|
7
|
+
* finished by the next one. The script is `<key>` (live) or `<key>-work` (workspace).
|
|
8
|
+
*
|
|
9
|
+
* Order, so the app is never reachable before it can serve and a workspace is never reachable
|
|
10
|
+
* without its gate: checks that need no call -> the address (zone, or the account's workers.dev
|
|
11
|
+
* name) and what already sits on it -> the build (fetched, sha256 checked) -> the gate (Access) ->
|
|
12
|
+
* the database link (Hyperdrive) -> secrets of a script already there -> upload -> on a company
|
|
13
|
+
* zone, workers.dev off at once -> secrets of a new script -> containers -> the address (DNS
|
|
14
|
+
* record and route, or the workers.dev switch on).
|
|
15
|
+
*
|
|
16
|
+
* A failure returns `{ ok: false, step, message }` in plain words. No message holds the token, a
|
|
17
|
+
* secret value, the database address or anything Cloudflare answered. A failure after which the
|
|
18
|
+
* app may be reachable without its gate also carries `reachableWithoutGate: true`, so a caller
|
|
19
|
+
* acts on the field and never on the words.
|
|
20
|
+
*/
|
|
21
|
+
export type AppCopy = 'live' | 'workspace';
|
|
22
|
+
export interface DeployWorkerAppInput {
|
|
23
|
+
/** The company's own, from Boule's Cloudflare connection. */
|
|
24
|
+
account: {
|
|
25
|
+
accountId: string;
|
|
26
|
+
token: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* `host` is the full hostname. A workspace on companyincluded.app is served on the account's
|
|
30
|
+
* workers.dev name. `repo` is the app's own GitHub repository (`owner/name`): the build must be
|
|
31
|
+
* a file of one of its releases.
|
|
32
|
+
*/
|
|
33
|
+
app: {
|
|
34
|
+
key: string;
|
|
35
|
+
host: string;
|
|
36
|
+
copy: AppCopy;
|
|
37
|
+
repo: string;
|
|
38
|
+
};
|
|
39
|
+
/** The company's GitHub token (Boule's GitHub connection), for a private repository's release files. */
|
|
40
|
+
github?: {
|
|
41
|
+
token: string;
|
|
42
|
+
} | null;
|
|
43
|
+
/** From `applyModules` and the build's `build.json`: `workerApp` must hold a build. */
|
|
44
|
+
entry: HostingEntry;
|
|
45
|
+
/** Postgres for Hyperdrive, one per copy. */
|
|
46
|
+
database?: {
|
|
47
|
+
url: string;
|
|
48
|
+
} | null;
|
|
49
|
+
/** `AUTH_*` and `MCP_*` env (and `KEYS_URL`), from Boule's sign-in port. Plain vars, never secrets. */
|
|
50
|
+
signIn?: Record<string, string> | null;
|
|
51
|
+
/** Secret values Boule holds, by name. */
|
|
52
|
+
secrets: Record<string, string>;
|
|
53
|
+
/** Who may open the copy, and the paths machines call without signing in. Required for a workspace. */
|
|
54
|
+
gate?: {
|
|
55
|
+
emails: string[];
|
|
56
|
+
machinePaths: string[];
|
|
57
|
+
} | null;
|
|
58
|
+
}
|
|
59
|
+
export interface RemoveWorkerAppInput {
|
|
60
|
+
account: {
|
|
61
|
+
accountId: string;
|
|
62
|
+
token: string;
|
|
63
|
+
};
|
|
64
|
+
app: {
|
|
65
|
+
key: string;
|
|
66
|
+
host: string;
|
|
67
|
+
copy: AppCopy;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export interface AppsDeps {
|
|
71
|
+
/** Builds the client for the company's account: `({ accountId, token }) => new CloudflareClient(token, accountId)`. */
|
|
72
|
+
cloudflare: (account: {
|
|
73
|
+
accountId: string;
|
|
74
|
+
token: string;
|
|
75
|
+
}) => AppsCloudflare;
|
|
76
|
+
/** Used to fetch the build (from GitHub) when `fetchArtifact` is not given. */
|
|
77
|
+
fetch?: typeof fetch;
|
|
78
|
+
/** Fetches the built module instead of foundry. Its address is checked first and its sha256 after. */
|
|
79
|
+
fetchArtifact?: (url: string) => Promise<Uint8Array>;
|
|
80
|
+
/** Test hooks. */
|
|
81
|
+
timeoutMs?: number;
|
|
82
|
+
rolloutPollMs?: number;
|
|
83
|
+
rolloutTimeoutMs?: number;
|
|
84
|
+
}
|
|
85
|
+
export type AppsResult = {
|
|
86
|
+
ok: true;
|
|
87
|
+
steps: string[];
|
|
88
|
+
url: string;
|
|
89
|
+
} | AppsFailure;
|
|
90
|
+
/**
|
|
91
|
+
* `reachableWithoutGate` is set only when the code is uploaded but its workers.dev address would
|
|
92
|
+
* not turn off: the caller should run `removeWorkerApp` at once, then deploy again.
|
|
93
|
+
*/
|
|
94
|
+
export type AppsFailure = {
|
|
95
|
+
ok: false;
|
|
96
|
+
step: string;
|
|
97
|
+
message: string;
|
|
98
|
+
steps: string[];
|
|
99
|
+
reachableWithoutGate?: true;
|
|
100
|
+
};
|
|
101
|
+
/** The paths an MCP client reaches without signing in at Access: the MCP endpoint and the OAuth discovery documents. */
|
|
102
|
+
export declare function mcpMachinePaths(mcpPath: string): string[];
|
|
103
|
+
export declare const appScriptName: (key: string, copy: AppCopy) => string;
|
|
104
|
+
export declare const appHyperdriveName: (script: string) => string;
|
|
105
|
+
/**
|
|
106
|
+
* Deploys one Worker app copy into the company's own account and returns what it did, or the step
|
|
107
|
+
* that stopped it in plain words. Never throws.
|
|
108
|
+
*/
|
|
109
|
+
export declare function deployWorkerApp(input: DeployWorkerAppInput, deps: AppsDeps): Promise<AppsResult>;
|
|
110
|
+
/**
|
|
111
|
+
* Removes one copy: its workers.dev address first, then its route and DNS record, its containers,
|
|
112
|
+
* the script with its secrets, its database link, and its Access apps last, so the gate stays
|
|
113
|
+
* until nothing is left behind it. A piece already gone is skipped, so a rerun converges. Never
|
|
114
|
+
* throws.
|
|
115
|
+
*/
|
|
116
|
+
export declare function removeWorkerApp(input: RemoveWorkerAppInput, deps: AppsDeps): Promise<AppsResult>;
|