@shware/security 2.5.3 → 2.6.0
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/auth/index.cjs +520 -561
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.d.cts +104 -106
- package/dist/auth/index.d.cts.map +1 -0
- package/dist/auth/index.d.mts +109 -0
- package/dist/auth/index.d.mts.map +1 -0
- package/dist/auth/index.mjs +513 -536
- package/dist/auth/index.mjs.map +1 -1
- package/dist/auth/types.cjs +0 -19
- package/dist/auth/types.d.cts +44 -44
- package/dist/auth/types.d.cts.map +1 -0
- package/dist/auth/types.d.mts +50 -0
- package/dist/auth/types.d.mts.map +1 -0
- package/dist/auth/types.mjs +1 -1
- package/dist/core/index.cjs +34 -59
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +23 -21
- package/dist/core/index.d.cts.map +1 -0
- package/dist/core/index.d.mts +34 -0
- package/dist/core/index.d.mts.map +1 -0
- package/dist/core/index.mjs +32 -33
- package/dist/core/index.mjs.map +1 -1
- package/dist/email/schema.cjs +13 -38
- package/dist/email/schema.cjs.map +1 -1
- package/dist/email/schema.d.cts +11 -12
- package/dist/email/schema.d.cts.map +1 -0
- package/dist/email/schema.d.mts +12 -0
- package/dist/email/schema.d.mts.map +1 -0
- package/dist/email/schema.mjs +10 -11
- package/dist/email/schema.mjs.map +1 -1
- package/dist/index.cjs +17 -54
- package/dist/index.d.cts +10 -15
- package/dist/index.d.mts +10 -0
- package/dist/index.mjs +4 -17
- package/dist/oauth2/client.cjs +109 -145
- package/dist/oauth2/client.cjs.map +1 -1
- package/dist/oauth2/client.d.cts +55 -56
- package/dist/oauth2/client.d.cts.map +1 -0
- package/dist/oauth2/client.d.mts +58 -0
- package/dist/oauth2/client.d.mts.map +1 -0
- package/dist/oauth2/client.mjs +104 -116
- package/dist/oauth2/client.mjs.map +1 -1
- package/dist/oauth2/error.cjs +19 -44
- package/dist/oauth2/error.cjs.map +1 -1
- package/dist/oauth2/error.d.cts +8 -6
- package/dist/oauth2/error.d.cts.map +1 -0
- package/dist/oauth2/{error.d.ts → error.d.mts} +8 -6
- package/dist/oauth2/error.d.mts.map +1 -0
- package/dist/oauth2/error.mjs +18 -19
- package/dist/oauth2/error.mjs.map +1 -1
- package/dist/oauth2/provider/apple.cjs +75 -88
- package/dist/oauth2/provider/apple.cjs.map +1 -1
- package/dist/oauth2/provider/apple.d.cts +31 -30
- package/dist/oauth2/provider/apple.d.cts.map +1 -0
- package/dist/oauth2/provider/apple.d.mts +42 -0
- package/dist/oauth2/provider/apple.d.mts.map +1 -0
- package/dist/oauth2/provider/apple.mjs +71 -60
- package/dist/oauth2/provider/apple.mjs.map +1 -1
- package/dist/oauth2/provider/common.cjs +86 -109
- package/dist/oauth2/provider/common.cjs.map +1 -1
- package/dist/oauth2/provider/common.d.cts +19 -18
- package/dist/oauth2/provider/common.d.cts.map +1 -0
- package/dist/oauth2/provider/common.d.mts +30 -0
- package/dist/oauth2/provider/common.d.mts.map +1 -0
- package/dist/oauth2/provider/common.mjs +80 -79
- package/dist/oauth2/provider/common.mjs.map +1 -1
- package/dist/oauth2/provider/facebook.cjs +93 -109
- package/dist/oauth2/provider/facebook.cjs.map +1 -1
- package/dist/oauth2/provider/facebook.d.cts +29 -28
- package/dist/oauth2/provider/facebook.d.cts.map +1 -0
- package/dist/oauth2/provider/facebook.d.mts +45 -0
- package/dist/oauth2/provider/facebook.d.mts.map +1 -0
- package/dist/oauth2/provider/facebook.mjs +89 -81
- package/dist/oauth2/provider/facebook.mjs.map +1 -1
- package/dist/oauth2/provider/github.cjs +64 -91
- package/dist/oauth2/provider/github.cjs.map +1 -1
- package/dist/oauth2/provider/github.d.cts +52 -51
- package/dist/oauth2/provider/github.d.cts.map +1 -0
- package/dist/oauth2/provider/github.d.mts +60 -0
- package/dist/oauth2/provider/github.d.mts.map +1 -0
- package/dist/oauth2/provider/github.mjs +60 -63
- package/dist/oauth2/provider/github.mjs.map +1 -1
- package/dist/oauth2/provider/google.cjs +105 -122
- package/dist/oauth2/provider/google.cjs.map +1 -1
- package/dist/oauth2/provider/google.d.cts +34 -33
- package/dist/oauth2/provider/google.d.cts.map +1 -0
- package/dist/oauth2/provider/google.d.mts +44 -0
- package/dist/oauth2/provider/google.d.mts.map +1 -0
- package/dist/oauth2/provider/google.mjs +101 -94
- package/dist/oauth2/provider/google.mjs.map +1 -1
- package/dist/oauth2/provider/index.cjs +13 -46
- package/dist/oauth2/provider/index.d.cts +7 -7
- package/dist/oauth2/provider/index.d.mts +7 -0
- package/dist/oauth2/provider/index.mjs +1 -10
- package/dist/oauth2/provider/wechat.cjs +77 -99
- package/dist/oauth2/provider/wechat.cjs.map +1 -1
- package/dist/oauth2/provider/wechat.d.cts +28 -27
- package/dist/oauth2/provider/wechat.d.cts.map +1 -0
- package/dist/oauth2/provider/wechat.d.mts +39 -0
- package/dist/oauth2/provider/wechat.d.mts.map +1 -0
- package/dist/oauth2/provider/wechat.mjs +74 -72
- package/dist/oauth2/provider/wechat.mjs.map +1 -1
- package/dist/oauth2/provider/x.cjs +102 -125
- package/dist/oauth2/provider/x.cjs.map +1 -1
- package/dist/oauth2/provider/x.d.cts +51 -50
- package/dist/oauth2/provider/x.d.cts.map +1 -0
- package/dist/oauth2/provider/x.d.mts +69 -0
- package/dist/oauth2/provider/x.d.mts.map +1 -0
- package/dist/oauth2/provider/x.mjs +99 -103
- package/dist/oauth2/provider/x.mjs.map +1 -1
- package/dist/oauth2/types.cjs +13 -37
- package/dist/oauth2/types.cjs.map +1 -1
- package/dist/oauth2/types.d.cts +180 -178
- package/dist/oauth2/types.d.cts.map +1 -0
- package/dist/oauth2/types.d.mts +213 -0
- package/dist/oauth2/types.d.mts.map +1 -0
- package/dist/oauth2/types.mjs +13 -13
- package/dist/oauth2/types.mjs.map +1 -1
- package/dist/session/common.cjs +17 -43
- package/dist/session/common.cjs.map +1 -1
- package/dist/session/common.d.cts +4 -4
- package/dist/session/common.d.cts.map +1 -0
- package/dist/session/{common.d.ts → common.d.mts} +4 -4
- package/dist/session/common.d.mts.map +1 -0
- package/dist/session/common.mjs +14 -16
- package/dist/session/common.mjs.map +1 -1
- package/dist/session/db.cjs +88 -123
- package/dist/session/db.cjs.map +1 -1
- package/dist/session/db.d.cts +36 -36
- package/dist/session/db.d.cts.map +1 -0
- package/dist/session/db.d.mts +44 -0
- package/dist/session/db.d.mts.map +1 -0
- package/dist/session/db.mjs +84 -95
- package/dist/session/db.mjs.map +1 -1
- package/dist/session/map-session.cjs +71 -103
- package/dist/session/map-session.cjs.map +1 -1
- package/dist/session/map-session.d.cts +24 -24
- package/dist/session/map-session.d.cts.map +1 -0
- package/dist/session/map-session.d.mts +27 -0
- package/dist/session/map-session.d.mts.map +1 -0
- package/dist/session/map-session.mjs +70 -78
- package/dist/session/map-session.mjs.map +1 -1
- package/dist/session/redis.cjs +270 -319
- package/dist/session/redis.cjs.map +1 -1
- package/dist/session/redis.d.cts +51 -51
- package/dist/session/redis.d.cts.map +1 -0
- package/dist/session/redis.d.mts +58 -0
- package/dist/session/redis.d.mts.map +1 -0
- package/dist/session/redis.mjs +266 -291
- package/dist/session/redis.mjs.map +1 -1
- package/dist/session/types.cjs +0 -19
- package/dist/session/types.d.cts +34 -33
- package/dist/session/types.d.cts.map +1 -0
- package/dist/session/types.d.mts +45 -0
- package/dist/session/types.d.mts.map +1 -0
- package/dist/session/types.mjs +1 -1
- package/dist/utils/http.cjs +31 -55
- package/dist/utils/http.cjs.map +1 -1
- package/dist/utils/http.d.cts +7 -10
- package/dist/utils/http.d.cts.map +1 -0
- package/dist/utils/{http.d.ts → http.d.mts} +7 -10
- package/dist/utils/http.d.mts.map +1 -0
- package/dist/utils/http.mjs +24 -24
- package/dist/utils/http.mjs.map +1 -1
- package/dist/utils/oauth2.cjs +6 -30
- package/dist/utils/oauth2.cjs.map +1 -1
- package/dist/utils/oauth2.d.cts +3 -1
- package/dist/utils/oauth2.d.cts.map +1 -0
- package/dist/utils/oauth2.d.mts +5 -0
- package/dist/utils/oauth2.d.mts.map +1 -0
- package/dist/utils/oauth2.mjs +5 -5
- package/dist/utils/oauth2.mjs.map +1 -1
- package/dist/utils/timing.cjs +49 -70
- package/dist/utils/timing.cjs.map +1 -1
- package/dist/utils/timing.d.cts +10 -8
- package/dist/utils/timing.d.cts.map +1 -0
- package/dist/utils/timing.d.mts +15 -0
- package/dist/utils/timing.d.mts.map +1 -0
- package/dist/utils/timing.mjs +48 -45
- package/dist/utils/timing.mjs.map +1 -1
- package/dist/utils/valid.cjs +50 -71
- package/dist/utils/valid.cjs.map +1 -1
- package/dist/utils/valid.d.cts +17 -16
- package/dist/utils/valid.d.cts.map +1 -0
- package/dist/utils/valid.d.mts +28 -0
- package/dist/utils/valid.d.mts.map +1 -0
- package/dist/utils/valid.mjs +47 -44
- package/dist/utils/valid.mjs.map +1 -1
- package/package.json +22 -12
- package/dist/auth/index.d.ts +0 -111
- package/dist/auth/types.cjs.map +0 -1
- package/dist/auth/types.d.ts +0 -50
- package/dist/auth/types.mjs.map +0 -1
- package/dist/core/index.d.ts +0 -32
- package/dist/email/schema.d.ts +0 -13
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -15
- package/dist/index.mjs.map +0 -1
- package/dist/oauth2/client.d.ts +0 -59
- package/dist/oauth2/provider/apple.d.ts +0 -41
- package/dist/oauth2/provider/common.d.ts +0 -29
- package/dist/oauth2/provider/facebook.d.ts +0 -44
- package/dist/oauth2/provider/github.d.ts +0 -59
- package/dist/oauth2/provider/google.d.ts +0 -43
- package/dist/oauth2/provider/index.cjs.map +0 -1
- package/dist/oauth2/provider/index.d.ts +0 -7
- package/dist/oauth2/provider/index.mjs.map +0 -1
- package/dist/oauth2/provider/wechat.d.ts +0 -38
- package/dist/oauth2/provider/x.d.ts +0 -68
- package/dist/oauth2/types.d.ts +0 -211
- package/dist/session/__tests__/redis.test.cjs +0 -247
- package/dist/session/__tests__/redis.test.cjs.map +0 -1
- package/dist/session/__tests__/redis.test.d.cts +0 -2
- package/dist/session/__tests__/redis.test.d.ts +0 -2
- package/dist/session/__tests__/redis.test.mjs +0 -252
- package/dist/session/__tests__/redis.test.mjs.map +0 -1
- package/dist/session/db.d.ts +0 -44
- package/dist/session/map-session.d.ts +0 -27
- package/dist/session/redis.d.ts +0 -58
- package/dist/session/types.cjs.map +0 -1
- package/dist/session/types.d.ts +0 -44
- package/dist/session/types.mjs.map +0 -1
- package/dist/utils/oauth2.d.ts +0 -3
- package/dist/utils/timing.d.ts +0 -13
- package/dist/utils/valid.d.ts +0 -27
package/dist/core/index.mjs
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
//#region src/core/index.ts
|
|
2
|
+
let Provider = /* @__PURE__ */ function(Provider) {
|
|
3
|
+
Provider["APPLE"] = "APPLE";
|
|
4
|
+
Provider["DISCORD"] = "DISCORD";
|
|
5
|
+
Provider["FACEBOOK"] = "FACEBOOK";
|
|
6
|
+
Provider["GITHUB"] = "GITHUB";
|
|
7
|
+
Provider["GOOGLE"] = "GOOGLE";
|
|
8
|
+
Provider["LINKEDIN"] = "LINKEDIN";
|
|
9
|
+
Provider["MICROSOFT"] = "MICROSOFT";
|
|
10
|
+
Provider["SLACK"] = "SLACK";
|
|
11
|
+
Provider["WECHAT"] = "WECHAT";
|
|
12
|
+
Provider["X"] = "X";
|
|
13
|
+
Provider["EMAIL"] = "EMAIL";
|
|
14
|
+
Provider["PHONE"] = "PHONE";
|
|
15
|
+
return Provider;
|
|
16
|
+
}({});
|
|
17
|
+
const ALL_PROVIDERS = [
|
|
18
|
+
"APPLE",
|
|
19
|
+
"DISCORD",
|
|
20
|
+
"FACEBOOK",
|
|
21
|
+
"GITHUB",
|
|
22
|
+
"GOOGLE",
|
|
23
|
+
"LINKEDIN",
|
|
24
|
+
"MICROSOFT",
|
|
25
|
+
"SLACK",
|
|
26
|
+
"WECHAT",
|
|
27
|
+
"X",
|
|
28
|
+
"EMAIL",
|
|
29
|
+
"PHONE"
|
|
30
30
|
];
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { ALL_PROVIDERS, Provider };
|
|
33
|
+
|
|
35
34
|
//# sourceMappingURL=index.mjs.map
|
package/dist/core/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/index.ts"],"sourcesContent":["export type JSONValue =\n | null\n | string\n | number\n | boolean\n | { [value: string]: JSONValue }\n | Array<JSONValue>;\n\nexport interface Principal {\n name: string;\n}\n\nexport interface Authentication extends Principal {\n authorities: string[];\n authenticated: boolean;\n}\n\nexport interface CsrfToken {\n token: string;\n headerName: string;\n parameterName: string;\n}\n\nexport enum Provider {\n // oauth2\n APPLE = 'APPLE',\n DISCORD = 'DISCORD',\n FACEBOOK = 'FACEBOOK',\n GITHUB = 'GITHUB',\n GOOGLE = 'GOOGLE',\n LINKEDIN = 'LINKEDIN',\n MICROSOFT = 'MICROSOFT',\n SLACK = 'SLACK',\n WECHAT = 'WECHAT',\n X = 'X',\n // contact\n EMAIL = 'EMAIL',\n PHONE = 'PHONE',\n}\n\nexport const ALL_PROVIDERS = [\n Provider.APPLE,\n Provider.DISCORD,\n Provider.FACEBOOK,\n Provider.GITHUB,\n Provider.GOOGLE,\n Provider.LINKEDIN,\n Provider.MICROSOFT,\n Provider.SLACK,\n Provider.WECHAT,\n Provider.X,\n Provider.EMAIL,\n Provider.PHONE,\n] as const;\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/core/index.ts"],"sourcesContent":["export type JSONValue =\n | null\n | string\n | number\n | boolean\n | { [value: string]: JSONValue }\n | Array<JSONValue>;\n\nexport interface Principal {\n name: string;\n}\n\nexport interface Authentication extends Principal {\n authorities: string[];\n authenticated: boolean;\n}\n\nexport interface CsrfToken {\n token: string;\n headerName: string;\n parameterName: string;\n}\n\nexport enum Provider {\n // oauth2\n APPLE = 'APPLE',\n DISCORD = 'DISCORD',\n FACEBOOK = 'FACEBOOK',\n GITHUB = 'GITHUB',\n GOOGLE = 'GOOGLE',\n LINKEDIN = 'LINKEDIN',\n MICROSOFT = 'MICROSOFT',\n SLACK = 'SLACK',\n WECHAT = 'WECHAT',\n X = 'X',\n // contact\n EMAIL = 'EMAIL',\n PHONE = 'PHONE',\n}\n\nexport const ALL_PROVIDERS = [\n Provider.APPLE,\n Provider.DISCORD,\n Provider.FACEBOOK,\n Provider.GITHUB,\n Provider.GOOGLE,\n Provider.LINKEDIN,\n Provider.MICROSOFT,\n Provider.SLACK,\n Provider.WECHAT,\n Provider.X,\n Provider.EMAIL,\n Provider.PHONE,\n] as const;\n"],"mappings":";AAuBA,IAAY,WAAL,yBAAA,UAAA;CAEL,SAAA,WAAA;CACA,SAAA,aAAA;CACA,SAAA,cAAA;CACA,SAAA,YAAA;CACA,SAAA,YAAA;CACA,SAAA,cAAA;CACA,SAAA,eAAA;CACA,SAAA,WAAA;CACA,SAAA,YAAA;CACA,SAAA,OAAA;CAEA,SAAA,WAAA;CACA,SAAA,WAAA;;AACF,EAAA,CAAA,CAAA;AAEA,MAAa,gBAAgB;;;;;;;;;;;;;AAa7B"}
|
package/dist/email/schema.cjs
CHANGED
|
@@ -1,41 +1,16 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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/email/schema.ts
|
|
21
|
-
var schema_exports = {};
|
|
22
|
-
__export(schema_exports, {
|
|
23
|
-
loginEmailSchema: () => loginEmailSchema,
|
|
24
|
-
sendEmailVerificationCodeSchema: () => sendEmailVerificationCodeSchema
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(schema_exports);
|
|
27
|
-
var import_mini = require("zod/mini");
|
|
28
|
-
var sendEmailVerificationCodeSchema = (0, import_mini.object)({
|
|
29
|
-
email: (0, import_mini.email)().check((0, import_mini.maxLength)(320)),
|
|
30
|
-
turnstileToken: (0, import_mini.string)().check((0, import_mini.maxLength)(2048))
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let zod_mini = require("zod/mini");
|
|
3
|
+
//#region src/email/schema.ts
|
|
4
|
+
const sendEmailVerificationCodeSchema = (0, zod_mini.object)({
|
|
5
|
+
email: (0, zod_mini.email)().check((0, zod_mini.maxLength)(320)),
|
|
6
|
+
turnstileToken: (0, zod_mini.string)().check((0, zod_mini.maxLength)(2048))
|
|
31
7
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
36
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
-
0 && (module.exports = {
|
|
38
|
-
loginEmailSchema,
|
|
39
|
-
sendEmailVerificationCodeSchema
|
|
8
|
+
const loginEmailSchema = (0, zod_mini.object)({
|
|
9
|
+
email: (0, zod_mini.email)().check((0, zod_mini.maxLength)(320)),
|
|
10
|
+
verificationCode: (0, zod_mini.string)().check((0, zod_mini.regex)(/^\d{6}$/))
|
|
40
11
|
});
|
|
12
|
+
//#endregion
|
|
13
|
+
exports.loginEmailSchema = loginEmailSchema;
|
|
14
|
+
exports.sendEmailVerificationCodeSchema = sendEmailVerificationCodeSchema;
|
|
15
|
+
|
|
41
16
|
//# sourceMappingURL=schema.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/email/schema.ts"],"sourcesContent":["import { email, maxLength, object, regex, string } from 'zod/mini';\n\nexport const sendEmailVerificationCodeSchema = object({\n email: email().check(maxLength(320)),\n turnstileToken: string().check(maxLength(2048)),\n});\n\nexport const loginEmailSchema = object({\n email: email().check(maxLength(320)),\n verificationCode: string().check(regex(/^\\d{6}$/)),\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.cjs","names":[],"sources":["../../src/email/schema.ts"],"sourcesContent":["import { email, maxLength, object, regex, string } from 'zod/mini';\n\nexport const sendEmailVerificationCodeSchema = object({\n email: email().check(maxLength(320)),\n turnstileToken: string().check(maxLength(2048)),\n});\n\nexport const loginEmailSchema = object({\n email: email().check(maxLength(320)),\n verificationCode: string().check(regex(/^\\d{6}$/)),\n});\n"],"mappings":";;;AAEA,MAAa,mCAAA,GAAA,SAAA,OAAA,CAAyC;CACpD,QAAA,GAAA,SAAA,MAAA,CAAa,CAAC,CAAC,OAAA,GAAA,SAAA,UAAA,CAAgB,GAAG,CAAC;CACnC,iBAAA,GAAA,SAAA,OAAA,CAAuB,CAAC,CAAC,OAAA,GAAA,SAAA,UAAA,CAAgB,IAAI,CAAC;AAChD,CAAC;AAED,MAAa,oBAAA,GAAA,SAAA,OAAA,CAA0B;CACrC,QAAA,GAAA,SAAA,MAAA,CAAa,CAAC,CAAC,OAAA,GAAA,SAAA,UAAA,CAAgB,GAAG,CAAC;CACnC,mBAAA,GAAA,SAAA,OAAA,CAAyB,CAAC,CAAC,OAAA,GAAA,SAAA,MAAA,CAAY,SAAS,CAAC;AACnD,CAAC"}
|
package/dist/email/schema.d.cts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}, zod_v4_core.$strip>;
|
|
12
|
-
|
|
1
|
+
//#region src/email/schema.d.ts
|
|
2
|
+
declare const sendEmailVerificationCodeSchema: import("zod/mini").ZodMiniObject<{
|
|
3
|
+
email: import("zod/mini").ZodMiniEmail;
|
|
4
|
+
turnstileToken: import("zod/mini").ZodMiniString<string>;
|
|
5
|
+
}, import("zod/v4/core").$strip>;
|
|
6
|
+
declare const loginEmailSchema: import("zod/mini").ZodMiniObject<{
|
|
7
|
+
email: import("zod/mini").ZodMiniEmail;
|
|
8
|
+
verificationCode: import("zod/mini").ZodMiniString<string>;
|
|
9
|
+
}, import("zod/v4/core").$strip>;
|
|
10
|
+
//#endregion
|
|
13
11
|
export { loginEmailSchema, sendEmailVerificationCodeSchema };
|
|
12
|
+
//# sourceMappingURL=schema.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.cts","names":[],"sources":["../../src/email/schema.ts"],"mappings":";cAEa,oDAA+B;;;;cAK/B,qCAAgB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/email/schema.d.ts
|
|
2
|
+
declare const sendEmailVerificationCodeSchema: import("zod/mini").ZodMiniObject<{
|
|
3
|
+
email: import("zod/mini").ZodMiniEmail;
|
|
4
|
+
turnstileToken: import("zod/mini").ZodMiniString<string>;
|
|
5
|
+
}, import("zod/v4/core").$strip>;
|
|
6
|
+
declare const loginEmailSchema: import("zod/mini").ZodMiniObject<{
|
|
7
|
+
email: import("zod/mini").ZodMiniEmail;
|
|
8
|
+
verificationCode: import("zod/mini").ZodMiniString<string>;
|
|
9
|
+
}, import("zod/v4/core").$strip>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { loginEmailSchema, sendEmailVerificationCodeSchema };
|
|
12
|
+
//# sourceMappingURL=schema.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.mts","names":[],"sources":["../../src/email/schema.ts"],"mappings":";cAEa,oDAA+B;;;;cAK/B,qCAAgB"}
|
package/dist/email/schema.mjs
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
// src/email/schema.ts
|
|
2
1
|
import { email, maxLength, object, regex, string } from "zod/mini";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
//#region src/email/schema.ts
|
|
3
|
+
const sendEmailVerificationCodeSchema = object({
|
|
4
|
+
email: email().check(maxLength(320)),
|
|
5
|
+
turnstileToken: string().check(maxLength(2048))
|
|
6
6
|
});
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const loginEmailSchema = object({
|
|
8
|
+
email: email().check(maxLength(320)),
|
|
9
|
+
verificationCode: string().check(regex(/^\d{6}$/))
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { loginEmailSchema, sendEmailVerificationCodeSchema };
|
|
13
|
+
|
|
15
14
|
//# sourceMappingURL=schema.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/email/schema.ts"],"sourcesContent":["import { email, maxLength, object, regex, string } from 'zod/mini';\n\nexport const sendEmailVerificationCodeSchema = object({\n email: email().check(maxLength(320)),\n turnstileToken: string().check(maxLength(2048)),\n});\n\nexport const loginEmailSchema = object({\n email: email().check(maxLength(320)),\n verificationCode: string().check(regex(/^\\d{6}$/)),\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.mjs","names":[],"sources":["../../src/email/schema.ts"],"sourcesContent":["import { email, maxLength, object, regex, string } from 'zod/mini';\n\nexport const sendEmailVerificationCodeSchema = object({\n email: email().check(maxLength(320)),\n turnstileToken: string().check(maxLength(2048)),\n});\n\nexport const loginEmailSchema = object({\n email: email().check(maxLength(320)),\n verificationCode: string().check(regex(/^\\d{6}$/)),\n});\n"],"mappings":";;AAEA,MAAa,kCAAkC,OAAO;CACpD,OAAO,MAAM,CAAC,CAAC,MAAM,UAAU,GAAG,CAAC;CACnC,gBAAgB,OAAO,CAAC,CAAC,MAAM,UAAU,IAAI,CAAC;AAChD,CAAC;AAED,MAAa,mBAAmB,OAAO;CACrC,OAAO,MAAM,CAAC,CAAC,MAAM,UAAU,GAAG,CAAC;CACnC,kBAAkB,OAAO,CAAC,CAAC,MAAM,MAAM,SAAS,CAAC;AACnD,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,54 +1,17 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
ALL_PROVIDERS: () => import_core.ALL_PROVIDERS,
|
|
24
|
-
Auth: () => import_auth.Auth,
|
|
25
|
-
DBIndexedSessionRepository: () => import_db.DBIndexedSessionRepository,
|
|
26
|
-
OAuth2Client: () => import_client.OAuth2Client,
|
|
27
|
-
PATH: () => import_auth.PATH,
|
|
28
|
-
PRINCIPAL_NAME_INDEX_NAME: () => import_common.PRINCIPAL_NAME_INDEX_NAME,
|
|
29
|
-
Provider: () => import_core.Provider,
|
|
30
|
-
RedisIndexedSessionRepository: () => import_redis.RedisIndexedSessionRepository,
|
|
31
|
-
RedisKVRepository: () => import_redis.RedisKVRepository,
|
|
32
|
-
oauth2RedirectQuerySchema: () => import_client.oauth2RedirectQuerySchema
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(index_exports);
|
|
35
|
-
var import_auth = require("./auth/index.cjs");
|
|
36
|
-
var import_client = require("./oauth2/client.cjs");
|
|
37
|
-
var import_redis = require("./session/redis.cjs");
|
|
38
|
-
var import_db = require("./session/db.cjs");
|
|
39
|
-
var import_common = require("./session/common.cjs");
|
|
40
|
-
var import_core = require("./core/index.cjs");
|
|
41
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
-
0 && (module.exports = {
|
|
43
|
-
ALL_PROVIDERS,
|
|
44
|
-
Auth,
|
|
45
|
-
DBIndexedSessionRepository,
|
|
46
|
-
OAuth2Client,
|
|
47
|
-
PATH,
|
|
48
|
-
PRINCIPAL_NAME_INDEX_NAME,
|
|
49
|
-
Provider,
|
|
50
|
-
RedisIndexedSessionRepository,
|
|
51
|
-
RedisKVRepository,
|
|
52
|
-
oauth2RedirectQuerySchema
|
|
53
|
-
});
|
|
54
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_core_index = require("./core/index.cjs");
|
|
3
|
+
const require_oauth2_client = require("./oauth2/client.cjs");
|
|
4
|
+
const require_session_common = require("./session/common.cjs");
|
|
5
|
+
const require_auth_index = require("./auth/index.cjs");
|
|
6
|
+
const require_session_redis = require("./session/redis.cjs");
|
|
7
|
+
const require_session_db = require("./session/db.cjs");
|
|
8
|
+
exports.ALL_PROVIDERS = require_core_index.ALL_PROVIDERS;
|
|
9
|
+
exports.Auth = require_auth_index.Auth;
|
|
10
|
+
exports.DBIndexedSessionRepository = require_session_db.DBIndexedSessionRepository;
|
|
11
|
+
exports.OAuth2Client = require_oauth2_client.OAuth2Client;
|
|
12
|
+
exports.PATH = require_auth_index.PATH;
|
|
13
|
+
exports.PRINCIPAL_NAME_INDEX_NAME = require_session_common.PRINCIPAL_NAME_INDEX_NAME;
|
|
14
|
+
exports.Provider = require_core_index.Provider;
|
|
15
|
+
exports.RedisIndexedSessionRepository = require_session_redis.RedisIndexedSessionRepository;
|
|
16
|
+
exports.RedisKVRepository = require_session_redis.RedisKVRepository;
|
|
17
|
+
exports.oauth2RedirectQuerySchema = require_oauth2_client.oauth2RedirectQuerySchema;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import 'zod/mini';
|
|
12
|
-
import 'ioredis';
|
|
13
|
-
import './session/map-session.cjs';
|
|
14
|
-
import './utils/http.cjs';
|
|
15
|
-
import 'cookie';
|
|
1
|
+
import { ALL_PROVIDERS, CsrfToken, Principal, Provider } from "./core/index.cjs";
|
|
2
|
+
import { KVRepository, Namespace, Session, SessionRepository } from "./session/types.cjs";
|
|
3
|
+
import { NativeCredential, OAuth2Token, OidcScopes, OidcToken, StandardClaims, UserInfo } from "./oauth2/types.cjs";
|
|
4
|
+
import { AuthConfig, AuthService } from "./auth/types.cjs";
|
|
5
|
+
import { Auth, PATH } from "./auth/index.cjs";
|
|
6
|
+
import { OAuth2Client, oauth2RedirectQuerySchema } from "./oauth2/client.cjs";
|
|
7
|
+
import { RedisIndexedSessionRepository, RedisKVRepository } from "./session/redis.cjs";
|
|
8
|
+
import { DBAdapter, DBIndexedSessionRepository } from "./session/db.cjs";
|
|
9
|
+
import { PRINCIPAL_NAME_INDEX_NAME } from "./session/common.cjs";
|
|
10
|
+
export { ALL_PROVIDERS, Auth, type AuthConfig, type AuthService, type CsrfToken, type DBAdapter, DBIndexedSessionRepository, type KVRepository, type Namespace, type NativeCredential, OAuth2Client, type OAuth2Token, type OidcScopes, type OidcToken, PATH, PRINCIPAL_NAME_INDEX_NAME, type Principal, Provider, RedisIndexedSessionRepository, RedisKVRepository, type Session, type SessionRepository, type StandardClaims, type UserInfo, oauth2RedirectQuerySchema };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ALL_PROVIDERS, CsrfToken, Principal, Provider } from "./core/index.mjs";
|
|
2
|
+
import { KVRepository, Namespace, Session, SessionRepository } from "./session/types.mjs";
|
|
3
|
+
import { NativeCredential, OAuth2Token, OidcScopes, OidcToken, StandardClaims, UserInfo } from "./oauth2/types.mjs";
|
|
4
|
+
import { AuthConfig, AuthService } from "./auth/types.mjs";
|
|
5
|
+
import { Auth, PATH } from "./auth/index.mjs";
|
|
6
|
+
import { OAuth2Client, oauth2RedirectQuerySchema } from "./oauth2/client.mjs";
|
|
7
|
+
import { RedisIndexedSessionRepository, RedisKVRepository } from "./session/redis.mjs";
|
|
8
|
+
import { DBAdapter, DBIndexedSessionRepository } from "./session/db.mjs";
|
|
9
|
+
import { PRINCIPAL_NAME_INDEX_NAME } from "./session/common.mjs";
|
|
10
|
+
export { ALL_PROVIDERS, Auth, type AuthConfig, type AuthService, type CsrfToken, type DBAdapter, DBIndexedSessionRepository, type KVRepository, type Namespace, type NativeCredential, OAuth2Client, type OAuth2Token, type OidcScopes, type OidcToken, PATH, PRINCIPAL_NAME_INDEX_NAME, type Principal, Provider, RedisIndexedSessionRepository, RedisKVRepository, type Session, type SessionRepository, type StandardClaims, type UserInfo, oauth2RedirectQuerySchema };
|
package/dist/index.mjs
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { Auth, PATH } from "./auth/index.mjs";
|
|
1
|
+
import { ALL_PROVIDERS, Provider } from "./core/index.mjs";
|
|
3
2
|
import { OAuth2Client, oauth2RedirectQuerySchema } from "./oauth2/client.mjs";
|
|
3
|
+
import { PRINCIPAL_NAME_INDEX_NAME } from "./session/common.mjs";
|
|
4
|
+
import { Auth, PATH } from "./auth/index.mjs";
|
|
4
5
|
import { RedisIndexedSessionRepository, RedisKVRepository } from "./session/redis.mjs";
|
|
5
6
|
import { DBIndexedSessionRepository } from "./session/db.mjs";
|
|
6
|
-
|
|
7
|
-
import { Provider, ALL_PROVIDERS } from "./core/index.mjs";
|
|
8
|
-
export {
|
|
9
|
-
ALL_PROVIDERS,
|
|
10
|
-
Auth,
|
|
11
|
-
DBIndexedSessionRepository,
|
|
12
|
-
OAuth2Client,
|
|
13
|
-
PATH,
|
|
14
|
-
PRINCIPAL_NAME_INDEX_NAME,
|
|
15
|
-
Provider,
|
|
16
|
-
RedisIndexedSessionRepository,
|
|
17
|
-
RedisKVRepository,
|
|
18
|
-
oauth2RedirectQuerySchema
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=index.mjs.map
|
|
7
|
+
export { ALL_PROVIDERS, Auth, DBIndexedSessionRepository, OAuth2Client, PATH, PRINCIPAL_NAME_INDEX_NAME, Provider, RedisIndexedSessionRepository, RedisKVRepository, oauth2RedirectQuerySchema };
|