@elysiajs/jwt 0.6.4 → 0.7.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.
@@ -19,20 +19,16 @@ export interface JWTOption<Name extends string | undefined = 'jwt', Schema exten
19
19
  exp?: string | number;
20
20
  }
21
21
  export declare const jwt: <Name extends string = "jwt", Schema extends TSchema | undefined = undefined>({ name, secret, alg, crit, schema, nbf, exp, ...payload }: JWTOption<Name, Schema>) => Elysia<"", {
22
- store: {};
23
- error: {};
24
- request: Record<Name extends string ? Name : "jwt", {
22
+ request: { [name in Name extends string ? Name : "jwt"]: {
25
23
  readonly sign: (morePayload: UnwrapSchema<Schema, Record<string, string>> & JWTPayloadSpec) => Promise<string>;
26
24
  readonly verify: (jwt?: string) => Promise<false | (UnwrapSchema<Schema, Record<string, string>> & JWTPayloadSpec)>;
27
- }> extends infer T extends Object ? { [key in keyof T]: Record<Name extends string ? Name : "jwt", {
25
+ }; } extends infer T ? { [K in keyof T]: { [name in Name extends string ? Name : "jwt"]: {
28
26
  readonly sign: (morePayload: UnwrapSchema<Schema, Record<string, string>> & JWTPayloadSpec) => Promise<string>;
29
27
  readonly verify: (jwt?: string) => Promise<false | (UnwrapSchema<Schema, Record<string, string>> & JWTPayloadSpec)>;
30
- }>[key]; } : never;
31
- schema: {};
32
- meta: {
33
- schema: {};
34
- defs: {};
35
- exposed: {};
36
- };
37
- }>;
28
+ }; }[K]; } : never;
29
+ store: {};
30
+ }, {
31
+ type: {};
32
+ error: {};
33
+ }, {}, {}, false>;
38
34
  export default jwt;
package/dist/index.d.ts CHANGED
@@ -19,20 +19,16 @@ export interface JWTOption<Name extends string | undefined = 'jwt', Schema exten
19
19
  exp?: string | number;
20
20
  }
21
21
  export declare const jwt: <Name extends string = "jwt", Schema extends TSchema | undefined = undefined>({ name, secret, alg, crit, schema, nbf, exp, ...payload }: JWTOption<Name, Schema>) => Elysia<"", {
22
- store: {};
23
- error: {};
24
- request: Record<Name extends string ? Name : "jwt", {
22
+ request: { [name in Name extends string ? Name : "jwt"]: {
25
23
  readonly sign: (morePayload: UnwrapSchema<Schema, Record<string, string>> & JWTPayloadSpec) => Promise<string>;
26
24
  readonly verify: (jwt?: string) => Promise<false | (UnwrapSchema<Schema, Record<string, string>> & JWTPayloadSpec)>;
27
- }> extends infer T extends Object ? { [key in keyof T]: Record<Name extends string ? Name : "jwt", {
25
+ }; } extends infer T ? { [K in keyof T]: { [name in Name extends string ? Name : "jwt"]: {
28
26
  readonly sign: (morePayload: UnwrapSchema<Schema, Record<string, string>> & JWTPayloadSpec) => Promise<string>;
29
27
  readonly verify: (jwt?: string) => Promise<false | (UnwrapSchema<Schema, Record<string, string>> & JWTPayloadSpec)>;
30
- }>[key]; } : never;
31
- schema: {};
32
- meta: {
33
- schema: {};
34
- defs: {};
35
- exposed: {};
36
- };
37
- }>;
28
+ }; }[K]; } : never;
29
+ store: {};
30
+ }, {
31
+ type: {};
32
+ error: {};
33
+ }, {}, {}, false>;
38
34
  export default jwt;
