@supacloud/elysia 0.30.0 → 0.31.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/README.md +12 -4
- package/compatibility.json +3 -3
- package/dist/framework.d.ts +2 -2
- package/dist/http-telemetry.d.ts +8 -2
- package/dist/index.d.ts +10 -11
- package/dist/index.js +97 -13
- package/dist/transactional-command.d.ts +20 -0
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -8,11 +8,11 @@ is a separately authorized business command, never an assumed rollback.
|
|
|
8
8
|
|
|
9
9
|
## Compatibility and Acceptance Boundary
|
|
10
10
|
|
|
11
|
-
The Elysia peer and development dependency are pinned to `2.0.0-beta.
|
|
12
|
-
The runtime adapter pins Effect `4.0.
|
|
11
|
+
The Elysia peer and development dependency are pinned to `2.0.0-beta.32`.
|
|
12
|
+
The runtime adapter pins Effect `4.0.5` and consumes its `Exit`-based
|
|
13
13
|
execution boundary.
|
|
14
14
|
`compatibility.json` records the acceptance target: Bun 1.4.3, Elysia
|
|
15
|
-
2.0.0-beta.
|
|
15
|
+
2.0.0-beta.32, Effect 4.0.5, `typebox` 1.3.37, `exact-mirror` 1.2.6,
|
|
16
16
|
TypeScript CLI 7.0.2 and the compiler's separate TypeScript 6 semantic API 6.0.2.
|
|
17
17
|
The matrix is a
|
|
18
18
|
required target, not proof of an execution. See the dated, commit-specific
|
|
@@ -193,6 +193,14 @@ concurrent request isolation. Run it with `bun run typecheck:test` as well as
|
|
|
193
193
|
|
|
194
194
|
## Persistent Command Adapters
|
|
195
195
|
|
|
196
|
+
For a local compiled Command whose handler must run in a PostgreSQL transaction,
|
|
197
|
+
use `createTransactionalCommandGovernance` with `createPostgresCommandStore`.
|
|
198
|
+
It supplies the governance callbacks and a request-isolated `transaction()`
|
|
199
|
+
accessor, delegating receipt, authorization-on-replay and audit to the existing
|
|
200
|
+
durable executor. The approval starter uses this binding and derives decoders
|
|
201
|
+
from its HTTP contracts. See [transactional defaults](../../docs/transactional-command-defaults.md)
|
|
202
|
+
for ownership, migration and native acceptance boundaries.
|
|
203
|
+
|
|
196
204
|
`createPersistentCommandAdapter(command, { identity, input })` binds a
|
|
197
205
|
`createTransactionalCommand` or `createExternalCommand` from `@supacloud/commands`
|
|
198
206
|
to `commandGovernance.rpc`.
|
|
@@ -319,7 +327,7 @@ Runtime adapter that turns `@supacloud/compiler` output into a production-ready
|
|
|
319
327
|
## Installation
|
|
320
328
|
|
|
321
329
|
```bash
|
|
322
|
-
bun add --exact @supacloud/elysia elysia@2.0.0-beta.
|
|
330
|
+
bun add --exact @supacloud/elysia elysia@2.0.0-beta.32
|
|
323
331
|
```
|
|
324
332
|
|
|
325
333
|
## Usage
|
package/compatibility.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bun": "1.4.3",
|
|
3
3
|
"packages": {
|
|
4
|
-
"elysia": "2.0.0-beta.
|
|
5
|
-
"effect": "4.0.
|
|
4
|
+
"elysia": "2.0.0-beta.32",
|
|
5
|
+
"effect": "4.0.5",
|
|
6
6
|
"typescript": "7.0.2",
|
|
7
|
-
"typebox": "1.3.
|
|
7
|
+
"typebox": "1.3.37",
|
|
8
8
|
"exact-mirror": "1.2.6",
|
|
9
9
|
"@typescript/typescript6": "6.0.2"
|
|
10
10
|
}
|
package/dist/framework.d.ts
CHANGED
|
@@ -29,8 +29,8 @@ export declare function createSupaCloudFramework<const Http extends AnyElysia =
|
|
|
29
29
|
macro: (import("elysia").DefaultMetadata & Http["~Metadata"])["macro"];
|
|
30
30
|
macroFn: (import("elysia").DefaultMetadata & Http["~Metadata"])["macroFn"];
|
|
31
31
|
parser: (import("elysia").DefaultMetadata & Http["~Metadata"])["parser"];
|
|
32
|
-
response: import("elysia/types").UnionResponseStatus<(import("elysia").DefaultMetadata & Http["~Metadata"])["response"], import("elysia/types").UnionResponseStatus<
|
|
33
|
-
},
|
|
32
|
+
response: import("elysia/types").UnionResponseStatus<(import("elysia").DefaultMetadata & Http["~Metadata"])["response"], import("elysia/types").UnionResponseStatus<Http["~Ephemeral"]["response"], {}>>;
|
|
33
|
+
}, {} & Http["~Routes"], import("elysia").DefaultEphemeral, {
|
|
34
34
|
derive: {};
|
|
35
35
|
schema: {};
|
|
36
36
|
schemas: {};
|
package/dist/http-telemetry.d.ts
CHANGED
|
@@ -16,12 +16,18 @@ export declare function createHttpTelemetry(observe: HttpTelemetryObserver): Ely
|
|
|
16
16
|
derive: {};
|
|
17
17
|
}, {
|
|
18
18
|
typebox: {};
|
|
19
|
-
error: [
|
|
19
|
+
error: [{
|
|
20
|
+
error: Error;
|
|
21
|
+
response: {};
|
|
22
|
+
passes: true;
|
|
23
|
+
'~return': undefined;
|
|
24
|
+
'~catchAll': true;
|
|
25
|
+
}];
|
|
20
26
|
}, {
|
|
21
27
|
schema: {};
|
|
22
28
|
schemas: {};
|
|
23
29
|
macro: {};
|
|
24
30
|
macroFn: {};
|
|
25
31
|
parser: {};
|
|
26
|
-
response:
|
|
32
|
+
response: import("elysia/types").ExtractErrorFromHandle<undefined>;
|
|
27
33
|
}, {}, import("elysia").DefaultEphemeral, import("elysia").DefaultEphemeral>;
|
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export { createDefaultEffectRuntime, createEffectRuntimeFromLayer, EffectApplica
|
|
|
25
25
|
export type { CompiledEffectDescriptor, SupaCloudEffectRuntime } from "./effect";
|
|
26
26
|
export type { ElysiaRouteContext, ElysiaRouteDefinition, ElysiaRouteHandler, ElysiaRouteSchema, ResponseMapSelector, RouteContractSchemas, SchemaDecoderOptions, SchemaNormalizeMode, } from "./schema_contract";
|
|
27
27
|
export { createPersistentCommandAdapter, type PersistentCommandHandler } from "./persistent-command";
|
|
28
|
+
export { createTransactionalCommandGovernance } from "./transactional-command";
|
|
29
|
+
export type { TransactionalCommandGovernanceOptions } from "./transactional-command";
|
|
28
30
|
export { createDocumentationPlugin } from "./documentation";
|
|
29
31
|
export type { ApplicationDocumentationOptions, DocumentationSource, GraphqlDocumentationOptions, OpenApiDocumentationOptions, } from "./documentation";
|
|
30
32
|
export { createSupaCloudFramework } from "./framework";
|
|
@@ -255,7 +257,7 @@ export interface ErrorContext {
|
|
|
255
257
|
*
|
|
256
258
|
* Declaring the runtime classes here lets Elysia's type system (and therefore
|
|
257
259
|
* Eden Treaty / generated clients) know these errors are *handled*: the generic
|
|
258
|
-
* `.
|
|
260
|
+
* `.onError(handler)` catch-all no longer widens every route's response schema
|
|
259
261
|
* with an untyped fallback. Each entry also documents the public `code` served
|
|
260
262
|
* by {@link defaultErrorResponse} when a caller does not install an
|
|
261
263
|
* `errorMapper`.
|
|
@@ -399,16 +401,13 @@ export declare function createModulePlugin<const Services extends Record<string,
|
|
|
399
401
|
}, {
|
|
400
402
|
typebox: {} & Http["~Definitions"]["typebox"];
|
|
401
403
|
error: [...Http["~Definitions"]["error"]];
|
|
402
|
-
}, import("elysia").DefaultMetadata & Http["~Metadata"],
|
|
404
|
+
}, import("elysia").DefaultMetadata & Http["~Metadata"], {} & Http["~Routes"], import("elysia").DefaultEphemeral, {
|
|
403
405
|
derive: {} & Http["~Ephemeral"]["derive"];
|
|
404
406
|
schema: {} & import("elysia/types").MergeSchema<{} & Http["~Ephemeral"]["schema"], {}, "", false>;
|
|
405
407
|
schemas: {} & Http["~Ephemeral"]["schemas"];
|
|
406
|
-
response:
|
|
408
|
+
response: Http["~Ephemeral"]["response"];
|
|
407
409
|
error: [...Http["~Ephemeral"]["error"]];
|
|
408
|
-
},
|
|
409
|
-
readonly services: Services;
|
|
410
|
-
readonly requestContext: unknown;
|
|
411
|
-
}>, {
|
|
410
|
+
}, {}, {
|
|
412
411
|
readonly services: Services;
|
|
413
412
|
readonly requestContext: unknown;
|
|
414
413
|
}>;
|
|
@@ -441,8 +440,8 @@ export declare function createApplication<const Http extends AnyElysia = Elysia>
|
|
|
441
440
|
macro: (import("elysia").DefaultMetadata & Http["~Metadata"])["macro"];
|
|
442
441
|
macroFn: (import("elysia").DefaultMetadata & Http["~Metadata"])["macroFn"];
|
|
443
442
|
parser: (import("elysia").DefaultMetadata & Http["~Metadata"])["parser"];
|
|
444
|
-
response: import("elysia/types").UnionResponseStatus<(import("elysia").DefaultMetadata & Http["~Metadata"])["response"], import("elysia/types").UnionResponseStatus<
|
|
445
|
-
},
|
|
443
|
+
response: import("elysia/types").UnionResponseStatus<(import("elysia").DefaultMetadata & Http["~Metadata"])["response"], import("elysia/types").UnionResponseStatus<Http["~Ephemeral"]["response"], {}>>;
|
|
444
|
+
}, {} & Http["~Routes"], import("elysia").DefaultEphemeral, {
|
|
446
445
|
derive: {};
|
|
447
446
|
schema: {};
|
|
448
447
|
schemas: {};
|
|
@@ -463,8 +462,8 @@ export declare function createTestApp<const Http extends AnyElysia = Elysia>(opt
|
|
|
463
462
|
macro: (import("elysia").DefaultMetadata & Http["~Metadata"])["macro"];
|
|
464
463
|
macroFn: (import("elysia").DefaultMetadata & Http["~Metadata"])["macroFn"];
|
|
465
464
|
parser: (import("elysia").DefaultMetadata & Http["~Metadata"])["parser"];
|
|
466
|
-
response: import("elysia/types").UnionResponseStatus<(import("elysia").DefaultMetadata & Http["~Metadata"])["response"], import("elysia/types").UnionResponseStatus<
|
|
467
|
-
},
|
|
465
|
+
response: import("elysia/types").UnionResponseStatus<(import("elysia").DefaultMetadata & Http["~Metadata"])["response"], import("elysia/types").UnionResponseStatus<Http["~Ephemeral"]["response"], {}>>;
|
|
466
|
+
}, {} & Http["~Routes"], import("elysia").DefaultEphemeral, {
|
|
468
467
|
derive: {};
|
|
469
468
|
schema: {};
|
|
470
469
|
schemas: {};
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import { Elysia as Elysia3, setupTypebox, Validator as Validator2 } from "elysia";
|
|
3
3
|
import { PendingWorkRegistry as PendingWorkRegistry2, PendingWorkTimeoutError, PendingWorkCapacityError } from "@supacloud/app/runtime";
|
|
4
|
-
import { commandFailureMetadata as
|
|
4
|
+
import { commandFailureMetadata as commandFailureMetadata3, decodeCommandPreview } from "@supacloud/contracts";
|
|
5
5
|
|
|
6
6
|
// src/command-errors.ts
|
|
7
7
|
function commandErrorCode(error) {
|
|
@@ -84,15 +84,15 @@ function httpRequestId(request) {
|
|
|
84
84
|
}
|
|
85
85
|
function createHttpTelemetry(observe) {
|
|
86
86
|
const starts = new WeakMap;
|
|
87
|
-
return new Elysia().
|
|
87
|
+
return new Elysia().onRequest(({ request, set }) => {
|
|
88
88
|
const supplied = request.headers.get("x-request-id");
|
|
89
89
|
const requestId = supplied && /^[A-Za-z0-9._:-]{1,128}$/.test(supplied) ? supplied : crypto.randomUUID();
|
|
90
90
|
starts.set(request, { time: performance.now(), requestId });
|
|
91
91
|
requestIds.set(request, requestId);
|
|
92
92
|
set.headers["x-request-id"] = requestId;
|
|
93
|
-
}).
|
|
93
|
+
}).onError(() => {
|
|
94
94
|
return;
|
|
95
|
-
}).
|
|
95
|
+
}).onAfterResponse(async ({ request, responseValue: response, set, route }) => {
|
|
96
96
|
const start = starts.get(request);
|
|
97
97
|
if (!start)
|
|
98
98
|
return;
|
|
@@ -861,7 +861,7 @@ function registerElysiaRoute(app, route) {
|
|
|
861
861
|
}
|
|
862
862
|
return value;
|
|
863
863
|
};
|
|
864
|
-
app.method(route.method, route.path, toElysiaRouteSchema(route.contract), handler);
|
|
864
|
+
app.method(route.method, route.path, { ...toElysiaRouteSchema(route.contract) }, handler);
|
|
865
865
|
return app;
|
|
866
866
|
}
|
|
867
867
|
|
|
@@ -1149,6 +1149,89 @@ function createPersistentCommandAdapter(command, options) {
|
|
|
1149
1149
|
}
|
|
1150
1150
|
};
|
|
1151
1151
|
}
|
|
1152
|
+
// src/transactional-command.ts
|
|
1153
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
1154
|
+
import { createTransactionalCommand } from "@supacloud/commands";
|
|
1155
|
+
import {
|
|
1156
|
+
CommandError as CommandError2,
|
|
1157
|
+
commandFailureMetadata as commandFailureMetadata2,
|
|
1158
|
+
decodeCommandIdentity as decodeCommandIdentity2
|
|
1159
|
+
} from "@supacloud/contracts";
|
|
1160
|
+
function createTransactionalCommandGovernance(options) {
|
|
1161
|
+
const { definition, permission, identity, input, rejection } = options;
|
|
1162
|
+
const { name, audit } = definition;
|
|
1163
|
+
if (!permission.trim())
|
|
1164
|
+
throw new TypeError("Command permission is required");
|
|
1165
|
+
const calls = new AsyncLocalStorage;
|
|
1166
|
+
function current(invocation) {
|
|
1167
|
+
const call = calls.getStore();
|
|
1168
|
+
if (!call?.active || call.transaction === undefined || invocation !== undefined && call.invocation !== invocation) {
|
|
1169
|
+
throw new Error("Command transaction is not active for this invocation");
|
|
1170
|
+
}
|
|
1171
|
+
return { ...call, transaction: call.transaction };
|
|
1172
|
+
}
|
|
1173
|
+
function assertBinding(invocation) {
|
|
1174
|
+
const command = invocation.command;
|
|
1175
|
+
if (command.name !== name || command.permission !== permission || command.audit !== audit.event || command.transaction !== "required" || command.idempotency !== "required" || command.rpc !== undefined) {
|
|
1176
|
+
throw new ApplicationError("Unsupported transactional command", { status: 501, code: "COMMAND_BINDING_MISMATCH" });
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
const command = createTransactionalCommand({
|
|
1180
|
+
...definition,
|
|
1181
|
+
async execute(transaction) {
|
|
1182
|
+
const call = calls.getStore();
|
|
1183
|
+
if (!call || call.active)
|
|
1184
|
+
throw new Error("Command continuation is not available");
|
|
1185
|
+
call.transaction = transaction;
|
|
1186
|
+
call.active = true;
|
|
1187
|
+
try {
|
|
1188
|
+
return await call.next();
|
|
1189
|
+
} catch (error) {
|
|
1190
|
+
throw rejection?.(error) ?? error;
|
|
1191
|
+
} finally {
|
|
1192
|
+
call.active = false;
|
|
1193
|
+
call.transaction = undefined;
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
});
|
|
1197
|
+
return {
|
|
1198
|
+
transaction: () => current().transaction,
|
|
1199
|
+
governance: {
|
|
1200
|
+
async authorize(invocation) {
|
|
1201
|
+
assertBinding(invocation);
|
|
1202
|
+
decodeCommandIdentity2(await identity(invocation));
|
|
1203
|
+
},
|
|
1204
|
+
async idempotency(invocation, next) {
|
|
1205
|
+
assertBinding(invocation);
|
|
1206
|
+
try {
|
|
1207
|
+
const actor = decodeCommandIdentity2(await identity(invocation));
|
|
1208
|
+
const key = requireIdempotencyKey(invocation);
|
|
1209
|
+
const value = input(invocation);
|
|
1210
|
+
const receipt = await calls.run({ invocation, next, active: false }, () => command.execute(actor, key, value, invocation.request.signal));
|
|
1211
|
+
if (receipt.status !== "confirmed")
|
|
1212
|
+
throw new CommandError2("COMMAND_OUTCOME_UNKNOWN");
|
|
1213
|
+
return receipt.result;
|
|
1214
|
+
} catch (error) {
|
|
1215
|
+
const code = commandErrorCode(error);
|
|
1216
|
+
if (!code)
|
|
1217
|
+
throw error;
|
|
1218
|
+
throw new ApplicationError(code, {
|
|
1219
|
+
code,
|
|
1220
|
+
status: commandErrorStatus(code),
|
|
1221
|
+
metadata: commandFailureMetadata2(code)
|
|
1222
|
+
});
|
|
1223
|
+
}
|
|
1224
|
+
},
|
|
1225
|
+
transaction(invocation, next) {
|
|
1226
|
+
current(invocation);
|
|
1227
|
+
return next();
|
|
1228
|
+
},
|
|
1229
|
+
audit: { succeeded(invocation) {
|
|
1230
|
+
current(invocation);
|
|
1231
|
+
}, failed() {} }
|
|
1232
|
+
}
|
|
1233
|
+
};
|
|
1234
|
+
}
|
|
1152
1235
|
// src/framework.ts
|
|
1153
1236
|
function createSupaCloudFramework(options) {
|
|
1154
1237
|
return createApplication({
|
|
@@ -1174,7 +1257,7 @@ function assertFeatureTransition(spec, state, event) {
|
|
|
1174
1257
|
return transition.to;
|
|
1175
1258
|
}
|
|
1176
1259
|
// src/memory.ts
|
|
1177
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
1260
|
+
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
1178
1261
|
|
|
1179
1262
|
// src/memory_policy.ts
|
|
1180
1263
|
function createMemoryPolicy() {
|
|
@@ -1249,7 +1332,7 @@ function stableStringify(value) {
|
|
|
1249
1332
|
class DefaultMemoryDatabase {
|
|
1250
1333
|
tables = new Map;
|
|
1251
1334
|
version = 0;
|
|
1252
|
-
current = new
|
|
1335
|
+
current = new AsyncLocalStorage2;
|
|
1253
1336
|
get(table, key) {
|
|
1254
1337
|
if (this.current.getStore())
|
|
1255
1338
|
return this.current.getStore()?.get(table, key);
|
|
@@ -2492,7 +2575,7 @@ function createModulePlugin(compiled, services, ctxFactory = defaultRequestConte
|
|
|
2492
2575
|
});
|
|
2493
2576
|
const createRequestScope = compiled.createRequestScope;
|
|
2494
2577
|
const requestScopes = new WeakMap;
|
|
2495
|
-
plugin.
|
|
2578
|
+
plugin.onAfterResponse(async ({ request }) => {
|
|
2496
2579
|
const scope = requestScopes.get(request);
|
|
2497
2580
|
requestScopes.delete(request);
|
|
2498
2581
|
try {
|
|
@@ -2514,9 +2597,9 @@ function createModulePlugin(compiled, services, ctxFactory = defaultRequestConte
|
|
|
2514
2597
|
const mapped = await options.errorMapper?.(error, context);
|
|
2515
2598
|
return mapped ?? defaultErrorResponse(error, frameworkCode);
|
|
2516
2599
|
};
|
|
2517
|
-
plugin.
|
|
2518
|
-
plugin.
|
|
2519
|
-
plugin.
|
|
2600
|
+
plugin.onError(ApplicationError, ({ error, request }) => mapError(error, frameworkErrorCode(error), request));
|
|
2601
|
+
plugin.onError(SchemaContractError, ({ error, request }) => mapError(error, frameworkErrorCode(error), request));
|
|
2602
|
+
plugin.onError(({ error, request }) => mapError(error, frameworkErrorCode(error), request));
|
|
2520
2603
|
const routeRegistrar = plugin;
|
|
2521
2604
|
for (const controller of compiled.controllers) {
|
|
2522
2605
|
for (const route of controller.routes) {
|
|
@@ -2565,7 +2648,7 @@ function createModulePlugin(compiled, services, ctxFactory = defaultRequestConte
|
|
|
2565
2648
|
requestContext: requestContexts.get(context.request),
|
|
2566
2649
|
response,
|
|
2567
2650
|
encodeResponse: async (value) => {
|
|
2568
|
-
const validator = responseValidators?.
|
|
2651
|
+
const validator = responseValidators?.get(responseStatusOf(value, context.set.status));
|
|
2569
2652
|
if (!validator)
|
|
2570
2653
|
return value;
|
|
2571
2654
|
if (!("EncodeFrom" in validator) || typeof validator.EncodeFrom !== "function") {
|
|
@@ -2774,7 +2857,7 @@ function defaultErrorResponse(error, frameworkCode) {
|
|
|
2774
2857
|
ok: false,
|
|
2775
2858
|
code: protocolCode,
|
|
2776
2859
|
message: protocolCode,
|
|
2777
|
-
metadata:
|
|
2860
|
+
metadata: commandFailureMetadata3(protocolCode)
|
|
2778
2861
|
}, {
|
|
2779
2862
|
status: commandErrorStatus(protocolCode)
|
|
2780
2863
|
});
|
|
@@ -2966,6 +3049,7 @@ export {
|
|
|
2966
3049
|
createSupaCloudFramework,
|
|
2967
3050
|
createSupaCloudRequestContext,
|
|
2968
3051
|
createTestApp,
|
|
3052
|
+
createTransactionalCommandGovernance,
|
|
2969
3053
|
createWorker,
|
|
2970
3054
|
defaultErrorResponse,
|
|
2971
3055
|
defineElysiaRoute,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type PersistentCommandDefinition } from "@supacloud/commands";
|
|
2
|
+
import { CommandError, type CommandIdentity } from "@supacloud/contracts";
|
|
3
|
+
import { type CommandGovernance, type CommandInvocation } from "./index";
|
|
4
|
+
export interface TransactionalCommandGovernanceOptions<Input, Result, Transaction> {
|
|
5
|
+
definition: PersistentCommandDefinition<Input, Result, Transaction>;
|
|
6
|
+
permission: string;
|
|
7
|
+
/** The host must verify identity and project ownership, never use body fields. */
|
|
8
|
+
identity(invocation: CommandInvocation): CommandIdentity | Promise<CommandIdentity>;
|
|
9
|
+
input(invocation: CommandInvocation): unknown;
|
|
10
|
+
/** Translate only known domain rejections; unknown failures stay outcome-unknown. */
|
|
11
|
+
rejection?(error: unknown): CommandError | undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Adapts a local compiled Command to the existing durable executor. The handler,
|
|
15
|
+
* receipt and authoritative audit share one transaction; no second store exists.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createTransactionalCommandGovernance<Input, Result, Transaction>(options: TransactionalCommandGovernanceOptions<Input, Result, Transaction>): {
|
|
18
|
+
governance: CommandGovernance;
|
|
19
|
+
transaction(): Transaction;
|
|
20
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supacloud/elysia",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "Elysia runtime adapter for SupaCloud compiled modules: application/request scopes, route registration and validation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"generate:example": "bun src/generate-webhook-example.ts",
|
|
25
25
|
"build": "bun run clean && bun run build:js && bun run build:types",
|
|
26
|
-
"build:js": "bun build src/index.ts --outdir dist --target node --external elysia --external effect --external jose --external @supacloud/app --external @supacloud/db --external @supacloud/contracts",
|
|
26
|
+
"build:js": "bun build src/index.ts --outdir dist --target node --external elysia --external effect --external jose --external @supacloud/app --external @supacloud/db --external @supacloud/contracts --external @supacloud/commands",
|
|
27
27
|
"build:types": "tsc -p tsconfig.json --emitDeclarationOnly",
|
|
28
28
|
"clean": "rm -rf dist",
|
|
29
29
|
"prepublishOnly": "bun run build",
|
|
@@ -49,29 +49,29 @@
|
|
|
49
49
|
"directory": "packages/elysia"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@supacloud/app": "0.27.
|
|
52
|
+
"@supacloud/app": "0.27.1",
|
|
53
|
+
"@supacloud/commands": "0.9.3",
|
|
53
54
|
"@supacloud/contracts": "0.9.0",
|
|
54
|
-
"effect": "4.0.
|
|
55
|
+
"effect": "4.0.5",
|
|
55
56
|
"exact-mirror": "1.2.6",
|
|
56
57
|
"jose": "^6.2.12",
|
|
57
|
-
"typebox": "1.3.
|
|
58
|
+
"typebox": "1.3.37"
|
|
58
59
|
},
|
|
59
60
|
"overrides": {
|
|
60
|
-
"@supacloud/delivery": "0.18.
|
|
61
|
+
"@supacloud/delivery": "0.18.1",
|
|
61
62
|
"@supacloud/contracts": "0.9.0",
|
|
62
|
-
"@supacloud/commands": "0.9.
|
|
63
|
-
"@graphql-tools/utils": "^12.0.
|
|
63
|
+
"@supacloud/commands": "0.9.3",
|
|
64
|
+
"@graphql-tools/utils": "^12.0.4"
|
|
64
65
|
},
|
|
65
66
|
"peerDependencies": {
|
|
66
|
-
"elysia": "2.0.0-beta.
|
|
67
|
+
"elysia": "2.0.0-beta.32"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
|
-
"@supacloud/compiler": "0.46.
|
|
70
|
-
"@supacloud/delivery": "0.18.
|
|
71
|
-
"@supacloud/
|
|
72
|
-
"@supacloud/db": "0.17.0",
|
|
70
|
+
"@supacloud/compiler": "0.46.2",
|
|
71
|
+
"@supacloud/delivery": "0.18.1",
|
|
72
|
+
"@supacloud/db": "0.17.1",
|
|
73
73
|
"@types/bun": "^1.4.3",
|
|
74
|
-
"elysia": "2.0.0-beta.
|
|
74
|
+
"elysia": "2.0.0-beta.32",
|
|
75
75
|
"typescript": "^7.0.2"
|
|
76
76
|
}
|
|
77
77
|
}
|