otplib 13.2.1 → 13.3.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/README.md +1 -1
- package/dist/class.cjs +1 -1
- package/dist/class.cjs.map +1 -1
- package/dist/class.d.cts +17 -2
- package/dist/class.d.ts +17 -2
- package/dist/class.js +1 -1
- package/dist/class.js.map +1 -1
- package/dist/functional.cjs +1 -1
- package/dist/functional.cjs.map +1 -1
- package/dist/functional.d.cts +1 -1
- package/dist/functional.d.ts +1 -1
- package/dist/functional.js +1 -1
- package/dist/functional.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/{types-Bap9LCID.d.cts → types-BBT_82HF.d.cts} +15 -2
- package/dist/{types-Bap9LCID.d.ts → types-BBT_82HF.d.ts} +15 -2
- package/package.json +29 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CryptoPlugin, Base32Plugin, OTPGuardrails, HashAlgorithm, Digits } from '@otplib/core';
|
|
1
|
+
import { CryptoPlugin, Base32Plugin, OTPGuardrails, HashAlgorithm, Digits, OTPHooks } from '@otplib/core';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Type definitions for otplib package
|
|
@@ -80,6 +80,12 @@ type OTPGenerateOptions = {
|
|
|
80
80
|
* Used by HOTP strategy (required)
|
|
81
81
|
*/
|
|
82
82
|
counter?: number;
|
|
83
|
+
/**
|
|
84
|
+
* Hooks for customizing token encoding and validation.
|
|
85
|
+
* Allows non-standard OTP variants (e.g., Steam Guard) to replace
|
|
86
|
+
* the default numeric encoding with custom schemes.
|
|
87
|
+
*/
|
|
88
|
+
hooks?: OTPHooks;
|
|
83
89
|
};
|
|
84
90
|
/**
|
|
85
91
|
* Options for OTP verification
|
|
@@ -104,6 +110,13 @@ type OTPVerifyOptions = OTPGenerateOptions & {
|
|
|
104
110
|
* - Tuple [past, future]: explicit window control
|
|
105
111
|
*/
|
|
106
112
|
counterTolerance?: number | [number, number];
|
|
113
|
+
/**
|
|
114
|
+
* Minimum allowed TOTP time step for replay protection (optional)
|
|
115
|
+
*
|
|
116
|
+
* Rejects tokens with timeStep <= afterTimeStep.
|
|
117
|
+
* Only used by TOTP strategy.
|
|
118
|
+
*/
|
|
119
|
+
afterTimeStep?: number;
|
|
107
120
|
};
|
|
108
121
|
|
|
109
|
-
export type { OTPAuthOptions as O, OTPGenerateOptions as a,
|
|
122
|
+
export type { OTPAuthOptions as O, OTPGenerateOptions as a, OTPStrategy as b, OTPVerifyOptions as c };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "otplib",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.3.0",
|
|
4
4
|
"description": "TypeScript-first library for TOTP and HOTP with multi-runtime and plugin support",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Gerald Yeo <support@yeojz.dev>",
|
|
@@ -41,6 +41,26 @@
|
|
|
41
41
|
"types": "./dist/index.d.cts",
|
|
42
42
|
"default": "./dist/index.cjs"
|
|
43
43
|
}
|
|
44
|
+
},
|
|
45
|
+
"./functional": {
|
|
46
|
+
"import": {
|
|
47
|
+
"types": "./dist/functional.d.ts",
|
|
48
|
+
"default": "./dist/functional.js"
|
|
49
|
+
},
|
|
50
|
+
"require": {
|
|
51
|
+
"types": "./dist/functional.d.cts",
|
|
52
|
+
"default": "./dist/functional.cjs"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"./class": {
|
|
56
|
+
"import": {
|
|
57
|
+
"types": "./dist/class.d.ts",
|
|
58
|
+
"default": "./dist/class.js"
|
|
59
|
+
},
|
|
60
|
+
"require": {
|
|
61
|
+
"types": "./dist/class.d.cts",
|
|
62
|
+
"default": "./dist/class.cjs"
|
|
63
|
+
}
|
|
44
64
|
}
|
|
45
65
|
},
|
|
46
66
|
"files": [
|
|
@@ -49,18 +69,17 @@
|
|
|
49
69
|
"LICENSE"
|
|
50
70
|
],
|
|
51
71
|
"dependencies": {
|
|
52
|
-
"@otplib/
|
|
53
|
-
"@otplib/
|
|
54
|
-
"@otplib/
|
|
55
|
-
"@otplib/
|
|
56
|
-
"@otplib/plugin-
|
|
57
|
-
"@otplib/
|
|
72
|
+
"@otplib/uri": "13.3.0",
|
|
73
|
+
"@otplib/hotp": "13.3.0",
|
|
74
|
+
"@otplib/totp": "13.3.0",
|
|
75
|
+
"@otplib/plugin-crypto-noble": "13.3.0",
|
|
76
|
+
"@otplib/plugin-base32-scure": "13.3.0",
|
|
77
|
+
"@otplib/core": "13.3.0"
|
|
58
78
|
},
|
|
59
79
|
"devDependencies": {
|
|
60
|
-
"tsup": "^8.
|
|
61
|
-
"typescript": "^5.
|
|
80
|
+
"tsup": "^8.5.1",
|
|
81
|
+
"typescript": "^5.9.3",
|
|
62
82
|
"vitest": "^4.0.18",
|
|
63
|
-
"@otplib/plugin-crypto-noble": "13.2.1",
|
|
64
83
|
"@repo/testing": "13.0.1"
|
|
65
84
|
},
|
|
66
85
|
"publishConfig": {
|