ecwt 0.1.1-beta.1 → 0.1.1-beta.2

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 CHANGED
@@ -156,15 +156,15 @@ Creates a token.
156
156
 
157
157
  `options.ttl` specifies the time to live of the token in seconds. If set to null, token will never expire.
158
158
 
159
- > **Be careful with `ttl=null`!**
159
+ > **Be careful with `ttl = null`!**
160
160
  >
161
- > Revoked tokens are stored in Redis until they expire. But such tokens will be stored in Redis forever, which will lead to uncontrolled Redis database growth.
161
+ > Revoked tokens are stored in Redis until they expire. Never-expiring tokens will be stored in Redis **forever**, which will lead to uncontrolled Redis database growth.
162
162
 
163
163
  Returns `Ecwt` instance.
164
164
 
165
165
  ```javascript
166
166
  // Example
167
- const ecwt_token = await ecwtFactory.create(
167
+ const ecwt = await ecwtFactory.create(
168
168
  {
169
169
  user_id: 1,
170
170
  nick: 'kirick',
@@ -195,12 +195,12 @@ Returns `Ecwt` instance.
195
195
  If the token is invalid, throws `EcwtInvalidError` which contains `Ecwt` instance in the `ecwt` property.
196
196
 
197
197
  ```javascript
198
- const ecwt_token = await ecwtFactory.verify(token);
198
+ const ecwt = await ecwtFactory.verify(token);
199
199
  ```
200
200
 
201
201
  ### `Ecwt`
202
202
 
203
- Represents the token. It cannot be created by the user.
203
+ Represents the token. Its counstructor cannot be called by the user.
204
204
 
205
205
  ```javascript
206
206
  import { Ecwt } from 'ecwt';
package/dist/ecwt.cjs CHANGED
@@ -30,7 +30,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  var main_exports = {};
31
31
  __export(main_exports, {
32
32
  Ecwt: () => Ecwt,
33
- EcwtFactory: () => EcwtFactory
33
+ EcwtExpiredError: () => EcwtExpiredError,
34
+ EcwtFactory: () => EcwtFactory,
35
+ EcwtInvalidError: () => EcwtInvalidError,
36
+ EcwtRevokedError: () => EcwtRevokedError
34
37
  });
35
38
  module.exports = __toCommonJS(main_exports);
36
39
 
@@ -426,5 +429,8 @@ var EcwtFactory = class {
426
429
  // Annotate the CommonJS export names for ESM import in node:
427
430
  0 && (module.exports = {
428
431
  Ecwt,
429
- EcwtFactory
432
+ EcwtExpiredError,
433
+ EcwtFactory,
434
+ EcwtInvalidError,
435
+ EcwtRevokedError
430
436
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecwt",
3
- "version": "0.1.1-beta.1",
3
+ "version": "0.1.1-beta.2",
4
4
  "description": "Encrypted CBOR-encoded Web Token",
5
5
  "main": "src/main.js",
6
6
  "type": "module",
package/src/main.js CHANGED
@@ -1,3 +1,8 @@
1
1
 
2
2
  export { EcwtFactory } from './factory.js';
3
3
  export { Ecwt } from './token.js';
4
+ export {
5
+ EcwtInvalidError,
6
+ EcwtExpiredError,
7
+ EcwtRevokedError,
8
+ } from './utils/errors.js';