@develit-io/backend-sdk 5.24.0 → 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,10 +159,10 @@ 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
+ }) || [],
166
166
  bindings,
167
167
  eventSources
168
168
  })
@@ -191,6 +191,9 @@ const validateEnvironment = (environment) => {
191
191
  return Number(environment);
192
192
  };
193
193
 
194
+ exports.composeWorkerArguments = worker.composeWorkerArguments;
195
+ exports.extractWorkerCrons = worker.extractWorkerCrons;
196
+ exports.loadWorkerConfig = worker.loadWorkerConfig;
194
197
  exports.Infrastructure = Infrastructure;
195
198
  exports.composeD1Arguments = composeD1Arguments;
196
199
  exports.composeIdentifierName = composeIdentifierName;
@@ -1,7 +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.Ntg58c34.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';
5
6
 
6
7
  declare class Infrastructure {
7
8
  private project;
@@ -1,7 +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.Ntg58c34.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';
5
6
 
6
7
  declare class Infrastructure {
7
8
  private project;
@@ -1,7 +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.Ntg58c34.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';
5
6
 
6
7
  declare class Infrastructure {
7
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,10 +157,10 @@ 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
+ }) || [],
164
164
  bindings,
165
165
  eventSources
166
166
  })
@@ -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, 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,32 +1,3 @@
1
- import { Bindings, Queue } from 'alchemy/cloudflare';
2
- import { E as Environment } from '../shared/backend-sdk.D5vSybcI.cjs';
3
- import { a as WorkerConfig } from '../shared/backend-sdk.Ntg58c34.cjs';
4
-
5
- declare const loadWorkerConfig: ({ path }: {
6
- path: string;
7
- }) => Promise<WorkerConfig>;
8
- declare const extractWorkerTriggers: ({ workerConfig, environment, }: {
9
- workerConfig: WorkerConfig;
10
- environment: Environment;
11
- }) => string[];
12
- declare const composeWorkerArguments: ({ resourceName, entrypoint, crons, bindings, eventSources, }: {
13
- resourceName: string;
14
- entrypoint: string;
15
- crons?: string[];
16
- bindings?: Bindings;
17
- eventSources?: Queue[];
18
- }) => {
19
- name: string;
20
- entrypoint: string;
21
- compatibilityFlags: string[];
22
- compatibilityDate: string;
23
- observability: {
24
- enabled: true;
25
- };
26
- url: false;
27
- eventSources: Queue[];
28
- bindings: Bindings | undefined;
29
- crons: string[];
30
- };
31
-
32
- export { composeWorkerArguments, extractWorkerTriggers, loadWorkerConfig };
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.B3VLuILe.cjs';
2
+ import 'alchemy/cloudflare';
3
+ import '../shared/backend-sdk.D5vSybcI.cjs';
@@ -1,32 +1,3 @@
1
- import { Bindings, Queue } from 'alchemy/cloudflare';
2
- import { E as Environment } from '../shared/backend-sdk.D5vSybcI.mjs';
3
- import { a as WorkerConfig } from '../shared/backend-sdk.Ntg58c34.mjs';
4
-
5
- declare const loadWorkerConfig: ({ path }: {
6
- path: string;
7
- }) => Promise<WorkerConfig>;
8
- declare const extractWorkerTriggers: ({ workerConfig, environment, }: {
9
- workerConfig: WorkerConfig;
10
- environment: Environment;
11
- }) => string[];
12
- declare const composeWorkerArguments: ({ resourceName, entrypoint, crons, bindings, eventSources, }: {
13
- resourceName: string;
14
- entrypoint: string;
15
- crons?: string[];
16
- bindings?: Bindings;
17
- eventSources?: Queue[];
18
- }) => {
19
- name: string;
20
- entrypoint: string;
21
- compatibilityFlags: string[];
22
- compatibilityDate: string;
23
- observability: {
24
- enabled: true;
25
- };
26
- url: false;
27
- eventSources: Queue[];
28
- bindings: Bindings | undefined;
29
- crons: string[];
30
- };
31
-
32
- export { composeWorkerArguments, extractWorkerTriggers, loadWorkerConfig };
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CHNezj3A.mjs';
2
+ import 'alchemy/cloudflare';
3
+ import '../shared/backend-sdk.D5vSybcI.mjs';
@@ -1,32 +1,3 @@
1
- import { Bindings, Queue } from 'alchemy/cloudflare';
2
- import { E as Environment } from '../shared/backend-sdk.D5vSybcI.js';
3
- import { a as WorkerConfig } from '../shared/backend-sdk.Ntg58c34.js';
4
-
5
- declare const loadWorkerConfig: ({ path }: {
6
- path: string;
7
- }) => Promise<WorkerConfig>;
8
- declare const extractWorkerTriggers: ({ workerConfig, environment, }: {
9
- workerConfig: WorkerConfig;
10
- environment: Environment;
11
- }) => string[];
12
- declare const composeWorkerArguments: ({ resourceName, entrypoint, crons, bindings, eventSources, }: {
13
- resourceName: string;
14
- entrypoint: string;
15
- crons?: string[];
16
- bindings?: Bindings;
17
- eventSources?: Queue[];
18
- }) => {
19
- name: string;
20
- entrypoint: string;
21
- compatibilityFlags: string[];
22
- compatibilityDate: string;
23
- observability: {
24
- enabled: true;
25
- };
26
- url: false;
27
- eventSources: Queue[];
28
- bindings: Bindings | undefined;
29
- crons: string[];
30
- };
31
-
32
- export { composeWorkerArguments, extractWorkerTriggers, loadWorkerConfig };
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.7SCu5aVl.js';
2
+ import 'alchemy/cloudflare';
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';
@@ -0,0 +1,47 @@
1
+ import { Bindings, Queue } from 'alchemy/cloudflare';
2
+ import { E as Environment } from './backend-sdk.D5vSybcI.js';
3
+
4
+ type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator';
5
+ type WorkerType = 'service' | 'orchestrator';
6
+ interface WorkerConfig {
7
+ triggers: {
8
+ crons: string[];
9
+ };
10
+ env: {
11
+ [key: string]: {
12
+ triggers: {
13
+ crons: string[];
14
+ };
15
+ };
16
+ };
17
+ }
18
+
19
+ declare const loadWorkerConfig: ({ path }: {
20
+ path: string;
21
+ }) => Promise<WorkerConfig>;
22
+ declare const extractWorkerCrons: ({ workerConfig, environment, }: {
23
+ workerConfig: WorkerConfig;
24
+ environment: Environment;
25
+ }) => string[];
26
+ declare const composeWorkerArguments: ({ resourceName, entrypoint, crons, bindings, eventSources, }: {
27
+ resourceName: string;
28
+ entrypoint: string;
29
+ crons?: string[];
30
+ bindings?: Bindings;
31
+ eventSources?: Queue[];
32
+ }) => {
33
+ name: string;
34
+ entrypoint: string;
35
+ compatibilityFlags: string[];
36
+ compatibilityDate: string;
37
+ observability: {
38
+ enabled: true;
39
+ };
40
+ url: false;
41
+ eventSources: Queue[];
42
+ bindings: Bindings | undefined;
43
+ crons: string[];
44
+ };
45
+
46
+ export { composeWorkerArguments as c, extractWorkerCrons as e, loadWorkerConfig as l };
47
+ export type { Resource as R, WorkerType as W };
@@ -0,0 +1,47 @@
1
+ import { Bindings, Queue } from 'alchemy/cloudflare';
2
+ import { E as Environment } from './backend-sdk.D5vSybcI.cjs';
3
+
4
+ type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator';
5
+ type WorkerType = 'service' | 'orchestrator';
6
+ interface WorkerConfig {
7
+ triggers: {
8
+ crons: string[];
9
+ };
10
+ env: {
11
+ [key: string]: {
12
+ triggers: {
13
+ crons: string[];
14
+ };
15
+ };
16
+ };
17
+ }
18
+
19
+ declare const loadWorkerConfig: ({ path }: {
20
+ path: string;
21
+ }) => Promise<WorkerConfig>;
22
+ declare const extractWorkerCrons: ({ workerConfig, environment, }: {
23
+ workerConfig: WorkerConfig;
24
+ environment: Environment;
25
+ }) => string[];
26
+ declare const composeWorkerArguments: ({ resourceName, entrypoint, crons, bindings, eventSources, }: {
27
+ resourceName: string;
28
+ entrypoint: string;
29
+ crons?: string[];
30
+ bindings?: Bindings;
31
+ eventSources?: Queue[];
32
+ }) => {
33
+ name: string;
34
+ entrypoint: string;
35
+ compatibilityFlags: string[];
36
+ compatibilityDate: string;
37
+ observability: {
38
+ enabled: true;
39
+ };
40
+ url: false;
41
+ eventSources: Queue[];
42
+ bindings: Bindings | undefined;
43
+ crons: string[];
44
+ };
45
+
46
+ export { composeWorkerArguments as c, extractWorkerCrons as e, loadWorkerConfig as l };
47
+ export type { Resource as R, WorkerType as W };
@@ -0,0 +1,47 @@
1
+ import { Bindings, Queue } from 'alchemy/cloudflare';
2
+ import { E as Environment } from './backend-sdk.D5vSybcI.mjs';
3
+
4
+ type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator';
5
+ type WorkerType = 'service' | 'orchestrator';
6
+ interface WorkerConfig {
7
+ triggers: {
8
+ crons: string[];
9
+ };
10
+ env: {
11
+ [key: string]: {
12
+ triggers: {
13
+ crons: string[];
14
+ };
15
+ };
16
+ };
17
+ }
18
+
19
+ declare const loadWorkerConfig: ({ path }: {
20
+ path: string;
21
+ }) => Promise<WorkerConfig>;
22
+ declare const extractWorkerCrons: ({ workerConfig, environment, }: {
23
+ workerConfig: WorkerConfig;
24
+ environment: Environment;
25
+ }) => string[];
26
+ declare const composeWorkerArguments: ({ resourceName, entrypoint, crons, bindings, eventSources, }: {
27
+ resourceName: string;
28
+ entrypoint: string;
29
+ crons?: string[];
30
+ bindings?: Bindings;
31
+ eventSources?: Queue[];
32
+ }) => {
33
+ name: string;
34
+ entrypoint: string;
35
+ compatibilityFlags: string[];
36
+ compatibilityDate: string;
37
+ observability: {
38
+ enabled: true;
39
+ };
40
+ url: false;
41
+ eventSources: Queue[];
42
+ bindings: Bindings | undefined;
43
+ crons: string[];
44
+ };
45
+
46
+ export { composeWorkerArguments as c, extractWorkerCrons as e, loadWorkerConfig as l };
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.0",
3
+ "version": "5.24.2",
4
4
  "description": "Develit Backend SDK",
5
5
  "author": "Develit.io",
6
6
  "license": "ISC",
@@ -1,12 +0,0 @@
1
- type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator';
2
- type WorkerType = 'service' | 'orchestrator';
3
- interface WorkerConfig {
4
- triggers: string[];
5
- env: {
6
- [key: string]: {
7
- triggers: string[];
8
- };
9
- };
10
- }
11
-
12
- export type { Resource as R, WorkerType as W, WorkerConfig as a };
@@ -1,12 +0,0 @@
1
- type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator';
2
- type WorkerType = 'service' | 'orchestrator';
3
- interface WorkerConfig {
4
- triggers: string[];
5
- env: {
6
- [key: string]: {
7
- triggers: string[];
8
- };
9
- };
10
- }
11
-
12
- export type { Resource as R, WorkerType as W, WorkerConfig as a };
@@ -1,12 +0,0 @@
1
- type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'worker' | 'service' | 'orchestrator';
2
- type WorkerType = 'service' | 'orchestrator';
3
- interface WorkerConfig {
4
- triggers: string[];
5
- env: {
6
- [key: string]: {
7
- triggers: string[];
8
- };
9
- };
10
- }
11
-
12
- export type { Resource as R, WorkerType as W, WorkerConfig as a };