@toa.io/extensions.configuration 1.0.0-alpha.3 → 1.0.0-alpha.300

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.
Files changed (104) hide show
  1. package/components/configuration.values/manifest.toa.yaml +151 -0
  2. package/components/configuration.values/migrations/0002-indexes.yaml +7 -0
  3. package/components/configuration.values/operations/create.js +32 -0
  4. package/components/configuration.values/operations/fetch.js +13 -0
  5. package/components/configuration.values/operations/get.js +19 -0
  6. package/components/configuration.values/operations/lib/map.js +22 -0
  7. package/components/configuration.values/operations/lib/resolve.js +24 -0
  8. package/components/configuration.values/operations/list.js +11 -0
  9. package/components/configuration.values/source/create.ts +56 -0
  10. package/components/configuration.values/source/fetch.ts +26 -0
  11. package/components/configuration.values/source/get.ts +32 -0
  12. package/components/configuration.values/source/lib/map.ts +36 -0
  13. package/components/configuration.values/source/lib/resolve.ts +57 -0
  14. package/components/configuration.values/source/list.ts +21 -0
  15. package/components/configuration.values/tsconfig.json +10 -0
  16. package/components/configuration.values/types/index.d.ts +3 -0
  17. package/components/configuration.values/types/toa.d.ts +69 -0
  18. package/package.json +21 -10
  19. package/readme.md +178 -50
  20. package/transpiled/Aspect.d.ts +19 -4
  21. package/transpiled/Aspect.js +62 -9
  22. package/transpiled/Aspect.js.map +1 -1
  23. package/transpiled/Client.d.ts +59 -0
  24. package/transpiled/Client.js +171 -0
  25. package/transpiled/Client.js.map +1 -0
  26. package/transpiled/Composition.d.ts +14 -0
  27. package/transpiled/Composition.js +38 -0
  28. package/transpiled/Composition.js.map +1 -0
  29. package/transpiled/Factory.d.ts +9 -2
  30. package/transpiled/Factory.js +20 -9
  31. package/transpiled/Factory.js.map +1 -1
  32. package/transpiled/Secret.d.ts +15 -0
  33. package/transpiled/Secret.js +26 -0
  34. package/transpiled/Secret.js.map +1 -0
  35. package/transpiled/UI.d.ts +25 -0
  36. package/transpiled/UI.js +173 -0
  37. package/transpiled/UI.js.map +1 -0
  38. package/transpiled/configuration.d.ts +8 -3
  39. package/transpiled/configuration.js +35 -48
  40. package/transpiled/configuration.js.map +1 -1
  41. package/transpiled/index.d.ts +3 -3
  42. package/transpiled/index.js +4 -9
  43. package/transpiled/index.js.map +1 -1
  44. package/ui/dist/_app/env.js +1 -0
  45. package/ui/dist/_app/immutable/assets/0.BGFdDICE.css +2 -0
  46. package/ui/dist/_app/immutable/assets/ui.BghF56l_.css +1 -0
  47. package/ui/dist/_app/immutable/chunks/BO-bVeya.js +1 -0
  48. package/ui/dist/_app/immutable/chunks/Bjy-W4x2.js +81 -0
  49. package/ui/dist/_app/immutable/chunks/CcD_ISxM.js +3 -0
  50. package/ui/dist/_app/immutable/chunks/ChuJmltc.js +1 -0
  51. package/ui/dist/_app/immutable/chunks/DLExbVxt.js +6 -0
  52. package/ui/dist/_app/immutable/chunks/DNBIBZfd.js +8 -0
  53. package/ui/dist/_app/immutable/chunks/DcYrQeF9.js +50 -0
  54. package/ui/dist/_app/immutable/chunks/xihTtKlq.js +1 -0
  55. package/ui/dist/_app/immutable/entry/app.C_BoZFMH.js +2 -0
  56. package/ui/dist/_app/immutable/entry/start.DGqZJFG-.js +1 -0
  57. package/ui/dist/_app/immutable/nodes/0.kGp6jAon.js +1 -0
  58. package/ui/dist/_app/immutable/nodes/1.B6GdKFoh.js +1 -0
  59. package/ui/dist/_app/immutable/nodes/2.B1yjjJQp.js +1 -0
  60. package/ui/dist/_app/immutable/nodes/3.Djrl0t8X.js +1 -0
  61. package/ui/dist/_app/immutable/nodes/4.DU-VoYDI.js +1 -0
  62. package/ui/dist/_app/version.json +1 -0
  63. package/ui/dist/apple-touch-icon.png +0 -0
  64. package/ui/dist/favicon-96x96.png +0 -0
  65. package/ui/dist/favicon.ico +0 -0
  66. package/ui/dist/index.html +57 -0
  67. package/ui/dist/robots.txt +3 -0
  68. package/notes/consistency.md +0 -69
  69. package/schemas/annotation.cos.yaml +0 -1
  70. package/schemas/manifest.cos.yaml +0 -2
  71. package/source/Aspect.test.ts +0 -15
  72. package/source/Aspect.ts +0 -23
  73. package/source/Factory.ts +0 -12
  74. package/source/configuration.test.ts +0 -90
  75. package/source/configuration.ts +0 -56
  76. package/source/deployment.test.ts +0 -21
  77. package/source/deployment.ts +0 -83
  78. package/source/index.ts +0 -3
  79. package/source/manifest.test.ts +0 -15
  80. package/source/manifest.ts +0 -15
  81. package/source/schemas.ts +0 -9
  82. package/transpiled/Aspect.test.d.ts +0 -1
  83. package/transpiled/Aspect.test.js +0 -15
  84. package/transpiled/Aspect.test.js.map +0 -1
  85. package/transpiled/configuration.test.d.ts +0 -1
  86. package/transpiled/configuration.test.js +0 -64
  87. package/transpiled/configuration.test.js.map +0 -1
  88. package/transpiled/deployment.d.ts +0 -8
  89. package/transpiled/deployment.js +0 -86
  90. package/transpiled/deployment.js.map +0 -1
  91. package/transpiled/deployment.test.d.ts +0 -1
  92. package/transpiled/deployment.test.js +0 -18
  93. package/transpiled/deployment.test.js.map +0 -1
  94. package/transpiled/manifest.d.ts +0 -6
  95. package/transpiled/manifest.js +0 -35
  96. package/transpiled/manifest.js.map +0 -1
  97. package/transpiled/manifest.test.d.ts +0 -1
  98. package/transpiled/manifest.test.js +0 -14
  99. package/transpiled/manifest.test.js.map +0 -1
  100. package/transpiled/schemas.d.ts +0 -3
  101. package/transpiled/schemas.js +0 -33
  102. package/transpiled/schemas.js.map +0 -1
  103. package/transpiled/tsconfig.tsbuildinfo +0 -1
  104. 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.kGp6jAon.js","/.configuration/_app/immutable/chunks/CcD_ISxM.js","/.configuration/_app/immutable/chunks/ChuJmltc.js","/.configuration/_app/immutable/chunks/xihTtKlq.js","/.configuration/_app/immutable/chunks/DLExbVxt.js","/.configuration/_app/immutable/chunks/BO-bVeya.js","/.configuration/_app/immutable/assets/0.BGFdDICE.css","/.configuration/_app/immutable/nodes/1.B6GdKFoh.js","/.configuration/_app/immutable/nodes/2.B1yjjJQp.js","/.configuration/_app/immutable/chunks/DcYrQeF9.js","/.configuration/_app/immutable/chunks/DNBIBZfd.js","/.configuration/_app/immutable/assets/ui.BghF56l_.css","/.configuration/_app/immutable/nodes/3.Djrl0t8X.js","/.configuration/_app/immutable/nodes/4.DU-VoYDI.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.kGp6jAon.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),()=>O(()=>import(`../nodes/1.B6GdKFoh.js`),__vite__mapDeps([7,1,3,5,2]),import.meta.url),()=>O(()=>import(`../nodes/2.B1yjjJQp.js`),__vite__mapDeps([8,1,2,3,4,9,5,10,11]),import.meta.url),()=>O(()=>import(`../nodes/3.Djrl0t8X.js`),__vite__mapDeps([12,1,3,9,2,4]),import.meta.url),()=>O(()=>import(`../nodes/4.DU-VoYDI.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/ChuJmltc.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/ChuJmltc.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/DLExbVxt.js";import{t as A}from"../chunks/BO-bVeya.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/BO-bVeya.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/ChuJmltc.js";import"../chunks/xihTtKlq.js";import{b as P,h as F,i as I,j as L,t as R}from"../chunks/DLExbVxt.js";import{H as z,W as B,o as V,s as H}from"../chunks/DcYrQeF9.js";import{t as U}from"../chunks/BO-bVeya.js";import{i as W,n as G,r as K,t as q}from"../chunks/DNBIBZfd.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/DcYrQeF9.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/ChuJmltc.js";import"../chunks/xihTtKlq.js";import{j as S,k as C}from"../chunks/DLExbVxt.js";import{c as w,i as T,l as E,n as D,t as O}from"../chunks/DcYrQeF9.js";import{t as k}from"../chunks/BO-bVeya.js";import{t as A}from"../chunks/DNBIBZfd.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":"1789117568823"}
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.DGqZJFG-.js" rel="modulepreload">
20
+ <link href="/.configuration/_app/immutable/chunks/ChuJmltc.js" rel="modulepreload">
21
+ <link href="/.configuration/_app/immutable/chunks/CcD_ISxM.js" rel="modulepreload">
22
+ <link href="/.configuration/_app/immutable/entry/app.C_BoZFMH.js" rel="modulepreload">
23
+ <link href="/.configuration/_app/immutable/chunks/xihTtKlq.js" rel="modulepreload">
24
+ <link href="/.configuration/_app/immutable/nodes/0.kGp6jAon.js" rel="modulepreload">
25
+ <link href="/.configuration/_app/immutable/chunks/DLExbVxt.js" rel="modulepreload">
26
+ <link href="/.configuration/_app/immutable/chunks/BO-bVeya.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_z9ldg7 = {
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_z9ldg7.env = env;
45
+
46
+ Promise.all([
47
+ import("/.configuration/_app/immutable/entry/start.DGqZJFG-.js"),
48
+ import("/.configuration/_app/immutable/entry/app.C_BoZFMH.js")
49
+ ]).then(([kit, app]) => {
50
+ kit.start(app, element);
51
+ });
52
+ });
53
+ }
54
+ </script>
55
+ </div>
56
+ </body>
57
+ </html>
@@ -0,0 +1,3 @@
1
+ # an operator's page, never a destination
2
+ User-agent: *
3
+ Disallow: /
@@ -1,69 +0,0 @@
1
- # Configuration Consistency
2
-
3
- ![Not Implemented](https://img.shields.io/badge/Not_Implemented-red)
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>
@@ -1,2 +0,0 @@
1
- schema: object
2
- defaults?: object
@@ -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[] = []
@@ -1,56 +0,0 @@
1
- import assert from 'node:assert'
2
- import { type Locator } from '@toa.io/core'
3
- import { decode, add } from '@toa.io/generic'
4
- import * as schemas from '@toa.io/schemas'
5
- import { PREFIX, SECRET_RX } from './deployment'
6
- import { type Manifest } from './manifest'
7
- import type { Schema } from '@toa.io/schemas'
8
-
9
- export function get (locator: Locator, manifest: Manifest): Configuration {
10
- const values = getConfiguration(locator.uppercase)
11
-
12
- substituteSecrets(values)
13
-
14
- if (manifest.defaults !== undefined)
15
- add(values, manifest.defaults)
16
-
17
- const schema: Schema<any> = schemas.schema(manifest.schema)
18
-
19
- schema.validate(values)
20
-
21
- return values
22
- }
23
-
24
- function getConfiguration (suffix: string): Configuration {
25
- const variable = PREFIX + suffix
26
- const string = process.env[variable]
27
-
28
- if (string === undefined) return {}
29
- else return decode(string)
30
- }
31
-
32
- function substituteSecrets (configuration: Configuration): void {
33
- for (const [key, value] of Object.entries(configuration)) {
34
- if (typeof value !== 'string') continue
35
-
36
- const match = value.match(SECRET_RX)
37
-
38
- if (match === null) continue
39
-
40
- const name = match.groups?.variable
41
-
42
- assert.ok(name !== undefined)
43
- configuration[key] = getSecret(name)
44
- }
45
- }
46
-
47
- function getSecret (name: string): string {
48
- const variable = PREFIX + '_' + name
49
- const value = process.env[variable]
50
-
51
- if (value === undefined) throw new Error(`${variable} is not set.`)
52
-
53
- return value
54
- }
55
-
56
- export type Configuration = Record<string, any>
@@ -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
- })
@@ -1,83 +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 !== 'string') continue
40
-
41
- const match = value.match(SECRET_RX)
42
-
43
- if (match === null) continue
44
-
45
- const name = match.groups?.variable
46
-
47
- assert.ok(name !== undefined)
48
-
49
- secrets.push({
50
- name: PREFIX + '_' + name,
51
- secret: {
52
- name: 'toa-configuration',
53
- key: name
54
- }
55
- })
56
- }
57
-
58
- return secrets
59
- }
60
-
61
- function validate (annotation: Annotation, instances: Instance[]): void {
62
- validators.annotation.validate(annotation)
63
-
64
- const requested = instances.map((instance) => instance.locator.id)
65
-
66
- for (const id of Object.keys(annotation))
67
- assert.ok(requested.includes(id),
68
- `Component '${id}' does not request configuration or does not exist.`)
69
- }
70
-
71
- function validateInstance (instace: Instance, values: object = {}): void {
72
- const defaults = instace.manifest.defaults ?? {}
73
- const configuration = overwrite(defaults, values)
74
- const schema: Schema<any> = schemas.schema(instace.manifest.schema)
75
-
76
- schema.validate(configuration)
77
- }
78
-
79
- export const SECRET_RX = /^\$(?<variable>[A-Z0-9_]{1,32})$/
80
- export const PREFIX = 'TOA_CONFIGURATION_'
81
-
82
- export type Annotation = Record<string, object>
83
- export type Instance = context.Dependency<Manifest>
package/source/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export { manifest } from './manifest'
2
- export { deployment } from './deployment'
3
- export { Factory } from './Factory'
@@ -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
- })
@@ -1,15 +0,0 @@
1
- import * as schemas from './schemas'
2
- import { type Configuration } 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?: Configuration
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 {};
@@ -1,64 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const generic_1 = require("@toa.io/generic");
4
- const core_1 = require("@toa.io/core");
5
- const randomstring_1 = require("randomstring");
6
- const configuration_1 = require("./configuration");
7
- let locator;
8
- let manifest;
9
- beforeEach(() => {
10
- locator = new core_1.Locator((0, randomstring_1.generate)(), (0, randomstring_1.generate)());
11
- manifest = { schema: { foo: 'string' } };
12
- });
13
- afterEach(() => {
14
- for (const name of used)
15
- delete process.env[name];
16
- used = [];
17
- });
18
- it('should read value', async () => {
19
- manifest.schema = { foo: 'string' };
20
- const value = { foo: (0, randomstring_1.generate)() };
21
- set(value);
22
- const result = (0, configuration_1.get)(locator, manifest);
23
- expect(result).toStrictEqual(value);
24
- });
25
- it('should return empty object if no value set', async () => {
26
- expect((0, configuration_1.get)(locator, manifest)).toStrictEqual({});
27
- });
28
- it('should substitute secrets', async () => {
29
- const value = { foo: '$BAR' };
30
- set(value);
31
- set('bar', '_BAR');
32
- const result = (0, configuration_1.get)(locator, manifest);
33
- expect(result).toStrictEqual({ foo: 'bar' });
34
- });
35
- it('should use defaults', async () => {
36
- manifest.schema = { foo: 'string', bar: ['number'], 'baz?': 'string' };
37
- manifest.defaults = { foo: 'bar', bar: [1] };
38
- const values = { bar: [2], baz: 'foo' };
39
- set(values);
40
- const result = (0, configuration_1.get)(locator, manifest);
41
- expect(result).toStrictEqual({
42
- foo: 'bar',
43
- bar: [2],
44
- baz: 'foo'
45
- });
46
- });
47
- it('should validate', async () => {
48
- manifest.schema = { foo: 'hello', bar: 'number' };
49
- const values = { bar: 5 };
50
- set(values);
51
- const result = (0, configuration_1.get)(locator, manifest);
52
- expect(result).toStrictEqual({
53
- foo: 'hello',
54
- bar: 5
55
- });
56
- });
57
- function set(value, key = locator.uppercase) {
58
- const string = typeof value === 'string' ? value : (0, generic_1.encode)(value);
59
- const name = 'TOA_CONFIGURATION_' + key;
60
- process.env[name] = string;
61
- used.push(name);
62
- }
63
- let used = [];
64
- //# sourceMappingURL=configuration.test.js.map