@develit-io/backend-sdk 5.24.3 → 5.25.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.
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
 
3
- const worker = require('../shared/backend-sdk.B5evt8s2.cjs');
3
+ const worker = require('../shared/backend-sdk.DY2PE5z-.cjs');
4
4
  const cloudflare = require('alchemy/cloudflare');
5
5
  const environment_consts = require('../shared/backend-sdk.BdcrYpFD.cjs');
6
6
  require('@std/path');
7
+ require('comment-json');
7
8
 
8
9
  const composeD1Arguments = ({
9
10
  resourceName
@@ -182,6 +183,20 @@ class Infrastructure {
182
183
  eventSources
183
184
  });
184
185
  }
186
+ /**
187
+ * Creates an instance of Cloudflare Worker as an orchestrator.
188
+ */
189
+ async orchestrator(options) {
190
+ const { resourceName, bindings, eventSources } = options;
191
+ return await this.worker({
192
+ resourceName,
193
+ resource: "orchestrator",
194
+ // TODO: Convert to util
195
+ path: `./apps/${resourceName}`,
196
+ bindings,
197
+ eventSources
198
+ });
199
+ }
185
200
  }
186
201
 
187
202
  const validateEnvironment = (environment) => {
@@ -105,6 +105,23 @@ declare class Infrastructure {
105
105
  */
106
106
  eventSources?: Queue[];
107
107
  }): Promise<Worker<Bindings, Rpc.WorkerEntrypointBranded>>;
108
+ /**
109
+ * Creates an instance of Cloudflare Worker as an orchestrator.
110
+ */
111
+ orchestrator(options: {
112
+ /**
113
+ * Name of the orchestrator. Do not include the 'orchestrator' prefix.
114
+ */
115
+ resourceName: string;
116
+ /**
117
+ * Bindings of the Worker.
118
+ */
119
+ bindings?: Bindings;
120
+ /**
121
+ * Event sources for the orchestrator to consume.
122
+ */
123
+ eventSources?: Queue[];
124
+ }): Promise<Worker<Bindings, Rpc.WorkerEntrypointBranded>>;
108
125
  }
109
126
 
110
127
  declare const composeD1Arguments: ({ resourceName, }: {
@@ -105,6 +105,23 @@ declare class Infrastructure {
105
105
  */
106
106
  eventSources?: Queue[];
107
107
  }): Promise<Worker<Bindings, Rpc.WorkerEntrypointBranded>>;
108
+ /**
109
+ * Creates an instance of Cloudflare Worker as an orchestrator.
110
+ */
111
+ orchestrator(options: {
112
+ /**
113
+ * Name of the orchestrator. Do not include the 'orchestrator' prefix.
114
+ */
115
+ resourceName: string;
116
+ /**
117
+ * Bindings of the Worker.
118
+ */
119
+ bindings?: Bindings;
120
+ /**
121
+ * Event sources for the orchestrator to consume.
122
+ */
123
+ eventSources?: Queue[];
124
+ }): Promise<Worker<Bindings, Rpc.WorkerEntrypointBranded>>;
108
125
  }
109
126
 
110
127
  declare const composeD1Arguments: ({ resourceName, }: {
@@ -105,6 +105,23 @@ declare class Infrastructure {
105
105
  */
106
106
  eventSources?: Queue[];
107
107
  }): Promise<Worker<Bindings, Rpc.WorkerEntrypointBranded>>;
108
+ /**
109
+ * Creates an instance of Cloudflare Worker as an orchestrator.
110
+ */
111
+ orchestrator(options: {
112
+ /**
113
+ * Name of the orchestrator. Do not include the 'orchestrator' prefix.
114
+ */
115
+ resourceName: string;
116
+ /**
117
+ * Bindings of the Worker.
118
+ */
119
+ bindings?: Bindings;
120
+ /**
121
+ * Event sources for the orchestrator to consume.
122
+ */
123
+ eventSources?: Queue[];
124
+ }): Promise<Worker<Bindings, Rpc.WorkerEntrypointBranded>>;
108
125
  }
109
126
 
