@withbuddi/buddi 0.1.0-pre.38 → 0.1.0-pre.39
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/extension/background.js +635 -21
- package/extension/manifest.json +2 -2
- package/node_modules/@buddi/cli/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/cli/dist/access-cmd.d.ts +1 -1
- package/node_modules/@buddi/cli/dist/access-cmd.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/access-cmd.js +23 -3
- package/node_modules/@buddi/cli/dist/access-cmd.js.map +1 -1
- package/node_modules/@buddi/cli/dist/args.d.ts +2 -2
- package/node_modules/@buddi/cli/dist/args.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/args.js +7 -2
- package/node_modules/@buddi/cli/dist/args.js.map +1 -1
- package/node_modules/@buddi/cli/dist/commands.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/commands.js +11 -0
- package/node_modules/@buddi/cli/dist/commands.js.map +1 -1
- package/node_modules/@buddi/cli/dist/main.d.ts.map +1 -1
- package/node_modules/@buddi/cli/dist/main.js +2 -1
- package/node_modules/@buddi/cli/dist/main.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/gateway/dist/missions/ask-cap.d.ts +26 -0
- package/node_modules/@buddi/gateway/dist/missions/ask-cap.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/missions/ask-cap.js +83 -0
- package/node_modules/@buddi/gateway/dist/missions/ask-cap.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/missions/execute.d.ts +12 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.js +73 -11
- package/node_modules/@buddi/gateway/dist/missions/execute.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/parked.d.ts +6 -0
- package/node_modules/@buddi/gateway/dist/missions/parked.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/parked.js +7 -1
- package/node_modules/@buddi/gateway/dist/missions/parked.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/serve.js +1 -1
- package/node_modules/@buddi/gateway/dist/serve.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/system-context.d.ts +7 -0
- package/node_modules/@buddi/gateway/dist/system-context.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/system-context.js +8 -0
- package/node_modules/@buddi/gateway/dist/system-context.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/api-routes.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/api-routes.js +11 -3
- package/node_modules/@buddi/gateway/dist/web/api-routes.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/extension.d.ts +13 -1
- package/node_modules/@buddi/gateway/dist/web/extension.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/extension.js +125 -5
- package/node_modules/@buddi/gateway/dist/web/extension.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/remote-hand.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/remote-hand.js +45 -2
- package/node_modules/@buddi/gateway/dist/web/remote-hand.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/secrets.d.ts +26 -1
- package/node_modules/@buddi/gateway/dist/web/secrets.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/secrets.js +66 -3
- package/node_modules/@buddi/gateway/dist/web/secrets.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/server.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/server.js +63 -7
- package/node_modules/@buddi/gateway/dist/web/server.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/version.d.ts +2 -0
- package/node_modules/@buddi/gateway/dist/web/version.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/version.js +5 -1
- package/node_modules/@buddi/gateway/dist/web/version.js.map +1 -1
- package/node_modules/@buddi/install/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/install/dist/app-layout.d.ts +127 -0
- package/node_modules/@buddi/install/dist/app-layout.d.ts.map +1 -0
- package/node_modules/@buddi/install/dist/app-layout.js +323 -0
- package/node_modules/@buddi/install/dist/app-layout.js.map +1 -0
- package/node_modules/@buddi/install/dist/index.d.ts +1 -0
- package/node_modules/@buddi/install/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/index.js +1 -0
- package/node_modules/@buddi/install/dist/index.js.map +1 -1
- package/node_modules/@buddi/install/dist/launcher.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/launcher.js +18 -4
- package/node_modules/@buddi/install/dist/launcher.js.map +1 -1
- package/node_modules/@buddi/install/dist/provenance.d.ts +34 -0
- package/node_modules/@buddi/install/dist/provenance.d.ts.map +1 -0
- package/node_modules/@buddi/install/dist/provenance.js +200 -0
- package/node_modules/@buddi/install/dist/provenance.js.map +1 -0
- package/node_modules/@buddi/install/dist/supervisor.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/supervisor.js +9 -4
- package/node_modules/@buddi/install/dist/supervisor.js.map +1 -1
- package/node_modules/@buddi/install/dist/upgrade.d.ts +77 -3
- package/node_modules/@buddi/install/dist/upgrade.d.ts.map +1 -1
- package/node_modules/@buddi/install/dist/upgrade.js +325 -43
- package/node_modules/@buddi/install/dist/upgrade.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-browser/dist/controller.d.ts +6 -0
- package/node_modules/@buddi/tool-browser/dist/controller.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/controller.js +80 -6
- package/node_modules/@buddi/tool-browser/dist/controller.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/driver.d.ts +3 -1
- package/node_modules/@buddi/tool-browser/dist/driver.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/driver.js +82 -1
- package/node_modules/@buddi/tool-browser/dist/driver.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/extension.d.ts +60 -7
- package/node_modules/@buddi/tool-browser/dist/extension.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/extension.js +90 -13
- package/node_modules/@buddi/tool-browser/dist/extension.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.d.ts +6 -4
- package/node_modules/@buddi/tool-browser/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.js +7 -4
- package/node_modules/@buddi/tool-browser/dist/index.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/logins.d.ts +150 -0
- package/node_modules/@buddi/tool-browser/dist/logins.d.ts.map +1 -0
- package/node_modules/@buddi/tool-browser/dist/logins.js +476 -0
- package/node_modules/@buddi/tool-browser/dist/logins.js.map +1 -0
- package/node_modules/@buddi/tool-browser/dist/routes.d.ts +22 -1
- package/node_modules/@buddi/tool-browser/dist/routes.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/routes.js +51 -3
- package/node_modules/@buddi/tool-browser/dist/routes.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/secrets.d.ts +3 -1
- package/node_modules/@buddi/tool-browser/dist/secrets.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/secrets.js +10 -6
- package/node_modules/@buddi/tool-browser/dist/secrets.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/service.d.ts +26 -2
- package/node_modules/@buddi/tool-browser/dist/service.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/service.js +117 -3
- package/node_modules/@buddi/tool-browser/dist/service.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/types.d.ts +88 -0
- package/node_modules/@buddi/tool-browser/dist/types.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/types.js +18 -0
- package/node_modules/@buddi/tool-browser/dist/types.js.map +1 -1
- package/node_modules/hono/dist/cjs/hono-base.js +2 -0
- package/node_modules/hono/dist/cjs/middleware/language/language.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/mount/index.js +71 -0
- package/node_modules/hono/dist/cjs/request.js +4 -4
- package/node_modules/hono/dist/hono-base.js +2 -0
- package/node_modules/hono/dist/middleware/mount/index.js +70 -0
- package/node_modules/hono/dist/request.js +4 -4
- package/node_modules/hono/dist/types/hono-base.d.ts +2 -0
- package/node_modules/hono/dist/types/jsx/base.d.ts +1 -1
- package/node_modules/hono/dist/types/middleware/mount/index.d.ts +46 -0
- package/node_modules/hono/dist/types/request.d.ts +4 -4
- package/node_modules/hono/package.json +9 -1
- package/package.json +2 -2
- package/packages/cli/dist/.tsbuildinfo +1 -1
- package/packages/cli/dist/access-cmd.d.ts +1 -1
- package/packages/cli/dist/access-cmd.d.ts.map +1 -1
- package/packages/cli/dist/access-cmd.js +23 -3
- package/packages/cli/dist/access-cmd.js.map +1 -1
- package/packages/cli/dist/args.d.ts +2 -2
- package/packages/cli/dist/args.d.ts.map +1 -1
- package/packages/cli/dist/args.js +7 -2
- package/packages/cli/dist/args.js.map +1 -1
- package/packages/cli/dist/commands.d.ts.map +1 -1
- package/packages/cli/dist/commands.js +11 -0
- package/packages/cli/dist/commands.js.map +1 -1
- package/packages/cli/dist/main.d.ts.map +1 -1
- package/packages/cli/dist/main.js +2 -1
- package/packages/cli/dist/main.js.map +1 -1
- package/packages/gateway/dist/.tsbuildinfo +1 -1
- package/packages/gateway/dist/missions/ask-cap.d.ts +26 -0
- package/packages/gateway/dist/missions/ask-cap.d.ts.map +1 -0
- package/packages/gateway/dist/missions/ask-cap.js +83 -0
- package/packages/gateway/dist/missions/ask-cap.js.map +1 -0
- package/packages/gateway/dist/missions/execute.d.ts +12 -1
- package/packages/gateway/dist/missions/execute.d.ts.map +1 -1
- package/packages/gateway/dist/missions/execute.js +73 -11
- package/packages/gateway/dist/missions/execute.js.map +1 -1
- package/packages/gateway/dist/missions/parked.d.ts +6 -0
- package/packages/gateway/dist/missions/parked.d.ts.map +1 -1
- package/packages/gateway/dist/missions/parked.js +7 -1
- package/packages/gateway/dist/missions/parked.js.map +1 -1
- package/packages/gateway/dist/serve.js +1 -1
- package/packages/gateway/dist/serve.js.map +1 -1
- package/packages/gateway/dist/system-context.d.ts +7 -0
- package/packages/gateway/dist/system-context.d.ts.map +1 -1
- package/packages/gateway/dist/system-context.js +8 -0
- package/packages/gateway/dist/system-context.js.map +1 -1
- package/packages/gateway/dist/web/api-routes.d.ts.map +1 -1
- package/packages/gateway/dist/web/api-routes.js +11 -3
- package/packages/gateway/dist/web/api-routes.js.map +1 -1
- package/packages/gateway/dist/web/extension.d.ts +13 -1
- package/packages/gateway/dist/web/extension.d.ts.map +1 -1
- package/packages/gateway/dist/web/extension.js +125 -5
- package/packages/gateway/dist/web/extension.js.map +1 -1
- package/packages/gateway/dist/web/remote-hand.d.ts.map +1 -1
- package/packages/gateway/dist/web/remote-hand.js +45 -2
- package/packages/gateway/dist/web/remote-hand.js.map +1 -1
- package/packages/gateway/dist/web/secrets.d.ts +26 -1
- package/packages/gateway/dist/web/secrets.d.ts.map +1 -1
- package/packages/gateway/dist/web/secrets.js +66 -3
- package/packages/gateway/dist/web/secrets.js.map +1 -1
- package/packages/gateway/dist/web/server.d.ts.map +1 -1
- package/packages/gateway/dist/web/server.js +63 -7
- package/packages/gateway/dist/web/server.js.map +1 -1
- package/packages/gateway/dist/web/version.d.ts +2 -0
- package/packages/gateway/dist/web/version.d.ts.map +1 -1
- package/packages/gateway/dist/web/version.js +5 -1
- package/packages/gateway/dist/web/version.js.map +1 -1
- package/packages/install/dist/.tsbuildinfo +1 -1
- package/packages/install/dist/app-layout.d.ts +127 -0
- package/packages/install/dist/app-layout.d.ts.map +1 -0
- package/packages/install/dist/app-layout.js +323 -0
- package/packages/install/dist/app-layout.js.map +1 -0
- package/packages/install/dist/index.d.ts +1 -0
- package/packages/install/dist/index.d.ts.map +1 -1
- package/packages/install/dist/index.js +1 -0
- package/packages/install/dist/index.js.map +1 -1
- package/packages/install/dist/launcher.d.ts.map +1 -1
- package/packages/install/dist/launcher.js +18 -4
- package/packages/install/dist/launcher.js.map +1 -1
- package/packages/install/dist/provenance.d.ts +34 -0
- package/packages/install/dist/provenance.d.ts.map +1 -0
- package/packages/install/dist/provenance.js +200 -0
- package/packages/install/dist/provenance.js.map +1 -0
- package/packages/install/dist/supervisor.d.ts.map +1 -1
- package/packages/install/dist/supervisor.js +9 -4
- package/packages/install/dist/supervisor.js.map +1 -1
- package/packages/install/dist/upgrade.d.ts +77 -3
- package/packages/install/dist/upgrade.d.ts.map +1 -1
- package/packages/install/dist/upgrade.js +325 -43
- package/packages/install/dist/upgrade.js.map +1 -1
- package/packages/tools/browser/dist/.tsbuildinfo +1 -1
- package/packages/tools/browser/dist/controller.d.ts +6 -0
- package/packages/tools/browser/dist/controller.d.ts.map +1 -1
- package/packages/tools/browser/dist/controller.js +80 -6
- package/packages/tools/browser/dist/controller.js.map +1 -1
- package/packages/tools/browser/dist/driver.d.ts +3 -1
- package/packages/tools/browser/dist/driver.d.ts.map +1 -1
- package/packages/tools/browser/dist/driver.js +82 -1
- package/packages/tools/browser/dist/driver.js.map +1 -1
- package/packages/tools/browser/dist/extension.d.ts +60 -7
- package/packages/tools/browser/dist/extension.d.ts.map +1 -1
- package/packages/tools/browser/dist/extension.js +90 -13
- package/packages/tools/browser/dist/extension.js.map +1 -1
- package/packages/tools/browser/dist/index.d.ts +6 -4
- package/packages/tools/browser/dist/index.d.ts.map +1 -1
- package/packages/tools/browser/dist/index.js +7 -4
- package/packages/tools/browser/dist/index.js.map +1 -1
- package/packages/tools/browser/dist/logins.d.ts +150 -0
- package/packages/tools/browser/dist/logins.d.ts.map +1 -0
- package/packages/tools/browser/dist/logins.js +476 -0
- package/packages/tools/browser/dist/logins.js.map +1 -0
- package/packages/tools/browser/dist/routes.d.ts +22 -1
- package/packages/tools/browser/dist/routes.d.ts.map +1 -1
- package/packages/tools/browser/dist/routes.js +51 -3
- package/packages/tools/browser/dist/routes.js.map +1 -1
- package/packages/tools/browser/dist/secrets.d.ts +3 -1
- package/packages/tools/browser/dist/secrets.d.ts.map +1 -1
- package/packages/tools/browser/dist/secrets.js +10 -6
- package/packages/tools/browser/dist/secrets.js.map +1 -1
- package/packages/tools/browser/dist/service.d.ts +26 -2
- package/packages/tools/browser/dist/service.d.ts.map +1 -1
- package/packages/tools/browser/dist/service.js +117 -3
- package/packages/tools/browser/dist/service.js.map +1 -1
- package/packages/tools/browser/dist/types.d.ts +88 -0
- package/packages/tools/browser/dist/types.d.ts.map +1 -1
- package/packages/tools/browser/dist/types.js +18 -0
- package/packages/tools/browser/dist/types.js.map +1 -1
- package/packages/web/dist/assets/index-DYfeUW-0.css +1 -0
- package/packages/web/dist/assets/index-vpc904_b.js +146 -0
- package/packages/web/dist/assets/{lottie_light-CuiSMqnl.js → lottie_light-BFAMYgLA.js} +1 -1
- package/packages/web/dist/build.json +1 -1
- package/packages/web/dist/index.html +2 -2
- package/packages/web/dist/precache.json +4 -4
- package/packages/web/dist/assets/index-Bac-CdD-.css +0 -1
- package/packages/web/dist/assets/index-DI8bp_D7.js +0 -146
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_helper_route_index = require("../../helper/route/index.js");
|
|
3
|
+
//#region src/middleware/mount/index.ts
|
|
4
|
+
const defaultReplaceRequest = (c) => {
|
|
5
|
+
const pathPrefix = require_helper_route_index.routePath(c).replace(/\/\*$/, "");
|
|
6
|
+
const url = new URL(c.req.raw.url);
|
|
7
|
+
url.pathname = c.req.path.slice(pathPrefix.length) || "/";
|
|
8
|
+
return new Request(url, c.req.raw);
|
|
9
|
+
};
|
|
10
|
+
const defaultGetOptions = (c) => {
|
|
11
|
+
let executionContext = void 0;
|
|
12
|
+
try {
|
|
13
|
+
executionContext = c.executionCtx;
|
|
14
|
+
} catch {}
|
|
15
|
+
return [c.env, executionContext];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* `mount()` allows you to mount applications built with other frameworks into your Hono application.
|
|
19
|
+
*
|
|
20
|
+
* @see {@link https://hono.dev/docs/api/hono#mount}
|
|
21
|
+
*
|
|
22
|
+
* @param {Function} applicationHandler - other Request Handler
|
|
23
|
+
* @param {MountOptions} [options] - options of `mount()`
|
|
24
|
+
* @returns {MiddlewareHandler} handler to register with `app.all()`
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { Router as IttyRouter } from 'itty-router'
|
|
29
|
+
* import { Hono } from 'hono'
|
|
30
|
+
* import { mount } from 'hono/mount'
|
|
31
|
+
* // Create itty-router application
|
|
32
|
+
* const ittyRouter = IttyRouter()
|
|
33
|
+
* // GET /itty-router/hello
|
|
34
|
+
* ittyRouter.get('/hello', () => new Response('Hello from itty-router'))
|
|
35
|
+
*
|
|
36
|
+
* const app = new Hono()
|
|
37
|
+
* app.all('/itty-router/*', mount(ittyRouter.handle))
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const app = new Hono()
|
|
43
|
+
* // Send the request to another application without modification.
|
|
44
|
+
* app.all('/app/*', mount(anotherApp, {
|
|
45
|
+
* replaceRequest: (req) => req,
|
|
46
|
+
* }))
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
const mount = (applicationHandler, options) => {
|
|
50
|
+
let replaceRequest;
|
|
51
|
+
let optionHandler;
|
|
52
|
+
if (options) {
|
|
53
|
+
if (typeof options === "function") optionHandler = options;
|
|
54
|
+
else {
|
|
55
|
+
optionHandler = options.optionHandler;
|
|
56
|
+
if (options.replaceRequest === false) replaceRequest = (request) => request;
|
|
57
|
+
else replaceRequest = options.replaceRequest;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const getOptions = optionHandler ? (c) => {
|
|
61
|
+
const options = optionHandler(c);
|
|
62
|
+
return Array.isArray(options) ? options : [options];
|
|
63
|
+
} : defaultGetOptions;
|
|
64
|
+
return async (c, next) => {
|
|
65
|
+
const res = await applicationHandler(replaceRequest ? replaceRequest(c.req.raw) : defaultReplaceRequest(c), ...getOptions(c));
|
|
66
|
+
if (res) return res;
|
|
67
|
+
await next();
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
//#endregion
|
|
71
|
+
exports.mount = mount;
|
|
@@ -189,7 +189,7 @@ var HonoRequest = class {
|
|
|
189
189
|
return this.#validatedData?.[target];
|
|
190
190
|
}
|
|
191
191
|
/**
|
|
192
|
-
* `.url
|
|
192
|
+
* `.url` can get the request url strings.
|
|
193
193
|
*
|
|
194
194
|
* @see {@link https://hono.dev/docs/api/request#url}
|
|
195
195
|
*
|
|
@@ -205,7 +205,7 @@ var HonoRequest = class {
|
|
|
205
205
|
return this.raw.url;
|
|
206
206
|
}
|
|
207
207
|
/**
|
|
208
|
-
* `.method
|
|
208
|
+
* `.method` can get the method name of the request.
|
|
209
209
|
*
|
|
210
210
|
* @see {@link https://hono.dev/docs/api/request#method}
|
|
211
211
|
*
|
|
@@ -223,7 +223,7 @@ var HonoRequest = class {
|
|
|
223
223
|
return this.#matchResult;
|
|
224
224
|
}
|
|
225
225
|
/**
|
|
226
|
-
* `.matchedRoutes
|
|
226
|
+
* `.matchedRoutes` can return a matched route in the handler
|
|
227
227
|
*
|
|
228
228
|
* @deprecated
|
|
229
229
|
*
|
|
@@ -253,7 +253,7 @@ var HonoRequest = class {
|
|
|
253
253
|
return this.#matchResult[0].map(([[, route]]) => route);
|
|
254
254
|
}
|
|
255
255
|
/**
|
|
256
|
-
*
|
|
256
|
+
* `.routePath` can retrieve the path registered within the handler
|
|
257
257
|
*
|
|
258
258
|
* @deprecated
|
|
259
259
|
*
|
|
@@ -175,6 +175,8 @@ var Hono = class Hono {
|
|
|
175
175
|
/**
|
|
176
176
|
* `.mount()` allows you to mount applications built with other frameworks into your Hono application.
|
|
177
177
|
*
|
|
178
|
+
* @deprecated Use `mount()` from `hono/mount` instead. `.mount()` will be removed in v5.
|
|
179
|
+
*
|
|
178
180
|
* @see {@link https://hono.dev/docs/api/hono#mount}
|
|
179
181
|
*
|
|
180
182
|
* @param {string} path - base Path
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { routePath } from "../../helper/route/index.js";
|
|
2
|
+
//#region src/middleware/mount/index.ts
|
|
3
|
+
const defaultReplaceRequest = (c) => {
|
|
4
|
+
const pathPrefix = routePath(c).replace(/\/\*$/, "");
|
|
5
|
+
const url = new URL(c.req.raw.url);
|
|
6
|
+
url.pathname = c.req.path.slice(pathPrefix.length) || "/";
|
|
7
|
+
return new Request(url, c.req.raw);
|
|
8
|
+
};
|
|
9
|
+
const defaultGetOptions = (c) => {
|
|
10
|
+
let executionContext = void 0;
|
|
11
|
+
try {
|
|
12
|
+
executionContext = c.executionCtx;
|
|
13
|
+
} catch {}
|
|
14
|
+
return [c.env, executionContext];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* `mount()` allows you to mount applications built with other frameworks into your Hono application.
|
|
18
|
+
*
|
|
19
|
+
* @see {@link https://hono.dev/docs/api/hono#mount}
|
|
20
|
+
*
|
|
21
|
+
* @param {Function} applicationHandler - other Request Handler
|
|
22
|
+
* @param {MountOptions} [options] - options of `mount()`
|
|
23
|
+
* @returns {MiddlewareHandler} handler to register with `app.all()`
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* import { Router as IttyRouter } from 'itty-router'
|
|
28
|
+
* import { Hono } from 'hono'
|
|
29
|
+
* import { mount } from 'hono/mount'
|
|
30
|
+
* // Create itty-router application
|
|
31
|
+
* const ittyRouter = IttyRouter()
|
|
32
|
+
* // GET /itty-router/hello
|
|
33
|
+
* ittyRouter.get('/hello', () => new Response('Hello from itty-router'))
|
|
34
|
+
*
|
|
35
|
+
* const app = new Hono()
|
|
36
|
+
* app.all('/itty-router/*', mount(ittyRouter.handle))
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const app = new Hono()
|
|
42
|
+
* // Send the request to another application without modification.
|
|
43
|
+
* app.all('/app/*', mount(anotherApp, {
|
|
44
|
+
* replaceRequest: (req) => req,
|
|
45
|
+
* }))
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
const mount = (applicationHandler, options) => {
|
|
49
|
+
let replaceRequest;
|
|
50
|
+
let optionHandler;
|
|
51
|
+
if (options) {
|
|
52
|
+
if (typeof options === "function") optionHandler = options;
|
|
53
|
+
else {
|
|
54
|
+
optionHandler = options.optionHandler;
|
|
55
|
+
if (options.replaceRequest === false) replaceRequest = (request) => request;
|
|
56
|
+
else replaceRequest = options.replaceRequest;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const getOptions = optionHandler ? (c) => {
|
|
60
|
+
const options = optionHandler(c);
|
|
61
|
+
return Array.isArray(options) ? options : [options];
|
|
62
|
+
} : defaultGetOptions;
|
|
63
|
+
return async (c, next) => {
|
|
64
|
+
const res = await applicationHandler(replaceRequest ? replaceRequest(c.req.raw) : defaultReplaceRequest(c), ...getOptions(c));
|
|
65
|
+
if (res) return res;
|
|
66
|
+
await next();
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
//#endregion
|
|
70
|
+
export { mount };
|
|
@@ -188,7 +188,7 @@ var HonoRequest = class {
|
|
|
188
188
|
return this.#validatedData?.[target];
|
|
189
189
|
}
|
|
190
190
|
/**
|
|
191
|
-
* `.url
|
|
191
|
+
* `.url` can get the request url strings.
|
|
192
192
|
*
|
|
193
193
|
* @see {@link https://hono.dev/docs/api/request#url}
|
|
194
194
|
*
|
|
@@ -204,7 +204,7 @@ var HonoRequest = class {
|
|
|
204
204
|
return this.raw.url;
|
|
205
205
|
}
|
|
206
206
|
/**
|
|
207
|
-
* `.method
|
|
207
|
+
* `.method` can get the method name of the request.
|
|
208
208
|
*
|
|
209
209
|
* @see {@link https://hono.dev/docs/api/request#method}
|
|
210
210
|
*
|
|
@@ -222,7 +222,7 @@ var HonoRequest = class {
|
|
|
222
222
|
return this.#matchResult;
|
|
223
223
|
}
|
|
224
224
|
/**
|
|
225
|
-
* `.matchedRoutes
|
|
225
|
+
* `.matchedRoutes` can return a matched route in the handler
|
|
226
226
|
*
|
|
227
227
|
* @deprecated
|
|
228
228
|
*
|
|
@@ -252,7 +252,7 @@ var HonoRequest = class {
|
|
|
252
252
|
return this.#matchResult[0].map(([[, route]]) => route);
|
|
253
253
|
}
|
|
254
254
|
/**
|
|
255
|
-
*
|
|
255
|
+
* `.routePath` can retrieve the path registered within the handler
|
|
256
256
|
*
|
|
257
257
|
* @deprecated
|
|
258
258
|
*
|
|
@@ -140,6 +140,8 @@ declare class Hono<E extends Env = Env, S extends Schema = {}, BasePath extends
|
|
|
140
140
|
/**
|
|
141
141
|
* `.mount()` allows you to mount applications built with other frameworks into your Hono application.
|
|
142
142
|
*
|
|
143
|
+
* @deprecated Use `mount()` from `hono/mount` instead. `.mount()` will be removed in v5.
|
|
144
|
+
*
|
|
143
145
|
* @see {@link https://hono.dev/docs/api/hono#mount}
|
|
144
146
|
*
|
|
145
147
|
* @param {string} path - base Path
|
|
@@ -4,7 +4,7 @@ import { JSX as JSX$1 } from "./intrinsic-elements.js";
|
|
|
4
4
|
import { Context } from "./context.js";
|
|
5
5
|
//#region src/jsx/base.d.ts
|
|
6
6
|
export type Props = Record<string, any>;
|
|
7
|
-
type FunctionComponentResult = HtmlEscapedString | Child[] | Promise<HtmlEscapedString | Child[]> | null;
|
|
7
|
+
type FunctionComponentResult = HtmlEscapedString | JSXNode | Child[] | Promise<HtmlEscapedString | JSXNode | Child[]> | null;
|
|
8
8
|
export type FC<P = Props> = {
|
|
9
9
|
(props: P): FunctionComponentResult;
|
|
10
10
|
defaultProps?: Partial<P> | undefined;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { MiddlewareHandler } from "../../types.js";
|
|
2
|
+
import { Context } from "../../context.js";
|
|
3
|
+
//#region src/middleware/mount/index.d.ts
|
|
4
|
+
type ApplicationHandler = (request: Request, ...args: any) => Response | Promise<Response>;
|
|
5
|
+
type MountOptionHandler = (c: Context) => unknown;
|
|
6
|
+
type MountReplaceRequest = (originalRequest: Request) => Request;
|
|
7
|
+
type MountOptions = MountOptionHandler | {
|
|
8
|
+
optionHandler?: MountOptionHandler;
|
|
9
|
+
replaceRequest?: MountReplaceRequest | false;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* `mount()` allows you to mount applications built with other frameworks into your Hono application.
|
|
13
|
+
*
|
|
14
|
+
* @see {@link https://hono.dev/docs/api/hono#mount}
|
|
15
|
+
*
|
|
16
|
+
* @param {Function} applicationHandler - other Request Handler
|
|
17
|
+
* @param {MountOptions} [options] - options of `mount()`
|
|
18
|
+
* @returns {MiddlewareHandler} handler to register with `app.all()`
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { Router as IttyRouter } from 'itty-router'
|
|
23
|
+
* import { Hono } from 'hono'
|
|
24
|
+
* import { mount } from 'hono/mount'
|
|
25
|
+
* // Create itty-router application
|
|
26
|
+
* const ittyRouter = IttyRouter()
|
|
27
|
+
* // GET /itty-router/hello
|
|
28
|
+
* ittyRouter.get('/hello', () => new Response('Hello from itty-router'))
|
|
29
|
+
*
|
|
30
|
+
* const app = new Hono()
|
|
31
|
+
* app.all('/itty-router/*', mount(ittyRouter.handle))
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const app = new Hono()
|
|
37
|
+
* // Send the request to another application without modification.
|
|
38
|
+
* app.all('/app/*', mount(anotherApp, {
|
|
39
|
+
* replaceRequest: (req) => req,
|
|
40
|
+
* }))
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const mount: (applicationHandler: ApplicationHandler, options?: MountOptions) => MiddlewareHandler;
|
|
44
|
+
//#endregion
|
|
45
|
+
export type { ApplicationHandler, MountOptionHandler, MountOptions, MountReplaceRequest };
|
|
46
|
+
export {};
|
|
@@ -217,7 +217,7 @@ export declare class HonoRequest<P extends string = '/', I extends Input['out']
|
|
|
217
217
|
*/
|
|
218
218
|
valid<T extends keyof I & keyof ValidationTargets>(target: T): InputToDataByTarget<I, T>;
|
|
219
219
|
/**
|
|
220
|
-
* `.url
|
|
220
|
+
* `.url` can get the request url strings.
|
|
221
221
|
*
|
|
222
222
|
* @see {@link https://hono.dev/docs/api/request#url}
|
|
223
223
|
*
|
|
@@ -231,7 +231,7 @@ export declare class HonoRequest<P extends string = '/', I extends Input['out']
|
|
|
231
231
|
*/
|
|
232
232
|
get url(): string;
|
|
233
233
|
/**
|
|
234
|
-
* `.method
|
|
234
|
+
* `.method` can get the method name of the request.
|
|
235
235
|
*
|
|
236
236
|
* @see {@link https://hono.dev/docs/api/request#method}
|
|
237
237
|
*
|
|
@@ -245,7 +245,7 @@ export declare class HonoRequest<P extends string = '/', I extends Input['out']
|
|
|
245
245
|
get method(): string;
|
|
246
246
|
get [GET_MATCH_RESULT](): Result<[unknown, RouterRoute]>;
|
|
247
247
|
/**
|
|
248
|
-
* `.matchedRoutes
|
|
248
|
+
* `.matchedRoutes` can return a matched route in the handler
|
|
249
249
|
*
|
|
250
250
|
* @deprecated
|
|
251
251
|
*
|
|
@@ -273,7 +273,7 @@ export declare class HonoRequest<P extends string = '/', I extends Input['out']
|
|
|
273
273
|
*/
|
|
274
274
|
get matchedRoutes(): RouterRoute[];
|
|
275
275
|
/**
|
|
276
|
-
*
|
|
276
|
+
* `.routePath` can retrieve the path registered within the handler
|
|
277
277
|
*
|
|
278
278
|
* @deprecated
|
|
279
279
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hono",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.13",
|
|
4
4
|
"description": "Web framework built on Web Standards",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -103,6 +103,11 @@
|
|
|
103
103
|
"import": "./dist/helper/route/index.js",
|
|
104
104
|
"require": "./dist/cjs/helper/route/index.js"
|
|
105
105
|
},
|
|
106
|
+
"./mount": {
|
|
107
|
+
"types": "./dist/types/middleware/mount/index.d.ts",
|
|
108
|
+
"import": "./dist/middleware/mount/index.js",
|
|
109
|
+
"require": "./dist/cjs/middleware/mount/index.js"
|
|
110
|
+
},
|
|
106
111
|
"./cookie": {
|
|
107
112
|
"types": "./dist/types/helper/cookie/index.d.ts",
|
|
108
113
|
"import": "./dist/helper/cookie/index.js",
|
|
@@ -457,6 +462,9 @@
|
|
|
457
462
|
"route": [
|
|
458
463
|
"./dist/types/helper/route"
|
|
459
464
|
],
|
|
465
|
+
"mount": [
|
|
466
|
+
"./dist/types/middleware/mount"
|
|
467
|
+
],
|
|
460
468
|
"cookie": [
|
|
461
469
|
"./dist/types/helper/cookie"
|
|
462
470
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@withbuddi/buddi",
|
|
3
|
-
"version": "0.1.0-pre.
|
|
3
|
+
"version": "0.1.0-pre.39",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Your personal agents, on your computer",
|
|
6
6
|
"repository": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"buddi": "packages/install/dist/launcher.js"
|
|
18
18
|
},
|
|
19
19
|
"buddi": {
|
|
20
|
-
"notes": "-
|
|
20
|
+
"notes": "- Logins: signing in again with a new password on a site where buddi keeps your login asks \"Update the login for amazon.com?\"; Update replaces the password it keeps. Signing in with the password it already keeps asks nothing, also after a restart and in your Chrome (a login saved before this release is asked about once). Saving two accounts on one site at once keeps both.\n- Logins: Save says \"Saved\" for two seconds once the login is really kept, or why it couldn't be kept with Try again — in the Page tab and in your Chrome's bar. In your Chrome the question survives the sign-in page moving on (a redirect to another page of the same site asks again there), and a Save pressed just after Give it back still counts.\n- Missions: a mission asks you one question at a time; asking the same unanswered question again within a day doesn't interrupt you (it leaves one quiet line under Needs you), and the \"needed you\" line for the same question is sent once a day at most.\n- Missions: when a mission running while you're away gets stuck, it asks you once on Telegram (with its choices as buttons) and carries on with your answer, instead of ending without a word; no answer within the wait (an hour by default) and you get one line saying it needed you.\n- buddi.app for Mac: an app that runs buddi with nothing to install, now a real app window with menus: the dashboard in its own window (first run and the lock screen included), a dock icon, the standard macOS menu bar (New Conversation, Settings, Lock, Find, Zoom, Check for Updates), microphone, downloads and native notifications, and the menu-bar glyph for status; first build, not yet distributed.\n- Logins: when you take over a page and sign in, buddi offers to keep that login for next time — \"Save this login for amazon.com?\" with Save, Not now and Never for this site, above the page in the Page tab, or in the \"buddi is waiting\" bar in your Chrome. Save keeps it under Settings → Keys and secrets (\"Login · amazon.com · for sam@… · saved 3 Oct\", with Remove), and agents sign in there with it without ever seeing the password; no agent, chat or log sees it. Your Chrome needs the extension from this release.\n- buddi.app for Mac: buddi updates itself from inside the app (Settings → System or \"Update to …\" in the menu): the new version is checked against npm's integrity hash and its signed provenance, tested, and only then switched to, with the version before kept; Advanced → Restart with the Previous Version goes back to it. Each release now builds a signed, notarized DMG for withbuddi.com once the signing keys are in place.\n- Chat: the round Send button is back at the right of the composer when Use my Chrome sits beside the model and Thinking; in a narrow box (the corner chat, a squeezed column) the model chip steps aside and the chip says just \"Chrome\".\n- Your Chrome: a page opens in an ordinary Chrome window, in the background, even when the window you last used is a popup or an installed app; when Chrome won't group the tab there, the page still opens (the \"buddi\" group is skipped), and with no ordinary window it opens in a new one that doesn't take the focus, with one line in the chat saying so.\n- Your Chrome: when the page opened and a later step failed, the agent gets the page and \"opened, then this failed\" instead of \"I couldn't open it\"; the same failure twice in a row is said plainly once rather than tried a third time.\n- Page tab: the page sits in a small browser window, with back, forward, reload and the address on a bar above it. While the agent drives, the bar is there but asleep and a click on the address copies it; a thin line along the bar shows a page loading.\n- Page tab: while you have the page in buddi's browser, back, forward and reload work, and you can type an address and press Enter to go there (the same sites the agent may visit; file and internal addresses are refused). The address follows the links you click.\n- Page tab: an Enlarge button beside Stop / Take over (and \"Open the full page view\" under ⋯) opens the page over the whole window with the same header; Esc or the button brings it back.\n- Page tab: the Keyboard button only shows on a phone, where it says \"Type into the page\"; on a computer, click the page and type.\n- Page tab: your pointer on the page is an arrow, not a crosshair.\n- Page tab: after reloading the dashboard while you have the page, clicks and typing reach it again straight away, without pressing Drive it here (on a computer; a phone still asks).\n- Your Chrome: Take over on a page in your Chrome brings its tab to the front of Chrome instead of waiting for a picture that never came; the bar in the tab says \"buddi is waiting\" with Give it back, and Give it back there or in the Canvas lets the agent carry on in that tab. Needs the extension from this release.\n- Your Chrome: when you asked for your Chrome (the Use my Chrome pin, the agent's setting, or the task) and buddi couldn't use it, the reply says why in one line: not connected to this buddi, not open right now, or turned off for agents in Settings.\n- A page that shows up signed out where the task needs your account (an Amazon cart saying \"Sign in to your account\") now asks with the \"needs your sign-in\" card, or moves to your Chrome where you're signed in, instead of the agent asking you in chat; a news front page with a Sign in link is left alone. Google's sign-in page under the title \"Gmail\" is now recognised as a sign-in page too.\n- Agents answer a list of items from a website (a cart, orders, search results) as a short list, one line per item, instead of a wide table; a table only when you ask for a comparison.\n- Lock screen: the widgets keep refreshing while it's locked, even in a tab in the back, and catch up the moment you look at it again; a slow answer can no longer put older headlines back over newer ones.\n- Settings → System: a version npm has just published but isn't serving yet is no longer offered; the panel says \"npm is still processing 0.1.0-pre.N; try again in a few minutes\" with no Upgrade button, and an upgrade that still runs into npm's 404 for buddi's own tarball says that same sentence instead of npm's output. A registry or mirror that needs your npm credentials (it gets the ones in your ~/.npmrc) or refuses the check is never mistaken for one still processing, and any other npm failure is shown in npm's own words, with credentials masked.\n- Cloudflare setup: after \"Remove what buddi made\", the panel says your Cloudflare API token is still kept here and still valid in Cloudflare, with a \"Forget the token\" button and where to revoke it (My Profile → API Tokens); Remove no longer drops the token on its own, so setting it up again doesn't ask for it. From the terminal: `buddi access cloudflare forget-token`."
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"packages",
|