@develit-io/backend-sdk 5.30.3 → 5.30.5

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,3 +0,0 @@
1
- type Environment = string | 'dev' | 'test' | 'staging' | 'production';
2
-
3
- export type { Environment as E };
@@ -1,69 +0,0 @@
1
- import { Bindings, Queue, QueueConsumerSettings } from 'alchemy/cloudflare';
2
- import { E as Environment } from './backend-sdk.CYcpgphg.cjs';
3
-
4
- type Resource = 'kv' | 'd1' | 'queue' | 'dlq' | 'r2' | 'durable-object' | 'worker' | 'service' | 'orchestrator' | 'client';
5
- type WorkerType = 'service' | 'orchestrator' | 'client';
6
- interface WorkerConfig {
7
- vars: {
8
- [key: string]: string;
9
- };
10
- triggers: {
11
- crons: string[];
12
- };
13
- env: {
14
- [key: string]: {
15
- vars: {
16
- [key: string]: string;
17
- };
18
- triggers: {
19
- crons: string[];
20
- };
21
- };
22
- };
23
- }
24
-
25
- declare const loadWorkerConfig: ({ path }: {
26
- path: string;
27
- }) => Promise<WorkerConfig>;
28
- declare const extractWorkerCrons: ({ workerConfig, environment, }: {
29
- workerConfig: WorkerConfig;
30
- environment: Environment;
31
- }) => string[];
32
- declare const extractWorkerVars: ({ workerConfig, environment, }: {
33
- workerConfig: WorkerConfig;
34
- environment: Environment;
35
- }) => {
36
- [key: string]: string;
37
- };
38
- declare const composeWorkerArguments: ({ resourceName, entrypoint, assets, domains, crons, bindings, eventSources, }: {
39
- resourceName: string;
40
- entrypoint: string;
41
- assets?: Bindings;
42
- domains?: string[];
43
- crons?: string[];
44
- bindings?: Bindings;
45
- eventSources?: {
46
- queue: Queue;
47
- settings: QueueConsumerSettings;
48
- }[];
49
- }) => {
50
- name: string;
51
- entrypoint: string;
52
- compatibilityFlags: string[];
53
- compatibilityDate: string;
54
- observability: {
55
- enabled: true;
56
- };
57
- url: false;
58
- assets: Bindings | undefined;
59
- domains: string[];
60
- eventSources: {
61
- queue: Queue;
62
- settings: QueueConsumerSettings;
63
- }[];
64
- crons: string[];
65
- bindings: Bindings | undefined;
66
- };
67
-
68
- export { extractWorkerVars as a, composeWorkerArguments as c, extractWorkerCrons as e, loadWorkerConfig as l };
69
- export type { Resource as R, WorkerType as W };
@@ -1,3 +0,0 @@
1
- const ENVIRONMENT = ["dev", "test", "staging", "production"];
2
-
3
- export { ENVIRONMENT as E };
@@ -1,70 +0,0 @@
1
- import { E as ENVIRONMENT } from './backend-sdk.DXRpnctc.mjs';
2
- import { join } from '@std/path';
3
- import { parse } from 'comment-json';
4
-
5
- const COMPATIBILITY_DATE = "2025-06-04";
6
- const COMPATIBILITY_FLAGS = ["nodejs_compat"];
7
- const QUEUE_DELIVERY_DELAY = 5;
8
- const QUEUE_MESSAGE_RETENTION_PERIOD = 259200;
9
- const QUEUE_MAX_BATCH_SIZE = 1;
10
- const QUEUE_MAX_BATCH_TIMEOUT = 5;
11
- const D1_LOCATION_HINT = "weur";
12
- const R2_STORAGE_CLASS = "Standard";
13
- const R2_JURISDICTION = "eu";
14
- const R2_LOCATION_HINT = "weur";
15
-
16
- const loadWorkerConfig = async ({ path }) => {
17
- const wranglerConfigFilePath = join(path, "./wrangler.jsonc");
18
- const workerConfigFile = Bun.file(wranglerConfigFilePath);
19
- return parse(
20
- await workerConfigFile.text(),
21
- null,
22
- true
23
- );
24
- };
25
- const extractWorkerCrons = ({
26
- workerConfig,
27
- environment
28
- }) => {
29
- if (!ENVIRONMENT.includes(String(environment))) {
30
- return workerConfig.triggers?.crons || [];
31
- }
32
- return workerConfig.env[environment]?.triggers?.crons || [];
33
- };
34
- const extractWorkerVars = ({
35
- workerConfig,
36
- environment
37
- }) => {
38
- if (!ENVIRONMENT.includes(String(environment))) {
39
- return workerConfig.vars || [];
40
- }
41
- return workerConfig.env[environment]?.vars || [];
42
- };
43
- const composeWorkerArguments = ({
44
- resourceName,
45
- entrypoint,
46
- assets,
47
- domains = [],
48
- crons = [],
49
- bindings,
50
- eventSources = []
51
- }) => {
52
- return {
53
- name: resourceName,
54
- entrypoint,
55
- compatibilityFlags: COMPATIBILITY_FLAGS,
56
- compatibilityDate: COMPATIBILITY_DATE,
57
- // TODO: Disable default logs and enable ours
58
- observability: {
59
- enabled: true
60
- },
61
- url: false,
62
- assets,
63
- domains,
64
- eventSources,
65
- crons,
66
- bindings
67
- };
68
- };
69
-
70
- export { COMPATIBILITY_FLAGS as C, D1_LOCATION_HINT as D, QUEUE_MESSAGE_RETENTION_PERIOD as Q, R2_LOCATION_HINT as R, extractWorkerVars as a, QUEUE_DELIVERY_DELAY as b, composeWorkerArguments as c, R2_JURISDICTION as d, extractWorkerCrons as e, R2_STORAGE_CLASS as f, QUEUE_MAX_BATCH_TIMEOUT as g, QUEUE_MAX_BATCH_SIZE as h, COMPATIBILITY_DATE as i, loadWorkerConfig as l };
@@ -1,85 +0,0 @@
1
- 'use strict';
2
-
3
- const environment_consts = require('./backend-sdk.BdcrYpFD.cjs');
4
- const path = require('@std/path');
5
- const commentJson = require('comment-json');
6
-
7
- const COMPATIBILITY_DATE = "2025-06-04";
8
- const COMPATIBILITY_FLAGS = ["nodejs_compat"];
9
- const QUEUE_DELIVERY_DELAY = 5;
10
- const QUEUE_MESSAGE_RETENTION_PERIOD = 259200;
11
- const QUEUE_MAX_BATCH_SIZE = 1;
12
- const QUEUE_MAX_BATCH_TIMEOUT = 5;
13
- const D1_LOCATION_HINT = "weur";
14
- const R2_STORAGE_CLASS = "Standard";
15
- const R2_JURISDICTION = "eu";
16
- const R2_LOCATION_HINT = "weur";
17
-
18
- const loadWorkerConfig = async ({ path: path$1 }) => {
19
- const wranglerConfigFilePath = path.join(path$1, "./wrangler.jsonc");
20
- const workerConfigFile = Bun.file(wranglerConfigFilePath);
21
- return commentJson.parse(
22
- await workerConfigFile.text(),
23
- null,
24
- true
25
- );
26
- };
27
- const extractWorkerCrons = ({
28
- workerConfig,
29
- environment
30
- }) => {
31
- if (!environment_consts.ENVIRONMENT.includes(String(environment))) {
32
- return workerConfig.triggers?.crons || [];
33
- }
34
- return workerConfig.env[environment]?.triggers?.crons || [];
35
- };
36
- const extractWorkerVars = ({
37
- workerConfig,
38
- environment
39
- }) => {
40
- if (!environment_consts.ENVIRONMENT.includes(String(environment))) {
41
- return workerConfig.vars || [];
42
- }
43
- return workerConfig.env[environment]?.vars || [];
44
- };
45
- const composeWorkerArguments = ({
46
- resourceName,
47
- entrypoint,
48
- assets,
49
- domains = [],
50
- crons = [],
51
- bindings,
52
- eventSources = []
53
- }) => {
54
- return {
55
- name: resourceName,
56
- entrypoint,
57
- compatibilityFlags: COMPATIBILITY_FLAGS,
58
- compatibilityDate: COMPATIBILITY_DATE,
59
- // TODO: Disable default logs and enable ours
60
- observability: {
61
- enabled: true
62
- },
63
- url: false,
64
- assets,
65
- domains,
66
- eventSources,
67
- crons,
68
- bindings
69
- };
70
- };
71
-
72
- exports.COMPATIBILITY_DATE = COMPATIBILITY_DATE;
73
- exports.COMPATIBILITY_FLAGS = COMPATIBILITY_FLAGS;
74
- exports.D1_LOCATION_HINT = D1_LOCATION_HINT;
75
- exports.QUEUE_DELIVERY_DELAY = QUEUE_DELIVERY_DELAY;
76
- exports.QUEUE_MAX_BATCH_SIZE = QUEUE_MAX_BATCH_SIZE;
77
- exports.QUEUE_MAX_BATCH_TIMEOUT = QUEUE_MAX_BATCH_TIMEOUT;
78
- exports.QUEUE_MESSAGE_RETENTION_PERIOD = QUEUE_MESSAGE_RETENTION_PERIOD;
79
- exports.R2_JURISDICTION = R2_JURISDICTION;
80
- exports.R2_LOCATION_HINT = R2_LOCATION_HINT;
81
- exports.R2_STORAGE_CLASS = R2_STORAGE_CLASS;
82
- exports.composeWorkerArguments = composeWorkerArguments;
83
- exports.extractWorkerCrons = extractWorkerCrons;
84
- exports.extractWorkerVars = extractWorkerVars;
85
- exports.loadWorkerConfig = loadWorkerConfig;
@@ -1,69 +0,0 @@
1
- import { Bindings, Queue, QueueConsumerSettings } from 'alchemy/cloudflare';
2
- import { E as Environment } from './backend-sdk.CYcpgphg.js';
3
-
4
- type Resource = 'kv' | 'd1' | 'queue' | 'dlq' | 'r2' | 'durable-object' | 'worker' | 'service' | 'orchestrator' | 'client';
5
- type WorkerType = 'service' | 'orchestrator' | 'client';
6
- interface WorkerConfig {
7
- vars: {
8
- [key: string]: string;
9
- };
10
- triggers: {
11
- crons: string[];
12
- };
13
- env: {
14
- [key: string]: {
15
- vars: {
16
- [key: string]: string;
17
- };
18
- triggers: {
19
- crons: string[];
20
- };
21
- };
22
- };
23
- }
24
-
25
- declare const loadWorkerConfig: ({ path }: {
26
- path: string;
27
- }) => Promise<WorkerConfig>;
28
- declare const extractWorkerCrons: ({ workerConfig, environment, }: {
29
- workerConfig: WorkerConfig;
30
- environment: Environment;
31
- }) => string[];
32
- declare const extractWorkerVars: ({ workerConfig, environment, }: {
33
- workerConfig: WorkerConfig;
34
- environment: Environment;
35
- }) => {
36
- [key: string]: string;
37
- };
38
- declare const composeWorkerArguments: ({ resourceName, entrypoint, assets, domains, crons, bindings, eventSources, }: {
39
- resourceName: string;
40
- entrypoint: string;
41
- assets?: Bindings;
42
- domains?: string[];
43
- crons?: string[];
44
- bindings?: Bindings;
45
- eventSources?: {
46
- queue: Queue;
47
- settings: QueueConsumerSettings;
48
- }[];
49
- }) => {
50
- name: string;
51
- entrypoint: string;
52
- compatibilityFlags: string[];
53
- compatibilityDate: string;
54
- observability: {
55
- enabled: true;
56
- };
57
- url: false;
58
- assets: Bindings | undefined;
59
- domains: string[];
60
- eventSources: {
61
- queue: Queue;
62
- settings: QueueConsumerSettings;
63
- }[];
64
- crons: string[];
65
- bindings: Bindings | undefined;
66
- };
67
-
68
- export { extractWorkerVars as a, composeWorkerArguments as c, extractWorkerCrons as e, loadWorkerConfig as l };
69
- export type { Resource as R, WorkerType as W };