@payloadcms/ui 3.74.0-internal.b0ecd5c → 3.74.0-internal.b78b222
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/elements/DocumentDrawer/DrawerContent.d.ts.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerContent.js +1 -4
- package/dist/elements/DocumentDrawer/DrawerContent.js.map +1 -1
- package/dist/elements/PublishButton/ScheduleDrawer/index.d.ts.map +1 -1
- package/dist/elements/PublishButton/ScheduleDrawer/index.js +5 -6
- package/dist/elements/PublishButton/ScheduleDrawer/index.js.map +1 -1
- package/dist/exports/client/index.js +12 -12
- package/dist/exports/client/index.js.map +3 -3
- package/dist/providers/ServerFunctions/index.d.ts +1 -2
- package/dist/providers/ServerFunctions/index.d.ts.map +1 -1
- package/dist/providers/ServerFunctions/index.js +0 -1
- package/dist/providers/ServerFunctions/index.js.map +1 -1
- package/dist/utilities/buildTableState.js +3 -4
- package/dist/utilities/buildTableState.js.map +1 -1
- package/dist/utilities/schedulePublishHandler.d.ts +4 -10
- package/dist/utilities/schedulePublishHandler.d.ts.map +1 -1
- package/dist/utilities/schedulePublishHandler.js +5 -4
- package/dist/utilities/schedulePublishHandler.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AdminViewServerPropsOnly, BuildFormStateArgs, BuildTableStateArgs, Data, DocumentPreferences, DocumentSlots, FormState, GetFolderResultsComponentAndDataArgs,
|
|
1
|
+
import type { AdminViewServerPropsOnly, BuildFormStateArgs, BuildTableStateArgs, Data, DocumentPreferences, DocumentSlots, FormState, GetFolderResultsComponentAndDataArgs, Params, RenderDocumentVersionsProperties, ServerFunction, ServerFunctionClient, SlugifyServerFunctionArgs } from 'payload';
|
|
2
2
|
import type { Slugify } from 'payload/shared';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import type { RenderFieldServerFnArgs, RenderFieldServerFnReturnType } from '../../forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.js';
|
|
@@ -31,7 +31,6 @@ type RenderDocumentBaseArgs = {
|
|
|
31
31
|
drawerSlug?: string;
|
|
32
32
|
initialData?: Data;
|
|
33
33
|
initialState?: FormState;
|
|
34
|
-
locale?: Locale;
|
|
35
34
|
overrideEntityVisibility?: boolean;
|
|
36
35
|
paramsOverride?: AdminViewServerPropsOnly['params'];
|
|
37
36
|
redirectAfterCreate?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/ServerFunctions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,IAAI,EACJ,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,oCAAoC,EACpC,MAAM,EACN,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/ServerFunctions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,IAAI,EACJ,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,oCAAoC,EACpC,MAAM,EACN,gCAAgC,EAChC,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,KAAqC,MAAM,OAAO,CAAA;AAEzD,OAAO,KAAK,EACV,uBAAuB,EACvB,6BAA6B,EAC9B,MAAM,4EAA4E,CAAA;AACnF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AAC9E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAA;AAChF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAA;AACnF,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,qDAAqD,CA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A;AAElG,MAAM,MAAM,0BAA0B,GAAG;IACvC,qBAAqB,EAAE,iBAAiB,CAAA;IACxC,kBAAkB,EAAE,wBAAwB,CAAA;IAC5C,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,gCAAgC,EAAE,sCAAsC,CAAA;IACxE,YAAY,EAAE,kBAAkB,CAAA;IAChC,aAAa,EAAE,mBAAmB,CAAA;IAClC,cAAc,EAAE,kCAAkC,CAAA;IAClD,eAAe,EAAE,qBAAqB,CAAA;IACtC,cAAc,EAAE,oBAAoB,CAAA;IACpC,OAAO,EAAE,aAAa,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,sBAAsB,2CAElC,CAAA;AAED,eAAO,MAAM,kBAAkB,kCAM9B,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC;IAC7C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,cAAc,EAAE,oBAAoB,CAAA;CACrC,CA4MA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","createContext","useCallback","ServerFunctionsContext","undefined","useServerFunctions","context","use","Error","ServerFunctionsProvider","children","serverFunction","getDocumentSlots","args","name","schedulePublish","signal","remoteSignal","rest","aborted","result","_err","console","error","type","doc","value","relationTo","getFormState","fallbackLocale","state","getTableState","renderDocument","copyDataFromLocale","getFolderResultsComponentAndData","_internal_renderField","slugify","_jsx"],"sources":["../../../src/providers/ServerFunctions/index.tsx"],"sourcesContent":["import type {\n AdminViewServerPropsOnly,\n BuildFormStateArgs,\n BuildTableStateArgs,\n Data,\n DocumentPreferences,\n DocumentSlots,\n FormState,\n GetFolderResultsComponentAndDataArgs,\n Locale,\n Params,\n RenderDocumentVersionsProperties,\n ServerFunction,\n ServerFunctionClient,\n SlugifyServerFunctionArgs,\n} from 'payload'\nimport type { Slugify } from 'payload/shared'\n\nimport React, { createContext, useCallback } from 'react'\n\nimport type {\n RenderFieldServerFnArgs,\n RenderFieldServerFnReturnType,\n} from '../../forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.js'\nimport type { buildFormStateHandler } from '../../utilities/buildFormState.js'\nimport type { buildTableStateHandler } from '../../utilities/buildTableState.js'\nimport type { CopyDataFromLocaleArgs } from '../../utilities/copyDataFromLocale.js'\nimport type { getFolderResultsComponentAndDataHandler } from '../../utilities/getFolderResultsComponentAndData.js'\nimport type {\n schedulePublishHandler,\n SchedulePublishHandlerArgs,\n} from '../../utilities/schedulePublishHandler.js'\n\ntype GetFormStateClient = (\n args: {\n signal?: AbortSignal\n } & Omit<BuildFormStateArgs, 'clientConfig' | 'req'>,\n) => ReturnType<typeof buildFormStateHandler>\n\ntype SchedulePublishClient = (\n args: {\n signal?: AbortSignal\n } & Omit<SchedulePublishHandlerArgs, 'clientConfig' | 'req'>,\n) => ReturnType<typeof schedulePublishHandler>\n\ntype GetTableStateClient = (\n args: {\n signal?: AbortSignal\n } & Omit<BuildTableStateArgs, 'clientConfig' | 'req'>,\n) => ReturnType<typeof buildTableStateHandler>\n\ntype SlugifyClient = (\n args: {\n signal?: AbortSignal\n } & Omit<SlugifyServerFunctionArgs, 'clientConfig' | 'req'>,\n) => ReturnType<Slugify>\n\nexport type RenderDocumentResult = {\n data: any\n Document: React.ReactNode\n preferences: DocumentPreferences\n}\n\ntype RenderDocumentBaseArgs = {\n collectionSlug: string\n disableActions?: boolean\n docID: number | string\n drawerSlug?: string\n initialData?: Data\n initialState?: FormState\n locale?: Locale\n overrideEntityVisibility?: boolean\n paramsOverride?: AdminViewServerPropsOnly['params']\n redirectAfterCreate?: boolean\n redirectAfterDelete: boolean\n redirectAfterDuplicate: boolean\n redirectAfterRestore?: boolean\n searchParams?: Params\n /**\n * Properties specific to the versions view\n */\n versions?: RenderDocumentVersionsProperties\n}\n\nexport type RenderDocumentServerFunction = ServerFunction<\n RenderDocumentBaseArgs,\n Promise<RenderDocumentResult>\n>\n\ntype RenderDocumentServerFunctionHookFn = (\n // No req or importMap - those are augmented by handleServerFunctions\n args: {\n signal?: AbortSignal\n } & RenderDocumentBaseArgs,\n) => Promise<RenderDocumentResult>\n\ntype CopyDataFromLocaleClient = (\n args: {\n signal?: AbortSignal\n } & Omit<CopyDataFromLocaleArgs, 'req'>,\n) => Promise<{ data: Data }>\n\ntype GetDocumentSlots = (args: {\n collectionSlug: string\n id?: number | string\n signal?: AbortSignal\n}) => Promise<DocumentSlots>\n\ntype GetFolderResultsComponentAndDataClient = (\n args: {\n signal?: AbortSignal\n } & Omit<GetFolderResultsComponentAndDataArgs, 'req'>,\n) => ReturnType<typeof getFolderResultsComponentAndDataHandler>\n\ntype RenderFieldClient = (args: RenderFieldServerFnArgs) => Promise<RenderFieldServerFnReturnType>\n\nexport type ServerFunctionsContextType = {\n _internal_renderField: RenderFieldClient\n copyDataFromLocale: CopyDataFromLocaleClient\n getDocumentSlots: GetDocumentSlots\n getFolderResultsComponentAndData: GetFolderResultsComponentAndDataClient\n getFormState: GetFormStateClient\n getTableState: GetTableStateClient\n renderDocument: RenderDocumentServerFunctionHookFn\n schedulePublish: SchedulePublishClient\n serverFunction: ServerFunctionClient\n slugify: SlugifyClient\n}\n\nexport const ServerFunctionsContext = createContext<ServerFunctionsContextType | undefined>(\n undefined,\n)\n\nexport const useServerFunctions = () => {\n const context = React.use(ServerFunctionsContext)\n if (context === undefined) {\n throw new Error('useServerFunctions must be used within a ServerFunctionsProvider')\n }\n return context\n}\n\nexport const ServerFunctionsProvider: React.FC<{\n children: React.ReactNode\n serverFunction: ServerFunctionClient\n}> = ({ children, serverFunction }) => {\n if (!serverFunction) {\n throw new Error('ServerFunctionsProvider requires a serverFunction prop')\n }\n\n const getDocumentSlots = useCallback<GetDocumentSlots>(\n async (args) =>\n await serverFunction({\n name: 'render-document-slots',\n args,\n }),\n [serverFunction],\n )\n\n const schedulePublish = useCallback<SchedulePublishClient>(\n async (args) => {\n const { signal: remoteSignal, ...rest } = args\n\n try {\n if (!remoteSignal?.aborted) {\n const result = (await serverFunction({\n name: 'schedule-publish',\n args: { ...rest },\n })) as Awaited<ReturnType<typeof schedulePublishHandler>> // TODO: infer this type when `strictNullChecks` is enabled\n\n if (!remoteSignal?.aborted) {\n return result\n }\n }\n } catch (_err) {\n console.error(_err) // eslint-disable-line no-console\n }\n\n let error = `Error scheduling ${rest.type}`\n\n if (rest.doc) {\n error += ` for document with ID ${rest.doc.value} in collection ${rest.doc.relationTo}`\n }\n\n return { error }\n },\n [serverFunction],\n )\n\n const getFormState = useCallback<GetFormStateClient>(\n async (args) => {\n const { signal: remoteSignal, ...rest } = args || {}\n\n try {\n if (!remoteSignal?.aborted) {\n const result = (await serverFunction({\n name: 'form-state',\n args: { fallbackLocale: false, ...rest },\n })) as Awaited<ReturnType<typeof buildFormStateHandler>> // TODO: infer this type when `strictNullChecks` is enabled\n\n if (!remoteSignal?.aborted) {\n return result\n }\n }\n } catch (_err) {\n console.error(_err) // eslint-disable-line no-console\n }\n\n return { state: null }\n },\n [serverFunction],\n )\n\n const getTableState = useCallback<GetTableStateClient>(\n async (args) => {\n const { signal: remoteSignal, ...rest } = args || {}\n\n try {\n if (!remoteSignal?.aborted) {\n const result = (await serverFunction({\n name: 'table-state',\n args: { fallbackLocale: false, ...rest },\n })) as Awaited<ReturnType<typeof buildTableStateHandler>> // TODO: infer this type when `strictNullChecks` is enabled\n\n if (!remoteSignal?.aborted) {\n return result\n }\n }\n } catch (_err) {\n console.error(_err) // eslint-disable-line no-console\n }\n\n // return { state: args.formState }\n },\n [serverFunction],\n )\n\n const renderDocument = useCallback<RenderDocumentServerFunctionHookFn>(\n async (args) => {\n const { signal: remoteSignal, ...rest } = args || {}\n try {\n const result = (await serverFunction({\n name: 'render-document',\n args: {\n fallbackLocale: false,\n ...rest,\n } as Parameters<RenderDocumentServerFunctionHookFn>[0],\n })) as Awaited<ReturnType<RenderDocumentServerFunctionHookFn>> // TODO: infer this type when `strictNullChecks` is enabled\n\n return result\n } catch (_err) {\n console.error(_err) // eslint-disable-line no-console\n }\n },\n [serverFunction],\n )\n\n const copyDataFromLocale = useCallback<CopyDataFromLocaleClient>(\n async (args) => {\n const { signal: remoteSignal, ...rest } = args || {}\n\n try {\n const result = (await serverFunction({\n name: 'copy-data-from-locale',\n args: rest,\n })) as { data: Data }\n\n if (!remoteSignal?.aborted) {\n return result\n }\n } catch (_err) {\n console.error(_err) // eslint-disable-line no-console\n }\n },\n [serverFunction],\n )\n\n const getFolderResultsComponentAndData = useCallback<GetFolderResultsComponentAndDataClient>(\n async (args) => {\n const { signal: remoteSignal, ...rest } = args || {}\n\n try {\n const result = (await serverFunction({\n name: 'get-folder-results-component-and-data',\n args: rest,\n })) as Awaited<ReturnType<typeof getFolderResultsComponentAndDataHandler>>\n\n if (!remoteSignal?.aborted) {\n return result\n }\n } catch (_err) {\n console.error(_err) // eslint-disable-line no-console\n }\n },\n [serverFunction],\n )\n\n const _internal_renderField = useCallback<RenderFieldClient>(\n async (args) => {\n try {\n const result = (await serverFunction({\n name: 'render-field',\n args,\n })) as RenderFieldServerFnReturnType\n\n return result\n } catch (_err) {\n console.error(_err) // eslint-disable-line no-console\n }\n },\n [serverFunction],\n )\n\n const slugify = useCallback<SlugifyClient>(\n async (args) => {\n const { signal: remoteSignal, ...rest } = args || {}\n\n try {\n const result = (await serverFunction({\n name: 'slugify',\n args: { ...rest },\n })) as Awaited<ReturnType<Slugify>> // TODO: infer this type when `strictNullChecks` is enabled\n\n return result\n } catch (_err) {\n console.error(_err) // eslint-disable-line no-console\n }\n },\n [serverFunction],\n )\n\n return (\n <ServerFunctionsContext\n value={{\n _internal_renderField,\n copyDataFromLocale,\n getDocumentSlots,\n getFolderResultsComponentAndData,\n getFormState,\n getTableState,\n renderDocument,\n schedulePublish,\n serverFunction,\n slugify,\n }}\n >\n {children}\n </ServerFunctionsContext>\n )\n}\n"],"mappings":";AAkBA,OAAOA,KAAA,IAASC,aAAa,EAAEC,WAAW,QAAQ;AA+GlD,OAAO,MAAMC,sBAAA,gBAAyBF,aAAA,CACpCG,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A;IACT,EAAE,OAAOC,IAAA,EAAM;MACbC,OAAA,CAAQC,KAAK,CAACF,IAAA,GAAM;IACtB;EACF,GACA,CAACV,cAAA,CAAe;EAGlB,MAAMyB,OAAA,GAAUlC,WAAA,CACd,MAAOW,IAAA;IACL,MAAM;MAAEG,MAAA,EAAQC,YAAY;MAAE,GAAGC;IAAA,CAAM,GAAGL,IAAA,IAAQ,CAAC;IAEnD,IAAI;MACF,MAAMO,MAAA,GAAU,MAAMT,cAAA,CAAe;QACnCG,IAAA,EAAM;QACND,IAAA,EAAM;UAAE,GAAGK;QAAK;MAClB;MAAoC;MAEpC,OAAOE,MAAA;IACT,EAAE,OAAOC,IAAA,EAAM;MACbC,OAAA,CAAQC,KAAK,CAACF,IAAA,GAAM;IACtB;EACF,GACA,CAACV,cAAA,CAAe;EAGlB,oBACE0B,IAAA,CAAClC,sBAAA;IACCuB,KAAA,EAAO;MACLS,qBAAA;MACAF,kBAAA;MACArB,gBAAA;MACAsB,gCAAA;MACAN,YAAA;MACAG,aAAA;MACAC,cAAA;MACAjB,eAAA;MACAJ,cAAA;MACAyB;IACF;cAEC1B;;AAGP","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","createContext","useCallback","ServerFunctionsContext","undefined","useServerFunctions","context","use","Error","ServerFunctionsProvider","children","serverFunction","getDocumentSlots","args","name","schedulePublish","signal","remoteSignal","rest","aborted","result","_err","console","error","type","doc","value","relationTo","getFormState","fallbackLocale","state","getTableState","renderDocument","copyDataFromLocale","getFolderResultsComponentAndData","_internal_renderField","slugify","_jsx"],"sources":["../../../src/providers/ServerFunctions/index.tsx"],"sourcesContent":["import type {\n AdminViewServerPropsOnly,\n BuildFormStateArgs,\n BuildTableStateArgs,\n Data,\n DocumentPreferences,\n DocumentSlots,\n FormState,\n GetFolderResultsComponentAndDataArgs,\n Params,\n RenderDocumentVersionsProperties,\n ServerFunction,\n ServerFunctionClient,\n SlugifyServerFunctionArgs,\n} from 'payload'\nimport type { Slugify } from 'payload/shared'\n\nimport React, { createContext, useCallback } from 'react'\n\nimport type {\n RenderFieldServerFnArgs,\n RenderFieldServerFnReturnType,\n} from '../../forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.js'\nimport type { buildFormStateHandler } from '../../utilities/buildFormState.js'\nimport type { buildTableStateHandler } from '../../utilities/buildTableState.js'\nimport type { CopyDataFromLocaleArgs } from '../../utilities/copyDataFromLocale.js'\nimport type { getFolderResultsComponentAndDataHandler } from '../../utilities/getFolderResultsComponentAndData.js'\nimport type {\n schedulePublishHandler,\n SchedulePublishHandlerArgs,\n} from '../../utilities/schedulePublishHandler.js'\n\ntype GetFormStateClient = (\n args: {\n signal?: AbortSignal\n } & Omit<BuildFormStateArgs, 'clientConfig' | 'req'>,\n) => ReturnType<typeof buildFormStateHandler>\n\ntype SchedulePublishClient = (\n args: {\n signal?: AbortSignal\n } & Omit<SchedulePublishHandlerArgs, 'clientConfig' | 'req'>,\n) => ReturnType<typeof schedulePublishHandler>\n\ntype GetTableStateClient = (\n args: {\n signal?: AbortSignal\n } & Omit<BuildTableStateArgs, 'clientConfig' | 'req'>,\n) => ReturnType<typeof buildTableStateHandler>\n\ntype SlugifyClient = (\n args: {\n signal?: AbortSignal\n } & Omit<SlugifyServerFunctionArgs, 'clientConfig' | 'req'>,\n) => ReturnType<Slugify>\n\nexport type RenderDocumentResult = {\n data: any\n Document: React.ReactNode\n preferences: DocumentPreferences\n}\n\ntype RenderDocumentBaseArgs = {\n collectionSlug: string\n disableActions?: boolean\n docID: number | string\n drawerSlug?: string\n initialData?: Data\n initialState?: FormState\n overrideEntityVisibility?: boolean\n paramsOverride?: AdminViewServerPropsOnly['params']\n redirectAfterCreate?: boolean\n redirectAfterDelete: boolean\n redirectAfterDuplicate: boolean\n redirectAfterRestore?: boolean\n searchParams?: Params\n /**\n * Properties specific to the versions view\n */\n versions?: RenderDocumentVersionsProperties\n}\n\nexport type RenderDocumentServerFunction = ServerFunction<\n RenderDocumentBaseArgs,\n Promise<RenderDocumentResult>\n>\n\ntype RenderDocumentServerFunctionHookFn = (\n // No req or importMap - those are augmented by handleServerFunctions\n args: {\n signal?: AbortSignal\n } & RenderDocumentBaseArgs,\n) => Promise<RenderDocumentResult>\n\ntype CopyDataFromLocaleClient = (\n args: {\n signal?: AbortSignal\n } & Omit<CopyDataFromLocaleArgs, 'req'>,\n) => Promise<{ data: Data }>\n\ntype GetDocumentSlots = (args: {\n collectionSlug: string\n id?: number | string\n signal?: AbortSignal\n}) => Promise<DocumentSlots>\n\ntype GetFolderResultsComponentAndDataClient = (\n args: {\n signal?: AbortSignal\n } & Omit<GetFolderResultsComponentAndDataArgs, 'req'>,\n) => ReturnType<typeof getFolderResultsComponentAndDataHandler>\n\ntype RenderFieldClient = (args: RenderFieldServerFnArgs) => Promise<RenderFieldServerFnReturnType>\n\nexport type ServerFunctionsContextType = {\n _internal_renderField: RenderFieldClient\n copyDataFromLocale: CopyDataFromLocaleClient\n getDocumentSlots: GetDocumentSlots\n getFolderResultsComponentAndData: GetFolderResultsComponentAndDataClient\n getFormState: GetFormStateClient\n getTableState: GetTableStateClient\n renderDocument: RenderDocumentServerFunctionHookFn\n schedulePublish: SchedulePublishClient\n serverFunction: ServerFunctionClient\n slugify: SlugifyClient\n}\n\nexport const ServerFunctionsContext = createContext<ServerFunctionsContextType | undefined>(\n undefined,\n)\n\nexport const useServerFunctions = () => {\n const context = React.use(ServerFunctionsContext)\n if (context === undefined) {\n throw new Error('useServerFunctions must be used within a ServerFunctionsProvider')\n }\n return context\n}\n\nexport const ServerFunctionsProvider: React.FC<{\n children: React.ReactNode\n serverFunction: ServerFunctionClient\n}> = ({ children, serverFunction }) => {\n if (!serverFunction) {\n throw new Error('ServerFunctionsProvider requires a serverFunction prop')\n }\n\n const getDocumentSlots = useCallback<GetDocumentSlots>(\n async (args) =>\n await serverFunction({\n name: 'render-document-slots',\n args,\n }),\n [serverFunction],\n )\n\n const schedulePublish = useCallback<SchedulePublishClient>(\n async (args) => {\n const { signal: remoteSignal, ...rest } = args\n\n try {\n if (!remoteSignal?.aborted) {\n const result = await serverFunction({\n name: 'schedule-publish',\n args: { ...rest },\n })\n\n if (!remoteSignal?.aborted) {\n return result\n }\n }\n } catch (_err) {\n console.error(_err) // eslint-disable-line no-console\n }\n\n let error = `Error scheduling ${rest.type}`\n\n if (rest.doc) {\n error += ` for document with ID ${rest.doc.value} in collection ${rest.doc.relationTo}`\n }\n\n return { error }\n },\n [serverFunction],\n )\n\n const getFormState = useCallback<GetFormStateClient>(\n async (args) => {\n const { signal: remoteSignal, ...rest } = args || {}\n\n try {\n if (!remoteSignal?.aborted) {\n const result = (await serverFunction({\n name: 'form-state',\n args: { fallbackLocale: false, ...rest },\n })) as Awaited<ReturnType<typeof buildFormStateHandler>> // TODO: infer this type when `strictNullChecks` is enabled\n\n if (!remoteSignal?.aborted) {\n return result\n }\n }\n } catch (_err) {\n console.error(_err) // eslint-disable-line no-console\n }\n\n return { state: null }\n },\n [serverFunction],\n )\n\n const getTableState = useCallback<GetTableStateClient>(\n async (args) => {\n const { signal: remoteSignal, ...rest } = args || {}\n\n try {\n if (!remoteSignal?.aborted) {\n const result = (await serverFunction({\n name: 'table-state',\n args: { fallbackLocale: false, ...rest },\n })) as Awaited<ReturnType<typeof buildTableStateHandler>> // TODO: infer this type when `strictNullChecks` is enabled\n\n if (!remoteSignal?.aborted) {\n return result\n }\n }\n } catch (_err) {\n console.error(_err) // eslint-disable-line no-console\n }\n\n // return { state: args.formState }\n },\n [serverFunction],\n )\n\n const renderDocument = useCallback<RenderDocumentServerFunctionHookFn>(\n async (args) => {\n const { signal: remoteSignal, ...rest } = args || {}\n try {\n const result = (await serverFunction({\n name: 'render-document',\n args: {\n fallbackLocale: false,\n ...rest,\n } as Parameters<RenderDocumentServerFunctionHookFn>[0],\n })) as Awaited<ReturnType<RenderDocumentServerFunctionHookFn>> // TODO: infer this type when `strictNullChecks` is enabled\n\n return result\n } catch (_err) {\n console.error(_err) // eslint-disable-line no-console\n }\n },\n [serverFunction],\n )\n\n const copyDataFromLocale = useCallback<CopyDataFromLocaleClient>(\n async (args) => {\n const { signal: remoteSignal, ...rest } = args || {}\n\n try {\n const result = (await serverFunction({\n name: 'copy-data-from-locale',\n args: rest,\n })) as { data: Data }\n\n if (!remoteSignal?.aborted) {\n return result\n }\n } catch (_err) {\n console.error(_err) // eslint-disable-line no-console\n }\n },\n [serverFunction],\n )\n\n const getFolderResultsComponentAndData = useCallback<GetFolderResultsComponentAndDataClient>(\n async (args) => {\n const { signal: remoteSignal, ...rest } = args || {}\n\n try {\n const result = (await serverFunction({\n name: 'get-folder-results-component-and-data',\n args: rest,\n })) as Awaited<ReturnType<typeof getFolderResultsComponentAndDataHandler>>\n\n if (!remoteSignal?.aborted) {\n return result\n }\n } catch (_err) {\n console.error(_err) // eslint-disable-line no-console\n }\n },\n [serverFunction],\n )\n\n const _internal_renderField = useCallback<RenderFieldClient>(\n async (args) => {\n try {\n const result = (await serverFunction({\n name: 'render-field',\n args,\n })) as RenderFieldServerFnReturnType\n\n return result\n } catch (_err) {\n console.error(_err) // eslint-disable-line no-console\n }\n },\n [serverFunction],\n )\n\n const slugify = useCallback<SlugifyClient>(\n async (args) => {\n const { signal: remoteSignal, ...rest } = args || {}\n\n try {\n const result = (await serverFunction({\n name: 'slugify',\n args: { ...rest },\n })) as Awaited<ReturnType<Slugify>> // TODO: infer this type when `strictNullChecks` is enabled\n\n return result\n } catch (_err) {\n console.error(_err) // eslint-disable-line no-console\n }\n },\n [serverFunction],\n )\n\n return (\n <ServerFunctionsContext\n value={{\n _internal_renderField,\n copyDataFromLocale,\n getDocumentSlots,\n getFolderResultsComponentAndData,\n getFormState,\n getTableState,\n renderDocument,\n schedulePublish,\n serverFunction,\n slugify,\n }}\n >\n {children}\n </ServerFunctionsContext>\n )\n}\n"],"mappings":";AAiBA,OAAOA,KAAA,IAASC,aAAa,EAAEC,WAAW,QAAQ;AA8GlD,OAAO,MAAMC,sBAAA,gBAAyBF,aAAA,CACp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T,EAAE,OAAOC,IAAA,EAAM;MACbC,OAAA,CAAQC,KAAK,CAACF,IAAA,GAAM;IACtB;EACF,GACA,CAACV,cAAA,CAAe;EAGlB,MAAMyB,OAAA,GAAUlC,WAAA,CACd,MAAOW,IAAA;IACL,MAAM;MAAEG,MAAA,EAAQC,YAAY;MAAE,GAAGC;IAAA,CAAM,GAAGL,IAAA,IAAQ,CAAC;IAEnD,IAAI;MACF,MAAMO,MAAA,GAAU,MAAMT,cAAA,CAAe;QACnCG,IAAA,EAAM;QACND,IAAA,EAAM;UAAE,GAAGK;QAAK;MAClB;MAAoC;MAEpC,OAAOE,MAAA;IACT,EAAE,OAAOC,IAAA,EAAM;MACbC,OAAA,CAAQC,KAAK,CAACF,IAAA,GAAM;IACtB;EACF,GACA,CAACV,cAAA,CAAe;EAGlB,oBACE0B,IAAA,CAAClC,sBAAA;IACCuB,KAAA,EAAO;MACLS,qBAAA;MACAF,kBAAA;MACArB,gBAAA;MACAsB,gCAAA;MACAN,YAAA;MACAG,aAAA;MACAC,cAAA;MACAjB,eAAA;MACAJ,cAAA;MACAyB;IACF;cAEC1B;;AAGP","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APIError, canAccessAdmin, formatErrors
|
|
1
|
+
import { APIError, canAccessAdmin, formatErrors } from 'payload';
|
|
2
2
|
import { applyLocaleFiltering, isNumber } from 'payload/shared';
|
|
3
3
|
import { getClientConfig } from './getClientConfig.js';
|
|
4
4
|
import { getColumns } from './getColumns.js';
|
|
@@ -35,6 +35,7 @@ const buildTableState = async args => {
|
|
|
35
35
|
enableRowSelections,
|
|
36
36
|
orderableFieldName,
|
|
37
37
|
parent,
|
|
38
|
+
permissions,
|
|
38
39
|
query,
|
|
39
40
|
renderRowTypes,
|
|
40
41
|
req,
|
|
@@ -62,9 +63,6 @@ const buildTableState = async args => {
|
|
|
62
63
|
config,
|
|
63
64
|
req
|
|
64
65
|
});
|
|
65
|
-
const permissions = await getAccessResults({
|
|
66
|
-
req
|
|
67
|
-
});
|
|
68
66
|
let collectionConfig;
|
|
69
67
|
let clientCollectionConfig;
|
|
70
68
|
if (!Array.isArray(collectionSlug)) {
|
|
@@ -165,6 +163,7 @@ const buildTableState = async args => {
|
|
|
165
163
|
payload,
|
|
166
164
|
query,
|
|
167
165
|
renderRowTypes,
|
|
166
|
+
req,
|
|
168
167
|
tableAppearance,
|
|
169
168
|
useAsTitle: Array.isArray(collectionSlug) ? payload.collections[collectionSlug[0]]?.config?.admin?.useAsTitle : collectionConfig?.admin?.useAsTitle
|
|
170
169
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildTableState.js","names":["APIError","canAccessAdmin","formatErrors","getAccessResults","applyLocaleFiltering","isNumber","getClientConfig","getColumns","renderFilters","renderTable","upsertPreferences","buildTableStateHandler","args","req","res","buildTableState","err","payload","logger","error","msg","message","collectionSlug","columns","columnsFromArgs","data","dataFromArgs","enableRowSelections","orderableFieldName","parent","query","renderRowTypes","i18n","config","user","tableAppearance","clientConfig","importMap","permissions","collectionConfig","clientCollectionConfig","Array","isArray","collections","find","collection","slug","collectionPreferences","key","joinPath","value","limit","Number","undefined","sort","docs","select","currentSelectRef","segments","split","i","length","joinQuery","where","isNaN","page","parentDoc","findByID","id","depth","joins","overrideAccess","draft","locale","columnState","Table","fieldPermissions","fields","useAsTitle","admin","renderedFilters","preferences","state"],"sources":["../../src/utilities/buildTableState.ts"],"sourcesContent":["import type {\n BuildTableStateArgs,\n ClientCollectionConfig,\n ClientConfig,\n CollectionPreferences,\n Column,\n ErrorResult,\n PaginatedDocs,\n SanitizedCollectionConfig,\n ServerFunction,\n Where,\n} from 'payload'\n\nimport { APIError, canAccessAdmin, formatErrors, getAccessResults } from 'payload'\nimport { applyLocaleFiltering, isNumber } from 'payload/shared'\n\nimport { getClientConfig } from './getClientConfig.js'\nimport { getColumns } from './getColumns.js'\nimport { renderFilters, renderTable } from './renderTable.js'\nimport { upsertPreferences } from './upsertPreferences.js'\n\ntype BuildTableStateSuccessResult = {\n clientConfig?: ClientConfig\n data: PaginatedDocs\n errors?: never\n preferences: CollectionPreferences\n renderedFilters: Map<string, React.ReactNode>\n state: Column[]\n Table: React.ReactNode\n}\n\ntype BuildTableStateErrorResult = {\n data?: any\n renderedFilters?: never\n state?: never\n Table?: never\n} & (\n | {\n message: string\n }\n | ErrorResult\n)\n\nexport type BuildTableStateResult = BuildTableStateErrorResult | BuildTableStateSuccessResult\n\nexport const buildTableStateHandler: ServerFunction<\n BuildTableStateArgs,\n Promise<BuildTableStateResult>\n> = async (args) => {\n const { req } = args\n\n try {\n const res = await buildTableState(args)\n return res\n } catch (err) {\n req.payload.logger.error({ err, msg: `There was an error building form state` })\n\n if (err.message === 'Could not find field schema for given path') {\n return {\n message: err.message,\n }\n }\n\n if (err.message === 'Unauthorized') {\n return null\n }\n\n return formatErrors(err)\n }\n}\n\nconst buildTableState = async (\n args: BuildTableStateArgs,\n): Promise<BuildTableStateSuccessResult> => {\n const {\n collectionSlug,\n columns: columnsFromArgs,\n data: dataFromArgs,\n enableRowSelections,\n orderableFieldName,\n parent,\n query,\n renderRowTypes,\n req,\n req: {\n i18n,\n payload,\n payload: { config },\n user,\n },\n tableAppearance,\n } = args\n\n await canAccessAdmin({ req })\n\n const clientConfig = getClientConfig({\n config,\n i18n,\n importMap: payload.importMap,\n user,\n })\n\n await applyLocaleFiltering({ clientConfig, config, req })\n\n const permissions = await getAccessResults({ req })\n\n let collectionConfig: SanitizedCollectionConfig\n let clientCollectionConfig: ClientCollectionConfig\n\n if (!Array.isArray(collectionSlug)) {\n if (req.payload.collections[collectionSlug]) {\n collectionConfig = req.payload.collections[collectionSlug].config\n clientCollectionConfig = clientConfig.collections.find(\n (collection) => collection.slug === collectionSlug,\n )\n }\n }\n\n const collectionPreferences = await upsertPreferences<CollectionPreferences>({\n key: Array.isArray(collectionSlug)\n ? `${parent.collectionSlug}-${parent.joinPath}`\n : `collection-${collectionSlug}`,\n req,\n value: {\n columns: columnsFromArgs,\n limit: isNumber(query?.limit) ? Number(query.limit) : undefined,\n sort: query?.sort as string,\n },\n })\n\n let data: PaginatedDocs = dataFromArgs\n\n // lookup docs, if desired, i.e. within `join` field which initialize with `depth: 0`\n\n if (!data?.docs || query) {\n if (Array.isArray(collectionSlug)) {\n if (!parent) {\n throw new APIError('Unexpected array of collectionSlug, parent must be provided')\n }\n\n const select = {}\n let currentSelectRef = select\n\n const segments = parent.joinPath.split('.')\n\n for (let i = 0; i < segments.length; i++) {\n currentSelectRef[segments[i]] = i === segments.length - 1 ? true : {}\n currentSelectRef = currentSelectRef[segments[i]]\n }\n\n const joinQuery: { limit?: number; page?: number; sort?: string; where?: Where } = {\n sort: query?.sort as string,\n where: query?.where,\n }\n\n if (query) {\n if (!Number.isNaN(Number(query.limit))) {\n joinQuery.limit = Number(query.limit)\n }\n\n if (!Number.isNaN(Number(query.page))) {\n joinQuery.limit = Number(query.limit)\n }\n }\n\n let parentDoc = await payload.findByID({\n id: parent.id,\n collection: parent.collectionSlug,\n depth: 1,\n joins: {\n [parent.joinPath]: joinQuery,\n },\n overrideAccess: false,\n select,\n user: req.user,\n })\n\n for (let i = 0; i < segments.length; i++) {\n if (i === segments.length - 1) {\n data = parentDoc[segments[i]]\n } else {\n parentDoc = parentDoc[segments[i]]\n }\n }\n } else {\n data = await payload.find({\n collection: collectionSlug,\n depth: 0,\n draft: true,\n limit: query?.limit,\n locale: req.locale,\n overrideAccess: false,\n page: query?.page,\n sort: query?.sort,\n user: req.user,\n where: query?.where,\n })\n }\n }\n\n const { columnState, Table } = renderTable({\n clientCollectionConfig,\n clientConfig,\n collectionConfig,\n collections: Array.isArray(collectionSlug) ? collectionSlug : undefined,\n columns: getColumns({\n clientConfig,\n collectionConfig: clientCollectionConfig,\n collectionSlug,\n columns: columnsFromArgs,\n i18n: req.i18n,\n permissions,\n }),\n data,\n enableRowSelections,\n fieldPermissions: Array.isArray(collectionSlug)\n ? true\n : permissions.collections[collectionSlug].fields,\n i18n: req.i18n,\n orderableFieldName,\n payload,\n query,\n renderRowTypes,\n tableAppearance,\n useAsTitle: Array.isArray(collectionSlug)\n ? payload.collections[collectionSlug[0]]?.config?.admin?.useAsTitle\n : collectionConfig?.admin?.useAsTitle,\n })\n\n let renderedFilters\n\n if (collectionConfig) {\n renderedFilters = renderFilters(collectionConfig.fields, req.payload.importMap)\n }\n\n return {\n data,\n preferences: collectionPreferences,\n renderedFilters,\n state: columnState,\n Table,\n }\n}\n"],"mappings":"AAaA,SAASA,QAAQ,EAAEC,cAAc,EAAEC,YAAY,EAAEC,gBAAgB,QAAQ;AACzE,SAASC,oBAAoB,EAAEC,QAAQ,QAAQ;AAE/C,SAASC,eAAe,QAAQ;AAChC,SAASC,UAAU,QAAQ;AAC3B,SAASC,aAAa,EAAEC,WAAW,QAAQ;AAC3C,SAASC,iBAAiB,QAAQ;AA0BlC,OAAO,MAAMC,sBAAA,GAGT,MAAOC,IAAA;EACT,MAAM;IAAEC;EAAG,CAAE,GAAGD,IAAA;EAEhB,IAAI;IACF,MAAME,GAAA,GAAM,MAAMC,eAAA,CAAgBH,IAAA;IAClC,OAAOE,GAAA;EACT,EAAE,OAAOE,GAAA,EAAK;IACZH,GAAA,CAAII,OAAO,CAACC,MAAM,CAACC,KAAK,CAAC;MAAEH,GAAA;MAAKI,GAAA,EAAK;IAAyC;IAE9E,IAAIJ,GAAA,CAAIK,OAAO,KAAK,8CAA8C;MAChE,OAAO;QACLA,OAAA,EAASL,GAAA,CAAIK;MACf;IACF;IAEA,IAAIL,GAAA,CAAIK,OAAO,KAAK,gBAAgB;MAClC,OAAO;IACT;IAEA,OAAOnB,YAAA,CAAac,GAAA;EACtB;AACF;AAEA,MAAMD,eAAA,GAAkB,MACtBH,IAAA;EAEA,MAAM;IACJU,cAAc;IACdC,OAAA,EAASC,eAAe;IACxBC,IAAA,EAAMC,YAAY;IAClBC,mBAAmB;IACnBC,kBAAkB;IAClBC,MAAM;IACNC,KAAK;IACLC,cAAc;IACdlB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I;MACdM;IACF;IACAb,IAAA;IACAE,mBAAA;IACAiD,gBAAA,EAAkBnC,KAAA,CAAMC,OAAO,CAACpB,cAAA,IAC5B,OACAgB,WAAA,CAAYK,WAAW,CAACrB,cAAA,CAAe,CAACuD,MAAM;IAClD7C,IAAA,EAAMnB,GAAA,CAAImB,IAAI;IACdJ,kBAAA;IACAX,OAAA;IACAa,KAAA;IACAC,cAAA;IACAI,eAAA;IACA2C,UAAA,EAAYrC,KAAA,CAAMC,OAAO,CAACpB,cAAA,IACtBL,OAAA,CAAQ0B,WAAW,CAACrB,cAAc,CAAC,EAAE,CAAC,EAAEW,MAAA,EAAQ8C,KAAA,EAAOD,UAAA,GACvDvC,gBAAA,EAAkBwC,KAAA,EAAOD;EAC/B;EAEA,IAAIE,eAAA;EAEJ,IAAIzC,gBAAA,EAAkB;IACpByC,eAAA,GAAkBxE,aAAA,CAAc+B,gBAAA,CAAiBsC,MAAM,EAAEhE,GAAA,CAAII,OAAO,CAACoB,SAAS;EAChF;EAEA,OAAO;IACLZ,IAAA;IACAwD,WAAA,EAAalC,qBAAA;IACbiC,eAAA;IACAE,KAAA,EAAOR,WAAA;IACPC;EACF;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"buildTableState.js","names":["APIError","canAccessAdmin","formatErrors","applyLocaleFiltering","isNumber","getClientConfig","getColumns","renderFilters","renderTable","upsertPreferences","buildTableStateHandler","args","req","res","buildTableState","err","payload","logger","error","msg","message","collectionSlug","columns","columnsFromArgs","data","dataFromArgs","enableRowSelections","orderableFieldName","parent","permissions","query","renderRowTypes","i18n","config","user","tableAppearance","clientConfig","importMap","collectionConfig","clientCollectionConfig","Array","isArray","collections","find","collection","slug","collectionPreferences","key","joinPath","value","limit","Number","undefined","sort","docs","select","currentSelectRef","segments","split","i","length","joinQuery","where","isNaN","page","parentDoc","findByID","id","depth","joins","overrideAccess","draft","locale","columnState","Table","fieldPermissions","fields","useAsTitle","admin","renderedFilters","preferences","state"],"sources":["../../src/utilities/buildTableState.ts"],"sourcesContent":["import type {\n BuildTableStateArgs,\n ClientCollectionConfig,\n ClientConfig,\n CollectionPreferences,\n Column,\n ErrorResult,\n PaginatedDocs,\n SanitizedCollectionConfig,\n ServerFunction,\n Where,\n} from 'payload'\n\nimport { APIError, canAccessAdmin, formatErrors } from 'payload'\nimport { applyLocaleFiltering, isNumber } from 'payload/shared'\n\nimport { getClientConfig } from './getClientConfig.js'\nimport { getColumns } from './getColumns.js'\nimport { renderFilters, renderTable } from './renderTable.js'\nimport { upsertPreferences } from './upsertPreferences.js'\n\ntype BuildTableStateSuccessResult = {\n clientConfig?: ClientConfig\n data: PaginatedDocs\n errors?: never\n preferences: CollectionPreferences\n renderedFilters: Map<string, React.ReactNode>\n state: Column[]\n Table: React.ReactNode\n}\n\ntype BuildTableStateErrorResult = {\n data?: any\n renderedFilters?: never\n state?: never\n Table?: never\n} & (\n | {\n message: string\n }\n | ErrorResult\n)\n\nexport type BuildTableStateResult = BuildTableStateErrorResult | BuildTableStateSuccessResult\n\nexport const buildTableStateHandler: ServerFunction<\n BuildTableStateArgs,\n Promise<BuildTableStateResult>\n> = async (args) => {\n const { req } = args\n\n try {\n const res = await buildTableState(args)\n return res\n } catch (err) {\n req.payload.logger.error({ err, msg: `There was an error building form state` })\n\n if (err.message === 'Could not find field schema for given path') {\n return {\n message: err.message,\n }\n }\n\n if (err.message === 'Unauthorized') {\n return null\n }\n\n return formatErrors(err)\n }\n}\n\nconst buildTableState: ServerFunction<\n BuildTableStateArgs,\n Promise<BuildTableStateSuccessResult>\n> = async (args) => {\n const {\n collectionSlug,\n columns: columnsFromArgs,\n data: dataFromArgs,\n enableRowSelections,\n orderableFieldName,\n parent,\n permissions,\n query,\n renderRowTypes,\n req,\n req: {\n i18n,\n payload,\n payload: { config },\n user,\n },\n tableAppearance,\n } = args\n\n await canAccessAdmin({ req })\n\n const clientConfig = getClientConfig({\n config,\n i18n,\n importMap: payload.importMap,\n user,\n })\n\n await applyLocaleFiltering({ clientConfig, config, req })\n\n let collectionConfig: SanitizedCollectionConfig\n let clientCollectionConfig: ClientCollectionConfig\n\n if (!Array.isArray(collectionSlug)) {\n if (req.payload.collections[collectionSlug]) {\n collectionConfig = req.payload.collections[collectionSlug].config\n clientCollectionConfig = clientConfig.collections.find(\n (collection) => collection.slug === collectionSlug,\n )\n }\n }\n\n const collectionPreferences = await upsertPreferences<CollectionPreferences>({\n key: Array.isArray(collectionSlug)\n ? `${parent.collectionSlug}-${parent.joinPath}`\n : `collection-${collectionSlug}`,\n req,\n value: {\n columns: columnsFromArgs,\n limit: isNumber(query?.limit) ? Number(query.limit) : undefined,\n sort: query?.sort as string,\n },\n })\n\n let data: PaginatedDocs = dataFromArgs\n\n // lookup docs, if desired, i.e. within `join` field which initialize with `depth: 0`\n\n if (!data?.docs || query) {\n if (Array.isArray(collectionSlug)) {\n if (!parent) {\n throw new APIError('Unexpected array of collectionSlug, parent must be provided')\n }\n\n const select = {}\n let currentSelectRef = select\n\n const segments = parent.joinPath.split('.')\n\n for (let i = 0; i < segments.length; i++) {\n currentSelectRef[segments[i]] = i === segments.length - 1 ? true : {}\n currentSelectRef = currentSelectRef[segments[i]]\n }\n\n const joinQuery: { limit?: number; page?: number; sort?: string; where?: Where } = {\n sort: query?.sort as string,\n where: query?.where,\n }\n\n if (query) {\n if (!Number.isNaN(Number(query.limit))) {\n joinQuery.limit = Number(query.limit)\n }\n\n if (!Number.isNaN(Number(query.page))) {\n joinQuery.limit = Number(query.limit)\n }\n }\n\n let parentDoc = await payload.findByID({\n id: parent.id,\n collection: parent.collectionSlug,\n depth: 1,\n joins: {\n [parent.joinPath]: joinQuery,\n },\n overrideAccess: false,\n select,\n user: req.user,\n })\n\n for (let i = 0; i < segments.length; i++) {\n if (i === segments.length - 1) {\n data = parentDoc[segments[i]]\n } else {\n parentDoc = parentDoc[segments[i]]\n }\n }\n } else {\n data = await payload.find({\n collection: collectionSlug,\n depth: 0,\n draft: true,\n limit: query?.limit,\n locale: req.locale,\n overrideAccess: false,\n page: query?.page,\n sort: query?.sort,\n user: req.user,\n where: query?.where,\n })\n }\n }\n\n const { columnState, Table } = renderTable({\n clientCollectionConfig,\n clientConfig,\n collectionConfig,\n collections: Array.isArray(collectionSlug) ? collectionSlug : undefined,\n columns: getColumns({\n clientConfig,\n collectionConfig: clientCollectionConfig,\n collectionSlug,\n columns: columnsFromArgs,\n i18n: req.i18n,\n permissions,\n }),\n data,\n enableRowSelections,\n fieldPermissions: Array.isArray(collectionSlug)\n ? true\n : permissions.collections[collectionSlug].fields,\n i18n: req.i18n,\n orderableFieldName,\n payload,\n query,\n renderRowTypes,\n req,\n tableAppearance,\n useAsTitle: Array.isArray(collectionSlug)\n ? payload.collections[collectionSlug[0]]?.config?.admin?.useAsTitle\n : collectionConfig?.admin?.useAsTitle,\n })\n\n let renderedFilters\n\n if (collectionConfig) {\n renderedFilters = renderFilters(collectionConfig.fields, req.payload.importMap)\n }\n\n return {\n data,\n preferences: collectionPreferences,\n renderedFilters,\n state: columnState,\n Table,\n }\n}\n"],"mappings":"AAaA,SAASA,QAAQ,EAAEC,cAAc,EAAEC,YAAY,QAAQ;AACvD,SAASC,oBAAoB,EAAEC,QAAQ,QAAQ;AAE/C,SAASC,eAAe,QAAQ;AAChC,SAASC,UAAU,QAAQ;AAC3B,SAASC,aAAa,EAAEC,WAAW,QAAQ;AAC3C,SAASC,iBAAiB,QAAQ;AA0BlC,OAAO,MAAMC,sBAAA,GAGT,MAAOC,IAAA;EACT,MAAM;IAAEC;EAAG,CAAE,GAAGD,IAAA;EAEhB,IAAI;IACF,MAAME,GAAA,GAAM,MAAMC,eAAA,CAAgBH,IAAA;IAClC,OAAOE,GAAA;EACT,EAAE,OAAOE,GAAA,EAAK;IACZH,GAAA,CAAII,OAAO,CAACC,MAAM,CAACC,KAAK,CAAC;MAAEH,GAAA;MAAKI,GAAA,EAAK;IAAyC;IAE9E,IAAIJ,GAAA,CAAIK,OAAO,KAAK,8CAA8C;MAChE,OAAO;QACLA,O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zC+B,sBAAA;IACAH,YAAA;IACAE,gBAAA;IACAI,WAAA,EAAaF,KAAA,CAAMC,OAAO,CAACpB,cAAA,IAAkBA,cAAA,GAAiB+B,SAAA;IAC9D9B,OAAA,EAAShB,UAAA,CAAW;MAClB8B,YAAA;MACAE,gBAAA,EAAkBC,sBAAA;MAClBlB,cAAA;MACAC,OAAA,EAASC,eAAA;MACTS,IAAA,EAAMpB,GAAA,CAAIoB,IAAI;MACdH;IACF;IACAL,IAAA;IACAE,mBAAA;IACAiD,gBAAA,EAAkBnC,KAAA,CAAMC,OAAO,CAACpB,cAAA,IAC5B,OACAQ,WAAA,CAAYa,WAAW,CAACrB,cAAA,CAAe,CAACuD,MAAM;IAClD5C,IAAA,EAAMpB,GAAA,CAAIoB,IAAI;IACdL,kBAAA;IACAX,OAAA;IACAc,KAAA;IACAC,cAAA;IACAnB,GAAA;IACAuB,eAAA;IACA0C,UAAA,EAAYrC,KAAA,CAAMC,OAAO,CAACpB,cAAA,IACtBL,OAAA,CAAQ0B,WAAW,CAACrB,cAAc,CAAC,EAAE,CAAC,EAAEY,MAAA,EAAQ6C,KAAA,EAAOD,UAAA,GACvDvC,gBAAA,EAAkBwC,KAAA,EAAOD;EAC/B;EAEA,IAAIE,eAAA;EAEJ,IAAIzC,gBAAA,EAAkB;IACpByC,eAAA,GAAkBxE,aAAA,CAAc+B,gBAAA,CAAiBsC,MAAM,EAAEhE,GAAA,CAAII,OAAO,CAACqB,SAAS;EAChF;EAEA,OAAO;IACLb,IAAA;IACAwD,WAAA,EAAalC,qBAAA;IACbiC,eAAA;IACAE,KAAA,EAAOR,WAAA;IACPC;EACF;AACF","ignoreList":[]}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type SchedulePublishTaskInput, type ServerFunction } from 'payload';
|
|
2
2
|
export type SchedulePublishHandlerArgs = {
|
|
3
3
|
date?: Date;
|
|
4
4
|
/**
|
|
5
5
|
* The job id to delete to remove a scheduled publish event
|
|
6
6
|
*/
|
|
7
7
|
deleteID?: number | string;
|
|
8
|
-
|
|
8
|
+
localeToPublish?: string;
|
|
9
9
|
timezone?: string;
|
|
10
|
-
} & SchedulePublishTaskInput
|
|
11
|
-
export declare const schedulePublishHandler:
|
|
12
|
-
error: any;
|
|
13
|
-
message?: undefined;
|
|
14
|
-
} | {
|
|
15
|
-
message: string;
|
|
16
|
-
error?: undefined;
|
|
17
|
-
}>;
|
|
10
|
+
} & Pick<SchedulePublishTaskInput, 'doc' | 'global' | 'type'>;
|
|
11
|
+
export declare const schedulePublishHandler: ServerFunction<SchedulePublishHandlerArgs>;
|
|
18
12
|
//# sourceMappingURL=schedulePublishHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedulePublishHandler.d.ts","sourceRoot":"","sources":["../../src/utilities/schedulePublishHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,
|
|
1
|
+
{"version":3,"file":"schedulePublishHandler.d.ts","sourceRoot":"","sources":["../../src/utilities/schedulePublishHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,wBAAwB,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAA;AAE5F,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,CAAC,EAAE,IAAI,CAAA;IACX;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,IAAI,CAAC,wBAAwB,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC,CAAA;AAE7D,eAAO,MAAM,sBAAsB,EAAE,cAAc,CAAC,0BAA0B,CAuD7E,CAAA"}
|
|
@@ -5,7 +5,7 @@ export const schedulePublishHandler = async ({
|
|
|
5
5
|
deleteID,
|
|
6
6
|
doc,
|
|
7
7
|
global,
|
|
8
|
-
|
|
8
|
+
localeToPublish,
|
|
9
9
|
req,
|
|
10
10
|
timezone
|
|
11
11
|
}) => {
|
|
@@ -34,7 +34,7 @@ export const schedulePublishHandler = async ({
|
|
|
34
34
|
type,
|
|
35
35
|
doc,
|
|
36
36
|
global,
|
|
37
|
-
locale,
|
|
37
|
+
locale: localeToPublish,
|
|
38
38
|
timezone,
|
|
39
39
|
user: user.id
|
|
40
40
|
},
|
|
@@ -51,8 +51,9 @@ export const schedulePublishHandler = async ({
|
|
|
51
51
|
error += `document with ID ${doc.value} in collection ${doc.relationTo}`;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
payload.logger.error(
|
|
55
|
-
|
|
54
|
+
payload.logger.error({
|
|
55
|
+
err
|
|
56
|
+
}, error);
|
|
56
57
|
return {
|
|
57
58
|
error
|
|
58
59
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedulePublishHandler.js","names":["canAccessAdmin","schedulePublishHandler","type","date","deleteID","doc","global","
|
|
1
|
+
{"version":3,"file":"schedulePublishHandler.js","names":["canAccessAdmin","schedulePublishHandler","type","date","deleteID","doc","global","localeToPublish","req","timezone","i18n","payload","user","delete","collection","where","id","equals","jobs","queue","input","locale","task","waitUntil","err","error","value","relationTo","logger","message","t"],"sources":["../../src/utilities/schedulePublishHandler.ts"],"sourcesContent":["import { canAccessAdmin, type SchedulePublishTaskInput, type ServerFunction } from 'payload'\n\nexport type SchedulePublishHandlerArgs = {\n date?: Date\n /**\n * The job id to delete to remove a scheduled publish event\n */\n deleteID?: number | string\n localeToPublish?: string\n timezone?: string\n} & Pick<SchedulePublishTaskInput, 'doc' | 'global' | 'type'>\n\nexport const schedulePublishHandler: ServerFunction<SchedulePublishHandlerArgs> = async ({\n type,\n date,\n deleteID,\n doc,\n global,\n localeToPublish,\n req,\n timezone,\n}) => {\n const { i18n, payload, user } = req\n\n await canAccessAdmin({ req })\n\n try {\n if (deleteID) {\n await payload.delete({\n collection: 'payload-jobs',\n req,\n where: { id: { equals: deleteID } },\n })\n }\n\n await payload.jobs.queue({\n input: {\n type,\n doc,\n global,\n locale: localeToPublish,\n timezone,\n user: user.id,\n },\n task: 'schedulePublish',\n waitUntil: date,\n })\n } catch (err) {\n let error\n\n if (deleteID) {\n error = `Error deleting scheduled publish event with ID ${deleteID}`\n } else {\n error = `Error scheduling ${type} for `\n if (doc) {\n error += `document with ID ${doc.value} in collection ${doc.relationTo}`\n }\n }\n\n payload.logger.error({ err }, error)\n\n return {\n error,\n }\n }\n\n return { message: i18n.t('general:success') }\n}\n"],"mappings":"AAAA,SAASA,cAAc,QAA4D;AAYnF,OAAO,MAAMC,sBAAA,GAAqE,MAAAA,CAAO;EACvFC,IAAI;EACJC,IAAI;EACJC,QAAQ;EACRC,GAAG;EACHC,MAAM;EACNC,eAAe;EACfC,GAAG;EACHC;AAAQ,CACT;EACC,MAAM;IAAEC,IAAI;IAAEC,OAAO;IAAEC;EAAI,CAAE,GAAGJ,GAAA;EAEhC,MAAMR,cAAA,CAAe;IAAEQ;EAAI;EAE3B,IAAI;IACF,IAAIJ,QAAA,EAAU;MACZ,MAAMO,OAAA,CAAQE,MAAM,CAAC;QACnBC,UAAA,EAAY;QACZN,GAAA;QACAO,KAAA,EAAO;UAAEC,EAAA,EAAI;YAAEC,MAAA,EAAQb;UAAS;QAAE;MACpC;IACF;IAEA,MAAMO,OAAA,CAAQO,IAAI,CAACC,KAAK,CAAC;MACvBC,KAAA,EAAO;QACLlB,IAAA;QACAG,GAAA;QACAC,MAAA;QACAe,MAAA,EAAQd,eAAA;QACRE,QAAA;QACAG,IAAA,EAAMA,IAAA,CAAKI;MACb;MACAM,IAAA,EAAM;MACNC,SAAA,EAAWpB;IACb;EACF,EAAE,OAAOqB,GAAA,EAAK;IACZ,IAAIC,KAAA;IAEJ,IAAIrB,QAAA,EAAU;MACZqB,KAAA,GAAQ,kDAAkDrB,QAAA,EAAU;IACtE,OAAO;MACLqB,KAAA,GAAQ,oBAAoBvB,IAAA,OAAW;MACvC,IAAIG,GAAA,EAAK;QACPoB,KAAA,IAAS,oBAAoBpB,GAAA,CAAIqB,KAAK,kBAAkBrB,GAAA,CAAIsB,UAAU,EAAE;MAC1E;IACF;IAEAhB,OAAA,CAAQiB,MAAM,CAACH,KAAK,CAAC;MAAED;IAAI,GAAGC,KAAA;IAE9B,OAAO;MACLA;IACF;EACF;EAEA,OAAO;IAAEI,OAAA,EAASnB,IAAA,CAAKoB,CAAC,CAAC;EAAmB;AAC9C","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/ui",
|
|
3
|
-
"version": "3.74.0-internal.
|
|
3
|
+
"version": "3.74.0-internal.b78b222",
|
|
4
4
|
"homepage": "https://payloadcms.com",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"ts-essentials": "10.0.3",
|
|
137
137
|
"use-context-selector": "2.0.0",
|
|
138
138
|
"uuid": "10.0.0",
|
|
139
|
-
"@payloadcms/translations": "3.74.0-internal.
|
|
139
|
+
"@payloadcms/translations": "3.74.0-internal.b78b222"
|
|
140
140
|
},
|
|
141
141
|
"devDependencies": {
|
|
142
142
|
"@babel/cli": "7.27.2",
|
|
@@ -152,13 +152,13 @@
|
|
|
152
152
|
"esbuild": "0.27.1",
|
|
153
153
|
"esbuild-sass-plugin": "3.3.1",
|
|
154
154
|
"@payloadcms/eslint-config": "3.28.0",
|
|
155
|
-
"payload": "3.74.0-internal.
|
|
155
|
+
"payload": "3.74.0-internal.b78b222"
|
|
156
156
|
},
|
|
157
157
|
"peerDependencies": {
|
|
158
158
|
"next": "^15.2.8 || ^15.3.8 || ^15.4.10 || ^15.5.9 || >=16.1.1-canary.35 <16.2.0 || ^16.2.0",
|
|
159
159
|
"react": "^19.0.1 || ^19.1.2 || ^19.2.1",
|
|
160
160
|
"react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1",
|
|
161
|
-
"payload": "3.74.0-internal.
|
|
161
|
+
"payload": "3.74.0-internal.b78b222"
|
|
162
162
|
},
|
|
163
163
|
"engines": {
|
|
164
164
|
"node": "^18.20.2 || >=20.9.0"
|