@jini-ai/devops 0.1.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/LICENSE +201 -0
- package/README.md +24 -0
- package/dist/deploy/cloudflare-pages.d.ts +105 -0
- package/dist/deploy/cloudflare-pages.d.ts.map +1 -0
- package/dist/deploy/cloudflare-pages.js +921 -0
- package/dist/deploy/cloudflare-pages.js.map +1 -0
- package/dist/deploy/github-pages.d.ts +62 -0
- package/dist/deploy/github-pages.d.ts.map +1 -0
- package/dist/deploy/github-pages.js +373 -0
- package/dist/deploy/github-pages.js.map +1 -0
- package/dist/deploy/index.d.ts +11 -0
- package/dist/deploy/index.d.ts.map +1 -0
- package/dist/deploy/index.js +11 -0
- package/dist/deploy/index.js.map +1 -0
- package/dist/deploy/naming.d.ts +18 -0
- package/dist/deploy/naming.d.ts.map +1 -0
- package/dist/deploy/naming.js +29 -0
- package/dist/deploy/naming.js.map +1 -0
- package/dist/deploy/netlify.d.ts +40 -0
- package/dist/deploy/netlify.d.ts.map +1 -0
- package/dist/deploy/netlify.js +299 -0
- package/dist/deploy/netlify.js.map +1 -0
- package/dist/deploy/reachability.d.ts +72 -0
- package/dist/deploy/reachability.d.ts.map +1 -0
- package/dist/deploy/reachability.js +260 -0
- package/dist/deploy/reachability.js.map +1 -0
- package/dist/deploy/redirect-guard.d.ts +33 -0
- package/dist/deploy/redirect-guard.d.ts.map +1 -0
- package/dist/deploy/redirect-guard.js +40 -0
- package/dist/deploy/redirect-guard.js.map +1 -0
- package/dist/deploy/tokens.d.ts +57 -0
- package/dist/deploy/tokens.d.ts.map +1 -0
- package/dist/deploy/tokens.js +58 -0
- package/dist/deploy/tokens.js.map +1 -0
- package/dist/deploy/tool.d.ts +104 -0
- package/dist/deploy/tool.d.ts.map +1 -0
- package/dist/deploy/tool.js +108 -0
- package/dist/deploy/tool.js.map +1 -0
- package/dist/deploy/types.d.ts +86 -0
- package/dist/deploy/types.d.ts.map +1 -0
- package/dist/deploy/types.js +27 -0
- package/dist/deploy/types.js.map +1 -0
- package/dist/deploy/vercel.d.ts +56 -0
- package/dist/deploy/vercel.d.ts.map +1 -0
- package/dist/deploy/vercel.js +258 -0
- package/dist/deploy/vercel.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { publishDeploy } from './tokens.js';
|
|
2
|
+
/** The `ToolRegistry` id this file registers `deploy.publish` under. */
|
|
3
|
+
export const DEPLOY_PUBLISH_TOOL_ID = 'deploy.publish';
|
|
4
|
+
/**
|
|
5
|
+
* Role hint `createRoleGatedDeployPublishPolicy`'s own default looks for on
|
|
6
|
+
* `Principal.roles`. Purely a convenience default — a host is free to pass
|
|
7
|
+
* its own `allowedRoles` list, or its own `ToolPolicy` entirely, using
|
|
8
|
+
* whatever role vocabulary it already has.
|
|
9
|
+
*/
|
|
10
|
+
export const DEFAULT_DEPLOY_PUBLISH_ROLE = 'deploy:publish';
|
|
11
|
+
/**
|
|
12
|
+
* Deny-by-default `ToolPolicy` for `deploy.publish` — every call is denied,
|
|
13
|
+
* unconditionally, regardless of principal. This is the registration's
|
|
14
|
+
* built-in default (see `createDeployPublishToolRegistration` below): a
|
|
15
|
+
* host must explicitly opt in, either by passing its own `policy` or by
|
|
16
|
+
* using {@link createRoleGatedDeployPublishPolicy}, rather than getting an
|
|
17
|
+
* unrestricted or partially-restricted gate for free merely by registering
|
|
18
|
+
* the tool.
|
|
19
|
+
*
|
|
20
|
+
* Why deny-by-default specifically (not e.g. "allow same-principal-as-run"
|
|
21
|
+
* or some other partial default): `deploy.publish` is the one tool in this
|
|
22
|
+
* codebase that reaches real external infrastructure under the caller's own
|
|
23
|
+
* cloud account — a successful call spends the operator's Vercel/Cloudflare
|
|
24
|
+
* quota, publishes content to a public, internet-reachable URL, and (for
|
|
25
|
+
* Cloudflare custom domains) can create real DNS records. Unlike most tool
|
|
26
|
+
* calls, a wrongly-allowed `deploy.publish` is not cheaply reversible and
|
|
27
|
+
* has an externally visible blast radius. That is a strictly stronger case
|
|
28
|
+
* for deny-by-default than `@jini-ai/media`'s `DEFAULT_MEDIA_EXECUTION_POLICY`
|
|
29
|
+
* (SEC-RB-010, `packages/media/src/policy.ts`) — media generation is
|
|
30
|
+
* costly but self-contained; a bad deploy is costly AND publicly visible AND
|
|
31
|
+
* (for custom domains) mutates DNS. Matching this branch's established
|
|
32
|
+
* "deny-by-default" discipline (see commit `0a9c9c237`'s media-policy fix)
|
|
33
|
+
* rather than inventing a more permissive default here.
|
|
34
|
+
*/
|
|
35
|
+
export const denyAllDeployPublishPolicy = {
|
|
36
|
+
authorize: () => 'deny',
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Convenience `ToolPolicy`: allows a `deploy.publish` call only when the
|
|
40
|
+
* calling `Principal` carries at least one of `allowedRoles` (default: just
|
|
41
|
+
* {@link DEFAULT_DEPLOY_PUBLISH_ROLE}). A `Principal` with no `roles` at all
|
|
42
|
+
* — the default shape per `@jini-ai/core`'s `Principal` (`roles` is optional)
|
|
43
|
+
* — is denied: an absent/empty roles list is never treated as
|
|
44
|
+
* "unrestricted," mirroring the SEC-RB-010 fix in `@jini-ai/media`'s
|
|
45
|
+
* `createAllowlistMediaPolicy` (an omitted field must not silently bypass
|
|
46
|
+
* an explicit gate).
|
|
47
|
+
*
|
|
48
|
+
* This is one usable, non-permissive policy a host can opt into — it is
|
|
49
|
+
* NOT the registration default (see {@link denyAllDeployPublishPolicy});
|
|
50
|
+
* a host must still choose to pass it explicitly.
|
|
51
|
+
*
|
|
52
|
+
* @complexity O(principal.roles) to check membership against `allowedRoles`.
|
|
53
|
+
* @overallScore 100/100
|
|
54
|
+
*/
|
|
55
|
+
export function createRoleGatedDeployPublishPolicy(allowedRoles = [DEFAULT_DEPLOY_PUBLISH_ROLE]) {
|
|
56
|
+
return {
|
|
57
|
+
authorize(ctx) {
|
|
58
|
+
const roles = ctx.principal.roles;
|
|
59
|
+
if (!roles || roles.length === 0)
|
|
60
|
+
return 'deny';
|
|
61
|
+
return roles.some((role) => allowedRoles.includes(role)) ? 'allow' : 'deny';
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Builds the `{descriptor, handler, policy}` triple a host registers
|
|
67
|
+
* against `@jini-ai/core`'s `ToolRegistry` so `deploy.publish` becomes
|
|
68
|
+
* reachable only via `ToolExecutor.execute(principal, run, 'deploy.publish',
|
|
69
|
+
* input, signal)` — never by a route or agent calling `publishDeploy`
|
|
70
|
+
* directly, which would bypass authorization and the audit trail entirely.
|
|
71
|
+
*
|
|
72
|
+
* The handler ignores the `ToolExecutionContext.signal` `ToolExecutor`
|
|
73
|
+
* supplies: `DeployTarget.publish`/`checkReachability` (`types.ts`) take no
|
|
74
|
+
* `AbortSignal` today, so there is nothing to forward it to. A `ToolExecutor`
|
|
75
|
+
* `timeoutMs`/external cancellation still aborts the *call* from the
|
|
76
|
+
* executor's perspective (the audit trail records `timed-out`/`cancelled`),
|
|
77
|
+
* it just cannot interrupt an in-flight HTTP request inside a target's own
|
|
78
|
+
* `publish` implementation — flagged as a follow-up in `source-map.md`
|
|
79
|
+
* rather than silently assumed away.
|
|
80
|
+
*
|
|
81
|
+
* @complexity O(1) to build the registration; the handler's own cost is `publishDeploy`'s (O(targets) dispatch plus the matched target's `publish`).
|
|
82
|
+
* @overallScore 100/100
|
|
83
|
+
*/
|
|
84
|
+
export function createDeployPublishToolRegistration(options) {
|
|
85
|
+
const { targets, policy = denyAllDeployPublishPolicy, requiresConfirmation, timeoutMs } = options;
|
|
86
|
+
return {
|
|
87
|
+
descriptor: {
|
|
88
|
+
id: DEPLOY_PUBLISH_TOOL_ID,
|
|
89
|
+
description: 'Publishes a file set to a bound deploy target (e.g. Vercel, Cloudflare Pages, Netlify, GitHub Pages).',
|
|
90
|
+
...(requiresConfirmation !== undefined ? { requiresConfirmation } : {}),
|
|
91
|
+
...(timeoutMs !== undefined ? { timeoutMs } : {}),
|
|
92
|
+
},
|
|
93
|
+
policy,
|
|
94
|
+
handler: async (ctx) => {
|
|
95
|
+
// The registry/executor boundary passes `input` as `unknown` by
|
|
96
|
+
// design (`ToolExecutionContext.input`, `packages/core/src/
|
|
97
|
+
// tool-registry.ts`) — this cast is the one place that shape becomes
|
|
98
|
+
// `DeployPublishToolInput` again, exactly as `tokens.ts`'s own
|
|
99
|
+
// deferred-wiring sketch anticipated. No parsing/validation library
|
|
100
|
+
// is introduced here; `publishDeploy`/the matched `DeployTarget`
|
|
101
|
+
// already reject a malformed `targetId`/`files`/`projectName` on
|
|
102
|
+
// their own terms (e.g. `DeployError` for an unknown target).
|
|
103
|
+
const input = ctx.input;
|
|
104
|
+
return publishDeploy(input, targets);
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../src/deploy/tool.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,aAAa,EAA+B,MAAM,aAAa,CAAC;AAGzE,wEAAwE;AACxE,MAAM,CAAC,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,gBAAgB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAe;IACpD,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,kCAAkC,CAChD,eAAkC,CAAC,2BAA2B,CAAC;IAE/D,OAAO;QACL,SAAS,CAAC,GAA6B;YACrC,MAAM,KAAK,GAAG,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC;YAClC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,MAAM,CAAC;YAChD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;QAC9E,CAAC;KACF,CAAC;AACJ,CAAC;AAaD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,mCAAmC,CACjD,OAAmD;IAEnD,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,0BAA0B,EAAE,oBAAoB,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAElG,OAAO;QACL,UAAU,EAAE;YACV,EAAE,EAAE,sBAAsB;YAC1B,WAAW,EAAE,uGAAuG;YACpH,GAAG,CAAC,oBAAoB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,oBAAoB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACvE,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClD;QACD,MAAM;QACN,OAAO,EAAE,KAAK,EAAE,GAAG,EAAgC,EAAE;YACnD,gEAAgE;YAChE,4DAA4D;YAC5D,qEAAqE;YACrE,+DAA+D;YAC/D,oEAAoE;YACpE,iEAAiE;YACjE,iEAAiE;YACjE,8DAA8D;YAC9D,MAAM,KAAK,GAAG,GAAG,CAAC,KAA+B,CAAC;YAClD,OAAO,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACvC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider-agnostic shapes for publishing a static file set to a hosting
|
|
3
|
+
* target (Vercel, Cloudflare Pages, and future adapters). None of these
|
|
4
|
+
* types know what a "project" is — the caller (a pack, a tool handler, a
|
|
5
|
+
* CLI command) resolves its own file set and hands over plain
|
|
6
|
+
* `DeployFile[]`. See `packages/deploy/source-map.md` for what was dropped
|
|
7
|
+
* from the OD origin file to get here.
|
|
8
|
+
*/
|
|
9
|
+
/** Generic JSON-shaped object; mirrors the loose bag used by provider APIs. */
|
|
10
|
+
export type JsonObject = Record<string, unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* One file to publish, keyed by its deploy-relative path.
|
|
13
|
+
*
|
|
14
|
+
* `sourcePath` is optional provenance the caller may attach (e.g. the path
|
|
15
|
+
* in its own file model) purely for diagnostics/logging — this package
|
|
16
|
+
* never reads it.
|
|
17
|
+
*/
|
|
18
|
+
export interface DeployFile {
|
|
19
|
+
file: string;
|
|
20
|
+
data: Buffer | Uint8Array | string;
|
|
21
|
+
contentType?: string;
|
|
22
|
+
sourcePath?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Coarse status of a deployment's public URL. `link-delayed` means the
|
|
26
|
+
* provider accepted the deploy but the URL is not yet reachable (DNS/CDN
|
|
27
|
+
* propagation); `protected` means the provider is gating the URL behind
|
|
28
|
+
* its own auth wall (e.g. Vercel Deployment Protection).
|
|
29
|
+
*/
|
|
30
|
+
export type DeployLinkStatus = 'ready' | 'protected' | 'failed' | 'link-delayed';
|
|
31
|
+
/** Result of probing a deployment URL over HTTP. */
|
|
32
|
+
export interface DeploymentUrlCheck {
|
|
33
|
+
reachable: boolean;
|
|
34
|
+
status?: DeployLinkStatus;
|
|
35
|
+
statusCode?: number;
|
|
36
|
+
statusMessage?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Input to `DeployTarget.publish`. Deliberately narrow: a file set plus a
|
|
40
|
+
* human/DNS-safe label the target may use to derive a provider-side
|
|
41
|
+
* project/deployment name. `metadata` is an escape hatch for target-specific
|
|
42
|
+
* options (e.g. Cloudflare custom-domain selection) that do not belong in
|
|
43
|
+
* the shared shape — each target documents the metadata keys it reads and
|
|
44
|
+
* ignores everything else.
|
|
45
|
+
*/
|
|
46
|
+
export interface DeployPublishInput {
|
|
47
|
+
files: DeployFile[];
|
|
48
|
+
projectName: string;
|
|
49
|
+
metadata?: JsonObject;
|
|
50
|
+
}
|
|
51
|
+
/** Result of a successful (or partially successful) publish call. */
|
|
52
|
+
export interface DeployPublishResult {
|
|
53
|
+
targetId: string;
|
|
54
|
+
url: string;
|
|
55
|
+
deploymentId?: string;
|
|
56
|
+
status: DeployLinkStatus;
|
|
57
|
+
statusMessage?: string;
|
|
58
|
+
reachableAt?: number;
|
|
59
|
+
/** Target-specific extras (e.g. Cloudflare custom-domain/DNS outcome). */
|
|
60
|
+
providerMetadata?: JsonObject;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The port every deploy provider implements. Bound many-to-one against the
|
|
64
|
+
* `DeployTarget` many-token in `tokens.ts` (`bindMany(DeployTargetToken, ...)`)
|
|
65
|
+
* so Vercel, Cloudflare Pages, and later targets can all register against
|
|
66
|
+
* the same capability without a central union type.
|
|
67
|
+
*/
|
|
68
|
+
export interface DeployTarget {
|
|
69
|
+
readonly id: string;
|
|
70
|
+
publish(input: DeployPublishInput): Promise<DeployPublishResult>;
|
|
71
|
+
checkReachability(url: string): Promise<DeploymentUrlCheck>;
|
|
72
|
+
}
|
|
73
|
+
export type DeployErrorDetails = JsonObject | string | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Thrown by target implementations for both caller-input problems (bad
|
|
76
|
+
* config, missing token) and upstream provider failures (HTTP error,
|
|
77
|
+
* malformed response). `status` mirrors HTTP semantics so a transport layer
|
|
78
|
+
* can map it directly onto a response code.
|
|
79
|
+
*/
|
|
80
|
+
export declare class DeployError extends Error {
|
|
81
|
+
status: number;
|
|
82
|
+
details: DeployErrorDetails;
|
|
83
|
+
code?: string | undefined;
|
|
84
|
+
constructor(message: string, status?: number, details?: DeployErrorDetails, code?: string);
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=types.d.ts.map
|
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AC;IACpB,OAAO,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACjE,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC7D;AAED,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;AAEjE;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,kBAAkB,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEd,OAAO,EAAE,MAAM,EAAE,MAAM,SAAM,EAAE,OAAO,GAAE,kBAA8B,EAAE,IAAI,CAAC,EAAE,MAAM;CAOlG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider-agnostic shapes for publishing a static file set to a hosting
|
|
3
|
+
* target (Vercel, Cloudflare Pages, and future adapters). None of these
|
|
4
|
+
* types know what a "project" is — the caller (a pack, a tool handler, a
|
|
5
|
+
* CLI command) resolves its own file set and hands over plain
|
|
6
|
+
* `DeployFile[]`. See `packages/deploy/source-map.md` for what was dropped
|
|
7
|
+
* from the OD origin file to get here.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Thrown by target implementations for both caller-input problems (bad
|
|
11
|
+
* config, missing token) and upstream provider failures (HTTP error,
|
|
12
|
+
* malformed response). `status` mirrors HTTP semantics so a transport layer
|
|
13
|
+
* can map it directly onto a response code.
|
|
14
|
+
*/
|
|
15
|
+
export class DeployError extends Error {
|
|
16
|
+
status;
|
|
17
|
+
details;
|
|
18
|
+
code;
|
|
19
|
+
constructor(message, status = 400, details = undefined, code) {
|
|
20
|
+
super(message);
|
|
21
|
+
this.name = 'DeployError';
|
|
22
|
+
this.status = status;
|
|
23
|
+
this.details = details;
|
|
24
|
+
this.code = code;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/deploy/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA2EH;;;;;GAKG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC,MAAM,CAAS;IACf,OAAO,CAAqB;IAC5B,IAAI,CAAsB;IAE1B,YAAY,OAAe,EAAE,MAAM,GAAG,GAAG,EAAE,UAA8B,SAAS,EAAE,IAAa;QAC/F,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type DeployPublishInput, type DeployPublishResult, type DeployTarget, type DeploymentUrlCheck } from './types.js';
|
|
2
|
+
export declare const VERCEL_TARGET_ID = "vercel";
|
|
3
|
+
/** Auth/scoping config a caller supplies when constructing a `VercelDeployTarget`. */
|
|
4
|
+
export interface VercelDeployConfig {
|
|
5
|
+
token: string;
|
|
6
|
+
teamId?: string;
|
|
7
|
+
teamSlug?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Heuristically detects Vercel's own Deployment Protection auth wall from a
|
|
11
|
+
* 401 response, so `checkReachability` can report `status: 'protected'`
|
|
12
|
+
* (an actionable, non-error outcome) instead of `reachable: false` with a
|
|
13
|
+
* generic message.
|
|
14
|
+
*
|
|
15
|
+
* @param resp - The HTTP response received from probing a deployment URL.
|
|
16
|
+
* @param body - The response body (only read for 401s by the caller).
|
|
17
|
+
* @returns `true` if the response looks like Vercel's SSO/auth gate.
|
|
18
|
+
* @complexity O(1) — a handful of regex tests over already-fetched strings.
|
|
19
|
+
* @overallScore 100/100
|
|
20
|
+
*/
|
|
21
|
+
export declare function isVercelProtectedResponse(resp: Response, body?: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* `DeployTarget` adapter for Vercel's v13 deployments API. Publishes a
|
|
24
|
+
* caller-supplied file set as a single deployment, polls until Vercel
|
|
25
|
+
* reports a terminal `readyState`, then waits for the resulting URL to
|
|
26
|
+
* become publicly reachable.
|
|
27
|
+
*
|
|
28
|
+
* Genericized from the origin product's daemon deploy module's
|
|
29
|
+
* `deployToVercel`: the origin's product-specific deployment-name
|
|
30
|
+
* convention is replaced by `input.projectName` (sanitized the same way);
|
|
31
|
+
* token/team config is supplied by the caller instead of being read from a
|
|
32
|
+
* product-owned local config file — persistence of that config is now the
|
|
33
|
+
* caller's concern, not this package's.
|
|
34
|
+
*/
|
|
35
|
+
export declare class VercelDeployTarget implements DeployTarget {
|
|
36
|
+
private readonly config;
|
|
37
|
+
readonly id = "vercel";
|
|
38
|
+
constructor(config: VercelDeployConfig);
|
|
39
|
+
/**
|
|
40
|
+
* Publishes `input.files` as a new Vercel deployment and waits for the
|
|
41
|
+
* resulting URL to be reachable.
|
|
42
|
+
*
|
|
43
|
+
* @param input - File set plus a caller-chosen project name label.
|
|
44
|
+
* @returns The published deployment's URL/status once Vercel has a
|
|
45
|
+
* terminal `readyState` (or the poll budget is exhausted).
|
|
46
|
+
* @throws {DeployError} If `config.token` is missing, or Vercel's API
|
|
47
|
+
* rejects the deployment request or reports `readyState: 'ERROR'`.
|
|
48
|
+
* @complexity O(files) to encode the payload, plus a bounded poll loop
|
|
49
|
+
* (`pollVercelDeployment`) and the reachability wait's own bound.
|
|
50
|
+
* @overallScore 100/100
|
|
51
|
+
*/
|
|
52
|
+
publish(input: DeployPublishInput): Promise<DeployPublishResult>;
|
|
53
|
+
/** Probes `url`, recognizing Vercel's own Deployment Protection auth wall. */
|
|
54
|
+
checkReachability(url: string): Promise<DeploymentUrlCheck>;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=vercel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vercel.d.ts","sourceRoot":"","sources":["../../src/deploy/vercel.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,KAAK,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,KAAK,kBAAkB,EAAmB,MAAM,YAAY,CAAC;AAEzJ,eAAO,MAAM,gBAAgB,WAAW,CAAC;AAMzC,sFAAsF;AACtF,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,SAAK,GAAG,OAAO,CAW5E;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,kBAAmB,YAAW,YAAY;IAGzC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,QAAQ,CAAC,EAAE,YAAoB;gBAEF,MAAM,EAAE,kBAAkB;IAEvD;;;;;;;;;;;;OAYG;IACG,OAAO,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAsEtE,8EAA8E;IACxE,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAMlE"}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { FETCH_TIMEOUT_MS, fetchWithTimeout } from '@jini-ai/platform';
|
|
2
|
+
import { checkDeploymentUrl, normalizeDeploymentUrl, waitForReachableDeploymentUrl } from './reachability.js';
|
|
3
|
+
import { safeProjectLabel } from './naming.js';
|
|
4
|
+
import { assertNotRedirected, redirectGuardInit } from './redirect-guard.js';
|
|
5
|
+
import { DeployError } from './types.js';
|
|
6
|
+
export const VERCEL_TARGET_ID = 'vercel';
|
|
7
|
+
const VERCEL_API = 'https://api.vercel.com';
|
|
8
|
+
const VERCEL_PROTECTED_MESSAGE = 'Deployment is protected by Vercel. Disable Deployment Protection or use a custom domain to make this link public.';
|
|
9
|
+
/**
|
|
10
|
+
* Heuristically detects Vercel's own Deployment Protection auth wall from a
|
|
11
|
+
* 401 response, so `checkReachability` can report `status: 'protected'`
|
|
12
|
+
* (an actionable, non-error outcome) instead of `reachable: false` with a
|
|
13
|
+
* generic message.
|
|
14
|
+
*
|
|
15
|
+
* @param resp - The HTTP response received from probing a deployment URL.
|
|
16
|
+
* @param body - The response body (only read for 401s by the caller).
|
|
17
|
+
* @returns `true` if the response looks like Vercel's SSO/auth gate.
|
|
18
|
+
* @complexity O(1) — a handful of regex tests over already-fetched strings.
|
|
19
|
+
* @overallScore 100/100
|
|
20
|
+
*/
|
|
21
|
+
export function isVercelProtectedResponse(resp, body = '') {
|
|
22
|
+
const server = resp.headers?.get?.('server') || '';
|
|
23
|
+
const setCookie = resp.headers?.get?.('set-cookie') || '';
|
|
24
|
+
const text = String(body || '');
|
|
25
|
+
return (/vercel/i.test(server) ||
|
|
26
|
+
/_vercel_sso_nonce/i.test(setCookie) ||
|
|
27
|
+
/Authentication Required/i.test(text) ||
|
|
28
|
+
/Vercel Authentication/i.test(text) ||
|
|
29
|
+
/vercel\.com\/sso-api/i.test(text));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* `DeployTarget` adapter for Vercel's v13 deployments API. Publishes a
|
|
33
|
+
* caller-supplied file set as a single deployment, polls until Vercel
|
|
34
|
+
* reports a terminal `readyState`, then waits for the resulting URL to
|
|
35
|
+
* become publicly reachable.
|
|
36
|
+
*
|
|
37
|
+
* Genericized from the origin product's daemon deploy module's
|
|
38
|
+
* `deployToVercel`: the origin's product-specific deployment-name
|
|
39
|
+
* convention is replaced by `input.projectName` (sanitized the same way);
|
|
40
|
+
* token/team config is supplied by the caller instead of being read from a
|
|
41
|
+
* product-owned local config file — persistence of that config is now the
|
|
42
|
+
* caller's concern, not this package's.
|
|
43
|
+
*/
|
|
44
|
+
export class VercelDeployTarget {
|
|
45
|
+
config;
|
|
46
|
+
id = VERCEL_TARGET_ID;
|
|
47
|
+
constructor(config) {
|
|
48
|
+
this.config = config;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Publishes `input.files` as a new Vercel deployment and waits for the
|
|
52
|
+
* resulting URL to be reachable.
|
|
53
|
+
*
|
|
54
|
+
* @param input - File set plus a caller-chosen project name label.
|
|
55
|
+
* @returns The published deployment's URL/status once Vercel has a
|
|
56
|
+
* terminal `readyState` (or the poll budget is exhausted).
|
|
57
|
+
* @throws {DeployError} If `config.token` is missing, or Vercel's API
|
|
58
|
+
* rejects the deployment request or reports `readyState: 'ERROR'`.
|
|
59
|
+
* @complexity O(files) to encode the payload, plus a bounded poll loop
|
|
60
|
+
* (`pollVercelDeployment`) and the reachability wait's own bound.
|
|
61
|
+
* @overallScore 100/100
|
|
62
|
+
*/
|
|
63
|
+
async publish(input) {
|
|
64
|
+
if (!this.config.token) {
|
|
65
|
+
throw new DeployError('Vercel token is required.', 400);
|
|
66
|
+
}
|
|
67
|
+
const createResp = await fetchWithTimeout(`${VERCEL_API}/v13/deployments${vercelTeamQuery(this.config)}`, redirectGuardInit({
|
|
68
|
+
method: 'POST',
|
|
69
|
+
headers: {
|
|
70
|
+
Authorization: `Bearer ${this.config.token}`,
|
|
71
|
+
'Content-Type': 'application/json',
|
|
72
|
+
},
|
|
73
|
+
body: JSON.stringify({
|
|
74
|
+
name: safeVercelProjectName(input.projectName),
|
|
75
|
+
files: input.files.map((f) => ({
|
|
76
|
+
file: f.file,
|
|
77
|
+
data: Buffer.from(f.data).toString('base64'),
|
|
78
|
+
encoding: 'base64',
|
|
79
|
+
})),
|
|
80
|
+
projectSettings: { framework: null },
|
|
81
|
+
}),
|
|
82
|
+
}), { timeoutMs: FETCH_TIMEOUT_MS.UPLOAD });
|
|
83
|
+
assertNotRedirected(createResp, 'Vercel deployment creation');
|
|
84
|
+
const created = await readVercelJson(createResp);
|
|
85
|
+
if (!createResp.ok)
|
|
86
|
+
throw vercelError(created, createResp.status);
|
|
87
|
+
const deploymentId = typeof created.id === 'string' ? created.id : typeof created.uid === 'string' ? created.uid : undefined;
|
|
88
|
+
const initialUrl = deploymentUrl(created);
|
|
89
|
+
const ready = deploymentId ? await pollVercelDeployment(this.config, deploymentId) : created;
|
|
90
|
+
if (ready?.readyState === 'ERROR') {
|
|
91
|
+
const readyError = ready?.error;
|
|
92
|
+
// `ready ?? undefined` — the `undefined` side is unreachable: this line
|
|
93
|
+
// only runs when `ready?.readyState === 'ERROR'` just matched, which
|
|
94
|
+
// requires `ready` itself to already be a real object (optional
|
|
95
|
+
// chaining on a null/undefined `ready` would make the whole comparison
|
|
96
|
+
// `undefined === 'ERROR'`, i.e. false, skipping this block entirely).
|
|
97
|
+
// So by the time `ready ?? undefined` evaluates, `ready` is always
|
|
98
|
+
// truthy and the `??` is a no-op at runtime. Kept (not simplified to
|
|
99
|
+
// just `ready`) purely for type-level reasons: `ready`'s static type is
|
|
100
|
+
// `JsonObject | null` (from `pollVercelDeployment`'s return type /
|
|
101
|
+
// `created`'s), and `DeployError`'s `details` parameter accepts
|
|
102
|
+
// `JsonObject | string | undefined` — not `null` — so this coalesce is
|
|
103
|
+
// a compile-time-required null-to-undefined conversion that TypeScript's
|
|
104
|
+
// control-flow analysis cannot narrow away just from the optional-chained
|
|
105
|
+
// comparison above. See packages/deploy/source-map.md's 2026-07-22
|
|
106
|
+
// addition for the full re-derivation.
|
|
107
|
+
throw new DeployError(readyError?.message || 'Vercel deployment failed.', 502, ready ?? undefined);
|
|
108
|
+
}
|
|
109
|
+
const candidates = deploymentUrlCandidates(ready, created);
|
|
110
|
+
const link = await waitForReachableDeploymentUrl(candidates.length ? candidates : [initialUrl], {
|
|
111
|
+
providerLabel: 'Vercel',
|
|
112
|
+
detectProtected: isVercelProtectedResponse,
|
|
113
|
+
protectedMessage: VERCEL_PROTECTED_MESSAGE,
|
|
114
|
+
});
|
|
115
|
+
return {
|
|
116
|
+
targetId: this.id,
|
|
117
|
+
url: link.url || deploymentUrl(ready) || initialUrl,
|
|
118
|
+
...(deploymentId ? { deploymentId } : {}),
|
|
119
|
+
status: link.status,
|
|
120
|
+
statusMessage: link.statusMessage,
|
|
121
|
+
...(link.reachableAt !== undefined ? { reachableAt: link.reachableAt } : {}),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
/** Probes `url`, recognizing Vercel's own Deployment Protection auth wall. */
|
|
125
|
+
async checkReachability(url) {
|
|
126
|
+
return checkDeploymentUrl(url, {
|
|
127
|
+
detectProtected: isVercelProtectedResponse,
|
|
128
|
+
protectedMessage: VERCEL_PROTECTED_MESSAGE,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Polls a just-created Vercel deployment until it reaches a terminal
|
|
134
|
+
* `readyState` (`READY`/`ERROR`) or the fixed 30-attempt budget is spent
|
|
135
|
+
* (~1s for the first 5 attempts, 2s thereafter — roughly a minute).
|
|
136
|
+
*
|
|
137
|
+
* A response this file cannot parse as JSON is treated as "keep polling,"
|
|
138
|
+
* not an error — same reasoning as `github-pages.ts`'s `pollGitHubPagesBuild`
|
|
139
|
+
* (fixed 2026-08-16 for the identical bug class): the deployment already
|
|
140
|
+
* exists server-side by the time this loop runs (the create call above
|
|
141
|
+
* already succeeded), so a transient/edge/empty poll response is exactly as
|
|
142
|
+
* uninformative as a stuck in-progress state, never a reason to report an
|
|
143
|
+
* already-created deployment as failed. Any other non-2xx response whose
|
|
144
|
+
* body DID parse still fails fast, unchanged.
|
|
145
|
+
*
|
|
146
|
+
* @complexity O(30) network round-trips, bounded and fixed regardless of input size.
|
|
147
|
+
* @overallScore 90/100
|
|
148
|
+
* @tradeoffs Fixed attempt/backoff constants (lifted verbatim from the OD
|
|
149
|
+
* origin) rather than caller-configurable ones — acceptable for now since
|
|
150
|
+
* `publish` has no caller-facing timeout knob yet either; flagged as a
|
|
151
|
+
* minor extensibility gap rather than a correctness issue.
|
|
152
|
+
*/
|
|
153
|
+
async function pollVercelDeployment(config, id) {
|
|
154
|
+
let last = null;
|
|
155
|
+
for (let i = 0; i < 30; i += 1) {
|
|
156
|
+
await new Promise((resolve) => setTimeout(resolve, i < 5 ? 1000 : 2000));
|
|
157
|
+
const resp = await fetchWithTimeout(`${VERCEL_API}/v13/deployments/${encodeURIComponent(id)}${vercelTeamQuery(config)}`, redirectGuardInit({ headers: { Authorization: `Bearer ${config.token}` } }), { timeoutMs: FETCH_TIMEOUT_MS.DEPLOY });
|
|
158
|
+
assertNotRedirected(resp, 'Vercel deployment status poll');
|
|
159
|
+
let json;
|
|
160
|
+
try {
|
|
161
|
+
json = await readVercelJson(resp);
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
// Nothing usable to report yet — keep polling within the same fixed budget
|
|
165
|
+
// rather than turning an ambiguous mid-poll hiccup into a reported failure.
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
if (!resp.ok)
|
|
169
|
+
throw vercelError(json, resp.status);
|
|
170
|
+
last = json;
|
|
171
|
+
if (json.readyState === 'READY' || json.readyState === 'ERROR')
|
|
172
|
+
return json;
|
|
173
|
+
}
|
|
174
|
+
return last;
|
|
175
|
+
}
|
|
176
|
+
function vercelTeamQuery(config) {
|
|
177
|
+
const params = new URLSearchParams();
|
|
178
|
+
if (config.teamId)
|
|
179
|
+
params.set('teamId', config.teamId);
|
|
180
|
+
else if (config.teamSlug)
|
|
181
|
+
params.set('slug', config.teamSlug);
|
|
182
|
+
const s = params.toString();
|
|
183
|
+
return s ? `?${s}` : '';
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Derives a Vercel-safe project name from a caller-supplied label, falling
|
|
187
|
+
* back to a random id if the label sanitizes to nothing. Replaces the OD
|
|
188
|
+
* origin's hardcoded `od-${projectId}` convention.
|
|
189
|
+
*/
|
|
190
|
+
function safeVercelProjectName(projectName) {
|
|
191
|
+
return safeProjectLabel(projectName, 80) || `deploy-${Math.random().toString(36).slice(2, 10)}`;
|
|
192
|
+
}
|
|
193
|
+
async function readVercelJson(resp) {
|
|
194
|
+
try {
|
|
195
|
+
return (await resp.json());
|
|
196
|
+
}
|
|
197
|
+
catch {
|
|
198
|
+
throw new DeployError('Vercel returned a non-JSON response.', resp.status || 502);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function vercelError(json, status) {
|
|
202
|
+
const code = json?.error && typeof json.error === 'object' ? json.error.code : undefined;
|
|
203
|
+
const message = (json?.error && typeof json.error === 'object' ? json.error.message : undefined) ||
|
|
204
|
+
json?.message ||
|
|
205
|
+
`Vercel request failed (${status}).`;
|
|
206
|
+
if (code === 'forbidden' || /permission/i.test(String(message))) {
|
|
207
|
+
return new DeployError("You don't have permission to create a project.", status, json);
|
|
208
|
+
}
|
|
209
|
+
return new DeployError(String(message), status, json);
|
|
210
|
+
}
|
|
211
|
+
function deploymentUrl(json) {
|
|
212
|
+
const url = json?.url || json?.alias?.[0] || '';
|
|
213
|
+
if (!url)
|
|
214
|
+
return '';
|
|
215
|
+
return /^https?:\/\//i.test(url) ? url : `https://${url}`;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* `if (!json) continue` is unreachable via this file's one call site,
|
|
219
|
+
* `deploymentUrlCandidates(ready, created)` in `publish()`: `created` comes
|
|
220
|
+
* from `readVercelJson`, which either returns a real parsed `JsonObject` or
|
|
221
|
+
* throws (never resolves to null/undefined); `ready` is either `created`
|
|
222
|
+
* itself (same guarantee) or `pollVercelDeployment`'s result, which — per
|
|
223
|
+
* that function's own loop shape (`i < 30` starting at `i = 0`, so it always
|
|
224
|
+
* runs at least one full iteration before it can return, and that iteration
|
|
225
|
+
* unconditionally assigns `last = json` right after the `!resp.ok` throw
|
|
226
|
+
* check, before any `return`) — can only resolve to a real `JsonObject` or
|
|
227
|
+
* throw, never resolve to `null`. The wider `(JsonObject | null | undefined)[]`
|
|
228
|
+
* parameter type is deliberately more permissive than what this one caller
|
|
229
|
+
* can ever supply — same "general-purpose helper, defense-in-depth beyond
|
|
230
|
+
* today's only caller" reasoning `netlify.ts`'s own `netlifyUrlCandidates`
|
|
231
|
+
* already documents for its structurally identical guard.
|
|
232
|
+
*/
|
|
233
|
+
function deploymentUrlCandidates(...responses) {
|
|
234
|
+
const urls = [];
|
|
235
|
+
for (const json of responses) {
|
|
236
|
+
if (!json)
|
|
237
|
+
continue;
|
|
238
|
+
if (typeof json.url === 'string')
|
|
239
|
+
urls.push(json.url);
|
|
240
|
+
for (const alias of json.alias ?? []) {
|
|
241
|
+
if (typeof alias === 'string')
|
|
242
|
+
urls.push(alias);
|
|
243
|
+
}
|
|
244
|
+
for (const alias of json.aliases ?? []) {
|
|
245
|
+
if (typeof alias === 'string')
|
|
246
|
+
urls.push(alias);
|
|
247
|
+
else if (alias && typeof alias === 'object') {
|
|
248
|
+
const a = alias;
|
|
249
|
+
if (typeof a.domain === 'string')
|
|
250
|
+
urls.push(a.domain);
|
|
251
|
+
else if (typeof a.url === 'string')
|
|
252
|
+
urls.push(a.url);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return [...new Set(urls.map(normalizeDeploymentUrl).filter(Boolean))];
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=vercel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vercel.js","sourceRoot":"","sources":["../../src/deploy/vercel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAC9G,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,WAAW,E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AAI,CAAC,KAAmB,IAAI,EAAE,EAAE,CAAC;YACpD,IAAI,OAAO,KAAK,KAAK,QAAQ;gBAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClD,CAAC;QACD,KAAK,MAAM,KAAK,IAAK,IAAI,CAAC,OAAqB,IAAI,EAAE,EAAE,CAAC;YACtD,IAAI,OAAO,KAAK,KAAK,QAAQ;gBAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;iBAC3C,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC5C,MAAM,CAAC,GAAG,KAAmB,CAAC;gBAC9B,IAAI,OAAO,CAAC,CAAC,MAAM,KAAK,QAAQ;oBAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;qBACjD,IAAI,OAAO,CAAC,CAAC,GAAG,KAAK,QAAQ;oBAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACxE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC"}
|