@ontrails/http 1.0.0-beta.14 → 1.0.0-beta.15
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/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +7 -0
- package/README.md +39 -15
- package/dist/build.d.ts +13 -10
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +20 -17
- package/dist/build.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -9
- package/src/__tests__/build.test.ts +162 -46
- package/src/__tests__/derive.test.ts +31 -0
- package/src/build.ts +54 -36
- package/src/index.ts +2 -2
- package/tsconfig.tests.json +10 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/blaze.d.ts +0 -25
- package/dist/blaze.d.ts.map +0 -1
- package/dist/blaze.js +0 -69
- package/dist/blaze.js.map +0 -1
- package/dist/hono/blaze.d.ts +0 -33
- package/dist/hono/blaze.d.ts.map +0 -1
- package/dist/hono/blaze.js +0 -232
- package/dist/hono/blaze.js.map +0 -1
- package/dist/hono/index.d.ts +0 -2
- package/dist/hono/index.d.ts.map +0 -1
- package/dist/hono/index.js +0 -2
- package/dist/hono/index.js.map +0 -1
- package/dist/hono/trailhead.d.ts +0 -36
- package/dist/hono/trailhead.d.ts.map +0 -1
- package/dist/hono/trailhead.js +0 -222
- package/dist/hono/trailhead.js.map +0 -1
- package/src/hono/__tests__/trailhead.test.ts +0 -527
- package/src/hono/index.ts +0 -1
- package/src/hono/trailhead.ts +0 -340
package/.turbo/turbo-lint.log
CHANGED
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# @ontrails/http
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Framework-agnostic HTTP route derivation for Trails. Pair this package with `@ontrails/hono` when you want the Hono surface connector.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
7
|
```typescript
|
|
8
8
|
import { trail, topo, Result } from '@ontrails/core';
|
|
9
|
-
import {
|
|
9
|
+
import { surface } from '@ontrails/hono';
|
|
10
10
|
import { z } from 'zod';
|
|
11
11
|
|
|
12
12
|
const greet = trail('greet', {
|
|
@@ -16,8 +16,8 @@ const greet = trail('greet', {
|
|
|
16
16
|
blaze: (input) => Result.ok({ message: `Hello, ${input.name}!` }),
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
const
|
|
20
|
-
await
|
|
19
|
+
const graph = topo('myapp', { greet });
|
|
20
|
+
await surface(graph, { port: 3000 });
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
This starts a Hono-based HTTP server. The `greet` trail becomes `GET /greet?name=...` because its `intent` is `'read'`.
|
|
@@ -25,23 +25,22 @@ This starts a Hono-based HTTP server. The `greet` trail becomes `GET /greet?name
|
|
|
25
25
|
For more control, build the routes yourself:
|
|
26
26
|
|
|
27
27
|
```typescript
|
|
28
|
-
import {
|
|
28
|
+
import { deriveHttpRoutes } from '@ontrails/http';
|
|
29
29
|
|
|
30
|
-
const result =
|
|
30
|
+
const result = deriveHttpRoutes(graph);
|
|
31
31
|
if (result.isErr()) throw result.error; // ValidationError on route collision
|
|
32
32
|
for (const route of result.value) {
|
|
33
33
|
console.log(`${route.method} ${route.path} → ${route.trailId}`);
|
|
34
34
|
}
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
`
|
|
37
|
+
`deriveHttpRoutes` returns `Result<HttpRouteDefinition[], Error>` rather than a bare array. It returns `Result.err(ValidationError)` if two trails derive the same `(method, path)` pair.
|
|
38
38
|
|
|
39
39
|
## API
|
|
40
40
|
|
|
41
41
|
| Export | What it does |
|
|
42
42
|
| --- | --- |
|
|
43
|
-
| `
|
|
44
|
-
| `trailhead(app, options?)` (`@ontrails/http/hono`) | Start a Hono HTTP server with all trails as routes |
|
|
43
|
+
| `deriveHttpRoutes(graph, options?)` | Build framework-agnostic route definitions from a topo |
|
|
45
44
|
|
|
46
45
|
## Route derivation
|
|
47
46
|
|
|
@@ -58,11 +57,24 @@ Trail IDs map to paths: `entity.show` becomes `/entity/show`. Dots become slashe
|
|
|
58
57
|
|
|
59
58
|
## Collision detection
|
|
60
59
|
|
|
61
|
-
`
|
|
60
|
+
`deriveHttpRoutes` detects when two trails would produce the same `(method, path)` pair and returns `Result.err(ValidationError)` describing both trail IDs. The `surface()` helper from `@ontrails/hono` throws on collision.
|
|
62
61
|
|
|
63
|
-
##
|
|
62
|
+
## Resource resolution
|
|
64
63
|
|
|
65
|
-
Declared
|
|
64
|
+
Declared resources on each trail are resolved into the context before the implementation runs.
|
|
65
|
+
|
|
66
|
+
## Filtering
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
const result = deriveHttpRoutes(graph, {
|
|
70
|
+
include: ['entity.**'],
|
|
71
|
+
exclude: ['dev.**'],
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`*` matches one dotted segment and `**` matches any depth. Trails declared
|
|
76
|
+
with `visibility: 'internal'` stay hidden unless you include their exact trail
|
|
77
|
+
ID intentionally.
|
|
66
78
|
|
|
67
79
|
## AbortSignal propagation
|
|
68
80
|
|
|
@@ -70,7 +82,7 @@ The `execute` function on each `HttpRouteDefinition` accepts an optional `abortS
|
|
|
70
82
|
|
|
71
83
|
## `HttpRouteDefinition`
|
|
72
84
|
|
|
73
|
-
Each route definition produced by `
|
|
85
|
+
Each route definition produced by `deriveHttpRoutes` includes:
|
|
74
86
|
|
|
75
87
|
| Field | Type | What it is |
|
|
76
88
|
| --- | --- | --- |
|
|
@@ -79,10 +91,22 @@ Each route definition produced by `buildHttpRoutes` includes:
|
|
|
79
91
|
| `trailId` | `string` | The trail ID this route was derived from |
|
|
80
92
|
| `inputSource` | `'query' \| 'body'` | Where to read input |
|
|
81
93
|
| `trail` | `Trail` | The original trail definition |
|
|
82
|
-
| `execute` | `(input, requestId?, abortSignal?) => Promise<Result>` | Validates,
|
|
94
|
+
| `execute` | `(input, requestId?, abortSignal?) => Promise<Result>` | Validates, layers, and runs the implementation |
|
|
95
|
+
|
|
96
|
+
For GET routes on the Hono surface, repeated query keys are passed through as
|
|
97
|
+
arrays (`?tag=one&tag=two` -> `{ tag: ['one', 'two'] }`) while a single
|
|
98
|
+
occurrence stays a scalar string. The connector does not coerce singleton query
|
|
99
|
+
values into arrays.
|
|
83
100
|
|
|
84
101
|
## Installation
|
|
85
102
|
|
|
86
103
|
```bash
|
|
87
|
-
bun add @ontrails/http hono
|
|
104
|
+
bun add @ontrails/http @ontrails/hono
|
|
88
105
|
```
|
|
106
|
+
|
|
107
|
+
## Migration
|
|
108
|
+
|
|
109
|
+
Hono integration now lives in `@ontrails/hono`.
|
|
110
|
+
|
|
111
|
+
- Replace `import { trailhead } from '@ontrails/http/hono'` with `import { surface } from '@ontrails/hono'`
|
|
112
|
+
- Keep `deriveHttpRoutes()` and the route model imports on `@ontrails/http`
|
package/dist/build.d.ts
CHANGED
|
@@ -2,18 +2,21 @@
|
|
|
2
2
|
* Build framework-agnostic HTTP route definitions from a Trails topo.
|
|
3
3
|
*
|
|
4
4
|
* Each route definition describes the path, method, input source, and an
|
|
5
|
-
* `execute` function that validates input, composes
|
|
5
|
+
* `execute` function that validates input, composes layers, and runs the
|
|
6
6
|
* implementation -- all without referencing any HTTP framework types.
|
|
7
7
|
*/
|
|
8
8
|
import { Result } from '@ontrails/core';
|
|
9
|
-
import type {
|
|
10
|
-
export interface
|
|
9
|
+
import type { Intent, Layer, ResourceOverrideMap, Topo, Trail, TrailContextInit } from '@ontrails/core';
|
|
10
|
+
export interface DeriveHttpRoutesOptions {
|
|
11
11
|
readonly basePath?: string | undefined;
|
|
12
|
-
/** Config values for
|
|
12
|
+
/** Config values for resources that declare a `config` schema, keyed by resource ID. */
|
|
13
13
|
readonly configValues?: Readonly<Record<string, Record<string, unknown>>> | undefined;
|
|
14
14
|
readonly createContext?: (() => TrailContextInit | Promise<TrailContextInit>) | undefined;
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
15
|
+
readonly exclude?: readonly string[] | undefined;
|
|
16
|
+
readonly include?: readonly string[] | undefined;
|
|
17
|
+
readonly intent?: readonly Intent[] | undefined;
|
|
18
|
+
readonly layers?: readonly Layer[] | undefined;
|
|
19
|
+
readonly resources?: ResourceOverrideMap | undefined;
|
|
17
20
|
/** Set to `false` to skip topo validation while building routes. */
|
|
18
21
|
readonly validate?: boolean | undefined;
|
|
19
22
|
}
|
|
@@ -25,9 +28,9 @@ export interface HttpRouteDefinition {
|
|
|
25
28
|
readonly path: string;
|
|
26
29
|
readonly trailId: string;
|
|
27
30
|
readonly inputSource: InputSource;
|
|
28
|
-
readonly trail: Trail<unknown, unknown>;
|
|
31
|
+
readonly trail: Trail<unknown, unknown, unknown>;
|
|
29
32
|
/**
|
|
30
|
-
* Validate input, compose
|
|
33
|
+
* Validate input, compose layers, and execute the trail implementation.
|
|
31
34
|
*
|
|
32
35
|
* The caller is responsible for parsing raw input from the request and
|
|
33
36
|
* mapping the Result to an HTTP response. This function is framework-agnostic.
|
|
@@ -45,10 +48,10 @@ export interface HttpRouteDefinition {
|
|
|
45
48
|
* - An HTTP method derived from intent (read -> GET, write -> POST, destroy -> DELETE)
|
|
46
49
|
* - A path derived from the trail ID (dots become slashes)
|
|
47
50
|
* - An input source derived from the method (GET -> query, others -> body)
|
|
48
|
-
* - An `execute` function that validates,
|
|
51
|
+
* - An `execute` function that validates, layers, and runs the implementation
|
|
49
52
|
*
|
|
50
53
|
* Returns `Result.err(ValidationError)` if two trails derive the same
|
|
51
54
|
* (method, path) pair. Returns `Result.ok(routes)` on success.
|
|
52
55
|
*/
|
|
53
|
-
export declare const
|
|
56
|
+
export declare const deriveHttpRoutes: (graph: Topo, options?: DeriveHttpRoutesOptions) => Result<HttpRouteDefinition[], Error>;
|
|
54
57
|
//# sourceMappingURL=build.d.ts.map
|
package/dist/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,MAAM,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,MAAM,EAMP,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,MAAM,EACN,KAAK,EACL,mBAAmB,EACnB,IAAI,EACJ,KAAK,EACL,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAMxB,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,wFAAwF;IACxF,QAAQ,CAAC,YAAY,CAAC,EAClB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GACjD,SAAS,CAAC;IACd,QAAQ,CAAC,aAAa,CAAC,EACnB,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,GACpD,SAAS,CAAC;IACd,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IACjD,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IACjD,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAChD,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,KAAK,EAAE,GAAG,SAAS,CAAC;IAC/C,QAAQ,CAAC,SAAS,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACrD,oEAAoE;IACpE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACzC;AAED,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEnD,iDAAiD;AACjD,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACjD;;;;;;;;;OASG;IACH,QAAQ,CAAC,OAAO,EAAE,CAChB,KAAK,EAAE,OAAO,EACd,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,EAC9B,WAAW,CAAC,EAAE,WAAW,GAAG,SAAS,KAClC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;CACtC;AA2JD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,IAAI,EACX,UAAS,uBAA4B,KACpC,MAAM,CAAC,mBAAmB,EAAE,EAAE,KAAK,CAiBrC,CAAC"}
|
package/dist/build.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Build framework-agnostic HTTP route definitions from a Trails topo.
|
|
3
3
|
*
|
|
4
4
|
* Each route definition describes the path, method, input source, and an
|
|
5
|
-
* `execute` function that validates input, composes
|
|
5
|
+
* `execute` function that validates input, composes layers, and runs the
|
|
6
6
|
* implementation -- all without referencing any HTTP framework types.
|
|
7
7
|
*/
|
|
8
|
-
import { Result, TRAILHEAD_KEY, ValidationError, executeTrail, validateEstablishedTopo, } from '@ontrails/core';
|
|
8
|
+
import { Result, TRAILHEAD_KEY, ValidationError, executeTrail, filterSurfaceTrails, validateEstablishedTopo, } from '@ontrails/core';
|
|
9
9
|
// ---------------------------------------------------------------------------
|
|
10
10
|
// Internal helpers
|
|
11
11
|
// ---------------------------------------------------------------------------
|
|
@@ -25,8 +25,6 @@ const derivePath = (basePath, trailId) => {
|
|
|
25
25
|
};
|
|
26
26
|
/** Derive input source from HTTP method. */
|
|
27
27
|
const deriveInputSource = (method) => method === 'GET' ? 'query' : 'body';
|
|
28
|
-
/** Check if a trail should be included (skip internal trails). */
|
|
29
|
-
const shouldInclude = (trail) => trail.meta?.['internal'] !== true;
|
|
30
28
|
/** Build per-request context overrides with the HTTP trailhead marker. */
|
|
31
29
|
const withHttpTrailhead = (requestId) => ({
|
|
32
30
|
...(requestId === undefined ? {} : { requestId }),
|
|
@@ -43,25 +41,30 @@ const withHttpTrailhead = (requestId) => ({
|
|
|
43
41
|
* Delegates to the centralized `executeTrail` pipeline in core.
|
|
44
42
|
* The returned function returns a `Result` and never throws.
|
|
45
43
|
*/
|
|
46
|
-
const createExecute = (t,
|
|
44
|
+
const createExecute = (graph, t, layers, options) => (input, requestId, abortSignal) => executeTrail(t, input, {
|
|
47
45
|
abortSignal,
|
|
48
46
|
configValues: options.configValues,
|
|
49
47
|
createContext: options.createContext,
|
|
50
48
|
ctx: withHttpTrailhead(requestId),
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
layers,
|
|
50
|
+
resources: options.resources,
|
|
51
|
+
topo: graph,
|
|
53
52
|
});
|
|
54
53
|
// ---------------------------------------------------------------------------
|
|
55
54
|
// Builder helpers
|
|
56
55
|
// ---------------------------------------------------------------------------
|
|
57
56
|
/** Filter topo items to eligible trails. */
|
|
58
|
-
const eligibleTrails = (
|
|
57
|
+
const eligibleTrails = (graph, options) => filterSurfaceTrails(graph.list(), {
|
|
58
|
+
exclude: options.exclude,
|
|
59
|
+
include: options.include,
|
|
60
|
+
intent: options.intent,
|
|
61
|
+
});
|
|
59
62
|
/** Build a single route definition from a trail. */
|
|
60
|
-
const buildRoute = (trail, basePath,
|
|
63
|
+
const buildRoute = (graph, trail, basePath, layers, options) => {
|
|
61
64
|
const method = deriveMethod(trail);
|
|
62
65
|
const path = derivePath(basePath, trail.id);
|
|
63
66
|
return {
|
|
64
|
-
execute: createExecute(trail,
|
|
67
|
+
execute: createExecute(graph, trail, layers, options),
|
|
65
68
|
inputSource: deriveInputSource(method),
|
|
66
69
|
method,
|
|
67
70
|
path,
|
|
@@ -86,11 +89,11 @@ const registerRoute = (route, seenRoutes, routes) => {
|
|
|
86
89
|
return Result.ok();
|
|
87
90
|
};
|
|
88
91
|
/** Accumulate route definitions, returning early on the first collision. */
|
|
89
|
-
const accumulateRoutes = (trails, basePath,
|
|
92
|
+
const accumulateRoutes = (graph, trails, basePath, layers, options) => {
|
|
90
93
|
const routes = [];
|
|
91
94
|
const seenRoutes = new Map();
|
|
92
95
|
for (const trail of trails) {
|
|
93
|
-
const route = buildRoute(trail, basePath,
|
|
96
|
+
const route = buildRoute(graph, trail, basePath, layers, options);
|
|
94
97
|
const registered = registerRoute(route, seenRoutes, routes);
|
|
95
98
|
if (registered.isErr()) {
|
|
96
99
|
return registered;
|
|
@@ -108,20 +111,20 @@ const accumulateRoutes = (trails, basePath, gates, options) => {
|
|
|
108
111
|
* - An HTTP method derived from intent (read -> GET, write -> POST, destroy -> DELETE)
|
|
109
112
|
* - A path derived from the trail ID (dots become slashes)
|
|
110
113
|
* - An input source derived from the method (GET -> query, others -> body)
|
|
111
|
-
* - An `execute` function that validates,
|
|
114
|
+
* - An `execute` function that validates, layers, and runs the implementation
|
|
112
115
|
*
|
|
113
116
|
* Returns `Result.err(ValidationError)` if two trails derive the same
|
|
114
117
|
* (method, path) pair. Returns `Result.ok(routes)` on success.
|
|
115
118
|
*/
|
|
116
|
-
export const
|
|
119
|
+
export const deriveHttpRoutes = (graph, options = {}) => {
|
|
117
120
|
if (options.validate !== false) {
|
|
118
|
-
const validated = validateEstablishedTopo(
|
|
121
|
+
const validated = validateEstablishedTopo(graph);
|
|
119
122
|
if (validated.isErr()) {
|
|
120
123
|
return Result.err(validated.error);
|
|
121
124
|
}
|
|
122
125
|
}
|
|
123
126
|
const basePath = (options.basePath ?? '').replace(/\/+$/, '');
|
|
124
|
-
const
|
|
125
|
-
return accumulateRoutes(eligibleTrails(
|
|
127
|
+
const layers = options.layers ?? [];
|
|
128
|
+
return accumulateRoutes(graph, eligibleTrails(graph, options), basePath, layers, options);
|
|
126
129
|
};
|
|
127
130
|
//# sourceMappingURL=build.js.map
|
package/dist/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,MAAM,EACN,aAAa,EACb,eAAe,EACf,YAAY,EACZ,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,MAAM,EACN,aAAa,EACb,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AA4DxB,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,6CAA6C;AAC7C,MAAM,cAAc,GAA+B;IACjD,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,4CAA4C;AAC5C,MAAM,YAAY,GAAG,CAAC,KAAuC,EAAc,EAAE,CAC3E,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC;AAEzC,uEAAuE;AACvE,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAE,OAAe,EAAU,EAAE;IAC/D,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CA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E,CAAC;IACpC,OAAO,gBAAgB,CACrB,KAAK,EACL,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,EAC9B,QAAQ,EACR,MAAM,EACN,OAAO,CACR,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { deriveHttpRoutes, type DeriveHttpRoutesOptions, type HttpMethod, type HttpRouteDefinition, type InputSource, } from './build.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,EACL,gBAAgB,GAKjB,MAAM,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ontrails/http",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./src/index.ts",
|
|
7
|
-
"./hono": "./src/hono/index.ts",
|
|
8
7
|
"./package.json": "./package.json"
|
|
9
8
|
},
|
|
10
9
|
"scripts": {
|
|
@@ -15,15 +14,9 @@
|
|
|
15
14
|
"clean": "rm -rf dist *.tsbuildinfo"
|
|
16
15
|
},
|
|
17
16
|
"dependencies": {
|
|
18
|
-
"@ontrails/core": "^1.0.0-beta.
|
|
17
|
+
"@ontrails/core": "^1.0.0-beta.14"
|
|
19
18
|
},
|
|
20
19
|
"peerDependencies": {
|
|
21
|
-
"hono": "^4.7.0",
|
|
22
20
|
"zod": "^4.3.5"
|
|
23
|
-
},
|
|
24
|
-
"peerDependenciesMeta": {
|
|
25
|
-
"hono": {
|
|
26
|
-
"optional": true
|
|
27
|
-
}
|
|
28
21
|
}
|
|
29
22
|
}
|