monastery 3.5.1 → 3.5.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/changelog.md +4 -0
- package/docs/_config.yml +1 -0
- package/docs/assets/imgs/favicon.ico +0 -0
- package/docs/readme.md +2 -1
- package/lib/manager.js +11 -3
- package/lib/util.js +5 -5
- package/package.json +4 -2
- package/tsconfig.json +26 -0
- package/types/lib/collection.d.ts +32 -0
- package/types/lib/collection.d.ts.map +1 -0
- package/types/lib/index.d.ts +166 -0
- package/types/lib/index.d.ts.map +1 -0
- package/types/lib/manager.d.ts +25 -0
- package/types/lib/manager.d.ts.map +1 -0
- package/types/lib/model-crud.d.ts +2 -0
- package/types/lib/model-crud.d.ts.map +1 -0
- package/types/lib/model-validate.d.ts +2 -0
- package/types/lib/model-validate.d.ts.map +1 -0
- package/types/lib/model.d.ts +37 -0
- package/types/lib/model.d.ts.map +1 -0
- package/types/lib/rules.d.ts +211 -0
- package/types/lib/rules.d.ts.map +1 -0
- package/types/lib/util.d.ts +38 -0
- package/types/lib/util.d.ts.map +1 -0
- package/types/plugins/images/index.d.ts +12 -0
- package/types/plugins/images/index.d.ts.map +1 -0
package/changelog.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [3.5.3](https://github.com/boycce/monastery/compare/3.5.2...3.5.3) (2025-06-12)
|
|
6
|
+
|
|
7
|
+
### [3.5.2](https://github.com/boycce/monastery/compare/3.5.1...3.5.2) (2025-01-22)
|
|
8
|
+
|
|
5
9
|
### [3.5.1](https://github.com/boycce/monastery/compare/3.5.0...3.5.1) (2024-12-23)
|
|
6
10
|
|
|
7
11
|
## [3.5.0](https://github.com/boycce/monastery/compare/3.4.3...3.5.0) (2024-12-20)
|
package/docs/_config.yml
CHANGED
|
Binary file
|
package/docs/readme.md
CHANGED
package/lib/manager.js
CHANGED
|
@@ -14,7 +14,7 @@ function Manager(uri, opts, parent) {
|
|
|
14
14
|
/**
|
|
15
15
|
* Constructs a new manager which contains a new MongoDB client
|
|
16
16
|
*
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {string|Array|Object} uri - MongoDB connection URI string / replica set, or reuse a MongoClient instance
|
|
18
18
|
* @param {Object} opts -
|
|
19
19
|
* {String} <opts.databaseName> - the name of the database
|
|
20
20
|
* {Boolean} <opts.promise(manager)> - return a promise
|
|
@@ -188,7 +188,7 @@ Manager.prototype.isId = function(value) {
|
|
|
188
188
|
return util.isId(value)
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
Manager.prototype.models = async function(pathname, opts) {
|
|
191
|
+
Manager.prototype.models = async function(pathname, opts={}) {
|
|
192
192
|
/**
|
|
193
193
|
* Setup model definitions from a folder location
|
|
194
194
|
* @param {string} pathname
|
|
@@ -199,7 +199,7 @@ Manager.prototype.models = async function(pathname, opts) {
|
|
|
199
199
|
* @this Manager
|
|
200
200
|
*/
|
|
201
201
|
let out = {}
|
|
202
|
-
let { waitForIndexes } = opts
|
|
202
|
+
let { waitForIndexes } = opts
|
|
203
203
|
if (!pathname || typeof pathname !== 'string') {
|
|
204
204
|
throw 'The path must be a valid pathname'
|
|
205
205
|
}
|
|
@@ -235,6 +235,10 @@ Manager.prototype.onError = function(fn) {
|
|
|
235
235
|
* @return {Promise}
|
|
236
236
|
*/
|
|
237
237
|
return new Promise((resolve, reject) => {
|
|
238
|
+
if (!this.emitter) {
|
|
239
|
+
reject(new Error('Emitter not found! This can happen if two seperate monastery packages are imported into the ' +
|
|
240
|
+
'same project. E.g. the first package initializes the manager, and the second package tries to use it.'))
|
|
241
|
+
}
|
|
238
242
|
this.emitter.on('error', (err) => {
|
|
239
243
|
resolve(err)
|
|
240
244
|
})
|
|
@@ -250,6 +254,10 @@ Manager.prototype.onOpen = function(fn) {
|
|
|
250
254
|
* @return {Promise(manager)}
|
|
251
255
|
*/
|
|
252
256
|
return new Promise((resolve, reject) => {
|
|
257
|
+
if (!this.emitter) {
|
|
258
|
+
reject(new Error('Emitter not found! This can happen if two seperate monastery packages are imported into the ' +
|
|
259
|
+
'same project. E.g. the first package initializes the manager, and the second package tries to use it.'))
|
|
260
|
+
}
|
|
253
261
|
if (this._state == 'open') {
|
|
254
262
|
resolve(this)
|
|
255
263
|
}
|
package/lib/util.js
CHANGED
|
@@ -72,12 +72,12 @@ module.exports = {
|
|
|
72
72
|
return this.isArray(value)? value : [value]
|
|
73
73
|
},
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Casts to ObjectId
|
|
77
|
+
* @param {string|ObjectId} str - string = hex string
|
|
78
|
+
* @return {ObjectId}
|
|
79
|
+
*/
|
|
75
80
|
id: function(str) {
|
|
76
|
-
/**
|
|
77
|
-
* Casts to ObjectId
|
|
78
|
-
* @param {string|ObjectId} str - string = hex string
|
|
79
|
-
* @return {ObjectId}
|
|
80
|
-
*/
|
|
81
81
|
if (str == null) return new ObjectId()
|
|
82
82
|
return typeof str === 'string' ? ObjectId.createFromHexString(str) : str
|
|
83
83
|
},
|
package/package.json
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
"name": "monastery",
|
|
3
3
|
"description": "⛪ A simple, straightforward MongoDB ODM",
|
|
4
4
|
"author": "Ricky Boyce",
|
|
5
|
-
"version": "3.5.
|
|
5
|
+
"version": "3.5.3",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "github:boycce/monastery",
|
|
8
8
|
"homepage": "https://boycce.github.io/monastery/",
|
|
9
9
|
"main": "lib/index.js",
|
|
10
|
+
"types": "./types/index.d.ts",
|
|
10
11
|
"keywords": [
|
|
11
12
|
"database",
|
|
12
13
|
"javascript",
|
|
@@ -30,7 +31,8 @@
|
|
|
30
31
|
"patch": "standard-version --release-as patch && npm publish",
|
|
31
32
|
"release": "standard-version && npm publish && git push --tags",
|
|
32
33
|
"test": "npm run lint && jest",
|
|
33
|
-
"test-one-example": "jest -t \"images addImages\" --watchAll"
|
|
34
|
+
"test-one-example": "jest -t \"images addImages\" --watchAll",
|
|
35
|
+
"types": "tsc"
|
|
34
36
|
},
|
|
35
37
|
"dependencies": {
|
|
36
38
|
"@aws-sdk/client-s3": "3.549.0",
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowJs": true,
|
|
4
|
+
"allowSyntheticDefaultImports": true,
|
|
5
|
+
"checkJs": true,
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
8
|
+
"emitDeclarationOnly": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"isolatedModules": true,
|
|
12
|
+
"moduleResolution": "node",
|
|
13
|
+
"noFallthroughCasesInSwitch": true,
|
|
14
|
+
"noImplicitAny": false,
|
|
15
|
+
"noImplicitReturns": false,
|
|
16
|
+
"noImplicitThis": true,
|
|
17
|
+
"noStrictGenericChecks": false,
|
|
18
|
+
"outDir": "types",
|
|
19
|
+
"skipLibCheck": true,
|
|
20
|
+
"strict": false,
|
|
21
|
+
"target": "es2022"
|
|
22
|
+
},
|
|
23
|
+
"include": [
|
|
24
|
+
"lib/**/*"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export = Collection;
|
|
2
|
+
declare function Collection(manager: any, name: any, options: any): void;
|
|
3
|
+
declare class Collection {
|
|
4
|
+
constructor(manager: any, name: any, options: any);
|
|
5
|
+
col: any;
|
|
6
|
+
manager: any;
|
|
7
|
+
name: any;
|
|
8
|
+
options: any;
|
|
9
|
+
_middleware(args: any): Promise<any>;
|
|
10
|
+
aggregate(stages: any, opts: any): Promise<any>;
|
|
11
|
+
bulkWrite(operations: any, opts: any): Promise<any>;
|
|
12
|
+
count(query: any, opts: any): Promise<any>;
|
|
13
|
+
createIndex(indexSpec: any, opts: any): Promise<any>;
|
|
14
|
+
createIndexes(indexSpecs: any, opts: any): Promise<any>;
|
|
15
|
+
distinct(field: any, query: any, opts: any): Promise<any>;
|
|
16
|
+
drop(): Promise<string>;
|
|
17
|
+
dropIndex(name: any, opts: any): Promise<any>;
|
|
18
|
+
dropIndexes(): Promise<any>;
|
|
19
|
+
find(query: any, opts: any): Promise<any>;
|
|
20
|
+
findOne(query: any, opts: any): Promise<any>;
|
|
21
|
+
findOneAndDelete(query: any, opts: any): Promise<any>;
|
|
22
|
+
findOneAndUpdate(query: any, update: any, opts: any): Promise<any>;
|
|
23
|
+
geoHaystackSearch(x: any, y: any, opts: any): Promise<never>;
|
|
24
|
+
indexInformation(opts: any): Promise<any>;
|
|
25
|
+
indexes(opts: any): Promise<any>;
|
|
26
|
+
insert(data: any, opts: any): Promise<any>;
|
|
27
|
+
mapReduce(map: any, reduce: any, opts: any): Promise<never>;
|
|
28
|
+
remove(query: any, opts: any): Promise<any>;
|
|
29
|
+
stats(opts: any): Promise<any>;
|
|
30
|
+
update(query: any, update: any, opts: any): Promise<any>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=collection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../lib/collection.js"],"names":[],"mappings":";AAEA,yEAKC;;IALD,mDAKC;IAJC,SAAe;IACf,aAAsB;IACtB,UAAgB;IAChB,aAAsB;IAGxB,qCAgEC;IAED,gDAGC;IAED,oDAGC;IAED,2CAQC;IAED,qDAGC;IAED,wDAGC;IAED,0DAGC;IAED,wBASC;IAED,8CAGC;IAED,4BAGC;IAED,0CAoDC;IAED,6CAIC;IAED,sDAOC;IAED,mEAmBC;IAED,6DAGC;IAED,0CASC;IAED,iCASC;IAED,2CAwBC;IAED,4DAGC;IAED,4CAIC;IAED,+BAGC;IAED,yDA+BC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
declare const _exports: {
|
|
2
|
+
manager(uri: any, opts: any): Manager;
|
|
3
|
+
arrayWithSchema: any;
|
|
4
|
+
close(): Promise<any>;
|
|
5
|
+
_state: string;
|
|
6
|
+
command(...args: any[]): any;
|
|
7
|
+
connectionString(uri: any, databaseName: any): any;
|
|
8
|
+
get(name: any, options: any): any;
|
|
9
|
+
id: any;
|
|
10
|
+
isId: any;
|
|
11
|
+
models(pathname: any, opts?: {}): Promise<{}>;
|
|
12
|
+
onError(fn: any): Promise<any>;
|
|
13
|
+
onOpen(fn: any): Promise<any>;
|
|
14
|
+
open(): Promise<Manager>;
|
|
15
|
+
db: any;
|
|
16
|
+
parseData: any;
|
|
17
|
+
model: typeof import("./model");
|
|
18
|
+
getSignedUrl: any;
|
|
19
|
+
_getSignedUrl(): never;
|
|
20
|
+
parseBracketNotation: any;
|
|
21
|
+
parseBracketToDotNotation: any;
|
|
22
|
+
parseDotNotation: any;
|
|
23
|
+
rules: {
|
|
24
|
+
required: {
|
|
25
|
+
validateUndefined: boolean;
|
|
26
|
+
validateNull: boolean;
|
|
27
|
+
validateEmptyString: boolean;
|
|
28
|
+
message: string;
|
|
29
|
+
fn: (x: any) => boolean;
|
|
30
|
+
};
|
|
31
|
+
isBoolean: {
|
|
32
|
+
validateEmptyString: boolean;
|
|
33
|
+
message: string;
|
|
34
|
+
tryParse: (x: any) => any;
|
|
35
|
+
fn: (x: any) => boolean;
|
|
36
|
+
};
|
|
37
|
+
isArray: {
|
|
38
|
+
validateEmptyString: boolean;
|
|
39
|
+
message: string;
|
|
40
|
+
tryParse: (x: any) => any;
|
|
41
|
+
fn: (x: any) => boolean;
|
|
42
|
+
};
|
|
43
|
+
isDate: {
|
|
44
|
+
validateEmptyString: boolean;
|
|
45
|
+
message: string;
|
|
46
|
+
tryParse: (x: any) => any;
|
|
47
|
+
fn: (x: any) => boolean;
|
|
48
|
+
};
|
|
49
|
+
isImageObject: {
|
|
50
|
+
validateEmptyString: boolean;
|
|
51
|
+
message: string;
|
|
52
|
+
messageLong: string;
|
|
53
|
+
tryParse: (x: any) => any;
|
|
54
|
+
fn: (x: any) => boolean;
|
|
55
|
+
};
|
|
56
|
+
isInteger: {
|
|
57
|
+
validateEmptyString: boolean;
|
|
58
|
+
message: string;
|
|
59
|
+
tryParse: (x: any) => any;
|
|
60
|
+
fn: (x: any) => boolean;
|
|
61
|
+
};
|
|
62
|
+
isNumber: {
|
|
63
|
+
validateEmptyString: boolean;
|
|
64
|
+
message: string;
|
|
65
|
+
tryParse: (x: any) => any;
|
|
66
|
+
fn: (x: any) => boolean;
|
|
67
|
+
};
|
|
68
|
+
isObject: {
|
|
69
|
+
validateEmptyString: boolean;
|
|
70
|
+
message: string;
|
|
71
|
+
tryParse: (x: any) => any;
|
|
72
|
+
fn: (x: any) => boolean;
|
|
73
|
+
};
|
|
74
|
+
isString: {
|
|
75
|
+
validateEmptyString: boolean;
|
|
76
|
+
message: string;
|
|
77
|
+
tryParse: (x: any) => any;
|
|
78
|
+
fn: (x: any) => boolean;
|
|
79
|
+
};
|
|
80
|
+
isAny: {
|
|
81
|
+
validateEmptyString: boolean;
|
|
82
|
+
message: string;
|
|
83
|
+
fn: (x: any) => boolean;
|
|
84
|
+
};
|
|
85
|
+
isId: {
|
|
86
|
+
validateEmptyString: boolean;
|
|
87
|
+
message: string;
|
|
88
|
+
tryParse: (x: any) => any;
|
|
89
|
+
fn: (x: any) => boolean;
|
|
90
|
+
};
|
|
91
|
+
max: {
|
|
92
|
+
message: (x: any, arg: any) => string;
|
|
93
|
+
fn: (x: any, arg: any) => boolean;
|
|
94
|
+
};
|
|
95
|
+
min: {
|
|
96
|
+
message: (x: any, arg: any) => string;
|
|
97
|
+
fn: (x: any, arg: any) => boolean;
|
|
98
|
+
};
|
|
99
|
+
enum: {
|
|
100
|
+
message: (x: any, arg: any) => string;
|
|
101
|
+
fn: (x: any, arg: any) => boolean;
|
|
102
|
+
};
|
|
103
|
+
isAfter: {
|
|
104
|
+
message: (x: any, arg: any) => string;
|
|
105
|
+
fn: (x: any, arg: any) => any;
|
|
106
|
+
};
|
|
107
|
+
isBefore: {
|
|
108
|
+
message: (x: any, arg: any) => string;
|
|
109
|
+
fn: (x: any, arg: any) => any;
|
|
110
|
+
};
|
|
111
|
+
isCreditCard: {
|
|
112
|
+
message: string;
|
|
113
|
+
fn: (x: any, arg: any) => any;
|
|
114
|
+
};
|
|
115
|
+
isEmail: {
|
|
116
|
+
message: string;
|
|
117
|
+
fn: (x: any, arg: any) => any;
|
|
118
|
+
};
|
|
119
|
+
isHexColor: {
|
|
120
|
+
message: string;
|
|
121
|
+
fn: (x: any, arg: any) => any;
|
|
122
|
+
};
|
|
123
|
+
isIn: {
|
|
124
|
+
message: (x: any, arg: any) => string;
|
|
125
|
+
fn: (x: any, arg: any) => any;
|
|
126
|
+
};
|
|
127
|
+
isIP: {
|
|
128
|
+
message: string;
|
|
129
|
+
fn: (x: any, arg: any) => any;
|
|
130
|
+
};
|
|
131
|
+
isNotEmptyString: {
|
|
132
|
+
validateEmptyString: boolean;
|
|
133
|
+
message: string;
|
|
134
|
+
fn: (x: any) => boolean;
|
|
135
|
+
};
|
|
136
|
+
isNotIn: {
|
|
137
|
+
message: (x: any, arg: any) => string;
|
|
138
|
+
fn: (x: any, arg: any) => boolean;
|
|
139
|
+
};
|
|
140
|
+
isURL: {
|
|
141
|
+
message: string;
|
|
142
|
+
fn: (x: any, arg: any) => any;
|
|
143
|
+
};
|
|
144
|
+
isUUID: {
|
|
145
|
+
message: string;
|
|
146
|
+
fn: (x: any, arg: any) => any;
|
|
147
|
+
};
|
|
148
|
+
minLength: {
|
|
149
|
+
message: (x: any, arg: any) => string;
|
|
150
|
+
fn: (x: any, arg: any) => any;
|
|
151
|
+
};
|
|
152
|
+
maxLength: {
|
|
153
|
+
message: (x: any, arg: any) => string;
|
|
154
|
+
fn: (x: any, arg: any) => any;
|
|
155
|
+
};
|
|
156
|
+
regex: {
|
|
157
|
+
message: (x: any, arg: any) => string;
|
|
158
|
+
fn: (x: any, arg: any) => any;
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
export = _exports;
|
|
163
|
+
export { rules };
|
|
164
|
+
import Manager = require("./manager");
|
|
165
|
+
import rules = require("./rules.js");
|
|
166
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export = Manager;
|
|
2
|
+
declare function Manager(uri: any, opts: any, parent: any): any;
|
|
3
|
+
declare class Manager {
|
|
4
|
+
constructor(uri: any, opts: any, parent: any);
|
|
5
|
+
manager(uri: any, opts: any): Manager;
|
|
6
|
+
arrayWithSchema(array: any, schema: any): any;
|
|
7
|
+
close(): Promise<any>;
|
|
8
|
+
_state: string;
|
|
9
|
+
command(...args: any[]): any;
|
|
10
|
+
connectionString(uri: any, databaseName: any): any;
|
|
11
|
+
get(name: any, options: any): any;
|
|
12
|
+
id(str: any): import("bson").ObjectId;
|
|
13
|
+
isId(value: any): boolean;
|
|
14
|
+
models(pathname: any, opts?: {}): Promise<{}>;
|
|
15
|
+
onError(fn: any): Promise<any>;
|
|
16
|
+
onOpen(fn: any): Promise<any>;
|
|
17
|
+
open(): Promise<Manager>;
|
|
18
|
+
db: any;
|
|
19
|
+
parseData(obj: any, parseBracketToDotNotation: any, parseDotNotation: any): any;
|
|
20
|
+
model: typeof Model;
|
|
21
|
+
getSignedUrl: (path: any, expires: number, bucket: any) => Promise<string>;
|
|
22
|
+
_getSignedUrl(): never;
|
|
23
|
+
}
|
|
24
|
+
import Model = require("./model.js");
|
|
25
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../lib/manager.js"],"names":[],"mappings":";AAYA,gEAuFC;;IAvFD,8CAuFC;IAED,sCAEC;IAED,8CAGC;IAED,sBAoBC;IAfqB,eAAuB;IAiB7C,6BAKC;IAED,mDA2BC;IAED,kCAYC;IAED,sCAEC;IAED,0BAEC;IAED,8CAsCC;IAED,+BAiBC;IAED,8BAuBC;IAED,yBAsBC;IAfG,QAA0B;IAiB9B,gFAEC;IAED,oBAAuB;IAEvB,2EAA8B;IAE9B,uBAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-crud.d.ts","sourceRoot":"","sources":["../../lib/model-crud.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-validate.d.ts","sourceRoot":"","sources":["../../lib/model-validate.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export = Model;
|
|
2
|
+
declare function Model(name: any, definition: any, waitForIndexes: any, manager: any): Model | Promise<this>;
|
|
3
|
+
declare class Model {
|
|
4
|
+
constructor(name: any, definition: any, waitForIndexes: any, manager: any);
|
|
5
|
+
messages: {};
|
|
6
|
+
fields: any;
|
|
7
|
+
fieldsFlattened: {};
|
|
8
|
+
modelFieldsArray: any[];
|
|
9
|
+
collection: any;
|
|
10
|
+
_getFieldsFlattened(fields: any, path: any): {};
|
|
11
|
+
_getModelFieldsArray(): any[];
|
|
12
|
+
_setupFields(fields: any, isSub: any): void;
|
|
13
|
+
_removeInvalidRules(field: any): any;
|
|
14
|
+
_setupIndexes(fields: any, opts?: {}): Promise<{
|
|
15
|
+
name: string;
|
|
16
|
+
key: {};
|
|
17
|
+
}[]>;
|
|
18
|
+
_callHooks(hookName: any, data: any, hookContext: any): Promise<any>;
|
|
19
|
+
_defaultFields: {
|
|
20
|
+
_id: {
|
|
21
|
+
insertOnly: boolean;
|
|
22
|
+
type: string;
|
|
23
|
+
};
|
|
24
|
+
createdAt: {
|
|
25
|
+
default: (fieldName: any, model: any) => number;
|
|
26
|
+
insertOnly: boolean;
|
|
27
|
+
timestampField: boolean;
|
|
28
|
+
type: string;
|
|
29
|
+
};
|
|
30
|
+
updatedAt: {
|
|
31
|
+
default: (fieldName: any, model: any) => number;
|
|
32
|
+
timestampField: boolean;
|
|
33
|
+
type: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../lib/model.js"],"names":[],"mappings":";AAGA,6GAkJC;;IAlJD,2EAkJC;IAtFC,aAgCQ;IAyBN,YAA4G;IAE9G,oBAAgE;IAChE,wBAAmD;IAGnD,gBAA4D;IAyB9D,gDAqBC;IAED,8BAWC;IAED,4CAwFC;IAED,qCAoBC;IAED;;;SA+GC;IAED,qEAaC;IAED;;;;;;;;;;;;;;;;MAA8B"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
export declare namespace required {
|
|
2
|
+
const validateUndefined: boolean;
|
|
3
|
+
const validateNull: boolean;
|
|
4
|
+
const validateEmptyString: boolean;
|
|
5
|
+
const message: string;
|
|
6
|
+
function fn(x: any): boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare namespace isBoolean {
|
|
9
|
+
const validateEmptyString_1: boolean;
|
|
10
|
+
export { validateEmptyString_1 as validateEmptyString };
|
|
11
|
+
const message_1: string;
|
|
12
|
+
export { message_1 as message };
|
|
13
|
+
export function tryParse(x: any): any;
|
|
14
|
+
export function fn_1(x: any): boolean;
|
|
15
|
+
export { fn_1 as fn };
|
|
16
|
+
}
|
|
17
|
+
export declare namespace isArray {
|
|
18
|
+
const validateEmptyString_2: boolean;
|
|
19
|
+
export { validateEmptyString_2 as validateEmptyString };
|
|
20
|
+
const message_2: string;
|
|
21
|
+
export { message_2 as message };
|
|
22
|
+
export function tryParse_1(x: any): any;
|
|
23
|
+
export { tryParse_1 as tryParse };
|
|
24
|
+
export function fn_2(x: any): boolean;
|
|
25
|
+
export { fn_2 as fn };
|
|
26
|
+
}
|
|
27
|
+
export declare namespace isDate {
|
|
28
|
+
const validateEmptyString_3: boolean;
|
|
29
|
+
export { validateEmptyString_3 as validateEmptyString };
|
|
30
|
+
const message_3: string;
|
|
31
|
+
export { message_3 as message };
|
|
32
|
+
export function tryParse_2(x: any): any;
|
|
33
|
+
export { tryParse_2 as tryParse };
|
|
34
|
+
export function fn_3(x: any): boolean;
|
|
35
|
+
export { fn_3 as fn };
|
|
36
|
+
}
|
|
37
|
+
export declare namespace isImageObject {
|
|
38
|
+
const validateEmptyString_4: boolean;
|
|
39
|
+
export { validateEmptyString_4 as validateEmptyString };
|
|
40
|
+
const message_4: string;
|
|
41
|
+
export { message_4 as message };
|
|
42
|
+
export const messageLong: string;
|
|
43
|
+
export function tryParse_3(x: any): any;
|
|
44
|
+
export { tryParse_3 as tryParse };
|
|
45
|
+
export function fn_4(x: any): boolean;
|
|
46
|
+
export { fn_4 as fn };
|
|
47
|
+
}
|
|
48
|
+
export declare namespace isInteger {
|
|
49
|
+
const validateEmptyString_5: boolean;
|
|
50
|
+
export { validateEmptyString_5 as validateEmptyString };
|
|
51
|
+
const message_5: string;
|
|
52
|
+
export { message_5 as message };
|
|
53
|
+
export function tryParse_4(x: any): any;
|
|
54
|
+
export { tryParse_4 as tryParse };
|
|
55
|
+
export function fn_5(x: any): boolean;
|
|
56
|
+
export { fn_5 as fn };
|
|
57
|
+
}
|
|
58
|
+
export declare namespace isNumber {
|
|
59
|
+
const validateEmptyString_6: boolean;
|
|
60
|
+
export { validateEmptyString_6 as validateEmptyString };
|
|
61
|
+
const message_6: string;
|
|
62
|
+
export { message_6 as message };
|
|
63
|
+
export function tryParse_5(x: any): any;
|
|
64
|
+
export { tryParse_5 as tryParse };
|
|
65
|
+
export function fn_6(x: any): boolean;
|
|
66
|
+
export { fn_6 as fn };
|
|
67
|
+
}
|
|
68
|
+
export declare namespace isObject {
|
|
69
|
+
const validateEmptyString_7: boolean;
|
|
70
|
+
export { validateEmptyString_7 as validateEmptyString };
|
|
71
|
+
const message_7: string;
|
|
72
|
+
export { message_7 as message };
|
|
73
|
+
export function tryParse_6(x: any): any;
|
|
74
|
+
export { tryParse_6 as tryParse };
|
|
75
|
+
export function fn_7(x: any): boolean;
|
|
76
|
+
export { fn_7 as fn };
|
|
77
|
+
}
|
|
78
|
+
export declare namespace isString {
|
|
79
|
+
const validateEmptyString_8: boolean;
|
|
80
|
+
export { validateEmptyString_8 as validateEmptyString };
|
|
81
|
+
const message_8: string;
|
|
82
|
+
export { message_8 as message };
|
|
83
|
+
export function tryParse_7(x: any): any;
|
|
84
|
+
export { tryParse_7 as tryParse };
|
|
85
|
+
export function fn_8(x: any): boolean;
|
|
86
|
+
export { fn_8 as fn };
|
|
87
|
+
}
|
|
88
|
+
export declare namespace isAny {
|
|
89
|
+
const validateEmptyString_9: boolean;
|
|
90
|
+
export { validateEmptyString_9 as validateEmptyString };
|
|
91
|
+
const message_9: string;
|
|
92
|
+
export { message_9 as message };
|
|
93
|
+
export function fn_9(x: any): boolean;
|
|
94
|
+
export { fn_9 as fn };
|
|
95
|
+
}
|
|
96
|
+
export declare namespace isId {
|
|
97
|
+
const validateEmptyString_10: boolean;
|
|
98
|
+
export { validateEmptyString_10 as validateEmptyString };
|
|
99
|
+
const message_10: string;
|
|
100
|
+
export { message_10 as message };
|
|
101
|
+
export function tryParse_8(x: any): any;
|
|
102
|
+
export { tryParse_8 as tryParse };
|
|
103
|
+
export function fn_10(x: any): boolean;
|
|
104
|
+
export { fn_10 as fn };
|
|
105
|
+
}
|
|
106
|
+
export declare namespace max {
|
|
107
|
+
export function message_11(x: any, arg: any): string;
|
|
108
|
+
export { message_11 as message };
|
|
109
|
+
export function fn_11(x: any, arg: any): boolean;
|
|
110
|
+
export { fn_11 as fn };
|
|
111
|
+
}
|
|
112
|
+
export declare namespace min {
|
|
113
|
+
export function message_12(x: any, arg: any): string;
|
|
114
|
+
export { message_12 as message };
|
|
115
|
+
export function fn_12(x: any, arg: any): boolean;
|
|
116
|
+
export { fn_12 as fn };
|
|
117
|
+
}
|
|
118
|
+
export declare namespace _enum {
|
|
119
|
+
export function message_13(x: any, arg: any): string;
|
|
120
|
+
export { message_13 as message };
|
|
121
|
+
export function fn_13(x: any, arg: any): boolean;
|
|
122
|
+
export { fn_13 as fn };
|
|
123
|
+
}
|
|
124
|
+
export { _enum as enum };
|
|
125
|
+
export declare namespace isAfter {
|
|
126
|
+
export function message_14(x: any, arg: any): string;
|
|
127
|
+
export { message_14 as message };
|
|
128
|
+
export function fn_14(x: any, arg: any): any;
|
|
129
|
+
export { fn_14 as fn };
|
|
130
|
+
}
|
|
131
|
+
export declare namespace isBefore {
|
|
132
|
+
export function message_15(x: any, arg: any): string;
|
|
133
|
+
export { message_15 as message };
|
|
134
|
+
export function fn_15(x: any, arg: any): any;
|
|
135
|
+
export { fn_15 as fn };
|
|
136
|
+
}
|
|
137
|
+
export declare namespace isCreditCard {
|
|
138
|
+
const message_16: string;
|
|
139
|
+
export { message_16 as message };
|
|
140
|
+
export function fn_16(x: any, arg: any): any;
|
|
141
|
+
export { fn_16 as fn };
|
|
142
|
+
}
|
|
143
|
+
export declare namespace isEmail {
|
|
144
|
+
const message_17: string;
|
|
145
|
+
export { message_17 as message };
|
|
146
|
+
export function fn_17(x: any, arg: any): any;
|
|
147
|
+
export { fn_17 as fn };
|
|
148
|
+
}
|
|
149
|
+
export declare namespace isHexColor {
|
|
150
|
+
const message_18: string;
|
|
151
|
+
export { message_18 as message };
|
|
152
|
+
export function fn_18(x: any, arg: any): any;
|
|
153
|
+
export { fn_18 as fn };
|
|
154
|
+
}
|
|
155
|
+
export declare namespace isIn {
|
|
156
|
+
export function message_19(x: any, arg: any): string;
|
|
157
|
+
export { message_19 as message };
|
|
158
|
+
export function fn_19(x: any, arg: any): any;
|
|
159
|
+
export { fn_19 as fn };
|
|
160
|
+
}
|
|
161
|
+
export declare namespace isIP {
|
|
162
|
+
const message_20: string;
|
|
163
|
+
export { message_20 as message };
|
|
164
|
+
export function fn_20(x: any, arg: any): any;
|
|
165
|
+
export { fn_20 as fn };
|
|
166
|
+
}
|
|
167
|
+
export declare namespace isNotEmptyString {
|
|
168
|
+
const validateEmptyString_11: boolean;
|
|
169
|
+
export { validateEmptyString_11 as validateEmptyString };
|
|
170
|
+
const message_21: string;
|
|
171
|
+
export { message_21 as message };
|
|
172
|
+
export function fn_21(x: any): boolean;
|
|
173
|
+
export { fn_21 as fn };
|
|
174
|
+
}
|
|
175
|
+
export declare namespace isNotIn {
|
|
176
|
+
export function message_22(x: any, arg: any): string;
|
|
177
|
+
export { message_22 as message };
|
|
178
|
+
export function fn_22(x: any, arg: any): boolean;
|
|
179
|
+
export { fn_22 as fn };
|
|
180
|
+
}
|
|
181
|
+
export declare namespace isURL {
|
|
182
|
+
const message_23: string;
|
|
183
|
+
export { message_23 as message };
|
|
184
|
+
export function fn_23(x: any, arg: any): any;
|
|
185
|
+
export { fn_23 as fn };
|
|
186
|
+
}
|
|
187
|
+
export declare namespace isUUID {
|
|
188
|
+
const message_24: string;
|
|
189
|
+
export { message_24 as message };
|
|
190
|
+
export function fn_24(x: any, arg: any): any;
|
|
191
|
+
export { fn_24 as fn };
|
|
192
|
+
}
|
|
193
|
+
export declare namespace minLength {
|
|
194
|
+
export function message_25(x: any, arg: any): string;
|
|
195
|
+
export { message_25 as message };
|
|
196
|
+
export function fn_25(x: any, arg: any): any;
|
|
197
|
+
export { fn_25 as fn };
|
|
198
|
+
}
|
|
199
|
+
export declare namespace maxLength {
|
|
200
|
+
export function message_26(x: any, arg: any): string;
|
|
201
|
+
export { message_26 as message };
|
|
202
|
+
export function fn_26(x: any, arg: any): any;
|
|
203
|
+
export { fn_26 as fn };
|
|
204
|
+
}
|
|
205
|
+
export declare namespace regex {
|
|
206
|
+
export function message_27(x: any, arg: any): string;
|
|
207
|
+
export { message_27 as message };
|
|
208
|
+
export function fn_27(x: any, arg: any): any;
|
|
209
|
+
export { fn_27 as fn };
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../lib/rules.js"],"names":[],"mappings":";;;;;IAYQ,6BAGH;;;;;;;IAQS,sCAKT;IACG,sCAEH;;;;;;;;IAKS,wCAKT;;IACG,sCAEH;;;;;;;;IAKS,wCAIT;;IACG,sCAGH;;;;;;;;;IAOS,wCAKT;;IACG,sCAGH;;;;;;;;IAKS,wCAIT;;IACG,sCAGH;;;;;;;;IAKS,wCAIT;;IACG,sCAGH;;;;;;;;IAKS,wCAKT;;IACG,sCAEH;;;;;;;;IAKS,wCAGT;;IACG,sCAEH;;;;;;;;IAKG,sCAEH;;;;;;;;IAKS,wCAKT;;IACG,uCAIH;;;;IAMQ,qDAAyE;;IAC9E,iDAGH;;;;IAGQ,qDAAsE;;IAC3E,iDAGH;;;;IAMQ,qDAAgC;;IACrC,iDAIH;;;;;IAGQ,qDAAgE;;IACrE,6CAAqD;;;;IAGhD,qDAA+D;;IACpE,6CAAsD;;;;;;IAItD,6CAA0D;;;;;;IAI1D,6CAAqD;;;;;;IAIrD,6CAAwD;;;;IAGnD,qDAAgF;;IACrF,6CAAkD;;;;;;IAIlD,6CAAkD;;;;;;;;IAKlD,uCAEH;;;;IAGQ,qDAA4E;;IACjF,iDAAmD;;;;;;IAInD,6CAA6E;;;;;;IAI7E,6CAA+C;;;;IAG1C,qDAGR;;IACG,6CAIH;;;;IAGQ,qDAGR;;IACG,6CAIH;;;;IAGQ,qDAAiF;;IACtF,6CAIH"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ObjectId } from "mongodb";
|
|
2
|
+
export function cast(obj: any): any;
|
|
3
|
+
export function deepCopy(obj: any): any;
|
|
4
|
+
export function deepFind(obj: any, path: any): any;
|
|
5
|
+
export function forEach(obj: any, iteratee: any, context: any): any;
|
|
6
|
+
export function forceArray(value: any): any;
|
|
7
|
+
export function id(str: string | ObjectId): ObjectId;
|
|
8
|
+
export function inArray(array: any, key: any, value: any): any;
|
|
9
|
+
export function isArray(value: any): boolean;
|
|
10
|
+
export function isArrayLike(collection: any): boolean;
|
|
11
|
+
export function isDefined(value: any): boolean;
|
|
12
|
+
export function isEmpty(obj: any): boolean;
|
|
13
|
+
export function isFunction(value: any): boolean;
|
|
14
|
+
export function isId(value: any): boolean;
|
|
15
|
+
export function isHex24(value: any): boolean;
|
|
16
|
+
export function isNumber(value: any): boolean;
|
|
17
|
+
export function isObject(value: any): boolean;
|
|
18
|
+
export function isObjectAndNotID(value: any): boolean;
|
|
19
|
+
export function isRegex(value: any): boolean;
|
|
20
|
+
export function isSchema(value: any): boolean;
|
|
21
|
+
export function isString(value: any): boolean;
|
|
22
|
+
export function isSubdocument(value: any): boolean;
|
|
23
|
+
export function isSubdocument2dsphere(value: any): any;
|
|
24
|
+
export function isUndefined(value: any): boolean;
|
|
25
|
+
export function omit(obj: any, fields: any): any;
|
|
26
|
+
export function parseData(obj: any, parseBracketToDotNotation: any, parseDotNotation: any): any;
|
|
27
|
+
export function parseDotNotation(obj: any): any;
|
|
28
|
+
export function parseBracketNotation(obj: any): any;
|
|
29
|
+
export function parseBracketToDotNotation(obj: any): {};
|
|
30
|
+
export function pick(obj: any, keys: any): {};
|
|
31
|
+
export function removeUndefined(variable: any): any;
|
|
32
|
+
export function runSeries(tasks: any, hookName: any, data: any): Promise<any>;
|
|
33
|
+
export function setDeepValue(obj: any, path: any, value: any, onlyUndefined: any, onlyUndefinedNull: any, ignoreEmptyArrays: any): any;
|
|
34
|
+
export function setTimeoutPromise(ms: any): Promise<any>;
|
|
35
|
+
export function toArray(variable: any): any[];
|
|
36
|
+
export function ucFirst(string: any): any;
|
|
37
|
+
export function wait(ms: any): Promise<any>;
|
|
38
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../lib/util.js"],"names":[],"mappings":";AAIQ,oCAwBL;AAES,wCAUT;AAES,mDAYT;AAEQ,oEAYR;AAEW,4CAEX;AAOG,qDAGH;AAEQ,+DAaR;AAEQ,6CAER;AAEY,sDAGZ;AAEU,+CAEV;AAEQ,2CAIR;AAEW,gDAEX;AAEK,0CAKL;AAEQ,6CAiBR;AAES,8CAET;AAES,8CAMT;AAEiB,sDAGjB;AAEQ,6CAER;AAES,8CAET;AAES,8CAET;AAEc,mDAmBd;AAEsB,uDAQtB;AAEY,iDAEZ;AAEK,iDAOL;AAEU,gGAWV;AAEiB,gDA+BjB;AAEqB,oDAmCrB;AAE0B,wDAsB1B;AAEK,8CAeL;AAEgB,oDAYhB;AAEU,8EAmDV;AAEa,uIAwCb;AAEkB,yDAElB;AAEQ,8CAIR;AAEQ,0CAGR;AAEK,4CAEL"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function setup(manager: any, options: any): void;
|
|
2
|
+
export function setupModel(model: any): void;
|
|
3
|
+
export function addImages(data: any, test: any): any;
|
|
4
|
+
export function getSignedUrl(path: any, expires: number, bucket: any): Promise<string>;
|
|
5
|
+
export function getSignedUrls(data: any): Promise<void>;
|
|
6
|
+
export function keepImagePlacement(data: any): Promise<void>;
|
|
7
|
+
export function removeImages(data: any, test: any): Promise<{}[]>;
|
|
8
|
+
export function _addImageObjectsToData(path: any, data: any, image: any): any;
|
|
9
|
+
export function _findValidImages(files: any): Promise<any[]>;
|
|
10
|
+
export function _findAndTransformImageFields(unprocessedFields: any, path: any): any[];
|
|
11
|
+
export function _findImagesInData(target: any, imageField: any, imageFieldChunkIndex: any, dataPath: any): any;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../plugins/images/index.js"],"names":[],"mappings":"AAMS,wDA4DN;AAEW,6CA+BX;AAEU,qDAsHV;AAEa,uFAyBb;AAEc,wDA2Bd;AAEmB,6DAwBnB;AAEa,kEA6Hb;AAEuB,8EAyBvB;AAEiB,6DA6DjB;AAE6B,uFAiE7B;AAEkB,+GA2ClB"}
|