@delmaredigital/payload-experiments 0.4.0-rc.7 → 0.4.0
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 +9 -15
- package/dist/admin/MetricSourceSelect.js +10 -3
- package/dist/admin/armSelect/armSelect.model.d.ts +1 -1
- package/dist/admin/blocks/BlockPanel.d.ts +1 -0
- package/dist/admin/blocks/BlockPanel.js +75 -29
- package/dist/admin/blocks/model.js +7 -6
- package/dist/admin/copy/blocks.d.ts +14 -11
- package/dist/admin/copy/blocks.js +33 -22
- package/dist/admin/copy/goals.d.ts +15 -8
- package/dist/admin/copy/goals.js +18 -8
- package/dist/admin/copy/newTest.d.ts +10 -7
- package/dist/admin/copy/newTest.js +14 -7
- package/dist/admin/copy/status.d.ts +1 -1
- package/dist/admin/copy/status.js +2 -1
- package/dist/admin/pageCollections.d.ts +1 -0
- package/dist/admin/pageCollections.js +3 -0
- package/dist/admin/placementStatus.model.js +5 -3
- package/dist/admin/status.model.d.ts +1 -0
- package/dist/admin/status.model.js +2 -1
- package/dist/admin/surface/ResultsRoute.js +12 -10
- package/dist/admin/surface/SurfaceShell.d.ts +4 -2
- package/dist/admin/surface/SurfaceShell.js +28 -3
- package/dist/admin/surface/TestRowMenu.d.ts +13 -0
- package/dist/admin/surface/TestRowMenu.js +163 -0
- package/dist/admin/surface/TestsHome.d.ts +4 -3
- package/dist/admin/surface/TestsHome.js +224 -52
- package/dist/admin/surface/TestsSurface.js +2 -1
- package/dist/admin/surface/goals/DeleteGoalDialog.d.ts +7 -0
- package/dist/admin/surface/goals/DeleteGoalDialog.js +42 -0
- package/dist/admin/surface/goals/GoalForm.d.ts +1 -0
- package/dist/admin/surface/goals/GoalForm.js +280 -198
- package/dist/admin/surface/goals/GoalsList.js +102 -33
- package/dist/admin/surface/goals/data.d.ts +2 -0
- package/dist/admin/surface/goals/data.js +9 -0
- package/dist/admin/surface/goals/goals.css +3 -2
- package/dist/admin/surface/goals/goals.model.d.ts +2 -2
- package/dist/admin/surface/goals/goals.model.js +7 -12
- package/dist/admin/surface/home.model.d.ts +15 -8
- package/dist/admin/surface/home.model.js +22 -18
- package/dist/admin/surface/newTest/NewTest.d.ts +3 -3
- package/dist/admin/surface/newTest/NewTest.js +156 -96
- package/dist/admin/surface/newTest/PageWizard.d.ts +4 -1
- package/dist/admin/surface/newTest/PageWizard.js +99 -68
- package/dist/admin/surface/newTest/newTest.css +28 -11
- package/dist/admin/surface/results/ResultsHeader.d.ts +1 -1
- package/dist/admin/surface/results/ResultsHeader.js +98 -66
- package/dist/admin/surface/surface.css +29 -0
- package/dist/admin/surface/test/TestPage.js +46 -38
- package/dist/admin/surface/useXpStepNav.d.ts +11 -0
- package/dist/admin/surface/useXpStepNav.js +14 -0
- package/dist/admin/views/TestsSurfaceClient.js +27 -3
- package/dist/admin/views/buildSurfaceProps.js +18 -66
- package/dist/arms/copy.d.ts +13 -3
- package/dist/arms/copy.js +5 -4
- package/dist/blocks/createExperimentBlock.js +1 -1
- package/dist/blocks/formState.js +2 -2
- package/dist/collections/experiments/armInvariants.js +8 -5
- package/dist/collections/experiments/config.js +8 -3
- 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 +12 -5
- package/dist/collections/metricsGuards.js +2 -0
- package/dist/collections/serialize.js +8 -6
- 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/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/results.d.ts +5 -1
- package/dist/db/results.js +21 -5
- package/dist/db/snapshots.d.ts +2 -0
- package/dist/endpoints/deleteImpact.js +2 -1
- package/dist/endpoints/duplicateOriginal.d.ts +38 -0
- package/dist/endpoints/duplicateOriginal.js +414 -0
- package/dist/endpoints/editorSurface.js +1 -1
- package/dist/endpoints/events.js +103 -39
- package/dist/endpoints/index.js +22 -8
- package/dist/endpoints/pages.js +245 -66
- package/dist/endpoints/placementStatus.js +8 -4
- package/dist/endpoints/results.d.ts +1 -1
- package/dist/endpoints/results.js +9 -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 +4 -0
- package/dist/errors.js +6 -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/index.d.ts +1 -1
- package/dist/exports/rsc.d.ts +1 -0
- package/dist/exports/rsc.js +1 -0
- package/dist/goals/fairness.js +2 -2
- package/dist/goals/picker/copy.js +1 -1
- package/dist/goals/sourceLabel.d.ts +2 -0
- package/dist/goals/sourceLabel.js +4 -0
- package/dist/hooks/hostHook.js +6 -2
- package/dist/hooks/pageGuard.js +4 -0
- package/dist/hooks/trackPageCopies.d.ts +11 -0
- package/dist/hooks/trackPageCopies.js +7 -0
- package/dist/labels/arms.d.ts +3 -0
- package/dist/labels/arms.js +8 -0
- package/dist/lib/fetchAllDocs.d.ts +1 -1
- package/dist/manifest/compile.js +8 -5
- package/dist/onInit.js +14 -0
- package/dist/options.d.ts +2 -0
- package/dist/options.js +23 -2
- package/dist/plugin.js +56 -2
- 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/editor/ConfigureTestDrawer.d.ts +7 -7
- package/dist/puck/editor/ConfigureTestDrawer.js +40 -29
- package/dist/puck/editor/ExperimentSlotEditor.d.ts +2 -1
- package/dist/puck/editor/ExperimentSlotEditor.js +376 -139
- package/dist/puck/editor/LeftoverVersions.js +17 -32
- package/dist/puck/editor/QuickTestActions.d.ts +6 -3
- package/dist/puck/editor/QuickTestActions.js +55 -33
- package/dist/puck/editor/ResultsReadout.d.ts +4 -1
- package/dist/puck/editor/ResultsReadout.js +28 -15
- package/dist/puck/editor/VersionBuilder.d.ts +17 -4
- package/dist/puck/editor/VersionBuilder.js +175 -112
- package/dist/puck/editor/armWrites.js +2 -2
- package/dist/puck/editor/armsCache.js +1 -3
- package/dist/puck/editor/copy.d.ts +14 -7
- package/dist/puck/editor/copy.js +26 -13
- package/dist/puck/editor/editor.chrome.css +10 -8
- package/dist/puck/editor/editor.css +15 -9
- package/dist/puck/editor/editor.model.d.ts +1 -0
- package/dist/puck/editor/placementsCache.d.ts +4 -0
- package/dist/puck/editor/usePageSaveReadiness.d.ts +6 -0
- package/dist/puck/editor/usePageSaveReadiness.js +31 -0
- package/dist/puck/nestedTestCopy.js +2 -2
- package/dist/puck/slotConfig.d.ts +1 -1
- package/dist/puck/slotConfig.js +1 -1
- package/dist/results/aggregate.d.ts +6 -3
- package/dist/results/aggregate.js +9 -9
- package/dist/results/analyse.d.ts +2 -0
- package/dist/results/analyse.js +2 -2
- 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.d.ts +4 -4
- package/dist/results/verdict.js +15 -11
- 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 +20 -2
- package/dist/server/getAssignments.js +11 -10
- package/dist/server/recordContentChange.d.ts +1 -1
- package/dist/server/recordContentChange.js +11 -2
- package/dist/server/resolveExperimentBlocks.js +2 -4
- package/dist/server/resolveExperimentData.js +2 -5
- package/dist/server/runResults.js +54 -15
- package/dist/server/startExperiment.d.ts +20 -0
- package/dist/server/startExperiment.js +70 -0
- package/dist/server/trackConversion.js +10 -13
- package/dist/testSurface/PreviewLinks.d.ts +2 -1
- package/dist/testSurface/PreviewLinks.js +3 -3
- package/dist/testSurface/actions/DecideDialog.d.ts +10 -4
- package/dist/testSurface/actions/DecideDialog.js +93 -63
- package/dist/testSurface/actions/LifecycleAction.d.ts +17 -0
- package/dist/testSurface/actions/LifecycleAction.js +107 -0
- package/dist/testSurface/actions/MakeContentResult.d.ts +4 -3
- package/dist/testSurface/actions/MakeContentResult.js +10 -2
- package/dist/testSurface/actions/actions.model.d.ts +13 -5
- package/dist/testSurface/actions/actions.model.js +75 -22
- package/dist/testSurface/actions/decide.model.d.ts +1 -0
- package/dist/testSurface/actions/decide.model.js +1 -0
- package/dist/testSurface/allocation.model.js +6 -3
- package/dist/testSurface/api.d.ts +9 -6
- package/dist/testSurface/api.js +43 -23
- package/dist/testSurface/copy/actions.d.ts +37 -14
- package/dist/testSurface/copy/actions.js +40 -17
- package/dist/testSurface/copy/advanced.d.ts +10 -0
- package/dist/testSurface/copy/advanced.js +10 -0
- package/dist/testSurface/copy/arms.d.ts +1 -1
- package/dist/testSurface/copy/arms.js +1 -1
- package/dist/testSurface/copy/audience.d.ts +4 -3
- package/dist/testSurface/copy/audience.js +5 -4
- package/dist/testSurface/copy/common.d.ts +8 -6
- package/dist/testSurface/copy/common.js +8 -6
- package/dist/testSurface/copy/languages.d.ts +1 -0
- package/dist/testSurface/copy/languages.js +1 -0
- package/dist/testSurface/copy/metrics.d.ts +7 -0
- package/dist/testSurface/copy/metrics.js +9 -0
- package/dist/testSurface/copy/pages.d.ts +67 -7
- package/dist/testSurface/copy/pages.js +74 -7
- package/dist/testSurface/copy/readiness.d.ts +20 -7
- package/dist/testSurface/copy/readiness.js +36 -10
- package/dist/testSurface/copy/recommendation.d.ts +1 -22
- package/dist/testSurface/copy/recommendation.js +2 -22
- package/dist/testSurface/copy/results.d.ts +21 -12
- package/dist/testSurface/copy/results.js +24 -13
- package/dist/testSurface/copy/review.d.ts +13 -10
- package/dist/testSurface/copy/review.js +14 -10
- package/dist/testSurface/copy/setting.d.ts +1 -2
- package/dist/testSurface/copy/setting.js +1 -2
- package/dist/testSurface/copy/surface.d.ts +11 -2
- package/dist/testSurface/copy/surface.js +14 -11
- package/dist/testSurface/copy/testPage.d.ts +36 -12
- package/dist/testSurface/copy/testPage.js +53 -16
- package/dist/testSurface/format/date.d.ts +5 -2
- package/dist/testSurface/format/date.js +24 -8
- package/dist/testSurface/format/roundProgress.d.ts +6 -0
- package/dist/testSurface/format/roundProgress.js +15 -0
- package/dist/testSurface/format/useDateFormatter.d.ts +3 -0
- package/dist/testSurface/format/useDateFormatter.js +8 -0
- package/dist/testSurface/labels.d.ts +1 -2
- package/dist/testSurface/labels.js +2 -3
- package/dist/testSurface/lockedNotice.model.d.ts +2 -0
- package/dist/testSurface/lockedNotice.model.js +31 -0
- package/dist/testSurface/readPreflight.d.ts +4 -0
- package/dist/testSurface/readPreflight.js +6 -0
- package/dist/testSurface/readinessRead.d.ts +3 -0
- package/dist/testSurface/readinessRead.js +4 -0
- package/dist/testSurface/results/CiChart.js +2 -1
- package/dist/testSurface/results/DataTable.d.ts +1 -1
- package/dist/testSurface/results/DataTable.js +4 -3
- package/dist/testSurface/results/VerdictHero.d.ts +3 -2
- package/dist/testSurface/results/VerdictHero.js +5 -1
- package/dist/testSurface/results/legacy.d.ts +0 -5
- package/dist/testSurface/results/legacy.js +0 -14
- package/dist/testSurface/results/results.css +2 -2
- package/dist/testSurface/results/results.model.d.ts +9 -4
- package/dist/testSurface/results/results.model.js +31 -23
- package/dist/testSurface/results/snapshot.d.ts +2 -0
- package/dist/testSurface/results/snapshot.js +3 -0
- package/dist/testSurface/surface/contracts.d.ts +13 -1
- package/dist/testSurface/surface/editorPlacement.d.ts +3 -3
- package/dist/testSurface/surface/editorPlacement.js +2 -2
- package/dist/testSurface/surface/pageBlock/pageBlock.model.js +3 -3
- package/dist/testSurface/surface/pageBlock/parts.js +25 -12
- package/dist/testSurface/surface/pagePicker/CopyRoute.d.ts +8 -1
- package/dist/testSurface/surface/pagePicker/CopyRoute.js +243 -22
- package/dist/testSurface/surface/pagePicker/PageCombobox.d.ts +15 -4
- package/dist/testSurface/surface/pagePicker/PageCombobox.js +300 -197
- package/dist/testSurface/surface/pagePicker/pagePicker.css +73 -10
- package/dist/testSurface/surface/pagePicker/pagePicker.model.d.ts +5 -3
- package/dist/testSurface/surface/pagePicker/pagePicker.model.js +17 -2
- package/dist/testSurface/surface/readiness/ActionDialogs.d.ts +9 -5
- package/dist/testSurface/surface/readiness/ActionDialogs.js +241 -230
- package/dist/testSurface/surface/readiness/Banner.d.ts +5 -1
- package/dist/testSurface/surface/readiness/Banner.js +113 -141
- package/dist/testSurface/surface/readiness/SaveStatus.d.ts +8 -4
- package/dist/testSurface/surface/readiness/SaveStatus.js +23 -22
- package/dist/testSurface/surface/readiness/readiness.model.d.ts +20 -6
- package/dist/testSurface/surface/readiness/readiness.model.js +168 -21
- package/dist/testSurface/surface/readiness/useTransition.d.ts +6 -4
- package/dist/testSurface/surface/readiness/useTransition.js +57 -14
- package/dist/testSurface/surface/results/ReleasePages.d.ts +6 -3
- package/dist/testSurface/surface/results/ReleasePages.js +42 -41
- package/dist/testSurface/surface/results/ResultsBody.d.ts +11 -4
- package/dist/testSurface/surface/results/ResultsBody.js +221 -118
- package/dist/testSurface/surface/results/recommendation.model.d.ts +6 -9
- package/dist/testSurface/surface/results/recommendation.model.js +15 -59
- package/dist/testSurface/surface/results/useResults.d.ts +13 -8
- package/dist/testSurface/surface/results/useResults.js +3 -2
- package/dist/testSurface/surface/setting/parts.js +89 -46
- package/dist/testSurface/surface/setting/setting.css +2 -1
- package/dist/testSurface/surface/test/AdvancedSection.js +11 -4
- package/dist/testSurface/surface/test/DeleteTest.d.ts +10 -2
- package/dist/testSurface/surface/test/DeleteTest.js +173 -74
- package/dist/testSurface/surface/test/GoalSection.js +18 -14
- package/dist/testSurface/surface/test/LengthSection.js +24 -13
- package/dist/testSurface/surface/test/PageHoldout.d.ts +1 -1
- package/dist/testSurface/surface/test/PageHoldout.js +11 -8
- package/dist/testSurface/surface/test/ReadinessBar.d.ts +2 -1
- package/dist/testSurface/surface/test/ReadinessBar.js +4 -10
- package/dist/testSurface/surface/test/Section.js +8 -0
- package/dist/testSurface/surface/test/TargetingSection.js +82 -12
- package/dist/testSurface/surface/test/TestSurface.js +73 -37
- package/dist/testSurface/surface/test/VersionsSection.js +141 -91
- package/dist/testSurface/surface/test/fields.d.ts +32 -6
- package/dist/testSurface/surface/test/fields.js +166 -52
- package/dist/testSurface/surface/test/pageParts.js +27 -12
- package/dist/testSurface/surface/test/testPage.css +9 -2
- package/dist/testSurface/surface/test/testPage.model.d.ts +1 -0
- package/dist/testSurface/surface/test/testPage.model.js +6 -0
- package/dist/testSurface/surface/testDocument.model.d.ts +3 -0
- package/dist/testSurface/surface/testDocument.model.js +4 -1
- package/dist/testSurface/surface/useTestDocument.d.ts +21 -5
- package/dist/testSurface/surface/useTestDocument.js +472 -167
- package/dist/testSurface/surface/watchTestDocument.d.ts +15 -0
- package/dist/testSurface/surface/watchTestDocument.js +181 -0
- package/dist/testSurface/surfaceUrls.d.ts +1 -0
- package/dist/testSurface/surfaceUrls.js +4 -0
- package/dist/testSurface/useApi.d.ts +8 -5
- package/dist/testSurface/useOnTestReturn.d.ts +2 -0
- package/dist/testSurface/useOnTestReturn.js +27 -0
- package/dist/testSurface/useReadinessPolling.js +3 -1
- 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 +1 -0
- package/dist/transitions/checkStart.js +17 -6
- package/dist/transitions/decide.d.ts +1 -1
- package/dist/transitions/decide.js +5 -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 +12 -8
- package/dist/transitions/nestedPlacementNames.d.ts +2 -2
- package/dist/transitions/nestedPlacementNames.js +4 -5
- package/dist/transitions/pageAddress.d.ts +6 -0
- package/dist/transitions/pageAddress.js +71 -0
- package/dist/transitions/pageVersions.d.ts +1 -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 +8 -7
- package/dist/transitions/placements.d.ts +2 -0
- package/dist/transitions/placements.js +5 -5
- package/dist/transitions/preflightData.d.ts +3 -2
- package/dist/transitions/preflightData.js +77 -43
- 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 +7 -9
- package/dist/transitions/start.js +75 -39
- 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/armKey.d.ts +2 -0
- package/dist/types/armKey.js +1 -0
- package/dist/types/contracts.d.ts +17 -4
- package/dist/types/endpoints.d.ts +89 -17
- package/dist/types/endpoints.js +1 -1
- package/dist/types/runtime.d.ts +15 -9
- package/dist/types/snapshot.d.ts +2 -0
- package/dist/types/surface.d.ts +7 -9
- package/dist/ui/ChipsInput.d.ts +8 -1
- package/dist/ui/ChipsInput.js +17 -4
- package/dist/ui/Dialog.d.ts +21 -2
- package/dist/ui/Dialog.js +101 -4
- package/dist/ui/Inputs.js +0 -1
- package/dist/ui/ui.css +5 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DocId } from '../types/contracts.js';
|
|
2
|
-
import type { DeleteImpactResult, WrapBlockBody, PagesResult, PlacementStatusBody, PlacementStatusResult, RestoreContentEntryBody, RestoreContentEntryResult, DismissContentEntryBody, DismissContentEntryResult, AddMetricBody, AllocateBody, ArchiveBody, DecideBody, MakeContentResult, AddMetricResult, ClickKeysResult, PreflightResult, PreviewTokenResult, RefusalCode, ResultsResponse, SummaryResponse, TransitionSuccess } from '../types/endpoints.js';
|
|
2
|
+
import type { CopyPagePlan, CopyPageResult, DeleteImpactResult, WrapBlockBody, PagesResult, PlacementStatusBody, PlacementStatusResult, RestoreContentEntryBody, RestoreContentEntryResult, DismissContentEntryBody, DismissContentEntryResult, AddMetricBody, AllocateBody, ArchiveBody, DecideBody, MakeContentResult, AddMetricResult, ClickKeysResult, PreflightResult, PreviewTokenResult, RefusalCode, ResultsResponse, SummaryResponse, TransitionSuccess } from '../types/endpoints.js';
|
|
3
3
|
import { refusalMessage } from './copy/common.js';
|
|
4
4
|
export type ApiResult<T> = {
|
|
5
5
|
ok: true;
|
|
@@ -28,16 +28,19 @@ export declare function createApi(apiBase: string, contentLocale?: string): {
|
|
|
28
28
|
q?: string;
|
|
29
29
|
path?: string;
|
|
30
30
|
page?: number;
|
|
31
|
+
mode?: "block";
|
|
31
32
|
}, signal?: AbortSignal) => Promise<ApiResult<PagesResult>>;
|
|
33
|
+
previewPageCopy: (id: DocId, arm: string, signal?: AbortSignal) => Promise<ApiResult<CopyPagePlan>>;
|
|
34
|
+
makePageCopy: (id: DocId, arm: string, plan: CopyPagePlan) => Promise<ApiResult<CopyPageResult>>;
|
|
32
35
|
placementStatus: (body: PlacementStatusBody) => Promise<ApiResult<PlacementStatusResult>>;
|
|
33
|
-
start: (id: DocId) => Promise<ApiResult<TransitionSuccess>>;
|
|
36
|
+
start: (id: DocId, phase?: number) => Promise<ApiResult<TransitionSuccess>>;
|
|
34
37
|
allocate: (id: DocId, body: AllocateBody, options?: RequestOptions) => Promise<ApiResult<TransitionSuccess>>;
|
|
35
38
|
addMetric: (id: DocId, body: AddMetricBody, options?: RequestOptions) => Promise<ApiResult<AddMetricResult>>;
|
|
36
|
-
stop: (id: DocId) => Promise<ApiResult<TransitionSuccess>>;
|
|
39
|
+
stop: (id: DocId, phase?: number) => Promise<ApiResult<TransitionSuccess>>;
|
|
37
40
|
decide: (id: DocId, body: DecideBody) => Promise<ApiResult<TransitionSuccess>>;
|
|
38
|
-
releaseHoldout: (id: DocId) => Promise<ApiResult<TransitionSuccess>>;
|
|
39
|
-
releasePages: (id: DocId) => Promise<ApiResult<TransitionSuccess>>;
|
|
40
|
-
makeContent: (id: DocId) => Promise<ApiResult<MakeContentResult>>;
|
|
41
|
+
releaseHoldout: (id: DocId, phase?: number) => Promise<ApiResult<TransitionSuccess>>;
|
|
42
|
+
releasePages: (id: DocId, phase?: number) => Promise<ApiResult<TransitionSuccess>>;
|
|
43
|
+
makeContent: (id: DocId, phase?: number) => Promise<ApiResult<MakeContentResult>>;
|
|
41
44
|
dismissContentEntry: (id: DocId, body: DismissContentEntryBody) => Promise<ApiResult<DismissContentEntryResult>>;
|
|
42
45
|
restoreContentEntry: (id: DocId, body: RestoreContentEntryBody) => Promise<ApiResult<RestoreContentEntryResult>>;
|
|
43
46
|
archive: (id: DocId, body: ArchiveBody) => Promise<ApiResult<TransitionSuccess>>;
|
package/dist/testSurface/api.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { XP_IF_UPDATED_AT_HEADER } from '../constants.js';
|
|
1
2
|
import { contentLocaleURL } from './contentLocaleURL.js';
|
|
2
3
|
import { API_MESSAGES, refusalMessage } from './copy/common.js';
|
|
3
4
|
import { CONTENT_ENTRY_REFUSALS } from './copy/actions.js';
|
|
@@ -5,7 +6,7 @@ export function createApi(apiBase, contentLocale) {
|
|
|
5
6
|
const collectionBase = `${apiBase.replace(/\/$/, '')}/xp-experiments`;
|
|
6
7
|
const base = `${apiBase.replace(/\/$/, '')}/xp/experiments`;
|
|
7
8
|
const route = (id, action)=>`${base}/${encodeURIComponent(id)}/${action}`;
|
|
8
|
-
async function request(path, method, body, options, signal) {
|
|
9
|
+
async function request(path, method, body, options, signal, updatedAt) {
|
|
9
10
|
try {
|
|
10
11
|
const response = await fetch(path(), {
|
|
11
12
|
method,
|
|
@@ -15,7 +16,10 @@ export function createApi(apiBase, contentLocale) {
|
|
|
15
16
|
} : {},
|
|
16
17
|
...body === undefined ? {} : {
|
|
17
18
|
headers: {
|
|
18
|
-
'Content-Type': 'application/json'
|
|
19
|
+
'Content-Type': 'application/json',
|
|
20
|
+
...updatedAt ? {
|
|
21
|
+
[XP_IF_UPDATED_AT_HEADER]: updatedAt
|
|
22
|
+
} : {}
|
|
19
23
|
},
|
|
20
24
|
body: JSON.stringify(body)
|
|
21
25
|
}
|
|
@@ -86,40 +90,56 @@ export function createApi(apiBase, contentLocale) {
|
|
|
86
90
|
},
|
|
87
91
|
deleteTest: (id, { draft = false } = {})=>request(()=>`${collectionBase}/${encodeURIComponent(id)}`, 'DELETE', undefined, {
|
|
88
92
|
notFound: API_MESSAGES.testAlreadyDeleted,
|
|
89
|
-
...draft ? {
|
|
90
|
-
forbidden: API_MESSAGES.testNoLongerDraft
|
|
91
|
-
} : {},
|
|
92
93
|
codes: {
|
|
93
94
|
'invalid-status': draft ? API_MESSAGES.testNoLongerDraft : API_MESSAGES.deleteInvalidStatus
|
|
94
95
|
}
|
|
95
96
|
}),
|
|
96
97
|
wrapBlock: (body)=>request(()=>`${apiBase.replace(/\/$/, '')}/xp/blocks/wrap`, 'POST', body),
|
|
97
|
-
pages: (query, signal)=>request(()
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
98
|
+
pages: (query, signal)=>request(()=>{
|
|
99
|
+
const params = new URLSearchParams({
|
|
100
|
+
collection: query.collection
|
|
101
|
+
});
|
|
102
|
+
if (query.q) params.set('q', query.q);
|
|
103
|
+
if (query.path !== undefined) params.set('path', query.path);
|
|
104
|
+
if (query.page) params.set('page', String(query.page));
|
|
105
|
+
if (query.mode) params.set('mode', query.mode);
|
|
106
|
+
if (contentLocale) params.set('locale', contentLocale);
|
|
107
|
+
return `${apiBase.replace(/\/$/, '')}/xp/pages?${params}`;
|
|
108
|
+
}, 'GET', undefined, undefined, signal),
|
|
109
|
+
previewPageCopy: (id, arm, signal)=>request(()=>`${route(id, 'duplicate-original')}?arm=${encodeURIComponent(arm)}`, 'GET', undefined, undefined, signal),
|
|
110
|
+
makePageCopy: (id, arm, plan)=>request(()=>route(id, 'duplicate-original'), 'POST', {
|
|
111
|
+
...plan,
|
|
112
|
+
arm
|
|
113
|
+
}, undefined, undefined, plan.updatedAt),
|
|
109
114
|
placementStatus: (body)=>request(()=>`${apiBase.replace(/\/$/, '')}/xp/placements/status`, 'POST', body),
|
|
110
|
-
start: (id)=>post(id, 'start'
|
|
115
|
+
start: (id, phase)=>post(id, 'start', phase === undefined ? undefined : {
|
|
116
|
+
phase
|
|
117
|
+
}),
|
|
111
118
|
allocate: (id, body, options)=>post(id, 'allocate', body, options),
|
|
112
119
|
addMetric: (id, body, options)=>post(id, 'add-metric', body, options),
|
|
113
|
-
stop: (id)=>post(id, 'stop'
|
|
120
|
+
stop: (id, phase)=>post(id, 'stop', phase === undefined ? undefined : {
|
|
121
|
+
phase
|
|
122
|
+
}),
|
|
114
123
|
decide: (id, body)=>post(id, 'decide', body),
|
|
115
|
-
releaseHoldout: (id)=>post(id, 'release-holdout'
|
|
116
|
-
|
|
117
|
-
|
|
124
|
+
releaseHoldout: (id, phase)=>post(id, 'release-holdout', phase === undefined ? undefined : {
|
|
125
|
+
phase
|
|
126
|
+
}),
|
|
127
|
+
releasePages: (id, phase)=>post(id, 'release-pages', phase === undefined ? undefined : {
|
|
128
|
+
phase
|
|
129
|
+
}),
|
|
130
|
+
makeContent: (id, phase)=>post(id, 'make-content', phase === undefined ? undefined : {
|
|
131
|
+
phase
|
|
132
|
+
}),
|
|
118
133
|
dismissContentEntry: (id, body)=>post(id, 'content-report/dismiss', body, CONTENT_ENTRY_REFUSALS),
|
|
119
134
|
restoreContentEntry: (id, body)=>post(id, 'content-report/restore', body, CONTENT_ENTRY_REFUSALS),
|
|
120
135
|
archive: (id, body)=>post(id, 'archive', body),
|
|
121
136
|
clickKeys: (id)=>request(()=>route(id, 'click-keys'), 'GET'),
|
|
122
|
-
deleteImpact: (id, signal)=>request(()=>contentLocaleURL(route(id, 'delete-impact'), contentLocale), 'GET', undefined,
|
|
137
|
+
deleteImpact: (id, signal)=>request(()=>contentLocaleURL(route(id, 'delete-impact'), contentLocale), 'GET', undefined, {
|
|
138
|
+
codes: {
|
|
139
|
+
'invalid-status': API_MESSAGES.deleteInvalidStatus
|
|
140
|
+
},
|
|
141
|
+
fallback: API_MESSAGES.deleteImpactUnavailable
|
|
142
|
+
}, signal),
|
|
123
143
|
preflight: (id)=>request(()=>contentLocaleURL(route(id, 'preflight'), contentLocale), 'GET'),
|
|
124
144
|
previewToken: (id, arm)=>request(()=>`${route(id, 'preview-token')}?arm=${encodeURIComponent(arm)}`, 'GET'),
|
|
125
145
|
results: (id, options = {})=>request(()=>{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AddMetricWarning } from '../../types/endpoints.js';
|
|
2
2
|
export declare const ACTIONS_COPY: {
|
|
3
|
+
readonly decisionUnavailable: "This round can no longer be decided here. Copy your note before closing.";
|
|
3
4
|
readonly start: "Start";
|
|
4
5
|
readonly restart: "Start a new round";
|
|
5
6
|
readonly stop: "Stop";
|
|
@@ -9,19 +10,35 @@ export declare const ACTIONS_COPY: {
|
|
|
9
10
|
readonly finish: "Finish archiving";
|
|
10
11
|
readonly archive: "Archive";
|
|
11
12
|
readonly discard: "Discard winner";
|
|
12
|
-
readonly startBody: "
|
|
13
|
-
readonly restartBody: "
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
18
|
-
|
|
13
|
+
readonly startBody: "The test will start showing versions to visitors and collecting results.";
|
|
14
|
+
readonly restartBody: "Visitors will start seeing test versions again. New results go into a new round, and earlier results are kept.";
|
|
15
|
+
readonly finishBody: "The updated content stays in place. The test moves to Archived and keeps its results. You can then delete it.";
|
|
16
|
+
readonly hardCodedBody: "The test moves to Archived and keeps its results. The site will use the version your developer made permanent. You can then delete the test.";
|
|
17
|
+
readonly confirmPermanentWinner: "Confirm permanent winner";
|
|
18
|
+
readonly titleLead: {
|
|
19
|
+
readonly restart: "Start a new round for";
|
|
20
|
+
readonly decide: "Decide the winner for";
|
|
21
|
+
readonly 'release-holdout': "Release the holdout for";
|
|
22
|
+
readonly 'make-content': "Make the winner permanent for";
|
|
23
|
+
readonly discard: "Discard the winner for";
|
|
24
|
+
readonly 'hard-coded': "Confirm the permanent winner for";
|
|
25
|
+
readonly allocate: "Let more people into";
|
|
26
|
+
readonly 'add-metric': "Add a goal to";
|
|
27
|
+
readonly 'release-pages': "Release pages for";
|
|
28
|
+
};
|
|
29
|
+
readonly decideBody: "Choose the version visitors should see going forward. The test round ends and its results are kept.";
|
|
30
|
+
readonly decideRoundMissing: "Couldn't find the versions from this round. Close this dialog and check the current round.";
|
|
31
|
+
readonly actionChanged: "This test changed. Close this dialog to see the current actions.";
|
|
19
32
|
readonly noResults: "There are no results yet.";
|
|
20
|
-
readonly noRecommendation: "The results don't recommend a
|
|
21
|
-
readonly different: "You chose a different
|
|
22
|
-
readonly
|
|
23
|
-
readonly
|
|
33
|
+
readonly noRecommendation: "The results don't recommend a version yet.";
|
|
34
|
+
readonly different: "You chose a different version than the results recommend.";
|
|
35
|
+
readonly winningVersion: "Winning version";
|
|
36
|
+
readonly chooseVersion: "Choose a version";
|
|
37
|
+
readonly note: "Decision note (optional)";
|
|
38
|
+
readonly requiredNote: "Decision note (required for this choice)";
|
|
24
39
|
readonly confirmation: "Confirmation";
|
|
40
|
+
readonly noEvidence: "No one has taken part yet, so there's nothing to compare. Deciding now picks a version without evidence.";
|
|
41
|
+
readonly decideAnyway: "Decide anyway";
|
|
25
42
|
readonly typePhrase: "Type the following to confirm:";
|
|
26
43
|
readonly cancel: "Cancel";
|
|
27
44
|
readonly retry: "Retry";
|
|
@@ -32,7 +49,7 @@ export declare const ACTIONS_COPY: {
|
|
|
32
49
|
readonly contentArchived: "The winner is now the content and the test is archived.";
|
|
33
50
|
readonly dismissLabel: (page: string) => string;
|
|
34
51
|
readonly undoLabel: (page: string) => string;
|
|
35
|
-
readonly dismissHelp: "Dismiss
|
|
52
|
+
readonly dismissHelp: "Dismiss each page you plan to update by hand so you can finish archiving.";
|
|
36
53
|
readonly contentEntryNotDecided: "This test isn't decided, so its pages can't be changed.";
|
|
37
54
|
readonly contentEntryMissing: "This page is no longer in the list. Reload to see the current list.";
|
|
38
55
|
readonly contentEntryDismissed: "This page was already dismissed.";
|
|
@@ -52,9 +69,15 @@ export declare const ACTIONS_COPY: {
|
|
|
52
69
|
'update-failed': string;
|
|
53
70
|
};
|
|
54
71
|
readonly missingContent: "This page no longer exists; nothing to change.";
|
|
55
|
-
readonly partial: "Some pages
|
|
72
|
+
readonly partial: "Some pages still need changes.";
|
|
56
73
|
};
|
|
57
|
-
export declare const
|
|
74
|
+
export declare const actionTitle: (action: string, test: string) => string;
|
|
75
|
+
export declare const actionTitleFor: (action: string, test: string) => string;
|
|
76
|
+
export declare const actionsForTest: (test: string) => string;
|
|
77
|
+
export declare const stopCopy: (control: string) => string;
|
|
78
|
+
export declare const discardCopy: (control: string) => string;
|
|
79
|
+
export declare const archiveCopy: (control: string) => string;
|
|
80
|
+
export declare const decideCopy: (winner: string, holdout: boolean, control: string, isControl: boolean) => string;
|
|
58
81
|
export declare const releaseCopy: (winner: string) => string;
|
|
59
82
|
export declare const makeContentCopy: (winner: string, kind: "block" | "page" | "flag") => string;
|
|
60
83
|
export declare const hardCodedLabel: (winner: string) => string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { asymmetricGoalsCopy, placementUncheckedCopy } from './readiness.js';
|
|
2
2
|
export const ACTIONS_COPY = {
|
|
3
|
+
decisionUnavailable: 'This round can no longer be decided here. Copy your note before closing.',
|
|
3
4
|
start: 'Start',
|
|
4
5
|
restart: 'Start a new round',
|
|
5
6
|
stop: 'Stop',
|
|
@@ -9,19 +10,35 @@ export const ACTIONS_COPY = {
|
|
|
9
10
|
finish: 'Finish archiving',
|
|
10
11
|
archive: 'Archive',
|
|
11
12
|
discard: 'Discard winner',
|
|
12
|
-
startBody: '
|
|
13
|
-
restartBody: '
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
startBody: 'The test will start showing versions to visitors and collecting results.',
|
|
14
|
+
restartBody: 'Visitors will start seeing test versions again. New results go into a new round, and earlier results are kept.',
|
|
15
|
+
finishBody: 'The updated content stays in place. The test moves to Archived and keeps its results. You can then delete it.',
|
|
16
|
+
hardCodedBody: 'The test moves to Archived and keeps its results. The site will use the version your developer made permanent. You can then delete the test.',
|
|
17
|
+
confirmPermanentWinner: 'Confirm permanent winner',
|
|
18
|
+
titleLead: {
|
|
19
|
+
restart: 'Start a new round for',
|
|
20
|
+
decide: 'Decide the winner for',
|
|
21
|
+
'release-holdout': 'Release the holdout for',
|
|
22
|
+
'make-content': 'Make the winner permanent for',
|
|
23
|
+
discard: 'Discard the winner for',
|
|
24
|
+
'hard-coded': 'Confirm the permanent winner for',
|
|
25
|
+
allocate: 'Let more people into',
|
|
26
|
+
'add-metric': 'Add a goal to',
|
|
27
|
+
'release-pages': 'Release pages for'
|
|
28
|
+
},
|
|
29
|
+
decideBody: 'Choose the version visitors should see going forward. The test round ends and its results are kept.',
|
|
30
|
+
decideRoundMissing: "Couldn't find the versions from this round. Close this dialog and check the current round.",
|
|
31
|
+
actionChanged: 'This test changed. Close this dialog to see the current actions.',
|
|
19
32
|
noResults: 'There are no results yet.',
|
|
20
|
-
noRecommendation: "The results don't recommend a
|
|
21
|
-
different: 'You chose a different
|
|
22
|
-
|
|
23
|
-
|
|
33
|
+
noRecommendation: "The results don't recommend a version yet.",
|
|
34
|
+
different: 'You chose a different version than the results recommend.',
|
|
35
|
+
winningVersion: 'Winning version',
|
|
36
|
+
chooseVersion: 'Choose a version',
|
|
37
|
+
note: 'Decision note (optional)',
|
|
38
|
+
requiredNote: 'Decision note (required for this choice)',
|
|
24
39
|
confirmation: 'Confirmation',
|
|
40
|
+
noEvidence: "No one has taken part yet, so there's nothing to compare. Deciding now picks a version without evidence.",
|
|
41
|
+
decideAnyway: 'Decide anyway',
|
|
25
42
|
typePhrase: 'Type the following to confirm:',
|
|
26
43
|
cancel: 'Cancel',
|
|
27
44
|
retry: 'Retry',
|
|
@@ -32,7 +49,7 @@ export const ACTIONS_COPY = {
|
|
|
32
49
|
contentArchived: 'The winner is now the content and the test is archived.',
|
|
33
50
|
dismissLabel: (page)=>`Dismiss ${page}`,
|
|
34
51
|
undoLabel: (page)=>`Undo dismiss ${page}`,
|
|
35
|
-
dismissHelp: "Dismiss
|
|
52
|
+
dismissHelp: "Dismiss each page you plan to update by hand so you can finish archiving.",
|
|
36
53
|
contentEntryNotDecided: "This test isn't decided, so its pages can't be changed.",
|
|
37
54
|
contentEntryMissing: 'This page is no longer in the list. Reload to see the current list.',
|
|
38
55
|
contentEntryDismissed: 'This page was already dismissed.',
|
|
@@ -45,18 +62,24 @@ export const ACTIONS_COPY = {
|
|
|
45
62
|
failed: 'Failed',
|
|
46
63
|
contentReasons: {
|
|
47
64
|
localized: "This page has more than one language; Make it the content can't publish it safely yet. Copy the winning version by hand.",
|
|
48
|
-
locked: 'Someone is editing this page.
|
|
65
|
+
locked: 'Someone is editing this page. Retry when they finish.',
|
|
49
66
|
forbidden: "You can't read or update this page. Ask someone with access to update it by hand. If it was deleted or moved to trash, discard the winner to archive this test.",
|
|
50
67
|
'not-found': 'This page could not be found. Check whether it was deleted.',
|
|
51
|
-
validation: "This page couldn't be saved automatically. Update it by hand
|
|
68
|
+
validation: "This page couldn't be saved automatically. Update it by hand.",
|
|
52
69
|
'update-failed': "This page couldn't be updated this time. Retry; if it keeps happening, ask a developer."
|
|
53
70
|
},
|
|
54
71
|
missingContent: 'This page no longer exists; nothing to change.',
|
|
55
|
-
partial: "Some pages
|
|
72
|
+
partial: "Some pages still need changes."
|
|
56
73
|
};
|
|
57
|
-
export const
|
|
74
|
+
export const actionTitle = (action, test)=>`${action} “${test}”?`;
|
|
75
|
+
export const actionTitleFor = (action, test)=>`${action} for “${test}”?`;
|
|
76
|
+
export const actionsForTest = (test)=>`Actions for ${test}`;
|
|
77
|
+
export const stopCopy = (control)=>`Visitors will go back to ${control}. The test stops collecting data and keeps its results. Starting again begins a new round.`;
|
|
78
|
+
export const discardCopy = (control)=>`Visitors go back to ${control}. The test moves to Archived and keeps its results and decision note. You can then delete it.`;
|
|
79
|
+
export const archiveCopy = (control)=>`The test moves out of the active list into Archived. It won't collect any more data, and visitors will keep seeing ${control}. You can still view the results or delete the test later. You can't restart it.`;
|
|
80
|
+
export const decideCopy = (winner, holdout, control, isControl)=>holdout && !isControl ? `Everyone except the holdout will see ${winner}. The holdout keeps seeing ${control} so we can measure the shipped change.` : `Everyone will see ${winner}.`;
|
|
58
81
|
export const releaseCopy = (winner)=>`The holdout will see ${winner} too. Measuring since shipping ends.`;
|
|
59
|
-
export const makeContentCopy = (winner, kind)=>kind === 'flag' ? `Saves ${winner}'s settings as the new defaults so the test can be archived.` : `Copies ${winner} into the page content so the test can be archived.`;
|
|
82
|
+
export const makeContentCopy = (winner, kind)=>kind === 'flag' ? `Saves ${winner}'s settings as the new defaults so the test can be archived.` : kind === 'page' ? `Archives the test and keeps serving ${winner} at the test's addresses. The pages and results are kept.` : `Copies ${winner} into the page content so the test can be archived.`;
|
|
60
83
|
export const hardCodedLabel = (winner)=>`The developer has hard-coded ${winner}`;
|
|
61
84
|
/** Old reports can contain host error text: never interpolate an unknown string. */ export const contentReportCopy = (reason, ok = false)=>reason === 'not-found' && ok ? ACTIONS_COPY.missingContent : ACTIONS_COPY.contentReasons[reason !== undefined && Object.hasOwn(ACTIONS_COPY.contentReasons, reason) ? reason : 'update-failed'];
|
|
62
85
|
// Each dismiss/restore refusal code has its own sentence; server text is never shown.
|
|
@@ -45,6 +45,16 @@ export declare const ADVANCED_COPY: {
|
|
|
45
45
|
readonly label: "Unit type";
|
|
46
46
|
readonly help: "Count visitors or signed-in users, as chosen at creation.";
|
|
47
47
|
};
|
|
48
|
+
readonly kinds: {
|
|
49
|
+
readonly block: "Page block";
|
|
50
|
+
readonly flag: "Setting";
|
|
51
|
+
readonly code: "Developer code";
|
|
52
|
+
readonly page: "Whole page";
|
|
53
|
+
};
|
|
54
|
+
readonly units: {
|
|
55
|
+
readonly visitor: "Each visitor";
|
|
56
|
+
readonly user: "Each signed-in user";
|
|
57
|
+
};
|
|
48
58
|
readonly inheritedWindow: "Use each goal's window";
|
|
49
59
|
readonly automaticTuning: "Automatic (5,000)";
|
|
50
60
|
readonly sequential: "Sequential";
|
|
@@ -45,6 +45,16 @@ export const ADVANCED_COPY = {
|
|
|
45
45
|
label: 'Unit type',
|
|
46
46
|
help: 'Count visitors or signed-in users, as chosen at creation.'
|
|
47
47
|
},
|
|
48
|
+
kinds: {
|
|
49
|
+
block: 'Page block',
|
|
50
|
+
flag: 'Setting',
|
|
51
|
+
code: 'Developer code',
|
|
52
|
+
page: 'Whole page'
|
|
53
|
+
},
|
|
54
|
+
units: {
|
|
55
|
+
visitor: 'Each visitor',
|
|
56
|
+
user: 'Each signed-in user'
|
|
57
|
+
},
|
|
48
58
|
inheritedWindow: "Use each goal's window",
|
|
49
59
|
automaticTuning: 'Automatic (5,000)',
|
|
50
60
|
sequential: 'Sequential',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { ARM_LABELS as GROUP_LABELS } from '../../labels/arms.js';
|
|
2
2
|
export { ISSUE_COPY, issueMessage } from '../../arms/copy.js';
|
|
3
3
|
export declare const ARMS_COPY: {
|
|
4
|
-
readonly holdout:
|
|
4
|
+
readonly holdout: (control: string) => string;
|
|
5
5
|
readonly pageRequired: "Enter a page path for this group.";
|
|
6
6
|
readonly pageInvalid: "Use a page path starting with /, without a host, query or fragment.";
|
|
7
7
|
readonly paramRequired: "Enter a value for {label}.";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { ARM_LABELS as GROUP_LABELS } from '../../labels/arms.js';
|
|
2
2
|
export { ISSUE_COPY, issueMessage } from '../../arms/copy.js';
|
|
3
3
|
export const ARMS_COPY = {
|
|
4
|
-
holdout:
|
|
4
|
+
holdout: (control)=>`The holdout sees ${control} and is measured but not compared during the test. After you decide, it keeps seeing ${control} so the winner can be compared with it.`,
|
|
5
5
|
pageRequired: 'Enter a page path for this group.',
|
|
6
6
|
pageInvalid: 'Use a page path starting with /, without a host, query or fragment.',
|
|
7
7
|
paramRequired: 'Enter a value for {label}.',
|
|
@@ -23,9 +23,10 @@ export declare const NUMBER_OP_LABELS: {
|
|
|
23
23
|
export declare const participation: (allocation: string, people: string, groups: string) => string;
|
|
24
24
|
export declare const eachVersion: (share: string) => string;
|
|
25
25
|
export declare const groupShare: (share: string, label: string) => string;
|
|
26
|
-
export declare const uncounted
|
|
27
|
-
export declare const holdoutClause: (weight: string) => string;
|
|
28
|
-
export declare const holdoutRemainder
|
|
26
|
+
export declare const uncounted: (control: string) => string;
|
|
27
|
+
export declare const holdoutClause: (weight: string, control: string) => string;
|
|
28
|
+
export declare const holdoutRemainder: (control: string) => string;
|
|
29
|
+
export declare const holdoutContent: (control: string) => string;
|
|
29
30
|
export declare const layerSentence: (name: string, used: number, free: number) => string;
|
|
30
31
|
export declare const peopleLabel: {
|
|
31
32
|
readonly visitor: "visitors";
|
|
@@ -22,10 +22,11 @@ export const NUMBER_OP_LABELS = {
|
|
|
22
22
|
};
|
|
23
23
|
export const participation = (allocation, people, groups)=>`${allocation}% of ${people} take part: about ${groups}`;
|
|
24
24
|
export const eachVersion = (share)=>`${share}% see each version`;
|
|
25
|
-
export const groupShare = (share, label)=>`${share}% see ${label
|
|
26
|
-
export const uncounted =
|
|
27
|
-
export const holdoutClause = (weight)=>`; the holdout (${weight}% of them) sees
|
|
28
|
-
export const holdoutRemainder =
|
|
25
|
+
export const groupShare = (share, label)=>`${share}% see ${label}`;
|
|
26
|
+
export const uncounted = (control)=>`; the rest see ${control} and are not counted`;
|
|
27
|
+
export const holdoutClause = (weight, control)=>`; the holdout (${weight}% of them) sees ${control} and is measured`;
|
|
28
|
+
export const holdoutRemainder = (control)=>`; everyone else sees ${control} and is not counted`;
|
|
29
|
+
export const holdoutContent = (control)=>`Sees ${control}`;
|
|
29
30
|
export const layerSentence = (name, used, free)=>` Uses ${used} of the 100 slices in layer ${name}; ${free} are free.`;
|
|
30
31
|
export const peopleLabel = {
|
|
31
32
|
visitor: 'visitors',
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
export declare const API_MESSAGES: {
|
|
2
2
|
readonly testAlreadyDeleted: "This test was already deleted. Reload the page.";
|
|
3
|
-
readonly deleteInvalidStatus: "
|
|
3
|
+
readonly deleteInvalidStatus: "Only draft and archived tests can be deleted. Open the test to see how to archive it.";
|
|
4
4
|
readonly testNoLongerDraft: "This test is no longer a draft. Reload the page.";
|
|
5
5
|
readonly notFound: "This test no longer exists.";
|
|
6
6
|
readonly goalNotFound: "That goal no longer exists. Choose another goal.";
|
|
7
7
|
readonly roundChanged: "This round has changed. Reload the page.";
|
|
8
8
|
readonly roundNotFound: "That round no longer exists. Choose another round.";
|
|
9
|
-
readonly commitUnverified: "The change may not have been saved. Reload
|
|
9
|
+
readonly commitUnverified: "The change may not have been saved. Reload to check.";
|
|
10
|
+
readonly transactionIsolation: "The site's database settings don't allow this right now. Ask your developer to check the server log.";
|
|
10
11
|
readonly notImplemented: "This isn't available yet.";
|
|
11
12
|
readonly unauthenticated: "Your session has expired. Sign in again.";
|
|
12
13
|
readonly forbidden: "You don't have permission to do this.";
|
|
13
|
-
readonly network: "Couldn't reach the server. Check your connection
|
|
14
|
+
readonly network: "Couldn't reach the server. Check your connection.";
|
|
14
15
|
readonly failed: "Couldn't complete this change. Try again.";
|
|
15
|
-
readonly unreadable: "Couldn't read the server's response. Reload
|
|
16
|
+
readonly unreadable: "Couldn't read the server's response. Reload to check.";
|
|
17
|
+
readonly deleteImpactUnavailable: "Couldn't check what visitors will see after deletion. Reopen this dialog to check again.";
|
|
16
18
|
};
|
|
17
19
|
export declare const LOCKED_MESSAGES: {
|
|
18
20
|
readonly creation: "Set when the test was created.";
|
|
19
|
-
readonly running: "Locked while the test is running
|
|
21
|
+
readonly running: "Locked while the test is running. Stop the test to change this.";
|
|
20
22
|
readonly runningAllocation: "To include more people, use \"Let more people in\" at the bottom of the page. To include fewer, stop the test; the change applies when you start it again.";
|
|
21
|
-
readonly runningMetrics: "
|
|
23
|
+
readonly runningMetrics: "Use \"Add a goal\" to track another goal. The main goal is fixed for this round.";
|
|
22
24
|
readonly decided: "Locked after the decision.";
|
|
23
25
|
readonly archived: "Archived tests can't be changed.";
|
|
24
26
|
readonly other: "Can't be changed in this state.";
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import { unpublishedPlacementsCopy } from './readiness.js';
|
|
2
2
|
export const API_MESSAGES = {
|
|
3
3
|
testAlreadyDeleted: 'This test was already deleted. Reload the page.',
|
|
4
|
-
deleteInvalidStatus: '
|
|
4
|
+
deleteInvalidStatus: 'Only draft and archived tests can be deleted. Open the test to see how to archive it.',
|
|
5
5
|
testNoLongerDraft: 'This test is no longer a draft. Reload the page.',
|
|
6
6
|
notFound: 'This test no longer exists.',
|
|
7
7
|
goalNotFound: 'That goal no longer exists. Choose another goal.',
|
|
8
8
|
roundChanged: 'This round has changed. Reload the page.',
|
|
9
9
|
roundNotFound: 'That round no longer exists. Choose another round.',
|
|
10
|
-
commitUnverified: 'The change may not have been saved. Reload
|
|
10
|
+
commitUnverified: 'The change may not have been saved. Reload to check.',
|
|
11
|
+
transactionIsolation: "The site's database settings don't allow this right now. Ask your developer to check the server log.",
|
|
11
12
|
notImplemented: "This isn't available yet.",
|
|
12
13
|
unauthenticated: 'Your session has expired. Sign in again.',
|
|
13
14
|
forbidden: "You don't have permission to do this.",
|
|
14
|
-
network: "Couldn't reach the server. Check your connection
|
|
15
|
+
network: "Couldn't reach the server. Check your connection.",
|
|
15
16
|
failed: "Couldn't complete this change. Try again.",
|
|
16
|
-
unreadable: "Couldn't read the server's response. Reload
|
|
17
|
+
unreadable: "Couldn't read the server's response. Reload to check.",
|
|
18
|
+
deleteImpactUnavailable: "Couldn't check what visitors will see after deletion. Reopen this dialog to check again."
|
|
17
19
|
};
|
|
18
20
|
export const LOCKED_MESSAGES = {
|
|
19
21
|
creation: 'Set when the test was created.',
|
|
20
|
-
running: 'Locked while the test is running
|
|
22
|
+
running: 'Locked while the test is running. Stop the test to change this.',
|
|
21
23
|
runningAllocation: 'To include more people, use "Let more people in" at the bottom of the page. To include fewer, stop the test; the change applies when you start it again.',
|
|
22
|
-
runningMetrics: '
|
|
24
|
+
runningMetrics: 'Use "Add a goal" to track another goal. The main goal is fixed for this round.',
|
|
23
25
|
decided: 'Locked after the decision.',
|
|
24
26
|
archived: "Archived tests can't be changed.",
|
|
25
27
|
other: "Can't be changed in this state."
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Shared by server readiness checks and client placement lists. */
|
|
2
2
|
export declare const PLACEMENT_LANGUAGES: {
|
|
3
|
+
readonly labelWithCode: (label: string, code: string) => string;
|
|
3
4
|
readonly allLocales: "All languages";
|
|
4
5
|
readonly locales: (names: string) => string;
|
|
5
6
|
};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
export declare const GOAL_ROLES: {
|
|
2
|
+
readonly primary: "Main goal";
|
|
3
|
+
readonly secondary: "Also tracked";
|
|
4
|
+
readonly guardrail: "Must not get worse";
|
|
5
|
+
};
|
|
1
6
|
export declare const METRICS_COPY: {
|
|
2
7
|
readonly source: "Measured by";
|
|
8
|
+
readonly browserWritablePrimary: "Visitors' browsers report this goal. Automated traffic can affect the results. For important decisions, use a goal your server records.";
|
|
3
9
|
readonly revenueHint: "Very large amounts are counted only up to the level that the top 1% of amounts reached in the 90 days before the test starts; totals are always shown in full.";
|
|
4
10
|
};
|
|
5
11
|
export declare const METRIC_KIND_LABELS: {
|
|
@@ -7,3 +13,4 @@ export declare const METRIC_KIND_LABELS: {
|
|
|
7
13
|
readonly count: "count";
|
|
8
14
|
readonly revenue: "amount";
|
|
9
15
|
};
|
|
16
|
+
export declare function percentileTail(quantile: number): number;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
export const GOAL_ROLES = {
|
|
2
|
+
primary: 'Main goal',
|
|
3
|
+
secondary: 'Also tracked',
|
|
4
|
+
guardrail: 'Must not get worse'
|
|
5
|
+
};
|
|
1
6
|
export const METRICS_COPY = {
|
|
2
7
|
source: 'Measured by',
|
|
8
|
+
browserWritablePrimary: "Visitors' browsers report this goal. Automated traffic can affect the results. For important decisions, use a goal your server records.",
|
|
3
9
|
revenueHint: 'Very large amounts are counted only up to the level that the top 1% of amounts reached in the 90 days before the test starts; totals are always shown in full.'
|
|
4
10
|
};
|
|
5
11
|
export const METRIC_KIND_LABELS = {
|
|
@@ -7,3 +13,6 @@ export const METRIC_KIND_LABELS = {
|
|
|
7
13
|
count: 'count',
|
|
8
14
|
revenue: 'amount'
|
|
9
15
|
};
|
|
16
|
+
export function percentileTail(quantile) {
|
|
17
|
+
return Number(((1 - quantile) * 100).toPrecision(12));
|
|
18
|
+
}
|