@develit-io/backend-sdk 5.24.2 → 5.24.4

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.CoCjd5zr.cjs');
3
+ const worker = require('../shared/backend-sdk.BiHu-BlC.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
@@ -162,7 +163,7 @@ class Infrastructure {
162
163
  crons: crons || worker.extractWorkerCrons({
163
164
  workerConfig,
164
165
  environment: this.environment
165
- }) || [],
166
+ }),
166
167
  bindings,
167
168
  eventSources
168
169
  })
@@ -1,8 +1,9 @@
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.B3VLuILe.cjs';
5
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.B3VLuILe.cjs';
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';
6
7
 
7
8
  declare class Infrastructure {
8
9
  private project;
@@ -1,8 +1,9 @@
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.CHNezj3A.mjs';
5
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CHNezj3A.mjs';
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';
6
7
 
7
8
  declare class Infrastructure {
8
9
  private project;
@@ -1,8 +1,9 @@
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.7SCu5aVl.js';
5
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.7SCu5aVl.js';
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';
6
7
 
7
8
  declare class Infrastructure {
8
9
  private project;
@@ -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.CoB3mJ3c.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.DiW9aySx.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
@@ -160,7 +161,7 @@ class Infrastructure {
160
161
  crons: crons || extractWorkerCrons({
161
162
  workerConfig,
162
163
  environment: this.environment
163
- }) || [],
164
+ }),
164
165
  bindings,
165
166
  eventSources
166
167
  })
@@ -1,8 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const worker = require('../shared/backend-sdk.CoCjd5zr.cjs');
3
+ const worker = require('../shared/backend-sdk.BiHu-BlC.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.B3VLuILe.cjs';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CkewpXu0.cjs';
2
+ import 'comment-json';
2
3
  import 'alchemy/cloudflare';
3
4
  import '../shared/backend-sdk.D5vSybcI.cjs';
@@ -1,3 +1,4 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CHNezj3A.mjs';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.5XEqGlkD.mjs';
2
+ import 'comment-json';
2
3
  import 'alchemy/cloudflare';
3
4
  import '../shared/backend-sdk.D5vSybcI.mjs';
@@ -1,3 +1,4 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.7SCu5aVl.js';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.DXHTs6BM.js';
2
+ import 'comment-json';
2
3
  import 'alchemy/cloudflare';
3
4
  import '../shared/backend-sdk.D5vSybcI.js';
@@ -1,3 +1,4 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CoB3mJ3c.mjs';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.DiW9aySx.mjs';
2
2
  import '../shared/backend-sdk.DXRpnctc.mjs';
3
3
  import '@std/path';
4
+ import 'comment-json';
@@ -1,3 +1,4 @@
1
+ import * as comment_json from 'comment-json';
1
2
  import { Bindings, Queue } from 'alchemy/cloudflare';
2
3
  import { E as Environment } from './backend-sdk.D5vSybcI.mjs';
3
4
 
@@ -18,7 +19,7 @@ interface WorkerConfig {
18
19
 
19
20
  declare const loadWorkerConfig: ({ path }: {
20
21
  path: string;
21
- }) => Promise<WorkerConfig>;
22
+ }) => Promise<comment_json.CommentJSONValue>;
22
23
  declare const extractWorkerCrons: ({ workerConfig, environment, }: {
23
24
  workerConfig: WorkerConfig;
24
25
  environment: Environment;
@@ -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,16 +15,16 @@ 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(await workerConfigFile.text(), null, true);
18
19
  };
19
20
  const extractWorkerCrons = ({
20
21
  workerConfig,
21
22
  environment
22
23
  }) => {
23
24
  if (!environment_consts.ENVIRONMENT.includes(String(environment))) {
24
- return workerConfig.triggers.crons;
25
+ return workerConfig.triggers?.crons || [];
25
26
  }
26
- return workerConfig.env[environment].triggers.crons;
27
+ return workerConfig.env[environment]?.triggers?.crons || [];
27
28
  };
28
29
  const composeWorkerArguments = ({
29
30
  resourceName,
@@ -1,3 +1,4 @@
1
+ import * as comment_json from 'comment-json';
1
2
  import { Bindings, Queue } from 'alchemy/cloudflare';
2
3
  import { E as Environment } from './backend-sdk.D5vSybcI.cjs';
3
4
 
@@ -18,7 +19,7 @@ interface WorkerConfig {
18
19
 
19
20
  declare const loadWorkerConfig: ({ path }: {
20
21
  path: string;
21
- }) => Promise<WorkerConfig>;
22
+ }) => Promise<comment_json.CommentJSONValue>;
22
23
  declare const extractWorkerCrons: ({ workerConfig, environment, }: {
23
24
  workerConfig: WorkerConfig;
24
25
  environment: Environment;
@@ -1,3 +1,4 @@
1
+ import * as comment_json from 'comment-json';
1
2
  import { Bindings, Queue } from 'alchemy/cloudflare';
2
3
  import { E as Environment } from './backend-sdk.D5vSybcI.js';
3
4
 
@@ -18,7 +19,7 @@ interface WorkerConfig {
18
19
 
19
20
  declare const loadWorkerConfig: ({ path }: {
20
21
  path: string;
21
- }) => Promise<WorkerConfig>;
22
+ }) => Promise<comment_json.CommentJSONValue>;
22
23
  declare const extractWorkerCrons: ({ workerConfig, environment, }: {
23
24
  workerConfig: WorkerConfig;
24
25
  environment: Environment;
@@ -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,16 +13,16 @@ 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(await workerConfigFile.text(), null, true);
16
17
  };
17
18
  const extractWorkerCrons = ({
18
19
  workerConfig,
19
20
  environment
20
21
  }) => {
21
22
  if (!ENVIRONMENT.includes(String(environment))) {
22
- return workerConfig.triggers.crons;
23
+ return workerConfig.triggers?.crons || [];
23
24
  }
24
- return workerConfig.env[environment].triggers.crons;
25
+ return workerConfig.env[environment]?.triggers?.crons || [];
25
26
  };
26
27
  const composeWorkerArguments = ({
27
28
  resourceName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-io/backend-sdk",
3
- "version": "5.24.2",
3
+ "version": "5.24.4",
4
4
  "description": "Develit Backend SDK",
5
5
  "author": "Develit.io",
6
6
  "license": "ISC",