@develit-io/backend-sdk 5.28.3 → 5.29.1

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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const worker = require('../shared/backend-sdk.BNEcLkji.cjs');
3
+ const worker = require('../shared/backend-sdk.n8SfX_xu.cjs');
4
4
  const text = require('@std/text');
5
5
  const cloudflare = require('alchemy/cloudflare');
6
6
  const environment_consts = require('../shared/backend-sdk.ClVQ4AzB.cjs');
@@ -33,14 +33,16 @@ const composeKvArguments = ({
33
33
  const composeQueueArguments = ({
34
34
  resourceName,
35
35
  deliveryDelay = worker.QUEUE_DELIVERY_DELAY,
36
- messageRetentionPeriod = worker.QUEUE_MESSAGE_RETENTION_PERIOD
36
+ messageRetentionPeriod = worker.QUEUE_MESSAGE_RETENTION_PERIOD,
37
+ dlq
37
38
  }) => {
38
39
  return {
39
40
  name: resourceName,
40
41
  settings: {
41
42
  deliveryDelay,
42
43
  messageRetentionPeriod
43
- }
44
+ },
45
+ dlq
44
46
  };
45
47
  };
46
48
 
@@ -70,6 +72,20 @@ const composeResourceName = ({
70
72
  return `${project}-${text.toKebabCase(resourceName).toLowerCase()}-${environment}`;
71
73
  };
72
74
 
75
+ const composeDlqArguments = ({
76
+ resourceName,
77
+ deliveryDelay = worker.QUEUE_DELIVERY_DELAY,
78
+ messageRetentionPeriod = worker.QUEUE_MESSAGE_RETENTION_PERIOD
79
+ }) => {
80
+ return {
81
+ name: resourceName,
82
+ settings: {
83
+ deliveryDelay,
84
+ messageRetentionPeriod
85
+ }
86
+ };
87
+ };
88
+
73
89
  class Deployment {
74
90
  project;
75
91
  environment;
@@ -82,7 +98,8 @@ class Deployment {
82
98
  return new state.CloudflareStateStore(scope, {
83
99
  scriptName: environment_consts.ALCHEMY_STATE_STORE
84
100
  });
85
- }
101
+ },
102
+ stage: Bun.env.ENVIRONMENT || "unknown"
86
103
  });
87
104
  }
88
105
  /**
@@ -128,6 +145,9 @@ class Deployment {
128
145
  */
129
146
  async queue(options) {
130
147
  const { resourceName, deliveryDelay, messageRetentionPeriod } = options;
148
+ const dlq = await this.dlq({
149
+ resourceName
150
+ });
131
151
  return await cloudflare.Queue(
132
152
  composeIdentifierName({ resourceName, resource: "queue" }),
133
153
  composeQueueArguments({
@@ -137,6 +157,26 @@ class Deployment {
137
157
  resourceName
138
158
  }),
139
159
  deliveryDelay,
160
+ messageRetentionPeriod,
161
+ dlq
162
+ })
163
+ );
164
+ }
165
+ /**
166
+ * Creates an instance of Cloudflare Queue as a DLQ.
167
+ */
168
+ async dlq(options) {
169
+ const { resourceName, deliveryDelay, messageRetentionPeriod } = options;
170
+ return await cloudflare.Queue(
171
+ composeIdentifierName({ resourceName, resource: "dlq" }),
172
+ composeDlqArguments({
173
+ resourceName: composeResourceName({
174
+ project: this.project,
175
+ environment: this.environment,
176
+ // TODO: Convert to a util
177
+ resourceName: `${resourceName}-dlq`
178
+ }),
179
+ deliveryDelay,
140
180
  messageRetentionPeriod
141
181
  })
142
182
  );
@@ -196,6 +236,16 @@ class Deployment {
196
236
  resource: resource || "worker"
197
237
  });
198
238
  const workerConfig = await worker.loadWorkerConfig({ path });
