@delmaredigital/payload-experiments 0.4.0-rc.1 → 0.4.0-rc.10
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/README.md +284 -772
- package/dist/admin/LayerUsage.js +1 -1
- package/dist/admin/MetricSourceSelect.js +2 -2
- package/dist/admin/PlacementStatus.js +1 -1
- package/dist/admin/TestsDashboardCards.d.ts +1 -0
- package/dist/admin/TestsDashboardCards.js +5 -9
- package/dist/admin/TestsNavLink.d.ts +1 -0
- package/dist/admin/TestsNavLink.js +5 -11
- package/dist/admin/blocks/BlockPanel.d.ts +1 -0
- package/dist/admin/blocks/BlockPanel.js +129 -37
- package/dist/admin/blocks/TestBlockField.js +3 -3
- package/dist/admin/blocks/formApi.d.ts +3 -0
- package/dist/admin/blocks/formApi.js +10 -4
- package/dist/admin/blocks/inject.js +1 -0
- package/dist/admin/blocks/model.d.ts +3 -2
- package/dist/admin/blocks/model.js +10 -6
- package/dist/admin/blocks/statusCache.d.ts +2 -0
- package/dist/admin/blocks/statusCache.js +12 -3
- package/dist/admin/components/RootViewMessage.js +1 -1
- package/dist/admin/copy/blocks.d.ts +21 -1
- package/dist/admin/copy/blocks.js +40 -6
- package/dist/admin/copy/goals.d.ts +6 -1
- package/dist/admin/copy/goals.js +10 -3
- package/dist/admin/copy/newTest.d.ts +6 -7
- package/dist/admin/copy/newTest.js +9 -7
- package/dist/admin/goals/XpGoalField.d.ts +2 -0
- package/dist/admin/goals/XpGoalField.js +156 -114
- package/dist/admin/goals/xpGoalField.css +47 -0
- package/dist/admin/pageCollections.d.ts +1 -0
- package/dist/admin/pageCollections.js +3 -0
- package/dist/admin/paths.d.ts +3 -0
- package/dist/admin/paths.js +3 -0
- package/dist/admin/placementStatus.model.js +1 -1
- package/dist/admin/status.model.js +1 -1
- package/dist/admin/surface/ResultsRoute.d.ts +2 -1
- package/dist/admin/surface/ResultsRoute.js +20 -24
- package/dist/admin/surface/SurfaceShell.js +5 -2
- package/dist/admin/surface/TestRowMenu.d.ts +6 -0
- package/dist/admin/surface/TestRowMenu.js +156 -0
- package/dist/admin/surface/TestsHome.d.ts +5 -3
- package/dist/admin/surface/TestsHome.js +266 -58
- package/dist/admin/surface/TestsSurface.js +8 -7
- package/dist/admin/surface/goals/GoalForm.d.ts +1 -1
- package/dist/admin/surface/goals/GoalForm.js +95 -54
- package/dist/admin/surface/goals/GoalsList.d.ts +1 -1
- package/dist/admin/surface/goals/GoalsList.js +5 -4
- package/dist/admin/surface/goals/data.js +2 -2
- package/dist/admin/surface/goals/goals.css +7 -0
- package/dist/admin/surface/goals/goals.model.d.ts +11 -1
- package/dist/admin/surface/goals/goals.model.js +43 -0
- package/dist/admin/surface/home.model.d.ts +9 -8
- package/dist/admin/surface/home.model.js +22 -21
- package/dist/admin/surface/newTest/NewTest.d.ts +4 -4
- package/dist/admin/surface/newTest/NewTest.js +98 -94
- package/dist/admin/surface/newTest/PageWizard.d.ts +2 -1
- package/dist/admin/surface/newTest/PageWizard.js +111 -76
- package/dist/admin/surface/newTest/newTest.css +28 -9
- package/dist/admin/surface/results/ResultsHeader.d.ts +2 -2
- package/dist/admin/surface/results/ResultsHeader.js +58 -54
- package/dist/admin/surface/surface.css +10 -0
- package/dist/admin/surface/test/TestPage.d.ts +1 -2
- package/dist/admin/surface/test/TestPage.js +42 -162
- package/dist/admin/theme.css +2 -0
- package/dist/admin/views/CollectionListRedirect.d.ts +1 -0
- package/dist/admin/views/CollectionListRedirect.js +1 -1
- package/dist/admin/views/ExperimentsRootView.js +18 -165
- package/dist/admin/views/GoalEditRedirect.d.ts +4 -0
- package/dist/admin/views/GoalEditRedirect.js +14 -0
- package/dist/admin/views/GoalsCollectionListView.d.ts +2 -0
- package/dist/admin/views/GoalsCollectionListView.js +4 -0
- package/dist/admin/views/TestsCollectionListView.d.ts +2 -0
- package/dist/admin/views/TestsCollectionListView.js +4 -0
- package/dist/admin/views/TestsNavLinkServer.d.ts +1 -0
- package/dist/admin/views/TestsNavLinkServer.js +2 -2
- package/dist/admin/views/TestsSurfaceClient.d.ts +3 -0
- package/dist/admin/views/TestsSurfaceClient.js +11 -0
- package/dist/admin/views/buildSurfaceProps.d.ts +8 -0
- package/dist/admin/views/buildSurfaceProps.js +102 -0
- package/dist/admin/views/renderCollectionList.d.ts +2 -0
- package/dist/admin/views/renderCollectionList.js +34 -0
- package/dist/admin/views/renderTestsSurface.d.ts +3 -0
- package/dist/admin/views/renderTestsSurface.js +34 -0
- package/dist/blocks/bindings.js +8 -14
- package/dist/blocks/formState.js +1 -1
- package/dist/blocks/placementLanguages.d.ts +7 -0
- package/dist/blocks/placementLanguages.js +27 -0
- package/dist/blocks/placementLocale.d.ts +37 -0
- package/dist/blocks/placementLocale.js +270 -0
- package/dist/collections/experiments/config.js +17 -8
- package/dist/collections/experiments/deleteGuard.js +2 -2
- package/dist/collections/experiments/lockHook.js +21 -2
- package/dist/collections/experiments/pickSlug.js +2 -0
- package/dist/collections/metrics.js +16 -4
- package/dist/collections/metricsGuards.js +2 -0
- package/dist/collections/serialize.js +5 -4
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/db/adapter.d.ts +9 -1
- package/dist/db/adapter.js +77 -1
- package/dist/db/appends.d.ts +13 -0
- package/dist/db/appends.js +49 -0
- package/dist/db/bulkPlacementRemoval.d.ts +30 -0
- package/dist/db/bulkPlacementRemoval.js +111 -0
- package/dist/db/delete.d.ts +1 -1
- package/dist/db/delete.js +2 -4
- package/dist/db/events.d.ts +9 -0
- package/dist/db/events.js +42 -8
- package/dist/db/executor.d.ts +7 -1
- package/dist/db/executor.js +7 -3
- package/dist/db/pageCopies.d.ts +5 -0
- package/dist/db/pageCopies.js +31 -0
- package/dist/db/placements.d.ts +2 -0
- package/dist/db/placements.js +8 -0
- package/dist/db/results.d.ts +5 -1
- package/dist/db/results.js +21 -5
- package/dist/db/snapshots.d.ts +1 -0
- package/dist/endpoints/contentLocale.d.ts +6 -0
- package/dist/endpoints/contentLocale.js +15 -0
- package/dist/endpoints/deleteImpact.d.ts +6 -0
- package/dist/endpoints/deleteImpact.js +207 -0
- package/dist/endpoints/duplicateOriginal.d.ts +38 -0
- package/dist/endpoints/duplicateOriginal.js +407 -0
- package/dist/endpoints/editorSurface.d.ts +3 -0
- package/dist/endpoints/editorSurface.js +31 -0
- package/dist/endpoints/events.js +103 -39
- package/dist/endpoints/index.js +57 -9
- package/dist/endpoints/pages.js +247 -64
- package/dist/endpoints/placementStatus.js +13 -5
- package/dist/endpoints/preflight.d.ts +1 -1
- package/dist/endpoints/preflight.js +17 -2
- package/dist/endpoints/results.d.ts +1 -1
- package/dist/endpoints/results.js +6 -2
- package/dist/endpoints/routeId.d.ts +2 -2
- package/dist/endpoints/routeId.js +11 -5
- package/dist/endpoints/summary.js +46 -12
- package/dist/endpoints/testVersion.d.ts +2 -0
- package/dist/endpoints/testVersion.js +38 -0
- package/dist/endpoints/transitions.js +41 -29
- package/dist/errors.d.ts +5 -0
- package/dist/errors.js +8 -0
- package/dist/events/request.d.ts +6 -2
- package/dist/events/request.js +35 -8
- package/dist/events/rows.d.ts +1 -1
- package/dist/events/rows.js +24 -8
- package/dist/events/writable.d.ts +9 -0
- package/dist/events/writable.js +13 -0
- package/dist/exports/adminClient.d.ts +1 -1
- package/dist/exports/adminClient.js +1 -1
- package/dist/exports/adminRsc.d.ts +3 -0
- package/dist/exports/adminRsc.js +3 -0
- package/dist/exports/index.d.ts +1 -1
- package/dist/exports/rsc.d.ts +1 -0
- package/dist/exports/rsc.js +1 -0
- package/dist/fields/xpGoal.js +3 -15
- package/dist/goals/fairness.d.ts +1 -1
- package/dist/goals/fairness.js +44 -35
- package/dist/goals/picker/clickGoalPicker.model.d.ts +8 -1
- package/dist/goals/picker/clickGoalPicker.model.js +20 -2
- package/dist/goals/picker/copy.d.ts +6 -2
- package/dist/goals/picker/copy.js +11 -2
- package/dist/goals/picker/useClickGoalPicker.d.ts +1 -1
- package/dist/goals/picker/useClickGoalPicker.js +4 -2
- package/dist/goals/validate.d.ts +3 -0
- package/dist/goals/validate.js +15 -0
- package/dist/hooks/blockRemovalRule.d.ts +30 -0
- package/dist/hooks/blockRemovalRule.js +165 -0
- package/dist/hooks/hostHook.js +6 -2
- package/dist/hooks/pageGuard.d.ts +27 -2
- package/dist/hooks/pageGuard.js +213 -45
- package/dist/hooks/puckGoals.d.ts +5 -0
- package/dist/hooks/puckGoals.js +62 -0
- package/dist/hooks/puckNestedTests.d.ts +8 -0
- package/dist/hooks/puckNestedTests.js +36 -0
- package/dist/hooks/trackPageCopies.d.ts +11 -0
- package/dist/hooks/trackPageCopies.js +7 -0
- package/dist/lib/fetchAllDocs.d.ts +1 -1
- package/dist/lib/placementPages.d.ts +10 -0
- package/dist/{admin/previewLinks.model.js → lib/placementPages.js} +10 -5
- package/dist/manifest/compile.d.ts +2 -1
- package/dist/manifest/compile.js +13 -6
- package/dist/onInit.js +36 -0
- package/dist/options.d.ts +2 -0
- package/dist/options.js +23 -2
- package/dist/plugin.js +19 -20
- package/dist/proxy/pageNavigation.d.ts +4 -0
- package/dist/proxy/pageNavigation.js +28 -0
- package/dist/proxy/resolve.js +52 -25
- package/dist/puck/ExperimentPicker.d.ts +2 -1
- package/dist/puck/ExperimentPicker.js +62 -40
- package/dist/puck/ExperimentSlot.js +3 -1
- package/dist/puck/copy.d.ts +5 -1
- package/dist/puck/copy.js +5 -1
- package/dist/puck/editor/ConfigureTestDrawer.d.ts +25 -0
- package/dist/puck/editor/ConfigureTestDrawer.js +150 -0
- package/dist/puck/editor/CreateExperimentDrawer.d.ts +12 -2
- package/dist/puck/editor/CreateExperimentDrawer.js +89 -21
- package/dist/puck/editor/EditorControls.d.ts +14 -0
- package/dist/puck/editor/EditorControls.js +99 -0
- package/dist/puck/editor/ExperimentSlotEditor.js +951 -179
- package/dist/puck/editor/LeftoverVersions.d.ts +15 -0
- package/dist/puck/editor/LeftoverVersions.js +79 -0
- package/dist/puck/editor/PlacementNotice.d.ts +8 -0
- package/dist/puck/editor/PlacementNotice.js +22 -0
- package/dist/puck/editor/QuickTestActions.d.ts +6 -0
- package/dist/puck/editor/QuickTestActions.js +57 -0
- package/dist/puck/editor/ResultsReadout.d.ts +2 -1
- package/dist/puck/editor/ResultsReadout.js +10 -6
- package/dist/puck/editor/VersionBuilder.d.ts +66 -12
- package/dist/puck/editor/VersionBuilder.js +554 -231
- package/dist/puck/editor/armWrites.d.ts +11 -2
- package/dist/puck/editor/armWrites.js +43 -4
- package/dist/puck/editor/armsCache.d.ts +3 -1
- package/dist/puck/editor/armsCache.js +20 -4
- package/dist/puck/editor/blockClipboard.d.ts +16 -0
- package/dist/puck/editor/blockClipboard.js +20 -0
- package/dist/puck/editor/cloneSlot.d.ts +2 -0
- package/dist/puck/editor/cloneSlot.js +7 -0
- package/dist/puck/editor/copy.d.ts +64 -19
- package/dist/puck/editor/copy.js +72 -20
- package/dist/puck/editor/createTest.d.ts +3 -0
- package/dist/puck/editor/createTest.js +33 -0
- package/dist/puck/editor/editor.chrome.css +191 -19
- package/dist/puck/editor/editor.css +328 -24
- package/dist/puck/editor/editor.model.d.ts +17 -1
- package/dist/puck/editor/editor.model.js +61 -4
- package/dist/puck/editor/editorSurface.d.ts +10 -0
- package/dist/puck/editor/editorSurface.js +65 -0
- package/dist/puck/editor/experimentOutlinePlugin.js +96 -28
- package/dist/puck/editor/localPlacements.d.ts +5 -0
- package/dist/puck/editor/localPlacements.js +43 -0
- package/dist/puck/editor/outlineVersion.d.ts +5 -0
- package/dist/puck/editor/outlineVersion.js +36 -0
- package/dist/puck/editor/placementsCache.d.ts +60 -0
- package/dist/puck/editor/placementsCache.js +263 -0
- package/dist/puck/editor/sidebar.d.ts +8 -0
- package/dist/puck/editor/sidebar.js +74 -0
- package/dist/puck/editor/usePageSaveReadiness.d.ts +6 -0
- package/dist/puck/editor/usePageSaveReadiness.js +31 -0
- package/dist/puck/editor/usePlacementNotice.d.ts +3 -0
- package/dist/puck/editor/usePlacementNotice.js +15 -0
- package/dist/puck/editor/xpGoalPuckEditorField.js +105 -86
- package/dist/puck/experimentSlotField.d.ts +3 -0
- package/dist/puck/experimentSlotField.js +15 -4
- package/dist/puck/experimentSlug.d.ts +2 -0
- package/dist/puck/experimentSlug.js +3 -0
- package/dist/puck/nestedTestCopy.d.ts +8 -0
- package/dist/puck/nestedTestCopy.js +22 -0
- package/dist/puck/nestedTests.d.ts +17 -0
- package/dist/puck/nestedTests.js +30 -0
- package/dist/puck/slotConfig.d.ts +1 -1
- package/dist/puck/slotConfig.js +17 -4
- package/dist/puck/visibility.d.ts +20 -0
- package/dist/puck/visibility.js +81 -0
- package/dist/results/aggregate.d.ts +6 -3
- package/dist/results/aggregate.js +9 -9
- package/dist/results/health.d.ts +8 -0
- package/dist/results/health.js +28 -0
- package/dist/results/identityCredit.d.ts +1 -0
- package/dist/results/identityCredit.js +4 -1
- package/dist/results/verdict.js +2 -1
- package/dist/runtime/cookie.d.ts +10 -2
- package/dist/runtime/cookie.js +38 -6
- package/dist/runtime/cookieOptions.d.ts +6 -0
- package/dist/runtime/cookieOptions.js +14 -0
- package/dist/runtime/proxyRuntime.d.ts +1 -0
- package/dist/runtime/proxyRuntime.js +18 -8
- package/dist/runtime/signing.d.ts +1 -0
- package/dist/runtime/signing.js +5 -0
- package/dist/sanitizeReadinessDetail.d.ts +2 -2
- package/dist/sanitizeReadinessDetail.js +22 -2
- package/dist/server/getAssignments.js +11 -10
- package/dist/server/recordContentChange.d.ts +1 -1
- package/dist/server/recordContentChange.js +48 -22
- package/dist/server/resolveExperimentBlocks.js +2 -4
- package/dist/server/resolveExperimentData.js +8 -8
- package/dist/server/runResults.js +52 -14
- package/dist/server/startExperiment.d.ts +20 -0
- package/dist/server/startExperiment.js +70 -0
- package/dist/server/trackConversion.js +10 -13
- package/dist/{admin → testSurface}/PreviewLinks.js +6 -2
- package/dist/testSurface/actions/DecideDialog.d.ts +16 -0
- package/dist/{admin → testSurface}/actions/DecideDialog.js +78 -55
- package/dist/testSurface/actions/LifecycleAction.d.ts +16 -0
- package/dist/testSurface/actions/LifecycleAction.js +105 -0
- package/dist/{admin → testSurface}/actions/MakeContentResult.d.ts +4 -3
- package/dist/{admin → testSurface}/actions/MakeContentResult.js +10 -2
- package/dist/{admin → testSurface}/actions/actions.model.d.ts +13 -5
- package/dist/testSurface/actions/actions.model.js +122 -0
- package/dist/{admin → testSurface}/api.d.ts +20 -7
- package/dist/{admin → testSurface}/api.js +72 -22
- package/dist/testSurface/contentLocaleURL.d.ts +2 -0
- package/dist/testSurface/contentLocaleURL.js +3 -0
- package/dist/{admin → testSurface}/copy/actions.d.ts +28 -8
- package/dist/{admin → testSurface}/copy/actions.js +31 -11
- package/dist/{admin → testSurface}/copy/common.d.ts +13 -4
- package/dist/{admin → testSurface}/copy/common.js +18 -8
- package/dist/testSurface/copy/languages.d.ts +12 -0
- package/dist/testSurface/copy/languages.js +8 -0
- package/dist/{admin → testSurface}/copy/metrics.d.ts +1 -0
- package/dist/{admin → testSurface}/copy/metrics.js +1 -0
- package/dist/testSurface/copy/pages.d.ts +84 -0
- package/dist/testSurface/copy/pages.js +90 -0
- package/dist/{admin → testSurface}/copy/readiness.d.ts +38 -4
- package/dist/{admin → testSurface}/copy/readiness.js +52 -7
- package/dist/{admin → testSurface}/copy/results.d.ts +6 -3
- package/dist/{admin → testSurface}/copy/results.js +6 -3
- package/dist/{admin → testSurface}/copy/review.d.ts +1 -1
- package/dist/{admin → testSurface}/copy/review.js +1 -1
- package/dist/{admin → testSurface}/copy/surface.d.ts +11 -2
- package/dist/{admin → testSurface}/copy/surface.js +13 -10
- package/dist/{admin → testSurface}/copy/testPage.d.ts +53 -8
- package/dist/testSurface/copy/testPage.js +165 -0
- package/dist/testSurface/format/adminURL.d.ts +7 -0
- package/dist/testSurface/format/adminURL.js +9 -0
- package/dist/testSurface/placementLabel.d.ts +8 -0
- package/dist/testSurface/placementLabel.js +24 -0
- package/dist/{admin → testSurface}/placements/placementLabels.d.ts +2 -0
- package/dist/{admin → testSurface}/placements/placementLabels.js +3 -2
- package/dist/{admin → testSurface}/previewLinks.model.d.ts +1 -6
- package/dist/testSurface/previewLinks.model.js +4 -0
- package/dist/testSurface/readPreflight.d.ts +13 -0
- package/dist/testSurface/readPreflight.js +44 -0
- package/dist/testSurface/readinessRead.d.ts +53 -0
- package/dist/testSurface/readinessRead.js +50 -0
- package/dist/{admin → testSurface}/results/VerdictHero.d.ts +2 -1
- package/dist/{admin → testSurface}/results/VerdictHero.js +5 -1
- package/dist/testSurface/results/results.css +64 -0
- package/dist/{admin → testSurface}/results/results.model.js +6 -2
- package/dist/{admin → testSurface}/surface/contracts.d.ts +17 -3
- package/dist/testSurface/surface/editorPlacement.d.ts +26 -0
- package/dist/testSurface/surface/editorPlacement.js +78 -0
- package/dist/testSurface/surface/pageBlock/pageBlock.model.js +9 -0
- package/dist/{admin → testSurface}/surface/pageBlock/parts.js +39 -11
- package/dist/testSurface/surface/pagePicker/CopyRoute.d.ts +13 -0
- package/dist/testSurface/surface/pagePicker/CopyRoute.js +273 -0
- package/dist/testSurface/surface/pagePicker/PageCombobox.d.ts +21 -0
- package/dist/testSurface/surface/pagePicker/PageCombobox.js +503 -0
- package/dist/testSurface/surface/pagePicker/pagePicker.css +73 -0
- package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.d.ts +7 -3
- package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.js +17 -2
- package/dist/{admin → testSurface}/surface/readiness/ActionDialogs.d.ts +8 -4
- package/dist/testSurface/surface/readiness/ActionDialogs.js +351 -0
- package/dist/{admin → testSurface}/surface/readiness/Banner.d.ts +2 -3
- package/dist/testSurface/surface/readiness/Banner.js +187 -0
- package/dist/testSurface/surface/readiness/BlockerList.d.ts +11 -0
- package/dist/testSurface/surface/readiness/BlockerList.js +31 -0
- package/dist/testSurface/surface/readiness/SaveStatus.d.ts +10 -0
- package/dist/testSurface/surface/readiness/SaveStatus.js +66 -0
- package/dist/{admin → testSurface}/surface/readiness/parts.js +0 -2
- package/dist/{admin → testSurface}/surface/readiness/readiness.model.d.ts +28 -2
- package/dist/testSurface/surface/readiness/readiness.model.js +377 -0
- package/dist/testSurface/surface/readiness/useTransition.d.ts +16 -0
- package/dist/testSurface/surface/readiness/useTransition.js +141 -0
- package/dist/{admin → testSurface}/surface/results/ReleasePages.d.ts +6 -3
- package/dist/{admin → testSurface}/surface/results/ReleasePages.js +40 -40
- package/dist/{admin → testSurface}/surface/results/ResultsBody.d.ts +7 -3
- package/dist/{admin → testSurface}/surface/results/ResultsBody.js +108 -44
- package/dist/{admin → testSurface}/surface/results/useResults.d.ts +26 -8
- package/dist/{admin → testSurface}/surface/results/useResults.js +3 -2
- package/dist/{admin → testSurface}/surface/setting/parts.js +58 -18
- package/dist/testSurface/surface/setting/setting.css +17 -0
- package/dist/{admin → testSurface}/surface/test/AdvancedSection.js +2 -0
- package/dist/testSurface/surface/test/DeleteTest.d.ts +23 -0
- package/dist/testSurface/surface/test/DeleteTest.js +270 -0
- package/dist/testSurface/surface/test/GoalSection.d.ts +4 -0
- package/dist/{admin → testSurface}/surface/test/GoalSection.js +116 -86
- package/dist/testSurface/surface/test/LengthSection.d.ts +2 -0
- package/dist/{admin → testSurface}/surface/test/LengthSection.js +5 -1
- package/dist/{admin → testSurface}/surface/test/PageHoldout.js +4 -1
- package/dist/{admin → testSurface}/surface/test/Rail.js +7 -4
- package/dist/{admin → testSurface}/surface/test/ReadinessBar.d.ts +1 -0
- package/dist/{admin → testSurface}/surface/test/ReadinessBar.js +2 -3
- package/dist/{admin → testSurface}/surface/test/Section.d.ts +3 -1
- package/dist/testSurface/surface/test/Section.js +80 -0
- package/dist/{admin → testSurface}/surface/test/TargetingSection.js +82 -12
- package/dist/testSurface/surface/test/TestSurface.d.ts +19 -0
- package/dist/testSurface/surface/test/TestSurface.js +265 -0
- package/dist/testSurface/surface/test/VersionsSection.d.ts +5 -0
- package/dist/{admin → testSurface}/surface/test/VersionsSection.js +69 -35
- package/dist/{admin → testSurface}/surface/test/fields.d.ts +30 -7
- package/dist/testSurface/surface/test/fields.js +306 -0
- package/dist/{admin → testSurface}/surface/test/pageParts.js +27 -43
- package/dist/testSurface/surface/test/testPage.css +103 -0
- package/dist/{admin → testSurface}/surface/test/testPage.model.d.ts +1 -0
- package/dist/{admin → testSurface}/surface/test/testPage.model.js +6 -0
- package/dist/{admin → testSurface}/surface/testDocument.model.d.ts +3 -0
- package/dist/{admin → testSurface}/surface/testDocument.model.js +4 -1
- package/dist/testSurface/surface/useTestDocument.d.ts +60 -0
- package/dist/testSurface/surface/useTestDocument.js +782 -0
- package/dist/testSurface/surface/watchTestDocument.d.ts +15 -0
- package/dist/testSurface/surface/watchTestDocument.js +181 -0
- package/dist/testSurface/surfaceUrls.d.ts +7 -0
- package/dist/testSurface/surfaceUrls.js +19 -0
- package/dist/{admin → testSurface}/useApi.d.ts +21 -5
- package/dist/testSurface/useOnTestReturn.d.ts +2 -0
- package/dist/testSurface/useOnTestReturn.js +27 -0
- package/dist/testSurface/useReadinessPolling.d.ts +3 -0
- package/dist/testSurface/useReadinessPolling.js +26 -0
- package/dist/transitions/addMetric.d.ts +2 -5
- package/dist/transitions/addMetric.js +5 -1
- package/dist/transitions/allocate.d.ts +2 -2
- package/dist/transitions/allocate.js +3 -1
- package/dist/transitions/archive.d.ts +1 -1
- package/dist/transitions/archive.js +3 -2
- package/dist/transitions/checkStart.d.ts +6 -1
- package/dist/transitions/checkStart.js +133 -17
- package/dist/transitions/contentFields.js +9 -5
- package/dist/transitions/decide.d.ts +1 -1
- package/dist/transitions/decide.js +6 -3
- package/dist/transitions/deleteExperiment.d.ts +2 -2
- package/dist/transitions/deleteExperiment.js +17 -7
- package/dist/transitions/kernel.d.ts +4 -0
- package/dist/transitions/kernel.js +9 -4
- package/dist/transitions/makeContent.d.ts +2 -1
- package/dist/transitions/makeContent.js +41 -17
- package/dist/transitions/nestedPlacementNames.d.ts +5 -0
- package/dist/transitions/nestedPlacementNames.js +32 -0
- package/dist/transitions/pageAddress.d.ts +6 -0
- package/dist/transitions/pageAddress.js +71 -0
- package/dist/transitions/pageVersions.js +3 -1
- package/dist/transitions/phaseRecord.d.ts +2 -0
- package/dist/transitions/phaseRecord.js +5 -0
- package/dist/transitions/placementInteractions.d.ts +3 -3
- package/dist/transitions/placementInteractions.js +16 -12
- package/dist/transitions/placements.d.ts +54 -8
- package/dist/transitions/placements.js +304 -81
- package/dist/transitions/preflightData.d.ts +5 -3
- package/dist/transitions/preflightData.js +137 -40
- package/dist/transitions/releaseHoldout.d.ts +2 -1
- package/dist/transitions/releaseHoldout.js +3 -1
- package/dist/transitions/releasePages.d.ts +2 -1
- package/dist/transitions/releasePages.js +3 -1
- package/dist/transitions/resolveCaps.d.ts +2 -4
- package/dist/transitions/start.d.ts +6 -8
- package/dist/transitions/start.js +72 -35
- package/dist/transitions/startReads.d.ts +7 -0
- package/dist/transitions/startReads.js +28 -0
- package/dist/transitions/stop.d.ts +2 -1
- package/dist/transitions/stop.js +3 -2
- package/dist/types/contracts.d.ts +15 -3
- package/dist/types/endpoints.d.ts +121 -17
- package/dist/types/puck.d.ts +1 -0
- package/dist/types/runtime.d.ts +15 -9
- package/dist/types/snapshot.d.ts +2 -0
- package/dist/types/surface.d.ts +9 -9
- package/dist/ui/Button.js +2 -2
- package/dist/ui/Card.d.ts +2 -1
- package/dist/ui/Card.js +4 -4
- package/dist/ui/ChipsInput.d.ts +8 -1
- package/dist/ui/ChipsInput.js +17 -4
- package/dist/ui/Dialog.d.ts +24 -2
- package/dist/ui/Dialog.js +116 -6
- package/dist/ui/Drawer.d.ts +10 -0
- package/dist/ui/Drawer.js +29 -0
- package/dist/ui/Inputs.d.ts +4 -3
- package/dist/ui/Inputs.js +7 -4
- package/dist/ui/SelectControl.d.ts +33 -0
- package/dist/ui/SelectControl.js +504 -0
- package/dist/ui/Tabs.d.ts +4 -4
- package/dist/ui/Tabs.js +35 -32
- package/dist/ui/ui.css +49 -5
- package/package.json +3 -2
- package/dist/admin/actions/ConfirmDialog.d.ts +0 -19
- package/dist/admin/actions/ConfirmDialog.js +0 -149
- package/dist/admin/actions/DecideDialog.d.ts +0 -10
- package/dist/admin/actions/actions.model.js +0 -70
- package/dist/admin/copy/pages.d.ts +0 -26
- package/dist/admin/copy/pages.js +0 -26
- package/dist/admin/copy/testPage.js +0 -104
- package/dist/admin/results/results.css +0 -64
- package/dist/admin/styles.css +0 -10
- package/dist/admin/styles.d.ts +0 -2
- package/dist/admin/styles.js +0 -3
- package/dist/admin/surface/pageBlock/pageBlock.model.js +0 -8
- package/dist/admin/surface/pagePicker/CopyRoute.d.ts +0 -6
- package/dist/admin/surface/pagePicker/CopyRoute.js +0 -53
- package/dist/admin/surface/pagePicker/PagePicker.d.ts +0 -10
- package/dist/admin/surface/pagePicker/PagePicker.js +0 -172
- package/dist/admin/surface/readiness/ActionDialogs.js +0 -337
- package/dist/admin/surface/readiness/Banner.js +0 -190
- package/dist/admin/surface/readiness/SaveStatus.d.ts +0 -5
- package/dist/admin/surface/readiness/SaveStatus.js +0 -53
- package/dist/admin/surface/readiness/readiness.model.js +0 -205
- package/dist/admin/surface/readiness/useTransition.d.ts +0 -11
- package/dist/admin/surface/readiness/useTransition.js +0 -35
- package/dist/admin/surface/setting/setting.css +0 -17
- package/dist/admin/surface/test/GoalSection.d.ts +0 -2
- package/dist/admin/surface/test/LengthSection.d.ts +0 -2
- package/dist/admin/surface/test/Section.js +0 -47
- package/dist/admin/surface/test/VersionsSection.d.ts +0 -4
- package/dist/admin/surface/test/fields.js +0 -216
- package/dist/admin/surface/test/testPage.css +0 -97
- package/dist/admin/surface/useTestDocument.d.ts +0 -32
- package/dist/admin/surface/useTestDocument.js +0 -415
- /package/dist/{admin → testSurface}/PreviewLinks.d.ts +0 -0
- /package/dist/{admin → testSurface}/actions/decide.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/actions/decide.model.js +0 -0
- /package/dist/{admin → testSurface}/allocation.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/allocation.model.js +0 -0
- /package/dist/{admin → testSurface}/arms/arms.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/arms/arms.model.js +0 -0
- /package/dist/{admin → testSurface}/arms/pageTarget.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/arms/pageTarget.model.js +0 -0
- /package/dist/{admin → testSurface}/arms/params.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/arms/params.model.js +0 -0
- /package/dist/{admin → testSurface}/copy/advanced.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/advanced.js +0 -0
- /package/dist/{admin → testSurface}/copy/arms.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/arms.js +0 -0
- /package/dist/{admin → testSurface}/copy/audience.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/audience.js +0 -0
- /package/dist/{admin → testSurface}/copy/recommendation.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/recommendation.js +0 -0
- /package/dist/{admin → testSurface}/copy/setting.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/setting.js +0 -0
- /package/dist/{admin → testSurface}/format/date.d.ts +0 -0
- /package/dist/{admin → testSurface}/format/date.js +0 -0
- /package/dist/{admin → testSurface}/labels.d.ts +0 -0
- /package/dist/{admin → testSurface}/labels.js +0 -0
- /package/dist/{admin → testSurface}/lockedNotice.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/lockedNotice.model.js +0 -0
- /package/dist/{admin → testSurface}/metricSource.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/metricSource.model.js +0 -0
- /package/dist/{admin → testSurface}/placements/placementLabels.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/placements/placementLabels.model.js +0 -0
- /package/dist/{admin → testSurface}/placements/usePlacementLabels.d.ts +0 -0
- /package/dist/{admin → testSurface}/placements/usePlacementLabels.js +0 -0
- /package/dist/{admin → testSurface}/reload.d.ts +0 -0
- /package/dist/{admin → testSurface}/reload.js +0 -0
- /package/dist/{admin → testSurface}/results/CappedCell.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/CappedCell.js +0 -0
- /package/dist/{admin → testSurface}/results/CiChart.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/CiChart.js +0 -0
- /package/dist/{admin → testSurface}/results/DataQualityPanel.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/DataQualityPanel.js +0 -0
- /package/dist/{admin → testSurface}/results/DataTable.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/DataTable.js +0 -0
- /package/dist/{admin → testSurface}/results/StatTile.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/StatTile.js +0 -0
- /package/dist/{admin → testSurface}/results/chart.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/chart.model.js +0 -0
- /package/dist/{admin → testSurface}/results/format.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/format.js +0 -0
- /package/dist/{admin → testSurface}/results/legacy.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/legacy.js +0 -0
- /package/dist/{admin → testSurface}/results/releasePages.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/releasePages.model.js +0 -0
- /package/dist/{admin → testSurface}/results/results.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/snapshot.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/snapshot.js +0 -0
- /package/dist/{admin → testSurface}/review/review.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/review/review.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/contracts.js +0 -0
- /package/dist/{admin → testSurface}/surface/pageBlock/pageBlock.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/pageBlock/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/results/recommendation.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/results/recommendation.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/setting/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/setting/setting.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/setting/setting.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/AdvancedSection.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/PageHoldout.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/Rail.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/TargetingSection.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/jumpToSection.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/jumpToSection.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/pageParts.d.ts +0 -0
- /package/dist/{admin → testSurface}/targeting/targeting.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/targeting/targeting.model.js +0 -0
- /package/dist/{admin → testSurface}/theme.d.ts +0 -0
- /package/dist/{admin → testSurface}/theme.js +0 -0
- /package/dist/{admin → testSurface}/useApi.js +0 -0
package/dist/db/appends.js
CHANGED
|
@@ -18,6 +18,55 @@ import { qualifiedTable, quoteIdentifier as quote } from './sql.js';
|
|
|
18
18
|
});
|
|
19
19
|
return doc ?? undefined;
|
|
20
20
|
}
|
|
21
|
+
/** Payload 3.90.2: updateByID starts from the latest version; update (bulk)
|
|
22
|
+
* starts from main rows except draft/trash saves. utilities/update then replaces
|
|
23
|
+
* unselected locales with the latest published version (publishSpecificLocale).
|
|
24
|
+
* Localized publication status is refused at init. Restore uses the selected version. */ export function placementMergeBase(path) {
|
|
25
|
+
if (path.versionId != null) return 'restore';
|
|
26
|
+
if (path.publishSpecificLocale) return 'published';
|
|
27
|
+
return path.bulk && !path.draft && !path.trashing ? 'main' : 'latest';
|
|
28
|
+
}
|
|
29
|
+
export async function placementWriteContent(req, collection, id, main, path = {}) {
|
|
30
|
+
const config = req.payload.config.collections?.find((entry)=>entry.slug === collection);
|
|
31
|
+
if (!config?.versions || !config.versions.drafts) return main;
|
|
32
|
+
const base = placementMergeBase(path);
|
|
33
|
+
if (base === 'main') return main;
|
|
34
|
+
// Adapter read on the guarded write's transaction; no Local API hook recursion.
|
|
35
|
+
const latest = await req.payload.db.findVersions({
|
|
36
|
+
collection,
|
|
37
|
+
req,
|
|
38
|
+
limit: 1,
|
|
39
|
+
pagination: false,
|
|
40
|
+
sort: '-updatedAt',
|
|
41
|
+
where: base === 'restore' ? {
|
|
42
|
+
id: {
|
|
43
|
+
equals: path.versionId
|
|
44
|
+
}
|
|
45
|
+
} : {
|
|
46
|
+
and: [
|
|
47
|
+
{
|
|
48
|
+
parent: {
|
|
49
|
+
equals: id
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
base === 'published' ? {
|
|
53
|
+
'version._status': {
|
|
54
|
+
equals: 'published'
|
|
55
|
+
}
|
|
56
|
+
} : {
|
|
57
|
+
latest: {
|
|
58
|
+
equals: true
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
overrideAccess: false
|
|
64
|
+
});
|
|
65
|
+
return latest.docs[0] ? {
|
|
66
|
+
...latest.docs[0].version,
|
|
67
|
+
id
|
|
68
|
+
} : base === 'published' ? undefined : main;
|
|
69
|
+
}
|
|
21
70
|
/** Read the main collection row BEFORE the host write. Draft version retention
|
|
22
71
|
* and unpublishing cannot remove this baseline.
|
|
23
72
|
*/ export async function previousPublishedContent(req, collection, id) {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { PayloadRequest, Where } from 'payload';
|
|
2
|
+
import { type PlacementLocaleView } from '../blocks/placementLocale.js';
|
|
3
|
+
import type { DocId } from '../types/contracts.js';
|
|
4
|
+
export interface BulkPlacementRemoval {
|
|
5
|
+
documents: Set<string>;
|
|
6
|
+
change?: {
|
|
7
|
+
collection: string;
|
|
8
|
+
data?: Record<string, unknown>;
|
|
9
|
+
draft: boolean;
|
|
10
|
+
deleting: boolean;
|
|
11
|
+
};
|
|
12
|
+
refusals: Map<string, string>;
|
|
13
|
+
}
|
|
14
|
+
export declare function usesBulkDocumentTransactions(req: PayloadRequest): boolean;
|
|
15
|
+
/** A distinct operation identity without copying the transaction/context. Native
|
|
16
|
+
* Request accessors and methods must use the original receiver.
|
|
17
|
+
*/
|
|
18
|
+
export declare function placementOperationRequest(req: PayloadRequest, fields: Map<PropertyKey, unknown>, failed?: () => void): PayloadRequest;
|
|
19
|
+
/** Observe Payload's actual, access-filtered bulk selection before it dispatches
|
|
20
|
+
* any document hooks. This request-only proxy adds no reads and never replaces
|
|
21
|
+
* the shared adapter. Matching the original Where node avoids capturing nested
|
|
22
|
+
* access-hook reads. queryDrafts prefixes keys but preserves condition objects.
|
|
23
|
+
* Payload 3's update/delete operations select the entire set before Promise.all.
|
|
24
|
+
*/
|
|
25
|
+
export declare function bulkPlacementRequest(req: PayloadRequest, collection: string, where: Where, data: Record<string, unknown> | undefined, draft: boolean, deleting: boolean, bulk: BulkPlacementRemoval): PayloadRequest;
|
|
26
|
+
/** Evaluate the common change against the published row seen under E, rather
|
|
27
|
+
* than a draft version or a selection snapshot from before the lock. */
|
|
28
|
+
export declare function bulkRemoves(bulk: BulkPlacementRemoval | undefined, req: PayloadRequest, collection: string, doc: Record<string, unknown> & {
|
|
29
|
+
id: DocId;
|
|
30
|
+
}, slug: string, view: PlacementLocaleView): boolean;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { placementLocaleContent, mergedPlacementLocales, removedPlacementViews, placementDocumentKey } from '../blocks/placementLocale.js';
|
|
2
|
+
// Payload starts/ends a transaction per bulk document with this adapter option.
|
|
3
|
+
export function usesBulkDocumentTransactions(req) {
|
|
4
|
+
return req.payload.db.bulkOperationsSingleTransaction === true;
|
|
5
|
+
}
|
|
6
|
+
const operationRequestState = Symbol('xpPlacementRequestState');
|
|
7
|
+
/** A distinct operation identity without copying the transaction/context. Native
|
|
8
|
+
* Request accessors and methods must use the original receiver.
|
|
9
|
+
*/ export function placementOperationRequest(req, fields, failed) {
|
|
10
|
+
const parent = req[operationRequestState];
|
|
11
|
+
const state = {
|
|
12
|
+
target: parent?.target ?? req,
|
|
13
|
+
failed: failed ?? parent?.failed
|
|
14
|
+
};
|
|
15
|
+
return new Proxy(req, {
|
|
16
|
+
deleteProperty (target, key) {
|
|
17
|
+
// Transaction deletion must reach the shared request without ending any
|
|
18
|
+
// ancestor operation. Extra wrappers of this operation inherit its cleanup.
|
|
19
|
+
if (key === 'transactionID') {
|
|
20
|
+
state.failed?.();
|
|
21
|
+
return Reflect.deleteProperty(state.target, key);
|
|
22
|
+
}
|
|
23
|
+
return Reflect.deleteProperty(target, key);
|
|
24
|
+
},
|
|
25
|
+
get (target, key) {
|
|
26
|
+
if (key === operationRequestState) return state;
|
|
27
|
+
if (fields.has(key)) return fields.get(key);
|
|
28
|
+
const value = Reflect.get(target, key, target);
|
|
29
|
+
return typeof Object.getOwnPropertyDescriptor(Request.prototype, key)?.value === 'function' ? value.bind(target) : value;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** Observe Payload's actual, access-filtered bulk selection before it dispatches
|
|
34
|
+
* any document hooks. This request-only proxy adds no reads and never replaces
|
|
35
|
+
* the shared adapter. Matching the original Where node avoids capturing nested
|
|
36
|
+
* access-hook reads. queryDrafts prefixes keys but preserves condition objects.
|
|
37
|
+
* Payload 3's update/delete operations select the entire set before Promise.all.
|
|
38
|
+
*/ export function bulkPlacementRequest(req, collection, where, data, draft, deleting, bulk) {
|
|
39
|
+
const config = req.payload.config.collections.find((entry)=>entry.slug === collection);
|
|
40
|
+
const draftOnly = draft && Boolean(config?.versions && config.versions.drafts) && data?._status !== 'published';
|
|
41
|
+
bulk.change = {
|
|
42
|
+
collection,
|
|
43
|
+
data,
|
|
44
|
+
draft: draftOnly,
|
|
45
|
+
deleting
|
|
46
|
+
};
|
|
47
|
+
let captured = false;
|
|
48
|
+
const matches = (value, expected, versions)=>{
|
|
49
|
+
if (value === expected) return true;
|
|
50
|
+
if (!versions) return false;
|
|
51
|
+
if (!value || !expected || typeof value !== 'object' || typeof expected !== 'object') return false;
|
|
52
|
+
const actual = value;
|
|
53
|
+
return Object.entries(expected).every(([key, condition])=>{
|
|
54
|
+
if (key === 'and' || key === 'or') return Array.isArray(actual[key]) && Array.isArray(condition) && condition.length === actual[key].length && condition.every((entry, i)=>matches(actual[key][i], entry, versions));
|
|
55
|
+
return actual[versions ? key === 'id' ? 'parent' : `version.${key}` : key] === condition;
|
|
56
|
+
}) && Object.keys(actual).length === Object.keys(expected).length;
|
|
57
|
+
};
|
|
58
|
+
const contains = (value, versions)=>matches(value, where, versions) || !!value && typeof value === 'object' && [
|
|
59
|
+
'and',
|
|
60
|
+
'or'
|
|
61
|
+
].some((key)=>{
|
|
62
|
+
const children = value[key];
|
|
63
|
+
return Array.isArray(children) && children.some((child)=>contains(child, versions));
|
|
64
|
+
});
|
|
65
|
+
const database = new Proxy(req.payload.db, {
|
|
66
|
+
get (target, key, receiver) {
|
|
67
|
+
const method = Reflect.get(target, key, receiver);
|
|
68
|
+
if (key !== 'find' && key !== 'queryDrafts') return method;
|
|
69
|
+
return async (query)=>{
|
|
70
|
+
const selection = !captured && (key !== 'queryDrafts' || 'pagination' in query && query.pagination === false) && query.req === scoped && query.collection === collection && contains(query.where, key === 'queryDrafts');
|
|
71
|
+
const result = await method.call(target, query);
|
|
72
|
+
if (selection) {
|
|
73
|
+
captured = true;
|
|
74
|
+
for (const doc of result.docs)bulk.documents.add(JSON.stringify([
|
|
75
|
+
collection,
|
|
76
|
+
String(doc.id)
|
|
77
|
+
]));
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
const payload = new Proxy(req.payload, {
|
|
84
|
+
get: (target, key, receiver)=>key === 'db' ? database : Reflect.get(target, key, receiver)
|
|
85
|
+
});
|
|
86
|
+
const scoped = placementOperationRequest(req, new Map([
|
|
87
|
+
[
|
|
88
|
+
'payload',
|
|
89
|
+
payload
|
|
90
|
+
]
|
|
91
|
+
]));
|
|
92
|
+
return scoped;
|
|
93
|
+
}
|
|
94
|
+
/** Evaluate the common change against the published row seen under E, rather
|
|
95
|
+
* than a draft version or a selection snapshot from before the lock. */ export function bulkRemoves(bulk, req, collection, doc, slug, view) {
|
|
96
|
+
const change = bulk?.change;
|
|
97
|
+
if (!change || change.draft || change.collection !== collection || !bulk.documents.has(JSON.stringify([
|
|
98
|
+
collection,
|
|
99
|
+
String(doc.id)
|
|
100
|
+
]))) return false;
|
|
101
|
+
// locale=all data and the adapter row share the same all-language shape.
|
|
102
|
+
// A single-locale write instead merges its flattened values once.
|
|
103
|
+
const input = req.locale === 'all' ? 'all-locales' : 'localized';
|
|
104
|
+
const pending = {
|
|
105
|
+
...input === 'all-locales' ? doc : placementLocaleContent(req, collection, doc, 'all-locales'),
|
|
106
|
+
...change.data
|
|
107
|
+
};
|
|
108
|
+
const after = input === 'all-locales' ? pending : mergedPlacementLocales(req, collection, doc, pending);
|
|
109
|
+
const views = removedPlacementViews(req, collection, doc, after, change.deleting || after.deletedAt != null || after._status === 'draft', 'all-locales');
|
|
110
|
+
return (views.get(slug) ?? []).some((removed)=>placementDocumentKey(collection, doc.id, removed) === placementDocumentKey(collection, doc.id, view));
|
|
111
|
+
}
|
package/dist/db/delete.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PayloadRequest } from 'payload';
|
|
2
2
|
import type { DocId } from '../types/contracts.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type Executor } from './executor.js';
|
|
4
4
|
interface DeleteState {
|
|
5
5
|
tail: Promise<void>;
|
|
6
6
|
retiredSlugs: Set<string>;
|
package/dist/db/delete.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { transactionSession } from './executor.js';
|
|
2
2
|
import { COLUMNS, TABLES } from './names.js';
|
|
3
3
|
import { qualifiedTable, quoteIdentifier as quote } from './sql.js';
|
|
4
4
|
// Key by the actual session: borrowed requests in one transaction share a queue,
|
|
@@ -9,9 +9,7 @@ const transactions = new WeakMap();
|
|
|
9
9
|
* Successful beforeDelete bodies retain exclusions until the transaction ends:
|
|
10
10
|
* another row can be between hooks with its children gone but its row present.
|
|
11
11
|
*/ export async function serializeDelete(req, fn) {
|
|
12
|
-
const
|
|
13
|
-
const session = id == null ? undefined : req.payload.db.sessions?.[id];
|
|
14
|
-
if (!session) throw new XpNoTransactionError();
|
|
12
|
+
const session = await transactionSession(req);
|
|
15
13
|
let state = transactions.get(session);
|
|
16
14
|
if (!state) {
|
|
17
15
|
state = {
|
package/dist/db/events.d.ts
CHANGED
|
@@ -17,5 +17,14 @@ export interface EventRow {
|
|
|
17
17
|
attributes?: Record<string, unknown>;
|
|
18
18
|
dedupeKey: string;
|
|
19
19
|
}
|
|
20
|
+
type ServerConversion = Pick<EventRow, 'unitId' | 'unitType' | 'userId' | 'ts'> & {
|
|
21
|
+
eventName: string;
|
|
22
|
+
value: number;
|
|
23
|
+
idempotencyKey: string;
|
|
24
|
+
};
|
|
25
|
+
/** A retained legacy row suppresses retries for its event name. The scoped key's
|
|
26
|
+
* unique index handles concurrent writes after the old writers have been drained. */
|
|
27
|
+
export declare function insertServerConversion(exec: Executor, event: ServerConversion, log: (message: string) => void): Promise<void>;
|
|
20
28
|
/** Pooled/autocommit executor required: an FK failure must not poison a caller's transaction. */
|
|
21
29
|
export declare function insertEvents(exec: Executor, rows: EventRow[], log?: (message: string) => void): Promise<number>;
|
|
30
|
+
export {};
|
package/dist/db/events.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
1
2
|
import { exposureDimensions } from '../events/dimensions.js';
|
|
2
3
|
import { COLUMNS, TABLES } from './names.js';
|
|
3
4
|
import { qualifiedTable, quoteIdentifier } from './sql.js';
|
|
@@ -6,7 +7,7 @@ import { qualifiedTable, quoteIdentifier } from './sql.js';
|
|
|
6
7
|
experimentId
|
|
7
8
|
]);
|
|
8
9
|
}
|
|
9
|
-
const quote =
|
|
10
|
+
const quote = quoteIdentifier;
|
|
10
11
|
const c = COLUMNS.events;
|
|
11
12
|
function foreignKeyViolation(error) {
|
|
12
13
|
const seen = new Set();
|
|
@@ -28,15 +29,48 @@ function foreignKeyViolation(error) {
|
|
|
28
29
|
return null;
|
|
29
30
|
}
|
|
30
31
|
}
|
|
32
|
+
function hasFiniteValue(value, log) {
|
|
33
|
+
if (value === undefined || Number.isFinite(value)) return true;
|
|
34
|
+
log('Experiments: dropped event with non-finite value');
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
/** A retained legacy row suppresses retries for its event name. The scoped key's
|
|
38
|
+
* unique index handles concurrent writes after the old writers have been drained. */ export async function insertServerConversion(exec, event, log) {
|
|
39
|
+
if (!hasFiniteValue(event.value, log)) return;
|
|
40
|
+
const table = qualifiedTable(exec, TABLES.events);
|
|
41
|
+
const digest = createHash('sha256').update(JSON.stringify([
|
|
42
|
+
event.eventName,
|
|
43
|
+
event.idempotencyKey
|
|
44
|
+
])).digest('hex');
|
|
45
|
+
await exec.query(`INSERT INTO ${table} (${[
|
|
46
|
+
c.type,
|
|
47
|
+
c.unitId,
|
|
48
|
+
c.unitType,
|
|
49
|
+
c.userId,
|
|
50
|
+
c.eventName,
|
|
51
|
+
c.value,
|
|
52
|
+
c.ts,
|
|
53
|
+
c.dedupeKey,
|
|
54
|
+
c.createdAt,
|
|
55
|
+
c.updatedAt
|
|
56
|
+
].map(quote).join(', ')})
|
|
57
|
+
SELECT 'conversion', $1, $2, $3, $4, $5, $6, $7, now(), now()
|
|
58
|
+
WHERE NOT EXISTS (SELECT 1 FROM ${table} WHERE ${quote(c.dedupeKey)} = $8 AND ${quote(c.eventName)} = $4)
|
|
59
|
+
ON CONFLICT (${quote(c.dedupeKey)}) DO NOTHING`, [
|
|
60
|
+
event.unitId,
|
|
61
|
+
event.unitType,
|
|
62
|
+
event.userId ?? null,
|
|
63
|
+
event.eventName,
|
|
64
|
+
event.value,
|
|
65
|
+
event.ts,
|
|
66
|
+
`conversion:s2:${digest}`,
|
|
67
|
+
`conversion:s:${event.idempotencyKey}`
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
31
70
|
/** Pooled/autocommit executor required: an FK failure must not poison a caller's transaction. */ export async function insertEvents(exec, rows, log = console.error) {
|
|
32
|
-
const valid = rows.filter((row)=>
|
|
33
|
-
if (row.value === undefined || Number.isFinite(row.value)) return true;
|
|
34
|
-
log('Experiments: dropped event with non-finite value');
|
|
35
|
-
return false;
|
|
36
|
-
});
|
|
71
|
+
const valid = rows.filter((row)=>hasFiniteValue(row.value, log));
|
|
37
72
|
if (!valid.length) return 0;
|
|
38
|
-
const
|
|
39
|
-
const table = `${schema ? `${quote(schema)}.` : ''}${quote(TABLES.events)}`;
|
|
73
|
+
const table = qualifiedTable(exec, TABLES.events);
|
|
40
74
|
async function insert(batch) {
|
|
41
75
|
const params = [];
|
|
42
76
|
const values = batch.map((row)=>{
|
package/dist/db/executor.d.ts
CHANGED
|
@@ -2,7 +2,13 @@ import type { Payload, PayloadRequest } from 'payload';
|
|
|
2
2
|
import type { Executor } from './pgExecutor.js';
|
|
3
3
|
export type { Executor } from './pgExecutor.js';
|
|
4
4
|
export { pgPoolExecutor, ownConnection, withStatementTimeout, raceDeadline, ResultsBudgetError, RESULTS_TIMEOUT_MARGIN_MS } from './pgExecutor.js';
|
|
5
|
-
|
|
5
|
+
type TransactionRequest = Pick<PayloadRequest, 'payload' | 'transactionID'>;
|
|
6
|
+
export declare function transactionSession(req: TransactionRequest): Promise<{
|
|
7
|
+
db: unknown;
|
|
8
|
+
reject: () => Promise<void>;
|
|
9
|
+
resolve: () => Promise<void>;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function txExecutor(req: TransactionRequest): Executor & {
|
|
6
12
|
schemaName?: string;
|
|
7
13
|
};
|
|
8
14
|
export declare function pooledExecutor(payload: Payload): Executor & {
|
package/dist/db/executor.js
CHANGED
|
@@ -14,14 +14,18 @@ export { pgPoolExecutor, ownConnection, withStatementTimeout, raceDeadline, Resu
|
|
|
14
14
|
chunks.push(sql.raw(text.slice(start)));
|
|
15
15
|
return sql.join(chunks, sql.raw(''));
|
|
16
16
|
}
|
|
17
|
+
export async function transactionSession(req) {
|
|
18
|
+
const id = await req.transactionID;
|
|
19
|
+
const session = id == null ? undefined : req.payload.db.sessions?.[id];
|
|
20
|
+
if (!session) throw new XpNoTransactionError();
|
|
21
|
+
return session;
|
|
22
|
+
}
|
|
17
23
|
export function txExecutor(req) {
|
|
18
24
|
const db = req.payload.db;
|
|
19
25
|
return {
|
|
20
26
|
schemaName: db.schemaName,
|
|
21
27
|
async query (text, params = []) {
|
|
22
|
-
const
|
|
23
|
-
const session = id == null ? undefined : db.sessions?.[id];
|
|
24
|
-
if (!session) throw new XpNoTransactionError();
|
|
28
|
+
const session = await transactionSession(req);
|
|
25
29
|
return normalise(await session.db.execute(bind(text, params)));
|
|
26
30
|
}
|
|
27
31
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Payload } from 'payload';
|
|
2
|
+
import type { DocId } from '../types/contracts.js';
|
|
3
|
+
/** Read only the tracked IDs. Omitting req puts this adapter read on the pool,
|
|
4
|
+
* so a row visible here survived the copy transaction. */
|
|
5
|
+
export declare function committedPageCopyIds(payload: Payload, collection: string, created: DocId[]): Promise<DocId[]>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Read only the tracked IDs. Omitting req puts this adapter read on the pool,
|
|
2
|
+
* so a row visible here survived the copy transaction. */ export async function committedPageCopyIds(payload, collection, created) {
|
|
3
|
+
const ids = [
|
|
4
|
+
...new Set(created)
|
|
5
|
+
];
|
|
6
|
+
if (!ids.length) return [];
|
|
7
|
+
const adapter = payload.db;
|
|
8
|
+
// The original transaction may have died before the adapter marked its write.
|
|
9
|
+
// Always check the primary so replica lag can't hide a committed draft.
|
|
10
|
+
const primary = adapter.primaryDrizzle ? {
|
|
11
|
+
...adapter,
|
|
12
|
+
drizzle: adapter.primaryDrizzle
|
|
13
|
+
} : adapter;
|
|
14
|
+
const { docs } = await primary.find({
|
|
15
|
+
collection,
|
|
16
|
+
where: {
|
|
17
|
+
id: {
|
|
18
|
+
in: ids
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
select: {
|
|
22
|
+
id: true
|
|
23
|
+
},
|
|
24
|
+
sort: 'id',
|
|
25
|
+
limit: ids.length,
|
|
26
|
+
pagination: false,
|
|
27
|
+
// The adapter has no access layer. Only IDs from this write are checked here.
|
|
28
|
+
overrideAccess: false
|
|
29
|
+
});
|
|
30
|
+
return docs.map((doc)=>doc.id);
|
|
31
|
+
}
|
package/dist/db/placements.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export interface PlacementTest {
|
|
|
21
21
|
}
|
|
22
22
|
/** Raw reads only: guard discovery includes every status, interaction checks filter under the locks. */
|
|
23
23
|
export declare function placementTests(exec: Executor): Promise<PlacementTest[]>;
|
|
24
|
+
/** Indexed slug lookup for the removal guard; startable tests share E with Start before status is rechecked. */
|
|
25
|
+
export declare function removableBlockTests(exec: Executor, slugs: readonly string[]): Promise<Array<Pick<PlacementTest, 'id' | 'slug' | 'name' | 'status'>>>;
|
|
24
26
|
/** §7.8: interacting-tests computes placement paths from published rows. */
|
|
25
27
|
export declare function placementPathContent(req: PayloadRequest, collection: string, id: DocId): Promise<(Record<string, unknown> & {
|
|
26
28
|
id: DocId;
|
package/dist/db/placements.js
CHANGED
|
@@ -14,6 +14,14 @@ import { qualifiedTable, quoteIdentifier as q } from './sql.js';
|
|
|
14
14
|
placementDocs: row.placementDocs ?? null
|
|
15
15
|
}));
|
|
16
16
|
}
|
|
17
|
+
/** Indexed slug lookup for the removal guard; startable tests share E with Start before status is rechecked. */ export async function removableBlockTests(exec, slugs) {
|
|
18
|
+
const e = COLUMNS.experiments;
|
|
19
|
+
const { rows } = await exec.query(`SELECT ${q(e.id)} AS id, ${q(e.slug)} AS slug, ${q(e.name)} AS name, ${q(e.status)} AS status
|
|
20
|
+
FROM ${qualifiedTable(exec, TABLES.experiments)} WHERE ${q(e.slug)} = ANY($1::text[]) AND ${q(e.kind)} = 'block' AND ${q(e.status)} IN ('draft', 'stopped', 'running')`, [
|
|
21
|
+
slugs
|
|
22
|
+
]);
|
|
23
|
+
return rows;
|
|
24
|
+
}
|
|
17
25
|
/** §7.8: interacting-tests computes placement paths from published rows. */ export async function placementPathContent(req, collection, id) {
|
|
18
26
|
return req.payload.db.findOne({
|
|
19
27
|
collection,
|
package/dist/db/results.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export interface PhaseExposureRow {
|
|
|
5
5
|
unitId: string;
|
|
6
6
|
arm: string;
|
|
7
7
|
ts: number;
|
|
8
|
+
unitAgeMs?: number;
|
|
8
9
|
}
|
|
9
10
|
export interface RolloutExposureRow {
|
|
10
11
|
unitId: string;
|
|
@@ -16,6 +17,7 @@ export interface MetricEventRow {
|
|
|
16
17
|
userId: string | null;
|
|
17
18
|
value: number;
|
|
18
19
|
ts: number;
|
|
20
|
+
unitAgeMs?: number;
|
|
19
21
|
}
|
|
20
22
|
export interface IdentityRow {
|
|
21
23
|
anonymousId: string;
|
|
@@ -41,12 +43,14 @@ export declare function rolloutExposureRows(exec: Executor, { experimentId, resp
|
|
|
41
43
|
* or userIds for stored user_id (user units and visitor identity credit). Each distinct
|
|
42
44
|
* ID occurs in one ANY array of at most 10,000, so batching cannot duplicate rows.
|
|
43
45
|
*/
|
|
44
|
-
export declare function metricEventRows(exec: Executor, { eventName, unitIds, userIds, from, to }: {
|
|
46
|
+
export declare function metricEventRows(exec: Executor, { eventName, unitIds, userIds, from, to, readAge, forVisitors }: {
|
|
45
47
|
eventName: string;
|
|
46
48
|
unitIds?: readonly string[];
|
|
47
49
|
userIds?: readonly string[];
|
|
48
50
|
from: Timestamp;
|
|
49
51
|
to: Timestamp;
|
|
52
|
+
readAge?: boolean;
|
|
53
|
+
forVisitors?: boolean;
|
|
50
54
|
}): Promise<MetricEventRow[]>;
|
|
51
55
|
/** Linked visitors for creditUserEvents; disjoint ANY batches of ≤ 10,000 IDs. */
|
|
52
56
|
export declare function identityRows(exec: Executor, { anonymousIds }: {
|
package/dist/db/results.js
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import { timestampMs } from '../results/aggregate.js';
|
|
2
2
|
import { COLUMNS, TABLES } from './names.js';
|
|
3
|
+
import { USER_BROWSER_CONVERSION_PREFIX } from '../constants.js';
|
|
3
4
|
import { qualifiedTable, quoteIdentifier as q } from './sql.js';
|
|
4
5
|
const c = COLUMNS.events;
|
|
5
6
|
const batchSize = 10_000;
|
|
6
7
|
const iso = (ts)=>new Date(timestampMs(ts)).toISOString();
|
|
7
8
|
// round()::bigint keeps exact milliseconds on servers where extract() returns a float (PG ≤ 13).
|
|
8
9
|
const epochMs = `round(extract(epoch from ${q(c.ts)}) * 1000)::bigint`;
|
|
10
|
+
const signedAge = `${q(c.attributes)}->'_xp'->'unitAgeMs' AS "unitAgeMs"`;
|
|
11
|
+
function knownAge(unitAgeMs) {
|
|
12
|
+
// A reissued legacy ID counts as known and older than the rapid activity window.
|
|
13
|
+
if (unitAgeMs === 'legacy') return {
|
|
14
|
+
unitAgeMs: Infinity
|
|
15
|
+
};
|
|
16
|
+
return typeof unitAgeMs === 'number' && Number.isSafeInteger(unitAgeMs) && unitAgeMs >= 0 ? {
|
|
17
|
+
unitAgeMs
|
|
18
|
+
} : {};
|
|
19
|
+
}
|
|
9
20
|
function phaseFilter({ experimentId, phase, endedAt }, type) {
|
|
10
21
|
const params = [
|
|
11
22
|
experimentId,
|
|
@@ -24,11 +35,12 @@ function phaseFilter({ experimentId, phase, endedAt }, type) {
|
|
|
24
35
|
}
|
|
25
36
|
/** All phase exposures, including multi-arm rows for firstExposures to exclude. */ export async function phaseExposureRows(exec, opts) {
|
|
26
37
|
const filter = phaseFilter(opts, 'exposure');
|
|
27
|
-
const { rows } = await exec.query(`SELECT ${q(c.unitId)} AS "unitId", ${q(c.arm)} AS "arm", ${epochMs} AS "ts" FROM ${qualifiedTable(exec, TABLES.events)} WHERE ${filter.text} ORDER BY ${q(c.ts)}, ${q(c.unitId)}`, filter.params);
|
|
38
|
+
const { rows } = await exec.query(`SELECT ${q(c.unitId)} AS "unitId", ${q(c.arm)} AS "arm", ${epochMs} AS "ts", ${signedAge} FROM ${qualifiedTable(exec, TABLES.events)} WHERE ${filter.text} ORDER BY ${q(c.ts)}, ${q(c.unitId)}`, filter.params);
|
|
28
39
|
return rows.map((row)=>({
|
|
29
40
|
unitId: row.unitId,
|
|
30
41
|
arm: row.arm,
|
|
31
|
-
ts: Number(row.ts)
|
|
42
|
+
ts: Number(row.ts),
|
|
43
|
+
...knownAge(row.unitAgeMs)
|
|
32
44
|
}));
|
|
33
45
|
}
|
|
34
46
|
/** Diagnostic distinct units only; this never contributes to multi-arm exclusion. */ export async function armMismatchCount(exec, opts) {
|
|
@@ -52,7 +64,7 @@ function phaseFilter({ experimentId, phase, endedAt }, type) {
|
|
|
52
64
|
/** events:<name> conversion rows in [from, to). Choose unitIds for stored unit_id,
|
|
53
65
|
* or userIds for stored user_id (user units and visitor identity credit). Each distinct
|
|
54
66
|
* ID occurs in one ANY array of at most 10,000, so batching cannot duplicate rows.
|
|
55
|
-
*/ export async function metricEventRows(exec, { eventName, unitIds, userIds, from, to }) {
|
|
67
|
+
*/ export async function metricEventRows(exec, { eventName, unitIds, userIds, from, to, readAge = false, forVisitors = false }) {
|
|
56
68
|
if (unitIds !== undefined && userIds !== undefined) throw new RangeError('Choose unitIds or userIds');
|
|
57
69
|
const params = [
|
|
58
70
|
'conversion',
|
|
@@ -60,7 +72,10 @@ function phaseFilter({ experimentId, phase, endedAt }, type) {
|
|
|
60
72
|
iso(from),
|
|
61
73
|
iso(to)
|
|
62
74
|
];
|
|
63
|
-
|
|
75
|
+
// A browser conversion without a visitor cookie cannot count for a visitor,
|
|
76
|
+
// even through the separate linked-user lookup.
|
|
77
|
+
const visitorFilter = forVisitors ? ` AND ${q(c.dedupeKey)} NOT LIKE '${USER_BROWSER_CONVERSION_PREFIX}%'` : '';
|
|
78
|
+
const text = `SELECT ${q(c.unitId)} AS "unitId", ${q(c.userId)} AS "userId", ${q(c.value)} AS "value", ${epochMs} AS "ts"${readAge ? `, ${signedAge}` : ''} FROM ${qualifiedTable(exec, TABLES.events)} WHERE ${q(c.type)} = $1 AND ${q(c.eventName)} = $2 AND ${q(c.ts)} >= $3 AND ${q(c.ts)} < $4${visitorFilter}`;
|
|
64
79
|
const filterIds = userIds ?? unitIds;
|
|
65
80
|
const column = userIds === undefined ? c.unitId : c.userId;
|
|
66
81
|
const ids = filterIds === undefined ? undefined : [
|
|
@@ -77,7 +92,8 @@ function phaseFilter({ experimentId, phase, endedAt }, type) {
|
|
|
77
92
|
unitId: row.unitId,
|
|
78
93
|
userId: row.userId == null ? null : String(row.userId),
|
|
79
94
|
value: Number(row.value),
|
|
80
|
-
ts: Number(row.ts)
|
|
95
|
+
ts: Number(row.ts),
|
|
96
|
+
...knownAge(row.unitAgeMs)
|
|
81
97
|
});
|
|
82
98
|
}
|
|
83
99
|
if (ids === undefined) break;
|
package/dist/db/snapshots.d.ts
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type PayloadRequest } from 'payload';
|
|
2
|
+
/** Validate advisory-read metadata language; placement discovery still scans all languages. */
|
|
3
|
+
export declare function contentLocale(req: PayloadRequest): {
|
|
4
|
+
locale: string | null | undefined;
|
|
5
|
+
fallbackLocale: false | "none" | "false" | "null" | ({} & string) | ({} & string)[] | null | undefined;
|
|
6
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { sanitizeFallbackLocale } from 'payload';
|
|
2
|
+
/** Validate advisory-read metadata language; placement discovery still scans all languages. */ export function contentLocale(req) {
|
|
3
|
+
const localization = req.payload.config.localization;
|
|
4
|
+
const requested = new URL(req.url ?? 'http://xp.invalid').searchParams.get('locale') ?? req.locale;
|
|
5
|
+
const locale = localization ? localization.localeCodes.includes(requested ?? '') ? requested : localization.defaultLocale : undefined;
|
|
6
|
+
const fallbackLocale = localization ? sanitizeFallbackLocale({
|
|
7
|
+
fallbackLocale: req.fallbackLocale ?? null,
|
|
8
|
+
locale: locale,
|
|
9
|
+
localization
|
|
10
|
+
}) : req.fallbackLocale;
|
|
11
|
+
return {
|
|
12
|
+
locale,
|
|
13
|
+
fallbackLocale
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type PayloadRequest } from 'payload';
|
|
2
|
+
import type { EndpointContext } from '../types/endpoints.js';
|
|
3
|
+
/** Advisory read only. Delete keeps its own access check, status guard and transaction. */
|
|
4
|
+
export declare function handleDeleteImpact<TUser extends {
|
|
5
|
+
id: string | number;
|
|
6
|
+
}>(req: PayloadRequest, { options }: EndpointContext<TUser>): Promise<Response>;
|