alchemy 0.12.21 → 0.14.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/lib/ai/client.d.ts.map +1 -1
- package/lib/ai/client.js +3 -5
- package/lib/ai/client.js.map +1 -1
- package/lib/alchemy.d.ts +2 -1
- package/lib/alchemy.d.ts.map +1 -1
- package/lib/alchemy.js +87 -92
- package/lib/alchemy.js.map +1 -1
- package/lib/apply.d.ts.map +1 -1
- package/lib/apply.js +6 -1
- package/lib/apply.js.map +1 -1
- package/lib/aws/bucket.d.ts.map +1 -1
- package/lib/aws/bucket.js +55 -57
- package/lib/aws/bucket.js.map +1 -1
- package/lib/aws/function.d.ts.map +1 -1
- package/lib/aws/function.js +250 -252
- package/lib/aws/function.js.map +1 -1
- package/lib/aws/policy-attachment.d.ts.map +1 -1
- package/lib/aws/policy-attachment.js +4 -6
- package/lib/aws/policy-attachment.js.map +1 -1
- package/lib/aws/policy.d.ts.map +1 -1
- package/lib/aws/policy.js +63 -65
- package/lib/aws/policy.js.map +1 -1
- package/lib/aws/queue.js +88 -90
- package/lib/aws/queue.js.map +1 -1
- package/lib/aws/table.d.ts.map +1 -1
- package/lib/aws/table.js +95 -99
- package/lib/aws/table.js.map +1 -1
- package/lib/cloudflare/account-api-token.d.ts +1 -1
- package/lib/cloudflare/account-api-token.d.ts.map +1 -1
- package/lib/cloudflare/account-api-token.js +0 -1
- package/lib/cloudflare/account-api-token.js.map +1 -1
- package/lib/cloudflare/ai-gateway.js.map +1 -1
- package/lib/cloudflare/ai.d.ts +1 -1
- package/lib/cloudflare/ai.d.ts.map +1 -1
- package/lib/cloudflare/ai.js.map +1 -1
- package/lib/cloudflare/api.d.ts +5 -5
- package/lib/cloudflare/api.d.ts.map +1 -1
- package/lib/cloudflare/api.js +52 -15
- package/lib/cloudflare/api.js.map +1 -1
- package/lib/cloudflare/auth.d.ts +24 -55
- package/lib/cloudflare/auth.d.ts.map +1 -1
- package/lib/cloudflare/auth.js +15 -72
- package/lib/cloudflare/auth.js.map +1 -1
- package/lib/cloudflare/bucket.d.ts +2 -2
- package/lib/cloudflare/bucket.d.ts.map +1 -1
- package/lib/cloudflare/bucket.js +22 -24
- package/lib/cloudflare/bucket.js.map +1 -1
- package/lib/cloudflare/bundle/alias-plugin.d.ts +6 -0
- package/lib/cloudflare/bundle/alias-plugin.d.ts.map +1 -0
- package/lib/cloudflare/bundle/alias-plugin.js +36 -0
- package/lib/cloudflare/bundle/alias-plugin.js.map +1 -0
- package/lib/cloudflare/bundle/build-failures.d.ts +12 -0
- package/lib/cloudflare/bundle/build-failures.d.ts.map +1 -0
- package/lib/cloudflare/bundle/build-failures.js +45 -0
- package/lib/cloudflare/bundle/build-failures.js.map +1 -0
- package/lib/cloudflare/bundle/bundle-worker.d.ts +7 -0
- package/lib/cloudflare/bundle/bundle-worker.d.ts.map +1 -0
- package/lib/cloudflare/bundle/bundle-worker.js +69 -0
- package/lib/cloudflare/bundle/bundle-worker.js.map +1 -0
- package/lib/cloudflare/bundle/external.d.ts +1 -0
- package/lib/cloudflare/bundle/external.d.ts.map +1 -1
- package/lib/cloudflare/bundle/external.js +8 -1
- package/lib/cloudflare/bundle/external.js.map +1 -1
- package/lib/cloudflare/bundle/local-dev-cloudflare-shim.d.ts +1 -1
- package/lib/cloudflare/bundle/local-dev-cloudflare-shim.d.ts.map +1 -1
- package/lib/cloudflare/bundle/local-dev-cloudflare-shim.js +6 -6
- package/lib/cloudflare/bundle/local-dev-cloudflare-shim.js.map +1 -1
- package/lib/cloudflare/bundle/nodejs-compat-mode.d.ts +17 -0
- package/lib/cloudflare/bundle/nodejs-compat-mode.d.ts.map +1 -0
- package/lib/cloudflare/bundle/nodejs-compat-mode.js +27 -0
- package/lib/cloudflare/bundle/nodejs-compat-mode.js.map +1 -0
- package/lib/cloudflare/bundle/{hybrid-nodejs-compat.d.ts → nodejs-compat.d.ts} +2 -2
- package/lib/cloudflare/bundle/nodejs-compat.d.ts.map +1 -0
- package/lib/cloudflare/bundle/{hybrid-nodejs-compat.js → nodejs-compat.js} +2 -2
- package/lib/cloudflare/bundle/nodejs-compat.js.map +1 -0
- package/lib/cloudflare/custom-domain.d.ts.map +1 -1
- package/lib/cloudflare/custom-domain.js +3 -5
- package/lib/cloudflare/custom-domain.js.map +1 -1
- package/lib/cloudflare/d1-database.d.ts +1 -1
- package/lib/cloudflare/d1-database.d.ts.map +1 -1
- package/lib/cloudflare/d1-database.js +70 -72
- package/lib/cloudflare/d1-database.js.map +1 -1
- package/lib/cloudflare/d1-migrations.d.ts +1 -1
- package/lib/cloudflare/d1-migrations.d.ts.map +1 -1
- package/lib/cloudflare/d1-migrations.js +2 -3
- package/lib/cloudflare/d1-migrations.js.map +1 -1
- package/lib/cloudflare/dns-records.d.ts.map +1 -1
- package/lib/cloudflare/dns-records.js +2 -4
- package/lib/cloudflare/dns-records.js.map +1 -1
- package/lib/cloudflare/kv-namespace.d.ts +1 -1
- package/lib/cloudflare/kv-namespace.d.ts.map +1 -1
- package/lib/cloudflare/kv-namespace.js +24 -27
- package/lib/cloudflare/kv-namespace.js.map +1 -1
- package/lib/cloudflare/pipeline.d.ts +1 -1
- package/lib/cloudflare/pipeline.d.ts.map +1 -1
- package/lib/cloudflare/pipeline.js +32 -34
- package/lib/cloudflare/pipeline.js.map +1 -1
- package/lib/cloudflare/queue-consumer.d.ts +1 -1
- package/lib/cloudflare/queue-consumer.d.ts.map +1 -1
- package/lib/cloudflare/queue-consumer.js +27 -33
- package/lib/cloudflare/queue-consumer.js.map +1 -1
- package/lib/cloudflare/queue.d.ts +1 -1
- package/lib/cloudflare/queue.d.ts.map +1 -1
- package/lib/cloudflare/queue.js +36 -38
- package/lib/cloudflare/queue.js.map +1 -1
- package/lib/cloudflare/r2-rest-state-store.js +4 -8
- package/lib/cloudflare/r2-rest-state-store.js.map +1 -1
- package/lib/cloudflare/types.d.ts.map +1 -1
- package/lib/cloudflare/types.js +1 -3
- package/lib/cloudflare/types.js.map +1 -1
- package/lib/cloudflare/user.d.ts +51 -0
- package/lib/cloudflare/user.d.ts.map +1 -0
- package/lib/cloudflare/user.js +62 -0
- package/lib/cloudflare/user.js.map +1 -0
- package/lib/cloudflare/vectorize-index.d.ts.map +1 -1
- package/lib/cloudflare/vectorize-index.js +37 -39
- package/lib/cloudflare/vectorize-index.js.map +1 -1
- package/lib/cloudflare/vectorize-metadata-index.d.ts +1 -1
- package/lib/cloudflare/vectorize-metadata-index.d.ts.map +1 -1
- package/lib/cloudflare/vectorize-metadata-index.js +10 -13
- package/lib/cloudflare/vectorize-metadata-index.js.map +1 -1
- package/lib/cloudflare/worker.d.ts +18 -3
- package/lib/cloudflare/worker.d.ts.map +1 -1
- package/lib/cloudflare/worker.js +11 -54
- package/lib/cloudflare/worker.js.map +1 -1
- package/lib/cloudflare/workflow.d.ts +1 -1
- package/lib/cloudflare/workflow.d.ts.map +1 -1
- package/lib/cloudflare/workflow.js.map +1 -1
- package/lib/cloudflare/zone.d.ts.map +1 -1
- package/lib/cloudflare/zone.js +48 -50
- package/lib/cloudflare/zone.js.map +1 -1
- package/lib/dns/godaddy.js +1 -1
- package/lib/dns/import-dns.js +1 -1
- package/lib/dns/import-dns.js.map +1 -1
- package/lib/env.js +7 -9
- package/lib/env.js.map +1 -1
- package/lib/esbuild/bundle.d.ts.map +1 -1
- package/lib/esbuild/bundle.js +8 -11
- package/lib/esbuild/bundle.js.map +1 -1
- package/lib/fs/copy-file.d.ts.map +1 -1
- package/lib/fs/copy-file.js +27 -29
- package/lib/fs/copy-file.js.map +1 -1
- package/lib/fs/file.d.ts +1 -1
- package/lib/fs/file.d.ts.map +1 -1
- package/lib/fs/file.js +1 -1
- package/lib/fs/file.js.map +1 -1
- package/lib/fs/folder.d.ts.map +1 -1
- package/lib/fs/folder.js +1 -3
- package/lib/fs/folder.js.map +1 -1
- package/lib/github/client.d.ts.map +1 -1
- package/lib/github/client.js +3 -5
- package/lib/github/client.js.map +1 -1
- package/lib/github/repository-environment.d.ts.map +1 -1
- package/lib/github/repository-environment.js +173 -176
- package/lib/github/repository-environment.js.map +1 -1
- package/lib/github/secret.d.ts.map +1 -1
- package/lib/github/secret.js +97 -99
- package/lib/github/secret.js.map +1 -1
- package/lib/internal/docs/providers.d.ts.map +1 -1
- package/lib/internal/docs/providers.js +5 -7
- package/lib/internal/docs/providers.js.map +1 -1
- package/lib/neon/api.js +1 -2
- package/lib/neon/api.js.map +1 -1
- package/lib/neon/project.js +2 -2
- package/lib/neon/project.js.map +1 -1
- package/lib/os/exec.d.ts +5 -0
- package/lib/os/exec.d.ts.map +1 -1
- package/lib/os/exec.js +88 -56
- package/lib/os/exec.js.map +1 -1
- package/lib/scope.d.ts +3 -0
- package/lib/scope.d.ts.map +1 -1
- package/lib/scope.js +10 -3
- package/lib/scope.js.map +1 -1
- package/lib/secret.d.ts.map +1 -1
- package/lib/secret.js +1 -3
- package/lib/secret.js.map +1 -1
- package/lib/serde.d.ts.map +1 -1
- package/lib/serde.js +13 -15
- package/lib/serde.js.map +1 -1
- package/lib/stripe/price.d.ts.map +1 -1
- package/lib/stripe/price.js +69 -73
- package/lib/stripe/price.js.map +1 -1
- package/lib/stripe/product.d.ts.map +1 -1
- package/lib/stripe/product.js +50 -52
- package/lib/stripe/product.js.map +1 -1
- package/lib/stripe/webhook.d.ts.map +1 -1
- package/lib/stripe/webhook.js +51 -53
- package/lib/stripe/webhook.js.map +1 -1
- package/lib/test/bun.d.ts +1 -1
- package/lib/test/bun.d.ts.map +1 -1
- package/lib/test/bun.js +3 -8
- package/lib/test/bun.js.map +1 -1
- package/lib/test/prune.d.ts.map +1 -1
- package/lib/test/prune.js.map +1 -1
- package/lib/util/dedent.js +4 -4
- package/lib/util/dedent.js.map +1 -1
- package/lib/web/astro.js +1 -1
- package/lib/web/shadcn.js +4 -4
- package/lib/web/shadcn.js.map +1 -1
- package/lib/web/tailwind.d.ts.map +1 -1
- package/lib/web/tailwind.js +0 -1
- package/lib/web/tailwind.js.map +1 -1
- package/lib/web/vite.js +3 -3
- package/lib/web/vitepress/home-page.d.ts.map +1 -1
- package/lib/web/vitepress/home-page.js +6 -8
- package/lib/web/vitepress/home-page.js.map +1 -1
- package/lib/web/vitepress/process-front-matter-files.js +1 -1
- package/lib/web/vitepress/process-front-matter-files.js.map +1 -1
- package/lib/web/vitepress/vitepress.js +2 -2
- package/lib/web/vitepress/vitepress.js.map +1 -1
- package/package.json +4 -1
- package/src/ai/astro-file.ts +4 -4
- package/src/ai/client.ts +4 -5
- package/src/ai/css-file.ts +4 -4
- package/src/ai/document.ts +3 -3
- package/src/ai/html-file.ts +4 -4
- package/src/ai/json-file.ts +1 -1
- package/src/ai/typescript-file.ts +4 -4
- package/src/ai/vue-file.ts +4 -4
- package/src/ai/yaml-file.ts +1 -1
- package/src/alchemy.ts +111 -104
- package/src/apply.ts +13 -6
- package/src/aws/bucket.ts +72 -75
- package/src/aws/function.ts +296 -297
- package/src/aws/oidc/github-oidc-provider.ts +1 -1
- package/src/aws/oidc/oidc-provider.ts +15 -15
- package/src/aws/policy-attachment.ts +10 -11
- package/src/aws/policy.ts +91 -94
- package/src/aws/queue.ts +111 -111
- package/src/aws/role.ts +24 -24
- package/src/aws/ses.ts +17 -17
- package/src/aws/table.ts +114 -115
- package/src/cloudflare/account-api-token.ts +11 -11
- package/src/cloudflare/ai-gateway.ts +4 -4
- package/src/cloudflare/ai.ts +1 -1
- package/src/cloudflare/api-error.ts +1 -1
- package/src/cloudflare/api.ts +70 -25
- package/src/cloudflare/assets.ts +4 -4
- package/src/cloudflare/auth.ts +49 -164
- package/src/cloudflare/bucket.ts +62 -63
- package/src/cloudflare/bundle/alias-plugin.ts +48 -0
- package/src/cloudflare/bundle/build-failures.ts +55 -0
- package/src/cloudflare/bundle/bundle-worker.ts +89 -0
- package/src/cloudflare/bundle/external.ts +9 -1
- package/src/cloudflare/bundle/local-dev-cloudflare-shim.ts +7 -6
- package/src/cloudflare/bundle/nodejs-compat-mode.ts +49 -0
- package/src/cloudflare/bundle/{hybrid-nodejs-compat.ts → nodejs-compat.ts} +10 -10
- package/src/cloudflare/custom-domain.ts +27 -28
- package/src/cloudflare/d1-database.ts +101 -102
- package/src/cloudflare/d1-migrations.ts +10 -10
- package/src/cloudflare/dns-records.ts +23 -24
- package/src/cloudflare/durable-object-namespace.ts +1 -1
- package/src/cloudflare/event-source.ts +1 -1
- package/src/cloudflare/hyperdrive.ts +3 -3
- package/src/cloudflare/kv-namespace.ts +36 -37
- package/src/cloudflare/nuxt.ts +1 -1
- package/src/cloudflare/permission-groups.ts +7 -7
- package/src/cloudflare/pipeline.ts +55 -56
- package/src/cloudflare/queue-consumer.ts +46 -53
- package/src/cloudflare/queue.ts +56 -57
- package/src/cloudflare/r2-rest-state-store.ts +11 -11
- package/src/cloudflare/redwood.ts +1 -1
- package/src/cloudflare/tanstack-start.ts +1 -1
- package/src/cloudflare/types.ts +1 -2
- package/src/cloudflare/user.ts +142 -0
- package/src/cloudflare/vectorize-index.ts +60 -61
- package/src/cloudflare/vectorize-metadata-index.ts +25 -25
- package/src/cloudflare/vite.ts +1 -1
- package/src/cloudflare/website.ts +3 -3
- package/src/cloudflare/worker.ts +83 -108
- package/src/cloudflare/workflow.ts +4 -4
- package/src/cloudflare/wrangler.json.ts +4 -4
- package/src/cloudflare/zone.ts +69 -70
- package/src/destroy.ts +4 -4
- package/src/dns/godaddy.ts +1 -1
- package/src/dns/import-dns.ts +5 -5
- package/src/encrypt.ts +6 -6
- package/src/env.ts +10 -10
- package/src/esbuild/bundle.ts +14 -15
- package/src/fs/copy-file.ts +35 -36
- package/src/fs/file-system-state-store.ts +4 -4
- package/src/fs/file.ts +9 -8
- package/src/fs/folder.ts +6 -7
- package/src/github/client.ts +15 -14
- package/src/github/repository-environment.ts +206 -210
- package/src/github/secret.ts +111 -116
- package/src/internal/docs/providers.ts +16 -17
- package/src/neon/api-error.ts +1 -1
- package/src/neon/api.ts +6 -6
- package/src/neon/project.ts +18 -17
- package/src/os/exec.ts +107 -66
- package/src/resource.ts +3 -3
- package/src/scope.ts +14 -4
- package/src/secret.ts +2 -3
- package/src/serde.ts +30 -22
- package/src/stripe/price.ts +74 -77
- package/src/stripe/product.ts +55 -56
- package/src/stripe/webhook.ts +56 -57
- package/src/test/bun.ts +9 -13
- package/src/test/prune.ts +4 -4
- package/src/util/dedent.ts +4 -4
- package/src/web/astro.ts +10 -10
- package/src/web/shadcn-component.ts +4 -4
- package/src/web/shadcn.ts +10 -10
- package/src/web/tailwind.ts +2 -3
- package/src/web/vite.ts +11 -11
- package/src/web/vitepress/config.ts +2 -2
- package/src/web/vitepress/custom-theme.ts +7 -7
- package/src/web/vitepress/dependencies.ts +4 -4
- package/src/web/vitepress/home-page.ts +8 -9
- package/src/web/vitepress/process-front-matter-files.ts +5 -5
- package/src/web/vitepress/vitepress.ts +7 -7
- package/lib/cloudflare/account-id.d.ts +0 -6
- package/lib/cloudflare/account-id.d.ts.map +0 -1
- package/lib/cloudflare/account-id.js +0 -6
- package/lib/cloudflare/account-id.js.map +0 -1
- package/lib/cloudflare/bundle/hybrid-nodejs-compat.d.ts.map +0 -1
- package/lib/cloudflare/bundle/hybrid-nodejs-compat.js.map +0 -1
- package/src/cloudflare/account-id.ts +0 -12
|
@@ -3,7 +3,7 @@ import { Resource } from "../resource.js";
|
|
|
3
3
|
import type { Secret } from "../secret.js";
|
|
4
4
|
import { CloudflareApiError, handleApiError } from "./api-error.js";
|
|
5
5
|
import {
|
|
6
|
-
CloudflareApi,
|
|
6
|
+
type CloudflareApi,
|
|
7
7
|
createCloudflareApi,
|
|
8
8
|
type CloudflareApiOptions,
|
|
9
9
|
} from "./api.js";
|
|
@@ -332,50 +332,49 @@ export const Pipeline = Resource("cloudflare::Pipeline", async function <
|
|
|
332
332
|
|
|
333
333
|
// Return void (a deleted pipeline has no content)
|
|
334
334
|
return this.destroy();
|
|
335
|
-
}
|
|
336
|
-
|
|
335
|
+
}
|
|
336
|
+
let pipelineData: CloudflarePipelineResponse;
|
|
337
337
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
);
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
// Update the pipeline with new settings
|
|
351
|
-
pipelineData = await updatePipeline(api, pipelineName, props);
|
|
352
|
-
} else {
|
|
353
|
-
// If no ID exists, fall back to creating a new pipeline
|
|
354
|
-
console.log(
|
|
355
|
-
"No existing Pipeline ID found, creating new Cloudflare Pipeline:",
|
|
356
|
-
pipelineName
|
|
338
|
+
if (this.phase === "create") {
|
|
339
|
+
pipelineData = await createPipeline(api, pipelineName, props);
|
|
340
|
+
} else {
|
|
341
|
+
// Update operation
|
|
342
|
+
if (this.output?.id) {
|
|
343
|
+
// Check if name is being changed, which is not allowed
|
|
344
|
+
if (props.name !== this.output.name) {
|
|
345
|
+
throw new Error(
|
|
346
|
+
"Cannot update Pipeline name after creation. Pipeline name is immutable.",
|
|
357
347
|
);
|
|
358
|
-
pipelineData = await createPipeline(api, pipelineName, props);
|
|
359
348
|
}
|
|
360
|
-
}
|
|
361
349
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
cors: s.cors,
|
|
373
|
-
})),
|
|
374
|
-
destination: props.destination, // Use the input destination, not the API response
|
|
375
|
-
compression: props.compression,
|
|
376
|
-
accountId: api.accountId,
|
|
377
|
-
});
|
|
350
|
+
// Update the pipeline with new settings
|
|
351
|
+
pipelineData = await updatePipeline(api, pipelineName, props);
|
|
352
|
+
} else {
|
|
353
|
+
// If no ID exists, fall back to creating a new pipeline
|
|
354
|
+
console.log(
|
|
355
|
+
"No existing Pipeline ID found, creating new Cloudflare Pipeline:",
|
|
356
|
+
pipelineName,
|
|
357
|
+
);
|
|
358
|
+
pipelineData = await createPipeline(api, pipelineName, props);
|
|
359
|
+
}
|
|
378
360
|
}
|
|
361
|
+
|
|
362
|
+
return this({
|
|
363
|
+
type: "pipeline",
|
|
364
|
+
id: pipelineData.result.id,
|
|
365
|
+
name: pipelineName,
|
|
366
|
+
endpoint: pipelineData.result.endpoint,
|
|
367
|
+
version: pipelineData.result.version,
|
|
368
|
+
source: pipelineData.result.source!.map((s) => ({
|
|
369
|
+
type: s.type as "http" | "binding",
|
|
370
|
+
format: s.format as "json",
|
|
371
|
+
authentication: s.authentication,
|
|
372
|
+
cors: s.cors,
|
|
373
|
+
})),
|
|
374
|
+
destination: props.destination, // Use the input destination, not the API response
|
|
375
|
+
compression: props.compression,
|
|
376
|
+
accountId: api.accountId,
|
|
377
|
+
});
|
|
379
378
|
});
|
|
380
379
|
|
|
381
380
|
interface CloudflarePipelineResponse {
|
|
@@ -421,10 +420,10 @@ interface CloudflarePipelineResponse {
|
|
|
421
420
|
*/
|
|
422
421
|
export async function getPipeline(
|
|
423
422
|
api: CloudflareApi,
|
|
424
|
-
pipelineName: string
|
|
423
|
+
pipelineName: string,
|
|
425
424
|
): Promise<CloudflarePipelineResponse> {
|
|
426
425
|
const response = await api.get(
|
|
427
|
-
`/accounts/${api.accountId}/pipelines/${pipelineName}
|
|
426
|
+
`/accounts/${api.accountId}/pipelines/${pipelineName}`,
|
|
428
427
|
);
|
|
429
428
|
|
|
430
429
|
if (!response.ok) {
|
|
@@ -439,11 +438,11 @@ export async function getPipeline(
|
|
|
439
438
|
*/
|
|
440
439
|
export async function deletePipeline(
|
|
441
440
|
api: CloudflareApi,
|
|
442
|
-
pipelineName: string
|
|
441
|
+
pipelineName: string,
|
|
443
442
|
): Promise<void> {
|
|
444
443
|
// Delete Pipeline
|
|
445
444
|
const deleteResponse = await api.delete(
|
|
446
|
-
`/accounts/${api.accountId}/pipelines/${pipelineName}
|
|
445
|
+
`/accounts/${api.accountId}/pipelines/${pipelineName}`,
|
|
447
446
|
);
|
|
448
447
|
|
|
449
448
|
if (!deleteResponse.ok && deleteResponse.status !== 404) {
|
|
@@ -452,7 +451,7 @@ export async function deletePipeline(
|
|
|
452
451
|
}));
|
|
453
452
|
throw new CloudflareApiError(
|
|
454
453
|
`Error deleting Cloudflare Pipeline '${pipelineName}': ${errorData.errors?.[0]?.message || deleteResponse.statusText}`,
|
|
455
|
-
deleteResponse
|
|
454
|
+
deleteResponse,
|
|
456
455
|
);
|
|
457
456
|
}
|
|
458
457
|
}
|
|
@@ -463,14 +462,14 @@ export async function deletePipeline(
|
|
|
463
462
|
export async function createPipeline(
|
|
464
463
|
api: CloudflareApi,
|
|
465
464
|
pipelineName: string,
|
|
466
|
-
props: PipelineProps
|
|
465
|
+
props: PipelineProps,
|
|
467
466
|
): Promise<CloudflarePipelineResponse> {
|
|
468
467
|
// Prepare the create payload
|
|
469
468
|
const createPayload = preparePipelinePayload(api, pipelineName, props);
|
|
470
469
|
|
|
471
470
|
const createResponse = await api.post(
|
|
472
471
|
`/accounts/${api.accountId}/pipelines`,
|
|
473
|
-
createPayload
|
|
472
|
+
createPayload,
|
|
474
473
|
);
|
|
475
474
|
|
|
476
475
|
if (!createResponse.ok) {
|
|
@@ -478,7 +477,7 @@ export async function createPipeline(
|
|
|
478
477
|
createResponse,
|
|
479
478
|
"creating",
|
|
480
479
|
"Pipeline",
|
|
481
|
-
pipelineName
|
|
480
|
+
pipelineName,
|
|
482
481
|
);
|
|
483
482
|
}
|
|
484
483
|
|
|
@@ -491,7 +490,7 @@ export async function createPipeline(
|
|
|
491
490
|
export async function updatePipeline(
|
|
492
491
|
api: CloudflareApi,
|
|
493
492
|
pipelineName: string,
|
|
494
|
-
props: PipelineProps
|
|
493
|
+
props: PipelineProps,
|
|
495
494
|
): Promise<CloudflarePipelineResponse> {
|
|
496
495
|
// Get current pipeline to build update payload
|
|
497
496
|
const currentPipeline = await getPipeline(api, pipelineName);
|
|
@@ -501,12 +500,12 @@ export async function updatePipeline(
|
|
|
501
500
|
api,
|
|
502
501
|
pipelineName,
|
|
503
502
|
props,
|
|
504
|
-
currentPipeline
|
|
503
|
+
currentPipeline,
|
|
505
504
|
);
|
|
506
505
|
|
|
507
506
|
const updateResponse = await api.put(
|
|
508
507
|
`/accounts/${api.accountId}/pipelines/${pipelineName}`,
|
|
509
|
-
updatePayload
|
|
508
|
+
updatePayload,
|
|
510
509
|
);
|
|
511
510
|
|
|
512
511
|
if (!updateResponse.ok) {
|
|
@@ -514,7 +513,7 @@ export async function updatePipeline(
|
|
|
514
513
|
updateResponse,
|
|
515
514
|
"updating",
|
|
516
515
|
"Pipeline",
|
|
517
|
-
pipelineName
|
|
516
|
+
pipelineName,
|
|
518
517
|
);
|
|
519
518
|
}
|
|
520
519
|
|
|
@@ -528,7 +527,7 @@ function preparePipelinePayload(
|
|
|
528
527
|
api: CloudflareApi,
|
|
529
528
|
pipelineName: string,
|
|
530
529
|
props: PipelineProps,
|
|
531
|
-
currentPipeline?: CloudflarePipelineResponse
|
|
530
|
+
currentPipeline?: CloudflarePipelineResponse,
|
|
532
531
|
): any {
|
|
533
532
|
// Prepare the payload with name and source
|
|
534
533
|
const payload: any = {
|
|
@@ -568,7 +567,7 @@ function preparePipelinePayload(
|
|
|
568
567
|
payload.destination = currentPipeline.result.destination;
|
|
569
568
|
} else if (!props.destination && !currentPipeline) {
|
|
570
569
|
throw new Error(
|
|
571
|
-
"An R2 destination is required for creating/updating a pipeline"
|
|
570
|
+
"An R2 destination is required for creating/updating a pipeline",
|
|
572
571
|
);
|
|
573
572
|
}
|
|
574
573
|
|
|
@@ -584,14 +583,14 @@ function preparePipelinePayload(
|
|
|
584
583
|
* List all pipelines in an account
|
|
585
584
|
*/
|
|
586
585
|
export async function listPipelines(
|
|
587
|
-
api: CloudflareApi
|
|
586
|
+
api: CloudflareApi,
|
|
588
587
|
): Promise<{ name: string; id: string }[]> {
|
|
589
588
|
const response = await api.get(`/accounts/${api.accountId}/pipelines`);
|
|
590
589
|
|
|
591
590
|
if (!response.ok) {
|
|
592
591
|
throw new CloudflareApiError(
|
|
593
592
|
`Failed to list pipelines: ${response.statusText}`,
|
|
594
|
-
response
|
|
593
|
+
response,
|
|
595
594
|
);
|
|
596
595
|
}
|
|
597
596
|
|
|
@@ -2,8 +2,8 @@ import type { Context } from "../context.js";
|
|
|
2
2
|
import { Resource } from "../resource.js";
|
|
3
3
|
import { CloudflareApiError, handleApiError } from "./api-error.js";
|
|
4
4
|
import {
|
|
5
|
-
CloudflareApi,
|
|
6
5
|
createCloudflareApi,
|
|
6
|
+
type CloudflareApi,
|
|
7
7
|
type CloudflareApiOptions,
|
|
8
8
|
} from "./api.js";
|
|
9
9
|
import type { Queue } from "./queue.js";
|
|
@@ -139,7 +139,7 @@ export const QueueConsumer = Resource(
|
|
|
139
139
|
async function (
|
|
140
140
|
this: Context<QueueConsumer>,
|
|
141
141
|
id: string,
|
|
142
|
-
props: QueueConsumerProps
|
|
142
|
+
props: QueueConsumerProps,
|
|
143
143
|
): Promise<QueueConsumer> {
|
|
144
144
|
const api = await createCloudflareApi(props);
|
|
145
145
|
|
|
@@ -159,48 +159,41 @@ export const QueueConsumer = Resource(
|
|
|
159
159
|
|
|
160
160
|
// Return void (a deleted consumer has no content)
|
|
161
161
|
return this.destroy();
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
if (this.phase === "create") {
|
|
166
|
-
console.log(`Creating Queue Consumer for queue ${queueId}`);
|
|
167
|
-
consumerData = await createQueueConsumer(api, queueId, props);
|
|
168
|
-
} else if (this.output?.id) {
|
|
169
|
-
console.log(`Updating Queue Consumer ${this.output.id}`);
|
|
170
|
-
consumerData = await updateQueueConsumer(
|
|
171
|
-
api,
|
|
172
|
-
queueId,
|
|
173
|
-
this.output.id,
|
|
174
|
-
props
|
|
175
|
-
);
|
|
176
|
-
} else {
|
|
177
|
-
// If no ID exists, fall back to creating a new consumer
|
|
178
|
-
console.log(
|
|
179
|
-
`No existing Consumer ID found, creating new Queue Consumer for queue ${queueId}`
|
|
180
|
-
);
|
|
181
|
-
consumerData = await createQueueConsumer(api, queueId, props);
|
|
182
|
-
}
|
|
162
|
+
}
|
|
163
|
+
let consumerData: CloudflareQueueConsumerResponse;
|
|
183
164
|
|
|
184
|
-
|
|
185
|
-
|
|
165
|
+
if (this.phase === "create") {
|
|
166
|
+
consumerData = await createQueueConsumer(api, queueId, props);
|
|
167
|
+
} else if (this.output?.id) {
|
|
168
|
+
consumerData = await updateQueueConsumer(
|
|
169
|
+
api,
|
|
186
170
|
queueId,
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
batchSize: consumerData.result.settings.batch_size,
|
|
193
|
-
maxConcurrency: consumerData.result.settings.max_concurrency,
|
|
194
|
-
maxRetries: consumerData.result.settings.max_retries,
|
|
195
|
-
maxWaitTimeMs: consumerData.result.settings.max_wait_time_ms,
|
|
196
|
-
retryDelay: consumerData.result.settings.retry_delay,
|
|
197
|
-
}
|
|
198
|
-
: undefined,
|
|
199
|
-
createdOn: consumerData.result.created_on,
|
|
200
|
-
accountId: api.accountId,
|
|
201
|
-
});
|
|
171
|
+
this.output.id,
|
|
172
|
+
props,
|
|
173
|
+
);
|
|
174
|
+
} else {
|
|
175
|
+
consumerData = await createQueueConsumer(api, queueId, props);
|
|
202
176
|
}
|
|
203
|
-
|
|
177
|
+
|
|
178
|
+
return this({
|
|
179
|
+
id: consumerData.result.consumer_id,
|
|
180
|
+
queueId,
|
|
181
|
+
queue: props.queue,
|
|
182
|
+
type: "worker",
|
|
183
|
+
scriptName: props.scriptName,
|
|
184
|
+
settings: consumerData.result.settings
|
|
185
|
+
? {
|
|
186
|
+
batchSize: consumerData.result.settings.batch_size,
|
|
187
|
+
maxConcurrency: consumerData.result.settings.max_concurrency,
|
|
188
|
+
maxRetries: consumerData.result.settings.max_retries,
|
|
189
|
+
maxWaitTimeMs: consumerData.result.settings.max_wait_time_ms,
|
|
190
|
+
retryDelay: consumerData.result.settings.retry_delay,
|
|
191
|
+
}
|
|
192
|
+
: undefined,
|
|
193
|
+
createdOn: consumerData.result.created_on,
|
|
194
|
+
accountId: api.accountId,
|
|
195
|
+
});
|
|
196
|
+
},
|
|
204
197
|
);
|
|
205
198
|
|
|
206
199
|
/**
|
|
@@ -232,7 +225,7 @@ interface CloudflareQueueConsumerResponse {
|
|
|
232
225
|
export async function createQueueConsumer(
|
|
233
226
|
api: CloudflareApi,
|
|
234
227
|
queueId: string,
|
|
235
|
-
props: QueueConsumerProps
|
|
228
|
+
props: QueueConsumerProps,
|
|
236
229
|
): Promise<CloudflareQueueConsumerResponse> {
|
|
237
230
|
// Prepare the create payload
|
|
238
231
|
const createPayload: any = {
|
|
@@ -267,7 +260,7 @@ export async function createQueueConsumer(
|
|
|
267
260
|
|
|
268
261
|
const createResponse = await api.post(
|
|
269
262
|
`/accounts/${api.accountId}/queues/${queueId}/consumers`,
|
|
270
|
-
createPayload
|
|
263
|
+
createPayload,
|
|
271
264
|
);
|
|
272
265
|
|
|
273
266
|
if (!createResponse.ok) {
|
|
@@ -275,7 +268,7 @@ export async function createQueueConsumer(
|
|
|
275
268
|
createResponse,
|
|
276
269
|
"creating",
|
|
277
270
|
"Queue Consumer",
|
|
278
|
-
`for queue ${queueId}
|
|
271
|
+
`for queue ${queueId}`,
|
|
279
272
|
);
|
|
280
273
|
}
|
|
281
274
|
|
|
@@ -288,10 +281,10 @@ export async function createQueueConsumer(
|
|
|
288
281
|
export async function deleteQueueConsumer(
|
|
289
282
|
api: CloudflareApi,
|
|
290
283
|
queueId: string,
|
|
291
|
-
consumerId: string
|
|
284
|
+
consumerId: string,
|
|
292
285
|
): Promise<void> {
|
|
293
286
|
const deleteResponse = await api.delete(
|
|
294
|
-
`/accounts/${api.accountId}/queues/${queueId}/consumers/${consumerId}
|
|
287
|
+
`/accounts/${api.accountId}/queues/${queueId}/consumers/${consumerId}`,
|
|
295
288
|
);
|
|
296
289
|
|
|
297
290
|
if (!deleteResponse.ok && deleteResponse.status !== 404) {
|
|
@@ -300,7 +293,7 @@ export async function deleteQueueConsumer(
|
|
|
300
293
|
}));
|
|
301
294
|
throw new CloudflareApiError(
|
|
302
295
|
`Error deleting Queue Consumer '${consumerId}': ${errorData.errors?.[0]?.message || deleteResponse.statusText}`,
|
|
303
|
-
deleteResponse
|
|
296
|
+
deleteResponse,
|
|
304
297
|
);
|
|
305
298
|
}
|
|
306
299
|
}
|
|
@@ -312,7 +305,7 @@ async function updateQueueConsumer(
|
|
|
312
305
|
api: CloudflareApi,
|
|
313
306
|
queueId: string,
|
|
314
307
|
consumerId: string,
|
|
315
|
-
props: QueueConsumerProps
|
|
308
|
+
props: QueueConsumerProps,
|
|
316
309
|
): Promise<CloudflareQueueConsumerResponse> {
|
|
317
310
|
// Prepare the update payload
|
|
318
311
|
const updatePayload: any = {
|
|
@@ -348,7 +341,7 @@ async function updateQueueConsumer(
|
|
|
348
341
|
// Use PUT to update the consumer
|
|
349
342
|
const updateResponse = await api.put(
|
|
350
343
|
`/accounts/${api.accountId}/queues/${queueId}/consumers/${consumerId}`,
|
|
351
|
-
updatePayload
|
|
344
|
+
updatePayload,
|
|
352
345
|
);
|
|
353
346
|
|
|
354
347
|
if (!updateResponse.ok) {
|
|
@@ -356,7 +349,7 @@ async function updateQueueConsumer(
|
|
|
356
349
|
updateResponse,
|
|
357
350
|
"updating",
|
|
358
351
|
"Queue Consumer",
|
|
359
|
-
consumerId
|
|
352
|
+
consumerId,
|
|
360
353
|
);
|
|
361
354
|
}
|
|
362
355
|
|
|
@@ -376,16 +369,16 @@ export interface ListQueueConsumersResponse {
|
|
|
376
369
|
*/
|
|
377
370
|
export async function listQueueConsumers(
|
|
378
371
|
api: CloudflareApi,
|
|
379
|
-
queueId: string
|
|
372
|
+
queueId: string,
|
|
380
373
|
): Promise<ListQueueConsumersResponse[]> {
|
|
381
374
|
const response = await api.get(
|
|
382
|
-
`/accounts/${api.accountId}/queues/${queueId}/consumers
|
|
375
|
+
`/accounts/${api.accountId}/queues/${queueId}/consumers`,
|
|
383
376
|
);
|
|
384
377
|
|
|
385
378
|
if (!response.ok) {
|
|
386
379
|
throw new CloudflareApiError(
|
|
387
380
|
`Failed to list queue consumers: ${response.statusText}`,
|
|
388
|
-
response
|
|
381
|
+
response,
|
|
389
382
|
);
|
|
390
383
|
}
|
|
391
384
|
|
package/src/cloudflare/queue.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Context } from "../context.js";
|
|
|
2
2
|
import { Resource } from "../resource.js";
|
|
3
3
|
import { CloudflareApiError, handleApiError } from "./api-error.js";
|
|
4
4
|
import {
|
|
5
|
-
CloudflareApi,
|
|
5
|
+
type CloudflareApi,
|
|
6
6
|
createCloudflareApi,
|
|
7
7
|
type CloudflareApiOptions,
|
|
8
8
|
} from "./api.js";
|
|
@@ -168,56 +168,55 @@ export const Queue = Resource("cloudflare::Queue", async function <
|
|
|
168
168
|
|
|
169
169
|
// Return void (a deleted queue has no content)
|
|
170
170
|
return this.destroy();
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
if (this.phase === "create") {
|
|
175
|
-
console.log("Creating Cloudflare Queue:", queueName);
|
|
176
|
-
queueData = await createQueue(api, queueName, props);
|
|
177
|
-
} else {
|
|
178
|
-
// Update operation
|
|
179
|
-
if (this.output?.id) {
|
|
180
|
-
console.log("Updating Cloudflare Queue:", queueName);
|
|
181
|
-
|
|
182
|
-
// Check if name is being changed, which is not allowed
|
|
183
|
-
if (props.name !== this.output.name) {
|
|
184
|
-
throw new Error(
|
|
185
|
-
"Cannot update Queue name after creation. Queue name is immutable."
|
|
186
|
-
);
|
|
187
|
-
}
|
|
171
|
+
}
|
|
172
|
+
let queueData: CloudflareQueueResponse;
|
|
188
173
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
174
|
+
if (this.phase === "create") {
|
|
175
|
+
console.log("Creating Cloudflare Queue:", queueName);
|
|
176
|
+
queueData = await createQueue(api, queueName, props);
|
|
177
|
+
} else {
|
|
178
|
+
// Update operation
|
|
179
|
+
if (this.output?.id) {
|
|
180
|
+
console.log("Updating Cloudflare Queue:", queueName);
|
|
181
|
+
|
|
182
|
+
// Check if name is being changed, which is not allowed
|
|
183
|
+
if (props.name !== this.output.name) {
|
|
184
|
+
throw new Error(
|
|
185
|
+
"Cannot update Queue name after creation. Queue name is immutable.",
|
|
196
186
|
);
|
|
197
|
-
queueData = await createQueue(api, queueName, props);
|
|
198
187
|
}
|
|
199
|
-
}
|
|
200
188
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
: undefined,
|
|
213
|
-
createdOn: queueData.result.created_on || new Date().toISOString(),
|
|
214
|
-
modifiedOn: queueData.result.modified_on || new Date().toISOString(),
|
|
215
|
-
accountId: api.accountId,
|
|
216
|
-
// phantom properties
|
|
217
|
-
Body: undefined as T,
|
|
218
|
-
Batch: undefined! as MessageBatch<T>,
|
|
219
|
-
});
|
|
189
|
+
// Update the queue with new settings
|
|
190
|
+
queueData = await updateQueue(api, this.output.id, props);
|
|
191
|
+
} else {
|
|
192
|
+
// If no ID exists, fall back to creating a new queue
|
|
193
|
+
console.log(
|
|
194
|
+
"No existing Queue ID found, creating new Cloudflare Queue:",
|
|
195
|
+
queueName,
|
|
196
|
+
);
|
|
197
|
+
queueData = await createQueue(api, queueName, props);
|
|
198
|
+
}
|
|
220
199
|
}
|
|
200
|
+
|
|
201
|
+
return this({
|
|
202
|
+
type: "queue",
|
|
203
|
+
id: queueData.result.queue_id || "",
|
|
204
|
+
name: queueName,
|
|
205
|
+
settings: queueData.result.settings
|
|
206
|
+
? {
|
|
207
|
+
deliveryDelay: queueData.result.settings.delivery_delay,
|
|
208
|
+
deliveryPaused: queueData.result.settings.delivery_paused,
|
|
209
|
+
messageRetentionPeriod:
|
|
210
|
+
queueData.result.settings.message_retention_period,
|
|
211
|
+
}
|
|
212
|
+
: undefined,
|
|
213
|
+
createdOn: queueData.result.created_on || new Date().toISOString(),
|
|
214
|
+
modifiedOn: queueData.result.modified_on || new Date().toISOString(),
|
|
215
|
+
accountId: api.accountId,
|
|
216
|
+
// phantom properties
|
|
217
|
+
Body: undefined as T,
|
|
218
|
+
Batch: undefined! as MessageBatch<T>,
|
|
219
|
+
});
|
|
221
220
|
});
|
|
222
221
|
|
|
223
222
|
/**
|
|
@@ -226,7 +225,7 @@ export const Queue = Resource("cloudflare::Queue", async function <
|
|
|
226
225
|
export async function createQueue(
|
|
227
226
|
api: CloudflareApi,
|
|
228
227
|
queueName: string,
|
|
229
|
-
props: QueueProps
|
|
228
|
+
props: QueueProps,
|
|
230
229
|
): Promise<CloudflareQueueResponse> {
|
|
231
230
|
// Prepare the create payload
|
|
232
231
|
const createPayload: any = {
|
|
@@ -253,7 +252,7 @@ export async function createQueue(
|
|
|
253
252
|
|
|
254
253
|
const createResponse = await api.post(
|
|
255
254
|
`/accounts/${api.accountId}/queues`,
|
|
256
|
-
createPayload
|
|
255
|
+
createPayload,
|
|
257
256
|
);
|
|
258
257
|
|
|
259
258
|
if (!createResponse.ok) {
|
|
@@ -268,10 +267,10 @@ export async function createQueue(
|
|
|
268
267
|
*/
|
|
269
268
|
export async function getQueue(
|
|
270
269
|
api: CloudflareApi,
|
|
271
|
-
queueId: string
|
|
270
|
+
queueId: string,
|
|
272
271
|
): Promise<CloudflareQueueResponse> {
|
|
273
272
|
const response = await api.get(
|
|
274
|
-
`/accounts/${api.accountId}/queues/${queueId}
|
|
273
|
+
`/accounts/${api.accountId}/queues/${queueId}`,
|
|
275
274
|
);
|
|
276
275
|
|
|
277
276
|
if (!response.ok) {
|
|
@@ -286,7 +285,7 @@ export async function getQueue(
|
|
|
286
285
|
*/
|
|
287
286
|
export async function deleteQueue(
|
|
288
287
|
api: CloudflareApi,
|
|
289
|
-
queueId?: string
|
|
288
|
+
queueId?: string,
|
|
290
289
|
): Promise<void> {
|
|
291
290
|
if (!queueId) {
|
|
292
291
|
console.log("No Queue ID provided, skipping delete");
|
|
@@ -295,7 +294,7 @@ export async function deleteQueue(
|
|
|
295
294
|
|
|
296
295
|
// Delete Queue
|
|
297
296
|
const deleteResponse = await api.delete(
|
|
298
|
-
`/accounts/${api.accountId}/queues/${queueId}
|
|
297
|
+
`/accounts/${api.accountId}/queues/${queueId}`,
|
|
299
298
|
);
|
|
300
299
|
|
|
301
300
|
if (!deleteResponse.ok && deleteResponse.status !== 404) {
|
|
@@ -304,7 +303,7 @@ export async function deleteQueue(
|
|
|
304
303
|
}));
|
|
305
304
|
throw new CloudflareApiError(
|
|
306
305
|
`Error deleting Cloudflare Queue '${queueId}': ${errorData.errors?.[0]?.message || deleteResponse.statusText}`,
|
|
307
|
-
deleteResponse
|
|
306
|
+
deleteResponse,
|
|
308
307
|
);
|
|
309
308
|
}
|
|
310
309
|
}
|
|
@@ -318,7 +317,7 @@ export async function deleteQueue(
|
|
|
318
317
|
export async function updateQueue(
|
|
319
318
|
api: CloudflareApi,
|
|
320
319
|
queueId: string,
|
|
321
|
-
props: QueueProps
|
|
320
|
+
props: QueueProps,
|
|
322
321
|
): Promise<CloudflareQueueResponse> {
|
|
323
322
|
// Prepare the update payload - only include settings
|
|
324
323
|
const updatePayload: any = {};
|
|
@@ -344,7 +343,7 @@ export async function updateQueue(
|
|
|
344
343
|
// Use PATCH for partial updates (only settings can be updated)
|
|
345
344
|
const updateResponse = await api.patch(
|
|
346
345
|
`/accounts/${api.accountId}/queues/${queueId}`,
|
|
347
|
-
updatePayload
|
|
346
|
+
updatePayload,
|
|
348
347
|
);
|
|
349
348
|
|
|
350
349
|
if (!updateResponse.ok) {
|
|
@@ -358,14 +357,14 @@ export async function updateQueue(
|
|
|
358
357
|
* List all Cloudflare Queues in an account
|
|
359
358
|
*/
|
|
360
359
|
export async function listQueues(
|
|
361
|
-
api: CloudflareApi
|
|
360
|
+
api: CloudflareApi,
|
|
362
361
|
): Promise<{ name: string; id: string }[]> {
|
|
363
362
|
const response = await api.get(`/accounts/${api.accountId}/queues`);
|
|
364
363
|
|
|
365
364
|
if (!response.ok) {
|
|
366
365
|
throw new CloudflareApiError(
|
|
367
366
|
`Failed to list queues: ${response.statusText}`,
|
|
368
|
-
response
|
|
367
|
+
response,
|
|
369
368
|
);
|
|
370
369
|
}
|
|
371
370
|
|