@develit-io/backend-sdk 5.28.1 → 5.28.3
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.
- package/dist/deployment/index.cjs +34 -18
- package/dist/deployment/index.d.cts +44 -9
- package/dist/deployment/index.d.mts +44 -9
- package/dist/deployment/index.d.ts +44 -9
- package/dist/deployment/index.mjs +36 -19
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/node/index.d.cts +2 -2
- package/dist/node/index.d.mts +2 -2
- package/dist/node/index.d.ts +2 -2
- package/dist/shared/{backend-sdk.8rfqUsXi.d.cts → backend-sdk.B7BfiqA5.d.cts} +1 -1
- package/dist/shared/{backend-sdk.BvaLhEr7.d.mts → backend-sdk.BEt22BOM.d.mts} +1 -1
- package/dist/shared/{backend-sdk.CPfRBPRs.d.ts → backend-sdk.CCDScozq.d.ts} +1 -1
- package/dist/shared/backend-sdk.CYcpgphg.d.cts +3 -0
- package/dist/shared/backend-sdk.CYcpgphg.d.mts +3 -0
- package/dist/shared/backend-sdk.CYcpgphg.d.ts +3 -0
- package/package.json +1 -1
- package/dist/shared/backend-sdk.D5vSybcI.d.cts +0 -3
- package/dist/shared/backend-sdk.D5vSybcI.d.mts +0 -3
- package/dist/shared/backend-sdk.D5vSybcI.d.ts +0 -3
|
@@ -74,12 +74,9 @@ class Deployment {
|
|
|
74
74
|
project;
|
|
75
75
|
environment;
|
|
76
76
|
alchemy;
|
|
77
|
-
constructor({
|
|
78
|
-
project,
|
|
79
|
-
environment
|
|
80
|
-
}) {
|
|
77
|
+
constructor({ project }) {
|
|
81
78
|
this.project = project;
|
|
82
|
-
this.environment =
|
|
79
|
+
this.environment = Bun.env.ENVIRONMENT || "unknown";
|
|
83
80
|
this.alchemy = alchemy__default(project, {
|
|
84
81
|
stateStore: (scope) => {
|
|
85
82
|
return new state.CloudflareStateStore(scope, {
|
|
@@ -88,6 +85,12 @@ class Deployment {
|
|
|
88
85
|
}
|
|
89
86
|
});
|
|
90
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Finalizes the deployment and correctly quits the Alchemy process.
|
|
90
|
+
*/
|
|
91
|
+
async finalize() {
|
|
92
|
+
return (await this.alchemy).finalize();
|
|
93
|
+
}
|
|
91
94
|
/**
|
|
92
95
|
* Creates an instance of Cloudflare KV.
|
|
93
96
|
*/
|
|
@@ -184,6 +187,8 @@ class Deployment {
|
|
|
184
187
|
assets,
|
|
185
188
|
crons,
|
|
186
189
|
bindings,
|
|
190
|
+
variables,
|
|
191
|
+
secrets,
|
|
187
192
|
eventSources
|
|
188
193
|
} = options;
|
|
189
194
|
const identifierName = composeIdentifierName({
|
|
@@ -207,7 +212,11 @@ class Deployment {
|
|
|
207
212
|
workerConfig,
|
|
208
213
|
environment: this.environment
|
|
209
214
|
}),
|
|
210
|
-
bindings
|
|
215
|
+
bindings: {
|
|
216
|
+
...bindings,
|
|
217
|
+
...variables,
|
|
218
|
+
...secrets
|
|
219
|
+
},
|
|
211
220
|
eventSources
|
|
212
221
|
})
|
|
213
222
|
);
|
|
@@ -216,13 +225,15 @@ class Deployment {
|
|
|
216
225
|
* Creates an instance of Cloudflare Worker as a service.
|
|
217
226
|
*/
|
|
218
227
|
async service(options) {
|
|
219
|
-
const { resourceName, bindings, eventSources } = options;
|
|
228
|
+
const { resourceName, bindings, variables, secrets, eventSources } = options;
|
|
220
229
|
return await this.worker({
|
|
221
230
|
resourceName,
|
|
222
231
|
resource: "service",
|
|
223
232
|
// TODO: Convert to util
|
|
224
233
|
path: `./services/${resourceName}`,
|
|
225
234
|
bindings,
|
|
235
|
+
variables,
|
|
236
|
+
secrets,
|
|
226
237
|
eventSources
|
|
227
238
|
});
|
|
228
239
|
}
|
|
@@ -230,7 +241,14 @@ class Deployment {
|
|
|
230
241
|
* Creates an instance of Cloudflare Worker as an orchestrator.
|
|
231
242
|
*/
|
|
232
243
|
async orchestrator(options) {
|
|
233
|
-
const {
|
|
244
|
+
const {
|
|
245
|
+
resourceName,
|
|
246
|
+
domains,
|
|
247
|
+
bindings,
|
|
248
|
+
variables,
|
|
249
|
+
secrets,
|
|
250
|
+
eventSources
|
|
251
|
+
} = options;
|
|
234
252
|
return await this.worker({
|
|
235
253
|
resourceName,
|
|
236
254
|
resource: "orchestrator",
|
|
@@ -238,6 +256,8 @@ class Deployment {
|
|
|
238
256
|
path: `./apps/${resourceName}`,
|
|
239
257
|
domains,
|
|
240
258
|
bindings,
|
|
259
|
+
variables,
|
|
260
|
+
secrets,
|
|
241
261
|
eventSources
|
|
242
262
|
});
|
|
243
263
|
}
|
|
@@ -245,7 +265,7 @@ class Deployment {
|
|
|
245
265
|
* Creates an instance of Cloudflare Worker as a client.
|
|
246
266
|
*/
|
|
247
267
|
async client(options) {
|
|
248
|
-
const { resourceName, domains, bindings } = options;
|
|
268
|
+
const { resourceName, domains, bindings, variables, secrets } = options;
|
|
249
269
|
return await cloudflare.Nuxt(
|
|
250
270
|
composeIdentifierName({
|
|
251
271
|
resourceName,
|
|
@@ -264,7 +284,11 @@ class Deployment {
|
|
|
264
284
|
},
|
|
265
285
|
url: false,
|
|
266
286
|
domains,
|
|
267
|
-
bindings
|
|
287
|
+
bindings: {
|
|
288
|
+
...bindings,
|
|
289
|
+
...variables,
|
|
290
|
+
...secrets
|
|
291
|
+
},
|
|
268
292
|
// TODO: Convert to util
|
|
269
293
|
cwd: `./apps/${resourceName}`
|
|
270
294
|
}
|
|
@@ -272,13 +296,6 @@ class Deployment {
|
|
|
272
296
|
}
|
|
273
297
|
}
|
|
274
298
|
|
|
275
|
-
const validateEnvironment = (environment) => {
|
|
276
|
-
if (environment_consts.ENVIRONMENT.includes(environment)) {
|
|
277
|
-
return environment;
|
|
278
|
-
}
|
|
279
|
-
return Number(environment);
|
|
280
|
-
};
|
|
281
|
-
|
|
282
299
|
exports.composeWorkerArguments = worker.composeWorkerArguments;
|
|
283
300
|
exports.extractWorkerCrons = worker.extractWorkerCrons;
|
|
284
301
|
exports.loadWorkerConfig = worker.loadWorkerConfig;
|
|
@@ -289,4 +306,3 @@ exports.composeKvArguments = composeKvArguments;
|
|
|
289
306
|
exports.composeQueueArguments = composeQueueArguments;
|
|
290
307
|
exports.composeR2Arguments = composeR2Arguments;
|
|
291
308
|
exports.composeResourceName = composeResourceName;
|
|
292
|
-
exports.validateEnvironment = validateEnvironment;
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import * as alchemy_cloudflare from 'alchemy/cloudflare';
|
|
2
2
|
import { KVNamespace, D1Database, Queue, R2Bucket, DurableObjectNamespace, Bindings, Worker } from 'alchemy/cloudflare';
|
|
3
3
|
import { P as Project } from '../shared/backend-sdk.CP78x0gl.cjs';
|
|
4
|
-
import { E as Environment } from '../shared/backend-sdk.
|
|
5
|
-
import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.
|
|
6
|
-
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.
|
|
4
|
+
import { E as Environment } from '../shared/backend-sdk.CYcpgphg.cjs';
|
|
5
|
+
import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.B7BfiqA5.cjs';
|
|
6
|
+
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.B7BfiqA5.cjs';
|
|
7
7
|
import alchemy from 'alchemy';
|
|
8
8
|
|
|
9
9
|
declare class Deployment {
|
|
10
10
|
project: Project;
|
|
11
11
|
environment: Environment;
|
|
12
12
|
alchemy: Promise<Awaited<ReturnType<typeof alchemy>>>;
|
|
13
|
-
constructor({ project
|
|
13
|
+
constructor({ project }: {
|
|
14
14
|
project: Project;
|
|
15
|
-
environment: Environment;
|
|
16
15
|
});
|
|
16
|
+
/**
|
|
17
|
+
* Finalizes the deployment and correctly quits the Alchemy process.
|
|
18
|
+
*/
|
|
19
|
+
finalize(): Promise<void>;
|
|
17
20
|
/**
|
|
18
21
|
* Creates an instance of Cloudflare KV.
|
|
19
22
|
*/
|
|
@@ -103,6 +106,14 @@ declare class Deployment {
|
|
|
103
106
|
* Bindings of the Worker.
|
|
104
107
|
*/
|
|
105
108
|
bindings?: Bindings;
|
|
109
|
+
/**
|
|
110
|
+
* Environment variables of the Worker.
|
|
111
|
+
*/
|
|
112
|
+
variables?: Bindings;
|
|
113
|
+
/**
|
|
114
|
+
* Secrets of the Worker.
|
|
115
|
+
*/
|
|
116
|
+
secrets?: Bindings;
|
|
106
117
|
/**
|
|
107
118
|
* Event sources for the service to consume.
|
|
108
119
|
*/
|
|
@@ -120,6 +131,14 @@ declare class Deployment {
|
|
|
120
131
|
* Bindings of the Worker.
|
|
121
132
|
*/
|
|
122
133
|
bindings?: Bindings;
|
|
134
|
+
/**
|
|
135
|
+
* Environment variables of the Worker.
|
|
136
|
+
*/
|
|
137
|
+
variables?: Bindings;
|
|
138
|
+
/**
|
|
139
|
+
* Secrets of the Worker.
|
|
140
|
+
*/
|
|
141
|
+
secrets?: Bindings;
|
|
123
142
|
/**
|
|
124
143
|
* Event sources for the service to consume.
|
|
125
144
|
*/
|
|
@@ -141,6 +160,14 @@ declare class Deployment {
|
|
|
141
160
|
* Bindings of the Worker.
|
|
142
161
|
*/
|
|
143
162
|
bindings?: Bindings;
|
|
163
|
+
/**
|
|
164
|
+
* Environment variables of the Worker.
|
|
165
|
+
*/
|
|
166
|
+
variables?: Bindings;
|
|
167
|
+
/**
|
|
168
|
+
* Secrets of the Worker.
|
|
169
|
+
*/
|
|
170
|
+
secrets?: Bindings;
|
|
144
171
|
/**
|
|
145
172
|
* Event sources for the orchestrator to consume.
|
|
146
173
|
*/
|
|
@@ -162,7 +189,17 @@ declare class Deployment {
|
|
|
162
189
|
* Bindings of the Worker.
|
|
163
190
|
*/
|
|
164
191
|
bindings?: Bindings;
|
|
165
|
-
|
|
192
|
+
/**
|
|
193
|
+
* Environment variables of the Worker.
|
|
194
|
+
*/
|
|
195
|
+
variables?: Bindings;
|
|
196
|
+
/**
|
|
197
|
+
* Secrets of the Worker.
|
|
198
|
+
*/
|
|
199
|
+
secrets?: Bindings;
|
|
200
|
+
}): Promise<Worker<{
|
|
201
|
+
[x: string]: alchemy_cloudflare.Binding;
|
|
202
|
+
} & {
|
|
166
203
|
ASSETS: alchemy_cloudflare.Assets;
|
|
167
204
|
}>>;
|
|
168
205
|
}
|
|
@@ -212,6 +249,4 @@ declare const composeResourceName: ({ project, environment, resourceName, }: {
|
|
|
212
249
|
resourceName: string;
|
|
213
250
|
}) => string;
|
|
214
251
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
export { Deployment, composeD1Arguments, composeIdentifierName, composeKvArguments, composeQueueArguments, composeR2Arguments, composeResourceName, validateEnvironment };
|
|
252
|
+
export { Deployment, composeD1Arguments, composeIdentifierName, composeKvArguments, composeQueueArguments, composeR2Arguments, composeResourceName };
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import * as alchemy_cloudflare from 'alchemy/cloudflare';
|
|
2
2
|
import { KVNamespace, D1Database, Queue, R2Bucket, DurableObjectNamespace, Bindings, Worker } from 'alchemy/cloudflare';
|
|
3
3
|
import { P as Project } from '../shared/backend-sdk.CP78x0gl.mjs';
|
|
4
|
-
import { E as Environment } from '../shared/backend-sdk.
|
|
5
|
-
import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.
|
|
6
|
-
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.
|
|
4
|
+
import { E as Environment } from '../shared/backend-sdk.CYcpgphg.mjs';
|
|
5
|
+
import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.BEt22BOM.mjs';
|
|
6
|
+
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.BEt22BOM.mjs';
|
|
7
7
|
import alchemy from 'alchemy';
|
|
8
8
|
|
|
9
9
|
declare class Deployment {
|
|
10
10
|
project: Project;
|
|
11
11
|
environment: Environment;
|
|
12
12
|
alchemy: Promise<Awaited<ReturnType<typeof alchemy>>>;
|
|
13
|
-
constructor({ project
|
|
13
|
+
constructor({ project }: {
|
|
14
14
|
project: Project;
|
|
15
|
-
environment: Environment;
|
|
16
15
|
});
|
|
16
|
+
/**
|
|
17
|
+
* Finalizes the deployment and correctly quits the Alchemy process.
|
|
18
|
+
*/
|
|
19
|
+
finalize(): Promise<void>;
|
|
17
20
|
/**
|
|
18
21
|
* Creates an instance of Cloudflare KV.
|
|
19
22
|
*/
|
|
@@ -103,6 +106,14 @@ declare class Deployment {
|
|
|
103
106
|
* Bindings of the Worker.
|
|
104
107
|
*/
|
|
105
108
|
bindings?: Bindings;
|
|
109
|
+
/**
|
|
110
|
+
* Environment variables of the Worker.
|
|
111
|
+
*/
|
|
112
|
+
variables?: Bindings;
|
|
113
|
+
/**
|
|
114
|
+
* Secrets of the Worker.
|
|
115
|
+
*/
|
|
116
|
+
secrets?: Bindings;
|
|
106
117
|
/**
|
|
107
118
|
* Event sources for the service to consume.
|
|
108
119
|
*/
|
|
@@ -120,6 +131,14 @@ declare class Deployment {
|
|
|
120
131
|
* Bindings of the Worker.
|
|
121
132
|
*/
|
|
122
133
|
bindings?: Bindings;
|
|
134
|
+
/**
|
|
135
|
+
* Environment variables of the Worker.
|
|
136
|
+
*/
|
|
137
|
+
variables?: Bindings;
|
|
138
|
+
/**
|
|
139
|
+
* Secrets of the Worker.
|
|
140
|
+
*/
|
|
141
|
+
secrets?: Bindings;
|
|
123
142
|
/**
|
|
124
143
|
* Event sources for the service to consume.
|
|
125
144
|
*/
|
|
@@ -141,6 +160,14 @@ declare class Deployment {
|
|
|
141
160
|
* Bindings of the Worker.
|
|
142
161
|
*/
|
|
143
162
|
bindings?: Bindings;
|
|
163
|
+
/**
|
|
164
|
+
* Environment variables of the Worker.
|
|
165
|
+
*/
|
|
166
|
+
variables?: Bindings;
|
|
167
|
+
/**
|
|
168
|
+
* Secrets of the Worker.
|
|
169
|
+
*/
|
|
170
|
+
secrets?: Bindings;
|
|
144
171
|
/**
|
|
145
172
|
* Event sources for the orchestrator to consume.
|
|
146
173
|
*/
|
|
@@ -162,7 +189,17 @@ declare class Deployment {
|
|
|
162
189
|
* Bindings of the Worker.
|
|
163
190
|
*/
|
|
164
191
|
bindings?: Bindings;
|
|
165
|
-
|
|
192
|
+
/**
|
|
193
|
+
* Environment variables of the Worker.
|
|
194
|
+
*/
|
|
195
|
+
variables?: Bindings;
|
|
196
|
+
/**
|
|
197
|
+
* Secrets of the Worker.
|
|
198
|
+
*/
|
|
199
|
+
secrets?: Bindings;
|
|
200
|
+
}): Promise<Worker<{
|
|
201
|
+
[x: string]: alchemy_cloudflare.Binding;
|
|
202
|
+
} & {
|
|
166
203
|
ASSETS: alchemy_cloudflare.Assets;
|
|
167
204
|
}>>;
|
|
168
205
|
}
|
|
@@ -212,6 +249,4 @@ declare const composeResourceName: ({ project, environment, resourceName, }: {
|
|
|
212
249
|
resourceName: string;
|
|
213
250
|
}) => string;
|
|
214
251
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
export { Deployment, composeD1Arguments, composeIdentifierName, composeKvArguments, composeQueueArguments, composeR2Arguments, composeResourceName, validateEnvironment };
|
|
252
|
+
export { Deployment, composeD1Arguments, composeIdentifierName, composeKvArguments, composeQueueArguments, composeR2Arguments, composeResourceName };
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import * as alchemy_cloudflare from 'alchemy/cloudflare';
|
|
2
2
|
import { KVNamespace, D1Database, Queue, R2Bucket, DurableObjectNamespace, Bindings, Worker } from 'alchemy/cloudflare';
|
|
3
3
|
import { P as Project } from '../shared/backend-sdk.CP78x0gl.js';
|
|
4
|
-
import { E as Environment } from '../shared/backend-sdk.
|
|
5
|
-
import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.
|
|
6
|
-
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.
|
|
4
|
+
import { E as Environment } from '../shared/backend-sdk.CYcpgphg.js';
|
|
5
|
+
import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.CCDScozq.js';
|
|
6
|
+
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CCDScozq.js';
|
|
7
7
|
import alchemy from 'alchemy';
|
|
8
8
|
|
|
9
9
|
declare class Deployment {
|
|
10
10
|
project: Project;
|
|
11
11
|
environment: Environment;
|
|
12
12
|
alchemy: Promise<Awaited<ReturnType<typeof alchemy>>>;
|
|
13
|
-
constructor({ project
|
|
13
|
+
constructor({ project }: {
|
|
14
14
|
project: Project;
|
|
15
|
-
environment: Environment;
|
|
16
15
|
});
|
|
16
|
+
/**
|
|
17
|
+
* Finalizes the deployment and correctly quits the Alchemy process.
|
|
18
|
+
*/
|
|
19
|
+
finalize(): Promise<void>;
|
|
17
20
|
/**
|
|
18
21
|
* Creates an instance of Cloudflare KV.
|
|
19
22
|
*/
|
|
@@ -103,6 +106,14 @@ declare class Deployment {
|
|
|
103
106
|
* Bindings of the Worker.
|
|
104
107
|
*/
|
|
105
108
|
bindings?: Bindings;
|
|
109
|
+
/**
|
|
110
|
+
* Environment variables of the Worker.
|
|
111
|
+
*/
|
|
112
|
+
variables?: Bindings;
|
|
113
|
+
/**
|
|
114
|
+
* Secrets of the Worker.
|
|
115
|
+
*/
|
|
116
|
+
secrets?: Bindings;
|
|
106
117
|
/**
|
|
107
118
|
* Event sources for the service to consume.
|
|
108
119
|
*/
|
|
@@ -120,6 +131,14 @@ declare class Deployment {
|
|
|
120
131
|
* Bindings of the Worker.
|
|
121
132
|
*/
|
|
122
133
|
bindings?: Bindings;
|
|
134
|
+
/**
|
|
135
|
+
* Environment variables of the Worker.
|
|
136
|
+
*/
|
|
137
|
+
variables?: Bindings;
|
|
138
|
+
/**
|
|
139
|
+
* Secrets of the Worker.
|
|
140
|
+
*/
|
|
141
|
+
secrets?: Bindings;
|
|
123
142
|
/**
|
|
124
143
|
* Event sources for the service to consume.
|
|
125
144
|
*/
|
|
@@ -141,6 +160,14 @@ declare class Deployment {
|
|
|
141
160
|
* Bindings of the Worker.
|
|
142
161
|
*/
|
|
143
162
|
bindings?: Bindings;
|
|
163
|
+
/**
|
|
164
|
+
* Environment variables of the Worker.
|
|
165
|
+
*/
|
|
166
|
+
variables?: Bindings;
|
|
167
|
+
/**
|
|
168
|
+
* Secrets of the Worker.
|
|
169
|
+
*/
|
|
170
|
+
secrets?: Bindings;
|
|
144
171
|
/**
|
|
145
172
|
* Event sources for the orchestrator to consume.
|
|
146
173
|
*/
|
|
@@ -162,7 +189,17 @@ declare class Deployment {
|
|
|
162
189
|
* Bindings of the Worker.
|
|
163
190
|
*/
|
|
164
191
|
bindings?: Bindings;
|
|
165
|
-
|
|
192
|
+
/**
|
|
193
|
+
* Environment variables of the Worker.
|
|
194
|
+
*/
|
|
195
|
+
variables?: Bindings;
|
|
196
|
+
/**
|
|
197
|
+
* Secrets of the Worker.
|
|
198
|
+
*/
|
|
199
|
+
secrets?: Bindings;
|
|
200
|
+
}): Promise<Worker<{
|
|
201
|
+
[x: string]: alchemy_cloudflare.Binding;
|
|
202
|
+
} & {
|
|
166
203
|
ASSETS: alchemy_cloudflare.Assets;
|
|
167
204
|
}>>;
|
|
168
205
|
}
|
|
@@ -212,6 +249,4 @@ declare const composeResourceName: ({ project, environment, resourceName, }: {
|
|
|
212
249
|
resourceName: string;
|
|
213
250
|
}) => string;
|
|
214
251
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
export { Deployment, composeD1Arguments, composeIdentifierName, composeKvArguments, composeQueueArguments, composeR2Arguments, composeResourceName, validateEnvironment };
|
|
252
|
+
export { Deployment, composeD1Arguments, composeIdentifierName, composeKvArguments, composeQueueArguments, composeR2Arguments, composeResourceName };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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, C as COMPATIBILITY_FLAGS, f as COMPATIBILITY_DATE } from '../shared/backend-sdk.CLtx2lZQ.mjs';
|
|
2
2
|
import { toKebabCase } from '@std/text';
|
|
3
3
|
import { KVNamespace, D1Database, Queue, R2Bucket, DurableObjectNamespace, Worker, Nuxt } from 'alchemy/cloudflare';
|
|
4
|
-
import { A as ALCHEMY_STATE_STORE
|
|
4
|
+
import { A as ALCHEMY_STATE_STORE } from '../shared/backend-sdk.BIVnu5aA.mjs';
|
|
5
5
|
import alchemy from 'alchemy';
|
|
6
6
|
import { CloudflareStateStore } from 'alchemy/state';
|
|
7
7
|
import '@std/path';
|
|
@@ -68,12 +68,9 @@ class Deployment {
|
|
|
68
68
|
project;
|
|
69
69
|
environment;
|
|
70
70
|
alchemy;
|
|
71
|
-
constructor({
|
|
72
|
-
project,
|
|
73
|
-
environment
|
|
74
|
-
}) {
|
|
71
|
+
constructor({ project }) {
|
|
75
72
|
this.project = project;
|
|
76
|
-
this.environment =
|
|
73
|
+
this.environment = Bun.env.ENVIRONMENT || "unknown";
|
|
77
74
|
this.alchemy = alchemy(project, {
|
|
78
75
|
stateStore: (scope) => {
|
|
79
76
|
return new CloudflareStateStore(scope, {
|
|
@@ -82,6 +79,12 @@ class Deployment {
|
|
|
82
79
|
}
|
|
83
80
|
});
|
|
84
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Finalizes the deployment and correctly quits the Alchemy process.
|
|
84
|
+
*/
|
|
85
|
+
async finalize() {
|
|
86
|
+
return (await this.alchemy).finalize();
|
|
87
|
+
}
|
|
85
88
|
/**
|
|
86
89
|
* Creates an instance of Cloudflare KV.
|
|
87
90
|
*/
|
|
@@ -178,6 +181,8 @@ class Deployment {
|
|
|
178
181
|
assets,
|
|
179
182
|
crons,
|
|
180
183
|
bindings,
|
|
184
|
+
variables,
|
|
185
|
+
secrets,
|
|
181
186
|
eventSources
|
|
182
187
|
} = options;
|
|
183
188
|
const identifierName = composeIdentifierName({
|
|
@@ -201,7 +206,11 @@ class Deployment {
|
|
|
201
206
|
workerConfig,
|
|
202
207
|
environment: this.environment
|
|
203
208
|
}),
|
|
204
|
-
bindings
|
|
209
|
+
bindings: {
|
|
210
|
+
...bindings,
|
|
211
|
+
...variables,
|
|
212
|
+
...secrets
|
|
213
|
+
},
|
|
205
214
|
eventSources
|
|
206
215
|
})
|
|
207
216
|
);
|
|
@@ -210,13 +219,15 @@ class Deployment {
|
|
|
210
219
|
* Creates an instance of Cloudflare Worker as a service.
|
|
211
220
|
*/
|
|
212
221
|
async service(options) {
|
|
213
|
-
const { resourceName, bindings, eventSources } = options;
|
|
222
|
+
const { resourceName, bindings, variables, secrets, eventSources } = options;
|
|
214
223
|
return await this.worker({
|
|
215
224
|
resourceName,
|
|
216
225
|
resource: "service",
|
|
217
226
|
// TODO: Convert to util
|
|
218
227
|
path: `./services/${resourceName}`,
|
|
219
228
|
bindings,
|
|
229
|
+
variables,
|
|
230
|
+
secrets,
|
|
220
231
|
eventSources
|
|
221
232
|
});
|
|
222
233
|
}
|
|
@@ -224,7 +235,14 @@ class Deployment {
|
|
|
224
235
|
* Creates an instance of Cloudflare Worker as an orchestrator.
|
|
225
236
|
*/
|
|
226
237
|
async orchestrator(options) {
|
|
227
|
-
const {
|
|
238
|
+
const {
|
|
239
|
+
resourceName,
|
|
240
|
+
domains,
|
|
241
|
+
bindings,
|
|
242
|
+
variables,
|
|
243
|
+
secrets,
|
|
244
|
+
eventSources
|
|
245
|
+
} = options;
|
|
228
246
|
return await this.worker({
|
|
229
247
|
resourceName,
|
|
230
248
|
resource: "orchestrator",
|
|
@@ -232,6 +250,8 @@ class Deployment {
|
|
|
232
250
|
path: `./apps/${resourceName}`,
|
|
233
251
|
domains,
|
|
234
252
|
bindings,
|
|
253
|
+
variables,
|
|
254
|
+
secrets,
|
|
235
255
|
eventSources
|
|
236
256
|
});
|
|
237
257
|
}
|
|
@@ -239,7 +259,7 @@ class Deployment {
|
|
|
239
259
|
* Creates an instance of Cloudflare Worker as a client.
|
|
240
260
|
*/
|
|
241
261
|
async client(options) {
|
|
242
|
-
const { resourceName, domains, bindings } = options;
|
|
262
|
+
const { resourceName, domains, bindings, variables, secrets } = options;
|
|
243
263
|
return await Nuxt(
|
|
244
264
|
composeIdentifierName({
|
|
245
265
|
resourceName,
|
|
@@ -258,7 +278,11 @@ class Deployment {
|
|
|
258
278
|
},
|
|
259
279
|
url: false,
|
|
260
280
|
domains,
|
|
261
|
-
bindings
|
|
281
|
+
bindings: {
|
|
282
|
+
...bindings,
|
|
283
|
+
...variables,
|
|
284
|
+
...secrets
|
|
285
|
+
},
|
|
262
286
|
// TODO: Convert to util
|
|
263
287
|
cwd: `./apps/${resourceName}`
|
|
264
288
|
}
|
|
@@ -266,11 +290,4 @@ class Deployment {
|
|
|
266
290
|
}
|
|
267
291
|
}
|
|
268
292
|
|
|
269
|
-
|
|
270
|
-
if (ENVIRONMENT.includes(environment)) {
|
|
271
|
-
return environment;
|
|
272
|
-
}
|
|
273
|
-
return Number(environment);
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
export { Deployment, composeD1Arguments, composeIdentifierName, composeKvArguments, composeQueueArguments, composeR2Arguments, composeResourceName, composeWorkerArguments, extractWorkerCrons, loadWorkerConfig, validateEnvironment };
|
|
293
|
+
export { Deployment, composeD1Arguments, composeIdentifierName, composeKvArguments, composeQueueArguments, composeR2Arguments, composeResourceName, composeWorkerArguments, extractWorkerCrons, loadWorkerConfig };
|
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ import { ExtractTablesWithRelations, DBQueryConfig, BuildQueryResult } from 'dri
|
|
|
5
5
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
6
6
|
import { AnySQLiteTable } from 'drizzle-orm/sqlite-core';
|
|
7
7
|
import * as z from 'zod/v4/core';
|
|
8
|
-
export { E as Environment } from './shared/backend-sdk.
|
|
8
|
+
export { E as Environment } from './shared/backend-sdk.CYcpgphg.cjs';
|
|
9
9
|
export { P as Project } from './shared/backend-sdk.CP78x0gl.cjs';
|
|
10
10
|
import { StatusCodes, ReasonPhrases } from 'http-status-codes';
|
|
11
11
|
export { ReasonPhrases as InternalResponsePhrase, StatusCodes as InternalResponseStatus } from 'http-status-codes';
|
package/dist/index.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ import { ExtractTablesWithRelations, DBQueryConfig, BuildQueryResult } from 'dri
|
|
|
5
5
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
6
6
|
import { AnySQLiteTable } from 'drizzle-orm/sqlite-core';
|
|
7
7
|
import * as z from 'zod/v4/core';
|
|
8
|
-
export { E as Environment } from './shared/backend-sdk.
|
|
8
|
+
export { E as Environment } from './shared/backend-sdk.CYcpgphg.mjs';
|
|
9
9
|
export { P as Project } from './shared/backend-sdk.CP78x0gl.mjs';
|
|
10
10
|
import { StatusCodes, ReasonPhrases } from 'http-status-codes';
|
|
11
11
|
export { ReasonPhrases as InternalResponsePhrase, StatusCodes as InternalResponseStatus } from 'http-status-codes';
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { ExtractTablesWithRelations, DBQueryConfig, BuildQueryResult } from 'dri
|
|
|
5
5
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
6
6
|
import { AnySQLiteTable } from 'drizzle-orm/sqlite-core';
|
|
7
7
|
import * as z from 'zod/v4/core';
|
|
8
|
-
export { E as Environment } from './shared/backend-sdk.
|
|
8
|
+
export { E as Environment } from './shared/backend-sdk.CYcpgphg.js';
|
|
9
9
|
export { P as Project } from './shared/backend-sdk.CP78x0gl.js';
|
|
10
10
|
import { StatusCodes, ReasonPhrases } from 'http-status-codes';
|
|
11
11
|
export { ReasonPhrases as InternalResponsePhrase, StatusCodes as InternalResponseStatus } from 'http-status-codes';
|
package/dist/node/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.
|
|
1
|
+
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.B7BfiqA5.cjs';
|
|
2
2
|
import 'alchemy/cloudflare';
|
|
3
|
-
import '../shared/backend-sdk.
|
|
3
|
+
import '../shared/backend-sdk.CYcpgphg.cjs';
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.
|
|
1
|
+
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.BEt22BOM.mjs';
|
|
2
2
|
import 'alchemy/cloudflare';
|
|
3
|
-
import '../shared/backend-sdk.
|
|
3
|
+
import '../shared/backend-sdk.CYcpgphg.mjs';
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.
|
|
1
|
+
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CCDScozq.js';
|
|
2
2
|
import 'alchemy/cloudflare';
|
|
3
|
-
import '../shared/backend-sdk.
|
|
3
|
+
import '../shared/backend-sdk.CYcpgphg.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Bindings, Queue } from 'alchemy/cloudflare';
|
|
2
|
-
import { E as Environment } from './backend-sdk.
|
|
2
|
+
import { E as Environment } from './backend-sdk.CYcpgphg.cjs';
|
|
3
3
|
|
|
4
4
|
type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'durable-object' | 'worker' | 'service' | 'orchestrator' | 'client';
|
|
5
5
|
type WorkerType = 'service' | 'orchestrator' | 'client';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Bindings, Queue } from 'alchemy/cloudflare';
|
|
2
|
-
import { E as Environment } from './backend-sdk.
|
|
2
|
+
import { E as Environment } from './backend-sdk.CYcpgphg.mjs';
|
|
3
3
|
|
|
4
4
|
type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'durable-object' | 'worker' | 'service' | 'orchestrator' | 'client';
|
|
5
5
|
type WorkerType = 'service' | 'orchestrator' | 'client';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Bindings, Queue } from 'alchemy/cloudflare';
|
|
2
|
-
import { E as Environment } from './backend-sdk.
|
|
2
|
+
import { E as Environment } from './backend-sdk.CYcpgphg.js';
|
|
3
3
|
|
|
4
4
|
type Resource = 'kv' | 'd1' | 'queue' | 'r2' | 'durable-object' | 'worker' | 'service' | 'orchestrator' | 'client';
|
|
5
5
|
type WorkerType = 'service' | 'orchestrator' | 'client';
|
package/package.json
CHANGED