@keystrokehq/hosting 0.1.15 → 0.1.16
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/docker.cjs +131 -0
- package/dist/docker.cjs.map +1 -0
- package/dist/docker.d.cts +23 -0
- package/dist/docker.d.cts.map +1 -0
- package/dist/docker.d.mts +23 -0
- package/dist/docker.d.mts.map +1 -0
- package/dist/docker.mjs +129 -0
- package/dist/docker.mjs.map +1 -0
- package/dist/index.cjs +28 -8429
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -127
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3 -127
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -8379
- package/dist/index.mjs.map +1 -1
- package/dist/org-artifacts.cjs +4 -0
- package/dist/org-artifacts.d.cts +2 -0
- package/dist/org-artifacts.d.mts +2 -0
- package/dist/org-artifacts.mjs +2 -0
- package/dist/plugin-is5oPt6x.d.cts +44 -0
- package/dist/plugin-is5oPt6x.d.cts.map +1 -0
- package/dist/plugin-qEl5Sx4m.d.mts +44 -0
- package/dist/plugin-qEl5Sx4m.d.mts.map +1 -0
- package/dist/runtime-B0jF0oMv.d.cts +69 -0
- package/dist/runtime-B0jF0oMv.d.cts.map +1 -0
- package/dist/runtime-B0jF0oMv.d.mts +69 -0
- package/dist/runtime-B0jF0oMv.d.mts.map +1 -0
- package/dist/runtime-BmfsHLrk.mjs +19 -0
- package/dist/runtime-BmfsHLrk.mjs.map +1 -0
- package/dist/runtime-CV7pSfMl.cjs +30 -0
- package/dist/runtime-CV7pSfMl.cjs.map +1 -0
- package/dist/wait-for-health-DM55_NQh.cjs +340 -0
- package/dist/wait-for-health-DM55_NQh.cjs.map +1 -0
- package/dist/wait-for-health-XEzPPQIO.mjs +209 -0
- package/dist/wait-for-health-XEzPPQIO.mjs.map +1 -0
- package/package.json +13 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { a as ProjectRuntimeDatabase, c as ProjectRuntimeInput, d as encodeOrgArtifacts, f as parseOrgArtifactsFromEnv, i as ProjectRuntime, l as ProjectRuntimeReconcileInput, n as OrgProjectDeploy, o as ProjectRuntimeDestroyInput, r as ProjectPingTarget, s as ProjectRuntimeHosting, t as OrgArtifactSpec, u as ProjectRuntimeResult } from "./runtime-B0jF0oMv.cjs";
|
|
2
|
+
import { a as WorkerRuntimeConfig, i as OrganizationHostingResult, n as HostingPlugin, o as WorkerRuntimeConfigError, r as OrganizationHostingInput, s as resolveWorkerRuntimeConfig, t as HostingOptions } from "./plugin-is5oPt6x.cjs";
|
|
2
3
|
|
|
3
4
|
//#region src/constants.d.ts
|
|
4
5
|
declare const PROJECT_SERVER_IMAGE = "keystroke/project-server:local";
|
|
@@ -15,131 +16,6 @@ declare const PROJECT_SERVER_DEPLOY_STATUS: {
|
|
|
15
16
|
readonly port: 3000;
|
|
16
17
|
};
|
|
17
18
|
//#endregion
|
|
18
|
-
//#region src/runtime.d.ts
|
|
19
|
-
type ProjectRuntimeDatabase = {
|
|
20
|
-
host: string;
|
|
21
|
-
port: number;
|
|
22
|
-
database: string;
|
|
23
|
-
user: string;
|
|
24
|
-
password: string;
|
|
25
|
-
searchPath: string;
|
|
26
|
-
organizationId: string; /** @deprecated Per-project workers only — org workers omit this. */
|
|
27
|
-
projectId?: string;
|
|
28
|
-
};
|
|
29
|
-
type OrgProjectDeploy = {
|
|
30
|
-
projectId: string;
|
|
31
|
-
name: string;
|
|
32
|
-
artifactId: string;
|
|
33
|
-
artifactStorageKey: string;
|
|
34
|
-
artifactVersion: number;
|
|
35
|
-
};
|
|
36
|
-
type OrgArtifactSpec = {
|
|
37
|
-
projectId: string;
|
|
38
|
-
artifactStorageKey: string;
|
|
39
|
-
artifactId: string; /** Monotonic per-project artifact version from the platform database. */
|
|
40
|
-
artifactVersion: number;
|
|
41
|
-
};
|
|
42
|
-
type ProjectRuntimeHosting = {
|
|
43
|
-
appName: string;
|
|
44
|
-
};
|
|
45
|
-
type ProjectRuntimeInput = {
|
|
46
|
-
organizationId: string;
|
|
47
|
-
projects: OrgProjectDeploy[];
|
|
48
|
-
database: ProjectRuntimeDatabase;
|
|
49
|
-
hosting?: ProjectRuntimeHosting; /** Extra env merged into the project server launch spec (e.g. from an llmProxy plugin). */
|
|
50
|
-
env?: Record<string, string>; /** Previous runtime to retire after a successful cutover. */
|
|
51
|
-
previousRuntimeId?: string | null;
|
|
52
|
-
};
|
|
53
|
-
/** Builds base64 `KEYSTROKE_ORG_ARTIFACTS` payload for org worker containers. */
|
|
54
|
-
declare function encodeOrgArtifacts(artifacts: OrgArtifactSpec[]): string;
|
|
55
|
-
declare function parseOrgArtifactsFromEnv(env?: NodeJS.ProcessEnv): OrgArtifactSpec[] | undefined;
|
|
56
|
-
type ProjectRuntimeDestroyInput = {
|
|
57
|
-
runtimeId: string;
|
|
58
|
-
hosting?: ProjectRuntimeHosting;
|
|
59
|
-
};
|
|
60
|
-
type ProjectRuntimeReconcileInput = {
|
|
61
|
-
organizationId: string; /** The runtime to keep — every other runtime belonging to this org should be destroyed. */
|
|
62
|
-
keepRuntimeId: string;
|
|
63
|
-
hosting?: ProjectRuntimeHosting;
|
|
64
|
-
};
|
|
65
|
-
type ProjectRuntimeResult = {
|
|
66
|
-
runtimeId: string;
|
|
67
|
-
baseUrl: string;
|
|
68
|
-
};
|
|
69
|
-
type ProjectRuntime = {
|
|
70
|
-
start(input: ProjectRuntimeInput): Promise<ProjectRuntimeResult>;
|
|
71
|
-
destroy?(input: ProjectRuntimeDestroyInput): Promise<void>;
|
|
72
|
-
/**
|
|
73
|
-
* Sweep away every runtime for this org except `keepRuntimeId`, retrying
|
|
74
|
-
* transient failures instead of giving up after one attempt. This catches
|
|
75
|
-
* orphans that a single {@link destroy} call missed (e.g. a previous deploy's
|
|
76
|
-
* destroy failed silently), not just the one runtime recorded as "previous."
|
|
77
|
-
*/
|
|
78
|
-
reconcile?(input: ProjectRuntimeReconcileInput): Promise<void>;
|
|
79
|
-
};
|
|
80
|
-
type ProjectPingTarget = {
|
|
81
|
-
baseUrl: string | null;
|
|
82
|
-
runtimeId: string | null;
|
|
83
|
-
};
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region src/worker-runtime-config.d.ts
|
|
86
|
-
/** Resolved platform ↔ project-server worker auth contract. */
|
|
87
|
-
type WorkerRuntimeConfig = {
|
|
88
|
-
/** Platform API base URL reachable from the project-server runtime. */platformUrl: string; /** Bearer token for platform `/internal` routes. */
|
|
89
|
-
workerToken: string;
|
|
90
|
-
};
|
|
91
|
-
declare class WorkerRuntimeConfigError extends Error {
|
|
92
|
-
readonly missing: readonly string[];
|
|
93
|
-
constructor(missing: string[]);
|
|
94
|
-
}
|
|
95
|
-
/** Fail fast when the platform cannot start worker-mode project servers. */
|
|
96
|
-
declare function resolveWorkerRuntimeConfig(source?: NodeJS.ProcessEnv): WorkerRuntimeConfig;
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region src/plugin.d.ts
|
|
99
|
-
type HostingOptions = {
|
|
100
|
-
image?: string;
|
|
101
|
-
env?: NodeJS.ProcessEnv;
|
|
102
|
-
fetchImpl?: typeof fetch;
|
|
103
|
-
healthTimeoutMs?: number;
|
|
104
|
-
};
|
|
105
|
-
type OrganizationHostingInput = {
|
|
106
|
-
organizationId: string;
|
|
107
|
-
name: string;
|
|
108
|
-
};
|
|
109
|
-
type OrganizationHostingResult = {
|
|
110
|
-
appName: string;
|
|
111
|
-
};
|
|
112
|
-
type HostingPlugin = {
|
|
113
|
-
name: string; /** Validated at plugin creation — shared by platform internal routes and project-server containers. */
|
|
114
|
-
workerRuntime: WorkerRuntimeConfig;
|
|
115
|
-
createRuntime(): ProjectRuntime;
|
|
116
|
-
provisionOrganization?(input: OrganizationHostingInput): Promise<OrganizationHostingResult>;
|
|
117
|
-
deprovisionOrganization?(result: OrganizationHostingResult): Promise<void>;
|
|
118
|
-
canPingTarget?(target: ProjectPingTarget): target is {
|
|
119
|
-
baseUrl: string;
|
|
120
|
-
runtimeId: string | null;
|
|
121
|
-
};
|
|
122
|
-
pingRequestHeaders?(runtimeId: string | null): Record<string, string>;
|
|
123
|
-
};
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region src/docker/create-docker-runtime.d.ts
|
|
126
|
-
type WorkspacesMount = {
|
|
127
|
-
hostPath: string;
|
|
128
|
-
containerPath: string;
|
|
129
|
-
};
|
|
130
|
-
type DockerPluginOptions = HostingOptions & {
|
|
131
|
-
docker?: Docker; /** Bind a shared host workspace dir into dev workers (VM sandbox proxy mount path). */
|
|
132
|
-
workspacesMount?: WorkspacesMount; /** Additional Docker bind mounts (`host:container[:options]`). */
|
|
133
|
-
extraBinds?: string[];
|
|
134
|
-
};
|
|
135
|
-
//#endregion
|
|
136
|
-
//#region src/docker/plugin.d.ts
|
|
137
|
-
declare function dockerPlugin(options?: DockerPluginOptions): HostingPlugin;
|
|
138
|
-
//#endregion
|
|
139
|
-
//#region src/default-plugin.d.ts
|
|
140
|
-
/** Local Docker hosting — default for platform and dev. */
|
|
141
|
-
declare function defaultHostingPlugin(options?: DockerPluginOptions): HostingPlugin;
|
|
142
|
-
//#endregion
|
|
143
19
|
//#region src/runtime-env.d.ts
|
|
144
20
|
/** Env keys that must never be forwarded into untrusted org workers. */
|
|
145
21
|
declare const FORBIDDEN_WORKER_ENV_KEYS: readonly ["BETTER_AUTH_SECRET", "DATABASE_URL", "POSTHOG_API_KEY", "POSTGRES_PASSWORD", "PLATFORM_WORKER_TOKEN", "STRIPE_SECRET_KEY", "CREDENTIAL_ENCRYPTION_KEY"];
|
|
@@ -231,5 +107,5 @@ type FetchDeployStatusOptions = {
|
|
|
231
107
|
*/
|
|
232
108
|
declare function fetchDeployStatus(baseUrl: string, options?: FetchDeployStatusOptions): Promise<DeployStatusResponse | undefined>;
|
|
233
109
|
//#endregion
|
|
234
|
-
export { DEV_PLATFORM_WORKER_TOKEN, type DeployStatusResponse,
|
|
110
|
+
export { DEV_PLATFORM_WORKER_TOKEN, type DeployStatusResponse, FORBIDDEN_WORKER_ENV_KEYS, type FetchDeployStatusOptions, type HostingOptions, type HostingPlugin, type OrgArtifactSpec, type OrgProjectDeploy, type OrganizationHostingInput, type OrganizationHostingResult, PROJECT_SERVER_DEPLOY_STATUS, PROJECT_SERVER_FRAMEWORK_NODE_MODULES, PROJECT_SERVER_FRAMEWORK_ROOT, PROJECT_SERVER_HEALTH, PROJECT_SERVER_IMAGE, PROJECT_SERVER_PORT, PROJECT_SERVER_ROOT, type PingProjectOptions, type ProjectDeployStatus, type ProjectPingTarget, type ProjectRuntime, type ProjectRuntimeDatabase, type ProjectRuntimeDestroyInput, type ProjectRuntimeHosting, type ProjectRuntimeInput, type ProjectRuntimeReconcileInput, type ProjectRuntimeResult, RUNTIME_PING_TIMEOUT_MS, type RuntimeLaunchSpec, type VerifiedOrgWorkerToken, type WaitForHealthOptions, type WorkerRuntimeConfig, WorkerRuntimeConfigError, buildRuntimeEnv, canPingProjectTarget, encodeOrgArtifacts, fetchDeployStatus, formatDockerEnv, mintOrgWorkerToken, parseOrgArtifactsFromEnv, pingProject, pingProjectTarget, resolvePlatformWorkerToken, resolveProjectServerImage, resolveRuntimeLaunch, resolveWorkerPlatformUrl, resolveWorkerRuntimeConfig, rewriteLoopbackHost, rewriteLoopbackUrl, verifyOrgWorkerToken, waitForHealth };
|
|
235
111
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/constants.ts","../src/runtime
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/constants.ts","../src/runtime-env.ts","../src/org-worker-token.ts","../src/wait-for-health.ts","../src/runtime-constants.ts","../src/ping-project.ts","../src/ping-project-target.ts","../src/deploy-status.ts"],"mappings":";;;;cAAa,oBAAA;AAAA,cAEA,mBAAA;AAAA,cAEA,mBAAA;AAAA,cAEA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GAAS,IAAA,CAAK,aAAA;AAAA;AAAA,iBAGM,WAAA,CACpB,OAAA,UACA,OAAA,GAAS,kBAAA,GACR,OAAO;;;iBCVM,oBAAA,CACd,MAAA,EAAQ,iBAAA,EACR,MAAA,GAAS,IAAA,CAAK,aAAA,qBACb,MAAA;EAAY,OAAA;EAAiB,SAAA;AAAA;AAAA,iBAQV,iBAAA,CACpB,MAAA,EAAQ,iBAAA,EACR,OAAA,GAAS,kBAAA;EACP,MAAA,GAAS,IAAA,CAAK,aAAA;AAAA,IAEf,OAAA;;;;KChBS,mBAAA;EACV,SAAA;EACA,EAAA;EACA,KAAA;AAAA;AAAA,KAGU,oBAAA;EACV,QAAA,EAAU,mBAAmB;AAAA;AAAA,KAGnB,wBAAA;EACV,SAAA,UAAmB,KAAK;EACxB,SAAA;AAAA;APd8B;AAEhC;;;;AAFgC,iBOsBV,iBAAA,CACpB,OAAA,UACA,OAAA,GAAS,wBAAA,GACR,OAAA,CAAQ,oBAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { a as ProjectRuntimeDatabase, c as ProjectRuntimeInput, d as encodeOrgArtifacts, f as parseOrgArtifactsFromEnv, i as ProjectRuntime, l as ProjectRuntimeReconcileInput, n as OrgProjectDeploy, o as ProjectRuntimeDestroyInput, r as ProjectPingTarget, s as ProjectRuntimeHosting, t as OrgArtifactSpec, u as ProjectRuntimeResult } from "./runtime-B0jF0oMv.mjs";
|
|
2
|
+
import { a as WorkerRuntimeConfig, i as OrganizationHostingResult, n as HostingPlugin, o as WorkerRuntimeConfigError, r as OrganizationHostingInput, s as resolveWorkerRuntimeConfig, t as HostingOptions } from "./plugin-qEl5Sx4m.mjs";
|
|
2
3
|
|
|
3
4
|
//#region src/constants.d.ts
|
|
4
5
|
declare const PROJECT_SERVER_IMAGE = "keystroke/project-server:local";
|
|
@@ -15,131 +16,6 @@ declare const PROJECT_SERVER_DEPLOY_STATUS: {
|
|
|
15
16
|
readonly port: 3000;
|
|
16
17
|
};
|
|
17
18
|
//#endregion
|
|
18
|
-
//#region src/runtime.d.ts
|
|
19
|
-
type ProjectRuntimeDatabase = {
|
|
20
|
-
host: string;
|
|
21
|
-
port: number;
|
|
22
|
-
database: string;
|
|
23
|
-
user: string;
|
|
24
|
-
password: string;
|
|
25
|
-
searchPath: string;
|
|
26
|
-
organizationId: string; /** @deprecated Per-project workers only — org workers omit this. */
|
|
27
|
-
projectId?: string;
|
|
28
|
-
};
|
|
29
|
-
type OrgProjectDeploy = {
|
|
30
|
-
projectId: string;
|
|
31
|
-
name: string;
|
|
32
|
-
artifactId: string;
|
|
33
|
-
artifactStorageKey: string;
|
|
34
|
-
artifactVersion: number;
|
|
35
|
-
};
|
|
36
|
-
type OrgArtifactSpec = {
|
|
37
|
-
projectId: string;
|
|
38
|
-
artifactStorageKey: string;
|
|
39
|
-
artifactId: string; /** Monotonic per-project artifact version from the platform database. */
|
|
40
|
-
artifactVersion: number;
|
|
41
|
-
};
|
|
42
|
-
type ProjectRuntimeHosting = {
|
|
43
|
-
appName: string;
|
|
44
|
-
};
|
|
45
|
-
type ProjectRuntimeInput = {
|
|
46
|
-
organizationId: string;
|
|
47
|
-
projects: OrgProjectDeploy[];
|
|
48
|
-
database: ProjectRuntimeDatabase;
|
|
49
|
-
hosting?: ProjectRuntimeHosting; /** Extra env merged into the project server launch spec (e.g. from an llmProxy plugin). */
|
|
50
|
-
env?: Record<string, string>; /** Previous runtime to retire after a successful cutover. */
|
|
51
|
-
previousRuntimeId?: string | null;
|
|
52
|
-
};
|
|
53
|
-
/** Builds base64 `KEYSTROKE_ORG_ARTIFACTS` payload for org worker containers. */
|
|
54
|
-
declare function encodeOrgArtifacts(artifacts: OrgArtifactSpec[]): string;
|
|
55
|
-
declare function parseOrgArtifactsFromEnv(env?: NodeJS.ProcessEnv): OrgArtifactSpec[] | undefined;
|
|
56
|
-
type ProjectRuntimeDestroyInput = {
|
|
57
|
-
runtimeId: string;
|
|
58
|
-
hosting?: ProjectRuntimeHosting;
|
|
59
|
-
};
|
|
60
|
-
type ProjectRuntimeReconcileInput = {
|
|
61
|
-
organizationId: string; /** The runtime to keep — every other runtime belonging to this org should be destroyed. */
|
|
62
|
-
keepRuntimeId: string;
|
|
63
|
-
hosting?: ProjectRuntimeHosting;
|
|
64
|
-
};
|
|
65
|
-
type ProjectRuntimeResult = {
|
|
66
|
-
runtimeId: string;
|
|
67
|
-
baseUrl: string;
|
|
68
|
-
};
|
|
69
|
-
type ProjectRuntime = {
|
|
70
|
-
start(input: ProjectRuntimeInput): Promise<ProjectRuntimeResult>;
|
|
71
|
-
destroy?(input: ProjectRuntimeDestroyInput): Promise<void>;
|
|
72
|
-
/**
|
|
73
|
-
* Sweep away every runtime for this org except `keepRuntimeId`, retrying
|
|
74
|
-
* transient failures instead of giving up after one attempt. This catches
|
|
75
|
-
* orphans that a single {@link destroy} call missed (e.g. a previous deploy's
|
|
76
|
-
* destroy failed silently), not just the one runtime recorded as "previous."
|
|
77
|
-
*/
|
|
78
|
-
reconcile?(input: ProjectRuntimeReconcileInput): Promise<void>;
|
|
79
|
-
};
|
|
80
|
-
type ProjectPingTarget = {
|
|
81
|
-
baseUrl: string | null;
|
|
82
|
-
runtimeId: string | null;
|
|
83
|
-
};
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region src/worker-runtime-config.d.ts
|
|
86
|
-
/** Resolved platform ↔ project-server worker auth contract. */
|
|
87
|
-
type WorkerRuntimeConfig = {
|
|
88
|
-
/** Platform API base URL reachable from the project-server runtime. */platformUrl: string; /** Bearer token for platform `/internal` routes. */
|
|
89
|
-
workerToken: string;
|
|
90
|
-
};
|
|
91
|
-
declare class WorkerRuntimeConfigError extends Error {
|
|
92
|
-
readonly missing: readonly string[];
|
|
93
|
-
constructor(missing: string[]);
|
|
94
|
-
}
|
|
95
|
-
/** Fail fast when the platform cannot start worker-mode project servers. */
|
|
96
|
-
declare function resolveWorkerRuntimeConfig(source?: NodeJS.ProcessEnv): WorkerRuntimeConfig;
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region src/plugin.d.ts
|
|
99
|
-
type HostingOptions = {
|
|
100
|
-
image?: string;
|
|
101
|
-
env?: NodeJS.ProcessEnv;
|
|
102
|
-
fetchImpl?: typeof fetch;
|
|
103
|
-
healthTimeoutMs?: number;
|
|
104
|
-
};
|
|
105
|
-
type OrganizationHostingInput = {
|
|
106
|
-
organizationId: string;
|
|
107
|
-
name: string;
|
|
108
|
-
};
|
|
109
|
-
type OrganizationHostingResult = {
|
|
110
|
-
appName: string;
|
|
111
|
-
};
|
|
112
|
-
type HostingPlugin = {
|
|
113
|
-
name: string; /** Validated at plugin creation — shared by platform internal routes and project-server containers. */
|
|
114
|
-
workerRuntime: WorkerRuntimeConfig;
|
|
115
|
-
createRuntime(): ProjectRuntime;
|
|
116
|
-
provisionOrganization?(input: OrganizationHostingInput): Promise<OrganizationHostingResult>;
|
|
117
|
-
deprovisionOrganization?(result: OrganizationHostingResult): Promise<void>;
|
|
118
|
-
canPingTarget?(target: ProjectPingTarget): target is {
|
|
119
|
-
baseUrl: string;
|
|
120
|
-
runtimeId: string | null;
|
|
121
|
-
};
|
|
122
|
-
pingRequestHeaders?(runtimeId: string | null): Record<string, string>;
|
|
123
|
-
};
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region src/docker/create-docker-runtime.d.ts
|
|
126
|
-
type WorkspacesMount = {
|
|
127
|
-
hostPath: string;
|
|
128
|
-
containerPath: string;
|
|
129
|
-
};
|
|
130
|
-
type DockerPluginOptions = HostingOptions & {
|
|
131
|
-
docker?: Docker; /** Bind a shared host workspace dir into dev workers (VM sandbox proxy mount path). */
|
|
132
|
-
workspacesMount?: WorkspacesMount; /** Additional Docker bind mounts (`host:container[:options]`). */
|
|
133
|
-
extraBinds?: string[];
|
|
134
|
-
};
|
|
135
|
-
//#endregion
|
|
136
|
-
//#region src/docker/plugin.d.ts
|
|
137
|
-
declare function dockerPlugin(options?: DockerPluginOptions): HostingPlugin;
|
|
138
|
-
//#endregion
|
|
139
|
-
//#region src/default-plugin.d.ts
|
|
140
|
-
/** Local Docker hosting — default for platform and dev. */
|
|
141
|
-
declare function defaultHostingPlugin(options?: DockerPluginOptions): HostingPlugin;
|
|
142
|
-
//#endregion
|
|
143
19
|
//#region src/runtime-env.d.ts
|
|
144
20
|
/** Env keys that must never be forwarded into untrusted org workers. */
|
|
145
21
|
declare const FORBIDDEN_WORKER_ENV_KEYS: readonly ["BETTER_AUTH_SECRET", "DATABASE_URL", "POSTHOG_API_KEY", "POSTGRES_PASSWORD", "PLATFORM_WORKER_TOKEN", "STRIPE_SECRET_KEY", "CREDENTIAL_ENCRYPTION_KEY"];
|
|
@@ -231,5 +107,5 @@ type FetchDeployStatusOptions = {
|
|
|
231
107
|
*/
|
|
232
108
|
declare function fetchDeployStatus(baseUrl: string, options?: FetchDeployStatusOptions): Promise<DeployStatusResponse | undefined>;
|
|
233
109
|
//#endregion
|
|
234
|
-
export { DEV_PLATFORM_WORKER_TOKEN, type DeployStatusResponse,
|
|
110
|
+
export { DEV_PLATFORM_WORKER_TOKEN, type DeployStatusResponse, FORBIDDEN_WORKER_ENV_KEYS, type FetchDeployStatusOptions, type HostingOptions, type HostingPlugin, type OrgArtifactSpec, type OrgProjectDeploy, type OrganizationHostingInput, type OrganizationHostingResult, PROJECT_SERVER_DEPLOY_STATUS, PROJECT_SERVER_FRAMEWORK_NODE_MODULES, PROJECT_SERVER_FRAMEWORK_ROOT, PROJECT_SERVER_HEALTH, PROJECT_SERVER_IMAGE, PROJECT_SERVER_PORT, PROJECT_SERVER_ROOT, type PingProjectOptions, type ProjectDeployStatus, type ProjectPingTarget, type ProjectRuntime, type ProjectRuntimeDatabase, type ProjectRuntimeDestroyInput, type ProjectRuntimeHosting, type ProjectRuntimeInput, type ProjectRuntimeReconcileInput, type ProjectRuntimeResult, RUNTIME_PING_TIMEOUT_MS, type RuntimeLaunchSpec, type VerifiedOrgWorkerToken, type WaitForHealthOptions, type WorkerRuntimeConfig, WorkerRuntimeConfigError, buildRuntimeEnv, canPingProjectTarget, encodeOrgArtifacts, fetchDeployStatus, formatDockerEnv, mintOrgWorkerToken, parseOrgArtifactsFromEnv, pingProject, pingProjectTarget, resolvePlatformWorkerToken, resolveProjectServerImage, resolveRuntimeLaunch, resolveWorkerPlatformUrl, resolveWorkerRuntimeConfig, rewriteLoopbackHost, rewriteLoopbackUrl, verifyOrgWorkerToken, waitForHealth };
|
|
235
111
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/constants.ts","../src/runtime
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/constants.ts","../src/runtime-env.ts","../src/org-worker-token.ts","../src/wait-for-health.ts","../src/runtime-constants.ts","../src/ping-project.ts","../src/ping-project-target.ts","../src/deploy-status.ts"],"mappings":";;;;cAAa,oBAAA;AAAA,cAEA,mBAAA;AAAA,cAEA,mBAAA;AAAA,cAEA,6BAAA;AAAA,cAEA,qCAAA;AAAA,cAEA,qBAAA;EAAA,SAGH,IAAA;EAAA,SAAA,IAAA;AAAA;AAAA,cAEG,4BAAA;EAAA,SAGH,IAAA;EAAA,SAAA,IAAA;AAAA;;;AAlBV;AAAA,cCyCa,yBAAA;;cAmBA,yBAAA;AAAA,KAED,iBAAA;EACV,KAAA;EACA,GAAA,EAAK,MAAA;EACL,IAAA;EACA,MAAA,SAAe,qBAAqB;AAAA;AD9DtC;;;;AAAA,iBCqEgB,oBAAA,CACd,OAAA,EAAS,cAAA,EACT,SAAA,EAAW,eAAA,IACX,QAAA,EAAU,sBAAA,EACV,QAAA,GAAW,MAAA,mBACV,iBAAA;;iBAsCa,eAAA,CACd,MAAA,EAAQ,MAAA,CAAO,UAAA,EACf,SAAA,EAAW,eAAA,IACX,QAAA,EAAU,sBAAA,EACV,QAAA,GAAW,MAAA,mBACV,MAAA;AAA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