@payloadcms/db-mongodb 3.0.0-alpha.17 → 3.0.0-alpha.19
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/connect.js +5 -20
- package/dist/create.js +6 -21
- package/dist/createGlobal.js +6 -21
- package/dist/createGlobalVersion.js +4 -14
- package/dist/createMigration.js +9 -24
- package/dist/createVersion.js +4 -14
- package/dist/deleteMany.js +4 -14
- package/dist/deleteOne.js +6 -21
- package/dist/deleteVersions.js +4 -14
- package/dist/destroy.js +7 -22
- package/dist/find.js +10 -25
- package/dist/findGlobal.js +8 -23
- package/dist/findGlobalVersions.js +12 -27
- package/dist/findOne.js +6 -21
- package/dist/findVersions.js +10 -25
- package/dist/index.js +64 -79
- package/dist/init.js +24 -39
- package/dist/migrateFresh.js +11 -24
- package/dist/models/buildCollectionSchema.js +8 -23
- package/dist/models/buildGlobalModel.js +9 -24
- package/dist/models/buildSchema.js +22 -37
- package/dist/queries/buildAndOrConditions.js +4 -14
- package/dist/queries/buildQuery.js +6 -16
- package/dist/queries/buildSearchParams.js +20 -32
- package/dist/queries/buildSortParam.js +4 -14
- package/dist/queries/getLocalizedSortProperty.js +8 -18
- package/dist/queries/getLocalizedSortProperty.spec.js +19 -23
- package/dist/queries/mock.js +0 -1
- package/dist/queries/operatorMap.js +2 -12
- package/dist/queries/parseParams.js +12 -27
- package/dist/queries/sanitizeQueryValue.js +8 -23
- package/dist/queryDrafts.js +11 -26
- package/dist/testCredentials.js +4 -25
- package/dist/transactions/beginTransaction.js +6 -16
- package/dist/transactions/commitTransaction.js +2 -12
- package/dist/transactions/rollbackTransaction.js +2 -12
- package/dist/types.js +2 -5
- package/dist/updateGlobal.js +6 -21
- package/dist/updateGlobalVersion.js +4 -14
- package/dist/updateOne.js +8 -23
- package/dist/updateVersion.js +4 -14
- package/dist/utilities/handleError.js +6 -21
- package/dist/utilities/sanitizeInternalFields.js +2 -12
- package/dist/withSession.js +5 -12
- package/package.json +3 -3
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
1
|
const internalFields = [
|
|
12
2
|
'__v'
|
|
13
3
|
];
|
|
@@ -26,6 +16,6 @@ const sanitizeInternalFields = (incomingDoc)=>Object.entries(incomingDoc).reduce
|
|
|
26
16
|
[key]: val
|
|
27
17
|
};
|
|
28
18
|
}, {});
|
|
29
|
-
|
|
19
|
+
export default sanitizeInternalFields;
|
|
30
20
|
|
|
31
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvc2FuaXRpemVJbnRlcm5hbEZpZWxkcy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJjb25zdCBpbnRlcm5hbEZpZWxkcyA9IFsnX192J11cblxuY29uc3Qgc2FuaXRpemVJbnRlcm5hbEZpZWxkcyA9IDxUIGV4dGVuZHMgUmVjb3JkPHN0cmluZywgdW5rbm93bj4+KGluY29taW5nRG9jOiBUKTogVCA9PlxuICBPYmplY3QuZW50cmllcyhpbmNvbWluZ0RvYykucmVkdWNlKChuZXdEb2MsIFtrZXksIHZhbF0pOiBUID0+
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvc2FuaXRpemVJbnRlcm5hbEZpZWxkcy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJjb25zdCBpbnRlcm5hbEZpZWxkcyA9IFsnX192J11cblxuY29uc3Qgc2FuaXRpemVJbnRlcm5hbEZpZWxkcyA9IDxUIGV4dGVuZHMgUmVjb3JkPH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CxDQUFDQyxJQUFJLEVBQUVDO1FBQ1Q7SUFDRixHQUFHLENBQUM7QUFFTixlQUFlUCx1QkFBc0IifQ==
|
package/dist/withSession.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "withSession", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return withSession;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
function withSession(db, transactionID) {
|
|
1
|
+
/**
|
|
2
|
+
* returns the session belonging to the transaction of the req.session if exists
|
|
3
|
+
* @returns ClientSession
|
|
4
|
+
*/ export function withSession(db, transactionID) {
|
|
12
5
|
return db.sessions[transactionID] ? {
|
|
13
6
|
session: db.sessions[transactionID]
|
|
14
7
|
} : {};
|
|
15
8
|
}
|
|
16
9
|
|
|
17
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy93aXRoU2Vzc2lvbi50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IENsaWVudFNlc3Npb24gfSBmcm9tICdtb25nb29zZSdcblxuaW1wb3J0IHR5cGUgeyBNb25nb29zZUFkYXB0ZXIgfSBmcm9tICcuL2luZGV4J1xuXG4vKipcbiAqIHJldHVybnMgdGhlIHNlc3Npb24gYmVsb25naW5nIHRvIHRoZSB0cmFuc2FjdGlvbiBvZiB0aGUgcmVxLnNlc3Npb24gaWYgZXhpc3RzXG4gKiBAcmV0dXJucyBDbGllbnRTZXNzaW9uXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiB3aXRoU2Vzc2lvbihcbiAgZGI6IE1vbmdvb3NlQWRhcHRlcixcbiAgdHJhbnNhY3Rpb25JRD86IG51bWJlciB8IHN0cmluZyxcbik6IHsgc2Vzc2lvbjogQ2xpZW50U2Vzc2lvbiB9IHwgb2JqZWN0IHtcbiAgcmV0dXJuIGRiLnNlc3Npb25zW3RyYW5zYWN0aW9uSURdID8geyBzZXNzaW9uOiBkYi5zZXNzaW9uc1t0cmFuc2FjdGlvbklEXSB9IDoge31cbn1cbiJdLCJuYW1lcyI6WyJ3aXRoU2Vzc2lvbiIsImRiIiwidHJhbnNhY3Rpb25JRCIsInNlc3Npb25zIiwic2Vzc2lvbiJdLCJtYXBwaW5ncyI6IkFBSUE7OztDQUdDLEdBQ0QsT0FBTyxTQUFTQSxZQUNkQyxFQUFtQixFQUNuQkMsYUFBK0I7SUFFL0IsT0FBT0QsR0FBR0UsUUFBUSxDQUFDRCxjQUFjLEdBQUc7UUFBRUUsU0FBU0gsR0FBR0UsUUFBUSxDQUFDRCxjQUFjO0lBQUMsSUFBSSxDQUFDO0FBQ2pGIn0=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/db-mongodb",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.19",
|
|
4
4
|
"description": "The officially supported MongoDB database adapter for Payload - Update 2",
|
|
5
5
|
"repository": "https://github.com/payloadcms/payload",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"mongodb": "4.17.1",
|
|
29
29
|
"mongodb-memory-server": "^9",
|
|
30
30
|
"@payloadcms/eslint-config": "1.1.1",
|
|
31
|
-
"payload": "3.0.0-alpha.
|
|
31
|
+
"payload": "3.0.0-alpha.19"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"payload": "3.0.0-alpha.
|
|
34
|
+
"payload": "3.0.0-alpha.19"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"registry": "https://registry.npmjs.org/"
|