@naturalcycles/nodejs-lib 15.93.0 → 15.95.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.
- package/dist/jwt/jwt.service.d.ts +4 -4
- package/dist/validation/ajv/from-data/generateJsonSchemaFromData.d.ts +1 -1
- package/dist/validation/ajv/getAjv.d.ts +1 -1
- package/dist/validation/ajv/index.d.ts +1 -1
- package/dist/validation/ajv/index.js +1 -1
- package/dist/validation/ajv/{ajvSchema.d.ts → jSchema.d.ts} +233 -272
- package/dist/validation/ajv/{ajvSchema.js → jSchema.js} +455 -461
- package/dist/validation/ajv/jsonSchemaBuilder.util.d.ts +1 -1
- package/package.json +1 -1
- package/src/jwt/jwt.service.ts +8 -4
- package/src/validation/ajv/from-data/generateJsonSchemaFromData.ts +2 -2
- package/src/validation/ajv/getAjv.ts +5 -5
- package/src/validation/ajv/index.ts +1 -1
- package/src/validation/ajv/{ajvSchema.ts → jSchema.ts} +1453 -1474
- package/src/validation/ajv/jsonSchemaBuilder.util.ts +1 -1
|
@@ -2,7 +2,7 @@ import type { ErrorData } from '@naturalcycles/js-lib/error';
|
|
|
2
2
|
import type { AnyObject, JWTString } from '@naturalcycles/js-lib/types';
|
|
3
3
|
import type { Algorithm, JwtHeader, SignOptions, VerifyOptions } from 'jsonwebtoken';
|
|
4
4
|
import jsonwebtoken from 'jsonwebtoken';
|
|
5
|
-
import type { AjvSchema } from '../validation/ajv/
|
|
5
|
+
import type { AjvSchema, JSchema } from '../validation/ajv/jSchema.js';
|
|
6
6
|
export { jsonwebtoken };
|
|
7
7
|
export type { Algorithm, JwtHeader, SignOptions, VerifyOptions };
|
|
8
8
|
export interface JWTServiceCfg {
|
|
@@ -50,9 +50,9 @@ export interface JWTServiceCfg {
|
|
|
50
50
|
export declare class JWTService {
|
|
51
51
|
cfg: JWTServiceCfg;
|
|
52
52
|
constructor(cfg: JWTServiceCfg);
|
|
53
|
-
sign<T extends AnyObject>(payload: T, schema?: AjvSchema<T>, opt?: SignOptions): JWTString;
|
|
54
|
-
verify<T extends AnyObject>(token: JWTString, schema?: AjvSchema<T>, opt?: VerifyOptions, publicKey?: string): T;
|
|
55
|
-
decode<T extends AnyObject>(token: JWTString, schema?: AjvSchema<T>): {
|
|
53
|
+
sign<T extends AnyObject>(payload: T, schema?: JSchema<T, any> | AjvSchema<T>, opt?: SignOptions): JWTString;
|
|
54
|
+
verify<T extends AnyObject>(token: JWTString, schema?: JSchema<T, any> | AjvSchema<T>, opt?: VerifyOptions, publicKey?: string): T;
|
|
55
|
+
decode<T extends AnyObject>(token: JWTString, schema?: JSchema<T, any> | AjvSchema<T>): {
|
|
56
56
|
header: JwtHeader;
|
|
57
57
|
payload: T;
|
|
58
58
|
signature: string;
|