239
+ const consumers = eventSources?.map((queue) => {
240
+ return {
241
+ queue,
242
+ settings: {
243
+ deadLetterQueue: queue.dlq,
244
+ batchSize: worker.QUEUE_MAX_BATCH_SIZE,
245
+ maxWaitTimeMs: worker.QUEUE_MAX_BATCH_TIMEOUT
246
+ }
247
+ };
248
+ });
199
249
  return await cloudflare.Worker(
200
250
  identifierName,
201
251
  worker.composeWorkerArguments({
@@ -217,7 +267,7 @@ class Deployment {
217
267
  ...variables,
218
268
  ...secrets
219
269
  },
220
- eventSources
270
+ eventSources: consumers
221
271
  })
222
272
  );
223
273
  }
@@ -2,8 +2,8 @@ import * as alchemy_cloudflare from 'alchemy/cloudflare';
2
2
  import { KVNamespace, D1Database, Queue, R2Bucket, DurableObjectNamespace, Bindings, Worker } from 'alchemy/cloudflare';
3
3
  import { P as Project } from '../shared/backend-sdk.CP78x0gl.cjs';
4
4
  import { E as Environment } from '../shared/backend-sdk.CYcpgphg.cjs';
5
- import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.B7BfiqA5.cjs';
6
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.B7BfiqA5.cjs';
5
+ import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.D8N5si7y.cjs';
6
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.D8N5si7y.cjs';
7
7
  import alchemy from 'alchemy';
8
8
 
9
9
  declare class Deployment {
@@ -52,6 +52,23 @@ declare class Deployment {
52
52
  */
53
53
  messageRetentionPeriod?: number;
54
54
  }): Promise<Queue<unknown>>;
55
+ /**
56
+ * Creates an instance of Cloudflare Queue as a DLQ.
57
+ */
58
+ dlq(options: {
59
+ /**
60
+ * Name of the DLQ. Do not include the 'dlq' or 'queue' prefix.
61
+ */
62
+ resourceName: string;
63
+ /**
64
+ * The number of seconds to delay delivery of messages to the queue.
65
+ */
66
+ deliveryDelay?: number;
67
+ /**
68
+ * The number of seconds a message will remain in the queue before being deleted.
69
+ */
70
+ messageRetentionPeriod?: number;
71
+ }): Promise<Queue<unknown>>;
55
72
  /**
56
73
  * Creates an instance of Cloudflare R2.
57
74
  */
