@lsby/net-core-jwt 0.1.11 → 0.1.13
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/cjs/get-authorization.cjs +43 -0
- package/dist/cjs/get-authorization.d.cts +15 -0
- package/dist/cjs/get-token.cjs +1 -1
- package/dist/cjs/index.cjs +19 -1
- package/dist/cjs/index.d.cts +1 -0
- package/dist/esm/chunk-FJM2GMH2.js +19 -0
- package/dist/esm/{chunk-CGTLOC4F.js → chunk-SDYIK55N.js} +1 -1
- package/dist/esm/get-authorization.d.ts +15 -0
- package/dist/esm/get-authorization.js +6 -0
- package/dist/esm/get-token.js +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +5 -1
- package/package.json +3 -3
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/get-authorization.ts
|
|
21
|
+
var get_authorization_exports = {};
|
|
22
|
+
__export(get_authorization_exports, {
|
|
23
|
+
GetAuthorization\u63D2\u4EF6: () => GetAuthorization\u63D2\u4EF6
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(get_authorization_exports);
|
|
26
|
+
var import_zod = require("zod");
|
|
27
|
+
var import_net_core = require("@lsby/net-core");
|
|
28
|
+
var zod\u7C7B\u578B\u8868\u793A = import_zod.z.object({
|
|
29
|
+
authorization: import_zod.z.string().or(import_zod.z.undefined())
|
|
30
|
+
});
|
|
31
|
+
var GetAuthorization\u63D2\u4EF6 = class extends import_net_core.\u63D2\u4EF6 {
|
|
32
|
+
constructor() {
|
|
33
|
+
super(zod\u7C7B\u578B\u8868\u793A, async (req) => {
|
|
34
|
+
return {
|
|
35
|
+
authorization: req.headers.authorization
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
GetAuthorization\u63D2\u4EF6
|
|
43
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { 插件 as __ } from '@lsby/net-core';
|
|
3
|
+
|
|
4
|
+
declare let zod类型表示: z.ZodObject<{
|
|
5
|
+
authorization: z.ZodUnion<[z.ZodString, z.ZodUndefined]>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
authorization?: string | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
authorization?: string | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
declare class GetAuthorization插件 extends __<typeof zod类型表示> {
|
|
12
|
+
constructor();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { GetAuthorization插件 };
|
package/dist/cjs/get-token.cjs
CHANGED
|
@@ -32,7 +32,7 @@ var GetToken\u63D2\u4EF6 = class extends import_net_core.\u63D2\u4EF6 {
|
|
|
32
32
|
constructor() {
|
|
33
33
|
super(zod\u7C7B\u578B\u8868\u793A, async (req) => {
|
|
34
34
|
return {
|
|
35
|
-
token: req.headers.authorization
|
|
35
|
+
token: req.headers.authorization?.replace("Bearer ", "")
|
|
36
36
|
};
|
|
37
37
|
});
|
|
38
38
|
}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var src_exports = {};
|
|
22
22
|
__export(src_exports, {
|
|
23
|
+
GetAuthorization\u63D2\u4EF6: () => GetAuthorization\u63D2\u4EF6,
|
|
23
24
|
GetToken\u63D2\u4EF6: () => GetToken\u63D2\u4EF6,
|
|
24
25
|
JWT\u63D2\u4EF6: () => JWT\u63D2\u4EF6
|
|
25
26
|
});
|
|
@@ -71,13 +72,30 @@ var GetToken\u63D2\u4EF6 = class extends import_net_core2.\u63D2\u4EF6 {
|
|
|
71
72
|
constructor() {
|
|
72
73
|
super(zod\u7C7B\u578B\u8868\u793A, async (req) => {
|
|
73
74
|
return {
|
|
74
|
-
token: req.headers.authorization
|
|
75
|
+
token: req.headers.authorization?.replace("Bearer ", "")
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// src/get-authorization.ts
|
|
82
|
+
var import_zod3 = require("zod");
|
|
83
|
+
var import_net_core3 = require("@lsby/net-core");
|
|
84
|
+
var zod\u7C7B\u578B\u8868\u793A2 = import_zod3.z.object({
|
|
85
|
+
authorization: import_zod3.z.string().or(import_zod3.z.undefined())
|
|
86
|
+
});
|
|
87
|
+
var GetAuthorization\u63D2\u4EF6 = class extends import_net_core3.\u63D2\u4EF6 {
|
|
88
|
+
constructor() {
|
|
89
|
+
super(zod\u7C7B\u578B\u8868\u793A2, async (req) => {
|
|
90
|
+
return {
|
|
91
|
+
authorization: req.headers.authorization
|
|
75
92
|
};
|
|
76
93
|
});
|
|
77
94
|
}
|
|
78
95
|
};
|
|
79
96
|
// Annotate the CommonJS export names for ESM import in node:
|
|
80
97
|
0 && (module.exports = {
|
|
98
|
+
GetAuthorization\u63D2\u4EF6,
|
|
81
99
|
GetToken\u63D2\u4EF6,
|
|
82
100
|
JWT\u63D2\u4EF6
|
|
83
101
|
});
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// src/get-authorization.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { \u63D2\u4EF6 } from "@lsby/net-core";
|
|
4
|
+
var zod\u7C7B\u578B\u8868\u793A = z.object({
|
|
5
|
+
authorization: z.string().or(z.undefined())
|
|
6
|
+
});
|
|
7
|
+
var GetAuthorization\u63D2\u4EF6 = class extends \u63D2\u4EF6 {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(zod\u7C7B\u578B\u8868\u793A, async (req) => {
|
|
10
|
+
return {
|
|
11
|
+
authorization: req.headers.authorization
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
GetAuthorization插件
|
|
19
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { 插件 as __ } from '@lsby/net-core';
|
|
3
|
+
|
|
4
|
+
declare let zod类型表示: z.ZodObject<{
|
|
5
|
+
authorization: z.ZodUnion<[z.ZodString, z.ZodUndefined]>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
authorization?: string | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
authorization?: string | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
declare class GetAuthorization插件 extends __<typeof zod类型表示> {
|
|
12
|
+
constructor();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { GetAuthorization插件 };
|
package/dist/esm/get-token.js
CHANGED
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GetAuthorization插件
|
|
3
|
+
} from "./chunk-FJM2GMH2.js";
|
|
1
4
|
import {
|
|
2
5
|
GetToken插件
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SDYIK55N.js";
|
|
4
7
|
import {
|
|
5
8
|
JWT插件
|
|
6
9
|
} from "./chunk-ERC6C4HS.js";
|
|
7
10
|
export {
|
|
11
|
+
GetAuthorization\u63D2\u4EF6,
|
|
8
12
|
GetToken\u63D2\u4EF6,
|
|
9
13
|
JWT\u63D2\u4EF6
|
|
10
14
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lsby/net-core-jwt",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"require": "./dist/cjs/index.cjs",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@lsby/net-core": "^0.7.0",
|
|
43
|
-
"@lsby/ts-fp-data": "^0.2.
|
|
44
|
-
"zod": "3.
|
|
43
|
+
"@lsby/ts-fp-data": "^0.2.5",
|
|
44
|
+
"zod": "3.24.2"
|
|
45
45
|
},
|
|
46
46
|
"packageManager": "pnpm@9.7.1+sha512.faf344af2d6ca65c4c5c8c2224ea77a81a5e8859cbc4e06b1511ddce2f0151512431dd19e6aff31f2c6a8f5f2aced9bd2273e1fed7dd4de1868984059d2c4247"
|
|
47
47
|
}
|