@uniformdev/context 12.2.1-alpha.142 → 12.2.1-alpha.177
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/api/api.d.ts +20 -2
- package/dist/api/api.js +2 -2
- package/dist/api/api.mjs +1 -1
- package/dist/chunk-GU2YFM6V.mjs +1 -0
- package/dist/chunk-JKQJOIRC.mjs +2 -0
- package/dist/chunk-KZPEO35A.mjs +1 -0
- package/dist/cli/cli.js +55 -21
- package/dist/cli/cli.mjs +54 -20
- package/dist/index.d.ts +34 -553
- package/dist/index.esm.js +3 -3
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/dist/types-1ad8439c.d.ts +987 -0
- package/package.json +4 -4
- package/dist/chunk-TRWANXVF.mjs +0 -1
- package/dist/chunk-WLJXJJSU.mjs +0 -2
- package/dist/v2-manifest.swagger-d0899723.d.ts +0 -285
package/dist/api/api.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
import {
|
1
|
+
import { ao as paths$6, g as ManifestV2 } from '../types-1ad8439c';
|
2
|
+
import 'mitt';
|
2
3
|
|
3
4
|
/**
|
4
5
|
* This file was auto-generated by openapi-typescript.
|
@@ -378,6 +379,12 @@ interface paths$3 {
|
|
378
379
|
aggregate: components$4["schemas"]["AggregateData"];
|
379
380
|
/** Format: uuid */
|
380
381
|
projectId: string;
|
382
|
+
/**
|
383
|
+
* @description Skips updating aggregate inputs and upserts only the aggregate definition.
|
384
|
+
* Inputs data is still required, but is ignored and not saved or validated.
|
385
|
+
* Useful when creating aggregates that reference each other: Create the definitions, then the inputs.
|
386
|
+
*/
|
387
|
+
skipInputs?: boolean;
|
381
388
|
};
|
382
389
|
};
|
383
390
|
};
|
@@ -1504,4 +1511,15 @@ declare class ContextClient {
|
|
1504
1511
|
readonly signals: SignalClient;
|
1505
1512
|
}
|
1506
1513
|
|
1507
|
-
|
1514
|
+
declare type DimensionDisplayData = {
|
1515
|
+
dim: string;
|
1516
|
+
type: 'Aggregate' | 'Enrichment' | 'Signal' | 'Intent' | 'Audience';
|
1517
|
+
category?: string;
|
1518
|
+
name: string;
|
1519
|
+
};
|
1520
|
+
declare function computeDimensionDefinitionDisplayData(dim: DimensionDefinition): DimensionDisplayData;
|
1521
|
+
declare function computeDimensionDisplayData(dim: string, manifest: ManifestV2): DimensionDisplayData | undefined;
|
1522
|
+
/** Computes the standard display name for a given dimension from the dimensions API */
|
1523
|
+
declare function computeDimensionDisplayName(dim: DimensionDefinition): string;
|
1524
|
+
|
1525
|
+
export { Aggregate, AggregateClient, AggregateDeleteParameters, AggregateGetParameters, AggregateGetResponse, AggregatePutParameters, ApiClientError, ClientOptions, ContextClient, CookieCriteria, CurrentPageCriteria, DimensionClient, DimensionDefinition, DimensionDisplayData, DimensionGetParameters, DimensionGetResponse, EnrichmentCategory, EnrichmentCategoryWithValues, EnrichmentClient, EnrichmentDeleteParameters, EnrichmentGetParameters, EnrichmentGetResponse, EnrichmentPutParameters, EnrichmentValue, EnrichmentValueDeleteParameters, EnrichmentValuePutParameters, EventCriteria, ExceptProject, LimitPolicy, ManifestClient, ManifestGetParameters, ManifestGetResponse, PageViewCountCriteria, QueryStringCriteria, Quirk, QuirkClient, QuirkCriteria, QuirkDeleteParameters, QuirkGetParameters, QuirkGetResponse, QuirkPutParameters, RootSignalCriteriaGroup, SignalClient, SignalDeleteParameters, SignalGetParameters, SignalGetResponse, SignalPutParameters, SignalWithId, computeDimensionDefinitionDisplayData, computeDimensionDisplayData, computeDimensionDisplayName, nullLimitPolicy };
|
package/dist/api/api.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
var b=Object.defineProperty;var
|
2
|
-
${o}${
|
1
|
+
var b=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var $=(r,e,t)=>e in r?b(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var H=r=>b(r,"__esModule",{value:!0});var K=(r,e)=>{for(var t in e)b(r,t,{get:e[t],enumerable:!0})},z=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of v(e))!Q.call(r,o)&&(t||o!=="default")&&b(r,o,{get:()=>e[o],enumerable:!(i=V(e,o))||i.enumerable});return r};var q=(r=>(e,t)=>r&&r.get(e)||(t=z(H({}),e,1),r&&r.set(e,t),t))(typeof WeakMap!="undefined"?new WeakMap:0);var h=(r,e,t)=>($(r,typeof e!="symbol"?e+"":e,t),t),B=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)};var n=(r,e,t)=>(B(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 W={};K(W,{AggregateClient:()=>E,ApiClientError:()=>g,ContextClient:()=>M,DimensionClient:()=>D,EnrichmentClient:()=>f,ManifestClient:()=>R,QuirkClient:()=>I,SignalClient:()=>G,computeDimensionDefinitionDisplayData:()=>J,computeDimensionDisplayData:()=>Y,computeDimensionDisplayName:()=>F,nullLimitPolicy:()=>A});var A=async r=>await r(),g=class extends Error{constructor(e,t,i,o,s){super(`${e}
|
2
|
+
${o}${s?" "+s:""} (${t} ${i})`);this.errorMessage=e;this.fetchMethod=t;this.fetchUri=i;this.statusCode=o;this.statusText=s;Object.setPrototypeOf(this,g.prototype)}};var p=class{constructor(e){h(this,"options");var t,i,o,s,a,m;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:(o=e.apiKey)!=null?o:null,projectId:(s=e.projectId)!=null?s:null,bearerToken:(a=e.bearerToken)!=null?a:null,limitPolicy:(m=e.limitPolicy)!=null?m:A}}async apiClient(e,t){return this.options.limitPolicy(async()=>{var s;let i=this.options.apiKey?{"x-api-key":this.options.apiKey}:{Authorization:`Bearer ${this.options.bearerToken}`},o=await fetch(e.toString(),{...t,headers:{...t==null?void 0:t.headers,...i}});if(!o.ok){let a="";try{let m=await o.text();try{let C=JSON.parse(m);C.errorMessage?a=Array.isArray(C.errorMessage)?C.errorMessage.join(", "):C.errorMessage:a=m}catch(C){a=m}}catch(m){a="General error"}throw new g(a,(s=t==null?void 0:t.method)!=null?s:"GET",e.toString(),o.status)}return(t==null?void 0:t.expectNoContent)?null:await o.json()})}createUrl(e,t){let i=new URL(`${this.options.apiHost}${e}`);return Object.entries(t!=null?t:{}).forEach(([o,s])=>{var a;typeof s!="undefined"&&s!==null&&i.searchParams.append(o,(a=s==null?void 0:s.toString())!=null?a:"")}),i}};var y,j=class extends p{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(n(j,y),{...e,projectId:t});return await this.apiClient(i)}async upsert(e){let t=this.createUrl(n(j,y));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let t=this.createUrl(n(j,y));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},E=j;y=new WeakMap,c(E,y,"/api/v2/aggregate");var S,N=class extends p{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(n(N,S),{...e,projectId:t});return await this.apiClient(i)}},D=N;S=new WeakMap,c(D,S,"/api/v2/dimension");var P,U,u=class extends p{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(n(u,P),{...e,projectId:t});return await this.apiClient(i)}async upsertCategory(e){let t=this.createUrl(n(u,P));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async removeCategory(e){let t=this.createUrl(n(u,P));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async upsertValue(e){let t=this.createUrl(n(u,U));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async removeValue(e){let t=this.createUrl(n(u,U));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},f=u;P=new WeakMap,U=new WeakMap,c(f,P,"/api/v1/enrichments"),c(f,U,"/api/v1/enrichment-values");var T,k=class extends p{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(n(k,T),{...e,projectId:t});return await this.apiClient(i)}},R=k;T=new WeakMap,c(R,T,"/api/v2/manifest");var d,O=class extends p{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(n(O,d),{...e,projectId:t});return await this.apiClient(i)}async upsert(e){let t=this.createUrl(n(O,d));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let t=this.createUrl(n(O,d));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},I=O;d=new WeakMap,c(I,d,"/api/v2/quirk");var x,w=class extends p{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(n(w,x),{...e,projectId:t});return await this.apiClient(i)}async upsert(e){let t=this.createUrl(n(w,x));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let t=this.createUrl(n(w,x));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},G=w;x=new WeakMap,c(G,x,"/api/v2/signal");var M=class{constructor(e){h(this,"enrichments");h(this,"aggregates");h(this,"dimensions");h(this,"manifest");h(this,"quirks");h(this,"signals");this.enrichments=new f(e),this.aggregates=new E(e),this.dimensions=new D(e),this.manifest=new R(e),this.quirks=new I(e),this.signals=new G(e)}};var L="_";function J(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 Y(r,e){var t,i,o,s;if((i=(t=e.project.pz)==null?void 0:t.agg)==null?void 0:i[r])return{dim:r,name:r,type:"Aggregate"};if((s=(o=e.project.pz)==null?void 0:o.sig)==null?void 0:s[r])return{dim:r,name:r,type:"Signal"};if(r.indexOf(L)>=0){let[a,m]=r.split(L);return{dim:r,name:m,type:"Enrichment",category:a}}}function F(r){let{type:e,name:t}=J(r);return`${e}: ${t}`}module.exports=q(W);0&&(module.exports={AggregateClient,ApiClientError,ContextClient,DimensionClient,EnrichmentClient,ManifestClient,QuirkClient,SignalClient,computeDimensionDefinitionDisplayData,computeDimensionDisplayData,computeDimensionDisplayName,nullLimitPolicy});
|
package/dist/api/api.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{a as
|
1
|
+
import{a as p}from"../chunk-GU2YFM6V.mjs";import{a as G,b as O,c as u,d as x,e as C,f as h,g as E,h as A}from"../chunk-JKQJOIRC.mjs";import{d as i,e as y,f as D,i as n}from"../chunk-KZPEO35A.mjs";n();n();n();var a,l=class extends u{constructor(t){super(t)}async get(t){let{projectId:r}=this.options,o=this.createUrl(y(l,a),{...t,projectId:r});return await this.apiClient(o)}},s=l;a=new WeakMap,D(s,a,"/api/v2/dimension");var w=class{constructor(t){i(this,"enrichments");i(this,"aggregates");i(this,"dimensions");i(this,"manifest");i(this,"quirks");i(this,"signals");this.enrichments=new C(t),this.aggregates=new x(t),this.dimensions=new s(t),this.manifest=new h(t),this.quirks=new E(t),this.signals=new A(t)}};n();function S(e){let t=e.category==="ENR"?"Enrichment":e.category==="SIG"?"Signal":e.subcategory==="1"?"Intent":e.subcategory==="0"?"Audience":"Aggregate";return{dim:e.dim,name:e.name,type:t,category:e.category==="ENR"?e.subcategory:void 0}}function z(e,t){var r,o,g,f;if((o=(r=t.project.pz)==null?void 0:r.agg)==null?void 0:o[e])return{dim:e,name:e,type:"Aggregate"};if((f=(g=t.project.pz)==null?void 0:g.sig)==null?void 0:f[e])return{dim:e,name:e,type:"Signal"};if(e.indexOf(p)>=0){let[d,R]=e.split(p);return{dim:e,name:R,type:"Enrichment",category:d}}}function Q(e){let{type:t,name:r}=S(e);return`${t}: ${r}`}export{x as AggregateClient,O as ApiClientError,w as ContextClient,s as DimensionClient,C as EnrichmentClient,h as ManifestClient,E as QuirkClient,A as SignalClient,S as computeDimensionDefinitionDisplayData,z as computeDimensionDisplayData,Q as computeDimensionDisplayName,G as nullLimitPolicy};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{i as R}from"./chunk-KZPEO35A.mjs";R();var A="_";export{A as a};
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{d as G,e as r,f as c,i as o}from"./chunk-KZPEO35A.mjs";o();var T=async b=>await b(),x=class extends Error{constructor(e,t,i,n,s){super(`${e}
|
2
|
+
${n}${s?" "+s:""} (${t} ${i})`);this.errorMessage=e;this.fetchMethod=t;this.fetchUri=i;this.statusCode=n;this.statusText=s;Object.setPrototypeOf(this,x.prototype)}};o();o();var p=class{constructor(e){G(this,"options");var t,i,n,s,a,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:(s=e.projectId)!=null?s:null,bearerToken:(a=e.bearerToken)!=null?a:null,limitPolicy:(l=e.limitPolicy)!=null?l:T}}async apiClient(e,t){return this.options.limitPolicy(async()=>{var s;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 a="";try{let l=await n.text();try{let f=JSON.parse(l);f.errorMessage?a=Array.isArray(f.errorMessage)?f.errorMessage.join(", "):f.errorMessage:a=l}catch(f){a=l}}catch(l){a="General error"}throw new x(a,(s=t==null?void 0:t.method)!=null?s:"GET",e.toString(),n.status)}return(t==null?void 0: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,s])=>{var a;typeof s!="undefined"&&s!==null&&i.searchParams.append(n,(a=s==null?void 0:s.toString())!=null?a:"")}),i}};var P,j=class extends p{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(r(j,P),{...e,projectId:t});return await this.apiClient(i)}async upsert(e){let t=this.createUrl(r(j,P));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let t=this.createUrl(r(j,P));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},w=j;P=new WeakMap,c(w,P,"/api/v2/aggregate");o();var y,E,m=class extends p{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(r(m,y),{...e,projectId:t});return await this.apiClient(i)}async upsertCategory(e){let t=this.createUrl(r(m,y));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async removeCategory(e){let t=this.createUrl(r(m,y));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async upsertValue(e){let t=this.createUrl(r(m,E));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async removeValue(e){let t=this.createUrl(r(m,E));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},O=m;y=new WeakMap,E=new WeakMap,c(O,y,"/api/v1/enrichments"),c(O,E,"/api/v1/enrichment-values");o();var I,R=class extends p{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(r(R,I),{...e,projectId:t});return await this.apiClient(i)}},N=R;I=new WeakMap,c(N,I,"/api/v2/manifest");o();var d,C=class extends p{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(r(C,d),{...e,projectId:t});return await this.apiClient(i)}async upsert(e){let t=this.createUrl(r(C,d));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let t=this.createUrl(r(C,d));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},S=C;d=new WeakMap,c(S,d,"/api/v2/quirk");o();var g,U=class extends p{constructor(e){super(e)}async get(e){let{projectId:t}=this.options,i=this.createUrl(r(U,g),{...e,projectId:t});return await this.apiClient(i)}async upsert(e){let t=this.createUrl(r(U,g));await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async remove(e){let t=this.createUrl(r(U,g));await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}},k=U;g=new WeakMap,c(k,g,"/api/v2/signal");export{T as a,x as b,p as c,w as d,O as e,N as f,S as g,k as h};
|
@@ -0,0 +1 @@
|
|
1
|
+
var a=Object.create;var i=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var s=(t,e,o)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var _=t=>i(t,"__esModule",{value:!0});var x=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,o)=>(typeof require!="undefined"?require:e)[o]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var d=(t,e)=>()=>(t&&(e=t(t=0)),e);var u=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var g=(t,e,o,m)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of c(e))!l.call(t,r)&&(o||r!=="default")&&i(t,r,{get:()=>e[r],enumerable:!(m=p(e,r))||m.enumerable});return t},D=(t,e)=>g(_(i(t!=null?a(f(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var F=(t,e,o)=>(s(t,typeof e!="symbol"?e+"":e,o),o),n=(t,e,o)=>{if(!e.has(t))throw TypeError("Cannot "+o)};var L=(t,e,o)=>(n(t,e,"read from private field"),o?o.call(t):e.get(t)),P=(t,e,o)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,o)},R=(t,e,o,m)=>(n(t,e,"write to private field"),m?m.call(t,o):e.set(t,o),o);var T=(t,e,o)=>(n(t,e,"access private method"),o);var h=d(()=>{});export{x as a,u as b,D as c,F as d,L as e,P as f,R as g,T as h,h as i};
|