@server/next 0.28.10 → 0.28.12
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/index.d.ts +5 -3
- package/index.js +3 -3
- package/package.json +10 -4
- package/src/jsx/jsx-runtime.d.ts +14 -0
package/index.d.ts
CHANGED
|
@@ -66,9 +66,11 @@ type SerializableValue = BasicValue | {
|
|
|
66
66
|
} | Array<SerializableValue>;
|
|
67
67
|
type KVStore = {
|
|
68
68
|
name?: string;
|
|
69
|
-
prefix: (
|
|
70
|
-
get: <T = SerializableValue>(key: string) => Promise<T>;
|
|
71
|
-
set: <T = SerializableValue>(key: string, value: T,
|
|
69
|
+
prefix: (prefix?: string) => KVStore;
|
|
70
|
+
get: <T = SerializableValue>(key: string) => Promise<T | null>;
|
|
71
|
+
set: <T = SerializableValue>(key: string, value: T, options?: {
|
|
72
|
+
expires?: string | number | null;
|
|
73
|
+
}) => Promise<void | string>;
|
|
72
74
|
has: (key: string) => Promise<boolean>;
|
|
73
75
|
del: (key: string) => Promise<void | string>;
|
|
74
76
|
keys: () => Promise<string[]>;
|
package/index.js
CHANGED
|
@@ -101,7 +101,7 @@ var createSession = async (user, ctx) => {
|
|
|
101
101
|
await session2.set(
|
|
102
102
|
id,
|
|
103
103
|
{ id, strategy, provider, user: user.email },
|
|
104
|
-
"1w"
|
|
104
|
+
{ expires: "1w" }
|
|
105
105
|
);
|
|
106
106
|
if (!strategy) throw new Error(`Invalid strategy "${strategy}"`);
|
|
107
107
|
if (strategy.includes("token")) {
|
|
@@ -330,7 +330,7 @@ var callback = async (ctx) => {
|
|
|
330
330
|
id: createId(),
|
|
331
331
|
strategy,
|
|
332
332
|
provider: "github",
|
|
333
|
-
user:
|
|
333
|
+
user: String(profile.id),
|
|
334
334
|
email: profile.email,
|
|
335
335
|
time: (/* @__PURE__ */ new Date()).toISOString().replace(/\.[0-9]*/, "")
|
|
336
336
|
};
|
|
@@ -343,7 +343,7 @@ var callback = async (ctx) => {
|
|
|
343
343
|
created: profile.created_at
|
|
344
344
|
});
|
|
345
345
|
await store.set(auth2.user, user);
|
|
346
|
-
await session2.set(auth2.id, auth2, "1w");
|
|
346
|
+
await session2.set(auth2.id, auth2, { expires: "1w" });
|
|
347
347
|
if (auth2.strategy.includes("token")) {
|
|
348
348
|
return status(201).json({ ...user, token: auth2.id });
|
|
349
349
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@server/next",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.12",
|
|
4
4
|
"description": "A fully-fledged web server with routing, file uploads, sessions, static files, schema validation, websockets, testing, etc.",
|
|
5
5
|
"homepage": "https://server-js.com/",
|
|
6
6
|
"repository": "https://github.com/franciscop/server-next.git",
|
|
@@ -40,8 +40,14 @@
|
|
|
40
40
|
"exports": {
|
|
41
41
|
".": "./index.js",
|
|
42
42
|
"./index.d.ts": "./index.d.ts",
|
|
43
|
-
"./jsx-runtime":
|
|
44
|
-
|
|
43
|
+
"./jsx-runtime": {
|
|
44
|
+
"types": "./src/jsx/jsx-runtime.d.ts",
|
|
45
|
+
"default": "./src/jsx/jsx-runtime.js"
|
|
46
|
+
},
|
|
47
|
+
"./jsx-dev-runtime": {
|
|
48
|
+
"types": "./src/jsx/jsx-runtime.d.ts",
|
|
49
|
+
"default": "./src/jsx/jsx-dev-runtime.js"
|
|
50
|
+
}
|
|
45
51
|
},
|
|
46
52
|
"devDependencies": {
|
|
47
53
|
"@types/bun": "^1.3.0",
|
|
@@ -50,7 +56,7 @@
|
|
|
50
56
|
"bun": "^1.3.13",
|
|
51
57
|
"check-dts": "^0.8.2",
|
|
52
58
|
"jest": "^29.7.0",
|
|
53
|
-
"polystore": "^0.
|
|
59
|
+
"polystore": "^0.21.1",
|
|
54
60
|
"tsup": "^8.5.1",
|
|
55
61
|
"typescript": "^5.9.3"
|
|
56
62
|
},
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function jsx(type: any, props: any, key?: any): any;
|
|
2
|
+
export declare function jsxs(type: any, props: any, key?: any): any;
|
|
3
|
+
export declare function jsxDEV(type: any, props: any, key?: any): any;
|
|
4
|
+
export declare const Fragment: unique symbol;
|
|
5
|
+
|
|
6
|
+
export declare namespace JSX {
|
|
7
|
+
interface Element {
|
|
8
|
+
type: any;
|
|
9
|
+
props: any;
|
|
10
|
+
}
|
|
11
|
+
interface IntrinsicElements {
|
|
12
|
+
[elem: string]: any;
|
|
13
|
+
}
|
|
14
|
+
}
|