ecwt 0.2.0-beta.4 → 0.2.0-beta.5
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/ecwt.cjs +2 -2
- package/package.json +1 -1
- package/src/factory.js +2 -2
- package/src/main.js +2 -0
- package/src/token.js +2 -0
- package/src/utils/base62.js +2 -0
- package/src/utils/errors.js +2 -0
- package/src/utils/time.js +2 -0
package/dist/ecwt.cjs
CHANGED
|
@@ -419,7 +419,7 @@ var EcwtFactory = class {
|
|
|
419
419
|
* Parses token without throwing errors.
|
|
420
420
|
* @async
|
|
421
421
|
* @param {string} token String representation of token.
|
|
422
|
-
* @returns {Promise<{ success:
|
|
422
|
+
* @returns {Promise<{ success: true, ecwt: Ecwt } | { success: false, ecwt: Ecwt | null }>} Returns whether token was parsed and verified successfully and Ecwt if parsed.
|
|
423
423
|
*/
|
|
424
424
|
async safeVerify(token) {
|
|
425
425
|
let ecwt = null;
|
|
@@ -451,7 +451,7 @@ var EcwtFactory = class {
|
|
|
451
451
|
* @param {object} options -
|
|
452
452
|
* @param {string} options.token_id -
|
|
453
453
|
* @param {number} options.ts_ms_created -
|
|
454
|
-
* @param {number} options.ttl_initial -
|
|
454
|
+
* @param {number | null} options.ttl_initial -
|
|
455
455
|
* @returns {Promise<void>} -
|
|
456
456
|
*/
|
|
457
457
|
async _revoke({
|
package/package.json
CHANGED
package/src/factory.js
CHANGED
|
@@ -311,7 +311,7 @@ export class EcwtFactory {
|
|
|
311
311
|
* Parses token without throwing errors.
|
|
312
312
|
* @async
|
|
313
313
|
* @param {string} token String representation of token.
|
|
314
|
-
* @returns {Promise<{ success:
|
|
314
|
+
* @returns {Promise<{ success: true, ecwt: Ecwt } | { success: false, ecwt: Ecwt | null }>} Returns whether token was parsed and verified successfully and Ecwt if parsed.
|
|
315
315
|
*/
|
|
316
316
|
async safeVerify(token) {
|
|
317
317
|
let ecwt = null;
|
|
@@ -348,7 +348,7 @@ export class EcwtFactory {
|
|
|
348
348
|
* @param {object} options -
|
|
349
349
|
* @param {string} options.token_id -
|
|
350
350
|
* @param {number} options.ts_ms_created -
|
|
351
|
-
* @param {number} options.ttl_initial -
|
|
351
|
+
* @param {number | null} options.ttl_initial -
|
|
352
352
|
* @returns {Promise<void>} -
|
|
353
353
|
*/
|
|
354
354
|
async _revoke({
|
package/src/main.js
CHANGED
package/src/token.js
CHANGED
package/src/utils/base62.js
CHANGED
package/src/utils/errors.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
|
|
2
|
+
// @ts-check
|
|
3
|
+
|
|
2
4
|
export class InvalidPackageInstanceError extends TypeError {
|
|
3
5
|
constructor(property, class_name, package_name) {
|
|
4
6
|
super(`Value ${property} must be an instance of ${class_name} from package "${package_name}". That error is probably caused by two separate installations of "${package_name}". Please, make sure that "${package_name}" in your project is matches "peerDependencies" of "ecwt" package.`);
|