@develit-io/backend-sdk 5.26.3 → 5.26.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,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const worker = require('../shared/backend-sdk.CEul1tWr.cjs');
3
+ const worker = require('../shared/backend-sdk.DmI0NREG.cjs');
4
4
  const cloudflare = require('alchemy/cloudflare');
5
5
  const environment_consts = require('../shared/backend-sdk.BdcrYpFD.cjs');
6
6
  require('@std/path');
@@ -148,8 +148,8 @@ class Infrastructure {
148
148
  resourceName,
149
149
  resource,
150
150
  path,
151
- assets,
152
- crons,
151
+ domains,
152
+ crons: _crons,
153
153
  bindings,
154
154
  eventSources
155
155
  } = options;
@@ -157,7 +157,6 @@ class Infrastructure {
157
157
  resourceName,
158
158
  resource: resource || "worker"
159
159
  });
160
- const workerConfig = await worker.loadWorkerConfig({ path });
161
160
  return await cloudflare.Worker(
162
161
  identifierName,
163
162
  worker.composeWorkerArguments({
@@ -167,12 +166,15 @@ class Infrastructure {
167
166
  resourceName: identifierName
168
167
  }),
169
168
  // TODO: Convert to util
170
- entrypoint: `${path}/src/index.ts`,
171
- assets,
172
- crons: crons || worker.extractWorkerCrons({
173
- workerConfig,
174
- environment: this.environment
175
- }),
169
+ entrypoint: resource === "client" ? `${path}/server/index.mjs` : `${path}/src/index.ts`,
170
+ domains,
171
+ // crons:
172
+ // crons ||
173
+ // extractWorkerCrons({
174
+ // workerConfig,
175
+ // environment: this.environment,
176
+ // }),
177
+ crons: [],
176
178
  bindings,
177
179
  eventSources
178
180
  })
