@aiao/rxdb 0.0.2 → 0.0.3
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/entity/EntityBase.d.ts +2 -0
- package/entity/TreeEntityBase.d.ts +2 -0
- package/entity/entity-metadata-options.interface.d.ts +1 -5
- package/entity/transition-metadata.d.ts +2 -2
- package/index.d.ts +7 -0
- package/index.js +359 -349
- package/package.json +2 -2
- package/repository/query.interface.d.ts +0 -5
- package/repository/relation-query.interface.d.ts +62 -0
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiao/rxdb",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"uuid": "^11.1.0",
|
|
8
8
|
"type-fest": "^4.41.0",
|
|
9
|
-
"@aiao/utils": "0.0.
|
|
9
|
+
"@aiao/utils": "0.0.3",
|
|
10
10
|
"rxjs": "~7.8.0"
|
|
11
11
|
},
|
|
12
12
|
".": {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SetNonNullable } from 'type-fest';
|
|
2
|
-
import { UUID } from '../entity/entity.interface';
|
|
3
2
|
/**
|
|
4
3
|
* 判断相等
|
|
5
4
|
*/
|
|
@@ -60,10 +59,6 @@ export type BooleanRules<T, K extends keyof T = keyof T, VT = T[K]> = RuleEqualN
|
|
|
60
59
|
* Date
|
|
61
60
|
*/
|
|
62
61
|
export type DateRules<T, K extends keyof T = keyof T, VT = T[K]> = RuleEqualNullable<T, K, VT> | RuleNumberNonNullable<T, K, VT> | RuleIn<T, K, VT> | RuleBetween<T, K, VT>;
|
|
63
|
-
export type OneToOneRules<T, K extends keyof T = keyof T> = RuleEqualNullable<T, K, UUID> | RuleIn<T, K, UUID>;
|
|
64
|
-
export type ManyToOneRules<T, K extends keyof T = keyof T> = RuleEqualNullable<T, K, UUID> | RuleIn<T, K, UUID>;
|
|
65
|
-
export type OneToManyRules<T, K extends keyof T = keyof T> = RuleIn<T, K, UUID>;
|
|
66
|
-
export type ManyToManyRules<T, K extends keyof T = keyof T> = RuleIn<T, K, UUID>;
|
|
67
62
|
/**
|
|
68
63
|
* 查询规则
|
|
69
64
|
*/
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { SetNonNullable } from 'type-fest';
|
|
2
|
+
/**
|
|
3
|
+
* 判断相等
|
|
4
|
+
*/
|
|
5
|
+
interface RuleEqualNullable<K, VT> {
|
|
6
|
+
field: K;
|
|
7
|
+
operator: '=' | '!=';
|
|
8
|
+
value: VT;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 字符串比较
|
|
12
|
+
*/
|
|
13
|
+
interface RuleStringNonNullable<K, VT> {
|
|
14
|
+
field: K;
|
|
15
|
+
operator: '<' | '>' | '<=' | '>=' | 'contains' | 'notContain' | 'beginWith' | 'notBeginWith' | 'endWith' | 'notEndWith';
|
|
16
|
+
value: SetNonNullable<VT>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 数值比较
|
|
20
|
+
*/
|
|
21
|
+
interface RuleNumberNonNullable<K, VT> {
|
|
22
|
+
field: K;
|
|
23
|
+
operator: '<' | '>' | '<=' | '>=';
|
|
24
|
+
value: SetNonNullable<VT>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* in
|
|
28
|
+
*/
|
|
29
|
+
interface RuleIn<K, VT> {
|
|
30
|
+
field: K;
|
|
31
|
+
operator: 'in' | 'notIn';
|
|
32
|
+
value: SetNonNullable<VT>[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* between
|
|
36
|
+
*/
|
|
37
|
+
interface RuleBetween<K, VT> {
|
|
38
|
+
field: K;
|
|
39
|
+
operator: 'between' | 'notBetween';
|
|
40
|
+
value: [SetNonNullable<VT>, SetNonNullable<VT>];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* UUID
|
|
44
|
+
*/
|
|
45
|
+
export type RelationUUIDRules<K, VT> = RuleEqualNullable<K, VT> | RuleIn<K, VT>;
|
|
46
|
+
/**
|
|
47
|
+
* string
|
|
48
|
+
*/
|
|
49
|
+
export type RelationStringRules<K, VT> = RuleEqualNullable<K, VT> | RuleStringNonNullable<K, VT> | RuleIn<K, VT> | RuleBetween<K, VT>;
|
|
50
|
+
/**
|
|
51
|
+
* number
|
|
52
|
+
*/
|
|
53
|
+
export type RelationNumberRules<K, VT> = RuleEqualNullable<K, VT> | RuleNumberNonNullable<K, VT> | RuleIn<K, VT> | RuleBetween<K, VT>;
|
|
54
|
+
/**
|
|
55
|
+
* Boolean
|
|
56
|
+
*/
|
|
57
|
+
export type RelationBooleanRules<K, VT> = RuleEqualNullable<K, VT>;
|
|
58
|
+
/**
|
|
59
|
+
* Date
|
|
60
|
+
*/
|
|
61
|
+
export type RelationDateRules<K, VT> = RuleEqualNullable<K, VT> | RuleNumberNonNullable<K, VT> | RuleIn<K, VT> | RuleBetween<K, VT>;
|
|
62
|
+
export {};
|