auth-vir 0.0.2 → 0.0.4

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.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { CookieParams } from './cookie.js';
2
- import { ParseJwtParams } from './jwt.js';
1
+ import { type CookieParams } from './cookie.js';
2
+ import { type ParseJwtParams } from './jwt.js';
3
3
  /**
4
4
  * All possible headers container types supported by {@link extractUserIdFromRequestHeaders}.
5
5
  *
package/dist/cookie.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { type PartialWithUndefined } from '@augment-vir/common';
2
2
  import { type AnyDuration } from 'date-vir';
3
- import { CreateJwtParams, type ParseJwtParams } from './jwt.js';
4
- import { UserJwtData } from './user-jwt.js';
3
+ import { type CreateJwtParams, type ParseJwtParams } from './jwt.js';
4
+ import { type UserJwtData } from './user-jwt.js';
5
5
  /**
6
6
  * Parameters for {@link generateCookie}.
7
7
  *
@@ -1,2 +1,3 @@
1
+ import { stringifyWithJson5 } from '@augment-vir/common';
1
2
  import { generateNewJwtKeys } from './jwt-keys.js';
2
- console.info(await generateNewJwtKeys());
3
+ console.info(stringifyWithJson5(await generateNewJwtKeys()));
package/dist/jwt.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import type { AnyObject, PartialWithUndefined } from '@augment-vir/common';
1
+ import { type AnyObject, type PartialWithUndefined } from '@augment-vir/common';
2
2
  import { type AnyDuration, type DateLike } from 'date-vir';
3
- import { JwtKeys } from './jwt-keys.js';
3
+ import { type JwtKeys } from './jwt-keys.js';
4
4
  /**
5
5
  * Params for {@link createJwt}.
6
6
  *
@@ -1,4 +1,4 @@
1
- import { CreateJwtParams, ParseJwtParams } from './jwt.js';
1
+ import { type CreateJwtParams, type ParseJwtParams } from './jwt.js';
2
2
  /**
3
3
  * Shape definition and source of truth for {@link UserJwtData}.
4
4
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auth-vir",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Auth made easy and secure via JWT cookies, CSRF tokens, and password hashing helpers.",
5
5
  "keywords": [
6
6
  "auth",
@@ -28,7 +28,7 @@
28
28
  "main": "dist/index.js",
29
29
  "module": "dist/index.js",
30
30
  "types": "dist/index.d.ts",
31
- "bin": "",
31
+ "bin": "bin.js",
32
32
  "scripts": {
33
33
  "build": "virmator frontend build",
34
34
  "compile": "virmator compile",
@@ -40,16 +40,16 @@
40
40
  "test:update": "npm test update"
41
41
  },
42
42
  "dependencies": {
43
- "@augment-vir/assert": "^31.11.0",
44
- "@augment-vir/common": "^31.11.0",
43
+ "@augment-vir/assert": "^31.17.1",
44
+ "@augment-vir/common": "^31.17.1",
45
45
  "date-vir": "^7.3.1",
46
46
  "hash-wasm": "^4.12.0",
47
- "jose": "^6.0.10",
47
+ "jose": "^6.0.11",
48
48
  "object-shape-tester": "^5.1.5",
49
49
  "url-vir": "^2.1.3"
50
50
  },
51
51
  "devDependencies": {
52
- "@augment-vir/test": "^31.11.0",
52
+ "@augment-vir/test": "^31.17.1",
53
53
  "@web/dev-server-esbuild": "^1.0.4",
54
54
  "@web/test-runner": "^0.20.1",
55
55
  "@web/test-runner-commands": "^0.9.0",
@@ -57,7 +57,7 @@
57
57
  "@web/test-runner-visual-regression": "^0.10.0",
58
58
  "istanbul-smart-text-reporter": "^1.1.5",
59
59
  "markdown-code-example-inserter": "^3.0.3",
60
- "typedoc": "^0.28.2"
60
+ "typedoc": "^0.28.4"
61
61
  },
62
62
  "engines": {
63
63
  "node": ">=22"
package/src/auth.ts CHANGED
@@ -1,6 +1,6 @@
1
- import {CookieParams, extractCookieJwt, generateCookie} from './cookie.js';
1
+ import {type CookieParams, extractCookieJwt, generateCookie} from './cookie.js';
2
2
  import {csrfTokenHeaderName, generateCsrfToken} from './csrf-token.js';
3
- import {ParseJwtParams} from './jwt.js';
3
+ import {type ParseJwtParams} from './jwt.js';
4
4
 
5
5
  /**
6
6
  * All possible headers container types supported by {@link extractUserIdFromRequestHeaders}.
package/src/cookie.ts CHANGED
@@ -2,8 +2,8 @@ import {check} from '@augment-vir/assert';
2
2
  import {safeMatch, type PartialWithUndefined} from '@augment-vir/common';
3
3
  import {convertDuration, type AnyDuration} from 'date-vir';
4
4
  import {parseUrl} from 'url-vir';
5
- import {CreateJwtParams, type ParseJwtParams} from './jwt.js';
6
- import {createUserJwt, parseUserJwt, UserJwtData} from './user-jwt.js';
5
+ import {type CreateJwtParams, type ParseJwtParams} from './jwt.js';
6
+ import {createUserJwt, parseUserJwt, type UserJwtData} from './user-jwt.js';
7
7
 
8
8
  /**
9
9
  * Parameters for {@link generateCookie}.
@@ -1,3 +1,4 @@
1
+ import {stringifyWithJson5} from '@augment-vir/common';
1
2
  import {generateNewJwtKeys} from './jwt-keys.js';
2
3
 
3
- console.info(await generateNewJwtKeys());
4
+ console.info(stringifyWithJson5(await generateNewJwtKeys()));
package/src/jwt.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import {check} from '@augment-vir/assert';
2
- import type {AnyObject, PartialWithUndefined} from '@augment-vir/common';
2
+ import {type AnyObject, type PartialWithUndefined} from '@augment-vir/common';
3
3
  import {
4
4
  calculateRelativeDate,
5
5
  createFullDateInUserTimezone,
@@ -9,7 +9,7 @@ import {
9
9
  type DateLike,
10
10
  } from 'date-vir';
11
11
  import {EncryptJWT, jwtDecrypt, jwtVerify, SignJWT} from 'jose';
12
- import {JwtKeys} from './jwt-keys.js';
12
+ import {type JwtKeys} from './jwt-keys.js';
13
13
 
14
14
  const encryptionProtectedHeader = {alg: 'dir', enc: 'A256GCM'};
15
15
  const signingProtectedHeader = {alg: 'HS512'};
package/src/user-jwt.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import {defineShape, isValidShape} from 'object-shape-tester';
2
2
  import {type generateCsrfToken} from './csrf-token.js';
3
- import {createJwt, CreateJwtParams, parseJwt, ParseJwtParams} from './jwt.js';
3
+ import {createJwt, type CreateJwtParams, parseJwt, type ParseJwtParams} from './jwt.js';
4
4
 
5
5
  /**
6
6
  * Shape definition and source of truth for {@link UserJwtData}.