@llmops/sdk 0.4.6 → 0.4.7-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.
- package/dist/express.d.cts +2 -2
- package/dist/express.d.mts +2 -2
- package/dist/express.mjs +1 -1
- package/dist/hono.d.cts +1 -1
- package/dist/hono.d.mts +1 -1
- package/dist/{index-BL6HTepw.d.mts → index-BUNt7GzB.d.mts} +1 -1
- package/dist/{index-UQjBf1t7.d.cts → index-BbeQtPGT.d.cts} +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/nextjs.cjs +29 -0
- package/dist/nextjs.d.cts +12 -0
- package/dist/nextjs.d.mts +12 -0
- package/dist/nextjs.mjs +28 -0
- package/package.json +15 -4
- /package/dist/{express-BXdOPP-q.mjs → express-Dz3xwxkh.mjs} +0 -0
- /package/dist/{index-BFiKnXi1.d.mts → index-B2A4WBGq.d.cts} +0 -0
- /package/dist/{index-fafxrrPF.d.cts → index-DFnEar4S.d.mts} +0 -0
package/dist/express.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { t as createLLMOpsMiddleware } from "./index-
|
|
1
|
+
import "./index-B2A4WBGq.cjs";
|
|
2
|
+
import { t as createLLMOpsMiddleware } from "./index-BbeQtPGT.cjs";
|
|
3
3
|
export { createLLMOpsMiddleware };
|
package/dist/express.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { t as createLLMOpsMiddleware } from "./index-
|
|
1
|
+
import "./index-DFnEar4S.mjs";
|
|
2
|
+
import { t as createLLMOpsMiddleware } from "./index-BUNt7GzB.mjs";
|
|
3
3
|
export { createLLMOpsMiddleware };
|
package/dist/express.mjs
CHANGED
package/dist/hono.d.cts
CHANGED
package/dist/hono.d.mts
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as createLLMOps } from "./index-
|
|
2
|
-
import { t as createLLMOpsMiddleware } from "./index-
|
|
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-
|
|
2
|
-
import { t as createLLMOpsMiddleware } from "./index-
|
|
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
package/dist/nextjs.cjs
ADDED
|
@@ -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 };
|
package/dist/nextjs.mjs
ADDED
|
@@ -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.
|
|
3
|
+
"version": "0.4.7-beta.2",
|
|
4
4
|
"description": "An LLMOps toolkit for TypeScript applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -58,18 +58,29 @@
|
|
|
58
58
|
"default": "./dist/hono.cjs"
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
|
+
"./nextjs": {
|
|
62
|
+
"import": {
|
|
63
|
+
"types": "./dist/nextjs.d.mts",
|
|
64
|
+
"default": "./dist/nextjs.mjs"
|
|
65
|
+
},
|
|
66
|
+
"require": {
|
|
67
|
+
"types": "./dist/nextjs.d.cts",
|
|
68
|
+
"default": "./dist/nextjs.cjs"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
61
71
|
"./*": "./*"
|
|
62
72
|
},
|
|
63
73
|
"publishConfig": {
|
|
64
74
|
"access": "public"
|
|
65
75
|
},
|
|
66
76
|
"dependencies": {
|
|
67
|
-
"@llmops/app": "^0.4.
|
|
68
|
-
"@llmops/core": "^0.4.
|
|
77
|
+
"@llmops/app": "^0.4.7-beta.2",
|
|
78
|
+
"@llmops/core": "^0.4.7-beta.2"
|
|
69
79
|
},
|
|
70
80
|
"devDependencies": {
|
|
71
81
|
"@types/express": "^5.0.6",
|
|
72
|
-
"hono": "^4.7.0"
|
|
82
|
+
"hono": "^4.7.0",
|
|
83
|
+
"next": "^15.0.0"
|
|
73
84
|
},
|
|
74
85
|
"scripts": {
|
|
75
86
|
"build": "tsdown",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|