payload 3.0.0-beta.54 → 3.0.0-beta.55

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.
@@ -0,0 +1,3 @@
1
+ import type { CustomComponent } from '../../config/types.js';
2
+ export type CustomUpload = CustomComponent;
3
+ //# sourceMappingURL=Upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Upload.d.ts","sourceRoot":"","sources":["../../../src/admin/elements/Upload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAE5D,MAAM,MAAM,YAAY,GAAG,eAAe,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=Upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/admin/elements/Upload.ts"],"sourcesContent":["import type { CustomComponent } from '../../config/types.js'\n\nexport type CustomUpload = CustomComponent\n"],"names":[],"mappings":"AAEA,WAA0C"}
@@ -8,6 +8,7 @@ export type { CustomPublishButton } from './elements/PublishButton.js';
8
8
  export type { CustomSaveButton } from './elements/SaveButton.js';
9
9
  export type { CustomSaveDraftButton } from './elements/SaveDraftButton.js';
10
10
  export type { DocumentTab, DocumentTabComponent, DocumentTabCondition, DocumentTabConfig, DocumentTabProps, } from './elements/Tab.js';
11
+ export type { CustomUpload } from './elements/Upload.js';
11
12
  export type { WithServerSidePropsComponent, WithServerSidePropsComponentProps, } from './elements/WithServerSideProps.js';
12
13
  export type { ErrorProps } from './forms/Error.js';
