payload 3.65.0-internal.ef3958a → 3.65.0

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.
Files changed (94) hide show
  1. package/dist/auth/getAccessResults.d.ts.map +1 -1
  2. package/dist/auth/getAccessResults.js +12 -10
  3. package/dist/auth/getAccessResults.js.map +1 -1
  4. package/dist/auth/operations/resetPassword.d.ts.map +1 -1
  5. package/dist/auth/operations/resetPassword.js +29 -0
  6. package/dist/auth/operations/resetPassword.js.map +1 -1
  7. package/dist/auth/types.d.ts +12 -10
  8. package/dist/auth/types.d.ts.map +1 -1
  9. package/dist/auth/types.js.map +1 -1
  10. package/dist/collections/config/types.d.ts +3 -3
  11. package/dist/collections/config/types.d.ts.map +1 -1
  12. package/dist/collections/config/types.js.map +1 -1
  13. package/dist/collections/operations/countVersions.d.ts.map +1 -1
  14. package/dist/collections/operations/countVersions.js +2 -1
  15. package/dist/collections/operations/countVersions.js.map +1 -1
  16. package/dist/collections/operations/docAccess.d.ts +9 -2
  17. package/dist/collections/operations/docAccess.d.ts.map +1 -1
  18. package/dist/collections/operations/docAccess.js +8 -6
  19. package/dist/collections/operations/docAccess.js.map +1 -1
  20. package/dist/collections/operations/restoreVersion.d.ts.map +1 -1
  21. package/dist/collections/operations/restoreVersion.js +9 -7
  22. package/dist/collections/operations/restoreVersion.js.map +1 -1
  23. package/dist/config/client.d.ts.map +1 -1
  24. package/dist/config/client.js +1 -0
  25. package/dist/config/client.js.map +1 -1
  26. package/dist/config/types.d.ts +2 -2
  27. package/dist/config/types.d.ts.map +1 -1
  28. package/dist/config/types.js.map +1 -1
  29. package/dist/database/getLocalizedPaths.d.ts.map +1 -1
  30. package/dist/database/getLocalizedPaths.js +6 -5
  31. package/dist/database/getLocalizedPaths.js.map +1 -1
  32. package/dist/database/queryValidation/types.d.ts.map +1 -1
  33. package/dist/database/queryValidation/types.js.map +1 -1
  34. package/dist/database/queryValidation/validateQueryPaths.d.ts.map +1 -1
  35. package/dist/database/queryValidation/validateQueryPaths.js.map +1 -1
  36. package/dist/database/queryValidation/validateSearchParams.d.ts.map +1 -1
  37. package/dist/database/queryValidation/validateSearchParams.js +10 -8
  38. package/dist/database/queryValidation/validateSearchParams.js.map +1 -1
  39. package/dist/exports/internal.d.ts +6 -0
  40. package/dist/exports/internal.d.ts.map +1 -0
  41. package/dist/exports/internal.js +6 -0
  42. package/dist/exports/internal.js.map +1 -0
  43. package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -1
  44. package/dist/fields/hooks/afterRead/promise.js +165 -79
  45. package/dist/fields/hooks/afterRead/promise.js.map +1 -1
  46. package/dist/globals/config/types.d.ts +3 -3
  47. package/dist/globals/config/types.d.ts.map +1 -1
  48. package/dist/globals/config/types.js.map +1 -1
  49. package/dist/globals/operations/docAccess.d.ts +5 -1
  50. package/dist/globals/operations/docAccess.d.ts.map +1 -1
  51. package/dist/globals/operations/docAccess.js +8 -11
  52. package/dist/globals/operations/docAccess.js.map +1 -1
  53. package/dist/index.bundled.d.ts +45 -19
  54. package/dist/index.d.ts +8 -0
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js.map +1 -1
  57. package/dist/types/index.d.ts +2 -0
  58. package/dist/types/index.d.ts.map +1 -1
  59. package/dist/types/index.js.map +1 -1
  60. package/dist/uploads/checkFileRestrictions.d.ts.map +1 -1
  61. package/dist/uploads/checkFileRestrictions.js +2 -1
  62. package/dist/uploads/checkFileRestrictions.js.map +1 -1
  63. package/dist/utilities/createPayloadRequest.d.ts +2 -1
  64. package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
  65. package/dist/utilities/createPayloadRequest.js +3 -2
  66. package/dist/utilities/createPayloadRequest.js.map +1 -1
  67. package/dist/utilities/getEntityPermissions/entityDocExists.d.ts +14 -0
  68. package/dist/utilities/getEntityPermissions/entityDocExists.d.ts.map +1 -0
  69. package/dist/utilities/getEntityPermissions/entityDocExists.js +45 -0
  70. package/dist/utilities/getEntityPermissions/entityDocExists.js.map +1 -0
  71. package/dist/utilities/getEntityPermissions/getEntityPermissions.d.ts +52 -0
  72. package/dist/utilities/getEntityPermissions/getEntityPermissions.d.ts.map +1 -0
  73. package/dist/utilities/getEntityPermissions/getEntityPermissions.js +193 -0
  74. package/dist/utilities/getEntityPermissions/getEntityPermissions.js.map +1 -0
  75. package/dist/utilities/getEntityPermissions/populateFieldPermissions.d.ts +24 -0
  76. package/dist/utilities/getEntityPermissions/populateFieldPermissions.d.ts.map +1 -0
  77. package/dist/utilities/getEntityPermissions/populateFieldPermissions.js +236 -0
  78. package/dist/utilities/getEntityPermissions/populateFieldPermissions.js.map +1 -0
  79. package/dist/utilities/handleEndpoints.d.ts +2 -1
  80. package/dist/utilities/handleEndpoints.d.ts.map +1 -1
  81. package/dist/utilities/handleEndpoints.js +3 -1
  82. package/dist/utilities/handleEndpoints.js.map +1 -1
  83. package/dist/utilities/sanitizePermissions.d.ts +2 -0
  84. package/dist/utilities/sanitizePermissions.d.ts.map +1 -1
  85. package/dist/utilities/sanitizePermissions.js +4 -0
  86. package/dist/utilities/sanitizePermissions.js.map +1 -1
  87. package/dist/versions/types.d.ts +1 -0
  88. package/dist/versions/types.d.ts.map +1 -1
  89. package/dist/versions/types.js.map +1 -1
  90. package/package.json +7 -2
  91. package/dist/utilities/getEntityPolicies.d.ts +0 -21
  92. package/dist/utilities/getEntityPolicies.d.ts.map +0 -1
  93. package/dist/utilities/getEntityPolicies.js +0 -306
  94. package/dist/utilities/getEntityPolicies.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"getAccessResults.d.ts","sourceRoot":"","sources":["../../src/auth/getAccessResults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,KAAK,EAAe,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAKnE,KAAK,oBAAoB,GAAG;IAC1B,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AACD,wBAAsB,gBAAgB,CAAC,EACrC,GAAG,GACJ,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAmEtD"}
