@develit-io/backend-sdk 5.24.4 → 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,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const worker = require('../shared/backend-sdk.BiHu-BlC.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');
@@ -183,6 +183,20 @@ class Infrastructure {
183
183
  eventSources
184
184
  });
185
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
+ }
186
200
  }
187
201
 
188
202
  const validateEnvironment = (environment) => {
@@ -1,9 +1,8 @@
1
1
  import { P as Project } from '../shared/backend-sdk.B5vcbB2_.cjs';
2
2
  import { E as Environment } from '../shared/backend-sdk.D5vSybcI.cjs';
3
3
  import { KVNamespace, D1Database, Queue, R2Bucket, Bindings, Worker } from 'alchemy/cloudflare';
4
- import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.CkewpXu0.cjs';
5
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CkewpXu0.cjs';
6
- import 'comment-json';
4
+ import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.B3VLuILe.cjs';
5
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.B3VLuILe.cjs';
7
6
 
8
7
  declare class Infrastructure {
9
8
  private project;
@@ -106,6 +105,23 @@ declare class Infrastructure {
106
105
  */
107
106
  eventSources?: Queue[];
108
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>>;
109
125
  }
110
126
 
111
127
  declare const composeD1Arguments: ({ resourceName, }: {
@@ -1,9 +1,8 @@
1
1
  import { P as Project } from '../shared/backend-sdk.B5vcbB2_.mjs';
2
2
  import { E as Environment } from '../shared/backend-sdk.D5vSybcI.mjs';
3
3
  import { KVNamespace, D1Database, Queue, R2Bucket, Bindings, Worker } from 'alchemy/cloudflare';
4
- import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.5XEqGlkD.mjs';
5
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.5XEqGlkD.mjs';
6
- import 'comment-json';
4
+ import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.CHNezj3A.mjs';
5
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CHNezj3A.mjs';
7
6
 
8
7
  declare class Infrastructure {
9
8
  private project;
@@ -106,6 +105,23 @@ declare class Infrastructure {
106
105
  */
107
106
  eventSources?: Queue[];
108
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>>;
109
125
  }
110
126
 
111
127
  declare const composeD1Arguments: ({ resourceName, }: {
@@ -1,9 +1,8 @@
1
1
  import { P as Project } from '../shared/backend-sdk.B5vcbB2_.js';
2
2
  import { E as Environment } from '../shared/backend-sdk.D5vSybcI.js';
3
3
  import { KVNamespace, D1Database, Queue, R2Bucket, Bindings, Worker } from 'alchemy/cloudflare';
4
- import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.DXHTs6BM.js';
5
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.DXHTs6BM.js';
6
- import 'comment-json';
4
+ import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.7SCu5aVl.js';
5
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.7SCu5aVl.js';
7
6
 
8
7
  declare class Infrastructure {
9
8
  private project;
@@ -106,6 +105,23 @@ declare class Infrastructure {
106
105
  */
107
106
  eventSources?: Queue[];
108
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>>;
109
125
  }
110
126
 
111
127
  declare const composeD1Arguments: ({ resourceName, }: {
@@ -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 } from '../shared/backend-sdk.DiW9aySx.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';
@@ -181,6 +181,20 @@ class Infrastructure {
181
181
  eventSources
182
182
  });
183
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
+ }
184
198
  }
185
199
 
186
200
  const validateEnvironment = (environment) => {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const worker = require('../shared/backend-sdk.BiHu-BlC.cjs');
3
+ const worker = require('../shared/backend-sdk.DY2PE5z-.cjs');
4
4
  require('../shared/backend-sdk.BdcrYpFD.cjs');
5
5
  require('@std/path');
6
6
  require('comment-json');
@@ -1,4 +1,3 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CkewpXu0.cjs';
2
- import 'comment-json';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.B3VLuILe.cjs';
3
2
  import 'alchemy/cloudflare';
4
3
  import '../shared/backend-sdk.D5vSybcI.cjs';
@@ -1,4 +1,3 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.5XEqGlkD.mjs';
2
- import 'comment-json';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CHNezj3A.mjs';
3
2
  import 'alchemy/cloudflare';
4
3
  import '../shared/backend-sdk.D5vSybcI.mjs';
@@ -1,4 +1,3 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.DXHTs6BM.js';
2
- import 'comment-json';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.7SCu5aVl.js';
3
2
  import 'alchemy/cloudflare';
4
3
  import '../shared/backend-sdk.D5vSybcI.js';
@@ -1,4 +1,4 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.DiW9aySx.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
4
  import 'comment-json';
@@ -1,4 +1,3 @@
1
- import * as comment_json from 'comment-json';
2
1
  import { Bindings, Queue } from 'alchemy/cloudflare';
3
2
  import { E as Environment } from './backend-sdk.D5vSybcI.js';
4
3
 
@@ -19,7 +18,7 @@ interface WorkerConfig {
19
18
 
20
19
  declare const loadWorkerConfig: ({ path }: {
21
20
  path: string;
22
- }) => Promise<comment_json.CommentJSONValue>;
21
+ }) => Promise<WorkerConfig>;
23
22
  declare const extractWorkerCrons: ({ workerConfig, environment, }: {
24
23
  workerConfig: WorkerConfig;
25
24
  environment: Environment;
@@ -1,4 +1,3 @@
1
- import * as comment_json from 'comment-json';
2
1
  import { Bindings, Queue } from 'alchemy/cloudflare';
3
2
  import { E as Environment } from './backend-sdk.D5vSybcI.cjs';
4
3
 
@@ -19,7 +18,7 @@ interface WorkerConfig {
19
18
 
20
19
  declare const loadWorkerConfig: ({ path }: {
21
20
  path: string;
22
- }) => Promise<comment_json.CommentJSONValue>;
21
+ }) => Promise<WorkerConfig>;
23
22
  declare const extractWorkerCrons: ({ workerConfig, environment, }: {
24
23
  workerConfig: WorkerConfig;
25
24
  environment: Environment;
@@ -13,7 +13,11 @@ const R2_LOCATION_HINT = "weur";
13
13
 
14
14
  const loadWorkerConfig = async ({ path }) => {
15
15
  const workerConfigFile = Bun.file(join(path, "./wrangler.jsonc"));
16
- return parse(await workerConfigFile.text(), null, true);
16
+ return parse(
17
+ await workerConfigFile.text(),
18
+ null,
19
+ true
20
+ );
17
21
  };
18
22
  const extractWorkerCrons = ({
19
23
  workerConfig,
@@ -1,4 +1,3 @@
1
- import * as comment_json from 'comment-json';
2
1
  import { Bindings, Queue } from 'alchemy/cloudflare';
3
2
  import { E as Environment } from './backend-sdk.D5vSybcI.mjs';
4
3
 
@@ -19,7 +18,7 @@ interface WorkerConfig {
19
18
 
20
19
  declare const loadWorkerConfig: ({ path }: {
21
20
  path: string;
22
- }) => Promise<comment_json.CommentJSONValue>;
21
+ }) => Promise<WorkerConfig>;
23
22
  declare const extractWorkerCrons: ({ workerConfig, environment, }: {
24
23
  workerConfig: WorkerConfig;
25
24
  environment: Environment;
@@ -15,7 +15,11 @@ const R2_LOCATION_HINT = "weur";
15
15
 
16
16
  const loadWorkerConfig = async ({ path: path$1 }) => {
17
17
  const workerConfigFile = Bun.file(path.join(path$1, "./wrangler.jsonc"));
18
- return commentJson.parse(await workerConfigFile.text(), null, true);
18
+ return commentJson.parse(
19
+ await workerConfigFile.text(),
20
+ null,
21
+ true
22
+ );
19
23
  };
20
24
  const extractWorkerCrons = ({
21
25
  workerConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-io/backend-sdk",
3
- "version": "5.24.4",
3
+ "version": "5.25.0",
4
4
  "description": "Develit Backend SDK",
5
5
  "author": "Develit.io",
6
6
  "license": "ISC",