equipped 4.1.5 → 4.1.7
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/CHANGELOG.md +14 -0
- package/lib/db/mongoose/changes.js +1 -1
- package/lib/validations/index.d.ts +15 -13
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [4.1.7](https://github.com/kevinand11/equipped/compare/v4.1.6...v4.1.7) (2023-03-22)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* parse _id if string or ObjectId ([3aab101](https://github.com/kevinand11/equipped/commit/3aab101960a3a1fe88bea887a1b8e638ae2f3577))
|
|
11
|
+
|
|
12
|
+
### [4.1.6](https://github.com/kevinand11/equipped/compare/v4.1.5...v4.1.6) (2023-03-18)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* update to latest version of valleyed ([bdcd8e1](https://github.com/kevinand11/equipped/commit/bdcd8e16c3a05dadf7393558cae746c3ab007ddf))
|
|
18
|
+
|
|
5
19
|
### [4.1.5](https://github.com/kevinand11/equipped/compare/v4.1.4...v4.1.5) (2023-03-17)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -54,7 +54,7 @@ class MongoDbChange extends _instance_1.DbChange {
|
|
|
54
54
|
});
|
|
55
55
|
const TestId = new mongoose_1.default.Types.ObjectId('__equipped__');
|
|
56
56
|
const hydrate = (data) => model.hydrate({
|
|
57
|
-
...data, _id: new mongoose_1.default.Types.ObjectId(data._id['$oid'])
|
|
57
|
+
...data, _id: new mongoose_1.default.Types.ObjectId(data._id['$oid'] ?? data._id)
|
|
58
58
|
}).toObject({ getters: true, virtuals: true });
|
|
59
59
|
instance_1.Instance.get().eventBus.createSubscriber(topic, async (data) => {
|
|
60
60
|
const op = data.op;
|
|
@@ -5,8 +5,8 @@ type Phone = {
|
|
|
5
5
|
number: string;
|
|
6
6
|
};
|
|
7
7
|
export declare const Schema: {
|
|
8
|
-
is: <T
|
|
9
|
-
in: <T_1
|
|
8
|
+
is: <T>(value: T) => Validate.VCore<T>;
|
|
9
|
+
in: <T_1>(values: readonly T_1[], comparer?: ((val: any, arrayItem: T_1) => boolean) | undefined) => Validate.VCore<T_1>;
|
|
10
10
|
or: <T_2 extends Validate.VCore<any>[]>(options: T_2, err?: string | undefined) => import("valleyed/lib/api/junctions").VOr<T_2>;
|
|
11
11
|
and: <I>(options: Validate.VCore<I>[], err?: string | undefined) => import("valleyed/lib/api/junctions").VAnd<I>;
|
|
12
12
|
string: (err?: string | undefined) => import("valleyed/lib/api/strings").VString;
|
|
@@ -36,8 +36,8 @@ export declare const Validation: {
|
|
|
36
36
|
Validator: typeof Validate.Validator;
|
|
37
37
|
VCore: typeof Validate.VCore;
|
|
38
38
|
v: {
|
|
39
|
-
is: <T
|
|
40
|
-
in: <T_1
|
|
39
|
+
is: <T>(value: T) => Validate.VCore<T>;
|
|
40
|
+
in: <T_1>(values: readonly T_1[], comparer?: ((val: any, arrayItem: T_1) => boolean) | undefined) => Validate.VCore<T_1>;
|
|
41
41
|
or: <T_2 extends Validate.VCore<any>[]>(options: T_2, err?: string | undefined) => import("valleyed/lib/api/junctions").VOr<T_2>;
|
|
42
42
|
and: <I>(options: Validate.VCore<I>[], err?: string | undefined) => import("valleyed/lib/api/junctions").VAnd<I>;
|
|
43
43
|
string: (err?: string | undefined) => import("valleyed/lib/api/strings").VString;
|
|
@@ -62,7 +62,9 @@ export declare const Validation: {
|
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
64
|
isEqualTo: <Type>(compare: Type, comparer?: ((val: any, compare: Type) => boolean) | undefined, error?: string | undefined) => Validate.Rule<Type>;
|
|
65
|
-
|
|
65
|
+
isNotEqualTo: <Compare, Type_1>(compare: Compare, comparer?: ((val: Type_1, compare: Compare) => boolean) | undefined, error?: string | undefined) => Validate.Rule<Type_1>;
|
|
66
|
+
arrayContains: <Type_2>(array: readonly Type_2[], comparer?: ((val: any, arrayItem: Type_2) => boolean) | undefined, error?: string | undefined) => Validate.Rule<Type_2>;
|
|
67
|
+
arrayNotContains: <Compare_1, Type_3>(array: readonly Compare_1[], comparer?: ((val: Type_3, arrayItem: Compare_1) => boolean) | undefined, error?: string | undefined) => Validate.Rule<Type_3>;
|
|
66
68
|
isString: (error?: string | undefined) => Validate.Rule<any>;
|
|
67
69
|
isLengthOf: (length: number, stripHTMLTags?: boolean | undefined, error?: string | undefined) => Validate.Rule<string>;
|
|
68
70
|
isMinOf: (length: number, stripHTMLTags?: boolean | undefined, error?: string | undefined) => Validate.Rule<string>;
|
|
@@ -76,10 +78,10 @@ export declare const Validation: {
|
|
|
76
78
|
isLessThan: (compare: number, error?: string | undefined) => Validate.Rule<number>;
|
|
77
79
|
isLessThanOrEqualTo: (compare: number, error?: string | undefined) => Validate.Rule<number>;
|
|
78
80
|
isArray: (error?: string | undefined) => Validate.Rule<any>;
|
|
79
|
-
hasLengthOf: <
|
|
80
|
-
hasMinOf: <
|
|
81
|
-
hasMaxOf: <
|
|
82
|
-
isArrayOf: <
|
|
81
|
+
hasLengthOf: <Type_4>(length: number, error?: string | undefined) => Validate.Rule<Type_4[]>;
|
|
82
|
+
hasMinOf: <Type_5>(length: number, error?: string | undefined) => Validate.Rule<Type_5[]>;
|
|
83
|
+
hasMaxOf: <Type_6>(length: number, error?: string | undefined) => Validate.Rule<Type_6[]>;
|
|
84
|
+
isArrayOf: <Type_7>(comparer: (cur: Type_7, idx: number) => boolean, error?: string | undefined) => Validate.Rule<Type_7[]>;
|
|
83
85
|
isUndefined: (error?: string | undefined) => Validate.Rule<undefined>;
|
|
84
86
|
isNull: (error?: string | undefined) => Validate.Rule<null>;
|
|
85
87
|
isBoolean: (error?: string | undefined) => Validate.Rule<boolean>;
|
|
@@ -110,16 +112,16 @@ export declare const Validation: {
|
|
|
110
112
|
formatNumber: (num: number, dp?: number | undefined) => string;
|
|
111
113
|
pluralize: (count: number, singular: string, plural: string) => string;
|
|
112
114
|
getRandomValue: () => string;
|
|
113
|
-
groupBy: <
|
|
115
|
+
groupBy: <Type_8, Unique extends string | number>(array: Type_8[], func: (item: Type_8) => Unique) => {
|
|
114
116
|
key: Unique;
|
|
115
|
-
values:
|
|
117
|
+
values: Type_8[];
|
|
116
118
|
}[];
|
|
117
119
|
getAlphabet: (num: number) => string;
|
|
118
120
|
addToArray: <T_6>(array: T_6[], item: T_6, getKey: (a: T_6) => any, getComparer: (a: T_6) => string | number, asc?: boolean | undefined) => T_6[];
|
|
119
121
|
divideByZero: (num: number, den: number) => number;
|
|
120
122
|
getPercentage: (num: number, den: number) => number;
|
|
121
|
-
getRandomSample: <
|
|
122
|
-
shuffleArray: <
|
|
123
|
+
getRandomSample: <Type_9>(population: Type_9[], n: number) => Type_9[];
|
|
124
|
+
shuffleArray: <Type_10>(array: Type_10[]) => Type_10[];
|
|
123
125
|
Geohash: typeof Validate.Geohash;
|
|
124
126
|
isValid: <T_7>(value: T_7) => {
|
|
125
127
|
valid: true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "equipped",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"redis": "^4.6.5",
|
|
67
67
|
"socket.io": "4.6.1",
|
|
68
68
|
"supertest": "^6.3.3",
|
|
69
|
-
"valleyed": "4.1.
|
|
69
|
+
"valleyed": "4.1.4"
|
|
70
70
|
},
|
|
71
71
|
"repository": {
|
|
72
72
|
"url": "git://github.com/kevinand11/equipped.git"
|