@picked/client 0.0.1-dev.1786004500650 → 0.0.1-dev.1786070942751
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-fPB4ZBjC.js → api-BqZglw7-.js} +1 -1
- package/dist/{api-BLYaNoaa.cjs → api-C5vMi1gb.cjs} +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/index.js +20 -1
- package/dist/esm/plugins/dynamic-experiences/index.js +4 -3
- package/dist/esm/server/index.js +36 -39
- package/dist/plugin-EFn9ALEF.cjs +1 -0
- package/dist/plugin-YytfMG0n.js +153 -0
- package/dist/provider-Bng22ugW.cjs +1 -0
- package/dist/provider-hAf_rar9.js +68 -0
- package/dist/registry-CdPPoopn.js +74 -0
- package/dist/registry-DpNNJt2g.cjs +1 -0
- package/dist/types/data-source/provider.d.ts +7 -6
- package/dist/types/data-source/provider.d.ts.map +1 -1
- package/dist/types/data-source/registry.d.ts +2 -3
- package/dist/types/data-source/registry.d.ts.map +1 -1
- package/dist/types/picked.d.ts +50 -1
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/index.d.ts +1 -3
- package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +8 -7
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +0 -24
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/server/index.d.ts +1 -1
- package/dist/types/server/index.d.ts.map +1 -1
- package/dist/types/server/serialize.d.ts +7 -25
- package/dist/types/server/serialize.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/plugin-Bg-jjHsL.cjs +0 -1
- package/dist/plugin-CfO5xaRm.js +0 -302
package/dist/esm/server/index.js
CHANGED
|
@@ -1,44 +1,41 @@
|
|
|
1
1
|
import { a as e, c as t, i as n, o as r, s as i, t as a, u as o } from "../../experience-instance-DGk11d8a.js";
|
|
2
|
-
import {
|
|
3
|
-
import { attach as
|
|
2
|
+
import { n as s } from "../../plugin-YytfMG0n.js";
|
|
3
|
+
import { attach as c, createEffect as l, createEvent as u, createStore as d, sample as f } from "effector";
|
|
4
4
|
//#region src/server/serialize.ts
|
|
5
|
-
var
|
|
6
|
-
function
|
|
5
|
+
var p = 1e4;
|
|
6
|
+
function m(e) {
|
|
7
7
|
if (e?.location !== void 0) return { location: e.location };
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function h(e, t) {
|
|
10
10
|
return e.nodes.filter(o).some((e) => t.get(e.stepId) === !0);
|
|
11
11
|
}
|
|
12
|
-
async function
|
|
13
|
-
let {
|
|
14
|
-
e.conditionResults.reset(),
|
|
12
|
+
async function g(e, n = {}) {
|
|
13
|
+
let i = n.previewToken === void 0 ? void 0 : { previewToken: n.previewToken }, a = await e.getProjectConfig(i), o = e.session.store.getState().id;
|
|
14
|
+
e.conditionResults.reset(), s(e, a, {
|
|
15
15
|
isPreview: !1,
|
|
16
|
-
sessionId:
|
|
16
|
+
sessionId: o
|
|
17
17
|
});
|
|
18
|
-
let
|
|
18
|
+
let c = m(n.attributes), l = n.timeoutMs ?? p, u = new Map(a.steps.map((e) => [e.id, e.layoutContentId !== void 0 && e.layoutContentId !== null])), d = Object.fromEntries(a.conditions.map((e) => [e.key, e])), f = a.experiences.filter((e) => !t(e.condition, d)), g = (await Promise.all(f.map(async (t) => ({
|
|
19
19
|
experience: t,
|
|
20
|
-
active: await r(e, { condition: t.condition }, { context:
|
|
21
|
-
})))).filter((e) => e.active).map((e) => e.experience), _ = await Promise.all(
|
|
20
|
+
active: await r(e, { condition: t.condition }, { context: c })
|
|
21
|
+
})))).filter((e) => e.active).map((e) => e.experience), _ = await Promise.all(g.filter((e) => h(e, u)).map((t) => e.getExperienceContent({
|
|
22
22
|
id: t.id,
|
|
23
23
|
key: t.key
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
key: t.key
|
|
27
|
-
}, { previewToken: n.previewToken }) : s(e.apiUrl, e.projectId, t.id, {
|
|
28
|
-
previewToken: n.previewToken,
|
|
24
|
+
}, {
|
|
25
|
+
...i,
|
|
29
26
|
signal: AbortSignal.timeout(l)
|
|
30
27
|
}))), v = /* @__PURE__ */ new Map();
|
|
31
28
|
for (let e of _) if (e) for (let t of e.content) v.set(t.id, t);
|
|
32
29
|
return {
|
|
33
|
-
versionId:
|
|
34
|
-
projectConfig:
|
|
30
|
+
versionId: a.versionId,
|
|
31
|
+
projectConfig: a,
|
|
35
32
|
content: Array.from(v.values()),
|
|
36
33
|
conditionResults: e.conditionResults.store.getState()
|
|
37
34
|
};
|
|
38
35
|
}
|
|
39
36
|
//#endregion
|
|
40
37
|
//#region src/server/index.ts
|
|
41
|
-
function
|
|
38
|
+
function _() {
|
|
42
39
|
let e, t;
|
|
43
40
|
return {
|
|
44
41
|
promise: new Promise((n, r) => {
|
|
@@ -48,16 +45,16 @@ function v() {
|
|
|
48
45
|
reject: (e) => t(e)
|
|
49
46
|
};
|
|
50
47
|
}
|
|
51
|
-
function
|
|
52
|
-
let { promise: n, resolve: r } =
|
|
48
|
+
function v(e, t) {
|
|
49
|
+
let { promise: n, resolve: r } = _(), i = u(), o = u(), s = u(), p = u(), m = u(), h = e.experiences.listStore.map((t) => t.map((t) => a({
|
|
53
50
|
client: e,
|
|
54
51
|
experience: t
|
|
55
|
-
}))), g =
|
|
52
|
+
}))), g = d({
|
|
56
53
|
currentExperienceIndex: 0,
|
|
57
54
|
renderedExperiences: [],
|
|
58
55
|
isComplete: !1
|
|
59
|
-
}),
|
|
60
|
-
let n =
|
|
56
|
+
}), v = l(async (t) => {
|
|
57
|
+
let n = c({
|
|
61
58
|
source: t.experience.componentStore,
|
|
62
59
|
effect: async (n, r) => {
|
|
63
60
|
let i = t.availableRenderers[r];
|
|
@@ -72,7 +69,7 @@ function y(e, t) {
|
|
|
72
69
|
if (t) return t;
|
|
73
70
|
}
|
|
74
71
|
return null;
|
|
75
|
-
}), y =
|
|
72
|
+
}), y = l(async ({ experience: e, availableRenderers: t, startRendererIndex: n = 0 }) => e ? v({
|
|
76
73
|
experience: e,
|
|
77
74
|
availableRenderers: t,
|
|
78
75
|
startRendererIndex: n
|
|
@@ -84,13 +81,13 @@ function y(e, t) {
|
|
|
84
81
|
})).on(m, (e) => ({
|
|
85
82
|
...e,
|
|
86
83
|
currentExperienceIndex: e.currentExperienceIndex + 1
|
|
87
|
-
})).on(
|
|
84
|
+
})).on(p, (e) => ({
|
|
88
85
|
...e,
|
|
89
86
|
isComplete: !0
|
|
90
|
-
})).reset(i),
|
|
87
|
+
})).reset(i), f({
|
|
91
88
|
clock: i,
|
|
92
89
|
target: o
|
|
93
|
-
}),
|
|
90
|
+
}), f({
|
|
94
91
|
clock: o,
|
|
95
92
|
source: {
|
|
96
93
|
experiences: h,
|
|
@@ -103,22 +100,22 @@ function y(e, t) {
|
|
|
103
100
|
startRendererIndex: 0
|
|
104
101
|
}),
|
|
105
102
|
target: y
|
|
106
|
-
}),
|
|
103
|
+
}), f({
|
|
107
104
|
clock: y.doneData,
|
|
108
105
|
filter: (e) => e !== null,
|
|
109
106
|
fn: (e) => e.rendered.body,
|
|
110
107
|
target: s
|
|
111
|
-
}),
|
|
108
|
+
}), f({
|
|
112
109
|
clock: s,
|
|
113
110
|
target: o
|
|
114
|
-
}),
|
|
111
|
+
}), f({
|
|
115
112
|
clock: y.doneData,
|
|
116
113
|
filter: (e) => e === null,
|
|
117
114
|
target: m
|
|
118
|
-
}),
|
|
115
|
+
}), f({
|
|
119
116
|
clock: m,
|
|
120
117
|
target: o
|
|
121
|
-
}),
|
|
118
|
+
}), f({
|
|
122
119
|
clock: [
|
|
123
120
|
o,
|
|
124
121
|
m,
|
|
@@ -129,18 +126,18 @@ function y(e, t) {
|
|
|
129
126
|
state: g
|
|
130
127
|
},
|
|
131
128
|
filter: ({ experiences: e, state: t }) => t.currentExperienceIndex >= e.length,
|
|
132
|
-
target:
|
|
129
|
+
target: p
|
|
133
130
|
});
|
|
134
|
-
let b =
|
|
131
|
+
let b = c({
|
|
135
132
|
source: g,
|
|
136
133
|
effect: (e) => {
|
|
137
134
|
e.isComplete && r(e.renderedExperiences);
|
|
138
135
|
}
|
|
139
136
|
});
|
|
140
|
-
return
|
|
141
|
-
clock:
|
|
137
|
+
return f({
|
|
138
|
+
clock: p,
|
|
142
139
|
target: b
|
|
143
140
|
}), i(), n;
|
|
144
141
|
}
|
|
145
142
|
//#endregion
|
|
146
|
-
export { a as createExperienceInstance, n as evaluateConditionMemo, e as hashRule, r as isExperienceActive,
|
|
143
|
+
export { a as createExperienceInstance, n as evaluateConditionMemo, e as hashRule, r as isExperienceActive, s as registerProjectConfig, v as render, i as ruleReferencesAction, t as ruleReferencesActionDeep, g as serialize };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require("./logger-CSTvAyyB.cjs");let e=require("effector");function t(e){let t=2166136261;for(let n of e)t^=n.codePointAt(0)??0,t=Math.imul(t,16777619);return t>>>0}function n(e){let t=e;return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),t^=t>>>16,t>>>0}function r(e,r){return n(t(`${e}:${r}`))%100}function i(e,t){return t<=0?!1:t>=100||e<t}function a(e,t){if(Array.isArray(t.conditions))for(let n of t.conditions)e.registerCondition(n)}function o(e,t){e.registerExperience({id:t.id,key:t.key,name:t.name,targets:t.targets,nodes:t.nodes,edges:t.edges,condition:t.condition,initializeOpen:t.initializeOpen,componentName:t.componentName})}function s(e,t){if(Array.isArray(t.fields))for(let n of t.fields)e.registerField(n)}function c(e,t){if(!Array.isArray(t.steps))return;let n=new Map(t.fields.map(e=>[e.id,e.key]));for(let r of t.steps){let t=[];for(let e of r.fieldIds??[]){let i=n.get(e);if(i===void 0){`${r.key}${e}`;continue}t.push(i)}let i=r.layoutContentId?e.contents.getById(r.layoutContentId):null;e.registerStep({id:r.id,key:r.key,name:r.name,fieldKeys:t,layoutName:r.layoutName,...r.layoutContentId!==void 0&&{layoutContentId:r.layoutContentId,layoutContentStore:i}})}}function l(e,t){if(Array.isArray(t.experiences))for(let n of t.experiences)o(e,n)}function u(e,t,n){p(e,t,n.isPreview,n.sessionId),a(e,t),s(e,t),c(e,t),l(e,t)}function d(e){let t=e.searchParams[`preview-token`];if(t&&t.length>0)return t[0]}function f(e){let t=new Set,n=e.searchParams.feature;if(!n)return t;for(let e of n){let n=e.indexOf(`:`);n>0&&t.add(e.substring(0,n))}return t}function p(e,t,n,r){let i=f(e);for(let a of t.features)i.has(a.id)||m(e,a,n,r)}function m(e,t,n,a){let o=r(a,t.id);e.registerFeature(t.id,{key:`v${t.version}`,name:t.name,enabled:t.enabled,weight:t.weight,storage:n?`session`:`local`,decide:()=>i(o,t.weight)})}function h(e,t){for(let n of t.content)e.registerContent({id:n.id,contentModelKey:n.contentModelKey,data:n.data})}function g(e,t){let n=new Map;return(r,i)=>{let a=n.get(r.id);if(a)return a;let o=(async()=>{try{let n=await t(r,i);return n&&h(e,n),n}finally{n.delete(r.id)}})();return n.set(r.id,o),o}}function _(e,t){let n=new Set(t&&Array.isArray(t.experiences)?t.experiences.map(e=>e.id):[]);return(t,r)=>n.has(t.id)?e(t,r):Promise.resolve(null)}function v(){return{name:`dynamic-experiences`,setup:t=>({onStart:(0,e.attach)({source:t.session.store.map(e=>e.id),effect:async e=>{let n=d(t),r=n!==void 0,i=n===void 0?void 0:{previewToken:n},a=await t.getProjectConfig(n===void 0?void 0:{previewToken:n}).catch(e=>null);if(t.contentLoader=g(t,_(e=>t.getExperienceContent(e,i),a)),!a)return;let o=t.seededVersionId;if(o!==null&&o!==a.versionId){t.versionSkew={seeded:o,resolved:a.versionId},`${a.versionId}${o}`;return}t.previewEmbedderOrigins=a.previewEmbedderOrigins??null,u(t,a,{isPreview:r,sessionId:e})}})})}}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return v}});
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import "./logger-DMN6TxJJ.js";
|
|
2
|
+
import { attach as e } from "effector";
|
|
3
|
+
//#region src/plugins/dynamic-experiences/hash.ts
|
|
4
|
+
function t(e) {
|
|
5
|
+
let t = 2166136261;
|
|
6
|
+
for (let n of e) t ^= n.codePointAt(0) ?? 0, t = Math.imul(t, 16777619);
|
|
7
|
+
return t >>> 0;
|
|
8
|
+
}
|
|
9
|
+
function n(e) {
|
|
10
|
+
let t = e;
|
|
11
|
+
return t ^= t >>> 16, t = Math.imul(t, 2246822507), t ^= t >>> 13, t = Math.imul(t, 3266489909), t ^= t >>> 16, t >>> 0;
|
|
12
|
+
}
|
|
13
|
+
function r(e, r) {
|
|
14
|
+
return n(t(`${e}:${r}`)) % 100;
|
|
15
|
+
}
|
|
16
|
+
function i(e, t) {
|
|
17
|
+
return t <= 0 ? !1 : t >= 100 || e < t;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/plugins/dynamic-experiences/plugin.ts
|
|
21
|
+
function a(e, t) {
|
|
22
|
+
if (Array.isArray(t.conditions)) for (let n of t.conditions) e.registerCondition(n);
|
|
23
|
+
}
|
|
24
|
+
function o(e, t) {
|
|
25
|
+
e.registerExperience({
|
|
26
|
+
id: t.id,
|
|
27
|
+
key: t.key,
|
|
28
|
+
name: t.name,
|
|
29
|
+
targets: t.targets,
|
|
30
|
+
nodes: t.nodes,
|
|
31
|
+
edges: t.edges,
|
|
32
|
+
condition: t.condition,
|
|
33
|
+
initializeOpen: t.initializeOpen,
|
|
34
|
+
componentName: t.componentName
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function s(e, t) {
|
|
38
|
+
if (Array.isArray(t.fields)) for (let n of t.fields) e.registerField(n);
|
|
39
|
+
}
|
|
40
|
+
function c(e, t) {
|
|
41
|
+
if (!Array.isArray(t.steps)) return;
|
|
42
|
+
let n = new Map(t.fields.map((e) => [e.id, e.key]));
|
|
43
|
+
for (let r of t.steps) {
|
|
44
|
+
let t = [];
|
|
45
|
+
for (let e of r.fieldIds ?? []) {
|
|
46
|
+
let i = n.get(e);
|
|
47
|
+
if (i === void 0) {
|
|
48
|
+
`${r.key}${e}`;
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
t.push(i);
|
|
52
|
+
}
|
|
53
|
+
let i = r.layoutContentId ? e.contents.getById(r.layoutContentId) : null;
|
|
54
|
+
e.registerStep({
|
|
55
|
+
id: r.id,
|
|
56
|
+
key: r.key,
|
|
57
|
+
name: r.name,
|
|
58
|
+
fieldKeys: t,
|
|
59
|
+
layoutName: r.layoutName,
|
|
60
|
+
...r.layoutContentId !== void 0 && {
|
|
61
|
+
layoutContentId: r.layoutContentId,
|
|
62
|
+
layoutContentStore: i
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function l(e, t) {
|
|
68
|
+
if (Array.isArray(t.experiences)) for (let n of t.experiences) o(e, n);
|
|
69
|
+
}
|
|
70
|
+
function u(e, t, n) {
|
|
71
|
+
p(e, t, n.isPreview, n.sessionId), a(e, t), s(e, t), c(e, t), l(e, t);
|
|
72
|
+
}
|
|
73
|
+
function d(e) {
|
|
74
|
+
let t = e.searchParams["preview-token"];
|
|
75
|
+
if (t && t.length > 0) return t[0];
|
|
76
|
+
}
|
|
77
|
+
function f(e) {
|
|
78
|
+
let t = /* @__PURE__ */ new Set(), n = e.searchParams.feature;
|
|
79
|
+
if (!n) return t;
|
|
80
|
+
for (let e of n) {
|
|
81
|
+
let n = e.indexOf(":");
|
|
82
|
+
n > 0 && t.add(e.substring(0, n));
|
|
83
|
+
}
|
|
84
|
+
return t;
|
|
85
|
+
}
|
|
86
|
+
function p(e, t, n, r) {
|
|
87
|
+
let i = f(e);
|
|
88
|
+
for (let a of t.features) i.has(a.id) || m(e, a, n, r);
|
|
89
|
+
}
|
|
90
|
+
function m(e, t, n, a) {
|
|
91
|
+
let o = r(a, t.id);
|
|
92
|
+
e.registerFeature(t.id, {
|
|
93
|
+
key: `v${t.version}`,
|
|
94
|
+
name: t.name,
|
|
95
|
+
enabled: t.enabled,
|
|
96
|
+
weight: t.weight,
|
|
97
|
+
storage: n ? "session" : "local",
|
|
98
|
+
decide: () => i(o, t.weight)
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function h(e, t) {
|
|
102
|
+
for (let n of t.content) e.registerContent({
|
|
103
|
+
id: n.id,
|
|
104
|
+
contentModelKey: n.contentModelKey,
|
|
105
|
+
data: n.data
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function g(e, t) {
|
|
109
|
+
let n = /* @__PURE__ */ new Map();
|
|
110
|
+
return (r, i) => {
|
|
111
|
+
let a = n.get(r.id);
|
|
112
|
+
if (a) return a;
|
|
113
|
+
let o = (async () => {
|
|
114
|
+
try {
|
|
115
|
+
let n = await t(r, i);
|
|
116
|
+
return n && h(e, n), n;
|
|
117
|
+
} finally {
|
|
118
|
+
n.delete(r.id);
|
|
119
|
+
}
|
|
120
|
+
})();
|
|
121
|
+
return n.set(r.id, o), o;
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function _(e, t) {
|
|
125
|
+
let n = new Set(t && Array.isArray(t.experiences) ? t.experiences.map((e) => e.id) : []);
|
|
126
|
+
return (t, r) => n.has(t.id) ? e(t, r) : Promise.resolve(null);
|
|
127
|
+
}
|
|
128
|
+
function v() {
|
|
129
|
+
return {
|
|
130
|
+
name: "dynamic-experiences",
|
|
131
|
+
setup: (t) => ({ onStart: e({
|
|
132
|
+
source: t.session.store.map((e) => e.id),
|
|
133
|
+
effect: async (e) => {
|
|
134
|
+
let n = d(t), r = n !== void 0, i = n === void 0 ? void 0 : { previewToken: n }, a = await t.getProjectConfig(n === void 0 ? void 0 : { previewToken: n }).catch((e) => null);
|
|
135
|
+
if (t.contentLoader = g(t, _((e) => t.getExperienceContent(e, i), a)), !a) return;
|
|
136
|
+
let o = t.seededVersionId;
|
|
137
|
+
if (o !== null && o !== a.versionId) {
|
|
138
|
+
t.versionSkew = {
|
|
139
|
+
seeded: o,
|
|
140
|
+
resolved: a.versionId
|
|
141
|
+
}, `${a.versionId}${o}`;
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
t.previewEmbedderOrigins = a.previewEmbedderOrigins ?? null, u(t, a, {
|
|
145
|
+
isPreview: r,
|
|
146
|
+
sessionId: e
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}) })
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
export { u as n, v as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require("./logger-CSTvAyyB.cjs");const e=require("./registry-DpNNJt2g.cjs");var t=`bundle`,n=`api`;async function r(){try{let t=await import(`virtual:picked/data`);return e.r(t)?t:null}catch{return null}}function i(t){if(t===void 0||e.r(t))return t}function a(a){let{apiUrl:o,projectId:s,previewToken:c,signal:l}=a,u=!!c,d=u?n:a.mode,f=i(u?void 0:a.bundle),p=u?void 0:a.projectConfig,m=a.getContent,h={mode:d??n,manifest:null},g,_,v=new Map;function y(){if(d===n)return Promise.resolve(null);if(f)return Promise.resolve(f);let t=e.t();return t?Promise.resolve(t):(g??=r(),g)}function b(e){h.mode=e?t:n,h.manifest=e?e.manifestMetadata:null}async function x(){if(p)return b(await y()),p;let n=await y();return b(n),n?n.projectConfig:d===t?null:e.a(o,s,{...c!==void 0&&{previewToken:c},...l!==void 0&&{signal:l}})}async function S(n,r){let i=c===void 0?void 0:{previewToken:c};if(m)return m(n,i);let a=await y();if(b(a),a)try{return await a.experienceContent(n,i)}catch{return`${n.id}`,null}if(d===t)return null;let u=r??l;return e.i(o,s,n.id,{...c!==void 0&&{previewToken:c},...u!==void 0&&{signal:u}})}return{meta:h,getProjectConfig:()=>(_??=x(),_),getContent:(e,t)=>{let n=v.get(e.id);if(n)return n;let r=S(e,t?.signal).finally(()=>{v.delete(e.id)});return v.set(e.id,r),r}}}exports.createPickedDataProvider=a;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import "./logger-DMN6TxJJ.js";
|
|
2
|
+
import { a as e, i as t, r as n, t as r } from "./registry-CdPPoopn.js";
|
|
3
|
+
//#region src/data-source/provider.ts
|
|
4
|
+
var i = "bundle", a = "api";
|
|
5
|
+
async function o() {
|
|
6
|
+
try {
|
|
7
|
+
let e = await import("virtual:picked/data");
|
|
8
|
+
return n(e) ? e : null;
|
|
9
|
+
} catch {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function s(e) {
|
|
14
|
+
if (e === void 0 || n(e)) return e;
|
|
15
|
+
}
|
|
16
|
+
function c(n) {
|
|
17
|
+
let { apiUrl: c, projectId: l, previewToken: u, signal: d } = n, f = !!u, p = f ? a : n.mode, m = s(f ? void 0 : n.bundle), h = f ? void 0 : n.projectConfig, g = n.getContent, _ = {
|
|
18
|
+
mode: p ?? a,
|
|
19
|
+
manifest: null
|
|
20
|
+
}, v, y, b = /* @__PURE__ */ new Map();
|
|
21
|
+
function x() {
|
|
22
|
+
if (p === a) return Promise.resolve(null);
|
|
23
|
+
if (m) return Promise.resolve(m);
|
|
24
|
+
let e = r();
|
|
25
|
+
return e ? Promise.resolve(e) : (v ??= o(), v);
|
|
26
|
+
}
|
|
27
|
+
function S(e) {
|
|
28
|
+
_.mode = e ? i : a, _.manifest = e ? e.manifestMetadata : null;
|
|
29
|
+
}
|
|
30
|
+
async function C() {
|
|
31
|
+
if (h) return S(await x()), h;
|
|
32
|
+
let t = await x();
|
|
33
|
+
return S(t), t ? t.projectConfig : p === i ? null : e(c, l, {
|
|
34
|
+
...u !== void 0 && { previewToken: u },
|
|
35
|
+
...d !== void 0 && { signal: d }
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
async function w(e, n) {
|
|
39
|
+
let r = u === void 0 ? void 0 : { previewToken: u };
|
|
40
|
+
if (g) return g(e, r);
|
|
41
|
+
let a = await x();
|
|
42
|
+
if (S(a), a) try {
|
|
43
|
+
return await a.experienceContent(e, r);
|
|
44
|
+
} catch {
|
|
45
|
+
return `${e.id}`, null;
|
|
46
|
+
}
|
|
47
|
+
if (p === i) return null;
|
|
48
|
+
let o = n ?? d;
|
|
49
|
+
return t(c, l, e.id, {
|
|
50
|
+
...u !== void 0 && { previewToken: u },
|
|
51
|
+
...o !== void 0 && { signal: o }
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
meta: _,
|
|
56
|
+
getProjectConfig: () => (y ??= C(), y),
|
|
57
|
+
getContent: (e, t) => {
|
|
58
|
+
let n = b.get(e.id);
|
|
59
|
+
if (n) return n;
|
|
60
|
+
let r = w(e, t?.signal).finally(() => {
|
|
61
|
+
b.delete(e.id);
|
|
62
|
+
});
|
|
63
|
+
return b.set(e.id, r), r;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { c as createPickedDataProvider };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import "./logger-DMN6TxJJ.js";
|
|
2
|
+
import { t as e } from "./api-BqZglw7-.js";
|
|
3
|
+
function t(e) {
|
|
4
|
+
return typeof e == "object" && !!e;
|
|
5
|
+
}
|
|
6
|
+
function n(e) {
|
|
7
|
+
return t(e) && "features" in e && Array.isArray(e.features);
|
|
8
|
+
}
|
|
9
|
+
function r(e) {
|
|
10
|
+
return !t(e) || !("experienceId" in e) || !("content" in e) ? !1 : Array.isArray(e.content);
|
|
11
|
+
}
|
|
12
|
+
function i(e) {
|
|
13
|
+
try {
|
|
14
|
+
let t = new URL(e).hostname;
|
|
15
|
+
return t === "localhost" || t === "127.0.0.1" || t === "::1";
|
|
16
|
+
} catch {
|
|
17
|
+
return !1;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function a(e) {
|
|
21
|
+
if (!t(e) || !("cause" in e)) return !1;
|
|
22
|
+
let { cause: n } = e;
|
|
23
|
+
return !t(n) || !("code" in n) ? !1 : n.code === "ECONNREFUSED";
|
|
24
|
+
}
|
|
25
|
+
async function o(t, r, o) {
|
|
26
|
+
let s = o?.previewToken ? `projects/${r}?preview_token=${encodeURIComponent(o.previewToken)}` : `projects/${r}`, c;
|
|
27
|
+
try {
|
|
28
|
+
c = await e(t, s, o?.headers, o?.signal);
|
|
29
|
+
} catch (e) {
|
|
30
|
+
return i(t) && a(e), null;
|
|
31
|
+
}
|
|
32
|
+
if (!c.ok) return `${c.status.toString()}`, null;
|
|
33
|
+
let l;
|
|
34
|
+
try {
|
|
35
|
+
l = await c.json();
|
|
36
|
+
} catch {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
return n(l) ? l : null;
|
|
40
|
+
}
|
|
41
|
+
async function s(t, n, o, s) {
|
|
42
|
+
let c = s?.previewToken ? `projects/${n}/experiences/${o}/content?preview_token=${encodeURIComponent(s.previewToken)}` : `projects/${n}/experiences/${o}/content`, l;
|
|
43
|
+
try {
|
|
44
|
+
l = await e(t, c, s?.headers, s?.signal);
|
|
45
|
+
} catch (e) {
|
|
46
|
+
return i(t) && a(e) || `${o}`, null;
|
|
47
|
+
}
|
|
48
|
+
if (!l.ok) return `${o}${l.status.toString()}`, null;
|
|
49
|
+
let u;
|
|
50
|
+
try {
|
|
51
|
+
u = await l.json();
|
|
52
|
+
} catch {
|
|
53
|
+
return `${o}`, null;
|
|
54
|
+
}
|
|
55
|
+
return r(u) ? u : (`${o}`, null);
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/data-source/virtual-data.ts
|
|
59
|
+
function c(e) {
|
|
60
|
+
if (typeof e != "object" || !e || !("projectConfig" in e) || !("experienceContent" in e) || !("manifestMetadata" in e)) return !1;
|
|
61
|
+
let { experienceContent: t } = e;
|
|
62
|
+
return typeof t == "function";
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/data-source/registry.ts
|
|
66
|
+
var l = null;
|
|
67
|
+
function u(e) {
|
|
68
|
+
c(e) && (l = e);
|
|
69
|
+
}
|
|
70
|
+
function d() {
|
|
71
|
+
return l;
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
export { o as a, s as i, u as n, c as r, d as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require("./logger-CSTvAyyB.cjs");const e=require("./api-C5vMi1gb.cjs");function t(e){return typeof e==`object`&&!!e}function n(e){return t(e)&&`features`in e&&Array.isArray(e.features)}function r(e){return!t(e)||!(`experienceId`in e)||!(`content`in e)?!1:Array.isArray(e.content)}function i(e){try{let t=new URL(e).hostname;return t===`localhost`||t===`127.0.0.1`||t===`::1`}catch{return!1}}function a(e){if(!t(e)||!(`cause`in e))return!1;let{cause:n}=e;return!t(n)||!(`code`in n)?!1:n.code===`ECONNREFUSED`}async function o(t,r,o){let s=o?.previewToken?`projects/${r}?preview_token=${encodeURIComponent(o.previewToken)}`:`projects/${r}`,c;try{c=await e.t(t,s,o?.headers,o?.signal)}catch(e){return i(t)&&a(e),null}if(!c.ok)return`${c.status.toString()}`,null;let l;try{l=await c.json()}catch{return null}return n(l)?l:null}async function s(t,n,o,s){let c=s?.previewToken?`projects/${n}/experiences/${o}/content?preview_token=${encodeURIComponent(s.previewToken)}`:`projects/${n}/experiences/${o}/content`,l;try{l=await e.t(t,c,s?.headers,s?.signal)}catch(e){return i(t)&&a(e)||`${o}`,null}if(!l.ok)return`${o}${l.status.toString()}`,null;let u;try{u=await l.json()}catch{return`${o}`,null}return r(u)?u:(`${o}`,null)}function c(e){if(typeof e!=`object`||!e||!(`projectConfig`in e)||!(`experienceContent`in e)||!(`manifestMetadata`in e))return!1;let{experienceContent:t}=e;return typeof t==`function`}var l=null;function u(e){c(e)&&(l=e)}function d(){return l}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});
|
|
@@ -9,8 +9,8 @@ export interface PickedDataProviderOptions {
|
|
|
9
9
|
/** Project ID to resolve data for. */
|
|
10
10
|
projectId: string;
|
|
11
11
|
/**
|
|
12
|
-
* Which source to read from. Omit to
|
|
13
|
-
* `
|
|
12
|
+
* Which source to read from. Omit to resolve `'bundle'` when a bundle is available and
|
|
13
|
+
* `'api'` otherwise.
|
|
14
14
|
*/
|
|
15
15
|
mode?: PickedDataMode;
|
|
16
16
|
/**
|
|
@@ -20,10 +20,9 @@ export interface PickedDataProviderOptions {
|
|
|
20
20
|
*/
|
|
21
21
|
previewToken?: string;
|
|
22
22
|
/**
|
|
23
|
-
* The `virtual:picked/data` module
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* match the module's shape is ignored with a warning, the same as an unresolvable import.
|
|
23
|
+
* The `virtual:picked/data` module, supplied directly to skip both the registry and the
|
|
24
|
+
* dynamic import. A value that fails the shape guard is ignored with a warning, the same as
|
|
25
|
+
* an unresolvable import.
|
|
27
26
|
*/
|
|
28
27
|
bundle?: VirtualPickedData;
|
|
29
28
|
/** Explicit project config. Supersedes both sources, except under a preview token. */
|
|
@@ -50,6 +49,8 @@ export interface PickedDataProvider {
|
|
|
50
49
|
getContent: (experience: {
|
|
51
50
|
id: string;
|
|
52
51
|
key: string;
|
|
52
|
+
}, options?: {
|
|
53
|
+
signal?: AbortSignal;
|
|
53
54
|
}) => Promise<ExperienceContentResponse | null>;
|
|
54
55
|
}
|
|
55
56
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/data-source/provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","s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,KAC/B,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAAA;CAC/C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAYlF;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA;AAyB9B;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,kBAAkB,CAuK/F"}
|
|
@@ -2,9 +2,8 @@ import type { VirtualPickedData } from '../plugins/dynamic-experiences/types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Records the bundle the build generated, for this session's data provider to read.
|
|
4
4
|
*
|
|
5
|
-
* A value that
|
|
6
|
-
*
|
|
7
|
-
* the first content resolution. Any usable bundle registered earlier is kept.
|
|
5
|
+
* A value that fails the shape guard is refused, so a malformed registration lands on the
|
|
6
|
+
* "no bundle" path. Any usable bundle registered earlier is kept.
|
|
8
7
|
*
|
|
9
8
|
* @param {unknown} bundle - The generated module's exports.
|
|
10
9
|
* @returns {void} Nothing.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/data-source/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/data-source/registry.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAK7E;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAQ1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,GAAG,IAAI,CAE/D"}
|
package/dist/types/picked.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { type EventBusPayload, type EventHistoryStore } from './utils/events';
|
|
|
16
16
|
import type { Field } from './entities/field/field';
|
|
17
17
|
import type { ExperienceStep } from './entities/step/step';
|
|
18
18
|
import type { Content, ContentDataPatch } from './entities/content/content';
|
|
19
|
-
import type { ContentLoader } from './plugins/dynamic-experiences/types';
|
|
19
|
+
import type { ContentLoader, ExperienceContentResponse, ProjectConfig } from './plugins/dynamic-experiences/types';
|
|
20
20
|
import type { Action } from './entities/action/action';
|
|
21
21
|
import { type Condition } from './entities/condition/condition';
|
|
22
22
|
import type { SessionEntity } from './entities/session/session';
|
|
@@ -74,6 +74,7 @@ export declare class Picked {
|
|
|
74
74
|
*/
|
|
75
75
|
previewEmbedderOrigins: string[] | null;
|
|
76
76
|
private readonly plugins;
|
|
77
|
+
private readonly dataProviders;
|
|
77
78
|
readonly eventBus: EventCallable<EventBusPayload>;
|
|
78
79
|
readonly events: EventHistoryStore;
|
|
79
80
|
readonly projectId: string;
|
|
@@ -276,6 +277,54 @@ export declare class Picked {
|
|
|
276
277
|
context?: Record<string, unknown>;
|
|
277
278
|
}, string, Error>;
|
|
278
279
|
constructor(options: CreateClientOptions);
|
|
280
|
+
/**
|
|
281
|
+
* Resolves the data provider backing a given preview token, building it once per token.
|
|
282
|
+
*
|
|
283
|
+
* @param {string | undefined} previewToken - Preview token for the caller, when there is one.
|
|
284
|
+
* @returns {Promise<PickedDataProvider>} The provider for that token.
|
|
285
|
+
* @example
|
|
286
|
+
* const provider = await client.dataProviderFor(undefined)
|
|
287
|
+
*/
|
|
288
|
+
private dataProviderFor;
|
|
289
|
+
/**
|
|
290
|
+
* Resolves this project's configuration.
|
|
291
|
+
*
|
|
292
|
+
* Reads the build-time bundle when one registered itself, and the Picked API otherwise. A
|
|
293
|
+
* preview token forces the API, because preview renders unpublished data no bundle can hold.
|
|
294
|
+
* Deduplicated per token, so several callers in one request cost one resolution.
|
|
295
|
+
*
|
|
296
|
+
* @param {object} [options] - Per-call resolution inputs.
|
|
297
|
+
* @param {string} [options.previewToken] - Preview token, forcing a live read.
|
|
298
|
+
* @param {AbortSignal} [options.signal] - Signal applied to an API read.
|
|
299
|
+
* @returns {Promise<ProjectConfig>} The project configuration.
|
|
300
|
+
* @throws {Error} When the configuration cannot be resolved from any source.
|
|
301
|
+
* @example
|
|
302
|
+
* const config = await client.getProjectConfig()
|
|
303
|
+
*/
|
|
304
|
+
getProjectConfig(options?: {
|
|
305
|
+
previewToken?: string;
|
|
306
|
+
signal?: AbortSignal;
|
|
307
|
+
}): Promise<ProjectConfig>;
|
|
308
|
+
/**
|
|
309
|
+
* Resolves one experience's CMS content, from the same source as the configuration.
|
|
310
|
+
*
|
|
311
|
+
* @param {{ id: string; key: string }} experience - The experience to resolve content for.
|
|
312
|
+
* @param {string} experience.id - Experience id, which keys bundled content.
|
|
313
|
+
* @param {string} experience.key - Experience key, for a content loader that prefers it.
|
|
314
|
+
* @param {object} [options] - Per-call resolution inputs.
|
|
315
|
+
* @param {string} [options.previewToken] - Preview token, forcing a live read.
|
|
316
|
+
* @param {AbortSignal} [options.signal] - Deadline for this call's API read, if it makes one.
|
|
317
|
+
* @returns {Promise<ExperienceContentResponse | null>} The content, or `null` when it has none.
|
|
318
|
+
* @example
|
|
319
|
+
* const content = await client.getExperienceContent({ id: 'exp_1', key: 'promo' })
|
|
320
|
+
*/
|
|
321
|
+
getExperienceContent(experience: {
|
|
322
|
+
id: string;
|
|
323
|
+
key: string;
|
|
324
|
+
}, options?: {
|
|
325
|
+
previewToken?: string;
|
|
326
|
+
signal?: AbortSignal;
|
|
327
|
+
}): Promise<ExperienceContentResponse | null>;
|
|
279
328
|
/**
|
|
280
329
|
* Lazily starts the preview channel when this frame is a live-preview session: the outbound
|
|
281
330
|
* bridge, which reports the frame's URL to the dashboard, and the inbound receiver, which applies
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picked.d.ts","sourceRoot":"","sources":["../../src/picked.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,KAAK,EACV,KAAK,aAAa,EACnB,MAAM,UAA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;;;;;;;;;OAkBG;IACH,YAAY,OAAQ,MAAM,SAAS,gBAAgB,KAAG,IAAI,CAEzD;IAED,cAAc,QAAS,MAAM,UAAU,MAAM,KAAG,IAAI,CAEnD;IAED,kBAAkB,eAAgB,UAAU,KAAG,IAAI,CAMlD;IAED;;;;;;;;;OASG;IAEH,oBAAoB,iBACJ,MAAM,YACV,uBAAuB,KAChC,OAAO,CAAC,IAAI,CAAC,CAEf;IACD;;;;;;;;;OASG;IAEH,qBAAqB,kBACJ,MAAM,YACX,uBAAuB,KAChC,OAAO,CAAC,IAAI,CAAC,CAEf;IAED;;;;;;;;OAQG;IAEH,kBAAkB,iBAAwB,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAE/D;IAED;;;;;;;;OAQG;IAEH,mBAAmB,kBAAyB,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;IAED,OAAO,CAAC,YAAY;IAsBpB,OAAO,CAAC,aAAa;IAsCrB,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,eAAe;IAWvB,eAAe,eAAgB,MAAM,KAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE1F;CACF"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/** @file Public exports for the dynamic-experiences plugin (project config + per-experience content resolution). */
|
|
2
2
|
export { dynamicExperiencesPlugin, fetchExperienceContent, fetchProject } from './plugin';
|
|
3
3
|
export { createClientHeaders } from '../../utils/client-headers';
|
|
4
|
-
export {
|
|
5
|
-
export { registerPickedBundle, readRegisteredBundle } from '../../data-source/registry';
|
|
6
|
-
export type { PickedDataMode, PickedDataProvider, PickedDataProviderMeta, PickedDataProviderOptions, } from '../../data-source/provider';
|
|
4
|
+
export { registerPickedBundle } from '../../data-source/registry';
|
|
7
5
|
export type * from './types';
|
|
8
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/index.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/index.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAIhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACjE,mBAAmB,SAAS,CAAA"}
|