@voyant-travel/hono 0.111.0 → 0.112.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/app.d.ts +8 -1
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +8 -1
- package/dist/create-app.d.ts +36 -0
- package/dist/create-app.d.ts.map +1 -0
- package/dist/create-app.js +23 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/package.json +5 -5
package/dist/app.d.ts
CHANGED
|
@@ -36,7 +36,14 @@ export interface VoyantAppExtensions<TBindings = unknown> {
|
|
|
36
36
|
*/
|
|
37
37
|
eventBus: import("@voyant-travel/core").EventBus;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Low-level app factory: given an already-resolved `modules`/`extensions` set
|
|
41
|
+
* (plus middleware config), build the Hono app. Most deployments use the
|
|
42
|
+
* config-driven `createApp` (see `create-app.ts`), which derives the modules
|
|
43
|
+
* from a manifest + registry + capabilities and delegates here. Use `mountApp`
|
|
44
|
+
* directly only when you have the resolved set in hand (tests, advanced hosts).
|
|
45
|
+
*/
|
|
46
|
+
export declare function mountApp<TBindings extends VoyantBindings>(config: VoyantAppConfig<TBindings>): Hono<{
|
|
40
47
|
Bindings: TBindings;
|
|
41
48
|
Variables: VoyantVariables;
|
|
42
49
|
}> & VoyantAppExtensions<TBindings>;
|
package/dist/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AA6B3B,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAY,eAAe,EAAE,MAAM,YAAY,CAAA;AA2C5F;;;;;;;;;;GAUG;AACH,MAAM,WAAW,mBAAmB,CAAC,SAAS,GAAG,OAAO;IACtD;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1C;;;;;;;;OAQG;IACH,QAAQ,EAAE,OAAO,qBAAqB,EAAE,QAAQ,CAAA;CACjD;AAED,wBAAgB,
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AA6B3B,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAY,eAAe,EAAE,MAAM,YAAY,CAAA;AA2C5F;;;;;;;;;;GAUG;AACH,MAAM,WAAW,mBAAmB,CAAC,SAAS,GAAG,OAAO;IACtD;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1C;;;;;;;;OAQG;IACH,QAAQ,EAAE,OAAO,qBAAqB,EAAE,QAAQ,CAAA;CACjD;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,SAAS,SAAS,cAAc,EACvD,MAAM,EAAE,eAAe,CAAC,SAAS,CAAC,GACjC,IAAI,CAAC;IAAE,QAAQ,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,eAAe,CAAA;CAAE,CAAC,GAAG,mBAAmB,CAAC,SAAS,CAAC,CA6a5F"}
|
package/dist/app.js
CHANGED
|
@@ -42,7 +42,14 @@ function buildRateLimitPolicy(config, env, bucket, defaults) {
|
|
|
42
42
|
store: resolveConfiguredRateLimitStore(config, env) ?? resolveRateLimitStore({ env }),
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Low-level app factory: given an already-resolved `modules`/`extensions` set
|
|
47
|
+
* (plus middleware config), build the Hono app. Most deployments use the
|
|
48
|
+
* config-driven `createApp` (see `create-app.ts`), which derives the modules
|
|
49
|
+
* from a manifest + registry + capabilities and delegates here. Use `mountApp`
|
|
50
|
+
* directly only when you have the resolved set in hand (tests, advanced hosts).
|
|
51
|
+
*/
|
|
52
|
+
export function mountApp(config) {
|
|
46
53
|
const app = new Hono();
|
|
47
54
|
app.onError(handleApiError);
|
|
48
55
|
// Expand plugins into their constituent modules/extensions before mounting
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type CompositionManifest, type CompositionRegistry } from "./composition.js";
|
|
2
|
+
import type { VoyantAppConfig, VoyantBindings } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Config-driven app config: the manifest + registry + capabilities replace the
|
|
5
|
+
* resolved `modules`/`extensions` of {@link VoyantAppConfig}. Everything else
|
|
6
|
+
* (db surfaces, auth, plugins, publicPaths, …) is unchanged.
|
|
7
|
+
*/
|
|
8
|
+
export interface CreateAppConfig<TBindings extends VoyantBindings, TCapabilities> extends Omit<VoyantAppConfig<TBindings>, "modules" | "extensions"> {
|
|
9
|
+
/** Ordered module/extension manifest. */
|
|
10
|
+
manifest: CompositionManifest;
|
|
11
|
+
/** Maps each manifest entry to its factory. */
|
|
12
|
+
registry: CompositionRegistry<TCapabilities>;
|
|
13
|
+
/** Deployment capabilities passed to every registry factory. */
|
|
14
|
+
capabilities: TCapabilities;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The low-level config-driven front door. Derives the module/extension set from
|
|
18
|
+
* an explicit manifest + registry + capabilities, then mounts the app — instead
|
|
19
|
+
* of `composeFromManifest(...)` followed by `mountApp(...)`:
|
|
20
|
+
*
|
|
21
|
+
* export const app = createApp<CloudflareBindings, Providers>({
|
|
22
|
+
* manifest: runtimeManifest,
|
|
23
|
+
* registry: composition,
|
|
24
|
+
* capabilities: buildProviders(),
|
|
25
|
+
* db, auth, plugins, ...
|
|
26
|
+
* })
|
|
27
|
+
*
|
|
28
|
+
* Standard deployments usually call `@voyant-travel/framework`'s higher-level
|
|
29
|
+
* `createVoyantApp({ providers, modules })` (which assembles the framework-owned
|
|
30
|
+
* manifest + registry for you and delegates here) rather than this directly.
|
|
31
|
+
*/
|
|
32
|
+
export declare function createApp<TBindings extends VoyantBindings, TCapabilities>(config: CreateAppConfig<TBindings, TCapabilities>): import("hono").Hono<{
|
|
33
|
+
Bindings: TBindings;
|
|
34
|
+
Variables: import("./types.js").VoyantVariables;
|
|
35
|
+
}, import("hono/types").BlankSchema, "/"> & import("./app.js").VoyantAppExtensions<TBindings>;
|
|
36
|
+
//# sourceMappingURL=create-app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../src/create-app.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAEzB,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEjE;;;;GAIG;AACH,MAAM,WAAW,eAAe,CAAC,SAAS,SAAS,cAAc,EAAE,aAAa,CAC9E,SAAQ,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,YAAY,CAAC;IAClE,yCAAyC;IACzC,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,+CAA+C;IAC/C,QAAQ,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAA;IAC5C,gEAAgE;IAChE,YAAY,EAAE,aAAa,CAAA;CAC5B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,SAAS,SAAS,cAAc,EAAE,aAAa,EACvE,MAAM,EAAE,eAAe,CAAC,SAAS,EAAE,aAAa,CAAC;;;8FAKlD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { mountApp } from "./app.js";
|
|
2
|
+
import { composeFromManifest, } from "./composition.js";
|
|
3
|
+
/**
|
|
4
|
+
* The low-level config-driven front door. Derives the module/extension set from
|
|
5
|
+
* an explicit manifest + registry + capabilities, then mounts the app — instead
|
|
6
|
+
* of `composeFromManifest(...)` followed by `mountApp(...)`:
|
|
7
|
+
*
|
|
8
|
+
* export const app = createApp<CloudflareBindings, Providers>({
|
|
9
|
+
* manifest: runtimeManifest,
|
|
10
|
+
* registry: composition,
|
|
11
|
+
* capabilities: buildProviders(),
|
|
12
|
+
* db, auth, plugins, ...
|
|
13
|
+
* })
|
|
14
|
+
*
|
|
15
|
+
* Standard deployments usually call `@voyant-travel/framework`'s higher-level
|
|
16
|
+
* `createVoyantApp({ providers, modules })` (which assembles the framework-owned
|
|
17
|
+
* manifest + registry for you and delegates here) rather than this directly.
|
|
18
|
+
*/
|
|
19
|
+
export function createApp(config) {
|
|
20
|
+
const { manifest, registry, capabilities, ...rest } = config;
|
|
21
|
+
const { modules, extensions } = composeFromManifest(manifest, registry, capabilities);
|
|
22
|
+
return mountApp({ ...rest, modules, extensions });
|
|
23
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export type { VoyantPermission } from "@voyant-travel/core";
|
|
2
|
-
export {
|
|
2
|
+
export { mountApp } from "./app.js";
|
|
3
3
|
export type { SessionAuthContext } from "./auth/index.js";
|
|
4
4
|
export { constantTimeEqual, extractBearerToken, generateNumericCode, randomBytesHex, requireUserId, sha256Base64Url, sha256Hex, unsignCookie, verifySession, } from "./auth/index.js";
|
|
5
|
+
export { type CreateAppConfig, createApp } from "./create-app.js";
|
|
5
6
|
export type { DocumentDownloadEnvelope, DocumentDownloadResolution, DocumentDownloadResolver, DocumentDownloadResolverResult, StoredDocumentReference, } from "./document-download.js";
|
|
6
7
|
export { resolveStoredDocumentDownload } from "./document-download.js";
|
|
7
8
|
export { createLazyRouteHandler, type LazyHonoRoutes, type LazyRoutesLoader, mountLazyRoutePaths, mountLazyRoutesAt, } from "./lazy-routes.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mapp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,EACnB,mBAAmB,EACnB,UAAU,EACV,UAAU,GACX,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,6BAA6B,EAC7B,6BAA6B,EAC7B,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,+BAA+B,EAC/B,2BAA2B,GAC5B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,KAAK,iCAAiC,EACtC,6CAA6C,EAC7C,iCAAiC,EACjC,sCAAsC,EACtC,kCAAkC,EAClC,KAAK,mCAAmC,EACxC,KAAK,8BAA8B,EACnC,KAAK,2BAA2B,EAChC,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EACrC,KAAK,kCAAkC,EACvC,KAAK,4BAA4B,EACjC,KAAK,sCAAsC,EAC3C,kCAAkC,EAClC,iCAAiC,GAClC,MAAM,+BAA+B,CAAA;AACtC,YAAY,EACV,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,cAAc,EACd,QAAQ,EACR,sBAAsB,EACtB,kBAAkB,EAClB,wBAAwB,EACxB,eAAe,GAChB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,wBAAwB,EACxB,aAAa,EACb,qBAAqB,EACrB,UAAU,EACV,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,iBAAiB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { mountApp } from "./app.js";
|
|
2
2
|
export { constantTimeEqual, extractBearerToken, generateNumericCode, randomBytesHex, requireUserId, sha256Base64Url, sha256Hex, unsignCookie, verifySession, } from "./auth/index.js";
|
|
3
|
+
export { createApp } from "./create-app.js";
|
|
3
4
|
export { resolveStoredDocumentDownload } from "./document-download.js";
|
|
4
5
|
export { createLazyRouteHandler, mountLazyRoutePaths, mountLazyRoutesAt, } from "./lazy-routes.js";
|
|
5
6
|
export { createPathDbSelector } from "./lib/db-selector.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/hono",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.112.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -119,19 +119,19 @@
|
|
|
119
119
|
"drizzle-orm": "^0.45.2",
|
|
120
120
|
"hono": "^4.12.10",
|
|
121
121
|
"zod": "^4.3.6",
|
|
122
|
-
"@voyant-travel/core": "^0.
|
|
123
|
-
"@voyant-travel/db": "^0.108.
|
|
122
|
+
"@voyant-travel/core": "^0.110.0",
|
|
123
|
+
"@voyant-travel/db": "^0.108.2",
|
|
124
124
|
"@voyant-travel/storage": "^0.105.0",
|
|
125
125
|
"@voyant-travel/types": "^0.104.5",
|
|
126
126
|
"@voyant-travel/utils": "^0.105.2",
|
|
127
|
-
"@voyant-travel/workflows": "^0.109.
|
|
127
|
+
"@voyant-travel/workflows": "^0.109.4"
|
|
128
128
|
},
|
|
129
129
|
"devDependencies": {
|
|
130
130
|
"@cloudflare/workers-types": "^4.20260426.1",
|
|
131
131
|
"typescript": "^6.0.2",
|
|
132
132
|
"vitest": "^4.1.2",
|
|
133
133
|
"@voyant-travel/voyant-typescript-config": "^0.1.0",
|
|
134
|
-
"@voyant-travel/workflows-orchestrator": "^0.109.
|
|
134
|
+
"@voyant-travel/workflows-orchestrator": "^0.109.4"
|
|
135
135
|
},
|
|
136
136
|
"files": [
|
|
137
137
|
"dist"
|