bigal 10.3.3 → 10.4.0-beta
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 +9 -0
- package/package.json +12 -12
- package/query/WhereQuery.d.ts +6 -8
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bigal",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.4.0-beta",
|
|
4
4
|
"description": "A fast and lightweight orm for postgres and node.js, written in typescript.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -19,34 +19,34 @@
|
|
|
19
19
|
"node": ">=14"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@types/lodash": "^4.14.
|
|
22
|
+
"@types/lodash": "^4.14.187",
|
|
23
23
|
"@types/node": ">=14",
|
|
24
24
|
"@types/pg": "^8.6.5",
|
|
25
25
|
"lodash": "^4.17.21",
|
|
26
26
|
"pg": "^8.8.0",
|
|
27
|
-
"postgres-pool": "^6.0.
|
|
27
|
+
"postgres-pool": "^6.0.6"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@faker-js/faker": "^7.
|
|
30
|
+
"@faker-js/faker": "^7.6.0",
|
|
31
31
|
"@types/chai": "^4.3.3",
|
|
32
|
-
"@types/mocha": "
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
34
|
-
"@typescript-eslint/parser": "^5.
|
|
32
|
+
"@types/mocha": "10.0.0",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^5.42.0",
|
|
34
|
+
"@typescript-eslint/parser": "^5.42.0",
|
|
35
35
|
"chai": "^4.3.6",
|
|
36
|
-
"eslint": "^8.
|
|
36
|
+
"eslint": "^8.26.0",
|
|
37
37
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
38
38
|
"eslint-config-airbnb-typescript": "^17.0.0",
|
|
39
39
|
"eslint-config-prettier": "^8.5.0",
|
|
40
40
|
"eslint-plugin-import": "^2.26.0",
|
|
41
|
-
"eslint-plugin-jsdoc": "^39.
|
|
41
|
+
"eslint-plugin-jsdoc": "^39.6.2",
|
|
42
42
|
"eslint-plugin-mocha": "10.1.0",
|
|
43
43
|
"eslint-plugin-prettier": "^4.2.1",
|
|
44
|
-
"eslint-plugin-promise": "^6.
|
|
44
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
45
45
|
"eslint-plugin-security": "^1.5.0",
|
|
46
46
|
"husky": "^8.0.1",
|
|
47
47
|
"lint-staged": "^13.0.3",
|
|
48
48
|
"markdownlint-cli": "^0.32.2",
|
|
49
|
-
"mocha": "^10.
|
|
49
|
+
"mocha": "^10.1.0",
|
|
50
50
|
"npm-run-all": "^4.1.5",
|
|
51
51
|
"pinst": "^3.0.0",
|
|
52
52
|
"prettier": "^2.7.1",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"strict-event-emitter-types": "^2.0.0",
|
|
55
55
|
"ts-mockito": "^2.6.1",
|
|
56
56
|
"ts-node": "^10.9.1",
|
|
57
|
-
"typescript": "^4.8.
|
|
57
|
+
"typescript": "^4.8.4"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"check:types": "tsc -p tsconfig.lint.json --noEmit",
|
package/query/WhereQuery.d.ts
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import type { Entity, NotEntityBrand } from '../Entity';
|
|
2
2
|
import type { ExcludeEntityCollections, ExcludeFunctions } from '../types';
|
|
3
3
|
declare type ExcludeUndefined<T> = Exclude<T, undefined>;
|
|
4
|
-
export declare type LiteralValues<TValue> = (
|
|
5
|
-
export declare type WhereClauseValue<TValue> = TValue extends NotEntityBrand | undefined ? Exclude<TValue, NotEntityBrand | undefined> : Extract<TValue, Entity> extends undefined ? LiteralValues<TValue
|
|
4
|
+
export declare type LiteralValues<TValue> = (TValue | null)[] | TValue | null;
|
|
5
|
+
export declare type WhereClauseValue<TValue> = TValue extends NotEntityBrand | undefined ? Exclude<TValue, NotEntityBrand | undefined> : Extract<TValue, Entity> extends undefined ? LiteralValues<ExcludeUndefined<TValue>> : (ExcludeUndefined<Exclude<TValue, Entity>> | null)[] | (Pick<Extract<ExcludeUndefined<TValue>, Entity>, 'id'> | null)[] | ExcludeUndefined<Exclude<TValue, Entity>> | Pick<Extract<ExcludeUndefined<TValue>, Entity>, 'id'> | null;
|
|
6
6
|
export declare type StringConstraint<TValue extends string> = {
|
|
7
|
-
[P in 'contains' | 'endsWith' | 'like' | 'startsWith']?: LiteralValues<TValue
|
|
7
|
+
[P in 'contains' | 'endsWith' | 'like' | 'startsWith']?: LiteralValues<ExcludeUndefined<TValue>>;
|
|
8
8
|
};
|
|
9
9
|
export declare type NumberOrDateConstraint<TValue extends Date | number> = {
|
|
10
|
-
[P in '<' | '<=' | '>' | '>=']?: LiteralValues<TValue
|
|
10
|
+
[P in '<' | '<=' | '>' | '>=']?: LiteralValues<ExcludeUndefined<TValue>>;
|
|
11
11
|
};
|
|
12
12
|
export declare type NegatableConstraint<TValue> = TValue | {
|
|
13
13
|
'!': TValue;
|
|
14
14
|
};
|
|
15
|
-
export declare type WhereQueryStatement<TValue> = TValue extends string ? NegatableConstraint<StringConstraint<TValue> | WhereClauseValue<TValue>> : TValue extends Date | number ? NegatableConstraint<NumberOrDateConstraint<TValue> | WhereClauseValue<TValue>> : NegatableConstraint<WhereClauseValue<TValue>>;
|
|
15
|
+
export declare type WhereQueryStatement<TValue> = [TValue] extends [string] ? NegatableConstraint<StringConstraint<TValue> | WhereClauseValue<TValue>> : TValue extends Date | number ? NegatableConstraint<NumberOrDateConstraint<TValue> | WhereClauseValue<TValue>> : NegatableConstraint<WhereClauseValue<TValue>>;
|
|
16
16
|
export declare type WhereQuery<T extends Entity> = {
|
|
17
|
-
[K in keyof T as ExcludeEntityCollections<T[K], ExcludeFunctions<T[K], K>>]?: K extends 'id' ? WhereQueryStatement<T | T[K]> : T[K] extends (infer U)[] | undefined ? WhereQueryStatement<U
|
|
18
|
-
'!': LiteralValues<T[K]>;
|
|
19
|
-
};
|
|
17
|
+
[K in keyof T as ExcludeEntityCollections<T[K], ExcludeFunctions<T[K], K>>]?: K extends 'id' ? WhereQueryStatement<T | T[K]> : T[K] extends (infer U)[] | undefined ? WhereQueryStatement<ExcludeUndefined<U>> : NegatableConstraint<LiteralValues<ExcludeUndefined<T[K]>>> | WhereQueryStatement<ExcludeUndefined<T[K]>>;
|
|
20
18
|
} & {
|
|
21
19
|
or?: WhereQuery<T>[];
|
|
22
20
|
};
|