@picked/client 0.0.61 → 0.0.62-next.10
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-CjGYS0lP.js → api-C11HFYrl.js} +1 -1
- package/dist/api-DXosW8uz.cjs +1 -0
- package/dist/cjs/form/index.js +1 -1
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/dom-observer/index.js +1 -0
- 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/responses-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/api/authentication.md +376 -0
- package/dist/docs/api/authorization-and-scopes.md +262 -0
- package/dist/docs/api/error-handling.md +211 -0
- package/dist/docs/api/index.md +172 -11
- package/dist/docs/api/pagination.md +176 -0
- package/dist/docs/image-optimisation-service.md +72 -0
- package/dist/docs/index.md +0 -2
- package/dist/docs/pickedql/data-sources.md +2 -2
- package/dist/docs/pickedql/dimensions.md +2 -0
- package/dist/docs/pickedql/schema.md +2 -2
- package/dist/docs/pickedql/virtual-functions.md +27 -0
- package/dist/docs/sdk/actions.md +0 -1
- package/dist/docs/sdk/content-security-policy.md +8 -7
- package/dist/docs/sdk/features.md +0 -1
- package/dist/docs/sdk/fields.md +2 -2
- 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 +2 -3
- package/dist/docs/sdk/plugins/window-object.md +0 -1
- package/dist/docs/sdk/predicates.md +0 -1
- package/dist/docs/workspaces.mdx +60 -1
- package/dist/dom-C3C6Fmwz.cjs +1 -0
- package/dist/dom-DGePXPpM.js +84 -0
- package/dist/esm/form/index.js +41 -34
- package/dist/esm/index.js +1020 -494
- package/dist/esm/plugins/create-experience/index.js +1 -1
- package/dist/esm/plugins/dom-observer/index.js +87 -0
- package/dist/esm/plugins/dynamic-experiences/index.js +133 -60
- package/dist/esm/plugins/experience-browser-storage/index.js +9 -6
- package/dist/esm/plugins/history-browser-storage/index.js +1 -1
- package/dist/esm/plugins/responses-browser-storage/index.js +1 -1
- 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-DImym3m_.js +419 -0
- package/dist/experience-instance-DygAdzbn.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/content/content.d.ts +37 -0
- package/dist/types/entities/content/content.d.ts.map +1 -0
- package/dist/types/entities/experience/experience.d.ts +69 -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/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/entities/step/step.d.ts +17 -2
- package/dist/types/entities/step/step.d.ts.map +1 -1
- package/dist/types/exports.d.ts +9 -3
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/form/create-form.d.ts +55 -0
- package/dist/types/form/create-form.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -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 +141 -187
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/dom-observer/index.d.ts +3 -0
- package/dist/types/plugins/dom-observer/index.d.ts.map +1 -0
- package/dist/types/plugins/dom-observer/plugin.d.ts +50 -0
- package/dist/types/plugins/dom-observer/plugin.d.ts.map +1 -0
- package/dist/types/plugins/dynamic-experiences/index.d.ts +2 -1
- package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +18 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +63 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/plugins/experience-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 +12 -2
- package/dist/api-BarClNGB.cjs +0 -1
- package/dist/docs/reference/index.md +0 -11
- package/dist/docs/tooling/index.md +0 -19
- package/dist/experience-instance-DC2gKwA6.cjs +0 -1
- package/dist/experience-instance-DJaNc5Ob.js +0 -486
- 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/docs/{tooling/chrome-extension.md → chrome-extension.md} +0 -0
- /package/dist/docs/{tooling/gtm-template.md → gtm-template.md} +0 -0
- /package/dist/docs/{tooling/mcp.md → mcp.md} +0 -0
- /package/dist/docs/{tooling/vite-plugin.md → vite-plugin.md} +0 -0
- /package/dist/{id-Bv44ilEo.cjs → id-Cg7fVl1O.cjs} +0 -0
- /package/dist/{id-CRqy981z.js → id-n2yrHvNo.js} +0 -0
- /package/dist/{object-C82v79xc.js → object-DvUDOytC.js} +0 -0
- /package/dist/{object-CUJOjanb.cjs → object-ThO1DEyl.cjs} +0 -0
- /package/dist/{storage-B6lQtc4-.cjs → storage-BXSlLTRa.cjs} +0 -0
- /package/dist/{storage-6Xk0uAxB.js → storage-hOHCCXvP.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./object-CUJOjanb.cjs`);function t(e){return typeof e==`number`&&!isNaN(e)}function n(e){return typeof e==`string`}function r(e){return Array.isArray(e)}function i(e){return e instanceof Promise}function a(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.keys(e).length===1}function o(e){if(t(e))return e;let n=parseFloat(`${e}`);return isNaN(n)?0:n}function s(e){return`${e}`}var c={"==":(e,t)=>e==t,"===":(e,t)=>e===t,"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,">":(e,t)=>o(e)>o(t),">=":(e,t)=>o(e)>=o(t),"<":(e,t,n)=>{let r=o(e),i=o(t);if(n===void 0)return r<i;let a=o(n);return r<i&&i<a},"<=":(e,t,n)=>{let r=o(e),i=o(t);if(n===void 0)return r<=i;let a=o(n);return r<=i&&i<=a},"!!":async e=>await u(e),"!":async e=>!await u(e),"%":(e,t)=>o(e)%o(t),log:e=>(console.log(e),e),in:(e,t)=>t?n(t)?t.indexOf(s(e))!==-1:r(t)?t.includes(e):!1:!1,cat:(...e)=>e.map(s).join(``),substr:(e,t,n)=>{let r=s(e),i=o(t);if(n===void 0)return r.substr(i);let a=o(n);if(a<0){let e=r.substr(i);return e.substr(0,e.length+a)}return r.substr(i,a)},"+":(...e)=>e.reduce((e,t)=>o(e)+o(t),0),"*":(...e)=>e.reduce((e,t)=>o(e)*o(t),1),"-":(e,t)=>{let n=o(e);return t===void 0?-n:n-o(t)},"/":(e,t)=>o(e)/o(t),min:(...e)=>Math.min(...e.map(o)),max:(...e)=>Math.max(...e.map(o)),merge:(...e)=>e.reduce((e,t)=>r(t)?e.concat(t):e.concat([t]),[]),var(e,t){let n=arguments.length>1?t:null;if(e===``||e===`.`||e==null)return this;if(typeof e==`number`&&Array.isArray(this))return e>=0&&e<this.length?this[e]:n;let r=s(e);if(r===``||r===`.`)return this;let i=r.split(`.`),a=this;for(let e of i){if(a==null)return n;if(Array.isArray(a)){let t=parseInt(e,10);a=isNaN(t)?a[e]:a[t]}else a=a[e]}return a===void 0?n:a},async missing(...e){let t=r(e[0])?e[0]:e,n=[];for(let e of t){let t=await l({var:e},this);(t===null||t===``)&&n.push(`${e}`)}return n},async missing_some(e,t){let i=await l({missing:t},this);if(!r(i)||!r(t))return[];let a=i.filter(n);return t.filter(n).length-a.length>=o(e)?[]:a},invoke(...e){let[t,...n]=e;return typeof t==`function`?Reflect.apply(t,null,n):null},startsWith:(e,t)=>n(e)&&n(t)&&e.startsWith(t),endsWith:(e,t)=>n(e)&&n(t)&&e.endsWith(t),regexp_matches(e,t){let i=e,a=``;if(r(e)){let[t,n]=e;i=t,a=n}return!n(i)||!n(a)?!1:new RegExp(i,a).test(s(t))},throw(e){throw Error(s(e))}};async function l(e,t){if(!e)return e;if(i(e))return l(await e,t);if(r(e))return Promise.all(e.map(e=>l(e,t)));if(!a(e))return e;let n=d(e),o=n?e[n]??[]:[];switch(r(o)||(o=[o]),n){case`if`:case`?:`:for(let e=0;e<o.length-1;e+=2)if(await u(await l(o[e],t)))return l(o[e+1],t);return o.length%2==1?l(o[o.length-1],t):null;case`and`:{let e=null;for(let n of o)if(e=await l(n,t),!await u(e))return e;return e}case`or`:{let e=null;for(let n of o)if(e=await l(n,t),await u(e))return e;return e}case`map`:{let e=await l(o[0],t);return r(e)?await Promise.all(e.map(e=>l(o[1],e))):[]}case`filter`:{let e=await l(o[0],t);return r(e)?(await Promise.all(e.map(async e=>({item:e,shouldInclude:await u(await l(o[1],e))})))).filter(({shouldInclude:e})=>e).map(({item:e})=>e):[]}case`reduce`:{let e=await l(o[0],t);if(!r(e))return o.length>2?await l(o[2],t):null;let n=o[1],i=o.length>2?await l(o[2],t):null;for(let t of e)i=await l(n,{current:t,accumulator:i});return i}case`all`:{let e=await l(o[0],t);if(!r(e)||e.length===0)return!1;for(let t of e)if(!await u(await l(o[1],t)))return!1;return!0}case`some`:{let e=await l(o[0],t);if(!r(e))return!1;for(let t of e)if(await u(await l(o[1],t)))return!0;return!1}case`none`:{let e=await l(o[0],t);if(!r(e))return!0;for(let t of e)if(await u(await l(o[1],t)))return!1;return!0}case`catch`:try{return await l(o[0],t)}catch(e){return a(e)?await l(e,t):o[1]?await l(o[1],e):e instanceof Error?e.message:e}}let s=await Promise.all(o.map(e=>l(e,t))),f=n?c[n]:void 0;if(!f)throw Error(`Unrecognized operation ${n}`);return f.apply(t,s)}async function u(e){return i(e)?u(await e):!(Array.isArray(e)&&e.length===0)&&!!e}function d(e){return Object.keys(e)[0]}function f(t){return!e.t(t)}async function p(e,t,n){let r=e.getStateSnapshot(),i=e.predicates.listStore.getState().reduce((e,t)=>({...e,[t.name]:(...e)=>t.predicate({...r,args:e})}),{}),a=e.actions.listStore.getState().reduce((e,t)=>({...e,[t.key]:(...e)=>t.action({...r,args:e},null)}),{}),o=e.features.listStore.getState().reduce((e,t)=>({...e,[t.id]:async()=>{let{bucket:e}=await t.getBucket();return e}}),{});return await l(t,{responses:e.responses.getAllStore.getState(),location:typeof r.location==`object`?{hash:r.location.hash,host:r.location.host,hostname:r.location.hostname,href:r.location.href,origin:r.location.origin,pathname:r.location.pathname,port:r.location.port,protocol:r.location.protocol,search:r.location.search}:void 0,predicates:i,actions:a,features:o,...n})}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Picked } from '../picked';
|
|
2
|
-
import { Field, FieldValue } from '../entities/field/field';
|
|
3
|
-
export interface StateSnapshot {
|
|
4
|
-
client: Picked;
|
|
5
|
-
location?: Window['location'];
|
|
6
|
-
document?: Window['document'];
|
|
7
|
-
sessionStorage?: Window['sessionStorage'];
|
|
8
|
-
localStorage?: Window['localStorage'];
|
|
9
|
-
responses: {
|
|
10
|
-
fieldKey: string;
|
|
11
|
-
value: FieldValue | undefined;
|
|
12
|
-
}[];
|
|
13
|
-
fields: Field[];
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Creates an immutable snapshot of the current client state for condition evaluation.
|
|
17
|
-
*
|
|
18
|
-
* @param {Picked} client - The Picked client instance to snapshot.
|
|
19
|
-
* @returns {StateSnapshot} A frozen snapshot of the current client state.
|
|
20
|
-
* @example
|
|
21
|
-
* ```ts
|
|
22
|
-
* const snapshot = createStateSnapshot(client)
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export declare function createStateSnapshot(client: Picked): StateSnapshot;
|
|
26
|
-
//# sourceMappingURL=state-snaphot.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state-snaphot.d.ts","sourceRoot":"","sources":["../../../src/utils/state-snaphot.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEhE,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAA;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC,CAAA;IACrC,SAAS,EAAE;QACT,QAAQ,EAAE,MAAM,CAAA;QAChB,KAAK,EAAE,UAAU,GAAG,SAAS,CAAA;KAC9B,EAAE,CAAA;IACH,MAAM,EAAE,KAAK,EAAE,CAAA;CAChB;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAYjE"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface Session {
|
|
2
|
-
id: string;
|
|
3
|
-
isUser?: boolean;
|
|
4
|
-
identifiers?: Record<string, string>;
|
|
5
|
-
}
|
|
6
|
-
export interface SessionStore extends Session {
|
|
7
|
-
setIsUser: (value: boolean) => void;
|
|
8
|
-
setIdentifier: (key: string, value: string) => void;
|
|
9
|
-
removeIdentifier: (key: string) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare const initialiseSession: () => SessionStore | null;
|
|
12
|
-
//# sourceMappingURL=user-session.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-session.d.ts","sourceRoot":"","sources":["../../../src/utils/user-session.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACrC;AAED,MAAM,WAAW,YAAa,SAAQ,OAAO;IAC3C,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IACnC,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACnD,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;CACxC;AAmED,eAAO,MAAM,iBAAiB,2BAI7B,CAAA"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|