@payloadcms/db-mongodb 3.0.0-canary.92e4997 → 3.0.0-canary.a78fca3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. package/README.md +1 -1
  2. package/dist/connect.d.ts +1 -1
  3. package/dist/connect.d.ts.map +1 -1
  4. package/dist/connect.js.map +1 -1
  5. package/dist/count.d.ts +1 -1
  6. package/dist/count.d.ts.map +1 -1
  7. package/dist/count.js +1 -1
  8. package/dist/count.js.map +1 -1
  9. package/dist/create.d.ts +1 -1
  10. package/dist/create.d.ts.map +1 -1
  11. package/dist/create.js.map +1 -1
  12. package/dist/createGlobal.d.ts +1 -1
  13. package/dist/createGlobal.d.ts.map +1 -1
  14. package/dist/createGlobal.js.map +1 -1
  15. package/dist/createGlobalVersion.d.ts +1 -1
  16. package/dist/createGlobalVersion.d.ts.map +1 -1
  17. package/dist/createGlobalVersion.js.map +1 -1
  18. package/dist/createMigration.d.ts +1 -1
  19. package/dist/createMigration.d.ts.map +1 -1
  20. package/dist/createMigration.js +13 -27
  21. package/dist/createMigration.js.map +1 -1
  22. package/dist/createVersion.d.ts +1 -1
  23. package/dist/createVersion.d.ts.map +1 -1
  24. package/dist/createVersion.js.map +1 -1
  25. package/dist/deleteMany.d.ts +1 -1
  26. package/dist/deleteMany.d.ts.map +1 -1
  27. package/dist/deleteMany.js.map +1 -1
  28. package/dist/deleteOne.d.ts +1 -1
  29. package/dist/deleteOne.d.ts.map +1 -1
  30. package/dist/deleteOne.js.map +1 -1
  31. package/dist/deleteVersions.d.ts +1 -1
  32. package/dist/deleteVersions.d.ts.map +1 -1
  33. package/dist/deleteVersions.js.map +1 -1
  34. package/dist/destroy.d.ts +1 -1
  35. package/dist/destroy.d.ts.map +1 -1
  36. package/dist/destroy.js.map +1 -1
  37. package/dist/find.d.ts +1 -1
  38. package/dist/find.d.ts.map +1 -1
  39. package/dist/find.js +1 -1
  40. package/dist/find.js.map +1 -1
  41. package/dist/findGlobal.d.ts +1 -1
  42. package/dist/findGlobal.d.ts.map +1 -1
  43. package/dist/findGlobal.js +1 -1
  44. package/dist/findGlobal.js.map +1 -1
  45. package/dist/findGlobalVersions.d.ts +1 -1
  46. package/dist/findGlobalVersions.d.ts.map +1 -1
  47. package/dist/findGlobalVersions.js +1 -2
  48. package/dist/findGlobalVersions.js.map +1 -1
  49. package/dist/findOne.d.ts +1 -1
  50. package/dist/findOne.d.ts.map +1 -1
  51. package/dist/findOne.js.map +1 -1
  52. package/dist/findVersions.d.ts +1 -1
  53. package/dist/findVersions.d.ts.map +1 -1
  54. package/dist/findVersions.js +1 -1
  55. package/dist/findVersions.js.map +1 -1
  56. package/dist/index.d.ts +1 -1
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/index.js.map +1 -1
  60. package/dist/init.d.ts +1 -1
  61. package/dist/init.d.ts.map +1 -1
  62. package/dist/init.js +1 -1
  63. package/dist/init.js.map +1 -1
  64. package/dist/migrateFresh.d.ts.map +1 -1
  65. package/dist/migrateFresh.js +1 -1
  66. package/dist/migrateFresh.js.map +1 -1
  67. package/dist/models/buildCollectionSchema.d.ts +1 -2
  68. package/dist/models/buildCollectionSchema.d.ts.map +1 -1
  69. package/dist/models/buildCollectionSchema.js.map +1 -1
  70. package/dist/models/buildGlobalModel.d.ts +1 -1
  71. package/dist/models/buildGlobalModel.d.ts.map +1 -1
  72. package/dist/models/buildGlobalModel.js.map +1 -1
  73. package/dist/models/buildSchema.d.ts +1 -2
  74. package/dist/models/buildSchema.d.ts.map +1 -1
  75. package/dist/models/buildSchema.js +1 -1
  76. package/dist/models/buildSchema.js.map +1 -1
  77. package/{predefinedMigrations → dist/predefinedMigrations}/versions-v1-v2.js +3 -1
  78. package/dist/predefinedMigrations/versions-v1-v2.js.map +1 -0
  79. package/dist/queries/buildAndOrConditions.d.ts +1 -2
  80. package/dist/queries/buildAndOrConditions.d.ts.map +1 -1
  81. package/dist/queries/buildAndOrConditions.js.map +1 -1
  82. package/dist/queries/buildQuery.d.ts +1 -2
  83. package/dist/queries/buildQuery.d.ts.map +1 -1
  84. package/dist/queries/buildQuery.js +1 -1
  85. package/dist/queries/buildQuery.js.map +1 -1
  86. package/dist/queries/buildSearchParams.d.ts +1 -2
  87. package/dist/queries/buildSearchParams.d.ts.map +1 -1
  88. package/dist/queries/buildSearchParams.js +9 -7
  89. package/dist/queries/buildSearchParams.js.map +1 -1
  90. package/dist/queries/buildSortParam.d.ts +1 -2
  91. package/dist/queries/buildSortParam.d.ts.map +1 -1
  92. package/dist/queries/buildSortParam.js.map +1 -1
  93. package/dist/queries/getLocalizedSortProperty.d.ts +1 -2
  94. package/dist/queries/getLocalizedSortProperty.d.ts.map +1 -1
  95. package/dist/queries/getLocalizedSortProperty.js +2 -2
  96. package/dist/queries/getLocalizedSortProperty.js.map +1 -1
  97. package/dist/queries/getLocalizedSortProperty.spec.js +1 -1
  98. package/dist/queries/getLocalizedSortProperty.spec.js.map +1 -1
  99. package/dist/queries/parseParams.d.ts +1 -3
  100. package/dist/queries/parseParams.d.ts.map +1 -1
  101. package/dist/queries/parseParams.js +2 -2
  102. package/dist/queries/parseParams.js.map +1 -1
  103. package/dist/queries/sanitizeQueryValue.d.ts +1 -1
  104. package/dist/queries/sanitizeQueryValue.d.ts.map +1 -1
  105. package/dist/queries/sanitizeQueryValue.js +1 -1
  106. package/dist/queries/sanitizeQueryValue.js.map +1 -1
  107. package/dist/queryDrafts.d.ts +1 -1
  108. package/dist/queryDrafts.d.ts.map +1 -1
  109. package/dist/queryDrafts.js +1 -1
  110. package/dist/queryDrafts.js.map +1 -1
  111. package/dist/transactions/beginTransaction.d.ts +1 -1
  112. package/dist/transactions/beginTransaction.d.ts.map +1 -1
  113. package/dist/transactions/beginTransaction.js +1 -1
  114. package/dist/transactions/beginTransaction.js.map +1 -1
  115. package/dist/transactions/commitTransaction.d.ts +1 -1
  116. package/dist/transactions/commitTransaction.d.ts.map +1 -1
  117. package/dist/transactions/commitTransaction.js.map +1 -1
  118. package/dist/transactions/rollbackTransaction.d.ts +1 -1
  119. package/dist/transactions/rollbackTransaction.d.ts.map +1 -1
  120. package/dist/transactions/rollbackTransaction.js.map +1 -1
  121. package/dist/types.d.ts +1 -3
  122. package/dist/types.d.ts.map +1 -1
  123. package/dist/types.js.map +1 -1
  124. package/dist/updateGlobal.d.ts +1 -1
  125. package/dist/updateGlobal.d.ts.map +1 -1
  126. package/dist/updateGlobal.js.map +1 -1
  127. package/dist/updateGlobalVersion.d.ts +1 -2
  128. package/dist/updateGlobalVersion.d.ts.map +1 -1
  129. package/dist/updateGlobalVersion.js.map +1 -1
  130. package/dist/updateOne.d.ts +1 -1
  131. package/dist/updateOne.d.ts.map +1 -1
  132. package/dist/updateOne.js.map +1 -1
  133. package/dist/updateVersion.d.ts +1 -1
  134. package/dist/updateVersion.d.ts.map +1 -1
  135. package/dist/updateVersion.js.map +1 -1
  136. package/dist/utilities/getDBName.d.ts +1 -1
  137. package/dist/utilities/getDBName.d.ts.map +1 -1
  138. package/dist/utilities/getDBName.js.map +1 -1
  139. package/dist/utilities/handleError.js +1 -1
  140. package/dist/utilities/handleError.js.map +1 -1
  141. package/package.json +7 -8
