@supacloud/elysia 0.42.3 → 0.42.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.
package/README.md CHANGED
@@ -48,11 +48,11 @@ The manifest describes static declarations; host options can add lifecycle hooks
48
48
  or select the request pipeline. Native Elysia macros supplied by the host are
49
49
  not inferred from application declarations.
50
50
 
51
- The Elysia peer and development dependency are pinned to `2.0.0-rc.1`.
51
+ The Elysia peer and development dependency are pinned to `2.0.0-rc.4`.
52
52
  The runtime adapter pins Effect `4.0.5` and consumes its `Exit`-based
53
53
  execution boundary.
54
54
  `compatibility.json` records the acceptance target: Bun 1.4.4, Elysia
55
- 2.0.0-rc.1, Effect 4.0.5, `typebox` 1.4.3, `exact-mirror` 1.2.6,
55
+ 2.0.0-rc.4, Effect 4.0.5, `typebox` 1.4.3, `exact-mirror` 1.2.7,
56
56
  TypeScript CLI 7.0.2 and the compiler's separate TypeScript 6 semantic API 6.0.2.
57
57
  The matrix is a
58
58
  required target, not proof of an execution. See the dated, commit-specific
@@ -405,7 +405,7 @@ Runtime adapter that turns `@supacloud/compiler` output into a production-ready
405
405
  ## Installation
406
406
 
407
407
  ```bash
408
- bun add --exact @supacloud/elysia elysia@2.0.0-rc.1
408
+ bun add --exact @supacloud/elysia elysia@2.0.0-rc.4
409
409
  ```
410
410
 
