@picked/client 0.0.1-dev.1777869768355 → 0.0.1-dev.1778120127377
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -8
- package/dist/{api-DT7ImnBi.cjs → api-BM3zWj3k.cjs} +1 -1
- package/dist/{api-Dx9PpWfN.js → api-zfqEYPyX.js} +1 -1
- package/dist/cjs/form/index.js +1 -1
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/plugins/experience-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/single-page-app/index.js +1 -1
- package/dist/cjs/plugins/web-components/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/docs/actions.mdx +0 -1
- package/dist/docs/index.md +0 -2
- package/dist/docs/pickedql/dimensions.md +2 -0
- package/dist/docs/pickedql/virtual-functions.md +27 -0
- package/dist/docs/sdk/actions.md +0 -1
- package/dist/docs/sdk/features.md +0 -1
- package/dist/docs/sdk/index.md +0 -1
- package/dist/docs/sdk/plugins/create-experience.md +0 -1
- package/dist/docs/sdk/plugins/dynamic-experiences.md +0 -1
- package/dist/docs/sdk/plugins/window-object.md +0 -1
- package/dist/docs/sdk/predicates.md +0 -1
- package/dist/esm/form/index.js +1 -1
- package/dist/esm/index.js +970 -539
- package/dist/esm/plugins/dynamic-experiences/index.js +51 -49
- package/dist/esm/plugins/experience-browser-storage/index.js +8 -5
- package/dist/esm/plugins/history-browser-storage/index.js +3 -3
- package/dist/esm/plugins/single-page-app/index.js +1 -1
- package/dist/esm/plugins/web-components/index.js +1 -1
- package/dist/esm/server/index.js +23 -13
- package/dist/{experience-instance-CWYRLfFM.js → experience-instance-BrLWgVAN.js} +135 -127
- package/dist/experience-instance-Ct3ogC7n.cjs +1 -0
- package/dist/rules-logic-D_CVBuv7.js +13 -0
- package/dist/rules-logic-H6P8xwHF.cjs +1 -0
- package/dist/types/client.d.ts +2 -2
- package/dist/types/entities/action/action.d.ts +6 -3
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/component/component.d.ts +39 -2
- package/dist/types/entities/component/component.d.ts.map +1 -1
- package/dist/types/entities/experience/experience.d.ts +49 -113
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +17 -2
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts +26 -2
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/framework/framework.d.ts +24 -3
- package/dist/types/entities/framework/framework.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts +3 -21
- package/dist/types/entities/history/history.d.ts.map +1 -1
- package/dist/types/entities/plugin/plugin.d.ts +32 -1
- package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
- package/dist/types/entities/predicate/predicate.d.ts +24 -3
- package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
- package/dist/types/entities/session/session.d.ts +45 -0
- package/dist/types/entities/session/session.d.ts.map +1 -0
- package/dist/types/exports.d.ts +9 -3
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lifecycle/lifecycle.d.ts +47 -0
- package/dist/types/lifecycle/lifecycle.d.ts.map +1 -0
- package/dist/types/lifecycle/rules-logic.d.ts +24 -0
- package/dist/types/lifecycle/rules-logic.d.ts.map +1 -0
- package/dist/types/lifecycle/state-snapshot.d.ts +37 -0
- package/dist/types/lifecycle/state-snapshot.d.ts.map +1 -0
- package/dist/types/logic-engine.d.ts +1 -1
- package/dist/types/logic-engine.d.ts.map +1 -1
- package/dist/types/picked.d.ts +104 -196
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +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 +0 -14
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/web-components/plugin.d.ts.map +1 -1
- package/dist/types/server/index.d.ts +7 -0
- package/dist/types/server/index.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +1 -1
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/picked-config.d.ts +12 -4
- package/dist/types/utils/picked-config.d.ts.map +1 -1
- package/dist/types/utils/rules-logic.d.ts +4 -9
- package/dist/types/utils/rules-logic.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/experience-instance-BDTNGT8a.cjs +0 -1
- package/dist/rules-logic-BTIxfrJJ.js +0 -240
- package/dist/rules-logic-DNLOv90w.cjs +0 -1
- package/dist/types/utils/state-snaphot.d.ts +0 -26
- package/dist/types/utils/state-snaphot.d.ts.map +0 -1
- package/dist/types/utils/user-session.d.ts +0 -12
- package/dist/types/utils/user-session.d.ts.map +0 -1
- /package/dist/{object-C82v79xc.js → object-DvUDOytC.js} +0 -0
- /package/dist/{object-CUJOjanb.cjs → object-ThO1DEyl.cjs} +0 -0
package/dist/types/picked.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { Effect, EventCallable, Store, StoreWritable } from 'effector';
|
|
1
2
|
import { Experience, LaunchExperienceOptions } from './entities/experience/experience';
|
|
2
3
|
import { Plugin, PluginConfigIndex } from './entities/plugin/plugin';
|
|
3
4
|
import { CreateClientOptions } from './client';
|
|
4
5
|
import { AdaptedComponent } from './entities/component/component';
|
|
5
6
|
import { Framework } from './entities/framework/framework';
|
|
6
|
-
import { StateSnapshot } from './
|
|
7
|
+
import { StateSnapshot } from './lifecycle/state-snapshot';
|
|
8
|
+
import { EvaluateRuleLogicParams } from './lifecycle/rules-logic';
|
|
9
|
+
import { LifecycleStage } from './lifecycle/lifecycle';
|
|
7
10
|
import { Predicate } from './entities/predicate/predicate';
|
|
8
11
|
import { Feature } from './entities/feature/feature';
|
|
9
12
|
import { EventBusPayload, EventHistoryStore } from './utils/events';
|
|
@@ -11,212 +14,133 @@ import { Field } from './entities/field/field';
|
|
|
11
14
|
import { ExperienceStep } from './entities/step/step';
|
|
12
15
|
import { Action } from './entities/action/action';
|
|
13
16
|
import { Condition } from './entities/condition/condition';
|
|
14
|
-
import {
|
|
15
|
-
import { LogicRule } from './logic-engine';
|
|
17
|
+
import { SessionEntity } from './entities/session/session';
|
|
16
18
|
export declare class Picked {
|
|
17
19
|
static readonly logger: (level: "log" | "warn" | "info" | "error", ...args: Parameters<Console["log"]>) => void;
|
|
18
20
|
private readonly options;
|
|
19
|
-
isReady: boolean;
|
|
20
21
|
private readonly plugins;
|
|
21
|
-
|
|
22
|
-
readonly eventBus: import('effector').EventCallable<EventBusPayload>;
|
|
22
|
+
readonly eventBus: EventCallable<EventBusPayload>;
|
|
23
23
|
readonly events: EventHistoryStore;
|
|
24
|
-
readonly organizationId: string;
|
|
25
24
|
readonly projectId: string;
|
|
26
25
|
readonly apiUrl: string;
|
|
27
26
|
readonly dashboardUrl: string;
|
|
28
27
|
readonly documentationSiteUrl: string;
|
|
29
|
-
readonly session
|
|
30
|
-
readonly precondition?: LogicRule | boolean;
|
|
31
|
-
readonly condition?: LogicRule | boolean;
|
|
32
|
-
preconditionPassed?: boolean;
|
|
28
|
+
readonly session: SessionEntity;
|
|
33
29
|
readonly searchParams: import('.').PickedSearchParams;
|
|
34
30
|
readonly history: {
|
|
35
|
-
push:
|
|
36
|
-
instanceId: string;
|
|
31
|
+
push: EventCallable<{
|
|
37
32
|
experienceId: string;
|
|
38
33
|
node: import('.').ExperienceNode;
|
|
39
34
|
}>;
|
|
40
|
-
replace:
|
|
41
|
-
instanceId: string;
|
|
35
|
+
replace: EventCallable<{
|
|
42
36
|
experienceId: string;
|
|
43
37
|
node: import('.').ExperienceNode;
|
|
44
38
|
}>;
|
|
45
|
-
back:
|
|
46
|
-
|
|
39
|
+
back: EventCallable<{
|
|
40
|
+
experienceId?: string;
|
|
47
41
|
}>;
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
restore: EventCallable<{
|
|
43
|
+
entries: import('.').HistoryEntry[];
|
|
50
44
|
}>;
|
|
51
|
-
|
|
52
|
-
instanceId: string;
|
|
53
|
-
experienceId: string;
|
|
54
|
-
}>;
|
|
55
|
-
entriesStore: import('effector').Store<import('.').HistoryEntry[]>;
|
|
56
|
-
snapshotStore: import('effector').Store<Record<string, import('.').HistoryEntry[]>>;
|
|
45
|
+
entriesStore: Store<import('.').HistoryEntry[]>;
|
|
57
46
|
};
|
|
58
47
|
readonly components: {
|
|
59
|
-
register:
|
|
60
|
-
|
|
48
|
+
register: EventCallable<{
|
|
49
|
+
name: string;
|
|
50
|
+
component: AdaptedComponent;
|
|
51
|
+
}>;
|
|
52
|
+
getByName: (name: string) => Store<{
|
|
61
53
|
name: string;
|
|
62
54
|
component: AdaptedComponent;
|
|
63
55
|
} | undefined>;
|
|
64
|
-
listStore:
|
|
56
|
+
listStore: Store<{
|
|
65
57
|
name: string;
|
|
66
58
|
component: AdaptedComponent<string, unknown>;
|
|
67
|
-
frameworkStore:
|
|
59
|
+
frameworkStore: Store<Framework | undefined>;
|
|
68
60
|
}[]>;
|
|
69
61
|
};
|
|
70
62
|
readonly experienceInstances: {
|
|
71
63
|
spawn: (experience: import('.').ExperienceStore, target: HTMLElement, options?: LaunchExperienceOptions) => void;
|
|
72
|
-
getByExperienceKey: (key: Experience["key"]) =>
|
|
73
|
-
getByExperienceId: (id: Experience["id"]) =>
|
|
74
|
-
listStore:
|
|
64
|
+
getByExperienceKey: (key: Experience["key"]) => Store<import('.').ExperienceInstance[]>;
|
|
65
|
+
getByExperienceId: (id: Experience["id"]) => Store<import('.').ExperienceInstance[]>;
|
|
66
|
+
listStore: Store<import('.').ExperienceInstance[]>;
|
|
75
67
|
};
|
|
76
68
|
readonly experiences: {
|
|
77
|
-
register:
|
|
78
|
-
get: (id: Experience["id"]) => import('
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
configStore: import('effector').Store<{
|
|
83
|
-
name: string;
|
|
84
|
-
decisionLogic: import('./logic-engine').LogicValue | LogicRule;
|
|
85
|
-
targetSelectors: import('.').ExperienceTarget[];
|
|
86
|
-
initializeOpenLogic: import('./logic-engine').LogicValue | LogicRule;
|
|
87
|
-
}>;
|
|
88
|
-
treeStore: import('effector').Store<{
|
|
89
|
-
steps: ExperienceStep[];
|
|
90
|
-
nodes: import('.').ExperienceNode[];
|
|
91
|
-
edges: import('.').ExperienceEdge[];
|
|
92
|
-
conditions: Condition[];
|
|
93
|
-
}>;
|
|
94
|
-
componentStore: import('effector').Store<{
|
|
95
|
-
name: string;
|
|
96
|
-
component: AdaptedComponent<string, unknown>;
|
|
97
|
-
frameworkStore: import('effector').Store<Framework | undefined>;
|
|
98
|
-
} | undefined>;
|
|
99
|
-
actions: import('.').ExperienceAction[];
|
|
100
|
-
merge: import('effector').EventCallable<{
|
|
101
|
-
experience: Partial<Experience>;
|
|
102
|
-
strategy: "override";
|
|
103
|
-
}>;
|
|
104
|
-
} | undefined>;
|
|
105
|
-
getById: (id: Experience["id"]) => import('effector').Store<{
|
|
106
|
-
id: string;
|
|
107
|
-
key: string;
|
|
108
|
-
name: string;
|
|
109
|
-
configStore: import('effector').Store<{
|
|
110
|
-
name: string;
|
|
111
|
-
decisionLogic: import('./logic-engine').LogicValue | LogicRule;
|
|
112
|
-
targetSelectors: import('.').ExperienceTarget[];
|
|
113
|
-
initializeOpenLogic: import('./logic-engine').LogicValue | LogicRule;
|
|
114
|
-
}>;
|
|
115
|
-
treeStore: import('effector').Store<{
|
|
116
|
-
steps: ExperienceStep[];
|
|
117
|
-
nodes: import('.').ExperienceNode[];
|
|
118
|
-
edges: import('.').ExperienceEdge[];
|
|
119
|
-
conditions: Condition[];
|
|
120
|
-
}>;
|
|
121
|
-
componentStore: import('effector').Store<{
|
|
122
|
-
name: string;
|
|
123
|
-
component: AdaptedComponent<string, unknown>;
|
|
124
|
-
frameworkStore: import('effector').Store<Framework | undefined>;
|
|
125
|
-
} | undefined>;
|
|
126
|
-
actions: import('.').ExperienceAction[];
|
|
127
|
-
merge: import('effector').EventCallable<{
|
|
128
|
-
experience: Partial<Experience>;
|
|
129
|
-
strategy: "override";
|
|
130
|
-
}>;
|
|
131
|
-
} | undefined>;
|
|
132
|
-
getByKey: (key: Experience["key"]) => import('effector').Store<import('.').ExperienceStore | undefined>;
|
|
133
|
-
launch: import('effector').Effect<{
|
|
69
|
+
register: EventCallable<Experience>;
|
|
70
|
+
get: (id: Experience["id"]) => Store<import('.').ExperienceStore | undefined>;
|
|
71
|
+
getById: (id: Experience["id"]) => Store<import('.').ExperienceStore | undefined>;
|
|
72
|
+
getByKey: (key: Experience["key"]) => Store<import('.').ExperienceStore | undefined>;
|
|
73
|
+
launch: Effect<{
|
|
134
74
|
key: string;
|
|
135
75
|
options?: LaunchExperienceOptions;
|
|
136
76
|
} | {
|
|
137
77
|
id: string;
|
|
138
78
|
options?: LaunchExperienceOptions;
|
|
139
79
|
}, void, Error>;
|
|
140
|
-
open:
|
|
80
|
+
open: Effect<{
|
|
141
81
|
key: string;
|
|
142
82
|
options?: import('./exports').OpenExperienceOptions;
|
|
143
83
|
} | {
|
|
144
84
|
id: string;
|
|
145
85
|
options?: import('./exports').OpenExperienceOptions;
|
|
146
86
|
}, void, Error>;
|
|
147
|
-
listStore: import('
|
|
148
|
-
|
|
149
|
-
key: string;
|
|
150
|
-
name: string;
|
|
151
|
-
configStore: import('effector').Store<{
|
|
152
|
-
name: string;
|
|
153
|
-
decisionLogic: import('./logic-engine').LogicValue | LogicRule;
|
|
154
|
-
targetSelectors: import('.').ExperienceTarget[];
|
|
155
|
-
initializeOpenLogic: import('./logic-engine').LogicValue | LogicRule;
|
|
156
|
-
}>;
|
|
157
|
-
treeStore: import('effector').Store<{
|
|
158
|
-
steps: ExperienceStep[];
|
|
159
|
-
nodes: import('.').ExperienceNode[];
|
|
160
|
-
edges: import('.').ExperienceEdge[];
|
|
161
|
-
conditions: Condition[];
|
|
162
|
-
}>;
|
|
163
|
-
componentStore: import('effector').Store<{
|
|
164
|
-
name: string;
|
|
165
|
-
component: AdaptedComponent<string, unknown>;
|
|
166
|
-
frameworkStore: import('effector').Store<Framework | undefined>;
|
|
167
|
-
} | undefined>;
|
|
168
|
-
actions: import('.').ExperienceAction[];
|
|
169
|
-
merge: import('effector').EventCallable<{
|
|
170
|
-
experience: Partial<Experience>;
|
|
171
|
-
strategy: "override";
|
|
172
|
-
}>;
|
|
173
|
-
}[]>;
|
|
87
|
+
listStore: Store<import('.').ExperienceStore[]>;
|
|
88
|
+
initialiseExperiencesFx: Effect<void, void, Error>;
|
|
174
89
|
};
|
|
175
90
|
readonly frameworks: {
|
|
176
|
-
register:
|
|
177
|
-
|
|
178
|
-
|
|
91
|
+
register: EventCallable<{
|
|
92
|
+
name: string;
|
|
93
|
+
framework: Framework;
|
|
94
|
+
}>;
|
|
95
|
+
getByName: (name: string) => Store<Framework | undefined>;
|
|
96
|
+
listStore: Store<Framework[]>;
|
|
179
97
|
};
|
|
180
98
|
readonly predicates: {
|
|
181
|
-
register:
|
|
182
|
-
|
|
183
|
-
|
|
99
|
+
register: EventCallable<{
|
|
100
|
+
name: string;
|
|
101
|
+
predicate: Predicate;
|
|
102
|
+
}>;
|
|
103
|
+
getByName: (name: string) => Store<Predicate | undefined>;
|
|
104
|
+
listStore: Store<{
|
|
184
105
|
name: string;
|
|
185
106
|
predicate: Predicate;
|
|
186
107
|
}[]>;
|
|
187
|
-
getEvokablePredicate: (predicateName: string) =>
|
|
108
|
+
getEvokablePredicate: (predicateName: string) => Store<() => ReturnType<Predicate>>;
|
|
188
109
|
};
|
|
189
110
|
readonly features: {
|
|
190
|
-
register:
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
111
|
+
register: EventCallable<{
|
|
112
|
+
id: string;
|
|
113
|
+
feature: Feature;
|
|
114
|
+
}>;
|
|
115
|
+
getById: (id: string) => Store<import('.').FeatureBucket | undefined>;
|
|
116
|
+
getByName: (name: string) => Store<import('.').FeatureIndexItem | undefined>;
|
|
117
|
+
listStore: Store<import('.').FeatureBucket[]>;
|
|
118
|
+
getEvokableFeature: (featureName: string) => Store<() => Promise<boolean | string | undefined>>;
|
|
195
119
|
};
|
|
196
120
|
readonly conditions: {
|
|
197
121
|
register: (condition: Condition) => void;
|
|
198
|
-
getById: (id: Condition["id"]) =>
|
|
199
|
-
getByKey: (key: Condition["key"]) =>
|
|
200
|
-
listStore:
|
|
201
|
-
indexStore:
|
|
122
|
+
getById: (id: Condition["id"]) => Store<Condition | null>;
|
|
123
|
+
getByKey: (key: Condition["key"]) => Store<Condition | null>;
|
|
124
|
+
listStore: Store<Condition[]>;
|
|
125
|
+
indexStore: StoreWritable<{
|
|
202
126
|
[id: string]: Condition;
|
|
203
127
|
}>;
|
|
204
128
|
};
|
|
205
129
|
readonly fields: {
|
|
206
130
|
register: (field: Field) => void;
|
|
207
131
|
update: (key: import('.').FieldBase["key"], updates: Partial<Field>) => void;
|
|
208
|
-
getById: (id: import('.').FieldBase["id"]) =>
|
|
209
|
-
getByKey: (key: import('.').FieldBase["key"]) =>
|
|
210
|
-
listStore:
|
|
211
|
-
getByName: (name: import('.').FieldBase["name"]) =>
|
|
132
|
+
getById: (id: import('.').FieldBase["id"]) => Store<Field | null>;
|
|
133
|
+
getByKey: (key: import('.').FieldBase["key"]) => Store<Field | null>;
|
|
134
|
+
listStore: Store<Field[]>;
|
|
135
|
+
getByName: (name: import('.').FieldBase["name"]) => Store<Field | null>;
|
|
212
136
|
};
|
|
213
137
|
readonly responses: {
|
|
214
138
|
register: {
|
|
215
139
|
(fieldKey: Field["key"], response: import('.').Response): void;
|
|
216
140
|
(payload: Record<Field["key"], import('.').Response>, response?: never): void;
|
|
217
141
|
};
|
|
218
|
-
clearAll:
|
|
219
|
-
clear:
|
|
142
|
+
clearAll: EventCallable<void>;
|
|
143
|
+
clear: EventCallable<string>;
|
|
220
144
|
commit: (responsesToCommit: import('.').CommitResponses) => Promise<{
|
|
221
145
|
errors: import('.').ValidationError[];
|
|
222
146
|
}>;
|
|
@@ -224,36 +148,63 @@ export declare class Picked {
|
|
|
224
148
|
responsesToCommit: import('.').CommitResponses;
|
|
225
149
|
validationErrors: import('.').ValidationError[];
|
|
226
150
|
}>;
|
|
227
|
-
listStore:
|
|
151
|
+
listStore: Store<{
|
|
228
152
|
fieldKey: string;
|
|
229
153
|
value: import('.').FieldValue;
|
|
230
154
|
}[]>;
|
|
231
|
-
getAllStore:
|
|
155
|
+
getAllStore: Store<{
|
|
232
156
|
[fieldKey: string]: import('.').FieldValue;
|
|
233
157
|
}>;
|
|
234
|
-
getByFieldId: (id: Field["id"]) =>
|
|
235
|
-
getByFieldKey: (key: Field["key"]) =>
|
|
236
|
-
getByFieldName: (fieldName: Field["name"]) =>
|
|
158
|
+
getByFieldId: (id: Field["id"]) => Store<import('.').FieldValue>;
|
|
159
|
+
getByFieldKey: (key: Field["key"]) => Store<import('.').FieldValue>;
|
|
160
|
+
getByFieldName: (fieldName: Field["name"]) => Store<import('.').FieldValue>;
|
|
237
161
|
};
|
|
238
162
|
readonly steps: {
|
|
239
163
|
register: (step: ExperienceStep) => void;
|
|
240
|
-
getById: (id: ExperienceStep["id"]) =>
|
|
241
|
-
getByKey: (key: ExperienceStep["key"]) =>
|
|
242
|
-
listStore:
|
|
243
|
-
indexStore:
|
|
164
|
+
getById: (id: ExperienceStep["id"]) => Store<ExperienceStep | null>;
|
|
165
|
+
getByKey: (key: ExperienceStep["key"]) => Store<ExperienceStep | null>;
|
|
166
|
+
listStore: Store<ExperienceStep[]>;
|
|
167
|
+
indexStore: StoreWritable<{
|
|
244
168
|
[id: string]: ExperienceStep;
|
|
245
169
|
}>;
|
|
246
170
|
};
|
|
247
171
|
readonly actions: {
|
|
248
|
-
register:
|
|
249
|
-
|
|
250
|
-
|
|
172
|
+
register: EventCallable<{
|
|
173
|
+
key: string;
|
|
174
|
+
action: Action;
|
|
175
|
+
}>;
|
|
176
|
+
getByKey: (key: string) => Store<Action | undefined>;
|
|
177
|
+
listStore: Store<import('.').ActionIndexItem[]>;
|
|
251
178
|
getEvokableAction: (actionKey: string, options?: {
|
|
252
179
|
experience: import('.').ExperienceInstance;
|
|
253
|
-
}) =>
|
|
180
|
+
}) => Store<() => ReturnType<Action>>;
|
|
254
181
|
};
|
|
182
|
+
readonly stateSnapshotStore: Store<StateSnapshot>;
|
|
183
|
+
readonly evaluateRuleLogicFx: Effect<EvaluateRuleLogicParams, unknown, Error>;
|
|
184
|
+
/** Public trigger — fires the start chain. `await allSettled(client.start, { scope })` resolves once the chain has fully settled. */
|
|
185
|
+
readonly start: EventCallable<void>;
|
|
186
|
+
/** Reactive store of the readiness flag. */
|
|
187
|
+
readonly readyStore: StoreWritable<boolean>;
|
|
188
|
+
/** Reactive store of the precondition-gate result (`undefined` until `start` is fired). */
|
|
189
|
+
readonly preconditionPassedStore: StoreWritable<boolean | undefined>;
|
|
190
|
+
/** Reactive store of the condition-gate result (`undefined` until `start` is fired). */
|
|
191
|
+
readonly conditionPassedStore: StoreWritable<boolean | undefined>;
|
|
192
|
+
/** Reactive store of the current lifecycle stage. */
|
|
193
|
+
readonly lifecycleStageStore: StoreWritable<LifecycleStage>;
|
|
194
|
+
private readonly lifecycle;
|
|
195
|
+
/**
|
|
196
|
+
* Effect that interpolates a template string against the latest responses plus a caller-supplied context. Source is `responses.listStore` so renders are scope-aware and pick up the latest committed responses without `.getState()`.
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* ```typescript
|
|
200
|
+
* const greeting = await client.renderStringFx({ template: 'Hi {{name}}', context: { name: 'Mae' } })
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
readonly renderStringFx: Effect<{
|
|
204
|
+
template: string;
|
|
205
|
+
context?: Record<string, unknown>;
|
|
206
|
+
}, string, Error>;
|
|
255
207
|
constructor(options: CreateClientOptions);
|
|
256
|
-
start: () => void;
|
|
257
208
|
registerFramework: (framework: Framework) => void;
|
|
258
209
|
registerComponent: (name: string, component: AdaptedComponent) => void;
|
|
259
210
|
registerPlugin: (plugin: Plugin) => void;
|
|
@@ -264,7 +215,6 @@ export declare class Picked {
|
|
|
264
215
|
registerStep: (step: ExperienceStep) => void;
|
|
265
216
|
registerAction: (key: string, action: Action) => void;
|
|
266
217
|
registerExperience: (experience: Experience) => void;
|
|
267
|
-
getStateSnapshot: () => StateSnapshot;
|
|
268
218
|
/**
|
|
269
219
|
* Launches an experience by ID.
|
|
270
220
|
*
|
|
@@ -307,53 +257,11 @@ export declare class Picked {
|
|
|
307
257
|
* ```
|
|
308
258
|
*/
|
|
309
259
|
openExperienceByKey: (experienceKey: string) => Promise<void>;
|
|
310
|
-
private runPluginStartHooks;
|
|
311
|
-
private evaluateGate;
|
|
312
260
|
private setupPlugins;
|
|
313
261
|
private setupFeatures;
|
|
314
262
|
private setupPredicates;
|
|
315
263
|
private setupActions;
|
|
316
264
|
private setupComponents;
|
|
317
265
|
getPluginConfig: (pluginName: string) => PluginConfigIndex[string] | Record<string, unknown>;
|
|
318
|
-
/**
|
|
319
|
-
* Interpolates a template string using values from the client's response store and/or a provided context.
|
|
320
|
-
* Supports dot-notation, modifiers, and executing functions found in the context.
|
|
321
|
-
*
|
|
322
|
-
* Sources:
|
|
323
|
-
* - responses.*: Loaded automatically from the client's internal response store by fieldId (e.g. {{ responses.email }}).
|
|
324
|
-
* - Context: Any non-responses.* key must be supplied in the context; nested dot-notation is supported.
|
|
325
|
-
* - Functions: If a context value is a function, it is invoked and its result is rendered.
|
|
326
|
-
*
|
|
327
|
-
* Placeholders:
|
|
328
|
-
* - {{ key | modifier: arg | modifier2: arg2 }} with modifiers applied left-to-right.
|
|
329
|
-
*
|
|
330
|
-
* Modifiers:
|
|
331
|
-
* - default: Use the argument when the value is null, undefined, NaN, or empty string; otherwise return the value as a string.
|
|
332
|
-
* - append: Append the argument (space-separated) when the value is non-empty.
|
|
333
|
-
* - prepend: Prepend the argument (space-separated) when the value is non-empty.
|
|
334
|
-
* - upper: Uppercase string values.
|
|
335
|
-
* - lower: Lowercase string values.
|
|
336
|
-
* - capitalize: Capitalize the first letter of string values.
|
|
337
|
-
* - list: Format Arrays, Maps, and Sets via Intl.ListFormat (Maps render as key: value pairs).
|
|
338
|
-
*
|
|
339
|
-
* Behavior:
|
|
340
|
-
* - Empty values (null, undefined, empty string, NaN) render as empty. Numeric 0 renders as "0", boolean false renders as "false", and boolean true renders as "true".
|
|
341
|
-
* - Objects and arrays are JSON-stringified; Maps/Sets serialize to {} unless the list modifier is used.
|
|
342
|
-
* - Unknown modifiers are ignored.
|
|
343
|
-
*
|
|
344
|
-
* @param template Template containing placeholders.
|
|
345
|
-
* @param context Optional data for interpolation. Non-responses.* keys belong here; function values are executed.
|
|
346
|
-
* @returns Interpolated string.
|
|
347
|
-
* @example
|
|
348
|
-
* renderString("Hello {{ name | default: 'Guest' | capitalize }}! Email: {{ responses.email | lower }}.", { name: "ALICE" })
|
|
349
|
-
* // => "Hello Alice! Email: alice@example.com."
|
|
350
|
-
* @example
|
|
351
|
-
* renderString("User: {{ getName | capitalize }}", { getName: () => "alice" })
|
|
352
|
-
* // => "User: Alice"
|
|
353
|
-
* @example
|
|
354
|
-
* renderString("Fruits: {{ fruits | list }}", { fruits: ["apple", "banana", "cherry"] })
|
|
355
|
-
* // => "Fruits: apple, banana, and cherry"
|
|
356
|
-
*/
|
|
357
|
-
renderString: (template: string, context?: Record<string, unknown>) => string;
|
|
358
266
|
}
|
|
359
267
|
//# sourceMappingURL=picked.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picked.d.ts","sourceRoot":"","sources":["../../src/picked.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"picked.d.ts","sourceRoot":"","sources":["../../src/picked.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OA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AAe,MAAM,EACrB,UAAU,uBAAuB,KAChC,OAAO,CAAC,IAAI,CAAC,CAEf;IAED;;;;;;;;OAQG;IAEH,kBAAkB,GAAU,cAAc,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAE/D;IAED;;;;;;;;OAQG;IAEH,mBAAmB,GAAU,eAAe,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;IAED,OAAO,CAAC,YAAY;IAsBpB,OAAO,CAAC,aAAa;IA8CrB,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,eAAe;IAWvB,eAAe,GAAI,YAAY,MAAM,KAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE1F;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,OAAO,KAAK,EACV,+BAA+B,EAC/B,mBAAmB,EACnB,aAAa,EAGd,MAAM,SAAS,CAAA;AA2VhB;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAmC/B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,+BAA+B,GAAG,MAAM,CAmD1F"}
|
|
@@ -1 +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,GAAI,eAE5C,8BAAmC,KAAG,
|
|
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,GAAI,eAE5C,8BAAmC,KAAG,MAmDxC,CAAA"}
|
|
@@ -3,19 +3,5 @@ import { Plugin } from '../../entities/plugin/plugin';
|
|
|
3
3
|
export interface HistoryBrowserStoragePlugin {
|
|
4
4
|
storage?: 'local' | 'session';
|
|
5
5
|
}
|
|
6
|
-
/**
|
|
7
|
-
* Picked plugin that persists per-experience history snapshots into
|
|
8
|
-
* `localStorage` (default) or `sessionStorage` and restores them on the
|
|
9
|
-
* client `load` event. Snapshots are keyed by `experienceId`; when a fresh
|
|
10
|
-
* `ExperienceInstance` spawns it reads its experience's snapshot via the
|
|
11
|
-
* history entity's `seedInstanceFromSnapshot` event and resumes from the
|
|
12
|
-
* last step (trailing action/condition terminals are dropped at seed time).
|
|
13
|
-
*
|
|
14
|
-
* @param {HistoryBrowserStoragePlugin} [options] - Plugin options.
|
|
15
|
-
* @param {'local' | 'session'} [options.storage] - Backing store.
|
|
16
|
-
* @returns {Plugin} A Picked client plugin.
|
|
17
|
-
* @example
|
|
18
|
-
* client.use(historyBrowserStoragePlugin({ storage: 'session' }))
|
|
19
|
-
*/
|
|
20
6
|
export declare const historyBrowserStoragePlugin: ({ storage, }?: HistoryBrowserStoragePlugin) => Plugin;
|
|
21
7
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +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
|
|
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,GAAI,eAEzC,2BAAgC,KAAG,MA8BrC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/web-components/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAG1D,eAAO,MAAM,mBAAmB,QAAO,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/web-components/plugin.ts"],"names":[],"mappings":"AAAA,kJAAkJ;AAClJ,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAG1D,eAAO,MAAM,mBAAmB,QAAO,MA2BtC,CAAA"}
|
|
@@ -8,5 +8,12 @@ export interface Renderer<T = AdaptedComponent<string, unknown>> {
|
|
|
8
8
|
body: string;
|
|
9
9
|
}>;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Renders all experiences in sequence using the provided renderers.
|
|
13
|
+
*
|
|
14
|
+
* @param {Picked} client - The Picked client instance.
|
|
15
|
+
* @param {Renderer[]} renderers - Array of available renderers to use.
|
|
16
|
+
* @returns {Promise<string[]>} A promise resolving to rendered experience HTML strings.
|
|
17
|
+
*/
|
|
11
18
|
export declare function render(client: Picked, renderers: Renderer[]): Promise<string[]>;
|
|
12
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAA;AAE7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAwBvE,MAAM,WAAW,QAAQ,CAAC,CAAC,GAAG,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC;IAC7D,gBAAgB,EAAE,CAAC,SAAS,EAAE,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAA;IAC3E,MAAM,EAAE,CACN,SAAS,EAAE,CAAC,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,kBAAkB,KAC3B,OAAO,CAAC;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;KACb,CAAC,CAAA;CACH;AAmBD;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAkJ/E"}
|
|
@@ -3,7 +3,7 @@ import { ValidationError } from '../entities/response/response';
|
|
|
3
3
|
import { ExperienceStep } from '../entities/step/step';
|
|
4
4
|
import { ExperienceInstance } from '../entities/experience-instance/experience-instance';
|
|
5
5
|
import { ResolvedFeature } from '../entities/feature/feature';
|
|
6
|
-
import { Session } from '
|
|
6
|
+
import { Session } from '../entities/session/session';
|
|
7
7
|
export interface FormPayload {
|
|
8
8
|
id: string;
|
|
9
9
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/utils/events.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAA;AAC7F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/utils/events.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAA;AAC7F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAE1D,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,KAAK,CAAA;IACZ,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;IACzB,UAAU,EAAE,KAAK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,EAAE,CAAA;SAAE,CAAA;QACxC,UAAU,EAAE,kBAAkB,CAAA;QAC9B,IAAI,CAAC,EAAE,cAAc,CAAA;KACtB,CAAA;IACD,sBAAsB,EAAE;QACtB,SAAS,EAAE;YAAE,MAAM,EAAE,eAAe,EAAE,CAAA;SAAE,CAAA;QACxC,UAAU,EAAE,kBAAkB,CAAA;QAC9B,IAAI,CAAC,EAAE,cAAc,CAAA;KACtB,CAAA;IACD,SAAS,EAAE;QACT,KAAK,EAAE,OAAO,GAAG,MAAM,CAAA;QACvB,IAAI,EAAE,OAAO,CAAA;KACd,CAAA;CACF;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,UAAU,CAAA;AAE9C,MAAM,MAAM,eAAe,GAAG;KAC3B,CAAC,IAAI,eAAe,GAAG;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,KAAK,GACxF,MAAM,GACN,UAAU,CAAC,CAAC,CAAC,CAAC;CACnB,CAAC,eAAe,CAAC,CAAA;AAElB,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,IAAI,CAAA;IACR,OAAO,EAAE,eAAe,CAAA;CACzB;AAED,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAA;AAgB1D,eAAO,MAAM,kBAAkB,GAC7B,UAAU,UAAU,CAAC,OAAO,WAAW,CAAC,eAAe,CAAC,CAAC,KACxD,iBAgBF,CAAA"}
|
|
@@ -5,8 +5,16 @@ declare global {
|
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
export declare function getPickedConfig<ExtendedPickedConfig extends Record<string, unknown> | undefined>(): Readonly<Partial<CreateClientOptions> & ExtendedPickedConfig> | undefined;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the Picked project id from the supplied options, falling back to
|
|
10
|
+
* `window.pickedConfig.projectId` and then to a `data-projectid` (or
|
|
11
|
+
* `project-id`) attribute on a `picked_script`/`picked`/`cvly` script tag.
|
|
12
|
+
*
|
|
13
|
+
* @param {CreateClientOptions} options - Options passed to `createClient`.
|
|
14
|
+
* @returns {string} The resolved project id.
|
|
15
|
+
* @throws {Error} If no project id can be resolved from any source.
|
|
16
|
+
* @example
|
|
17
|
+
* getCreateClientProjectId({ projectId: 'proj-abc' })
|
|
18
|
+
*/
|
|
19
|
+
export declare function getCreateClientProjectId(options: CreateClientOptions): string;
|
|
12
20
|
//# sourceMappingURL=picked-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picked-config.d.ts","sourceRoot":"","sources":["../../../src/utils/picked-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAGpD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,YAAY,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;KAC5C;CACF;AAED,wBAAgB,eAAe,CAC7B,oBAAoB,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,+EAUjE;
|
|
1
|
+
{"version":3,"file":"picked-config.d.ts","sourceRoot":"","sources":["../../../src/utils/picked-config.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAGpD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,YAAY,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;KAC5C;CACF;AAED,wBAAgB,eAAe,CAC7B,oBAAoB,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,+EAUjE;AA4BD;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAqB7E"}
|
|
@@ -14,16 +14,11 @@ import { Picked } from '../picked';
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function isRulesLogic(rules: unknown): rules is LogicRule;
|
|
16
16
|
/**
|
|
17
|
-
* Evaluates a json-logic condition against the current client state.
|
|
17
|
+
* Evaluates a json-logic condition against the current client state by delegating to `client.evaluateRuleLogicFx`.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
* and features, then applies the caller-supplied `context` on top so that
|
|
21
|
-
* callers such as the field evaluator can override defaults like `responses`
|
|
22
|
-
* with staged/in-session values.
|
|
23
|
-
*
|
|
24
|
-
* @param {Picked} client - The Picked client instance providing state snapshots.
|
|
19
|
+
* @param {Picked} client - The Picked client instance providing reactive state stores.
|
|
25
20
|
* @param {LogicRule} condition - The json-logic rule to evaluate.
|
|
26
|
-
* @param {LogicObject} [context] - Optional overrides merged on top of the default context.
|
|
21
|
+
* @param {LogicObject} [context] - Optional overrides merged on top of the default context (e.g., staged form values).
|
|
27
22
|
* @returns {Promise<unknown>} The result of applying the logic rule.
|
|
28
23
|
* @example
|
|
29
24
|
* ```ts
|
|
@@ -32,5 +27,5 @@ export declare function isRulesLogic(rules: unknown): rules is LogicRule;
|
|
|
32
27
|
* })
|
|
33
28
|
* ```
|
|
34
29
|
*/
|
|
35
|
-
export declare function evaluateRuleLogic(client: Picked, condition: LogicRule, context?: LogicObject): Promise<
|
|
30
|
+
export declare function evaluateRuleLogic(client: Picked, condition: LogicRule, context?: LogicObject): Promise<unknown>;
|
|
36
31
|
//# sourceMappingURL=rules-logic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules-logic.d.ts","sourceRoot":"","sources":["../../../src/utils/rules-logic.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"rules-logic.d.ts","sourceRoot":"","sources":["../../../src/utils/rules-logic.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAGvC;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE/D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,OAAO,CAAC,CAElB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picked/client",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.1778120127377",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@withease/factories": "^1.0.5"
|
|
6
6
|
},
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"size-limit": [
|
|
161
161
|
{
|
|
162
162
|
"path": "dist/esm/index.js",
|
|
163
|
-
"limit": "
|
|
163
|
+
"limit": "13.5 kB"
|
|
164
164
|
},
|
|
165
165
|
{
|
|
166
166
|
"path": "dist/esm/server/index.js",
|