@classytic/mongokit 2.0.0 → 2.1.0
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/README.md +221 -7
- package/dist/actions/index.cjs +479 -0
- package/dist/actions/index.cjs.map +1 -0
- package/dist/actions/index.d.cts +3 -0
- package/dist/actions/index.d.ts +3 -0
- package/dist/actions/index.js +473 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/index-BfVJZF-3.d.cts +337 -0
- package/dist/index-CgOJ2pqz.d.ts +337 -0
- package/dist/index.cjs +2142 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +239 -0
- package/dist/index.d.ts +239 -0
- package/dist/index.js +2108 -0
- package/dist/index.js.map +1 -0
- package/dist/memory-cache-DG2oSSbx.d.ts +142 -0
- package/dist/memory-cache-DqfFfKes.d.cts +142 -0
- package/dist/pagination/PaginationEngine.cjs +375 -0
- package/dist/pagination/PaginationEngine.cjs.map +1 -0
- package/dist/pagination/PaginationEngine.d.cts +117 -0
- package/dist/pagination/PaginationEngine.d.ts +117 -0
- package/dist/pagination/PaginationEngine.js +369 -0
- package/dist/pagination/PaginationEngine.js.map +1 -0
- package/dist/plugins/index.cjs +874 -0
- package/dist/plugins/index.cjs.map +1 -0
- package/dist/plugins/index.d.cts +275 -0
- package/dist/plugins/index.d.ts +275 -0
- package/dist/plugins/index.js +857 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/types-Nxhmi1aI.d.cts +510 -0
- package/dist/types-Nxhmi1aI.d.ts +510 -0
- package/dist/utils/index.cjs +667 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +189 -0
- package/dist/utils/index.d.ts +189 -0
- package/dist/utils/index.js +643 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +44 -21
- package/src/Repository.js +0 -296
- package/src/actions/aggregate.js +0 -266
- package/src/actions/create.js +0 -59
- package/src/actions/delete.js +0 -88
- package/src/actions/index.js +0 -11
- package/src/actions/read.js +0 -188
- package/src/actions/update.js +0 -176
- package/src/hooks/lifecycle.js +0 -146
- package/src/index.js +0 -71
- package/src/pagination/PaginationEngine.js +0 -348
- package/src/pagination/utils/cursor.js +0 -119
- package/src/pagination/utils/filter.js +0 -42
- package/src/pagination/utils/limits.js +0 -82
- package/src/pagination/utils/sort.js +0 -101
- package/src/plugins/aggregate-helpers.plugin.js +0 -71
- package/src/plugins/audit-log.plugin.js +0 -60
- package/src/plugins/batch-operations.plugin.js +0 -66
- package/src/plugins/field-filter.plugin.js +0 -27
- package/src/plugins/index.js +0 -19
- package/src/plugins/method-registry.plugin.js +0 -140
- package/src/plugins/mongo-operations.plugin.js +0 -317
- package/src/plugins/soft-delete.plugin.js +0 -46
- package/src/plugins/subdocument.plugin.js +0 -66
- package/src/plugins/timestamp.plugin.js +0 -19
- package/src/plugins/validation-chain.plugin.js +0 -145
- package/src/types.d.ts +0 -87
- package/src/utils/error.js +0 -12
- package/src/utils/field-selection.js +0 -156
- package/src/utils/index.js +0 -12
- package/types/Repository.d.ts +0 -95
- package/types/Repository.d.ts.map +0 -1
- package/types/actions/aggregate.d.ts +0 -112
- package/types/actions/aggregate.d.ts.map +0 -1
- package/types/actions/create.d.ts +0 -21
- package/types/actions/create.d.ts.map +0 -1
- package/types/actions/delete.d.ts +0 -37
- package/types/actions/delete.d.ts.map +0 -1
- package/types/actions/index.d.ts +0 -6
- package/types/actions/index.d.ts.map +0 -1
- package/types/actions/read.d.ts +0 -135
- package/types/actions/read.d.ts.map +0 -1
- package/types/actions/update.d.ts +0 -58
- package/types/actions/update.d.ts.map +0 -1
- package/types/hooks/lifecycle.d.ts +0 -44
- package/types/hooks/lifecycle.d.ts.map +0 -1
- package/types/index.d.ts +0 -25
- package/types/index.d.ts.map +0 -1
- package/types/pagination/PaginationEngine.d.ts +0 -386
- package/types/pagination/PaginationEngine.d.ts.map +0 -1
- package/types/pagination/utils/cursor.d.ts +0 -40
- package/types/pagination/utils/cursor.d.ts.map +0 -1
- package/types/pagination/utils/filter.d.ts +0 -28
- package/types/pagination/utils/filter.d.ts.map +0 -1
- package/types/pagination/utils/limits.d.ts +0 -64
- package/types/pagination/utils/limits.d.ts.map +0 -1
- package/types/pagination/utils/sort.d.ts +0 -41
- package/types/pagination/utils/sort.d.ts.map +0 -1
- package/types/plugins/aggregate-helpers.plugin.d.ts +0 -6
- package/types/plugins/aggregate-helpers.plugin.d.ts.map +0 -1
- package/types/plugins/audit-log.plugin.d.ts +0 -6
- package/types/plugins/audit-log.plugin.d.ts.map +0 -1
- package/types/plugins/batch-operations.plugin.d.ts +0 -6
- package/types/plugins/batch-operations.plugin.d.ts.map +0 -1
- package/types/plugins/field-filter.plugin.d.ts +0 -6
- package/types/plugins/field-filter.plugin.d.ts.map +0 -1
- package/types/plugins/index.d.ts +0 -11
- package/types/plugins/index.d.ts.map +0 -1
- package/types/plugins/method-registry.plugin.d.ts +0 -3
- package/types/plugins/method-registry.plugin.d.ts.map +0 -1
- package/types/plugins/mongo-operations.plugin.d.ts +0 -4
- package/types/plugins/mongo-operations.plugin.d.ts.map +0 -1
- package/types/plugins/soft-delete.plugin.d.ts +0 -6
- package/types/plugins/soft-delete.plugin.d.ts.map +0 -1
- package/types/plugins/subdocument.plugin.d.ts +0 -6
- package/types/plugins/subdocument.plugin.d.ts.map +0 -1
- package/types/plugins/timestamp.plugin.d.ts +0 -6
- package/types/plugins/timestamp.plugin.d.ts.map +0 -1
- package/types/plugins/validation-chain.plugin.d.ts +0 -31
- package/types/plugins/validation-chain.plugin.d.ts.map +0 -1
- package/types/utils/error.d.ts +0 -11
- package/types/utils/error.d.ts.map +0 -1
- package/types/utils/field-selection.d.ts +0 -9
- package/types/utils/field-selection.d.ts.map +0 -1
- package/types/utils/index.d.ts +0 -2
- package/types/utils/index.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subdocument.plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/subdocument.plugin.js"],"names":[],"mappings":"AAOO;;;EAwDL"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timestamp.plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/timestamp.plugin.js"],"names":[],"mappings":"AAAO;;;EAgBL"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export function validationChainPlugin(validators?: any[], options?: {}): {
|
|
2
|
-
name: string;
|
|
3
|
-
apply(repo: any): void;
|
|
4
|
-
};
|
|
5
|
-
export function blockIf(name: string, operations: string[], condition: Function, errorMessage: string): {
|
|
6
|
-
name: string;
|
|
7
|
-
operations: string[];
|
|
8
|
-
validate: (context: any) => void;
|
|
9
|
-
};
|
|
10
|
-
export function requireField(field: any, operations?: string[]): {
|
|
11
|
-
name: string;
|
|
12
|
-
operations: string[];
|
|
13
|
-
validate: (context: any) => void;
|
|
14
|
-
};
|
|
15
|
-
export function autoInject(field: any, getter: any, operations?: string[]): {
|
|
16
|
-
name: string;
|
|
17
|
-
operations: string[];
|
|
18
|
-
validate: (context: any) => void;
|
|
19
|
-
};
|
|
20
|
-
export function immutableField(field: any): {
|
|
21
|
-
name: string;
|
|
22
|
-
operations: string[];
|
|
23
|
-
validate: (context: any) => void;
|
|
24
|
-
};
|
|
25
|
-
export function uniqueField(field: any, errorMessage: any): {
|
|
26
|
-
name: string;
|
|
27
|
-
operations: string[];
|
|
28
|
-
validate: (context: any, repo: any) => Promise<void>;
|
|
29
|
-
};
|
|
30
|
-
export default validationChainPlugin;
|
|
31
|
-
//# sourceMappingURL=validation-chain.plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validation-chain.plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/validation-chain.plugin.js"],"names":[],"mappings":"AAEO;;;EAsEN;AAUM,8BANI,MAAM,cACN,MAAM,EAAE,qCAER,MAAM;;;;EAWf;AAEK;;;;EAQL;AAEK;;;;EAWL;AAEK;;;;EAQL;AAEK;;;;EAiBL"}
|
package/types/utils/error.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates an error with HTTP status code
|
|
3
|
-
*
|
|
4
|
-
* @param {number} status - HTTP status code
|
|
5
|
-
* @param {string} message - Error message
|
|
6
|
-
* @returns {Error & {status: number}} Error with status property
|
|
7
|
-
*/
|
|
8
|
-
export function createError(status: number, message: string): Error & {
|
|
9
|
-
status: number;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/utils/error.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,oCAJW,MAAM,WACN,MAAM,GACJ,KAAK,GAAG;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAMpC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export function getFieldsForUser(user: any, preset: {
|
|
2
|
-
public: string[];
|
|
3
|
-
authenticated: string[];
|
|
4
|
-
admin: string[];
|
|
5
|
-
}): string[];
|
|
6
|
-
export function getMongooseProjection(user: any, preset: any): string;
|
|
7
|
-
export function filterResponseData(data: any | any[], preset: any, user?: any): any | any[];
|
|
8
|
-
export function createFieldPreset(config: any): any;
|
|
9
|
-
//# sourceMappingURL=field-selection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-selection.d.ts","sourceRoot":"","sources":["../../src/utils/field-selection.js"],"names":[],"mappings":"AA+BO,oDALJ;IAAyB,MAAM,EAAvB,MAAM,EAAE;IACS,aAAa,EAA9B,MAAM,EAAE;IACS,KAAK,EAAtB,MAAM,EAAE;CAChB,GAAU,MAAM,EAAE,CAuBpB;AAaM,+DANM,MAAM,CASlB;AAsBM,yCAVI,WAAY,4BAGV,WAAY,CAiBxB;AAiDM,oDAMN"}
|
package/types/utils/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.js"],"names":[],"mappings":""}
|