@hs-x/cli 0.3.0 → 0.3.6
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/commands/account.d.ts +6 -6
- package/dist/commands/api.js +1 -1
- package/dist/commands/control-plane-read.d.ts +8 -8
- package/dist/commands/deploy-promote.d.ts +1 -1
- package/dist/commands/deploy.d.ts +3 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +180 -22
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/flags.d.ts +1 -1
- package/dist/commands/init.d.ts +2 -2
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +29 -5
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/link.d.ts +1 -1
- package/dist/commands/migrate.d.ts +1 -1
- package/dist/commands/rollback.d.ts +1 -1
- package/dist/commands/secrets.d.ts +2 -2
- package/dist/commands/status.d.ts +1 -1
- package/dist/commands/validate.d.ts +2 -2
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/init/templates.d.ts +1 -1
- package/dist/init/templates.d.ts.map +1 -1
- package/dist/init/templates.js +71 -1
- package/dist/init/templates.js.map +1 -1
- package/dist/services/live.d.ts +1 -1
- package/package.json +8 -8
- package/dist/cloudflare-worker-versions.d.ts +0 -184
- package/dist/cloudflare-worker-versions.d.ts.map +0 -1
- package/dist/cloudflare-worker-versions.js +0 -360
- package/dist/cloudflare-worker-versions.js.map +0 -1
- package/dist/rollback-traffic.d.ts +0 -85
- package/dist/rollback-traffic.d.ts.map +0 -1
- package/dist/rollback-traffic.js +0 -204
- package/dist/rollback-traffic.js.map +0 -1
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cloudflare Worker Versions/Deployments adapter (ADR-021).
|
|
3
|
-
*
|
|
4
|
-
* Rollback = point traffic at a retained Worker version via Cloudflare's
|
|
5
|
-
* native Versions/Deployments API. This module is the single place HS-X
|
|
6
|
-
* talks to that API surface: deploy capture (R03) records version ids from
|
|
7
|
-
* it, and rollback (R04) creates 100% deployments through it.
|
|
8
|
-
*
|
|
9
|
-
* API references (shapes confirmed 2026-07-14):
|
|
10
|
-
* - Versions: https://developers.cloudflare.com/api/resources/workers/subresources/scripts/subresources/versions/
|
|
11
|
-
* - List: GET /accounts/{account_id}/workers/scripts/{script_name}/versions
|
|
12
|
-
* response `result.items` (latest first; `?deployable=true` filter, `page`/`per_page`)
|
|
13
|
-
* https://developers.cloudflare.com/api/resources/workers/subresources/scripts/subresources/versions/methods/list/
|
|
14
|
-
* - Get: GET .../versions/{version_id} (full metadata + annotations + resources)
|
|
15
|
-
* - Deployments: https://developers.cloudflare.com/api/resources/workers/subresources/scripts/subresources/deployments/
|
|
16
|
-
* - List: GET .../deployments — response `result.deployments`, first entry is the
|
|
17
|
-
* ACTIVE deployment
|
|
18
|
-
* https://developers.cloudflare.com/api/resources/workers/subresources/scripts/subresources/deployments/methods/list/
|
|
19
|
-
* - Create: POST .../deployments (optional `?force=true`) with body
|
|
20
|
-
* `{ strategy: "percentage", versions: [{ percentage, version_id }], annotations? }`
|
|
21
|
-
* - Get: GET .../deployments/{deployment_id}
|
|
22
|
-
* - Concepts: https://developers.cloudflare.com/workers/configuration/versions-and-deployments/
|
|
23
|
-
*
|
|
24
|
-
* The only caller-settable deployment annotation is `workers/message` (max 1000
|
|
25
|
-
* bytes); `workers/triggered_by` is read-only (Cloudflare rejects it, HTTP 400
|
|
26
|
-
* code 10210). So the idempotency tag AND the trigger context both ride in
|
|
27
|
-
* `workers/message` — `[hsx-op:<operationId>] [<triggeredBy>] <message>`.
|
|
28
|
-
* `reconcileDeployment` recovers a previously-applied deployment by that tag
|
|
29
|
-
* after an ambiguous (timeout/5xx) create response.
|
|
30
|
-
*
|
|
31
|
-
* The adapter takes account id + script name verbatim and never invents
|
|
32
|
-
* names or ids: every version/deployment id it returns came from Cloudflare.
|
|
33
|
-
*/
|
|
34
|
-
export type CloudflareWorkerVersionsErrorCode = 'HSX_E_CLOUDFLARE_AUTH_FAILED' | 'HSX_E_CLOUDFLARE_SCRIPT_NOT_FOUND' | 'HSX_E_CLOUDFLARE_VERSION_NOT_FOUND' | 'HSX_E_CLOUDFLARE_DEPLOYMENT_AMBIGUOUS' | 'HSX_E_CLOUDFLARE_VERSIONS_API';
|
|
35
|
-
export declare abstract class CloudflareWorkerVersionsError extends Error {
|
|
36
|
-
abstract readonly code: CloudflareWorkerVersionsErrorCode;
|
|
37
|
-
readonly detail: string;
|
|
38
|
-
readonly status: number | undefined;
|
|
39
|
-
constructor(message: string, detail: string, status?: number);
|
|
40
|
-
}
|
|
41
|
-
/** 401/403 (or Cloudflare "Authentication error" code 10000) from the API. */
|
|
42
|
-
export declare class CloudflareWorkerAuthFailedError extends CloudflareWorkerVersionsError {
|
|
43
|
-
readonly code: "HSX_E_CLOUDFLARE_AUTH_FAILED";
|
|
44
|
-
constructor(detail: string, status?: number);
|
|
45
|
-
}
|
|
46
|
-
/** The Worker script does not exist on this account. */
|
|
47
|
-
export declare class CloudflareScriptNotFoundError extends CloudflareWorkerVersionsError {
|
|
48
|
-
readonly code: "HSX_E_CLOUDFLARE_SCRIPT_NOT_FOUND";
|
|
49
|
-
readonly scriptName: string;
|
|
50
|
-
constructor(scriptName: string, detail: string, status?: number);
|
|
51
|
-
}
|
|
52
|
-
/** The target version id does not exist (or is not deployable) for this script. */
|
|
53
|
-
export declare class CloudflareVersionNotFoundError extends CloudflareWorkerVersionsError {
|
|
54
|
-
readonly code: "HSX_E_CLOUDFLARE_VERSION_NOT_FOUND";
|
|
55
|
-
readonly versionId: string;
|
|
56
|
-
constructor(versionId: string, detail: string, status?: number);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* A deployment create got an ambiguous response (network failure, timeout, or
|
|
60
|
-
* 5xx AFTER the POST was sent): Cloudflare may or may not have applied it.
|
|
61
|
-
* Callers must NOT blindly retry a raw POST — call `reconcileDeployment`
|
|
62
|
-
* (or `createDeployment` again, which reconciles first) with the same
|
|
63
|
-
* `operationId` to discover whether the deployment took effect.
|
|
64
|
-
*/
|
|
65
|
-
export declare class CloudflareDeploymentAmbiguousError extends CloudflareWorkerVersionsError {
|
|
66
|
-
readonly code: "HSX_E_CLOUDFLARE_DEPLOYMENT_AMBIGUOUS";
|
|
67
|
-
readonly operationId: string;
|
|
68
|
-
readonly versionId: string;
|
|
69
|
-
constructor(input: {
|
|
70
|
-
readonly operationId: string;
|
|
71
|
-
readonly versionId: string;
|
|
72
|
-
readonly detail: string;
|
|
73
|
-
readonly status?: number;
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
/** Any other API failure (unexpected 4xx, malformed body, transport error on reads). */
|
|
77
|
-
export declare class CloudflareVersionsApiError extends CloudflareWorkerVersionsError {
|
|
78
|
-
readonly code: "HSX_E_CLOUDFLARE_VERSIONS_API";
|
|
79
|
-
constructor(detail: string, status?: number);
|
|
80
|
-
}
|
|
81
|
-
export interface WorkerVersionSummary {
|
|
82
|
-
/** Cloudflare version id (UUID) — returned verbatim, never fabricated. */
|
|
83
|
-
readonly id: string;
|
|
84
|
-
/** Sequential version number, when present. */
|
|
85
|
-
readonly number?: number;
|
|
86
|
-
readonly createdOn?: string;
|
|
87
|
-
/** Upload origin: 'api' | 'wrangler' | 'dash' | 'terraform' | ... */
|
|
88
|
-
readonly source?: string;
|
|
89
|
-
readonly authorEmail?: string;
|
|
90
|
-
/** `workers/message` version annotation. */
|
|
91
|
-
readonly message?: string;
|
|
92
|
-
/** `workers/tag` version annotation. */
|
|
93
|
-
readonly tag?: string;
|
|
94
|
-
/** Raw `annotations` object, verbatim. */
|
|
95
|
-
readonly annotations?: Readonly<Record<string, string>>;
|
|
96
|
-
}
|
|
97
|
-
export interface WorkerVersionDetail extends WorkerVersionSummary {
|
|
98
|
-
/**
|
|
99
|
-
* Raw `resources` block (bindings, script hash/handlers, script_runtime).
|
|
100
|
-
* Kept opaque: R03/R04 record and compare it, they do not edit it.
|
|
101
|
-
*/
|
|
102
|
-
readonly resources?: unknown;
|
|
103
|
-
}
|
|
104
|
-
export interface WorkerDeploymentVersionSplit {
|
|
105
|
-
readonly versionId: string;
|
|
106
|
-
readonly percentage: number;
|
|
107
|
-
}
|
|
108
|
-
export interface WorkerDeployment {
|
|
109
|
-
/** Cloudflare deployment id — returned verbatim, never fabricated. */
|
|
110
|
-
readonly id: string;
|
|
111
|
-
readonly createdOn?: string;
|
|
112
|
-
readonly source?: string;
|
|
113
|
-
readonly strategy: string;
|
|
114
|
-
readonly versions: readonly WorkerDeploymentVersionSplit[];
|
|
115
|
-
readonly annotations?: Readonly<Record<string, string>>;
|
|
116
|
-
readonly authorEmail?: string;
|
|
117
|
-
/** HS-X operation id parsed from the `[hsx-op:...]` tag in `workers/message`, if present. */
|
|
118
|
-
readonly operationId?: string;
|
|
119
|
-
}
|
|
120
|
-
export interface CreateDeploymentInput {
|
|
121
|
-
/** Target Worker version id; receives 100% of traffic. */
|
|
122
|
-
readonly versionId: string;
|
|
123
|
-
/**
|
|
124
|
-
* Idempotency tag for this logical operation (e.g. a rollback attempt id).
|
|
125
|
-
* Embedded in the `workers/message` annotation; retrying with the same id
|
|
126
|
-
* returns the already-applied deployment instead of double-applying.
|
|
127
|
-
* Allowed: [A-Za-z0-9._-], 1..=64 chars.
|
|
128
|
-
*/
|
|
129
|
-
readonly operationId: string;
|
|
130
|
-
/** Human-readable message appended after the idempotency tag. */
|
|
131
|
-
readonly message?: string;
|
|
132
|
-
/** `workers/triggered_by` annotation (e.g. 'rollback', 'deployment'). */
|
|
133
|
-
readonly triggeredBy?: string;
|
|
134
|
-
/** Bypass Cloudflare deployment safeguards (`?force=true`). */
|
|
135
|
-
readonly force?: boolean;
|
|
136
|
-
}
|
|
137
|
-
export interface CreateDeploymentResult {
|
|
138
|
-
readonly deployment: WorkerDeployment;
|
|
139
|
-
/**
|
|
140
|
-
* True when the deployment was found via reconcile (a prior attempt with
|
|
141
|
-
* this operationId already applied) rather than created by this call.
|
|
142
|
-
*/
|
|
143
|
-
readonly alreadyApplied: boolean;
|
|
144
|
-
}
|
|
145
|
-
export interface ListVersionsOptions {
|
|
146
|
-
/** Only versions that can be the target of a deployment. */
|
|
147
|
-
readonly deployable?: boolean;
|
|
148
|
-
readonly page?: number;
|
|
149
|
-
readonly perPage?: number;
|
|
150
|
-
}
|
|
151
|
-
export interface CloudflareWorkerVersionsClient {
|
|
152
|
-
/** Versions for the script, latest first (single page; see ListVersionsOptions). */
|
|
153
|
-
listVersions(options?: ListVersionsOptions): Promise<readonly WorkerVersionSummary[]>;
|
|
154
|
-
/** Full version detail including metadata, annotations, and resources. */
|
|
155
|
-
getVersion(versionId: string): Promise<WorkerVersionDetail>;
|
|
156
|
-
/**
|
|
157
|
-
* Idempotently point 100% of traffic at `versionId`. Reconciles by
|
|
158
|
-
* `operationId` first, so a retry after CloudflareDeploymentAmbiguousError
|
|
159
|
-
* resolves to the already-applied deployment instead of a duplicate.
|
|
160
|
-
*/
|
|
161
|
-
createDeployment(input: CreateDeploymentInput): Promise<CreateDeploymentResult>;
|
|
162
|
-
getDeployment(deploymentId: string): Promise<WorkerDeployment>;
|
|
163
|
-
/** All deployments, active first (Cloudflare list order). */
|
|
164
|
-
listDeployments(): Promise<readonly WorkerDeployment[]>;
|
|
165
|
-
/** The deployment currently serving traffic, or undefined if none exist. */
|
|
166
|
-
getActiveDeployment(): Promise<WorkerDeployment | undefined>;
|
|
167
|
-
/**
|
|
168
|
-
* Determine whether a previously-attempted create with this operationId
|
|
169
|
-
* actually took effect. Returns the tagged deployment, or undefined.
|
|
170
|
-
*/
|
|
171
|
-
reconcileDeployment(operationId: string): Promise<WorkerDeployment | undefined>;
|
|
172
|
-
}
|
|
173
|
-
export declare function formatOperationTag(operationId: string): string;
|
|
174
|
-
export declare function parseOperationTag(message: string | undefined): string | undefined;
|
|
175
|
-
export declare function createWorkerVersionsClient(input: {
|
|
176
|
-
/** Cloudflare account id — used verbatim. */
|
|
177
|
-
readonly accountId: string;
|
|
178
|
-
/** Worker script name — stable identity supplied by the caller, used verbatim. */
|
|
179
|
-
readonly scriptName: string;
|
|
180
|
-
readonly apiToken: string;
|
|
181
|
-
readonly baseUrl?: string;
|
|
182
|
-
readonly fetchImpl?: typeof fetch;
|
|
183
|
-
}): CloudflareWorkerVersionsClient;
|
|
184
|
-
//# sourceMappingURL=cloudflare-worker-versions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cloudflare-worker-versions.d.ts","sourceRoot":"","sources":["../src/cloudflare-worker-versions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAMH,MAAM,MAAM,iCAAiC,GACzC,8BAA8B,GAC9B,mCAAmC,GACnC,oCAAoC,GACpC,uCAAuC,GACvC,+BAA+B,CAAC;AAEpC,8BAAsB,6BAA8B,SAAQ,KAAK;IAC/D,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,iCAAiC,CAAC;IAC1D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;gBACxB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAK7D;AAED,8EAA8E;AAC9E,qBAAa,+BAAgC,SAAQ,6BAA6B;IAChF,QAAQ,CAAC,IAAI,EAAG,8BAA8B,CAAU;gBAC5C,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAI5C;AAED,wDAAwD;AACxD,qBAAa,6BAA8B,SAAQ,6BAA6B;IAC9E,QAAQ,CAAC,IAAI,EAAG,mCAAmC,CAAU;IAC7D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;gBAChB,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAKhE;AAED,mFAAmF;AACnF,qBAAa,8BAA+B,SAA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AAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CACnC,GAAG,8BAA8B,CAsSjC"}
|
|
@@ -1,360 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cloudflare Worker Versions/Deployments adapter (ADR-021).
|
|
3
|
-
*
|
|
4
|
-
* Rollback = point traffic at a retained Worker version via Cloudflare's
|
|
5
|
-
* native Versions/Deployments API. This module is the single place HS-X
|
|
6
|
-
* talks to that API surface: deploy capture (R03) records version ids from
|
|
7
|
-
* it, and rollback (R04) creates 100% deployments through it.
|
|
8
|
-
*
|
|
9
|
-
* API references (shapes confirmed 2026-07-14):
|
|
10
|
-
* - Versions: https://developers.cloudflare.com/api/resources/workers/subresources/scripts/subresources/versions/
|
|
11
|
-
* - List: GET /accounts/{account_id}/workers/scripts/{script_name}/versions
|
|
12
|
-
* response `result.items` (latest first; `?deployable=true` filter, `page`/`per_page`)
|
|
13
|
-
* https://developers.cloudflare.com/api/resources/workers/subresources/scripts/subresources/versions/methods/list/
|
|
14
|
-
* - Get: GET .../versions/{version_id} (full metadata + annotations + resources)
|
|
15
|
-
* - Deployments: https://developers.cloudflare.com/api/resources/workers/subresources/scripts/subresources/deployments/
|
|
16
|
-
* - List: GET .../deployments — response `result.deployments`, first entry is the
|
|
17
|
-
* ACTIVE deployment
|
|
18
|
-
* https://developers.cloudflare.com/api/resources/workers/subresources/scripts/subresources/deployments/methods/list/
|
|
19
|
-
* - Create: POST .../deployments (optional `?force=true`) with body
|
|
20
|
-
* `{ strategy: "percentage", versions: [{ percentage, version_id }], annotations? }`
|
|
21
|
-
* - Get: GET .../deployments/{deployment_id}
|
|
22
|
-
* - Concepts: https://developers.cloudflare.com/workers/configuration/versions-and-deployments/
|
|
23
|
-
*
|
|
24
|
-
* The only caller-settable deployment annotation is `workers/message` (max 1000
|
|
25
|
-
* bytes); `workers/triggered_by` is read-only (Cloudflare rejects it, HTTP 400
|
|
26
|
-
* code 10210). So the idempotency tag AND the trigger context both ride in
|
|
27
|
-
* `workers/message` — `[hsx-op:<operationId>] [<triggeredBy>] <message>`.
|
|
28
|
-
* `reconcileDeployment` recovers a previously-applied deployment by that tag
|
|
29
|
-
* after an ambiguous (timeout/5xx) create response.
|
|
30
|
-
*
|
|
31
|
-
* The adapter takes account id + script name verbatim and never invents
|
|
32
|
-
* names or ids: every version/deployment id it returns came from Cloudflare.
|
|
33
|
-
*/
|
|
34
|
-
export class CloudflareWorkerVersionsError extends Error {
|
|
35
|
-
detail;
|
|
36
|
-
status;
|
|
37
|
-
constructor(message, detail, status) {
|
|
38
|
-
super(message);
|
|
39
|
-
this.detail = detail;
|
|
40
|
-
this.status = status;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/** 401/403 (or Cloudflare "Authentication error" code 10000) from the API. */
|
|
44
|
-
export class CloudflareWorkerAuthFailedError extends CloudflareWorkerVersionsError {
|
|
45
|
-
code = 'HSX_E_CLOUDFLARE_AUTH_FAILED';
|
|
46
|
-
constructor(detail, status) {
|
|
47
|
-
super('Cloudflare rejected the API credential for the Worker Versions API.', detail, status);
|
|
48
|
-
this.name = 'CloudflareWorkerAuthFailedError';
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/** The Worker script does not exist on this account. */
|
|
52
|
-
export class CloudflareScriptNotFoundError extends CloudflareWorkerVersionsError {
|
|
53
|
-
code = 'HSX_E_CLOUDFLARE_SCRIPT_NOT_FOUND';
|
|
54
|
-
scriptName;
|
|
55
|
-
constructor(scriptName, detail, status) {
|
|
56
|
-
super(`Cloudflare Worker script "${scriptName}" was not found.`, detail, status);
|
|
57
|
-
this.name = 'CloudflareScriptNotFoundError';
|
|
58
|
-
this.scriptName = scriptName;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
/** The target version id does not exist (or is not deployable) for this script. */
|
|
62
|
-
export class CloudflareVersionNotFoundError extends CloudflareWorkerVersionsError {
|
|
63
|
-
code = 'HSX_E_CLOUDFLARE_VERSION_NOT_FOUND';
|
|
64
|
-
versionId;
|
|
65
|
-
constructor(versionId, detail, status) {
|
|
66
|
-
super(`Cloudflare Worker version "${versionId}" was not found or is not deployable.`, detail, status);
|
|
67
|
-
this.name = 'CloudflareVersionNotFoundError';
|
|
68
|
-
this.versionId = versionId;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* A deployment create got an ambiguous response (network failure, timeout, or
|
|
73
|
-
* 5xx AFTER the POST was sent): Cloudflare may or may not have applied it.
|
|
74
|
-
* Callers must NOT blindly retry a raw POST — call `reconcileDeployment`
|
|
75
|
-
* (or `createDeployment` again, which reconciles first) with the same
|
|
76
|
-
* `operationId` to discover whether the deployment took effect.
|
|
77
|
-
*/
|
|
78
|
-
export class CloudflareDeploymentAmbiguousError extends CloudflareWorkerVersionsError {
|
|
79
|
-
code = 'HSX_E_CLOUDFLARE_DEPLOYMENT_AMBIGUOUS';
|
|
80
|
-
operationId;
|
|
81
|
-
versionId;
|
|
82
|
-
constructor(input) {
|
|
83
|
-
super('Cloudflare returned an ambiguous response while creating a Worker deployment; it may or may not have been applied. Reconcile with the same operation id before retrying.', input.detail, input.status);
|
|
84
|
-
this.name = 'CloudflareDeploymentAmbiguousError';
|
|
85
|
-
this.operationId = input.operationId;
|
|
86
|
-
this.versionId = input.versionId;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
/** Any other API failure (unexpected 4xx, malformed body, transport error on reads). */
|
|
90
|
-
export class CloudflareVersionsApiError extends CloudflareWorkerVersionsError {
|
|
91
|
-
code = 'HSX_E_CLOUDFLARE_VERSIONS_API';
|
|
92
|
-
constructor(detail, status) {
|
|
93
|
-
super('Cloudflare Worker Versions API request failed.', detail, status);
|
|
94
|
-
this.name = 'CloudflareVersionsApiError';
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
// ---------------------------------------------------------------------------
|
|
98
|
-
// Idempotency tag helpers
|
|
99
|
-
// ---------------------------------------------------------------------------
|
|
100
|
-
const OPERATION_ID_PATTERN = /^[A-Za-z0-9._-]{1,64}$/;
|
|
101
|
-
const OPERATION_TAG_PATTERN = /\[hsx-op:([A-Za-z0-9._-]{1,64})\]/;
|
|
102
|
-
/** `workers/message` is truncated by Cloudflare at 1000 bytes; stay under it. */
|
|
103
|
-
const MAX_MESSAGE_BYTES = 1000;
|
|
104
|
-
export function formatOperationTag(operationId) {
|
|
105
|
-
if (!OPERATION_ID_PATTERN.test(operationId)) {
|
|
106
|
-
throw new Error(`operationId must match ${String(OPERATION_ID_PATTERN)} (got ${JSON.stringify(operationId)})`);
|
|
107
|
-
}
|
|
108
|
-
return `[hsx-op:${operationId}]`;
|
|
109
|
-
}
|
|
110
|
-
export function parseOperationTag(message) {
|
|
111
|
-
if (!message)
|
|
112
|
-
return undefined;
|
|
113
|
-
const match = OPERATION_TAG_PATTERN.exec(message);
|
|
114
|
-
return match?.[1];
|
|
115
|
-
}
|
|
116
|
-
function buildDeploymentMessage(operationId, message, triggeredBy) {
|
|
117
|
-
const tag = formatOperationTag(operationId);
|
|
118
|
-
// Cloudflare rejects a caller-set `workers/triggered_by` annotation (HTTP 400
|
|
119
|
-
// code 10210 — it is read-only, set by Cloudflare), so carry the trigger
|
|
120
|
-
// context inside `workers/message` instead. The tag stays at the very front:
|
|
121
|
-
// reconcile keys on it, so it must never be truncated.
|
|
122
|
-
const prefix = triggeredBy ? `${tag} [${triggeredBy}]` : tag;
|
|
123
|
-
if (!message)
|
|
124
|
-
return prefix;
|
|
125
|
-
const full = `${prefix} ${message}`;
|
|
126
|
-
if (Buffer.byteLength(full, 'utf8') <= MAX_MESSAGE_BYTES)
|
|
127
|
-
return full;
|
|
128
|
-
let trimmed = message;
|
|
129
|
-
while (trimmed.length > 0 &&
|
|
130
|
-
Buffer.byteLength(`${prefix} ${trimmed}`, 'utf8') > MAX_MESSAGE_BYTES) {
|
|
131
|
-
trimmed = trimmed.slice(0, -1);
|
|
132
|
-
}
|
|
133
|
-
return trimmed.length > 0 ? `${prefix} ${trimmed}` : prefix;
|
|
134
|
-
}
|
|
135
|
-
/** Cloudflare "workers.api.error.script_not_found". */
|
|
136
|
-
const CF_CODE_SCRIPT_NOT_FOUND = 10007;
|
|
137
|
-
/** Cloudflare "Authentication error". */
|
|
138
|
-
const CF_CODE_AUTH_ERROR = 10000;
|
|
139
|
-
export function createWorkerVersionsClient(input) {
|
|
140
|
-
const fetchImpl = input.fetchImpl ?? fetch;
|
|
141
|
-
const baseUrl = input.baseUrl ?? 'https://api.cloudflare.com';
|
|
142
|
-
const scriptRoot = `/client/v4/accounts/${encodeURIComponent(input.accountId)}/workers/scripts/${encodeURIComponent(input.scriptName)}`;
|
|
143
|
-
/**
|
|
144
|
-
* Execute a request and parse the standard Cloudflare envelope. Transport
|
|
145
|
-
* failures (fetch throw / timeout) are NOT caught here — create-deployment
|
|
146
|
-
* needs to classify them as ambiguous, reads classify them as API errors.
|
|
147
|
-
*/
|
|
148
|
-
const request = async (path, init = {}) => {
|
|
149
|
-
const response = await fetchImpl(new URL(path, baseUrl), {
|
|
150
|
-
...init,
|
|
151
|
-
headers: {
|
|
152
|
-
authorization: `Bearer ${input.apiToken}`,
|
|
153
|
-
accept: 'application/json',
|
|
154
|
-
...(init.body ? { 'content-type': 'application/json' } : {}),
|
|
155
|
-
...(init.headers ?? {}),
|
|
156
|
-
},
|
|
157
|
-
});
|
|
158
|
-
const rawText = await response.text().catch(() => '');
|
|
159
|
-
let body = {};
|
|
160
|
-
try {
|
|
161
|
-
body = rawText ? JSON.parse(rawText) : {};
|
|
162
|
-
}
|
|
163
|
-
catch {
|
|
164
|
-
body = {};
|
|
165
|
-
}
|
|
166
|
-
return { status: response.status, body, rawText };
|
|
167
|
-
};
|
|
168
|
-
const errorDetail = (response, fallback) => {
|
|
169
|
-
const messages = (response.body.errors ?? [])
|
|
170
|
-
.map((error) => (error.message ? `${error.code ?? ''} ${error.message}`.trim() : undefined))
|
|
171
|
-
.filter((message) => Boolean(message));
|
|
172
|
-
if (messages.length > 0)
|
|
173
|
-
return `HTTP ${response.status}: ${messages.join('; ')}`;
|
|
174
|
-
if (response.rawText)
|
|
175
|
-
return `HTTP ${response.status}: ${response.rawText.slice(0, 300)}`;
|
|
176
|
-
return `HTTP ${response.status}: ${fallback}`;
|
|
177
|
-
};
|
|
178
|
-
const isAuthFailure = (response) => response.status === 401 ||
|
|
179
|
-
response.status === 403 ||
|
|
180
|
-
(response.body.errors ?? []).some((error) => error.code === CF_CODE_AUTH_ERROR);
|
|
181
|
-
const isScriptNotFound = (response) => (response.body.errors ?? []).some((error) => error.code === CF_CODE_SCRIPT_NOT_FOUND ||
|
|
182
|
-
/script.*not.?found|workers\.api\.error\.script_not_found/i.test(error.message ?? ''));
|
|
183
|
-
const succeeded = (response) => response.status >= 200 && response.status < 300 && response.body.success !== false;
|
|
184
|
-
/** Shared classification for read paths (list/get). */
|
|
185
|
-
const throwReadError = (response, context) => {
|
|
186
|
-
if (isAuthFailure(response)) {
|
|
187
|
-
throw new CloudflareWorkerAuthFailedError(errorDetail(response, 'authentication failed'), response.status);
|
|
188
|
-
}
|
|
189
|
-
if (isScriptNotFound(response)) {
|
|
190
|
-
throw new CloudflareScriptNotFoundError(input.scriptName, errorDetail(response, 'script not found'), response.status);
|
|
191
|
-
}
|
|
192
|
-
if (context.versionId && response.status === 404) {
|
|
193
|
-
throw new CloudflareVersionNotFoundError(context.versionId, errorDetail(response, 'version not found'), response.status);
|
|
194
|
-
}
|
|
195
|
-
throw new CloudflareVersionsApiError(errorDetail(response, 'request failed'), response.status);
|
|
196
|
-
};
|
|
197
|
-
const asRecord = (value) => typeof value === 'object' && value !== null ? value : {};
|
|
198
|
-
const asString = (value) => typeof value === 'string' ? value : undefined;
|
|
199
|
-
const asAnnotations = (value) => {
|
|
200
|
-
const record = asRecord(value);
|
|
201
|
-
const entries = Object.entries(record).filter((entry) => typeof entry[1] === 'string');
|
|
202
|
-
return entries.length > 0 ? Object.fromEntries(entries) : undefined;
|
|
203
|
-
};
|
|
204
|
-
const normalizeVersion = (raw) => {
|
|
205
|
-
const record = asRecord(raw);
|
|
206
|
-
const metadata = asRecord(record.metadata);
|
|
207
|
-
const annotations = asAnnotations(record.annotations);
|
|
208
|
-
const id = asString(record.id);
|
|
209
|
-
if (!id) {
|
|
210
|
-
throw new CloudflareVersionsApiError('Cloudflare returned a version without an id.');
|
|
211
|
-
}
|
|
212
|
-
return {
|
|
213
|
-
id,
|
|
214
|
-
...(typeof record.number === 'number' ? { number: record.number } : {}),
|
|
215
|
-
...(asString(metadata.created_on) ? { createdOn: asString(metadata.created_on) } : {}),
|
|
216
|
-
...(asString(metadata.source) ? { source: asString(metadata.source) } : {}),
|
|
217
|
-
...(asString(metadata.author_email) ? { authorEmail: asString(metadata.author_email) } : {}),
|
|
218
|
-
...(annotations?.['workers/message'] ? { message: annotations['workers/message'] } : {}),
|
|
219
|
-
...(annotations?.['workers/tag'] ? { tag: annotations['workers/tag'] } : {}),
|
|
220
|
-
...(annotations ? { annotations } : {}),
|
|
221
|
-
...('resources' in record ? { resources: record.resources } : {}),
|
|
222
|
-
};
|
|
223
|
-
};
|
|
224
|
-
const normalizeDeployment = (raw) => {
|
|
225
|
-
const record = asRecord(raw);
|
|
226
|
-
const id = asString(record.id);
|
|
227
|
-
if (!id) {
|
|
228
|
-
throw new CloudflareVersionsApiError('Cloudflare returned a deployment without an id.');
|
|
229
|
-
}
|
|
230
|
-
const annotations = asAnnotations(record.annotations);
|
|
231
|
-
const versions = Array.isArray(record.versions)
|
|
232
|
-
? record.versions.flatMap((entry) => {
|
|
233
|
-
const version = asRecord(entry);
|
|
234
|
-
const versionId = asString(version.version_id);
|
|
235
|
-
return versionId ? [{ versionId, percentage: Number(version.percentage ?? 0) }] : [];
|
|
236
|
-
})
|
|
237
|
-
: [];
|
|
238
|
-
const operationId = parseOperationTag(annotations?.['workers/message']);
|
|
239
|
-
return {
|
|
240
|
-
id,
|
|
241
|
-
strategy: asString(record.strategy) ?? 'percentage',
|
|
242
|
-
versions,
|
|
243
|
-
...(asString(record.created_on) ? { createdOn: asString(record.created_on) } : {}),
|
|
244
|
-
...(asString(record.source) ? { source: asString(record.source) } : {}),
|
|
245
|
-
...(asString(record.author_email) ? { authorEmail: asString(record.author_email) } : {}),
|
|
246
|
-
...(annotations ? { annotations } : {}),
|
|
247
|
-
...(operationId ? { operationId } : {}),
|
|
248
|
-
};
|
|
249
|
-
};
|
|
250
|
-
const listDeployments = async () => {
|
|
251
|
-
const response = await request(`${scriptRoot}/deployments`);
|
|
252
|
-
if (!succeeded(response))
|
|
253
|
-
throwReadError(response, {});
|
|
254
|
-
const result = asRecord(response.body.result);
|
|
255
|
-
const deployments = Array.isArray(result.deployments) ? result.deployments : [];
|
|
256
|
-
return deployments.map(normalizeDeployment);
|
|
257
|
-
};
|
|
258
|
-
const reconcileDeployment = async (operationId) => {
|
|
259
|
-
const tag = formatOperationTag(operationId);
|
|
260
|
-
const deployments = await listDeployments();
|
|
261
|
-
return deployments.find((deployment) => (deployment.annotations?.['workers/message'] ?? '').includes(tag));
|
|
262
|
-
};
|
|
263
|
-
return {
|
|
264
|
-
async listVersions(options) {
|
|
265
|
-
const url = new URL(`${scriptRoot}/versions`, baseUrl);
|
|
266
|
-
if (options?.deployable !== undefined) {
|
|
267
|
-
url.searchParams.set('deployable', String(options.deployable));
|
|
268
|
-
}
|
|
269
|
-
if (options?.page !== undefined)
|
|
270
|
-
url.searchParams.set('page', String(options.page));
|
|
271
|
-
if (options?.perPage !== undefined)
|
|
272
|
-
url.searchParams.set('per_page', String(options.perPage));
|
|
273
|
-
const response = await request(`${url.pathname}${url.search}`);
|
|
274
|
-
if (!succeeded(response))
|
|
275
|
-
throwReadError(response, {});
|
|
276
|
-
const result = asRecord(response.body.result);
|
|
277
|
-
const items = Array.isArray(result.items) ? result.items : [];
|
|
278
|
-
return items.map(normalizeVersion);
|
|
279
|
-
},
|
|
280
|
-
async getVersion(versionId) {
|
|
281
|
-
const response = await request(`${scriptRoot}/versions/${encodeURIComponent(versionId)}`);
|
|
282
|
-
if (!succeeded(response))
|
|
283
|
-
throwReadError(response, { versionId });
|
|
284
|
-
return normalizeVersion(response.body.result);
|
|
285
|
-
},
|
|
286
|
-
async createDeployment(deploymentInput) {
|
|
287
|
-
const { versionId, operationId } = deploymentInput;
|
|
288
|
-
const message = buildDeploymentMessage(operationId, deploymentInput.message, deploymentInput.triggeredBy);
|
|
289
|
-
// Reconcile-before-create: if a prior attempt with this operationId
|
|
290
|
-
// already applied (e.g. we got an ambiguous 500/timeout and the caller
|
|
291
|
-
// retried), return that deployment instead of double-applying.
|
|
292
|
-
const existing = await reconcileDeployment(operationId);
|
|
293
|
-
if (existing)
|
|
294
|
-
return { deployment: existing, alreadyApplied: true };
|
|
295
|
-
const path = `${scriptRoot}/deployments${deploymentInput.force ? '?force=true' : ''}`;
|
|
296
|
-
let response;
|
|
297
|
-
try {
|
|
298
|
-
response = await request(path, {
|
|
299
|
-
method: 'POST',
|
|
300
|
-
body: JSON.stringify({
|
|
301
|
-
strategy: 'percentage',
|
|
302
|
-
versions: [{ percentage: 100, version_id: versionId }],
|
|
303
|
-
annotations: {
|
|
304
|
-
'workers/message': message,
|
|
305
|
-
},
|
|
306
|
-
}),
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
catch (error) {
|
|
310
|
-
// Transport failure AFTER the POST left the process: Cloudflare may
|
|
311
|
-
// have applied it. Distinguishable so R04 reconciles, never blind-retries.
|
|
312
|
-
throw new CloudflareDeploymentAmbiguousError({
|
|
313
|
-
operationId,
|
|
314
|
-
versionId,
|
|
315
|
-
detail: error instanceof Error ? error.message : String(error),
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
if (succeeded(response)) {
|
|
319
|
-
return { deployment: normalizeDeployment(response.body.result), alreadyApplied: false };
|
|
320
|
-
}
|
|
321
|
-
if (response.status >= 500) {
|
|
322
|
-
// 5xx after a POST is ambiguous: the deployment may have been applied
|
|
323
|
-
// before the error was produced.
|
|
324
|
-
throw new CloudflareDeploymentAmbiguousError({
|
|
325
|
-
operationId,
|
|
326
|
-
versionId,
|
|
327
|
-
detail: errorDetail(response, 'deployment create returned a server error'),
|
|
328
|
-
status: response.status,
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
if (isAuthFailure(response)) {
|
|
332
|
-
throw new CloudflareWorkerAuthFailedError(errorDetail(response, 'authentication failed'), response.status);
|
|
333
|
-
}
|
|
334
|
-
if (isScriptNotFound(response)) {
|
|
335
|
-
throw new CloudflareScriptNotFoundError(input.scriptName, errorDetail(response, 'script not found'), response.status);
|
|
336
|
-
}
|
|
337
|
-
// Definitive 4xx: a missing/incompatible target version is the expected
|
|
338
|
-
// failure ("could not find version" / "not deployable").
|
|
339
|
-
if ((response.body.errors ?? []).some((error) => /version.*(not.?found|does not exist|not deployable)|could not find version/i.test(error.message ?? ''))) {
|
|
340
|
-
throw new CloudflareVersionNotFoundError(versionId, errorDetail(response, 'target version not found'), response.status);
|
|
341
|
-
}
|
|
342
|
-
throw new CloudflareVersionsApiError(errorDetail(response, 'deployment create failed'), response.status);
|
|
343
|
-
},
|
|
344
|
-
async getDeployment(deploymentId) {
|
|
345
|
-
const response = await request(`${scriptRoot}/deployments/${encodeURIComponent(deploymentId)}`);
|
|
346
|
-
if (!succeeded(response))
|
|
347
|
-
throwReadError(response, {});
|
|
348
|
-
return normalizeDeployment(response.body.result);
|
|
349
|
-
},
|
|
350
|
-
listDeployments,
|
|
351
|
-
async getActiveDeployment() {
|
|
352
|
-
// Cloudflare lists deployments with the active deployment first:
|
|
353
|
-
// https://developers.cloudflare.com/api/resources/workers/subresources/scripts/subresources/deployments/methods/list/
|
|
354
|
-
const deployments = await listDeployments();
|
|
355
|
-
return deployments[0];
|
|
356
|
-
},
|
|
357
|
-
reconcileDeployment,
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
//# sourceMappingURL=cloudflare-worker-versions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cloudflare-worker-versions.js","sourceRoot":"","sources":["../src/cloudflare-worker-versions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAaH,MAAM,OAAgB,6BAA8B,SAAQ,KAAK;IAEtD,MAAM,CAAS;IACf,MAAM,CAAqB;IACpC,YAAY,OAAe,EAAE,MAAc,EAAE,MAAe;QAC1D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAED,8EAA8E;AAC9E,MAAM,OAAO,+BAAgC,SAAQ,6BAA6B;IACvE,IAAI,GAAG,8BAAuC,CAAC;IACxD,YAAY,MAAc,EAAE,MAAe;QACzC,KAAK,CAAC,qEAAqE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC7F,IAAI,CAAC,IAAI,GAAG,iCAAiC,CAAC;IAChD,CAAC;CACF;AAED,wDAAwD;AACxD,MAAM,OAAO,6BAA8B,SAAQ,6BAA6B;IACrE,IAAI,GAAG,mCAA4C,CAAC;IACpD,UAAU,CAAS;IAC5B,YAAY,UAAkB,EAAE,MAAc,EAAE,MAAe;QAC7D,KAAK,CAAC,6BAA6B,UAAU,kBAAkB,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACjF,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAC;QAC5C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF;AAED,mFAAmF;AACnF,MAAM,OAAO,8BAA+B,SAAQ,6BAA6B;IACtE,IAAI,GAAG,oCAA6C,CAAC;IACrD,SAAS,CAAS;IAC3B,YAAY,SAAiB,EAAE,MAAc,EAAE,MAAe;QAC5D,KAAK,CACH,8BAA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