@develit-io/backend-sdk 5.26.0 → 5.26.2

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,10 +1,11 @@
1
1
  'use strict';
2
2
 
3
- const worker = require('../shared/backend-sdk.DRtTRYdh.cjs');
3
+ const worker = require('../shared/backend-sdk.CeeriD8t.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
7
  require('comment-json');
8
+ require('@std/fs');
8
9
 
9
10
  const composeD1Arguments = ({
10
11
  resourceName
@@ -213,9 +214,9 @@ class Infrastructure {
213
214
  const { resourceName, assets, bindings } = options;
214
215
  return await this.worker({
215
216
  resourceName,
216
- resource: "orchestrator",
217
+ resource: "client",
217
218
  // TODO: Convert to util
218
- path: `./apps/${resourceName}`,
219
+ path: `./apps/${resourceName}/.output`,
219
220
  assets,
220
221
  bindings
221
222
  });
@@ -1,8 +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.Cb-705pK.cjs';
5
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.Cb-705pK.cjs';
4
+ import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.D9IsijTC.cjs';
5
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.D9IsijTC.cjs';
6
6
 
7
7
  declare class Infrastructure {
8
8
  private project;
@@ -1,8 +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.CUuG2-SC.mjs';
5
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CUuG2-SC.mjs';
4
+ import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.CcWnaBCv.mjs';
5
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CcWnaBCv.mjs';
6
6
 
7
7
  declare class Infrastructure {
8
8
  private project;
@@ -1,8 +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.Cpbr7RlX.js';
5
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.Cpbr7RlX.js';
4
+ import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.tAymSGp7.js';
5
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.tAymSGp7.js';
6
6
 
7
7
  declare class Infrastructure {
8
8
  private project;
@@ -1,8 +1,9 @@
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.670b7XEP.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.DNTOq4pj.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
5
  import 'comment-json';
6
+ import '@std/fs';
6
7
 
7
8
  const composeD1Arguments = ({
8
9
  resourceName
@@ -211,9 +212,9 @@ class Infrastructure {
211
212
  const { resourceName, assets, bindings } = options;
212
213
  return await this.worker({
213
214
  resourceName,
214
- resource: "orchestrator",
215
+ resource: "client",
215
216
  // TODO: Convert to util
216
- path: `./apps/${resourceName}`,
217
+ path: `./apps/${resourceName}/.output`,
217
218
  assets,
218
219
  bindings
219
220
  });
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
 
3
- const worker = require('../shared/backend-sdk.DRtTRYdh.cjs');
3
+ const worker = require('../shared/backend-sdk.CeeriD8t.cjs');
4
4
  require('../shared/backend-sdk.BdcrYpFD.cjs');
5
5
  require('@std/path');
6
6
  require('comment-json');
7
+ require('@std/fs');
7
8
 
8
9
 
9
10
 
@@ -1,3 +1,3 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.Cb-705pK.cjs';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.D9IsijTC.cjs';
2
2
  import 'alchemy/cloudflare';
3
3
  import '../shared/backend-sdk.D5vSybcI.cjs';
@@ -1,3 +1,3 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CUuG2-SC.mjs';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CcWnaBCv.mjs';
2
2
  import 'alchemy/cloudflare';
3
3
  import '../shared/backend-sdk.D5vSybcI.mjs';
@@ -1,3 +1,3 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.Cpbr7RlX.js';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.tAymSGp7.js';
2
2
  import 'alchemy/cloudflare';
3
3
  import '../shared/backend-sdk.D5vSybcI.js';
@@ -1,4 +1,5 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.670b7XEP.mjs';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.DNTOq4pj.mjs';
2
2
  import '../shared/backend-sdk.DXRpnctc.mjs';
3
3
  import '@std/path';
4
4
  import 'comment-json';
5
+ import '@std/fs';
@@ -1,8 +1,8 @@
1
1
  import { Bindings, Queue } from 'alchemy/cloudflare';
2
2
  import { E as Environment } from './backend-sdk.D5vSybcI.mjs';
3
3
 
4
- type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator';
5
- type WorkerType = 'service' | 'orchestrator';
4
+ type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator' | 'client';
5
+ type WorkerType = 'service' | 'orchestrator' | 'client';
6
6
  interface WorkerConfig {
7
7
  triggers: {
8
8
  crons: string[];
@@ -18,7 +18,7 @@ interface WorkerConfig {
18
18
 
19
19
  declare const loadWorkerConfig: ({ path }: {
20
20
  path: string;
21
- }) => Promise<WorkerConfig>;
21
+ }) => Promise<{}>;
22
22
  declare const extractWorkerCrons: ({ workerConfig, environment, }: {
23
23
  workerConfig: WorkerConfig;
24
24
  environment: Environment;
@@ -3,6 +3,7 @@
3
3
  const environment_consts = require('./backend-sdk.BdcrYpFD.cjs');
4
4
  const path = require('@std/path');
5
5
  const commentJson = require('comment-json');
6
+ const fs = require('@std/fs');
6
7
 
7
8
  const COMPATIBILITY_DATE = "2025-06-04";
8
9
  const COMPATIBILITY_FLAGS = ["nodejs_compat"];
@@ -14,7 +15,13 @@ const R2_JURISDICTION = "eu";
14
15
  const R2_LOCATION_HINT = "weur";
15
16
 
16
17
  const loadWorkerConfig = async ({ path: path$1 }) => {
17
- const workerConfigFile = Bun.file(path.join(path$1, "./wrangler.jsonc"));
18
+ const wranglerConfigFilePath = path.join(path$1, "./wrangler.jsonc");
19
+ const wranglerConfigFileExists = fs.exists(wranglerConfigFilePath);
20
+ if (!wranglerConfigFileExists) {
21
+ console.log(`Could not find ${wranglerConfigFilePath}.`);
22
+ return {};
23
+ }
24
+ const workerConfigFile = Bun.file(wranglerConfigFilePath);
18
25
  return commentJson.parse(
19
26
  await workerConfigFile.text(),
20
27
  null,
@@ -1,8 +1,8 @@
1
1
  import { Bindings, Queue } from 'alchemy/cloudflare';
2
2
  import { E as Environment } from './backend-sdk.D5vSybcI.cjs';
3
3
 
4
- type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator';
5
- type WorkerType = 'service' | 'orchestrator';
4
+ type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator' | 'client';
5
+ type WorkerType = 'service' | 'orchestrator' | 'client';
6
6
  interface WorkerConfig {
7
7
  triggers: {
8
8
  crons: string[];
@@ -18,7 +18,7 @@ interface WorkerConfig {
18
18
 
19
19
  declare const loadWorkerConfig: ({ path }: {
20
20
  path: string;
21
- }) => Promise<WorkerConfig>;
21
+ }) => Promise<{}>;
22
22
  declare const extractWorkerCrons: ({ workerConfig, environment, }: {
23
23
  workerConfig: WorkerConfig;
24
24
  environment: Environment;
@@ -1,6 +1,7 @@
1
1
  import { E as ENVIRONMENT } from './backend-sdk.DXRpnctc.mjs';
2
2
  import { join } from '@std/path';
3
3
  import { parse } from 'comment-json';
4
+ import { exists } from '@std/fs';
4
5
 
5
6
  const COMPATIBILITY_DATE = "2025-06-04";
6
7
  const COMPATIBILITY_FLAGS = ["nodejs_compat"];
@@ -12,7 +13,13 @@ const R2_JURISDICTION = "eu";
12
13
  const R2_LOCATION_HINT = "weur";
13
14
 
14
15
  const loadWorkerConfig = async ({ path }) => {
15
- const workerConfigFile = Bun.file(join(path, "./wrangler.jsonc"));
16
+ const wranglerConfigFilePath = join(path, "./wrangler.jsonc");
17
+ const wranglerConfigFileExists = exists(wranglerConfigFilePath);
18
+ if (!wranglerConfigFileExists) {
19
+ console.log(`Could not find ${wranglerConfigFilePath}.`);
20
+ return {};
21
+ }
22
+ const workerConfigFile = Bun.file(wranglerConfigFilePath);
16
23
  return parse(
17
24
  await workerConfigFile.text(),
18
25
  null,
@@ -1,8 +1,8 @@
1
1
  import { Bindings, Queue } from 'alchemy/cloudflare';
2
2
  import { E as Environment } from './backend-sdk.D5vSybcI.js';
3
3
 
4
- type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator';
5
- type WorkerType = 'service' | 'orchestrator';
4
+ type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator' | 'client';
5
+ type WorkerType = 'service' | 'orchestrator' | 'client';
6
6
  interface WorkerConfig {
7
7
  triggers: {
8
8
  crons: string[];
@@ -18,7 +18,7 @@ interface WorkerConfig {
18
18
 
19
19
  declare const loadWorkerConfig: ({ path }: {
20
20
  path: string;
21
- }) => Promise<WorkerConfig>;
21
+ }) => Promise<{}>;
22
22
  declare const extractWorkerCrons: ({ workerConfig, environment, }: {
23
23
  workerConfig: WorkerConfig;
24
24
  environment: Environment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-io/backend-sdk",
3
- "version": "5.26.0",
3
+ "version": "5.26.2",
4
4
  "description": "Develit Backend SDK",
5
5
  "author": "Develit.io",
6
6
  "license": "ISC",
@@ -39,6 +39,7 @@
39
39
  ],
40
40
  "dependencies": {
41
41
  "@cloudflare/workers-types": "4.20250923.0",
42
+ "@std/fs": "npm:@jsr/std__fs",
42
43
  "@std/path": "npm:@jsr/std__path",
43
44
  "@std/text": "npm:@jsr/std__text",
44
45
  "comment-json": "^4.2.5",