@veloxts/router 0.7.9 → 0.8.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/types.d.ts CHANGED
@@ -349,17 +349,16 @@ export interface CompiledProcedure<TInput = unknown, TOutput = unknown, TContext
349
349
  /**
350
350
  * Resource schema for auto-projection
351
351
  *
352
- * When set via `.expose()`, the procedure executor will automatically
353
- * project the handler's return value based on `ctx.__accessLevel`.
352
+ * When set via `.output()` with a tagged resource view, the procedure
353
+ * executor will automatically project the handler's return value based
354
+ * on the tagged level.
354
355
  *
355
- * This enables the elegant chained API:
356
356
  * ```typescript
357
357
  * procedure()
358
- * .guardNarrow(authenticatedNarrow)
359
- * .expose(UserSchema)
358
+ * .output(UserSchema.authenticated)
360
359
  * .query(async ({ ctx }) => {
361
360
  * return ctx.db.user.findUnique(...);
362
- * // Auto-projected based on __accessLevel
361
+ * // Auto-projected to authenticated fields
363
362
  * });
364
363
  * ```
365
364
  *
@@ -369,12 +368,21 @@ export interface CompiledProcedure<TInput = unknown, TOutput = unknown, TContext
369
368
  /**
370
369
  * Explicit resource projection level from tagged schema
371
370
  *
372
- * Set when using `.expose(UserSchema.authenticated)` etc.
373
- * Takes precedence over guard-derived access level.
371
+ * Set when using `.output(UserSchema.authenticated)` etc.
374
372
  *
375
373
  * @internal
376
374
  */
377
375
  readonly _resourceLevel?: string;
376
+ /**
377
+ * Handler map for Level 3 branched procedures
378
+ *
379
+ * When set, the procedure has per-access-level handlers keyed by
380
+ * `__velox_level_{levelName}` strings. The executor evaluates guards
381
+ * most-privileged-first to select the correct branch.
382
+ *
383
+ * @internal
384
+ */
385
+ readonly _handlerMap?: Readonly<Record<string, ProcedureHandler<TInput, TOutput, TContext>>>;
378
386
  }
379
387
  /**
380
388
  * Record of named procedures
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veloxts/router",
3
- "version": "0.7.9",
3
+ "version": "0.8.0",
4
4
  "description": "Procedure definitions with tRPC and REST routing for VeloxTS framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -39,8 +39,8 @@
39
39
  "dependencies": {
40
40
  "@trpc/server": "11.10.0",
41
41
  "fastify": "5.7.4",
42
- "@veloxts/core": "0.7.9",
43
- "@veloxts/validation": "0.7.9"
42
+ "@veloxts/validation": "0.8.0",
43
+ "@veloxts/core": "0.8.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@vitest/coverage-v8": "4.0.18",