13
14
  export type { Description, DescriptionComponent, DescriptionFunction, FieldDescriptionProps, } from './forms/FieldDescription.js';
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/admin/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,YAAY,EAAE,eAAe,EAAE,uBAAuB,EAAE,kBAAkB,EAAE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"],"sourcesContent":["export type { LanguageOptions } from './LanguageOptions.js'\nexport type { RichTextAdapter, RichTextAdapterProvider, RichTextFieldProps } from './RichText.js'\nexport type { CellComponentProps, DefaultCellComponentProps } from './elements/Cell.js'\nexport type { ConditionalDateProps } from './elements/DatePicker.js'\nexport type { DayPickerProps, SharedProps, TimePickerProps } from './elements/DatePicker.js'\nexport type { CustomPreviewButton } from './elements/PreviewButton.js'\nexport type { CustomPublishButton } from './elements/PublishButton.js'\nexport type { CustomSaveButton } from './elements/SaveButton.js'\nexport type { CustomSaveDraftButton } from './elements/SaveDraftButton.js'\nexport type {\n DocumentTab,\n DocumentTabComponent,\n DocumentTabCondition,\n DocumentTabConfig,\n DocumentTabProps,\n} from './elements/Tab.js'\nexport type {\n WithServerSidePropsComponent,\n WithServerSidePropsComponentProps,\n} from './elements/WithServerSideProps.js'\nexport type { ErrorProps } from './forms/Error.js'\nexport type {\n Description,\n DescriptionComponent,\n DescriptionFunction,\n FieldDescriptionProps,\n} from './forms/FieldDescription.js'\nexport type { Data, FilterOptionsResult, FormField, FormState, Row } from './forms/Form.js'\nexport type { LabelProps, SanitizedLabelProps } from './forms/Label.js'\n\nexport type { RowLabel, RowLabelComponent } from './forms/RowLabel.js'\n\nexport type {\n AdminViewComponent,\n AdminViewProps,\n EditViewProps,\n InitPageResult,\n ServerSideEditViewProps,\n VisibleEntities,\n} from './views/types.js'\n"],"names":[],"mappings":"AAgCA,WAOyB"}
1
+ {"version":3,"sources":["../../src/admin/types.ts"],"sourcesContent":["export type { LanguageOptions } from './LanguageOptions.js'\nexport type { RichTextAdapter, RichTextAdapterProvider, RichTextFieldProps } from './RichText.js'\nexport type { CellComponentProps, DefaultCellComponentProps } from './elements/Cell.js'\nexport type { ConditionalDateProps } from './elements/DatePicker.js'\nexport type { DayPickerProps, SharedProps, TimePickerProps } from './elements/DatePicker.js'\nexport type { CustomPreviewButton } from './elements/PreviewButton.js'\nexport type { CustomPublishButton } from './elements/PublishButton.js'\nexport type { CustomSaveButton } from './elements/SaveButton.js'\nexport type { CustomSaveDraftButton } from './elements/SaveDraftButton.js'\nexport type {\n DocumentTab,\n DocumentTabComponent,\n DocumentTabCondition,\n DocumentTabConfig,\n DocumentTabProps,\n} from './elements/Tab.js'\nexport type { CustomUpload } from './elements/Upload.js'\nexport type {\n WithServerSidePropsComponent,\n WithServerSidePropsComponentProps,\n} from './elements/WithServerSideProps.js'\nexport type { ErrorProps } from './forms/Error.js'\nexport type {\n Description,\n DescriptionComponent,\n DescriptionFunction,\n FieldDescriptionProps,\n} from './forms/FieldDescription.js'\nexport type { Data, FilterOptionsResult, FormField, FormState, Row } from './forms/Form.js'\nexport type { LabelProps, SanitizedLabelProps } from './forms/Label.js'\n\nexport type { RowLabel, RowLabelComponent } from './forms/RowLabel.js'\n\nexport type {\n AdminViewComponent,\n AdminViewProps,\n EditViewProps,\n InitPageResult,\n ServerSideEditViewProps,\n VisibleEntities,\n} from './views/types.js'\n"],"names":[],"mappings":"AAiCA,WAOyB"}
@@ -4,6 +4,7 @@ import type { ClientUser } from '../types.js';
4
4
  export type MeOperationResult = {
5
5
  collection?: string;
6
6
  exp?: number;
7
+ strategy?: string;
7
8
  token?: string;
8
9
  user?: ClientUser;
9
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/me.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAQ,MAAM,aAAa,CAAA;AAEnD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,GAAG,EAAE,sBAAsB,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,WAAW,uCAIrB,SAAS,KAAG,OAAO,CAAC,iBAAiB,CAuDvC,CAAA"}
1
+ {"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/me.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAQ,MAAM,aAAa,CAAA;AAEnD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,GAAG,EAAE,sBAAsB,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,WAAW,uCAIrB,SAAS,KAAG,OAAO,CAAC,iBAAiB,CAwDvC,CAAA"}
@@ -22,6 +22,7 @@ export const meOperation = async ({ collection, currentToken, req })=>{
22
22
  delete user.collection;
23
23
  result = {
24
24
  collection: req.user.collection,
25
+ strategy: req.user._strategy,
25
26
  user
26
27
  };
27
28
  if (currentToken) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/auth/operations/me.ts"],"sourcesContent":["import jwt from 'jsonwebtoken'\n\nimport type { Collection } from '../../collections/config/types.js'\nimport type { PayloadRequestWithData } from '../../types/index.js'\nimport type { ClientUser, User } from '../types.js'\n\nexport type MeOperationResult = {\n collection?: string\n exp?: number\n token?: string\n user?: ClientUser\n}\n\nexport type Arguments = {\n collection: Collection\n currentToken?: string\n req: PayloadRequestWithData\n}\n\nexport const meOperation = async ({\n collection,\n currentToken,\n req,\n}: Arguments): Promise<MeOperationResult> => {\n let result: MeOperationResult = {\n user: null,\n }\n\n if (req.user) {\n const { pathname } = req\n const isGraphQL = pathname === `/api${req.payload.config.routes.graphQL}`\n\n const user = (await req.payload.findByID({\n id: req.user.id,\n collection: collection.config.slug,\n depth: isGraphQL ? 0 : collection.config.auth.depth,\n overrideAccess: false,\n req,\n showHiddenFields: false,\n })) as User\n\n if (req.user.collection !== collection.config.slug) {\n return {\n user: null,\n }\n }\n\n delete user.collection\n\n result = {\n collection: req.user.collection,\n user,\n }\n\n if (currentToken) {\n const decoded = jwt.decode(currentToken) as jwt.JwtPayload\n if (decoded) result.exp = decoded.exp\n result.token = currentToken\n }\n }\n\n // /////////////////////////////////////\n // After Me - Collection\n // /////////////////////////////////////\n\n await collection.config.hooks.afterMe.reduce(async (priorHook, hook) => {\n await priorHook\n\n result =\n (await hook({\n collection: collection?.config,\n context: req.context,\n req,\n response: result,\n })) || result\n }, Promise.resolve())\n\n return result\n}\n"],"names":["jwt","meOperation","collection","currentToken","req","result","user","pathname","isGraphQL","payload","config","routes","graphQL","findByID","id","slug","depth","auth","overrideAccess","showHiddenFields","decoded","decode","exp","token","hooks","afterMe","reduce","priorHook","hook","context","response","Promise","resolve"],"mappings":"AAAA,OAAOA,SAAS,eAAc;AAmB9B,OAAO,MAAMC,cAAc,OAAO,EAChCC,UAAU,EACVC,YAAY,EACZC,GAAG,EACO;IACV,IAAIC,SAA4B;QAC9BC,MAAM;IACR;IAEA,IAAIF,IAAIE,IAAI,EAAE;QACZ,MAAM,EAAEC,QAAQ,EAAE,GAAGH;QACrB,MAAMI,YAAYD,aAAa,CAAC,IAAI,EAAEH,IAAIK,OAAO,CAACC,MAAM,CAACC,MAAM,CAACC,OAAO,CAAC,CAAC;QAEzE,MAAMN,OAAQ,MAAMF,IAAIK,OAAO,CAACI,QAAQ,CAAC;YACvCC,IAAIV,IAAIE,IAAI,CAACQ,EAAE;YACfZ,YAAYA,WAAWQ,MAAM,CAACK,IAAI;YAClCC,OAAOR,YAAY,IAAIN,WAAWQ,MAAM,CAACO,IAAI,CAACD,KAAK;YACnDE,gBAAgB;YAChBd;YACAe,kBAAkB;QACpB;QAEA,IAAIf,IAAIE,IAAI,CAACJ,UAAU,KAAKA,WAAWQ,MAAM,CAACK,IAAI,EAAE;YAClD,OAAO;gBACLT,MAAM;YACR;QACF;QAEA,OAAOA,KAAKJ,UAAU;QAEtBG,SAAS;YACPH,YAAYE,IAAIE,IAAI,CAACJ,UAAU;YAC/BI;QACF;QAEA,IAAIH,cAAc;YAChB,MAAMiB,UAAUpB,IAAIqB,MAAM,CAAClB;YAC3B,IAAIiB,SAASf,OAAOiB,GAAG,GAAGF,QAAQE,GAAG;YACrCjB,OAAOkB,KAAK,GAAGpB;QACjB;IACF;IAEA,wCAAwC;IACxC,wBAAwB;IACxB,wCAAwC;IAExC,MAAMD,WAAWQ,MAAM,CAACc,KAAK,CAACC,OAAO,CAACC,MAAM,CAAC,OAAOC,WAAWC;QAC7D,MAAMD;QAENtB,SACE,AAAC,MAAMuB,KAAK;YACV1B,YAAYA,YAAYQ;YACxBmB,SAASzB,IAAIyB,OAAO;YACpBzB;YACA0B,UAAUzB;QACZ,MAAOA;IACX,GAAG0B,QAAQC,OAAO;IAElB,OAAO3B;AACT,EAAC"}
1
+ {"version":3,"sources":["../../../src/auth/operations/me.ts"],"sourcesContent":["import jwt from 'jsonwebtoken'\n\nimport type { Collection } from '../../collections/config/types.js'\nimport type { PayloadRequestWithData } from '../../types/index.js'\nimport type { ClientUser, User } from '../types.js'\n\nexport type MeOperationResult = {\n collection?: string\n exp?: number\n strategy?: string\n token?: string\n user?: ClientUser\n}\n\nexport type Arguments = {\n collection: Collection\n currentToken?: string\n req: PayloadRequestWithData\n}\n\nexport const meOperation = async ({\n collection,\n currentToken,\n req,\n}: Arguments): Promise<MeOperationResult> => {\n let result: MeOperationResult = {\n user: null,\n }\n\n if (req.user) {\n const { pathname } = req\n const isGraphQL = pathname === `/api${req.payload.config.routes.graphQL}`\n\n const user = (await req.payload.findByID({\n id: req.user.id,\n collection: collection.config.slug,\n depth: isGraphQL ? 0 : collection.config.auth.depth,\n overrideAccess: false,\n req,\n showHiddenFields: false,\n })) as User\n\n if (req.user.collection !== collection.config.slug) {\n return {\n user: null,\n }\n }\n\n delete user.collection\n\n result = {\n collection: req.user.collection,\n strategy: req.user._strategy,\n user,\n }\n\n if (currentToken) {\n const decoded = jwt.decode(currentToken) as jwt.JwtPayload\n if (decoded) result.exp = decoded.exp\n result.token = currentToken\n }\n }\n\n // /////////////////////////////////////\n // After Me - Collection\n // /////////////////////////////////////\n\n await collection.config.hooks.afterMe.reduce(async (priorHook, hook) => {\n await priorHook\n\n result =\n (await hook({\n collection: collection?.config,\n context: req.context,\n req,\n response: result,\n })) || result\n }, Promise.resolve())\n\n return result\n}\n"],"names":["jwt","meOperation","collection","currentToken","req","result","user","pathname","isGraphQL","payload","config","routes","graphQL","findByID","id","slug","depth","auth","overrideAccess","showHiddenFields","strategy","_strategy","decoded","decode","exp","token","hooks","afterMe","reduce","priorHook","hook","context","response","Promise","resolve"],"mappings":"AAAA,OAAOA,SAAS,eAAc;AAoB9B,OAAO,MAAMC,cAAc,OAAO,EAChCC,UAAU,EACVC,YAAY,EACZC,GAAG,EACO;IACV,IAAIC,SAA4B;QAC9BC,MAAM;IACR;IAEA,IAAIF,IAAIE,IAAI,EAAE;QACZ,MAAM,EAAEC,QAAQ,EAAE,GAAGH;QACrB,MAAMI,YAAYD,aAAa,CAAC,IAAI,EAAEH,IAAIK,OAAO,CAACC,MAAM,CAACC,MAAM,CAACC,OAAO,CAAC,CAAC;QAEzE,MAAMN,OAAQ,MAAMF,IAAIK,OAAO,CAACI,QAAQ,CAAC;YACvCC,IAAIV,IAAIE,IAAI,CAACQ,EAAE;YACfZ,YAAYA,WAAWQ,MAAM,CAACK,IAAI;YAClCC,OAAOR,YAAY,IAAIN,WAAWQ,MAAM,CAACO,IAAI,CAACD,KAAK;YACnDE,gBAAgB;YAChBd;YACAe,kBAAkB;QACpB;QAEA,IAAIf,IAAIE,IAAI,CAACJ,UAAU,KAAKA,WAAWQ,MAAM,CAACK,IAAI,EAAE;YAClD,OAAO;gBACLT,MAAM;YACR;QACF;QAEA,OAAOA,KAAKJ,UAAU;QAEtBG,SAAS;YACPH,YAAYE,IAAIE,IAAI,CAACJ,UAAU;YAC/BkB,UAAUhB,IAAIE,IAAI,CAACe,SAAS;YAC5Bf;QACF;QAEA,IAAIH,cAAc;YAChB,MAAMmB,UAAUtB,IAAIuB,MAAM,CAACpB;YAC3B,IAAImB,SAASjB,OAAOmB,GAAG,GAAGF,QAAQE,GAAG;YACrCnB,OAAOoB,KAAK,GAAGtB;QACjB;IACF;IAEA,wCAAwC;IACxC,wBAAwB;IACxB,wCAAwC;IAExC,MAAMD,WAAWQ,MAAM,CAACgB,KAAK,CAACC,OAAO,CAACC,MAAM,CAAC,OAAOC,WAAWC;QAC7D,MAAMD;QAENxB,SACE,AAAC,MAAMyB,KAAK;YACV5B,YAAYA,YAAYQ;YACxBqB,SAAS3B,IAAI2B,OAAO;YACpB3B;YACA4B,UAAU3B;QACZ,MAAOA;IACX,GAAG4B,QAAQC,OAAO;IAElB,OAAO7B;AACT,EAAC"}
@@ -3,6 +3,7 @@ import type { Document, PayloadRequestWithData } from '../../types/index.js';
3
3
  export type Result = {
4
4
  exp: number;
5
5
  refreshedToken: string;
6
+ strategy?: string;
6
7
  user: Document;
7
8
  };
8
9
  export type Arguments = {
@@ -1 +1 @@
1
- {"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/refresh.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAuB,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACxF,OAAO,KAAK,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAS5E,MAAM,MAAM,MAAM,GAAG;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,cAAc,EAAE,MAAM,CAAA;IACtB,IAAI,EAAE,QAAQ,CAAA;CACf,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,GAAG,EAAE,sBAAsB,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,eAAO,MAAM,gBAAgB,iBAAwB,SAAS,KAAG,OAAO,CAAC,MAAM,CA2G9E,CAAA"}
1
+ {"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/refresh.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAuB,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACxF,OAAO,KAAK,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAS5E,MAAM,MAAM,MAAM,GAAG;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,QAAQ,CAAA;CACf,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,GAAG,EAAE,sBAAsB,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,eAAO,MAAM,gBAAgB,iBAAwB,SAAS,KAAG,OAAO,CAAC,MAAM,CA4G9E,CAAA"}
@@ -48,6 +48,7 @@ export const refreshOperation = async (incomingArgs)=>{
48
48
  let result = {
49
49
  exp,
50
50
  refreshedToken,
51
+ strategy: args.req.user._strategy,
51
52
  user
52
53
  };
53
54
  // /////////////////////////////////////
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/auth/operations/refresh.ts"],"sourcesContent":["import jwt from 'jsonwebtoken'\nimport url from 'url'\n\nimport type { BeforeOperationHook, Collection } from '../../collections/config/types.js'\nimport type { Document, PayloadRequestWithData } from '../../types/index.js'\n\nimport { buildAfterOperation } from '../../collections/operations/utils.js'\nimport { Forbidden } from '../../errors/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { getFieldsToSign } from '../getFieldsToSign.js'\n\nexport type Result = {\n exp: number\n refreshedToken: string\n user: Document\n}\n\nexport type Arguments = {\n collection: Collection\n req: PayloadRequestWithData\n token: string\n}\n\nexport const refreshOperation = async (incomingArgs: Arguments): Promise<Result> => {\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(\n async (priorHook: BeforeOperationHook | Promise<void>, hook: BeforeOperationHook) => {\n await priorHook\n\n args =\n (await hook({\n args,\n collection: args.collection?.config,\n context: args.req.context,\n operation: 'refresh',\n req: args.req,\n })) || args\n },\n Promise.resolve(),\n )\n\n // /////////////////////////////////////\n // Refresh\n // /////////////////////////////////////\n\n const {\n collection: { config: collectionConfig },\n req,\n req: {\n payload: { config, secret },\n },\n } = args\n\n if (typeof args.token !== 'string' || !args.req.user) throw new Forbidden(args.req.t)\n\n const parsedURL = url.parse(args.req.url)\n const isGraphQL = parsedURL.pathname === config.routes.graphQL\n\n const user = await args.req.payload.findByID({\n id: args.req.user.id,\n collection: args.req.user.collection,\n depth: isGraphQL ? 0 : args.collection.config.auth.depth,\n req: args.req,\n })\n\n const fieldsToSign = getFieldsToSign({\n collectionConfig,\n email: user?.email as string,\n user: args?.req?.user,\n })\n\n const refreshedToken = jwt.sign(fieldsToSign, secret, {\n expiresIn: collectionConfig.auth.tokenExpiration,\n })\n\n const exp = (jwt.decode(refreshedToken) as Record<string, unknown>).exp as number\n\n let result: Result = {\n exp,\n refreshedToken,\n user,\n }\n\n // /////////////////////////////////////\n // After Refresh - Collection\n // /////////////////////////////////////\n\n await collectionConfig.hooks.afterRefresh.reduce(async (priorHook, hook) => {\n await priorHook\n\n result =\n (await hook({\n collection: args.collection?.config,\n context: args.req.context,\n exp,\n req: args.req,\n token: refreshedToken,\n })) || result\n }, Promise.resolve())\n\n // /////////////////////////////////////\n // afterOperation - Collection\n // /////////////////////////////////////\n\n result = await buildAfterOperation({\n args,\n collection: args.collection?.config,\n operation: 'refresh',\n result,\n })\n\n // /////////////////////////////////////\n // Return results\n // /////////////////////////////////////\n\n if (shouldCommit) await commitTransaction(req)\n\n return result\n } catch (error: unknown) {\n await killTransaction(args.req)\n throw error\n }\n}\n"],"names":["jwt","url","buildAfterOperation","Forbidden","commitTransaction","initTransaction","killTransaction","getFieldsToSign","refreshOperation","incomingArgs","args","shouldCommit","req","collection","config","hooks","beforeOperation","reduce","priorHook","hook","context","operation","Promise","resolve","collectionConfig","payload","secret","token","user","t","parsedURL","parse","isGraphQL","pathname","routes","graphQL","findByID","id","depth","auth","fieldsToSign","email","refreshedToken","sign","expiresIn","tokenExpiration","exp","decode","result","afterRefresh","error"],"mappings":"AAAA,OAAOA,SAAS,eAAc;AAC9B,OAAOC,SAAS,MAAK;AAKrB,SAASC,mBAAmB,QAAQ,wCAAuC;AAC3E,SAASC,SAAS,QAAQ,wBAAuB;AACjD,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,wBAAuB;AAcvD,OAAO,MAAMC,mBAAmB,OAAOC;IACrC,IAAIC,OAAOD;IAEX,IAAI;QACF,MAAME,eAAe,MAAMN,gBAAgBK,KAAKE,GAAG;QAEnD,wCAAwC;QACxC,+BAA+B;QAC/B,wCAAwC;QAExC,MAAMF,KAAKG,UAAU,CAACC,MAAM,CAACC,KAAK,CAACC,eAAe,CAACC,MAAM,CACvD,OAAOC,WAAgDC;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EvE,IAAIE,SAAiB;YACnBF;YACAJ;YACAd;QACF;QAEA,wCAAwC;QACxC,6BAA6B;QAC7B,wCAAwC;QAExC,MAAMJ,iBAAiBT,KAAK,CAACkC,YAAY,CAAChC,MAAM,CAAC,OAAOC,WAAWC;YACjE,MAAMD;YAEN8B,SACE,AAAC,MAAM7B,KAAK;gBACVN,YAAYH,KAAKG,UAAU,EAAEC;gBAC7BM,SAASV,KAAKE,GAAG,CAACQ,OAAO;gBACzB0B;gBACAlC,KAAKF,KAAKE,GAAG;gBACbe,OAAOe;YACT,MAAOM;QACX,GAAG1B,QAAQC,OAAO;QAElB,wCAAwC;QACxC,8BAA8B;QAC9B,wCAAwC;QAExCyB,SAAS,MAAM9C,oBAAoB;YACjCQ;YACAG,YAAYH,KAAKG,UAAU,EAAEC;YAC7BO,WAAW;YACX2B;QACF;QAEA,wCAAwC;QACxC,iBAAiB;QACjB,wCAAwC;QAExC,IAAIrC,cAAc,MAAMP,kBAAkBQ;QAE1C,OAAOoC;IACT,EAAE,OAAOE,OAAgB;QACvB,MAAM5C,gBAAgBI,KAAKE,GAAG;QAC9B,MAAMsC;IACR;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../src/auth/operations/refresh.ts"],"sourcesContent":["import jwt from 'jsonwebtoken'\nimport url from 'url'\n\nimport type { BeforeOperationHook, Collection } from '../../collections/config/types.js'\nimport type { Document, PayloadRequestWithData } from '../../types/index.js'\n\nimport { buildAfterOperation } from '../../collections/operations/utils.js'\nimport { Forbidden } from '../../errors/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { getFieldsToSign } from '../getFieldsToSign.js'\n\nexport type Result = {\n exp: number\n refreshedToken: string\n strategy?: string\n user: Document\n}\n\nexport type Arguments = {\n collection: Collection\n req: PayloadRequestWithData\n token: string\n}\n\nexport const refreshOperation = async (incomingArgs: Arguments): Promise<Result> => {\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(\n async (priorHook: BeforeOperationHook | Promise<void>, hook: BeforeOperationHook) => {\n await priorHook\n\n args =\n (await hook({\n args,\n collection: args.collection?.config,\n context: args.req.context,\n operation: 'refresh',\n req: args.req,\n })) || args\n },\n Promise.resolve(),\n )\n\n // /////////////////////////////////////\n // Refresh\n // /////////////////////////////////////\n\n const {\n collection: { config: collectionConfig },\n req,\n req: {\n payload: { config, secret },\n },\n } = args\n\n if (typeof args.token !== 'string' || !args.req.user) throw new Forbidden(args.req.t)\n\n const parsedURL = url.parse(args.req.url)\n const isGraphQL = parsedURL.pathname === config.routes.graphQL\n\n const user = await args.req.payload.findByID({\n id: args.req.user.id,\n collection: args.req.user.collection,\n depth: isGraphQL ? 0 : args.collection.config.auth.depth,\n req: args.req,\n })\n\n const fieldsToSign = getFieldsToSign({\n collectionConfig,\n email: user?.email as string,\n user: args?.req?.user,\n })\n\n const refreshedToken = jwt.sign(fieldsToSign, secret, {\n expiresIn: collectionConfig.auth.tokenExpiration,\n })\n\n const exp = (jwt.decode(refreshedToken) as Record<string, unknown>).exp as number\n\n let result: Result = {\n exp,\n refreshedToken,\n strategy: args.req.user._strategy,\n user,\n }\n\n // /////////////////////////////////////\n // After Refresh - Collection\n // /////////////////////////////////////\n\n await collectionConfig.hooks.afterRefresh.reduce(async (priorHook, hook) => {\n await priorHook\n\n result =\n (await hook({\n collection: args.collection?.config,\n context: args.req.context,\n exp,\n req: args.req,\n token: refreshedToken,\n })) || result\n }, Promise.resolve())\n\n // /////////////////////////////////////\n // afterOperation - Collection\n // /////////////////////////////////////\n\n result = await buildAfterOperation({\n args,\n collection: args.collection?.config,\n operation: 'refresh',\n result,\n })\n\n // /////////////////////////////////////\n // Return results\n // /////////////////////////////////////\n\n if (shouldCommit) await commitTransaction(req)\n\n return result\n } catch (error: unknown) {\n await killTransaction(args.req)\n throw error\n }\n}\n"],"names":["jwt","url","buildAfterOperation","Forbidden","commitTransaction","initTransaction","killTransaction","getFieldsToSign","refreshOperation","incomingArgs","args","shouldCommit","req","collection","config","hooks","beforeOperation","reduce","priorHook","hook","context","operation","Promise","resolve","collectionConfig","payload","secret","token","user","t","parsedURL","parse","isGraphQL","pathname","routes","graphQL","findByID","id","depth","auth","fieldsToSign","email","refreshedToken","sign","expiresIn","tokenExpiration","exp","decode","result","strategy","_strategy","afterRefresh","error"],"mappings":"AAAA,OAAOA,SAAS,eAAc;AAC9B,OAAOC,SAAS,MAAK;AAKrB,SAASC,mBAAmB,QAAQ,wCAAuC;AAC3E,SAASC,SAAS,QAAQ,wBAAuB;AACjD,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,wBAAuB;AAevD,OAAO,MAAMC,mBAAmB,OAAOC;IACrC,IAAIC,OAAOD;IAEX,IAAI;QACF,MAAME,eAAe,MAAMN,gBAAgBK,KAAKE,GAAG;QAEnD,wCAAwC;QACxC,+BAA+B;QAC/B,wCAAwC;QAExC,MAAMF,KAAKG,UAAU,CAACC,MAAM,CAACC,KAAK,CAACC,eAAe,CAACC,MAAM,CACvD,OAAOC,WAAgDC;YACrD,MAAMD;YAENR,OACE,AAAC,MAAMS,KAAK;gBACVT;gBACAG,YAAYH,KAAKG,UAAU,EAAEC;gBAC7BM,SAASV,KAAKE,GAAG,CAACQ,OAAO;gBACzBC,WAAW;gBACXT,KAAKF,KAAKE,GAAG;YACf,MAAOF;QACX,GACAY,QAAQC,OAAO;QAGjB,wCAAwC;QACxC,UAAU;QACV,wCAAwC;QAExC,MAAM,EACJV,YAAY,EAAEC,QAAQU,gBAAgB,EAAE,EACxCZ,GAAG,EACHA,KAAK,EACHa,SAAS,EAAEX,MAAM,EAAEY,MAAM,EAAE,EAC5B,EACF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AG;gBACbe,OAAOe;YACT,MAAOM;QACX,GAAG1B,QAAQC,OAAO;QAElB,wCAAwC;QACxC,8BAA8B;QAC9B,wCAAwC;QAExCyB,SAAS,MAAM9C,oBAAoB;YACjCQ;YACAG,YAAYH,KAAKG,UAAU,EAAEC;YAC7BO,WAAW;YACX2B;QACF;QAEA,wCAAwC;QACxC,iBAAiB;QACjB,wCAAwC;QAExC,IAAIrC,cAAc,MAAMP,kBAAkBQ;QAE1C,OAAOoC;IACT,EAAE,OAAOI,OAAgB;QACvB,MAAM9C,gBAAgBI,KAAKE,GAAG;QAC9B,MAAMwC;IACR;AACF,EAAC"}
@@ -31,6 +31,7 @@ export declare const createClientCollectionConfig: ({ collection, t, }: {
31
31
  PublishButton: import("../../index.js").CustomPublishButton;
32
32
  SaveButton: import("../../index.js").CustomSaveButton;
33
33
  SaveDraftButton: import("../../index.js").CustomSaveDraftButton;
34
+ Upload: import("../../index.js").CustomUpload;
34
35
  };
35
36
  views: {
36
37
  Edit: import("../../config/types.js").EditViewComponent | {
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/collections/config/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAA;AAE/F,MAAM,MAAM,8BAA8B,GAAG,MAAM,IAAI,CACrD,yBAAyB,EACzB,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAC5C,CAAA;AAED,MAAM,MAAM,mCAAmC,GAAG,MAAM,IAAI,CAC1D,yBAAyB,CAAC,OAAO,CAAC,EAClC,YAAY,GAAG,QAAQ,GAAG,SAAS,CACpC,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,yBAAyB,EACzB,OAAO,GAAG,QAAQ,GAAG,8BAA8B,CACpD,GAAG;IACF,KAAK,EAAE,IAAI,CACT,yBAAyB,CAAC,OAAO,CAAC,EAClC,QAAQ,GAAG,aAA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;;;;;;;;;;;;;;;;;;;wCARe,aAAY;;;;;;kCAQ5B,CAAC;;;;;;;;;;;;;;;;;;;;+BA6E4/I,MAAO,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA9B5iJ,CADJ;;4BACiF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBjF,CAAA;AAED,eAAO,MAAM,6BAA6B,wBAGvC;IACD,WAAW,EAAE,yBAAyB,EAAE,CAAA;IACxC,CAAC,EAAE,SAAS,CAAA;CACb,KAAG,sBAAsB,EACwD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/collections/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAerB,QAAA,MAAM,gBAAgB,uBAwNpB,CAAA;AAEF,eAAe,gBAAgB,CAAA"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/collections/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAUrB,QAAA,MAAM,gBAAgB,uBA0NpB,CAAA;AAEF,eAAe,gBAAgB,CAAA"}
@@ -2,10 +2,6 @@ import joi from 'joi';
2
2
  import { endpointsSchema } from '../../config/schema.js';
3
3
  import { componentSchema, customViewSchema, livePreviewSchema } from '../../config/shared/componentSchema.js';
4
4
  import { openGraphSchema } from '../../config/shared/openGraphSchema.js';
5
- const strategyBaseSchema = joi.object().keys({
6
- logout: joi.boolean(),
7
- refresh: joi.boolean()
8
- });
9
5
  const collectionSchema = joi.object().keys({
10
6
  slug: joi.string().required(),
11
7
  access: joi.object({
@@ -28,7 +24,8 @@ const collectionSchema = joi.object().keys({
28
24
  PreviewButton: componentSchema,
29
25
  PublishButton: componentSchema,
30
26
  SaveButton: componentSchema,
31
- SaveDraftButton: componentSchema
27
+ SaveDraftButton: componentSchema,
28
+ Upload: componentSchema
32
29
  }),
33
30
  views: joi.object({
34
31
  Edit: joi.alternatives().try(componentSchema, joi.object({
@@ -154,6 +151,7 @@ const collectionSchema = joi.object().keys({
154
151
  width: joi.number().integer().allow(null)
155
152
  }).unknown()),
156
153
  mimeTypes: joi.array().items(joi.string()),
154
+ modifyResponseHeaders: joi.func(),
157
155
  resizeOptions: joi.object().keys({
158
156
  background: joi.string(),
159
157
  fastShrinkOnLoad: 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'\nimport { openGraphSchema } from '../../config/shared/openGraphSchema.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 Description: componentSchema,\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\n .alternatives()\n .try(joi.func(), joi.object().pattern(joi.string(), [joi.string()]), joi.string()),\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 meta: joi.object({\n description: joi.string(),\n openGraph: openGraphSchema,\n }),\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 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 validate: joi.boolean(),\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","openGraphSchema","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","Description","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","meta","openGraph","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","tempFileDir","trimOptions","useTempFiles","versions","drafts","autosave","interval","validate","maxPerDoc"],"mappings":"AAAA,OAAOA,SAAS,MAAK;AAErB,SAASC,eAAe,QAAQ,yBAAwB;AACxD,SACEC,eAAe,EACfC,gBAAgB,EAChBC,iBAAiB,QACZ,yCAAwC;AAC/C,SAASC,eAAe,QAAQ,yCAAwC;AAExE,MAAMC,qBAAqBN,IAAIO,MAAM,GAAGC,IAAI,CAAC;IAC3CC,QAAQT,IAAIU,OAAO;IACnBC,SAASX,IAAIU,OAAO;AACtB;AAEA,MAAME,mBAAmBZ,IAAIO,MAAM,GAAGC,IAAI,CAAC;IACzCK,MAAMb,IAAIc,MAAM,GAAGC,QAAQ;IAC3BC,QAAQhB,IAAIO,MAAM,CAAC;QACjBU,OAAOjB,IAAIkB,IAAI;QACfC,QAAQnB,IAAIkB,IAAI;QAChBE,QAAQpB,IAAIkB,IAAI;QAChBG,MAAMrB,IAAIkB,IAAI;QACdI,cAActB,IAAIkB,IAAI;QACtBK,QAAQvB,IAAIkB,IAAI;QAChBM,QAAQxB,IAAIkB,IAAI;IAClB;IACAD,OAAOjB,IAAIO,MAAM,CAAC;QAChBkB,YAAYzB,IAAIO,MAAM,CAAC;YACrBmB,WAAW1B,IAAI2B,KAAK,GAAGC,KAAK,CAAC1B;YAC7B2B,gBAAgB7B,IAAI2B,KAAK,GAAGC,KAAK,CAAC1B;YAClC4B,YAAY9B,IAAI2B,KAAK,GAAGC,KAAK,CAAC1B;YAC9B6B,iBAAiB/B,IAAI2B,KAAK,GAAGC,KAAK,CAAC1B;YACnC8B,MAAMhC,IAAIO,MAAM,CAAC;gBACf0B,aAAa/B;gBACbgC,eAAehC;gBACfiC,eAAejC;gBACfkC,YAAYlC;gBACZmC,iBAAiBnC;YACnB;YACAoC,OAAOtC,IAAIO,MAAM,CAAC;gBAChBgC,MAAMvC,IAAIwC,YAAY,GAAGC,GAAG,CAC1BvC,iBACAF,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AAIU,OAAO;IAEb6I,UAAUvJ,IAAIwC,YAAY,GAAGC,GAAG,CAC9BzC,IAAIO,MAAM,CAAC;QACTiJ,QAAQxJ,IAAIwC,YAAY,GAAGC,GAAG,CAC5BzC,IAAIO,MAAM,CAAC;YACTkJ,UAAUzJ,IAAIwC,YAAY,GAAGC,GAAG,CAC9BzC,IAAIU,OAAO,IACXV,IAAIO,MAAM,CAAC;gBACTmJ,UAAU1J,IAAImE,MAAM;YACtB;YAEFwF,UAAU3J,IAAIU,OAAO;QACvB,IACAV,IAAIU,OAAO;QAEbkJ,WAAW5J,IAAImE,MAAM;IACvB,IACAnE,IAAIU,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'\nimport { openGraphSchema } from '../../config/shared/openGraphSchema.js'\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 Description: componentSchema,\n PreviewButton: componentSchema,\n PublishButton: componentSchema,\n SaveButton: componentSchema,\n SaveDraftButton: componentSchema,\n Upload: 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\n .alternatives()\n .try(joi.func(), joi.object().pattern(joi.string(), [joi.string()]), joi.string()),\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 meta: joi.object({\n description: joi.string(),\n openGraph: openGraphSchema,\n }),\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 modifyResponseHeaders: joi.func(),\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 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 validate: joi.boolean(),\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","openGraphSchema","collectionSchema","object","keys","slug","string","required","access","admin","func","create","delete","read","readVersions","unlock","update","components","AfterList","array","items","AfterListTable","BeforeList","BeforeListTable","edit","Description","PreviewButton","PublishButton","SaveButton","SaveDraftButton","Upload","views","Edit","alternatives","try","API","Default","LivePreview","Version","Versions","List","Component","actions","custom","pattern","any","defaultColumns","description","enableRichTextLink","boolean","enableRichTextRelationship","group","hidden","hideAPIURL","bool","listSearchableFields","livePreview","meta","openGraph","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","modifyResponseHeaders","resizeOptions","background","fastShrinkOnLoad","fit","kernel","position","withoutEnlargement","staticDir","tempFileDir","trimOptions","useTempFiles","versions","drafts","autosave","interval","validate","maxPerDoc"],"mappings":"AAAA,OAAOA,SAAS,MAAK;AAErB,SAASC,eAAe,QAAQ,yBAAwB;AACxD,SACEC,eAAe,EACfC,gBAAgB,EAChBC,iBAAiB,QACZ,yCAAwC;AAC/C,SAASC,eAAe,QAAQ,yCAAwC;AAExE,MAAMC,mBAAmBN,IAAIO,MAAM,GAAGC,IAAI,CAAC;IACzCC,MAAMT,IAAIU,MAAM,GAAGC,QAAQ;IAC3BC,QAAQZ,IAAIO,MAAM,CAAC;QACjBM,OAAOb,IAAIc,IAAI;QACfC,QAAQf,IAAIc,IAAI;QAChBE,QAAQhB,IAAIc,IAAI;QAChBG,MAAMjB,IAAIc,IAAI;QACdI,cAAclB,IAAIc,IAAI;QACtBK,QAAQnB,IAAIc,IAAI;QAChBM,QAAQpB,IAAIc,IAAI;IAClB;IACAD,OAAOb,IAAIO,MAAM,CAAC;QAChBc,YAAYrB,IAAIO,MAAM,CAAC;YACrBe,WAAWtB,IAAIuB,KAAK,GAAGC,KAAK,CAACtB;YAC7BuB,gBAAgBzB,IAAIuB,KAAK,GAAGC,KAAK,CAACtB;YAClCwB,YAAY1B,IAAIuB,KAAK,GAAGC,KAAK,CAACtB;YAC9ByB,iBAAiB3B,IAAIuB,KAAK,GAAGC,KAAK,CAACtB;YACnC0B,MAAM5B,IAAIO,MAAM,CAAC;gBACfsB,aAAa3B;gBACb4B,eAAe5B;gBACf6B,eAAe7B;gBACf8B,YAAY9B;gBACZ+B,iBAAiB/B;gBACjBgC,QAAQhC;YACV;YACAiC,OAAOnC,IAAIO,MAAM,CAAC;gBAChB6B,MAAMpC,IAAIqC,YAAY,GAAGC,GAAG,CAC1BpC,iBACAF,IAAIO,MAAM,CAAC;oBACTgC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IAAIqC,YAAY,GAAGC,GAAG,CAC9BtC,IAAIO,MAAM,CAAC;QACTgJ,QAAQvJ,IAAIqC,YAAY,GAAGC,GAAG,CAC5BtC,IAAIO,MAAM,CAAC;YACTiJ,UAAUxJ,IAAIqC,YAAY,GAAGC,GAAG,CAC9BtC,IAAIqD,OAAO,IACXrD,IAAIO,MAAM,CAAC;gBACTkJ,UAAUzJ,IAAIiE,MAAM;YACtB;YAEFyF,UAAU1J,IAAIqD,OAAO;QACvB,IACArD,IAAIqD,OAAO;QAEbsG,WAAW3J,IAAIiE,MAAM;IACvB,IACAjE,IAAIqD,OAAO;AAEf;AAEA,eAAe/C,iBAAgB"}
@@ -1,6 +1,6 @@
1
1
  import type { GraphQLInputObjectType, GraphQLNonNull, GraphQLObjectType } from 'graphql';
2
2
  import type { DeepRequired, MarkOptional } from 'ts-essentials';
3
- import type { CustomPreviewButton, CustomPublishButton, CustomSaveButton, CustomSaveDraftButton } from '../../admin/types.js';
3
+ import type { CustomPreviewButton, CustomPublishButton, CustomSaveButton, CustomSaveDraftButton, CustomUpload } from '../../admin/types.js';
4
4
  import type { Auth, ClientUser, IncomingAuthType } from '../../auth/types.js';
5
5
  import type { Access, CustomComponent, EditConfig, Endpoint, EntityDescription, EntityDescriptionComponent, GeneratePreviewURL, LabelFunction, LivePreviewConfig, OpenGraphConfig } from '../../config/types.js';
6
6
  import type { DBIdentifierName } from '../../database/types.js';
@@ -191,6 +191,11 @@ export type CollectionAdminOptions = {
191
191
  * + autosave must be disabled
192
192
  */
193
193
  SaveDraftButton?: CustomSaveDraftButton;
194
+ /**
195
+ * Replaces the "Upload" section
196
+ * + upload must be enabled
197
+ */
198
+ Upload?: CustomUpload;
194
199
  };
195
200
  views?: {
196
201
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/collections/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,iBAAiB,EAAE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AAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/collections/config/types.ts"],"sourcesContent":["import type { GraphQLInputObjectType, GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { DeepRequired, MarkOptional } from 'ts-essentials'\n\nimport type {\n CustomPreviewButton,\n CustomPublishButton,\n CustomSaveButton,\n CustomSaveDraftButton,\n} from '../../admin/types.js'\nimport type { Auth, ClientUser, IncomingAuthType } from '../../auth/types.js'\nimport type {\n Access,\n CustomComponent,\n EditConfig,\n Endpoint,\n EntityDescription,\n EntityDescriptionComponent,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n OpenGraphConfig,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type { Field } from '../../fields/config/types.js'\nimport type { CollectionSlug, TypedCollection } from '../../index.js'\nimport type { PayloadRequestWithData, RequestContext } from '../../types/index.js'\nimport type { SanitizedUploadConfig, UploadConfig } from '../../uploads/types.js'\nimport type {\n IncomingCollectionVersions,\n SanitizedCollectionVersions,\n} from '../../versions/types.js'\nimport type { AfterOperationArg, AfterOperationMap } from '../operations/utils.js'\n\nexport type DataFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollection[TSlug]\n\nexport type RequiredDataFromCollection<TData extends Record<string, any>> = MarkOptional<\n TData,\n 'createdAt' | 'id' | 'sizes' | 'updatedAt'\n>\n\nexport type RequiredDataFromCollectionSlug<TSlug extends CollectionSlug> =\n RequiredDataFromCollection<DataFromCollectionSlug<TSlug>>\n\nexport type HookOperationType =\n | 'autosave'\n | 'count'\n | 'create'\n | 'delete'\n | 'forgotPassword'\n | 'login'\n | 'read'\n | 'refresh'\n | 'update'\n\ntype CreateOrUpdateOperation = Extract<HookOperationType, 'create' | 'update'>\n\nexport type BeforeOperationHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n /**\n * Hook operation being performed\n */\n operation: HookOperationType\n req: PayloadRequestWithData\n}) => any\n\nexport type BeforeValidateHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data?: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequestWithData\n}) => any\n\nexport type BeforeChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequestWithData\n}) => any\n\nexport type AfterChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n previousDoc: T\n req: PayloadRequestWithData\n}) => any\n\nexport type BeforeReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n query: { [key: string]: any }\n req: PayloadRequestWithData\n}) => any\n\nexport type AfterReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n findMany?: boolean\n query?: { [key: string]: any }\n req: PayloadRequestWithData\n}) => any\n\nexport type BeforeDeleteHook = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n id: number | string\n req: PayloadRequestWithData\n}) => any\n\nexport type AfterDeleteHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n id: number | string\n req: PayloadRequestWithData\n}) => any\n\nexport type AfterOperationHook<TOperationGeneric extends CollectionSlug = string> = (\n arg: AfterOperationArg<TOperationGeneric>,\n) =>\n | Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n | Promise<\n Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n >\n\nexport type AfterErrorHook = (\n err: Error,\n res: unknown,\n context: RequestContext,\n /** The collection which this hook is being run on. This is null if the AfterError hook was be added to the payload-wide config */\n collection: SanitizedCollectionConfig | null,\n) => { response: any; status: number } | void\n\nexport type BeforeLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequestWithData\n user: T\n}) => any\n\nexport type AfterLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequestWithData\n token: string\n user: T\n}) => any\n\nexport type AfterLogoutHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequestWithData\n}) => any\n\nexport type AfterMeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequestWithData\n response: unknown\n}) => any\n\nexport type AfterRefreshHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n exp: number\n req: PayloadRequestWithData\n token: string\n}) => any\n\nexport type AfterForgotPasswordHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n}) => any\n\nexport type CollectionAdminOptions = {\n /**\n * Custom admin components\n */\n components?: {\n AfterList?: CustomComponent[]\n AfterListTable?: CustomComponent[]\n BeforeList?: CustomComponent[]\n BeforeListTable?: CustomComponent[]\n /**\n * Components within the edit view\n */\n edit?: {\n Description?: EntityDescriptionComponent\n\n /**\n * Replaces the \"Preview\" button\n */\n PreviewButton?: CustomPreviewButton\n /**\n * Replaces the \"Publish\" button\n * + drafts must be enabled\n */\n PublishButton?: CustomPublishButton\n /**\n * Replaces the \"Save\" button\n * + drafts must be disabled\n */\n SaveButton?: CustomSaveButton\n /**\n * Replaces the \"Save Draft\" button\n * + drafts must be enabled\n * + autosave must be disabled\n */\n SaveDraftButton?: CustomSaveDraftButton\n }\n views?: {\n /**\n * Set to a React component to replace the entire \"Edit\" view, including all nested routes.\n * Set to an object to replace or modify individual nested routes, or to add new ones.\n */\n Edit?: EditConfig\n List?:\n | {\n Component?: React.ComponentType<any>\n actions?: CustomComponent[]\n }\n | React.ComponentType<any>\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /**\n * Default columns to show in list view\n */\n defaultColumns?: string[]\n /**\n * Custom description for collection\n */\n description?: EntityDescription\n enableRichTextLink?: boolean\n enableRichTextRelationship?: boolean\n /**\n * Place collections into a navigational group\n * */\n group?: Record<string, string> | string\n /**\n * Exclude the collection from the admin nav and routes\n */\n hidden?: ((args: { user: ClientUser }) => boolean) | boolean\n /**\n * Hide the API URL within the Edit view\n */\n hideAPIURL?: boolean\n /**\n * Additional fields to be searched via the full text search\n */\n listSearchableFields?: string[]\n /**\n * Live preview options\n */\n livePreview?: LivePreviewConfig\n meta?: {\n description?: string\n openGraph?: OpenGraphConfig\n }\n pagination?: {\n defaultLimit?: number\n limits?: number[]\n }\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n /**\n * Field to use as title in Edit view and first column in List view\n */\n useAsTitle?: string\n}\n\n/** Manage all aspects of a data collection */\nexport type CollectionConfig<TSlug extends CollectionSlug = any> = {\n /**\n * Access control\n */\n access?: {\n admin?: ({ req }: { req: PayloadRequestWithData }) => Promise<boolean> | boolean\n create?: Access\n delete?: Access\n read?: Access\n readVersions?: Access\n unlock?: Access\n update?: Access\n }\n /**\n * Collection admin options\n */\n admin?: CollectionAdminOptions\n /**\n * Collection login options\n *\n * Use `true` to enable with default options\n */\n auth?: IncomingAuthType | boolean\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /**\n * Used to override the default naming of the database table or collection with your using a function or string\n * @WARNING: If you change this property with existing data, you will need to handle the renaming of the table in your database or by using migrations\n */\n dbName?: DBIdentifierName\n /**\n * Default field to sort by in collection list view\n */\n defaultSort?: string\n /**\n * When true, do not show the \"Duplicate\" button while editing documents within this collection and prevent `duplicate` from all APIs\n */\n disableDuplicate?: boolean\n /**\n * Custom rest api endpoints, set false to disable all rest endpoints for this collection.\n */\n endpoints?: Omit<Endpoint, 'root'>[] | false\n fields: Field[]\n /**\n * GraphQL configuration\n */\n graphQL?:\n | {\n pluralName?: string\n singularName?: string\n }\n | false\n /**\n * Hooks to modify Payload functionality\n */\n hooks?: {\n afterChange?: AfterChangeHook[]\n afterDelete?: AfterDeleteHook[]\n afterError?: AfterErrorHook\n afterForgotPassword?: AfterForgotPasswordHook[]\n afterLogin?: AfterLoginHook[]\n afterLogout?: AfterLogoutHook[]\n afterMe?: AfterMeHook[]\n afterOperation?: AfterOperationHook<TSlug>[]\n afterRead?: AfterReadHook[]\n afterRefresh?: AfterRefreshHook[]\n beforeChange?: BeforeChangeHook[]\n beforeDelete?: BeforeDeleteHook[]\n beforeLogin?: BeforeLoginHook[]\n beforeOperation?: BeforeOperationHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n }\n /**\n * Label configuration\n */\n labels?: {\n plural?: LabelFunction | Record<string, string> | string\n singular?: LabelFunction | Record<string, string> | string\n }\n slug: string\n /**\n * Add `createdAt` and `updatedAt` fields\n *\n * @default true\n */\n timestamps?: boolean\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable uploads\n */\n upload?: UploadConfig | boolean\n /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable versioning\n */\n versions?: IncomingCollectionVersions | boolean\n}\n\nexport interface SanitizedCollectionConfig\n extends Omit<\n DeepRequired<CollectionConfig>,\n 'auth' | 'endpoints' | 'fields' | 'upload' | 'versions'\n > {\n auth: Auth\n endpoints: Endpoint[] | false\n fields: Field[]\n upload: SanitizedUploadConfig\n versions: SanitizedCollectionVersions\n}\n\nexport type Collection = {\n config: SanitizedCollectionConfig\n customIDType?: 'number' | 'text'\n graphQL?: {\n JWT: GraphQLObjectType\n countType: GraphQLObjectType\n mutationInputType: GraphQLNonNull<any>\n paginatedType: GraphQLObjectType\n type: GraphQLObjectType\n updateMutationInputType: GraphQLNonNull<any>\n versionType: GraphQLObjectType\n whereInputType: GraphQLInputObjectType\n }\n}\n\nexport type BulkOperationResult<TSlug extends CollectionSlug> = {\n docs: DataFromCollectionSlug<TSlug>[]\n errors: {\n id: DataFromCollectionSlug<TSlug>['id']\n message: string\n }[]\n}\n\nexport type AuthCollection = {\n config: SanitizedCollectionConfig\n}\n\nexport type TypeWithID = {\n id: number | string\n}\n\nexport type TypeWithTimestamps = {\n [key: string]: unknown\n createdAt: string\n id: number | string\n updatedAt: string\n}\n"],"names":[],"mappings":"AA2dA,WAKC"}
1
+ {"version":3,"sources":["../../../src/collections/config/types.ts"],"sourcesContent":["import type { GraphQLInputObjectType, GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { DeepRequired, MarkOptional } from 'ts-essentials'\n\nimport type {\n CustomPreviewButton,\n CustomPublishButton,\n CustomSaveButton,\n CustomSaveDraftButton,\n CustomUpload,\n} from '../../admin/types.js'\nimport type { Auth, ClientUser, IncomingAuthType } from '../../auth/types.js'\nimport type {\n Access,\n CustomComponent,\n EditConfig,\n Endpoint,\n EntityDescription,\n EntityDescriptionComponent,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n OpenGraphConfig,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type { Field } from '../../fields/config/types.js'\nimport type { CollectionSlug, TypedCollection } from '../../index.js'\nimport type { PayloadRequestWithData, RequestContext } from '../../types/index.js'\nimport type { SanitizedUploadConfig, UploadConfig } from '../../uploads/types.js'\nimport type {\n IncomingCollectionVersions,\n SanitizedCollectionVersions,\n} from '../../versions/types.js'\nimport type { AfterOperationArg, AfterOperationMap } from '../operations/utils.js'\n\nexport type DataFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollection[TSlug]\n\nexport type RequiredDataFromCollection<TData extends Record<string, any>> = MarkOptional<\n TData,\n 'createdAt' | 'id' | 'sizes' | 'updatedAt'\n>\n\nexport type RequiredDataFromCollectionSlug<TSlug extends CollectionSlug> =\n RequiredDataFromCollection<DataFromCollectionSlug<TSlug>>\n\nexport type HookOperationType =\n | 'autosave'\n | 'count'\n | 'create'\n | 'delete'\n | 'forgotPassword'\n | 'login'\n | 'read'\n | 'refresh'\n | 'update'\n\ntype CreateOrUpdateOperation = Extract<HookOperationType, 'create' | 'update'>\n\nexport type BeforeOperationHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n /**\n * Hook operation being performed\n */\n operation: HookOperationType\n req: PayloadRequestWithData\n}) => any\n\nexport type BeforeValidateHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data?: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequestWithData\n}) => any\n\nexport type BeforeChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequestWithData\n}) => any\n\nexport type AfterChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n previousDoc: T\n req: PayloadRequestWithData\n}) => any\n\nexport type BeforeReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n query: { [key: string]: any }\n req: PayloadRequestWithData\n}) => any\n\nexport type AfterReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n findMany?: boolean\n query?: { [key: string]: any }\n req: PayloadRequestWithData\n}) => any\n\nexport type BeforeDeleteHook = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n id: number | string\n req: PayloadRequestWithData\n}) => any\n\nexport type AfterDeleteHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n id: number | string\n req: PayloadRequestWithData\n}) => any\n\nexport type AfterOperationHook<TOperationGeneric extends CollectionSlug = string> = (\n arg: AfterOperationArg<TOperationGeneric>,\n) =>\n | Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n | Promise<\n Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n >\n\nexport type AfterErrorHook = (\n err: Error,\n res: unknown,\n context: RequestContext,\n /** The collection which this hook is being run on. This is null if the AfterError hook was be added to the payload-wide config */\n collection: SanitizedCollectionConfig | null,\n) => { response: any; status: number } | void\n\nexport type BeforeLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequestWithData\n user: T\n}) => any\n\nexport type AfterLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequestWithData\n token: string\n user: T\n}) => any\n\nexport type AfterLogoutHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequestWithData\n}) => any\n\nexport type AfterMeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequestWithData\n response: unknown\n}) => any\n\nexport type AfterRefreshHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n exp: number\n req: PayloadRequestWithData\n token: string\n}) => any\n\nexport type AfterForgotPasswordHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n}) => any\n\nexport type CollectionAdminOptions = {\n /**\n * Custom admin components\n */\n components?: {\n AfterList?: CustomComponent[]\n AfterListTable?: CustomComponent[]\n BeforeList?: CustomComponent[]\n BeforeListTable?: CustomComponent[]\n /**\n * Components within the edit view\n */\n edit?: {\n Description?: EntityDescriptionComponent\n\n /**\n * Replaces the \"Preview\" button\n */\n PreviewButton?: CustomPreviewButton\n /**\n * Replaces the \"Publish\" button\n * + drafts must be enabled\n */\n PublishButton?: CustomPublishButton\n /**\n * Replaces the \"Save\" button\n * + drafts must be disabled\n */\n SaveButton?: CustomSaveButton\n /**\n * Replaces the \"Save Draft\" button\n * + drafts must be enabled\n * + autosave must be disabled\n */\n SaveDraftButton?: CustomSaveDraftButton\n /**\n * Replaces the \"Upload\" section\n * + upload must be enabled\n */\n Upload?: CustomUpload\n }\n views?: {\n /**\n * Set to a React component to replace the entire \"Edit\" view, including all nested routes.\n * Set to an object to replace or modify individual nested routes, or to add new ones.\n */\n Edit?: EditConfig\n List?:\n | {\n Component?: React.ComponentType<any>\n actions?: CustomComponent[]\n }\n | React.ComponentType<any>\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /**\n * Default columns to show in list view\n */\n defaultColumns?: string[]\n /**\n * Custom description for collection\n */\n description?: EntityDescription\n enableRichTextLink?: boolean\n enableRichTextRelationship?: boolean\n /**\n * Place collections into a navigational group\n * */\n group?: Record<string, string> | string\n /**\n * Exclude the collection from the admin nav and routes\n */\n hidden?: ((args: { user: ClientUser }) => boolean) | boolean\n /**\n * Hide the API URL within the Edit view\n */\n hideAPIURL?: boolean\n /**\n * Additional fields to be searched via the full text search\n */\n listSearchableFields?: string[]\n /**\n * Live preview options\n */\n livePreview?: LivePreviewConfig\n meta?: {\n description?: string\n openGraph?: OpenGraphConfig\n }\n pagination?: {\n defaultLimit?: number\n limits?: number[]\n }\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n /**\n * Field to use as title in Edit view and first column in List view\n */\n useAsTitle?: string\n}\n\n/** Manage all aspects of a data collection */\nexport type CollectionConfig<TSlug extends CollectionSlug = any> = {\n /**\n * Access control\n */\n access?: {\n admin?: ({ req }: { req: PayloadRequestWithData }) => Promise<boolean> | boolean\n create?: Access\n delete?: Access\n read?: Access\n readVersions?: Access\n unlock?: Access\n update?: Access\n }\n /**\n * Collection admin options\n */\n admin?: CollectionAdminOptions\n /**\n * Collection login options\n *\n * Use `true` to enable with default options\n */\n auth?: IncomingAuthType | boolean\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /**\n * Used to override the default naming of the database table or collection with your using a function or string\n * @WARNING: If you change this property with existing data, you will need to handle the renaming of the table in your database or by using migrations\n */\n dbName?: DBIdentifierName\n /**\n * Default field to sort by in collection list view\n */\n defaultSort?: string\n /**\n * When true, do not show the \"Duplicate\" button while editing documents within this collection and prevent `duplicate` from all APIs\n */\n disableDuplicate?: boolean\n /**\n * Custom rest api endpoints, set false to disable all rest endpoints for this collection.\n */\n endpoints?: Omit<Endpoint, 'root'>[] | false\n fields: Field[]\n /**\n * GraphQL configuration\n */\n graphQL?:\n | {\n pluralName?: string\n singularName?: string\n }\n | false\n /**\n * Hooks to modify Payload functionality\n */\n hooks?: {\n afterChange?: AfterChangeHook[]\n afterDelete?: AfterDeleteHook[]\n afterError?: AfterErrorHook\n afterForgotPassword?: AfterForgotPasswordHook[]\n afterLogin?: AfterLoginHook[]\n afterLogout?: AfterLogoutHook[]\n afterMe?: AfterMeHook[]\n afterOperation?: AfterOperationHook<TSlug>[]\n afterRead?: AfterReadHook[]\n afterRefresh?: AfterRefreshHook[]\n beforeChange?: BeforeChangeHook[]\n beforeDelete?: BeforeDeleteHook[]\n beforeLogin?: BeforeLoginHook[]\n beforeOperation?: BeforeOperationHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n }\n /**\n * Label configuration\n */\n labels?: {\n plural?: LabelFunction | Record<string, string> | string\n singular?: LabelFunction | Record<string, string> | string\n }\n slug: string\n /**\n * Add `createdAt` and `updatedAt` fields\n *\n * @default true\n */\n timestamps?: boolean\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable uploads\n */\n upload?: UploadConfig | boolean\n /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable versioning\n */\n versions?: IncomingCollectionVersions | boolean\n}\n\nexport interface SanitizedCollectionConfig\n extends Omit<\n DeepRequired<CollectionConfig>,\n 'auth' | 'endpoints' | 'fields' | 'upload' | 'versions'\n > {\n auth: Auth\n endpoints: Endpoint[] | false\n fields: Field[]\n upload: SanitizedUploadConfig\n versions: SanitizedCollectionVersions\n}\n\nexport type Collection = {\n config: SanitizedCollectionConfig\n customIDType?: 'number' | 'text'\n graphQL?: {\n JWT: GraphQLObjectType\n countType: GraphQLObjectType\n mutationInputType: GraphQLNonNull<any>\n paginatedType: GraphQLObjectType\n type: GraphQLObjectType\n updateMutationInputType: GraphQLNonNull<any>\n versionType: GraphQLObjectType\n whereInputType: GraphQLInputObjectType\n }\n}\n\nexport type BulkOperationResult<TSlug extends CollectionSlug> = {\n docs: DataFromCollectionSlug<TSlug>[]\n errors: {\n id: DataFromCollectionSlug<TSlug>['id']\n message: string\n }[]\n}\n\nexport type AuthCollection = {\n config: SanitizedCollectionConfig\n}\n\nexport type TypeWithID = {\n id: number | string\n}\n\nexport type TypeWithTimestamps = {\n [key: string]: unknown\n createdAt: string\n id: number | string\n updatedAt: string\n}\n"],"names":[],"mappings":"AAieA,WAKC"}
@@ -120,7 +120,7 @@ export type UploadConfig = {
120
120
  collection: string;
121
121
  filename: string;
122
122
  };
123
- }) => Promise<Response> | Response | null)[];
123
+ }) => Promise<Response> | Promise<void> | Response | void)[];
124
124
  imageSizes?: ImageSize[];
