jsonauthtoken 3.0.2 → 3.0.4-beta-1

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.
@@ -0,0 +1,53 @@
1
+ import { N as NodeRuntime, J as JsonAuthTokenExpiry, R as RuntimeWiseAlgorithmMap, G as GenerateKeyPair, A as AlgorithmDetails } from './types.d-D_Cze-FV.mjs';
2
+
3
+ declare class NodeCryptoModule<R extends NodeRuntime> {
4
+ private dev;
5
+ private runtime;
6
+ private web;
7
+ private node;
8
+ constructor({ runtime, dev }?: {
9
+ dev?: boolean;
10
+ runtime?: R;
11
+ });
12
+ private createToken;
13
+ private verifyToken;
14
+ create({ key, exp, algo }: {
15
+ key: string;
16
+ exp: JsonAuthTokenExpiry;
17
+ algo: RuntimeWiseAlgorithmMap[R];
18
+ }, payload: any): Promise<string>;
19
+ verify<T>(token: string, key: string): Promise<T>;
20
+ }
21
+ declare const JAT: <R extends NodeRuntime>({ runtime, dev }?: {
22
+ runtime?: R;
23
+ dev?: boolean;
24
+ }) => NodeCryptoModule<R>;
25
+ declare const getSupportedAlgorithm: () => AlgorithmDetails[];
26
+ declare const P2KG: {
27
+ generateKeyPair: (options?: {
28
+ runtime?: "web";
29
+ dev?: boolean;
30
+ }) => Promise<GenerateKeyPair>;
31
+ generatePublicKey: (privateKeyPem: string, options?: {
32
+ runtime?: "web";
33
+ dev?: boolean;
34
+ }) => Promise<string>;
35
+ };
36
+ declare const jsonauthtoken: {
37
+ JAT: <R extends NodeRuntime>({ runtime, dev }?: {
38
+ runtime?: R;
39
+ dev?: boolean;
40
+ }) => NodeCryptoModule<R>;
41
+ P2KG: {
42
+ generateKeyPair: (options?: {
43
+ runtime?: "web";
44
+ dev?: boolean;
45
+ }) => Promise<GenerateKeyPair>;
46
+ generatePublicKey: (privateKeyPem: string, options?: {
47
+ runtime?: "web";
48
+ dev?: boolean;
49
+ }) => Promise<string>;
50
+ };
51
+ };
52
+
53
+ export { JAT, NodeCryptoModule, P2KG, jsonauthtoken as default, getSupportedAlgorithm };
@@ -0,0 +1,53 @@
1
+ import { N as NodeRuntime, J as JsonAuthTokenExpiry, R as RuntimeWiseAlgorithmMap, G as GenerateKeyPair, A as AlgorithmDetails } from './types.d-D_Cze-FV.js';
2
+
3
+ declare class NodeCryptoModule<R extends NodeRuntime> {
4
+ private dev;
5
+ private runtime;
6
+ private web;
7
+ private node;
8
+ constructor({ runtime, dev }?: {
9
+ dev?: boolean;
10
+ runtime?: R;
11
+ });
12
+ private createToken;
13
+ private verifyToken;
14
+ create({ key, exp, algo }: {
15
+ key: string;
16
+ exp: JsonAuthTokenExpiry;
17
+ algo: RuntimeWiseAlgorithmMap[R];
18
+ }, payload: any): Promise<string>;
19
+ verify<T>(token: string, key: string): Promise<T>;
20
+ }
21
+ declare const JAT: <R extends NodeRuntime>({ runtime, dev }?: {
22
+ runtime?: R;
23
+ dev?: boolean;
24
+ }) => NodeCryptoModule<R>;
25
+ declare const getSupportedAlgorithm: () => AlgorithmDetails[];
26
+ declare const P2KG: {
27
+ generateKeyPair: (options?: {
28
+ runtime?: "web";
29
+ dev?: boolean;
30
+ }) => Promise<GenerateKeyPair>;
31
+ generatePublicKey: (privateKeyPem: string, options?: {
32
+ runtime?: "web";
33
+ dev?: boolean;
34
+ }) => Promise<string>;
35
+ };
36
+ declare const jsonauthtoken: {
37
+ JAT: <R extends NodeRuntime>({ runtime, dev }?: {
38
+ runtime?: R;
39
+ dev?: boolean;
40
+ }) => NodeCryptoModule<R>;
41
+ P2KG: {
42
+ generateKeyPair: (options?: {
43
+ runtime?: "web";
44
+ dev?: boolean;
45
+ }) => Promise<GenerateKeyPair>;
46
+ generatePublicKey: (privateKeyPem: string, options?: {
47
+ runtime?: "web";
48
+ dev?: boolean;
49
+ }) => Promise<string>;
50
+ };
51
+ };
52
+
53
+ export { JAT, NodeCryptoModule, P2KG, jsonauthtoken as default, getSupportedAlgorithm };