@worktango/ai-assistant 0.0.40 → 0.0.41

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/express.js CHANGED
@@ -11190,7 +11190,7 @@ function setupAiAssistantRoutes(args) {
11190
11190
  const logger = coalesce(args.logger, console);
11191
11191
  const routePath = args.route ?? "/ai-assistant";
11192
11192
  const port = args.targetPort ?? 80;
11193
- const protocol = "http";
11193
+ const protocol = args.targetProtocol ?? "http";
11194
11194
  args.app.use(routePath, (req, res, next) => {
11195
11195
  args.getBearerToken(req.headers).then((bearerToken) => {
11196
11196
  req.headers.Authorization = `Bearer ${bearerToken}`;
@@ -11203,6 +11203,7 @@ function setupAiAssistantRoutes(args) {
11203
11203
  const proxyOptions = {
11204
11204
  target: `${protocol}://${args.targetHost}:${port}`,
11205
11205
  changeOrigin: true,
11206
+ followRedirects: true,
11206
11207
  pathRewrite: (path, req) => {
11207
11208
  const expressRequest = req;
11208
11209
  return args.getTargetPath(expressRequest.originalUrl || path);
package/express.d.ts CHANGED
@@ -18,6 +18,10 @@ export function setupAiAssistantRoutes(args: {
18
18
  * The port of the application to proxy requests to. Defaults to 80.
19
19
  */
20
20
  targetPort?: number;
21
+ /**
22
+ * The protocol of the application to proxy requests to. Defaults to "http".
23
+ */
24
+ targetProtocol?: string;
21
25
  /**
22
26
  * The route path to the local service's AI assistant. Defaults to
23
27
  * "/ai-assistant".
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worktango/ai-assistant",
3
- "version": "0.0.40",
3
+ "version": "0.0.41",
4
4
  "files": [
5
5
  "dist",
6
6
  "express.d.ts",