@atscript/mongo 0.1.2 → 0.1.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/dist/index.d.ts +11 -3
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -47,7 +47,11 @@ declare class AsCollection<T extends TAtscriptAnnotatedTypeConstructor> {
|
|
|
47
47
|
protected readonly logger: TGenericLogger;
|
|
48
48
|
readonly name: string;
|
|
49
49
|
readonly collection: Collection<InstanceType<T>>;
|
|
50
|
-
protected readonly validators: Map<TValidatorPurpose, Validator<T,
|
|
50
|
+
protected readonly validators: Map<TValidatorPurpose, Validator<T, T extends {
|
|
51
|
+
type: {
|
|
52
|
+
__dataType?: infer D;
|
|
53
|
+
};
|
|
54
|
+
} ? unknown extends D ? T extends new (...args: any[]) => infer I ? I : D : D : unknown>>;
|
|
51
55
|
protected _indexes: Map<string, TIndex>;
|
|
52
56
|
protected _vectorFilters: Map<string, string>;
|
|
53
57
|
protected _flatMap?: Map<string, TAtscriptAnnotatedType>;
|
|
@@ -75,7 +79,11 @@ declare class AsCollection<T extends TAtscriptAnnotatedTypeConstructor> {
|
|
|
75
79
|
* @returns {Validator} The corresponding validator instance.
|
|
76
80
|
* @throws {Error} If an unknown purpose is provided.
|
|
77
81
|
*/
|
|
78
|
-
getValidator(purpose: TValidatorPurpose): Validator<T,
|
|
82
|
+
getValidator(purpose: TValidatorPurpose): Validator<T, T extends {
|
|
83
|
+
type: {
|
|
84
|
+
__dataType?: infer D;
|
|
85
|
+
};
|
|
86
|
+
} ? unknown extends D ? T extends new (...args: any[]) => infer I ? I : D : D : unknown> | undefined;
|
|
79
87
|
get type(): TAtscriptAnnotatedType<TAtscriptTypeObject>;
|
|
80
88
|
get indexes(): Map<string, TIndex>;
|
|
81
89
|
protected _addIndexField(type: TPlainIndex['type'], name: string, field: string, weight?: number): void;
|
|
@@ -93,7 +101,7 @@ declare class AsCollection<T extends TAtscriptAnnotatedTypeConstructor> {
|
|
|
93
101
|
protected _searchIndexesMap?: Map<string, TIndex>;
|
|
94
102
|
getSearchIndexes(): Map<string, TIndex>;
|
|
95
103
|
getSearchIndex(name?: string): TIndex | undefined;
|
|
96
|
-
get flatMap(): Map<string, TAtscriptAnnotatedType<_atscript_typescript_utils.TAtscriptTypeDef>>;
|
|
104
|
+
get flatMap(): Map<string, TAtscriptAnnotatedType<_atscript_typescript_utils.TAtscriptTypeDef<unknown>, unknown>>;
|
|
97
105
|
syncIndexes(): Promise<void>;
|
|
98
106
|
insert(payload: (Omit<InstanceType<T>, '_id'> & {
|
|
99
107
|
_id?: InstanceType<T>['_id'] | ObjectId;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/mongo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Mongodb plugin for atscript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"license": "ISC",
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"mongodb": "^6.17.0",
|
|
37
|
-
"@atscript/
|
|
38
|
-
"@atscript/
|
|
37
|
+
"@atscript/core": "^0.1.3",
|
|
38
|
+
"@atscript/typescript": "^0.1.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"vitest": "3.2.4"
|