@develit-io/backend-sdk 5.30.1 → 5.30.3
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/deployment/index.cjs +19 -4
- package/dist/deployment/index.mjs +20 -5
- package/package.json +1 -1
|
@@ -225,6 +225,24 @@ class Deployment {
|
|
|
225
225
|
resource: resource || "worker"
|
|
226
226
|
});
|
|
227
227
|
const workerConfig = await worker.loadWorkerConfig({ path });
|
|
228
|
+
const vars = worker.extractWorkerVars({
|
|
229
|
+
workerConfig,
|
|
230
|
+
environment: this.environment
|
|
231
|
+
});
|
|
232
|
+
for (const key in vars) {
|
|
233
|
+
const value = vars[key];
|
|
234
|
+
switch (typeof value) {
|
|
235
|
+
case "number":
|
|
236
|
+
vars[key] = JSON.stringify(value);
|
|
237
|
+
break;
|
|
238
|
+
case "boolean":
|
|
239
|
+
vars[key] = JSON.stringify(value);
|
|
240
|
+
break;
|
|
241
|
+
case "object":
|
|
242
|
+
vars[key] = JSON.stringify(value);
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
228
246
|
const consumers = eventSources?.map((queue) => {
|
|
229
247
|
return {
|
|
230
248
|
queue,
|
|
@@ -256,10 +274,7 @@ class Deployment {
|
|
|
256
274
|
}),
|
|
257
275
|
bindings: {
|
|
258
276
|
...bindings,
|
|
259
|
-
...
|
|
260
|
-
workerConfig,
|
|
261
|
-
environment: this.environment
|
|
262
|
-
})
|
|
277
|
+
...vars
|
|
263
278
|
},
|
|
264
279
|
eventSources: consumers
|
|
265
280
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as D1_LOCATION_HINT, Q as QUEUE_MESSAGE_RETENTION_PERIOD, b as QUEUE_DELIVERY_DELAY, R as R2_LOCATION_HINT, d as R2_JURISDICTION, f as R2_STORAGE_CLASS, l as loadWorkerConfig, g as QUEUE_MAX_BATCH_TIMEOUT, h as QUEUE_MAX_BATCH_SIZE, c as composeWorkerArguments,
|
|
1
|
+
import { D as D1_LOCATION_HINT, Q as QUEUE_MESSAGE_RETENTION_PERIOD, b as QUEUE_DELIVERY_DELAY, R as R2_LOCATION_HINT, d as R2_JURISDICTION, f as R2_STORAGE_CLASS, l as loadWorkerConfig, a as extractWorkerVars, g as QUEUE_MAX_BATCH_TIMEOUT, h as QUEUE_MAX_BATCH_SIZE, c as composeWorkerArguments, e as extractWorkerCrons, C as COMPATIBILITY_FLAGS, i as COMPATIBILITY_DATE } from '../shared/backend-sdk.Fdiq3Ek5.mjs';
|
|
2
2
|
import { toKebabCase } from '@std/text';
|
|
3
3
|
import { KVNamespace, D1Database, Queue, R2Bucket, DurableObjectNamespace, Worker, Nuxt } from 'alchemy/cloudflare';
|
|
4
4
|
import '../shared/backend-sdk.DXRpnctc.mjs';
|
|
@@ -223,6 +223,24 @@ class Deployment {
|
|
|
223
223
|
resource: resource || "worker"
|
|
224
224
|
});
|
|
225
225
|
const workerConfig = await loadWorkerConfig({ path });
|
|
226
|
+
const vars = extractWorkerVars({
|
|
227
|
+
workerConfig,
|
|
228
|
+
environment: this.environment
|
|
229
|
+
});
|
|
230
|
+
for (const key in vars) {
|
|
231
|
+
const value = vars[key];
|
|
232
|
+
switch (typeof value) {
|
|
233
|
+
case "number":
|
|
234
|
+
vars[key] = JSON.stringify(value);
|
|
235
|
+
break;
|
|
236
|
+
case "boolean":
|
|
237
|
+
vars[key] = JSON.stringify(value);
|
|
238
|
+
break;
|
|
239
|
+
case "object":
|
|
240
|
+
vars[key] = JSON.stringify(value);
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
226
244
|
const consumers = eventSources?.map((queue) => {
|
|
227
245
|
return {
|
|
228
246
|
queue,
|
|
@@ -254,10 +272,7 @@ class Deployment {
|
|
|
254
272
|
}),
|
|
255
273
|
bindings: {
|
|
256
274
|
...bindings,
|
|
257
|
-
...
|
|
258
|
-
workerConfig,
|
|
259
|
-
environment: this.environment
|
|
260
|
-
})
|
|
275
|
+
...vars
|
|
261
276
|
},
|
|
262
277
|
eventSources: consumers
|
|
263
278
|
})
|