alchemy 0.70.1 → 0.71.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/bin/alchemy.js +13 -15
- package/bin/commands/init.ts +0 -10
- package/lib/apply.d.ts.map +1 -1
- package/lib/apply.js +2 -0
- package/lib/apply.js.map +1 -1
- package/lib/clickhouse/organization.d.ts +1 -1
- package/lib/clickhouse/organization.js +2 -2
- package/lib/clickhouse/organization.js.map +1 -1
- package/lib/clickhouse/service.d.ts +28 -18
- package/lib/clickhouse/service.d.ts.map +1 -1
- package/lib/clickhouse/service.js +61 -9
- package/lib/clickhouse/service.js.map +1 -1
- package/lib/cloudflare/account-api-token.js +1 -1
- package/lib/cloudflare/account-api-token.js.map +1 -1
- package/lib/cloudflare/bindings.d.ts +12 -2
- package/lib/cloudflare/bindings.d.ts.map +1 -1
- package/lib/cloudflare/bindings.js.map +1 -1
- package/lib/cloudflare/bound.d.ts +3 -2
- package/lib/cloudflare/bound.d.ts.map +1 -1
- package/lib/cloudflare/bucket.d.ts +6 -0
- package/lib/cloudflare/bucket.d.ts.map +1 -1
- package/lib/cloudflare/bucket.js +5 -3
- package/lib/cloudflare/bucket.js.map +1 -1
- package/lib/cloudflare/bun-spa/bun-spa.d.ts +6 -1
- package/lib/cloudflare/bun-spa/bun-spa.d.ts.map +1 -1
- package/lib/cloudflare/bun-spa/bun-spa.js +29 -9
- package/lib/cloudflare/bun-spa/bun-spa.js.map +1 -1
- package/lib/cloudflare/compatibility-date.gen.d.ts +1 -1
- package/lib/cloudflare/compatibility-date.gen.js +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 +1 -1
- package/lib/cloudflare/d1-database.js.map +1 -1
- package/lib/cloudflare/index.d.ts +2 -0
- package/lib/cloudflare/index.d.ts.map +1 -1
- package/lib/cloudflare/index.js +2 -0
- package/lib/cloudflare/index.js.map +1 -1
- package/lib/cloudflare/logpush-job.d.ts +349 -0
- package/lib/cloudflare/logpush-job.d.ts.map +1 -0
- package/lib/cloudflare/logpush-job.js +277 -0
- package/lib/cloudflare/logpush-job.js.map +1 -0
- package/lib/cloudflare/miniflare/build-worker-options.d.ts +1 -0
- package/lib/cloudflare/miniflare/build-worker-options.d.ts.map +1 -1
- package/lib/cloudflare/miniflare/build-worker-options.js +16 -6
- package/lib/cloudflare/miniflare/build-worker-options.js.map +1 -1
- package/lib/cloudflare/miniflare/remote-binding-proxy.d.ts.map +1 -1
- package/lib/cloudflare/miniflare/remote-binding-proxy.js +2 -0
- package/lib/cloudflare/miniflare/remote-binding-proxy.js.map +1 -1
- package/lib/cloudflare/permission-groups.d.ts +1489 -26
- package/lib/cloudflare/permission-groups.d.ts.map +1 -1
- package/lib/cloudflare/permission-groups.js +1787 -6
- package/lib/cloudflare/permission-groups.js.map +1 -1
- package/lib/cloudflare/queue-consumer.js +2 -2
- package/lib/cloudflare/queue-consumer.js.map +1 -1
- package/lib/cloudflare/worker-loader.d.ts +9 -0
- package/lib/cloudflare/worker-loader.d.ts.map +1 -0
- package/lib/cloudflare/worker-loader.js +6 -0
- package/lib/cloudflare/worker-loader.js.map +1 -0
- package/lib/cloudflare/worker-metadata.d.ts +14 -2
- package/lib/cloudflare/worker-metadata.d.ts.map +1 -1
- package/lib/cloudflare/worker-metadata.js +10 -1
- package/lib/cloudflare/worker-metadata.js.map +1 -1
- package/lib/cloudflare/worker-stub.d.ts +3 -1
- package/lib/cloudflare/worker-stub.d.ts.map +1 -1
- package/lib/cloudflare/worker-stub.js +19 -7
- package/lib/cloudflare/worker-stub.js.map +1 -1
- package/lib/cloudflare/worker-subdomain.js +1 -1
- package/lib/cloudflare/worker.d.ts +74 -10
- package/lib/cloudflare/worker.d.ts.map +1 -1
- package/lib/cloudflare/worker.js +23 -7
- package/lib/cloudflare/worker.js.map +1 -1
- package/lib/cloudflare/wrangler.json.d.ts +3 -0
- package/lib/cloudflare/wrangler.json.d.ts.map +1 -1
- package/lib/cloudflare/wrangler.json.js +9 -0
- package/lib/cloudflare/wrangler.json.js.map +1 -1
- package/lib/github/comment.d.ts.map +1 -1
- package/lib/github/comment.js +14 -7
- package/lib/github/comment.js.map +1 -1
- package/lib/scope.d.ts.map +1 -1
- package/lib/scope.js +6 -7
- package/lib/scope.js.map +1 -1
- package/lib/util/camel-to-snake.d.ts +12 -0
- package/lib/util/camel-to-snake.d.ts.map +1 -0
- package/lib/util/camel-to-snake.js +16 -0
- package/lib/util/camel-to-snake.js.map +1 -0
- package/lib/util/retry.d.ts +1 -1
- package/lib/util/retry.d.ts.map +1 -1
- package/lib/util/retry.js +2 -2
- package/lib/util/retry.js.map +1 -1
- package/lib/util/validate-resource-id.d.ts +2 -0
- package/lib/util/validate-resource-id.d.ts.map +1 -0
- package/lib/util/validate-resource-id.js +11 -0
- package/lib/util/validate-resource-id.js.map +1 -0
- package/package.json +2 -2
- package/src/apply.ts +2 -0
- package/src/clickhouse/organization.ts +2 -2
- package/src/clickhouse/service.ts +124 -33
- package/src/cloudflare/account-api-token.ts +1 -1
- package/src/cloudflare/bindings.ts +13 -0
- package/src/cloudflare/bound.ts +36 -32
- package/src/cloudflare/bucket.ts +13 -4
- package/src/cloudflare/bun-spa/bun-spa.ts +42 -11
- package/src/cloudflare/compatibility-date.gen.ts +1 -1
- package/src/cloudflare/d1-database.ts +2 -2
- package/src/cloudflare/index.ts +2 -0
- package/src/cloudflare/logpush-job.ts +768 -0
- package/src/cloudflare/miniflare/build-worker-options.ts +18 -6
- package/src/cloudflare/miniflare/remote-binding-proxy.ts +2 -0
- package/src/cloudflare/permission-groups.ts +1832 -45
- package/src/cloudflare/queue-consumer.ts +2 -2
- package/src/cloudflare/worker-loader.ts +12 -0
- package/src/cloudflare/worker-metadata.ts +25 -3
- package/src/cloudflare/worker-stub.ts +28 -11
- package/src/cloudflare/worker-subdomain.ts +1 -1
- package/src/cloudflare/worker.ts +106 -17
- package/src/cloudflare/wrangler.json.ts +15 -0
- package/src/github/comment.ts +17 -8
- package/src/scope.ts +7 -10
- package/src/util/camel-to-snake.ts +88 -0
- package/src/util/retry.ts +2 -1
- package/src/util/validate-resource-id.ts +10 -0
- package/workers/tunnel-proxy.js +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as miniflare from "miniflare";
|
|
2
|
+
import path from "pathe";
|
|
2
3
|
import { assertNever } from "../../util/assert-never.ts";
|
|
3
4
|
import type { HTTPServer } from "../../util/http.ts";
|
|
4
5
|
import { logger } from "../../util/logger.ts";
|
|
@@ -26,6 +27,7 @@ export interface MiniflareWorkerInput {
|
|
|
26
27
|
bundle: WorkerBundleSource;
|
|
27
28
|
port: number | undefined;
|
|
28
29
|
tunnel: boolean | undefined;
|
|
30
|
+
cwd: string;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
type RemoteOnlyBindingType =
|
|
@@ -78,11 +80,6 @@ export const buildWorkerOptions = async (
|
|
|
78
80
|
proxy: true,
|
|
79
81
|
},
|
|
80
82
|
],
|
|
81
|
-
containerEngine: {
|
|
82
|
-
localDocker: {
|
|
83
|
-
socketPath: await getDockerSocketPath(),
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
83
|
// This exposes the worker as a route that can be accessed by setting the MF-Route-Override header.
|
|
87
84
|
routes: [input.name],
|
|
88
85
|
};
|
|
@@ -119,7 +116,7 @@ export const buildWorkerOptions = async (
|
|
|
119
116
|
case "assets": {
|
|
120
117
|
options.assets = {
|
|
121
118
|
binding: key,
|
|
122
|
-
directory: binding.path,
|
|
119
|
+
directory: path.resolve(input.cwd, binding.path),
|
|
123
120
|
assetConfig: {
|
|
124
121
|
html_handling: input.assets?.html_handling,
|
|
125
122
|
not_found_handling: input.assets?.not_found_handling,
|
|
@@ -144,6 +141,11 @@ export const buildWorkerOptions = async (
|
|
|
144
141
|
imageName: binding.image.imageRef,
|
|
145
142
|
},
|
|
146
143
|
};
|
|
144
|
+
options.containerEngine = {
|
|
145
|
+
localDocker: {
|
|
146
|
+
socketPath: await getDockerSocketPath(),
|
|
147
|
+
},
|
|
148
|
+
};
|
|
147
149
|
break;
|
|
148
150
|
}
|
|
149
151
|
case "d1": {
|
|
@@ -268,6 +270,10 @@ export const buildWorkerOptions = async (
|
|
|
268
270
|
type: "r2_bucket",
|
|
269
271
|
name: key,
|
|
270
272
|
bucket_name: binding.name,
|
|
273
|
+
jurisdiction:
|
|
274
|
+
binding.jurisdiction === "default"
|
|
275
|
+
? undefined
|
|
276
|
+
: binding.jurisdiction,
|
|
271
277
|
raw: true,
|
|
272
278
|
});
|
|
273
279
|
} else {
|
|
@@ -308,6 +314,10 @@ export const buildWorkerOptions = async (
|
|
|
308
314
|
};
|
|
309
315
|
break;
|
|
310
316
|
}
|
|
317
|
+
case "worker_loader": {
|
|
318
|
+
(options.workerLoaders ??= {})[key] = {};
|
|
319
|
+
break;
|
|
320
|
+
}
|
|
311
321
|
case "workflow": {
|
|
312
322
|
(options.workflows ??= {})[key] = {
|
|
313
323
|
name: binding.workflowName,
|
|
@@ -329,11 +339,13 @@ export const buildWorkerOptions = async (
|
|
|
329
339
|
);
|
|
330
340
|
}
|
|
331
341
|
if (isQueueEventSource(eventSource)) {
|
|
342
|
+
const dlq = eventSource.settings?.deadLetterQueue;
|
|
332
343
|
(options.queueConsumers ??= {})[queue.name] = {
|
|
333
344
|
maxBatchSize: eventSource.settings?.batchSize,
|
|
334
345
|
maxBatchTimeout: eventSource.settings?.maxWaitTimeMs,
|
|
335
346
|
maxRetries: eventSource.settings?.maxRetries,
|
|
336
347
|
retryDelay: eventSource.settings?.retryDelay,
|
|
348
|
+
deadLetterQueue: typeof dlq === "string" ? dlq : dlq?.name,
|
|
337
349
|
};
|
|
338
350
|
} else {
|
|
339
351
|
(options.queueConsumers ??= {})[eventSource.name] = {};
|
|
@@ -82,6 +82,8 @@ export async function createRemoteProxyWorker(input: {
|
|
|
82
82
|
headers,
|
|
83
83
|
body: req.body,
|
|
84
84
|
redirect: "manual",
|
|
85
|
+
// @ts-expect-error - caused by @cloudflare/workers-types
|
|
86
|
+
duplex: req.body ? "half" : undefined,
|
|
85
87
|
});
|
|
86
88
|
|
|
87
89
|
const responseHeaders = new Headers(res.headers);
|