@payloadcms/db-mongodb 3.0.0-alpha.7 → 3.0.0-alpha.70
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 +0 -2
- package/dist/connect.d.ts.map +1 -1
- package/dist/connect.js +20 -25
- package/dist/connect.js.map +1 -0
- package/dist/count.d.ts +3 -0
- package/dist/count.d.ts.map +1 -0
- package/dist/count.js +33 -0
- package/dist/count.js.map +1 -0
- package/dist/create.js +6 -21
- package/dist/create.js.map +1 -0
- package/dist/createGlobal.js +6 -21
- package/dist/createGlobal.js.map +1 -0
- package/dist/createGlobalVersion.d.ts.map +1 -1
- package/dist/createGlobalVersion.js +4 -14
- package/dist/createGlobalVersion.js.map +1 -0
- package/dist/createMigration.d.ts.map +1 -1
- package/dist/createMigration.js +15 -25
- package/dist/createMigration.js.map +1 -0
- package/dist/createVersion.js +4 -14
- package/dist/createVersion.js.map +1 -0
- package/dist/deleteMany.js +4 -14
- package/dist/deleteMany.js.map +1 -0
- package/dist/deleteOne.js +6 -21
- package/dist/deleteOne.js.map +1 -0
- package/dist/deleteVersions.js +4 -14
- package/dist/deleteVersions.js.map +1 -0
- package/dist/destroy.js +5 -21
- package/dist/destroy.js.map +1 -0
- package/dist/find.d.ts.map +1 -1
- package/dist/find.js +10 -25
- package/dist/find.js.map +1 -0
- package/dist/findGlobal.js +8 -23
- package/dist/findGlobal.js.map +1 -0
- package/dist/findGlobalVersions.js +12 -27
- package/dist/findGlobalVersions.js.map +1 -0
- package/dist/findOne.js +6 -21
- package/dist/findOne.js.map +1 -0
- package/dist/findVersions.js +10 -25
- package/dist/findVersions.js.map +1 -0
- package/dist/index.d.ts +36 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +67 -80
- package/dist/index.js.map +1 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +34 -44
- package/dist/init.js.map +1 -0
- package/dist/migrateFresh.d.ts +1 -1
- package/dist/migrateFresh.d.ts.map +1 -1
- package/dist/migrateFresh.js +13 -26
- package/dist/migrateFresh.js.map +1 -0
- package/dist/models/buildCollectionSchema.d.ts +25 -0
- package/dist/models/buildCollectionSchema.d.ts.map +1 -1
- package/dist/models/buildCollectionSchema.js +8 -23
- package/dist/models/buildCollectionSchema.js.map +1 -0
- package/dist/models/buildGlobalModel.d.ts +1 -1
- package/dist/models/buildGlobalModel.d.ts.map +1 -1
- package/dist/models/buildGlobalModel.js +9 -24
- package/dist/models/buildGlobalModel.js.map +1 -0
- package/dist/models/buildSchema.d.ts +26 -2
- package/dist/models/buildSchema.d.ts.map +1 -1
- package/dist/models/buildSchema.js +23 -33
- package/dist/models/buildSchema.js.map +1 -0
- package/dist/queries/buildAndOrConditions.js +4 -14
- package/dist/queries/buildAndOrConditions.js.map +1 -0
- package/dist/queries/buildQuery.js +6 -16
- package/dist/queries/buildQuery.js.map +1 -0
- package/dist/queries/buildSearchParams.d.ts.map +1 -1
- package/dist/queries/buildSearchParams.js +23 -39
- package/dist/queries/buildSearchParams.js.map +1 -0
- package/dist/queries/buildSortParam.d.ts +25 -0
- package/dist/queries/buildSortParam.d.ts.map +1 -1
- package/dist/queries/buildSortParam.js +4 -14
- package/dist/queries/buildSortParam.js.map +1 -0
- package/dist/queries/getLocalizedSortProperty.js +8 -18
- package/dist/queries/getLocalizedSortProperty.js.map +1 -0
- package/dist/queries/getLocalizedSortProperty.spec.js +33 -32
- package/dist/queries/getLocalizedSortProperty.spec.js.map +1 -0
- package/dist/queries/mock.js +1 -2
- package/dist/queries/mock.js.map +1 -0
- package/dist/queries/operatorMap.js +2 -12
- package/dist/queries/operatorMap.js.map +1 -0
- package/dist/queries/parseParams.js +12 -27
- package/dist/queries/parseParams.js.map +1 -0
- package/dist/queries/sanitizeQueryValue.d.ts.map +1 -1
- package/dist/queries/sanitizeQueryValue.js +10 -25
- package/dist/queries/sanitizeQueryValue.js.map +1 -0
- package/dist/queryDrafts.d.ts.map +1 -1
- package/dist/queryDrafts.js +11 -26
- package/dist/queryDrafts.js.map +1 -0
- package/dist/testCredentials.js +4 -25
- package/dist/testCredentials.js.map +1 -0
- package/dist/transactions/beginTransaction.js +6 -16
- package/dist/transactions/beginTransaction.js.map +1 -0
- package/dist/transactions/commitTransaction.d.ts.map +1 -1
- package/dist/transactions/commitTransaction.js +7 -13
- package/dist/transactions/commitTransaction.js.map +1 -0
- package/dist/transactions/rollbackTransaction.js +2 -12
- package/dist/transactions/rollbackTransaction.js.map +1 -0
- package/dist/types.d.ts +26 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -5
- package/dist/types.js.map +1 -0
- package/dist/updateGlobal.js +6 -21
- package/dist/updateGlobal.js.map +1 -0
- package/dist/updateGlobalVersion.d.ts +1 -1
- package/dist/updateGlobalVersion.d.ts.map +1 -1
- package/dist/updateGlobalVersion.js +4 -14
- package/dist/updateGlobalVersion.js.map +1 -0
- package/dist/updateOne.d.ts.map +1 -1
- package/dist/updateOne.js +8 -23
- package/dist/updateOne.js.map +1 -0
- package/dist/updateVersion.js +4 -14
- package/dist/updateVersion.js.map +1 -0
- package/dist/utilities/getDBName.d.ts +19 -0
- package/dist/utilities/getDBName.d.ts.map +1 -0
- package/dist/utilities/getDBName.js +19 -0
- package/dist/utilities/getDBName.js.map +1 -0
- package/dist/utilities/handleError.js +6 -21
- package/dist/utilities/handleError.js.map +1 -0
- package/dist/utilities/sanitizeInternalFields.d.ts.map +1 -1
- package/dist/utilities/sanitizeInternalFields.js +2 -12
- package/dist/utilities/sanitizeInternalFields.js.map +1 -0
- package/dist/withSession.d.ts +26 -1
- package/dist/withSession.d.ts.map +1 -1
- package/dist/withSession.js +5 -12
- package/dist/withSession.js.map +1 -0
- package/package.json +25 -21
package/dist/updateGlobal.js
CHANGED
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "updateGlobal", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return updateGlobal;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _sanitizeInternalFields = /*#__PURE__*/ _interop_require_default(require("./utilities/sanitizeInternalFields"));
|
|
12
|
-
const _withSession = require("./withSession");
|
|
13
|
-
function _interop_require_default(obj) {
|
|
14
|
-
return obj && obj.__esModule ? obj : {
|
|
15
|
-
default: obj
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
const updateGlobal = async function updateGlobal({ data, req = {}, slug }) {
|
|
1
|
+
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js';
|
|
2
|
+
import { withSession } from './withSession.js';
|
|
3
|
+
export const updateGlobal = async function updateGlobal({ slug, data, req = {} }) {
|
|
19
4
|
const Model = this.globals;
|
|
20
5
|
const options = {
|
|
21
|
-
...
|
|
6
|
+
...withSession(this, req.transactionID),
|
|
22
7
|
lean: true,
|
|
23
8
|
new: true
|
|
24
9
|
};
|
|
@@ -29,8 +14,8 @@ const updateGlobal = async function updateGlobal({ data, req = {}, slug }) {
|
|
|
29
14
|
result = JSON.parse(JSON.stringify(result));
|
|
30
15
|
// custom id type reset
|
|
31
16
|
result.id = result._id;
|
|
32
|
-
result = (
|
|
17
|
+
result = sanitizeInternalFields(result);
|
|
33
18
|
return result;
|
|
34
19
|
};
|
|
35
20
|
|
|
36
|
-
//# sourceMappingURL=
|
|
21
|
+
//# sourceMappingURL=updateGlobal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/updateGlobal.ts"],"sourcesContent":["import type { UpdateGlobal } from 'payload/database'\nimport type { PayloadRequestWithData } from 'payload/types'\n\nimport type { MongooseAdapter } from './index.js'\n\nimport sanitizeInternalFields from './utilities/sanitizeInternalFields.js'\nimport { withSession } from './withSession.js'\n\nexport const updateGlobal: UpdateGlobal = async function updateGlobal(\n this: MongooseAdapter,\n { slug, data, req = {} as PayloadRequestWithData },\n) {\n const Model = this.globals\n const options = {\n ...withSession(this, req.transactionID),\n lean: true,\n new: true,\n }\n\n let result\n result = await Model.findOneAndUpdate({ globalType: slug }, data, options)\n\n result = JSON.parse(JSON.stringify(result))\n\n // custom id type reset\n result.id = result._id\n result = sanitizeInternalFields(result)\n\n return result\n}\n"],"names":["sanitizeInternalFields","withSession","updateGlobal","slug","data","req","Model","globals","options","transactionID","lean","new","result","findOneAndUpdate","globalType","JSON","parse","stringify","id","_id"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAKA,OAAOA,4BAA4B,wCAAuC;AAC1E,SAASC,WAAW,QAAQ,mBAAkB;AAE9C,OAAO,MAAMC,eAA6B,eAAeA,aAEvD,EAAEC,IAAI,EAAEC,IAAI,EAAEC,MAAM,CAAC,CAA2B,EAAE;IAElD,MAAMC,QAAQ,IAAI,CAACC,OAAO;IAC1B,MAAMC,UAAU;QACd,GAAGP,YAAY,IAAI,EAAEI,IAAII,aAAa,CAAC;QACvCC,MAAM;QACNC,KAAK;IACP;IAEA,IAAIC;IACJA,SAAS,MAAMN,MAAMO,gBAAgB,CAAC;QAAEC,YAAYX;IAAK,GAAGC,MAAMI;IAElEI,SAASG,KAAKC,KAAK,CAACD,KAAKE,SAAS,CAACL;IAEnC,uBAAuB;IACvBA,OAAOM,EAAE,GAAGN,OAAOO,GAAG;IACtBP,SAASZ,uBAAuBY;IAEhC,OAAOA;AACT,EAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UpdateGlobalVersionArgs } from 'payload/database';
|
|
2
2
|
import type { TypeWithID } from 'payload/types';
|
|
3
|
-
import type { MongooseAdapter } from '.';
|
|
3
|
+
import type { MongooseAdapter } from './index.js';
|
|
4
4
|
export declare function updateGlobalVersion<T extends TypeWithID>(this: MongooseAdapter, { id, global, locale, req, versionData, where, }: UpdateGlobalVersionArgs<T>): Promise<any>;
|
|
5
5
|
//# sourceMappingURL=updateGlobalVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateGlobalVersion.d.ts","sourceRoot":"","sources":["../src/updateGlobalVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"updateGlobalVersion.d.ts","sourceRoot":"","sources":["../src/updateGlobalVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,KAAK,EAA0B,UAAU,EAAE,MAAM,eAAe,CAAA;AAEvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAIjD,wBAAsB,mBAAmB,CAAC,CAAC,SAAS,UAAU,EAC5D,IAAI,EAAE,eAAe,EACrB,EACE,EAAE,EACF,MAAM,EACN,MAAM,EACN,GAAkC,EAClC,WAAW,EACX,KAAK,GACN,EAAE,uBAAuB,CAAC,CAAC,CAAC,gBA4B9B"}
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "updateGlobalVersion", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return updateGlobalVersion;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _withSession = require("./withSession");
|
|
12
|
-
async function updateGlobalVersion({ id, global, locale, req = {}, versionData, where }) {
|
|
1
|
+
import { withSession } from './withSession.js';
|
|
2
|
+
export async function updateGlobalVersion({ id, global, locale, req = {}, versionData, where }) {
|
|
13
3
|
const VersionModel = this.versions[global];
|
|
14
4
|
const whereToUse = where || {
|
|
15
5
|
id: {
|
|
@@ -17,7 +7,7 @@ async function updateGlobalVersion({ id, global, locale, req = {}, versionData,
|
|
|
17
7
|
}
|
|
18
8
|
};
|
|
19
9
|
const options = {
|
|
20
|
-
...
|
|
10
|
+
...withSession(this, req.transactionID),
|
|
21
11
|
lean: true,
|
|
22
12
|
new: true
|
|
23
13
|
};
|
|
@@ -37,4 +27,4 @@ async function updateGlobalVersion({ id, global, locale, req = {}, versionData,
|
|
|
37
27
|
return result;
|
|
38
28
|
}
|
|
39
29
|
|
|
40
|
-
//# sourceMappingURL=
|
|
30
|
+
//# sourceMappingURL=updateGlobalVersion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/updateGlobalVersion.ts"],"sourcesContent":["import type { UpdateGlobalVersionArgs } from 'payload/database'\nimport type { PayloadRequestWithData, TypeWithID } from 'payload/types'\n\nimport type { MongooseAdapter } from './index.js'\n\nimport { withSession } from './withSession.js'\n\nexport async function updateGlobalVersion<T extends TypeWithID>(\n this: MongooseAdapter,\n {\n id,\n global,\n locale,\n req = {} as PayloadRequestWithData,\n versionData,\n where,\n }: UpdateGlobalVersionArgs<T>,\n) {\n const VersionModel = this.versions[global]\n const whereToUse = where || { id: { equals: id } }\n const options = {\n ...withSession(this, req.transactionID),\n lean: true,\n new: true,\n }\n\n const query = await VersionModel.buildQuery({\n locale,\n payload: this.payload,\n where: whereToUse,\n })\n\n const doc = await VersionModel.findOneAndUpdate(query, versionData, options)\n\n const result = JSON.parse(JSON.stringify(doc))\n\n const verificationToken = doc._verificationToken\n\n // custom id type reset\n result.id = result._id\n if (verificationToken) {\n result._verificationToken = verificationToken\n }\n return result\n}\n"],"names":["withSession","updateGlobalVersion","id","global","locale","req","versionData","where","VersionModel","versions","whereToUse","equals","options","transactionID","lean","new","query","buildQuery","payload","doc","findOneAndUpdate","result","JSON","parse","stringify","verificationToken","_verificationToken","_id"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAKA,SAASA,WAAW,QAAQ,mBAAkB;AAE9C,OAAO,eAAeC,oBAEpB,EACEC,EAAE,EACFC,MAAM,EACNC,MAAM,EACNC,MAAM,CAAC,CAA2B,EAClCC,WAAW,EACXC,KAAK,EACsB;IAE7B,MAAMC,eAAe,IAAI,CAACC,QAAQ,CAACN,OAAO;IAC1C,MAAMO,aAAaH,SAAS;QAAEL,IAAI;YAAES,QAAQT;QAAG;IAAE;IACjD,MAAMU,UAAU;QACd,GAAGZ,YAAY,IAAI,EAAEK,IAAIQ,aAAa,CAAC;QACvCC,MAAM;QACNC,KAAK;IACP;IAEA,MAAMC,QAAQ,MAAMR,aAAaS,UAAU,CAAC;QAC1Cb;QACAc,SAAS,IAAI,CAACA,OAAO;QACrBX,OAAOG;IACT;IAEA,MAAMS,MAAM,MAAMX,aAAaY,gBAAgB,CAACJ,OAAOV,aAAaM;IAEpE,MAAMS,SAASC,KAAKC,KAAK,CAACD,KAAKE,SAAS,CAACL;IAEzC,MAAMM,oBAAoBN,IAAIO,kBAAkB;IAEhD,uBAAuB;IACvBL,OAAOnB,EAAE,GAAGmB,OAAOM,GAAG;IACtB,IAAIF,mBAAmB;QACrBJ,OAAOK,kBAAkB,GAAGD;IAC9B;IACA,OAAOJ;AACT"}
|
package/dist/updateOne.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateOne.d.ts","sourceRoot":"","sources":["../src/updateOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AASjD,eAAO,MAAM,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"updateOne.d.ts","sourceRoot":"","sources":["../src/updateOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AASjD,eAAO,MAAM,SAAS,EAAE,SA+BvB,CAAA"}
|
package/dist/updateOne.js
CHANGED
|
@@ -1,22 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
})
|
|
5
|
-
Object.defineProperty(exports, "updateOne", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return updateOne;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _handleError = /*#__PURE__*/ _interop_require_default(require("./utilities/handleError"));
|
|
12
|
-
const _sanitizeInternalFields = /*#__PURE__*/ _interop_require_default(require("./utilities/sanitizeInternalFields"));
|
|
13
|
-
const _withSession = require("./withSession");
|
|
14
|
-
function _interop_require_default(obj) {
|
|
15
|
-
return obj && obj.__esModule ? obj : {
|
|
16
|
-
default: obj
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
const updateOne = async function updateOne({ id, collection, data, locale, req = {}, where: whereArg }) {
|
|
1
|
+
import handleError from './utilities/handleError.js';
|
|
2
|
+
import sanitizeInternalFields from './utilities/sanitizeInternalFields.js';
|
|
3
|
+
import { withSession } from './withSession.js';
|
|
4
|
+
export const updateOne = async function updateOne({ id, collection, data, locale, req = {}, where: whereArg }) {
|
|
20
5
|
const where = id ? {
|
|
21
6
|
id: {
|
|
22
7
|
equals: id
|
|
@@ -24,7 +9,7 @@ const updateOne = async function updateOne({ id, collection, data, locale, req =
|
|
|
24
9
|
} : whereArg;
|
|
25
10
|
const Model = this.collections[collection];
|
|
26
11
|
const options = {
|
|
27
|
-
...
|
|
12
|
+
...withSession(this, req.transactionID),
|
|
28
13
|
lean: true,
|
|
29
14
|
new: true
|
|
30
15
|
};
|
|
@@ -37,12 +22,12 @@ const updateOne = async function updateOne({ id, collection, data, locale, req =
|
|
|
37
22
|
try {
|
|
38
23
|
result = await Model.findOneAndUpdate(query, data, options);
|
|
39
24
|
} catch (error) {
|
|
40
|
-
(
|
|
25
|
+
handleError(error, req);
|
|
41
26
|
}
|
|
42
27
|
result = JSON.parse(JSON.stringify(result));
|
|
43
28
|
result.id = result._id;
|
|
44
|
-
result = (
|
|
29
|
+
result = sanitizeInternalFields(result);
|
|
45
30
|
return result;
|
|
46
31
|
};
|
|
47
32
|
|
|
48
|
-
//# sourceMappingURL=
|
|
33
|
+
//# sourceMappingURL=updateOne.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/updateOne.ts"],"sourcesContent":["import type { UpdateOne } from 'payload/database'\nimport type { PayloadRequestWithData } from 'payload/types'\n\nimport type { MongooseAdapter } from './index.js'\n\nimport handleError from './utilities/handleError.js'\nimport sanitizeInternalFields from './utilities/sanitizeInternalFields.js'\nimport { withSession } from './withSession.js'\n\nexport const updateOne: UpdateOne = async function updateOne(\n this: MongooseAdapter,\n { id, collection, data, locale, req = {} as PayloadRequestWithData, where: whereArg },\n) {\n const where = id ? { id: { equals: id } } : whereArg\n const Model = this.collections[collection]\n const options = {\n ...withSession(this, req.transactionID),\n lean: true,\n new: true,\n }\n\n const query = await Model.buildQuery({\n locale,\n payload: this.payload,\n where,\n })\n\n let result\n\n try {\n result = await Model.findOneAndUpdate(query, data, options)\n } catch (error) {\n handleError(error, req)\n }\n\n result = JSON.parse(JSON.stringify(result))\n result.id = result._id\n result = sanitizeInternalFields(result)\n\n return result\n}\n"],"names":["handleError","sanitizeInternalFields","withSession","updateOne","id","collection","data","locale","req","where","whereArg","equals","Model","collections","options","transactionID","lean","new","query","buildQuery","payload","result","findOneAndUpdate","error","JSON","parse","stringify","_id"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAKA,OAAOA,iBAAiB,6BAA4B;AACpD,OAAOC,4BAA4B,wCAAuC;AAC1E,SAASC,WAAW,QAAQ,mBAAkB;AAE9C,OAAO,MAAMC,YAAuB,eAAeA,UAEjD,EAAEC,EAAE,EAAEC,UAAU,EAAEC,IAAI,EAAEC,MAAM,EAAEC,MAAM,CAAC,CAA2B,EAAEC,OAAOC,QAAQ,EAAE;IAErF,MAAMD,QAAQL,KAAK;QAAEA,IAAI;YAAEO,QAAQP;QAAG;IAAE,IAAIM;IAC5C,MAAME,QAAQ,IAAI,CAACC,WAAW,CAACR,WAAW;IAC1C,MAAMS,UAAU;QACd,GAAGZ,YAAY,IAAI,EAAEM,IAAIO,aAAa,CAAC;QACvCC,MAAM;QACNC,KAAK;IACP;IAEA,MAAMC,QAAQ,MAAMN,MAAMO,UAAU,CAAC;QACnCZ;QACAa,SAAS,IAAI,CAACA,OAAO;QACrBX;IACF;IAEA,IAAIY;IAEJ,IAAI;QACFA,SAAS,MAAMT,MAAMU,gBAAgB,CAACJ,OAAOZ,MAAMQ;IACrD,EAAE,OAAOS,OAAO;QACdvB,YAAYuB,OAAOf;IACrB;IAEAa,SAASG,KAAKC,KAAK,CAACD,KAAKE,SAAS,CAACL;IACnCA,OAAOjB,EAAE,GAAGiB,OAAOM,GAAG;IACtBN,SAASpB,uBAAuBoB;IAEhC,OAAOA;AACT,EAAC"}
|
package/dist/updateVersion.js
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "updateVersion", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return updateVersion;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _withSession = require("./withSession");
|
|
12
|
-
const updateVersion = async function updateVersion({ id, collection, locale, req = {}, versionData, where }) {
|
|
1
|
+
import { withSession } from './withSession.js';
|
|
2
|
+
export const updateVersion = async function updateVersion({ id, collection, locale, req = {}, versionData, where }) {
|
|
13
3
|
const VersionModel = this.versions[collection];
|
|
14
4
|
const whereToUse = where || {
|
|
15
5
|
id: {
|
|
@@ -17,7 +7,7 @@ const updateVersion = async function updateVersion({ id, collection, locale, req
|
|
|
17
7
|
}
|
|
18
8
|
};
|
|
19
9
|
const options = {
|
|
20
|
-
...
|
|
10
|
+
...withSession(this, req.transactionID),
|
|
21
11
|
lean: true,
|
|
22
12
|
new: true
|
|
23
13
|
};
|
|
@@ -37,4 +27,4 @@ const updateVersion = async function updateVersion({ id, collection, locale, req
|
|
|
37
27
|
return result;
|
|
38
28
|
};
|
|
39
29
|
|
|
40
|
-
//# sourceMappingURL=
|
|
30
|
+
//# sourceMappingURL=updateVersion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/updateVersion.ts"],"sourcesContent":["import type { UpdateVersion } from 'payload/database'\nimport type { PayloadRequestWithData } from 'payload/types'\n\nimport type { MongooseAdapter } from './index.js'\n\nimport { withSession } from './withSession.js'\n\nexport const updateVersion: UpdateVersion = async function updateVersion(\n this: MongooseAdapter,\n { id, collection, locale, req = {} as PayloadRequestWithData, versionData, where },\n) {\n const VersionModel = this.versions[collection]\n const whereToUse = where || { id: { equals: id } }\n const options = {\n ...withSession(this, req.transactionID),\n lean: true,\n new: true,\n }\n\n const query = await VersionModel.buildQuery({\n locale,\n payload: this.payload,\n where: whereToUse,\n })\n\n const doc = await VersionModel.findOneAndUpdate(query, versionData, options)\n\n const result = JSON.parse(JSON.stringify(doc))\n\n const verificationToken = doc._verificationToken\n\n // custom id type reset\n result.id = result._id\n if (verificationToken) {\n result._verificationToken = verificationToken\n }\n return result\n}\n"],"names":["withSession","updateVersion","id","collection","locale","req","versionData","where","VersionModel","versions","whereToUse","equals","options","transactionID","lean","new","query","buildQuery","payload","doc","findOneAndUpdate","result","JSON","parse","stringify","verificationToken","_verificationToken","_id"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAKA,SAASA,WAAW,QAAQ,mBAAkB;AAE9C,OAAO,MAAMC,gBAA+B,eAAeA,cAEzD,EAAEC,EAAE,EAAEC,UAAU,EAAEC,MAAM,EAAEC,MAAM,CAAC,CAA2B,EAAEC,WAAW,EAAEC,KAAK,EAAE;IAElF,MAAMC,eAAe,IAAI,CAACC,QAAQ,CAACN,WAAW;IAC9C,MAAMO,aAAaH,SAAS;QAAEL,IAAI;YAAES,QAAQT;QAAG;IAAE;IACjD,MAAMU,UAAU;QACd,GAAGZ,YAAY,IAAI,EAAEK,IAAIQ,aAAa,CAAC;QACvCC,MAAM;QACNC,KAAK;IACP;IAEA,MAAMC,QAAQ,MAAMR,aAAaS,UAAU,CAAC;QAC1Cb;QACAc,SAAS,IAAI,CAACA,OAAO;QACrBX,OAAOG;IACT;IAEA,MAAMS,MAAM,MAAMX,aAAaY,gBAAgB,CAACJ,OAAOV,aAAaM;IAEpE,MAAMS,SAASC,KAAKC,KAAK,CAACD,KAAKE,SAAS,CAACL;IAEzC,MAAMM,oBAAoBN,IAAIO,kBAAkB;IAEhD,uBAAuB;IACvBL,OAAOnB,EAAE,GAAGmB,OAAOM,GAAG;IACtB,IAAIF,mBAAmB;QACrBJ,OAAOK,kBAAkB,GAAGD;IAC9B;IACA,OAAOJ;AACT,EAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DBIdentifierName } from 'payload/database';
|
|
2
|
+
type Args = {
|
|
3
|
+
config: {
|
|
4
|
+
dbName?: DBIdentifierName;
|
|
5
|
+
enumName?: DBIdentifierName;
|
|
6
|
+
name?: string;
|
|
7
|
+
slug?: string;
|
|
8
|
+
};
|
|
9
|
+
locales?: boolean;
|
|
10
|
+
target?: 'dbName' | 'enumName';
|
|
11
|
+
versions?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Used to name database enums and collections
|
|
15
|
+
* Returns the collection or enum name for a given entity
|
|
16
|
+
*/
|
|
17
|
+
export declare const getDBName: ({ config: { name, slug }, config, target, versions, }: Args) => string;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=getDBName.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDBName.d.ts","sourceRoot":"","sources":["../../src/utilities/getDBName.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAExD,KAAK,IAAI,GAAG;IACV,MAAM,EAAE;QACN,MAAM,CAAC,EAAE,gBAAgB,CAAA;QACzB,QAAQ,CAAC,EAAE,gBAAgB,CAAA;QAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;IACD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,0DAKnB,IAAI,KAAG,MAiBT,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Used to name database enums and collections
|
|
3
|
+
* Returns the collection or enum name for a given entity
|
|
4
|
+
*/ export const getDBName = ({ config: { name, slug }, config, target = 'dbName', versions = false })=>{
|
|
5
|
+
let result;
|
|
6
|
+
let custom = config[target];
|
|
7
|
+
if (!custom && target === 'enumName') {
|
|
8
|
+
custom = config['dbName'];
|
|
9
|
+
}
|
|
10
|
+
if (custom) {
|
|
11
|
+
result = typeof custom === 'function' ? custom({}) : custom;
|
|
12
|
+
} else {
|
|
13
|
+
result = name ?? slug;
|
|
14
|
+
}
|
|
15
|
+
if (versions) result = `_${result}_versions`;
|
|
16
|
+
return result;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=getDBName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/getDBName.ts"],"sourcesContent":["import type { DBIdentifierName } from 'payload/database'\n\ntype Args = {\n config: {\n dbName?: DBIdentifierName\n enumName?: DBIdentifierName\n name?: string\n slug?: string\n }\n locales?: boolean\n target?: 'dbName' | 'enumName'\n versions?: boolean\n}\n\n/**\n * Used to name database enums and collections\n * Returns the collection or enum name for a given entity\n */\nexport const getDBName = ({\n config: { name, slug },\n config,\n target = 'dbName',\n versions = false,\n}: Args): string => {\n let result: string\n let custom = config[target]\n\n if (!custom && target === 'enumName') {\n custom = config['dbName']\n }\n\n if (custom) {\n result = typeof custom === 'function' ? custom({}) : custom\n } else {\n result = name ?? slug\n }\n\n if (versions) result = `_${result}_versions`\n\n return result\n}\n"],"names":["getDBName","config","name","slug","target","versions","result","custom"],"rangeMappings":";;;;;;;;;;;;;;;;","mappings":"AAcA;;;CAGC,GACD,OAAO,MAAMA,YAAY,CAAC,EACxBC,QAAQ,EAAEC,IAAI,EAAEC,IAAI,EAAE,EACtBF,MAAM,EACNG,SAAS,QAAQ,EACjBC,WAAW,KAAK,EACX;IACL,IAAIC;IACJ,IAAIC,SAASN,MAAM,CAACG,OAAO;IAE3B,IAAI,CAACG,UAAUH,WAAW,YAAY;QACpCG,SAASN,MAAM,CAAC,SAAS;IAC3B;IAEA,IAAIM,QAAQ;QACVD,SAAS,OAAOC,WAAW,aAAaA,OAAO,CAAC,KAAKA;IACvD,OAAO;QACLD,SAASJ,QAAQC;IACnB;IAEA,IAAIE,UAAUC,SAAS,CAAC,CAAC,EAAEA,OAAO,SAAS,CAAC;IAE5C,OAAOA;AACT,EAAC"}
|
|
@@ -1,35 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _httpstatus = /*#__PURE__*/ _interop_require_default(require("http-status"));
|
|
12
|
-
const _errors = require("payload/errors");
|
|
13
|
-
function _interop_require_default(obj) {
|
|
14
|
-
return obj && obj.__esModule ? obj : {
|
|
15
|
-
default: obj
|
|
16
|
-
};
|
|
17
|
-
}
|
|
1
|
+
import httpStatus from 'http-status';
|
|
2
|
+
import { APIError, ValidationError } from 'payload/errors';
|
|
18
3
|
const handleError = (error, req)=>{
|
|
19
4
|
// Handle uniqueness error from MongoDB
|
|
20
5
|
if (error.code === 11000 && error.keyValue) {
|
|
21
|
-
throw new
|
|
6
|
+
throw new ValidationError([
|
|
22
7
|
{
|
|
23
8
|
field: Object.keys(error.keyValue)[0],
|
|
24
9
|
message: req.t('error:valueMustBeUnique')
|
|
25
10
|
}
|
|
26
11
|
], req.t);
|
|
27
12
|
} else if (error.code === 11000) {
|
|
28
|
-
throw new
|
|
13
|
+
throw new APIError(req.t('error:valueMustBeUnique'), httpStatus.BAD_REQUEST);
|
|
29
14
|
} else {
|
|
30
15
|
throw error;
|
|
31
16
|
}
|
|
32
17
|
};
|
|
33
|
-
|
|
18
|
+
export default handleError;
|
|
34
19
|
|
|
35
|
-
//# sourceMappingURL=
|
|
20
|
+
//# sourceMappingURL=handleError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/handleError.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { APIError, ValidationError } from 'payload/errors'\n\nconst handleError = (error, req) => {\n // Handle uniqueness error from MongoDB\n if (error.code === 11000 && error.keyValue) {\n throw new ValidationError(\n [\n {\n field: Object.keys(error.keyValue)[0],\n message: req.t('error:valueMustBeUnique'),\n },\n ],\n req.t,\n )\n } else if (error.code === 11000) {\n throw new APIError(req.t('error:valueMustBeUnique'), httpStatus.BAD_REQUEST)\n } else {\n throw error\n }\n}\n\nexport default handleError\n"],"names":["httpStatus","APIError","ValidationError","handleError","error","req","code","keyValue","field","Object","keys","message","t","BAD_REQUEST"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,QAAQ,EAAEC,eAAe,QAAQ,iBAAgB;AAE1D,MAAMC,cAAc,CAACC,OAAOC;IAC1B,uCAAuC;IACvC,IAAID,MAAME,IAAI,KAAK,SAASF,MAAMG,QAAQ,EAAE;QAC1C,MAAM,IAAIL,gBACR;YACE;gBACEM,OAAOC,OAAOC,IAAI,CAACN,MAAMG,QAAQ,CAAC,CAAC,EAAE;gBACrCI,SAASN,IAAIO,CAAC,CAAC;YACjB;SACD,EACDP,IAAIO,CAAC;IAET,OAAO,IAAIR,MAAME,IAAI,KAAK,OAAO;QAC/B,MAAM,IAAIL,SAASI,IAAIO,CAAC,CAAC,4BAA4BZ,WAAWa,WAAW;IAC7E,OAAO;QACL,MAAMT;IACR;AACF;AAEA,eAAeD,YAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitizeInternalFields.d.ts","sourceRoot":"","sources":["../../src/utilities/sanitizeInternalFields.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"sanitizeInternalFields.d.ts","sourceRoot":"","sources":["../../src/utilities/sanitizeInternalFields.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,sBAAsB,mDAAoD,CAAC,KAAG,CAiBvE,CAAA;AAEb,eAAe,sBAAsB,CAAA"}
|
|
@@ -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=
|
|
21
|
+
//# sourceMappingURL=sanitizeInternalFields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/sanitizeInternalFields.ts"],"sourcesContent":["const internalFields = ['__v']\n\nconst sanitizeInternalFields = <T extends Record<string, unknown>>(incomingDoc: T): T =>\n Object.entries(incomingDoc).reduce((newDoc, [key, val]): T => {\n if (key === '_id') {\n return {\n ...newDoc,\n id: val,\n }\n }\n\n if (internalFields.indexOf(key) > -1) {\n return newDoc\n }\n\n return {\n ...newDoc,\n [key]: val,\n }\n }, {} as T)\n\nexport default sanitizeInternalFields\n"],"names":["internalFields","sanitizeInternalFields","incomingDoc","Object","entries","reduce","newDoc","key","val","id","indexOf"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAAA,MAAMA,iBAAiB;IAAC;CAAM;AAE9B,MAAMC,yBAAyB,CAAoCC,cACjEC,OAAOC,OAAO,CAACF,aAAaG,MAAM,CAAC,CAACC,QAAQ,CAACC,KAAKC,IAAI;QACpD,IAAID,QAAQ,OAAO;YACjB,OAAO;gBACL,GAAGD,MAAM;gBACTG,IAAID;YACN;QACF;QAEA,IAAIR,eAAeU,OAAO,CAACH,OAAO,CAAC,GAAG;YACpC,OAAOD;QACT;QAEA,OAAO;YACL,GAAGA,MAAM;YACT,CAACC,IAAI,EAAEC;QACT;IACF,GAAG,CAAC;AAEN,eAAeP,uBAAsB"}
|
package/dist/withSession.d.ts
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate.js" />
|
|
2
|
+
/// <reference types="mongoose/types/callback.js" />
|
|
3
|
+
/// <reference types="mongoose/types/collection.js" />
|
|
4
|
+
/// <reference types="mongoose/types/connection.js" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor.js" />
|
|
6
|
+
/// <reference types="mongoose/types/document.js" />
|
|
7
|
+
/// <reference types="mongoose/types/error.js" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions.js" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers.js" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares.js" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes.js" />
|
|
12
|
+
/// <reference types="mongoose/types/models.js" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions.js" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage.js" />
|
|
15
|
+
/// <reference types="mongoose/types/populate.js" />
|
|
16
|
+
/// <reference types="mongoose/types/query.js" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions.js" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes.js" />
|
|
19
|
+
/// <reference types="mongoose/types/session.js" />
|
|
20
|
+
/// <reference types="mongoose/types/types.js" />
|
|
21
|
+
/// <reference types="mongoose/types/utility.js" />
|
|
22
|
+
/// <reference types="mongoose/types/validation.js" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals.js" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype.js" />
|
|
25
|
+
/// <reference types="mongoose-paginate-v2" />
|
|
1
26
|
import type { ClientSession } from 'mongoose';
|
|
2
|
-
import type { MongooseAdapter } from './index';
|
|
27
|
+
import type { MongooseAdapter } from './index.js';
|
|
3
28
|
/**
|
|
4
29
|
* returns the session belonging to the transaction of the req.session if exists
|
|
5
30
|
* @returns ClientSession
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withSession.d.ts","sourceRoot":"","sources":["../src/withSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"withSession.d.ts","sourceRoot":"","sources":["../src/withSession.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD;;;GAGG;AACH,wBAAgB,WAAW,CACzB,EAAE,EAAE,eAAe,EACnB,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAC9B;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,GAAG,MAAM,CAErC"}
|
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=
|
|
10
|
+
//# sourceMappingURL=withSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/withSession.ts"],"sourcesContent":["import type { ClientSession } from 'mongoose'\n\nimport type { MongooseAdapter } from './index.js'\n\n/**\n * returns the session belonging to the transaction of the req.session if exists\n * @returns ClientSession\n */\nexport function withSession(\n db: MongooseAdapter,\n transactionID?: number | string,\n): { session: ClientSession } | object {\n return db.sessions[transactionID] ? { session: db.sessions[transactionID] } : {}\n}\n"],"names":["withSession","db","transactionID","sessions","session"],"rangeMappings":";;;;;;;","mappings":"AAIA;;;CAGC,GACD,OAAO,SAASA,YACdC,EAAmB,EACnBC,aAA+B;IAE/B,OAAOD,GAAGE,QAAQ,CAACD,cAAc,GAAG;QAAEE,SAASH,GAAGE,QAAQ,CAACD,cAAc;IAAC,IAAI,CAAC;AACjF"}
|
package/package.json
CHANGED
|
@@ -1,24 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/db-mongodb",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
4
|
-
"description": "The officially supported MongoDB database adapter for Payload
|
|
5
|
-
"repository": "https://github.com/payloadcms/payload",
|
|
6
|
-
"license": "MIT",
|
|
3
|
+
"version": "3.0.0-alpha.70",
|
|
4
|
+
"description": "The officially supported MongoDB database adapter for Payload",
|
|
7
5
|
"homepage": "https://payloadcms.com",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/payloadcms/payload.git",
|
|
9
|
+
"directory": "packages/db-mongodb"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": "Payload <dev@payloadcms.com> (https://payloadcms.com)",
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
|
+
"require": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts"
|
|
19
|
+
}
|
|
12
20
|
},
|
|
13
21
|
"main": "./dist/index.js",
|
|
14
22
|
"types": "./dist/index.d.ts",
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"mock.js",
|
|
26
|
+
"predefinedMigrations"
|
|
27
|
+
],
|
|
15
28
|
"dependencies": {
|
|
16
29
|
"bson-objectid": "2.0.4",
|
|
17
30
|
"deepmerge": "4.3.1",
|
|
18
31
|
"get-port": "5.1.1",
|
|
19
32
|
"http-status": "1.6.2",
|
|
20
33
|
"mongoose": "6.12.3",
|
|
21
|
-
"mongoose-aggregate-paginate-v2": "1.0.6",
|
|
22
34
|
"mongoose-paginate-v2": "1.7.22",
|
|
23
35
|
"prompts": "2.4.2",
|
|
24
36
|
"uuid": "9.0.0"
|
|
@@ -27,23 +39,15 @@
|
|
|
27
39
|
"@types/mongoose-aggregate-paginate-v2": "1.0.9",
|
|
28
40
|
"mongodb": "4.17.1",
|
|
29
41
|
"mongodb-memory-server": "^9",
|
|
30
|
-
"
|
|
31
|
-
"
|
|
42
|
+
"@payloadcms/eslint-config": "1.1.1",
|
|
43
|
+
"payload": "3.0.0-alpha.70"
|
|
32
44
|
},
|
|
33
45
|
"peerDependencies": {
|
|
34
|
-
"payload": "
|
|
35
|
-
},
|
|
36
|
-
"publishConfig": {
|
|
37
|
-
"registry": "https://registry.npmjs.org/"
|
|
46
|
+
"payload": "3.0.0-alpha.70"
|
|
38
47
|
},
|
|
39
|
-
"files": [
|
|
40
|
-
"dist",
|
|
41
|
-
"mock.js",
|
|
42
|
-
"predefinedMigrations"
|
|
43
|
-
],
|
|
44
48
|
"scripts": {
|
|
45
49
|
"build": "pnpm build:swc && pnpm build:types",
|
|
46
|
-
"build:swc": "swc ./src -d ./dist --config-file .swcrc",
|
|
50
|
+
"build:swc": "swc ./src -d ./dist --config-file .swcrc-build",
|
|
47
51
|
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
|
48
52
|
"clean": "rimraf {dist,*.tsbuildinfo}"
|
|
49
53
|
}
|