@payloadcms/db-mongodb 3.0.0-canary.a192632 → 3.0.0-canary.a5aaf21
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/connect.d.ts.map +1 -1
- package/dist/connect.js +7 -3
- package/dist/connect.js.map +1 -1
- package/dist/create.d.ts.map +1 -1
- package/dist/create.js +7 -1
- package/dist/create.js.map +1 -1
- package/dist/createGlobal.d.ts.map +1 -1
- package/dist/createGlobal.js +10 -5
- package/dist/createGlobal.js.map +1 -1
- package/dist/createGlobalVersion.d.ts +1 -1
- package/dist/createGlobalVersion.d.ts.map +1 -1
- package/dist/createGlobalVersion.js +13 -4
- package/dist/createGlobalVersion.js.map +1 -1
- package/dist/createVersion.d.ts +1 -1
- package/dist/createVersion.d.ts.map +1 -1
- package/dist/createVersion.js +14 -5
- package/dist/createVersion.js.map +1 -1
- package/dist/deleteOne.js +1 -1
- package/dist/deleteOne.js.map +1 -1
- package/dist/find.d.ts.map +1 -1
- package/dist/find.js +20 -3
- package/dist/find.js.map +1 -1
- package/dist/findGlobal.js +1 -1
- package/dist/findGlobal.js.map +1 -1
- package/dist/findGlobalVersions.d.ts.map +1 -1
- package/dist/findGlobalVersions.js +2 -2
- package/dist/findGlobalVersions.js.map +1 -1
- package/dist/findOne.d.ts.map +1 -1
- package/dist/findOne.js +19 -3
- package/dist/findOne.js.map +1 -1
- package/dist/findVersions.js +1 -1
- package/dist/findVersions.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +9 -6
- package/dist/init.js.map +1 -1
- package/dist/models/buildCollectionSchema.d.ts +1 -2
- package/dist/models/buildCollectionSchema.d.ts.map +1 -1
- package/dist/models/buildCollectionSchema.js +7 -4
- package/dist/models/buildCollectionSchema.js.map +1 -1
- package/dist/models/buildGlobalModel.js +2 -2
- package/dist/models/buildGlobalModel.js.map +1 -1
- package/dist/models/buildSchema.d.ts +1 -2
- package/dist/models/buildSchema.d.ts.map +1 -1
- package/dist/models/buildSchema.js +88 -11
- package/dist/models/buildSchema.js.map +1 -1
- package/dist/queries/buildQuery.d.ts +2 -2
- package/dist/queries/buildQuery.d.ts.map +1 -1
- package/dist/queries/buildQuery.js +1 -2
- package/dist/queries/buildQuery.js.map +1 -1
- package/dist/queries/buildSearchParams.d.ts.map +1 -1
- package/dist/queries/buildSearchParams.js +19 -11
- package/dist/queries/buildSearchParams.js.map +1 -1
- package/dist/queries/getLocalizedSortProperty.spec.js +1 -1
- package/dist/queries/getLocalizedSortProperty.spec.js.map +1 -1
- package/dist/queries/parseParams.d.ts.map +1 -1
- package/dist/queries/parseParams.js +3 -1
- package/dist/queries/parseParams.js.map +1 -1
- package/dist/queries/sanitizeQueryValue.d.ts.map +1 -1
- package/dist/queries/sanitizeQueryValue.js +83 -24
- package/dist/queries/sanitizeQueryValue.js.map +1 -1
- package/dist/queryDrafts.js +1 -1
- package/dist/queryDrafts.js.map +1 -1
- package/dist/transactions/beginTransaction.d.ts.map +1 -1
- package/dist/transactions/beginTransaction.js +2 -0
- package/dist/transactions/beginTransaction.js.map +1 -1
- package/dist/transactions/commitTransaction.d.ts.map +1 -1
- package/dist/transactions/commitTransaction.js +3 -1
- package/dist/transactions/commitTransaction.js.map +1 -1
- package/dist/types.d.ts +5 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/updateGlobal.d.ts.map +1 -1
- package/dist/updateGlobal.js +8 -2
- package/dist/updateGlobal.js.map +1 -1
- package/dist/updateGlobalVersion.d.ts +2 -2
- package/dist/updateGlobalVersion.d.ts.map +1 -1
- package/dist/updateGlobalVersion.js +10 -3
- package/dist/updateGlobalVersion.js.map +1 -1
- package/dist/updateOne.d.ts.map +1 -1
- package/dist/updateOne.js +8 -2
- package/dist/updateOne.js.map +1 -1
- package/dist/updateVersion.d.ts +1 -1
- package/dist/updateVersion.d.ts.map +1 -1
- package/dist/updateVersion.js +8 -1
- package/dist/updateVersion.js.map +1 -1
- package/dist/utilities/buildJoinAggregation.d.ts +15 -0
- package/dist/utilities/buildJoinAggregation.d.ts.map +1 -0
- package/dist/utilities/buildJoinAggregation.js +148 -0
- package/dist/utilities/buildJoinAggregation.js.map +1 -0
- package/dist/utilities/getDBName.d.ts.map +1 -1
- package/dist/utilities/getDBName.js +3 -1
- package/dist/utilities/getDBName.js.map +1 -1
- package/dist/utilities/sanitizeInternalFields.d.ts +1 -2
- package/dist/utilities/sanitizeInternalFields.d.ts.map +1 -1
- package/dist/utilities/sanitizeInternalFields.js +1 -2
- package/dist/utilities/sanitizeInternalFields.js.map +1 -1
- package/dist/utilities/sanitizeRelationshipIDs.d.ts +9 -0
- package/dist/utilities/sanitizeRelationshipIDs.d.ts.map +1 -0
- package/dist/utilities/sanitizeRelationshipIDs.js +111 -0
- package/dist/utilities/sanitizeRelationshipIDs.js.map +1 -0
- package/dist/withSession.d.ts +1 -1
- package/dist/withSession.d.ts.map +1 -1
- package/dist/withSession.js +5 -3
- package/dist/withSession.js.map +1 -1
- package/package.json +9 -6
package/dist/withSession.d.ts
CHANGED
@@ -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;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,EAAE,EAAE,eAAe,EACnB,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,GAAG,MAAM,CAAC,
|
1
|
+
{"version":3,"file":"withSession.d.ts","sourceRoot":"","sources":["../src/withSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,EAAE,EAAE,eAAe,EACnB,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAU7D"}
|
package/dist/withSession.js
CHANGED
@@ -6,9 +6,11 @@
|
|
6
6
|
if (transactionID instanceof Promise) {
|
7
7
|
transactionID = await req.transactionID;
|
8
8
|
}
|
9
|
-
if (req)
|
10
|
-
|
11
|
-
|
9
|
+
if (req) {
|
10
|
+
return db.sessions[transactionID] ? {
|
11
|
+
session: db.sessions[transactionID]
|
12
|
+
} : {};
|
13
|
+
}
|
12
14
|
}
|
13
15
|
|
14
16
|
//# sourceMappingURL=withSession.js.map
|
package/dist/withSession.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/withSession.ts"],"sourcesContent":["import type { ClientSession } from 'mongoose'\nimport type { PayloadRequest } from 'payload'\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 async function withSession(\n db: MongooseAdapter,\n req: PayloadRequest,\n): Promise<{ session: ClientSession } |
|
1
|
+
{"version":3,"sources":["../src/withSession.ts"],"sourcesContent":["import type { ClientSession } from 'mongoose'\nimport type { PayloadRequest } from 'payload'\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 async function withSession(\n db: MongooseAdapter,\n req: PayloadRequest,\n): Promise<{ session: ClientSession } | Record<string, never>> {\n let transactionID = req.transactionID\n\n if (transactionID instanceof Promise) {\n transactionID = await req.transactionID\n }\n\n if (req) {\n return db.sessions[transactionID] ? { session: db.sessions[transactionID] } : {}\n }\n}\n"],"names":["withSession","db","req","transactionID","Promise","sessions","session"],"mappings":"AAKA;;;CAGC,GACD,OAAO,eAAeA,YACpBC,EAAmB,EACnBC,GAAmB;IAEnB,IAAIC,gBAAgBD,IAAIC,aAAa;IAErC,IAAIA,yBAAyBC,SAAS;QACpCD,gBAAgB,MAAMD,IAAIC,aAAa;IACzC;IAEA,IAAID,KAAK;QACP,OAAOD,GAAGI,QAAQ,CAACF,cAAc,GAAG;YAAEG,SAASL,GAAGI,QAAQ,CAACF,cAAc;QAAC,IAAI,CAAC;IACjF;AACF"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@payloadcms/db-mongodb",
|
3
|
-
"version": "3.0.0-canary.
|
3
|
+
"version": "3.0.0-canary.a5aaf21",
|
4
4
|
"description": "The officially supported MongoDB database adapter for Payload",
|
5
5
|
"homepage": "https://payloadcms.com",
|
6
6
|
"repository": {
|
@@ -29,24 +29,27 @@
|
|
29
29
|
"bson-objectid": "2.0.4",
|
30
30
|
"http-status": "1.6.2",
|
31
31
|
"mongoose": "6.12.3",
|
32
|
+
"mongoose-aggregate-paginate-v2": "1.0.6",
|
32
33
|
"mongoose-paginate-v2": "1.7.22",
|
33
34
|
"prompts": "2.4.2",
|
34
35
|
"uuid": "10.0.0"
|
35
36
|
},
|
36
37
|
"devDependencies": {
|
37
|
-
"@types/mongoose-aggregate-paginate-v2": "1.0.
|
38
|
+
"@types/mongoose-aggregate-paginate-v2": "1.0.6",
|
38
39
|
"mongodb": "4.17.1",
|
39
40
|
"mongodb-memory-server": "^9",
|
40
|
-
"@payloadcms/eslint-config": "3.0.0-beta.
|
41
|
-
"payload": "3.0.0-canary.
|
41
|
+
"@payloadcms/eslint-config": "3.0.0-beta.97",
|
42
|
+
"payload": "3.0.0-canary.a5aaf21"
|
42
43
|
},
|
43
44
|
"peerDependencies": {
|
44
|
-
"payload": "3.0.0-canary.
|
45
|
+
"payload": "3.0.0-canary.a5aaf21"
|
45
46
|
},
|
46
47
|
"scripts": {
|
47
48
|
"build": "pnpm build:types && pnpm build:swc",
|
48
49
|
"build:swc": "swc ./src -d ./dist --config-file .swcrc-build --strip-leading-paths",
|
49
50
|
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
50
|
-
"clean": "rimraf {dist,*.tsbuildinfo}"
|
51
|
+
"clean": "rimraf {dist,*.tsbuildinfo}",
|
52
|
+
"lint": "eslint .",
|
53
|
+
"lint:fix": "eslint . --fix"
|
51
54
|
}
|
52
55
|
}
|