mocody 0.4.27 → 0.4.29
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/type/index.d.ts +8 -16
- package/package.json +1 -1
package/dist/type/index.d.ts
CHANGED
|
@@ -6,37 +6,29 @@ type TypeFallBackStringOnly<T> = T extends string ? Extract<T, string> : never;
|
|
|
6
6
|
type TypeFallBack<T> = undefined extends T ? Exclude<T, undefined> : T;
|
|
7
7
|
type TypeFallBackArray<T> = number extends T ? number[] : string extends T ? string[] : T;
|
|
8
8
|
type TypeFallBackArrayAdvanced<T> = number extends T ? number[] : string extends T ? string[] : Extract<T, string>[] | Extract<T, number>[];
|
|
9
|
-
export type IMocodyKeyConditionParams<T
|
|
9
|
+
export type IMocodyKeyConditionParams<T = string> = {
|
|
10
10
|
$eq?: TypeFallBack<T> | null;
|
|
11
11
|
$gt?: TypeFallBack<T>;
|
|
12
12
|
$gte?: TypeFallBack<T>;
|
|
13
13
|
$lt?: TypeFallBack<T>;
|
|
14
14
|
$lte?: TypeFallBack<T>;
|
|
15
15
|
$between?: [TypeFallBack<T>, TypeFallBack<T>];
|
|
16
|
-
} & (T extends string ? {
|
|
17
16
|
$beginsWith?: TypeFallBackStringOnly<T>;
|
|
18
|
-
}
|
|
19
|
-
export type IMocodyQueryConditionParams<T = any> = {
|
|
17
|
+
};
|
|
18
|
+
export type IMocodyQueryConditionParams<T = any> = IMocodyKeyConditionParams<T> & {
|
|
20
19
|
$ne?: TypeFallBack<T> | null;
|
|
21
20
|
$in?: TypeFallBackArrayAdvanced<T>;
|
|
22
21
|
$nin?: TypeFallBackArrayAdvanced<T>;
|
|
23
22
|
$exists?: boolean;
|
|
23
|
+
$not?: IMocodyKeyConditionParams<T>;
|
|
24
24
|
$elemMatch?: {
|
|
25
25
|
$in: TypeFallBackArray<T>;
|
|
26
26
|
};
|
|
27
27
|
$contains?: TypeFallBackStringOnly<T>;
|
|
28
28
|
$notContains?: TypeFallBackStringOnly<T>;
|
|
29
29
|
$nestedMatch?: IQueryNested<RequireAtLeastOne<T>>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
} : never);
|
|
33
|
-
export type IMocodyQueryNestedParams<T = any> = T extends string | number ? IMocodyKeyConditionParams<T> & {
|
|
34
|
-
$contains?: TypeFallBackStringOnly<T>;
|
|
35
|
-
$ne?: TypeFallBack<T> | null;
|
|
36
|
-
$in?: TypeFallBackArrayAdvanced<T>;
|
|
37
|
-
$nin?: TypeFallBackArrayAdvanced<T>;
|
|
38
|
-
$exists?: boolean;
|
|
39
|
-
} : {
|
|
30
|
+
};
|
|
31
|
+
export type IMocodyQueryNestedParams<T = any> = IMocodyKeyConditionParams<T> & {
|
|
40
32
|
$contains?: TypeFallBackStringOnly<T>;
|
|
41
33
|
$ne?: TypeFallBack<T> | null;
|
|
42
34
|
$in?: TypeFallBackArrayAdvanced<T>;
|
|
@@ -64,7 +56,7 @@ type IQueryDefAnd<T> = {
|
|
|
64
56
|
$and?: IQueryAll<RequireAtLeastOne<T>>[];
|
|
65
57
|
};
|
|
66
58
|
export type IMocodyQueryDefinition<T> = IQueryAll<RequireAtLeastOne<T & IQueryDefOr<T> & IQueryDefAnd<T>>>;
|
|
67
|
-
export interface IMocodyQueryIndexOptions<T, TSortKeyField
|
|
59
|
+
export interface IMocodyQueryIndexOptions<T, TSortKeyField = string> {
|
|
68
60
|
indexName: string;
|
|
69
61
|
partitionKeyValue: string | number;
|
|
70
62
|
sortKeyQuery?: IMocodyKeyConditionParams<TSortKeyField>;
|
|
@@ -75,7 +67,7 @@ export interface IMocodyQueryIndexOptions<T, TSortKeyField extends string | numb
|
|
|
75
67
|
limit?: number | undefined | null;
|
|
76
68
|
sort?: "asc" | "desc" | undefined | null;
|
|
77
69
|
}
|
|
78
|
-
export type IMocodyQueryIndexOptionsNoPaging<T, TSortKeyField
|
|
70
|
+
export type IMocodyQueryIndexOptionsNoPaging<T, TSortKeyField = string> = Omit<IMocodyQueryIndexOptions<T, TSortKeyField>, "pagingParams">;
|
|
79
71
|
export interface IMocodyIndexDefinition<T> {
|
|
80
72
|
indexName: string;
|
|
81
73
|
partitionKeyFieldName: keyof T;
|
package/package.json
CHANGED