@delmaredigital/payload-experiments 0.4.0-rc.2 → 0.4.0-rc.4
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 +283 -775
- 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.js +2 -2
- package/dist/admin/TestsNavLink.js +2 -2
- package/dist/admin/blocks/BlockPanel.js +3 -3
- package/dist/admin/blocks/TestBlockField.js +3 -3
- package/dist/admin/blocks/formApi.js +1 -1
- package/dist/admin/blocks/model.js +1 -1
- package/dist/admin/blocks/statusCache.js +1 -1
- package/dist/admin/components/RootViewMessage.js +1 -1
- package/dist/admin/copy/blocks.d.ts +2 -2
- package/dist/admin/copy/blocks.js +3 -2
- package/dist/admin/copy/goals.d.ts +6 -1
- package/dist/admin/copy/goals.js +10 -3
- package/dist/admin/goals/XpGoalField.js +155 -129
- package/dist/admin/goals/xpGoalField.css +2 -3
- package/dist/admin/status.model.js +1 -1
- package/dist/admin/surface/ResultsRoute.d.ts +2 -1
- package/dist/admin/surface/ResultsRoute.js +4 -3
- package/dist/admin/surface/SurfaceShell.js +2 -2
- package/dist/admin/surface/TestsHome.d.ts +1 -1
- package/dist/admin/surface/TestsHome.js +3 -3
- package/dist/admin/surface/TestsSurface.js +2 -2
- package/dist/admin/surface/goals/GoalForm.d.ts +1 -1
- package/dist/admin/surface/goals/GoalForm.js +69 -15
- package/dist/admin/surface/goals/GoalsList.d.ts +1 -1
- package/dist/admin/surface/goals/GoalsList.js +4 -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 +1 -1
- package/dist/admin/surface/home.model.js +5 -5
- package/dist/admin/surface/newTest/NewTest.d.ts +1 -1
- package/dist/admin/surface/newTest/NewTest.js +1 -1
- package/dist/admin/surface/newTest/PageWizard.d.ts +1 -1
- package/dist/admin/surface/newTest/PageWizard.js +13 -13
- package/dist/admin/surface/results/ResultsHeader.d.ts +2 -2
- package/dist/admin/surface/results/ResultsHeader.js +8 -8
- package/dist/admin/surface/test/TestPage.d.ts +1 -2
- package/dist/admin/surface/test/TestPage.js +45 -156
- package/dist/admin/views/ExperimentsRootView.js +1 -1
- package/dist/admin/views/TestsNavLinkServer.js +1 -1
- package/dist/admin/views/renderCollectionList.js +1 -1
- package/dist/admin/views/renderTestsSurface.js +1 -1
- package/dist/blocks/placementLocale.d.ts +21 -0
- package/dist/blocks/placementLocale.js +115 -0
- package/dist/collections/experiments/config.js +1 -1
- package/dist/collections/metrics.js +1 -1
- package/dist/db/bulkPlacementRemoval.d.ts +30 -0
- package/dist/db/bulkPlacementRemoval.js +107 -0
- package/dist/db/placements.d.ts +2 -0
- package/dist/db/placements.js +8 -0
- package/dist/endpoints/editorSurface.d.ts +3 -0
- package/dist/endpoints/editorSurface.js +31 -0
- package/dist/endpoints/index.js +28 -1
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +2 -0
- package/dist/fields/xpGoal.js +1 -1
- 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.js +3 -2
- package/dist/hooks/blockRemovalRule.d.ts +29 -0
- package/dist/hooks/blockRemovalRule.js +141 -0
- package/dist/hooks/pageGuard.d.ts +24 -2
- package/dist/hooks/pageGuard.js +178 -24
- package/dist/hooks/puckGoals.d.ts +2 -0
- package/dist/hooks/puckGoals.js +34 -10
- package/dist/lib/placementPages.d.ts +9 -0
- package/dist/{admin/previewLinks.model.js → lib/placementPages.js} +1 -4
- package/dist/onInit.js +22 -0
- package/dist/plugin.js +2 -1
- package/dist/puck/ExperimentPicker.js +25 -10
- package/dist/puck/copy.d.ts +4 -1
- package/dist/puck/copy.js +4 -1
- package/dist/puck/editor/ConfigureTestDrawer.d.ts +21 -0
- package/dist/puck/editor/ConfigureTestDrawer.js +147 -0
- package/dist/puck/editor/CreateExperimentDrawer.d.ts +11 -2
- package/dist/puck/editor/CreateExperimentDrawer.js +69 -9
- package/dist/puck/editor/EditorControls.d.ts +14 -0
- package/dist/puck/editor/EditorControls.js +99 -0
- package/dist/puck/editor/ExperimentSlotEditor.js +317 -51
- package/dist/puck/editor/ResultsReadout.js +3 -5
- package/dist/puck/editor/VersionBuilder.js +2 -2
- package/dist/puck/editor/armsCache.d.ts +3 -1
- package/dist/puck/editor/armsCache.js +20 -3
- package/dist/puck/editor/copy.d.ts +18 -2
- package/dist/puck/editor/copy.js +19 -3
- package/dist/puck/editor/editor.chrome.css +33 -0
- package/dist/puck/editor/editor.css +39 -0
- package/dist/puck/editor/editor.model.d.ts +14 -0
- package/dist/puck/editor/editor.model.js +58 -1
- package/dist/puck/editor/editorSurface.d.ts +10 -0
- package/dist/puck/editor/editorSurface.js +65 -0
- package/dist/puck/editor/localPlacements.d.ts +2 -0
- package/dist/puck/editor/localPlacements.js +29 -0
- package/dist/puck/editor/placementsCache.d.ts +19 -0
- package/dist/puck/editor/placementsCache.js +83 -0
- package/dist/puck/editor/xpGoalPuckEditorField.js +109 -98
- package/dist/puck/experimentSlotField.d.ts +3 -0
- package/dist/puck/experimentSlotField.js +15 -4
- package/dist/{admin → testSurface}/actions/DecideDialog.d.ts +2 -1
- package/dist/{admin → testSurface}/actions/DecideDialog.js +6 -4
- package/dist/{admin → testSurface}/api.js +4 -5
- package/dist/{admin → testSurface}/copy/common.d.ts +2 -0
- package/dist/{admin → testSurface}/copy/common.js +2 -0
- package/dist/{admin → testSurface}/copy/readiness.d.ts +3 -0
- package/dist/{admin → testSurface}/copy/readiness.js +3 -0
- package/dist/{admin → testSurface}/copy/testPage.d.ts +3 -0
- package/dist/{admin → testSurface}/copy/testPage.js +7 -2
- package/dist/testSurface/format/adminURL.d.ts +7 -0
- package/dist/testSurface/format/adminURL.js +9 -0
- package/dist/{admin → testSurface}/placements/placementLabels.js +1 -1
- package/dist/{admin → testSurface}/previewLinks.model.d.ts +1 -6
- package/dist/testSurface/previewLinks.model.js +4 -0
- package/dist/testSurface/results/results.css +64 -0
- package/dist/{admin → testSurface}/surface/contracts.d.ts +1 -0
- package/dist/{admin → testSurface}/surface/pageBlock/parts.js +6 -6
- package/dist/testSurface/surface/pagePicker/pagePicker.css +10 -0
- package/dist/{admin → testSurface}/surface/readiness/useTransition.js +1 -0
- package/dist/{admin → testSurface}/surface/results/ResultsBody.d.ts +2 -2
- package/dist/{admin → testSurface}/surface/results/ResultsBody.js +18 -11
- package/dist/testSurface/surface/setting/setting.css +17 -0
- package/dist/testSurface/surface/test/GoalSection.d.ts +4 -0
- package/dist/{admin → testSurface}/surface/test/GoalSection.js +3 -2
- package/dist/{admin → testSurface}/surface/test/Section.js +9 -8
- package/dist/testSurface/surface/test/TestSurface.d.ts +18 -0
- package/dist/testSurface/surface/test/TestSurface.js +152 -0
- package/dist/testSurface/surface/test/VersionsSection.d.ts +5 -0
- package/dist/{admin → testSurface}/surface/test/VersionsSection.js +12 -6
- package/dist/testSurface/surface/test/testPage.css +92 -0
- package/dist/{admin → testSurface}/surface/useTestDocument.d.ts +5 -1
- package/dist/{admin → testSurface}/surface/useTestDocument.js +34 -3
- package/dist/{admin → testSurface}/surfaceUrls.js +1 -1
- package/dist/transitions/placementInteractions.js +1 -1
- package/dist/transitions/placements.d.ts +27 -8
- package/dist/transitions/placements.js +77 -6
- package/dist/transitions/start.js +2 -2
- package/dist/types/endpoints.d.ts +1 -1
- package/dist/ui/Dialog.d.ts +4 -1
- package/dist/ui/Dialog.js +41 -3
- package/dist/ui/Drawer.d.ts +10 -0
- package/dist/ui/Drawer.js +29 -0
- package/dist/ui/Tabs.d.ts +3 -3
- package/dist/ui/Tabs.js +35 -33
- package/dist/ui/ui.css +6 -0
- package/package.json +1 -1
- package/dist/admin/actions/ConfirmDialog.d.ts +0 -19
- package/dist/admin/actions/ConfirmDialog.js +0 -149
- 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/pagePicker/pagePicker.css +0 -10
- package/dist/admin/surface/setting/setting.css +0 -17
- package/dist/admin/surface/test/GoalSection.d.ts +0 -2
- package/dist/admin/surface/test/VersionsSection.d.ts +0 -4
- package/dist/admin/surface/test/testPage.css +0 -92
- /package/dist/{admin → testSurface}/PreviewLinks.d.ts +0 -0
- /package/dist/{admin → testSurface}/PreviewLinks.js +0 -0
- /package/dist/{admin → testSurface}/actions/MakeContentResult.d.ts +0 -0
- /package/dist/{admin → testSurface}/actions/MakeContentResult.js +0 -0
- /package/dist/{admin → testSurface}/actions/actions.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/actions/actions.model.js +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}/api.d.ts +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/actions.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/actions.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/metrics.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/metrics.js +0 -0
- /package/dist/{admin → testSurface}/copy/pages.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/pages.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/results.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/results.js +0 -0
- /package/dist/{admin → testSurface}/copy/review.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/review.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}/copy/surface.d.ts +0 -0
- /package/dist/{admin → testSurface}/copy/surface.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.d.ts +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/VerdictHero.d.ts +0 -0
- /package/dist/{admin → testSurface}/results/VerdictHero.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/results.model.js +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/pageBlock.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/pageBlock/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/CopyRoute.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/CopyRoute.js +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/PageCombobox.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/PageCombobox.js +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/pagePicker/pagePicker.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/ActionDialogs.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/ActionDialogs.js +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/Banner.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/Banner.js +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/SaveStatus.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/SaveStatus.js +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/parts.js +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/readiness.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/readiness.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/readiness/useTransition.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/results/ReleasePages.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/results/ReleasePages.js +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/results/useResults.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/results/useResults.js +0 -0
- /package/dist/{admin → testSurface}/surface/setting/parts.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/setting/parts.js +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/AdvancedSection.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/LengthSection.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/LengthSection.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/PageHoldout.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/PageHoldout.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/Rail.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/Rail.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/ReadinessBar.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/ReadinessBar.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/Section.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/TargetingSection.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/TargetingSection.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/fields.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/fields.js +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}/surface/test/pageParts.js +0 -0
- /package/dist/{admin → testSurface}/surface/test/testPage.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/test/testPage.model.js +0 -0
- /package/dist/{admin → testSurface}/surface/testDocument.model.d.ts +0 -0
- /package/dist/{admin → testSurface}/surface/testDocument.model.js +0 -0
- /package/dist/{admin → testSurface}/surfaceUrls.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.d.ts +0 -0
- /package/dist/{admin → testSurface}/useApi.js +0 -0
package/dist/endpoints/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { handleEditorSurface } from './editorSurface.js';
|
|
1
2
|
import { handleClickKeys } from './clickKeys.js';
|
|
2
3
|
import { createHmac, timingSafeEqual } from 'node:crypto';
|
|
3
4
|
import { XP_MANIFEST_KEY_HEADER } from '../constants.js';
|
|
@@ -146,9 +147,15 @@ export const ROUTES = [
|
|
|
146
147
|
path: '/xp/placements/status',
|
|
147
148
|
access: 'manage',
|
|
148
149
|
handler: handlePlacementStatus
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
method: 'get',
|
|
153
|
+
path: '/xp/editor-surface',
|
|
154
|
+
access: 'surface',
|
|
155
|
+
handler: handleEditorSurface
|
|
149
156
|
}
|
|
150
157
|
];
|
|
151
|
-
function
|
|
158
|
+
function endpointError(status, code, message, detail) {
|
|
152
159
|
return Response.json({
|
|
153
160
|
errors: [
|
|
154
161
|
{
|
|
@@ -172,6 +179,11 @@ export function buildEndpoints(ctx) {
|
|
|
172
179
|
const handlerContext = {
|
|
173
180
|
options
|
|
174
181
|
};
|
|
182
|
+
const error = (status, code, message, detail)=>{
|
|
183
|
+
const response = endpointError(status, code, message, detail);
|
|
184
|
+
if (route.access === 'surface') response.headers.set('Cache-Control', 'private, no-store');
|
|
185
|
+
return response;
|
|
186
|
+
};
|
|
175
187
|
try {
|
|
176
188
|
if (route.access === 'manage' || route.access === 'readResults') {
|
|
177
189
|
if (!req.user) return error(401, 'unauthenticated', 'Authentication required');
|
|
@@ -179,6 +191,21 @@ export function buildEndpoints(ctx) {
|
|
|
179
191
|
if (await access({
|
|
180
192
|
req
|
|
181
193
|
}) !== true) return error(403, 'forbidden', 'Access denied');
|
|
194
|
+
} else if (route.access === 'surface') {
|
|
195
|
+
if (!req.user) return error(401, 'unauthenticated', 'Authentication required');
|
|
196
|
+
// Match the admin surface: a failed host access check denies that permission.
|
|
197
|
+
const permits = async (access)=>{
|
|
198
|
+
try {
|
|
199
|
+
return await access({
|
|
200
|
+
req
|
|
201
|
+
}) === true;
|
|
202
|
+
} catch {
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
const manage = await permits(options.access.manage);
|
|
207
|
+
const read = options.access.readResults ? await permits(options.access.readResults) : manage;
|
|
208
|
+
if (!manage && !read) return error(403, 'forbidden', 'Access denied');
|
|
182
209
|
} else if (route.access === 'manifestKey') {
|
|
183
210
|
const secret = options.runtime.proxyRuntime.secrets[0];
|
|
184
211
|
if (!secret) return error(401, 'unauthenticated', 'Invalid manifest key');
|
package/dist/errors.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export declare class XpRefusal extends Error {
|
|
|
22
22
|
readonly detail: unknown | undefined;
|
|
23
23
|
readonly status: 409 | 413 | 422 | 500 | 404;
|
|
24
24
|
name: string;
|
|
25
|
+
readonly isOperational = true;
|
|
25
26
|
readonly isPublic = true;
|
|
26
27
|
constructor(code: RefusalCode, message: string, detail: unknown | undefined, status: 409 | 413 | 422 | 500 | 404, options?: ErrorOptions);
|
|
27
28
|
}
|
package/dist/errors.js
CHANGED
|
@@ -26,6 +26,8 @@ export class XpRefusal extends Error {
|
|
|
26
26
|
detail;
|
|
27
27
|
status;
|
|
28
28
|
name = 'XpRefusal';
|
|
29
|
+
// Payload-compatible marker used by Puck's public-error response mapper.
|
|
30
|
+
isOperational = true;
|
|
29
31
|
isPublic = true;
|
|
30
32
|
constructor(code, message, detail, status, options){
|
|
31
33
|
super(message, options), this.code = code, this.detail = detail, this.status = status;
|
package/dist/fields/xpGoal.js
CHANGED
|
@@ -6,7 +6,7 @@ import { validateClickGoal } from '../goals/validate.js';
|
|
|
6
6
|
label: 'Click goal',
|
|
7
7
|
type: 'text',
|
|
8
8
|
admin: {
|
|
9
|
-
description: 'Choose the
|
|
9
|
+
description: 'Choose the click goal to count here.',
|
|
10
10
|
components: {
|
|
11
11
|
Field: XP_GOAL_FIELD
|
|
12
12
|
}
|
|
@@ -8,7 +8,14 @@ export type PickerStatus = 'loading' | 'ready' | 'not-manager' | 'error';
|
|
|
8
8
|
export declare function goalSlug(name: string): string;
|
|
9
9
|
export declare function clickGoalSlug(name: string): string;
|
|
10
10
|
export declare function definedClickGoals(rows: readonly ClickGoal[]): ClickGoal[];
|
|
11
|
-
|
|
11
|
+
/** Keep legacy values visible without changing stored data during a read. */
|
|
12
|
+
export declare function clickGoalOptions(status: PickerStatus, goals: readonly ClickGoal[], value: string): {
|
|
13
|
+
options: {
|
|
14
|
+
value: string;
|
|
15
|
+
label: string;
|
|
16
|
+
}[];
|
|
17
|
+
missing: boolean;
|
|
18
|
+
};
|
|
12
19
|
export declare function clickGoalBody(name: string, slug: string): {
|
|
13
20
|
name: string;
|
|
14
21
|
slug: string;
|
|
@@ -9,8 +9,26 @@ export function clickGoalSlug(name) {
|
|
|
9
9
|
export function definedClickGoals(rows) {
|
|
10
10
|
return rows.filter((row)=>isClickSource(row.source));
|
|
11
11
|
}
|
|
12
|
-
export function
|
|
13
|
-
|
|
12
|
+
/** Keep legacy values visible without changing stored data during a read. */ export function clickGoalOptions(status, goals, value) {
|
|
13
|
+
const missing = status === 'ready' && Boolean(value) && !goals.some((goal)=>goal.slug === value);
|
|
14
|
+
const options = [
|
|
15
|
+
{
|
|
16
|
+
value: '',
|
|
17
|
+
label: C.none
|
|
18
|
+
},
|
|
19
|
+
...goals.map((goal)=>({
|
|
20
|
+
value: goal.slug,
|
|
21
|
+
label: goal.name
|
|
22
|
+
}))
|
|
23
|
+
];
|
|
24
|
+
if (value && !goals.some((goal)=>goal.slug === value)) options.push({
|
|
25
|
+
value,
|
|
26
|
+
label: missing ? `${value} (missing)` : value
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
options,
|
|
30
|
+
missing
|
|
31
|
+
};
|
|
14
32
|
}
|
|
15
33
|
export function clickGoalBody(name, slug) {
|
|
16
34
|
return {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/** Shared by Payload's field and the Puck sidebar, without either UI dependency. */
|
|
2
2
|
export declare const CLICK_GOAL_COPY: {
|
|
3
3
|
readonly label: "Click goal";
|
|
4
|
-
readonly
|
|
4
|
+
readonly none: "No click goal";
|
|
5
|
+
readonly loadError: "Couldn't load goals. Try again.";
|
|
6
|
+
readonly retry: "Try again";
|
|
5
7
|
readonly newGoal: "+ New click goal";
|
|
6
8
|
readonly title: "New click goal";
|
|
7
9
|
readonly name: "Name";
|
|
@@ -9,8 +11,10 @@ export declare const CLICK_GOAL_COPY: {
|
|
|
9
11
|
readonly advanced: "Advanced";
|
|
10
12
|
readonly createGoal: "Create goal";
|
|
11
13
|
readonly cancel: "Cancel";
|
|
12
|
-
readonly undefinedKey: "
|
|
14
|
+
readonly undefinedKey: "This click goal is missing. Choose another goal or “No click goal”.";
|
|
15
|
+
readonly invalidKey: "Use a click goal short name.";
|
|
13
16
|
readonly slugRule: "Use 1–64 lowercase letters, numbers, underscores or hyphens, starting with a letter or number.";
|
|
14
17
|
readonly duplicateSlug: "Another goal already uses this short name. Change it under Advanced.";
|
|
15
18
|
readonly saveError: "Couldn't save the goal. Try again.";
|
|
16
19
|
};
|
|
20
|
+
export declare function puckGoalRefusal(rawKey: string, block: string, malformed: boolean, more?: number): string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/** Shared by Payload's field and the Puck sidebar, without either UI dependency. */ export const CLICK_GOAL_COPY = {
|
|
2
2
|
label: 'Click goal',
|
|
3
|
-
|
|
3
|
+
none: 'No click goal',
|
|
4
|
+
loadError: "Couldn't load goals. Try again.",
|
|
5
|
+
retry: 'Try again',
|
|
4
6
|
newGoal: '+ New click goal',
|
|
5
7
|
title: 'New click goal',
|
|
6
8
|
name: 'Name',
|
|
@@ -8,8 +10,15 @@
|
|
|
8
10
|
advanced: 'Advanced',
|
|
9
11
|
createGoal: 'Create goal',
|
|
10
12
|
cancel: 'Cancel',
|
|
11
|
-
undefinedKey: '
|
|
13
|
+
undefinedKey: 'This click goal is missing. Choose another goal or “No click goal”.',
|
|
14
|
+
invalidKey: 'Use a click goal short name.',
|
|
12
15
|
slugRule: 'Use 1–64 lowercase letters, numbers, underscores or hyphens, starting with a letter or number.',
|
|
13
16
|
duplicateSlug: 'Another goal already uses this short name. Change it under Advanced.',
|
|
14
17
|
saveError: "Couldn't save the goal. Try again."
|
|
15
18
|
};
|
|
19
|
+
export function puckGoalRefusal(rawKey, block, malformed, more = 0) {
|
|
20
|
+
// A malformed key can be any length; keep the dialog readable.
|
|
21
|
+
const key = rawKey.length > 64 ? `${rawKey.slice(0, 64)}…` : rawKey;
|
|
22
|
+
const sentence = malformed ? `Click goal "${key}" on the ${block} block isn't a valid short name. Use lowercase letters, numbers, - and _, then publish.` : `Click goal "${key}" doesn't exist yet. Create it with "+ New click goal" on the ${block} block, then publish.`;
|
|
23
|
+
return sentence + (more > 0 ? ` (and ${more} more)` : '');
|
|
24
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { fetchAllDocs } from '../../lib/fetchAllDocs.js';
|
|
4
4
|
import { CLICK_KEY } from '../key.js';
|
|
5
|
-
import { clickGoalBody, clickGoalCreateError, clickGoalSlug, definedClickGoals
|
|
5
|
+
import { clickGoalBody, clickGoalCreateError, clickGoalSlug, definedClickGoals } from './clickGoalPicker.model.js';
|
|
6
6
|
const goalLists = new Map();
|
|
7
7
|
function publish(list, state) {
|
|
8
8
|
// A read may finish after its last row unmounts and a new list has started.
|
|
@@ -180,7 +180,9 @@ const emptyPanel = ()=>({
|
|
|
180
180
|
status,
|
|
181
181
|
goals,
|
|
182
182
|
canManage,
|
|
183
|
-
|
|
183
|
+
retry: ()=>{
|
|
184
|
+
loadGoals(api);
|
|
185
|
+
},
|
|
184
186
|
panel,
|
|
185
187
|
open: ()=>{
|
|
186
188
|
if (canManage) setPanel({
|
package/dist/goals/validate.js
CHANGED
|
@@ -2,13 +2,14 @@ import { definedClickKeys } from '../db/clickGoals.js';
|
|
|
2
2
|
import { pooledExecutor } from '../db/executor.js';
|
|
3
3
|
import { clickKeys } from './cache.js';
|
|
4
4
|
import { CLICK_KEY } from './key.js';
|
|
5
|
+
import { CLICK_GOAL_COPY } from './picker/copy.js';
|
|
5
6
|
/** Shared publish validation for Payload fields and Puck JSON props. */ export async function validateClickGoal(value, req) {
|
|
6
7
|
if (!value) return true;
|
|
7
|
-
if (!CLICK_KEY.test(value)) return
|
|
8
|
+
if (!CLICK_KEY.test(value)) return CLICK_GOAL_COPY.invalidKey;
|
|
8
9
|
const options = req.payload.config.custom?.xp;
|
|
9
10
|
if (!options || await options.access.manage({
|
|
10
11
|
req
|
|
11
12
|
}) !== true) return true;
|
|
12
13
|
const keys = await clickKeys(req.payload);
|
|
13
|
-
return !keys || keys.has(value) || (await definedClickKeys(pooledExecutor(req.payload))).has(value) ||
|
|
14
|
+
return !keys || keys.has(value) || (await definedClickKeys(pooledExecutor(req.payload))).has(value) || CLICK_GOAL_COPY.undefinedKey;
|
|
14
15
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { PayloadRequest } from 'payload';
|
|
2
|
+
import type { Executor } from '../db/executor.js';
|
|
3
|
+
import { type PlacementTest } from '../db/placements.js';
|
|
4
|
+
import { type BulkPlacementRemoval } from '../db/bulkPlacementRemoval.js';
|
|
5
|
+
import { type RemovedPlacementViews } from '../blocks/placementLocale.js';
|
|
6
|
+
import type { DocId } from '../types/contracts.js';
|
|
7
|
+
export type RemovalClaims = {
|
|
8
|
+
transaction: unknown;
|
|
9
|
+
tests: Map<string, Set<string>>;
|
|
10
|
+
counts?: Map<string, Map<string, number>>;
|
|
11
|
+
absent?: Set<string>;
|
|
12
|
+
};
|
|
13
|
+
export declare function releaseRemovalClaim(req: PayloadRequest, collection: string, id: DocId, ownKeys?: Map<string, Set<string>>): void;
|
|
14
|
+
/** A removal must have reached afterChange before a later write can restore it.
|
|
15
|
+
* A write merely retaining another locale cannot clear an in-flight removal.
|
|
16
|
+
*/
|
|
17
|
+
export declare function observeUnpublishedRemoval(req: PayloadRequest, collection: string, id: DocId): void;
|
|
18
|
+
export declare function releaseRestoredRemovalClaims(req: PayloadRequest, collection: string, doc: Record<string, unknown> & {
|
|
19
|
+
id: DocId;
|
|
20
|
+
}, test: PlacementTest): void;
|
|
21
|
+
export declare const blockRemovalRule: {
|
|
22
|
+
prepare(req: PayloadRequest, collection: string, before: Record<string, unknown> | undefined, after: Record<string, unknown>, removingPage: boolean, exec?: Executor, tests?: readonly PlacementTest[]): Promise<{
|
|
23
|
+
views: RemovedPlacementViews;
|
|
24
|
+
affected: PlacementTest[];
|
|
25
|
+
}>;
|
|
26
|
+
discover(exec: Executor, removed: string[], tests?: readonly PlacementTest[]): Promise<PlacementTest[]>;
|
|
27
|
+
claim(req: PayloadRequest, transaction: unknown, affected: readonly PlacementTest[], collection: string, id: DocId, views: RemovedPlacementViews): RemovalClaims;
|
|
28
|
+
check(req: PayloadRequest, current: readonly PlacementTest[], affected: readonly PlacementTest[], collection: string, id: DocId, removingPage: boolean, views: RemovedPlacementViews, bulk?: BulkPlacementRemoval): Promise<void>;
|
|
29
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { removableBlockTests } from '../db/placements.js';
|
|
2
|
+
import { XpNoTransactionError, XpRefusal } from '../errors.js';
|
|
3
|
+
import { lastBlockPlacementCopy, pendingBlockRemovalCopy, bulkBlockRemovalCopy } from '../testSurface/copy/readiness.js';
|
|
4
|
+
import { hasOtherPublishedBlockPlacement } from '../transitions/placements.js';
|
|
5
|
+
import { bulkRemoves } from '../db/bulkPlacementRemoval.js';
|
|
6
|
+
import { localeRequest, placementLocaleContent, removedPlacementViews, placementDocumentKey } from '../blocks/placementLocale.js';
|
|
7
|
+
import { placementSlugs } from '../blocks/bindings.js';
|
|
8
|
+
export function releaseRemovalClaim(req, collection, id, ownKeys) {
|
|
9
|
+
const claims = req.context.xpPlacementRemovals;
|
|
10
|
+
for (const [test, documents] of claims?.tests ?? [])for (const key of documents){
|
|
11
|
+
const [slug, docId] = JSON.parse(key);
|
|
12
|
+
if (slug !== collection || docId !== String(id) || ownKeys && !ownKeys.get(test)?.has(key)) continue;
|
|
13
|
+
const count = claims?.counts?.get(test)?.get(key) ?? 1;
|
|
14
|
+
if (ownKeys && count > 1) claims.counts.get(test).set(key, count - 1);
|
|
15
|
+
else {
|
|
16
|
+
documents.delete(`${key}`);
|
|
17
|
+
claims?.counts?.get(test)?.delete(`${key}`);
|
|
18
|
+
claims?.absent?.delete(`${test}:${key}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** A removal must have reached afterChange before a later write can restore it.
|
|
23
|
+
* A write merely retaining another locale cannot clear an in-flight removal.
|
|
24
|
+
*/ export function observeUnpublishedRemoval(req, collection, id) {
|
|
25
|
+
const claims = req.context.xpPlacementRemovals;
|
|
26
|
+
if (!claims) return;
|
|
27
|
+
claims.absent ??= new Set();
|
|
28
|
+
for (const [test, documents] of claims.tests)for (const key of documents){
|
|
29
|
+
const [slug, docId] = JSON.parse(key);
|
|
30
|
+
if (slug === collection && docId === String(id)) claims.absent.add(`${test}:${key}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export function releaseRestoredRemovalClaims(req, collection, doc, test) {
|
|
34
|
+
const claims = req.context.xpPlacementRemovals;
|
|
35
|
+
if (!claims) return;
|
|
36
|
+
claims.absent ??= new Set();
|
|
37
|
+
for (const key of claims.tests.get(String(test.id)) ?? []){
|
|
38
|
+
const [slug, id, view] = JSON.parse(key);
|
|
39
|
+
if (slug !== collection || id !== String(doc.id)) continue;
|
|
40
|
+
const marker = `${test.id}:${key}`;
|
|
41
|
+
if (!placementSlugs(req.payload.config.custom.xp, collection, placementLocaleContent(localeRequest(req, view), collection, doc)).includes(test.slug)) claims.absent.add(marker);
|
|
42
|
+
else if (claims.absent.has(marker) && (claims.counts?.get(String(test.id))?.get(key) ?? 1) === 1) {
|
|
43
|
+
claims.tests.get(String(test.id)).delete(`${key}`);
|
|
44
|
+
claims.counts?.get(String(test.id))?.delete(`${key}`);
|
|
45
|
+
claims.absent.delete(`${marker}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
// Separate removal-rule entry points let tests observe its IO independently
|
|
50
|
+
// of the earlier page-path and publish guards.
|
|
51
|
+
export const blockRemovalRule = {
|
|
52
|
+
async prepare (req, collection, before, after, removingPage, exec, tests) {
|
|
53
|
+
const views = removedPlacementViews(req, collection, before, after, removingPage);
|
|
54
|
+
const affected = views.size ? await blockRemovalRule.discover(exec, [
|
|
55
|
+
...views.keys()
|
|
56
|
+
], tests) : [];
|
|
57
|
+
return {
|
|
58
|
+
views,
|
|
59
|
+
affected
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
async discover (exec, removed, tests) {
|
|
63
|
+
if (tests) return tests.filter((test)=>test.kind === 'block' && [
|
|
64
|
+
'draft',
|
|
65
|
+
'stopped',
|
|
66
|
+
'running'
|
|
67
|
+
].includes(test.status) && removed.includes(test.slug));
|
|
68
|
+
return (await removableBlockTests(exec, removed)).map((test)=>({
|
|
69
|
+
...test,
|
|
70
|
+
kind: 'block',
|
|
71
|
+
pageCollection: null,
|
|
72
|
+
phase: 0,
|
|
73
|
+
arms: [],
|
|
74
|
+
placementDocs: null
|
|
75
|
+
}));
|
|
76
|
+
},
|
|
77
|
+
claim (req, transaction, affected, collection, id, views) {
|
|
78
|
+
let claims = req.context.xpPlacementRemovals;
|
|
79
|
+
if (!claims) req.context.xpPlacementRemovals = claims = {
|
|
80
|
+
transaction,
|
|
81
|
+
tests: new Map()
|
|
82
|
+
};
|
|
83
|
+
claims.counts ??= new Map();
|
|
84
|
+
claims.absent ??= new Set();
|
|
85
|
+
if (claims.transaction !== transaction) {
|
|
86
|
+
claims.transaction = transaction;
|
|
87
|
+
claims.tests.clear();
|
|
88
|
+
claims.counts.clear();
|
|
89
|
+
claims.absent.clear();
|
|
90
|
+
}
|
|
91
|
+
for (const test of affected){
|
|
92
|
+
const documents = claims.tests.get(String(test.id)) ?? new Set();
|
|
93
|
+
const counts = claims.counts.get(String(test.id)) ?? new Map();
|
|
94
|
+
for (const view of views.get(test.slug) ?? []){
|
|
95
|
+
const key = placementDocumentKey(collection, id, view);
|
|
96
|
+
documents.add(key);
|
|
97
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
98
|
+
}
|
|
99
|
+
claims.tests.set(String(test.id), documents);
|
|
100
|
+
claims.counts.set(String(test.id), counts);
|
|
101
|
+
}
|
|
102
|
+
return claims;
|
|
103
|
+
},
|
|
104
|
+
async check (req, current, affected, collection, id, removingPage, views, bulk) {
|
|
105
|
+
const transaction = await req.transactionID;
|
|
106
|
+
// Claim only after every earlier guard passed. These claims cover subsequent
|
|
107
|
+
// writes; the complete bulk selection covers siblings before any can decide.
|
|
108
|
+
const claims = transaction == null ? undefined : blockRemovalRule.claim(req, transaction, affected, collection, id, views);
|
|
109
|
+
const ownKeys = new Map(affected.map((test)=>[
|
|
110
|
+
String(test.id),
|
|
111
|
+
new Set((views.get(test.slug) ?? []).map((view)=>placementDocumentKey(collection, id, view)))
|
|
112
|
+
]));
|
|
113
|
+
try {
|
|
114
|
+
for (const test of affected){
|
|
115
|
+
if (!current.some((row)=>String(row.id) === String(test.id) && row.kind === 'block' && row.status === 'running')) continue;
|
|
116
|
+
const documents = claims?.tests.get(String(test.id));
|
|
117
|
+
let excludedSibling = false;
|
|
118
|
+
if (await hasOtherPublishedBlockPlacement(req, req.payload.config.custom.xp, test.slug, (slug, docId, view, doc)=>{
|
|
119
|
+
const key = placementDocumentKey(slug, docId, view);
|
|
120
|
+
if (ownKeys.get(String(test.id))?.has(key)) return true;
|
|
121
|
+
if (bulkRemoves(bulk, req, slug, doc, test.slug, view) || documents?.has(key)) {
|
|
122
|
+
excludedSibling = true;
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
return false;
|
|
126
|
+
})) continue;
|
|
127
|
+
if (transaction == null) throw new XpNoTransactionError('Save this page with transactions on.');
|
|
128
|
+
// Bulk selection is immutable through every sibling's decision, including
|
|
129
|
+
// earlier rule refusals. afterOperation explains unrelated failed writes.
|
|
130
|
+
const message = excludedSibling ? bulk ? bulkBlockRemovalCopy(test.name) : pendingBlockRemovalCopy(test.name) : lastBlockPlacementCopy(test.name, removingPage);
|
|
131
|
+
if (bulk && excludedSibling) bulk.refusals.set(message, pendingBlockRemovalCopy(test.name));
|
|
132
|
+
throw new XpRefusal('locked-placement', message, {
|
|
133
|
+
experimentId: test.id
|
|
134
|
+
}, 409);
|
|
135
|
+
}
|
|
136
|
+
} catch (error) {
|
|
137
|
+
releaseRemovalClaim(req, collection, id, ownKeys);
|
|
138
|
+
throw error;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
@@ -1,9 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
import type { CollectionAfterChangeHook, CollectionAfterOperationHook, CollectionBeforeChangeHook, CollectionBeforeDeleteHook, CollectionBeforeOperationHook, PayloadRequest } from 'payload';
|
|
3
|
+
import type { DocId } from '../types/contracts.js';
|
|
2
4
|
import { type PlacementTest } from '../db/placements.js';
|
|
5
|
+
import { type BulkPlacementRemoval } from '../db/bulkPlacementRemoval.js';
|
|
6
|
+
type OperationFrame = {
|
|
7
|
+
collection: string;
|
|
8
|
+
request?: PayloadRequest;
|
|
9
|
+
draft: boolean;
|
|
10
|
+
restore: boolean;
|
|
11
|
+
pending?: boolean;
|
|
12
|
+
scoped?: boolean;
|
|
13
|
+
complete?: boolean;
|
|
14
|
+
detached?: boolean;
|
|
15
|
+
parent?: OperationFrame;
|
|
16
|
+
bulk?: BulkPlacementRemoval;
|
|
17
|
+
};
|
|
18
|
+
export declare const pageGuardOperationScope: AsyncLocalStorage<OperationFrame | undefined>;
|
|
19
|
+
/** Must be first: buildBeforeOperation invokes its first hook synchronously,
|
|
20
|
+
* before the operation registers its await continuation. Later host hooks may
|
|
21
|
+
* await nested operations; those keep separate async contexts. No IO here.
|
|
22
|
+
*/
|
|
23
|
+
export declare const pageGuardEnterOperation: CollectionBeforeOperationHook;
|
|
3
24
|
export declare const pageGuardBeforeOperation: CollectionBeforeOperationHook;
|
|
4
25
|
export declare const pageGuardAfterOperation: CollectionAfterOperationHook;
|
|
5
|
-
export declare function guardExperimentIds(tests: readonly PlacementTest[], slugs: readonly string[], collection: string, paths: readonly string[], held: unknown, tags?: Set<string
|
|
26
|
+
export declare function guardExperimentIds(tests: readonly PlacementTest[], slugs: readonly string[], collection: string, paths: readonly string[], held: unknown, tags?: Set<string>, discovered?: readonly DocId[]): string[];
|
|
6
27
|
export declare const pageGuardBeforeDelete: CollectionBeforeDeleteHook;
|
|
7
28
|
export declare const pageGuardBeforeChange: CollectionBeforeChangeHook;
|
|
8
29
|
/** Unwrapped: these writes must fail the publish closed, unlike the best-effort audit. */
|
|
9
30
|
export declare const pageGuardAfterChange: CollectionAfterChangeHook;
|
|
31
|
+
export {};
|