@worktango/ai-assistant 0.0.36 → 0.0.38

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.
Files changed (3) hide show
  1. package/dist/express.js +6922 -115
  2. package/express.d.ts +12 -3
  3. package/package.json +2 -1
package/express.d.ts CHANGED
@@ -7,7 +7,9 @@ export function setupAiAssistantRoutes(args: {
7
7
  * back-channel request proxying. This should be a JWT token that can be
8
8
  * decoded on the `kazoo-web` application to authenticate the request.
9
9
  */
10
- getBearerToken: (req: Request) => Promise<string>;
10
+ getBearerToken: (
11
+ headers: Record<string, undefined | string | string[]>
12
+ ) => Promise<string>;
11
13
  /**
12
14
  * The host of the application to proxy requests to.
13
15
  */
@@ -31,8 +33,15 @@ export function setupAiAssistantRoutes(args: {
31
33
  preflightMiddlewares?: RequestHandler[];
32
34
  /**
33
35
  * A function that should return the target path for the proxy request, based
34
- * on the incoming request object. The path returned will be appended to the
36
+ * on the incoming full path. The path returned will be appended to the
35
37
  * target host and port to form the final URL.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * getTargetPath: (fullPath) => {
42
+ * return fullPath;
43
+ * }
44
+ * ```
36
45
  */
37
- getTargetPath: (req: Request) => string;
46
+ getTargetPath: (fullPath: string) => string;
38
47
  }): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worktango/ai-assistant",
3
- "version": "0.0.36",
3
+ "version": "0.0.38",
4
4
  "files": [
5
5
  "dist",
6
6
  "express.d.ts",
@@ -20,6 +20,7 @@
20
20
  "gql:generate": "gql-generate"
21
21
  },
22
22
  "dependencies": {
23
+ "http-proxy-middleware": "^3",
23
24
  "micromark": "^4"
24
25
  },
25
26
  "devDependencies": {