@uniformdev/context
Advanced tools
Comparing version 16.2.1-alpha.106 to 16.2.1-alpha.142
@@ -1,2 +0,2 @@ | ||
"use strict";var N=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var H=Object.prototype.hasOwnProperty;var K=(r,e,t)=>e in r?N(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var q=(r,e)=>{for(var t in e)N(r,t,{get:e[t],enumerable:!0})},z=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Q(e))!H.call(r,n)&&n!==t&&N(r,n,{get:()=>e[n],enumerable:!(i=V(e,n))||i.enumerable});return r};var B=r=>z(N({},"__esModule",{value:!0}),r);var m=(r,e,t)=>(K(r,typeof e!="symbol"?e+"":e,t),t),Y=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)};var s=(r,e,t)=>(Y(r,e,"read from private field"),t?t.call(r):e.get(r)),p=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)};var X={};q(X,{AggregateClient:()=>f,ApiClientError:()=>h,ContextClient:()=>J,DimensionClient:()=>P,EnrichmentClient:()=>y,ManifestClient:()=>x,QuirkClient:()=>j,SignalClient:()=>C,computeDimensionDefinitionDisplayData:()=>M,computeDimensionDisplayData:()=>F,computeDimensionDisplayName:()=>W,nullLimitPolicy:()=>k});module.exports=B(X);var k=async r=>await r(),h=class extends Error{constructor(t,i,n,a,c,l){super(`${t} | ||
${a}${c?" "+c:""} (${i} ${n}${l?` Request ID: ${l}`:""})`);this.errorMessage=t;this.fetchMethod=i;this.fetchUri=n;this.statusCode=a;this.statusText=c;this.requestId=l;Object.setPrototypeOf(this,h.prototype)}};var o=class{constructor(e){m(this,"options");var t,i,n,a,c,l;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:(n=e.apiKey)!=null?n:null,projectId:(a=e.projectId)!=null?a:null,bearerToken:(c=e.bearerToken)!=null?c:null,limitPolicy:(l=e.limitPolicy)!=null?l:k}}async apiClient(e,t){return this.options.limitPolicy(async()=>{var a;let i=this.options.apiKey?{"x-api-key":this.options.apiKey}:{Authorization:`Bearer ${this.options.bearerToken}`},n=await fetch(e.toString(),{...t,headers:{...t==null?void 0:t.headers,...i}});if(!n.ok){let c="";try{let l=await n.text();try{let R=JSON.parse(l);R.errorMessage?c=Array.isArray(R.errorMessage)?R.errorMessage.join(", "):R.errorMessage:c=l}catch(R){c=l}}catch(l){c="General error"}throw new h(c,(a=t==null?void 0:t.method)!=null?a:"GET",e.toString(),n.status,n.statusText,o.getRequestId(n))}return t!=null&&t.expectNoContent?null:await n.json()})}createUrl(e,t){let i=new URL(`${this.options.apiHost}${e}`);return Object.entries(t!=null?t:{}).forEach(([n,a])=>{var c;typeof a!="undefined"&&a!==null&&i.searchParams.append(n,(c=a==null?void 0:a.toString())!=null?c:"")}),i}static getRequestId(e){let t=e.headers.get("x-nf-request-id");if(t)return t}};var g,I=class extends o{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(s(I,g),{...e,projectId:t});return await this.apiClient(i)}async upsert(e){let t=this.createUrl(s(I,g));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let t=this.createUrl(s(I,g));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},f=I;g=new WeakMap,p(f,g,"/api/v2/aggregate");var S,v=class extends o{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(s(v,S),{...e,projectId:t});return await this.apiClient(i)}},P=v;S=new WeakMap,p(P,S,"/api/v2/dimension");var d,T,u=class extends o{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(s(u,d),{...e,projectId:t});return await this.apiClient(i)}async upsertCategory(e){let t=this.createUrl(s(u,d));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async removeCategory(e){let t=this.createUrl(s(u,d));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async upsertValue(e){let t=this.createUrl(s(u,T));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async removeValue(e){let t=this.createUrl(s(u,T));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},y=u;d=new WeakMap,T=new WeakMap,p(y,d,"/api/v1/enrichments"),p(y,T,"/api/v1/enrichment-values");var A,L=class extends o{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(s(L,A),{...e,projectId:t});return await this.apiClient(i)}async publish(){let{projectId:e}=this.options,t=this.createUrl("/api/v1/publish",{siteId:e});await this.apiClient(t,{method:"POST",expectNoContent:!0})}},x=L;A=new WeakMap,p(x,A,"/api/v2/manifest");var E,O=class extends o{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(s(O,E),{...e,projectId:t});return await this.apiClient(i)}async upsert(e){let t=this.createUrl(s(O,E));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let t=this.createUrl(s(O,E));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},j=O;E=new WeakMap,p(j,E,"/api/v2/quirk");var U,G=class extends o{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(s(G,U),{...e,projectId:t});return await this.apiClient(i)}async upsert(e){let t=this.createUrl(s(G,U));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let t=this.createUrl(s(G,U));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},C=G;U=new WeakMap,p(C,U,"/api/v2/signal");var D,b=class extends o{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(s(b,D),{...e,projectId:t});return await this.apiClient(i)}async upsert(e){let t=this.createUrl(s(b,D));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let t=this.createUrl(s(b,D));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},w=b;D=new WeakMap,p(w,D,"/api/v2/test");var J=class{constructor(e){m(this,"enrichments");m(this,"aggregates");m(this,"dimensions");m(this,"manifest");m(this,"quirks");m(this,"signals");m(this,"tests");this.enrichments=new y(e),this.aggregates=new f(e),this.dimensions=new P(e),this.manifest=new x(e),this.quirks=new j(e),this.signals=new C(e),this.tests=new w(e)}};var $="_";function M(r){let e=r.category==="ENR"?"Enrichment":r.category==="SIG"?"Signal":r.subcategory==="1"?"Intent":r.subcategory==="0"?"Audience":"Aggregate";return{dim:r.dim,name:r.name,type:e,category:r.category==="ENR"?r.subcategory:void 0}}function F(r,e){var t,i,n,a;if((i=(t=e.project.pz)==null?void 0:t.agg)!=null&&i[r])return{dim:r,name:r,type:"Aggregate"};if((a=(n=e.project.pz)==null?void 0:n.sig)!=null&&a[r])return{dim:r,name:r,type:"Signal"};if(r.indexOf($)>=0){let[c,l]=r.split($);return{dim:r,name:l,type:"Enrichment",category:c}}}function W(r){let{type:e,name:t}=M(r);return`${e}: ${t}`}0&&(module.exports={AggregateClient,ApiClientError,ContextClient,DimensionClient,EnrichmentClient,ManifestClient,QuirkClient,SignalClient,computeDimensionDefinitionDisplayData,computeDimensionDisplayData,computeDimensionDisplayName,nullLimitPolicy}); | ||
"use strict";var N=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var H=Object.prototype.hasOwnProperty;var K=(r,e,t)=>e in r?N(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var q=(r,e)=>{for(var t in e)N(r,t,{get:e[t],enumerable:!0})},z=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Q(e))!H.call(r,n)&&n!==t&&N(r,n,{get:()=>e[n],enumerable:!(i=V(e,n))||i.enumerable});return r};var B=r=>z(N({},"__esModule",{value:!0}),r);var m=(r,e,t)=>(K(r,typeof e!="symbol"?e+"":e,t),t),Y=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)};var s=(r,e,t)=>(Y(r,e,"read from private field"),t?t.call(r):e.get(r)),c=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)};var X={};q(X,{AggregateClient:()=>g,ApiClientError:()=>h,ContextClient:()=>J,DimensionClient:()=>P,EnrichmentClient:()=>y,ManifestClient:()=>x,QuirkClient:()=>j,SignalClient:()=>C,computeDimensionDefinitionDisplayData:()=>M,computeDimensionDisplayData:()=>F,computeDimensionDisplayName:()=>W,nullLimitPolicy:()=>k});module.exports=B(X);var k=async r=>await r(),h=class extends Error{constructor(t,i,n,a,p,l){super(`${t} | ||
${a}${p?" "+p:""} (${i} ${n}${l?` Request ID: ${l}`:""})`);this.errorMessage=t;this.fetchMethod=i;this.fetchUri=n;this.statusCode=a;this.statusText=p;this.requestId=l;Object.setPrototypeOf(this,h.prototype)}};var o=class{constructor(e){m(this,"options");var t,i,n,a,p,l;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:(n=e.apiKey)!=null?n:null,projectId:(a=e.projectId)!=null?a:null,bearerToken:(p=e.bearerToken)!=null?p:null,limitPolicy:(l=e.limitPolicy)!=null?l:k}}async apiClient(e,t){return this.options.limitPolicy(async()=>{var a;let i=this.options.apiKey?{"x-api-key":this.options.apiKey}:{Authorization:`Bearer ${this.options.bearerToken}`},n=await this.options.fetch(e.toString(),{...t,headers:{...t==null?void 0:t.headers,...i}});if(!n.ok){let p="";try{let l=await n.text();try{let R=JSON.parse(l);R.errorMessage?p=Array.isArray(R.errorMessage)?R.errorMessage.join(", "):R.errorMessage:p=l}catch(R){p=l}}catch(l){p="General error"}throw new h(p,(a=t==null?void 0:t.method)!=null?a:"GET",e.toString(),n.status,n.statusText,o.getRequestId(n))}return t!=null&&t.expectNoContent?null:await n.json()})}createUrl(e,t){let i=new URL(`${this.options.apiHost}${e}`);return Object.entries(t!=null?t:{}).forEach(([n,a])=>{var p;typeof a!="undefined"&&a!==null&&i.searchParams.append(n,(p=a==null?void 0:a.toString())!=null?p:"")}),i}static getRequestId(e){let t=e.headers.get("apigw-requestid");if(t)return t}};var f,I=class extends o{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(s(I,f),{...e,projectId:t});return await this.apiClient(i)}async upsert(e){let t=this.createUrl(s(I,f));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let t=this.createUrl(s(I,f));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},g=I;f=new WeakMap,c(g,f,"/api/v2/aggregate");var S,v=class extends o{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(s(v,S),{...e,projectId:t});return await this.apiClient(i)}},P=v;S=new WeakMap,c(P,S,"/api/v2/dimension");var d,T,u=class extends o{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(s(u,d),{...e,projectId:t});return await this.apiClient(i)}async upsertCategory(e){let t=this.createUrl(s(u,d));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async removeCategory(e){let t=this.createUrl(s(u,d));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async upsertValue(e){let t=this.createUrl(s(u,T));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async removeValue(e){let t=this.createUrl(s(u,T));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},y=u;d=new WeakMap,T=new WeakMap,c(y,d,"/api/v1/enrichments"),c(y,T,"/api/v1/enrichment-values");var A,L=class extends o{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(s(L,A),{...e,projectId:t});return await this.apiClient(i)}async publish(){let{projectId:e}=this.options,t=this.createUrl("/api/v1/publish",{siteId:e});await this.apiClient(t,{method:"POST",expectNoContent:!0})}},x=L;A=new WeakMap,c(x,A,"/api/v2/manifest");var E,O=class extends o{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(s(O,E),{...e,projectId:t});return await this.apiClient(i)}async upsert(e){let t=this.createUrl(s(O,E));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let t=this.createUrl(s(O,E));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},j=O;E=new WeakMap,c(j,E,"/api/v2/quirk");var U,G=class extends o{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(s(G,U),{...e,projectId:t});return await this.apiClient(i)}async upsert(e){let t=this.createUrl(s(G,U));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let t=this.createUrl(s(G,U));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},C=G;U=new WeakMap,c(C,U,"/api/v2/signal");var D,b=class extends o{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(s(b,D),{...e,projectId:t});return await this.apiClient(i)}async upsert(e){let t=this.createUrl(s(b,D));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let t=this.createUrl(s(b,D));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},w=b;D=new WeakMap,c(w,D,"/api/v2/test");var J=class{constructor(e){m(this,"enrichments");m(this,"aggregates");m(this,"dimensions");m(this,"manifest");m(this,"quirks");m(this,"signals");m(this,"tests");this.enrichments=new y(e),this.aggregates=new g(e),this.dimensions=new P(e),this.manifest=new x(e),this.quirks=new j(e),this.signals=new C(e),this.tests=new w(e)}};var $="_";function M(r){let e=r.category==="ENR"?"Enrichment":r.category==="SIG"?"Signal":r.subcategory==="1"?"Intent":r.subcategory==="0"?"Audience":"Aggregate";return{dim:r.dim,name:r.name,type:e,category:r.category==="ENR"?r.subcategory:void 0}}function F(r,e){var t,i,n,a;if((i=(t=e.project.pz)==null?void 0:t.agg)!=null&&i[r])return{dim:r,name:r,type:"Aggregate"};if((a=(n=e.project.pz)==null?void 0:n.sig)!=null&&a[r])return{dim:r,name:r,type:"Signal"};if(r.indexOf($)>=0){let[p,l]=r.split($);return{dim:r,name:l,type:"Enrichment",category:p}}}function W(r){let{type:e,name:t}=M(r);return`${e}: ${t}`}0&&(module.exports={AggregateClient,ApiClientError,ContextClient,DimensionClient,EnrichmentClient,ManifestClient,QuirkClient,SignalClient,computeDimensionDefinitionDisplayData,computeDimensionDisplayData,computeDimensionDisplayName,nullLimitPolicy}); |
{ | ||
"name": "@uniformdev/context", | ||
"version": "16.2.1-alpha.106+a3eb5a014", | ||
"version": "16.2.1-alpha.142+0cfd8c64a", | ||
"description": "Uniform Context core package", | ||
@@ -62,3 +62,3 @@ "license": "SEE LICENSE IN LICENSE.txt", | ||
"@types/yargs": "17.0.10", | ||
"@uniformdev/cli": "^16.2.1-alpha.106+a3eb5a014", | ||
"@uniformdev/cli": "^16.2.1-alpha.142+0cfd8c64a", | ||
"benny": "3.7.1", | ||
@@ -69,3 +69,2 @@ "yargs": "17.5.1" | ||
"dequal": "^2.0.2", | ||
"isomorphic-unfetch": "^3.1.0", | ||
"js-cookie": "3.0.1", | ||
@@ -82,3 +81,3 @@ "mitt": "^3.0.0", | ||
}, | ||
"gitHead": "a3eb5a01423196eee3cb0fbb2a4e9372b420f160" | ||
"gitHead": "0cfd8c64a32188799639bf906d0a1cc706dfa957" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 4 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 6 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
2330065
5
11678
80
13
- Removedisomorphic-unfetch@^3.1.0
- Removedisomorphic-unfetch@3.1.0(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedunfetch@4.2.0(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)