package/package.json CHANGED
@@ -1,57 +1,56 @@
1
1
  {
2
- "name": "@elysiajs/jwt",
3
- "description": "Plugin for Elysia for using JWT Authentication",
4
- "version": "0.6.4",
5
- "author": {
6
- "name": "saltyAom",
7
- "url": "https://github.com/SaltyAom",
8
- "email": "saltyaom@gmail.com"
9
- },
10
- "repository": {
11
- "type": "git",
12
- "url": "https://github.com/elysiajs/elysia-jwt"
13
- },
14
- "main": "./dist/index.js",
15
- "exports": {
16
- "bun": "./dist/index.js",
17
- "node": "./dist/cjs/index.js",
18
- "require": "./dist/cjs/index.js",
19
- "import": "./dist/index.js",
20
- "default": "./dist/index.js"
21
- },
22
- "types": "./dist/index.d.ts",
23
- "bugs": "https://github.com/elysiajs/elysia-jwt/issues",
24
- "homepage": "https://github.com/elysiajs/elysia-jwt",
25
- "keywords": [
26
- "elysia",
27
- "jwt",
28
- "auth",
29
- "authentication"
30
- ],
31
- "license": "MIT",
32
- "scripts": {
33
- "dev": "bun run --hot example/index.ts",
34
- "test": "bun test && npm run test:node",
35
- "test:node": "npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js",
36
- "build": "rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json",
37
- "release": "npm run build && npm run test && npm publish --access public"
38
- },
39
- "dependencies": {
40
- "jose": "^4.14.4"
41
- },
42
- "devDependencies": {
43
- "@elysiajs/cookie": "^0.3.0",
44
- "@sinclair/typebox": "^0.30.4",
45
- "@types/node": "^20.1.4",
46
- "@typescript-eslint/eslint-plugin": "^6.6.0",
47
- "@typescript-eslint/parser": "^6.6.0",
48
- "bun-types": "^0.5.8",
49
- "elysia": "0.6.6",
50
- "eslint": "^8.40.0",
51
- "rimraf": "4.3",
52
- "typescript": "^5.1.6"
53
- },
54
- "peerDependencies": {
55
- "elysia": ">= 0.6.0"
56
- }
57
- }
2
+ "name": "@elysiajs/jwt",
3
+ "description": "Plugin for Elysia for using JWT Authentication",
4
+ "version": "0.7.0",
5
+ "author": {
6
+ "name": "saltyAom",
7
+ "url": "https://github.com/SaltyAom",
8
+ "email": "saltyaom@gmail.com"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/elysiajs/elysia-jwt"
13
+ },
14
+ "main": "./dist/index.js",
15
+ "exports": {
16
+ "bun": "./dist/index.js",
17
+ "node": "./dist/cjs/index.js",
18
+ "require": "./dist/cjs/index.js",
19
+ "import": "./dist/index.js",
20
+ "default": "./dist/index.js"
21
+ },
22
+ "types": "./dist/index.d.ts",
23
+ "bugs": "https://github.com/elysiajs/elysia-jwt/issues",
24
+ "homepage": "https://github.com/elysiajs/elysia-jwt",
25
+ "keywords": [
26
+ "elysia",
27
+ "jwt",
28
+ "auth",
29
+ "authentication"
30
+ ],
31
+ "license": "MIT",
32
+ "scripts": {
33
+ "dev": "bun run --hot example/index.ts",
34
+ "test": "bun test && npm run test:node",
35
+ "test:node": "npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js",
36
+ "build": "rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json",
37
+ "release": "npm run build && npm run test && npm publish --access public"
38
+ },
39
+ "dependencies": {
40
+ "jose": "^4.14.4"
41
+ },
42
+ "devDependencies": {
43
+ "@elysiajs/cookie": "^0.3.0",
44
+ "@types/node": "^20.1.4",
45
+ "@typescript-eslint/eslint-plugin": "^6.6.0",
46
+ "@typescript-eslint/parser": "^6.6.0",
47
+ "bun-types": "^0.5.8",
48
+ "elysia": "0.7.0",
49
+ "eslint": "^8.40.0",
50
+ "rimraf": "4.3",
51
+ "typescript": "^5.1.6"
52
+ },
53
+ "peerDependencies": {
54
+ "elysia": ">= 0.7.0"
55
+ }
56
+ }