@ctx-core/jwt 10.0.29 → 10.0.34

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/.swcrc CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "jsc": {
3
- "target": "es2019",
3
+ "target": "es2020",
4
4
  "parser": {
5
5
  "syntax": "typescript",
6
6
  "tsx": true,
package/CHANGELOG.md CHANGED
@@ -1,5 +1,59 @@
1
1
  # @ctx-core/jwt
2
2
 
3
+ ## 10.0.34
4
+
5
+ ### Patch Changes
6
+
7
+ - @swc/core: ^1.2.116 -> ^1.2.117
8
+ - Updated dependencies
9
+ - @ctx-core/atob@10.0.29
10
+ - @ctx-core/error@11.1.5
11
+ - @ctx-core/function@20.2.9
12
+
13
+ ## 10.0.33
14
+
15
+ ### Patch Changes
16
+
17
+ - @swc/core: ^1.2.113 -> ^1.2.116
18
+ - Updated dependencies
19
+ - @ctx-core/atob@10.0.28
20
+ - @ctx-core/error@11.1.4
21
+ - @ctx-core/function@20.2.8
22
+
23
+ ## 10.0.32
24
+
25
+ ### Patch Changes
26
+
27
+ - @swc/cli: ^0.1.51 -> ^0.1.52
28
+ - @swc/core: ^1.2.111 -> ^1.2.113
29
+ - Updated dependencies
30
+ - Updated dependencies
31
+ - @ctx-core/atob@10.0.27
32
+ - @ctx-core/error@11.1.3
33
+ - @ctx-core/function@20.2.7
34
+
35
+ ## 10.0.31
36
+
37
+ ### Patch Changes
38
+
39
+ - @swc/core: ^1.2.110 -> ^1.2.111
40
+ - Updated dependencies
41
+ - @ctx-core/atob@10.0.26
42
+ - @ctx-core/error@11.1.2
43
+ - @ctx-core/function@20.2.6
44
+
45
+ ## 10.0.30
46
+
47
+ ### Patch Changes
48
+
49
+ - typescript: ^4.4.4 -> ^4.5.2
50
+ - @swc/core: ^1.2.108 -> ^1.2.110
51
+ - Updated dependencies
52
+ - Updated dependencies
53
+ - @ctx-core/atob@10.0.25
54
+ - @ctx-core/error@11.0.20
55
+ - @ctx-core/function@20.2.5
56
+
3
57
  ## 10.0.29
4
58
 
5
59
  ### Patch Changes
package/COMMIT_EDITMSG ADDED
@@ -0,0 +1 @@
1
+
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/JwtToken.ts"],"sourcesContent":["import type { maybe, nullish } from '@ctx-core/function'\nimport type { error_ctx_I } from '@ctx-core/error'\nexport interface Token {\n\taccess_token: string\n\ttoken_type: string\n\tid_token?:string\n\temail?:string\n\terror?:maybe<error_ctx_I, nullish>\n}\n"],"names":[],"mappings":"AAAA,MAAM"}
1
+ {"version":3,"sources":["../src/JwtToken.ts"],"sourcesContent":["import type { error_ctx_I } from '@ctx-core/error'\nimport type { maybe, nullish } from '@ctx-core/function'\nexport interface Token {\n\taccess_token: string\n\ttoken_type: string\n\tid_token?:string\n\temail?:string\n\terror?:maybe<error_ctx_I, nullish>\n}\n"],"names":[],"mappings":"AAAA,MAAM"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from './header_authorization_jwt_token_.js';
2
- export * from './jwt_token_exp_.js';
3
2
  export * from './jwt_error_ctx_I.js';
3
+ export * from './jwt_token_exp_.js';
4
4
  export * from './JwtToken.js';
5
5
  export * from './validate_current_jwt.js';
6
6
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './header_authorization_jwt_token_.js'\nexport * from './jwt_token_exp_.js'\nexport * from './jwt_error_ctx_I.js'\nexport * from './JwtToken.js'\nexport * from './validate_current_jwt.js'\n"],"names":[],"mappings":"cAAc,CAAsC;cACtC,CAAqB;cACrB,CAAsB;cACtB,CAAe;cACf,CAA2B"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './header_authorization_jwt_token_.js'\nexport * from './jwt_error_ctx_I.js'\nexport * from './jwt_token_exp_.js'\nexport * from './JwtToken.js'\nexport * from './validate_current_jwt.js'\n"],"names":[],"mappings":"cAAc,CAAsC;cACtC,CAAsB;cACtB,CAAqB;cACrB,CAAe;cACf,CAA2B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/jwt_token_exp_.ts"],"sourcesContent":["import type { nullish } from '@ctx-core/function'\nimport { atob_ } from '@ctx-core/atob'\nexport function jwt_token_exp_(jwt_token:string|nullish):number {\n\tconst atob = atob_()\n\tconst jwt_data = jwt_token && JSON.parse(atob(jwt_token.split('.')[1]))\n\treturn jwt_data?.exp\n}\nexport {\n\tjwt_token_exp_ as _jwt_token_exp,\n\tjwt_token_exp_ as _exp__jwt_token,\n}\n"],"names":["atob_","jwt_token_exp_","jwt_token","atob","jwt_data","JSON","parse","split","exp","_jwt_token_exp","_exp__jwt_token"],"mappings":"AACA,MAAM,GAAGA,KAAK,QAAQ,CAAgB;AACtC,MAAM,UAAUC,cAAc,CAACC,SAAwB,EAAS,CAAC;IAChE,KAAK,CAACC,IAAI,GAAGH,KAAK;IAClB,KAAK,CAACI,QAAQ,GAAGF,SAAS,IAAIG,IAAI,CAACC,KAAK,CAACH,IAAI,CAACD,SAAS,CAACK,KAAK,CAAC,CAAG,IAAE,CAAC;IACpE,MAAM,CAACH,QAAQ,aAARA,QAAQ,KAARA,IAAI,CAAJA,CAAa,GAAbA,IAAI,CAAJA,CAAa,GAAbA,QAAQ,CAAEI,GAAG;AACrB,CAAC;AACD,MAAM,GACLP,cAAc,IAAIQ,cAAc,EAChCR,cAAc,IAAIS,eAAe"}
1
+ {"version":3,"sources":["../src/jwt_token_exp_.ts"],"sourcesContent":["import { atob_ } from '@ctx-core/atob'\nimport type { nullish } from '@ctx-core/function'\nexport function jwt_token_exp_(jwt_token:string|nullish):number {\n\tconst atob = atob_()\n\tconst jwt_data = jwt_token && JSON.parse(atob(jwt_token.split('.')[1]))\n\treturn jwt_data?.exp\n}\nexport {\n\tjwt_token_exp_ as _jwt_token_exp,\n\tjwt_token_exp_ as _exp__jwt_token,\n}\n"],"names":["atob_","jwt_token_exp_","jwt_token","atob","jwt_data","JSON","parse","split","exp","_jwt_token_exp","_exp__jwt_token"],"mappings":"AAAA,MAAM,GAAGA,KAAK,QAAQ,CAAgB;AAEtC,MAAM,UAAUC,cAAc,CAACC,SAAwB,EAAS,CAAC;IAChE,KAAK,CAACC,IAAI,GAAGH,KAAK;IAClB,KAAK,CAACI,QAAQ,GAAGF,SAAS,IAAIG,IAAI,CAACC,KAAK,CAACH,IAAI,CAACD,SAAS,CAACK,KAAK,CAAC,CAAG,IAAE,CAAC;IACpE,MAAM,CAACH,QAAQ,aAARA,QAAQ,KAARA,IAAI,CAAJA,CAAa,GAAbA,IAAI,CAAJA,CAAa,GAAbA,QAAQ,CAAEI,GAAG;AACrB,CAAC;AACD,MAAM,GACLP,cAAc,IAAIQ,cAAc,EAChCR,cAAc,IAAIS,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/validate_current_jwt.ts"],"sourcesContent":["import type { nullish } from '@ctx-core/function'\nimport { throw_bad_credentials } from '@ctx-core/error'\nimport type { jwt_error_ctx_I } from './jwt_error_ctx_I.js'\nimport { jwt_token_exp_ } from './jwt_token_exp_.js'\nexport function validate_current_jwt(jwt_token:string|nullish):void {\n\tconst jwt_token_exp = jwt_token_exp_(jwt_token)\n\tconst jwt_token_exp_millis = jwt_token_exp * 1000\n\tif (Date.now() > jwt_token_exp_millis) {\n\t\tthrow_bad_credentials({\n\t\t\tjwt_token,\n\t\t\terror_message: 'Session Expired'\n\t\t} as jwt_error_ctx_I)\n\t}\n}\nexport {\n\tvalidate_current_jwt as validate__current__jwt\n}\n"],"names":["throw_bad_credentials","jwt_token_exp_","validate_current_jwt","jwt_token","jwt_token_exp","jwt_token_exp_millis","Date","now","error_message","validate__current__jwt"],"mappings":"AACA,MAAM,GAAGA,qBAAqB,QAAQ,CAAiB;AAEvD,MAAM,GAAGC,cAAc,QAAQ,CAAqB;AACpD,MAAM,UAAUC,oBAAoB,CAACC,SAAwB,EAAO,CAAC;IACpE,KAAK,CAACC,aAAa,GAAGH,cAAc,CAACE,SAAS;IAC9C,KAAK,CAACE,oBAAoB,GAAGD,aAAa,GAAG,IAAI;IACjD,EAAE,EAAEE,IAAI,CAACC,GAAG,KAAKF,oBAAoB,EAAE,CAAC;QACvCL,qBAAqB,CAAC,CAAC;YACtBG,SAAS;YACTK,aAAa,EAAE,CAAiB;QACjC,CAAC;IACF,CAAC;AACF,CAAC;AACD,MAAM,GACLN,oBAAoB,IAAIO,sBAAsB"}
1
+ {"version":3,"sources":["../src/validate_current_jwt.ts"],"sourcesContent":["import { throw_bad_credentials } from '@ctx-core/error'\nimport type { nullish } from '@ctx-core/function'\nimport type { jwt_error_ctx_I } from './jwt_error_ctx_I.js'\nimport { jwt_token_exp_ } from './jwt_token_exp_.js'\nexport function validate_current_jwt(jwt_token:string|nullish):void {\n\tconst jwt_token_exp = jwt_token_exp_(jwt_token)\n\tconst jwt_token_exp_millis = jwt_token_exp * 1000\n\tif (Date.now() > jwt_token_exp_millis) {\n\t\tthrow_bad_credentials({\n\t\t\tjwt_token,\n\t\t\terror_message: 'Session Expired'\n\t\t} as jwt_error_ctx_I)\n\t}\n}\nexport {\n\tvalidate_current_jwt as validate__current__jwt\n}\n"],"names":["throw_bad_credentials","jwt_token_exp_","validate_current_jwt","jwt_token","jwt_token_exp","jwt_token_exp_millis","Date","now","error_message","validate__current__jwt"],"mappings":"AAAA,MAAM,GAAGA,qBAAqB,QAAQ,CAAiB;AAGvD,MAAM,GAAGC,cAAc,QAAQ,CAAqB;AACpD,MAAM,UAAUC,oBAAoB,CAACC,SAAwB,EAAO,CAAC;IACpE,KAAK,CAACC,aAAa,GAAGH,cAAc,CAACE,SAAS;IAC9C,KAAK,CAACE,oBAAoB,GAAGD,aAAa,GAAG,IAAI;IACjD,EAAE,EAAEE,IAAI,CAACC,GAAG,KAAKF,oBAAoB,EAAE,CAAC;QACvCL,qBAAqB,CAAC,CAAC;YACtBG,SAAS;YACTK,aAAa,EAAE,CAAiB;QACjC,CAAC;IACF,CAAC;AACF,CAAC;AACD,MAAM,GACLN,oBAAoB,IAAIO,sBAAsB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctx-core/jwt",
3
- "version": "10.0.29",
3
+ "version": "10.0.34",
4
4
  "description": "ctx-core jwt",
5
5
  "keywords": [
6
6
  "ctx-core",
@@ -28,14 +28,14 @@
28
28
  "./package.json": "./package.json"
29
29
  },
30
30
  "dependencies": {
31
- "@ctx-core/atob": "^10.0.24",
32
- "@ctx-core/error": "^11.0.19",
33
- "@ctx-core/function": "^20.2.4",
34
- "@swc/cli": "^0.1.51",
35
- "@swc/core": "^1.2.108"
31
+ "@ctx-core/atob": "^10.0.29",
32
+ "@ctx-core/error": "^11.1.5",
33
+ "@ctx-core/function": "^20.2.9",
34
+ "@swc/cli": "^0.1.52",
35
+ "@swc/core": "^1.2.117"
36
36
  },
37
37
  "devDependencies": {
38
- "typescript": "^4.4.4"
38
+ "typescript": "next"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public",
package/src/JwtToken.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { maybe, nullish } from '@ctx-core/function'
2
1
  import type { error_ctx_I } from '@ctx-core/error'
2
+ import type { maybe, nullish } from '@ctx-core/function'
3
3
  export interface Token {
4
4
  access_token: string
5
5
  token_type: string
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './header_authorization_jwt_token_.js'
2
- export * from './jwt_token_exp_.js'
3
2
  export * from './jwt_error_ctx_I.js'
3
+ export * from './jwt_token_exp_.js'
4
4
  export * from './JwtToken.js'
5
5
  export * from './validate_current_jwt.js'
@@ -1,5 +1,5 @@
1
- import type { nullish } from '@ctx-core/function'
2
1
  import { atob_ } from '@ctx-core/atob'
2
+ import type { nullish } from '@ctx-core/function'
3
3
  export function jwt_token_exp_(jwt_token:string|nullish):number {
4
4
  const atob = atob_()
5
5
  const jwt_data = jwt_token && JSON.parse(atob(jwt_token.split('.')[1]))
@@ -1,5 +1,5 @@
1
- import type { nullish } from '@ctx-core/function'
2
1
  import { throw_bad_credentials } from '@ctx-core/error'
2
+ import type { nullish } from '@ctx-core/function'
3
3
  import type { jwt_error_ctx_I } from './jwt_error_ctx_I.js'
4
4
  import { jwt_token_exp_ } from './jwt_token_exp_.js'
5
5
  export function validate_current_jwt(jwt_token:string|nullish):void {