@toa.io/extensions.configuration 1.0.0-alpha.30 → 1.0.0-alpha.301
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/components/configuration.values/manifest.toa.yaml +151 -0
- package/components/configuration.values/migrations/0002-indexes.yaml +7 -0
- package/components/configuration.values/operations/create.js +32 -0
- package/components/configuration.values/operations/fetch.js +13 -0
- package/components/configuration.values/operations/get.js +19 -0
- package/components/configuration.values/operations/lib/map.js +22 -0
- package/components/configuration.values/operations/lib/resolve.js +24 -0
- package/components/configuration.values/operations/list.js +11 -0
- package/components/configuration.values/source/create.ts +56 -0
- package/components/configuration.values/source/fetch.ts +26 -0
- package/components/configuration.values/source/get.ts +32 -0
- package/components/configuration.values/source/lib/map.ts +36 -0
- package/components/configuration.values/source/lib/resolve.ts +57 -0
- package/components/configuration.values/source/list.ts +21 -0
- package/components/configuration.values/tsconfig.json +10 -0
- package/components/configuration.values/types/index.d.ts +3 -0
- package/components/configuration.values/types/toa.d.ts +69 -0
- package/package.json +21 -10
- package/readme.md +178 -50
- package/transpiled/Aspect.d.ts +19 -4
- package/transpiled/Aspect.js +62 -9
- package/transpiled/Aspect.js.map +1 -1
- package/transpiled/Client.d.ts +59 -0
- package/transpiled/Client.js +171 -0
- package/transpiled/Client.js.map +1 -0
- package/transpiled/Composition.d.ts +14 -0
- package/transpiled/Composition.js +38 -0
- package/transpiled/Composition.js.map +1 -0
- package/transpiled/Factory.d.ts +9 -2
- package/transpiled/Factory.js +20 -9
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/Secret.d.ts +15 -0
- package/transpiled/Secret.js +26 -0
- package/transpiled/Secret.js.map +1 -0
- package/transpiled/UI.d.ts +25 -0
- package/transpiled/UI.js +173 -0
- package/transpiled/UI.js.map +1 -0
- package/transpiled/configuration.d.ts +7 -2
- package/transpiled/configuration.js +33 -43
- package/transpiled/configuration.js.map +1 -1
- package/transpiled/index.d.ts +3 -3
- package/transpiled/index.js +4 -9
- package/transpiled/index.js.map +1 -1
- package/ui/dist/_app/env.js +1 -0
- package/ui/dist/_app/immutable/assets/0.BGFdDICE.css +2 -0
- package/ui/dist/_app/immutable/assets/ui.BghF56l_.css +1 -0
- package/ui/dist/_app/immutable/chunks/6jxCYw_T.js +1 -0
- package/ui/dist/_app/immutable/chunks/BG50_4wx.js +6 -0
- package/ui/dist/_app/immutable/chunks/Bjy-W4x2.js +81 -0
- package/ui/dist/_app/immutable/chunks/CVIujoKI.js +8 -0
- package/ui/dist/_app/immutable/chunks/CcD_ISxM.js +3 -0
- package/ui/dist/_app/immutable/chunks/leGVpEw7.js +1 -0
- package/ui/dist/_app/immutable/chunks/rNpgwZyw.js +50 -0
- package/ui/dist/_app/immutable/chunks/xihTtKlq.js +1 -0
- package/ui/dist/_app/immutable/entry/app.DlwFTf9j.js +2 -0
- package/ui/dist/_app/immutable/entry/start.C6URLbPE.js +1 -0
- package/ui/dist/_app/immutable/nodes/0.C0JuJXHr.js +1 -0
- package/ui/dist/_app/immutable/nodes/1.CZGho2uS.js +1 -0
- package/ui/dist/_app/immutable/nodes/2.BZCHVwVc.js +1 -0
- package/ui/dist/_app/immutable/nodes/3.B8dAiPmk.js +1 -0
- package/ui/dist/_app/immutable/nodes/4.Bf-vzTH8.js +1 -0
- package/ui/dist/_app/version.json +1 -0
- package/ui/dist/apple-touch-icon.png +0 -0
- package/ui/dist/favicon-96x96.png +0 -0
- package/ui/dist/favicon.ico +0 -0
- package/ui/dist/index.html +57 -0
- package/ui/dist/robots.txt +3 -0
- package/notes/consistency.md +0 -69
- package/schemas/annotation.cos.yaml +0 -1
- package/schemas/manifest.cos.yaml +0 -2
- package/source/Aspect.test.ts +0 -15
- package/source/Aspect.ts +0 -23
- package/source/Factory.ts +0 -12
- package/source/configuration.test.ts +0 -90
- package/source/configuration.ts +0 -59
- package/source/deployment.test.ts +0 -21
- package/source/deployment.ts +0 -86
- package/source/index.ts +0 -3
- package/source/manifest.test.ts +0 -15
- package/source/manifest.ts +0 -15
- package/source/schemas.ts +0 -9
- package/transpiled/Aspect.test.d.ts +0 -1
- package/transpiled/Aspect.test.js +0 -15
- package/transpiled/Aspect.test.js.map +0 -1
- package/transpiled/configuration.test.d.ts +0 -1
- package/transpiled/configuration.test.js +0 -64
- package/transpiled/configuration.test.js.map +0 -1
- package/transpiled/deployment.d.ts +0 -8
- package/transpiled/deployment.js +0 -88
- package/transpiled/deployment.js.map +0 -1
- package/transpiled/deployment.test.d.ts +0 -1
- package/transpiled/deployment.test.js +0 -18
- package/transpiled/deployment.test.js.map +0 -1
- package/transpiled/manifest.d.ts +0 -6
- package/transpiled/manifest.js +0 -35
- package/transpiled/manifest.js.map +0 -1
- package/transpiled/manifest.test.d.ts +0 -1
- package/transpiled/manifest.test.js +0 -14
- package/transpiled/manifest.test.js.map +0 -1
- package/transpiled/schemas.d.ts +0 -3
- package/transpiled/schemas.js +0 -33
- package/transpiled/schemas.js.map +0 -1
- package/transpiled/tsconfig.tsbuildinfo +0 -1
- package/tsconfig.json +0 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/.configuration/_app/immutable/nodes/0.C0JuJXHr.js","/.configuration/_app/immutable/chunks/CcD_ISxM.js","/.configuration/_app/immutable/chunks/6jxCYw_T.js","/.configuration/_app/immutable/chunks/xihTtKlq.js","/.configuration/_app/immutable/chunks/BG50_4wx.js","/.configuration/_app/immutable/chunks/leGVpEw7.js","/.configuration/_app/immutable/assets/0.BGFdDICE.css","/.configuration/_app/immutable/nodes/1.CZGho2uS.js","/.configuration/_app/immutable/nodes/2.BZCHVwVc.js","/.configuration/_app/immutable/chunks/rNpgwZyw.js","/.configuration/_app/immutable/chunks/CVIujoKI.js","/.configuration/_app/immutable/assets/ui.BghF56l_.css","/.configuration/_app/immutable/nodes/3.B8dAiPmk.js","/.configuration/_app/immutable/nodes/4.Bf-vzTH8.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as e,A as t,B as n,E as r,Et as i,H as a,J as o,P as s,Q as c,Y as l,bt as u,i as d,it as f,j as p,k as m,n as h,ot as g,q as _,r as v,s as y,st as b,tt as x,v as S,w as C,yt as w}from"../chunks/CcD_ISxM.js";import"../chunks/xihTtKlq.js";var T=`modulepreload`,E=function(e,t){return new URL(e,t).href},D={},O=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=E(t,n),t=s(t),t in D)return;D[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:T,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},k={},A=p(`<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>`),j=p(`<!> <!>`,1);function M(p,v){u(v,!0);let T=d(v,`components`,23,()=>[]),E=d(v,`data_0`,3,null),D=d(v,`data_1`,3,null),O=d(v,`data_2`,3,null);l(()=>v.stores.page.set(v.page)),o(()=>{v.stores,v.page,v.constructors,T(),v.form,E(),D(),O(),v.stores.page.notify()});let k=g(!1),M=g(!1),N=g(null);h(()=>{let e=v.stores.page.subscribe(()=>{n(k)&&(f(M,!0),a().then(()=>{f(N,document.title||`untitled page`,!0)}))});return f(k,!0),e});let P=b(()=>v.constructors[2]);var F=j(),I=e(F),L=r=>{let i=b(()=>v.constructors[0]);var a=t(),o=e(a);S(o,()=>n(i),(r,i)=>{y(i(r,{get data(){return E()},get form(){return v.form},get params(){return v.page.params},children:(r,i)=>{var a=t(),o=e(a),s=r=>{let i=b(()=>v.constructors[1]);var a=t(),o=e(a);S(o,()=>n(i),(r,i)=>{y(i(r,{get data(){return D()},get form(){return v.form},get params(){return v.page.params},children:(r,i)=>{var a=t(),o=e(a);S(o,()=>n(P),(e,t)=>{y(t(e,{get data(){return O()},get form(){return v.form},get params(){return v.page.params}}),e=>T()[2]=e,()=>T()?.[2])}),m(r,a)},$$slots:{default:!0}}),e=>T()[1]=e,()=>T()?.[1])}),m(r,a)},c=r=>{let i=b(()=>v.constructors[1]);var a=t(),o=e(a);S(o,()=>n(i),(e,t)=>{y(t(e,{get data(){return D()},get form(){return v.form},get params(){return v.page.params}}),e=>T()[1]=e,()=>T()?.[1])}),m(r,a)};C(o,e=>{v.constructors[2]?e(s):e(c,-1)}),m(r,a)},$$slots:{default:!0}}),e=>T()[0]=e,()=>T()?.[0])}),m(r,a)},R=r=>{let i=b(()=>v.constructors[0]);var a=t(),o=e(a);S(o,()=>n(i),(e,t)=>{y(t(e,{get data(){return E()},get form(){return v.form},get params(){return v.page.params}}),e=>T()[0]=e,()=>T()?.[0])}),m(r,a)};C(I,e=>{v.constructors[1]?e(L):e(R,-1)});var z=x(I,2),B=e=>{var t=A(),a=c(t),o=e=>{var t=s();_(()=>r(t,n(N))),m(e,t)};C(a,e=>{n(M)&&e(o)}),i(t),m(e,t)};C(z,e=>{n(k)&&e(B)}),m(p,F),w()}var N=v(M),P=[()=>O(()=>import(`../nodes/0.C0JuJXHr.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),()=>O(()=>import(`../nodes/1.CZGho2uS.js`),__vite__mapDeps([7,1,3,5,2]),import.meta.url),()=>O(()=>import(`../nodes/2.BZCHVwVc.js`),__vite__mapDeps([8,1,2,3,4,9,5,10,11]),import.meta.url),()=>O(()=>import(`../nodes/3.B8dAiPmk.js`),__vite__mapDeps([12,1,3,9,2,4]),import.meta.url),()=>O(()=>import(`../nodes/4.Bf-vzTH8.js`),__vite__mapDeps([13,1,2,3,4,9,5,10,11]),import.meta.url)],F=[],I={"/(private)":[3,[2]],"/(private)/[component]":[4,[2]]},L={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},R=Object.fromEntries(Object.entries(L.transport).map(([e,t])=>[e,t.decode])),z=Object.fromEntries(Object.entries(L.transport).map(([e,t])=>[e,t.encode])),B=!1,V=(e,t)=>R[e](t),H=()=>O(()=>import(`../chunks/Bjy-W4x2.js`).then(e=>e.default),[],import.meta.url);export{V as decode,R as decoders,I as dictionary,z as encoders,H as get_error_template,B as hash,L as hooks,k as matchers,P as nodes,N as root,F as server_loads};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e,r as t}from"../chunks/6jxCYw_T.js";export{e as load_css,t as start};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,A as t,B as n,G as r,J as i,X as a,bt as o,d as s,dt as c,g as l,ht as u,j as d,jt as f,k as p,q as m,st as h,ut as g,y as _,yt as v}from"../chunks/CcD_ISxM.js";import{n as y}from"../chunks/6jxCYw_T.js";import"../chunks/xihTtKlq.js";import{C as b,S as x,T as S,b as C,o as w,r as T,t as E,v as D,w as O,y as k}from"../chunks/BG50_4wx.js";import{t as A}from"../chunks/leGVpEw7.js";var j=x();j.on(`*`,(e,t)=>{t===void 0?console.debug(e):console.debug(e,t)});var M=u({status:`disconnected`,events:[]});j.on(`*`,(e,t)=>{M.update(n=>(n.events.push({label:e,payload:t}),n.events=n.events.slice(-128),n))});function N(e){M.update(t=>(t.status=e,(e===`connected`||e===`disconnected`)&&t.events.push({label:e}),t))}function P(){M.update(()=>({status:`disconnected`,events:[]}))}var F=k.resource(`/presence/`);async function I(e,t){return await F.multipart(e,{credentials:`include`,...t})}var L=null,R=null;async function z(e){if(L!==null&&L!==e&&V(),L!==e)for(L=e;L===e;){N(`connecting`);let t=await B(e).catch(e=>e);t!==void 0&&(t.name===`AbortError`?console.debug(`Realtime connection aborted`):(console.warn(`Realtime connection exception`,t),await new Promise(e=>setTimeout(e,3e3))))}}async function B(e){R=new AbortController;let t=R.signal,n=Intl.DateTimeFormat().resolvedOptions().timeZone,r=await I(e,{signal:t,body:{timezone:n}});if(r instanceof Error)throw N(`disconnected`),r;console.debug(`Realtime connected`,e),N(`connected`);for await(let e of r)H(e);console.debug(`Realtime connection lost`,e)}function V(){if(L!==null){if(L=null,R===null)throw Error(`Realtime controller is NULL`);R.abort(),P()}}function H(e){typeof e==`string`?j.emit(`heartbeat`):j.emit(e.event,e.data)}function U(){O.subscribe(e=>{let t=b.extract();e?z(t.id):V()})}function W(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return atob(t.padEnd(t.length+(4-t.length%4)%4,`=`))}function G(){let e=T(`challenge`);return e===null?null:W(e)}function K(){k.events.on(`challenge`,e=>S.set(e)),k.events.on(`error`,e=>{e.code===401&&S.set(null)}),S.subscribe(e=>k.authenticate(e));let e=G();e!==null&&S.set(e),D()}var q=f({prerender:()=>!1,ssr:()=>!1,trailingSlash:()=>J});K(),U();var J=`always`,Y=d(`<meta name="description"/>`);function X(u,d){o(d,!0);let f=()=>c(E,`$dict`,b),[b,x]=g(),S=h(()=>A.data.meta?.title??C.title),T=h(()=>A.data.meta?.description??C.description);y(w),i(()=>{document.dir=f().dir});var D=t();l(`12qhfyh`,e=>{var t=Y();m(()=>s(t,`content`,n(T))),r(()=>{a.title=n(S)??``}),p(e,t)});var O=e(D);_(O,()=>d.children),p(u,D),v(),x()}export{X as component,q as universal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,E as t,bt as n,et as r,j as i,k as a,q as o,tt as s,yt as c}from"../chunks/CcD_ISxM.js";import"../chunks/xihTtKlq.js";import{t as l}from"../chunks/leGVpEw7.js";var u=i(`<h1> </h1> <p> </p>`,1);function d(i,d){n(d,!0);var f=u(),p=e(f),m=r(p,!0),h=s(p,2),g=r(h,!0);o(()=>{t(m,l.status),t(g,l.error?.message)}),a(i,f),c()}export{d as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,A as t,B as n,Dt as r,E as i,Et as a,L as o,P as s,Q as c,Tt as l,Z as u,a as d,bt as f,d as p,dt as m,et as h,ft as g,i as _,it as v,j as y,k as b,lt as x,o as S,ot as C,q as w,s as T,st as E,tt as D,u as O,ut as k,y as A,yt as j}from"../chunks/CcD_ISxM.js";import{c as M,n as N}from"../chunks/6jxCYw_T.js";import"../chunks/xihTtKlq.js";import{b as P,h as F,i as I,j as L,t as R}from"../chunks/BG50_4wx.js";import{H as z,W as B,o as V,s as H}from"../chunks/rNpgwZyw.js";import{t as U}from"../chunks/leGVpEw7.js";import{i as W,n as G,r as K,t as q}from"../chunks/CVIujoKI.js";var J=new Set([`$$slots`,`$$events`,`$$legacy`]);function Y(e,t){let n=d(t,J),r=[[`path`,{d:`m21 21-4.34-4.34`}],[`circle`,{cx:`11`,cy:`11`,r:`8`}]];L(e,S({name:`search`},()=>n,{get iconNode(){return r}}))}var X=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),Z=y(`<kbd><!></kbd>`);function Q(e,t){f(t,!0);let n=_(t,`ref`,15,null),i=d(t,X);var o=Z();O(o,e=>({"data-slot":`kbd`,class:e,...i}),[()=>B(`h-5 w-fit min-w-5 gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3 pointer-events-none inline-flex items-center justify-center select-none`,t.class)]);var s=c(o);A(s,()=>t.children??r),a(o),T(o,e=>n(e),()=>n()),b(e,o),j()}var $=y(`<div class="flex h-dvh flex-col"><header class="flex items-center gap-4 px-4 py-3" style="view-transition-name: chrome"><div class="hidden flex-1 items-center gap-4 md:flex"><h1 class="min-w-0 truncate text-lg font-medium"><a id="nav-home-link" class="hover:text-muted-foreground transition-colors"> </a></h1></div> <div class="relative w-full max-w-64 min-w-0 shrink"><!> <!> <!></div> <div class="flex flex-1 justify-end"><!></div></header> <main class="min-h-0 flex-1"><!></main></div>`);function ee(r,d){f(d,!0);let _=()=>m(V,`$only`,T),y=()=>m(H,`$query`,T),S=()=>m(R,`$dict`,T),[T,O]=k(),L=E(()=>U.url.pathname===M+`/`?`.`:`..`);N(()=>H.set(``));let B=C(null);function J(e){e.key===`Enter`&&_()?.()}function X(e){e.key===`k`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),n(B)?.focus(),n(B)?.select())}o(`keydown`,u,X),G(r,{children:(r,o)=>{var u=$(),f=c(u),m=c(f),_=c(m),C=c(_),T=h(C,!0);a(_),a(m);var E=D(m,2),O=c(E);Y(O,{class:`text-muted-foreground pointer-events-none absolute start-2.5 top-1/2 size-3.5 -translate-y-1/2`});var k=D(O,2);K(k,{id:`nav-filter-input`,type:`search`,onkeydown:J,get"aria-label"(){return S().nav.filter},class:`ps-8 pe-3 md:pe-14 [&::-webkit-search-cancel-button]:hidden`,get ref(){return n(B)},set ref(e){v(B,e,!0)},get value(){return x(),y()},set value(e){g(H,e)}}),Q(D(k,2),{class:`absolute end-2 top-1/2 hidden -translate-y-1/2 md:inline-flex`,children:(e,t)=>{l();var n=s();w(()=>i(n,I?`⌘K`:`Ctrl K`)),b(e,n)},$$slots:{default:!0}}),a(E);var j=D(E,2),M=c(j);z(M,{id:`iam-logout-button`,variant:`ghost`,size:`icon`,get"aria-label"(){return S().nav.signout},class:`text-destructive hover:text-destructive`,get onclick(){return F},children:(e,t)=>{W(e,{})},$$slots:{default:!0}}),a(j),a(f);var N=D(f,2),R=c(N);q(R,{role:`system:configuration:get`,children:(n,r)=>{var i=t(),a=e(i);A(a,()=>d.children),b(n,i)},$$slots:{default:!0}}),a(N),a(u),w(()=>{p(C,`href`,n(L)),i(T,P.title)}),b(r,u)},$$slots:{default:!0}}),j(),O()}export{ee as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Et as e,Q as t,j as n,k as r}from"../chunks/CcD_ISxM.js";import"../chunks/xihTtKlq.js";import{r as i}from"../chunks/rNpgwZyw.js";var a=n(`<div class="mx-auto h-full max-w-7xl overflow-auto px-4 pb-12"><!></div>`);function o(n){var o=a(),s=t(o);i(s,{}),e(o),r(n,o)}export{o as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,A as t,B as n,Dt as r,E as i,Et as a,Q as o,a as s,bt as c,d as l,dt as u,et as d,j as f,k as p,o as m,q as h,st as g,tt as _,ut as v,w as y,yt as b}from"../chunks/CcD_ISxM.js";import{c as x}from"../chunks/6jxCYw_T.js";import"../chunks/xihTtKlq.js";import{j as S,k as C}from"../chunks/BG50_4wx.js";import{c as w,i as T,l as E,n as D,t as O}from"../chunks/rNpgwZyw.js";import{t as k}from"../chunks/leGVpEw7.js";import{t as A}from"../chunks/CVIujoKI.js";var j=new Set([`$$slots`,`$$events`,`$$legacy`]);function M(e,t){let n=s(t,j),r=[[`path`,{d:`m15 18-6-6 6-6`}]];S(e,m({name:`chevron-left`},()=>n,{get iconNode(){return r}}))}var N=f(`<span class="text-muted-foreground"> </span>`),P=f(`<!> <p class="text-muted-foreground mt-2 text-center font-mono text-xs"> </p>`,1),F=f(`<p class="text-muted-foreground py-20 text-center"> </p>`),I=f(`<p class="text-destructive py-20 text-center"> </p>`),L=f(`<div class="mx-auto h-full max-w-2xl overflow-auto px-4 pb-12"><div class="flex items-center gap-2 py-2"><a id="configuration-back-link" class="text-muted-foreground hover:text-foreground -ms-1 rounded-md p-1 transition-colors"><!></a> <h2 class="min-w-0 truncate font-medium"><!> </h2> <div class="ms-auto"><!></div></div> <!></div>`);function R(s,f){c(f,!0);let m=()=>u(T,`$dict`,S),[S,j]=v(),R=g(()=>k.params.component??``),z=g(()=>E.get(n(R))),B=g(()=>w(n(R)));function V(e){return`code`in e&&e.code===404}var H=L(),U=o(H),W=o(U);M(o(W),{class:`size-4`}),a(W);var G=_(W,2),K=o(G),q=e=>{var t=N(),r=d(t);h(()=>i(r,`${n(B).namespace??``}.`)),p(e,t)};y(K,e=>{n(B).namespace!=="default"&&e(q)});var J=_(K,1,!0);a(G);var Y=_(G,2),X=o(Y);C(X,{get store(){return n(z)},silent:!0,awaited:(e,t=r)=>{A(e,{role:`system:configuration:create`,denied:e=>{},children:(e,n)=>{O(e,{get configuration(){return t()}})},$$slots:{denied:!0,default:!0}})},$$slots:{awaited:!0}}),a(Y),a(U);var Z=_(U,2);C(Z,{get store(){return n(z)},awaited:(t,n=r)=>{var a=P(),o=e(a);D(o,{get value(){return n().configuration}});var s=_(o,2),c=d(s,!0);h(()=>i(c,n().epoch)),p(t,a)},error:(a,o=r)=>{var s=t(),c=e(s),l=e=>{var t=F(),n=d(t,!0);h(()=>i(n,m().value.none)),p(e,t)},u=g(()=>V(o())),f=e=>{var t=I(),n=d(t,!0);h(()=>i(n,o().message)),p(e,t)};y(c,e=>{n(u)?e(l):e(f,-1)}),p(a,s)},$$slots:{awaited:!0,error:!0}}),a(H),h(()=>{l(W,`href`,`${x??``}/`),l(W,`aria-label`,m().value.title),i(J,n(B).component)}),p(s,H),b(),j()}export{R as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"1789138353083"}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html translate="no" lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<meta name="robots" content="noindex,nofollow" />
|
|
7
|
+
<meta name="google" content="notranslate" />
|
|
8
|
+
|
|
9
|
+
<!-- `/.configuration`, so they resolve under the path the page is mounted at -->
|
|
10
|
+
<link rel="icon" href="/.configuration/favicon.ico" sizes="32x32" />
|
|
11
|
+
<link
|
|
12
|
+
rel="icon"
|
|
13
|
+
href="/.configuration/favicon-96x96.png"
|
|
14
|
+
type="image/png"
|
|
15
|
+
sizes="96x96"
|
|
16
|
+
/>
|
|
17
|
+
<link rel="apple-touch-icon" href="/.configuration/apple-touch-icon.png" />
|
|
18
|
+
|
|
19
|
+
<link href="/.configuration/_app/immutable/entry/start.C6URLbPE.js" rel="modulepreload">
|
|
20
|
+
<link href="/.configuration/_app/immutable/chunks/6jxCYw_T.js" rel="modulepreload">
|
|
21
|
+
<link href="/.configuration/_app/immutable/chunks/CcD_ISxM.js" rel="modulepreload">
|
|
22
|
+
<link href="/.configuration/_app/immutable/entry/app.DlwFTf9j.js" rel="modulepreload">
|
|
23
|
+
<link href="/.configuration/_app/immutable/chunks/xihTtKlq.js" rel="modulepreload">
|
|
24
|
+
<link href="/.configuration/_app/immutable/nodes/0.C0JuJXHr.js" rel="modulepreload">
|
|
25
|
+
<link href="/.configuration/_app/immutable/chunks/BG50_4wx.js" rel="modulepreload">
|
|
26
|
+
<link href="/.configuration/_app/immutable/chunks/leGVpEw7.js" rel="modulepreload">
|
|
27
|
+
<link href="/.configuration/_app/env.js" rel="modulepreload">
|
|
28
|
+
|
|
29
|
+
<link href="/.configuration/_app/immutable/assets/0.BGFdDICE.css" rel="stylesheet">
|
|
30
|
+
</head>
|
|
31
|
+
<body data-sveltekit-preload-data="hover">
|
|
32
|
+
<div style="display: contents">
|
|
33
|
+
<script>
|
|
34
|
+
{
|
|
35
|
+
__sveltekit_192vbzq = {
|
|
36
|
+
base: "/.configuration",
|
|
37
|
+
assets: "/.configuration",
|
|
38
|
+
env: null
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const element = document.currentScript.parentElement;
|
|
42
|
+
|
|
43
|
+
import("/.configuration/_app/env.js").then(({ env }) => {
|
|
44
|
+
__sveltekit_192vbzq.env = env;
|
|
45
|
+
|
|
46
|
+
Promise.all([
|
|
47
|
+
import("/.configuration/_app/immutable/entry/start.C6URLbPE.js"),
|
|
48
|
+
import("/.configuration/_app/immutable/entry/app.DlwFTf9j.js")
|
|
49
|
+
]).then(([kit, app]) => {
|
|
50
|
+
kit.start(app, element);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
</script>
|
|
55
|
+
</div>
|
|
56
|
+
</body>
|
|
57
|
+
</html>
|
package/notes/consistency.md
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# Configuration Consistency
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
## Problem Definition
|
|
6
|
-
|
|
7
|
-
At arbitrary moments when the configuration has changed, some distributed operations have started
|
|
8
|
-
but haven't yet
|
|
9
|
-
finished. This leads to operations that start with certain configuration values but will finish with
|
|
10
|
-
another, which may
|
|
11
|
-
result in logical problems.
|
|
12
|
-
|
|
13
|
-
Given that distributed operations may have arbitrary participants and last for an arbitrary period,
|
|
14
|
-
there is no such
|
|
15
|
-
single moment when configuration can be safely changed. Thus, it must be a process.
|
|
16
|
-
|
|
17
|
-
## ~~Not a~~ Solution
|
|
18
|
-
|
|
19
|
-
1. Configuration is a single versioned object.
|
|
20
|
-
2. Configuration version value is included in the Uniform Communication Interface.
|
|
21
|
-
3. The first distributed operation participant (which is the one who has received a UCI without the
|
|
22
|
-
configuration
|
|
23
|
-
version value) must include in the outgoing UCI the configuration version value that it considers
|
|
24
|
-
as current.
|
|
25
|
-
4. Non-first distributed operations participants (which is those who has received a UCI with the
|
|
26
|
-
configuration version
|
|
27
|
-
value) must use the configuration version specified in the UCI.
|
|
28
|
-
5. Non-first distributed operation participants must include in the outgoing UCI the same
|
|
29
|
-
configuration version value as
|
|
30
|
-
they received in the incoming.
|
|
31
|
-
|
|
32
|
-
## Restrictions
|
|
33
|
-
|
|
34
|
-
1. Configuration updates are always backward compatible.
|
|
35
|
-
2. Configuration updates are always being delivered before algorithm updates.
|
|
36
|
-
1. Including federated deployment, that is: first deliver configuration to all facilities (data
|
|
37
|
-
centers, zones,
|
|
38
|
-
whatever), then deliver algorithm updates.
|
|
39
|
-
3. Configuration storage and access solution must provide the transactional updates, that is if any
|
|
40
|
-
arbitrary
|
|
41
|
-
participant observed a certain configuration version, then any other participant is guaranteed to
|
|
42
|
-
be able to
|
|
43
|
-
subsequently observe that version.
|
|
44
|
-
1. Including federated deployment[^1].
|
|
45
|
-
|
|
46
|
-
## Solution
|
|
47
|
-
|
|
48
|
-
The configuration compatibility problem described above is a particular case of a common
|
|
49
|
-
compatibility problem for
|
|
50
|
-
distributed operation participants. It is not the only configuration that may change while a
|
|
51
|
-
distributed operation is
|
|
52
|
-
running, but participant algorithms themselves. This leads to the conclusion that this particular
|
|
53
|
-
solution must be
|
|
54
|
-
propagated to algorithm versions, that is: which system (as a set of algorithms and configuration)
|
|
55
|
-
version was used to
|
|
56
|
-
start the operation, and that system version must be used to finish the operation.
|
|
57
|
-
|
|
58
|
-
This kind of solution results in the need to run all versions of the system with appropriate message
|
|
59
|
-
routing. The
|
|
60
|
-
implementation complexity of this solution and its operations costs are considered unreasonable.
|
|
61
|
-
However, an attempt
|
|
62
|
-
will be made to implement this solution with a certain
|
|
63
|
-
constraints [#147](https://github.com/toa-io/toa/issues/147).
|
|
64
|
-
|
|
65
|
-
[^1]: Since it looks like there is no reasonable way to provide this kind of guarantee without
|
|
66
|
-
significant performance
|
|
67
|
-
and/or availability impact, it may be implemented as a mechanism with read retries and with a
|
|
68
|
-
timeout considered as
|
|
69
|
-
“enough for the most of fail-over scenarios”.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<object>
|
package/source/Aspect.test.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Aspect } from './Aspect'
|
|
2
|
-
|
|
3
|
-
it('should return value', async () => {
|
|
4
|
-
const configuration = {
|
|
5
|
-
foo: 'bar',
|
|
6
|
-
bar: {
|
|
7
|
-
baz: 'quux'
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const aspect = new Aspect(configuration)
|
|
12
|
-
|
|
13
|
-
expect(aspect.invoke(['foo'])).toStrictEqual(configuration.foo)
|
|
14
|
-
expect(aspect.invoke(['bar', 'baz'])).toStrictEqual(configuration.bar.baz)
|
|
15
|
-
})
|
package/source/Aspect.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Connector, type extensions } from '@toa.io/core'
|
|
2
|
-
|
|
3
|
-
export class Aspect extends Connector implements extensions.Aspect {
|
|
4
|
-
public readonly name = 'configuration'
|
|
5
|
-
|
|
6
|
-
private readonly value: object
|
|
7
|
-
|
|
8
|
-
public constructor (value: object) {
|
|
9
|
-
super()
|
|
10
|
-
|
|
11
|
-
this.value = value
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
public invoke (path: string[]): any {
|
|
15
|
-
let cursor: any = this.value
|
|
16
|
-
|
|
17
|
-
if (path !== undefined)
|
|
18
|
-
for (const segment of path)
|
|
19
|
-
cursor = cursor[segment]
|
|
20
|
-
|
|
21
|
-
return cursor
|
|
22
|
-
}
|
|
23
|
-
}
|
package/source/Factory.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type Locator, type extensions } from '@toa.io/core'
|
|
2
|
-
import { Aspect } from './Aspect'
|
|
3
|
-
import { type Manifest } from './manifest'
|
|
4
|
-
import { get } from './configuration'
|
|
5
|
-
|
|
6
|
-
export class Factory implements extensions.Factory {
|
|
7
|
-
public aspect (locator: Locator, manifest: Manifest): extensions.Aspect {
|
|
8
|
-
const value = get(locator, manifest)
|
|
9
|
-
|
|
10
|
-
return new Aspect(value)
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { encode } from '@toa.io/generic'
|
|
2
|
-
import { Locator } from '@toa.io/core'
|
|
3
|
-
import { generate } from 'randomstring'
|
|
4
|
-
import { get } from './configuration'
|
|
5
|
-
import { type Manifest } from './manifest'
|
|
6
|
-
|
|
7
|
-
let locator: Locator
|
|
8
|
-
let manifest: Manifest
|
|
9
|
-
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
locator = new Locator(generate(), generate())
|
|
12
|
-
manifest = { schema: { foo: 'string' } }
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
afterEach(() => {
|
|
16
|
-
for (const name of used)
|
|
17
|
-
delete process.env[name]
|
|
18
|
-
|
|
19
|
-
used = []
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
it('should read value', async () => {
|
|
23
|
-
manifest.schema = { foo: 'string' }
|
|
24
|
-
|
|
25
|
-
const value: object = { foo: generate() }
|
|
26
|
-
|
|
27
|
-
set(value)
|
|
28
|
-
|
|
29
|
-
const result = get(locator, manifest)
|
|
30
|
-
|
|
31
|
-
expect(result).toStrictEqual(value)
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
it('should return empty object if no value set', async () => {
|
|
35
|
-
expect(get(locator, manifest)).toStrictEqual({})
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
it('should substitute secrets', async () => {
|
|
39
|
-
const value: object = { foo: '$BAR' }
|
|
40
|
-
|
|
41
|
-
set(value)
|
|
42
|
-
set('bar', '_BAR')
|
|
43
|
-
|
|
44
|
-
const result = get(locator, manifest)
|
|
45
|
-
|
|
46
|
-
expect(result).toStrictEqual({ foo: 'bar' })
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
it('should use defaults', async () => {
|
|
50
|
-
manifest.schema = { foo: 'string', bar: ['number'], 'baz?': 'string' }
|
|
51
|
-
manifest.defaults = { foo: 'bar', bar: [1] }
|
|
52
|
-
|
|
53
|
-
const values = { bar: [2], baz: 'foo' }
|
|
54
|
-
|
|
55
|
-
set(values)
|
|
56
|
-
|
|
57
|
-
const result = get(locator, manifest)
|
|
58
|
-
|
|
59
|
-
expect(result).toStrictEqual({
|
|
60
|
-
foo: 'bar',
|
|
61
|
-
bar: [2],
|
|
62
|
-
baz: 'foo'
|
|
63
|
-
})
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
it('should validate', async () => {
|
|
67
|
-
manifest.schema = { foo: 'hello', bar: 'number' }
|
|
68
|
-
|
|
69
|
-
const values = { bar: 5 }
|
|
70
|
-
|
|
71
|
-
set(values)
|
|
72
|
-
|
|
73
|
-
const result = get(locator, manifest)
|
|
74
|
-
|
|
75
|
-
expect(result).toStrictEqual({
|
|
76
|
-
foo: 'hello',
|
|
77
|
-
bar: 5
|
|
78
|
-
})
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
function set (value: object | string, key = locator.uppercase): void {
|
|
82
|
-
const string = typeof value === 'string' ? value : encode(value)
|
|
83
|
-
const name = 'TOA_CONFIGURATION_' + key
|
|
84
|
-
|
|
85
|
-
process.env[name] = string
|
|
86
|
-
|
|
87
|
-
used.push(name)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
let used: string[] = []
|
package/source/configuration.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { type Locator } from '@toa.io/core'
|
|
2
|
-
import { decode, add } from '@toa.io/generic'
|
|
3
|
-
import * as schemas from '@toa.io/schemas'
|
|
4
|
-
import { PREFIX, SECRET_RX } from './deployment'
|
|
5
|
-
import { type Manifest } from './manifest'
|
|
6
|
-
import type { Schema } from '@toa.io/schemas'
|
|
7
|
-
|
|
8
|
-
export function get (locator: Locator, manifest: Manifest): Node {
|
|
9
|
-
const values = getConfiguration(locator.uppercase)
|
|
10
|
-
|
|
11
|
-
substituteSecrets(values)
|
|
12
|
-
|
|
13
|
-
if (manifest.defaults !== undefined)
|
|
14
|
-
add(values, manifest.defaults)
|
|
15
|
-
|
|
16
|
-
const schema: Schema<any> = schemas.schema(manifest.schema)
|
|
17
|
-
|
|
18
|
-
schema.validate(values)
|
|
19
|
-
|
|
20
|
-
return values
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function getConfiguration (suffix: string): Node {
|
|
24
|
-
const variable = PREFIX + suffix
|
|
25
|
-
const string = process.env[variable]
|
|
26
|
-
|
|
27
|
-
if (string === undefined)
|
|
28
|
-
return {}
|
|
29
|
-
else
|
|
30
|
-
return decode(string)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function substituteSecrets (configuration: Node): void {
|
|
34
|
-
for (const [key, value] of Object.entries(configuration)) {
|
|
35
|
-
if (typeof value === 'object' && value !== null)
|
|
36
|
-
substituteSecrets(value as Node)
|
|
37
|
-
|
|
38
|
-
if (typeof value !== 'string') continue
|
|
39
|
-
|
|
40
|
-
const match = value.match(SECRET_RX)
|
|
41
|
-
|
|
42
|
-
if (match === null) continue
|
|
43
|
-
|
|
44
|
-
const name = match.groups?.variable
|
|
45
|
-
|
|
46
|
-
configuration[key] = getSecret(name!)
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function getSecret (name: string): string {
|
|
51
|
-
const variable = PREFIX + '_' + name
|
|
52
|
-
const value = process.env[variable]
|
|
53
|
-
|
|
54
|
-
if (value === undefined) throw new Error(`${variable} is not set.`)
|
|
55
|
-
|
|
56
|
-
return value
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export type Node = Record<string, unknown>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type Annotation, deployment, type Instance } from './deployment'
|
|
2
|
-
import { type Manifest } from './manifest'
|
|
3
|
-
|
|
4
|
-
it('should validate annotation', async () => {
|
|
5
|
-
const wrongType = 'not ok' as unknown as Annotation
|
|
6
|
-
|
|
7
|
-
expect(() => deployment([], wrongType)).toThrow('object')
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
it('should validate values', async () => {
|
|
11
|
-
const manifest: Manifest = {
|
|
12
|
-
schema: { foo: 'string', bar: 'number' },
|
|
13
|
-
defaults: { foo: 'ok', bar: 0 }
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const locator = { id: 'component' }
|
|
17
|
-
const instances = [{ manifest, locator }] as unknown as Instance[]
|
|
18
|
-
const annotation: Annotation = { [locator.id]: { bar: 'not a number' } }
|
|
19
|
-
|
|
20
|
-
expect(() => deployment(instances, annotation)).toThrow('number')
|
|
21
|
-
})
|
package/source/deployment.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert'
|
|
2
|
-
import { type Dependency, type Variable, type Variables } from '@toa.io/operations'
|
|
3
|
-
import * as schemas from '@toa.io/schemas'
|
|
4
|
-
import { encode, overwrite } from '@toa.io/generic'
|
|
5
|
-
import { type Manifest } from './manifest'
|
|
6
|
-
import * as validators from './schemas'
|
|
7
|
-
import type { Schema } from '@toa.io/schemas'
|
|
8
|
-
import type { context } from '@toa.io/norm'
|
|
9
|
-
|
|
10
|
-
export function deployment (instances: Instance[], annotation: Annotation = {}): Dependency {
|
|
11
|
-
validate(annotation, instances)
|
|
12
|
-
|
|
13
|
-
const variables: Variables = {}
|
|
14
|
-
|
|
15
|
-
for (const instance of instances) {
|
|
16
|
-
const values = annotation[instance.locator.id]
|
|
17
|
-
|
|
18
|
-
validateInstance(instance, values)
|
|
19
|
-
|
|
20
|
-
if (values === undefined) continue
|
|
21
|
-
|
|
22
|
-
variables[instance.locator.label] = [{
|
|
23
|
-
name: PREFIX + instance.locator.uppercase,
|
|
24
|
-
value: encode(values)
|
|
25
|
-
}]
|
|
26
|
-
|
|
27
|
-
const secrets = createSecrets(values)
|
|
28
|
-
|
|
29
|
-
variables[instance.locator.label].push(...secrets)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return { variables }
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function createSecrets (values: object): Variable[] {
|
|
36
|
-
const secrets: Variable[] = []
|
|
37
|
-
|
|
38
|
-
for (const value of Object.values(values)) {
|
|
39
|
-
if (typeof value === 'object' && value !== null)
|
|
40
|
-
secrets.push(...createSecrets(value as object))
|
|
41
|
-
|
|
42
|
-
if (typeof value !== 'string') continue
|
|
43
|
-
|
|
44
|
-
const match = value.match(SECRET_RX)
|
|
45
|
-
|
|
46
|
-
if (match === null) continue
|
|
47
|
-
|
|
48
|
-
const name = match.groups?.variable
|
|
49
|
-
|
|
50
|
-
assert.ok(name !== undefined)
|
|
51
|
-
|
|
52
|
-
secrets.push({
|
|
53
|
-
name: PREFIX + '_' + name,
|
|
54
|
-
secret: {
|
|
55
|
-
name: 'toa-configuration',
|
|
56
|
-
key: name
|
|
57
|
-
}
|
|
58
|
-
})
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return secrets
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function validate (annotation: Annotation, instances: Instance[]): void {
|
|
65
|
-
validators.annotation.validate(annotation)
|
|
66
|
-
|
|
67
|
-
const requested = instances.map((instance) => instance.locator.id)
|
|
68
|
-
|
|
69
|
-
for (const id of Object.keys(annotation))
|
|
70
|
-
assert.ok(requested.includes(id),
|
|
71
|
-
`Component '${id}' does not request configuration or does not exist.`)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function validateInstance (instace: Instance, values: object = {}): void {
|
|
75
|
-
const defaults = instace.manifest.defaults ?? {}
|
|
76
|
-
const configuration = overwrite(defaults, values)
|
|
77
|
-
const schema: Schema<any> = schemas.schema(instace.manifest.schema)
|
|
78
|
-
|
|
79
|
-
schema.validate(configuration)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export const SECRET_RX = /^\$(?<variable>[A-Z0-9_]{1,32})$/
|
|
83
|
-
export const PREFIX = 'TOA_CONFIGURATION_'
|
|
84
|
-
|
|
85
|
-
export type Annotation = Record<string, object>
|
|
86
|
-
export type Instance = context.Dependency<Manifest>
|
package/source/index.ts
DELETED
package/source/manifest.test.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type Manifest, manifest } from './manifest'
|
|
2
|
-
|
|
3
|
-
it('should validate', async () => {
|
|
4
|
-
const additional = { schema: {}, foo: 'bar' } as unknown as Manifest
|
|
5
|
-
|
|
6
|
-
expect(() => {
|
|
7
|
-
manifest(additional)
|
|
8
|
-
}).toThrow('not expected')
|
|
9
|
-
|
|
10
|
-
const wrongType = { schema: 'not ok' } as unknown as Manifest
|
|
11
|
-
|
|
12
|
-
expect(() => {
|
|
13
|
-
manifest(wrongType)
|
|
14
|
-
}).toThrow('object')
|
|
15
|
-
})
|
package/source/manifest.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as schemas from './schemas'
|
|
2
|
-
import { type Node } from './configuration'
|
|
3
|
-
|
|
4
|
-
export function manifest (manifest: Manifest): Manifest {
|
|
5
|
-
if (manifest.schema === undefined) manifest = { schema: manifest }
|
|
6
|
-
|
|
7
|
-
schemas.manifest.validate(manifest)
|
|
8
|
-
|
|
9
|
-
return manifest
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface Manifest {
|
|
13
|
-
schema: object
|
|
14
|
-
defaults?: Node
|
|
15
|
-
}
|
package/source/schemas.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { resolve } from 'node:path'
|
|
2
|
-
import * as schemas from '@toa.io/schemas'
|
|
3
|
-
import type { Schema } from '@toa.io/schemas'
|
|
4
|
-
|
|
5
|
-
const path = resolve(__dirname, '../schemas')
|
|
6
|
-
const namespace = schemas.namespace(path)
|
|
7
|
-
|
|
8
|
-
export const manifest: Schema<any> = namespace.schema('manifest')
|
|
9
|
-
export const annotation: Schema<any> = namespace.schema('annotation')
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const Aspect_1 = require("./Aspect");
|
|
4
|
-
it('should return value', async () => {
|
|
5
|
-
const configuration = {
|
|
6
|
-
foo: 'bar',
|
|
7
|
-
bar: {
|
|
8
|
-
baz: 'quux'
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
const aspect = new Aspect_1.Aspect(configuration);
|
|
12
|
-
expect(aspect.invoke(['foo'])).toStrictEqual(configuration.foo);
|
|
13
|
-
expect(aspect.invoke(['bar', 'baz'])).toStrictEqual(configuration.bar.baz);
|
|
14
|
-
});
|
|
15
|
-
//# sourceMappingURL=Aspect.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Aspect.test.js","sourceRoot":"","sources":["../source/Aspect.test.ts"],"names":[],"mappings":";;AAAA,qCAAiC;AAEjC,EAAE,CAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;IACnC,MAAM,aAAa,GAAG;QACpB,GAAG,EAAE,KAAK;QACV,GAAG,EAAE;YACH,GAAG,EAAE,MAAM;SACZ;KACF,CAAA;IAED,MAAM,MAAM,GAAG,IAAI,eAAM,CAAC,aAAa,CAAC,CAAA;IAExC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;IAC/D,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAC5E,CAAC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|