110
127
  declare const composeD1Arguments: ({ resourceName, }: {
@@ -1,7 +1,8 @@
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 } from '../shared/backend-sdk.CxGZ-mdg.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, c as composeWorkerArguments, e as extractWorkerCrons } from '../shared/backend-sdk.BTl8Iida.mjs';
2
2
  import { KVNamespace, D1Database, Queue, R2Bucket, Worker } from 'alchemy/cloudflare';
3
3
  import { E as ENVIRONMENT } from '../shared/backend-sdk.DXRpnctc.mjs';
4
4
  import '@std/path';
5
+ import 'comment-json';
5
6
 
6
7
  const composeD1Arguments = ({
7
8
  resourceName
@@ -180,6 +181,20 @@ class Infrastructure {
180
181
  eventSources
181
182
  });
182
183
  }
184
+ /**
185
+ * Creates an instance of Cloudflare Worker as an orchestrator.
186
+ */
187
+ async orchestrator(options) {
188
+ const { resourceName, bindings, eventSources } = options;
189
+ return await this.worker({
190
+ resourceName,
191
+ resource: "orchestrator",
192
+ // TODO: Convert to util
193
+ path: `./apps/${resourceName}`,
194
+ bindings,
195
+ eventSources
196
+ });
197
+ }
183
198
  }
184
199
 
185
200
  const validateEnvironment = (environment) => {
@@ -1,8 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const worker = require('../shared/backend-sdk.B5evt8s2.cjs');
3
+ const worker = require('../shared/backend-sdk.DY2PE5z-.cjs');
4
4
  require('../shared/backend-sdk.BdcrYpFD.cjs');
5
5
  require('@std/path');
6
+ require('comment-json');
6
7
 
7
8
 
8
9
 
@@ -1,3 +1,4 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CxGZ-mdg.mjs';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.BTl8Iida.mjs';
2
2
  import '../shared/backend-sdk.DXRpnctc.mjs';
3
3
  import '@std/path';
4
+ import 'comment-json';
@@ -1,5 +1,6 @@
1
1
  import { E as ENVIRONMENT } from './backend-sdk.DXRpnctc.mjs';
2
2
  import { join } from '@std/path';
3
+ import { parse } from 'comment-json';
3
4
 
4
5
  const COMPATIBILITY_DATE = "2025-06-04";
5
6
  const COMPATIBILITY_FLAGS = ["nodejs_compat"];
@@ -12,7 +13,11 @@ const R2_LOCATION_HINT = "weur";
12
13
 
13
14
  const loadWorkerConfig = async ({ path }) => {
14
15
  const workerConfigFile = Bun.file(join(path, "./wrangler.jsonc"));
15
- return await workerConfigFile.json();
16
+ return parse(
17
+ await workerConfigFile.text(),
18
+ null,
19
+ true
20
+ );
16
21
  };
17
22
  const extractWorkerCrons = ({
18
23
  workerConfig,
@@ -2,6 +2,7 @@
2
2
 
3
3
  const environment_consts = require('./backend-sdk.BdcrYpFD.cjs');
4
4
  const path = require('@std/path');
5
+ const commentJson = require('comment-json');
5
6
 
6
7
  const COMPATIBILITY_DATE = "2025-06-04";
7
8
  const COMPATIBILITY_FLAGS = ["nodejs_compat"];
@@ -14,7 +15,11 @@ const R2_LOCATION_HINT = "weur";
14
15
 
15
16
  const loadWorkerConfig = async ({ path: path$1 }) => {
16
17
  const workerConfigFile = Bun.file(path.join(path$1, "./wrangler.jsonc"));
17
- return await workerConfigFile.json();
18
+ return commentJson.parse(
19
+ await workerConfigFile.text(),
20
+ null,
21
+ true
22
+ );
18
23
  };
19
24
  const extractWorkerCrons = ({
20
25
  workerConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-io/backend-sdk",
3
- "version": "5.24.3",
3
+ "version": "5.25.0",
4
4
  "description": "Develit Backend SDK",
5
5
  "author": "Develit.io",
6
6
  "license": "ISC",