411
411
  ## Usage
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "bun": "1.4.4",
3
3
  "packages": {
4
- "elysia": "2.0.0-rc.3",
4
+ "elysia": "2.0.0-rc.4",
5
5
  "effect": "4.0.5",
6
6
  "typescript": "7.1.0-beta",
7
7
  "typebox": "1.4.3",
package/dist/bun-aot.js CHANGED
@@ -1023,11 +1023,13 @@ var DEFAULT_EFFECT_RETRY = "none";
1023
1023
  class EffectApplicationError extends Error {
1024
1024
  status;
1025
1025
  code;
1026
+ details;
1026
1027
  expose = true;
1027
- constructor(message, status, code) {
1028
+ constructor(message, status, code, details) {
1028
1029
  super(message);
1029
1030
  this.status = status;
1030
1031
  this.code = code;
1032
+ this.details = details;
1031
1033
  this.name = "EffectApplicationError";
1032
1034
  }
1033
1035
  }
@@ -1091,7 +1093,7 @@ function mapEffectFailure(error, descriptor) {
1091
1093
  const instanceCode = mapping.codeFromError ? boundedString(error, "code", 120) : undefined;
1092
1094
  const instanceMessage = mapping.messageFromError ? boundedString(error, "message", 500) : undefined;
1093
1095
  const instanceStatus = mapping.statusFromError ? boundedStatus(error) : undefined;
1094
- return new EffectApplicationError(instanceMessage ?? mapping.message ?? mapping.code, instanceStatus ?? mapping.status, instanceCode ?? mapping.code);
1096
+ return new EffectApplicationError(instanceMessage ?? mapping.message ?? mapping.code, instanceStatus ?? mapping.status, instanceCode ?? mapping.code, isRecord(error) && "details" in error ? error.details : undefined);
1095
1097
  }
1096
1098
  if (tag === "TimeoutException" || tag === "TimeoutError") {
1097
1099
  return new EffectApplicationError("Effect execution timed out", 504, "EFFECT_TIMEOUT");
@@ -2819,6 +2821,7 @@ function createModulePlugin(compiled, services, ctxFactory = defaultRequestConte
2819
2821
  "schemaKinds",
2820
2822
  "nativeResponse",
2821
2823
  "invoker",
2824
+ "effectMode",
2822
2825
  "effect",
2823
2826
  "directInvoker",
2824
2827
  "directInvokerFast",
@@ -3001,7 +3004,6 @@ function createModulePlugin(compiled, services, ctxFactory = defaultRequestConte
3001
3004
  const command = route.command ? commandsByClassName.get(route.command) : undefined;
3002
3005
  const commandPipeline = route.command ? descriptorPipeline(command ?? {}, "command", options.onExecution) : undefined;
3003
3006
  const routeHasAspects = compiled.aspectPipeline !== undefined || (compiled.aspects?.length ?? 0) > 0 || route.aspectPipeline !== undefined || (route.aspects?.length ?? 0) > 0 || command?.aspectPipeline !== undefined || (command?.aspects?.length ?? 0) > 0;
3004
- const routeInvoker = route.invoker;
3005
3007
  if (mappingPolicies.length > 0) {
3006
3008
  const responseValidators = Validator2.response(schema.response, { normalize: options.normalize ?? true });
3007
3009
  Object.assign(schema, {
package/dist/effect.d.ts CHANGED
@@ -37,8 +37,9 @@ export interface SupaCloudEffectRuntime {
37
37
  export declare class EffectApplicationError extends Error {
38
38
  readonly status: number;
39
39
  readonly code: string;
40
+ readonly details?: unknown;
40
41
  readonly expose: true;
41
- constructor(message: string, status: number, code: string);
42
+ constructor(message: string, status: number, code: string, details?: unknown);
42
43
  }
43
44
  export declare function createDefaultEffectRuntime(): SupaCloudEffectRuntime;
44
45
  export declare function createEffectRuntimeFromLayer<Services>(layer: Layer.Layer<Services, never, never>): SupaCloudEffectRuntime;
@@ -139,6 +139,15 @@ export interface CompiledModule {
139
139
  }
140
140
  type CompiledAspectObserver = (stage: string, run: () => unknown | Promise<unknown>) => unknown | Promise<unknown>;
141
141
  type CompiledAspectPipeline = (context: CompiledAspectContext, next: () => unknown | Promise<unknown>, observe?: CompiledAspectObserver) => unknown | Promise<unknown>;
142
+ export declare function compiledAspectStep(context: CompiledAspectContext, handler: () => unknown | Promise<unknown>, run: (next: () => Promise<unknown>) => unknown | Promise<unknown>): Promise<unknown>;
143
+ export declare function observeCompiledAspect(observe: CompiledAspectObserver | undefined, stage: string, run: () => unknown | Promise<unknown>): unknown | Promise<unknown>;
144
+ export declare function resolveFactoryValue(value: unknown): unknown;
145
+ type CompiledServiceLifecycleEntry = {
146
+ key: string;
147
+ index?: number;
148
+ };
149
+ export declare function initializeServiceInstances(services: Record<string, unknown>, plan: readonly CompiledServiceLifecycleEntry[]): Promise<void>;
150
+ export declare function destroyServiceInstances(services: Record<string, unknown>, plan: readonly CompiledServiceLifecycleEntry[]): Promise<void>;
142
151
  export type CompiledApplicationModule = Omit<CompiledModule, "name" | "createServices"> & ({
143
152
  name: "webhook";
144
153
  createServices: typeof createWebhookServices;
package/dist/index.js CHANGED
@@ -1023,11 +1023,13 @@ var DEFAULT_EFFECT_RETRY = "none";
1023
1023
  class EffectApplicationError extends Error {
1024
1024
  status;
1025
1025
  code;
1026
+ details;
1026
1027
  expose = true;
1027
- constructor(message, status, code) {
1028
+ constructor(message, status, code, details) {
1028
1029
  super(message);
1029
1030
  this.status = status;
1030
1031
  this.code = code;
1032
+ this.details = details;
1031
1033
  this.name = "EffectApplicationError";
1032
1034
  }
1033
1035
  }
@@ -1091,7 +1093,7 @@ function mapEffectFailure(error, descriptor) {
1091
1093
  const instanceCode = mapping.codeFromError ? boundedString(error, "code", 120) : undefined;
1092
1094
  const instanceMessage = mapping.messageFromError ? boundedString(error, "message", 500) : undefined;
1093
1095
  const instanceStatus = mapping.statusFromError ? boundedStatus(error) : undefined;
1094
- return new EffectApplicationError(instanceMessage ?? mapping.message ?? mapping.code, instanceStatus ?? mapping.status, instanceCode ?? mapping.code);
1096
+ return new EffectApplicationError(instanceMessage ?? mapping.message ?? mapping.code, instanceStatus ?? mapping.status, instanceCode ?? mapping.code, isRecord(error) && "details" in error ? error.details : undefined);
1095
1097
  }
1096
1098
  if (tag === "TimeoutException" || tag === "TimeoutError") {
1097
1099
  return new EffectApplicationError("Effect execution timed out", 504, "EFFECT_TIMEOUT");
@@ -2819,6 +2821,7 @@ function createModulePlugin(compiled, services, ctxFactory = defaultRequestConte
2819
2821
  "schemaKinds",
2820
2822
  "nativeResponse",
2821
2823
  "invoker",
2824
+ "effectMode",
2822
2825
  "effect",
2823
2826
  "directInvoker",
2824
2827
  "directInvokerFast",
@@ -3001,7 +3004,6 @@ function createModulePlugin(compiled, services, ctxFactory = defaultRequestConte
3001
3004
  const command = route.command ? commandsByClassName.get(route.command) : undefined;
3002
3005
  const commandPipeline = route.command ? descriptorPipeline(command ?? {}, "command", options.onExecution) : undefined;
3003
3006
  const routeHasAspects = compiled.aspectPipeline !== undefined || (compiled.aspects?.length ?? 0) > 0 || route.aspectPipeline !== undefined || (route.aspects?.length ?? 0) > 0 || command?.aspectPipeline !== undefined || (command?.aspects?.length ?? 0) > 0;
3004
- const routeInvoker = route.invoker;
3005
3007
  if (mappingPolicies.length > 0) {
3006
3008
  const responseValidators = Validator2.response(schema.response, { normalize: options.normalize ?? true });
3007
3009
  Object.assign(schema, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/elysia",
3
- "version": "0.42.3",
3
+ "version": "0.42.5",
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",
@@ -54,31 +54,31 @@
54
54
  "directory": "packages/elysia"
55
55
  },
56
56
  "dependencies": {
57
- "@supacloud/app": "0.39.2",
57
+ "@supacloud/app": "0.39.4",
58
58
  "@supacloud/commands": "0.12.0",
59
- "@supacloud/contracts": "0.16.1",
59
+ "@supacloud/contracts": "0.16.2",
60
60
  "effect": "4.0.5",
61
61
  "exact-mirror": "1.2.7",
62
62
  "jose": "^6.2.13",
63
63
  "typebox": "1.4.3"
64
64
  },
65
65
  "overrides": {
66
- "@supacloud/delivery": "0.27.0",
67
- "@supacloud/contracts": "0.16.1",
66
+ "@supacloud/delivery": "0.28.0",
67
+ "@supacloud/contracts": "0.16.2",
68
68
  "@supacloud/commands": "0.12.0",
69
69
  "@graphql-tools/utils": "^12.0.4",
70
70
  "deepmerge-ts": "8.0.2",
71
71
  "prisma": "6.19.3"
72
72
  },
73
73
  "peerDependencies": {
74
- "elysia": "2.0.0-rc.3"
74
+ "elysia": "2.0.0-rc.4"
75
75
  },
76
76
  "devDependencies": {
77
- "@supacloud/compiler": "0.62.3",
78
- "@supacloud/delivery": "0.27.0",
79
- "@supacloud/db": "0.24.2",
77
+ "@supacloud/compiler": "0.62.7",
78
+ "@supacloud/delivery": "0.28.0",
79
+ "@supacloud/db": "0.25.1",
80
80
  "@types/bun": "^1.4.4",
81
- "elysia": "2.0.0-rc.3",
81
+ "elysia": "2.0.0-rc.4",
82
82
  "typescript": "7.1.0-beta"
83
83
  }
84
84
  }