@theholocron/cloudflare-client 1.37.1 → 1.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +8 -1
- package/dist/index.mjs +1 -0
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -122,6 +122,12 @@ interface CfWorkerSecret {
|
|
|
122
122
|
name: string;
|
|
123
123
|
type: "secret_text";
|
|
124
124
|
}
|
|
125
|
+
/** https://developers.cloudflare.com/api/operations/worker-script-list-workers */
|
|
126
|
+
interface CfWorkerScript {
|
|
127
|
+
id: string;
|
|
128
|
+
created_on?: string;
|
|
129
|
+
modified_on?: string;
|
|
130
|
+
}
|
|
125
131
|
//#endregion
|
|
126
132
|
//#region ../../../../../src/index.d.ts
|
|
127
133
|
declare function createCloudflareClient(opts: CloudflareClientOptions): {
|
|
@@ -170,6 +176,7 @@ declare function createCloudflareClient(opts: CloudflareClientOptions): {
|
|
|
170
176
|
verify: () => Promise<CfTokenVerification>;
|
|
171
177
|
};
|
|
172
178
|
workers: {
|
|
179
|
+
listScripts: (accountId: string) => Promise<CfWorkerScript[]>;
|
|
173
180
|
putScript: (accountId: string, scriptName: string, script: string) => Promise<void>;
|
|
174
181
|
listRoutes: (zoneId: string) => Promise<CfWorkerRoute[]>;
|
|
175
182
|
createRoute: (zoneId: string, pattern: string, script: string) => Promise<CfWorkerRoute>;
|
|
@@ -181,4 +188,4 @@ declare function createCloudflareClient(opts: CloudflareClientOptions): {
|
|
|
181
188
|
};
|
|
182
189
|
type CloudflareClient = ReturnType<typeof createCloudflareClient>;
|
|
183
190
|
//#endregion
|
|
184
|
-
export { type CfDnsRecord, type CfDnsRecordInput, type CfDnsRecordType, type CfEnvelope, type CfIngressRule, type CfPagesDeployment, type CfPagesDeploymentStage, type CfPagesDomain, type CfPagesEnvConfig, type CfPagesEnvVar, type CfPagesEnvVarType, type CfPagesProject, type CfPagesProjectInput, type CfTokenVerification, type CfTunnel, type CfTunnelConfig, type CfWorkerRoute, type CfWorkerSecret, type CfZone, CloudflareClient, type CloudflareClientOptions, createCloudflareClient };
|
|
191
|
+
export { type CfDnsRecord, type CfDnsRecordInput, type CfDnsRecordType, type CfEnvelope, type CfIngressRule, type CfPagesDeployment, type CfPagesDeploymentStage, type CfPagesDomain, type CfPagesEnvConfig, type CfPagesEnvVar, type CfPagesEnvVarType, type CfPagesProject, type CfPagesProjectInput, type CfTokenVerification, type CfTunnel, type CfTunnelConfig, type CfWorkerRoute, type CfWorkerScript, type CfWorkerSecret, type CfZone, CloudflareClient, type CloudflareClientOptions, createCloudflareClient };
|
package/dist/index.mjs
CHANGED
|
@@ -87,6 +87,7 @@ function workers(rest, opts) {
|
|
|
87
87
|
const baseUrl = opts.baseUrl ?? "https://api.cloudflare.com/client/v4";
|
|
88
88
|
const fetchImpl = opts.fetch ?? globalThis.fetch;
|
|
89
89
|
return {
|
|
90
|
+
listScripts: (accountId) => cfRequest(rest, "GET", `/accounts/${accountId}/workers/scripts`),
|
|
90
91
|
putScript: async (accountId, scriptName, script) => {
|
|
91
92
|
const form = new FormData();
|
|
92
93
|
form.append("metadata", new Blob([JSON.stringify({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/cloudflare-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.39.0",
|
|
4
4
|
"description": "A TypeScript client for the Cloudflare API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@theholocron/observability": "^0.3.0",
|
|
36
|
-
"@theholocron/http-client": "^1.
|
|
36
|
+
"@theholocron/http-client": "^1.39.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@theholocron/cli": "5.0.0-alpha.79",
|