payload 3.0.0-beta.19 → 3.0.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/elements/Tab.d.ts +3 -0
- package/dist/admin/elements/Tab.d.ts.map +1 -1
- package/dist/admin/elements/Tab.js.map +1 -1
- package/dist/auth/operations/forgotPassword.js +3 -2
- package/dist/auth/operations/forgotPassword.js.map +1 -1
- package/dist/auth/sendVerificationEmail.js +3 -2
- package/dist/auth/sendVerificationEmail.js.map +1 -1
- package/dist/collections/config/sanitize.d.ts +1 -2
- package/dist/collections/config/sanitize.d.ts.map +1 -1
- package/dist/collections/config/sanitize.js +1 -2
- package/dist/collections/config/sanitize.js.map +1 -1
- package/dist/collections/config/schema.d.ts.map +1 -1
- package/dist/collections/config/schema.js +1 -0
- package/dist/collections/config/schema.js.map +1 -1
- package/dist/config/sanitize.d.ts.map +1 -1
- package/dist/config/sanitize.js +8 -2
- package/dist/config/sanitize.js.map +1 -1
- package/dist/config/schema.js +1 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/config/types.d.ts +7 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js.map +1 -1
- package/dist/email/consoleEmailAdapter.d.ts.map +1 -1
- package/dist/email/consoleEmailAdapter.js +1 -0
- package/dist/email/consoleEmailAdapter.js.map +1 -1
- package/dist/email/types.d.ts +1 -0
- package/dist/email/types.d.ts.map +1 -1
- package/dist/email/types.js.map +1 -1
- package/dist/uploads/types.d.ts +4 -0
- package/dist/uploads/types.d.ts.map +1 -1
- package/dist/uploads/types.js.map +1 -1
- package/dist/utilities/createLocalReq.d.ts.map +1 -1
- package/dist/utilities/createLocalReq.js +3 -1
- package/dist/utilities/createLocalReq.js.map +1 -1
- package/dist/utilities/telemetry/index.d.ts +7 -1
- package/dist/utilities/telemetry/index.d.ts.map +1 -1
- package/dist/utilities/telemetry/index.js +41 -19
- package/dist/utilities/telemetry/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { I18n } from '@payloadcms/translations';
|
|
2
|
+
import type { Permissions } from '../../auth/types.js';
|
|
2
3
|
import type { SanitizedCollectionConfig } from '../../collections/config/types.js';
|
|
3
4
|
import type { SanitizedConfig } from '../../config/types.js';
|
|
4
5
|
import type { SanitizedGlobalConfig } from '../../globals/config/types.js';
|
|
@@ -8,11 +9,13 @@ export type DocumentTabProps = {
|
|
|
8
9
|
config: SanitizedConfig;
|
|
9
10
|
globalConfig?: SanitizedGlobalConfig;
|
|
10
11
|
i18n: I18n;
|
|
12
|
+
permissions: Permissions;
|
|
11
13
|
};
|
|
12
14
|
export type DocumentTabCondition = (args: {
|
|
13
15
|
collectionConfig: SanitizedCollectionConfig;
|
|
14
16
|
config: SanitizedConfig;
|
|
15
17
|
globalConfig: SanitizedGlobalConfig;
|
|
18
|
+
permissions: Permissions;
|
|
16
19
|
}) => boolean;
|
|
17
20
|
export type DocumentTabConfig = {
|
|
18
21
|
Pill?: React.ComponentType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../../src/admin/elements/Tab.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAEpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAE1E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gBAAgB,CAAC,EAAE,yBAAyB,CAAA;IAC5C,MAAM,EAAE,eAAe,CAAA;IACvB,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,IAAI,EAAE,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"Tab.d.ts","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AAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,GAAG,OAAO,CAAA;IAC1D,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE;QAAE,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC,GAAG,MAAM,CAAA;IACnE,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAAC;IACrD,IAAI,EAAE,MAAM,CAAA;CACb,CAAC,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAAG,iBAAiB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/admin/elements/Tab.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\n\nimport type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type { SanitizedConfig } from '../../config/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\n\nexport type DocumentTabProps = {\n apiURL?: string\n collectionConfig?: SanitizedCollectionConfig\n config: SanitizedConfig\n globalConfig?: SanitizedGlobalConfig\n i18n: I18n\n}\n\nexport type DocumentTabCondition = (args: {\n collectionConfig: SanitizedCollectionConfig\n config: SanitizedConfig\n globalConfig: SanitizedGlobalConfig\n}) => boolean\n\n// Everything is optional because we merge in the defaults\n// i.e. the config may override the `Default` view with a `label` but not an `href`\nexport type DocumentTabConfig = {\n Pill?: React.ComponentType\n condition?: DocumentTabCondition\n href?:\n | ((args: {\n apiURL: string\n collection: SanitizedCollectionConfig\n global: SanitizedGlobalConfig\n id?: string\n routes: SanitizedConfig['routes']\n }) => string)\n | string\n isActive?: ((args: { href: string }) => boolean) | boolean\n label?: ((args: { t: (key: string) => string }) => string) | string\n newTab?: boolean\n}\n\nexport type DocumentTabComponent = React.ComponentType<{\n path: string\n}>\n\nexport type DocumentTab = DocumentTabComponent | DocumentTabConfig\n"],"names":[],"rangeMappings":"","mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/elements/Tab.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\n\nimport type { Permissions } from '../../auth/types.js'\nimport type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type { SanitizedConfig } from '../../config/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\n\nexport type DocumentTabProps = {\n apiURL?: string\n collectionConfig?: SanitizedCollectionConfig\n config: SanitizedConfig\n globalConfig?: SanitizedGlobalConfig\n i18n: I18n\n permissions: Permissions\n}\n\nexport type DocumentTabCondition = (args: {\n collectionConfig: SanitizedCollectionConfig\n config: SanitizedConfig\n globalConfig: SanitizedGlobalConfig\n permissions: Permissions\n}) => boolean\n\n// Everything is optional because we merge in the defaults\n// i.e. the config may override the `Default` view with a `label` but not an `href`\nexport type DocumentTabConfig = {\n Pill?: React.ComponentType\n condition?: DocumentTabCondition\n href?:\n | ((args: {\n apiURL: string\n collection: SanitizedCollectionConfig\n global: SanitizedGlobalConfig\n id?: string\n routes: SanitizedConfig['routes']\n }) => string)\n | string\n isActive?: ((args: { href: string }) => boolean) | boolean\n label?: ((args: { t: (key: string) => string }) => string) | string\n newTab?: boolean\n}\n\nexport type DocumentTabComponent = React.ComponentType<{\n path: string\n}>\n\nexport type DocumentTab = DocumentTabComponent | DocumentTabConfig\n"],"names":[],"rangeMappings":"","mappings":"AA8CA,WAAkE"}
|
|
@@ -57,8 +57,9 @@ export const forgotPasswordOperation = async (incomingArgs)=>{
|
|
|
57
57
|
req
|
|
58
58
|
});
|
|
59
59
|
if (!disableEmail) {
|
|
60
|
-
const protocol = new URL(req.url).protocol
|
|
61
|
-
|
|
60
|
+
const protocol = new URL(req.url).protocol // includes the final :
|
|
61
|
+
;
|
|
62
|
+
const serverURL = config.serverURL !== null && config.serverURL !== '' ? config.serverURL : `${protocol}//${req.headers.get('host')}`;
|
|
62
63
|
let html = `${req.t('authentication:youAreReceivingResetPassword')}
|
|
63
64
|
<a href="${serverURL}${config.routes.admin}/reset/${token}">
|
|
64
65
|
${serverURL}${config.routes.admin}/reset/${token}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/auth/operations/forgotPassword.ts"],"sourcesContent":["import crypto from 'crypto'\nimport httpStatus from 'http-status'\nimport { URL } from 'url'\n\nimport type { Collection } from '../../collections/config/types.js'\nimport type { PayloadRequestWithData } from '../../types/index.js'\n\nimport { buildAfterOperation } from '../../collections/operations/utils.js'\nimport { APIError } from '../../errors/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\n\nexport type Arguments = {\n collection: Collection\n data: {\n [key: string]: unknown\n email: string\n }\n disableEmail?: boolean\n expiration?: number\n req: PayloadRequestWithData\n}\n\nexport type Result = string\n\nexport const forgotPasswordOperation = async (incomingArgs: Arguments): Promise<null | string> => {\n if (!Object.prototype.hasOwnProperty.call(incomingArgs.data, 'email')) {\n throw new APIError('Missing email.', httpStatus.BAD_REQUEST)\n }\n\n let args = incomingArgs\n\n try {\n const shouldCommit = await initTransaction(args.req)\n\n // /////////////////////////////////////\n // beforeOperation - Collection\n // /////////////////////////////////////\n\n await args.collection.config.hooks.beforeOperation.reduce(async (priorHook, hook) => {\n await priorHook\n\n args =\n (await hook({\n args,\n collection: args.collection?.config,\n context: args.req.context,\n operation: 'forgotPassword',\n req: args.req,\n })) || args\n }, Promise.resolve())\n\n const {\n collection: { config: collectionConfig },\n data,\n disableEmail,\n expiration,\n req: {\n payload: { config, email },\n payload,\n },\n req,\n } = args\n\n // /////////////////////////////////////\n // Forget password\n // /////////////////////////////////////\n\n let token: string = crypto.randomBytes(20).toString('hex')\n\n type UserDoc = {\n id: number | string\n resetPasswordExpiration?: string\n resetPasswordToken?: string\n }\n\n if (!data.email) {\n throw new APIError('Missing email.', httpStatus.BAD_REQUEST)\n }\n\n let user = await payload.db.findOne<UserDoc>({\n collection: collectionConfig.slug,\n req,\n where: { email: { equals: data.email.toLowerCase() } },\n })\n\n // We don't want to indicate specifically that an email was not found,\n // as doing so could lead to the exposure of registered emails.\n // Therefore, we prefer to fail silently.\n if (!user) return null\n\n user.resetPasswordToken = token\n user.resetPasswordExpiration = new Date(expiration || Date.now() + 3600000).toISOString() // 1 hour\n\n user = await payload.update({\n id: user.id,\n collection: collectionConfig.slug,\n data: user,\n req,\n })\n\n if (!disableEmail) {\n const protocol = new URL(req.url).protocol
|
|
1
|
+
{"version":3,"sources":["../../../src/auth/operations/forgotPassword.ts"],"sourcesContent":["import crypto from 'crypto'\nimport httpStatus from 'http-status'\nimport { URL } from 'url'\n\nimport type { Collection } from '../../collections/config/types.js'\nimport type { PayloadRequestWithData } from '../../types/index.js'\n\nimport { buildAfterOperation } from '../../collections/operations/utils.js'\nimport { APIError } from '../../errors/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\n\nexport type Arguments = {\n collection: Collection\n data: {\n [key: string]: unknown\n email: string\n }\n disableEmail?: boolean\n expiration?: number\n req: PayloadRequestWithData\n}\n\nexport type Result = string\n\nexport const forgotPasswordOperation = async (incomingArgs: Arguments): Promise<null | string> => {\n if (!Object.prototype.hasOwnProperty.call(incomingArgs.data, 'email')) {\n throw new APIError('Missing email.', httpStatus.BAD_REQUEST)\n }\n\n let args = incomingArgs\n\n try {\n const shouldCommit = await initTransaction(args.req)\n\n // /////////////////////////////////////\n // beforeOperation - Collection\n // /////////////////////////////////////\n\n await args.collection.config.hooks.beforeOperation.reduce(async (priorHook, hook) => {\n await priorHook\n\n args =\n (await hook({\n args,\n collection: args.collection?.config,\n context: args.req.context,\n operation: 'forgotPassword',\n req: args.req,\n })) || args\n }, Promise.resolve())\n\n const {\n collection: { config: collectionConfig },\n data,\n disableEmail,\n expiration,\n req: {\n payload: { config, email },\n payload,\n },\n req,\n } = args\n\n // /////////////////////////////////////\n // Forget password\n // /////////////////////////////////////\n\n let token: string = crypto.randomBytes(20).toString('hex')\n\n type UserDoc = {\n id: number | string\n resetPasswordExpiration?: string\n resetPasswordToken?: string\n }\n\n if (!data.email) {\n throw new APIError('Missing email.', httpStatus.BAD_REQUEST)\n }\n\n let user = await payload.db.findOne<UserDoc>({\n collection: collectionConfig.slug,\n req,\n where: { email: { equals: data.email.toLowerCase() } },\n })\n\n // We don't want to indicate specifically that an email was not found,\n // as doing so could lead to the exposure of registered emails.\n // Therefore, we prefer to fail silently.\n if (!user) return null\n\n user.resetPasswordToken = token\n user.resetPasswordExpiration = new Date(expiration || Date.now() + 3600000).toISOString() // 1 hour\n\n user = await payload.update({\n id: user.id,\n collection: collectionConfig.slug,\n data: user,\n req,\n })\n\n if (!disableEmail) {\n const protocol = new URL(req.url).protocol // includes the final :\n const serverURL =\n config.serverURL !== null && config.serverURL !== ''\n ? config.serverURL\n : `${protocol}//${req.headers.get('host')}`\n\n let html = `${req.t('authentication:youAreReceivingResetPassword')}\n <a href=\"${serverURL}${config.routes.admin}/reset/${token}\">\n ${serverURL}${config.routes.admin}/reset/${token}\n </a>\n ${req.t('authentication:youDidNotRequestPassword')}`\n\n if (typeof collectionConfig.auth.forgotPassword.generateEmailHTML === 'function') {\n html = await collectionConfig.auth.forgotPassword.generateEmailHTML({\n req,\n token,\n user,\n })\n }\n\n let subject = req.t('authentication:resetYourPassword')\n\n if (typeof collectionConfig.auth.forgotPassword.generateEmailSubject === 'function') {\n subject = await collectionConfig.auth.forgotPassword.generateEmailSubject({\n req,\n token,\n user,\n })\n }\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n email.sendEmail({\n from: `\"${email.defaultFromName}\" <${email.defaultFromAddress}>`,\n html,\n subject,\n to: data.email,\n })\n }\n\n // /////////////////////////////////////\n // afterForgotPassword - Collection\n // /////////////////////////////////////\n\n await collectionConfig.hooks.afterForgotPassword.reduce(async (priorHook, hook) => {\n await priorHook\n await hook({ args, collection: args.collection?.config, context: req.context })\n }, Promise.resolve())\n\n // /////////////////////////////////////\n // afterOperation - Collection\n // /////////////////////////////////////\n\n token = await buildAfterOperation({\n args,\n collection: args.collection?.config,\n operation: 'forgotPassword',\n result: token,\n })\n\n if (shouldCommit) await commitTransaction(req)\n\n return token\n } catch (error: unknown) {\n await killTransaction(args.req)\n throw error\n }\n}\n"],"names":["crypto","httpStatus","URL","buildAfterOperation","APIError","commitTransaction","initTransaction","killTransaction","forgotPasswordOperation","incomingArgs","Object","prototype","hasOwnProperty","call","data","BAD_REQUEST","args","shouldCommit","req","collection","config","hooks","beforeOperation","reduce","priorHook","hook","context","operation","Promise","resolve","collectionConfig","disableEmail","expiration","payload","email","token","randomBytes","toString","user","db","findOne","slug","where","equals","toLowerCase","resetPasswordToken","resetPasswordExpiration","Date","now","toISOString","update","id","protocol","url","serverURL","headers","get","html","t","routes","admin","auth","forgotPassword","generateEmailHTML","subject","generateEmailSubject","sendEmail","from","defaultFromName","defaultFromAddress","to","afterForgotPassword","result","error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,YAAY,SAAQ;AAC3B,OAAOC,gBAAgB,cAAa;AACpC,SAASC,GAAG,QAAQ,MAAK;AAKzB,SAASC,mBAAmB,QAAQ,wCAAuC;AAC3E,SAASC,QAAQ,QAAQ,wBAAuB;AAChD,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AAepE,OAAO,MAAMC,0BAA0B,OAAOC;IAC5C,IAAI,CAACC,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACJ,aAAaK,IAAI,EAAE,UAAU;QACrE,MAAM,IAAIV,S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MmC,kBAAkB,CAAC,CAAC,CAAC;gBAChEZ;gBACAO;gBACAM,IAAIxD,KAAKoB,KAAK;YAChB;QACF;QAEA,wCAAwC;QACxC,mCAAmC;QACnC,wCAAwC;QAExC,MAAMJ,iBAAiBT,KAAK,CAACkD,mBAAmB,CAAChD,MAAM,CAAC,OAAOC,WAAWC;YACxE,MAAMD;YACN,MAAMC,KAAK;gBAAET;gBAAMG,YAAYH,KAAKG,UAAU,EAAEC;gBAAQM,SAASR,IAAIQ,OAAO;YAAC;QAC/E,GAAGE,QAAQC,OAAO;QAElB,wCAAwC;QACxC,8BAA8B;QAC9B,wCAAwC;QAExCM,QAAQ,MAAMhC,oBAAoB;YAChCa;YACAG,YAAYH,KAAKG,UAAU,EAAEC;YAC7BO,WAAW;YACX6C,QAAQrC;QACV;QAEA,IAAIlB,cAAc,MAAMZ,kBAAkBa;QAE1C,OAAOiB;IACT,EAAE,OAAOsC,OAAgB;QACvB,MAAMlE,gBAAgBS,KAAKE,GAAG;QAC9B,MAAMuD;IACR;AACF,EAAC"}
|
|
@@ -3,8 +3,9 @@ export async function sendVerificationEmail(args) {
|
|
|
3
3
|
// Verify token from e-mail
|
|
4
4
|
const { collection: { config: collectionConfig }, config, disableEmail, email, req, token, user } = args;
|
|
5
5
|
if (!disableEmail) {
|
|
6
|
-
const protocol = new URL(req.url).protocol
|
|
7
|
-
|
|
6
|
+
const protocol = new URL(req.url).protocol // includes the final :
|
|
7
|
+
;
|
|
8
|
+
const serverURL = config.serverURL !== null && config.serverURL !== '' ? config.serverURL : `${protocol}//${req.headers.get('host')}`;
|
|
8
9
|
const verificationURL = `${serverURL}${config.routes.admin}/${collectionConfig.slug}/verify/${token}`;
|
|
9
10
|
let html = `${req.t('authentication:newAccountCreated', {
|
|
10
11
|
serverURL: config.serverURL,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/auth/sendVerificationEmail.ts"],"sourcesContent":["import { URL } from 'url'\n\nimport type { Collection } from '../collections/config/types.js'\nimport type { SanitizedConfig } from '../config/types.js'\nimport type { InitializedEmailAdapter } from '../email/types.js'\nimport type { PayloadRequestWithData } from '../types/index.js'\nimport type { User, VerifyConfig } from './types.js'\n\ntype Args = {\n collection: Collection\n config: SanitizedConfig\n disableEmail: boolean\n email: InitializedEmailAdapter\n req: PayloadRequestWithData\n token: string\n user: User\n}\n\nexport async function sendVerificationEmail(args: Args): Promise<void> {\n // Verify token from e-mail\n const {\n collection: { config: collectionConfig },\n config,\n disableEmail,\n email,\n req,\n token,\n user,\n } = args\n\n if (!disableEmail) {\n const protocol = new URL(req.url).protocol
|
|
1
|
+
{"version":3,"sources":["../../src/auth/sendVerificationEmail.ts"],"sourcesContent":["import { URL } from 'url'\n\nimport type { Collection } from '../collections/config/types.js'\nimport type { SanitizedConfig } from '../config/types.js'\nimport type { InitializedEmailAdapter } from '../email/types.js'\nimport type { PayloadRequestWithData } from '../types/index.js'\nimport type { User, VerifyConfig } from './types.js'\n\ntype Args = {\n collection: Collection\n config: SanitizedConfig\n disableEmail: boolean\n email: InitializedEmailAdapter\n req: PayloadRequestWithData\n token: string\n user: User\n}\n\nexport async function sendVerificationEmail(args: Args): Promise<void> {\n // Verify token from e-mail\n const {\n collection: { config: collectionConfig },\n config,\n disableEmail,\n email,\n req,\n token,\n user,\n } = args\n\n if (!disableEmail) {\n const protocol = new URL(req.url).protocol // includes the final :\n const serverURL =\n config.serverURL !== null && config.serverURL !== ''\n ? config.serverURL\n : `${protocol}//${req.headers.get('host')}`\n\n const verificationURL = `${serverURL}${config.routes.admin}/${collectionConfig.slug}/verify/${token}`\n\n let html = `${req.t('authentication:newAccountCreated', {\n serverURL: config.serverURL,\n verificationURL,\n })}`\n\n const verify = collectionConfig.auth.verify as VerifyConfig\n\n // Allow config to override email content\n if (typeof verify.generateEmailHTML === 'function') {\n html = await verify.generateEmailHTML({\n req,\n token,\n user,\n })\n }\n\n let subject = req.t('authentication:verifyYourEmail')\n\n // Allow config to override email subject\n if (typeof verify.generateEmailSubject === 'function') {\n subject = await verify.generateEmailSubject({\n req,\n token,\n user,\n })\n }\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n email.sendEmail({\n from: `\"${email.defaultFromName}\" <${email.defaultFromName}>`,\n html,\n subject,\n to: user.email,\n })\n }\n}\n"],"names":["URL","sendVerificationEmail","args","collection","config","collectionConfig","disableEmail","email","req","token","user","protocol","url","serverURL","headers","get","verificationURL","routes","admin","slug","html","t","verify","auth","generateEmailHTML","subject","generateEmailSubject","sendEmail","from","defaultFromName","to"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,MAAK;AAkBzB,OAAO,eAAeC,sBAAsBC,IAAU;IACpD,2BAA2B;IAC3B,MAAM,EACJC,YAAY,EAAEC,QAAQC,gBAAgB,EAAE,EACxCD,MAAM,EACNE,YAAY,EACZC,KAAK,EACLC,GAAG,EACHC,KAAK,EACLC,IAAI,EACL,GAAGR;IAEJ,IAAI,CAACI,cAAc;QACjB,MAAMK,WAAW,IAAIX,IAAIQ,IAAII,GAAG,EAAED,QAAQ,CAAC,uBAAuB;;QAClE,MAAME,YACJT,OAAOS,SAAS,KAAK,QAAQT,OAAOS,SAAS,KAAK,KAC9CT,OAAOS,SAAS,GAChB,CAAC,EAAEF,SAAS,EAAE,EAAEH,IAAIM,OAAO,CAACC,GAAG,CAAC,QAAQ,CAAC;QAE/C,MAAMC,kBAAkB,CAAC,EAAEH,UAAU,EAAET,OAAOa,MAAM,CAACC,KAAK,CAAC,CAAC,EAAEb,iBAAiBc,IAAI,CAAC,QAAQ,EAAEV,MAAM,CAAC;QAErG,IAAIW,OAAO,CAAC,EAAEZ,IAAIa,CAAC,CAAC,oCAAoC;YACtDR,WAAWT,OAAOS,SAAS;YAC3BG;QACF,GAAG,CAAC;QAEJ,MAAMM,SAASjB,iBAAiBkB,IAAI,CAACD,MAAM;QAE3C,yCAAyC;QACzC,IAAI,OAAOA,OAAOE,iBAAiB,KAAK,YAAY;YAClDJ,OAAO,MAAME,OAAOE,iBAAiB,CAAC;gBACpChB;gBACAC;gBACAC;YACF;QACF;QAEA,IAAIe,UAAUjB,IAAIa,CAAC,CAAC;QAEpB,yCAAyC;QACzC,IAAI,OAAOC,OAAOI,oBAAoB,KAAK,YAAY;YACrDD,UAAU,MAAMH,OAAOI,oBAAoB,CAAC;gBAC1ClB;gBACAC;gBACAC;YACF;QACF;QAEA,mEAAmE;QACnEH,MAAMoB,SAAS,CAAC;YACdC,MAAM,CAAC,CAAC,EAAErB,MAAMsB,eAAe,CAAC,GAAG,EAAEtB,MAAMsB,eAAe,CAAC,CAAC,CAAC;YAC7DT;YACAK;YACAK,IAAIpB,KAAKH,KAAK;QAChB;IACF;AACF"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Config } from '../../config/types.js';
|
|
2
2
|
import type { CollectionConfig, SanitizedCollectionConfig } from './types.js';
|
|
3
|
-
declare const sanitizeCollection: (config: Config, collection: CollectionConfig) => SanitizedCollectionConfig;
|
|
4
|
-
export default sanitizeCollection;
|
|
3
|
+
export declare const sanitizeCollection: (config: Config, collection: CollectionConfig) => SanitizedCollectionConfig;
|
|
5
4
|
//# sourceMappingURL=sanitize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../src/collections/config/sanitize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAgB7E,
|
|
1
|
+
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../src/collections/config/sanitize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAgB7E,eAAO,MAAM,kBAAkB,WACrB,MAAM,cACF,gBAAgB,KAC3B,yBA0IF,CAAA"}
|
|
@@ -12,7 +12,7 @@ import { formatLabels } from '../../utilities/formatLabels.js';
|
|
|
12
12
|
import { isPlainObject } from '../../utilities/isPlainObject.js';
|
|
13
13
|
import baseVersionFields from '../../versions/baseFields.js';
|
|
14
14
|
import { authDefaults, defaults } from './defaults.js';
|
|
15
|
-
const sanitizeCollection = (config, collection)=>{
|
|
15
|
+
export const sanitizeCollection = (config, collection)=>{
|
|
16
16
|
// /////////////////////////////////
|
|
17
17
|
// Make copy of collection config
|
|
18
18
|
// /////////////////////////////////
|
|
@@ -125,6 +125,5 @@ const sanitizeCollection = (config, collection)=>{
|
|
|
125
125
|
});
|
|
126
126
|
return sanitized;
|
|
127
127
|
};
|
|
128
|
-
export default sanitizeCollection;
|
|
129
128
|
|
|
130
129
|
//# sourceMappingURL=sanitize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/collections/config/sanitize.ts"],"sourcesContent":["import merge from 'deepmerge'\n\nimport type { Config } from '../../config/types.js'\nimport type { CollectionConfig, SanitizedCollectionConfig } from './types.js'\n\nimport baseAccountLockFields from '../../auth/baseFields/accountLock.js'\nimport baseAPIKeyFields from '../../auth/baseFields/apiKey.js'\nimport baseAuthFields from '../../auth/baseFields/auth.js'\nimport baseVerificationFields from '../../auth/baseFields/verification.js'\nimport { TimestampsRequired } from '../../errors/TimestampsRequired.js'\nimport { sanitizeFields } from '../../fields/config/sanitize.js'\nimport { fieldAffectsData } from '../../fields/config/types.js'\nimport mergeBaseFields from '../../fields/mergeBaseFields.js'\nimport { getBaseUploadFields } from '../../uploads/getBaseFields.js'\nimport { formatLabels } from '../../utilities/formatLabels.js'\nimport { isPlainObject } from '../../utilities/isPlainObject.js'\nimport baseVersionFields from '../../versions/baseFields.js'\nimport { authDefaults, defaults } from './defaults.js'\n\
|
|
1
|
+
{"version":3,"sources":["../../../src/collections/config/sanitize.ts"],"sourcesContent":["import merge from 'deepmerge'\n\nimport type { Config } from '../../config/types.js'\nimport type { CollectionConfig, SanitizedCollectionConfig } from './types.js'\n\nimport baseAccountLockFields from '../../auth/baseFields/accountLock.js'\nimport baseAPIKeyFields from '../../auth/baseFields/apiKey.js'\nimport baseAuthFields from '../../auth/baseFields/auth.js'\nimport baseVerificationFields from '../../auth/baseFields/verification.js'\nimport { TimestampsRequired } from '../../errors/TimestampsRequired.js'\nimport { sanitizeFields } from '../../fields/config/sanitize.js'\nimport { fieldAffectsData } from '../../fields/config/types.js'\nimport mergeBaseFields from '../../fields/mergeBaseFields.js'\nimport { getBaseUploadFields } from '../../uploads/getBaseFields.js'\nimport { formatLabels } from '../../utilities/formatLabels.js'\nimport { isPlainObject } from '../../utilities/isPlainObject.js'\nimport baseVersionFields from '../../versions/baseFields.js'\nimport { authDefaults, defaults } from './defaults.js'\n\nexport const sanitizeCollection = (\n config: Config,\n collection: CollectionConfig,\n): SanitizedCollectionConfig => {\n // /////////////////////////////////\n // Make copy of collection config\n // /////////////////////////////////\n\n const sanitized: CollectionConfig = merge(defaults, collection, {\n isMergeableObject: isPlainObject,\n })\n\n if (sanitized.timestamps !== false) {\n // add default timestamps fields only as needed\n let hasUpdatedAt = null\n let hasCreatedAt = null\n sanitized.fields.some((field) => {\n if (fieldAffectsData(field)) {\n if (field.name === 'updatedAt') hasUpdatedAt = true\n if (field.name === 'createdAt') hasCreatedAt = true\n }\n return hasCreatedAt && hasUpdatedAt\n })\n if (!hasUpdatedAt) {\n sanitized.fields.push({\n name: 'updatedAt',\n type: 'date',\n admin: {\n disableBulkEdit: true,\n hidden: true,\n },\n label: ({ t }) => t('general:updatedAt'),\n })\n }\n if (!hasCreatedAt) {\n sanitized.fields.push({\n name: 'createdAt',\n admin: {\n disableBulkEdit: true,\n hidden: true,\n },\n // The default sort for list view is createdAt. Thus, enabling indexing by default, is a major performance improvement, especially for large or a large amount of collections.\n type: 'date',\n index: true,\n label: ({ t }) => t('general:createdAt'),\n })\n }\n }\n\n sanitized.labels = sanitized.labels || formatLabels(sanitized.slug)\n\n if (sanitized.versions) {\n if (sanitized.versions === true) sanitized.versions = { drafts: false }\n\n if (sanitized.timestamps === false) {\n throw new TimestampsRequired(collection)\n }\n\n if (sanitized.versions.drafts) {\n if (sanitized.versions.drafts === true) {\n sanitized.versions.drafts = {\n autosave: false,\n }\n }\n\n if (sanitized.versions.drafts.autosave === true) {\n sanitized.versions.drafts.autosave = {\n interval: 2000,\n }\n }\n\n sanitized.fields = mergeBaseFields(sanitized.fields, baseVersionFields)\n }\n }\n\n if (sanitized.upload) {\n if (sanitized.upload === true) sanitized.upload = {}\n\n // disable duplicate for uploads by default\n sanitized.disableDuplicate = sanitized.disableDuplicate || true\n\n sanitized.upload.staticDir = sanitized.upload.staticDir || sanitized.slug\n sanitized.admin.useAsTitle =\n sanitized.admin.useAsTitle && sanitized.admin.useAsTitle !== 'id'\n ? sanitized.admin.useAsTitle\n : 'filename'\n\n const uploadFields = getBaseUploadFields({\n collection: sanitized,\n config,\n })\n\n sanitized.fields = mergeBaseFields(sanitized.fields, uploadFields)\n }\n\n if (sanitized.auth) {\n sanitized.auth = merge(authDefaults, typeof sanitized.auth === 'object' ? sanitized.auth : {}, {\n isMergeableObject: isPlainObject,\n })\n\n let authFields = []\n\n if (sanitized.auth.useAPIKey) {\n authFields = authFields.concat(baseAPIKeyFields)\n }\n\n if (!sanitized.auth.disableLocalStrategy) {\n authFields = authFields.concat(baseAuthFields)\n\n if (sanitized.auth.verify) {\n if (sanitized.auth.verify === true) sanitized.auth.verify = {}\n authFields = authFields.concat(baseVerificationFields)\n }\n\n if (sanitized.auth.maxLoginAttempts > 0) {\n authFields = authFields.concat(baseAccountLockFields)\n }\n }\n\n // disable duplicate for auth enabled collections by default\n sanitized.disableDuplicate = sanitized.disableDuplicate || true\n\n if (!sanitized.auth.strategies) {\n sanitized.auth.strategies = []\n }\n\n sanitized.fields = mergeBaseFields(sanitized.fields, authFields)\n }\n\n // /////////////////////////////////\n // Sanitize fields\n // /////////////////////////////////\n\n const validRelationships = config.collections.map((c) => c.slug) || []\n sanitized.fields = sanitizeFields({\n config,\n fields: sanitized.fields,\n validRelationships,\n })\n\n return sanitized as SanitizedCollectionConfig\n}\n"],"names":["merge","baseAccountLockFields","baseAPIKeyFields","baseAuthFields","baseVerificationFields","TimestampsRequired","sanitizeFields","fieldAffectsData","mergeBaseFields","getBaseUploadFields","formatLabels","isPlainObject","baseVersionFields","authDefaults","defaults","sanitizeCollection","config","collection","sanitized","isMergeableObject","timestamps","hasUpdatedAt","hasCreatedAt","fields","some","field","name","push","type","admin","disableBulkEdit","hidden","label","t","index","labels","slug","versions","drafts","autosave","interval","upload","disableDuplicate","staticDir","useAsTitle","uploadFields","auth","authFields","useAPIKey","concat","disableLocalStrategy","verify","maxLoginAttempts","strategies","validRelationships","collections","map","c"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,WAAW,YAAW;AAK7B,OAAOC,2BAA2B,uCAAsC;AACxE,OAAOC,sBAAsB,kCAAiC;AAC9D,OAAOC,oBAAoB,gCAA+B;AAC1D,OAAOC,4BAA4B,wCAAuC;AAC1E,SAASC,kBAAkB,QAAQ,qCAAoC;AACvE,SAASC,cAAc,QAAQ,kCAAiC;AAChE,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,OAAOC,qBAAqB,kCAAiC;AAC7D,SAASC,mBAAmB,QAAQ,iCAAgC;AACpE,SAASC,YAAY,QAAQ,kCAAiC;AAC9D,SAASC,aAAa,QAAQ,mCAAkC;AAChE,OAAOC,uBAAuB,+BAA8B;AAC5D,SAASC,YAAY,EAAEC,QAAQ,QAAQ,gBAAe;AAEtD,OAAO,MAAMC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YAE/B,IAAIe,UAAU4B,IAAI,CAACK,MAAM,EAAE;gBACzB,IAAIjC,UAAU4B,IAAI,CAACK,MAAM,KAAK,MAAMjC,UAAU4B,IAAI,CAACK,MAAM,GAAG,CAAC;gBAC7DJ,aAAaA,WAAWE,MAAM,CAAC7C;YACjC;YAEA,IAAIc,UAAU4B,IAAI,CAACM,gBAAgB,GAAG,GAAG;gBACvCL,aAAaA,WAAWE,MAAM,CAAChD;YACjC;QACF;QAEA,4DAA4D;QAC5DiB,UAAUwB,gBAAgB,GAAGxB,UAAUwB,gBAAgB,IAAI;QAE3D,IAAI,CAACxB,UAAU4B,IAAI,CAACO,UAAU,EAAE;YAC9BnC,UAAU4B,IAAI,CAACO,UAAU,GAAG,EAAE;QAChC;QAEAnC,UAAUK,MAAM,GAAGf,gBAAgBU,UAAUK,MAAM,EAAEwB;IACvD;IAEA,oCAAoC;IACpC,kBAAkB;IAClB,oCAAoC;IAEpC,MAAMO,qBAAqBtC,OAAOuC,WAAW,CAACC,GAAG,CAAC,CAACC,IAAMA,EAAErB,IAAI,KAAK,EAAE;IACtElB,UAAUK,MAAM,GAAGjB,eAAe;QAChCU;QACAO,QAAQL,UAAUK,MAAM;QACxB+B;IACF;IAEA,OAAOpC;AACT,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/collections/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAcrB,QAAA,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/collections/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAcrB,QAAA,MAAM,gBAAgB,uBAiNpB,CAAA;AAEF,eAAe,gBAAgB,CAAA"}
|
|
@@ -127,6 +127,7 @@ const collectionSchema = joi.object().keys({
|
|
|
127
127
|
interface: joi.string()
|
|
128
128
|
}),
|
|
129
129
|
upload: joi.alternatives().try(joi.object({
|
|
130
|
+
adapter: joi.string(),
|
|
130
131
|
adminThumbnail: joi.alternatives().try(joi.string(), componentSchema),
|
|
131
132
|
crop: joi.bool(),
|
|
132
133
|
disableLocalStorage: joi.bool(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/collections/config/schema.ts"],"sourcesContent":["import joi from 'joi'\n\nimport { endpointsSchema } from '../../config/schema.js'\nimport {\n componentSchema,\n customViewSchema,\n livePreviewSchema,\n} from '../../config/shared/componentSchema.js'\n\nconst strategyBaseSchema = joi.object().keys({\n logout: joi.boolean(),\n refresh: joi.boolean(),\n})\n\nconst collectionSchema = joi.object().keys({\n slug: joi.string().required(),\n access: joi.object({\n admin: joi.func(),\n create: joi.func(),\n delete: joi.func(),\n read: joi.func(),\n readVersions: joi.func(),\n unlock: joi.func(),\n update: joi.func(),\n }),\n admin: joi.object({\n components: joi.object({\n AfterList: joi.array().items(componentSchema),\n AfterListTable: joi.array().items(componentSchema),\n BeforeList: joi.array().items(componentSchema),\n BeforeListTable: joi.array().items(componentSchema),\n edit: joi.object({\n PreviewButton: componentSchema,\n PublishButton: componentSchema,\n SaveButton: componentSchema,\n SaveDraftButton: componentSchema,\n }),\n views: joi.object({\n Edit: joi.alternatives().try(\n componentSchema,\n joi.object({\n API: joi.alternatives().try(componentSchema, customViewSchema),\n Default: joi.alternatives().try(componentSchema, customViewSchema),\n LivePreview: joi.alternatives().try(componentSchema, customViewSchema),\n Version: joi.alternatives().try(componentSchema, customViewSchema),\n Versions: joi.alternatives().try(componentSchema, customViewSchema),\n // Relationships\n // References\n }),\n ),\n List: joi.alternatives().try(\n componentSchema,\n joi.object({\n Component: componentSchema,\n actions: joi.array().items(componentSchema),\n }),\n ),\n }),\n }),\n custom: joi.object().pattern(joi.string(), joi.any()),\n defaultColumns: joi.array().items(joi.string()),\n description: joi.alternatives().try(joi.string(), componentSchema),\n enableRichTextLink: joi.boolean(),\n enableRichTextRelationship: joi.boolean(),\n group: joi.alternatives().try(joi.string(), joi.object().pattern(joi.string(), [joi.string()])),\n hidden: joi.alternatives().try(joi.boolean(), joi.func()),\n hideAPIURL: joi.bool(),\n listSearchableFields: joi.array().items(joi.string()),\n livePreview: joi.object(livePreviewSchema),\n pagination: joi.object({\n defaultLimit: joi.number(),\n limits: joi.array().items(joi.number()),\n }),\n preview: joi.func(),\n useAsTitle: joi.string(),\n }),\n auth: joi.alternatives().try(\n joi.object({\n cookies: joi.object().keys({\n domain: joi.string(),\n sameSite: joi.string(), // TODO: add further specificity with joi.xor\n secure: joi.boolean(),\n }),\n depth: joi.number(),\n disableLocalStrategy: joi.boolean().valid(true),\n forgotPassword: joi.object().keys({\n generateEmailHTML: joi.func(),\n generateEmailSubject: joi.func(),\n }),\n lockTime: joi.number(),\n maxLoginAttempts: joi.number(),\n removeTokenFromResponses: joi.boolean().valid(true),\n strategies: joi.array().items(\n joi.object().keys({\n name: joi.string().required(),\n authenticate: joi.func().required(),\n }),\n ),\n tokenExpiration: joi.number(),\n useAPIKey: joi.boolean(),\n verify: joi.alternatives().try(\n joi.boolean(),\n joi.object().keys({\n generateEmailHTML: joi.func(),\n generateEmailSubject: joi.func(),\n }),\n ),\n }),\n joi.boolean(),\n ),\n custom: joi.object().pattern(joi.string(), joi.any()),\n dbName: joi.alternatives().try(joi.string(), joi.func()),\n defaultSort: joi.string(),\n disableDuplicate: joi.bool(),\n endpoints: endpointsSchema,\n fields: joi.array(),\n graphQL: joi.alternatives().try(\n joi.object().keys({\n pluralName: joi.string(),\n singularName: joi.string(),\n }),\n joi.boolean(),\n ),\n hooks: joi.object({\n afterChange: joi.array().items(joi.func()),\n afterDelete: joi.array().items(joi.func()),\n afterForgotPassword: joi.array().items(joi.func()),\n afterLogin: joi.array().items(joi.func()),\n afterLogout: joi.array().items(joi.func()),\n afterMe: joi.array().items(joi.func()),\n afterOperation: joi.array().items(joi.func()),\n afterRead: joi.array().items(joi.func()),\n afterRefresh: joi.array().items(joi.func()),\n beforeChange: joi.array().items(joi.func()),\n beforeDelete: joi.array().items(joi.func()),\n beforeLogin: joi.array().items(joi.func()),\n beforeOperation: joi.array().items(joi.func()),\n beforeRead: joi.array().items(joi.func()),\n beforeValidate: joi.array().items(joi.func()),\n }),\n labels: joi.object({\n plural: joi\n .alternatives()\n .try(joi.func(), joi.string(), joi.object().pattern(joi.string(), [joi.string()])),\n singular: joi\n .alternatives()\n .try(joi.func(), joi.string(), joi.object().pattern(joi.string(), [joi.string()])),\n }),\n timestamps: joi.boolean(),\n typescript: joi.object().keys({\n interface: joi.string(),\n }),\n upload: joi.alternatives().try(\n joi.object({\n adminThumbnail: joi.alternatives().try(joi.string(), componentSchema),\n crop: joi.bool(),\n disableLocalStorage: joi.bool(),\n externalFileHeaderFilter: joi.func(),\n filesRequiredOnCreate: joi.bool(),\n focalPoint: joi.bool(),\n formatOptions: joi.object().keys({\n format: joi.string(),\n options: joi.object(),\n }),\n handlers: joi.array().items(joi.func()),\n imageSizes: joi.array().items(\n joi\n .object()\n .keys({\n name: joi.string(),\n crop: joi.string(), // TODO: add further specificity with joi.xor\n height: joi.number().integer().allow(null),\n width: joi.number().integer().allow(null),\n })\n .unknown(),\n ),\n mimeTypes: joi.array().items(joi.string()),\n resizeOptions: joi\n .object()\n .keys({\n background: joi.string(),\n fastShrinkOnLoad: joi.bool(),\n fit: joi.string(),\n height: joi.number().allow(null),\n kernel: joi.string(),\n position: joi.alternatives().try(joi.string(), joi.number()),\n width: joi.number().allow(null),\n withoutEnlargement: joi.bool(),\n })\n .allow(null),\n staticDir: joi.string(),\n staticOptions: joi.object(),\n tempFileDir: joi.string(),\n trimOptions: joi.alternatives().try(\n joi.object().keys({\n format: joi.string(),\n options: joi.object(),\n }),\n joi.string(),\n joi.number(),\n ),\n useTempFiles: joi.bool(),\n }),\n joi.boolean(),\n ),\n versions: joi.alternatives().try(\n joi.object({\n drafts: joi.alternatives().try(\n joi.object({\n autosave: joi.alternatives().try(\n joi.boolean(),\n joi.object({\n interval: joi.number(),\n }),\n ),\n }),\n joi.boolean(),\n ),\n maxPerDoc: joi.number(),\n }),\n joi.boolean(),\n ),\n})\n\nexport default collectionSchema\n"],"names":["joi","endpointsSchema","componentSchema","customViewSchema","livePreviewSchema","strategyBaseSchema","object","keys","logout","boolean","refresh","collectionSchema","slug","string","required","access","admin","func","create","delete","read","readVersions","unlock","update","components","AfterList","array","items","AfterListTable","BeforeList","BeforeListTable","edit","PreviewButton","PublishButton","SaveButton","SaveDraftButton","views","Edit","alternatives","try","API","Default","LivePreview","Version","Versions","List","Component","actions","custom","pattern","any","defaultColumns","description","enableRichTextLink","enableRichTextRelationship","group","hidden","hideAPIURL","bool","listSearchableFields","livePreview","pagination","defaultLimit","number","limits","preview","useAsTitle","auth","cookies","domain","sameSite","secure","depth","disableLocalStrategy","valid","forgotPassword","generateEmailHTML","generateEmailSubject","lockTime","maxLoginAttempts","removeTokenFromResponses","strategies","name","authenticate","tokenExpiration","useAPIKey","verify","dbName","defaultSort","disableDuplicate","endpoints","fields","graphQL","pluralName","singularName","hooks","afterChange","afterDelete","afterForgotPassword","afterLogin","afterLogout","afterMe","afterOperation","afterRead","afterRefresh","beforeChange","beforeDelete","beforeLogin","beforeOperation","beforeRead","beforeValidate","labels","plural","singular","timestamps","typescript","interface","upload","adminThumbnail","crop","disableLocalStorage","externalFileHeaderFilter","filesRequiredOnCreate","focalPoint","formatOptions","format","options","handlers","imageSizes","height","integer","allow","width","unknown","mimeTypes","resizeOptions","background","fastShrinkOnLoad","fit","kernel","position","withoutEnlargement","staticDir","staticOptions","tempFileDir","trimOptions","useTempFiles","versions","drafts","autosave","interval","maxPerDoc"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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B;QAEJ,IACA/D,IAAIS,OAAO;QAEb8I,WAAWvJ,IAAI+D,MAAM;IACvB,IACA/D,IAAIS,OAAO;AAEf;AAEA,eAAeE,iBAAgB"}
|
|
1
|
+
{"version":3,"sources":["../../../src/collections/config/schema.ts"],"sourcesContent":["import joi from 'joi'\n\nimport { endpointsSchema } from '../../config/schema.js'\nimport {\n componentSchema,\n customViewSchema,\n livePreviewSchema,\n} from '../../config/shared/componentSchema.js'\n\nconst strategyBaseSchema = joi.object().keys({\n logout: joi.boolean(),\n refresh: joi.boolean(),\n})\n\nconst collectionSchema = joi.object().keys({\n slug: joi.string().required(),\n access: joi.object({\n admin: joi.func(),\n create: joi.func(),\n delete: joi.func(),\n read: joi.func(),\n readVersions: joi.func(),\n unlock: joi.func(),\n update: joi.func(),\n }),\n admin: joi.object({\n components: joi.object({\n AfterList: joi.array().items(componentSchema),\n AfterListTable: joi.array().items(componentSchema),\n BeforeList: joi.array().items(componentSchema),\n BeforeListTable: joi.array().items(componentSchema),\n edit: joi.object({\n PreviewButton: componentSchema,\n PublishButton: componentSchema,\n SaveButton: componentSchema,\n SaveDraftButton: componentSchema,\n }),\n views: joi.object({\n Edit: joi.alternatives().try(\n componentSchema,\n joi.object({\n API: joi.alternatives().try(componentSchema, customViewSchema),\n Default: joi.alternatives().try(componentSchema, customViewSchema),\n LivePreview: joi.alternatives().try(componentSchema, customViewSchema),\n Version: joi.alternatives().try(componentSchema, customViewSchema),\n Versions: joi.alternatives().try(componentSchema, customViewSchema),\n // Relationships\n // References\n }),\n ),\n List: joi.alternatives().try(\n componentSchema,\n joi.object({\n Component: componentSchema,\n actions: joi.array().items(componentSchema),\n }),\n ),\n }),\n }),\n custom: joi.object().pattern(joi.string(), joi.any()),\n defaultColumns: joi.array().items(joi.string()),\n description: joi.alternatives().try(joi.string(), componentSchema),\n enableRichTextLink: joi.boolean(),\n enableRichTextRelationship: joi.boolean(),\n group: joi.alternatives().try(joi.string(), joi.object().pattern(joi.string(), [joi.string()])),\n hidden: joi.alternatives().try(joi.boolean(), joi.func()),\n hideAPIURL: joi.bool(),\n listSearchableFields: joi.array().items(joi.string()),\n livePreview: joi.object(livePreviewSchema),\n pagination: joi.object({\n defaultLimit: joi.number(),\n limits: joi.array().items(joi.number()),\n }),\n preview: joi.func(),\n useAsTitle: joi.string(),\n }),\n auth: joi.alternatives().try(\n joi.object({\n cookies: joi.object().keys({\n domain: joi.string(),\n sameSite: joi.string(), // TODO: add further specificity with joi.xor\n secure: joi.boolean(),\n }),\n depth: joi.number(),\n disableLocalStrategy: joi.boolean().valid(true),\n forgotPassword: joi.object().keys({\n generateEmailHTML: joi.func(),\n generateEmailSubject: joi.func(),\n }),\n lockTime: joi.number(),\n maxLoginAttempts: joi.number(),\n removeTokenFromResponses: joi.boolean().valid(true),\n strategies: joi.array().items(\n joi.object().keys({\n name: joi.string().required(),\n authenticate: joi.func().required(),\n }),\n ),\n tokenExpiration: joi.number(),\n useAPIKey: joi.boolean(),\n verify: joi.alternatives().try(\n joi.boolean(),\n joi.object().keys({\n generateEmailHTML: joi.func(),\n generateEmailSubject: joi.func(),\n }),\n ),\n }),\n joi.boolean(),\n ),\n custom: joi.object().pattern(joi.string(), joi.any()),\n dbName: joi.alternatives().try(joi.string(), joi.func()),\n defaultSort: joi.string(),\n disableDuplicate: joi.bool(),\n endpoints: endpointsSchema,\n fields: joi.array(),\n graphQL: joi.alternatives().try(\n joi.object().keys({\n pluralName: joi.string(),\n singularName: joi.string(),\n }),\n joi.boolean(),\n ),\n hooks: joi.object({\n afterChange: joi.array().items(joi.func()),\n afterDelete: joi.array().items(joi.func()),\n afterForgotPassword: joi.array().items(joi.func()),\n afterLogin: joi.array().items(joi.func()),\n afterLogout: joi.array().items(joi.func()),\n afterMe: joi.array().items(joi.func()),\n afterOperation: joi.array().items(joi.func()),\n afterRead: joi.array().items(joi.func()),\n afterRefresh: joi.array().items(joi.func()),\n beforeChange: joi.array().items(joi.func()),\n beforeDelete: joi.array().items(joi.func()),\n beforeLogin: joi.array().items(joi.func()),\n beforeOperation: joi.array().items(joi.func()),\n beforeRead: joi.array().items(joi.func()),\n beforeValidate: joi.array().items(joi.func()),\n }),\n labels: joi.object({\n plural: joi\n .alternatives()\n .try(joi.func(), joi.string(), joi.object().pattern(joi.string(), [joi.string()])),\n singular: joi\n .alternatives()\n .try(joi.func(), joi.string(), joi.object().pattern(joi.string(), [joi.string()])),\n }),\n timestamps: joi.boolean(),\n typescript: joi.object().keys({\n interface: joi.string(),\n }),\n upload: joi.alternatives().try(\n joi.object({\n adapter: joi.string(),\n adminThumbnail: joi.alternatives().try(joi.string(), componentSchema),\n crop: joi.bool(),\n disableLocalStorage: joi.bool(),\n externalFileHeaderFilter: joi.func(),\n filesRequiredOnCreate: joi.bool(),\n focalPoint: joi.bool(),\n formatOptions: joi.object().keys({\n format: joi.string(),\n options: joi.object(),\n }),\n handlers: joi.array().items(joi.func()),\n imageSizes: joi.array().items(\n joi\n .object()\n .keys({\n name: joi.string(),\n crop: joi.string(), // TODO: add further specificity with joi.xor\n height: joi.number().integer().allow(null),\n width: joi.number().integer().allow(null),\n })\n .unknown(),\n ),\n mimeTypes: joi.array().items(joi.string()),\n resizeOptions: joi\n .object()\n .keys({\n background: joi.string(),\n fastShrinkOnLoad: joi.bool(),\n fit: joi.string(),\n height: joi.number().allow(null),\n kernel: joi.string(),\n position: joi.alternatives().try(joi.string(), joi.number()),\n width: joi.number().allow(null),\n withoutEnlargement: joi.bool(),\n })\n .allow(null),\n staticDir: joi.string(),\n staticOptions: joi.object(),\n tempFileDir: joi.string(),\n trimOptions: joi.alternatives().try(\n joi.object().keys({\n format: joi.string(),\n options: joi.object(),\n }),\n joi.string(),\n joi.number(),\n ),\n useTempFiles: joi.bool(),\n }),\n joi.boolean(),\n ),\n versions: joi.alternatives().try(\n joi.object({\n drafts: joi.alternatives().try(\n joi.object({\n autosave: joi.alternatives().try(\n joi.boolean(),\n joi.object({\n interval: joi.number(),\n }),\n ),\n }),\n joi.boolean(),\n ),\n maxPerDoc: joi.number(),\n }),\n joi.boolean(),\n ),\n})\n\nexport default collectionSchema\n"],"names":["joi","endpointsSchema","componentSchema","customViewSchema","livePreviewSchema","strategyBaseSchema","object","keys","logout","boolean","refresh","collectionSchema","slug","string","required","access","admin","func","create","delete","read","readVersions","unlock","update","components","AfterList","array","items","AfterListTable","BeforeList","BeforeListTable","edit","PreviewButton","PublishButton","SaveButton","SaveDraftButton","views","Edit","alternatives","try","API","Default","LivePreview","Version","Versions","List","Component","actions","custom","pattern","any","defaultColumns","description","enableRichTextLink","enableRichTextRelationship","group","hidden","hideAPIURL","bool","listSearchableFields","livePreview","pagination","defaultLimit","number","limits","preview","useAsTitle","auth","cookies","domain","sameSite","secure","depth","disableLocalStrategy","valid","forgotPassword","generateEmailHTML","generateEmailSubject","lockTime","maxLoginAttempts","removeTokenFromResponses","strategies","name","authenticate","tokenExpiration","useAPIKey","verify","dbName","defaultSort","disableDuplicate","endpoints","fields","graphQL","pluralName","singularName","hooks","afterChange","afterDelete","afterForgotPassword","afterLogin","afterLogout","afterMe","afterOperation","afterRead","afterRefresh","beforeChange","beforeDelete","beforeLogin","beforeOperation","beforeRead","beforeValidate","labels","plural","singular","timestamps","typescript","interface","upload","adapter","adminThumbnail","crop","disableLocalStorage","externalFileHeaderFilter","filesRequiredOnCreate","focalPoint","formatOptions","format","options","handlers","imageSizes","height","integer","allow","width","unknown","mimeTypes","resizeOptions","background","fastShrinkOnLoad","fit","kernel","position","withoutEnlargement","staticDir","staticOptions","tempFileDir","trimOptions","useTempFiles","versions","drafts","autosave","interval","maxPerDoc"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,SAAS,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,IAAIS,OAAO;QAEb+I,WAAWxJ,IAAI+D,MAAM;IACvB,IACA/D,IAAIS,OAAO;AAEf;AAEA,eAAeE,iBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/config/sanitize.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,MAAM,EAGN,eAAe,EAChB,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/config/sanitize.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,MAAM,EAGN,eAAe,EAChB,MAAM,YAAY,CAAA;AAsCnB,eAAO,MAAM,cAAc,mBAAoB,MAAM,KAAG,eA4EvD,CAAA"}
|
package/dist/config/sanitize.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { en } from '@payloadcms/translations/languages/en';
|
|
2
2
|
import merge from 'deepmerge';
|
|
3
3
|
import { defaultUserCollection } from '../auth/defaultUser.js';
|
|
4
|
-
import sanitizeCollection from '../collections/config/sanitize.js';
|
|
4
|
+
import { sanitizeCollection } from '../collections/config/sanitize.js';
|
|
5
5
|
import { migrationsCollection } from '../database/migrations/migrationsCollection.js';
|
|
6
6
|
import { InvalidConfiguration } from '../errors/index.js';
|
|
7
7
|
import sanitizeGlobals from '../globals/config/sanitize.js';
|
|
@@ -23,7 +23,8 @@ const sanitizeAdminConfig = (configToSanitize)=>{
|
|
|
23
23
|
sanitizedConfig.collections.push(defaultUserCollection);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
const userCollection = sanitizedConfig.collections.find(({ slug })=>slug === sanitizedConfig.admin.user);
|
|
27
|
+
if (!userCollection || !userCollection.auth) {
|
|
27
28
|
throw new InvalidConfiguration(`${sanitizedConfig.admin.user} is not a valid admin user collection`);
|
|
28
29
|
}
|
|
29
30
|
return sanitizedConfig;
|
|
@@ -80,6 +81,11 @@ export const sanitizeConfig = (incomingConfig)=>{
|
|
|
80
81
|
if (config.serverURL !== '') {
|
|
81
82
|
config.csrf.push(config.serverURL);
|
|
82
83
|
}
|
|
84
|
+
// Get deduped list of upload adapters
|
|
85
|
+
if (!config.upload) config.upload = {
|
|
86
|
+
adapters: []
|
|
87
|
+
};
|
|
88
|
+
config.upload.adapters = Array.from(new Set(config.collections.map((c)=>c.upload?.adapter).filter(Boolean)));
|
|
83
89
|
return config;
|
|
84
90
|
};
|
|
85
91
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config/sanitize.ts"],"sourcesContent":["import { en } from '@payloadcms/translations/languages/en'\nimport merge from 'deepmerge'\n\nimport type {\n Config,\n LocalizationConfigWithLabels,\n LocalizationConfigWithNoLabels,\n SanitizedConfig,\n} from './types.js'\n\nimport { defaultUserCollection } from '../auth/defaultUser.js'\nimport sanitizeCollection from '../collections/config/sanitize.js'\nimport { migrationsCollection } from '../database/migrations/migrationsCollection.js'\nimport { InvalidConfiguration } from '../errors/index.js'\nimport sanitizeGlobals from '../globals/config/sanitize.js'\nimport getPreferencesCollection from '../preferences/preferencesCollection.js'\nimport checkDuplicateCollections from '../utilities/checkDuplicateCollections.js'\nimport { isPlainObject } from '../utilities/isPlainObject.js'\nimport { defaults } from './defaults.js'\n\nconst sanitizeAdminConfig = (configToSanitize: Config): Partial<SanitizedConfig> => {\n const sanitizedConfig = { ...configToSanitize }\n\n // add default user collection if none provided\n if (!sanitizedConfig?.admin?.user) {\n const firstCollectionWithAuth = sanitizedConfig.collections.find(({ auth }) => Boolean(auth))\n if (firstCollectionWithAuth) {\n sanitizedConfig.admin.user = firstCollectionWithAuth.slug\n } else {\n sanitizedConfig.admin.user = defaultUserCollection.slug\n sanitizedConfig.collections.push(defaultUserCollection)\n }\n }\n\n
|
|
1
|
+
{"version":3,"sources":["../../src/config/sanitize.ts"],"sourcesContent":["import { en } from '@payloadcms/translations/languages/en'\nimport merge from 'deepmerge'\n\nimport type {\n Config,\n LocalizationConfigWithLabels,\n LocalizationConfigWithNoLabels,\n SanitizedConfig,\n} from './types.js'\n\nimport { defaultUserCollection } from '../auth/defaultUser.js'\nimport { sanitizeCollection } from '../collections/config/sanitize.js'\nimport { migrationsCollection } from '../database/migrations/migrationsCollection.js'\nimport { InvalidConfiguration } from '../errors/index.js'\nimport sanitizeGlobals from '../globals/config/sanitize.js'\nimport getPreferencesCollection from '../preferences/preferencesCollection.js'\nimport checkDuplicateCollections from '../utilities/checkDuplicateCollections.js'\nimport { isPlainObject } from '../utilities/isPlainObject.js'\nimport { defaults } from './defaults.js'\n\nconst sanitizeAdminConfig = (configToSanitize: Config): Partial<SanitizedConfig> => {\n const sanitizedConfig = { ...configToSanitize }\n\n // add default user collection if none provided\n if (!sanitizedConfig?.admin?.user) {\n const firstCollectionWithAuth = sanitizedConfig.collections.find(({ auth }) => Boolean(auth))\n if (firstCollectionWithAuth) {\n sanitizedConfig.admin.user = firstCollectionWithAuth.slug\n } else {\n sanitizedConfig.admin.user = defaultUserCollection.slug\n sanitizedConfig.collections.push(defaultUserCollection)\n }\n }\n\n const userCollection = sanitizedConfig.collections.find(\n ({ slug }) => slug === sanitizedConfig.admin.user,\n )\n if (!userCollection || !userCollection.auth) {\n throw new InvalidConfiguration(\n `${sanitizedConfig.admin.user} is not a valid admin user collection`,\n )\n }\n\n return sanitizedConfig as Partial<SanitizedConfig>\n}\n\nexport const sanitizeConfig = (incomingConfig: Config): SanitizedConfig => {\n const configWithDefaults: Config = merge(defaults, incomingConfig, {\n isMergeableObject: isPlainObject,\n }) as Config\n\n if (!configWithDefaults?.serverURL) {\n configWithDefaults.serverURL = ''\n }\n\n const config: Partial<SanitizedConfig> = sanitizeAdminConfig(configWithDefaults)\n\n if (config.localization && config.localization.locales?.length > 0) {\n // clone localization config so to not break everything\n const firstLocale = config.localization.locales[0]\n if (typeof firstLocale === 'string') {\n config.localization.localeCodes = [\n ...(config.localization as unknown as LocalizationConfigWithNoLabels).locales,\n ]\n\n // is string[], so convert to Locale[]\n config.localization.locales = (\n config.localization as unknown as LocalizationConfigWithNoLabels\n ).locales.map((locale) => ({\n code: locale,\n label: locale,\n rtl: false,\n toString: () => locale,\n }))\n } else {\n // is Locale[], so convert to string[] for localeCodes\n config.localization.localeCodes = config.localization.locales.reduce((locales, locale) => {\n locales.push(locale.code)\n return locales\n }, [] as string[])\n\n config.localization.locales = (\n config.localization as LocalizationConfigWithLabels\n ).locales.map((locale) => ({\n ...locale,\n toString: () => locale.code,\n }))\n }\n }\n\n config.i18n = {\n fallbackLanguage: 'en',\n supportedLanguages: {\n en,\n },\n translations: {},\n ...(incomingConfig?.i18n ?? {}),\n }\n\n configWithDefaults.collections.push(getPreferencesCollection(configWithDefaults))\n configWithDefaults.collections.push(migrationsCollection)\n\n config.collections = config.collections.map((collection) =>\n sanitizeCollection(configWithDefaults, collection),\n )\n checkDuplicateCollections(config.collections)\n\n if (config.globals.length > 0) {\n config.globals = sanitizeGlobals(config as SanitizedConfig)\n }\n\n if (config.serverURL !== '') {\n config.csrf.push(config.serverURL)\n }\n\n // Get deduped list of upload adapters\n if (!config.upload) config.upload = { adapters: [] }\n config.upload.adapters = Array.from(\n new Set(config.collections.map((c) => c.upload?.adapter).filter(Boolean)),\n )\n\n return config as SanitizedConfig\n}\n"],"names":["en","merge","defaultUserCollection","sanitizeCollection","migrationsCollection","InvalidConfiguration","sanitizeGlobals","getPreferencesCollection","checkDuplicateCollections","isPlainObject","defaults","sanitizeAdminConfig","configToSanitize","sanitizedConfig","admin","user","firstCollectionWithAuth","collections","find","auth","Boolean","slug","push","userCollection","sanitizeConfig","incomingConfig","configWithDefaults","isMergeableObject","serverURL","config","localization","locales","length","firstLocale","localeCodes","map","locale","code","label","rtl","toString","reduce","i18n","fallbackLanguage","supportedLanguages","translations","collection","globals","csrf","upload","adapters","Array","from","Set","c","adapter","filter"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,GAAGY,OAAOZ,WAAW,CAACkB,GAAG,CAAC,CAACW,aAC3C3C,mBAAmBuB,oBAAoBoB;IAEzCtC,0BAA0BqB,OAAOZ,WAAW;IAE5C,IAAIY,OAAOkB,OAAO,CAACf,MAAM,GAAG,GAAG;QAC7BH,OAAOkB,OAAO,GAAGzC,gBAAgBuB;IACnC;IAEA,IAAIA,OAAOD,SAAS,KAAK,IAAI;QAC3BC,OAAOmB,IAAI,CAAC1B,IAAI,CAACO,OAAOD,SAAS;IACnC;IAEA,sCAAsC;IACtC,IAAI,CAACC,OAAOoB,MAAM,EAAEpB,OAAOoB,MAAM,GAAG;QAAEC,UAAU,EAAE;IAAC;IACnDrB,OAAOoB,MAAM,CAACC,QAAQ,GAAGC,MAAMC,IAAI,CACjC,IAAIC,IAAIxB,OAAOZ,WAAW,CAACkB,GAAG,CAAC,CAACmB,IAAMA,EAAEL,MAAM,EAAEM,SAASC,MAAM,CAACpC;IAGlE,OAAOS;AACT,EAAC"}
|
package/dist/config/schema.js
CHANGED
|
@@ -81,7 +81,7 @@ export default joi.object({
|
|
|
81
81
|
populationPromise: joi.func().optional(),
|
|
82
82
|
validate: joi.func().required()
|
|
83
83
|
}).unknown(),
|
|
84
|
-
email: joi.object(),
|
|
84
|
+
email: joi.alternatives().try(joi.object(), joi.func()),
|
|
85
85
|
endpoints: endpointsSchema,
|
|
86
86
|
globals: joi.array(),
|
|
87
87
|
graphQL: joi.object().keys({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config/schema.ts"],"sourcesContent":["import joi from 'joi'\n\nimport { adminViewSchema } from './shared/adminViewSchema.js'\nimport { componentSchema, livePreviewSchema } from './shared/componentSchema.js'\n\nconst component = joi.alternatives().try(joi.object().unknown(), joi.func())\n\nexport const endpointsSchema = joi.alternatives().try(\n joi.array().items(\n joi.object({\n custom: joi.object().pattern(joi.string(), joi.any()),\n handler: joi.alternatives().try(joi.array().items(joi.func()), joi.func()),\n method: joi\n .string()\n .valid('get', 'head', 'post', 'put', 'patch', 'delete', 'connect', 'options'),\n path: joi.string(),\n root: joi.bool(),\n }),\n ),\n joi.boolean(),\n)\n\nexport default joi.object({\n admin: joi.object({\n autoLogin: joi.alternatives().try(\n joi.object().keys({\n email: joi.string(),\n password: joi.string(),\n prefillOnly: joi.boolean(),\n }),\n joi.boolean(),\n ),\n avatar: joi.alternatives().try(joi.string(), component),\n buildPath: joi.string(),\n components: joi.object().keys({\n Nav: component,\n actions: joi.array().items(component),\n afterDashboard: joi.array().items(component),\n afterLogin: joi.array().items(component),\n afterNavLinks: joi.array().items(component),\n beforeDashboard: joi.array().items(component),\n beforeLogin: joi.array().items(component),\n beforeNavLinks: joi.array().items(component),\n graphics: joi.object({\n Icon: component,\n Logo: component,\n }),\n logout: joi.object({\n Button: component,\n }),\n providers: joi.array().items(component),\n views: joi.alternatives().try(\n joi.object({\n Account: joi.alternatives().try(component, adminViewSchema),\n Dashboard: joi.alternatives().try(component, adminViewSchema),\n }),\n joi.object().pattern(joi.string(), component),\n ),\n }),\n custom: joi.object().pattern(joi.string(), joi.any()),\n dateFormat: joi.string(),\n disable: joi.bool(),\n inactivityRoute: joi.string(),\n livePreview: joi.object({\n ...livePreviewSchema,\n collections: joi.array().items(joi.string()),\n globals: joi.array().items(joi.string()),\n }),\n logoutRoute: joi.string(),\n meta: joi.object().keys({\n favicon: joi.string(),\n ogImage: joi.string(),\n titleSuffix: joi.string(),\n }),\n user: joi.string(),\n }),\n bin: joi.array().items(\n joi.object().keys({\n key: joi.string(),\n scriptPath: joi.string(),\n }),\n ),\n collections: joi.array(),\n cookiePrefix: joi.string(),\n cors: [joi.string().valid('*'), joi.array().items(joi.string())],\n csrf: joi.array().items(joi.string().allow('')).sparse(),\n custom: joi.object().pattern(joi.string(), joi.any()),\n db: joi.any(),\n debug: joi.boolean(),\n defaultDepth: joi.number().min(0).max(30),\n defaultMaxTextLength: joi.number(),\n editor: joi\n .object()\n .required()\n .keys({\n CellComponent: componentSchema.optional(),\n FieldComponent: componentSchema.optional(),\n afterReadPromise: joi.func().optional(),\n outputSchema: joi.func().optional(),\n populationPromise: joi.func().optional(),\n validate: joi.func().required(),\n })\n .unknown(),\n email: joi.object(),\n endpoints: endpointsSchema,\n globals: joi.array(),\n graphQL: joi.object().keys({\n disable: joi.boolean(),\n disablePlaygroundInProduction: joi.boolean(),\n maxComplexity: joi.number(),\n mutations: joi.function(),\n queries: joi.function(),\n }),\n hooks: joi.object().keys({\n afterError: joi.func(),\n }),\n i18n: joi.object(),\n indexSortableFields: joi.boolean(),\n local: joi.boolean(),\n localization: joi.alternatives().try(\n joi.object().keys({\n defaultLocale: joi.string(),\n fallback: joi.boolean(),\n localeCodes: joi.array().items(joi.string()),\n locales: joi.alternatives().try(\n joi.array().items(\n joi.object().keys({\n code: joi.string(),\n fallbackLocale: joi.string(),\n label: joi\n .alternatives()\n .try(\n joi.object().pattern(joi.string(), [joi.string()]),\n joi.string(),\n joi.valid(false),\n ),\n rtl: joi.boolean(),\n toString: joi.func(),\n }),\n ),\n joi.array().items(joi.string()),\n ),\n }),\n joi.boolean(),\n ),\n maxDepth: joi.number().min(0).max(100),\n onInit: joi.func(),\n plugins: joi.array().items(joi.func()),\n routes: joi.object({\n admin: joi.string(),\n api: joi.string(),\n graphQL: joi.string(),\n graphQLPlayground: joi.string(),\n }),\n secret: joi.string(),\n serverURL: joi\n .string()\n .uri()\n .allow('')\n .custom((value, helper) => {\n const urlWithoutProtocol = value.split('//')[1]\n\n if (!urlWithoutProtocol) {\n return helper.message({\n custom: 'You need to include either \"https://\" or \"http://\" in your serverURL.',\n })\n }\n\n if (urlWithoutProtocol.indexOf('/') > -1) {\n return helper.message({\n custom:\n 'Your serverURL cannot have a path. It can only contain a protocol, a domain, and an optional port.',\n })\n }\n\n return value\n }),\n sharp: joi.any(),\n telemetry: joi.boolean(),\n typescript: joi.object({\n declare: joi.boolean(),\n outputFile: joi.string(),\n }),\n upload: joi.object(),\n})\n"],"names":["joi","adminViewSchema","componentSchema","livePreviewSchema","component","alternatives","try","object","unknown","func","endpointsSchema","array","items","custom","pattern","string","any","handler","method","valid","path","root","bool","boolean","admin","autoLogin","keys","email","password","prefillOnly","avatar","buildPath","components","Nav","actions","afterDashboard","afterLogin","afterNavLinks","beforeDashboard","beforeLogin","beforeNavLinks","graphics","Icon","Logo","logout","Button","providers","views","Account","Dashboard","dateFormat","disable","inactivityRoute","livePreview","collections","globals","logoutRoute","meta","favicon","ogImage","titleSuffix","user","bin","key","scriptPath","cookiePrefix","cors","csrf","allow","sparse","db","debug","defaultDepth","number","min","max","defaultMaxTextLength","editor","required","CellComponent","optional","FieldComponent","afterReadPromise","outputSchema","populationPromise","validate","endpoints","graphQL","disablePlaygroundInProduction","maxComplexity","mutations","function","queries","hooks","afterError","i18n","indexSortableFields","local","localization","defaultLocale","fallback","localeCodes","locales","code","fallbackLocale","label","rtl","toString","maxDepth","onInit","plugins","routes","api","graphQLPlayground","secret","serverURL","uri","value","helper","urlWithoutProtocol","split","message","indexOf","sharp","telemetry","typescript","declare","outputFile","upload"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,SAAS,MAAK;AAErB,SAASC,eAAe,QAAQ,8BAA6B;AAC7D,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,8BAA6B;AAEhF,MAAMC,YAAYJ,IAAIK,YAAY,GAAGC,GAAG,CAACN,IAAIO,MAAM,GAAGC,OAAO,IAAIR,IAAIS,IAAI;AAEzE,OAAO,MAAMC,kBAAkBV,IAAIK,YAAY,GAAGC,GAAG,CACnDN,IAAIW,KAAK,GAAGC,KAAK,CACfZ,IAAIO,MAAM,CAAC;IACTM,QAAQb,IAAIO,MAAM,GAAGO,OAAO,CAACd,IAAIe,MAA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AC,OAAO,CAAC,GAAG;YACxC,OAAOJ,OAAOG,OAAO,CAAC;gBACpB5G,QACE;YACJ;QACF;QAEA,OAAOwG;IACT;IACFM,OAAO3H,IAAIgB,GAAG;IACd4G,WAAW5H,IAAIuB,OAAO;IACtBsG,YAAY7H,IAAIO,MAAM,CAAC;QACrBuH,SAAS9H,IAAIuB,OAAO;QACpBwG,YAAY/H,IAAIe,MAAM;IACxB;IACAiH,QAAQhI,IAAIO,MAAM;AACpB,GAAE"}
|
|
1
|
+
{"version":3,"sources":["../../src/config/schema.ts"],"sourcesContent":["import joi from 'joi'\n\nimport { adminViewSchema } from './shared/adminViewSchema.js'\nimport { componentSchema, livePreviewSchema } from './shared/componentSchema.js'\n\nconst component = joi.alternatives().try(joi.object().unknown(), joi.func())\n\nexport const endpointsSchema = joi.alternatives().try(\n joi.array().items(\n joi.object({\n custom: joi.object().pattern(joi.string(), joi.any()),\n handler: joi.alternatives().try(joi.array().items(joi.func()), joi.func()),\n method: joi\n .string()\n .valid('get', 'head', 'post', 'put', 'patch', 'delete', 'connect', 'options'),\n path: joi.string(),\n root: joi.bool(),\n }),\n ),\n joi.boolean(),\n)\n\nexport default joi.object({\n admin: joi.object({\n autoLogin: joi.alternatives().try(\n joi.object().keys({\n email: joi.string(),\n password: joi.string(),\n prefillOnly: joi.boolean(),\n }),\n joi.boolean(),\n ),\n avatar: joi.alternatives().try(joi.string(), component),\n buildPath: joi.string(),\n components: joi.object().keys({\n Nav: component,\n actions: joi.array().items(component),\n afterDashboard: joi.array().items(component),\n afterLogin: joi.array().items(component),\n afterNavLinks: joi.array().items(component),\n beforeDashboard: joi.array().items(component),\n beforeLogin: joi.array().items(component),\n beforeNavLinks: joi.array().items(component),\n graphics: joi.object({\n Icon: component,\n Logo: component,\n }),\n logout: joi.object({\n Button: component,\n }),\n providers: joi.array().items(component),\n views: joi.alternatives().try(\n joi.object({\n Account: joi.alternatives().try(component, adminViewSchema),\n Dashboard: joi.alternatives().try(component, adminViewSchema),\n }),\n joi.object().pattern(joi.string(), component),\n ),\n }),\n custom: joi.object().pattern(joi.string(), joi.any()),\n dateFormat: joi.string(),\n disable: joi.bool(),\n inactivityRoute: joi.string(),\n livePreview: joi.object({\n ...livePreviewSchema,\n collections: joi.array().items(joi.string()),\n globals: joi.array().items(joi.string()),\n }),\n logoutRoute: joi.string(),\n meta: joi.object().keys({\n favicon: joi.string(),\n ogImage: joi.string(),\n titleSuffix: joi.string(),\n }),\n user: joi.string(),\n }),\n bin: joi.array().items(\n joi.object().keys({\n key: joi.string(),\n scriptPath: joi.string(),\n }),\n ),\n collections: joi.array(),\n cookiePrefix: joi.string(),\n cors: [joi.string().valid('*'), joi.array().items(joi.string())],\n csrf: joi.array().items(joi.string().allow('')).sparse(),\n custom: joi.object().pattern(joi.string(), joi.any()),\n db: joi.any(),\n debug: joi.boolean(),\n defaultDepth: joi.number().min(0).max(30),\n defaultMaxTextLength: joi.number(),\n editor: joi\n .object()\n .required()\n .keys({\n CellComponent: componentSchema.optional(),\n FieldComponent: componentSchema.optional(),\n afterReadPromise: joi.func().optional(),\n outputSchema: joi.func().optional(),\n populationPromise: joi.func().optional(),\n validate: joi.func().required(),\n })\n .unknown(),\n email: joi.alternatives().try(joi.object(), joi.func()),\n endpoints: endpointsSchema,\n globals: joi.array(),\n graphQL: joi.object().keys({\n disable: joi.boolean(),\n disablePlaygroundInProduction: joi.boolean(),\n maxComplexity: joi.number(),\n mutations: joi.function(),\n queries: joi.function(),\n }),\n hooks: joi.object().keys({\n afterError: joi.func(),\n }),\n i18n: joi.object(),\n indexSortableFields: joi.boolean(),\n local: joi.boolean(),\n localization: joi.alternatives().try(\n joi.object().keys({\n defaultLocale: joi.string(),\n fallback: joi.boolean(),\n localeCodes: joi.array().items(joi.string()),\n locales: joi.alternatives().try(\n joi.array().items(\n joi.object().keys({\n code: joi.string(),\n fallbackLocale: joi.string(),\n label: joi\n .alternatives()\n .try(\n joi.object().pattern(joi.string(), [joi.string()]),\n joi.string(),\n joi.valid(false),\n ),\n rtl: joi.boolean(),\n toString: joi.func(),\n }),\n ),\n joi.array().items(joi.string()),\n ),\n }),\n joi.boolean(),\n ),\n maxDepth: joi.number().min(0).max(100),\n onInit: joi.func(),\n plugins: joi.array().items(joi.func()),\n routes: joi.object({\n admin: joi.string(),\n api: joi.string(),\n graphQL: joi.string(),\n graphQLPlayground: joi.string(),\n }),\n secret: joi.string(),\n serverURL: joi\n .string()\n .uri()\n .allow('')\n .custom((value, helper) => {\n const urlWithoutProtocol = value.split('//')[1]\n\n if (!urlWithoutProtocol) {\n return helper.message({\n custom: 'You need to include either \"https://\" or \"http://\" in your serverURL.',\n })\n }\n\n if (urlWithoutProtocol.indexOf('/') > -1) {\n return helper.message({\n custom:\n 'Your serverURL cannot have a path. It can only contain a protocol, a domain, and an optional port.',\n })\n }\n\n return value\n }),\n sharp: joi.any(),\n telemetry: joi.boolean(),\n typescript: joi.object({\n declare: joi.boolean(),\n outputFile: joi.string(),\n }),\n upload: joi.object(),\n})\n"],"names":["joi","adminViewSchema","componentSchema","livePreviewSchema","component","alternatives","try","object","unknown","func","endpointsSchema","array","items","custom","pattern","string","any","handler","method","valid","path","root","bool","boolean","admin","autoLogin","keys","email","password","prefillOnly","avatar","buildPath","components","Nav","actions","afterDashboard","afterLogin","afterNavLinks","beforeDashboard","beforeLogin","beforeNavLinks","graphics","Icon","Logo","logout","Button","providers","views","Account","Dashboard","dateFormat","disable","inactivityRoute","livePreview","collections","globals","logoutRoute","meta","favicon","ogImage","titleSuffix","user","bin","key","scriptPath","cookiePrefix","cors","csrf","allow","sparse","db","debug","defaultDepth","number","min","max","defaultMaxTextLength","editor","required","CellComponent","optional","FieldComponent","afterReadPromise","outputSchema","populationPromise","validate","endpoints","graphQL","disablePlaygroundInProduction","maxComplexity","mutations","function","queries","hooks","afterError","i18n","indexSortableFields","local","localization","defaultLocale","fallback","localeCodes","locales","code","fallbackLocale","label","rtl","toString","maxDepth","onInit","plugins","routes","api","graphQLPlayground","secret","serverURL","uri","value","helper","urlWithoutProtocol","split","message","indexOf","sharp","telemetry","typescript","declare","outputFile","upload"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,SAAS,MAAK;AAErB,SAASC,eAAe,QAAQ,8BAA6B;AAC7D,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,8BAA6B;AAEhF,MAAMC,YAAYJ,IAAIK,YAAY,GAAGC,GAAG,CAACN,IAAIO,MAAM,GAAGC,OAAO,IAAIR,IAAIS,IAAI;AAEzE,OAAO,MAAMC,kBAAkBV,IAAIK,YAAY,GAAGC,GAAG,CACnDN,IAAIW,KAAK,GAAGC,KAAK,CACfZ,IAAIO,MAAM,CAAC;IACTM,QAAQb,IAAIO,MAAM,GAAGO,OAAO,CAACd,IAAIe,MAAM,IAAIf,IAAIgB,GAAG;IAClDC,SAASjB,IAAIK,YAAY,GAAGC,GAAG,CAACN,IAAIW,KAAK,GAAGC,KAAK,CAACZ,IAAIS,IAAI,KAAKT,IAAIS,IAAI;IACvES,QAAQlB,IACLe,MAAM,GACNI,KAAK,CAAC,OAAO,QAAQ,QAAQ,OAAO,SAAS,UAAU,WAAW;IACrEC,MAAMpB,IAAIe,MAAM;IAChBM,MAAMrB,IAAIsB,IAAI;AAChB,KAEFtB,IAAIuB,OAAO,IACZ;AAED,eAAevB,IAAIO,MAAM,CAAC;IACxBiB,OAAOxB,IAAIO,MAAM,CAAC;QAChBkB,WAAWzB,IAAIK,YAAY,GAAGC,GAAG,CAC/BN,IAAIO,MAAM,GAAGmB,IAAI,CAAC;YAChBC,OAAO3B,IAAIe,MAAM;YACjBa,UAAU5B,IAAIe,MAAM;YACpBc,aAAa7B,IAAIuB,OAAO;QAC1B,IACAvB,IAAIuB,OAAO;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,GAAGC,KAAK,CAACZ,IAAIe,MAAM;IAEhC,IACAf,IAAIuB,OAAO;IAEbqF,UAAU5G,IAAIyE,MAAM,GAAGC,GAAG,CAAC,GAAGC,GAAG,CAAC;IAClCkC,QAAQ7G,IAAIS,IAAI;IAChBqG,SAAS9G,IAAIW,KAAK,GAAGC,KAAK,CAACZ,IAAIS,IAAI;IACnCsG,QAAQ/G,IAAIO,MAAM,CAAC;QACjBiB,OAAOxB,IAAIe,MAAM;QACjBiG,KAAKhH,IAAIe,MAAM;QACfwE,SAASvF,IAAIe,MAAM;QACnBkG,mBAAmBjH,IAAIe,MAAM;IAC/B;IACAmG,QAAQlH,IAAIe,MAAM;IAClBoG,WAAWnH,IACRe,MAAM,GACNqG,GAAG,GACHhD,KAAK,CAAC,IACNvD,MAAM,CAAC,CAACwG,OAAOC;QACd,MAAMC,qBAAqBF,MAAMG,KAAK,CAAC,KAAK,CAAC,EAAE;QAE/C,IAAI,CAACD,oBAAoB;YACvB,OAAOD,OAAOG,OAAO,CAAC;gBACpB5G,QAAQ;YACV;QACF;QAEA,IAAI0G,mBAAmBG,OAAO,CAAC,OAAO,CAAC,GAAG;YACxC,OAAOJ,OAAOG,OAAO,CAAC;gBACpB5G,QACE;YACJ;QACF;QAEA,OAAOwG;IACT;IACFM,OAAO3H,IAAIgB,GAAG;IACd4G,WAAW5H,IAAIuB,OAAO;IACtBsG,YAAY7H,IAAIO,MAAM,CAAC;QACrBuH,SAAS9H,IAAIuB,OAAO;QACpBwG,YAAY/H,IAAIe,MAAM;IACxB;IACAiH,QAAQhI,IAAIO,MAAM;AACpB,GAAE"}
|
package/dist/config/types.d.ts
CHANGED
|
@@ -561,7 +561,7 @@ export type Config = {
|
|
|
561
561
|
*/
|
|
562
562
|
upload?: ExpressFileUploadOptions;
|
|
563
563
|
};
|
|
564
|
-
export type SanitizedConfig = Omit<DeepRequired<Config>, 'collections' | 'endpoint' | 'globals' | 'i18n' | 'localization'> & {
|
|
564
|
+
export type SanitizedConfig = Omit<DeepRequired<Config>, 'collections' | 'endpoint' | 'globals' | 'i18n' | 'localization' | 'upload'> & {
|
|
565
565
|
collections: SanitizedCollectionConfig[];
|
|
566
566
|
endpoints: Endpoint[];
|
|
567
567
|
globals: SanitizedGlobalConfig[];
|
|
@@ -572,6 +572,12 @@ export type SanitizedConfig = Omit<DeepRequired<Config>, 'collections' | 'endpoi
|
|
|
572
572
|
configDir: string;
|
|
573
573
|
rawConfig: string;
|
|
574
574
|
};
|
|
575
|
+
upload: ExpressFileUploadOptions & {
|
|
576
|
+
/**
|
|
577
|
+
* Deduped list of adapters used in the project
|
|
578
|
+
*/
|
|
579
|
+
adapters: string[];
|
|
580
|
+
};
|
|
575
581
|
};
|
|
576
582
|
export type EditConfig = ({
|
|
577
583
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACtE,OAAO,KAAK,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAC7E,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAK,MAAM,MAAM,CAAA;AAC/D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACjF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,KAAK,EACV,cAAc,EACd,U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AG,KAAK,CAAA;IACjD,KAAK,EAAE;QACL,MAAM,EAAE,MAAM,CAAA;QACd,SAAS,EAAE,MAAM,CAAA;QACjB,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;IACD,MAAM,EAAE,wBAAwB,GAAG;QACjC;;WAEG;QACH,QAAQ,EAAE,MAAM,EAAE,CAAA;KACnB,CAAA;CACF,CAAA;AAED,MAAM,MAAM,UAAU,GAClB,CACI;IACE;;;;;;;;;;OAUG;IACH,GAAG,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;IACjD,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;IACrD,WAAW,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;IACzD,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;IACrD,QAAQ,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;CAIvD,GACD;IACE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;CAC9B,CACJ,GACD,iBAAiB,CAAA;AAErB,MAAM,MAAM,0BAA0B,GAAG,eAAe,CAAA;AAExD,MAAM,MAAM,yBAAyB,GAAG,MAAM,MAAM,CAAA;AAEpD,MAAM,MAAM,iBAAiB,GACzB,0BAA0B,GAC1B,yBAAyB,GACzB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACtB,MAAM,CAAA;AAEV,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAA"}
|
package/dist/config/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config/types.ts"],"sourcesContent":["import type { I18nOptions, TFunction } from '@payloadcms/translations'\nimport type { Options as ExpressFileUploadOptions } from 'express-fileupload'\nimport type GraphQL from 'graphql'\nimport type { DestinationStream, LoggerOptions, P } from 'pino'\nimport type React from 'react'\nimport type { default as sharp } from 'sharp'\nimport type { DeepRequired } from 'ts-essentials'\n\nimport type { DocumentTab, RichTextAdapter } from '../admin/types.js'\nimport type { AdminView, ServerSideEditViewProps } from '../admin/views/types.js'\nimport type { User } from '../auth/types.js'\nimport type {\n AfterErrorHook,\n Collection,\n CollectionConfig,\n SanitizedCollectionConfig,\n} from '../collections/config/types.js'\nimport type { DatabaseAdapterResult } from '../database/types.js'\nimport type { EmailAdapter, SendEmailOptions } from '../email/types.js'\nimport type { GlobalConfig, Globals, SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { Payload } from '../index.js'\nimport type { PayloadRequest, PayloadRequestWithData, Where } from '../types/index.js'\nimport type { PayloadLogger } from '../utilities/logger.js'\n\nexport type BinScriptConfig = {\n key: string\n scriptPath: string\n}\n\nexport type BinScript = (config: SanitizedConfig) => Promise<void> | void\n\ntype Prettify<T> = {\n [K in keyof T]: T[K]\n} & NonNullable<unknown>\n\n// eslint-disable-next-line no-use-before-define\nexport type Plugin = (config: Config) => Config | Promise<Config>\n\nexport type LivePreviewConfig = {\n /**\n Device breakpoints to use for the `iframe` of the Live Preview window.\n Options are displayed in the Live Preview toolbar.\n The `responsive` breakpoint is included by default.\n */\n breakpoints?: {\n height: number | string\n label: string\n name: string\n width: number | string\n }[]\n /**\n The URL of the frontend application. This will be rendered within an `iframe` as its `src`.\n Payload will send a `window.postMessage()` to this URL with the document data in real-time.\n The frontend application is responsible for receiving the message and updating the UI accordingly.\n Use the `useLivePreview` hook to get started in React applications.\n */\n url?:\n | ((args: {\n collectionConfig?: SanitizedCollectionConfig\n data: Record<string, any>\n globalConfig?: SanitizedGlobalConfig\n locale: Locale\n payload: Payload\n }) => Promise<string> | string)\n | string\n}\n\nexport type ServerOnlyLivePreviewProperties = keyof Pick<LivePreviewConfig, 'url'>\n\ntype GeneratePreviewURLOptions = {\n locale: string\n req: PayloadRequestWithData\n token: null | string\n}\n\nexport type GeneratePreviewURL = (\n doc: Record<string, unknown>,\n options: GeneratePreviewURLOptions,\n) => Promise<null | string> | null | string\n\nexport type GraphQLInfo = {\n Mutation: {\n fields: Record<string, any>\n name: string\n }\n Query: {\n fields: Record<string, any>\n name: string\n }\n collections: {\n [slug: number | string | symbol]: Collection\n }\n globals: Globals\n types: {\n arrayTypes: Record<string, GraphQL.GraphQLType>\n blockInputTypes: Record<string, GraphQL.GraphQLInputObjectType>\n blockTypes: Record<string, GraphQL.GraphQLObjectType>\n fallbackLocaleInputType?: GraphQL.GraphQLEnumType | GraphQL.GraphQLScalarType\n groupTypes: Record<string, GraphQL.GraphQLObjectType>\n localeInputType?: GraphQL.GraphQLEnumType | GraphQL.GraphQLScalarType\n tabTypes: Record<string, GraphQL.GraphQLObjectType>\n }\n}\nexport type GraphQLExtension = (\n graphQL: typeof GraphQL,\n context: {\n config: SanitizedConfig\n } & GraphQLInfo,\n) => Record<string, unknown>\n\nexport type InitOptions = {\n /**\n * Sometimes, with the local API, you might need to pass a config file directly, for example, serverless on Vercel\n * The passed config should match the config file, and if it doesn't, there could be mismatches between the admin UI\n * and the backend functionality\n */\n config: Promise<SanitizedConfig> | SanitizedConfig\n /**\n * Disable connect to the database on init\n */\n disableDBConnect?: boolean\n\n /**\n * Disable running of the `onInit` function\n */\n disableOnInit?: boolean\n\n /**\n * A previously instantiated logger instance. Must conform to the PayloadLogger interface which uses Pino\n * This allows you to bring your own logger instance and let payload use it\n */\n logger?: PayloadLogger\n\n loggerDestination?: DestinationStream\n\n /**\n * Specify options for the built-in Pino logger that Payload uses for internal logging.\n *\n * See Pino Docs for options: https://getpino.io/#/docs/api?id=options\n */\n loggerOptions?: LoggerOptions\n /**\n * A function that is called immediately following startup that receives the Payload instance as it's only argument.\n */\n onInit?: (payload: Payload) => Promise<void> | void\n}\n\n/**\n * This result is calculated on the server\n * and then sent to the client allowing the dashboard to show accessible data and actions.\n *\n * If the result is `true`, the user has access.\n * If the result is an object, it is interpreted as a MongoDB query.\n *\n * @example `{ createdBy: { equals: id } }`\n *\n * @example `{ tenant: { in: tenantIds } }`\n *\n * @see https://payloadcms.com/docs/access-control/overview\n */\nexport type AccessResult = Where | boolean\n\nexport type AccessArgs<T = any, U = any> = {\n /**\n * The relevant resource that is being accessed.\n *\n * `data` is null when a list is requested\n */\n data?: T\n /** ID of the resource being accessed */\n id?: number | string\n /** If true, the request is for a static file */\n isReadingStaticFile?: boolean\n /** The original request that requires an access check */\n req: PayloadRequestWithData<U>\n}\n\n/**\n * Access function runs on the server\n * and is sent to the client allowing the dashboard to show accessible data and actions.\n *\n * @see https://payloadcms.com/docs/access-control/overview\n */\nexport type Access<T = any, U = any> = (\n args: AccessArgs<T, U>,\n) => AccessResult | Promise<AccessResult>\n\n/** Web Request/Response model, but the the req has more payload specific properties added to it. */\nexport type PayloadHandler = (req: PayloadRequest) => Promise<Response> | Response\n\n/**\n * Docs: https://payloadcms.com/docs/rest-api/overview#custom-endpoints\n */\nexport type Endpoint<U = User> = {\n /** Extension point to add your custom data. */\n custom?: Record<string, any>\n\n /**\n * Middleware that will be called when the path/method matches\n *\n * Compatible with Web Request/Response Model\n */\n handler: PayloadHandler\n /** HTTP method (or \"all\") */\n method: 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put'\n /**\n * Pattern that should match the path of the incoming request\n *\n * Compatible with the Express router\n */\n path: string\n /**\n * Please add \"root\" routes under the /api folder in the Payload Project.\n * https://nextjs.org/docs/app/api-reference/file-conventions/route\n *\n * @deprecated in 3.0\n */\n root?: never\n}\n\nexport type EditViewComponent = React.ComponentType<ServerSideEditViewProps>\n\nexport type EditViewConfig =\n | {\n /**\n * Add a new Edit view to the admin panel\n * i.e. you can render a custom view that has no tab, if desired\n * Or override a specific properties of an existing one\n * i.e. you can customize the `Default` view tab label, if desired\n */\n Tab?: DocumentTab\n path?: string\n }\n | {\n Component: EditViewComponent\n path: string\n }\n | {\n actions?: CustomComponent[]\n }\n\n/**\n * Override existing views\n * i.e. Dashboard, Account, API, LivePreview, etc.\n * Path is not available here\n * All Tab properties become optional\n * i.e. you can change just the label, if desired\n */\nexport type EditView = EditViewComponent | EditViewConfig\n\nexport type ServerProps = {\n payload: Payload\n}\n\nexport const serverProps: (keyof ServerProps)[] = ['payload']\n\nexport type CustomComponent<T extends any = any> = React.ComponentType<T & ServerProps>\n\nexport type Locale = {\n /**\n * value of supported locale\n * @example \"en\"\n */\n code: string\n /**\n * Code of another locale to use when reading documents with fallback, if not specified defaultLocale is used\n */\n fallbackLocale?: string\n /**\n * label of supported locale\n * @example \"English\"\n */\n label: Record<string, string> | string\n /**\n * if true, defaults textAligmnent on text fields to RTL\n */\n rtl?: boolean\n}\n\nexport type BaseLocalizationConfig = {\n /**\n * Locale for users that have not expressed their preference for a specific locale\n * @example `\"en\"`\n */\n defaultLocale: string\n /** Set to `true` to let missing values in localised fields fall back to the values in `defaultLocale` */\n fallback?: boolean\n}\n\nexport type LocalizationConfigWithNoLabels = Prettify<\n BaseLocalizationConfig & {\n /**\n * List of supported locales\n * @example `[\"en\", \"es\", \"fr\", \"nl\", \"de\", \"jp\"]`\n */\n locales: string[]\n }\n>\n\nexport type LocalizationConfigWithLabels = Prettify<\n BaseLocalizationConfig & {\n /**\n * List of supported locales with labels\n * @example {\n * label: 'English',\n * value: 'en',\n * rtl: false\n * }\n */\n locales: Locale[]\n }\n>\n\nexport type SanitizedLocalizationConfig = Prettify<\n LocalizationConfigWithLabels & {\n /**\n * List of supported locales\n * @example `[\"en\", \"es\", \"fr\", \"nl\", \"de\", \"jp\"]`\n */\n localeCodes: string[]\n }\n>\n\n/**\n * @see https://payloadcms.com/docs/configuration/localization#localization\n */\nexport type LocalizationConfig = Prettify<\n LocalizationConfigWithLabels | LocalizationConfigWithNoLabels\n>\n\nexport type LabelFunction = ({ t }: { t: TFunction }) => string\n\nexport type SharpDependency = (\n input?:\n | ArrayBuffer\n | Buffer\n | Float32Array\n | Float64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | string,\n options?: sharp.SharpOptions,\n) => sharp.Sharp\n\n/**\n * This is the central configuration\n *\n * @see https://payloadcms.com/docs/configuration/overview\n */\nexport type Config = {\n /** Configure admin dashboard */\n admin?: {\n /** Automatically log in as a user when visiting the admin dashboard. */\n autoLogin?:\n | {\n /**\n * The email address of the user to login as\n *\n */\n email: string\n /** The password of the user to login as */\n password: string\n /**\n * If set to true, the login credentials will be prefilled but the user will still need to click the login button.\n *\n * @default false\n */\n prefillOnly?: boolean\n }\n | false\n /** Set account profile picture. Options: gravatar, default or a custom React component. */\n avatar?: 'default' | 'gravatar' | React.ComponentType<any>\n\n /**\n * Add extra and/or replace built-in components with custom components\n *\n * @see https://payloadcms.com/docs/admin/components\n */\n components?: {\n /**\n * Replace the navigation with a custom component\n */\n Nav?: CustomComponent\n /**\n * Add custom components to the top right of the Admin Panel\n */\n actions?: CustomComponent[]\n /**\n * Add custom components after the collection overview\n */\n afterDashboard?: CustomComponent[]\n /**\n * Add custom components after the email/password field\n */\n afterLogin?: CustomComponent[]\n /**\n * Add custom components after the navigation links\n */\n afterNavLinks?: CustomComponent[]\n /**\n * Add custom components before the collection overview\n */\n beforeDashboard?: CustomComponent[]\n /**\n * Add custom components before the email/password field\n */\n beforeLogin?: CustomComponent[]\n /**\n * Add custom components before the navigation links\n */\n beforeNavLinks?: CustomComponent[]\n /** Replace graphical components */\n graphics?: {\n /** Replace the icon in the navigation */\n Icon?: CustomComponent\n /** Replace the logo on the login page */\n Logo?: CustomComponent\n }\n /** Replace logout related components */\n logout?: {\n /** Replace the logout button */\n Button?: CustomComponent\n }\n /**\n * Wrap the admin dashboard in custom context providers\n */\n providers?: React.ComponentType<{ children?: React.ReactNode }>[]\n /**\n * Replace or modify top-level admin routes, or add new ones:\n * + `Account` - `/admin/account`\n * + `Dashboard` - `/admin`\n * + `:path` - `/admin/:path`\n */\n views?: {\n /** Add custom admin views */\n [key: string]: AdminView\n /** Replace the account screen */\n Account?: AdminView\n /** Replace the admin homepage */\n Dashboard?: AdminView\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /** Global date format that will be used for all dates in the Admin panel. Any valid date-fns format pattern can be used. */\n dateFormat?: string\n /** If set to true, the entire Admin panel will be disabled. */\n disable?: boolean\n /** The route the user will be redirected to after being inactive for too long. */\n inactivityRoute?: string\n livePreview?: LivePreviewConfig & {\n collections?: string[]\n globals?: string[]\n }\n /** The route for the logout page. */\n logoutRoute?: string\n /** Base meta data to use for the Admin panel. Included properties are titleSuffix, ogImage, and favicon. */\n meta?: {\n /**\n * Public path to an icon\n *\n * This image may be displayed in the browser next to the title of the page\n */\n favicon?: string\n /**\n * Public path to an image\n *\n * This image may be displayed as preview when the link is shared on social media\n */\n ogImage?: string\n /**\n * String to append to the <title> of admin pages\n * @example `\" - My Brand\"`\n */\n titleSuffix?: string\n }\n /** The slug of a Collection that you want be used to log in to the Admin dashboard. */\n user?: string\n }\n /** Custom Payload bin scripts can be injected via the config. */\n bin?: BinScriptConfig[]\n /**\n * Manage the datamodel of your application\n *\n * @see https://payloadcms.com/docs/configuration/collections#collection-configs\n */\n collections?: CollectionConfig[]\n /**\n * Replace the built-in components with custom ones\n */\n components?: { [key: string]: (() => JSX.Element) | JSX.Element }\n /**\n * Prefix a string to all cookies that Payload sets.\n *\n * @default \"payload\"\n */\n cookiePrefix?: string\n /** Either a whitelist array of URLS to allow CORS requests from, or a wildcard string ('*') to accept incoming requests from any domain. */\n cors?: '*' | string[]\n /** A whitelist array of URLs to allow Payload cookies to be accepted from as a form of CSRF protection. */\n csrf?: string[]\n\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n\n /** Pass in a database adapter for use on this project. */\n db: DatabaseAdapterResult\n /** Enable to expose more detailed error information. */\n debug?: boolean\n /**\n * If a user does not specify `depth` while requesting a resource, this depth will be used.\n *\n * @see https://payloadcms.com/docs/getting-started/concepts#depth\n *\n * @default 2\n */\n defaultDepth?: number\n /**\n * The maximum allowed depth to be permitted application-wide. This setting helps prevent against malicious queries.\n *\n * @default 40000\n */\n defaultMaxTextLength?: number\n /** Default richtext editor to use for richText fields */\n editor: RichTextAdapter<any, any, any>\n /**\n * Email Adapter\n *\n * @see https://payloadcms.com/docs/email/overview\n */\n email?: EmailAdapter | Promise<EmailAdapter>\n /** Custom REST endpoints */\n endpoints?: Endpoint[]\n /**\n * @see https://payloadcms.com/docs/configuration/globals#global-configs\n */\n globals?: GlobalConfig[]\n /**\n * Manage the GraphQL API\n *\n * You can add your own GraphQL queries and mutations to Payload, making use of all the types that Payload has defined for you.\n *\n * @see https://payloadcms.com/docs/graphql/overview\n */\n graphQL?: {\n disable?: boolean\n disablePlaygroundInProduction?: boolean\n maxComplexity?: number\n /**\n * Function that returns an object containing keys to custom GraphQL mutations\n *\n * @see https://payloadcms.com/docs/graphql/extending\n */\n mutations?: GraphQLExtension\n /**\n * Function that returns an object containing keys to custom GraphQL queries\n *\n * @see https://payloadcms.com/docs/graphql/extending\n */\n queries?: GraphQLExtension\n }\n /**\n * Tap into Payload-wide hooks.\n *\n * @see https://payloadcms.com/docs/hooks/overview\n */\n hooks?: {\n afterError?: AfterErrorHook\n }\n /** i18n config settings */\n i18n?: I18nOptions\n /** Automatically index all sortable top-level fields in the database to improve sort performance and add database compatibility for Azure Cosmos and similar. */\n indexSortableFields?: boolean\n /**\n * Translate your content to different languages/locales.\n *\n * @default false // disable localization\n */\n localization?: LocalizationConfig | false\n /**\n * The maximum allowed depth to be permitted application-wide. This setting helps prevent against malicious queries.\n *\n * @see https://payloadcms.com/docs/getting-started/concepts#depth\n *\n * @default 10\n */\n maxDepth?: number\n /** A function that is called immediately following startup that receives the Payload instance as its only argument. */\n onInit?: (payload: Payload) => Promise<void> | void\n /**\n * An array of Payload plugins.\n *\n * @see https://payloadcms.com/docs/plugins/overview\n */\n plugins?: Plugin[]\n /** Control the routing structure that Payload binds itself to. */\n routes?: {\n /** @default \"/admin\" */\n admin?: string\n /** @default \"/api\" */\n api?: string\n /** @default \"/graphql\" */\n graphQL?: string\n /** @default \"/graphql-playground\" */\n graphQLPlayground?: string\n }\n /** Secure string that Payload will use for any encryption workflows */\n secret: string\n /**\n * Define the absolute URL of your app including the protocol, for example `https://example.org`.\n * No paths allowed, only protocol, domain and (optionally) port.\n *\n * @see https://payloadcms.com/docs/configuration/overview#options\n */\n serverURL?: string\n /**\n * Pass in a local copy of Sharp if you'd like to use it.\n *\n */\n sharp?: SharpDependency\n /** Send anonymous telemetry data about general usage. */\n telemetry?: boolean\n /** Control how typescript interfaces are generated from your collections. */\n typescript?: {\n /** Disable declare block in generated types file */\n declare?: false\n /** Filename to write the generated types to */\n outputFile?: string\n }\n /**\n * Customize the handling of incoming file uploads for collections that have uploads enabled.\n */\n upload?: ExpressFileUploadOptions\n}\n\nexport type SanitizedConfig = Omit<\n DeepRequired<Config>,\n 'collections' | 'endpoint' | 'globals' | 'i18n' | 'localization'\n> & {\n collections: SanitizedCollectionConfig[]\n endpoints: Endpoint[]\n globals: SanitizedGlobalConfig[]\n i18n: Required<I18nOptions>\n localization: SanitizedLocalizationConfig | false\n paths: {\n config: string\n configDir: string\n rawConfig: string\n }\n}\n\nexport type EditConfig =\n | (\n | {\n /**\n * Replace or modify individual nested routes, or add new ones:\n * + `Default` - `/admin/collections/:collection/:id`\n * + `API` - `/admin/collections/:collection/:id/api`\n * + `LivePreview` - `/admin/collections/:collection/:id/preview`\n * + `References` - `/admin/collections/:collection/:id/references`\n * + `Relationships` - `/admin/collections/:collection/:id/relationships`\n * + `Versions` - `/admin/collections/:collection/:id/versions`\n * + `Version` - `/admin/collections/:collection/:id/versions/:version`\n * + `CustomView` - `/admin/collections/:collection/:id/:path`\n */\n API?: EditViewComponent | Partial<EditViewConfig>\n Default?: EditViewComponent | Partial<EditViewConfig>\n LivePreview?: EditViewComponent | Partial<EditViewConfig>\n Version?: EditViewComponent | Partial<EditViewConfig>\n Versions?: EditViewComponent | Partial<EditViewConfig>\n // TODO: uncomment these as they are built\n // References?: EditView\n // Relationships?: EditView\n }\n | {\n [key: string]: EditViewConfig\n }\n )\n | EditViewComponent\n\nexport type EntityDescriptionComponent = CustomComponent\n\nexport type EntityDescriptionFunction = () => string\n\nexport type EntityDescription =\n | EntityDescriptionComponent\n | EntityDescriptionFunction\n | Record<string, string>\n | string\n\nexport type { EmailAdapter, SendEmailOptions }\n"],"names":["serverProps"],"rangeMappings":";;","mappings":"AA8PA,OAAO,MAAMA,cAAqC;IAAC;CAAU,CAAA"}
|
|
1
|
+
{"version":3,"sources":["../../src/config/types.ts"],"sourcesContent":["import type { I18nOptions, TFunction } from '@payloadcms/translations'\nimport type { Options as ExpressFileUploadOptions } from 'express-fileupload'\nimport type GraphQL from 'graphql'\nimport type { DestinationStream, LoggerOptions, P } from 'pino'\nimport type React from 'react'\nimport type { default as sharp } from 'sharp'\nimport type { DeepRequired } from 'ts-essentials'\n\nimport type { DocumentTab, RichTextAdapter } from '../admin/types.js'\nimport type { AdminView, ServerSideEditViewProps } from '../admin/views/types.js'\nimport type { User } from '../auth/types.js'\nimport type {\n AfterErrorHook,\n Collection,\n CollectionConfig,\n SanitizedCollectionConfig,\n} from '../collections/config/types.js'\nimport type { DatabaseAdapterResult } from '../database/types.js'\nimport type { EmailAdapter, SendEmailOptions } from '../email/types.js'\nimport type { GlobalConfig, Globals, SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { Payload } from '../index.js'\nimport type { PayloadRequest, PayloadRequestWithData, Where } from '../types/index.js'\nimport type { PayloadLogger } from '../utilities/logger.js'\n\nexport type BinScriptConfig = {\n key: string\n scriptPath: string\n}\n\nexport type BinScript = (config: SanitizedConfig) => Promise<void> | void\n\ntype Prettify<T> = {\n [K in keyof T]: T[K]\n} & NonNullable<unknown>\n\n// eslint-disable-next-line no-use-before-define\nexport type Plugin = (config: Config) => Config | Promise<Config>\n\nexport type LivePreviewConfig = {\n /**\n Device breakpoints to use for the `iframe` of the Live Preview window.\n Options are displayed in the Live Preview toolbar.\n The `responsive` breakpoint is included by default.\n */\n breakpoints?: {\n height: number | string\n label: string\n name: string\n width: number | string\n }[]\n /**\n The URL of the frontend application. This will be rendered within an `iframe` as its `src`.\n Payload will send a `window.postMessage()` to this URL with the document data in real-time.\n The frontend application is responsible for receiving the message and updating the UI accordingly.\n Use the `useLivePreview` hook to get started in React applications.\n */\n url?:\n | ((args: {\n collectionConfig?: SanitizedCollectionConfig\n data: Record<string, any>\n globalConfig?: SanitizedGlobalConfig\n locale: Locale\n payload: Payload\n }) => Promise<string> | string)\n | string\n}\n\nexport type ServerOnlyLivePreviewProperties = keyof Pick<LivePreviewConfig, 'url'>\n\ntype GeneratePreviewURLOptions = {\n locale: string\n req: PayloadRequestWithData\n token: null | string\n}\n\nexport type GeneratePreviewURL = (\n doc: Record<string, unknown>,\n options: GeneratePreviewURLOptions,\n) => Promise<null | string> | null | string\n\nexport type GraphQLInfo = {\n Mutation: {\n fields: Record<string, any>\n name: string\n }\n Query: {\n fields: Record<string, any>\n name: string\n }\n collections: {\n [slug: number | string | symbol]: Collection\n }\n globals: Globals\n types: {\n arrayTypes: Record<string, GraphQL.GraphQLType>\n blockInputTypes: Record<string, GraphQL.GraphQLInputObjectType>\n blockTypes: Record<string, GraphQL.GraphQLObjectType>\n fallbackLocaleInputType?: GraphQL.GraphQLEnumType | GraphQL.GraphQLScalarType\n groupTypes: Record<string, GraphQL.GraphQLObjectType>\n localeInputType?: GraphQL.GraphQLEnumType | GraphQL.GraphQLScalarType\n tabTypes: Record<string, GraphQL.GraphQLObjectType>\n }\n}\nexport type GraphQLExtension = (\n graphQL: typeof GraphQL,\n context: {\n config: SanitizedConfig\n } & GraphQLInfo,\n) => Record<string, unknown>\n\nexport type InitOptions = {\n /**\n * Sometimes, with the local API, you might need to pass a config file directly, for example, serverless on Vercel\n * The passed config should match the config file, and if it doesn't, there could be mismatches between the admin UI\n * and the backend functionality\n */\n config: Promise<SanitizedConfig> | SanitizedConfig\n /**\n * Disable connect to the database on init\n */\n disableDBConnect?: boolean\n\n /**\n * Disable running of the `onInit` function\n */\n disableOnInit?: boolean\n\n /**\n * A previously instantiated logger instance. Must conform to the PayloadLogger interface which uses Pino\n * This allows you to bring your own logger instance and let payload use it\n */\n logger?: PayloadLogger\n\n loggerDestination?: DestinationStream\n\n /**\n * Specify options for the built-in Pino logger that Payload uses for internal logging.\n *\n * See Pino Docs for options: https://getpino.io/#/docs/api?id=options\n */\n loggerOptions?: LoggerOptions\n /**\n * A function that is called immediately following startup that receives the Payload instance as it's only argument.\n */\n onInit?: (payload: Payload) => Promise<void> | void\n}\n\n/**\n * This result is calculated on the server\n * and then sent to the client allowing the dashboard to show accessible data and actions.\n *\n * If the result is `true`, the user has access.\n * If the result is an object, it is interpreted as a MongoDB query.\n *\n * @example `{ createdBy: { equals: id } }`\n *\n * @example `{ tenant: { in: tenantIds } }`\n *\n * @see https://payloadcms.com/docs/access-control/overview\n */\nexport type AccessResult = Where | boolean\n\nexport type AccessArgs<T = any, U = any> = {\n /**\n * The relevant resource that is being accessed.\n *\n * `data` is null when a list is requested\n */\n data?: T\n /** ID of the resource being accessed */\n id?: number | string\n /** If true, the request is for a static file */\n isReadingStaticFile?: boolean\n /** The original request that requires an access check */\n req: PayloadRequestWithData<U>\n}\n\n/**\n * Access function runs on the server\n * and is sent to the client allowing the dashboard to show accessible data and actions.\n *\n * @see https://payloadcms.com/docs/access-control/overview\n */\nexport type Access<T = any, U = any> = (\n args: AccessArgs<T, U>,\n) => AccessResult | Promise<AccessResult>\n\n/** Web Request/Response model, but the the req has more payload specific properties added to it. */\nexport type PayloadHandler = (req: PayloadRequest) => Promise<Response> | Response\n\n/**\n * Docs: https://payloadcms.com/docs/rest-api/overview#custom-endpoints\n */\nexport type Endpoint<U = User> = {\n /** Extension point to add your custom data. */\n custom?: Record<string, any>\n\n /**\n * Middleware that will be called when the path/method matches\n *\n * Compatible with Web Request/Response Model\n */\n handler: PayloadHandler\n /** HTTP method (or \"all\") */\n method: 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put'\n /**\n * Pattern that should match the path of the incoming request\n *\n * Compatible with the Express router\n */\n path: string\n /**\n * Please add \"root\" routes under the /api folder in the Payload Project.\n * https://nextjs.org/docs/app/api-reference/file-conventions/route\n *\n * @deprecated in 3.0\n */\n root?: never\n}\n\nexport type EditViewComponent = React.ComponentType<ServerSideEditViewProps>\n\nexport type EditViewConfig =\n | {\n /**\n * Add a new Edit view to the admin panel\n * i.e. you can render a custom view that has no tab, if desired\n * Or override a specific properties of an existing one\n * i.e. you can customize the `Default` view tab label, if desired\n */\n Tab?: DocumentTab\n path?: string\n }\n | {\n Component: EditViewComponent\n path: string\n }\n | {\n actions?: CustomComponent[]\n }\n\n/**\n * Override existing views\n * i.e. Dashboard, Account, API, LivePreview, etc.\n * Path is not available here\n * All Tab properties become optional\n * i.e. you can change just the label, if desired\n */\nexport type EditView = EditViewComponent | EditViewConfig\n\nexport type ServerProps = {\n payload: Payload\n}\n\nexport const serverProps: (keyof ServerProps)[] = ['payload']\n\nexport type CustomComponent<T extends any = any> = React.ComponentType<T & ServerProps>\n\nexport type Locale = {\n /**\n * value of supported locale\n * @example \"en\"\n */\n code: string\n /**\n * Code of another locale to use when reading documents with fallback, if not specified defaultLocale is used\n */\n fallbackLocale?: string\n /**\n * label of supported locale\n * @example \"English\"\n */\n label: Record<string, string> | string\n /**\n * if true, defaults textAligmnent on text fields to RTL\n */\n rtl?: boolean\n}\n\nexport type BaseLocalizationConfig = {\n /**\n * Locale for users that have not expressed their preference for a specific locale\n * @example `\"en\"`\n */\n defaultLocale: string\n /** Set to `true` to let missing values in localised fields fall back to the values in `defaultLocale` */\n fallback?: boolean\n}\n\nexport type LocalizationConfigWithNoLabels = Prettify<\n BaseLocalizationConfig & {\n /**\n * List of supported locales\n * @example `[\"en\", \"es\", \"fr\", \"nl\", \"de\", \"jp\"]`\n */\n locales: string[]\n }\n>\n\nexport type LocalizationConfigWithLabels = Prettify<\n BaseLocalizationConfig & {\n /**\n * List of supported locales with labels\n * @example {\n * label: 'English',\n * value: 'en',\n * rtl: false\n * }\n */\n locales: Locale[]\n }\n>\n\nexport type SanitizedLocalizationConfig = Prettify<\n LocalizationConfigWithLabels & {\n /**\n * List of supported locales\n * @example `[\"en\", \"es\", \"fr\", \"nl\", \"de\", \"jp\"]`\n */\n localeCodes: string[]\n }\n>\n\n/**\n * @see https://payloadcms.com/docs/configuration/localization#localization\n */\nexport type LocalizationConfig = Prettify<\n LocalizationConfigWithLabels | LocalizationConfigWithNoLabels\n>\n\nexport type LabelFunction = ({ t }: { t: TFunction }) => string\n\nexport type SharpDependency = (\n input?:\n | ArrayBuffer\n | Buffer\n | Float32Array\n | Float64Array\n | Int8Array\n | Int16Array\n | Int32Array\n | Uint8Array\n | Uint8ClampedArray\n | Uint16Array\n | Uint32Array\n | string,\n options?: sharp.SharpOptions,\n) => sharp.Sharp\n\n/**\n * This is the central configuration\n *\n * @see https://payloadcms.com/docs/configuration/overview\n */\nexport type Config = {\n /** Configure admin dashboard */\n admin?: {\n /** Automatically log in as a user when visiting the admin dashboard. */\n autoLogin?:\n | {\n /**\n * The email address of the user to login as\n *\n */\n email: string\n /** The password of the user to login as */\n password: string\n /**\n * If set to true, the login credentials will be prefilled but the user will still need to click the login button.\n *\n * @default false\n */\n prefillOnly?: boolean\n }\n | false\n /** Set account profile picture. Options: gravatar, default or a custom React component. */\n avatar?: 'default' | 'gravatar' | React.ComponentType<any>\n\n /**\n * Add extra and/or replace built-in components with custom components\n *\n * @see https://payloadcms.com/docs/admin/components\n */\n components?: {\n /**\n * Replace the navigation with a custom component\n */\n Nav?: CustomComponent\n /**\n * Add custom components to the top right of the Admin Panel\n */\n actions?: CustomComponent[]\n /**\n * Add custom components after the collection overview\n */\n afterDashboard?: CustomComponent[]\n /**\n * Add custom components after the email/password field\n */\n afterLogin?: CustomComponent[]\n /**\n * Add custom components after the navigation links\n */\n afterNavLinks?: CustomComponent[]\n /**\n * Add custom components before the collection overview\n */\n beforeDashboard?: CustomComponent[]\n /**\n * Add custom components before the email/password field\n */\n beforeLogin?: CustomComponent[]\n /**\n * Add custom components before the navigation links\n */\n beforeNavLinks?: CustomComponent[]\n /** Replace graphical components */\n graphics?: {\n /** Replace the icon in the navigation */\n Icon?: CustomComponent\n /** Replace the logo on the login page */\n Logo?: CustomComponent\n }\n /** Replace logout related components */\n logout?: {\n /** Replace the logout button */\n Button?: CustomComponent\n }\n /**\n * Wrap the admin dashboard in custom context providers\n */\n providers?: React.ComponentType<{ children?: React.ReactNode }>[]\n /**\n * Replace or modify top-level admin routes, or add new ones:\n * + `Account` - `/admin/account`\n * + `Dashboard` - `/admin`\n * + `:path` - `/admin/:path`\n */\n views?: {\n /** Add custom admin views */\n [key: string]: AdminView\n /** Replace the account screen */\n Account?: AdminView\n /** Replace the admin homepage */\n Dashboard?: AdminView\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /** Global date format that will be used for all dates in the Admin panel. Any valid date-fns format pattern can be used. */\n dateFormat?: string\n /** If set to true, the entire Admin panel will be disabled. */\n disable?: boolean\n /** The route the user will be redirected to after being inactive for too long. */\n inactivityRoute?: string\n livePreview?: LivePreviewConfig & {\n collections?: string[]\n globals?: string[]\n }\n /** The route for the logout page. */\n logoutRoute?: string\n /** Base meta data to use for the Admin panel. Included properties are titleSuffix, ogImage, and favicon. */\n meta?: {\n /**\n * Public path to an icon\n *\n * This image may be displayed in the browser next to the title of the page\n */\n favicon?: string\n /**\n * Public path to an image\n *\n * This image may be displayed as preview when the link is shared on social media\n */\n ogImage?: string\n /**\n * String to append to the <title> of admin pages\n * @example `\" - My Brand\"`\n */\n titleSuffix?: string\n }\n /** The slug of a Collection that you want be used to log in to the Admin dashboard. */\n user?: string\n }\n /** Custom Payload bin scripts can be injected via the config. */\n bin?: BinScriptConfig[]\n /**\n * Manage the datamodel of your application\n *\n * @see https://payloadcms.com/docs/configuration/collections#collection-configs\n */\n collections?: CollectionConfig[]\n /**\n * Replace the built-in components with custom ones\n */\n components?: { [key: string]: (() => JSX.Element) | JSX.Element }\n /**\n * Prefix a string to all cookies that Payload sets.\n *\n * @default \"payload\"\n */\n cookiePrefix?: string\n /** Either a whitelist array of URLS to allow CORS requests from, or a wildcard string ('*') to accept incoming requests from any domain. */\n cors?: '*' | string[]\n /** A whitelist array of URLs to allow Payload cookies to be accepted from as a form of CSRF protection. */\n csrf?: string[]\n\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n\n /** Pass in a database adapter for use on this project. */\n db: DatabaseAdapterResult\n /** Enable to expose more detailed error information. */\n debug?: boolean\n /**\n * If a user does not specify `depth` while requesting a resource, this depth will be used.\n *\n * @see https://payloadcms.com/docs/getting-started/concepts#depth\n *\n * @default 2\n */\n defaultDepth?: number\n /**\n * The maximum allowed depth to be permitted application-wide. This setting helps prevent against malicious queries.\n *\n * @default 40000\n */\n defaultMaxTextLength?: number\n /** Default richtext editor to use for richText fields */\n editor: RichTextAdapter<any, any, any>\n /**\n * Email Adapter\n *\n * @see https://payloadcms.com/docs/email/overview\n */\n email?: EmailAdapter | Promise<EmailAdapter>\n /** Custom REST endpoints */\n endpoints?: Endpoint[]\n /**\n * @see https://payloadcms.com/docs/configuration/globals#global-configs\n */\n globals?: GlobalConfig[]\n /**\n * Manage the GraphQL API\n *\n * You can add your own GraphQL queries and mutations to Payload, making use of all the types that Payload has defined for you.\n *\n * @see https://payloadcms.com/docs/graphql/overview\n */\n graphQL?: {\n disable?: boolean\n disablePlaygroundInProduction?: boolean\n maxComplexity?: number\n /**\n * Function that returns an object containing keys to custom GraphQL mutations\n *\n * @see https://payloadcms.com/docs/graphql/extending\n */\n mutations?: GraphQLExtension\n /**\n * Function that returns an object containing keys to custom GraphQL queries\n *\n * @see https://payloadcms.com/docs/graphql/extending\n */\n queries?: GraphQLExtension\n }\n /**\n * Tap into Payload-wide hooks.\n *\n * @see https://payloadcms.com/docs/hooks/overview\n */\n hooks?: {\n afterError?: AfterErrorHook\n }\n /** i18n config settings */\n i18n?: I18nOptions\n /** Automatically index all sortable top-level fields in the database to improve sort performance and add database compatibility for Azure Cosmos and similar. */\n indexSortableFields?: boolean\n /**\n * Translate your content to different languages/locales.\n *\n * @default false // disable localization\n */\n localization?: LocalizationConfig | false\n /**\n * The maximum allowed depth to be permitted application-wide. This setting helps prevent against malicious queries.\n *\n * @see https://payloadcms.com/docs/getting-started/concepts#depth\n *\n * @default 10\n */\n maxDepth?: number\n /** A function that is called immediately following startup that receives the Payload instance as its only argument. */\n onInit?: (payload: Payload) => Promise<void> | void\n /**\n * An array of Payload plugins.\n *\n * @see https://payloadcms.com/docs/plugins/overview\n */\n plugins?: Plugin[]\n /** Control the routing structure that Payload binds itself to. */\n routes?: {\n /** @default \"/admin\" */\n admin?: string\n /** @default \"/api\" */\n api?: string\n /** @default \"/graphql\" */\n graphQL?: string\n /** @default \"/graphql-playground\" */\n graphQLPlayground?: string\n }\n /** Secure string that Payload will use for any encryption workflows */\n secret: string\n /**\n * Define the absolute URL of your app including the protocol, for example `https://example.org`.\n * No paths allowed, only protocol, domain and (optionally) port.\n *\n * @see https://payloadcms.com/docs/configuration/overview#options\n */\n serverURL?: string\n /**\n * Pass in a local copy of Sharp if you'd like to use it.\n *\n */\n sharp?: SharpDependency\n /** Send anonymous telemetry data about general usage. */\n telemetry?: boolean\n /** Control how typescript interfaces are generated from your collections. */\n typescript?: {\n /** Disable declare block in generated types file */\n declare?: false\n /** Filename to write the generated types to */\n outputFile?: string\n }\n /**\n * Customize the handling of incoming file uploads for collections that have uploads enabled.\n */\n upload?: ExpressFileUploadOptions\n}\n\nexport type SanitizedConfig = Omit<\n DeepRequired<Config>,\n 'collections' | 'endpoint' | 'globals' | 'i18n' | 'localization' | 'upload'\n> & {\n collections: SanitizedCollectionConfig[]\n endpoints: Endpoint[]\n globals: SanitizedGlobalConfig[]\n i18n: Required<I18nOptions>\n localization: SanitizedLocalizationConfig | false\n paths: {\n config: string\n configDir: string\n rawConfig: string\n }\n upload: ExpressFileUploadOptions & {\n /**\n * Deduped list of adapters used in the project\n */\n adapters: string[]\n }\n}\n\nexport type EditConfig =\n | (\n | {\n /**\n * Replace or modify individual nested routes, or add new ones:\n * + `Default` - `/admin/collections/:collection/:id`\n * + `API` - `/admin/collections/:collection/:id/api`\n * + `LivePreview` - `/admin/collections/:collection/:id/preview`\n * + `References` - `/admin/collections/:collection/:id/references`\n * + `Relationships` - `/admin/collections/:collection/:id/relationships`\n * + `Versions` - `/admin/collections/:collection/:id/versions`\n * + `Version` - `/admin/collections/:collection/:id/versions/:version`\n * + `CustomView` - `/admin/collections/:collection/:id/:path`\n */\n API?: EditViewComponent | Partial<EditViewConfig>\n Default?: EditViewComponent | Partial<EditViewConfig>\n LivePreview?: EditViewComponent | Partial<EditViewConfig>\n Version?: EditViewComponent | Partial<EditViewConfig>\n Versions?: EditViewComponent | Partial<EditViewConfig>\n // TODO: uncomment these as they are built\n // References?: EditView\n // Relationships?: EditView\n }\n | {\n [key: string]: EditViewConfig\n }\n )\n | EditViewComponent\n\nexport type EntityDescriptionComponent = CustomComponent\n\nexport type EntityDescriptionFunction = () => string\n\nexport type EntityDescription =\n | EntityDescriptionComponent\n | EntityDescriptionFunction\n | Record<string, string>\n | string\n\nexport type { EmailAdapter, SendEmailOptions }\n"],"names":["serverProps"],"rangeMappings":";;","mappings":"AA8PA,OAAO,MAAMA,cAAqC;IAAC;CAAU,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consoleEmailAdapter.d.ts","sourceRoot":"","sources":["../../src/email/consoleEmailAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAK9C,eAAO,MAAM,mBAAmB,EAAE,YAAY,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"consoleEmailAdapter.d.ts","sourceRoot":"","sources":["../../src/email/consoleEmailAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAK9C,eAAO,MAAM,mBAAmB,EAAE,YAAY,CAAC,IAAI,CAUjD,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { emailDefaults } from './defaults.js';
|
|
2
2
|
import { getStringifiedToAddress } from './getStringifiedToAddress.js';
|
|
3
3
|
export const consoleEmailAdapter = ({ payload })=>({
|
|
4
|
+
name: 'console',
|
|
4
5
|
defaultFromAddress: emailDefaults.defaultFromAddress,
|
|
5
6
|
defaultFromName: emailDefaults.defaultFromName,
|
|
6
7
|
sendEmail: async (message)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/email/consoleEmailAdapter.ts"],"sourcesContent":["import type { EmailAdapter } from './types.js'\n\nimport { emailDefaults } from './defaults.js'\nimport { getStringifiedToAddress } from './getStringifiedToAddress.js'\n\nexport const consoleEmailAdapter: EmailAdapter<void> = ({ payload }) => ({\n defaultFromAddress: emailDefaults.defaultFromAddress,\n defaultFromName: emailDefaults.defaultFromName,\n sendEmail: async (message) => {\n const stringifiedTo = getStringifiedToAddress(message)\n const res = `Email attempted without being configured. To: '${stringifiedTo}', Subject: '${message.subject}'`\n payload.logger.info({ msg: res })\n return Promise.resolve()\n },\n})\n"],"names":["emailDefaults","getStringifiedToAddress","consoleEmailAdapter","payload","defaultFromAddress","defaultFromName","sendEmail","message","stringifiedTo","res","subject","logger","info","msg","Promise","resolve"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/email/consoleEmailAdapter.ts"],"sourcesContent":["import type { EmailAdapter } from './types.js'\n\nimport { emailDefaults } from './defaults.js'\nimport { getStringifiedToAddress } from './getStringifiedToAddress.js'\n\nexport const consoleEmailAdapter: EmailAdapter<void> = ({ payload }) => ({\n name: 'console',\n defaultFromAddress: emailDefaults.defaultFromAddress,\n defaultFromName: emailDefaults.defaultFromName,\n sendEmail: async (message) => {\n const stringifiedTo = getStringifiedToAddress(message)\n const res = `Email attempted without being configured. To: '${stringifiedTo}', Subject: '${message.subject}'`\n payload.logger.info({ msg: res })\n return Promise.resolve()\n },\n})\n"],"names":["emailDefaults","getStringifiedToAddress","consoleEmailAdapter","payload","name","defaultFromAddress","defaultFromName","sendEmail","message","stringifiedTo","res","subject","logger","info","msg","Promise","resolve"],"rangeMappings":";;;;;;;;;;;;;;","mappings":"AAEA,SAASA,aAAa,QAAQ,gBAAe;AAC7C,SAASC,uBAAuB,QAAQ,+BAA8B;AAEtE,OAAO,MAAMC,sBAA0C,CAAC,EAAEC,OAAO,EAAE,GAAM,CAAA;QACvEC,MAAM;QACNC,oBAAoBL,cAAcK,kBAAkB;QACpDC,iBAAiBN,cAAcM,eAAe;QAC9CC,WAAW,OAAOC;YAChB,MAAMC,gBAAgBR,wBAAwBO;YAC9C,MAAME,MAAM,CAAC,+CAA+C,EAAED,cAAc,aAAa,EAAED,QAAQG,OAAO,CAAC,CAAC,CAAC;YAC7GR,QAAQS,MAAM,CAACC,IAAI,CAAC;gBAAEC,KAAKJ;YAAI;YAC/B,OAAOK,QAAQC,OAAO;QACxB;IACF,CAAA,EAAE"}
|
package/dist/email/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/email/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,IAAI,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAE9E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEhD,KAAK,QAAQ,CAAC,CAAC,IAAI;KAChB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;AAExB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,yBAAyB,CAAC,CAAA;AAElE;;GAEG;AACH,MAAM,MAAM,uBAAuB,CAAC,kBAAkB,GAAG,OAAO,IAAI,UAAU,CAC5E,YAAY,CAAC,kBAAkB,CAAC,CACjC,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
|
|
|
1
|
-
{"version":3,"sources":["../../src/email/types.ts"],"sourcesContent":["import type { SendMailOptions as NodemailerSendMailOptions } from 'nodemailer'\n\nimport type { Payload } from '../types/index.js'\n\ntype Prettify<T> = {\n [K in keyof T]: T[K]\n} & NonNullable<unknown>\n\n/**\n * Options for sending an email. Allows access to the PayloadRequest object\n */\nexport type SendEmailOptions = Prettify<NodemailerSendMailOptions>\n\n/**\n * Email adapter after it has been initialized. This is used internally by Payload.\n */\nexport type InitializedEmailAdapter<TSendEmailResponse = unknown> = ReturnType<\n EmailAdapter<TSendEmailResponse>\n>\n\n/**\n * Email adapter interface. Allows a generic type for the response of the sendEmail method.\n *\n * This is the interface to use if you are creating a new email adapter.\n */\n\nexport type EmailAdapter<TSendEmailResponse = unknown> = ({ payload }: { payload: Payload }) => {\n defaultFromAddress: string\n defaultFromName: string\n sendEmail: (message: SendEmailOptions) => Promise<TSendEmailResponse>\n}\n"],"names":[],"rangeMappings":";;;;","mappings":"AAoBA;;;;CAIC,GAED,
|
|
1
|
+
{"version":3,"sources":["../../src/email/types.ts"],"sourcesContent":["import type { SendMailOptions as NodemailerSendMailOptions } from 'nodemailer'\n\nimport type { Payload } from '../types/index.js'\n\ntype Prettify<T> = {\n [K in keyof T]: T[K]\n} & NonNullable<unknown>\n\n/**\n * Options for sending an email. Allows access to the PayloadRequest object\n */\nexport type SendEmailOptions = Prettify<NodemailerSendMailOptions>\n\n/**\n * Email adapter after it has been initialized. This is used internally by Payload.\n */\nexport type InitializedEmailAdapter<TSendEmailResponse = unknown> = ReturnType<\n EmailAdapter<TSendEmailResponse>\n>\n\n/**\n * Email adapter interface. Allows a generic type for the response of the sendEmail method.\n *\n * This is the interface to use if you are creating a new email adapter.\n */\n\nexport type EmailAdapter<TSendEmailResponse = unknown> = ({ payload }: { payload: Payload }) => {\n defaultFromAddress: string\n defaultFromName: string\n name: string\n sendEmail: (message: SendEmailOptions) => Promise<TSendEmailResponse>\n}\n"],"names":[],"rangeMappings":";;;;","mappings":"AAoBA;;;;CAIC,GAED,WAKC"}
|
package/dist/uploads/types.d.ts
CHANGED
|
@@ -63,6 +63,10 @@ export type GetAdminThumbnail = (args: {
|
|
|
63
63
|
doc: Record<string, unknown>;
|
|
64
64
|
}) => false | null | string;
|
|
65
65
|
export type UploadConfig = {
|
|
66
|
+
/**
|
|
67
|
+
* The adapter to use for uploads.
|
|
68
|
+
*/
|
|
69
|
+
adapter?: string;
|
|
66
70
|
/**
|
|
67
71
|
* Represents an admin thumbnail, which can be either a React component or a string.
|
|
68
72
|
* - If a string, it should be one of the image size names.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/uploads/types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,KAAK,WAAW,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAEjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAE/D,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAA;IACvB,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAA;IACvB,MAAM,EAAE,IAAI,GAAG,MAAM,CAAA;IACrB,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAA;IACvB,KAAK,EAAE,IAAI,GAAG,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM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D,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAA;IACpC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAA;IAC1F,WAAW,CAAC,EAAE,sBAAsB,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG;IACjD,SAAS,EAAE,YAAY,CAAC,WAAW,CAAC,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/uploads/types.ts"],"sourcesContent":["import type express from 'express'\nimport type serveStatic from 'serve-static'\nimport type { ResizeOptions, Sharp } from 'sharp'\n\nimport type { PayloadRequestWithData } from '../types/index.js'\n\nexport type FileSize = {\n filename: null | string\n filesize: null | number\n height: null | number\n mimeType: null | string\n width: null | number\n}\n\nexport type FileSizes = {\n [size: string]: FileSize\n}\n\nexport type FileData = {\n filename: string\n filesize: number\n height: number\n mimeType: string\n sizes: FileSizes\n tempFilePath?: string\n url?: string\n width: number\n}\n\nexport type ProbedImageSize = {\n height: number\n width: number\n}\n\n/**\n * Params sent to the sharp toFormat() function\n * @link https://sharp.pixelplumbing.com/api-output#toformat\n */\nexport type ImageUploadFormatOptions = {\n format: Parameters<Sharp['toFormat']>[0]\n options?: Parameters<Sharp['toFormat']>[1]\n}\n\n/**\n * Params sent to the sharp trim() function\n * @link https://sharp.pixelplumbing.com/api-resize#trim\n */\nexport type ImageUploadTrimOptions = Parameters<Sharp['trim']>[0]\n\nexport type ImageSize = Omit<ResizeOptions, 'withoutEnlargement'> & {\n /**\n * @deprecated prefer position\n */\n crop?: string // comes from sharp package\n formatOptions?: ImageUploadFormatOptions\n name: string\n trimOptions?: ImageUploadTrimOptions\n /**\n * When an uploaded image is smaller than the defined image size, we have 3 options:\n *\n * `undefined | false | true`\n *\n * 1. `undefined` [default]: uploading images with smaller width AND height than the image size will return null\n * 2. `false`: always enlarge images to the image size\n * 3. `true`: if the image is smaller than the image size, return the original image\n */\n withoutEnlargement?: ResizeOptions['withoutEnlargement']\n}\n\nexport type GetAdminThumbnail = (args: { doc: Record<string, unknown> }) => false | null | string\n\nexport type UploadConfig = {\n /**\n * Represents an admin thumbnail, which can be either a React component or a string.\n * - If a string, it should be one of the image size names.\n * - If a React component, register a function that generates the thumbnail URL using the `useAdminThumbnail` hook.\n **/\n adminThumbnail?: GetAdminThumbnail | string\n crop?: boolean\n disableLocalStorage?: boolean\n /**\n * Accepts existing headers and can filter/modify them.\n *\n * Useful for adding custom headers to fetch from external providers.\n */\n externalFileHeaderFilter?: (headers: Record<string, string>) => Record<string, string>\n filesRequiredOnCreate?: boolean\n focalPoint?: boolean\n /** Options for original upload file only. For sizes, set each formatOptions individually. */\n formatOptions?: ImageUploadFormatOptions\n handlers?: ((\n req: PayloadRequestWithData,\n args: { params: { collection: string; filename: string } },\n ) => Promise<Response> | Response)[]\n imageSizes?: ImageSize[]\n mimeTypes?: string[]\n resizeOptions?: ResizeOptions\n staticDir?: string\n staticOptions?: serveStatic.ServeStaticOptions<express.Response<any, Record<string, any>>>\n trimOptions?: ImageUploadTrimOptions\n}\n\nexport type SanitizedUploadConfig = UploadConfig & {\n staticDir: UploadConfig['staticDir']\n}\n\nexport type File = {\n data: Buffer\n mimetype: string\n name: string\n size: number\n}\n\nexport type FileToSave = {\n buffer: Buffer\n path: string\n}\n"],"names":[],"rangeMappings":"","mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/uploads/types.ts"],"sourcesContent":["import type express from 'express'\nimport type serveStatic from 'serve-static'\nimport type { ResizeOptions, Sharp } from 'sharp'\n\nimport type { PayloadRequestWithData } from '../types/index.js'\n\nexport type FileSize = {\n filename: null | string\n filesize: null | number\n height: null | number\n mimeType: null | string\n width: null | number\n}\n\nexport type FileSizes = {\n [size: string]: FileSize\n}\n\nexport type FileData = {\n filename: string\n filesize: number\n height: number\n mimeType: string\n sizes: FileSizes\n tempFilePath?: string\n url?: string\n width: number\n}\n\nexport type ProbedImageSize = {\n height: number\n width: number\n}\n\n/**\n * Params sent to the sharp toFormat() function\n * @link https://sharp.pixelplumbing.com/api-output#toformat\n */\nexport type ImageUploadFormatOptions = {\n format: Parameters<Sharp['toFormat']>[0]\n options?: Parameters<Sharp['toFormat']>[1]\n}\n\n/**\n * Params sent to the sharp trim() function\n * @link https://sharp.pixelplumbing.com/api-resize#trim\n */\nexport type ImageUploadTrimOptions = Parameters<Sharp['trim']>[0]\n\nexport type ImageSize = Omit<ResizeOptions, 'withoutEnlargement'> & {\n /**\n * @deprecated prefer position\n */\n crop?: string // comes from sharp package\n formatOptions?: ImageUploadFormatOptions\n name: string\n trimOptions?: ImageUploadTrimOptions\n /**\n * When an uploaded image is smaller than the defined image size, we have 3 options:\n *\n * `undefined | false | true`\n *\n * 1. `undefined` [default]: uploading images with smaller width AND height than the image size will return null\n * 2. `false`: always enlarge images to the image size\n * 3. `true`: if the image is smaller than the image size, return the original image\n */\n withoutEnlargement?: ResizeOptions['withoutEnlargement']\n}\n\nexport type GetAdminThumbnail = (args: { doc: Record<string, unknown> }) => false | null | string\n\nexport type UploadConfig = {\n /**\n * The adapter to use for uploads.\n */\n adapter?: string\n /**\n * Represents an admin thumbnail, which can be either a React component or a string.\n * - If a string, it should be one of the image size names.\n * - If a React component, register a function that generates the thumbnail URL using the `useAdminThumbnail` hook.\n **/\n adminThumbnail?: GetAdminThumbnail | string\n crop?: boolean\n disableLocalStorage?: boolean\n /**\n * Accepts existing headers and can filter/modify them.\n *\n * Useful for adding custom headers to fetch from external providers.\n */\n externalFileHeaderFilter?: (headers: Record<string, string>) => Record<string, string>\n filesRequiredOnCreate?: boolean\n focalPoint?: boolean\n /** Options for original upload file only. For sizes, set each formatOptions individually. */\n formatOptions?: ImageUploadFormatOptions\n handlers?: ((\n req: PayloadRequestWithData,\n args: { params: { collection: string; filename: string } },\n ) => Promise<Response> | Response)[]\n imageSizes?: ImageSize[]\n mimeTypes?: string[]\n resizeOptions?: ResizeOptions\n staticDir?: string\n staticOptions?: serveStatic.ServeStaticOptions<express.Response<any, Record<string, any>>>\n trimOptions?: ImageUploadTrimOptions\n}\n\nexport type SanitizedUploadConfig = UploadConfig & {\n staticDir: UploadConfig['staticDir']\n}\n\nexport type File = {\n data: Buffer\n mimetype: string\n name: string\n size: number\n}\n\nexport type FileToSave = {\n buffer: Buffer\n path: string\n}\n"],"names":[],"rangeMappings":"","mappings":"AAqHA,WAGC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createLocalReq.d.ts","sourceRoot":"","sources":["../../src/utilities/createLocalReq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAsD/D,KAAK,cAAc,GAAG,CACpB,OAAO,EAAE;IACP,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,sBAAsB,CAAA;IAC5B,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ,EACD,OAAO,EAAE,OAAO,KACb,OAAO,CAAC,sBAAsB,CAAC,CAAA;AACpC,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"createLocalReq.d.ts","sourceRoot":"","sources":["../../src/utilities/createLocalReq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAsD/D,KAAK,cAAc,GAAG,CACpB,OAAO,EAAE;IACP,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,sBAAsB,CAAA;IAC5B,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ,EACD,OAAO,EAAE,OAAO,KACb,OAAO,CAAC,sBAAsB,CAAC,CAAA;AACpC,eAAO,MAAM,cAAc,EAAE,cAmC5B,CAAA"}
|
|
@@ -43,7 +43,7 @@ const attachFakeURLProperties = (req)=>{
|
|
|
43
43
|
// @ts-expect-error
|
|
44
44
|
if (!req.origin) req.origin = getURLObject().origin;
|
|
45
45
|
// @ts-expect-error
|
|
46
|
-
if (!req?.url) req.url = getURLObject().
|
|
46
|
+
if (!req?.url) req.url = getURLObject().href;
|
|
47
47
|
};
|
|
48
48
|
export const createLocalReq = async ({ context, fallbackLocale, locale: localeArg, req = {}, user }, payload)=>{
|
|
49
49
|
const i18n = req?.i18n || await getLocalI18n({
|
|
@@ -60,6 +60,8 @@ export const createLocalReq = async ({ context, fallbackLocale, locale: localeAr
|
|
|
60
60
|
req.fallbackLocale = fallbackLocaleFromConfig || defaultLocale;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
+
// @ts-expect-error
|
|
64
|
+
if (!req.headers) req.headers = new Headers();
|
|
63
65
|
req.context = getRequestContext(req, context);
|
|
64
66
|
req.payloadAPI = req?.payloadAPI || 'local';
|
|
65
67
|
req.payload = payload;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/createLocalReq.ts"],"sourcesContent":["import type { User } from '../auth/types.js'\nimport type { Payload, RequestContext } from '../index.js'\nimport type { PayloadRequestWithData } from '../types/index.js'\n\nimport { getDataLoader } from '../collections/dataloader.js'\nimport { getLocalI18n } from '../translations/getLocalI18n.js'\n\nfunction getRequestContext(\n req: PayloadRequestWithData = { context: null } as PayloadRequestWithData,\n context: RequestContext = {},\n): RequestContext {\n if (req.context) {\n if (Object.keys(req.context).length === 0 && req.context.constructor === Object) {\n // if req.context is `{}` avoid unnecessary spread\n return context\n } else {\n return { ...req.context, ...context }\n }\n } else {\n return context\n }\n}\n\nconst attachFakeURLProperties = (req: PayloadRequestWithData) => {\n /**\n * *NOTE*\n * If no URL is provided, the local API was called directly outside\n * the context of a request. Therefore we create a fake URL object.\n * `ts-ignore` is used below for properties that are 'read-only'\n * since they do not exist yet we can safely ignore the error.\n */\n let urlObject\n\n function getURLObject() {\n if (urlObject) return urlObject\n const urlToUse = req?.url || req.payload.config?.serverURL || 'http://localhost'\n try {\n urlObject = new URL(urlToUse)\n } catch (error) {\n urlObject = new URL('http://localhost')\n }\n\n return urlObject\n }\n\n if (!req.host) req.host = getURLObject().host\n if (!req.protocol) req.protocol = getURLObject().protocol\n if (!req.pathname) req.pathname = getURLObject().pathname\n // @ts-expect-error\n if (!req.searchParams) req.searchParams = getURLObject().searchParams\n // @ts-expect-error\n if (!req.origin) req.origin = getURLObject().origin\n // @ts-expect-error\n if (!req?.url) req.url = getURLObject().
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/createLocalReq.ts"],"sourcesContent":["import type { User } from '../auth/types.js'\nimport type { Payload, RequestContext } from '../index.js'\nimport type { PayloadRequestWithData } from '../types/index.js'\n\nimport { getDataLoader } from '../collections/dataloader.js'\nimport { getLocalI18n } from '../translations/getLocalI18n.js'\n\nfunction getRequestContext(\n req: PayloadRequestWithData = { context: null } as PayloadRequestWithData,\n context: RequestContext = {},\n): RequestContext {\n if (req.context) {\n if (Object.keys(req.context).length === 0 && req.context.constructor === Object) {\n // if req.context is `{}` avoid unnecessary spread\n return context\n } else {\n return { ...req.context, ...context }\n }\n } else {\n return context\n }\n}\n\nconst attachFakeURLProperties = (req: PayloadRequestWithData) => {\n /**\n * *NOTE*\n * If no URL is provided, the local API was called directly outside\n * the context of a request. Therefore we create a fake URL object.\n * `ts-ignore` is used below for properties that are 'read-only'\n * since they do not exist yet we can safely ignore the error.\n */\n let urlObject\n\n function getURLObject() {\n if (urlObject) return urlObject\n const urlToUse = req?.url || req.payload.config?.serverURL || 'http://localhost'\n try {\n urlObject = new URL(urlToUse)\n } catch (error) {\n urlObject = new URL('http://localhost')\n }\n\n return urlObject\n }\n\n if (!req.host) req.host = getURLObject().host\n if (!req.protocol) req.protocol = getURLObject().protocol\n if (!req.pathname) req.pathname = getURLObject().pathname\n // @ts-expect-error\n if (!req.searchParams) req.searchParams = getURLObject().searchParams\n // @ts-expect-error\n if (!req.origin) req.origin = getURLObject().origin\n // @ts-expect-error\n if (!req?.url) req.url = getURLObject().href\n}\n\ntype CreateLocalReq = (\n options: {\n context?: RequestContext\n fallbackLocale?: string\n locale?: string\n req?: PayloadRequestWithData\n user?: User\n },\n payload: Payload,\n) => Promise<PayloadRequestWithData>\nexport const createLocalReq: CreateLocalReq = async (\n { context, fallbackLocale, locale: localeArg, req = {} as PayloadRequestWithData, user },\n payload,\n) => {\n const i18n = req?.i18n || (await getLocalI18n({ config: payload.config }))\n\n if (payload.config?.localization) {\n const locale = localeArg === '*' ? 'all' : localeArg\n const defaultLocale = payload.config.localization.defaultLocale\n req.locale = locale || req?.locale || defaultLocale\n const fallbackLocaleFromConfig = payload.config.localization.locales.find(\n ({ code }) => req.locale === code,\n )?.fallbackLocale\n if (typeof fallbackLocale !== 'undefined') {\n req.fallbackLocale = fallbackLocale\n } else if (typeof req?.fallbackLocale === 'undefined') {\n req.fallbackLocale = fallbackLocaleFromConfig || defaultLocale\n }\n }\n\n // @ts-expect-error\n if (!req.headers) req.headers = new Headers()\n req.context = getRequestContext(req, context)\n req.payloadAPI = req?.payloadAPI || 'local'\n req.payload = payload\n req.i18n = i18n\n req.t = i18n.t\n req.user = user || req?.user || null\n req.payloadDataLoader = req?.payloadDataLoader || getDataLoader(req)\n req.routeParams = req?.routeParams || {}\n req.query = req?.query || {}\n\n attachFakeURLProperties(req)\n\n return req\n}\n"],"names":["getDataLoader","getLocalI18n","getRequestContext","req","context","Object","keys","length","constructor","attachFakeURLProperties","urlObject","getURLObject","urlToUse","url","payload","config","serverURL","URL","error","host","protocol","pathname","searchParams","origin","href","createLocalReq","fallbackLocale","locale","localeArg","user","i18n","localization","defaultLocale","fallbackLocaleFromConfig","locales","find","code","headers","Headers","payloadAPI","t","payloadDataLoader","routeParams","query"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,aAAa,QAAQ,+BAA8B;AAC5D,SAASC,YAAY,QAAQ,kCAAiC;AAE9D,SAASC,kBACPC,MAA8B;IAAEC,SAAS;AAAK,CAA2B,EACzEA,UAA0B,CAAC,CAAC;IAE5B,IAAID,IAAIC,OAAO,EAAE;QACf,IAAIC,OAAOC,IAAI,CAACH,IAAIC,OAAO,EAAEG,MAAM,KAAK,KAAKJ,IAAIC,OAAO,CAACI,WAAW,KAAKH,QAAQ;YAC/E,kDAAkD;YAClD,OAAOD;QACT,OAAO;YACL,OAAO;gBAAE,GAAGD,IAAIC,OAAO;gBAAE,GAAGA,OAAO;YAAC;QACtC;IACF,OAAO;QACL,OAAOA;IACT;AACF;AAEA,MAAMK,0BAA0B,CAACN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YAAY,CAACG,OAAO,CAACC,IAAI,CACvE,CAAC,EAAEC,IAAI,EAAE,GAAKjC,IAAIwB,MAAM,KAAKS,OAC5BV;QACH,IAAI,OAAOA,mBAAmB,aAAa;YACzCvB,IAAIuB,cAAc,GAAGA;QACvB,OAAO,IAAI,OAAOvB,KAAKuB,mBAAmB,aAAa;YACrDvB,IAAIuB,cAAc,GAAGO,4BAA4BD;QACnD;IACF;IAEA,mBAAmB;IACnB,IAAI,CAAC7B,IAAIkC,OAAO,EAAElC,IAAIkC,OAAO,GAAG,IAAIC;IACpCnC,IAAIC,OAAO,GAAGF,kBAAkBC,KAAKC;IACrCD,IAAIoC,UAAU,GAAGpC,KAAKoC,cAAc;IACpCpC,IAAIW,OAAO,GAAGA;IACdX,IAAI2B,IAAI,GAAGA;IACX3B,IAAIqC,CAAC,GAAGV,KAAKU,CAAC;IACdrC,IAAI0B,IAAI,GAAGA,QAAQ1B,KAAK0B,QAAQ;IAChC1B,IAAIsC,iBAAiB,GAAGtC,KAAKsC,qBAAqBzC,cAAcG;IAChEA,IAAIuC,WAAW,GAAGvC,KAAKuC,eAAe,CAAC;IACvCvC,IAAIwC,KAAK,GAAGxC,KAAKwC,SAAS,CAAC;IAE3BlC,wBAAwBN;IAExB,OAAOA;AACT,EAAC"}
|
|
@@ -3,13 +3,18 @@ import type { AdminInitEvent } from './events/adminInit.js';
|
|
|
3
3
|
import type { ServerInitEvent } from './events/serverInit.js';
|
|
4
4
|
export type BaseEvent = {
|
|
5
5
|
ciName: null | string;
|
|
6
|
+
dbAdapter: string;
|
|
7
|
+
emailAdapter: null | string;
|
|
6
8
|
envID: string;
|
|
7
9
|
isCI: boolean;
|
|
10
|
+
locales: string[];
|
|
11
|
+
localizationDefaultLocale: null | string;
|
|
12
|
+
localizationEnabled: boolean;
|
|
8
13
|
nodeEnv: string;
|
|
9
14
|
nodeVersion: string;
|
|
10
|
-
payloadPackages: Record<string, string>;
|
|
11
15
|
payloadVersion: string;
|
|
12
16
|
projectID: string;
|
|
17
|
+
uploadAdapters: string[];
|
|
13
18
|
};
|
|
14
19
|
type PackageJSON = {
|
|
15
20
|
dependencies: Record<string, string | undefined>;
|
|
@@ -22,5 +27,6 @@ type Args = {
|
|
|
22
27
|
};
|
|
23
28
|
export declare const sendEvent: ({ event, payload }: Args) => Promise<void>;
|
|
24
29
|
export declare const getPayloadVersion: (packageJSON: PackageJSON) => string;
|
|
30
|
+
export declare const getLocalizationInfo: (payload: Payload) => Pick<BaseEvent, 'locales' | 'localizationDefaultLocale' | 'localizationEnabled'>;
|
|
25
31
|
export {};
|
|
26
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/telemetry/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAM7D,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,IAAI,GAAG,MAAM,CAAA;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/telemetry/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAM7D,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,IAAI,GAAG,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,IAAI,GAAG,MAAM,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,yBAAyB,EAAE,IAAI,GAAG,MAAM,CAAA;IACxC,mBAAmB,EAAE,OAAO,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;IAChD,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,KAAK,cAAc,GAAG,cAAc,GAAG,eAAe,CAAA;AAEtD,KAAK,IAAI,GAAG;IACV,KAAK,EAAE,cAAc,CAAA;IACrB,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAID,eAAO,MAAM,SAAS,uBAA8B,IAAI,KAAG,QAAQ,IAAI,CAyCtE,CAAA;AAiED,eAAO,MAAM,iBAAiB,gBAAiB,WAAW,KAAG,MAE5D,CAAA;AAED,eAAO,MAAM,mBAAmB,wBAE7B,KAAK,SAAS,EAAE,SAAS,GAAG,2BAA2B,GAAG,qBAAqB,CAcjF,CAAA"}
|
|
@@ -11,7 +11,7 @@ const Conf = ConfImport.default || ConfImport;
|
|
|
11
11
|
let baseEvent = null;
|
|
12
12
|
export const sendEvent = async ({ event, payload })=>{
|
|
13
13
|
try {
|
|
14
|
-
const packageJSON = await getPackageJSON();
|
|
14
|
+
const { packageJSON, packageJSONPath } = await getPackageJSON();
|
|
15
15
|
// Only generate the base event once
|
|
16
16
|
if (!baseEvent) {
|
|
17
17
|
baseEvent = {
|
|
@@ -20,16 +20,20 @@ export const sendEvent = async ({ event, payload })=>{
|
|
|
20
20
|
isCI: ciInfo.isCI,
|
|
21
21
|
nodeEnv: process.env.NODE_ENV || 'development',
|
|
22
22
|
nodeVersion: process.version,
|
|
23
|
-
payloadPackages: getPayloadPackages(packageJSON),
|
|
24
23
|
payloadVersion: getPayloadVersion(packageJSON),
|
|
25
|
-
projectID: getProjectID(payload, packageJSON)
|
|
24
|
+
projectID: getProjectID(payload, packageJSON),
|
|
25
|
+
...getLocalizationInfo(payload),
|
|
26
|
+
dbAdapter: payload.db.name,
|
|
27
|
+
emailAdapter: payload.email?.name || null,
|
|
28
|
+
uploadAdapters: payload.config.upload.adapters
|
|
26
29
|
};
|
|
27
30
|
}
|
|
28
31
|
if (process.env.PAYLOAD_TELEMETRY_DEBUG) {
|
|
29
32
|
payload.logger.info({
|
|
30
33
|
event: {
|
|
31
34
|
...baseEvent,
|
|
32
|
-
...event
|
|
35
|
+
...event,
|
|
36
|
+
packageJSONPath
|
|
33
37
|
},
|
|
34
38
|
msg: 'Telemetry Event'
|
|
35
39
|
});
|
|
@@ -80,22 +84,26 @@ const getGitID = (payload)=>{
|
|
|
80
84
|
return null;
|
|
81
85
|
}
|
|
82
86
|
};
|
|
83
|
-
const getPayloadPackages = (packageJSON)=>{
|
|
84
|
-
return Object.keys(packageJSON.dependencies || {}).reduce((acc, key)=>{
|
|
85
|
-
return key.startsWith('@payloadcms/') ? {
|
|
86
|
-
...acc,
|
|
87
|
-
[key]: packageJSON.dependencies[key]
|
|
88
|
-
} : acc;
|
|
89
|
-
}, {});
|
|
90
|
-
};
|
|
91
87
|
const getPackageJSON = async ()=>{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
88
|
+
let packageJSONPath = path.resolve(process.cwd(), 'package.json');
|
|
89
|
+
if (!fs.existsSync(packageJSONPath)) {
|
|
90
|
+
// Old logic
|
|
91
|
+
const filename = fileURLToPath(import.meta.url);
|
|
92
|
+
const dirname = path.dirname(filename);
|
|
93
|
+
packageJSONPath = await findUp('package.json', {
|
|
94
|
+
cwd: dirname
|
|
95
|
+
});
|
|
96
|
+
const jsonContent = JSON.parse(fs.readFileSync(packageJSONPath, 'utf-8'));
|
|
97
|
+
return {
|
|
98
|
+
packageJSON: jsonContent,
|
|
99
|
+
packageJSONPath
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath, 'utf-8'));
|
|
103
|
+
return {
|
|
104
|
+
packageJSON,
|
|
105
|
+
packageJSONPath
|
|
106
|
+
};
|
|
99
107
|
};
|
|
100
108
|
const getPackageJSONID = (payload, packageJSON)=>{
|
|
101
109
|
return oneWayHash(packageJSON.name, payload.secret);
|
|
@@ -103,5 +111,19 @@ const getPackageJSONID = (payload, packageJSON)=>{
|
|
|
103
111
|
export const getPayloadVersion = (packageJSON)=>{
|
|
104
112
|
return packageJSON?.dependencies?.payload ?? '';
|
|
105
113
|
};
|
|
114
|
+
export const getLocalizationInfo = (payload)=>{
|
|
115
|
+
if (!payload.config.localization) {
|
|
116
|
+
return {
|
|
117
|
+
locales: [],
|
|
118
|
+
localizationDefaultLocale: null,
|
|
119
|
+
localizationEnabled: false
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
locales: payload.config.localization.localeCodes,
|
|
124
|
+
localizationDefaultLocale: payload.config.localization.defaultLocale,
|
|
125
|
+
localizationEnabled: true
|
|
126
|
+
};
|
|
127
|
+
};
|
|
106
128
|
|
|
107
129
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utilities/telemetry/index.ts"],"sourcesContent":["import { execSync } from 'child_process'\nimport ciInfo from 'ci-info'\nimport ConfImport from 'conf'\nimport { randomBytes } from 'crypto'\nimport findUp from 'find-up'\nimport fs from 'fs'\nimport path from 'path'\nimport { fileURLToPath } from 'url'\n\nimport type { Payload } from '../../types/index.js'\nimport type { AdminInitEvent } from './events/adminInit.js'\nimport type { ServerInitEvent } from './events/serverInit.js'\n\nimport { oneWayHash } from './oneWayHash.js'\n\nconst Conf = (ConfImport.default || ConfImport) as unknown as typeof ConfImport.default\n\nexport type BaseEvent = {\n ciName: null | string\n envID: string\n isCI: boolean\n
|
|
1
|
+
{"version":3,"sources":["../../../src/utilities/telemetry/index.ts"],"sourcesContent":["import { execSync } from 'child_process'\nimport ciInfo from 'ci-info'\nimport ConfImport from 'conf'\nimport { randomBytes } from 'crypto'\nimport findUp from 'find-up'\nimport fs from 'fs'\nimport path from 'path'\nimport { fileURLToPath } from 'url'\n\nimport type { Payload } from '../../types/index.js'\nimport type { AdminInitEvent } from './events/adminInit.js'\nimport type { ServerInitEvent } from './events/serverInit.js'\n\nimport { oneWayHash } from './oneWayHash.js'\n\nconst Conf = (ConfImport.default || ConfImport) as unknown as typeof ConfImport.default\n\nexport type BaseEvent = {\n ciName: null | string\n dbAdapter: string\n emailAdapter: null | string\n envID: string\n isCI: boolean\n locales: string[]\n localizationDefaultLocale: null | string\n localizationEnabled: boolean\n nodeEnv: string\n nodeVersion: string\n payloadVersion: string\n projectID: string\n uploadAdapters: string[]\n}\n\ntype PackageJSON = {\n dependencies: Record<string, string | undefined>\n name: string\n}\n\ntype TelemetryEvent = AdminInitEvent | ServerInitEvent\n\ntype Args = {\n event: TelemetryEvent\n payload: Payload\n}\n\nlet baseEvent: BaseEvent | null = null\n\nexport const sendEvent = async ({ event, payload }: Args): Promise<void> => {\n try {\n const { packageJSON, packageJSONPath } = await getPackageJSON()\n\n // Only generate the base event once\n if (!baseEvent) {\n baseEvent = {\n ciName: ciInfo.isCI ? ciInfo.name : null,\n envID: getEnvID(),\n isCI: ciInfo.isCI,\n nodeEnv: process.env.NODE_ENV || 'development',\n nodeVersion: process.version,\n payloadVersion: getPayloadVersion(packageJSON),\n projectID: getProjectID(payload, packageJSON),\n ...getLocalizationInfo(payload),\n dbAdapter: payload.db.name,\n emailAdapter: payload.email?.name || null,\n uploadAdapters: payload.config.upload.adapters,\n }\n }\n\n if (process.env.PAYLOAD_TELEMETRY_DEBUG) {\n payload.logger.info({\n event: { ...baseEvent, ...event, packageJSONPath },\n msg: 'Telemetry Event',\n })\n return\n }\n\n if (payload.config.telemetry !== false) {\n await fetch('https://telemetry.payloadcms.com/events', {\n body: JSON.stringify({ ...baseEvent, ...event }),\n headers: {\n 'Content-Type': 'application/json',\n },\n method: 'post',\n })\n }\n } catch (_) {\n // Eat any errors in sending telemetry event\n }\n}\n\n/**\n * This is a quasi-persistent identifier used to dedupe recurring events. It's\n * generated from random data and completely anonymous.\n */\nconst getEnvID = (): string => {\n const conf = new Conf()\n const ENV_ID = 'envID'\n\n const val = conf.get(ENV_ID)\n if (val) {\n return val as string\n }\n\n const generated = randomBytes(32).toString('hex')\n conf.set(ENV_ID, generated)\n return generated\n}\n\nconst getProjectID = (payload: Payload, packageJSON: PackageJSON): string => {\n const projectID =\n getGitID(payload) ||\n getPackageJSONID(payload, packageJSON) ||\n payload.config.serverURL ||\n process.cwd()\n return oneWayHash(projectID, payload.secret)\n}\n\nconst getGitID = (payload: Payload) => {\n try {\n const originBuffer = execSync('git config --local --get remote.origin.url', {\n stdio: 'pipe',\n timeout: 1000,\n })\n\n return oneWayHash(String(originBuffer).trim(), payload.secret)\n } catch (_) {\n return null\n }\n}\n\nconst getPackageJSON = async (): Promise<{\n packageJSON?: PackageJSON\n packageJSONPath: string\n}> => {\n let packageJSONPath = path.resolve(process.cwd(), 'package.json')\n\n if (!fs.existsSync(packageJSONPath)) {\n // Old logic\n const filename = fileURLToPath(import.meta.url)\n const dirname = path.dirname(filename)\n packageJSONPath = await findUp('package.json', { cwd: dirname })\n const jsonContent: PackageJSON = JSON.parse(fs.readFileSync(packageJSONPath, 'utf-8'))\n return { packageJSON: jsonContent, packageJSONPath }\n }\n\n const packageJSON: PackageJSON = JSON.parse(fs.readFileSync(packageJSONPath, 'utf-8'))\n return { packageJSON, packageJSONPath }\n}\n\nconst getPackageJSONID = (payload: Payload, packageJSON: PackageJSON): string => {\n return oneWayHash(packageJSON.name, payload.secret)\n}\n\nexport const getPayloadVersion = (packageJSON: PackageJSON): string => {\n return packageJSON?.dependencies?.payload ?? ''\n}\n\nexport const getLocalizationInfo = (\n payload: Payload,\n): Pick<BaseEvent, 'locales' | 'localizationDefaultLocale' | 'localizationEnabled'> => {\n if (!payload.config.localization) {\n return {\n locales: [],\n localizationDefaultLocale: null,\n localizationEnabled: false,\n }\n }\n\n return {\n locales: payload.config.localization.localeCodes,\n localizationDefaultLocale: payload.config.localization.defaultLocale,\n localizationEnabled: true,\n }\n}\n"],"names":["execSync","ciInfo","ConfImport","randomBytes","findUp","fs","path","fileURLToPath","oneWayHash","Conf","default","baseEvent","sendEvent","event","payload","packageJSON","packageJSONPath","getPackageJSON","ciName","isCI","name","envID","getEnvID","nodeEnv","process","env","NODE_ENV","nodeVersion","version","payloadVersion","getPayloadVersion","projectID","getProjectID","getLocalizationInfo","dbAdapter","db","emailAdapter","email","uploadAdapters","config","upload","adapters","PAYLOAD_TELEMETRY_DEBUG","logger","info","msg","telemetry","fetch","body","JSON","stringify","headers","method","_","conf","ENV_ID","val","get","generated","toString","set","getGitID","getPackageJSONID","serverURL","cwd","secret","originBuffer","stdio","timeout","String","trim","resolve","existsSync","filename","url","dirname","jsonContent","parse","readFileSync","dependencies","localization","locales","localizationDefaultLocale","localizationEnabled","localeCodes","defaultLocale"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAe;AACxC,OAAOC,YAAY,UAAS;AAC5B,OAAOC,gBAAgB,OAAM;AAC7B,SAASC,WAAW,QAAQ,SAAQ;AACpC,OAAOC,YAAY,UAAS;AAC5B,OAAOC,QAAQ,KAAI;AACnB,OAAOC,UAAU,OAAM;AACvB,SAASC,aAAa,QAAQ,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SAAkBC;IAC1C,OAAOP,WAAWO,YAAYK,IAAI,EAAEN,QAAQmD,MAAM;AACpD;AAEA,OAAO,MAAMnC,oBAAoB,CAACf;IAChC,OAAOA,aAAagE,cAAcjE,WAAW;AAC/C,EAAC;AAED,OAAO,MAAMmB,sBAAsB,CACjCnB;IAEA,IAAI,CAACA,QAAQyB,MAAM,CAACyC,YAAY,EAAE;QAChC,OAAO;YACLC,SAAS,EAAE;YACXC,2BAA2B;YAC3BC,qBAAqB;QACvB;IACF;IAEA,OAAO;QACLF,SAASnE,QAAQyB,MAAM,CAACyC,YAAY,CAACI,WAAW;QAChDF,2BAA2BpE,QAAQyB,MAAM,CAACyC,YAAY,CAACK,aAAa;QACpEF,qBAAqB;IACvB;AACF,EAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payload",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.20",
|
|
4
4
|
"description": "Node, React, Headless CMS and Application Framework built on Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"admin panel",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"scheduler": "0.23.0",
|
|
100
100
|
"scmp": "2.1.0",
|
|
101
101
|
"uuid": "^9.0.1",
|
|
102
|
-
"@payloadcms/translations": "3.0.0-beta.
|
|
102
|
+
"@payloadcms/translations": "3.0.0-beta.20"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
105
|
"@monaco-editor/react": "4.5.1",
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
}
|
|
156
156
|
},
|
|
157
157
|
"engines": {
|
|
158
|
-
"node": "
|
|
158
|
+
"node": "^18.20.2 || >=20.6.0"
|
|
159
159
|
},
|
|
160
160
|
"publishConfig": {
|
|
161
161
|
"access": "public",
|