Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uniformdev/optimize-common

Package Overview
Dependencies
Maintainers
9
Versions
184
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uniformdev/optimize-common - npm Package Compare versions

Comparing version 12.2.1-alpha.59 to 12.2.1-alpha.107

14

dist/index.d.ts

@@ -542,15 +542,3 @@ /**

/** Fetches all enrichments and values for a project, grouped by category */
getEnrichments(options?: ExceptProject<EnrichmentsGetParameters>): Promise<{
enrichments: ({
id: string;
name: string;
sortOrder?: number | undefined;
} & {
values: {
id: string;
value: string;
sortOrder?: number | undefined;
}[];
})[];
}>;
getEnrichments(options?: ExceptProject<EnrichmentsGetParameters>): Promise<EnrichmentsGetResponse>;
/** Updates or creates (based on id) an enrichment category */

@@ -557,0 +545,0 @@ upsertEnrichmentCategory(body: ExceptProject<EnrichmentsPutParameters>): Promise<void>;

4

dist/index.esm.js

@@ -1,2 +0,2 @@

var m;(function(n){n[n.Antimatter=0]="Antimatter",n[n.Tangential=5]="Tangential",n[n.Weak=25]="Weak",n[n.Normal=50]="Normal",n[n.Strong=75]="Strong",n[n.Strongest=100]="Strongest",n[n.Boost=1e3]="Boost"})(m||(m={}));function S(i){return(i==null?void 0:i.intents)?Object.keys(i==null?void 0:i.intents).reduce((t,e)=>{let r=i.intents[e];return(r==null?void 0:r.noBeh)||(t[e]=r),t},{}):{}}function E(i){return(i==null?void 0:i.intents)?Object.keys(i==null?void 0:i.intents).reduce((t,e)=>{let r=i.intents[e];return(r==null?void 0:r.noPn)||(t[e]=r),t},{}):{}}import x from"p-throttle";import h from"p-retry";function g({throttle:i={interval:1e3,limit:10},retry:t={retries:1,factor:1.66}}){let e=i?x(i):null;return function(a){let o=async()=>await a();if(e&&(o=e(o)),t){let s=o;o=()=>h(s,t)}return o()}}var l=class extends Error{constructor(t,e,r,a,o){super(`${t}
${a}${o?" "+o:""} (${e} ${r})`);this.errorMessage=t;this.fetchMethod=e;this.fetchUri=r;this.statusCode=a;this.statusText=o;Object.setPrototypeOf(this,l.prototype)}};var u=class{constructor(t){var e,r,a,o,s,n;if(!t.apiKey&&!t.bearerToken)throw new Error("You must provide an API key or a bearer token");this.options={...t,fetch:(e=t.fetch)!=null?e:fetch,apiHost:(r=t.apiHost)!=null?r:"https://uniform.app",apiKey:(a=t.apiKey)!=null?a:null,projectId:(o=t.projectId)!=null?o:null,bearerToken:(s=t.bearerToken)!=null?s:null,limitPolicy:(n=t.limitPolicy)!=null?n:g({})}}async apiClient(t,e){return this.options.limitPolicy(async()=>{var o;let r=this.options.apiKey?{"x-api-key":this.options.apiKey}:{Authorization:`Bearer ${this.options.bearerToken}`},a=await fetch(t.toString(),{...e,headers:{...e==null?void 0:e.headers,...r}});if(!a.ok){let s="";try{let n=await a.text();try{let c=JSON.parse(n);c.errorMessage?s=Array.isArray(c.errorMessage)?c.errorMessage.join(", "):c.errorMessage:s=n}catch(c){s=n}}catch(n){s="General error"}throw new l(s,(o=e==null?void 0:e.method)!=null?o:"GET",t.toString(),a.status)}return(e==null?void 0:e.expectNoContent)?null:await a.json()})}createUrl(t,e){let r=new URL(`${this.options.apiHost}${t}`);return Object.entries(e!=null?e:{}).forEach(([a,o])=>{var s;typeof o!==void 0&&o!==null&&r.searchParams.append(a,(s=o==null?void 0:o.toString())!=null?s:"")}),r}};var d=class extends u{constructor(t){super(t)}async getEnrichments(t){let{projectId:e}=this.options,r=this.createUrl("/api/v1/enrichments",{...t,projectId:e});return await this.apiClient(r)}async upsertEnrichmentCategory(t){let e=this.createUrl("/api/v1/enrichments");await this.apiClient(e,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeEnrichmentCategory(t){let e=this.createUrl("/api/v1/enrichments");await this.apiClient(e,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async upsertEnrichmentValue(t){let e=this.createUrl("/api/v1/enrichment-values");await this.apiClient(e,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeEnrichmentValue(t){let e=this.createUrl("/api/v1/enrichment-values");await this.apiClient(e,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}};var p;(function(n){n.Cookie="CK",n.Event="EVT",n.Behavior="BEH",n.LandingPage="LP",n.PageViewCount="PVW",n.PageVisited="PVI",n.QueryString="QS"})(p||(p={}));var f;(function(r){r.OncePerVisit="visit",r.Once="once",r.Always="always"})(f||(f={}));var y;(function(e){e.Visit="visit",e.Visitor="visitor"})(y||(y={}));function B(i){return i.type==p.Cookie}function Q(i){return i.type==p.Event}function G(i){return i.type==p.Behavior}function Y(i){return i.type==p.LandingPage}function F(i){return i.type==p.PageViewCount}function ie(i){return i.type==p.PageVisited}function se(i){return i.type==p.QueryString}function pe(i,t){var a,o,s,n;let e=i,r=t==null?void 0:t.expr;switch(((a=t==null?void 0:t.cs)!=null?a:!1)||([e,r]=P(e,r)),(o=t==null?void 0:t.type)!=null?o:"exact"){case"exact":return e===r;case"notexact":return e!==r;case"contains":return r&&(s=e==null?void 0:e.includes(r))!=null?s:!1;case"notcontains":return r?!((n=e==null?void 0:e.includes(r))!=null?n:!0):!0;case"exists":return i!==null&&typeof i!="undefined";case"notexists":return i===null||typeof i=="undefined";default:return console.warn(`Unknown string match type ${t.type} will be ignored.`),!1}}function P(...i){return i.map(t=>t==null?void 0:t.toUpperCase())}export{d as EnrichmentClient,m as IntentTagStrength,y as Scope,f as SignalFrequency,p as SignalType,S as getBehaviorIntents,E as getPersonalizationIntents,G as isBehaviorSignal,B as isCookieSignal,Q as isEventSignal,Y as isLandingPageSignal,F as isPageViewCountSignal,ie as isPageVisitedSignal,se as isQueryStringSignal,pe as isStringMatch};
var y=(r=>(r[r.Antimatter=0]="Antimatter",r[r.Tangential=5]="Tangential",r[r.Weak=25]="Weak",r[r.Normal=50]="Normal",r[r.Strong=75]="Strong",r[r.Strongest=100]="Strongest",r[r.Boost=1e3]="Boost",r))(y||{});function C(n){return(n==null?void 0:n.intents)?Object.keys(n==null?void 0:n.intents).reduce((e,t)=>{let i=n.intents[t];return(i==null?void 0:i.noBeh)||(e[t]=i),e},{}):{}}function V(n){return(n==null?void 0:n.intents)?Object.keys(n==null?void 0:n.intents).reduce((e,t)=>{let i=n.intents[t];return(i==null?void 0:i.noPn)||(e[t]=i),e},{}):{}}import h from"p-throttle";import x from"p-retry";function f({throttle:n={interval:1e3,limit:10},retry:e={retries:1,factor:1.66}}){let t=n?h(n):null;return function(a){let o=async()=>await a();if(t&&(o=t(o)),e){let s=o;o=()=>x(s,e)}return o()}}var u=class extends Error{constructor(e,t,i,a,o){super(`${e}
${a}${o?" "+o:""} (${t} ${i})`);this.errorMessage=e;this.fetchMethod=t;this.fetchUri=i;this.statusCode=a;this.statusText=o;Object.setPrototypeOf(this,u.prototype)}};var m=class{constructor(e){var t,i,a,o,s,r;if(!e.apiKey&&!e.bearerToken)throw new Error("You must provide an API key or a bearer token");this.options={...e,fetch:(t=e.fetch)!=null?t:fetch,apiHost:(i=e.apiHost)!=null?i:"https://uniform.app",apiKey:(a=e.apiKey)!=null?a:null,projectId:(o=e.projectId)!=null?o:null,bearerToken:(s=e.bearerToken)!=null?s:null,limitPolicy:(r=e.limitPolicy)!=null?r:f({})}}async apiClient(e,t){return this.options.limitPolicy(async()=>{var o;let i=this.options.apiKey?{"x-api-key":this.options.apiKey}:{Authorization:`Bearer ${this.options.bearerToken}`},a=await fetch(e.toString(),{...t,headers:{...t==null?void 0:t.headers,...i}});if(!a.ok){let s="";try{let r=await a.text();try{let g=JSON.parse(r);g.errorMessage?s=Array.isArray(g.errorMessage)?g.errorMessage.join(", "):g.errorMessage:s=r}catch(g){s=r}}catch(r){s="General error"}throw new u(s,(o=t==null?void 0:t.method)!=null?o:"GET",e.toString(),a.status)}return(t==null?void 0:t.expectNoContent)?null:await a.json()})}createUrl(e,t){let i=new URL(`${this.options.apiHost}${e}`);return Object.entries(t!=null?t:{}).forEach(([a,o])=>{var s;typeof o!==void 0&&o!==null&&i.searchParams.append(a,(s=o==null?void 0:o.toString())!=null?s:"")}),i}};var d=class extends m{constructor(e){super(e)}async getEnrichments(e){let{projectId:t}=this.options,i=this.createUrl("/api/v1/enrichments",{...e,projectId:t});return await this.apiClient(i)}async upsertEnrichmentCategory(e){let t=this.createUrl("/api/v1/enrichments");await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async removeEnrichmentCategory(e){let t=this.createUrl("/api/v1/enrichments");await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async upsertEnrichmentValue(e){let t=this.createUrl("/api/v1/enrichment-values");await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async removeEnrichmentValue(e){let t=this.createUrl("/api/v1/enrichment-values");await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}};var p=(r=>(r.Cookie="CK",r.Event="EVT",r.Behavior="BEH",r.LandingPage="LP",r.PageViewCount="PVW",r.PageVisited="PVI",r.QueryString="QS",r))(p||{}),S=(i=>(i.OncePerVisit="visit",i.Once="once",i.Always="always",i))(S||{}),P=(t=>(t.Visit="visit",t.Visitor="visitor",t))(P||{});function N(n){return n.type==p.Cookie}function G(n){return n.type==p.Event}function z(n){return n.type==p.Behavior}function X(n){return n.type==p.LandingPage}function ee(n){return n.type==p.PageViewCount}function re(n){return n.type==p.PageVisited}function pe(n){return n.type==p.QueryString}function le(n,e){var a,o,s,r;let t=n,i=e==null?void 0:e.expr;switch(((a=e==null?void 0:e.cs)!=null?a:!1)||([t,i]=E(t,i)),(o=e==null?void 0:e.type)!=null?o:"exact"){case"exact":return t===i;case"notexact":return t!==i;case"contains":return i&&(s=t==null?void 0:t.includes(i))!=null?s:!1;case"notcontains":return i?!((r=t==null?void 0:t.includes(i))!=null?r:!0):!0;case"exists":return n!==null&&typeof n!="undefined";case"notexists":return n===null||typeof n=="undefined";default:return console.warn(`Unknown string match type ${e.type} will be ignored.`),!1}}function E(...n){return n.map(e=>e==null?void 0:e.toUpperCase())}export{d as EnrichmentClient,y as IntentTagStrength,P as Scope,S as SignalFrequency,p as SignalType,C as getBehaviorIntents,V as getPersonalizationIntents,z as isBehaviorSignal,N as isCookieSignal,G as isEventSignal,X as isLandingPageSignal,ee as isPageViewCountSignal,re as isPageVisitedSignal,pe as isQueryStringSignal,le as isStringMatch};

@@ -1,2 +0,2 @@

var V=Object.create;var m=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty;var h=t=>m(t,"__esModule",{value:!0});var M=(t,e)=>{h(t);for(var i in e)m(t,i,{get:e[i],enumerable:!0})},O=(t,e,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of w(e))!j.call(t,n)&&n!=="default"&&m(t,n,{get:()=>e[n],enumerable:!(i=b(e,n))||i.enumerable});return t},d=t=>O(h(m(t!=null?V(k(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);M(exports,{EnrichmentClient:()=>C,IntentTagStrength:()=>g,Scope:()=>x,SignalFrequency:()=>y,SignalType:()=>a,getBehaviorIntents:()=>R,getPersonalizationIntents:()=>v,isBehaviorSignal:()=>I,isCookieSignal:()=>L,isEventSignal:()=>U,isLandingPageSignal:()=>T,isPageViewCountSignal:()=>B,isPageVisitedSignal:()=>A,isQueryStringSignal:()=>N,isStringMatch:()=>$});var g;(function(r){r[r.Antimatter=0]="Antimatter",r[r.Tangential=5]="Tangential",r[r.Weak=25]="Weak",r[r.Normal=50]="Normal",r[r.Strong=75]="Strong",r[r.Strongest=100]="Strongest",r[r.Boost=1e3]="Boost"})(g||(g={}));function R(t){return(t==null?void 0:t.intents)?Object.keys(t==null?void 0:t.intents).reduce((e,i)=>{let n=t.intents[i];return(n==null?void 0:n.noBeh)||(e[i]=n),e},{}):{}}function v(t){return(t==null?void 0:t.intents)?Object.keys(t==null?void 0:t.intents).reduce((e,i)=>{let n=t.intents[i];return(n==null?void 0:n.noPn)||(e[i]=n),e},{}):{}}var P=d(require("p-throttle")),S=d(require("p-retry"));function E({throttle:t={interval:1e3,limit:10},retry:e={retries:1,factor:1.66}}){let i=t?(0,P.default)(t):null;return function(p){let o=async()=>await p();if(i&&(o=i(o)),e){let s=o;o=()=>(0,S.default)(s,e)}return o()}}var u=class extends Error{constructor(e,i,n,p,o){super(`${e}
${p}${o?" "+o:""} (${i} ${n})`);this.errorMessage=e;this.fetchMethod=i;this.fetchUri=n;this.statusCode=p;this.statusText=o;Object.setPrototypeOf(this,u.prototype)}};var f=class{constructor(e){var i,n,p,o,s,r;if(!e.apiKey&&!e.bearerToken)throw new Error("You must provide an API key or a bearer token");this.options={...e,fetch:(i=e.fetch)!=null?i:fetch,apiHost:(n=e.apiHost)!=null?n:"https://uniform.app",apiKey:(p=e.apiKey)!=null?p:null,projectId:(o=e.projectId)!=null?o:null,bearerToken:(s=e.bearerToken)!=null?s:null,limitPolicy:(r=e.limitPolicy)!=null?r:E({})}}async apiClient(e,i){return this.options.limitPolicy(async()=>{var o;let n=this.options.apiKey?{"x-api-key":this.options.apiKey}:{Authorization:`Bearer ${this.options.bearerToken}`},p=await fetch(e.toString(),{...i,headers:{...i==null?void 0:i.headers,...n}});if(!p.ok){let s="";try{let r=await p.text();try{let l=JSON.parse(r);l.errorMessage?s=Array.isArray(l.errorMessage)?l.errorMessage.join(", "):l.errorMessage:s=r}catch(l){s=r}}catch(r){s="General error"}throw new u(s,(o=i==null?void 0:i.method)!=null?o:"GET",e.toString(),p.status)}return(i==null?void 0:i.expectNoContent)?null:await p.json()})}createUrl(e,i){let n=new URL(`${this.options.apiHost}${e}`);return Object.entries(i!=null?i:{}).forEach(([p,o])=>{var s;typeof o!==void 0&&o!==null&&n.searchParams.append(p,(s=o==null?void 0:o.toString())!=null?s:"")}),n}};var C=class extends f{constructor(e){super(e)}async getEnrichments(e){let{projectId:i}=this.options,n=this.createUrl("/api/v1/enrichments",{...e,projectId:i});return await this.apiClient(n)}async upsertEnrichmentCategory(e){let i=this.createUrl("/api/v1/enrichments");await this.apiClient(i,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async removeEnrichmentCategory(e){let i=this.createUrl("/api/v1/enrichments");await this.apiClient(i,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async upsertEnrichmentValue(e){let i=this.createUrl("/api/v1/enrichment-values");await this.apiClient(i,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async removeEnrichmentValue(e){let i=this.createUrl("/api/v1/enrichment-values");await this.apiClient(i,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}};var a;(function(r){r.Cookie="CK",r.Event="EVT",r.Behavior="BEH",r.LandingPage="LP",r.PageViewCount="PVW",r.PageVisited="PVI",r.QueryString="QS"})(a||(a={}));var y;(function(n){n.OncePerVisit="visit",n.Once="once",n.Always="always"})(y||(y={}));var x;(function(i){i.Visit="visit",i.Visitor="visitor"})(x||(x={}));function L(t){return t.type==a.Cookie}function U(t){return t.type==a.Event}function I(t){return t.type==a.Behavior}function T(t){return t.type==a.LandingPage}function B(t){return t.type==a.PageViewCount}function A(t){return t.type==a.PageVisited}function N(t){return t.type==a.QueryString}function $(t,e){var p,o,s,r;let i=t,n=e==null?void 0:e.expr;switch(((p=e==null?void 0:e.cs)!=null?p:!1)||([i,n]=Q(i,n)),(o=e==null?void 0:e.type)!=null?o:"exact"){case"exact":return i===n;case"notexact":return i!==n;case"contains":return n&&(s=i==null?void 0:i.includes(n))!=null?s:!1;case"notcontains":return n?!((r=i==null?void 0:i.includes(n))!=null?r:!0):!0;case"exists":return t!==null&&typeof t!="undefined";case"notexists":return t===null||typeof t=="undefined";default:return console.warn(`Unknown string match type ${e.type} will be ignored.`),!1}}function Q(...t){return t.map(e=>e==null?void 0:e.toUpperCase())}0&&(module.exports={EnrichmentClient,IntentTagStrength,Scope,SignalFrequency,SignalType,getBehaviorIntents,getPersonalizationIntents,isBehaviorSignal,isCookieSignal,isEventSignal,isLandingPageSignal,isPageViewCountSignal,isPageVisitedSignal,isQueryStringSignal,isStringMatch});
var V=Object.create;var u=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var f=t=>u(t,"__esModule",{value:!0});var j=(t,e)=>{f(t);for(var n in e)u(t,n,{get:e[n],enumerable:!0})},M=(t,e,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of w(e))!T.call(t,i)&&i!=="default"&&u(t,i,{get:()=>e[i],enumerable:!(n=b(e,i))||n.enumerable});return t},y=t=>M(f(u(t!=null?V(k(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);j(exports,{EnrichmentClient:()=>P,IntentTagStrength:()=>h,Scope:()=>C,SignalFrequency:()=>E,SignalType:()=>p,getBehaviorIntents:()=>O,getPersonalizationIntents:()=>R,isBehaviorSignal:()=>I,isCookieSignal:()=>v,isEventSignal:()=>L,isLandingPageSignal:()=>U,isPageViewCountSignal:()=>B,isPageVisitedSignal:()=>A,isQueryStringSignal:()=>N,isStringMatch:()=>$});var h=(r=>(r[r.Antimatter=0]="Antimatter",r[r.Tangential=5]="Tangential",r[r.Weak=25]="Weak",r[r.Normal=50]="Normal",r[r.Strong=75]="Strong",r[r.Strongest=100]="Strongest",r[r.Boost=1e3]="Boost",r))(h||{});function O(t){return(t==null?void 0:t.intents)?Object.keys(t==null?void 0:t.intents).reduce((e,n)=>{let i=t.intents[n];return(i==null?void 0:i.noBeh)||(e[n]=i),e},{}):{}}function R(t){return(t==null?void 0:t.intents)?Object.keys(t==null?void 0:t.intents).reduce((e,n)=>{let i=t.intents[n];return(i==null?void 0:i.noPn)||(e[n]=i),e},{}):{}}var x=y(require("p-throttle")),d=y(require("p-retry"));function S({throttle:t={interval:1e3,limit:10},retry:e={retries:1,factor:1.66}}){let n=t?(0,x.default)(t):null;return function(a){let o=async()=>await a();if(n&&(o=n(o)),e){let s=o;o=()=>(0,d.default)(s,e)}return o()}}var g=class extends Error{constructor(e,n,i,a,o){super(`${e}
${a}${o?" "+o:""} (${n} ${i})`);this.errorMessage=e;this.fetchMethod=n;this.fetchUri=i;this.statusCode=a;this.statusText=o;Object.setPrototypeOf(this,g.prototype)}};var m=class{constructor(e){var n,i,a,o,s,r;if(!e.apiKey&&!e.bearerToken)throw new Error("You must provide an API key or a bearer token");this.options={...e,fetch:(n=e.fetch)!=null?n:fetch,apiHost:(i=e.apiHost)!=null?i:"https://uniform.app",apiKey:(a=e.apiKey)!=null?a:null,projectId:(o=e.projectId)!=null?o:null,bearerToken:(s=e.bearerToken)!=null?s:null,limitPolicy:(r=e.limitPolicy)!=null?r:S({})}}async apiClient(e,n){return this.options.limitPolicy(async()=>{var o;let i=this.options.apiKey?{"x-api-key":this.options.apiKey}:{Authorization:`Bearer ${this.options.bearerToken}`},a=await fetch(e.toString(),{...n,headers:{...n==null?void 0:n.headers,...i}});if(!a.ok){let s="";try{let r=await a.text();try{let l=JSON.parse(r);l.errorMessage?s=Array.isArray(l.errorMessage)?l.errorMessage.join(", "):l.errorMessage:s=r}catch(l){s=r}}catch(r){s="General error"}throw new g(s,(o=n==null?void 0:n.method)!=null?o:"GET",e.toString(),a.status)}return(n==null?void 0:n.expectNoContent)?null:await a.json()})}createUrl(e,n){let i=new URL(`${this.options.apiHost}${e}`);return Object.entries(n!=null?n:{}).forEach(([a,o])=>{var s;typeof o!==void 0&&o!==null&&i.searchParams.append(a,(s=o==null?void 0:o.toString())!=null?s:"")}),i}};var P=class extends m{constructor(e){super(e)}async getEnrichments(e){let{projectId:n}=this.options,i=this.createUrl("/api/v1/enrichments",{...e,projectId:n});return await this.apiClient(i)}async upsertEnrichmentCategory(e){let n=this.createUrl("/api/v1/enrichments");await this.apiClient(n,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async removeEnrichmentCategory(e){let n=this.createUrl("/api/v1/enrichments");await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async upsertEnrichmentValue(e){let n=this.createUrl("/api/v1/enrichment-values");await this.apiClient(n,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async removeEnrichmentValue(e){let n=this.createUrl("/api/v1/enrichment-values");await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}};var p=(r=>(r.Cookie="CK",r.Event="EVT",r.Behavior="BEH",r.LandingPage="LP",r.PageViewCount="PVW",r.PageVisited="PVI",r.QueryString="QS",r))(p||{}),E=(i=>(i.OncePerVisit="visit",i.Once="once",i.Always="always",i))(E||{}),C=(n=>(n.Visit="visit",n.Visitor="visitor",n))(C||{});function v(t){return t.type==p.Cookie}function L(t){return t.type==p.Event}function I(t){return t.type==p.Behavior}function U(t){return t.type==p.LandingPage}function B(t){return t.type==p.PageViewCount}function A(t){return t.type==p.PageVisited}function N(t){return t.type==p.QueryString}function $(t,e){var a,o,s,r;let n=t,i=e==null?void 0:e.expr;switch(((a=e==null?void 0:e.cs)!=null?a:!1)||([n,i]=Q(n,i)),(o=e==null?void 0:e.type)!=null?o:"exact"){case"exact":return n===i;case"notexact":return n!==i;case"contains":return i&&(s=n==null?void 0:n.includes(i))!=null?s:!1;case"notcontains":return i?!((r=n==null?void 0:n.includes(i))!=null?r:!0):!0;case"exists":return t!==null&&typeof t!="undefined";case"notexists":return t===null||typeof t=="undefined";default:return console.warn(`Unknown string match type ${e.type} will be ignored.`),!1}}function Q(...t){return t.map(e=>e==null?void 0:e.toUpperCase())}0&&(module.exports={EnrichmentClient,IntentTagStrength,Scope,SignalFrequency,SignalType,getBehaviorIntents,getPersonalizationIntents,isBehaviorSignal,isCookieSignal,isEventSignal,isLandingPageSignal,isPageViewCountSignal,isPageVisitedSignal,isQueryStringSignal,isStringMatch});
© 2021 Uniform Systems, Inc. All Rights Reserved.
See details of Uniform Systems, Inc. Master Subscription Agreement here: https://uniform.dev/eula
{
"name": "@uniformdev/optimize-common",
"version": "12.2.1-alpha.59+ee5a4745",
"version": "12.2.1-alpha.107+b30768d5",
"description": "Common functionality and types for Uniform Optimize",

@@ -30,11 +30,11 @@ "license": "SEE LICENSE IN LICENSE.txt",

"@types/jest": "27.0.3",
"@types/node": "16.7.1",
"eslint": "7.32.0",
"@types/node": "16.11.18",
"eslint": "8.4.1",
"eslint-plugin-react": "7.27.1",
"eslint-plugin-react-hooks": "4.3.0",
"jest": "27.3.1",
"jest": "27.4.5",
"npm-run-all": "4.1.5",
"rimraf": "3.0.2",
"ts-jest": "27.0.7",
"tsup": "5.7.2"
"ts-jest": "27.1.1",
"tsup": "5.11.10"
},

@@ -51,3 +51,3 @@ "dependencies": {

},
"gitHead": "ee5a4745535ac342d62ba2472e2a681c9867255b"
"gitHead": "b30768d5d58d4c75b390274042724d50c1ee1041"
}
Common functionality and types for Uniform Optimize
part of the [Uniform Platform](https://uniform.app). See our [documentation](https://docs.uniform.app) for more details.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc