@llmops/sdk 0.4.7 → 0.4.8-beta.2

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.
@@ -1,3 +1,3 @@
1
- import "./index-fafxrrPF.cjs";
2
- import { t as createLLMOpsMiddleware } from "./index-UQjBf1t7.cjs";
1
+ import "./index-B2A4WBGq.cjs";
2
+ import { t as createLLMOpsMiddleware } from "./index-BbeQtPGT.cjs";
3
3
  export { createLLMOpsMiddleware };
@@ -1,3 +1,3 @@
1
- import "./index-BFiKnXi1.mjs";
2
- import { t as createLLMOpsMiddleware } from "./index-BL6HTepw.mjs";
1
+ import "./index-DFnEar4S.mjs";
2
+ import { t as createLLMOpsMiddleware } from "./index-BUNt7GzB.mjs";
3
3
  export { createLLMOpsMiddleware };
package/dist/express.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { t as createLLMOpsMiddleware } from "./express-BXdOPP-q.mjs";
1
+ import { t as createLLMOpsMiddleware } from "./express-Dz3xwxkh.mjs";
2
2
 
3
3
  export { createLLMOpsMiddleware };
package/dist/hono.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as LLMOpsClient } from "./index-fafxrrPF.cjs";
1
+ import { t as LLMOpsClient } from "./index-B2A4WBGq.cjs";
2
2
  import { MiddlewareHandler } from "hono";
3
3
 
4
4
  //#region src/lib/hono/index.d.ts
package/dist/hono.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as LLMOpsClient } from "./index-BFiKnXi1.mjs";
1
+ import { t as LLMOpsClient } from "./index-DFnEar4S.mjs";
2
2
  import { MiddlewareHandler } from "hono";
3
3
 
4
4
  //#region src/lib/hono/index.d.ts
@@ -1,4 +1,4 @@
1
- import { t as LLMOpsClient } from "./index-BFiKnXi1.mjs";
1
+ import { t as LLMOpsClient } from "./index-DFnEar4S.mjs";
2
2
  import { NextFunction, Request, Response } from "express";
3
3
 
4
4
  //#region src/lib/express/index.d.ts
@@ -1,4 +1,4 @@
1
- import { t as LLMOpsClient } from "./index-fafxrrPF.cjs";
1
+ import { t as LLMOpsClient } from "./index-B2A4WBGq.cjs";
2
2
  import { NextFunction, Request, Response } from "express";
3
3
 
4
4
  //#region src/lib/express/index.d.ts
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { n as createLLMOps } from "./index-fafxrrPF.cjs";
2
- import { t as createLLMOpsMiddleware } from "./index-UQjBf1t7.cjs";
1
+ import { n as createLLMOps, t as LLMOpsClient } from "./index-B2A4WBGq.cjs";
2
+ import { t as createLLMOpsMiddleware } from "./index-BbeQtPGT.cjs";
3
3
 
4
4
  //#region src/lib/auth/client.d.ts
5
5
 
@@ -170,4 +170,4 @@ declare class AuthFeatureNotAvailableError extends Error {
170
170
  constructor(feature: string, authType: string);
171
171
  }
172
172
  //#endregion
173
- export { AuthClient, AuthFeatureNotAvailableError, PaginatedResponse, PaginationOptions, Permission, Session, User, createLLMOpsMiddleware, createLLMOps as llmops };
173
+ export { AuthClient, AuthFeatureNotAvailableError, type LLMOpsClient, PaginatedResponse, PaginationOptions, Permission, Session, User, createLLMOpsMiddleware, createLLMOps as llmops };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { n as createLLMOps } from "./index-BFiKnXi1.mjs";
2
- import { t as createLLMOpsMiddleware } from "./index-BL6HTepw.mjs";
1
+ import { n as createLLMOps, t as LLMOpsClient } from "./index-DFnEar4S.mjs";
2
+ import { t as createLLMOpsMiddleware } from "./index-BUNt7GzB.mjs";
3
3
 
4
4
  //#region src/lib/auth/client.d.ts
5
5
 
@@ -170,4 +170,4 @@ declare class AuthFeatureNotAvailableError extends Error {
170
170
  constructor(feature: string, authType: string);
171
171
  }
172
172
  //#endregion
173
- export { AuthClient, AuthFeatureNotAvailableError, PaginatedResponse, PaginationOptions, Permission, Session, User, createLLMOpsMiddleware, createLLMOps as llmops };
173
+ export { AuthClient, AuthFeatureNotAvailableError, type LLMOpsClient, PaginatedResponse, PaginationOptions, Permission, Session, User, createLLMOpsMiddleware, createLLMOps as llmops };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as createLLMOpsMiddleware } from "./express-BXdOPP-q.mjs";
1
+ import { t as createLLMOpsMiddleware } from "./express-Dz3xwxkh.mjs";
2
2
  import "@llmops/core";
3
3
  import { createApp } from "@llmops/app";
4
4
 
@@ -0,0 +1,29 @@
1
+
2
+ //#region src/lib/nextjs/index.ts
3
+ function toNextJsHandler(client) {
4
+ const basePath = client.config.basePath;
5
+ const handler = async (request) => {
6
+ if (!("handler" in client)) return new Response("Not Found", { status: 404 });
7
+ const url = new URL(request.url);
8
+ let urlPath = url.pathname;
9
+ if (basePath && basePath !== "/" && urlPath.startsWith(basePath)) urlPath = urlPath.slice(basePath.length) || "/";
10
+ const newUrl = new URL(urlPath + url.search, url.origin);
11
+ const newRequest = new Request(newUrl, {
12
+ method: request.method,
13
+ headers: request.headers,
14
+ body: ["GET", "HEAD"].includes(request.method) ? void 0 : request.body,
15
+ duplex: "half"
16
+ });
17
+ return client.handler(newRequest);
18
+ };
19
+ return {
20
+ GET: handler,
21
+ POST: handler,
22
+ PATCH: handler,
23
+ PUT: handler,
24
+ DELETE: handler
25
+ };
26
+ }
27
+
28
+ //#endregion
29
+ exports.toNextJsHandler = toNextJsHandler;
@@ -0,0 +1,12 @@
1
+ import { t as LLMOpsClient } from "./index-B2A4WBGq.cjs";
2
+
3
+ //#region src/lib/nextjs/index.d.ts
4
+ declare function toNextJsHandler(client: LLMOpsClient): {
5
+ GET: (request: Request) => Promise<Response>;
6
+ POST: (request: Request) => Promise<Response>;
7
+ PATCH: (request: Request) => Promise<Response>;
8
+ PUT: (request: Request) => Promise<Response>;
9
+ DELETE: (request: Request) => Promise<Response>;
10
+ };
11
+ //#endregion
12
+ export { toNextJsHandler };
@@ -0,0 +1,12 @@
1
+ import { t as LLMOpsClient } from "./index-DFnEar4S.mjs";
2
+
3
+ //#region src/lib/nextjs/index.d.ts
4
+ declare function toNextJsHandler(client: LLMOpsClient): {
5
+ GET: (request: Request) => Promise<Response>;
6
+ POST: (request: Request) => Promise<Response>;
7
+ PATCH: (request: Request) => Promise<Response>;
8
+ PUT: (request: Request) => Promise<Response>;
9
+ DELETE: (request: Request) => Promise<Response>;
10
+ };
11
+ //#endregion
12
+ export { toNextJsHandler };
@@ -0,0 +1,28 @@
1
+ //#region src/lib/nextjs/index.ts
2
+ function toNextJsHandler(client) {
3
+ const basePath = client.config.basePath;
4
+ const handler = async (request) => {
5
+ if (!("handler" in client)) return new Response("Not Found", { status: 404 });
6
+ const url = new URL(request.url);
7
+ let urlPath = url.pathname;
8
+ if (basePath && basePath !== "/" && urlPath.startsWith(basePath)) urlPath = urlPath.slice(basePath.length) || "/";
9
+ const newUrl = new URL(urlPath + url.search, url.origin);
10
+ const newRequest = new Request(newUrl, {
11
+ method: request.method,
12
+ headers: request.headers,
13
+ body: ["GET", "HEAD"].includes(request.method) ? void 0 : request.body,
14
+ duplex: "half"
15
+ });
16
+ return client.handler(newRequest);
17
+ };
18
+ return {
19
+ GET: handler,
20
+ POST: handler,
21
+ PATCH: handler,
22
+ PUT: handler,
23
+ DELETE: handler
24
+ };
25
+ }
26
+
27
+ //#endregion
28
+ export { toNextJsHandler };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llmops/sdk",
3
- "version": "0.4.7",
3
+ "version": "0.4.8-beta.2",
4
4
  "description": "An LLMOps toolkit for TypeScript applications",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -64,8 +64,8 @@
64
64
  "access": "public"
65
65
  },
66
66
  "dependencies": {
67
- "@llmops/app": "^0.4.7",
68
- "@llmops/core": "^0.4.7"
67
+ "@llmops/app": "^0.4.8-beta.2",
68
+ "@llmops/core": "^0.4.8-beta.2"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@types/express": "^5.0.6",