@@ -217,16 +234,18 @@ declare const composeKvArguments: ({ resourceName, }: {
217
234
  title: string;
218
235
  };
219
236
 
220
- declare const composeQueueArguments: ({ resourceName, deliveryDelay, messageRetentionPeriod, }: {
237
+ declare const composeQueueArguments: ({ resourceName, deliveryDelay, messageRetentionPeriod, dlq, }: {
221
238
  resourceName: string;
222
239
  deliveryDelay?: number;
223
240
  messageRetentionPeriod?: number;
241
+ dlq: Queue;
224
242
  }) => {
225
243
  name: string;
226
244
  settings: {
227
245
  deliveryDelay: number;
228
246
  messageRetentionPeriod: number;
229
247
  };
248
+ dlq: Queue;
230
249
  };
231
250
 
232
251
  declare const composeR2Arguments: ({ resourceName, storageClass, }: {
@@ -2,8 +2,8 @@ import * as alchemy_cloudflare from 'alchemy/cloudflare';
2
2
  import { KVNamespace, D1Database, Queue, R2Bucket, DurableObjectNamespace, Bindings, Worker } from 'alchemy/cloudflare';
3
3
  import { P as Project } from '../shared/backend-sdk.CP78x0gl.mjs';
4
4
  import { E as Environment } from '../shared/backend-sdk.CYcpgphg.mjs';
5
- import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.BEt22BOM.mjs';
6
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.BEt22BOM.mjs';
5
+ import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.OvCBQJUw.mjs';
6
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.OvCBQJUw.mjs';
7
7
  import alchemy from 'alchemy';
8
8
 
9
9
  declare class Deployment {
@@ -52,6 +52,23 @@ declare class Deployment {
52
52
  */
53
53
  messageRetentionPeriod?: number;
54
54
  }): Promise<Queue<unknown>>;
55
+ /**
56
+ * Creates an instance of Cloudflare Queue as a DLQ.
57
+ */
58
+ dlq(options: {
59
+ /**
60
+ * Name of the DLQ. Do not include the 'dlq' or 'queue' prefix.
61
+ */
62
+ resourceName: string;
63
+ /**
64
+ * The number of seconds to delay delivery of messages to the queue.
65
+ */
66
+ deliveryDelay?: number;
67
+ /**
68
+ * The number of seconds a message will remain in the queue before being deleted.
69
+ */
70
+ messageRetentionPeriod?: number;
71
+ }): Promise<Queue<unknown>>;
55
72
  /**
56
73
  * Creates an instance of Cloudflare R2.
57
74
  */
@@ -217,16 +234,18 @@ declare const composeKvArguments: ({ resourceName, }: {
217
234
  title: string;
218
235
  };
219
236
 
220
- declare const composeQueueArguments: ({ resourceName, deliveryDelay, messageRetentionPeriod, }: {
237
+ declare const composeQueueArguments: ({ resourceName, deliveryDelay, messageRetentionPeriod, dlq, }: {
221
238
  resourceName: string;
222
239
  deliveryDelay?: number;
223
240
  messageRetentionPeriod?: number;
241
+ dlq: Queue;
224
242
  }) => {
225
243
  name: string;
226
244
  settings: {
227
245
  deliveryDelay: number;
228
246
  messageRetentionPeriod: number;
229
247
  };
248
+ dlq: Queue;
230
249
  };
231
250
 
232
251
  declare const composeR2Arguments: ({ resourceName, storageClass, }: {
@@ -2,8 +2,8 @@ import * as alchemy_cloudflare from 'alchemy/cloudflare';
2
2
  import { KVNamespace, D1Database, Queue, R2Bucket, DurableObjectNamespace, Bindings, Worker } from 'alchemy/cloudflare';
3
3
  import { P as Project } from '../shared/backend-sdk.CP78x0gl.js';
4
4
  import { E as Environment } from '../shared/backend-sdk.CYcpgphg.js';
5
- import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.CCDScozq.js';
6
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CCDScozq.js';
5
+ import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.DSK5flKM.js';
6
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.DSK5flKM.js';
7
7
  import alchemy from 'alchemy';
8
8
 
9
9
  declare class Deployment {
@@ -52,6 +52,23 @@ declare class Deployment {
52
52
  */
53
53
  messageRetentionPeriod?: number;
54
54
  }): Promise<Queue<unknown>>;
55
+ /**
56
+ * Creates an instance of Cloudflare Queue as a DLQ.
57
+ */
58
+ dlq(options: {
59
+ /**
60
+ * Name of the DLQ. Do not include the 'dlq' or 'queue' prefix.
61
+ */
62
+ resourceName: string;
63
+ /**
64
+ * The number of seconds to delay delivery of messages to the queue.
65
+ */
66
+ deliveryDelay?: number;
67
+ /**
68
+ * The number of seconds a message will remain in the queue before being deleted.
69
+ */
70
+ messageRetentionPeriod?: number;
71
+ }): Promise<Queue<unknown>>;
55
72
  /**
56
73
  * Creates an instance of Cloudflare R2.
57
74
  */
@@ -217,16 +234,18 @@ declare const composeKvArguments: ({ resourceName, }: {
217
234
  title: string;
218
235
  };
219
236
 
220
- declare const composeQueueArguments: ({ resourceName, deliveryDelay, messageRetentionPeriod, }: {
237
+ declare const composeQueueArguments: ({ resourceName, deliveryDelay, messageRetentionPeriod, dlq, }: {
221
238
  resourceName: string;
222
239
  deliveryDelay?: number;
223
240
  messageRetentionPeriod?: number;
241
+ dlq: Queue;
224
242
  }) => {
225
243
  name: string;
226
244
  settings: {
227
245
  deliveryDelay: number;
228
246
  messageRetentionPeriod: number;
229
247
  };
248
+ dlq: Queue;
230
249
  };
231
250
 
232
251
  declare const composeR2Arguments: ({ resourceName, storageClass, }: {
@@ -1,4 +1,4 @@
1
- import { D as D1_LOCATION_HINT, Q as QUEUE_MESSAGE_RETENTION_PERIOD, a as QUEUE_DELIVERY_DELAY, R as R2_STORAGE_CLASS, b as R2_LOCATION_HINT, d as R2_JURISDICTION, l as loadWorkerConfig, c as composeWorkerArguments, e as extractWorkerCrons, C as COMPATIBILITY_FLAGS, f as COMPATIBILITY_DATE } from '../shared/backend-sdk.CLtx2lZQ.mjs';
1
+ import { D as D1_LOCATION_HINT, Q as QUEUE_MESSAGE_RETENTION_PERIOD, a as QUEUE_DELIVERY_DELAY, R as R2_STORAGE_CLASS, b as R2_LOCATION_HINT, d as R2_JURISDICTION, l as loadWorkerConfig, f as QUEUE_MAX_BATCH_TIMEOUT, g as QUEUE_MAX_BATCH_SIZE, c as composeWorkerArguments, e as extractWorkerCrons, C as COMPATIBILITY_FLAGS, h as COMPATIBILITY_DATE } from '../shared/backend-sdk.Cyo7INro.mjs';
2
2
  import { toKebabCase } from '@std/text';
3
3
  import { KVNamespace, D1Database, Queue, R2Bucket, DurableObjectNamespace, Worker, Nuxt } from 'alchemy/cloudflare';
4
4
  import { A as ALCHEMY_STATE_STORE } from '../shared/backend-sdk.BIVnu5aA.mjs';
@@ -27,14 +27,16 @@ const composeKvArguments = ({
27
27
  const composeQueueArguments = ({
28
28
  resourceName,
29
29
  deliveryDelay = QUEUE_DELIVERY_DELAY,
30
- messageRetentionPeriod = QUEUE_MESSAGE_RETENTION_PERIOD
30
+ messageRetentionPeriod = QUEUE_MESSAGE_RETENTION_PERIOD,
31
+ dlq
31
32
  }) => {
32
33
  return {
33
34
  name: resourceName,
34
35
  settings: {
35
36
  deliveryDelay,
36
37
  messageRetentionPeriod
37
- }
38
+ },
39
+ dlq
38
40
  };
39
41
  };
40
42
 
@@ -64,6 +66,20 @@ const composeResourceName = ({
64
66
  return `${project}-${toKebabCase(resourceName).toLowerCase()}-${environment}`;
65
67
  };
66
68
 
69
+ const composeDlqArguments = ({
70
+ resourceName,
71
+ deliveryDelay = QUEUE_DELIVERY_DELAY,
72
+ messageRetentionPeriod = QUEUE_MESSAGE_RETENTION_PERIOD
73
+ }) => {
74
+ return {
75
+ name: resourceName,
76
+ settings: {
77
+ deliveryDelay,
78
+ messageRetentionPeriod
79
+ }
80
+ };
81
+ };
82
+
67
83
  class Deployment {
68
84
  project;
69
85
  environment;
@@ -76,7 +92,8 @@ class Deployment {
76
92
  return new CloudflareStateStore(scope, {
77
93
  scriptName: ALCHEMY_STATE_STORE
78
94
  });
79
- }
95
+ },
96
+ stage: Bun.env.ENVIRONMENT || "unknown"
80
97
  });
81
98
  }
82
99
  /**
@@ -122,6 +139,9 @@ class Deployment {
122
139
  */
123
140
  async queue(options) {
124
141
  const { resourceName, deliveryDelay, messageRetentionPeriod } = options;
142
+ const dlq = await this.dlq({
143
+ resourceName
144
+ });
125
145
  return await Queue(
126
146
  composeIdentifierName({ resourceName, resource: "queue" }),
127
147
  composeQueueArguments({
@@ -131,6 +151,26 @@ class Deployment {
131
151
  resourceName
132
152
  }),
133
153
  deliveryDelay,
154
+ messageRetentionPeriod,
155
+ dlq
156
+ })
157
+ );
158
+ }
159
+ /**
160
+ * Creates an instance of Cloudflare Queue as a DLQ.
161
+ */
162
+ async dlq(options) {
163
+ const { resourceName, deliveryDelay, messageRetentionPeriod } = options;
164
+ return await Queue(
165
+ composeIdentifierName({ resourceName, resource: "dlq" }),
166
+ composeDlqArguments({
167
+ resourceName: composeResourceName({
168
+ project: this.project,
169
+ environment: this.environment,
170
+ // TODO: Convert to a util
171
+ resourceName: `${resourceName}-dlq`
172
+ }),
173
+ deliveryDelay,
134
174
  messageRetentionPeriod
135
175
  })
136
176
  );
@@ -190,6 +230,16 @@ class Deployment {
190
230
  resource: resource || "worker"
191
231
  });
192
232
  const workerConfig = await loadWorkerConfig({ path });
233
+ const consumers = eventSources?.map((queue) => {
234
+ return {
235
+ queue,
236
+ settings: {
237
+ deadLetterQueue: queue.dlq,
238
+ batchSize: QUEUE_MAX_BATCH_SIZE,
239
+ maxWaitTimeMs: QUEUE_MAX_BATCH_TIMEOUT
240
+ }
241
+ };
242
+ });
193
243
  return await Worker(
194
244
  identifierName,
195
245
  composeWorkerArguments({
@@ -211,7 +261,7 @@ class Deployment {
211
261
  ...variables,
212
262
  ...secrets
213
263
  },
214
- eventSources
264
+ eventSources: consumers
215
265
  })
216
266
  );
217
267
  }
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const worker = require('../shared/backend-sdk.BNEcLkji.cjs');
3
+ const worker = require('../shared/backend-sdk.n8SfX_xu.cjs');
4
4
  require('../shared/backend-sdk.ClVQ4AzB.cjs');
5
5
  require('@std/path');
6
6
  require('comment-json');
@@ -1,3 +1,3 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.B7BfiqA5.cjs';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.D8N5si7y.cjs';
2
2
  import 'alchemy/cloudflare';
3
3
  import '../shared/backend-sdk.CYcpgphg.cjs';
@@ -1,3 +1,3 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.BEt22BOM.mjs';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.OvCBQJUw.mjs';
2
2
  import 'alchemy/cloudflare';
3
3
  import '../shared/backend-sdk.CYcpgphg.mjs';
@@ -1,3 +1,3 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CCDScozq.js';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.DSK5flKM.js';
2
2
  import 'alchemy/cloudflare';
3
3
  import '../shared/backend-sdk.CYcpgphg.js';
@@ -1,4 +1,4 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CLtx2lZQ.mjs';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.Cyo7INro.mjs';
2
2
  import '../shared/backend-sdk.BIVnu5aA.mjs';
3
3
  import '@std/path';
4
4
  import 'comment-json';
@@ -6,6 +6,8 @@ const COMPATIBILITY_DATE = "2025-06-04";
6
6
  const COMPATIBILITY_FLAGS = ["nodejs_compat"];
7
7
  const QUEUE_DELIVERY_DELAY = 5;
8
8
  const QUEUE_MESSAGE_RETENTION_PERIOD = 259200;
9
+ const QUEUE_MAX_BATCH_SIZE = 1;
10
+ const QUEUE_MAX_BATCH_TIMEOUT = 5;
9
11
  const D1_LOCATION_HINT = "weur";
10
12
  const R2_STORAGE_CLASS = "Standard";
11
13
  const R2_JURISDICTION = "eu";
@@ -55,4 +57,4 @@ const composeWorkerArguments = ({
55
57
  };
56
58
  };
57
59
 
58
- export { COMPATIBILITY_FLAGS as C, D1_LOCATION_HINT as D, QUEUE_MESSAGE_RETENTION_PERIOD as Q, R2_STORAGE_CLASS as R, QUEUE_DELIVERY_DELAY as a, R2_LOCATION_HINT as b, composeWorkerArguments as c, R2_JURISDICTION as d, extractWorkerCrons as e, COMPATIBILITY_DATE as f, loadWorkerConfig as l };
60
+ export { COMPATIBILITY_FLAGS as C, D1_LOCATION_HINT as D, QUEUE_MESSAGE_RETENTION_PERIOD as Q, R2_STORAGE_CLASS as R, QUEUE_DELIVERY_DELAY as a, R2_LOCATION_HINT as b, composeWorkerArguments as c, R2_JURISDICTION as d, extractWorkerCrons as e, QUEUE_MAX_BATCH_TIMEOUT as f, QUEUE_MAX_BATCH_SIZE as g, COMPATIBILITY_DATE as h, loadWorkerConfig as l };
@@ -1,7 +1,7 @@
1
- import { Bindings, Queue } from 'alchemy/cloudflare';
1
+ import { Bindings, Queue, QueueConsumerSettings } from 'alchemy/cloudflare';
2
2
  import { E as Environment } from './backend-sdk.CYcpgphg.cjs';
3
3
 
4
- type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'durable-object' | 'worker' | 'service' | 'orchestrator' | 'client';
4
+ type Resource = 'kv' | 'd1' | 'queue' | 'dlq' | 'r2' | 'durable-object' | 'worker' | 'service' | 'orchestrator' | 'client';
5
5
  type WorkerType = 'service' | 'orchestrator' | 'client';
6
6
  interface WorkerConfig {
7
7
  triggers: {
@@ -30,7 +30,10 @@ declare const composeWorkerArguments: ({ resourceName, entrypoint, assets, domai
30
30
  domains?: string[];
31
31
  crons?: string[];
32
32
  bindings?: Bindings;
33
- eventSources?: Queue[];
33
+ eventSources?: {
34
+ queue: Queue;
35
+ settings: QueueConsumerSettings;
36
+ }[];
34
37
  }) => {
35
38
  name: string;
36
39
  entrypoint: string;
@@ -42,7 +45,10 @@ declare const composeWorkerArguments: ({ resourceName, entrypoint, assets, domai
42
45
  url: false;
43
46
  assets: Bindings | undefined;
44
47
  domains: string[];
45
- eventSources: Queue[];
48
+ eventSources: {
49
+ queue: Queue;
50
+ settings: QueueConsumerSettings;
51
+ }[];
46
52
  crons: string[];
47
53
  bindings: Bindings | undefined;
48
54
  };
@@ -1,7 +1,7 @@
1
- import { Bindings, Queue } from 'alchemy/cloudflare';
1
+ import { Bindings, Queue, QueueConsumerSettings } from 'alchemy/cloudflare';
2
2
  import { E as Environment } from './backend-sdk.CYcpgphg.js';
3
3
 
4
- type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'durable-object' | 'worker' | 'service' | 'orchestrator' | 'client';
4
+ type Resource = 'kv' | 'd1' | 'queue' | 'dlq' | 'r2' | 'durable-object' | 'worker' | 'service' | 'orchestrator' | 'client';
5
5
  type WorkerType = 'service' | 'orchestrator' | 'client';
6
6
  interface WorkerConfig {
7
7
  triggers: {
@@ -30,7 +30,10 @@ declare const composeWorkerArguments: ({ resourceName, entrypoint, assets, domai
30
30
  domains?: string[];
31
31
  crons?: string[];
32
32
  bindings?: Bindings;
33
- eventSources?: Queue[];
33
+ eventSources?: {
34
+ queue: Queue;
35
+ settings: QueueConsumerSettings;
36
+ }[];
34
37
  }) => {
35
38
  name: string;
36
39
  entrypoint: string;
@@ -42,7 +45,10 @@ declare const composeWorkerArguments: ({ resourceName, entrypoint, assets, domai
42
45
  url: false;
43
46
  assets: Bindings | undefined;
44
47
  domains: string[];
45
- eventSources: Queue[];
48
+ eventSources: {
49
+ queue: Queue;
50
+ settings: QueueConsumerSettings;
51
+ }[];
46
52
  crons: string[];
47
53
  bindings: Bindings | undefined;
48
54
  };
@@ -1,7 +1,7 @@
1
- import { Bindings, Queue } from 'alchemy/cloudflare';
1
+ import { Bindings, Queue, QueueConsumerSettings } from 'alchemy/cloudflare';
2
2
  import { E as Environment } from './backend-sdk.CYcpgphg.mjs';
3
3
 
4
- type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'durable-object' | 'worker' | 'service' | 'orchestrator' | 'client';
4
+ type Resource = 'kv' | 'd1' | 'queue' | 'dlq' | 'r2' | 'durable-object' | 'worker' | 'service' | 'orchestrator' | 'client';
5
5
  type WorkerType = 'service' | 'orchestrator' | 'client';
6
6
  interface WorkerConfig {
7
7
  triggers: {
@@ -30,7 +30,10 @@ declare const composeWorkerArguments: ({ resourceName, entrypoint, assets, domai
30
30
  domains?: string[];
31
31
  crons?: string[];
32
32
  bindings?: Bindings;
33
- eventSources?: Queue[];
33
+ eventSources?: {
34
+ queue: Queue;
35
+ settings: QueueConsumerSettings;
36
+ }[];
34
37
  }) => {
35
38
  name: string;
36
39
  entrypoint: string;
@@ -42,7 +45,10 @@ declare const composeWorkerArguments: ({ resourceName, entrypoint, assets, domai
42
45
  url: false;
43
46
  assets: Bindings | undefined;
44
47
  domains: string[];
45
- eventSources: Queue[];
48
+ eventSources: {
49
+ queue: Queue;
50
+ settings: QueueConsumerSettings;
51
+ }[];
46
52
  crons: string[];
47
53
  bindings: Bindings | undefined;
48
54
  };
@@ -8,6 +8,8 @@ const COMPATIBILITY_DATE = "2025-06-04";
8
8
  const COMPATIBILITY_FLAGS = ["nodejs_compat"];
9
9
  const QUEUE_DELIVERY_DELAY = 5;
10
10
  const QUEUE_MESSAGE_RETENTION_PERIOD = 259200;
11
+ const QUEUE_MAX_BATCH_SIZE = 1;
12
+ const QUEUE_MAX_BATCH_TIMEOUT = 5;
11
13
  const D1_LOCATION_HINT = "weur";
12
14
  const R2_STORAGE_CLASS = "Standard";
13
15
  const R2_JURISDICTION = "eu";
@@ -61,6 +63,8 @@ exports.COMPATIBILITY_DATE = COMPATIBILITY_DATE;
61
63
  exports.COMPATIBILITY_FLAGS = COMPATIBILITY_FLAGS;
62
64
  exports.D1_LOCATION_HINT = D1_LOCATION_HINT;
63
65
  exports.QUEUE_DELIVERY_DELAY = QUEUE_DELIVERY_DELAY;
66
+ exports.QUEUE_MAX_BATCH_SIZE = QUEUE_MAX_BATCH_SIZE;
67
+ exports.QUEUE_MAX_BATCH_TIMEOUT = QUEUE_MAX_BATCH_TIMEOUT;
64
68
  exports.QUEUE_MESSAGE_RETENTION_PERIOD = QUEUE_MESSAGE_RETENTION_PERIOD;
65
69
  exports.R2_JURISDICTION = R2_JURISDICTION;
66
70
  exports.R2_LOCATION_HINT = R2_LOCATION_HINT;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-io/backend-sdk",
3
- "version": "5.28.3",
3
+ "version": "5.29.1",
4
4
  "description": "Develit Backend SDK",
5
5
  "author": "Develit.io",
6
6
  "license": "ISC",