@develit-io/backend-sdk 5.24.1 → 5.24.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,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const worker = require('../shared/backend-sdk.wIHFRZjD.cjs');
3
+ const worker = require('../shared/backend-sdk.CoCjd5zr.cjs');
4
4
  const cloudflare = require('alchemy/cloudflare');
5
5
  const environment_consts = require('../shared/backend-sdk.BdcrYpFD.cjs');
6
6
  require('@std/path');
@@ -159,7 +159,7 @@ class Infrastructure {
159
159
  }),
160
160
  // TODO: Convert to util
161
161
  entrypoint: `${path}/src/index.ts`,
162
- crons: crons || worker.extractWorkerTriggers({
162
+ crons: crons || worker.extractWorkerCrons({
163
163
  workerConfig,
164
164
  environment: this.environment
165
165
  }) || [],
@@ -192,7 +192,7 @@ const validateEnvironment = (environment) => {
192
192
  };
193
193
 
194
194
  exports.composeWorkerArguments = worker.composeWorkerArguments;
195
- exports.extractWorkerTriggers = worker.extractWorkerTriggers;
195
+ exports.extractWorkerCrons = worker.extractWorkerCrons;
196
196
  exports.loadWorkerConfig = worker.loadWorkerConfig;
197
197
  exports.Infrastructure = Infrastructure;
198
198
  exports.composeD1Arguments = composeD1Arguments;
@@ -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.CigZ8gpt.cjs';
5
- export { c as composeWorkerArguments, e as extractWorkerTriggers, l as loadWorkerConfig } from '../shared/backend-sdk.CigZ8gpt.cjs';
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';
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.BpktX9HT.mjs';
5
- export { c as composeWorkerArguments, e as extractWorkerTriggers, l as loadWorkerConfig } from '../shared/backend-sdk.BpktX9HT.mjs';
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';
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.C9hX3xcw.js';
5
- export { c as composeWorkerArguments, e as extractWorkerTriggers, l as loadWorkerConfig } from '../shared/backend-sdk.C9hX3xcw.js';
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';
6
6
 
7
7
  declare class Infrastructure {
8
8
  private project;
@@ -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 extractWorkerTriggers } from '../shared/backend-sdk.G6WixINe.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.CoB3mJ3c.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';
@@ -157,7 +157,7 @@ class Infrastructure {
157
157
  }),
158
158
  // TODO: Convert to util
159
159
  entrypoint: `${path}/src/index.ts`,
160
- crons: crons || extractWorkerTriggers({
160
+ crons: crons || extractWorkerCrons({
161
161
  workerConfig,
162
162
  environment: this.environment
163
163
  }) || [],
@@ -189,4 +189,4 @@ const validateEnvironment = (environment) => {
189
189
  return Number(environment);
190
190
  };
191
191
 
192
- export { Infrastructure, composeD1Arguments, composeIdentifierName, composeKvArguments, composeQueueArguments, composeR2Arguments, composeResourceName, composeWorkerArguments, extractWorkerTriggers, loadWorkerConfig, validateEnvironment };
192
+ export { Infrastructure, composeD1Arguments, composeIdentifierName, composeKvArguments, composeQueueArguments, composeR2Arguments, composeResourceName, composeWorkerArguments, extractWorkerCrons, loadWorkerConfig, validateEnvironment };
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- const worker = require('../shared/backend-sdk.wIHFRZjD.cjs');
3
+ const worker = require('../shared/backend-sdk.CoCjd5zr.cjs');
4
4
  require('../shared/backend-sdk.BdcrYpFD.cjs');
5
5
  require('@std/path');
6
6
 
7
7
 
8
8
 
9
9
  exports.composeWorkerArguments = worker.composeWorkerArguments;
10
- exports.extractWorkerTriggers = worker.extractWorkerTriggers;
10
+ exports.extractWorkerCrons = worker.extractWorkerCrons;
11
11
  exports.loadWorkerConfig = worker.loadWorkerConfig;
@@ -1,3 +1,3 @@
1
- export { c as composeWorkerArguments, e as extractWorkerTriggers, l as loadWorkerConfig } from '../shared/backend-sdk.CigZ8gpt.cjs';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.B3VLuILe.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 extractWorkerTriggers, l as loadWorkerConfig } from '../shared/backend-sdk.BpktX9HT.mjs';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CHNezj3A.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 extractWorkerTriggers, l as loadWorkerConfig } from '../shared/backend-sdk.C9hX3xcw.js';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.7SCu5aVl.js';
2
2
  import 'alchemy/cloudflare';
3
3
  import '../shared/backend-sdk.D5vSybcI.js';
@@ -1,3 +1,3 @@
1
- export { c as composeWorkerArguments, e as extractWorkerTriggers, l as loadWorkerConfig } from '../shared/backend-sdk.G6WixINe.mjs';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CoB3mJ3c.mjs';
2
2
  import '../shared/backend-sdk.DXRpnctc.mjs';
3
3
  import '@std/path';
@@ -4,10 +4,14 @@ import { E as Environment } from './backend-sdk.D5vSybcI.js';
4
4
  type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator';
5
5
  type WorkerType = 'service' | 'orchestrator';
6
6
  interface WorkerConfig {
7
- triggers: string[];
7
+ triggers: {
8
+ crons: string[];
9
+ };
8
10
  env: {
9
11
  [key: string]: {
10
- triggers: string[];
12
+ triggers: {
13
+ crons: string[];
14
+ };
11
15
  };
12
16
  };
13
17
  }
@@ -15,7 +19,7 @@ interface WorkerConfig {
15
19
  declare const loadWorkerConfig: ({ path }: {
16
20
  path: string;
17
21
  }) => Promise<WorkerConfig>;
18
- declare const extractWorkerTriggers: ({ workerConfig, environment, }: {
22
+ declare const extractWorkerCrons: ({ workerConfig, environment, }: {
19
23
  workerConfig: WorkerConfig;
20
24
  environment: Environment;
21
25
  }) => string[];
@@ -39,5 +43,5 @@ declare const composeWorkerArguments: ({ resourceName, entrypoint, crons, bindin
39
43
  crons: string[];
40
44
  };
41
45
 
42
- export { composeWorkerArguments as c, extractWorkerTriggers as e, loadWorkerConfig as l };
46
+ export { composeWorkerArguments as c, extractWorkerCrons as e, loadWorkerConfig as l };
43
47
  export type { Resource as R, WorkerType as W };
@@ -4,10 +4,14 @@ import { E as Environment } from './backend-sdk.D5vSybcI.cjs';
4
4
  type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator';
5
5
  type WorkerType = 'service' | 'orchestrator';
6
6
  interface WorkerConfig {
7
- triggers: string[];
7
+ triggers: {
8
+ crons: string[];
9
+ };
8
10
  env: {
9
11
  [key: string]: {
10
- triggers: string[];
12
+ triggers: {
13
+ crons: string[];
14
+ };
11
15
  };
12
16
  };
13
17
  }
@@ -15,7 +19,7 @@ interface WorkerConfig {
15
19
  declare const loadWorkerConfig: ({ path }: {
16
20
  path: string;
17
21
  }) => Promise<WorkerConfig>;
18
- declare const extractWorkerTriggers: ({ workerConfig, environment, }: {
22
+ declare const extractWorkerCrons: ({ workerConfig, environment, }: {
19
23
  workerConfig: WorkerConfig;
20
24
  environment: Environment;
21
25
  }) => string[];
@@ -39,5 +43,5 @@ declare const composeWorkerArguments: ({ resourceName, entrypoint, crons, bindin
39
43
  crons: string[];
40
44
  };
41
45
 
42
- export { composeWorkerArguments as c, extractWorkerTriggers as e, loadWorkerConfig as l };
46
+ export { composeWorkerArguments as c, extractWorkerCrons as e, loadWorkerConfig as l };
43
47
  export type { Resource as R, WorkerType as W };
@@ -4,10 +4,14 @@ import { E as Environment } from './backend-sdk.D5vSybcI.mjs';
4
4
  type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator';
5
5
  type WorkerType = 'service' | 'orchestrator';
6
6
  interface WorkerConfig {
7
- triggers: string[];
7
+ triggers: {
8
+ crons: string[];
9
+ };
8
10
  env: {
9
11
  [key: string]: {
10
- triggers: string[];
12
+ triggers: {
13
+ crons: string[];
14
+ };
11
15
  };
12
16
  };
13
17
  }
@@ -15,7 +19,7 @@ interface WorkerConfig {
15
19
  declare const loadWorkerConfig: ({ path }: {
16
20
  path: string;
17
21
  }) => Promise<WorkerConfig>;
18
- declare const extractWorkerTriggers: ({ workerConfig, environment, }: {
22
+ declare const extractWorkerCrons: ({ workerConfig, environment, }: {
19
23
  workerConfig: WorkerConfig;
20
24
  environment: Environment;
21
25
  }) => string[];
@@ -39,5 +43,5 @@ declare const composeWorkerArguments: ({ resourceName, entrypoint, crons, bindin
39
43
  crons: string[];
40
44
  };
41
45
 
42
- export { composeWorkerArguments as c, extractWorkerTriggers as e, loadWorkerConfig as l };
46
+ export { composeWorkerArguments as c, extractWorkerCrons as e, loadWorkerConfig as l };
43
47
  export type { Resource as R, WorkerType as W };
@@ -14,14 +14,14 @@ const loadWorkerConfig = async ({ path }) => {
14
14
  const workerConfigFile = Bun.file(join(path, "./wrangler.jsonc"));
15
15
  return await workerConfigFile.json();
16
16
  };
17
- const extractWorkerTriggers = ({
17
+ const extractWorkerCrons = ({
18
18
  workerConfig,
19
19
  environment
20
20
  }) => {
21
21
  if (!ENVIRONMENT.includes(String(environment))) {
22
- return workerConfig.triggers;
22
+ return workerConfig.triggers.crons;
23
23
  }
24
- return workerConfig.env[environment].triggers;
24
+ return workerConfig.env[environment].triggers.crons;
25
25
  };
26
26
  const composeWorkerArguments = ({
27
27
  resourceName,
@@ -45,4 +45,4 @@ const composeWorkerArguments = ({
45
45
  };
46
46
  };
47
47
 
48
- export { 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, extractWorkerTriggers as e, loadWorkerConfig as l };
48
+ export { 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, loadWorkerConfig as l };
@@ -16,14 +16,14 @@ const loadWorkerConfig = async ({ path: path$1 }) => {
16
16
  const workerConfigFile = Bun.file(path.join(path$1, "./wrangler.jsonc"));
17
17
  return await workerConfigFile.json();
18
18
  };
19
- const extractWorkerTriggers = ({
19
+ const extractWorkerCrons = ({
20
20
  workerConfig,
21
21
  environment
22
22
  }) => {
23
23
  if (!environment_consts.ENVIRONMENT.includes(String(environment))) {
24
- return workerConfig.triggers;
24
+ return workerConfig.triggers.crons;
25
25
  }
26
- return workerConfig.env[environment].triggers;
26
+ return workerConfig.env[environment].triggers.crons;
27
27
  };
28
28
  const composeWorkerArguments = ({
29
29
  resourceName,
@@ -54,5 +54,5 @@ exports.R2_JURISDICTION = R2_JURISDICTION;
54
54
  exports.R2_LOCATION_HINT = R2_LOCATION_HINT;
55
55
  exports.R2_STORAGE_CLASS = R2_STORAGE_CLASS;
56
56
  exports.composeWorkerArguments = composeWorkerArguments;
57
- exports.extractWorkerTriggers = extractWorkerTriggers;
57
+ exports.extractWorkerCrons = extractWorkerCrons;
58
58
  exports.loadWorkerConfig = loadWorkerConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-io/backend-sdk",
3
- "version": "5.24.1",
3
+ "version": "5.24.2",
4
4
  "description": "Develit Backend SDK",
5
5
  "author": "Develit.io",
6
6
  "license": "ISC",