@jini-ai/devops 0.3.3 → 0.4.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/README.md +3 -3
- package/dist/deploy/index.d.ts +0 -4
- package/dist/deploy/index.js +0 -4
- package/dist/deploy/naming.d.ts +1 -2
- package/dist/deploy/naming.js +1 -2
- package/dist/deploy/reachability.d.ts +5 -6
- package/dist/deploy/reachability.js +2 -2
- package/dist/deploy/redirect-guard.d.ts +8 -9
- package/dist/deploy/redirect-guard.js +8 -9
- package/dist/deploy/tokens.d.ts +3 -3
- package/dist/deploy/tokens.js +3 -3
- package/dist/deploy/tool.d.ts +3 -3
- package/dist/deploy/tool.js +4 -4
- package/dist/deploy/types.d.ts +5 -5
- package/dist/deploy/types.js +1 -1
- package/package.json +1 -1
- package/dist/deploy/cloudflare-pages.d.ts +0 -105
- package/dist/deploy/cloudflare-pages.js +0 -943
- package/dist/deploy/github-pages.d.ts +0 -62
- package/dist/deploy/github-pages.js +0 -373
- package/dist/deploy/netlify.d.ts +0 -40
- package/dist/deploy/netlify.js +0 -299
- package/dist/deploy/vercel.d.ts +0 -56
- package/dist/deploy/vercel.js +0 -258
package/README.md
CHANGED
|
@@ -8,18 +8,18 @@ public subpath and permission boundary.
|
|
|
8
8
|
|
|
9
9
|
| subpath | purpose |
|
|
10
10
|
|---|---|
|
|
11
|
-
| `./deploy` |
|
|
11
|
+
| `./deploy` | The generic deploy seam: the `DeployTarget` port, the `DeployTargetToken` many-token, the guarded `deploy.publish` tool, and the `DeployTargetModule`/`DeployHostKit` contract. Ships no hosting vendor. |
|
|
12
12
|
| `./source-control` | Reserved for repository, branch, commit, and pull-request operations. |
|
|
13
13
|
| `./ci-cd` | Reserved for pipeline definitions, run status, logs, cancellation, and deployment orchestration. |
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
16
|
import {
|
|
17
17
|
DeployTargetToken,
|
|
18
|
-
|
|
18
|
+
createDeployPublishToolRegistration,
|
|
19
19
|
} from '@jini-ai/devops/deploy';
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Hosting targets live in the host, not in this package: the host writes each
|
|
23
23
|
target as a `DeployTargetModule` and hands it a `DeployHostKit` (the outbound
|
|
24
24
|
`fetch`, timeouts, and this package's naming, reachability and redirect-guard
|
|
25
25
|
helpers), so the module needs no imports of its own. `create()` returns a plain
|
package/dist/deploy/index.d.ts
CHANGED
|
@@ -3,10 +3,6 @@ export * from './naming.js';
|
|
|
3
3
|
export * from './reachability.js';
|
|
4
4
|
export * from './redirect-guard.js';
|
|
5
5
|
export * from './host-kit.js';
|
|
6
|
-
export * from './vercel.js';
|
|
7
|
-
export * from './cloudflare-pages.js';
|
|
8
|
-
export * from './netlify.js';
|
|
9
|
-
export * from './github-pages.js';
|
|
10
6
|
export * from './tokens.js';
|
|
11
7
|
export * from './tool.js';
|
|
12
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/deploy/index.js
CHANGED
|
@@ -3,10 +3,6 @@ export * from './naming.js';
|
|
|
3
3
|
export * from './reachability.js';
|
|
4
4
|
export * from './redirect-guard.js';
|
|
5
5
|
export * from './host-kit.js';
|
|
6
|
-
export * from './vercel.js';
|
|
7
|
-
export * from './cloudflare-pages.js';
|
|
8
|
-
export * from './netlify.js';
|
|
9
|
-
export * from './github-pages.js';
|
|
10
6
|
export * from './tokens.js';
|
|
11
7
|
export * from './tool.js';
|
|
12
8
|
//# sourceMappingURL=index.js.map
|
package/dist/deploy/naming.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared label-sanitizing helpers
|
|
3
|
-
* Pages adapters to turn a caller-supplied `projectName` into a
|
|
2
|
+
* Shared label-sanitizing helpers deploy targets use to turn a caller-supplied `projectName` into a
|
|
4
3
|
* provider-safe identifier (lowercase, hyphenated, length-capped). Lifted
|
|
5
4
|
* verbatim from `apps/daemon/src/deploy.ts`'s `safeProjectLabel` — pure
|
|
6
5
|
* string logic, no OD dependency to strip.
|
package/dist/deploy/naming.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared label-sanitizing helpers
|
|
3
|
-
* Pages adapters to turn a caller-supplied `projectName` into a
|
|
2
|
+
* Shared label-sanitizing helpers deploy targets use to turn a caller-supplied `projectName` into a
|
|
4
3
|
* provider-safe identifier (lowercase, hyphenated, length-capped). Lifted
|
|
5
4
|
* verbatim from `apps/daemon/src/deploy.ts`'s `safeProjectLabel` — pure
|
|
6
5
|
* string logic, no OD dependency to strip.
|
|
@@ -2,11 +2,10 @@ import { createValidatingLookup } from '@jini-ai/platform';
|
|
|
2
2
|
import type { DeployLinkStatus, DeploymentUrlCheck } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Provider-supplied hook for recognizing a deployment URL that responded
|
|
5
|
-
* but is gated behind the provider's own auth wall (
|
|
6
|
-
*
|
|
7
|
-
* instead of hardcoding
|
|
8
|
-
*
|
|
9
|
-
* detector or omit one entirely.
|
|
5
|
+
* but is gated behind the provider's own auth wall (a deployment-protection
|
|
6
|
+
* login page, for example) rather than genuinely down. Kept pluggable
|
|
7
|
+
* instead of hardcoding one provider's SSO-nonce/header sniffing here, so
|
|
8
|
+
* each target can supply its own detector or omit one entirely.
|
|
10
9
|
*/
|
|
11
10
|
export type ProtectedResponseDetector = (resp: Response, body: string) => boolean;
|
|
12
11
|
export interface ReachabilityOptions {
|
|
@@ -33,7 +32,7 @@ export interface ReachabilityWaitResult {
|
|
|
33
32
|
}
|
|
34
33
|
/**
|
|
35
34
|
* Normalizes a raw provider-returned URL/hostname into an absolute
|
|
36
|
-
* `https://` URL (bare hostnames like `foo.
|
|
35
|
+
* `https://` URL (bare hostnames like `foo.example.app` are assumed https).
|
|
37
36
|
*
|
|
38
37
|
* @param url - Raw value from a provider response; may be `undefined`/non-string.
|
|
39
38
|
* @returns The normalized absolute URL, or `''` if `url` was empty/non-string.
|
|
@@ -2,7 +2,7 @@ import { Agent } from 'undici';
|
|
|
2
2
|
import { assertSafePublicUrl, AssetCacheError, createValidatingLookup } from '@jini-ai/platform';
|
|
3
3
|
/**
|
|
4
4
|
* SEC-003: reachability probes fetch a *provider-returned* URL/alias
|
|
5
|
-
* (
|
|
5
|
+
* (a deployment's `url`/`alias`/`aliases[]` from the host), so a compromised or
|
|
6
6
|
* malicious provider response is a live SSRF vector — the same trust-boundary
|
|
7
7
|
* shape `@jini-ai/platform`'s asset-cache solves for a caller-supplied media URL.
|
|
8
8
|
* Reused here rather than reinvented (see
|
|
@@ -25,7 +25,7 @@ function assertSafeDeploymentUrl(raw) {
|
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Normalizes a raw provider-returned URL/hostname into an absolute
|
|
28
|
-
* `https://` URL (bare hostnames like `foo.
|
|
28
|
+
* `https://` URL (bare hostnames like `foo.example.app` are assumed https).
|
|
29
29
|
*
|
|
30
30
|
* @param url - Raw value from a provider response; may be `undefined`/non-string.
|
|
31
31
|
* @returns The normalized absolute URL, or `''` if `url` was empty/non-string.
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared redirect guard for
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* origin redirects these endpoints, but a redirect is exactly the mechanism a compromised edge,
|
|
2
|
+
* Shared redirect guard for deploy targets whose `fetch()` calls carry a live
|
|
3
|
+
* `Authorization: Bearer <token>` header. Without a `redirect` option, a 3xx response from a
|
|
4
|
+
* target's hardcoded, trusted API origin would be followed transparently by `fetch()`, replaying
|
|
5
|
+
* that Authorization header at whatever `Location` the response named. Under normal operation no
|
|
6
|
+
* such origin redirects these endpoints, but a redirect is exactly the mechanism a compromised edge,
|
|
8
7
|
* misconfigured origin, or MITM would use to exfiltrate the token to an attacker-controlled host —
|
|
9
|
-
* flagged 2026-08-15 (a downstream product's deploy-publishing dispatch) and fixed here, in the
|
|
8
|
+
* flagged 2026-08-15 (a downstream product's deploy-publishing dispatch) and fixed here, in the shared helper every target uses,
|
|
10
9
|
* rather than only papering over it from a caller.
|
|
11
10
|
*
|
|
12
11
|
* `redirectGuardInit` is the one place every call site adds `redirect: 'manual'`.
|
|
@@ -24,10 +23,10 @@ export declare function redirectGuardInit(init: RequestInit): RequestInit;
|
|
|
24
23
|
* @throws {DeployError} `resp` is an opaque-redirect filtered response (the server tried to
|
|
25
24
|
* redirect this authenticated request elsewhere). Call immediately after every guarded
|
|
26
25
|
* `fetch()`, before reading `resp.status`/`resp.json()` for any other reason — a caller that
|
|
27
|
-
* checks `resp.status === 404` (a real, expected branch in
|
|
26
|
+
* checks `resp.status === 404` (a real, expected branch in some targets) before this guard
|
|
28
27
|
* would never see that check misfire, since an opaque-redirect response's `status` is `0`, not
|
|
29
28
|
* `404` — but call ordering here still matters for every OTHER status-sensitive branch in
|
|
30
|
-
*
|
|
29
|
+
* a target.
|
|
31
30
|
*/
|
|
32
31
|
export declare function assertNotRedirected(resp: Response, providerLabel: string): void;
|
|
33
32
|
//# sourceMappingURL=redirect-guard.d.ts.map
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { DeployError } from './types.js';
|
|
2
2
|
/**
|
|
3
|
-
* Shared redirect guard for
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* origin redirects these endpoints, but a redirect is exactly the mechanism a compromised edge,
|
|
3
|
+
* Shared redirect guard for deploy targets whose `fetch()` calls carry a live
|
|
4
|
+
* `Authorization: Bearer <token>` header. Without a `redirect` option, a 3xx response from a
|
|
5
|
+
* target's hardcoded, trusted API origin would be followed transparently by `fetch()`, replaying
|
|
6
|
+
* that Authorization header at whatever `Location` the response named. Under normal operation no
|
|
7
|
+
* such origin redirects these endpoints, but a redirect is exactly the mechanism a compromised edge,
|
|
9
8
|
* misconfigured origin, or MITM would use to exfiltrate the token to an attacker-controlled host —
|
|
10
|
-
* flagged 2026-08-15 (a downstream product's deploy-publishing dispatch) and fixed here, in the
|
|
9
|
+
* flagged 2026-08-15 (a downstream product's deploy-publishing dispatch) and fixed here, in the shared helper every target uses,
|
|
11
10
|
* rather than only papering over it from a caller.
|
|
12
11
|
*
|
|
13
12
|
* `redirectGuardInit` is the one place every call site adds `redirect: 'manual'`.
|
|
@@ -27,10 +26,10 @@ export function redirectGuardInit(init) {
|
|
|
27
26
|
* @throws {DeployError} `resp` is an opaque-redirect filtered response (the server tried to
|
|
28
27
|
* redirect this authenticated request elsewhere). Call immediately after every guarded
|
|
29
28
|
* `fetch()`, before reading `resp.status`/`resp.json()` for any other reason — a caller that
|
|
30
|
-
* checks `resp.status === 404` (a real, expected branch in
|
|
29
|
+
* checks `resp.status === 404` (a real, expected branch in some targets) before this guard
|
|
31
30
|
* would never see that check misfire, since an opaque-redirect response's `status` is `0`, not
|
|
32
31
|
* `404` — but call ordering here still matters for every OTHER status-sensitive branch in
|
|
33
|
-
*
|
|
32
|
+
* a target.
|
|
34
33
|
*/
|
|
35
34
|
export function assertNotRedirected(resp, providerLabel) {
|
|
36
35
|
if (resp.type === 'opaqueredirect' || (resp.status >= 300 && resp.status < 400)) {
|
package/dist/deploy/tokens.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ import { type DeployFile, type DeployPublishResult, type DeployTarget, type Json
|
|
|
2
2
|
/**
|
|
3
3
|
* Many-bound composition token for deploy providers, per extraction-plan.md
|
|
4
4
|
* §2.2's own worked example (`DeployTarget = manyToken<DeployProvider>
|
|
5
|
-
* ('jini.deployTarget')`, `bindMany(DeployTarget,
|
|
5
|
+
* ('jini.deployTarget')`, `bindMany(DeployTarget, someTarget)`, paraphrased). A host
|
|
6
6
|
* composition binds every deploy provider it wants available against this
|
|
7
7
|
* one token:
|
|
8
8
|
*
|
|
9
9
|
* ```ts
|
|
10
|
-
* bindings().bindMany(DeployTargetToken,
|
|
11
|
-
* .bindMany(DeployTargetToken,
|
|
10
|
+
* bindings().bindMany(DeployTargetToken, hostTargetA)
|
|
11
|
+
* .bindMany(DeployTargetToken, hostTargetB)
|
|
12
12
|
* ```
|
|
13
13
|
*
|
|
14
14
|
* A pack then resolves `c.getMany(DeployTargetToken)` to get every bound
|
package/dist/deploy/tokens.js
CHANGED
|
@@ -3,13 +3,13 @@ import { DeployError } from './types.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Many-bound composition token for deploy providers, per extraction-plan.md
|
|
5
5
|
* §2.2's own worked example (`DeployTarget = manyToken<DeployProvider>
|
|
6
|
-
* ('jini.deployTarget')`, `bindMany(DeployTarget,
|
|
6
|
+
* ('jini.deployTarget')`, `bindMany(DeployTarget, someTarget)`, paraphrased). A host
|
|
7
7
|
* composition binds every deploy provider it wants available against this
|
|
8
8
|
* one token:
|
|
9
9
|
*
|
|
10
10
|
* ```ts
|
|
11
|
-
* bindings().bindMany(DeployTargetToken,
|
|
12
|
-
* .bindMany(DeployTargetToken,
|
|
11
|
+
* bindings().bindMany(DeployTargetToken, hostTargetA)
|
|
12
|
+
* .bindMany(DeployTargetToken, hostTargetB)
|
|
13
13
|
* ```
|
|
14
14
|
*
|
|
15
15
|
* A pack then resolves `c.getMany(DeployTargetToken)` to get every bound
|
package/dist/deploy/tool.d.ts
CHANGED
|
@@ -40,9 +40,9 @@ export declare const DEFAULT_DEPLOY_PUBLISH_ROLE = "deploy:publish";
|
|
|
40
40
|
* Why deny-by-default specifically (not e.g. "allow same-principal-as-run"
|
|
41
41
|
* or some other partial default): `deploy.publish` is the one tool in this
|
|
42
42
|
* codebase that reaches real external infrastructure under the caller's own
|
|
43
|
-
* cloud account — a successful call spends the operator's
|
|
44
|
-
* quota, publishes content to a public, internet-reachable URL, and (for
|
|
45
|
-
*
|
|
43
|
+
* cloud account — a successful call spends the operator's hosting-provider
|
|
44
|
+
* quota, publishes content to a public, internet-reachable URL, and (for a
|
|
45
|
+
* target that manages custom domains) can create real DNS records. Unlike most tool
|
|
46
46
|
* calls, a wrongly-allowed `deploy.publish` is not cheaply reversible and
|
|
47
47
|
* has an externally visible blast radius. That is a strictly stronger case
|
|
48
48
|
* for deny-by-default than `@jini-ai/media`'s `DEFAULT_MEDIA_EXECUTION_POLICY`
|
package/dist/deploy/tool.js
CHANGED
|
@@ -20,9 +20,9 @@ export const DEFAULT_DEPLOY_PUBLISH_ROLE = 'deploy:publish';
|
|
|
20
20
|
* Why deny-by-default specifically (not e.g. "allow same-principal-as-run"
|
|
21
21
|
* or some other partial default): `deploy.publish` is the one tool in this
|
|
22
22
|
* codebase that reaches real external infrastructure under the caller's own
|
|
23
|
-
* cloud account — a successful call spends the operator's
|
|
24
|
-
* quota, publishes content to a public, internet-reachable URL, and (for
|
|
25
|
-
*
|
|
23
|
+
* cloud account — a successful call spends the operator's hosting-provider
|
|
24
|
+
* quota, publishes content to a public, internet-reachable URL, and (for a
|
|
25
|
+
* target that manages custom domains) can create real DNS records. Unlike most tool
|
|
26
26
|
* calls, a wrongly-allowed `deploy.publish` is not cheaply reversible and
|
|
27
27
|
* has an externally visible blast radius. That is a strictly stronger case
|
|
28
28
|
* for deny-by-default than `@jini-ai/media`'s `DEFAULT_MEDIA_EXECUTION_POLICY`
|
|
@@ -86,7 +86,7 @@ export function createDeployPublishToolRegistration(options) {
|
|
|
86
86
|
return {
|
|
87
87
|
descriptor: {
|
|
88
88
|
id: DEPLOY_PUBLISH_TOOL_ID,
|
|
89
|
-
description: 'Publishes a file set to a bound deploy target (
|
|
89
|
+
description: 'Publishes a file set to a bound deploy target (a hosting provider the host registered).',
|
|
90
90
|
...(requiresConfirmation !== undefined ? { requiresConfirmation } : {}),
|
|
91
91
|
...(timeoutMs !== undefined ? { timeoutMs } : {}),
|
|
92
92
|
},
|
package/dist/deploy/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Provider-agnostic shapes for publishing a static file set to a hosting
|
|
3
|
-
* target (
|
|
3
|
+
* target (any host-supplied adapter). None of these
|
|
4
4
|
* types know what a "project" is — the caller (a pack, a tool handler, a
|
|
5
5
|
* CLI command) resolves its own file set and hands over plain
|
|
6
6
|
* `DeployFile[]`. See `packages/devops/source-map.md` for what was dropped
|
|
@@ -25,7 +25,7 @@ export interface DeployFile {
|
|
|
25
25
|
* Coarse status of a deployment's public URL. `link-delayed` means the
|
|
26
26
|
* provider accepted the deploy but the URL is not yet reachable (DNS/CDN
|
|
27
27
|
* propagation); `protected` means the provider is gating the URL behind
|
|
28
|
-
* its own auth wall (e.g.
|
|
28
|
+
* its own auth wall (e.g. a deployment-protection login page).
|
|
29
29
|
*/
|
|
30
30
|
export type DeployLinkStatus = 'ready' | 'protected' | 'failed' | 'link-delayed';
|
|
31
31
|
/** Result of probing a deployment URL over HTTP. */
|
|
@@ -39,7 +39,7 @@ export interface DeploymentUrlCheck {
|
|
|
39
39
|
* Input to `DeployTarget.publish`. Deliberately narrow: a file set plus a
|
|
40
40
|
* human/DNS-safe label the target may use to derive a provider-side
|
|
41
41
|
* project/deployment name. `metadata` is an escape hatch for target-specific
|
|
42
|
-
* options (e.g.
|
|
42
|
+
* options (e.g. custom-domain selection) that do not belong in
|
|
43
43
|
* the shared shape — each target documents the metadata keys it reads and
|
|
44
44
|
* ignores everything else.
|
|
45
45
|
*
|
|
@@ -64,13 +64,13 @@ export interface DeployPublishResult {
|
|
|
64
64
|
status: DeployLinkStatus;
|
|
65
65
|
statusMessage?: string;
|
|
66
66
|
reachableAt?: number;
|
|
67
|
-
/** Target-specific extras (e.g.
|
|
67
|
+
/** Target-specific extras (e.g. a custom-domain/DNS outcome). */
|
|
68
68
|
providerMetadata?: JsonObject;
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* The port every deploy provider implements. Bound many-to-one against the
|
|
72
72
|
* `DeployTarget` many-token in `tokens.ts` (`bindMany(DeployTargetToken, ...)`)
|
|
73
|
-
* so
|
|
73
|
+
* so any number of hosting targets can register against
|
|
74
74
|
* the same capability without a central union type.
|
|
75
75
|
*/
|
|
76
76
|
export interface DeployTarget {
|
package/dist/deploy/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Provider-agnostic shapes for publishing a static file set to a hosting
|
|
3
|
-
* target (
|
|
3
|
+
* target (any host-supplied adapter). None of these
|
|
4
4
|
* types know what a "project" is — the caller (a pack, a tool handler, a
|
|
5
5
|
* CLI command) resolves its own file set and hands over plain
|
|
6
6
|
* `DeployFile[]`. See `packages/devops/source-map.md` for what was dropped
|
package/package.json
CHANGED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { type DeployFile, type DeployPublishInput, type DeployPublishResult, type DeployTarget, type DeploymentUrlCheck, type JsonObject } from './types.js';
|
|
2
|
-
export declare const CLOUDFLARE_PAGES_TARGET_ID = "cloudflare-pages";
|
|
3
|
-
export declare const CLOUDFLARE_PAGES_ASSET_UPLOAD_MAX_FILES = 100;
|
|
4
|
-
export declare const CLOUDFLARE_PAGES_ASSET_UPLOAD_MAX_BODY_BYTES: number;
|
|
5
|
-
export declare const CLOUDFLARE_PAGES_ASSET_MAX_BYTES: number;
|
|
6
|
-
/** Auth/scoping config a caller supplies when constructing a `CloudflarePagesDeployTarget`. */
|
|
7
|
-
export interface CloudflarePagesDeployConfig {
|
|
8
|
-
token: string;
|
|
9
|
-
accountId: string;
|
|
10
|
-
}
|
|
11
|
-
/** A caller-selected Cloudflare zone + subdomain prefix to bind as a custom domain. */
|
|
12
|
-
export interface CloudflarePagesCustomDomainSelection {
|
|
13
|
-
zoneId: string;
|
|
14
|
-
zoneName: string;
|
|
15
|
-
domainPrefix: string;
|
|
16
|
-
}
|
|
17
|
-
/** Opaque bookkeeping from a prior publish's custom-domain setup, fed back in to make DNS-record reuse idempotent. */
|
|
18
|
-
export interface CloudflarePagesPriorCustomDomainMetadata {
|
|
19
|
-
dnsRecordId?: string;
|
|
20
|
-
marker?: string;
|
|
21
|
-
}
|
|
22
|
-
/** Optional `DeployPublishInput.metadata` keys this target reads; everything else is ignored. */
|
|
23
|
-
export interface CloudflarePagesPublishMetadata extends JsonObject {
|
|
24
|
-
customDomain?: CloudflarePagesCustomDomainSelection;
|
|
25
|
-
priorCustomDomain?: CloudflarePagesPriorCustomDomainMetadata;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Deterministic content hash used purely as Cloudflare Pages' per-asset
|
|
29
|
-
* dedup key (the direct-upload protocol needs a stable 32-hex-char key per
|
|
30
|
-
* file, not a specific algorithm). Swapped from the OD origin's
|
|
31
|
-
* `blake3-wasm` to Node's built-in `crypto` so this package carries no
|
|
32
|
-
* native/WASM dependency — see `source-map.md`.
|
|
33
|
-
*/
|
|
34
|
-
export declare function cloudflarePagesAssetHash(file: Pick<DeployFile, 'file' | 'data'>): string;
|
|
35
|
-
/**
|
|
36
|
-
* Splits a file set into upload batches that respect Cloudflare Pages'
|
|
37
|
-
* per-request file-count and body-size limits.
|
|
38
|
-
*
|
|
39
|
-
* @param files - Files with their pre-computed content hash.
|
|
40
|
-
* @param limits - Overridable file-count/byte-size caps (default to the
|
|
41
|
-
* Cloudflare Pages direct-upload limits).
|
|
42
|
-
* @returns An array of batches; each batch's estimated encoded size stays
|
|
43
|
-
* under `maxBytes` and its length under `maxFiles` (a single
|
|
44
|
-
* larger-than-cap file still gets its own batch rather than being dropped).
|
|
45
|
-
* @complexity O(n) in the number of files.
|
|
46
|
-
* @overallScore 100/100
|
|
47
|
-
*/
|
|
48
|
-
export declare function chunkCloudflarePagesAssetUploads(files: {
|
|
49
|
-
hash: string;
|
|
50
|
-
data: Buffer | Uint8Array | string;
|
|
51
|
-
contentType?: string;
|
|
52
|
-
}[], { maxFiles, maxBytes }?: {
|
|
53
|
-
maxFiles?: number | undefined;
|
|
54
|
-
maxBytes?: number | undefined;
|
|
55
|
-
}): (typeof files)[number][][];
|
|
56
|
-
/** Lists active, fully-onboarded zones on the account — used to populate a custom-domain selection UI. */
|
|
57
|
-
export declare function listCloudflarePagesZones(config: CloudflarePagesDeployConfig): Promise<{
|
|
58
|
-
zones: {
|
|
59
|
-
id: string;
|
|
60
|
-
name: string;
|
|
61
|
-
status: string | undefined;
|
|
62
|
-
type: string | undefined;
|
|
63
|
-
}[];
|
|
64
|
-
}>;
|
|
65
|
-
/**
|
|
66
|
-
* `DeployTarget` adapter for Cloudflare Pages' direct-upload API: ensures a
|
|
67
|
-
* Pages project exists, uploads the file set as content-addressed assets,
|
|
68
|
-
* creates a deployment, waits for the `pages.dev` URL to be reachable, and
|
|
69
|
-
* (optionally, when `input.metadata.customDomain` is supplied) binds a
|
|
70
|
-
* custom domain via a managed CNAME + Pages domain record.
|
|
71
|
-
*
|
|
72
|
-
* Genericized from the origin product's daemon deploy module's
|
|
73
|
-
* `deployToCloudflarePages` family: the origin's persisted local config file
|
|
74
|
-
* and product-specific project naming are gone — the caller supplies
|
|
75
|
-
* `{ token, accountId }` directly and a stable `projectName` label.
|
|
76
|
-
*/
|
|
77
|
-
export declare class CloudflarePagesDeployTarget implements DeployTarget {
|
|
78
|
-
private readonly config;
|
|
79
|
-
readonly id = "cloudflare-pages";
|
|
80
|
-
constructor(config: CloudflarePagesDeployConfig);
|
|
81
|
-
/**
|
|
82
|
-
* Publishes `input.files` to Cloudflare Pages and waits for the resulting
|
|
83
|
-
* `pages.dev` URL to be reachable, optionally binding a custom domain.
|
|
84
|
-
*
|
|
85
|
-
* @param input - File set, a caller-chosen project name label, and
|
|
86
|
-
* optional `metadata.customDomain`/`metadata.priorCustomDomain`.
|
|
87
|
-
* @returns The published deployment's URL/status, with any custom-domain
|
|
88
|
-
* outcome folded into `providerMetadata`.
|
|
89
|
-
* @throws {DeployError} If `token`/`accountId` are missing, the derived
|
|
90
|
-
* project name is empty, or any Cloudflare API call fails.
|
|
91
|
-
* @complexity O(files) to hash/chunk the asset set, plus a bounded
|
|
92
|
-
* reachability wait; DNS/domain setup is O(1) additional round-trips.
|
|
93
|
-
* @overallScore 95/100
|
|
94
|
-
* @tradeoffs Custom-domain setup errors are captured into the returned
|
|
95
|
-
* `providerMetadata` rather than thrown, matching the OD origin's
|
|
96
|
-
* behavior of always returning the base pages.dev result even if the
|
|
97
|
-
* custom domain step fails partway — flagged since a caller that only
|
|
98
|
-
* checks `status`/`throws` could miss a degraded custom-domain state
|
|
99
|
-
* without also inspecting `providerMetadata`.
|
|
100
|
-
*/
|
|
101
|
-
publish(input: DeployPublishInput): Promise<DeployPublishResult>;
|
|
102
|
-
/** Probes `url` with the shared reachability checker (no Cloudflare-specific auth-wall detection is needed). */
|
|
103
|
-
checkReachability(url: string): Promise<DeploymentUrlCheck>;
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=cloudflare-pages.d.ts.map
|