@uniformdev/context 12.2.1-alpha.184 → 14.2.1-alpha.34
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 +17 -1401
- package/dist/api/api.js +2 -2
- package/dist/api/api.mjs +1 -1
- package/dist/chunk-2QBWX3VO.mjs +2 -0
- package/dist/chunk-ORM4ZDHU.mjs +1 -0
- package/dist/{chunk-KZPEO35A.mjs → chunk-PZGIHZYO.mjs} +0 -0
- package/dist/cli/cli.d.ts +14 -1
- package/dist/cli/cli.js +63 -53
- package/dist/cli/cli.mjs +62 -52
- package/dist/contextTypes-7f24fc7c.d.ts +1534 -0
- package/dist/index.d.ts +3 -2
- 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 → types-6c6360c2.d.ts} +4 -285
- package/dist/v2-manifest.swagger-d0899723.d.ts +285 -0
- package/package.json +6 -19
- package/dist/chunk-GU2YFM6V.mjs +0 -1
- package/dist/chunk-JKQJOIRC.mjs +0 -2
package/dist/chunk-JKQJOIRC.mjs
DELETED
@@ -1,2 +0,0 @@
|
|
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};
|