1
+ {"version":3,"file":"getAccessResults.d.ts","sourceRoot":"","sources":["../../src/auth/getAccessResults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,KAAK,EAAe,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAKnE,KAAK,oBAAoB,GAAG;IAC1B,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AACD,wBAAsB,gBAAgB,CAAC,EACrC,GAAG,GACJ,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAqEtD"}
@@ -1,4 +1,4 @@
1
- import { getEntityPolicies } from '../utilities/getEntityPolicies.js';
1
+ import { getEntityPermissions } from '../utilities/getEntityPermissions/getEntityPermissions.js';
2
2
  import { sanitizePermissions } from '../utilities/sanitizePermissions.js';
3
3
  export async function getAccessResults({ req }) {
4
4
  const results = {
@@ -15,7 +15,7 @@ export async function getAccessResults({ req }) {
15
15
  } else {
16
16
  results.canAccessAdmin = false;
17
17
  }
18
- const blockPolicies = {};
18
+ const blockReferencesPermissions = {};
19
19
  await Promise.all(payload.config.collections.map(async (collection)=>{
20
20
  const collectionOperations = [
21
21
  'create',
@@ -29,14 +29,15 @@ export async function getAccessResults({ req }) {
29
29
  if (collection.versions) {
30
30
  collectionOperations.push('readVersions');
31
31
  }
32
- const collectionPolicy = await getEntityPolicies({
33
- type: 'collection',
34
- blockPolicies,
32
+ const collectionPermissions = await getEntityPermissions({
33
+ blockReferencesPermissions,
35
34
  entity: collection,
35
+ entityType: 'collection',
36
+ fetchData: false,
36
37
  operations: collectionOperations,
37
38
  req
38
39
  });
39
- results.collections[collection.slug] = collectionPolicy;
40
+ results.collections[collection.slug] = collectionPermissions;
40
41
  }));
41
42
  await Promise.all(payload.config.globals.map(async (global)=>{
42
43
  const globalOperations = [
@@ -46,14 +47,15 @@ export async function getAccessResults({ req }) {
46
47
  if (global.versions) {
47
48
  globalOperations.push('readVersions');
48
49
  }
49
- const globalPolicy = await getEntityPolicies({
50
- type: 'global',
51
- blockPolicies,
50
+ const globalPermissions = await getEntityPermissions({
51
+ blockReferencesPermissions,
52
52
  entity: global,
53
+ entityType: 'global',
54
+ fetchData: false,
53
55
  operations: globalOperations,
54
56
  req
55
57
  });
56
- results.globals[global.slug] = globalPolicy;
58
+ results.globals[global.slug] = globalPermissions;
57
59
  }));
58
60
  return sanitizePermissions(results);
59
61
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/auth/getAccessResults.ts"],"sourcesContent":["import type { AllOperations, PayloadRequest } from '../types/index.js'\nimport type { Permissions, SanitizedPermissions } from './types.js'\n\nimport { getEntityPolicies } from '../utilities/getEntityPolicies.js'\nimport { sanitizePermissions } from '../utilities/sanitizePermissions.js'\n\ntype GetAccessResultsArgs = {\n req: PayloadRequest\n}\nexport async function getAccessResults({\n req,\n}: GetAccessResultsArgs): Promise<SanitizedPermissions> {\n const results = {\n collections: {},\n globals: {},\n } as Permissions\n const { payload, user } = req\n\n const isLoggedIn = !!user\n const userCollectionConfig =\n user && user.collection ? payload?.collections?.[user.collection]?.config : null\n\n if (userCollectionConfig && payload.config.admin.user === user?.collection) {\n results.canAccessAdmin = userCollectionConfig.access.admin\n ? await userCollectionConfig.access.admin({ req })\n : isLoggedIn\n } else {\n results.canAccessAdmin = false\n }\n const blockPolicies = {}\n\n await Promise.all(\n payload.config.collections.map(async (collection) => {\n const collectionOperations: AllOperations[] = ['create', 'read', 'update', 'delete']\n\n if (\n collection.auth &&\n typeof collection.auth.maxLoginAttempts !== 'undefined' &&\n collection.auth.maxLoginAttempts !== 0\n ) {\n collectionOperations.push('unlock')\n }\n\n if (collection.versions) {\n collectionOperations.push('readVersions')\n }\n\n const collectionPolicy = await getEntityPolicies({\n type: 'collection',\n blockPolicies,\n entity: collection,\n operations: collectionOperations,\n req,\n })\n results.collections![collection.slug] = collectionPolicy\n }),\n )\n\n await Promise.all(\n payload.config.globals.map(async (global) => {\n const globalOperations: AllOperations[] = ['read', 'update']\n\n if (global.versions) {\n globalOperations.push('readVersions')\n }\n\n const globalPolicy = await getEntityPolicies({\n type: 'global',\n blockPolicies,\n entity: global,\n operations: globalOperations,\n req,\n })\n results.globals![global.slug] = globalPolicy\n }),\n )\n\n return sanitizePermissions(results)\n}\n"],"names":["getEntityPolicies","sanitizePermissions","getAccessResults","req","results","collections","globals","payload","user","isLoggedIn","userCollectionConfig","collection","config","admin","canAccessAdmin","access","blockPolicies","Promise","all","map","collectionOperations","auth","maxLoginAttempts","push","versions","collectionPolicy","type","entity","operations","slug","global","globalOperations","globalPolicy"],"mappings":"AAGA,SAASA,iBAAiB,QAAQ,oCAAmC;AACrE,SAASC,mBAAmB,QAAQ,sCAAqC;AAKzE,OAAO,eAAeC,iBAAiB,EACrCC,GAAG,EACkB;IACrB,MAAMC,UAAU;QACdC,aAAa,CAAC;QACdC,SAAS,CAAC;IACZ;IACA,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAE,GAAGL;IAE1B,MAAMM,aAAa,CAAC,CAACD;IACrB,MAAME,uBACJF,QAAQA,KAAKG,UAAU,GAAGJ,SAASF,aAAa,CAACG,KAAKG,UAAU,CAAC,EAAEC,SAAS;IAE9E,IAAIF,wBAAwBH,QAAQK,MAAM,CAACC,KAAK,CAACL,IAAI,KAAKA,MAAMG,YAAY;QAC1EP,QAAQU,cAAc,GAAGJ,qBAAqBK,MAAM,CAACF,KAAK,GACtD,MAAMH,qBAAqBK,MAAM,CAACF,KAAK,CAAC;YAAEV;QAAI,KAC9CM;IACN,OAAO;QACLL,QAAQU,cAAc,GAAG;IAC3B;IACA,MAAME,gBAAgB,CAAC;IAEvB,MAAMC,QAAQC,GAAG,CACfX,QAAQK,MAAM,CAACP,WAAW,CAACc,GAAG,CAAC,OAAOR;QACpC,MAAMS,uBAAwC;YAAC;YAAU;YAAQ;YAAU;SAAS;QAEpF,IACET,WAAWU,IAAI,IACf,OAAOV,WAAWU,IAAI,CAACC,gBAAgB,KAAK,eAC5CX,WAAWU,IAAI,CAACC,gBAAgB,KAAK,GACrC;YACAF,qBAAqBG,IAAI,CAAC;QAC5B;QAEA,IAAIZ,WAAWa,QAAQ,EAAE;YACvBJ,qBAAqBG,IAAI,CAAC;QAC5B;QAEA,MAAME,mBAAmB,MAAMzB,kBAAkB;YAC/C0B,MAAM;YACNV;YACAW,QAAQhB;YACRiB,YAAYR;YACZjB;QACF;QACAC,QAAQC,WAAW,AAAC,CAACM,WAAWkB,IAAI,CAAC,GAAGJ;IAC1C;IAGF,MAAMR,QAAQC,GAAG,CACfX,QAAQK,MAAM,CAACN,OAAO,CAACa,GAAG,CAAC,OAAOW;QAChC,MAAMC,mBAAoC;YAAC;YAAQ;SAAS;QAE5D,IAAID,OAAON,QAAQ,EAAE;YACnBO,iBAAiBR,IAAI,CAAC;QACxB;QAEA,MAAMS,eAAe,MAAMhC,kBAAkB;YAC3C0B,MAAM;YACNV;YACAW,QAAQG;YACRF,YAAYG;YACZ5B;QACF;QACAC,QAAQE,OAAO,AAAC,CAACwB,OAAOD,IAAI,CAAC,GAAGG;IAClC;IAGF,OAAO/B,oBAAoBG;AAC7B"}
1
+ {"version":3,"sources":["../../src/auth/getAccessResults.ts"],"sourcesContent":["import type { AllOperations, PayloadRequest } from '../types/index.js'\nimport type { Permissions, SanitizedPermissions } from './types.js'\n\nimport { getEntityPermissions } from '../utilities/getEntityPermissions/getEntityPermissions.js'\nimport { sanitizePermissions } from '../utilities/sanitizePermissions.js'\n\ntype GetAccessResultsArgs = {\n req: PayloadRequest\n}\nexport async function getAccessResults({\n req,\n}: GetAccessResultsArgs): Promise<SanitizedPermissions> {\n const results = {\n collections: {},\n globals: {},\n } as Permissions\n const { payload, user } = req\n\n const isLoggedIn = !!user\n const userCollectionConfig =\n user && user.collection ? payload?.collections?.[user.collection]?.config : null\n\n if (userCollectionConfig && payload.config.admin.user === user?.collection) {\n results.canAccessAdmin = userCollectionConfig.access.admin\n ? await userCollectionConfig.access.admin({ req })\n : isLoggedIn\n } else {\n results.canAccessAdmin = false\n }\n const blockReferencesPermissions = {}\n\n await Promise.all(\n payload.config.collections.map(async (collection) => {\n const collectionOperations: AllOperations[] = ['create', 'read', 'update', 'delete']\n\n if (\n collection.auth &&\n typeof collection.auth.maxLoginAttempts !== 'undefined' &&\n collection.auth.maxLoginAttempts !== 0\n ) {\n collectionOperations.push('unlock')\n }\n\n if (collection.versions) {\n collectionOperations.push('readVersions')\n }\n\n const collectionPermissions = await getEntityPermissions({\n blockReferencesPermissions,\n entity: collection,\n entityType: 'collection',\n fetchData: false,\n operations: collectionOperations,\n req,\n })\n results.collections![collection.slug] = collectionPermissions\n }),\n )\n\n await Promise.all(\n payload.config.globals.map(async (global) => {\n const globalOperations: AllOperations[] = ['read', 'update']\n\n if (global.versions) {\n globalOperations.push('readVersions')\n }\n\n const globalPermissions = await getEntityPermissions({\n blockReferencesPermissions,\n entity: global,\n entityType: 'global',\n fetchData: false,\n operations: globalOperations,\n req,\n })\n results.globals![global.slug] = globalPermissions\n }),\n )\n\n return sanitizePermissions(results)\n}\n"],"names":["getEntityPermissions","sanitizePermissions","getAccessResults","req","results","collections","globals","payload","user","isLoggedIn","userCollectionConfig","collection","config","admin","canAccessAdmin","access","blockReferencesPermissions","Promise","all","map","collectionOperations","auth","maxLoginAttempts","push","versions","collectionPermissions","entity","entityType","fetchData","operations","slug","global","globalOperations","globalPermissions"],"mappings":"AAGA,SAASA,oBAAoB,QAAQ,4DAA2D;AAChG,SAASC,mBAAmB,QAAQ,sCAAqC;AAKzE,OAAO,eAAeC,iBAAiB,EACrCC,GAAG,EACkB;IACrB,MAAMC,UAAU;QACdC,aAAa,CAAC;QACdC,SAAS,CAAC;IACZ;IACA,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAE,GAAGL;IAE1B,MAAMM,aAAa,CAAC,CAACD;IACrB,MAAME,uBACJF,QAAQ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OD,IAAI,CAAC,GAAGG;IAClC;IAGF,OAAOhC,oBAAoBG;AAC7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"resetPassword.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/resetPassword.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAA0B,MAAM,mCAAmC,CAAA;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAc1D,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAA;QAChB,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAU,KAAK,SAAS,cAAc,QACjE,SAAS,KACd,OAAO,CAAC,MAAM,CA8KhB,CAAA"}
1
+ {"version":3,"file":"resetPassword.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/resetPassword.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAA0B,MAAM,mCAAmC,CAAA;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAc1D,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAA;QAChB,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAU,KAAK,SAAS,cAAc,QACjE,SAAS,KACd,OAAO,CAAC,MAAM,CAmNhB,CAAA"}
@@ -110,11 +110,40 @@ export const resetPasswordOperation = async (args)=>{
110
110
  fieldsToSignArgs.sid = sid;
111
111
  }
112
112
  const fieldsToSign = getFieldsToSign(fieldsToSignArgs);
113
+ // /////////////////////////////////////
114
+ // beforeLogin - Collection
115
+ // /////////////////////////////////////
116
+ let userBeforeLogin = user;
117
+ if (collectionConfig.hooks?.beforeLogin?.length) {
118
+ for (const hook of collectionConfig.hooks.beforeLogin){
119
+ userBeforeLogin = await hook({
120
+ collection: args.collection?.config,
121
+ context: args.req.context,
122
+ req: args.req,
123
+ user: userBeforeLogin
124
+ }) || userBeforeLogin;
125
+ }
126
+ }
113
127
  const { token } = await jwtSign({
114
128
  fieldsToSign,
115
129
  secret,
116
130
  tokenExpiration: collectionConfig.auth.tokenExpiration
117
131
  });
132
+ req.user = userBeforeLogin;
133
+ // /////////////////////////////////////
134
+ // afterLogin - Collection
135
+ // /////////////////////////////////////
136
+ if (collectionConfig.hooks?.afterLogin?.length) {
137
+ for (const hook of collectionConfig.hooks.afterLogin){
138
+ userBeforeLogin = await hook({
139
+ collection: args.collection?.config,
140
+ context: args.req.context,
141
+ req: args.req,
142
+ token,
143
+ user: userBeforeLogin
144
+ }) || userBeforeLogin;
145
+ }
146
+ }
118
147
  const fullUser = await payload.findByID({
119
148
  id: user.id,
120
149
  collection: collectionConfig.slug,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/auth/operations/resetPassword.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\n\nimport type { Collection, DataFromCollectionSlug } from '../../collections/config/types.js'\nimport type { CollectionSlug } from '../../index.js'\nimport type { PayloadRequest } from '../../types/index.js'\n\nimport { buildAfterOperation } from '../../collections/operations/utils.js'\nimport { APIError, Forbidden } from '../../errors/index.js'\nimport { appendNonTrashedFilter } from '../../utilities/appendNonTrashedFilter.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { getFieldsToSign } from '../getFieldsToSign.js'\nimport { jwtSign } from '../jwt.js'\nimport { addSessionToUser } from '../sessions.js'\nimport { authenticateLocalStrategy } from '../strategies/local/authenticate.js'\nimport { generatePasswordSaltHash } from '../strategies/local/generatePasswordSaltHash.js'\n\nexport type Result = {\n token?: string\n user: Record<string, unknown>\n}\n\nexport type Arguments = {\n collection: Collection\n data: {\n password: string\n token: string\n }\n depth?: number\n overrideAccess?: boolean\n req: PayloadRequest\n}\n\nexport const resetPasswordOperation = async <TSlug extends CollectionSlug>(\n args: Arguments,\n): Promise<Result> => {\n const {\n collection: { config: collectionConfig },\n data,\n depth,\n overrideAccess,\n req: {\n payload: { secret },\n payload,\n },\n req,\n } = args\n\n if (\n !Object.prototype.hasOwnProperty.call(data, 'token') ||\n !Object.prototype.hasOwnProperty.call(data, 'password')\n ) {\n throw new APIError('Missing required data.', httpStatus.BAD_REQUEST)\n }\n\n if (collectionConfig.auth.disableLocalStrategy) {\n throw new Forbidden(req.t)\n }\n\n try {\n const shouldCommit = await initTransaction(req)\n\n if (args.collection.config.hooks?.beforeOperation?.length) {\n for (const hook of args.collection.config.hooks.beforeOperation) {\n args =\n (await hook({\n args,\n collection: args.collection?.config,\n context: args.req.context,\n operation: 'resetPassword',\n req: args.req,\n })) || args\n }\n }\n\n // /////////////////////////////////////\n // Reset Password\n // /////////////////////////////////////\n\n const where = appendNonTrashedFilter({\n enableTrash: Boolean(collectionConfig.trash),\n trash: false,\n where: {\n resetPasswordExpiration: { greater_than: new Date().toISOString() },\n resetPasswordToken: { equals: data.token },\n },\n })\n\n const user = await payload.db.findOne<any>({\n collection: collectionConfig.slug,\n req,\n where,\n })\n\n if (!user) {\n throw new APIError('Token is either invalid or has expired.', httpStatus.FORBIDDEN)\n }\n\n // TODO: replace this method\n const { hash, salt } = await generatePasswordSaltHash({\n collection: collectionConfig,\n password: data.password,\n req,\n })\n\n user.salt = salt\n user.hash = hash\n\n user.resetPasswordExpiration = new Date().toISOString()\n\n if (collectionConfig.auth.verify) {\n user._verified = Boolean(user._verified)\n }\n // /////////////////////////////////////\n // beforeValidate - Collection\n // /////////////////////////////////////\n\n if (collectionConfig.hooks?.beforeValidate?.length) {\n for (const hook of collectionConfig.hooks.beforeValidate) {\n await hook({\n collection: args.collection?.config,\n context: req.context,\n data: user,\n operation: 'update',\n req,\n })\n }\n }\n\n // /////////////////////////////////////\n // Update new password\n // /////////////////////////////////////\n\n // Ensure updatedAt date is always updated\n user.updatedAt = new Date().toISOString()\n\n const doc = await payload.db.updateOne({\n id: user.id,\n collection: collectionConfig.slug,\n data: user,\n req,\n })\n\n await authenticateLocalStrategy({ doc, password: data.password })\n\n const fieldsToSignArgs: Parameters<typeof getFieldsToSign>[0] = {\n collectionConfig,\n email: user.email,\n user,\n }\n\n const { sid } = await addSessionToUser({\n collectionConfig,\n payload,\n req,\n user,\n })\n\n if (sid) {\n fieldsToSignArgs.sid = sid\n }\n\n const fieldsToSign = getFieldsToSign(fieldsToSignArgs)\n\n const { token } = await jwtSign({\n fieldsToSign,\n secret,\n tokenExpiration: collectionConfig.auth.tokenExpiration,\n })\n\n const fullUser = await payload.findByID({\n id: user.id,\n collection: collectionConfig.slug,\n depth,\n overrideAccess,\n req,\n trash: false,\n })\n\n if (shouldCommit) {\n await commitTransaction(req)\n }\n\n if (fullUser) {\n fullUser.collection = collectionConfig.slug\n fullUser._strategy = 'local-jwt'\n }\n\n let result: { user: DataFromCollectionSlug<TSlug> } & Result = {\n token,\n user: fullUser,\n }\n\n // /////////////////////////////////////\n // afterOperation - Collection\n // /////////////////////////////////////\n\n result = await buildAfterOperation({\n args,\n collection: args.collection?.config,\n operation: 'resetPassword',\n result,\n })\n\n return result\n } catch (error: unknown) {\n await killTransaction(req)\n throw error\n }\n}\n"],"names":["status","httpStatus","buildAfterOperation","APIError","Forbidden","appendNonTrashedFilter","commitTransaction","initTransaction","killTransaction","getFieldsToSign","jwtSign","addSessionToUser","authenticateLocalStrategy","generatePasswordSaltHash","resetPasswordOperation","args","collection","config","collectionConfig","data","depth","overrideAccess","req","payload","secret","Object","prototype","hasOwnProperty","call","BAD_REQUEST","auth","disableLocalStrategy","t","shouldCommit","hooks","beforeOperation","length","hook","context","operation","where","enableTrash","Boolean","trash","resetPasswordExpiration","greater_than","Date","toISOString","resetPasswordToken","equals","token","user","db","findOne","slug","FORBIDDEN","hash","salt","password","verify","_verified","beforeValidate","updatedAt","doc","updateOne","id","fieldsToSignArgs","email","sid","fieldsToSign","tokenExpiration","fullUser","findByID","_strategy","result","error"],"mappings":"AAAA,SAASA,UAAUC,UAAU,QAAQ,cAAa;AAMlD,SAASC,mBAAmB,QAAQ,wCAAuC;AAC3E,SAASC,QAAQ,EAAEC,SAAS,QAAQ,wBAAuB;AAC3D,SAASC,sBAAsB,QAAQ,4CAA2C;AAClF,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,wBAAuB;AACvD,SAASC,OAAO,QAAQ,YAAW;AACnC,SAASC,gBAAgB,QAAQ,iBAAgB;AACjD,SAASC,yBAAyB,QAAQ,sCAAqC;AAC/E,SAASC,wBAAwB,QAAQ,kDAAiD;AAkB1F,OAAO,MAAMC,yBAAyB,OACpCC;IAEA,MAAM,EACJC,YAAY,EAAEC,QAAQC,gBAAgB,EAAE,EACxC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AG,GAAGA;QACzB;QAEA,MAAMC,eAAe5D,gBAAgByD;QAErC,MAAM,EAAEhB,KAAK,EAAE,GAAG,MAAMxC,QAAQ;YAC9B2D;YACA7C;YACA8C,iBAAiBpD,iBAAiBY,IAAI,CAACwC,eAAe;QACxD;QAEA,MAAMC,WAAW,MAAMhD,QAAQiD,QAAQ,CAAC;YACtCP,IAAId,KAAKc,EAAE;YACXjD,YAAYE,iBAAiBoC,IAAI;YACjClC;YACAC;YACAC;YACAqB,OAAO;QACT;QAEA,IAAIV,cAAc;YAChB,MAAM3B,kBAAkBgB;QAC1B;QAEA,IAAIiD,UAAU;YACZA,SAASvD,UAAU,GAAGE,iBAAiBoC,IAAI;YAC3CiB,SAASE,SAAS,GAAG;QACvB;QAEA,IAAIC,SAA2D;YAC7DxB;YACAC,MAAMoB;QACR;QAEA,wCAAwC;QACxC,8BAA8B;QAC9B,wCAAwC;QAExCG,SAAS,MAAMxE,oBAAoB;YACjCa;YACAC,YAAYD,KAAKC,UAAU,EAAEC;YAC7BsB,WAAW;YACXmC;QACF;QAEA,OAAOA;IACT,EAAE,OAAOC,OAAgB;QACvB,MAAMnE,gBAAgBc;QACtB,MAAMqD;IACR;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../src/auth/operations/resetPassword.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\n\nimport type { Collection, DataFromCollectionSlug } from '../../collections/config/types.js'\nimport type { CollectionSlug } from '../../index.js'\nimport type { PayloadRequest } from '../../types/index.js'\n\nimport { buildAfterOperation } from '../../collections/operations/utils.js'\nimport { APIError, Forbidden } from '../../errors/index.js'\nimport { appendNonTrashedFilter } from '../../utilities/appendNonTrashedFilter.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { getFieldsToSign } from '../getFieldsToSign.js'\nimport { jwtSign } from '../jwt.js'\nimport { addSessionToUser } from '../sessions.js'\nimport { authenticateLocalStrategy } from '../strategies/local/authenticate.js'\nimport { generatePasswordSaltHash } from '../strategies/local/generatePasswordSaltHash.js'\n\nexport type Result = {\n token?: string\n user: Record<string, unknown>\n}\n\nexport type Arguments = {\n collection: Collection\n data: {\n password: string\n token: string\n }\n depth?: number\n overrideAccess?: boolean\n req: PayloadRequest\n}\n\nexport const resetPasswordOperation = async <TSlug extends CollectionSlug>(\n args: Arguments,\n): Promise<Result> => {\n const {\n collection: { config: collectionConfig },\n data,\n depth,\n overrideAccess,\n req: {\n payload: { secret },\n payload,\n },\n req,\n } = args\n\n if (\n !Object.prototype.hasOwnProperty.call(data, 'token') ||\n !Object.prototype.hasOwnProperty.call(data, 'password')\n ) {\n throw new APIError('Missing required data.', httpStatus.BAD_REQUEST)\n }\n\n if (collectionConfig.auth.disableLocalStrategy) {\n throw new Forbidden(req.t)\n }\n\n try {\n const shouldCommit = await initTransaction(req)\n\n if (args.collection.config.hooks?.beforeOperation?.length) {\n for (const hook of args.collection.config.hooks.beforeOperation) {\n args =\n (await hook({\n args,\n collection: args.collection?.config,\n context: args.req.context,\n operation: 'resetPassword',\n req: args.req,\n })) || args\n }\n }\n\n // /////////////////////////////////////\n // Reset Password\n // /////////////////////////////////////\n\n const where = appendNonTrashedFilter({\n enableTrash: Boolean(collectionConfig.trash),\n trash: false,\n where: {\n resetPasswordExpiration: { greater_than: new Date().toISOString() },\n resetPasswordToken: { equals: data.token },\n },\n })\n\n const user = await payload.db.findOne<any>({\n collection: collectionConfig.slug,\n req,\n where,\n })\n\n if (!user) {\n throw new APIError('Token is either invalid or has expired.', httpStatus.FORBIDDEN)\n }\n\n // TODO: replace this method\n const { hash, salt } = await generatePasswordSaltHash({\n collection: collectionConfig,\n password: data.password,\n req,\n })\n\n user.salt = salt\n user.hash = hash\n\n user.resetPasswordExpiration = new Date().toISOString()\n\n if (collectionConfig.auth.verify) {\n user._verified = Boolean(user._verified)\n }\n // /////////////////////////////////////\n // beforeValidate - Collection\n // /////////////////////////////////////\n\n if (collectionConfig.hooks?.beforeValidate?.length) {\n for (const hook of collectionConfig.hooks.beforeValidate) {\n await hook({\n collection: args.collection?.config,\n context: req.context,\n data: user,\n operation: 'update',\n req,\n })\n }\n }\n\n // /////////////////////////////////////\n // Update new password\n // /////////////////////////////////////\n\n // Ensure updatedAt date is always updated\n user.updatedAt = new Date().toISOString()\n\n const doc = await payload.db.updateOne({\n id: user.id,\n collection: collectionConfig.slug,\n data: user,\n req,\n })\n\n await authenticateLocalStrategy({ doc, password: data.password })\n\n const fieldsToSignArgs: Parameters<typeof getFieldsToSign>[0] = {\n collectionConfig,\n email: user.email,\n user,\n }\n\n const { sid } = await addSessionToUser({\n collectionConfig,\n payload,\n req,\n user,\n })\n\n if (sid) {\n fieldsToSignArgs.sid = sid\n }\n\n const fieldsToSign = getFieldsToSign(fieldsToSignArgs)\n\n // /////////////////////////////////////\n // beforeLogin - Collection\n // /////////////////////////////////////\n\n let userBeforeLogin = user\n\n if (collectionConfig.hooks?.beforeLogin?.length) {\n for (const hook of collectionConfig.hooks.beforeLogin) {\n userBeforeLogin =\n (await hook({\n collection: args.collection?.config,\n context: args.req.context,\n req: args.req,\n user: userBeforeLogin,\n })) || userBeforeLogin\n }\n }\n\n const { token } = await jwtSign({\n fieldsToSign,\n secret,\n tokenExpiration: collectionConfig.auth.tokenExpiration,\n })\n\n req.user = userBeforeLogin\n\n // /////////////////////////////////////\n // afterLogin - Collection\n // /////////////////////////////////////\n\n if (collectionConfig.hooks?.afterLogin?.length) {\n for (const hook of collectionConfig.hooks.afterLogin) {\n userBeforeLogin =\n (await hook({\n collection: args.collection?.config,\n context: args.req.context,\n req: args.req,\n token,\n user: userBeforeLogin,\n })) || userBeforeLogin\n }\n }\n\n const fullUser = await payload.findByID({\n id: user.id,\n collection: collectionConfig.slug,\n depth,\n overrideAccess,\n req,\n trash: false,\n })\n\n if (shouldCommit) {\n await commitTransaction(req)\n }\n\n if (fullUser) {\n fullUser.collection = collectionConfig.slug\n fullUser._strategy = 'local-jwt'\n }\n\n let result: { user: DataFromCollectionSlug<TSlug> } & Result = {\n token,\n user: fullUser,\n }\n\n // /////////////////////////////////////\n // afterOperation - Collection\n // /////////////////////////////////////\n\n result = await buildAfterOperation({\n args,\n collection: args.collection?.config,\n operation: 'resetPassword',\n result,\n })\n\n return result\n } catch (error: unknown) {\n await killTransaction(req)\n throw error\n }\n}\n"],"names":["status","httpStatus","buildAfterOperation","APIError","Forbidden","appendNonTrashedFilter","commitTransaction","initTransaction","killTransaction","getFieldsToSign","jwtSign","addSessionToUser","authenticateLocalStrategy","generatePasswordSaltHash","resetPasswordOperation","args","collection","config","collectionConfig","data","depth","overrideAccess","req","payload","secret","Object","prototype","hasOwnProperty","call","BAD_REQUEST","auth","disableLocalStrategy","t","shouldCommit","hooks","beforeOperation","length","hook","context","operation","where","enableTrash","Boolean","trash","resetPasswordExpiration","greater_than","Date","toISOString","resetPasswordToken","equals","token","user","db","findOne","slug","FORBIDDEN","hash","salt","password","verify","_verified","beforeValidate","updatedAt","doc","updateOne","id","fieldsToSignArgs","email","sid","fieldsToSign","userBeforeLogin","beforeLogin","tokenExpiration","afterLogin","fullUser","findByID","_strategy","result","error"],"mappings":"AAAA,SAASA,UAAUC,UAAU,QAAQ,cAAa;AAMlD,SAASC,mBAAmB,QAAQ,wCAAuC;AAC3E,SAASC,QAAQ,EAAEC,SAAS,QAAQ,wBAAuB;AAC3D,SAASC,sBAAsB,QAAQ,4CAA2C;AAClF,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,wBAAuB;AACvD,SAASC,OAAO,QAAQ,YAAW;AACnC,SAASC,gBAAgB,QAAQ,iBAAgB;AACjD,SAASC,yBAAyB,QAAQ,sCAAqC;AAC/E,SAASC,wBAAwB,QAAQ,kDAAiD;AAkB1F,OAAO,MAAMC,yBAAyB,OACpCC;IAEA,MAAM,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oC,IAAI;YAC3CoB,SAASE,SAAS,GAAG;QACvB;QAEA,IAAIC,SAA2D;YAC7D3B;YACAC,MAAMuB;QACR;QAEA,wCAAwC;QACxC,8BAA8B;QAC9B,wCAAwC;QAExCG,SAAS,MAAM3E,oBAAoB;YACjCa;YACAC,YAAYD,KAAKC,UAAU,EAAEC;YAC7BsB,WAAW;YACXsC;QACF;QAEA,OAAOA;IACT,EAAE,OAAOC,OAAgB;QACvB,MAAMtE,gBAAgBc;QACtB,MAAMwD;IACR;AACF,EAAC"}
@@ -22,16 +22,16 @@ export type SanitizedBlockPermissions = {
22
22
  } | true;
23
23
  export type BlocksPermissions = {
24
24
  [blockSlug: string]: BlockPermissions;
25
- } | true;
25
+ };
26
26
  export type SanitizedBlocksPermissions = {
27
27
  [blockSlug: string]: SanitizedBlockPermissions;
28
28
  } | true;
29
29
  export type FieldPermissions = {
30
30
  blocks?: BlocksPermissions;
31
- create: Permission;
31
+ create?: Permission;
32
32
  fields?: FieldsPermissions;
33
- read: Permission;
34
- update: Permission;
33
+ read?: Permission;
34
+ update?: Permission;
35
35
  };
36
36
  export type SanitizedFieldPermissions = {
37
37
  blocks?: SanitizedBlocksPermissions;
@@ -44,12 +44,13 @@ export type SanitizedFieldsPermissions = {
44
44
  [fieldName: string]: SanitizedFieldPermissions;
45
45
  } | true;
46
46
  export type CollectionPermission = {
47
- create: Permission;
48
- delete: Permission;
47
+ create?: Permission;
48
+ delete?: Permission;
49
49
  fields: FieldsPermissions;
50
- read: Permission;
50
+ read?: Permission;
51
51
  readVersions?: Permission;
52
- update: Permission;
52
+ unlock?: Permission;
53
+ update?: Permission;
53
54
  };
54
55
  export type SanitizedCollectionPermission = {
55
56
  create?: true;
@@ -57,13 +58,14 @@ export type SanitizedCollectionPermission = {
57
58
  fields: SanitizedFieldsPermissions;
58
59
  read?: true;
59
60
  readVersions?: true;
61
+ unlock?: true;
60
62
  update?: true;
61
63
  };
62
64
  export type GlobalPermission = {
63
65
  fields: FieldsPermissions;
64
- read: Permission;
66
+ read?: Permission;
65
67
  readVersions?: Permission;
66
- update: Permission;
68
+ update?: Permission;
67
69
  };
68
70
  export type SanitizedGlobalPermission = {
69
71
  fields: SanitizedFieldsPermissions;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/auth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE9D;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAA;CACtC,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,UAAU,CAAA;IAClB,MAAM,EAAE,iBAAiB,CAAA;IACzB,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,UAAU,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,yBAAyB,GACjC;IACE,MAAM,EAAE,0BAA0B,CAAA;CACnC,GACD,IAAI,CAAA;AAER,MAAM,MAAM,iBAAiB,GACzB;IACE,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAA;CACtC,GACD,IAAI,CAAA;AAER,MAAM,MAAM,0BAA0B,GAClC;IACE,CAAC,SAAS,EAAE,MAAM,GAAG,yBAAyB,CAAA;CAC/C,GACD,IAAI,CAAA;AAER,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,MAAM,EAAE,UAAU,CAAA;IAClB,MAAM,CAAC,EA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EG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;OAEG;IACH,wBAAwB,CAAC,EAAE,IAAI,CAAA;IAC/B;;;OAGG;IACH,UAAU,CAAC,EAAE,YAAY,EAAE,CAAA;IAC3B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;OAGG;IACH,MAAM,CAAC,EACH;QACE,iBAAiB,CAAC,EAAE,uBAAuB,CAAA;QAC3C,oBAAoB,CAAC,EAAE,0BAA0B,CAAA;KAClD,GACD,OAAO,CAAA;CACZ;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,iBAAiB,CAAC,EAAE,uBAAuB,CAAA;IAC3C,oBAAoB,CAAC,EAAE,0BAA0B,CAAA;CAClD,CAAA;AAED,MAAM,WAAW,IACf,SAAQ,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,mBAAmB,GAAG,QAAQ,CAAC;IAC/F,cAAc,CAAC,EAAE;QACf,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,iBAAiB,CAAC,EAAE,+BAA+B,CAAA;QACnD,oBAAoB,CAAC,EAAE,kCAAkC,CAAA;KAC1D,CAAA;IACD,iBAAiB,EAAE,KAAK,GAAG,wBAAwB,CAAA;IACnD,MAAM,CAAC,EAAE,OAAO,GAAG,YAAY,CAAA;CAChC;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,IAAI,KAAK,CAE7E"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/auth/types.ts"],"sourcesContent":["import type { DeepRequired } from 'ts-essentials'\n\nimport type { CollectionSlug, GlobalSlug, Payload, TypedUser } from '../index.js'\nimport type { PayloadRequest, Where } from '../types/index.js'\n\n/**\n * A permission object that can be used to determine if a user has access to a specific operation.\n */\nexport type Permission = {\n permission: boolean\n where?: Where\n}\n\nexport type FieldsPermissions = {\n [fieldName: string]: FieldPermissions\n}\n\nexport type BlockPermissions = {\n create: Permission\n fields: FieldsPermissions\n read: Permission\n update: Permission\n}\n\nexport type SanitizedBlockPermissions =\n | {\n fields: SanitizedFieldsPermissions\n }\n | true\n\nexport type BlocksPermissions =\n | {\n [blockSlug: string]: BlockPermissions\n }\n | true\n\nexport type SanitizedBlocksPermissions =\n | {\n [blockSlug: string]: SanitizedBlockPermissions\n }\n | true\n\nexport type FieldPermissions = {\n blocks?: BlocksPermissions\n create: Permission\n fields?: FieldsPermissions\n read: Permission\n update: Permission\n}\n\nexport type SanitizedFieldPermissions =\n | {\n blocks?: SanitizedBlocksPermissions\n create: true\n fields?: SanitizedFieldsPermissions\n read: true\n update: true\n }\n | true\n\nexport type SanitizedFieldsPermissions =\n | {\n [fieldName: string]: SanitizedFieldPermissions\n }\n | true\n\nexport type CollectionPermission = {\n create: Permission\n delete: Permission\n fields: FieldsPermissions\n read: Permission\n readVersions?: Permission\n update: Permission\n}\n\nexport type SanitizedCollectionPermission = {\n create?: true\n delete?: true\n fields: SanitizedFieldsPermissions\n read?: true\n readVersions?: true\n update?: true\n}\n\nexport type GlobalPermission = {\n fields: FieldsPermissions\n read: Permission\n readVersions?: Permission\n update: Permission\n}\n\nexport type SanitizedGlobalPermission = {\n fields: SanitizedFieldsPermissions\n read?: true\n readVersions?: true\n update?: true\n}\n\nexport type DocumentPermissions = CollectionPermission | GlobalPermission\n\nexport type SanitizedDocumentPermissions = SanitizedCollectionPermission | SanitizedGlobalPermission\n\nexport type Permissions = {\n canAccessAdmin: boolean\n collections?: Record<CollectionSlug, CollectionPermission>\n globals?: Record<GlobalSlug, GlobalPermission>\n}\n\nexport type SanitizedPermissions = {\n canAccessAdmin?: boolean\n collections?: {\n [collectionSlug: string]: SanitizedCollectionPermission\n }\n globals?: {\n [globalSlug: string]: SanitizedGlobalPermission\n }\n}\n\ntype BaseUser = {\n collection: string\n email?: string\n id: number | string\n sessions?: Array<UserSession>\n username?: string\n}\n\n/**\n * @deprecated Use `TypedUser` instead. This will be removed in 4.0.\n */\nexport type UntypedUser = {\n [key: string]: any\n} & BaseUser\n\n/**\n * `collection` is not available one the client. It's only available on the server (req.user)\n * On the client, you can access the collection via config.admin.user. Config can be accessed using the useConfig() hook\n */\nexport type ClientUser = {\n [key: string]: any\n} & BaseUser\n\nexport type UserSession = { createdAt: Date | string; expiresAt: Date | string; id: string }\ntype GenerateVerifyEmailHTML<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateVerifyEmailSubject<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailHTML<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailSubject<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\nexport type AuthStrategyFunctionArgs = {\n /**\n * Specifies whether or not response headers can be set from this strategy.\n */\n canSetHeaders?: boolean\n headers: Request['headers']\n isGraphQL?: boolean\n payload: Payload\n /**\n * The AuthStrategy name property from the payload config.\n */\n strategyName?: string\n}\n\nexport type AuthStrategyResult = {\n responseHeaders?: Headers\n user:\n | ({\n _strategy?: string\n collection?: string\n } & TypedUser)\n | null\n}\n\nexport type AuthStrategyFunction = (\n args: AuthStrategyFunctionArgs,\n) => AuthStrategyResult | Promise<AuthStrategyResult>\nexport type AuthStrategy = {\n authenticate: AuthStrategyFunction\n name: string\n}\n\nexport type LoginWithUsernameOptions =\n | {\n allowEmailLogin?: false\n requireEmail?: boolean\n // If `allowEmailLogin` is false, `requireUsername` must be true (default: true)\n requireUsername?: true\n }\n | {\n allowEmailLogin?: true\n requireEmail?: boolean\n requireUsername?: boolean\n }\n\nexport interface IncomingAuthType {\n /**\n * Set cookie options, including secure, sameSite, and domain. For advanced users.\n */\n cookies?: {\n domain?: string\n sameSite?: 'Lax' | 'None' | 'Strict' | boolean\n secure?: boolean\n }\n /**\n * How many levels deep a user document should be populated when creating the JWT and binding the user to the req. Defaults to 0 and should only be modified if absolutely necessary, as this will affect performance.\n * @default 0\n */\n depth?: number\n /**\n * Advanced - disable Payload's built-in local auth strategy. Only use this property if you have replaced Payload's auth mechanisms with your own.\n */\n disableLocalStrategy?:\n | {\n /**\n * Include auth fields on the collection even though the local strategy is disabled.\n * Useful when you do not want the database or types to vary depending on the auth configuration.\n */\n enableFields?: true\n optionalPassword?: true\n }\n | true\n /**\n * Customize the way that the forgotPassword operation functions.\n * @link https://payloadcms.com/docs/authentication/email#forgot-password\n */\n forgotPassword?: {\n /**\n * The number of milliseconds that the forgot password token should be valid for.\n * @default 3600000 // 1 hour\n */\n expiration?: number\n generateEmailHTML?: GenerateForgotPasswordEmailHTML\n generateEmailSubject?: GenerateForgotPasswordEmailSubject\n }\n /**\n * Set the time (in milliseconds) that a user should be locked out if they fail authentication more times than maxLoginAttempts allows for.\n */\n lockTime?: number\n /**\n * Ability to allow users to login with username/password.\n *\n * @link https://payloadcms.com/docs/authentication/overview#login-with-username\n */\n loginWithUsername?: boolean | LoginWithUsernameOptions\n /**\n * Only allow a user to attempt logging in X amount of times. Automatically locks out a user from authenticating if this limit is passed. Set to 0 to disable.\n */\n maxLoginAttempts?: number\n /***\n * Set to true if you want to remove the token from the returned authentication API responses such as login or refresh.\n */\n removeTokenFromResponses?: true\n /**\n * Advanced - an array of custom authentification strategies to extend this collection's authentication with.\n * @link https://payloadcms.com/docs/authentication/custom-strategies\n */\n strategies?: AuthStrategy[]\n /**\n * Controls how many seconds the token will be valid for. Default is 2 hours.\n * @default 7200\n * @link https://payloadcms.com/docs/authentication/overview#config-options\n */\n tokenExpiration?: number\n /**\n * Payload Authentication provides for API keys to be set on each user within an Authentication-enabled Collection.\n * @default false\n * @link https://payloadcms.com/docs/authentication/api-keys\n */\n useAPIKey?: boolean\n\n /**\n * Use sessions for authentication. Enabled by default.\n * @default true\n */\n useSessions?: boolean\n\n /**\n * Set to true or pass an object with verification options to require users to verify by email before they are allowed to log into your app.\n * @link https://payloadcms.com/docs/authentication/email#email-verification\n */\n verify?:\n | {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n }\n | boolean\n}\n\nexport type VerifyConfig = {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n}\n\nexport interface Auth\n extends Omit<DeepRequired<IncomingAuthType>, 'forgotPassword' | 'loginWithUsername' | 'verify'> {\n forgotPassword?: {\n expiration?: number\n generateEmailHTML?: GenerateForgotPasswordEmailHTML\n generateEmailSubject?: GenerateForgotPasswordEmailSubject\n }\n loginWithUsername: false | LoginWithUsernameOptions\n verify?: boolean | VerifyConfig\n}\n\nexport function hasWhereAccessResult(result: boolean | Where): result is Where {\n return result && typeof result === 'object'\n}\n"],"names":["hasWhereAccessResult","result"],"mappings":"AAiUA,OAAO,SAASA,qBAAqBC,MAAuB;IAC1D,OAAOA,UAAU,OAAOA,WAAW;AACrC"}
1
+ {"version":3,"sources":["../../src/auth/types.ts"],"sourcesContent":["import type { DeepRequired } from 'ts-essentials'\n\nimport type { CollectionSlug, GlobalSlug, Payload, TypedUser } from '../index.js'\nimport type { PayloadRequest, Where } from '../types/index.js'\n\n/**\n * A permission object that can be used to determine if a user has access to a specific operation.\n */\nexport type Permission = {\n permission: boolean\n where?: Where\n}\n\nexport type FieldsPermissions = {\n [fieldName: string]: FieldPermissions\n}\n\nexport type BlockPermissions = {\n create: Permission\n fields: FieldsPermissions\n read: Permission\n update: Permission\n}\n\nexport type SanitizedBlockPermissions =\n | {\n fields: SanitizedFieldsPermissions\n }\n | true\n\nexport type BlocksPermissions = {\n [blockSlug: string]: BlockPermissions\n}\n\nexport type SanitizedBlocksPermissions =\n | {\n [blockSlug: string]: SanitizedBlockPermissions\n }\n | true\n\nexport type FieldPermissions = {\n blocks?: BlocksPermissions\n create?: Permission\n fields?: FieldsPermissions\n read?: Permission\n update?: Permission\n}\n\nexport type SanitizedFieldPermissions =\n | {\n blocks?: SanitizedBlocksPermissions\n create: true\n fields?: SanitizedFieldsPermissions\n read: true\n update: true\n }\n | true\n\nexport type SanitizedFieldsPermissions =\n | {\n [fieldName: string]: SanitizedFieldPermissions\n }\n | true\n\nexport type CollectionPermission = {\n create?: Permission\n delete?: Permission\n fields: FieldsPermissions\n read?: Permission\n readVersions?: Permission\n // Auth-enabled Collections only\n unlock?: Permission\n update?: Permission\n}\n\nexport type SanitizedCollectionPermission = {\n create?: true\n delete?: true\n fields: SanitizedFieldsPermissions\n read?: true\n readVersions?: true\n // Auth-enabled Collections only\n unlock?: true\n update?: true\n}\n\nexport type GlobalPermission = {\n fields: FieldsPermissions\n read?: Permission\n readVersions?: Permission\n update?: Permission\n}\n\nexport type SanitizedGlobalPermission = {\n fields: SanitizedFieldsPermissions\n read?: true\n readVersions?: true\n update?: true\n}\n\nexport type DocumentPermissions = CollectionPermission | GlobalPermission\n\nexport type SanitizedDocumentPermissions = SanitizedCollectionPermission | SanitizedGlobalPermission\n\nexport type Permissions = {\n canAccessAdmin: boolean\n collections?: Record<CollectionSlug, CollectionPermission>\n globals?: Record<GlobalSlug, GlobalPermission>\n}\n\nexport type SanitizedPermissions = {\n canAccessAdmin?: boolean\n collections?: {\n [collectionSlug: string]: SanitizedCollectionPermission\n }\n globals?: {\n [globalSlug: string]: SanitizedGlobalPermission\n }\n}\n\ntype BaseUser = {\n collection: string\n email?: string\n id: number | string\n sessions?: Array<UserSession>\n username?: string\n}\n\n/**\n * @deprecated Use `TypedUser` instead. This will be removed in 4.0.\n */\nexport type UntypedUser = {\n [key: string]: any\n} & BaseUser\n\n/**\n * `collection` is not available one the client. It's only available on the server (req.user)\n * On the client, you can access the collection via config.admin.user. Config can be accessed using the useConfig() hook\n */\nexport type ClientUser = {\n [key: string]: any\n} & BaseUser\n\nexport type UserSession = { createdAt: Date | string; expiresAt: Date | string; id: string }\ntype GenerateVerifyEmailHTML<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateVerifyEmailSubject<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailHTML<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailSubject<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\nexport type AuthStrategyFunctionArgs = {\n /**\n * Specifies whether or not response headers can be set from this strategy.\n */\n canSetHeaders?: boolean\n headers: Request['headers']\n isGraphQL?: boolean\n payload: Payload\n /**\n * The AuthStrategy name property from the payload config.\n */\n strategyName?: string\n}\n\nexport type AuthStrategyResult = {\n responseHeaders?: Headers\n user:\n | ({\n _strategy?: string\n collection?: string\n } & TypedUser)\n | null\n}\n\nexport type AuthStrategyFunction = (\n args: AuthStrategyFunctionArgs,\n) => AuthStrategyResult | Promise<AuthStrategyResult>\nexport type AuthStrategy = {\n authenticate: AuthStrategyFunction\n name: string\n}\n\nexport type LoginWithUsernameOptions =\n | {\n allowEmailLogin?: false\n requireEmail?: boolean\n // If `allowEmailLogin` is false, `requireUsername` must be true (default: true)\n requireUsername?: true\n }\n | {\n allowEmailLogin?: true\n requireEmail?: boolean\n requireUsername?: boolean\n }\n\nexport interface IncomingAuthType {\n /**\n * Set cookie options, including secure, sameSite, and domain. For advanced users.\n */\n cookies?: {\n domain?: string\n sameSite?: 'Lax' | 'None' | 'Strict' | boolean\n secure?: boolean\n }\n /**\n * How many levels deep a user document should be populated when creating the JWT and binding the user to the req. Defaults to 0 and should only be modified if absolutely necessary, as this will affect performance.\n * @default 0\n */\n depth?: number\n /**\n * Advanced - disable Payload's built-in local auth strategy. Only use this property if you have replaced Payload's auth mechanisms with your own.\n */\n disableLocalStrategy?:\n | {\n /**\n * Include auth fields on the collection even though the local strategy is disabled.\n * Useful when you do not want the database or types to vary depending on the auth configuration.\n */\n enableFields?: true\n optionalPassword?: true\n }\n | true\n /**\n * Customize the way that the forgotPassword operation functions.\n * @link https://payloadcms.com/docs/authentication/email#forgot-password\n */\n forgotPassword?: {\n /**\n * The number of milliseconds that the forgot password token should be valid for.\n * @default 3600000 // 1 hour\n */\n expiration?: number\n generateEmailHTML?: GenerateForgotPasswordEmailHTML\n generateEmailSubject?: GenerateForgotPasswordEmailSubject\n }\n /**\n * Set the time (in milliseconds) that a user should be locked out if they fail authentication more times than maxLoginAttempts allows for.\n */\n lockTime?: number\n /**\n * Ability to allow users to login with username/password.\n *\n * @link https://payloadcms.com/docs/authentication/overview#login-with-username\n */\n loginWithUsername?: boolean | LoginWithUsernameOptions\n /**\n * Only allow a user to attempt logging in X amount of times. Automatically locks out a user from authenticating if this limit is passed. Set to 0 to disable.\n */\n maxLoginAttempts?: number\n /***\n * Set to true if you want to remove the token from the returned authentication API responses such as login or refresh.\n */\n removeTokenFromResponses?: true\n /**\n * Advanced - an array of custom authentification strategies to extend this collection's authentication with.\n * @link https://payloadcms.com/docs/authentication/custom-strategies\n */\n strategies?: AuthStrategy[]\n /**\n * Controls how many seconds the token will be valid for. Default is 2 hours.\n * @default 7200\n * @link https://payloadcms.com/docs/authentication/overview#config-options\n */\n tokenExpiration?: number\n /**\n * Payload Authentication provides for API keys to be set on each user within an Authentication-enabled Collection.\n * @default false\n * @link https://payloadcms.com/docs/authentication/api-keys\n */\n useAPIKey?: boolean\n\n /**\n * Use sessions for authentication. Enabled by default.\n * @default true\n */\n useSessions?: boolean\n\n /**\n * Set to true or pass an object with verification options to require users to verify by email before they are allowed to log into your app.\n * @link https://payloadcms.com/docs/authentication/email#email-verification\n */\n verify?:\n | {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n }\n | boolean\n}\n\nexport type VerifyConfig = {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n}\n\nexport interface Auth\n extends Omit<DeepRequired<IncomingAuthType>, 'forgotPassword' | 'loginWithUsername' | 'verify'> {\n forgotPassword?: {\n expiration?: number\n generateEmailHTML?: GenerateForgotPasswordEmailHTML\n generateEmailSubject?: GenerateForgotPasswordEmailSubject\n }\n loginWithUsername: false | LoginWithUsernameOptions\n verify?: boolean | VerifyConfig\n}\n\nexport function hasWhereAccessResult(result: boolean | Where): result is Where {\n return result && typeof result === 'object'\n}\n"],"names":["hasWhereAccessResult","result"],"mappings":"AAmUA,OAAO,SAASA,qBAAqBC,MAAuB;IAC1D,OAAOA,UAAU,OAAOA,WAAW;AACrC"}
@@ -8,7 +8,7 @@ import type { Access, AfterErrorHookArgs, AfterErrorResult, CustomComponent, Edi
8
8
  import type { DBIdentifierName } from '../../database/types.js';
9
9
  import type { Field, FlattenedField, JoinField, RelationshipField, UploadField } from '../../fields/config/types.js';
10
10
  import type { CollectionFoldersConfiguration } from '../../folders/types.js';
11
- import type { CollectionSlug, JsonObject, RequestContext, TypedAuthOperations, TypedCollection, TypedCollectionSelect, TypedLocale } from '../../index.js';
11
+ import type { CollectionAdminCustom, CollectionCustom, CollectionSlug, JsonObject, RequestContext, TypedAuthOperations, TypedCollection, TypedCollectionSelect, TypedLocale } from '../../index.js';
12
12
  import type { PayloadRequest, SelectIncludeType, SelectType, Sort, TransformCollectionWithSelect, Where } from '../../types/index.js';
13
13
  import type { SanitizedUploadConfig, UploadConfig } from '../../uploads/types.js';
14
14
  import type { IncomingCollectionVersions, SanitizedCollectionVersions } from '../../versions/types.js';
@@ -282,7 +282,7 @@ export type CollectionAdminOptions = {
282
282
  };
283
283
  };
284
284
  /** Extension point to add your custom data. Available in server and client. */
285
- custom?: Record<string, any>;
285
+ custom?: CollectionAdminCustom;
286
286
  /**
287
287
  * Default columns to show in list view
288
288
  */
@@ -408,7 +408,7 @@ export type CollectionConfig<TSlug extends CollectionSlug = any> = {
408
408
  */
409
409
  auth?: boolean | IncomingAuthType;
410
410
  /** Extension point to add your custom data. Server only. */
411
- custom?: Record<string, any>;
411
+ custom?: CollectionCustom;
412
412
  /**
413
413
  * Used to override the default naming of the database table or collection with your using a function or string
414
414
  * @WARNING: If you change this property with existing data, you will need to handle the renaming of the table in your database or by using migrations
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/collections/config/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC3E,OAAO,KAAK,EACV,SAAS,IAAI,gBAAgB,EAC7B,MAAM,IAAI,aAAa,EACxB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC7E,OAAO,KAAK,EACV,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,0BAA0B,EAC1B,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,KAAK,EACV,KAAK,EACL,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,WAAW,EACZ,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,w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AAI,EAAE,MAAM,CAAA;QACZ,gBAAgB,EAAE,OAAO,CAAA;KAC1B,EAAE,CAAA;IACH,MAAM,EAAE,OAAO,CAAA;CAChB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/collections/config/types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { GraphQLInputObjectType, GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { DeepRequired, IsAny, MarkOptional } from 'ts-essentials'\n\nimport type { CustomUpload, ViewTypes } from '../../admin/types.js'\nimport type { Arguments as MeArguments } from '../../auth/operations/me.js'\nimport type {\n Arguments as RefreshArguments,\n Result as RefreshResult,\n} from '../../auth/operations/refresh.js'\nimport type { Auth, ClientUser, IncomingAuthType } from '../../auth/types.js'\nimport type {\n Access,\n AfterErrorHookArgs,\n AfterErrorResult,\n CustomComponent,\n EditConfig,\n Endpoint,\n EntityDescription,\n EntityDescriptionComponent,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n MetaConfig,\n PayloadComponent,\n StaticLabel,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type {\n Field,\n FlattenedField,\n JoinField,\n RelationshipField,\n UploadField,\n} from '../../fields/config/types.js'\nimport type { CollectionFoldersConfiguration } from '../../folders/types.js'\nimport type {\n CollectionSlug,\n JsonObject,\n RequestContext,\n TypedAuthOperations,\n TypedCollection,\n TypedCollectionSelect,\n TypedLocale,\n} from '../../index.js'\nimport type {\n PayloadRequest,\n SelectIncludeType,\n SelectType,\n Sort,\n TransformCollectionWithSelect,\n Where,\n} from '../../types/index.js'\nimport type { SanitizedUploadConfig, UploadConfig } from '../../uploads/types.js'\nimport type {\n IncomingCollectionVersions,\n SanitizedCollectionVersions,\n} from '../../versions/types.js'\nimport type { AfterOperationArg, AfterOperationMap } from '../operations/utils.js'\n\nexport type DataFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollection[TSlug]\n\nexport type SelectFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollectionSelect[TSlug]\n\nexport type AuthOperationsFromCollectionSlug<TSlug extends CollectionSlug> =\n TypedAuthOperations[TSlug]\n\nexport type RequiredDataFromCollection<TData extends JsonObject> = MarkOptional<\n TData,\n 'createdAt' | 'deletedAt' | 'id' | 'sizes' | 'updatedAt'\n>\n\nexport type RequiredDataFromCollectionSlug<TSlug extends CollectionSlug> =\n RequiredDataFromCollection<DataFromCollectionSlug<TSlug>>\n\n/**\n * Helper type for draft data - makes all fields optional except auto-generated ones\n * When creating a draft, required fields don't need to be provided as validation is skipped\n */\nexport type DraftDataFromCollection<TData extends JsonObject> = Partial<\n MarkOptional<TData, 'createdAt' | 'deletedAt' | 'id' | 'sizes' | 'updatedAt'>\n>\n\nexport type DraftDataFromCollectionSlug<TSlug extends CollectionSlug> = DraftDataFromCollection<\n DataFromCollectionSlug<TSlug>\n>\n\nexport type HookOperationType =\n | 'autosave'\n | 'count'\n | 'countVersions'\n | 'create'\n | 'delete'\n | 'forgotPassword'\n | 'login'\n | 'read'\n | 'readDistinct'\n | 'refresh'\n | 'resetPassword'\n | 'restoreVersion'\n | 'update'\n\ntype CreateOrUpdateOperation = Extract<HookOperationType, 'create' | 'update'>\n\nexport type BeforeOperationHook = (args: {\n args?: any\n /**\n * The collection which this hook is being run on\n */\n collection: SanitizedCollectionConfig\n context: RequestContext\n /**\n * Hook operation being performed\n */\n operation: HookOperationType\n req: PayloadRequest\n}) => any\n\nexport type BeforeValidateHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data?: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type AfterChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n doc: T\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n previousDoc: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n query: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n findMany?: boolean\n query?: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type BeforeDeleteHook = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterDeleteHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterOperationHook<TOperationGeneric extends CollectionSlug = string> = (\n arg: AfterOperationArg<TOperationGeneric>,\n) =>\n | Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n | Promise<\n Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n >\n\nexport type BeforeLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n user: T\n}) => any\n\nexport type AfterLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n token: string\n user: T\n}) => any\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterLogoutHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n}) => any\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterMeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n response: unknown\n}) => any\n\nexport type RefreshHook<T extends TypeWithID = any> = (args: {\n args: RefreshArguments\n user: T\n}) => Promise<RefreshResult | void> | (RefreshResult | void)\n\nexport type MeHook<T extends TypeWithID = any> = (args: {\n args: MeArguments\n user: T\n}) => ({ exp: number; user: T } | void) | Promise<{ exp: number; user: T } | void>\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterRefreshHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n exp: number\n req: PayloadRequest\n token: string\n}) => any\n\nexport type AfterErrorHook = (\n args: { collection: SanitizedCollectionConfig } & AfterErrorHookArgs,\n) => AfterErrorResult | Promise<AfterErrorResult>\n\nexport type AfterForgotPasswordHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n}) => any\n\nexport type EnableFoldersOptions = {\n // Displays the folder collection and parentFolder field in the document view\n debug?: boolean\n}\n\nexport type BaseFilter = (args: {\n limit: number\n locale?: TypedLocale\n page: number\n req: PayloadRequest\n sort: string\n}) => null | Promise<null | Where> | Where\n\n/**\n * @deprecated Use `BaseFilter` instead.\n */\nexport type BaseListFilter = BaseFilter\n\nexport type CollectionAdminOptions = {\n /**\n * Defines a default base filter which will be applied in the following parts of the admin panel:\n * - List View\n * - Relationship fields for internal links within the Lexical editor\n *\n * This is especially useful for plugins like multi-tenant. For example,\n * a user may have access to multiple tenants, but should only see content\n * related to the currently active or selected tenant in those places.\n */\n baseFilter?: BaseFilter\n /**\n * @deprecated Use `baseFilter` instead. If both are defined,\n * `baseFilter` will take precedence. This property remains only\n * for backward compatibility and may be removed in a future version.\n *\n * Originally, `baseListFilter` was intended to filter only the List View\n * in the admin panel. However, base filtering is often required in other areas\n * such as internal link relationships in the Lexical editor.\n */\n baseListFilter?: BaseListFilter\n /**\n * Custom admin components\n */\n components?: {\n afterList?: CustomComponent[]\n afterListTable?: CustomComponent[]\n beforeList?: CustomComponent[]\n beforeListTable?: CustomComponent[]\n Description?: EntityDescriptionComponent\n /**\n * Components within the edit view\n */\n edit?: {\n /**\n * Inject custom components before the document controls\n */\n beforeDocumentControls?: CustomComponent[]\n /**\n * Inject custom components within the 3-dot menu dropdown\n */\n editMenuItems?: CustomComponent[]\n /**\n * Replaces the \"Preview\" button\n */\n PreviewButton?: CustomComponent\n /**\n * Replaces the \"Publish\" button\n * + drafts must be enabled\n */\n PublishButton?: CustomComponent\n /**\n * Replaces the \"Save\" button\n * + drafts must be disabled\n */\n SaveButton?: CustomComponent\n /**\n * Replaces the \"Save Draft\" button\n * + drafts must be enabled\n * + autosave must be disabled\n */\n SaveDraftButton?: CustomComponent\n /**\n * Replaces the \"Upload\" section\n * + upload must be enabled\n */\n Upload?: CustomUpload\n }\n listMenuItems?: CustomComponent[]\n views?: {\n /**\n * Replace, modify, or add new \"document\" views.\n * @link https://payloadcms.com/docs/custom-components/document-views\n */\n edit?: EditConfig\n /**\n * Replace or modify the \"list\" view.\n * @link https://payloadcms.com/docs/custom-components/list-view\n */\n list?: {\n actions?: CustomComponent[]\n Component?: PayloadComponent\n }\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /**\n * Default columns to show in list view\n */\n defaultColumns?: string[]\n /**\n * Custom description for collection. This will also be used as JSDoc for the generated types\n */\n description?: EntityDescription\n /**\n * Disable the Copy To Locale button in the edit document view\n * @default false\n */\n disableCopyToLocale?: boolean\n /**\n * Performance opt-in. If true, will use the [Select API](https://payloadcms.com/docs/queries/select) when\n * loading the list view to query only the active columns, as opposed to the entire documents.\n * If your cells require specific fields that may be unselected, such as within hooks, etc.,\n * use `forceSelect` in conjunction with this property.\n *\n * @experimental This is an experimental feature and may change in the future. Use at your own risk.\n */\n enableListViewSelectAPI?: boolean\n enableRichTextLink?: boolean\n enableRichTextRelationship?: boolean\n /**\n * Function to format the URL for document links in the list view.\n * Return null to disable linking for that document.\n * Return a string to customize the link destination.\n * If not provided, uses the default admin edit URL.\n */\n formatDocURL?: (args: {\n collectionSlug: string\n /**\n * The default URL that would normally be used for this document link.\n * You can return this as-is, modify it, or completely replace it.\n */\n defaultURL: string\n doc: Record<string, unknown>\n req: PayloadRequest\n /**\n * The current view context where the link is being generated.\n * Most relevant values for document linking are 'list' and 'trash'.\n */\n viewType?: ViewTypes\n }) => null | string\n /**\n * Specify a navigational group for collections in the admin sidebar.\n * - Provide a string to place the entity in a custom group.\n * - Provide a record to define localized group names.\n * - Set to `false` to exclude the entity from the sidebar / dashboard without disabling its routes.\n */\n group?: false | Record<string, string> | string\n /**\n * @description Enable grouping by a field in the list view.\n * Uses `payload.findDistinct` under the hood to populate the group-by options.\n *\n * @experimental This option is currently in beta and may change in future releases. Use at your own risk.\n */\n groupBy?: boolean\n /**\n * Exclude the collection from the admin nav and routes\n */\n hidden?: ((args: { user: ClientUser }) => boolean) | boolean\n /**\n * Hide the API URL within the Edit view\n */\n hideAPIURL?: boolean\n /**\n * Additional fields to be searched via the full text search\n */\n listSearchableFields?: string[]\n /**\n * Live Preview options.\n *\n * @see https://payloadcms.com/docs/live-preview/overview\n */\n livePreview?: LivePreviewConfig\n meta?: MetaConfig\n pagination?: {\n defaultLimit?: number\n limits?: number[]\n }\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n /**\n * Field to use as title in Edit View and first column in List view\n */\n useAsTitle?: string\n}\n\n/** Manage all aspects of a data collection */\nexport type CollectionConfig<TSlug extends CollectionSlug = any> = {\n /**\n * Do not set this property manually. This is set to true during sanitization, to avoid\n * sanitizing the same collection multiple times.\n */\n _sanitized?: boolean\n /**\n * Access control\n */\n access?: {\n admin?: ({ req }: { req: PayloadRequest }) => boolean | Promise<boolean>\n create?: Access\n delete?: Access\n read?: Access\n readVersions?: Access\n unlock?: Access\n update?: Access\n }\n /**\n * Collection admin options\n */\n admin?: CollectionAdminOptions\n /**\n * Collection login options\n *\n * Use `true` to enable with default options\n */\n auth?: boolean | IncomingAuthType\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /**\n * Used to override the default naming of the database table or collection with your using a function or string\n * @WARNING: If you change this property with existing data, you will need to handle the renaming of the table in your database or by using migrations\n */\n dbName?: DBIdentifierName\n defaultPopulate?: IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectType\n : SelectFromCollectionSlug<TSlug>\n /**\n * Default field to sort by in collection list view\n */\n defaultSort?: Sort\n /**\n * Disable the bulk edit operation for the collection in the admin panel and the API\n */\n disableBulkEdit?: boolean\n /**\n * When true, do not show the \"Duplicate\" button while editing documents within this collection and prevent `duplicate` from all APIs\n */\n disableDuplicate?: boolean\n /**\n * Opt-in to enable query presets for this collection.\n * @see https://payloadcms.com/docs/query-presets/overview\n */\n enableQueryPresets?: boolean\n /**\n * Custom rest api endpoints, set false to disable all rest endpoints for this collection.\n */\n endpoints?: false | Omit<Endpoint, 'root'>[]\n fields: Field[]\n /**\n * Enables folders for this collection\n */\n folders?: boolean | CollectionFoldersConfiguration\n /**\n * Specify which fields should be selected always, regardless of the `select` query which can be useful that the field exists for access control / hooks\n */\n forceSelect?: IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectIncludeType\n : SelectFromCollectionSlug<TSlug>\n /**\n * GraphQL configuration\n */\n graphQL?:\n | {\n disableMutations?: true\n disableQueries?: true\n pluralName?: string\n singularName?: string\n }\n | false\n /**\n * Hooks to modify Payload functionality\n */\n hooks?: {\n afterChange?: AfterChangeHook[]\n afterDelete?: AfterDeleteHook[]\n afterError?: AfterErrorHook[]\n afterForgotPassword?: AfterForgotPasswordHook[]\n afterLogin?: AfterLoginHook[]\n afterLogout?: AfterLogoutHook[]\n afterMe?: AfterMeHook[]\n afterOperation?: AfterOperationHook<TSlug>[]\n afterRead?: AfterReadHook[]\n afterRefresh?: AfterRefreshHook[]\n beforeChange?: BeforeChangeHook[]\n beforeDelete?: BeforeDeleteHook[]\n beforeLogin?: BeforeLoginHook[]\n beforeOperation?: BeforeOperationHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n /**\n /**\n * Use the `me` hook to control the `me` operation.\n * Here, you can optionally instruct the me operation to return early,\n * and skip its default logic.\n */\n me?: MeHook[]\n /**\n * Use the `refresh` hook to control the refresh operation.\n * Here, you can optionally instruct the refresh operation to return early,\n * and skip its default logic.\n */\n refresh?: RefreshHook[]\n }\n /**\n * Define compound indexes for this collection.\n * This can be used to either speed up querying/sorting by 2 or more fields at the same time or\n * to ensure uniqueness between several fields.\n * Specify field paths\n * @example\n * [{ unique: true, fields: ['title', 'group.name'] }]\n * @default []\n */\n indexes?: CompoundIndex[]\n /**\n * Label configuration\n */\n labels?: {\n plural?: LabelFunction | StaticLabel\n singular?: LabelFunction | StaticLabel\n }\n /**\n * Enables / Disables the ability to lock documents while editing\n * @default true\n */\n lockDocuments?:\n | {\n duration: number\n }\n | false\n /**\n * If true, enables custom ordering for the collection, and documents in the listView can be reordered via drag and drop.\n * New documents are inserted at the end of the list according to this parameter.\n *\n * Under the hood, a field with {@link https://observablehq.com/@dgreensp/implementing-fractional-indexing|fractional indexing} is used to optimize inserts and reorderings.\n *\n * @default false\n *\n * @experimental There may be frequent breaking changes to this API\n */\n orderable?: boolean\n slug: string\n /**\n * Add `createdAt`, `deletedAt` and `updatedAt` fields\n *\n * @default true\n */\n timestamps?: boolean\n /**\n * Enables trash support for this collection.\n *\n * When enabled, documents will include a `deletedAt` timestamp field.\n * This allows documents to be marked as deleted without being permanently removed.\n * The `deletedAt` field will be set to the current date and time when a document is trashed.\n *\n * @experimental This is a beta feature and its behavior may be refined in future releases.\n * @default false\n */\n trash?: boolean\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable uploads\n */\n upload?: boolean | UploadConfig\n /**\n * Enable versioning. Set it to true to enable default versions settings,\n * or customize versions options by setting the property equal to an object\n * containing the version options.\n *\n * @default false // disable versioning\n */\n versions?: boolean | IncomingCollectionVersions\n}\n\nexport type SanitizedJoin = {\n /**\n * The field configuration defining the join\n */\n field: JoinField\n getForeignPath?(args: { locale?: TypedLocale }): string\n /**\n * The path of the join field in dot notation\n */\n joinPath: string\n /**\n * `parentIsLocalized` is true if any parent field of the\n * field configuration defining the join is localized\n */\n parentIsLocalized: boolean\n targetField: RelationshipField | UploadField\n}\n\nexport type SanitizedJoins = {\n [collectionSlug: string]: SanitizedJoin[]\n}\n\n/**\n * @todo remove the `DeepRequired` in v4.\n * We don't actually guarantee that all properties are set when sanitizing configs.\n */\nexport interface SanitizedCollectionConfig\n extends Omit<\n DeepRequired<CollectionConfig>,\n 'admin' | 'auth' | 'endpoints' | 'fields' | 'folders' | 'slug' | 'upload' | 'versions'\n > {\n admin: CollectionAdminOptions\n auth: Auth\n endpoints: Endpoint[] | false\n fields: Field[]\n /**\n * Fields in the database schema structure\n * Rows / collapsible / tabs w/o name `fields` merged to top, UIs are excluded\n */\n flattenedFields: FlattenedField[]\n /**\n * Object of collections to join 'Join Fields object keyed by collection\n */\n folders: CollectionFoldersConfiguration | false\n joins: SanitizedJoins\n\n /**\n * List of all polymorphic join fields\n */\n polymorphicJoins: SanitizedJoin[]\n\n sanitizedIndexes: SanitizedCompoundIndex[]\n\n slug: CollectionSlug\n upload: SanitizedUploadConfig\n versions: SanitizedCollectionVersions\n}\n\nexport type Collection = {\n config: SanitizedCollectionConfig\n customIDType?: 'number' | 'text'\n graphQL?: {\n countType: GraphQLObjectType\n JWT: GraphQLObjectType\n mutationInputType: GraphQLNonNull<any>\n paginatedType: GraphQLObjectType\n type: GraphQLObjectType\n updateMutationInputType: GraphQLNonNull<any>\n versionType: GraphQLObjectType\n whereInputType: GraphQLInputObjectType\n }\n}\n\nexport type BulkOperationResult<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n docs: TransformCollectionWithSelect<TSlug, TSelect>[]\n errors: {\n id: DataFromCollectionSlug<TSlug>['id']\n isPublic: boolean\n message: string\n }[]\n}\n\nexport type AuthCollection = {\n config: SanitizedCollectionConfig\n}\n\nexport type LocalizedMeta = {\n [locale: string]: {\n status: 'draft' | 'published'\n updatedAt: string\n }\n}\n\nexport type TypeWithID = {\n id: number | string\n}\n\nexport type TypeWithTimestamps = {\n [key: string]: unknown\n createdAt: string\n deletedAt?: null | string\n id: number | string\n updatedAt: string\n}\n\nexport type CompoundIndex = {\n fields: string[]\n unique?: boolean\n}\n\nexport type SanitizedCompoundIndex = {\n fields: {\n field: FlattenedField\n localizedPath: string\n path: string\n pathHasLocalized: boolean\n }[]\n unique: boolean\n}\n"],"names":[],"mappings":"AAAA,qDAAqD,GAgxBrD,WAQC"}
1
+ {"version":3,"sources":["../../../src/collections/config/types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { GraphQLInputObjectType, GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { DeepRequired, IsAny, MarkOptional } from 'ts-essentials'\n\nimport type { CustomUpload, ViewTypes } from '../../admin/types.js'\nimport type { Arguments as MeArguments } from '../../auth/operations/me.js'\nimport type {\n Arguments as RefreshArguments,\n Result as RefreshResult,\n} from '../../auth/operations/refresh.js'\nimport type { Auth, ClientUser, IncomingAuthType } from '../../auth/types.js'\nimport type {\n Access,\n AfterErrorHookArgs,\n AfterErrorResult,\n CustomComponent,\n EditConfig,\n Endpoint,\n EntityDescription,\n EntityDescriptionComponent,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n MetaConfig,\n PayloadComponent,\n StaticLabel,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type {\n Field,\n FlattenedField,\n JoinField,\n RelationshipField,\n UploadField,\n} from '../../fields/config/types.js'\nimport type { CollectionFoldersConfiguration } from '../../folders/types.js'\nimport type {\n CollectionAdminCustom,\n CollectionCustom,\n CollectionSlug,\n JsonObject,\n RequestContext,\n TypedAuthOperations,\n TypedCollection,\n TypedCollectionSelect,\n TypedLocale,\n} from '../../index.js'\nimport type {\n PayloadRequest,\n SelectIncludeType,\n SelectType,\n Sort,\n TransformCollectionWithSelect,\n Where,\n} from '../../types/index.js'\nimport type { SanitizedUploadConfig, UploadConfig } from '../../uploads/types.js'\nimport type {\n IncomingCollectionVersions,\n SanitizedCollectionVersions,\n} from '../../versions/types.js'\nimport type { AfterOperationArg, AfterOperationMap } from '../operations/utils.js'\n\nexport type DataFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollection[TSlug]\n\nexport type SelectFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollectionSelect[TSlug]\n\nexport type AuthOperationsFromCollectionSlug<TSlug extends CollectionSlug> =\n TypedAuthOperations[TSlug]\n\nexport type RequiredDataFromCollection<TData extends JsonObject> = MarkOptional<\n TData,\n 'createdAt' | 'deletedAt' | 'id' | 'sizes' | 'updatedAt'\n>\n\nexport type RequiredDataFromCollectionSlug<TSlug extends CollectionSlug> =\n RequiredDataFromCollection<DataFromCollectionSlug<TSlug>>\n\n/**\n * Helper type for draft data - makes all fields optional except auto-generated ones\n * When creating a draft, required fields don't need to be provided as validation is skipped\n */\nexport type DraftDataFromCollection<TData extends JsonObject> = Partial<\n MarkOptional<TData, 'createdAt' | 'deletedAt' | 'id' | 'sizes' | 'updatedAt'>\n>\n\nexport type DraftDataFromCollectionSlug<TSlug extends CollectionSlug> = DraftDataFromCollection<\n DataFromCollectionSlug<TSlug>\n>\n\nexport type HookOperationType =\n | 'autosave'\n | 'count'\n | 'countVersions'\n | 'create'\n | 'delete'\n | 'forgotPassword'\n | 'login'\n | 'read'\n | 'readDistinct'\n | 'refresh'\n | 'resetPassword'\n | 'restoreVersion'\n | 'update'\n\ntype CreateOrUpdateOperation = Extract<HookOperationType, 'create' | 'update'>\n\nexport type BeforeOperationHook = (args: {\n args?: any\n /**\n * The collection which this hook is being run on\n */\n collection: SanitizedCollectionConfig\n context: RequestContext\n /**\n * Hook operation being performed\n */\n operation: HookOperationType\n req: PayloadRequest\n}) => any\n\nexport type BeforeValidateHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data?: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type AfterChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n doc: T\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n previousDoc: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n query: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n findMany?: boolean\n query?: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type BeforeDeleteHook = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterDeleteHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterOperationHook<TOperationGeneric extends CollectionSlug = string> = (\n arg: AfterOperationArg<TOperationGeneric>,\n) =>\n | Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n | Promise<\n Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n >\n\nexport type BeforeLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n user: T\n}) => any\n\nexport type AfterLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n token: string\n user: T\n}) => any\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterLogoutHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n}) => any\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterMeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n response: unknown\n}) => any\n\nexport type RefreshHook<T extends TypeWithID = any> = (args: {\n args: RefreshArguments\n user: T\n}) => Promise<RefreshResult | void> | (RefreshResult | void)\n\nexport type MeHook<T extends TypeWithID = any> = (args: {\n args: MeArguments\n user: T\n}) => ({ exp: number; user: T } | void) | Promise<{ exp: number; user: T } | void>\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterRefreshHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n exp: number\n req: PayloadRequest\n token: string\n}) => any\n\nexport type AfterErrorHook = (\n args: { collection: SanitizedCollectionConfig } & AfterErrorHookArgs,\n) => AfterErrorResult | Promise<AfterErrorResult>\n\nexport type AfterForgotPasswordHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n}) => any\n\nexport type EnableFoldersOptions = {\n // Displays the folder collection and parentFolder field in the document view\n debug?: boolean\n}\n\nexport type BaseFilter = (args: {\n limit: number\n locale?: TypedLocale\n page: number\n req: PayloadRequest\n sort: string\n}) => null | Promise<null | Where> | Where\n\n/**\n * @deprecated Use `BaseFilter` instead.\n */\nexport type BaseListFilter = BaseFilter\n\nexport type CollectionAdminOptions = {\n /**\n * Defines a default base filter which will be applied in the following parts of the admin panel:\n * - List View\n * - Relationship fields for internal links within the Lexical editor\n *\n * This is especially useful for plugins like multi-tenant. For example,\n * a user may have access to multiple tenants, but should only see content\n * related to the currently active or selected tenant in those places.\n */\n baseFilter?: BaseFilter\n /**\n * @deprecated Use `baseFilter` instead. If both are defined,\n * `baseFilter` will take precedence. This property remains only\n * for backward compatibility and may be removed in a future version.\n *\n * Originally, `baseListFilter` was intended to filter only the List View\n * in the admin panel. However, base filtering is often required in other areas\n * such as internal link relationships in the Lexical editor.\n */\n baseListFilter?: BaseListFilter\n /**\n * Custom admin components\n */\n components?: {\n afterList?: CustomComponent[]\n afterListTable?: CustomComponent[]\n beforeList?: CustomComponent[]\n beforeListTable?: CustomComponent[]\n Description?: EntityDescriptionComponent\n /**\n * Components within the edit view\n */\n edit?: {\n /**\n * Inject custom components before the document controls\n */\n beforeDocumentControls?: CustomComponent[]\n /**\n * Inject custom components within the 3-dot menu dropdown\n */\n editMenuItems?: CustomComponent[]\n /**\n * Replaces the \"Preview\" button\n */\n PreviewButton?: CustomComponent\n /**\n * Replaces the \"Publish\" button\n * + drafts must be enabled\n */\n PublishButton?: CustomComponent\n /**\n * Replaces the \"Save\" button\n * + drafts must be disabled\n */\n SaveButton?: CustomComponent\n /**\n * Replaces the \"Save Draft\" button\n * + drafts must be enabled\n * + autosave must be disabled\n */\n SaveDraftButton?: CustomComponent\n /**\n * Replaces the \"Upload\" section\n * + upload must be enabled\n */\n Upload?: CustomUpload\n }\n listMenuItems?: CustomComponent[]\n views?: {\n /**\n * Replace, modify, or add new \"document\" views.\n * @link https://payloadcms.com/docs/custom-components/document-views\n */\n edit?: EditConfig\n /**\n * Replace or modify the \"list\" view.\n * @link https://payloadcms.com/docs/custom-components/list-view\n */\n list?: {\n actions?: CustomComponent[]\n Component?: PayloadComponent\n }\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: CollectionAdminCustom\n /**\n * Default columns to show in list view\n */\n defaultColumns?: string[]\n /**\n * Custom description for collection. This will also be used as JSDoc for the generated types\n */\n description?: EntityDescription\n /**\n * Disable the Copy To Locale button in the edit document view\n * @default false\n */\n disableCopyToLocale?: boolean\n /**\n * Performance opt-in. If true, will use the [Select API](https://payloadcms.com/docs/queries/select) when\n * loading the list view to query only the active columns, as opposed to the entire documents.\n * If your cells require specific fields that may be unselected, such as within hooks, etc.,\n * use `forceSelect` in conjunction with this property.\n *\n * @experimental This is an experimental feature and may change in the future. Use at your own risk.\n */\n enableListViewSelectAPI?: boolean\n enableRichTextLink?: boolean\n enableRichTextRelationship?: boolean\n /**\n * Function to format the URL for document links in the list view.\n * Return null to disable linking for that document.\n * Return a string to customize the link destination.\n * If not provided, uses the default admin edit URL.\n */\n formatDocURL?: (args: {\n collectionSlug: string\n /**\n * The default URL that would normally be used for this document link.\n * You can return this as-is, modify it, or completely replace it.\n */\n defaultURL: string\n doc: Record<string, unknown>\n req: PayloadRequest\n /**\n * The current view context where the link is being generated.\n * Most relevant values for document linking are 'list' and 'trash'.\n */\n viewType?: ViewTypes\n }) => null | string\n /**\n * Specify a navigational group for collections in the admin sidebar.\n * - Provide a string to place the entity in a custom group.\n * - Provide a record to define localized group names.\n * - Set to `false` to exclude the entity from the sidebar / dashboard without disabling its routes.\n */\n group?: false | Record<string, string> | string\n /**\n * @description Enable grouping by a field in the list view.\n * Uses `payload.findDistinct` under the hood to populate the group-by options.\n *\n * @experimental This option is currently in beta and may change in future releases. Use at your own risk.\n */\n groupBy?: boolean\n /**\n * Exclude the collection from the admin nav and routes\n */\n hidden?: ((args: { user: ClientUser }) => boolean) | boolean\n /**\n * Hide the API URL within the Edit view\n */\n hideAPIURL?: boolean\n /**\n * Additional fields to be searched via the full text search\n */\n listSearchableFields?: string[]\n /**\n * Live Preview options.\n *\n * @see https://payloadcms.com/docs/live-preview/overview\n */\n livePreview?: LivePreviewConfig\n meta?: MetaConfig\n pagination?: {\n defaultLimit?: number\n limits?: number[]\n }\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n /**\n * Field to use as title in Edit View and first column in List view\n */\n useAsTitle?: string\n}\n\n/** Manage all aspects of a data collection */\nexport type CollectionConfig<TSlug extends CollectionSlug = any> = {\n /**\n * Do not set this property manually. This is set to true during sanitization, to avoid\n * sanitizing the same collection multiple times.\n */\n _sanitized?: boolean\n /**\n * Access control\n */\n access?: {\n admin?: ({ req }: { req: PayloadRequest }) => boolean | Promise<boolean>\n create?: Access\n delete?: Access\n read?: Access\n readVersions?: Access\n unlock?: Access\n update?: Access\n }\n /**\n * Collection admin options\n */\n admin?: CollectionAdminOptions\n /**\n * Collection login options\n *\n * Use `true` to enable with default options\n */\n auth?: boolean | IncomingAuthType\n /** Extension point to add your custom data. Server only. */\n custom?: CollectionCustom\n /**\n * Used to override the default naming of the database table or collection with your using a function or string\n * @WARNING: If you change this property with existing data, you will need to handle the renaming of the table in your database or by using migrations\n */\n dbName?: DBIdentifierName\n defaultPopulate?: IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectType\n : SelectFromCollectionSlug<TSlug>\n /**\n * Default field to sort by in collection list view\n */\n defaultSort?: Sort\n /**\n * Disable the bulk edit operation for the collection in the admin panel and the API\n */\n disableBulkEdit?: boolean\n /**\n * When true, do not show the \"Duplicate\" button while editing documents within this collection and prevent `duplicate` from all APIs\n */\n disableDuplicate?: boolean\n /**\n * Opt-in to enable query presets for this collection.\n * @see https://payloadcms.com/docs/query-presets/overview\n */\n enableQueryPresets?: boolean\n /**\n * Custom rest api endpoints, set false to disable all rest endpoints for this collection.\n */\n endpoints?: false | Omit<Endpoint, 'root'>[]\n fields: Field[]\n /**\n * Enables folders for this collection\n */\n folders?: boolean | CollectionFoldersConfiguration\n /**\n * Specify which fields should be selected always, regardless of the `select` query which can be useful that the field exists for access control / hooks\n */\n forceSelect?: IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectIncludeType\n : SelectFromCollectionSlug<TSlug>\n /**\n * GraphQL configuration\n */\n graphQL?:\n | {\n disableMutations?: true\n disableQueries?: true\n pluralName?: string\n singularName?: string\n }\n | false\n /**\n * Hooks to modify Payload functionality\n */\n hooks?: {\n afterChange?: AfterChangeHook[]\n afterDelete?: AfterDeleteHook[]\n afterError?: AfterErrorHook[]\n afterForgotPassword?: AfterForgotPasswordHook[]\n afterLogin?: AfterLoginHook[]\n afterLogout?: AfterLogoutHook[]\n afterMe?: AfterMeHook[]\n afterOperation?: AfterOperationHook<TSlug>[]\n afterRead?: AfterReadHook[]\n afterRefresh?: AfterRefreshHook[]\n beforeChange?: BeforeChangeHook[]\n beforeDelete?: BeforeDeleteHook[]\n beforeLogin?: BeforeLoginHook[]\n beforeOperation?: BeforeOperationHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n /**\n /**\n * Use the `me` hook to control the `me` operation.\n * Here, you can optionally instruct the me operation to return early,\n * and skip its default logic.\n */\n me?: MeHook[]\n /**\n * Use the `refresh` hook to control the refresh operation.\n * Here, you can optionally instruct the refresh operation to return early,\n * and skip its default logic.\n */\n refresh?: RefreshHook[]\n }\n /**\n * Define compound indexes for this collection.\n * This can be used to either speed up querying/sorting by 2 or more fields at the same time or\n * to ensure uniqueness between several fields.\n * Specify field paths\n * @example\n * [{ unique: true, fields: ['title', 'group.name'] }]\n * @default []\n */\n indexes?: CompoundIndex[]\n /**\n * Label configuration\n */\n labels?: {\n plural?: LabelFunction | StaticLabel\n singular?: LabelFunction | StaticLabel\n }\n /**\n * Enables / Disables the ability to lock documents while editing\n * @default true\n */\n lockDocuments?:\n | {\n duration: number\n }\n | false\n /**\n * If true, enables custom ordering for the collection, and documents in the listView can be reordered via drag and drop.\n * New documents are inserted at the end of the list according to this parameter.\n *\n * Under the hood, a field with {@link https://observablehq.com/@dgreensp/implementing-fractional-indexing|fractional indexing} is used to optimize inserts and reorderings.\n *\n * @default false\n *\n * @experimental There may be frequent breaking changes to this API\n */\n orderable?: boolean\n slug: string\n /**\n * Add `createdAt`, `deletedAt` and `updatedAt` fields\n *\n * @default true\n */\n timestamps?: boolean\n /**\n * Enables trash support for this collection.\n *\n * When enabled, documents will include a `deletedAt` timestamp field.\n * This allows documents to be marked as deleted without being permanently removed.\n * The `deletedAt` field will be set to the current date and time when a document is trashed.\n *\n * @experimental This is a beta feature and its behavior may be refined in future releases.\n * @default false\n */\n trash?: boolean\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable uploads\n */\n upload?: boolean | UploadConfig\n /**\n * Enable versioning. Set it to true to enable default versions settings,\n * or customize versions options by setting the property equal to an object\n * containing the version options.\n *\n * @default false // disable versioning\n */\n versions?: boolean | IncomingCollectionVersions\n}\n\nexport type SanitizedJoin = {\n /**\n * The field configuration defining the join\n */\n field: JoinField\n getForeignPath?(args: { locale?: TypedLocale }): string\n /**\n * The path of the join field in dot notation\n */\n joinPath: string\n /**\n * `parentIsLocalized` is true if any parent field of the\n * field configuration defining the join is localized\n */\n parentIsLocalized: boolean\n targetField: RelationshipField | UploadField\n}\n\nexport type SanitizedJoins = {\n [collectionSlug: string]: SanitizedJoin[]\n}\n\n/**\n * @todo remove the `DeepRequired` in v4.\n * We don't actually guarantee that all properties are set when sanitizing configs.\n */\nexport interface SanitizedCollectionConfig\n extends Omit<\n DeepRequired<CollectionConfig>,\n 'admin' | 'auth' | 'endpoints' | 'fields' | 'folders' | 'slug' | 'upload' | 'versions'\n > {\n admin: CollectionAdminOptions\n auth: Auth\n endpoints: Endpoint[] | false\n fields: Field[]\n /**\n * Fields in the database schema structure\n * Rows / collapsible / tabs w/o name `fields` merged to top, UIs are excluded\n */\n flattenedFields: FlattenedField[]\n /**\n * Object of collections to join 'Join Fields object keyed by collection\n */\n folders: CollectionFoldersConfiguration | false\n joins: SanitizedJoins\n\n /**\n * List of all polymorphic join fields\n */\n polymorphicJoins: SanitizedJoin[]\n\n sanitizedIndexes: SanitizedCompoundIndex[]\n\n slug: CollectionSlug\n upload: SanitizedUploadConfig\n versions: SanitizedCollectionVersions\n}\n\nexport type Collection = {\n config: SanitizedCollectionConfig\n customIDType?: 'number' | 'text'\n graphQL?: {\n countType: GraphQLObjectType\n JWT: GraphQLObjectType\n mutationInputType: GraphQLNonNull<any>\n paginatedType: GraphQLObjectType\n type: GraphQLObjectType\n updateMutationInputType: GraphQLNonNull<any>\n versionType: GraphQLObjectType\n whereInputType: GraphQLInputObjectType\n }\n}\n\nexport type BulkOperationResult<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n docs: TransformCollectionWithSelect<TSlug, TSelect>[]\n errors: {\n id: DataFromCollectionSlug<TSlug>['id']\n isPublic: boolean\n message: string\n }[]\n}\n\nexport type AuthCollection = {\n config: SanitizedCollectionConfig\n}\n\nexport type LocalizedMeta = {\n [locale: string]: {\n status: 'draft' | 'published'\n updatedAt: string\n }\n}\n\nexport type TypeWithID = {\n id: number | string\n}\n\nexport type TypeWithTimestamps = {\n [key: string]: unknown\n createdAt: string\n deletedAt?: null | string\n id: number | string\n updatedAt: string\n}\n\nexport type CompoundIndex = {\n fields: string[]\n unique?: boolean\n}\n\nexport type SanitizedCompoundIndex = {\n fields: {\n field: FlattenedField\n localizedPath: string\n path: string\n pathHasLocalized: boolean\n }[]\n unique: boolean\n}\n"],"names":[],"mappings":"AAAA,qDAAqD,GAkxBrD,WAQC"}
@@ -1 +1 @@
1
- {"version":3,"file":"countVersions.d.ts","sourceRoot":"","sources":["../../../src/collections/operations/countVersions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAMpD,OAAO,EAAgC,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAIlF,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAGD,eAAO,MAAM,sBAAsB,GAAU,KAAK,SAAS,cAAc,gBACzD,SAAS,KACtB,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CA6F/B,CAAA"}
1
+ {"version":3,"file":"countVersions.d.ts","sourceRoot":"","sources":["../../../src/collections/operations/countVersions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAMpD,OAAO,EAAgC,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAIlF,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAGD,eAAO,MAAM,sBAAsB,GAAU,KAAK,SAAS,cAAc,gBACzD,SAAS,KACtB,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CA8F/B,CAAA"}
@@ -24,7 +24,7 @@ export const countVersionsOperation = async (incomingArgs)=>{
24
24
  }
25
25
  }
26
26
  const { collection: { config: collectionConfig }, disableErrors, overrideAccess, req, where } = args;
27
- const { payload } = req;
27
+ const { locale, payload } = req;
28
28
  // /////////////////////////////////////
29
29
  // Access
30
30
  // /////////////////////////////////////
@@ -58,6 +58,7 @@ export const countVersionsOperation = async (incomingArgs)=>{
58
58
  });
59
59
  result = await payload.db.countVersions({
60
60
  collection: collectionConfig.slug,
61
+ locale: locale,
61
62
  req,
62
63
  where: fullWhere
63
64
  });