@picked/client 0.0.1-dev.1785305085063 → 0.0.1-dev.1785908062293
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -0
- package/dist/api-03c5jvVk.js +38 -0
- package/dist/api-CQxCVIrm.cjs +1 -0
- package/dist/cjs/form/index.js +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/dom-observer/index.js +1 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/docs/explanation/conditions-and-the-logic-engine.md +94 -0
- package/dist/docs/explanation/feature-flag-allocation.md +176 -0
- package/dist/docs/explanation/how-picked-works.md +124 -0
- package/dist/docs/explanation/how-pickedql-works.md +76 -0
- package/dist/docs/explanation/pages-and-flows.md +64 -0
- package/dist/docs/explanation/the-content-model.md +77 -0
- package/dist/docs/explanation/the-two-apis.md +68 -0
- package/dist/docs/explanation/why-server-side-rendering.md +76 -0
- package/dist/docs/explanation/workspaces-and-versions.md +71 -0
- package/dist/docs/how-to/add-a-step-field-or-action.md +43 -0
- package/dist/docs/{pickedql/examples.md → how-to/analytics/index.md} +53 -28
- package/dist/docs/how-to/archive-or-delete-a-workspace.md +46 -0
- package/dist/docs/how-to/authenticate-with-a-magic-link.md +40 -0
- package/dist/docs/how-to/authenticate-with-a-password.md +51 -0
- package/dist/docs/how-to/authenticate-with-an-api-key.md +51 -0
- package/dist/docs/how-to/authenticate-with-oauth.md +40 -0
- package/dist/docs/how-to/build-a-flow.md +83 -0
- package/dist/docs/how-to/connect-the-mcp-server.md +38 -0
- package/dist/docs/how-to/create-a-project.md +29 -0
- package/dist/docs/how-to/create-an-experience.md +42 -0
- package/dist/docs/how-to/create-and-revoke-an-api-key.md +37 -0
- package/dist/docs/how-to/debug-with-the-chrome-extension.md +57 -0
- package/dist/docs/how-to/define-a-page-layout.md +39 -0
- package/dist/docs/how-to/fill-and-publish-a-page.md +50 -0
- package/dist/docs/how-to/install-the-gtm-template.md +84 -0
- package/dist/docs/how-to/install-the-sdk.md +68 -0
- package/dist/docs/how-to/install-the-vite-plugin.md +56 -0
- package/dist/docs/how-to/invite-and-remove-members.md +34 -0
- package/dist/docs/how-to/preview-a-workspace.md +28 -0
- package/dist/docs/how-to/publish-a-workspace.md +30 -0
- package/dist/docs/how-to/read-a-feature-flag.md +101 -0
- package/dist/docs/how-to/register-a-component.md +55 -0
- package/dist/docs/how-to/register-an-action-handler.md +67 -0
- package/dist/docs/how-to/render-a-step-form.md +132 -0
- package/dist/docs/how-to/render-an-unpublished-preview.md +41 -0
- package/dist/docs/how-to/reuse-a-section.md +37 -0
- package/dist/docs/how-to/reuse-a-step-field-or-action.md +28 -0
- package/dist/docs/how-to/roll-back-a-published-version.md +26 -0
- package/dist/docs/how-to/run-an-ab-test.md +49 -0
- package/dist/docs/how-to/run-code-on-a-form-submission.md +125 -0
- package/dist/docs/how-to/server-render-a-page.md +81 -0
- package/dist/docs/how-to/set-a-content-security-policy.md +32 -0
- package/dist/docs/how-to/set-up-mfa.md +69 -0
- package/dist/docs/how-to/upload-and-use-an-asset.mdx +73 -0
- package/dist/docs/how-to/validate-a-field.md +52 -0
- package/dist/docs/how-to/write-a-condition.md +45 -0
- package/dist/docs/how-to/write-a-predicate.md +60 -0
- package/dist/docs/index.md +41 -59
- package/dist/docs/reference/dashboard/actions.mdx +53 -0
- package/dist/docs/reference/dashboard/api-keys.mdx +37 -0
- package/dist/docs/reference/dashboard/conditions.mdx +42 -0
- package/dist/docs/reference/dashboard/content/asset-library.mdx +63 -0
- package/dist/docs/reference/dashboard/content/content-entries.mdx +44 -0
- package/dist/docs/reference/dashboard/content/layouts.mdx +62 -0
- package/dist/docs/reference/dashboard/content/pages.mdx +35 -0
- package/dist/docs/reference/dashboard/content/sections.mdx +28 -0
- package/dist/docs/reference/dashboard/experiences.mdx +51 -0
- package/dist/docs/reference/dashboard/features.mdx +114 -0
- package/dist/docs/reference/dashboard/fields.mdx +100 -0
- package/dist/docs/reference/dashboard/flow-builder/canvas.mdx +58 -0
- package/dist/docs/reference/dashboard/flow-builder/condition-builder.md +57 -0
- package/dist/docs/reference/dashboard/flow-builder/keyboard-shortcuts.md +72 -0
- package/dist/docs/reference/dashboard/flow-builder/nodes.md +63 -0
- package/dist/docs/reference/dashboard/projects.mdx +44 -0
- package/dist/docs/reference/dashboard/reports.mdx +43 -0
- package/dist/docs/reference/dashboard/steps.mdx +37 -0
- package/dist/docs/reference/dashboard/team-management.md +29 -0
- package/dist/docs/reference/dashboard/workspace-versioning.mdx +30 -0
- package/dist/docs/reference/dashboard/workspaces.mdx +76 -0
- package/dist/docs/{delivery-api → reference/delivery-api}/experience-content.md +17 -5
- package/dist/docs/reference/delivery-api/index.md +45 -0
- package/dist/docs/reference/delivery-api/preview-caching-crawling.md +79 -0
- package/dist/docs/{delivery-api → reference/delivery-api}/project-config.md +15 -6
- package/dist/docs/reference/glossary.md +173 -0
- package/dist/docs/reference/management-api/authentication.md +74 -0
- package/dist/docs/{api → reference/management-api}/authorization-and-scopes.md +70 -47
- package/dist/docs/reference/management-api/error-handling.md +233 -0
- package/dist/docs/{api → reference/management-api}/pagination.md +36 -20
- package/dist/docs/reference/pickedql/data-sources.md +174 -0
- package/dist/docs/reference/pickedql/dimensions.md +87 -0
- package/dist/docs/{pickedql → reference/pickedql}/filtering.md +17 -6
- package/dist/docs/reference/pickedql/index.md +18 -0
- package/dist/docs/reference/pickedql/schema.md +172 -0
- package/dist/docs/reference/pickedql/virtual-functions.md +237 -0
- package/dist/docs/reference/sdk/actions.md +30 -0
- package/dist/docs/{sdk → reference/sdk}/conditions.md +15 -5
- package/dist/docs/reference/sdk/content-security-policy.md +21 -0
- package/dist/docs/reference/sdk/experiences.md +51 -0
- package/dist/docs/reference/sdk/features.md +233 -0
- package/dist/docs/reference/sdk/fields.md +209 -0
- package/dist/docs/reference/sdk/index.md +68 -0
- package/dist/docs/{sdk → reference/sdk}/plugins/create-experience.md +25 -34
- package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +74 -0
- package/dist/docs/reference/sdk/plugins/index.md +29 -0
- package/dist/docs/{sdk → reference/sdk}/plugins/window-object.md +6 -0
- package/dist/docs/reference/sdk/predicates.md +43 -0
- package/dist/docs/reference/sdk/ssr/index.md +33 -0
- package/dist/docs/reference/sdk/ssr/rendering-and-hydration.md +103 -0
- package/dist/docs/reference/sdk/ssr/serialize.md +77 -0
- package/dist/docs/reference/sdk/ssr/slots-and-placements.md +59 -0
- package/dist/docs/reference/sdk/steps.md +87 -0
- package/dist/docs/reference/tools/chrome-extension.md +16 -0
- package/dist/docs/reference/tools/image-optimisation-service.md +104 -0
- package/dist/docs/reference/tools/mcp.md +88 -0
- package/dist/docs/reference/tools/vite-plugin.md +88 -0
- package/dist/docs/tutorials/first-api-call.md +228 -0
- package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +143 -0
- package/dist/docs/tutorials/first-experience.mdx +255 -0
- package/dist/docs/tutorials/first-server-rendered-page.mdx +186 -0
- package/dist/{dom-BwmTHeT7.js → dom-BqcToNL0.js} +1 -3
- package/dist/{dom-CDrHc_j9.cjs → dom-DlLH3FxV.cjs} +1 -1
- package/dist/esm/form/index.js +2 -4
- package/dist/esm/index.js +225 -186
- package/dist/esm/plugins/dom-observer/index.js +1 -1
- package/dist/esm/plugins/dynamic-experiences/index.js +3 -3
- package/dist/esm/preview/index.js +1 -1
- package/dist/esm/server/index.js +33 -31
- package/dist/{experience-instance-DOJShRk5.js → experience-instance-DGk11d8a.js} +3 -3
- package/dist/experience-instance-Dej3P1sE.cjs +1 -0
- package/dist/plugin-CHOVsx7Z.js +287 -0
- package/dist/plugin-DsaGXQHx.cjs +1 -0
- package/dist/{preview-channel-DW9J8t4B.js → preview-channel-CSr96XAo.js} +1 -1
- package/dist/{protocol-DSqOlW2r.js → protocol-C5KkkiZc.js} +1 -1
- package/dist/types/client.d.ts +7 -6
- package/dist/types/data-source/api.d.ts +60 -0
- package/dist/types/data-source/api.d.ts.map +1 -0
- package/dist/types/data-source/provider.d.ts +97 -0
- package/dist/types/data-source/provider.d.ts.map +1 -0
- package/dist/types/entities/action/action.d.ts +5 -4
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/component/component.d.ts +6 -5
- package/dist/types/entities/component/component.d.ts.map +1 -1
- package/dist/types/entities/condition/condition.d.ts +5 -5
- package/dist/types/entities/content/content.d.ts +4 -3
- package/dist/types/entities/experience/experience.d.ts +11 -10
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +10 -9
- package/dist/types/entities/feature/feature.d.ts +19 -2
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +7 -6
- package/dist/types/entities/framework/framework.d.ts +7 -6
- package/dist/types/entities/framework/framework.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts +6 -6
- package/dist/types/entities/plugin/plugin.d.ts +3 -2
- package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
- package/dist/types/entities/predicate/predicate.d.ts +4 -3
- package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
- package/dist/types/entities/response/response-validation.d.ts +3 -2
- package/dist/types/entities/response/response.d.ts +12 -11
- package/dist/types/entities/session/session.d.ts +2 -1
- package/dist/types/entities/step/step.d.ts +6 -5
- package/dist/types/exports.d.ts +2 -1
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/form/build-responses.d.ts +2 -1
- package/dist/types/form/create-field-evaluator.d.ts +4 -3
- package/dist/types/form/create-field-validation.d.ts +5 -4
- package/dist/types/form/create-form.d.ts +7 -6
- package/dist/types/form/create-submit-pipeline.d.ts +7 -6
- package/dist/types/form/get-step-fields.d.ts +3 -2
- package/dist/types/lifecycle/condition-selection.d.ts +14 -4
- package/dist/types/lifecycle/lifecycle.d.ts +4 -3
- package/dist/types/lifecycle/rules-logic.d.ts +4 -3
- package/dist/types/lifecycle/state-snapshot.d.ts +4 -3
- package/dist/types/picked.d.ts +79 -62
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/ping.d.ts +1 -1
- package/dist/types/ping.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +9 -8
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/plugin.d.ts +3 -2
- package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/serialization.d.ts.map +1 -1
- package/dist/types/plugins/dom-observer/plugin.d.ts +1 -1
- package/dist/types/plugins/dynamic-experiences/hash.d.ts +40 -5
- package/dist/types/plugins/dynamic-experiences/hash.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/index.d.ts +2 -0
- package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +4 -36
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +42 -11
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts +1 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts +1 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts +1 -1
- package/dist/types/plugins/single-page-app/plugin.d.ts +1 -1
- package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
- package/dist/types/plugins/web-components/plugin.d.ts +2 -1
- package/dist/types/plugins/window-object/plugin.d.ts +2 -2
- package/dist/types/preview-channel.d.ts +5 -1
- package/dist/types/preview-receiver/index.d.ts +18 -1
- package/dist/types/preview-receiver/protocol.d.ts +10 -1
- package/dist/types/server/index.d.ts +3 -3
- package/dist/types/server/serialize.d.ts +8 -2
- package/dist/types/server/serialize.d.ts.map +1 -1
- package/dist/types/utils/dom.d.ts +2 -1
- package/dist/types/utils/events.d.ts +6 -6
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/global-obj.d.ts +1 -1
- package/dist/types/utils/global-obj.d.ts.map +1 -1
- package/dist/types/utils/id.d.ts.map +1 -1
- package/dist/types/utils/logger.d.ts +2 -1
- package/dist/types/utils/logger.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +2 -1
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +2 -1
- package/dist/types/utils/node-tree/get-next-node.d.ts +1 -1
- package/dist/types/utils/node-tree/get-next-node.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-origin-node.d.ts +1 -1
- package/dist/types/utils/node-tree/get-origin-node.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +1 -1
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
- package/dist/types/utils/nodes.d.ts +1 -1
- package/dist/types/utils/picked-config.d.ts +2 -1
- package/dist/types/utils/rehydrate-scripts.d.ts +6 -0
- package/dist/types/utils/rehydrate-scripts.d.ts.map +1 -1
- package/dist/types/utils/rules-logic.d.ts +6 -2
- package/dist/types/utils/storage.d.ts +1 -1
- package/dist/types/utils/storage.d.ts.map +1 -1
- package/package.json +22 -23
- package/dist/api-CPL40b7A.js +0 -40
- package/dist/api-Dz5rgRgQ.cjs +0 -1
- package/dist/docs/actions.mdx +0 -78
- package/dist/docs/api/authentication.md +0 -376
- package/dist/docs/api/error-handling.md +0 -211
- package/dist/docs/api/index.md +0 -197
- package/dist/docs/api-keys.mdx +0 -40
- package/dist/docs/chrome-extension.md +0 -51
- package/dist/docs/conditions.mdx +0 -59
- package/dist/docs/content/asset-library.mdx +0 -93
- package/dist/docs/content/content-entries.mdx +0 -30
- package/dist/docs/content/layouts.mdx +0 -70
- package/dist/docs/content/pages.mdx +0 -67
- package/dist/docs/content/sections.mdx +0 -33
- package/dist/docs/delivery-api/index.md +0 -46
- package/dist/docs/delivery-api/preview-caching-crawling.md +0 -59
- package/dist/docs/experiences.mdx +0 -42
- package/dist/docs/features.mdx +0 -58
- package/dist/docs/fields.mdx +0 -79
- package/dist/docs/flow-builder/building-flows.md +0 -61
- package/dist/docs/flow-builder/condition-builder.md +0 -54
- package/dist/docs/flow-builder/keyboard-shortcuts.md +0 -66
- package/dist/docs/flow-builder/nodes.md +0 -43
- package/dist/docs/flow-builder/overview.mdx +0 -50
- package/dist/docs/gtm-template.md +0 -69
- package/dist/docs/guides/build-a-personalized-page.mdx +0 -143
- package/dist/docs/image-optimisation-service.md +0 -80
- package/dist/docs/mcp.md +0 -120
- package/dist/docs/pickedql/data-sources.md +0 -145
- package/dist/docs/pickedql/dimensions.md +0 -65
- package/dist/docs/pickedql/index.md +0 -36
- package/dist/docs/pickedql/schema.md +0 -156
- package/dist/docs/pickedql/virtual-functions.md +0 -204
- package/dist/docs/projects.mdx +0 -37
- package/dist/docs/reports.mdx +0 -18
- package/dist/docs/sdk/actions.md +0 -66
- package/dist/docs/sdk/content-security-policy.md +0 -32
- package/dist/docs/sdk/experiences.md +0 -46
- package/dist/docs/sdk/features.md +0 -212
- package/dist/docs/sdk/fields.md +0 -263
- package/dist/docs/sdk/index.md +0 -83
- package/dist/docs/sdk/plugins/dynamic-experiences.md +0 -58
- package/dist/docs/sdk/plugins/index.md +0 -9
- package/dist/docs/sdk/predicates.md +0 -112
- package/dist/docs/sdk/ssr/index.md +0 -62
- package/dist/docs/sdk/ssr/rendering-and-hydration.md +0 -141
- package/dist/docs/sdk/ssr/serialize.md +0 -86
- package/dist/docs/sdk/ssr/slots-and-placements.md +0 -35
- package/dist/docs/sdk/steps.md +0 -434
- package/dist/docs/steps.mdx +0 -44
- package/dist/docs/team-management.md +0 -40
- package/dist/docs/vite-plugin.md +0 -82
- package/dist/docs/workspace-versioning.mdx +0 -28
- package/dist/docs/workspaces.mdx +0 -102
- package/dist/experience-instance-DurC3pE-.cjs +0 -1
- package/dist/plugin-CFXwbXeM.js +0 -247
- package/dist/plugin-m4qekgtA.cjs +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
/** @file Creates the client-side field validation slice (touched tracking, error stores, staged values). */
|
|
2
|
+
import { type EventCallable, type Store, type StoreWritable } from 'effector';
|
|
3
|
+
import type { Field, FieldValue } from '../entities/field/field';
|
|
4
|
+
import type { ValidationError } from '../entities/response/response';
|
|
5
|
+
import type { Picked } from '../picked';
|
|
5
6
|
export interface FieldValidation {
|
|
6
7
|
/** Dispatch on keyboard input — updates staged values and runs validation if the field has been touched. */
|
|
7
8
|
fieldInputEvent: EventCallable<{
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
/** @file Creates form instances that wire field evaluation, validation, and submission. */
|
|
2
|
+
import { type EventCallable, type Store } from 'effector';
|
|
3
|
+
import type { Field, FieldValue } from '../entities/field/field';
|
|
4
|
+
import type { ExperienceInstance } from '../entities/experience-instance/experience-instance';
|
|
5
|
+
import type { ValidationError } from '../entities/response/response';
|
|
6
|
+
import type { Picked } from '../picked';
|
|
7
|
+
import { type ErrorCallback, type SubmitCallback, type SubmitEventWithCurrentTarget, type SuccessCallback } from './create-submit-pipeline';
|
|
7
8
|
export type FormField = Field & {
|
|
8
9
|
value: FieldValue | undefined;
|
|
9
10
|
/** Validation error for this field, or undefined if valid. */
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
/** @file Submit pipeline for form instances — manages lifecycle, validation, and navigation. */
|
|
2
|
+
import { type Event, type EventCallable, type Store } from 'effector';
|
|
3
|
+
import type { ExperienceInstance } from '../entities/experience-instance/experience-instance';
|
|
4
|
+
import type { ExperienceStep } from '../entities/step/step';
|
|
5
|
+
import type { Field, FieldValue } from '../entities/field/field';
|
|
6
|
+
import type { ValidationError } from '../entities/response/response';
|
|
7
|
+
import type { Picked } from '../picked';
|
|
7
8
|
export type SubmitEventWithCurrentTarget = SubmitEvent & {
|
|
8
9
|
currentTarget: EventTarget & HTMLFormElement;
|
|
9
10
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
/** @file Step field evaluation — resolves field and option visibility conditions. */
|
|
2
|
+
import type { Field } from '../entities/field/field';
|
|
3
|
+
import type { Picked } from '../picked';
|
|
3
4
|
import { evaluateRuleLogic } from '../utils/rules-logic';
|
|
4
5
|
/**
|
|
5
6
|
* Evaluates field and option conditions, returning only the fields that should be visible.
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @file Memoized condition evaluator plus a reactive condition-results store.
|
|
3
|
+
*
|
|
4
|
+
* The results store is keyed by a stable, key-order-independent hash of the rule, so the
|
|
5
|
+
* server's selection (`serialize`) and the client's hydration share results without
|
|
6
|
+
* re-evaluating. A cache hit reads synchronously (driving SSR render and the first
|
|
7
|
+
* client paint); a miss evaluates asynchronously and writes the result back, which
|
|
8
|
+
* propagates reactively to subscribers. Conditions that reference an action are exempt from the
|
|
9
|
+
* cache: they re-evaluate on every call so the action's side effect runs each time.
|
|
10
|
+
*/
|
|
11
|
+
import { type Store } from 'effector';
|
|
12
|
+
import type { Condition } from '../entities/condition/condition';
|
|
13
|
+
import type { LogicObject, LogicRule, LogicValue } from '../logic-engine';
|
|
14
|
+
import type { Picked } from '../picked';
|
|
5
15
|
/** A condition rule that may be json-logic, a raw logic value, or unset. */
|
|
6
16
|
type ConditionRule = LogicRule | LogicValue | undefined;
|
|
7
17
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
/** @file Lifecycle module — owns the SDK start chain as an effector event graph. */
|
|
2
|
+
import { type Effect, type EventCallable, type StoreWritable } from 'effector';
|
|
3
|
+
import type { Picked } from '../picked';
|
|
4
|
+
import type { LogicRule } from '../logic-engine';
|
|
4
5
|
/** Discrete stages of the SDK lifecycle. */
|
|
5
6
|
export type LifecycleStage = 'idle' | 'starting' | 'ready' | 'failed';
|
|
6
7
|
/** A logic-engine gate rule, a literal boolean override, or `undefined` to indicate no gate is configured. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
/** @file Effector effect that evaluates a json-logic rule against the client's reactive state. */
|
|
2
|
+
import { type Effect } from 'effector';
|
|
3
|
+
import type { LogicObject, LogicRule } from '../logic-engine';
|
|
4
|
+
import type { Picked } from '../picked';
|
|
4
5
|
/** Parameters for `evaluateRuleLogicFx` — the rule to evaluate and an optional context override. */
|
|
5
6
|
export interface EvaluateRuleLogicParams {
|
|
6
7
|
rule: LogicRule;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
/** @file State snapshot store — derives an immutable `StateSnapshot` from the client's reactive entity stores via `combine`. */
|
|
2
|
+
import { type Store } from 'effector';
|
|
3
|
+
import type { Picked } from '../picked';
|
|
4
|
+
import type { Field, FieldValue } from '../entities/field/field';
|
|
4
5
|
/** Immutable snapshot of the current client state, suitable for passing to user-supplied predicates, actions, and rule evaluators. */
|
|
5
6
|
export interface StateSnapshot {
|
|
6
7
|
client: Picked;
|
package/dist/types/picked.d.ts
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
1
|
+
/** @file Picked client — the main entry point for the Picked SDK. */
|
|
2
|
+
import { type Effect, type EventCallable, type Store, type StoreWritable } from 'effector';
|
|
3
|
+
import { type Experience, type LaunchExperienceOptions } from './entities/experience/experience';
|
|
4
|
+
import { type Plugin, type PluginConfigIndex } from './entities/plugin/plugin';
|
|
5
|
+
import { type CreateClientOptions } from './client';
|
|
6
|
+
import { type AdaptedComponent } from './entities/component/component';
|
|
7
|
+
import { type Framework } from './entities/framework/framework';
|
|
8
|
+
import { logger } from './utils/logger';
|
|
9
|
+
import { type StateSnapshot } from './lifecycle/state-snapshot';
|
|
10
|
+
import { type EvaluateRuleLogicParams } from './lifecycle/rules-logic';
|
|
11
|
+
import { type ConditionResults } from './lifecycle/condition-selection';
|
|
12
|
+
import { type LifecycleStage } from './lifecycle/lifecycle';
|
|
13
|
+
import type { Predicate } from './entities/predicate/predicate';
|
|
14
|
+
import type { Feature } from './entities/feature/feature';
|
|
15
|
+
import { type EventBusPayload, type EventHistoryStore } from './utils/events';
|
|
16
|
+
import type { Field } from './entities/field/field';
|
|
17
|
+
import type { ExperienceStep } from './entities/step/step';
|
|
18
|
+
import type { Content, ContentDataPatch } from './entities/content/content';
|
|
19
|
+
import type { ContentLoader } from './plugins/dynamic-experiences/types';
|
|
20
|
+
import type { Action } from './entities/action/action';
|
|
21
|
+
import { type Condition } from './entities/condition/condition';
|
|
22
|
+
import type { SessionEntity } from './entities/session/session';
|
|
21
23
|
/**
|
|
22
24
|
* Provenance metadata describing where the Picked client's project config and
|
|
23
25
|
* content came from. Set by `dynamicExperiencesPlugin` when the Vite plugin's
|
|
@@ -34,7 +36,7 @@ export interface PickedDataSource {
|
|
|
34
36
|
workspaceId: string | null;
|
|
35
37
|
}
|
|
36
38
|
export declare class Picked {
|
|
37
|
-
static readonly logger:
|
|
39
|
+
static readonly logger: typeof logger;
|
|
38
40
|
private readonly options;
|
|
39
41
|
/**
|
|
40
42
|
* Provenance metadata for the data backing this client. Populated by
|
|
@@ -42,6 +44,21 @@ export declare class Picked {
|
|
|
42
44
|
* resolvable; remains `null` when the SDK is using the runtime API path.
|
|
43
45
|
*/
|
|
44
46
|
dataSource: PickedDataSource | null;
|
|
47
|
+
/**
|
|
48
|
+
* `versionId` of the SSR snapshot this client was seeded from, set by the framework
|
|
49
|
+
* providers' `seedFromSnapshot`. `null` when no snapshot was seeded — a browser-only client,
|
|
50
|
+
* or a route that rendered without one.
|
|
51
|
+
*/
|
|
52
|
+
seededVersionId: string | null;
|
|
53
|
+
/**
|
|
54
|
+
* Set when a resolved project config disagrees with the seeded snapshot's `versionId`. The
|
|
55
|
+
* snapshot stays authoritative (it is what the server rendered the markup from) and the
|
|
56
|
+
* resolved config is dropped, so this records the divergence rather than hiding it.
|
|
57
|
+
*/
|
|
58
|
+
versionSkew: {
|
|
59
|
+
seeded: string;
|
|
60
|
+
resolved: string;
|
|
61
|
+
} | null;
|
|
45
62
|
/**
|
|
46
63
|
* Content fetcher selected by `dynamicExperiencesPlugin`'s resolution chain. Called
|
|
47
64
|
* by each experience's `prepareExperienceContentFx` (fired in parallel with
|
|
@@ -64,23 +81,23 @@ export declare class Picked {
|
|
|
64
81
|
readonly dashboardUrl: string;
|
|
65
82
|
readonly documentationSiteUrl: string;
|
|
66
83
|
readonly session: SessionEntity;
|
|
67
|
-
readonly searchParams: import(
|
|
84
|
+
readonly searchParams: import(".").PickedSearchParams;
|
|
68
85
|
readonly history: {
|
|
69
86
|
push: EventCallable<{
|
|
70
87
|
experienceId: string;
|
|
71
|
-
node: import(
|
|
88
|
+
node: import(".").ExperienceNode;
|
|
72
89
|
}>;
|
|
73
90
|
replace: EventCallable<{
|
|
74
91
|
experienceId: string;
|
|
75
|
-
node: import(
|
|
92
|
+
node: import(".").ExperienceNode;
|
|
76
93
|
}>;
|
|
77
94
|
back: EventCallable<{
|
|
78
95
|
experienceId?: string;
|
|
79
96
|
}>;
|
|
80
97
|
restore: EventCallable<{
|
|
81
|
-
entries: import(
|
|
98
|
+
entries: import(".").HistoryEntry[];
|
|
82
99
|
}>;
|
|
83
|
-
entriesStore: Store<import(
|
|
100
|
+
entriesStore: Store<import(".").HistoryEntry[]>;
|
|
84
101
|
};
|
|
85
102
|
readonly components: {
|
|
86
103
|
register: EventCallable<{
|
|
@@ -98,16 +115,16 @@ export declare class Picked {
|
|
|
98
115
|
}[]>;
|
|
99
116
|
};
|
|
100
117
|
readonly experienceInstances: {
|
|
101
|
-
spawn: (experience: import(
|
|
102
|
-
getByExperienceKey: (key: Experience[
|
|
103
|
-
getByExperienceId: (id: Experience[
|
|
104
|
-
listStore: Store<import(
|
|
118
|
+
spawn: (experience: import(".").ExperienceStore, target: HTMLElement, options?: LaunchExperienceOptions) => void;
|
|
119
|
+
getByExperienceKey: (key: Experience['key']) => Store<import(".").ExperienceInstance[]>;
|
|
120
|
+
getByExperienceId: (id: Experience['id']) => Store<import(".").ExperienceInstance[]>;
|
|
121
|
+
listStore: Store<import(".").ExperienceInstance[]>;
|
|
105
122
|
};
|
|
106
123
|
readonly experiences: {
|
|
107
124
|
register: EventCallable<Experience>;
|
|
108
|
-
get: (id: Experience[
|
|
109
|
-
getById: (id: Experience[
|
|
110
|
-
getByKey: (key: Experience[
|
|
125
|
+
get: (id: Experience['id']) => Store<import(".").ExperienceStore | undefined>;
|
|
126
|
+
getById: (id: Experience['id']) => Store<import(".").ExperienceStore | undefined>;
|
|
127
|
+
getByKey: (key: Experience['key']) => Store<import(".").ExperienceStore | undefined>;
|
|
111
128
|
launch: Effect<{
|
|
112
129
|
key: string;
|
|
113
130
|
options?: LaunchExperienceOptions;
|
|
@@ -117,12 +134,12 @@ export declare class Picked {
|
|
|
117
134
|
}, void, Error>;
|
|
118
135
|
open: Effect<{
|
|
119
136
|
key: string;
|
|
120
|
-
options?: import(
|
|
137
|
+
options?: import("./exports").OpenExperienceOptions;
|
|
121
138
|
} | {
|
|
122
139
|
id: string;
|
|
123
|
-
options?: import(
|
|
140
|
+
options?: import("./exports").OpenExperienceOptions;
|
|
124
141
|
}, void, Error>;
|
|
125
|
-
listStore: Store<import(
|
|
142
|
+
listStore: Store<import(".").ExperienceStore[]>;
|
|
126
143
|
initialiseExperiencesFx: Effect<void, void, Error>;
|
|
127
144
|
};
|
|
128
145
|
readonly frameworks: {
|
|
@@ -150,15 +167,15 @@ export declare class Picked {
|
|
|
150
167
|
id: string;
|
|
151
168
|
feature: Feature;
|
|
152
169
|
}>;
|
|
153
|
-
getById: (id: string) => Store<import(
|
|
154
|
-
getByName: (name: string) => Store<import(
|
|
155
|
-
listStore: Store<import(
|
|
170
|
+
getById: (id: string) => Store<import(".").FeatureBucket | undefined>;
|
|
171
|
+
getByName: (name: string) => Store<import(".").FeatureIndexItem | undefined>;
|
|
172
|
+
listStore: Store<import(".").FeatureBucket[]>;
|
|
156
173
|
getEvokableFeature: (featureName: string) => Store<() => Promise<boolean | string | undefined>>;
|
|
157
174
|
};
|
|
158
175
|
readonly conditions: {
|
|
159
176
|
register: (condition: Condition) => void;
|
|
160
|
-
getById: (id: Condition[
|
|
161
|
-
getByKey: (key: Condition[
|
|
177
|
+
getById: (id: Condition['id']) => Store<Condition | null>;
|
|
178
|
+
getByKey: (key: Condition['key']) => Store<Condition | null>;
|
|
162
179
|
listStore: Store<Condition[]>;
|
|
163
180
|
indexStore: StoreWritable<{
|
|
164
181
|
[id: string]: Condition;
|
|
@@ -166,41 +183,41 @@ export declare class Picked {
|
|
|
166
183
|
};
|
|
167
184
|
readonly fields: {
|
|
168
185
|
register: (field: Field) => void;
|
|
169
|
-
update: (key: import(
|
|
170
|
-
getById: (id: import(
|
|
171
|
-
getByKey: (key: import(
|
|
186
|
+
update: (key: import(".").FieldBase['key'], updates: Partial<Field>) => void;
|
|
187
|
+
getById: (id: import(".").FieldBase['id']) => Store<Field | null>;
|
|
188
|
+
getByKey: (key: import(".").FieldBase['key']) => Store<Field | null>;
|
|
172
189
|
listStore: Store<Field[]>;
|
|
173
|
-
getByName: (name: import(
|
|
190
|
+
getByName: (name: import(".").FieldBase['name']) => Store<Field | null>;
|
|
174
191
|
};
|
|
175
192
|
readonly responses: {
|
|
176
193
|
register: {
|
|
177
|
-
(fieldKey: Field[
|
|
178
|
-
(payload: Record<Field[
|
|
194
|
+
(fieldKey: Field['key'], response: import(".").Response): void;
|
|
195
|
+
(payload: Record<Field['key'], import(".").Response>, response?: never): void;
|
|
179
196
|
};
|
|
180
197
|
clearAll: EventCallable<void>;
|
|
181
198
|
clear: EventCallable<string>;
|
|
182
|
-
commit: (responsesToCommit: import(
|
|
183
|
-
errors: import(
|
|
199
|
+
commit: (responsesToCommit: import(".").CommitResponses) => Promise<{
|
|
200
|
+
errors: import(".").ValidationError[];
|
|
184
201
|
}>;
|
|
185
|
-
getResponsesToCommit: (responsesToCommit: import(
|
|
186
|
-
responsesToCommit: import(
|
|
187
|
-
validationErrors: import(
|
|
202
|
+
getResponsesToCommit: (responsesToCommit: import(".").CommitResponses) => Promise<{
|
|
203
|
+
responsesToCommit: import(".").CommitResponses;
|
|
204
|
+
validationErrors: import(".").ValidationError[];
|
|
188
205
|
}>;
|
|
189
206
|
listStore: Store<{
|
|
190
207
|
fieldKey: string;
|
|
191
|
-
value: import(
|
|
208
|
+
value: import(".").FieldValue;
|
|
192
209
|
}[]>;
|
|
193
210
|
getAllStore: Store<{
|
|
194
|
-
[fieldKey: string]: import(
|
|
211
|
+
[fieldKey: string]: import(".").FieldValue;
|
|
195
212
|
}>;
|
|
196
|
-
getByFieldId: (id: Field[
|
|
197
|
-
getByFieldKey: (key: Field[
|
|
198
|
-
getByFieldName: (fieldName: Field[
|
|
213
|
+
getByFieldId: (id: Field['id']) => Store<import(".").FieldValue>;
|
|
214
|
+
getByFieldKey: (key: Field['key']) => Store<import(".").FieldValue>;
|
|
215
|
+
getByFieldName: (fieldName: Field['name']) => Store<import(".").FieldValue>;
|
|
199
216
|
};
|
|
200
217
|
readonly steps: {
|
|
201
218
|
register: (step: ExperienceStep) => void;
|
|
202
|
-
getById: (id: ExperienceStep[
|
|
203
|
-
getByKey: (key: ExperienceStep[
|
|
219
|
+
getById: (id: ExperienceStep['id']) => Store<ExperienceStep | null>;
|
|
220
|
+
getByKey: (key: ExperienceStep['key']) => Store<ExperienceStep | null>;
|
|
204
221
|
listStore: Store<ExperienceStep[]>;
|
|
205
222
|
indexStore: StoreWritable<{
|
|
206
223
|
[id: string]: ExperienceStep;
|
|
@@ -209,7 +226,7 @@ export declare class Picked {
|
|
|
209
226
|
readonly contents: {
|
|
210
227
|
register: (content: Content) => void;
|
|
211
228
|
patch: (id: string, apply: ContentDataPatch) => void;
|
|
212
|
-
getById: (id: Content[
|
|
229
|
+
getById: (id: Content['id']) => Store<Content | null>;
|
|
213
230
|
listStore: Store<Content[]>;
|
|
214
231
|
indexStore: StoreWritable<{
|
|
215
232
|
[id: string]: Content;
|
|
@@ -221,9 +238,9 @@ export declare class Picked {
|
|
|
221
238
|
action: Action;
|
|
222
239
|
}>;
|
|
223
240
|
getByKey: (key: string) => Store<Action | undefined>;
|
|
224
|
-
listStore: Store<import(
|
|
241
|
+
listStore: Store<import(".").ActionIndexItem[]>;
|
|
225
242
|
getEvokableAction: (actionKey: string, options?: {
|
|
226
|
-
experience: import(
|
|
243
|
+
experience: import(".").ExperienceInstance;
|
|
227
244
|
}) => Store<() => ReturnType<Action>>;
|
|
228
245
|
};
|
|
229
246
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picked.d.ts","sourceRoot":"","sources":["../../src/picked.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,KAAK,EACV,KAAK,aAAa,EACnB,MAAM,UAAU,CAAA;AACjB,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC7B,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,iBAAiB,EAAe,MAAM,0BAA0B,CAAA;AAC3F,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAEL,KAAK,SAAS,EAEf,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"picked.d.ts","sourceRoot":"","sources":["../../src/picked.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,KAAK,EACV,KAAK,aAAa,EACnB,MAAM,UAAU,CAAA;AACjB,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC7B,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,iBAAiB,EAAe,MAAM,0BAA0B,CAAA;AAC3F,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAEL,KAAK,SAAS,EAEf,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAA4B,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAA;AACzF,OAAO,EAA6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AAM,aAAa,SAAS,KAAG,IAAI,CAE7D;IAED,iBAAiB,cAAe,SAAS,KAAG,IAAI,CAE/C;IAED,aAAa,UAAW,KAAK,KAAG,IAAI,CAEnC;IAED,YAAY,SAAU,cAAc,KAAG,IAAI,CAE1C;IAED,eAAe,YAAa,OAAO,KAAG,IAAI,CAEzC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,YAAY,OAAQ,MAAM,SAAS,gBAAgB,KAAG,IAAI,CAEzD;IAED,cAAc,QAAS,MAAM,UAAU,MAAM,KAAG,IAAI,CAEnD;IAED,kBAAkB,eAAgB,UAAU,KAAG,IAAI,CAMlD;IAED;;;;;;;;;OASG;IAEH,oBAAoB,iBACJ,MAAM,YACV,uBAAuB,KAChC,OAAO,CAAC,IAAI,CAAC,CAEf;IACD;;;;;;;;;OASG;IAEH,qBAAqB,kBACJ,MAAM,YACX,uBAAuB,KAChC,OAAO,CAAC,IAAI,CAAC,CAEf;IAED;;;;;;;;OAQG;IAEH,kBAAkB,iBAAwB,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAE/D;IAED;;;;;;;;OAQG;IAEH,mBAAmB,kBAAyB,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;IAED,OAAO,CAAC,YAAY;IAsBpB,OAAO,CAAC,aAAa;IAsCrB,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,eAAe;IAWvB,eAAe,eAAgB,MAAM,KAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE1F;CACF"}
|
package/dist/types/ping.d.ts
CHANGED
package/dist/types/ping.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ping.d.ts","sourceRoot":"","sources":["../../src/ping.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAKtC;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"ping.d.ts","sourceRoot":"","sources":["../../src/ping.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAKtC;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,WAAkB,MAAM,KAAG,OAAO,CAAC,OAAO,CA2C1D,CAAA"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
/** @file Builder API for creating experiences, steps, conditions, fields, and flow graphs. */
|
|
2
|
+
import type { ActionNode, Experience, ExperienceEdge, ExperienceNode, ExperienceTarget } from '../../entities/experience/experience';
|
|
3
|
+
import type { ExperienceStep } from '../../entities/step/step';
|
|
4
|
+
import type { Condition } from '../../entities/condition/condition';
|
|
5
|
+
import type { AdaptedComponent } from '../../entities/component/component';
|
|
6
|
+
import type { LogicRule, LogicValue } from '../../logic-engine';
|
|
7
|
+
import type { Field, FieldBooleanMultiple, FieldBooleanSingular, FieldNumberMultiple, FieldNumberSingular, FieldObjectMultiple, FieldObjectSingular, FieldTextMultiple, FieldTextSingular, JsonValue } from '../../entities/field/field';
|
|
8
|
+
import { type Serialized } from './serialization';
|
|
8
9
|
export interface SerializedExperience extends Experience {
|
|
9
10
|
steps: ExperienceStep[];
|
|
10
11
|
conditions: Condition[];
|
|
@@ -203,7 +204,7 @@ export declare const createNode: (nodeOptions: CreateNodeOptions, experience: Se
|
|
|
203
204
|
export declare const createEdge: (edgeOptions: CreateEdgeOptions, experience: SerializableExperience) => SerializableEdge;
|
|
204
205
|
export declare const createCondition: (conditionOptions: CreateConditionOptions, experience: SerializableExperience) => SerializableCondition;
|
|
205
206
|
/** @deprecated Use `createCondition` instead. */
|
|
206
|
-
export declare const createConditional:
|
|
207
|
+
export declare const createConditional: typeof createCondition;
|
|
207
208
|
/**
|
|
208
209
|
* Creates a field with optional generic type parameter for object field type safety.
|
|
209
210
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-experience.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/create-experience.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,OAAO,KAAK,EACV,UAAU,EAEV,UAAU,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAGjB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAA;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,KAAK,EACV,KAAK,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACV,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEhE,MAAM,WAAW,oBAAqB,SAAQ,UAAU;IACtD,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,UAAU,EAAE,SAAS,EAAE,CAAA;IACvB,MAAM,EAAE,KAAK,EAAE,CAAA;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAAA;CAC9B;AAED,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IAChD,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,iBAAiB,EAAE,CAAA;IAC3B,UAAU,EAAE,sBAAsB,CAAA;IAClC,QAAQ,EAAE,C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AiB,KAAG,UAoB3D,CAAA;AAED,eAAO,MAAM,kBAAkB,gBAChB,iBAAiB,GAAG,UAAU,cAC/B,sBAAsB,KACjC,gBAwCF,CAAA;AAED,eAAO,MAAM,UAAU,gBACR,iBAAiB,cAClB,sBAAsB,KACjC,gBA2EF,CAAA;AAED,eAAO,MAAM,UAAU,gBACR,iBAAiB,cAClB,sBAAsB,KACjC,gBAkBF,CAAA;AAED,eAAO,MAAM,eAAe,qBACR,sBAAsB,cAC5B,sBAAsB,KACjC,qBAmDF,CAAA;AAED,iDAAiD;AACjD,eAAO,MAAM,iBAAiB,wBAAkB,CAAA;AAEhD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,gBAC3C,kBAAkB,KAC/B,iBAAiB,CAAC,CAAC,CAsOrB,CAAA;AAED,eAAO,MAAM,gBAAgB,eAAgB,uBAAuB,KAAG,sBA4LtE,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
/** @file Plugin that registers builder-created experiences with the client. */
|
|
2
|
+
import type { Plugin } from '../../entities/plugin/plugin';
|
|
3
|
+
import type { SerializableExperience } from './create-experience';
|
|
3
4
|
interface CreateExperiencePluginOptions {
|
|
4
5
|
experiences: SerializableExperience[];
|
|
5
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/plugin.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAE1D,OAAO,KAAK,EAAwB,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAGvF,UAAU,6BAA6B;IACrC,WAAW,EAAE,sBAAsB,EAAE,CAAA;CACtC;AAED,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/plugin.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAE1D,OAAO,KAAK,EAAwB,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAGvF,UAAU,6BAA6B;IACrC,WAAW,EAAE,sBAAsB,EAAE,CAAA;CACtC;AAED,eAAO,MAAM,sBAAsB,YAAa,6BAA6B,KAAG,MA0B/E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/serialization.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,MAAM,CAAA;AAElC,eAAO,MAAM,aAAa;
|
|
1
|
+
{"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/serialization.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,MAAM,CAAA;AAElC,eAAO,MAAM,aAAa;IACxB,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;IAGnC,WAAW,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC;CAGtC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Plugin } from '../../entities/plugin/plugin';
|
|
1
|
+
import type { Plugin } from '../../entities/plugin/plugin';
|
|
2
2
|
/**
|
|
3
3
|
* Watches the document for `childList` mutations and reconciles experiences
|
|
4
4
|
* whose declared target selectors match newly added DOM subtrees. Each
|
|
@@ -1,18 +1,53 @@
|
|
|
1
|
+
/** @file Deterministic, independent per-feature bucket allocation for A/B testing. */
|
|
1
2
|
/**
|
|
2
3
|
* FNV-1a 32-bit hash.
|
|
3
4
|
* Deterministic, fast, well-distributed for short strings.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} input - String to hash.
|
|
7
|
+
* @returns {number} Unsigned 32-bit hash.
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* fnv1a32('sess_1:winter-sale')
|
|
11
|
+
* ```
|
|
4
12
|
*/
|
|
5
13
|
export declare function fnv1a32(input: string): number;
|
|
6
14
|
/**
|
|
7
15
|
* Deterministic dice roll for A/B testing.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
16
|
+
*
|
|
17
|
+
* Returns a value 0–99 that is stable for a given session and feature. Seeding
|
|
18
|
+
* on the feature as well as the session keeps flags independent of one another:
|
|
19
|
+
* two flags at weight 50 each take half of sessions, and a quarter of sessions
|
|
20
|
+
* land in both. Independence rests on the avalanche in {@link fmix32}, not on
|
|
21
|
+
* the seed alone.
|
|
22
|
+
*
|
|
23
|
+
* The feature version keys the stored bucket rather than the roll, so
|
|
24
|
+
* publishing a new version re-runs `decide` against the current weight and an
|
|
25
|
+
* unchanged weight keeps the same audience.
|
|
26
|
+
*
|
|
27
|
+
* @param {string} sessionId - Current session id, stable across page loads.
|
|
28
|
+
* @param {string} featureId - Feature the roll is for.
|
|
29
|
+
* @returns {number} A value in the range 0–99.
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const diceRoll = featureDiceRoll('sess_1', 'winter-sale')
|
|
33
|
+
* ```
|
|
10
34
|
*/
|
|
11
|
-
export declare function
|
|
35
|
+
export declare function featureDiceRoll(sessionId: string, featureId: string): number;
|
|
12
36
|
/**
|
|
13
37
|
* Whether the given dice roll falls within the feature's weight.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
38
|
+
*
|
|
39
|
+
* Widening a weight admits sessions the narrower weight excluded and never
|
|
40
|
+
* evicts one already inside, so a rollout can ratchet up without re-bucketing
|
|
41
|
+
* anyone. The roll is per feature, so this describes one feature's own weight
|
|
42
|
+
* changing over time; two features at the same weight overlap by chance.
|
|
43
|
+
*
|
|
44
|
+
* @param {number} diceRoll - Roll from {@link featureDiceRoll}, 0–99.
|
|
45
|
+
* @param {number} weight - Feature weight, 0–100.
|
|
46
|
+
* @returns {boolean} Whether the session is allocated to the feature.
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* isAllocated(42, 50) // true
|
|
50
|
+
* ```
|
|
16
51
|
*/
|
|
17
52
|
export declare function isAllocated(diceRoll: number, weight: number): boolean;
|
|
18
53
|
//# sourceMappingURL=hash.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/hash.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/hash.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAY7C;AA8BD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAUrE"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** @file Public exports for the dynamic-experiences plugin (project config + per-experience content resolution). */
|
|
2
2
|
export { dynamicExperiencesPlugin, fetchExperienceContent, fetchProject } from './plugin';
|
|
3
3
|
export { createClientHeaders } from '../../utils/client-headers';
|
|
4
|
+
export { createPickedDataProvider, resolveVirtualDataModule, isVirtualPickedData, } from '../../data-source/provider';
|
|
5
|
+
export type { PickedDataMode, PickedDataProvider, PickedDataProviderMeta, PickedDataProviderOptions, } from '../../data-source/provider';
|
|
4
6
|
export type * from './types';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/index.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAChE,mBAAmB,SAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/index.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,4BAA4B,CAAA;AACnC,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,4BAA4B,CAAA;AACnC,mBAAmB,SAAS,CAAA"}
|