@picked/client 0.0.1-dev.1794460939512 → 0.0.1-dev.1794524488993
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 -1
- package/dist/{api-DpESrsVW.js → api-BPgIOr9M.js} +1 -1
- package/dist/{api-CwgMIHfV.cjs → api-CPcoVcOk.cjs} +1 -1
- package/dist/cjs/client.d.ts +161 -0
- package/dist/cjs/client.d.ts.map +1 -0
- package/dist/cjs/data-source/api.d.ts +60 -0
- package/dist/cjs/data-source/api.d.ts.map +1 -0
- package/dist/cjs/data-source/preview-unavailable.d.ts +21 -0
- package/dist/cjs/data-source/preview-unavailable.d.ts.map +1 -0
- package/dist/cjs/data-source/provider.d.ts +108 -0
- package/dist/cjs/data-source/provider.d.ts.map +1 -0
- package/dist/cjs/data-source/registry.d.ts +26 -0
- package/dist/cjs/data-source/registry.d.ts.map +1 -0
- package/dist/cjs/data-source/request-observer.d.ts +75 -0
- package/dist/cjs/data-source/request-observer.d.ts.map +1 -0
- package/dist/cjs/data-source/virtual-data.d.ts +19 -0
- package/dist/cjs/data-source/virtual-data.d.ts.map +1 -0
- package/dist/cjs/entities/action/action.d.ts +156 -0
- package/dist/cjs/entities/action/action.d.ts.map +1 -0
- package/dist/cjs/entities/component/component.d.ts +91 -0
- package/dist/cjs/entities/component/component.d.ts.map +1 -0
- package/dist/cjs/entities/component/lazyComponent.d.ts +11 -0
- package/dist/cjs/entities/component/lazyComponent.d.ts.map +1 -0
- package/dist/cjs/entities/condition/condition.d.ts +29 -0
- package/dist/cjs/entities/condition/condition.d.ts.map +1 -0
- package/dist/cjs/entities/content/content.d.ts +53 -0
- package/dist/cjs/entities/content/content.d.ts.map +1 -0
- package/dist/cjs/entities/content/reference.d.ts +101 -0
- package/dist/cjs/entities/content/reference.d.ts.map +1 -0
- package/dist/cjs/entities/experience/experience.d.ts +228 -0
- package/dist/cjs/entities/experience/experience.d.ts.map +1 -0
- package/dist/cjs/entities/experience-instance/action-result.d.ts +69 -0
- package/dist/cjs/entities/experience-instance/action-result.d.ts.map +1 -0
- package/dist/cjs/entities/experience-instance/experience-instance.d.ts +112 -0
- package/dist/cjs/entities/experience-instance/experience-instance.d.ts.map +1 -0
- package/dist/cjs/entities/feature/feature.d.ts +158 -0
- package/dist/cjs/entities/feature/feature.d.ts.map +1 -0
- package/dist/cjs/entities/field/field.d.ts +135 -0
- package/dist/cjs/entities/field/field.d.ts.map +1 -0
- package/dist/cjs/entities/field/policies.d.ts +35 -0
- package/dist/cjs/entities/field/policies.d.ts.map +1 -0
- package/dist/cjs/entities/framework/framework.d.ts +45 -0
- package/dist/cjs/entities/framework/framework.d.ts.map +1 -0
- package/dist/cjs/entities/history/history.d.ts +25 -0
- package/dist/cjs/entities/history/history.d.ts.map +1 -0
- package/dist/cjs/entities/plugin/plugin.d.ts +50 -0
- package/dist/cjs/entities/plugin/plugin.d.ts.map +1 -0
- package/dist/cjs/entities/predicate/predicate.d.ts +48 -0
- package/dist/cjs/entities/predicate/predicate.d.ts.map +1 -0
- package/dist/cjs/entities/response/response-validation.d.ts +75 -0
- package/dist/cjs/entities/response/response-validation.d.ts.map +1 -0
- package/dist/cjs/entities/response/response.d.ts +69 -0
- package/dist/cjs/entities/response/response.d.ts.map +1 -0
- package/dist/cjs/entities/session/session.d.ts +55 -0
- package/dist/cjs/entities/session/session.d.ts.map +1 -0
- package/dist/cjs/entities/step/step.d.ts +56 -0
- package/dist/cjs/entities/step/step.d.ts.map +1 -0
- package/dist/cjs/entities/workspace/workspace.d.ts +37 -0
- package/dist/cjs/entities/workspace/workspace.d.ts.map +1 -0
- package/dist/cjs/exports.d.ts +34 -0
- package/dist/cjs/exports.d.ts.map +1 -0
- package/dist/cjs/form/build-responses.d.ts +18 -0
- package/dist/cjs/form/build-responses.d.ts.map +1 -0
- package/dist/cjs/form/create-field-evaluator.d.ts +28 -0
- package/dist/cjs/form/create-field-evaluator.d.ts.map +1 -0
- package/dist/cjs/form/create-field-validation.d.ts +60 -0
- package/dist/cjs/form/create-field-validation.d.ts.map +1 -0
- package/dist/cjs/form/create-form.d.ts +155 -0
- package/dist/cjs/form/create-form.d.ts.map +1 -0
- package/dist/cjs/form/create-submit-pipeline.d.ts +116 -0
- package/dist/cjs/form/create-submit-pipeline.d.ts.map +1 -0
- package/dist/cjs/form/get-step-fields.d.ts +19 -0
- package/dist/cjs/form/get-step-fields.d.ts.map +1 -0
- package/dist/cjs/form/index.d.ts +11 -0
- package/dist/cjs/form/index.d.ts.map +1 -0
- package/dist/cjs/index.d.ts +27 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/lifecycle/condition-selection.d.ts +146 -0
- package/dist/cjs/lifecycle/condition-selection.d.ts.map +1 -0
- package/dist/cjs/lifecycle/lifecycle.d.ts +48 -0
- package/dist/cjs/lifecycle/lifecycle.d.ts.map +1 -0
- package/dist/cjs/lifecycle/rules-logic.d.ts +25 -0
- package/dist/cjs/lifecycle/rules-logic.d.ts.map +1 -0
- package/dist/cjs/lifecycle/state-snapshot.d.ts +38 -0
- package/dist/cjs/lifecycle/state-snapshot.d.ts.map +1 -0
- package/dist/cjs/logic-engine.d.ts +38 -0
- package/dist/cjs/logic-engine.d.ts.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/picked.d.ts +468 -0
- package/dist/cjs/picked.d.ts.map +1 -0
- package/dist/cjs/plugins/create-experience/create-experience.d.ts +221 -0
- package/dist/cjs/plugins/create-experience/create-experience.d.ts.map +1 -0
- package/dist/cjs/plugins/create-experience/index.d.ts +6 -0
- package/dist/cjs/plugins/create-experience/index.d.ts.map +1 -0
- package/dist/cjs/plugins/create-experience/plugin.d.ts +9 -0
- package/dist/cjs/plugins/create-experience/plugin.d.ts.map +1 -0
- package/dist/cjs/plugins/create-experience/serialization.d.ts +6 -0
- package/dist/cjs/plugins/create-experience/serialization.d.ts.map +1 -0
- package/dist/cjs/plugins/dom-observer/index.d.ts +3 -0
- package/dist/cjs/plugins/dom-observer/index.d.ts.map +1 -0
- package/dist/cjs/plugins/dom-observer/plugin.d.ts +50 -0
- package/dist/cjs/plugins/dom-observer/plugin.d.ts.map +1 -0
- package/dist/cjs/plugins/dynamic-experiences/hash.d.ts +105 -0
- package/dist/cjs/plugins/dynamic-experiences/hash.d.ts.map +1 -0
- package/dist/cjs/plugins/dynamic-experiences/index.d.ts +8 -0
- package/dist/cjs/plugins/dynamic-experiences/index.d.ts.map +1 -0
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/plugins/dynamic-experiences/plugin.d.ts +53 -0
- package/dist/cjs/plugins/dynamic-experiences/plugin.d.ts.map +1 -0
- package/dist/cjs/plugins/dynamic-experiences/types.d.ts +48 -0
- package/dist/cjs/plugins/dynamic-experiences/types.d.ts.map +1 -0
- package/dist/cjs/plugins/experience-browser-storage/index.d.ts +2 -0
- package/dist/cjs/plugins/experience-browser-storage/index.d.ts.map +1 -0
- package/dist/cjs/plugins/experience-browser-storage/plugin.d.ts +7 -0
- package/dist/cjs/plugins/experience-browser-storage/plugin.d.ts.map +1 -0
- package/dist/cjs/plugins/history-browser-storage/index.d.ts +2 -0
- package/dist/cjs/plugins/history-browser-storage/index.d.ts.map +1 -0
- package/dist/cjs/plugins/history-browser-storage/plugin.d.ts +7 -0
- package/dist/cjs/plugins/history-browser-storage/plugin.d.ts.map +1 -0
- package/dist/cjs/plugins/responses-browser-storage/index.d.ts +2 -0
- package/dist/cjs/plugins/responses-browser-storage/index.d.ts.map +1 -0
- package/dist/cjs/plugins/responses-browser-storage/plugin.d.ts +18 -0
- package/dist/cjs/plugins/responses-browser-storage/plugin.d.ts.map +1 -0
- package/dist/cjs/plugins/responses-indexeddb/index.d.ts +2 -0
- package/dist/cjs/plugins/responses-indexeddb/index.d.ts.map +1 -0
- package/dist/cjs/plugins/responses-indexeddb/plugin.d.ts +3 -0
- package/dist/cjs/plugins/responses-indexeddb/plugin.d.ts.map +1 -0
- package/dist/cjs/plugins/single-page-app/index.d.ts +3 -0
- package/dist/cjs/plugins/single-page-app/index.d.ts.map +1 -0
- package/dist/cjs/plugins/single-page-app/plugin.d.ts +32 -0
- package/dist/cjs/plugins/single-page-app/plugin.d.ts.map +1 -0
- package/dist/cjs/plugins/telemetry/emit.d.ts +18 -0
- package/dist/cjs/plugins/telemetry/emit.d.ts.map +1 -0
- package/dist/cjs/plugins/telemetry/index.d.ts +4 -0
- package/dist/cjs/plugins/telemetry/index.d.ts.map +1 -0
- package/dist/cjs/plugins/telemetry/plugin-summary.d.ts +10 -0
- package/dist/cjs/plugins/telemetry/plugin-summary.d.ts.map +1 -0
- package/dist/cjs/plugins/telemetry/plugin.d.ts +47 -0
- package/dist/cjs/plugins/telemetry/plugin.d.ts.map +1 -0
- package/dist/cjs/plugins/web-components/index.d.ts +2 -0
- package/dist/cjs/plugins/web-components/index.d.ts.map +1 -0
- package/dist/cjs/plugins/web-components/plugin.d.ts +4 -0
- package/dist/cjs/plugins/web-components/plugin.d.ts.map +1 -0
- package/dist/cjs/plugins/window-object/index.d.ts +2 -0
- package/dist/cjs/plugins/window-object/index.d.ts.map +1 -0
- package/dist/cjs/plugins/window-object/plugin.d.ts +9 -0
- package/dist/cjs/plugins/window-object/plugin.d.ts.map +1 -0
- package/dist/cjs/preview/index.d.ts +18 -0
- package/dist/cjs/preview/index.d.ts.map +1 -0
- package/dist/cjs/preview-bridge/index.d.ts +14 -0
- package/dist/cjs/preview-bridge/index.d.ts.map +1 -0
- package/dist/cjs/preview-channel.d.ts +16 -0
- package/dist/cjs/preview-channel.d.ts.map +1 -0
- package/dist/cjs/preview-receiver/apply-ops.d.ts +32 -0
- package/dist/cjs/preview-receiver/apply-ops.d.ts.map +1 -0
- package/dist/cjs/preview-receiver/index.d.ts +32 -0
- package/dist/cjs/preview-receiver/index.d.ts.map +1 -0
- package/dist/cjs/preview-receiver/protocol.d.ts +69 -0
- package/dist/cjs/preview-receiver/protocol.d.ts.map +1 -0
- package/dist/cjs/schema-registry.d.ts +240 -0
- package/dist/cjs/schema-registry.d.ts.map +1 -0
- package/dist/cjs/server/hydrate.d.ts +21 -0
- package/dist/cjs/server/hydrate.d.ts.map +1 -0
- package/dist/cjs/server/index.d.ts +28 -0
- package/dist/cjs/server/index.d.ts.map +1 -0
- package/dist/cjs/server/index.js +1 -1
- package/dist/cjs/server/serialize.d.ts +89 -0
- package/dist/cjs/server/serialize.d.ts.map +1 -0
- package/dist/cjs/storage.d.ts +6 -0
- package/dist/cjs/storage.d.ts.map +1 -0
- package/dist/cjs/typed-content.d.ts +30 -0
- package/dist/cjs/typed-content.d.ts.map +1 -0
- package/dist/cjs/utils/api-url.d.ts +2 -0
- package/dist/cjs/utils/api-url.d.ts.map +1 -0
- package/dist/cjs/utils/client-telemetry.d.ts +25 -0
- package/dist/cjs/utils/client-telemetry.d.ts.map +1 -0
- package/dist/cjs/utils/content-path.d.ts +37 -0
- package/dist/cjs/utils/content-path.d.ts.map +1 -0
- package/dist/cjs/utils/devtools-experience.d.ts +4 -0
- package/dist/cjs/utils/devtools-experience.d.ts.map +1 -0
- package/dist/cjs/utils/dom.d.ts +20 -0
- package/dist/cjs/utils/dom.d.ts.map +1 -0
- package/dist/cjs/utils/events.d.ts +129 -0
- package/dist/cjs/utils/events.d.ts.map +1 -0
- package/dist/cjs/utils/global-obj.d.ts +10 -0
- package/dist/cjs/utils/global-obj.d.ts.map +1 -0
- package/dist/cjs/utils/html-asset-value.d.ts +20 -0
- package/dist/cjs/utils/html-asset-value.d.ts.map +1 -0
- package/dist/cjs/utils/id.d.ts +11 -0
- package/dist/cjs/utils/id.d.ts.map +1 -0
- package/dist/cjs/utils/indexed-db.d.ts +12 -0
- package/dist/cjs/utils/indexed-db.d.ts.map +1 -0
- package/dist/cjs/utils/inert-script-report.d.ts +40 -0
- package/dist/cjs/utils/inert-script-report.d.ts.map +1 -0
- package/dist/cjs/utils/logger.d.ts +3 -0
- package/dist/cjs/utils/logger.d.ts.map +1 -0
- package/dist/cjs/utils/node-tree/get-next-node-from-action.d.ts +25 -0
- package/dist/cjs/utils/node-tree/get-next-node-from-action.d.ts.map +1 -0
- package/dist/cjs/utils/node-tree/get-next-node-from-condition.d.ts +17 -0
- package/dist/cjs/utils/node-tree/get-next-node-from-condition.d.ts.map +1 -0
- package/dist/cjs/utils/node-tree/get-next-node.d.ts +3 -0
- package/dist/cjs/utils/node-tree/get-next-node.d.ts.map +1 -0
- package/dist/cjs/utils/node-tree/get-origin-node.d.ts +3 -0
- package/dist/cjs/utils/node-tree/get-origin-node.d.ts.map +1 -0
- package/dist/cjs/utils/node-tree/min-max-steps-to-leaf.d.ts +21 -0
- package/dist/cjs/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -0
- package/dist/cjs/utils/node-tree/min-max-steps-to-origin.d.ts +23 -0
- package/dist/cjs/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -0
- package/dist/cjs/utils/node-tree/next-reachable-step-nodes.d.ts +37 -0
- package/dist/cjs/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -0
- package/dist/cjs/utils/node-tree/node-adjacency.d.ts +50 -0
- package/dist/cjs/utils/node-tree/node-adjacency.d.ts.map +1 -0
- package/dist/cjs/utils/node-tree/node-tree-index.d.ts +57 -0
- package/dist/cjs/utils/node-tree/node-tree-index.d.ts.map +1 -0
- package/dist/cjs/utils/nodes.d.ts +7 -0
- package/dist/cjs/utils/nodes.d.ts.map +1 -0
- package/dist/cjs/utils/object.d.ts +49 -0
- package/dist/cjs/utils/object.d.ts.map +1 -0
- package/dist/cjs/utils/picked-config.d.ts +39 -0
- package/dist/cjs/utils/picked-config.d.ts.map +1 -0
- package/dist/cjs/utils/preview-session.d.ts +12 -0
- package/dist/cjs/utils/preview-session.d.ts.map +1 -0
- package/dist/cjs/utils/rehydrate-scripts.d.ts +50 -0
- package/dist/cjs/utils/rehydrate-scripts.d.ts.map +1 -0
- package/dist/cjs/utils/render-string.d.ts +24 -0
- package/dist/cjs/utils/render-string.d.ts.map +1 -0
- package/dist/cjs/utils/rules-logic.d.ts +36 -0
- package/dist/cjs/utils/rules-logic.d.ts.map +1 -0
- package/dist/cjs/utils/search-params.d.ts +26 -0
- package/dist/cjs/utils/search-params.d.ts.map +1 -0
- package/dist/cjs/utils/storage.d.ts +385 -0
- package/dist/cjs/utils/storage.d.ts.map +1 -0
- package/dist/cjs/utils/supports.d.ts +97 -0
- package/dist/cjs/utils/supports.d.ts.map +1 -0
- package/dist/cjs/utils/user-timing.d.ts +21 -0
- package/dist/cjs/utils/user-timing.d.ts.map +1 -0
- package/dist/cjs/utils/version.d.ts +2 -0
- package/dist/cjs/utils/version.d.ts.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
- package/dist/esm/server/index.js +2 -2
- package/dist/{plugin-UA4qhlvs.cjs → plugin-C-4rIh44.cjs} +1 -1
- package/dist/{plugin-C7lY7wA0.js → plugin-C9tjxmv9.js} +2 -2
- package/dist/{preview-unavailable-D5JVXP6H.js → preview-unavailable-7lhCKSQG.js} +1 -1
- package/dist/{preview-unavailable-DcA7cGAO.cjs → preview-unavailable-CG-i-Ish.cjs} +1 -1
- package/dist/{provider-ZrjYdXty.cjs → provider-BA1KvzJM.cjs} +1 -1
- package/dist/{provider-B3lHhG5v.js → provider-CAsL7WcN.js} +1 -1
- package/dist/types/client.d.ts +7 -7
- package/dist/types/data-source/provider.d.ts +3 -3
- package/dist/types/data-source/registry.d.ts +1 -1
- package/dist/types/data-source/virtual-data.d.ts +1 -1
- package/dist/types/entities/action/action.d.ts +3 -3
- package/dist/types/entities/component/component.d.ts +4 -4
- package/dist/types/entities/condition/condition.d.ts +1 -1
- package/dist/types/entities/content/reference.d.ts +1 -1
- package/dist/types/entities/experience/experience.d.ts +7 -7
- package/dist/types/entities/experience-instance/action-result.d.ts +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +6 -6
- package/dist/types/entities/feature/feature.d.ts +2 -2
- package/dist/types/entities/field/field.d.ts +2 -2
- package/dist/types/entities/framework/framework.d.ts +3 -3
- package/dist/types/entities/history/history.d.ts +1 -1
- package/dist/types/entities/plugin/plugin.d.ts +1 -1
- package/dist/types/entities/predicate/predicate.d.ts +2 -2
- package/dist/types/entities/response/response-validation.d.ts +2 -2
- package/dist/types/entities/response/response.d.ts +5 -5
- package/dist/types/entities/step/step.d.ts +1 -1
- package/dist/types/exports.d.ts +20 -20
- package/dist/types/form/build-responses.d.ts +1 -1
- package/dist/types/form/create-field-evaluator.d.ts +2 -2
- package/dist/types/form/create-field-validation.d.ts +3 -3
- package/dist/types/form/create-form.d.ts +5 -5
- package/dist/types/form/create-submit-pipeline.d.ts +6 -6
- package/dist/types/form/get-step-fields.d.ts +3 -3
- package/dist/types/form/index.d.ts +9 -9
- package/dist/types/index.d.ts +25 -25
- package/dist/types/lifecycle/condition-selection.d.ts +3 -3
- package/dist/types/lifecycle/lifecycle.d.ts +2 -2
- package/dist/types/lifecycle/rules-logic.d.ts +2 -2
- package/dist/types/lifecycle/state-snapshot.d.ts +2 -2
- package/dist/types/picked.d.ts +74 -74
- package/dist/types/plugins/create-experience/create-experience.d.ts +8 -8
- package/dist/types/plugins/create-experience/index.d.ts +4 -4
- package/dist/types/plugins/create-experience/plugin.d.ts +2 -2
- package/dist/types/plugins/dom-observer/index.d.ts +1 -1
- package/dist/types/plugins/dom-observer/plugin.d.ts +1 -1
- package/dist/types/plugins/dynamic-experiences/index.d.ts +3 -3
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +3 -3
- package/dist/types/plugins/experience-browser-storage/index.d.ts +1 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts +1 -1
- package/dist/types/plugins/history-browser-storage/index.d.ts +1 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts +1 -1
- package/dist/types/plugins/responses-browser-storage/index.d.ts +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts +1 -1
- package/dist/types/plugins/responses-indexeddb/index.d.ts +1 -1
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts +1 -1
- package/dist/types/plugins/single-page-app/index.d.ts +2 -2
- package/dist/types/plugins/single-page-app/plugin.d.ts +1 -1
- package/dist/types/plugins/telemetry/index.d.ts +2 -2
- package/dist/types/plugins/telemetry/plugin.d.ts +1 -1
- package/dist/types/plugins/web-components/index.d.ts +1 -1
- package/dist/types/plugins/web-components/plugin.d.ts +1 -1
- package/dist/types/plugins/window-object/index.d.ts +1 -1
- package/dist/types/plugins/window-object/plugin.d.ts +2 -2
- package/dist/types/preview/index.d.ts +6 -6
- package/dist/types/preview-channel.d.ts +1 -1
- package/dist/types/preview-receiver/index.d.ts +1 -1
- package/dist/types/preview-receiver/protocol.d.ts +1 -1
- package/dist/types/schema-registry.d.ts +2 -2
- package/dist/types/server/hydrate.d.ts +2 -2
- package/dist/types/server/index.d.ts +9 -9
- package/dist/types/server/serialize.d.ts +1 -1
- package/dist/types/storage.d.ts +1 -1
- package/dist/types/typed-content.d.ts +2 -2
- package/dist/types/utils/client-telemetry.d.ts +1 -1
- package/dist/types/utils/dom.d.ts +1 -1
- package/dist/types/utils/events.d.ts +5 -5
- package/dist/types/utils/global-obj.d.ts +1 -1
- package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +1 -1
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +1 -1
- package/dist/types/utils/node-tree/get-next-node.d.ts +1 -1
- package/dist/types/utils/node-tree/get-origin-node.d.ts +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +2 -2
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +2 -2
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +2 -2
- package/dist/types/utils/node-tree/node-adjacency.d.ts +1 -1
- package/dist/types/utils/node-tree/node-tree-index.d.ts +2 -2
- package/dist/types/utils/nodes.d.ts +1 -1
- package/dist/types/utils/picked-config.d.ts +1 -1
- package/dist/types/utils/rules-logic.d.ts +2 -2
- package/dist/types/utils/storage.d.ts +1 -1
- package/package.json +141 -56
|
@@ -0,0 +1,221 @@
|
|
|
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.js';
|
|
3
|
+
import type { ExperienceStep } from '../../entities/step/step.js';
|
|
4
|
+
import type { Condition } from '../../entities/condition/condition.js';
|
|
5
|
+
import type { AdaptedComponent } from '../../entities/component/component.js';
|
|
6
|
+
import type { LogicRule, LogicValue } from '../../logic-engine.js';
|
|
7
|
+
import type { Field, FieldBooleanMultiple, FieldBooleanSingular, FieldNumberMultiple, FieldNumberSingular, FieldObjectMultiple, FieldObjectSingular, FieldTextMultiple, FieldTextSingular, JsonValue } from '../../entities/field/field.js';
|
|
8
|
+
import type { FieldPolicies } from '../../entities/field/policies.js';
|
|
9
|
+
import { type Serialized } from './serialization.js';
|
|
10
|
+
export interface SerializedExperience extends Experience {
|
|
11
|
+
steps: ExperienceStep[];
|
|
12
|
+
conditions: Condition[];
|
|
13
|
+
fields: Field[];
|
|
14
|
+
}
|
|
15
|
+
export interface Nodeable {
|
|
16
|
+
node: SerializableNode | null;
|
|
17
|
+
}
|
|
18
|
+
export interface SerializableStep extends Nodeable {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
key: string;
|
|
22
|
+
fields: SerializableField[];
|
|
23
|
+
experience: SerializableExperience;
|
|
24
|
+
nextStep: (stepOptions: CreateStepOptions | SerializableStep) => SerializableStep;
|
|
25
|
+
nextCondition: (conditionOptions: CreateConditionOptions | SerializableCondition) => SerializableCondition;
|
|
26
|
+
/** @deprecated Use `nextCondition` instead. */
|
|
27
|
+
nextConditional: (conditionOptions: CreateConditionOptions | SerializableCondition) => SerializableCondition;
|
|
28
|
+
addNextExperience: (experience: SerializableExperience) => SerializableExperience;
|
|
29
|
+
addField: (fieldOptions: CreateFieldOptions | SerializableField) => SerializableField;
|
|
30
|
+
serialize: () => Serialized<ExperienceStep>;
|
|
31
|
+
}
|
|
32
|
+
export interface CreateStepOptions {
|
|
33
|
+
id?: string;
|
|
34
|
+
key?: string;
|
|
35
|
+
name: string;
|
|
36
|
+
fields?: SerializableField[];
|
|
37
|
+
}
|
|
38
|
+
export type SerializableNode = SerializableStepNode | SerializableConditionNode | SerializableLaunchExperienceNode | SerializableOriginNode | SerializableActionNode;
|
|
39
|
+
export interface SerializableActionNode extends SerializableBaseNode {
|
|
40
|
+
type: 'action';
|
|
41
|
+
action: string;
|
|
42
|
+
addNext: (nodeable: Nodeable) => undefined;
|
|
43
|
+
onSuccess: (nodeable: Nodeable) => undefined;
|
|
44
|
+
onFail: (nodeable: Nodeable) => undefined;
|
|
45
|
+
serialize: () => Serialized<ActionNode>;
|
|
46
|
+
}
|
|
47
|
+
export interface CreateActionOptions {
|
|
48
|
+
action: string;
|
|
49
|
+
}
|
|
50
|
+
export declare const createAction: (actionOptions: CreateActionOptions, experience: SerializableExperience) => SerializableActionNode;
|
|
51
|
+
export interface SerializableBaseNode {
|
|
52
|
+
id: string;
|
|
53
|
+
experience: SerializableExperience;
|
|
54
|
+
serialize: () => Serialized<ExperienceNode>;
|
|
55
|
+
}
|
|
56
|
+
export interface SerializableStepNode extends SerializableBaseNode {
|
|
57
|
+
type: 'step';
|
|
58
|
+
connectedStep: SerializableStep;
|
|
59
|
+
}
|
|
60
|
+
export interface SerializableConditionNode extends SerializableBaseNode {
|
|
61
|
+
type: 'condition';
|
|
62
|
+
connectedCondition: SerializableCondition;
|
|
63
|
+
}
|
|
64
|
+
export interface SerializableLaunchExperienceNode extends SerializableBaseNode {
|
|
65
|
+
type: 'experience';
|
|
66
|
+
connectedExperience: SerializableExperience;
|
|
67
|
+
}
|
|
68
|
+
export interface SerializableOriginNode extends SerializableBaseNode {
|
|
69
|
+
type: 'origin';
|
|
70
|
+
}
|
|
71
|
+
export type CreateNodeOptions = {
|
|
72
|
+
step: SerializableStep;
|
|
73
|
+
type: 'step';
|
|
74
|
+
} | {
|
|
75
|
+
condition: SerializableCondition;
|
|
76
|
+
type: 'condition';
|
|
77
|
+
} | {
|
|
78
|
+
type: 'origin';
|
|
79
|
+
} | {
|
|
80
|
+
experience: SerializableExperience;
|
|
81
|
+
type: 'experience';
|
|
82
|
+
} | {
|
|
83
|
+
action: SerializableActionNode;
|
|
84
|
+
type: 'action';
|
|
85
|
+
};
|
|
86
|
+
export interface SerializableEdge {
|
|
87
|
+
id: string;
|
|
88
|
+
sourceNode: SerializableNode;
|
|
89
|
+
sourceHandle: 'true' | 'false' | null;
|
|
90
|
+
destinationNode: SerializableNode;
|
|
91
|
+
experience: SerializableExperience;
|
|
92
|
+
serialize: () => Serialized<ExperienceEdge>;
|
|
93
|
+
}
|
|
94
|
+
export interface CreateEdgeOptions {
|
|
95
|
+
sourceNode: SerializableNode;
|
|
96
|
+
sourceHandle: 'true' | 'false' | null;
|
|
97
|
+
destinationNode: SerializableNode;
|
|
98
|
+
}
|
|
99
|
+
export interface SerializableCondition extends Nodeable {
|
|
100
|
+
id: string;
|
|
101
|
+
key: string;
|
|
102
|
+
name: string;
|
|
103
|
+
label?: string;
|
|
104
|
+
logic: LogicRule;
|
|
105
|
+
experience: SerializableExperience;
|
|
106
|
+
addTrue: (nodeable: Nodeable) => undefined;
|
|
107
|
+
addFalse: (nodeable: Nodeable) => undefined;
|
|
108
|
+
serialize: () => Serialized<Condition>;
|
|
109
|
+
}
|
|
110
|
+
export interface CreateConditionOptions {
|
|
111
|
+
condition: LogicRule;
|
|
112
|
+
name?: string;
|
|
113
|
+
key?: string;
|
|
114
|
+
label?: string;
|
|
115
|
+
}
|
|
116
|
+
export type CreateFieldOptions = Omit<Field, 'id' | 'key' | 'options' | 'placeholder' | 'description' | 'helpText' | 'validation' | 'policies' | 'defaultValue'> & {
|
|
117
|
+
id?: string;
|
|
118
|
+
key?: string;
|
|
119
|
+
defaultValue?: string | number | boolean | object | null | string[] | number[] | boolean[] | object[];
|
|
120
|
+
placeholder?: string;
|
|
121
|
+
description?: string;
|
|
122
|
+
helpText?: string;
|
|
123
|
+
validation?: LogicRule;
|
|
124
|
+
policies?: FieldPolicies;
|
|
125
|
+
options?: NonNullable<FieldTextSingular['options']>[number][] | NonNullable<FieldTextMultiple['options']>[number][] | NonNullable<FieldNumberSingular['options']>[number][] | NonNullable<FieldNumberMultiple['options']>[number][] | NonNullable<FieldBooleanSingular['options']>[number][] | NonNullable<FieldBooleanMultiple['options']>[number][] | Omit<NonNullable<FieldObjectSingular['options']>[number], 'id'>[] | Omit<NonNullable<FieldObjectMultiple['options']>[number], 'id'>[];
|
|
126
|
+
};
|
|
127
|
+
export type SerializableField<T extends JsonValue = JsonValue> = {
|
|
128
|
+
id: string;
|
|
129
|
+
key: string;
|
|
130
|
+
name: string;
|
|
131
|
+
label: string;
|
|
132
|
+
type: 'text' | 'number' | 'object' | 'boolean';
|
|
133
|
+
multiple: boolean;
|
|
134
|
+
required: boolean;
|
|
135
|
+
defaultValue: string | number | boolean | object | null | string[] | number[] | boolean[] | object[];
|
|
136
|
+
placeholder?: string;
|
|
137
|
+
description?: string;
|
|
138
|
+
helpText?: string;
|
|
139
|
+
validation: LogicRule;
|
|
140
|
+
condition?: LogicRule;
|
|
141
|
+
policies?: FieldPolicies;
|
|
142
|
+
options: {
|
|
143
|
+
id: string;
|
|
144
|
+
label: string;
|
|
145
|
+
description?: string;
|
|
146
|
+
value: JsonValue;
|
|
147
|
+
condition?: LogicRule;
|
|
148
|
+
}[] | null;
|
|
149
|
+
} & {
|
|
150
|
+
serialize: () => Serialized<Field>;
|
|
151
|
+
};
|
|
152
|
+
export interface SerializableExperience {
|
|
153
|
+
id: string;
|
|
154
|
+
key: string;
|
|
155
|
+
component?: AdaptedComponent;
|
|
156
|
+
name: string;
|
|
157
|
+
condition?: LogicRule | LogicValue;
|
|
158
|
+
initializeOpen?: LogicRule | LogicValue;
|
|
159
|
+
targets: ExperienceTarget[];
|
|
160
|
+
steps: SerializableStep[];
|
|
161
|
+
nodes: SerializableNode[];
|
|
162
|
+
edges: SerializableEdge[];
|
|
163
|
+
fields: SerializableField[];
|
|
164
|
+
conditions: SerializableCondition[];
|
|
165
|
+
addStep: (stepOptions: CreateStepOptions | SerializableStep | OrphanStep, after?: {
|
|
166
|
+
node: SerializableNode | null;
|
|
167
|
+
}) => SerializableStep;
|
|
168
|
+
addCondition: (conditionOptions: CreateConditionOptions | SerializableCondition, after?: {
|
|
169
|
+
node: SerializableNode | null;
|
|
170
|
+
}) => SerializableCondition;
|
|
171
|
+
/** @deprecated Use `addCondition` instead. */
|
|
172
|
+
addConditional: (conditionOptions: CreateConditionOptions | SerializableCondition, after?: {
|
|
173
|
+
node: SerializableNode | null;
|
|
174
|
+
}) => SerializableCondition;
|
|
175
|
+
addExperience: (experience: SerializableExperience, after?: {
|
|
176
|
+
node: SerializableNode | null;
|
|
177
|
+
}) => SerializableExperience;
|
|
178
|
+
addField: (fieldOptions: CreateFieldOptions | SerializableField, step?: SerializableStep) => SerializableField;
|
|
179
|
+
addAction: (actionOptions: CreateActionOptions | SerializableActionNode, after?: {
|
|
180
|
+
node: SerializableNode | null;
|
|
181
|
+
}) => SerializableActionNode;
|
|
182
|
+
serialize: () => Serialized<SerializedExperience>;
|
|
183
|
+
}
|
|
184
|
+
export interface CreateExperienceOptions {
|
|
185
|
+
id: string;
|
|
186
|
+
key?: string;
|
|
187
|
+
name: string;
|
|
188
|
+
condition?: LogicRule | LogicValue;
|
|
189
|
+
initializeOpen?: LogicRule | LogicValue;
|
|
190
|
+
targets: ExperienceTarget[];
|
|
191
|
+
component?: AdaptedComponent;
|
|
192
|
+
}
|
|
193
|
+
export type OrphanStep = Omit<SerializableStep, 'nextStep' | 'nextCondition' | 'nextConditional' | 'addNextExperience' | 'node' | 'serialize' | 'addField' | 'experience'> & {
|
|
194
|
+
addField: (fieldOrFieldOptions: CreateFieldOptions | SerializableField) => void;
|
|
195
|
+
};
|
|
196
|
+
export declare const createStep: (stepOptions: CreateStepOptions) => OrphanStep;
|
|
197
|
+
export declare const bindExperienceStep: (stepOptions: CreateStepOptions | OrphanStep, experience: SerializableExperience) => SerializableStep;
|
|
198
|
+
export declare const createNode: (nodeOptions: CreateNodeOptions, experience: SerializableExperience) => SerializableNode;
|
|
199
|
+
export declare const createEdge: (edgeOptions: CreateEdgeOptions, experience: SerializableExperience) => SerializableEdge;
|
|
200
|
+
export declare const createCondition: (conditionOptions: CreateConditionOptions, experience: SerializableExperience) => SerializableCondition;
|
|
201
|
+
/** @deprecated Use `createCondition` instead. */
|
|
202
|
+
export declare const createConditional: typeof createCondition;
|
|
203
|
+
/**
|
|
204
|
+
* Creates a field with optional generic type parameter for object field type safety.
|
|
205
|
+
*
|
|
206
|
+
* @template T - The type of the object field value (only applicable for type: 'object').
|
|
207
|
+
* @param {CreateFieldOptions} fieldOptions - The field configuration options.
|
|
208
|
+
* @returns {SerializableField<T>} A serializable field with type information.
|
|
209
|
+
* @example
|
|
210
|
+
* ```typescript
|
|
211
|
+
* // Without type parameter (default JsonValue)
|
|
212
|
+
* const field = createField({ type: 'text', ... })
|
|
213
|
+
*
|
|
214
|
+
* // With type parameter for object fields
|
|
215
|
+
* interface MyData { name: string; age: number }
|
|
216
|
+
* const typedField = createField<MyData>({ type: 'object', ... })
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
export declare const createField: <T extends JsonValue = JsonValue>(fieldOptions: CreateFieldOptions) => SerializableField<T>;
|
|
220
|
+
export declare const createExperience: (experience: CreateExperienceOptions) => SerializableExperience;
|
|
221
|
+
//# sourceMappingURL=create-experience.d.ts.map
|
|
@@ -0,0 +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,C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,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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** @file Public API for the create-experience plugin. */
|
|
2
|
+
export { createExperiencePlugin } from './plugin.js';
|
|
3
|
+
export type * from './plugin.js';
|
|
4
|
+
export type * from './create-experience.js';
|
|
5
|
+
export { createCondition, createEdge, createExperience, createNode, createField, createStep, } from './create-experience.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/index.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AACjD,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,qBAAqB,CAAA;AACxC,OAAO,EACL,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,UAAU,GACX,MAAM,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @file Plugin that registers builder-created experiences with the client. */
|
|
2
|
+
import type { Plugin } from '../../entities/plugin/plugin.js';
|
|
3
|
+
import type { SerializableExperience } from './create-experience.js';
|
|
4
|
+
interface CreateExperiencePluginOptions {
|
|
5
|
+
experiences: SerializableExperience[];
|
|
6
|
+
}
|
|
7
|
+
export declare const createExperiencePlugin: (options: CreateExperiencePluginOptions) => Plugin;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +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,YAAa,6BAA6B,KAAG,MA0B/E,CAAA"}
|
|
@@ -0,0 +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;IACxB,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;IAGnC,WAAW,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC;CAGtC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dom-observer/index.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Plugin } from '../../entities/plugin/plugin.js';
|
|
2
|
+
/**
|
|
3
|
+
* Watches the document for `childList` mutations and reconciles experiences
|
|
4
|
+
* whose declared target selectors match newly added DOM subtrees. Each
|
|
5
|
+
* matching experience runs through its per-experience `shouldInitialiseFx`,
|
|
6
|
+
* and on `true` is handed to its `initialiseFx(undefined)`.
|
|
7
|
+
*
|
|
8
|
+
* Scope: lazy-mounted target hosts that arrive after the initial bulk init
|
|
9
|
+
* in `picked.ts`. Route-driven re-initialisation (decisionLogic depending
|
|
10
|
+
* on `location.pathname`, lifecycle event re-fires, plugin start hooks)
|
|
11
|
+
* is the responsibility of `singlePageAppPlugin`, which calls
|
|
12
|
+
* `client.start()` on history events. Pair the two plugins to cover both.
|
|
13
|
+
*
|
|
14
|
+
* Pipeline:
|
|
15
|
+
* - Each experience's `configStore.watch()` pushes its trimmed selectors
|
|
16
|
+
* into a reactive `Store<Map<id, string[]>>`. Empty / whitespace-only
|
|
17
|
+
* selectors are filtered out.
|
|
18
|
+
* - A single `MutationObserver` collects `Element` instances from
|
|
19
|
+
* `childList.addedNodes` across one animation frame, then fires a
|
|
20
|
+
* single `mutationObserved` event carrying the collected elements.
|
|
21
|
+
* - `sample` filters registered experiences to those whose selectors
|
|
22
|
+
* match at least one added element via `el.matches` or
|
|
23
|
+
* `el.querySelector`. Malformed selectors are skipped per-experience
|
|
24
|
+
* without poisoning the rest of the batch. The matched array is
|
|
25
|
+
* routed straight into `reconcileMatchedFx` via `sample.target`.
|
|
26
|
+
* - `reconcileMatchedFx` invokes each experience's
|
|
27
|
+
* `shouldInitialiseFx`, and on `true` its `initialiseFx(undefined)`.
|
|
28
|
+
* `initialiseFx` is idempotent: tagged target elements are skipped
|
|
29
|
+
* on subsequent passes.
|
|
30
|
+
*
|
|
31
|
+
* Setup is deferred until `document.body` is parsed, so SDKs loaded from
|
|
32
|
+
* `<head>` without `defer` (the standard Shopify-theme / GTM-template
|
|
33
|
+
* pattern) still install once the body becomes available.
|
|
34
|
+
*
|
|
35
|
+
* No-ops outside browser environments and on partial-DOM runtimes that
|
|
36
|
+
* lack `MutationObserver` or `requestAnimationFrame`. `MutationObserver`
|
|
37
|
+
* does not cross shadow root or iframe boundaries, so experiences whose
|
|
38
|
+
* target lives inside a shadow tree or a cross-origin frame are not
|
|
39
|
+
* reconciled by this plugin.
|
|
40
|
+
*
|
|
41
|
+
* @returns {Plugin} The plugin.
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* createClient({
|
|
45
|
+
* plugins: [domObserverPlugin()]
|
|
46
|
+
* })
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare const domObserverPlugin: () => Plugin;
|
|
50
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dom-observer/plugin.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,eAAO,MAAM,iBAAiB,QAAO,MAiBpC,CAAA"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/** @file Deterministic, independent per-feature bucket allocation for A/B testing. */
|
|
2
|
+
/**
|
|
3
|
+
* FNV-1a 32-bit hash.
|
|
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
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare function fnv1a32(input: string): number;
|
|
14
|
+
/**
|
|
15
|
+
* Deterministic dice roll for A/B testing.
|
|
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
|
+
* This is the boolean path's input. A multi-variant feature does not roll once
|
|
28
|
+
* and look the result up; {@link allocateVariant} scores each arm on its own
|
|
29
|
+
* seed. One roll per feature is still what keeps features independent of one
|
|
30
|
+
* another, per ADR-0018.
|
|
31
|
+
*
|
|
32
|
+
* @param {string} pickedId - The visitor's Picked ID, stable across page loads.
|
|
33
|
+
* @param {string} featureId - Feature the roll is for.
|
|
34
|
+
* @returns {number} A value in the range 0 to 99.
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const diceRoll = featureDiceRoll('sess_1', 'winter-sale')
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function featureDiceRoll(pickedId: string, featureId: string): number;
|
|
41
|
+
/**
|
|
42
|
+
* Whether the given dice roll falls within the feature's weight.
|
|
43
|
+
*
|
|
44
|
+
* Widening a weight admits sessions the narrower weight excluded and never
|
|
45
|
+
* evicts one already inside, so a rollout can ratchet up without re-bucketing
|
|
46
|
+
* anyone. The roll is per feature, so this describes one feature's own weight
|
|
47
|
+
* changing over time; two features at the same weight overlap by chance.
|
|
48
|
+
*
|
|
49
|
+
* @param {number} diceRoll - Roll from {@link featureDiceRoll}, 0–99.
|
|
50
|
+
* @param {number} weight - Feature weight, 0–100.
|
|
51
|
+
* @returns {boolean} Whether the session is allocated to the feature.
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* isAllocated(42, 50) // true
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function isAllocated(diceRoll: number, weight: number): boolean;
|
|
58
|
+
/** The fields {@link allocateVariant} needs from an arm. */
|
|
59
|
+
export interface AllocatableVariant {
|
|
60
|
+
key: string;
|
|
61
|
+
weight: number;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Picks the arm a session lands in, scoring each arm independently.
|
|
65
|
+
*
|
|
66
|
+
* Each arm is hashed on its own key and scored against its own weight, and the
|
|
67
|
+
* highest score wins. An arm's score therefore depends on nothing but the
|
|
68
|
+
* session, the feature and that arm's own weight, which is what gives the two
|
|
69
|
+
* properties an author is entitled to assume:
|
|
70
|
+
*
|
|
71
|
+
* - Editing one arm's weight moves sessions only into or out of that arm. Two
|
|
72
|
+
* arms the author did not touch never trade sessions with each other.
|
|
73
|
+
* - Widening an arm only admits sessions and never evicts one already inside,
|
|
74
|
+
* the same ratchet {@link isAllocated} gives the boolean path. Narrowing is
|
|
75
|
+
* its mirror.
|
|
76
|
+
*
|
|
77
|
+
* Neither holds for cumulative ranges, where an arm's interval depends on every
|
|
78
|
+
* arm ordered before it, so a boundary shift upstream drags unrelated arms
|
|
79
|
+
* across it.
|
|
80
|
+
*
|
|
81
|
+
* Scores are compared, never summed, so the result is invariant under scaling
|
|
82
|
+
* every weight by the same factor: `1:1:2` and `10:10:20` allocate identically.
|
|
83
|
+
* Ties break on the key so that the arms' arrival order cannot matter — nothing
|
|
84
|
+
* in the delivery pipeline promises one.
|
|
85
|
+
*
|
|
86
|
+
* The chosen arm is returned whole rather than by key, so a caller reading its
|
|
87
|
+
* value needs no second lookup — and cannot resolve a duplicate key to a
|
|
88
|
+
* different arm than the one scored.
|
|
89
|
+
*
|
|
90
|
+
* @template T
|
|
91
|
+
* @param {string} pickedId - The visitor's Picked ID, stable across page loads.
|
|
92
|
+
* @param {string} featureKey - Feature being allocated.
|
|
93
|
+
* @param {readonly T[]} variants - The feature's arms, in any order.
|
|
94
|
+
* @returns {T | null} The chosen arm, or null when the set decides nobody.
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* // 'hero-b' takes three sessions in four; 'false' takes the fourth.
|
|
98
|
+
* allocateVariant('sess_1', 'hero', [
|
|
99
|
+
* { key: 'hero-b', weight: 3 },
|
|
100
|
+
* { key: 'false', weight: 1 },
|
|
101
|
+
* ])
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
export declare function allocateVariant<T extends AllocatableVariant>(pickedId: string, featureKey: string, variants: readonly T[]): T | null;
|
|
105
|
+
//# sourceMappingURL=hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAUrE;AAED,4DAA4D;AAC5D,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;CACf;AA4CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,kBAAkB,EAC1D,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,SAAS,CAAC,EAAE,GACrB,CAAC,GAAG,IAAI,CAmBV"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @file Public exports for the dynamic-experiences plugin (project config + per-experience content resolution). */
|
|
2
|
+
export { dynamicExperiencesPlugin, fetchExperienceContent, fetchProject } from './plugin.js';
|
|
3
|
+
export { createClientHeaders, fetchSchema } from '@picked/delivery-api-client';
|
|
4
|
+
export { ActionResponseTimeoutError, ActionRunFailedError } from '@picked/delivery-api-client';
|
|
5
|
+
export { registerPickedBundle } from '../../data-source/registry.js';
|
|
6
|
+
export type * from './types.js';
|
|
7
|
+
export type { ApiExperienceStep, ContentBlob, ExperienceContentResponse, FetchProjectOptions, ProjectConfig, ProjectConfigExperience, ProjectConfigFeature, ProjectConfigNode, } from '@picked/delivery-api-client';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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;AAGzF,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAE9E,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAI9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACjE,mBAAmB,SAAS,CAAA;AAI5B,YAAY,EACV,iBAAiB,EACjB,WAAW,EACX,yBAAyB,EACzB,mBAAmB,EACnB,aAAa,EACb,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,6BAA6B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../plugin-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../plugin-C-4rIh44.cjs"),t=require("../../../api-CPcoVcOk.cjs"),n=require("../../../registry-C1t8l3t9.cjs");let r=require("@picked/delivery-api-client");Object.defineProperty(exports,"ActionResponseTimeoutError",{enumerable:!0,get:function(){return r.ActionResponseTimeoutError}}),Object.defineProperty(exports,"ActionRunFailedError",{enumerable:!0,get:function(){return r.ActionRunFailedError}}),Object.defineProperty(exports,"createClientHeaders",{enumerable:!0,get:function(){return r.createClientHeaders}}),exports.dynamicExperiencesPlugin=e.t,exports.fetchExperienceContent=t.t,exports.fetchProject=t.n,Object.defineProperty(exports,"fetchSchema",{enumerable:!0,get:function(){return r.fetchSchema}}),exports.registerPickedBundle=n.n;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ProjectConfig } from '@picked/delivery-api-client';
|
|
2
|
+
import type { Plugin } from '../../entities/plugin/plugin.js';
|
|
3
|
+
import type { Picked } from '../../picked.js';
|
|
4
|
+
export { fetchProject, fetchExperienceContent } from '../../data-source/api.js';
|
|
5
|
+
/**
|
|
6
|
+
* Synchronously registers a complete project config with the client: features, conditions,
|
|
7
|
+
* fields, steps, and experiences, in dependency order.
|
|
8
|
+
*
|
|
9
|
+
* Extracted from `dynamicExperiencesPlugin`'s `onStart` so the same registration runs outside
|
|
10
|
+
* the lifecycle (notably from the server `serialize` helper and the SSR provider), where the
|
|
11
|
+
* stores must be populated synchronously before selection or rendering.
|
|
12
|
+
*
|
|
13
|
+
* @param {Picked} client - Picked client instance.
|
|
14
|
+
* @param {ProjectConfig} config - Project configuration to register.
|
|
15
|
+
* @param {object} options - Registration options.
|
|
16
|
+
* @param {boolean} options.isPreview - Whether features use session storage instead of local storage.
|
|
17
|
+
* @param {string} options.pickedId - The visitor's Picked ID, the seed for stable feature allocation. `sessionId` is its deprecated name.
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* registerProjectConfig(client, config, { isPreview: false, pickedId: client.session.store.getState().pickedId })
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function registerProjectConfig(client: Picked, config: ProjectConfig, options: {
|
|
24
|
+
isPreview: boolean;
|
|
25
|
+
} & ({
|
|
26
|
+
pickedId: string;
|
|
27
|
+
} | {
|
|
28
|
+
/** @deprecated Use `pickedId`. */
|
|
29
|
+
sessionId: string;
|
|
30
|
+
})): void;
|
|
31
|
+
/**
|
|
32
|
+
* Plugin that resolves project configuration through the client and registers features,
|
|
33
|
+
* steps, fields, and experiences with it.
|
|
34
|
+
*
|
|
35
|
+
* Resolution runs during the `onStart` hook, before experience initialisation, and reads
|
|
36
|
+
* whichever source the client resolves to — the build-time bundle when one registered itself,
|
|
37
|
+
* the Picked API otherwise. Search param feature overrides take precedence over resolved
|
|
38
|
+
* values.
|
|
39
|
+
*
|
|
40
|
+
* @returns {Plugin} A configured Picked plugin.
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* import { dynamicExperiencesPlugin } from '@picked/client/plugins/dynamic-experiences'
|
|
44
|
+
*
|
|
45
|
+
* createClient({
|
|
46
|
+
* plugins: [
|
|
47
|
+
* dynamicExperiencesPlugin()
|
|
48
|
+
* ]
|
|
49
|
+
* })
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function dynamicExperiencesPlugin(): Plugin;
|
|
53
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/plugin.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAEV,aAAa,EAGd,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAO1C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAgK5E;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,GAAG,CAC9B;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GACpB;IACE,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAA;CAClB,CACJ,GACA,IAAI,CAqBN;AAudD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAiDjD"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Plugin-specific types for the dynamic-experiences plugin.
|
|
3
|
+
*
|
|
4
|
+
* The wire-format shapes the Delivery API returns live in `@picked/delivery-api-client`,
|
|
5
|
+
* which stays runtime-agnostic. This file holds the types that only mean something inside
|
|
6
|
+
* the client: the content loader and the virtual data module
|
|
7
|
+
* `@picked/vite-plugin-picked` generates.
|
|
8
|
+
*/
|
|
9
|
+
import type { ExperienceContentResponse, ProjectConfig } from '@picked/delivery-api-client';
|
|
10
|
+
/**
|
|
11
|
+
* Function that resolves an experience's content blobs. Set on the Picked client by
|
|
12
|
+
* `dynamicExperiencesPlugin` (selecting from virtual module, getContent override, or API)
|
|
13
|
+
* and called by each experience's `prepareExperienceContentFx`, which is fired by the
|
|
14
|
+
* per-experience sample graph in parallel with `initialiseFx`.
|
|
15
|
+
*/
|
|
16
|
+
export type ContentLoader = (experience: {
|
|
17
|
+
id: string;
|
|
18
|
+
key: string;
|
|
19
|
+
}, options?: {
|
|
20
|
+
previewToken?: string;
|
|
21
|
+
}) => Promise<ExperienceContentResponse | null>;
|
|
22
|
+
/**
|
|
23
|
+
* Provenance the virtual data module records about the snapshot it carries: which build
|
|
24
|
+
* flavour produced it, when, and which workspace version it was taken from.
|
|
25
|
+
*/
|
|
26
|
+
export interface PickedManifestMetadata {
|
|
27
|
+
/**
|
|
28
|
+
* `'build'` when build-mode prefetch JSON was used, `'dev'` when the dev-mode fetch was,
|
|
29
|
+
* `'snapshot'` when the committed `picked.snapshot.json` was.
|
|
30
|
+
*/
|
|
31
|
+
mode: 'dev' | 'build' | 'snapshot';
|
|
32
|
+
/** ISO 8601 timestamp from the manifest. `null` in dev mode, where no manifest is written. */
|
|
33
|
+
fetchedAt: string | null;
|
|
34
|
+
/** The `versionId` the snapshot was taken from, when known. */
|
|
35
|
+
projectVersionId: string | null;
|
|
36
|
+
/** The `workspaceId` the snapshot was taken from, when known. */
|
|
37
|
+
workspaceId: string | null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Optional-fields surface of the virtual data module exposed by `@picked/vite-plugin-picked`.
|
|
41
|
+
* The shape is identical between dev (`vite serve`) and build (`vite build`) modes.
|
|
42
|
+
*/
|
|
43
|
+
export interface VirtualPickedData {
|
|
44
|
+
projectConfig: ProjectConfig;
|
|
45
|
+
experienceContent: ContentLoader;
|
|
46
|
+
manifestMetadata: PickedManifestMetadata;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAE3F;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,CAC1B,UAAU,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACvC,OAAO,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,KAChC,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAAA;AAE9C;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,IAAI,EAAE,KAAK,GAAG,OAAO,GAAG,UAAU,CAAA;IAClC,8FAA8F;IAC9F,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,+DAA+D;IAC/D,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,iEAAiE;IACjE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,aAAa,CAAA;IAC5B,iBAAiB,EAAE,aAAa,CAAA;IAChC,gBAAgB,EAAE,sBAAsB,CAAA;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/experience-browser-storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Plugin } from '../../entities/plugin/plugin.js';
|
|
2
|
+
interface ExperienceBrowserStoragePlugin {
|
|
3
|
+
storage?: 'local' | 'session';
|
|
4
|
+
}
|
|
5
|
+
export declare const experienceBrowserStoragePlugin: ({ storage, }?: ExperienceBrowserStoragePlugin) => Plugin;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/experience-browser-storage/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,UAAU,8BAA8B;IACtC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,eAAO,MAAM,8BAA8B,kBAExC,8BAA8B,KAAQ,MA0DxC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/history-browser-storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Plugin } from '../../entities/plugin/plugin.js';
|
|
2
|
+
/** @public */
|
|
3
|
+
export interface HistoryBrowserStoragePlugin {
|
|
4
|
+
storage?: 'local' | 'session';
|
|
5
|
+
}
|
|
6
|
+
export declare const historyBrowserStoragePlugin: ({ storage, }?: HistoryBrowserStoragePlugin) => Plugin;
|
|
7
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/history-browser-storage/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,cAAc;AACd,MAAM,WAAW,2BAA2B;IAC1C,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,eAAO,MAAM,2BAA2B,kBAErC,2BAA2B,KAAQ,MA8BrC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-browser-storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA"}
|