@@ -196,12 +198,13 @@ class Infrastructure {
196
198
  * Creates an instance of Cloudflare Worker as an orchestrator.
197
199
  */
198
200
  async orchestrator(options) {
199
- const { resourceName, bindings, eventSources } = options;
201
+ const { resourceName, domains, bindings, eventSources } = options;
200
202
  return await this.worker({
201
203
  resourceName,
202
204
  resource: "orchestrator",
203
205
  // TODO: Convert to util
204
206
  path: `./apps/${resourceName}`,
207
+ domains,
205
208
  bindings,
206
209
  eventSources
207
210
  });
@@ -210,13 +213,13 @@ class Infrastructure {
210
213
  * Creates an instance of Cloudflare Worker as a client.
211
214
  */
212
215
  async client(options) {
213
- const { resourceName, assets, bindings } = options;
216
+ const { resourceName, domains, bindings } = options;
214
217
  return await this.worker({
215
218
  resourceName,
216
219
  resource: "client",
217
220
  // TODO: Convert to util
218
221
  path: `./apps/${resourceName}/.output`,
219
- assets,
222
+ domains,
220
223
  bindings
221
224
  });
222
225
  }
@@ -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.D9IsijTC.cjs';
5
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.D9IsijTC.cjs';
4
+ import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.COZ8j4F5.cjs';
5
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.COZ8j4F5.cjs';
6
6
 
7
7
  declare class Infrastructure {
8
8
  private project;
@@ -76,9 +76,9 @@ declare class Infrastructure {
76
76
  */
77
77
  path: string;
78
78
  /**
79
- * Static assets of the Worker.
79
+ * Custom domains to bind to the Worker.
80
80
  */
81
- assets?: Bindings;
81
+ domains?: string[];
82
82
  /**
83
83
  * Cron expressions for the trigger of the Worker.
84
84
  */
@@ -117,6 +117,10 @@ declare class Infrastructure {
117
117
  * Name of the orchestrator. Do not include the 'orchestrator' prefix.
118
118
  */
119
119
  resourceName: string;
120
+ /**
121
+ * Custom domains to bind to the Worker.
122
+ */
123
+ domains?: string[];
120
124
  /**
121
125
  * Bindings of the Worker.
122
126
  */
@@ -135,9 +139,9 @@ declare class Infrastructure {
135
139
  */
136
140
  resourceName: string;
137
141
  /**
138
- * Static assets of the Worker.
142
+ * Custom domains to bind to the Worker.
139
143
  */
140
- assets?: Bindings;
144
+ domains?: string[];
141
145
  /**
142
146
  * Bindings of the Worker.
143
147
  */
@@ -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.CcWnaBCv.mjs';
5
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CcWnaBCv.mjs';
4
+ import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.zF_pNSIO.mjs';
5
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.zF_pNSIO.mjs';
6
6
 
7
7
  declare class Infrastructure {
8
8
  private project;
@@ -76,9 +76,9 @@ declare class Infrastructure {
76
76
  */
77
77
  path: string;
78
78
  /**
79
- * Static assets of the Worker.
79
+ * Custom domains to bind to the Worker.
80
80
  */
81
- assets?: Bindings;
81
+ domains?: string[];
82
82
  /**
83
83
  * Cron expressions for the trigger of the Worker.
84
84
  */
@@ -117,6 +117,10 @@ declare class Infrastructure {
117
117
  * Name of the orchestrator. Do not include the 'orchestrator' prefix.
118
118
  */
119
119
  resourceName: string;
120
+ /**
121
+ * Custom domains to bind to the Worker.
122
+ */
123
+ domains?: string[];
120
124
  /**
121
125
  * Bindings of the Worker.
122
126
  */
@@ -135,9 +139,9 @@ declare class Infrastructure {
135
139
  */
136
140
  resourceName: string;
137
141
  /**
138
- * Static assets of the Worker.
142
+ * Custom domains to bind to the Worker.
139
143
  */
140
- assets?: Bindings;
144
+ domains?: string[];
141
145
  /**
142
146
  * Bindings of the Worker.
143
147
  */
@@ -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.tAymSGp7.js';
5
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.tAymSGp7.js';
4
+ import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.umOsvljz.js';
5
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.umOsvljz.js';
6
6
 
7
7
  declare class Infrastructure {
8
8
  private project;
@@ -76,9 +76,9 @@ declare class Infrastructure {
76
76
  */
77
77
  path: string;
78
78
  /**
79
- * Static assets of the Worker.
79
+ * Custom domains to bind to the Worker.
80
80
  */
81
- assets?: Bindings;
81
+ domains?: string[];
82
82
  /**
83
83
  * Cron expressions for the trigger of the Worker.
84
84
  */
@@ -117,6 +117,10 @@ declare class Infrastructure {
117
117
  * Name of the orchestrator. Do not include the 'orchestrator' prefix.
118
118
  */
119
119
  resourceName: string;
120
+ /**
121
+ * Custom domains to bind to the Worker.
122
+ */
123
+ domains?: string[];
120
124
  /**
121
125
  * Bindings of the Worker.
122
126
  */
@@ -135,9 +139,9 @@ declare class Infrastructure {
135
139
  */
136
140
  resourceName: string;
137
141
  /**
138
- * Static assets of the Worker.
142
+ * Custom domains to bind to the Worker.
139
143
  */
140
- assets?: Bindings;
144
+ domains?: string[];
141
145
  /**
142
146
  * Bindings of the Worker.
143
147
  */
@@ -1,4 +1,5 @@
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.yptokdbb.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, c as composeWorkerArguments } from '../shared/backend-sdk.UXVziNMz.mjs';
2
+ export { e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.UXVziNMz.mjs';
2
3
  import { KVNamespace, D1Database, Queue, R2Bucket, Worker } from 'alchemy/cloudflare';
3
4
  import { E as ENVIRONMENT } from '../shared/backend-sdk.DXRpnctc.mjs';
4
5
  import '@std/path';
@@ -146,8 +147,8 @@ class Infrastructure {
146
147
  resourceName,
147
148
  resource,
148
149
  path,
149
- assets,
150
- crons,
150
+ domains,
151
+ crons: _crons,
151
152
  bindings,
152
153
  eventSources
153
154
  } = options;
@@ -155,7 +156,6 @@ class Infrastructure {
155
156
  resourceName,
156
157
  resource: resource || "worker"
157
158
  });
158
- const workerConfig = await loadWorkerConfig({ path });
159
159
  return await Worker(
160
160
  identifierName,
161
161
  composeWorkerArguments({
@@ -165,12 +165,15 @@ class Infrastructure {
165
165
  resourceName: identifierName
166
166
  }),
167
167
  // TODO: Convert to util
168
- entrypoint: `${path}/src/index.ts`,
169
- assets,
170
- crons: crons || extractWorkerCrons({
171
- workerConfig,
172
- environment: this.environment
173
- }),
168
+ entrypoint: resource === "client" ? `${path}/server/index.mjs` : `${path}/src/index.ts`,
169
+ domains,
170
+ // crons:
171
+ // crons ||
172
+ // extractWorkerCrons({
173
+ // workerConfig,
174
+ // environment: this.environment,
175
+ // }),
176
+ crons: [],
174
177
  bindings,
175
178
  eventSources
176
179
  })
@@ -194,12 +197,13 @@ class Infrastructure {
194
197
  * Creates an instance of Cloudflare Worker as an orchestrator.
195
198
  */
196
199
  async orchestrator(options) {
197
- const { resourceName, bindings, eventSources } = options;
200
+ const { resourceName, domains, bindings, eventSources } = options;
198
201
  return await this.worker({
199
202
  resourceName,
200
203
  resource: "orchestrator",
201
204
  // TODO: Convert to util
202
205
  path: `./apps/${resourceName}`,
206
+ domains,
203
207
  bindings,
204
208
  eventSources
205
209
  });
@@ -208,13 +212,13 @@ class Infrastructure {
208
212
  * Creates an instance of Cloudflare Worker as a client.
209
213
  */
210
214
  async client(options) {
211
- const { resourceName, assets, bindings } = options;
215
+ const { resourceName, domains, bindings } = options;
212
216
  return await this.worker({
213
217
  resourceName,
214
218
  resource: "client",
215
219
  // TODO: Convert to util
216
220
  path: `./apps/${resourceName}/.output`,
217
- assets,
221
+ domains,
218
222
  bindings
219
223
  });
220
224
  }
@@ -227,4 +231,4 @@ const validateEnvironment = (environment) => {
227
231
  return Number(environment);
228
232
  };
229
233
 
230
- export { Infrastructure, composeD1Arguments, composeIdentifierName, composeKvArguments, composeQueueArguments, composeR2Arguments, composeResourceName, composeWorkerArguments, extractWorkerCrons, loadWorkerConfig, validateEnvironment };
234
+ export { Infrastructure, composeD1Arguments, composeIdentifierName, composeKvArguments, composeQueueArguments, composeR2Arguments, composeResourceName, composeWorkerArguments, validateEnvironment };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const worker = require('../shared/backend-sdk.CEul1tWr.cjs');
3
+ const worker = require('../shared/backend-sdk.DmI0NREG.cjs');
4
4
  require('../shared/backend-sdk.BdcrYpFD.cjs');
5
5
  require('@std/path');
6
6
  require('comment-json');
@@ -1,3 +1,3 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.D9IsijTC.cjs';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.COZ8j4F5.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.CcWnaBCv.mjs';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.zF_pNSIO.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.tAymSGp7.js';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.umOsvljz.js';
2
2
  import 'alchemy/cloudflare';
3
3
  import '../shared/backend-sdk.D5vSybcI.js';
@@ -1,4 +1,4 @@
1
- export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.yptokdbb.mjs';
1
+ export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.UXVziNMz.mjs';
2
2
  import '../shared/backend-sdk.DXRpnctc.mjs';
3
3
  import '@std/path';
4
4
  import 'comment-json';
@@ -23,10 +23,10 @@ declare const extractWorkerCrons: ({ workerConfig, environment, }: {
23
23
  workerConfig: WorkerConfig;
24
24
  environment: Environment;
25
25
  }) => string[];
26
- declare const composeWorkerArguments: ({ resourceName, entrypoint, assets, crons, bindings, eventSources, }: {
26
+ declare const composeWorkerArguments: ({ resourceName, entrypoint, domains, crons, bindings, eventSources, }: {
27
27
  resourceName: string;
28
28
  entrypoint: string;
29
- assets?: Bindings;
29
+ domains?: string[];
30
30
  crons?: string[];
31
31
  bindings?: Bindings;
32
32
  eventSources?: Queue[];
@@ -39,8 +39,8 @@ declare const composeWorkerArguments: ({ resourceName, entrypoint, assets, crons
39
39
  enabled: true;
40
40
  };
41
41
  url: false;
42
+ domains: string[];
42
43
  eventSources: Queue[];
43
- assets: Bindings | undefined;
44
44
  crons: string[];
45
45
  bindings: Bindings | undefined;
46
46
  };
@@ -38,7 +38,7 @@ const extractWorkerCrons = ({
38
38
  const composeWorkerArguments = ({
39
39
  resourceName,
40
40
  entrypoint,
41
- assets,
41
+ domains = [],
42
42
  crons = [],
43
43
  bindings,
44
44
  eventSources = []
@@ -52,8 +52,8 @@ const composeWorkerArguments = ({
52
52
  enabled: true
53
53
  },
54
54
  url: false,
55
+ domains,
55
56
  eventSources,
56
- assets,
57
57
  crons,
58
58
  bindings
59
59
  };
@@ -36,7 +36,7 @@ const extractWorkerCrons = ({
36
36
  const composeWorkerArguments = ({
37
37
  resourceName,
38
38
  entrypoint,
39
- assets,
39
+ domains = [],
40
40
  crons = [],
41
41
  bindings,
42
42
  eventSources = []
@@ -50,8 +50,8 @@ const composeWorkerArguments = ({
50
50
  enabled: true
51
51
  },
52
52
  url: false,
53
+ domains,
53
54
  eventSources,
54
- assets,
55
55
  crons,
56
56
  bindings
57
57
  };
@@ -23,10 +23,10 @@ declare const extractWorkerCrons: ({ workerConfig, environment, }: {
23
23
  workerConfig: WorkerConfig;
24
24
  environment: Environment;
25
25
  }) => string[];
26
- declare const composeWorkerArguments: ({ resourceName, entrypoint, assets, crons, bindings, eventSources, }: {
26
+ declare const composeWorkerArguments: ({ resourceName, entrypoint, domains, crons, bindings, eventSources, }: {
27
27
  resourceName: string;
28
28
  entrypoint: string;
29
- assets?: Bindings;
29
+ domains?: string[];
30
30
  crons?: string[];
31
31
  bindings?: Bindings;
32
32
  eventSources?: Queue[];
@@ -39,8 +39,8 @@ declare const composeWorkerArguments: ({ resourceName, entrypoint, assets, crons
39
39
  enabled: true;
40
40
  };
41
41
  url: false;
42
+ domains: string[];
42
43
  eventSources: Queue[];
43
- assets: Bindings | undefined;
44
44
  crons: string[];
45
45
  bindings: Bindings | undefined;
46
46
  };
@@ -23,10 +23,10 @@ declare const extractWorkerCrons: ({ workerConfig, environment, }: {
23
23
  workerConfig: WorkerConfig;
24
24
  environment: Environment;
25
25
  }) => string[];
26
- declare const composeWorkerArguments: ({ resourceName, entrypoint, assets, crons, bindings, eventSources, }: {
26
+ declare const composeWorkerArguments: ({ resourceName, entrypoint, domains, crons, bindings, eventSources, }: {
27
27
  resourceName: string;
28
28
  entrypoint: string;
29
- assets?: Bindings;
29
+ domains?: string[];
30
30
  crons?: string[];
31
31
  bindings?: Bindings;
32
32
  eventSources?: Queue[];
@@ -39,8 +39,8 @@ declare const composeWorkerArguments: ({ resourceName, entrypoint, assets, crons
39
39
  enabled: true;
40
40
  };
41
41
  url: false;
42
+ domains: string[];
42
43
  eventSources: Queue[];
43
- assets: Bindings | undefined;
44
44
  crons: string[];
45
45
  bindings: Bindings | undefined;
46
46
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-io/backend-sdk",
3
- "version": "5.26.3",
3
+ "version": "5.26.5",
4
4
  "description": "Develit Backend SDK",
5
5
  "author": "Develit.io",
6
6
  "license": "ISC",