@naturalcycles/nodejs-lib 12.81.0 → 12.82.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 +1 -1
- package/dist/jwt/jwt.service.js +1 -1
- package/dist/log/debug.d.ts +7 -7
- package/dist/stream/transform/transformLogProgress.d.ts +1 -1
- package/dist/stream/transform/transformMap.d.ts +1 -1
- package/dist/stream/transform/transformMapSync.d.ts +1 -1
- package/dist/validation/joi/joi.extensions.d.ts +2 -2
- package/dist/validation/joi/number.extensions.d.ts +1 -1
- package/dist/validation/joi/string.extensions.d.ts +1 -1
- package/package.json +2 -2
- package/src/jwt/jwt.service.ts +1 -1
- package/src/log/debug.ts +7 -7
- package/src/stream/transform/transformLogProgress.ts +1 -1
- package/src/stream/transform/transformMap.ts +1 -1
- package/src/stream/transform/transformMapSync.ts +1 -1
- package/src/validation/joi/joi.extensions.ts +2 -2
- package/src/validation/joi/number.extensions.ts +1 -1
- package/src/validation/joi/string.extensions.ts +1 -1
|
@@ -39,7 +39,7 @@ export interface JWTServiceCfg {
|
|
|
39
39
|
* You should create one instance of JWTService for each pair of private/public key.
|
|
40
40
|
*
|
|
41
41
|
* Generate key pair like this:
|
|
42
|
-
* openssl ecparam -name
|
|
42
|
+
* openssl ecparam -name prime256v1 -genkey -noout -out key.pem
|
|
43
43
|
* openssl ec -in key.pem -pubout > key.pub.pem
|
|
44
44
|
*/
|
|
45
45
|
export declare class JWTService {
|
package/dist/jwt/jwt.service.js
CHANGED
|
@@ -12,7 +12,7 @@ const joi_validation_util_1 = require("../validation/joi/joi.validation.util");
|
|
|
12
12
|
* You should create one instance of JWTService for each pair of private/public key.
|
|
13
13
|
*
|
|
14
14
|
* Generate key pair like this:
|
|
15
|
-
* openssl ecparam -name
|
|
15
|
+
* openssl ecparam -name prime256v1 -genkey -noout -out key.pem
|
|
16
16
|
* openssl ec -in key.pem -pubout > key.pub.pem
|
|
17
17
|
*/
|
|
18
18
|
class JWTService {
|
package/dist/log/debug.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export interface IDebug {
|
|
2
2
|
(namespace: string): IDebugger;
|
|
3
|
-
coerce(val: any)
|
|
4
|
-
disable()
|
|
5
|
-
enable(namespaces: string)
|
|
6
|
-
enabled(namespaces: string)
|
|
7
|
-
log(...args: any[])
|
|
3
|
+
coerce: (val: any) => any;
|
|
4
|
+
disable: () => string;
|
|
5
|
+
enable: (namespaces: string) => void;
|
|
6
|
+
enabled: (namespaces: string) => boolean;
|
|
7
|
+
log: (...args: any[]) => any;
|
|
8
8
|
names: RegExp[];
|
|
9
9
|
skips: RegExp[];
|
|
10
10
|
formatters: DebugFormatters;
|
|
@@ -16,8 +16,8 @@ export interface IDebugger {
|
|
|
16
16
|
(...args: any[]): void;
|
|
17
17
|
color: string;
|
|
18
18
|
enabled: boolean;
|
|
19
|
-
log(...args: any[])
|
|
19
|
+
log: (...args: any[]) => any;
|
|
20
20
|
namespace: string;
|
|
21
|
-
destroy()
|
|
21
|
+
destroy: () => boolean;
|
|
22
22
|
}
|
|
23
23
|
export declare const Debug: IDebug;
|
|
@@ -75,7 +75,7 @@ export interface TransformLogProgressOptions<IN = any> extends TransformOptions
|
|
|
75
75
|
*
|
|
76
76
|
* chunk is undefined for "final" stats, otherwise is defined.
|
|
77
77
|
*/
|
|
78
|
-
extra
|
|
78
|
+
extra?: (chunk: IN | undefined, index: number) => AnyObject;
|
|
79
79
|
/**
|
|
80
80
|
* If specified - will multiply the counter by this number.
|
|
81
81
|
* Useful e.g when using `transformBuffer({ batchSize: 500 })`, so
|
|
@@ -29,7 +29,7 @@ export interface TransformMapOptions<IN = any, OUT = IN> {
|
|
|
29
29
|
* If defined - will be called on every error happening in the stream.
|
|
30
30
|
* Called BEFORE observable will emit error (unless skipErrors is set to true).
|
|
31
31
|
*/
|
|
32
|
-
onError
|
|
32
|
+
onError?: (err: Error, input: IN) => any;
|
|
33
33
|
/**
|
|
34
34
|
* Progress metric
|
|
35
35
|
*
|
|
@@ -27,7 +27,7 @@ export interface TransformMapSyncOptions<IN = any, OUT = IN> {
|
|
|
27
27
|
* If defined - will be called on every error happening in the stream.
|
|
28
28
|
* Called BEFORE observable will emit error (unless skipErrors is set to true).
|
|
29
29
|
*/
|
|
30
|
-
onError
|
|
30
|
+
onError?: (err: Error, input: IN) => any;
|
|
31
31
|
/**
|
|
32
32
|
* Progress metric
|
|
33
33
|
*
|
|
@@ -2,8 +2,8 @@ import * as JoiLib from 'joi';
|
|
|
2
2
|
import { ExtendedNumberSchema } from './number.extensions';
|
|
3
3
|
import { ExtendedStringSchema } from './string.extensions';
|
|
4
4
|
export interface ExtendedJoi extends JoiLib.Root {
|
|
5
|
-
string()
|
|
6
|
-
number()
|
|
5
|
+
string: () => ExtendedStringSchema;
|
|
6
|
+
number: () => ExtendedNumberSchema;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* This is the only right place to import Joi from
|
|
@@ -2,6 +2,6 @@ import * as Joi from 'joi';
|
|
|
2
2
|
import { Extension, NumberSchema } from 'joi';
|
|
3
3
|
import { AnySchemaTyped } from './joi.model';
|
|
4
4
|
export interface ExtendedNumberSchema extends NumberSchema, AnySchemaTyped<number> {
|
|
5
|
-
dividable(q: number)
|
|
5
|
+
dividable: (q: number) => this;
|
|
6
6
|
}
|
|
7
7
|
export declare function numberExtensions(joi: typeof Joi): Extension;
|
|
@@ -2,7 +2,7 @@ import { Extension, StringSchema } from 'joi';
|
|
|
2
2
|
import * as Joi from 'joi';
|
|
3
3
|
import { AnySchemaTyped } from './joi.model';
|
|
4
4
|
export interface ExtendedStringSchema extends StringSchema, AnySchemaTyped<string> {
|
|
5
|
-
dateString(min?: string, max?: string)
|
|
5
|
+
dateString: (min?: string, max?: string) => this;
|
|
6
6
|
}
|
|
7
7
|
export interface JoiDateStringOptions {
|
|
8
8
|
min?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturalcycles/nodejs-lib",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.82.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prepare": "husky install",
|
|
6
6
|
"docs-serve": "vuepress dev docs",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"globby": "^11.0.0",
|
|
33
33
|
"got": "^11.0.1",
|
|
34
34
|
"joi": "17.4.2",
|
|
35
|
-
"jsonwebtoken": "^
|
|
35
|
+
"jsonwebtoken": "^9.0.0",
|
|
36
36
|
"lru-cache": "^7.4.0",
|
|
37
37
|
"move-file": "^2.0.0",
|
|
38
38
|
"through2-concurrent": "^2.0.0",
|
package/src/jwt/jwt.service.ts
CHANGED
|
@@ -55,7 +55,7 @@ export interface JWTServiceCfg {
|
|
|
55
55
|
* You should create one instance of JWTService for each pair of private/public key.
|
|
56
56
|
*
|
|
57
57
|
* Generate key pair like this:
|
|
58
|
-
* openssl ecparam -name
|
|
58
|
+
* openssl ecparam -name prime256v1 -genkey -noout -out key.pem
|
|
59
59
|
* openssl ec -in key.pem -pubout > key.pub.pem
|
|
60
60
|
*/
|
|
61
61
|
export class JWTService {
|
package/src/log/debug.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Types based on @types/debug
|
|
2
2
|
export interface IDebug {
|
|
3
3
|
(namespace: string): IDebugger
|
|
4
|
-
coerce(val: any)
|
|
5
|
-
disable()
|
|
6
|
-
enable(namespaces: string)
|
|
7
|
-
enabled(namespaces: string)
|
|
8
|
-
log(...args: any[])
|
|
4
|
+
coerce: (val: any) => any
|
|
5
|
+
disable: () => string
|
|
6
|
+
enable: (namespaces: string) => void
|
|
7
|
+
enabled: (namespaces: string) => boolean
|
|
8
|
+
log: (...args: any[]) => any
|
|
9
9
|
|
|
10
10
|
names: RegExp[]
|
|
11
11
|
skips: RegExp[]
|
|
@@ -23,9 +23,9 @@ export interface IDebugger {
|
|
|
23
23
|
|
|
24
24
|
color: string
|
|
25
25
|
enabled: boolean
|
|
26
|
-
log(...args: any[])
|
|
26
|
+
log: (...args: any[]) => any
|
|
27
27
|
namespace: string
|
|
28
|
-
destroy()
|
|
28
|
+
destroy: () => boolean
|
|
29
29
|
// extend: (namespace: string, delimiter?: string) => IDebugger
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -100,7 +100,7 @@ export interface TransformLogProgressOptions<IN = any> extends TransformOptions
|
|
|
100
100
|
*
|
|
101
101
|
* chunk is undefined for "final" stats, otherwise is defined.
|
|
102
102
|
*/
|
|
103
|
-
extra
|
|
103
|
+
extra?: (chunk: IN | undefined, index: number) => AnyObject
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
106
|
* If specified - will multiply the counter by this number.
|
|
@@ -48,7 +48,7 @@ export interface TransformMapOptions<IN = any, OUT = IN> {
|
|
|
48
48
|
* If defined - will be called on every error happening in the stream.
|
|
49
49
|
* Called BEFORE observable will emit error (unless skipErrors is set to true).
|
|
50
50
|
*/
|
|
51
|
-
onError
|
|
51
|
+
onError?: (err: Error, input: IN) => any
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* Progress metric
|
|
@@ -43,7 +43,7 @@ export interface TransformMapSyncOptions<IN = any, OUT = IN> {
|
|
|
43
43
|
* If defined - will be called on every error happening in the stream.
|
|
44
44
|
* Called BEFORE observable will emit error (unless skipErrors is set to true).
|
|
45
45
|
*/
|
|
46
|
-
onError
|
|
46
|
+
onError?: (err: Error, input: IN) => any
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* Progress metric
|
|
@@ -5,9 +5,9 @@ import { ExtendedStringSchema, stringExtensions } from './string.extensions'
|
|
|
5
5
|
|
|
6
6
|
export interface ExtendedJoi extends JoiLib.Root {
|
|
7
7
|
// eslint-disable-next-line id-blacklist
|
|
8
|
-
string()
|
|
8
|
+
string: () => ExtendedStringSchema
|
|
9
9
|
// eslint-disable-next-line id-blacklist
|
|
10
|
-
number()
|
|
10
|
+
number: () => ExtendedNumberSchema
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -3,7 +3,7 @@ import { Extension, NumberSchema } from 'joi'
|
|
|
3
3
|
import { AnySchemaTyped } from './joi.model'
|
|
4
4
|
|
|
5
5
|
export interface ExtendedNumberSchema extends NumberSchema, AnySchemaTyped<number> {
|
|
6
|
-
dividable(q: number)
|
|
6
|
+
dividable: (q: number) => this
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export function numberExtensions(joi: typeof Joi): Extension {
|
|
@@ -4,7 +4,7 @@ import * as Joi from 'joi'
|
|
|
4
4
|
import { AnySchemaTyped } from './joi.model'
|
|
5
5
|
|
|
6
6
|
export interface ExtendedStringSchema extends StringSchema, AnySchemaTyped<string> {
|
|
7
|
-
dateString(min?: string, max?: string)
|
|
7
|
+
dateString: (min?: string, max?: string) => this
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export interface JoiDateStringOptions {
|