125
125
  /**
126
126
  * Restrict mimeTypes in the file picker. Array of valid mime types or mimetype wildcards
@@ -128,6 +128,13 @@ export type UploadConfig = {
128
128
  * @default undefined
129
129
  */
130
130
  mimeTypes?: string[];
131
+ /**
132
+ * Ability to modify the response headers fetching a file.
133
+ * @default undefined
134
+ */
135
+ modifyResponseHeaders?: ({ headers }: {
136
+ headers: Headers;
137
+ }) => Headers;
131
138
  /**
132
139
  * Sharp resize options for the original image.
133
140
  * @link https://sharp.pixelplumbing.com/api-resize#resize
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/uploads/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAEjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAE/D,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAA;IACvB,QAAQ,E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UAAU,CAAC,EAAE,SAAS,EAAE,CAAA;IACxB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAA;IACtE;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,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;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE;QACL,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,CAAC,CAAC,EAAE,MAAM,CAAA;QACV,CAAC,CAAC,EAAE,MAAM,CAAA;KACX,CAAA;IACD,UAAU,CAAC,EAAE;QACX,CAAC,CAAC,EAAE,MAAM,CAAA;QACV,CAAC,CAAC,EAAE,MAAM,CAAA;KACX,CAAA;CACF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/uploads/types.ts"],"sourcesContent":["import type { ResizeOptions, Sharp } from 'sharp'\n\nimport type { TypeWithID } from '../collections/config/types.js'\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 focalX?: number\n focalY?: 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 name to use for uploads. Used for storage adapter telemetry.\n * @default undefined\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 * - A function that generates a fully qualified URL for the thumbnail, receives the doc as the only argument.\n **/\n adminThumbnail?: GetAdminThumbnail | string\n /**\n * Enables cropping of images.\n * @default true\n */\n crop?: boolean\n /**\n * Disable the ability to save files to disk.\n * @default false\n */\n disableLocalStorage?: boolean\n /**\n * Ability to filter/modify Request Headers when fetching a file.\n *\n * Useful for adding custom headers to fetch from external providers.\n * @default undefined\n */\n externalFileHeaderFilter?: (headers: Record<string, string>) => Record<string, string>\n /**\n * Require files to be uploaded when creating a document.\n * @default true\n */\n filesRequiredOnCreate?: boolean\n /**\n * Enables focal point positioning for image manipulation.\n * @default false\n */\n focalPoint?: boolean\n /**\n * Format options for the uploaded file. Formatting image sizes needs to be done within each formatOptions individually.\n */\n formatOptions?: ImageUploadFormatOptions\n /**\n * Custom handlers to run when a file is fetched.\n *\n * - If a handler returns a Response, the response will be sent to the client and no further handlers will be run.\n * - If a handler returns null, the next handler will be run.\n * - If no handlers return a response the file will be returned by default.\n *\n * @default undefined\n */\n handlers?: ((\n req: PayloadRequestWithData,\n args: { doc: TypeWithID; params: { collection: string; filename: string } },\n ) => Promise<Response> | Response | null)[]\n imageSizes?: ImageSize[]\n /**\n * Restrict mimeTypes in the file picker. Array of valid mime types or mimetype wildcards\n * @example ['image/*', 'application/pdf']\n * @default undefined\n */\n mimeTypes?: string[]\n /**\n * Sharp resize options for the original image.\n * @link https://sharp.pixelplumbing.com/api-resize#resize\n * @default undefined\n */\n resizeOptions?: ResizeOptions\n /**\n * The directory to serve static files from. Defaults to collection slug.\n * @default undefined\n */\n staticDir?: string\n trimOptions?: ImageUploadTrimOptions\n}\n\nexport type SanitizedUploadConfig = UploadConfig & {\n staticDir: UploadConfig['staticDir']\n}\n\nexport type File = {\n /**\n * The buffer of the file.\n */\n data: Buffer\n /**\n * The mimetype of the file.\n */\n mimetype: string\n /**\n * The name of the file.\n */\n name: string\n /**\n * The size of the file in bytes.\n */\n size: number\n}\n\nexport type FileToSave = {\n /**\n * The buffer of the file.\n */\n buffer: Buffer\n /**\n * The path to save the file.\n */\n path: string\n}\n\nexport type UploadEdits = {\n crop?: {\n height?: number\n width?: number\n x?: number\n y?: number\n }\n focalPoint?: {\n x?: number\n y?: number\n }\n}\n"],"names":[],"mappings":"AAuLA,WAWC"}
1
+ {"version":3,"sources":["../../src/uploads/types.ts"],"sourcesContent":["import type { ResizeOptions, Sharp } from 'sharp'\n\nimport type { TypeWithID } from '../collections/config/types.js'\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 focalX?: number\n focalY?: 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 name to use for uploads. Used for storage adapter telemetry.\n * @default undefined\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 * - A function that generates a fully qualified URL for the thumbnail, receives the doc as the only argument.\n **/\n adminThumbnail?: GetAdminThumbnail | string\n /**\n * Enables cropping of images.\n * @default true\n */\n crop?: boolean\n /**\n * Disable the ability to save files to disk.\n * @default false\n */\n disableLocalStorage?: boolean\n /**\n * Ability to filter/modify Request Headers when fetching a file.\n *\n * Useful for adding custom headers to fetch from external providers.\n * @default undefined\n */\n externalFileHeaderFilter?: (headers: Record<string, string>) => Record<string, string>\n /**\n * Require files to be uploaded when creating a document.\n * @default true\n */\n filesRequiredOnCreate?: boolean\n /**\n * Enables focal point positioning for image manipulation.\n * @default false\n */\n focalPoint?: boolean\n /**\n * Format options for the uploaded file. Formatting image sizes needs to be done within each formatOptions individually.\n */\n formatOptions?: ImageUploadFormatOptions\n /**\n * Custom handlers to run when a file is fetched.\n *\n * - If a handler returns a Response, the response will be sent to the client and no further handlers will be run.\n * - If a handler returns null, the next handler will be run.\n * - If no handlers return a response the file will be returned by default.\n *\n * @default undefined\n */\n handlers?: ((\n req: PayloadRequestWithData,\n args: {\n doc: TypeWithID\n params: { collection: string; filename: string }\n },\n ) => Promise<Response> | Promise<void> | Response | void)[]\n imageSizes?: ImageSize[]\n /**\n * Restrict mimeTypes in the file picker. Array of valid mime types or mimetype wildcards\n * @example ['image/*', 'application/pdf']\n * @default undefined\n */\n mimeTypes?: string[]\n /**\n * Ability to modify the response headers fetching a file.\n * @default undefined\n */\n modifyResponseHeaders?: ({ headers }: { headers: Headers }) => Headers\n /**\n * Sharp resize options for the original image.\n * @link https://sharp.pixelplumbing.com/api-resize#resize\n * @default undefined\n */\n resizeOptions?: ResizeOptions\n /**\n * The directory to serve static files from. Defaults to collection slug.\n * @default undefined\n */\n staticDir?: string\n trimOptions?: ImageUploadTrimOptions\n}\n\nexport type SanitizedUploadConfig = UploadConfig & {\n staticDir: UploadConfig['staticDir']\n}\n\nexport type File = {\n /**\n * The buffer of the file.\n */\n data: Buffer\n /**\n * The mimetype of the file.\n */\n mimetype: string\n /**\n * The name of the file.\n */\n name: string\n /**\n * The size of the file in bytes.\n */\n size: number\n}\n\nexport type FileToSave = {\n /**\n * The buffer of the file.\n */\n buffer: Buffer\n /**\n * The path to save the file.\n */\n path: string\n}\n\nexport type UploadEdits = {\n crop?: {\n height?: number\n width?: number\n x?: number\n y?: number\n }\n focalPoint?: {\n x?: number\n y?: number\n }\n}\n"],"names":[],"mappings":"AA+LA,WAWC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payload",
3
- "version": "3.0.0-beta.54",
3
+ "version": "3.0.0-beta.55",
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
  "scmp": "2.1.0",
100
100
  "ts-essentials": "7.0.3",
101
101
  "uuid": "10.0.0",
102
- "@payloadcms/translations": "3.0.0-beta.54"
102
+ "@payloadcms/translations": "3.0.0-beta.55"
103
103
  },
104
104
  "devDependencies": {
105
105
  "@hyrious/esbuild-plugin-commonjs": "^0.2.4",