@@ -1 +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
+ {"version":3,"sources":["../src/updateGlobal.ts"],"sourcesContent":["import type { PayloadRequestWithData, UpdateGlobal } from 'payload'\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":"AAIA,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,4 @@
1
- import type { UpdateGlobalVersionArgs } from 'payload/database';
2
- import type { TypeWithID } from 'payload/types';
1
+ import type { TypeWithID, UpdateGlobalVersionArgs } from 'payload';
3
2
  import type { MongooseAdapter } from './index.js';
4
3
  export declare function updateGlobalVersion<T extends TypeWithID>(this: MongooseAdapter, { id, global, locale, req, versionData, where, }: UpdateGlobalVersionArgs<T>): Promise<any>;
5
4
  //# 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,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
+ {"version":3,"file":"updateGlobalVersion.d.ts","sourceRoot":"","sources":["../src/updateGlobalVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA0B,UAAU,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAE1F,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 +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"}
1
+ {"version":3,"sources":["../src/updateGlobalVersion.ts"],"sourcesContent":["import type { PayloadRequestWithData, TypeWithID, UpdateGlobalVersionArgs } from 'payload'\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":"AAIA,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"}
@@ -1,3 +1,3 @@
1
- import type { UpdateOne } from 'payload/database';
1
+ import type { UpdateOne } from 'payload';
2
2
  export declare const updateOne: UpdateOne;
3
3
  //# sourceMappingURL=updateOne.d.ts.map
@@ -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,SA+BvB,CAAA"}
1
+ {"version":3,"file":"updateOne.d.ts","sourceRoot":"","sources":["../src/updateOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA0B,SAAS,EAAE,MAAM,SAAS,CAAA;AAQhE,eAAO,MAAM,SAAS,EAAE,SA+BvB,CAAA"}
@@ -1 +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"}
1
+ {"version":3,"sources":["../src/updateOne.ts"],"sourcesContent":["import type { PayloadRequestWithData, UpdateOne } from 'payload'\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":"AAIA,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"}
@@ -1,3 +1,3 @@
1
- import type { UpdateVersion } from 'payload/database';
1
+ import type { UpdateVersion } from 'payload';
2
2
  export declare const updateVersion: UpdateVersion;
3
3
  //# sourceMappingURL=updateVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"updateVersion.d.ts","sourceRoot":"","sources":["../src/updateVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAOrD,eAAO,MAAM,aAAa,EAAE,aA8B3B,CAAA"}
1
+ {"version":3,"file":"updateVersion.d.ts","sourceRoot":"","sources":["../src/updateVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA0B,aAAa,EAAE,MAAM,SAAS,CAAA;AAMpE,eAAO,MAAM,aAAa,EAAE,aA8B3B,CAAA"}
@@ -1 +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"}
1
+ {"version":3,"sources":["../src/updateVersion.ts"],"sourcesContent":["import type { PayloadRequestWithData, UpdateVersion } from 'payload'\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":"AAIA,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"}
@@ -1,4 +1,4 @@
1
- import type { DBIdentifierName } from 'payload/database';
1
+ import type { DBIdentifierName } from 'payload';
2
2
  type Args = {
3
3
  config: {
4
4
  dbName?: DBIdentifierName;
@@ -1 +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"}
1
+ {"version":3,"file":"getDBName.d.ts","sourceRoot":"","sources":["../../src/utilities/getDBName.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C,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"}
@@ -1 +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
+ {"version":3,"sources":["../../src/utilities/getDBName.ts"],"sourcesContent":["import type { DBIdentifierName } from 'payload'\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,5 +1,5 @@
1
1
  import httpStatus from 'http-status';
2
- import { APIError, ValidationError } from 'payload/errors';
2
+ import { APIError, ValidationError } from 'payload';
3
3
  const handleError = (error, req)=>{
4
4
  // Handle uniqueness error from MongoDB
5
5
  if (error.code === 11000 && error.keyValue) {
@@ -1 +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
+ {"version":3,"sources":["../../src/utilities/handleError.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { APIError, ValidationError } from 'payload'\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,UAAS;AAEnD,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/db-mongodb",
3
- "version": "3.0.0-canary.92e4997",
3
+ "version": "3.0.0-canary.a78fca3",
4
4
  "description": "The officially supported MongoDB database adapter for Payload",
5
5
  "homepage": "https://payloadcms.com",
6
6
  "repository": {
@@ -28,26 +28,25 @@
28
28
  "dependencies": {
29
29
  "bson-objectid": "2.0.4",
30
30
  "deepmerge": "4.3.1",
31
- "get-port": "5.1.1",
32
31
  "http-status": "1.6.2",
33
32
  "mongoose": "6.12.3",
34
33
  "mongoose-paginate-v2": "1.7.22",
35
34
  "prompts": "2.4.2",
36
- "uuid": "9.0.0"
35
+ "uuid": "10.0.0"
37
36
  },
38
37
  "devDependencies": {
39
38
  "@types/mongoose-aggregate-paginate-v2": "1.0.9",
40
39
  "mongodb": "4.17.1",
41
40
  "mongodb-memory-server": "^9",
42
- "payload": "3.0.0-canary.92e4997",
43
- "@payloadcms/eslint-config": "1.1.1"
41
+ "@payloadcms/eslint-config": "1.1.1",
42
+ "payload": "3.0.0-canary.a78fca3"
44
43
  },
45
44
  "peerDependencies": {
46
- "payload": "3.0.0-canary.92e4997"
45
+ "payload": "3.0.0-canary.a78fca3"
47
46
  },
48
47
  "scripts": {
49
- "build": "pnpm build:swc && pnpm build:types",
50
- "build:swc": "swc ./src -d ./dist --config-file .swcrc-build",
48
+ "build": "pnpm build:types && pnpm build:swc",
49
+ "build:swc": "swc ./src -d ./dist --config-file .swcrc-build --strip-leading-paths",
51
50
  "build:types": "tsc --emitDeclarationOnly --outDir dist",
52
51
  "clean": "rimraf {dist,*.tsbuildinfo}"
53
52
  }