@develit-io/backend-sdk 5.25.0 → 5.26.0
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/infrastructure/index.cjs +25 -2
- package/dist/infrastructure/index.d.cts +23 -2
- package/dist/infrastructure/index.d.mts +23 -2
- package/dist/infrastructure/index.d.ts +23 -2
- package/dist/infrastructure/index.mjs +25 -2
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +1 -1
- package/dist/node/index.d.mts +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/shared/{backend-sdk.BTl8Iida.mjs → backend-sdk.670b7XEP.mjs} +4 -2
- package/dist/shared/{backend-sdk.CHNezj3A.d.mts → backend-sdk.CUuG2-SC.d.mts} +4 -2
- package/dist/shared/{backend-sdk.B3VLuILe.d.cts → backend-sdk.Cb-705pK.d.cts} +4 -2
- package/dist/shared/{backend-sdk.7SCu5aVl.d.ts → backend-sdk.Cpbr7RlX.d.ts} +4 -2
- package/dist/shared/{backend-sdk.DY2PE5z-.cjs → backend-sdk.DRtTRYdh.cjs} +4 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const worker = require('../shared/backend-sdk.
|
|
3
|
+
const worker = require('../shared/backend-sdk.DRtTRYdh.cjs');
|
|
4
4
|
const cloudflare = require('alchemy/cloudflare');
|
|
5
5
|
const environment_consts = require('../shared/backend-sdk.BdcrYpFD.cjs');
|
|
6
6
|
require('@std/path');
|
|
@@ -144,7 +144,15 @@ class Infrastructure {
|
|
|
144
144
|
* Creates an instance of Cloudflare Worker.
|
|
145
145
|
*/
|
|
146
146
|
async worker(options) {
|
|
147
|
-
const {
|
|
147
|
+
const {
|
|
148
|
+
resourceName,
|
|
149
|
+
resource,
|
|
150
|
+
path,
|
|
151
|
+
assets,
|
|
152
|
+
crons,
|
|
153
|
+
bindings,
|
|
154
|
+
eventSources
|
|
155
|
+
} = options;
|
|
148
156
|
const identifierName = composeIdentifierName({
|
|
149
157
|
resourceName,
|
|
150
158
|
resource: resource || "worker"
|
|
@@ -160,6 +168,7 @@ class Infrastructure {
|
|
|
160
168
|
}),
|
|
161
169
|
// TODO: Convert to util
|
|
162
170
|
entrypoint: `${path}/src/index.ts`,
|
|
171
|
+
assets,
|
|
163
172
|
crons: crons || worker.extractWorkerCrons({
|
|
164
173
|
workerConfig,
|
|
165
174
|
environment: this.environment
|
|
@@ -197,6 +206,20 @@ class Infrastructure {
|
|
|
197
206
|
eventSources
|
|
198
207
|
});
|
|
199
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* Creates an instance of Cloudflare Worker as a client.
|
|
211
|
+
*/
|
|
212
|
+
async client(options) {
|
|
213
|
+
const { resourceName, assets, bindings } = options;
|
|
214
|
+
return await this.worker({
|
|
215
|
+
resourceName,
|
|
216
|
+
resource: "orchestrator",
|
|
217
|
+
// TODO: Convert to util
|
|
218
|
+
path: `./apps/${resourceName}`,
|
|
219
|
+
assets,
|
|
220
|
+
bindings
|
|
221
|
+
});
|
|
222
|
+
}
|
|
200
223
|
}
|
|
201
224
|
|
|
202
225
|
const validateEnvironment = (environment) => {
|
|
@@ -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.
|
|
5
|
-
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.
|
|
4
|
+
import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.Cb-705pK.cjs';
|
|
5
|
+
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.Cb-705pK.cjs';
|
|
6
6
|
|
|
7
7
|
declare class Infrastructure {
|
|
8
8
|
private project;
|
|
@@ -75,6 +75,10 @@ declare class Infrastructure {
|
|
|
75
75
|
* Path to the root of the Worker.
|
|
76
76
|
*/
|
|
77
77
|
path: string;
|
|
78
|
+
/**
|
|
79
|
+
* Static assets of the Worker.
|
|
80
|
+
*/
|
|
81
|
+
assets?: Bindings;
|
|
78
82
|
/**
|
|
79
83
|
* Cron expressions for the trigger of the Worker.
|
|
80
84
|
*/
|
|
@@ -122,6 +126,23 @@ declare class Infrastructure {
|
|
|
122
126
|
*/
|
|
123
127
|
eventSources?: Queue[];
|
|
124
128
|
}): Promise<Worker<Bindings, Rpc.WorkerEntrypointBranded>>;
|
|
129
|
+
/**
|
|
130
|
+
* Creates an instance of Cloudflare Worker as a client.
|
|
131
|
+
*/
|
|
132
|
+
client(options: {
|
|
133
|
+
/**
|
|
134
|
+
* Name of the client. Do not include the 'client' prefix.
|
|
135
|
+
*/
|
|
136
|
+
resourceName: string;
|
|
137
|
+
/**
|
|
138
|
+
* Static assets of the Worker.
|
|
139
|
+
*/
|
|
140
|
+
assets?: Bindings;
|
|
141
|
+
/**
|
|
142
|
+
* Bindings of the Worker.
|
|
143
|
+
*/
|
|
144
|
+
bindings?: Bindings;
|
|
145
|
+
}): Promise<Worker<Bindings, Rpc.WorkerEntrypointBranded>>;
|
|
125
146
|
}
|
|
126
147
|
|
|
127
148
|
declare const composeD1Arguments: ({ resourceName, }: {
|
|
@@ -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.
|
|
5
|
-
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.
|
|
4
|
+
import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.CUuG2-SC.mjs';
|
|
5
|
+
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.CUuG2-SC.mjs';
|
|
6
6
|
|
|
7
7
|
declare class Infrastructure {
|
|
8
8
|
private project;
|
|
@@ -75,6 +75,10 @@ declare class Infrastructure {
|
|
|
75
75
|
* Path to the root of the Worker.
|
|
76
76
|
*/
|
|
77
77
|
path: string;
|
|
78
|
+
/**
|
|
79
|
+
* Static assets of the Worker.
|
|
80
|
+
*/
|
|
81
|
+
assets?: Bindings;
|
|
78
82
|
/**
|
|
79
83
|
* Cron expressions for the trigger of the Worker.
|
|
80
84
|
*/
|
|
@@ -122,6 +126,23 @@ declare class Infrastructure {
|
|
|
122
126
|
*/
|
|
123
127
|
eventSources?: Queue[];
|
|
124
128
|
}): Promise<Worker<Bindings, Rpc.WorkerEntrypointBranded>>;
|
|
129
|
+
/**
|
|
130
|
+
* Creates an instance of Cloudflare Worker as a client.
|
|
131
|
+
*/
|
|
132
|
+
client(options: {
|
|
133
|
+
/**
|
|
134
|
+
* Name of the client. Do not include the 'client' prefix.
|
|
135
|
+
*/
|
|
136
|
+
resourceName: string;
|
|
137
|
+
/**
|
|
138
|
+
* Static assets of the Worker.
|
|
139
|
+
*/
|
|
140
|
+
assets?: Bindings;
|
|
141
|
+
/**
|
|
142
|
+
* Bindings of the Worker.
|
|
143
|
+
*/
|
|
144
|
+
bindings?: Bindings;
|
|
145
|
+
}): Promise<Worker<Bindings, Rpc.WorkerEntrypointBranded>>;
|
|
125
146
|
}
|
|
126
147
|
|
|
127
148
|
declare const composeD1Arguments: ({ resourceName, }: {
|
|
@@ -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.
|
|
5
|
-
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.
|
|
4
|
+
import { W as WorkerType$1, R as Resource } from '../shared/backend-sdk.Cpbr7RlX.js';
|
|
5
|
+
export { c as composeWorkerArguments, e as extractWorkerCrons, l as loadWorkerConfig } from '../shared/backend-sdk.Cpbr7RlX.js';
|
|
6
6
|
|
|
7
7
|
declare class Infrastructure {
|
|
8
8
|
private project;
|
|
@@ -75,6 +75,10 @@ declare class Infrastructure {
|
|
|
75
75
|
* Path to the root of the Worker.
|
|
76
76
|
*/
|
|
77
77
|
path: string;
|
|
78
|
+
/**
|
|
79
|
+
* Static assets of the Worker.
|
|
80
|
+
*/
|
|
81
|
+
assets?: Bindings;
|
|
78
82
|
/**
|
|
79
83
|
* Cron expressions for the trigger of the Worker.
|
|
80
84
|
*/
|
|
@@ -122,6 +126,23 @@ declare class Infrastructure {
|
|
|
122
126
|
*/
|
|
123
127
|
eventSources?: Queue[];
|
|
124
128
|
}): Promise<Worker<Bindings, Rpc.WorkerEntrypointBranded>>;
|
|
129
|
+
/**
|
|
130
|
+
* Creates an instance of Cloudflare Worker as a client.
|
|
131
|
+
*/
|
|
132
|
+
client(options: {
|
|
133
|
+
/**
|
|
134
|
+
* Name of the client. Do not include the 'client' prefix.
|
|
135
|
+
*/
|
|
136
|
+
resourceName: string;
|
|
137
|
+
/**
|
|
138
|
+
* Static assets of the Worker.
|
|
139
|
+
*/
|
|
140
|
+
assets?: Bindings;
|
|
141
|
+
/**
|
|
142
|
+
* Bindings of the Worker.
|
|
143
|
+
*/
|
|
144
|
+
bindings?: Bindings;
|
|
145
|
+
}): Promise<Worker<Bindings, Rpc.WorkerEntrypointBranded>>;
|
|
125
146
|
}
|
|
126
147
|
|
|
127
148
|
declare const composeD1Arguments: ({ resourceName, }: {
|
|
@@ -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 extractWorkerCrons } from '../shared/backend-sdk.
|
|
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.670b7XEP.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';
|
|
@@ -142,7 +142,15 @@ class Infrastructure {
|
|
|
142
142
|
* Creates an instance of Cloudflare Worker.
|
|
143
143
|
*/
|
|
144
144
|
async worker(options) {
|
|
145
|
-
const {
|
|
145
|
+
const {
|
|
146
|
+
resourceName,
|
|
147
|
+
resource,
|
|
148
|
+
path,
|
|
149
|
+
assets,
|
|
150
|
+
crons,
|
|
151
|
+
bindings,
|
|
152
|
+
eventSources
|
|
153
|
+
} = options;
|
|
146
154
|
const identifierName = composeIdentifierName({
|
|
147
155
|
resourceName,
|
|
148
156
|
resource: resource || "worker"
|
|
@@ -158,6 +166,7 @@ class Infrastructure {
|
|
|
158
166
|
}),
|
|
159
167
|
// TODO: Convert to util
|
|
160
168
|
entrypoint: `${path}/src/index.ts`,
|
|
169
|
+
assets,
|
|
161
170
|
crons: crons || extractWorkerCrons({
|
|
162
171
|
workerConfig,
|
|
163
172
|
environment: this.environment
|
|
@@ -195,6 +204,20 @@ class Infrastructure {
|
|
|
195
204
|
eventSources
|
|
196
205
|
});
|
|
197
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Creates an instance of Cloudflare Worker as a client.
|
|
209
|
+
*/
|
|
210
|
+
async client(options) {
|
|
211
|
+
const { resourceName, assets, bindings } = options;
|
|
212
|
+
return await this.worker({
|
|
213
|
+
resourceName,
|
|
214
|
+
resource: "orchestrator",
|
|
215
|
+
// TODO: Convert to util
|
|
216
|
+
path: `./apps/${resourceName}`,
|
|
217
|
+
assets,
|
|
218
|
+
bindings
|
|
219
|
+
});
|
|
220
|
+
}
|
|
198
221
|
}
|
|
199
222
|
|
|
200
223
|
const validateEnvironment = (environment) => {
|
package/dist/node/index.cjs
CHANGED
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.Cb-705pK.cjs';
|
|
2
2
|
import 'alchemy/cloudflare';
|
|
3
3
|
import '../shared/backend-sdk.D5vSybcI.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.CUuG2-SC.mjs';
|
|
2
2
|
import 'alchemy/cloudflare';
|
|
3
3
|
import '../shared/backend-sdk.D5vSybcI.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.Cpbr7RlX.js';
|
|
2
2
|
import 'alchemy/cloudflare';
|
|
3
3
|
import '../shared/backend-sdk.D5vSybcI.js';
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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.670b7XEP.mjs';
|
|
2
2
|
import '../shared/backend-sdk.DXRpnctc.mjs';
|
|
3
3
|
import '@std/path';
|
|
4
4
|
import 'comment-json';
|
|
@@ -31,6 +31,7 @@ const extractWorkerCrons = ({
|
|
|
31
31
|
const composeWorkerArguments = ({
|
|
32
32
|
resourceName,
|
|
33
33
|
entrypoint,
|
|
34
|
+
assets,
|
|
34
35
|
crons = [],
|
|
35
36
|
bindings,
|
|
36
37
|
eventSources = []
|
|
@@ -45,8 +46,9 @@ const composeWorkerArguments = ({
|
|
|
45
46
|
},
|
|
46
47
|
url: false,
|
|
47
48
|
eventSources,
|
|
48
|
-
|
|
49
|
-
crons
|
|
49
|
+
assets,
|
|
50
|
+
crons,
|
|
51
|
+
bindings
|
|
50
52
|
};
|
|
51
53
|
};
|
|
52
54
|
|
|
@@ -23,9 +23,10 @@ declare const extractWorkerCrons: ({ workerConfig, environment, }: {
|
|
|
23
23
|
workerConfig: WorkerConfig;
|
|
24
24
|
environment: Environment;
|
|
25
25
|
}) => string[];
|
|
26
|
-
declare const composeWorkerArguments: ({ resourceName, entrypoint, crons, bindings, eventSources, }: {
|
|
26
|
+
declare const composeWorkerArguments: ({ resourceName, entrypoint, assets, crons, bindings, eventSources, }: {
|
|
27
27
|
resourceName: string;
|
|
28
28
|
entrypoint: string;
|
|
29
|
+
assets?: Bindings;
|
|
29
30
|
crons?: string[];
|
|
30
31
|
bindings?: Bindings;
|
|
31
32
|
eventSources?: Queue[];
|
|
@@ -39,8 +40,9 @@ declare const composeWorkerArguments: ({ resourceName, entrypoint, crons, bindin
|
|
|
39
40
|
};
|
|
40
41
|
url: false;
|
|
41
42
|
eventSources: Queue[];
|
|
42
|
-
|
|
43
|
+
assets: Bindings | undefined;
|
|
43
44
|
crons: string[];
|
|
45
|
+
bindings: Bindings | undefined;
|
|
44
46
|
};
|
|
45
47
|
|
|
46
48
|
export { composeWorkerArguments as c, extractWorkerCrons as e, loadWorkerConfig as l };
|
|
@@ -23,9 +23,10 @@ declare const extractWorkerCrons: ({ workerConfig, environment, }: {
|
|
|
23
23
|
workerConfig: WorkerConfig;
|
|
24
24
|
environment: Environment;
|
|
25
25
|
}) => string[];
|
|
26
|
-
declare const composeWorkerArguments: ({ resourceName, entrypoint, crons, bindings, eventSources, }: {
|
|
26
|
+
declare const composeWorkerArguments: ({ resourceName, entrypoint, assets, crons, bindings, eventSources, }: {
|
|
27
27
|
resourceName: string;
|
|
28
28
|
entrypoint: string;
|
|
29
|
+
assets?: Bindings;
|
|
29
30
|
crons?: string[];
|
|
30
31
|
bindings?: Bindings;
|
|
31
32
|
eventSources?: Queue[];
|
|
@@ -39,8 +40,9 @@ declare const composeWorkerArguments: ({ resourceName, entrypoint, crons, bindin
|
|
|
39
40
|
};
|
|
40
41
|
url: false;
|
|
41
42
|
eventSources: Queue[];
|
|
42
|
-
|
|
43
|
+
assets: Bindings | undefined;
|
|
43
44
|
crons: string[];
|
|
45
|
+
bindings: Bindings | undefined;
|
|
44
46
|
};
|
|
45
47
|
|
|
46
48
|
export { composeWorkerArguments as c, extractWorkerCrons as e, loadWorkerConfig as l };
|
|
@@ -23,9 +23,10 @@ declare const extractWorkerCrons: ({ workerConfig, environment, }: {
|
|
|
23
23
|
workerConfig: WorkerConfig;
|
|
24
24
|
environment: Environment;
|
|
25
25
|
}) => string[];
|
|
26
|
-
declare const composeWorkerArguments: ({ resourceName, entrypoint, crons, bindings, eventSources, }: {
|
|
26
|
+
declare const composeWorkerArguments: ({ resourceName, entrypoint, assets, crons, bindings, eventSources, }: {
|
|
27
27
|
resourceName: string;
|
|
28
28
|
entrypoint: string;
|
|
29
|
+
assets?: Bindings;
|
|
29
30
|
crons?: string[];
|
|
30
31
|
bindings?: Bindings;
|
|
31
32
|
eventSources?: Queue[];
|
|
@@ -39,8 +40,9 @@ declare const composeWorkerArguments: ({ resourceName, entrypoint, crons, bindin
|
|
|
39
40
|
};
|
|
40
41
|
url: false;
|
|
41
42
|
eventSources: Queue[];
|
|
42
|
-
|
|
43
|
+
assets: Bindings | undefined;
|
|
43
44
|
crons: string[];
|
|
45
|
+
bindings: Bindings | undefined;
|
|
44
46
|
};
|
|
45
47
|
|
|
46
48
|
export { composeWorkerArguments as c, extractWorkerCrons as e, loadWorkerConfig as l };
|
|
@@ -33,6 +33,7 @@ const extractWorkerCrons = ({
|
|
|
33
33
|
const composeWorkerArguments = ({
|
|
34
34
|
resourceName,
|
|
35
35
|
entrypoint,
|
|
36
|
+
assets,
|
|
36
37
|
crons = [],
|
|
37
38
|
bindings,
|
|
38
39
|
eventSources = []
|
|
@@ -47,8 +48,9 @@ const composeWorkerArguments = ({
|
|
|
47
48
|
},
|
|
48
49
|
url: false,
|
|
49
50
|
eventSources,
|
|
50
|
-
|
|
51
|
-
crons
|
|
51
|
+
assets,
|
|
52
|
+
crons,
|
|
53
|
+
bindings
|
|
52
54
|
};
|
|
53
55
|
};
|
|
54
56
|
|