@auersperg/flare 0.3.4 → 0.3.6

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 (41) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/{chunk-5tjevcsj.js → chunk-r3ceakrn.js} +212 -20
  3. package/dist/cli/flare.js +9 -7
  4. package/dist/platform/admin.js +10 -4
  5. package/dist/platform/dashboard/_astro/auth-view.UTGGCEHc.js +1 -0
  6. package/dist/platform/dashboard/_astro/cli-approval.BZAWmpiR.js +1 -0
  7. package/dist/platform/dashboard/_astro/client.Bcl1NrNO.js +1 -0
  8. package/dist/platform/dashboard/_astro/client.BeKNsjPN.js +9 -0
  9. package/dist/platform/dashboard/_astro/common.DPoFQu44.js +1 -0
  10. package/dist/platform/dashboard/_astro/data-view.BgYyTCMN.js +1 -0
  11. package/dist/platform/dashboard/_astro/functions-view.PUkng3T1.js +1 -0
  12. package/dist/platform/dashboard/_astro/index.astro_astro_type_script_index_0_lang.BEuO3H0E.js +4 -0
  13. package/dist/platform/dashboard/_astro/index.lobU7uK5.css +2 -0
  14. package/dist/platform/dashboard/_astro/input-group.CJxPRHej.js +1 -0
  15. package/dist/platform/dashboard/_astro/sdk-view.COmbEZrF.js +1 -0
  16. package/dist/platform/dashboard/_astro/services-view.C34dy0dk.js +1 -0
  17. package/dist/platform/dashboard/_astro/settings-view.IuD2r5JW.js +3 -0
  18. package/dist/platform/dashboard/index.html +1 -1
  19. package/dist/platform/manifest.json +48 -83
  20. package/dist/platform/runtime.js +29 -6
  21. package/package.json +1 -1
  22. package/dist/platform/dashboard/_astro/auth-view.CuxQ12Fa.js +0 -1
  23. package/dist/platform/dashboard/_astro/badge.DwKWvVfO.js +0 -1
  24. package/dist/platform/dashboard/_astro/card.Bdqmram9.js +0 -1
  25. package/dist/platform/dashboard/_astro/cli-approval.VKPc8wYS.js +0 -1
  26. package/dist/platform/dashboard/_astro/client.DYdPL2z4.js +0 -9
  27. package/dist/platform/dashboard/_astro/common.HrRZXwD9.js +0 -1
  28. package/dist/platform/dashboard/_astro/dashboard.CH594XTw.js +0 -3
  29. package/dist/platform/dashboard/_astro/data-view.CcyUYvId.js +0 -1
  30. package/dist/platform/dashboard/_astro/function-badge.MlTRYkqM.js +0 -1
  31. package/dist/platform/dashboard/_astro/functions-view.C8JWdNAh.js +0 -1
  32. package/dist/platform/dashboard/_astro/index.DiiMDa7R.css +0 -2
  33. package/dist/platform/dashboard/_astro/input-group.3twGpQ77.js +0 -1
  34. package/dist/platform/dashboard/_astro/react-dom.DwX89IcG.js +0 -1
  35. package/dist/platform/dashboard/_astro/refresh-cw.B0Cj85jJ.js +0 -1
  36. package/dist/platform/dashboard/_astro/sdk-view.CRFkbEyS.js +0 -1
  37. package/dist/platform/dashboard/_astro/services-view.B2suYnaG.js +0 -1
  38. package/dist/platform/dashboard/_astro/settings-view.BFP47ySK.js +0 -3
  39. package/dist/platform/dashboard/_astro/status-badge.BV1dzbX9.js +0 -1
  40. package/dist/platform/dashboard/_astro/table-guide.DzBDP6fC.js +0 -2
  41. package/dist/platform/dashboard/_astro/tabs.GRO5rCrK.js +0 -1
@@ -529,7 +529,7 @@ class PasswordAuth {
529
529
  // packages/core/package.json
530
530
  var package_default = {
531
531
  name: "@flare/platform",
532
- version: "0.3.4",
532
+ version: "0.3.6",
533
533
  type: "module",
534
534
  license: "MIT",
535
535
  private: true,
@@ -7841,9 +7841,26 @@ function aliases(env) {
7841
7841
  }
7842
7842
  function getSupervisor(env, scope) {
7843
7843
  const stub = env.SUPERVISORS.getByName(scope);
7844
- return new Proxy({}, {
7845
- get: (_target, key) => key === "fetch" ? (request) => stub.fetch(request) : (...args) => stub.dispatch(String(key), args).then(unwrap)
7846
- });
7844
+ return {
7845
+ fetch: (request) => stub.fetch(request),
7846
+ authCommand: (...args) => stub.dispatch("authCommand", args).then(unwrap),
7847
+ application: (...args) => stub.dispatch("application", args).then(unwrap),
7848
+ socketIdentity: (...args) => stub.dispatch("socketIdentity", args).then(unwrap),
7849
+ configuration: (...args) => stub.dispatch("configuration", args).then(unwrap),
7850
+ configure: (...args) => stub.dispatch("configure", args).then(unwrap),
7851
+ publish: (...args) => stub.dispatch("publish", args).then(unwrap),
7852
+ activate: (...args) => stub.dispatch("activate", args).then(unwrap),
7853
+ admin: (...args) => stub.dispatch("admin", args).then(unwrap),
7854
+ authenticate: (...args) => stub.dispatch("authenticate", args).then(unwrap),
7855
+ consumeTicket: (...args) => stub.dispatch("consumeTicket", args).then(unwrap),
7856
+ ticket: (...args) => stub.dispatch("ticket", args).then(unwrap),
7857
+ call: (...args) => stub.dispatch("call", args).then(unwrap),
7858
+ job: (...args) => stub.dispatch("job", args).then(unwrap),
7859
+ destroy: (...args) => stub.dispatch("destroy", args).then(unwrap),
7860
+ prepareDestroy: (...args) => stub.dispatch("prepareDestroy", args).then(unwrap),
7861
+ fileCommand: (...args) => stub.dispatch("fileCommand", args).then(unwrap),
7862
+ scheduleCommand: (...args) => stub.dispatch("scheduleCommand", args).then(unwrap)
7863
+ };
7847
7864
  }
7848
7865
 
7849
7866
  class AppOutbound extends WorkerEntrypoint {
@@ -7904,7 +7921,10 @@ class EnvironmentSupervisor extends DurableObject {
7904
7921
  "scheduleCommand"
7905
7922
  ].includes(op))
7906
7923
  fail("INVALID_OPERATION");
7907
- return this[op](...args);
7924
+ if (!Array.isArray(args))
7925
+ fail("INVALID_INPUT");
7926
+ const method = this[op];
7927
+ return method.apply(this, args);
7908
7928
  });
7909
7929
  }
7910
7930
  removed = false;
@@ -9148,7 +9168,10 @@ class RuntimeControl extends WorkerEntrypoint {
9148
9168
  "readiness"
9149
9169
  ].includes(op))
9150
9170
  fail("INVALID_OPERATION");
9151
- return this[op](...args);
9171
+ if (!Array.isArray(args))
9172
+ fail("INVALID_INPUT");
9173
+ const method = this[op];
9174
+ return method.apply(this, args);
9152
9175
  });
9153
9176
  }
9154
9177
  readiness() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auersperg/flare",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Flare client, server declarations and development CLI",
@@ -1 +0,0 @@
1
- import{i as e,n as t}from"./react-dom.DwX89IcG.js";import{S as n,_ as r,a as i,b as a,f as o,g as s,gt as c,ht as l,n as u,p as d,s as f,u as p,v as m,x as h,y as g}from"./common.HrRZXwD9.js";import{t as _}from"./status-badge.BV1dzbX9.js";var v=e(t(),1),y=c();function b(e){let t=s(e.project,e.env),[c,b]=(0,v.useState)(``),[x,S]=(0,v.useState)(),C=p(t+`/auth-users`+(c?`?cursor=`+encodeURIComponent(c):``)),w=p(t+`/auth-settings`),T=e.session.role===`owner`,E=(n,r,i,a=[])=>{S({title:r,description:`Passwords are never displayed. Changes revoke existing sessions.`,productionId:e.env===`prod`?e.project.id:void 0,fields:a,submit:async r=>{try{await d(t+`/`+n,{...i,...o(a,e=>new FormData(r).get(e)),confirm:e.project.id})}catch(e){throw e instanceof Error&&e.message===`INVALID_PASSWORD`?Error(`Password must contain 6–128 characters. Spaces are allowed; the password is not trimmed.`):e instanceof Error&&e.message===`REGISTRATION_UNAVAILABLE`?Error(`This login is already registered. Choose another login or manage the existing user.`):e}C.refresh(),w.refresh()}})},D={name:`password`,type:`password`,required:!0,description:`6–128 characters.`};return(0,y.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,y.jsx)(`h1`,{className:`page-title`,children:`Auth`}),(0,y.jsx)(f,{loading:C.loading||w.loading,error:C.error||w.error}),w.data&&(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,y.jsx)(_,{status:w.data.enabled?`Enabled`:`Disabled`}),(0,y.jsx)(_,{status:w.data.registration?`Public registration`:`Registration closed`}),T&&(0,y.jsx)(l,{variant:`outline`,onClick:()=>E(`auth-configure`,`Configure authentication`,{},[{name:`enabled`,type:`boolean`,value:w.data.enabled},{name:`registration`,type:`boolean`,value:w.data.registration}]),children:`Configure`}),T&&(0,y.jsx)(l,{onClick:()=>E(`auth-create`,`Create user`,{},[{name:`login`,type:`string`,required:!0},D]),children:`Create user`})]}),C.data&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(r,{children:[(0,y.jsx)(h,{children:(0,y.jsxs)(n,{children:[(0,y.jsx)(a,{children:`Login`}),(0,y.jsx)(a,{children:`User ID`}),(0,y.jsx)(a,{children:`Status`}),(0,y.jsx)(a,{children:`Created`}),(0,y.jsx)(a,{children:`Actions`})]})}),(0,y.jsx)(m,{children:C.data.users.map(e=>(0,y.jsxs)(n,{children:[(0,y.jsx)(g,{children:e.login}),(0,y.jsx)(g,{children:(0,y.jsx)(`code`,{children:e.id})}),(0,y.jsx)(g,{children:(0,y.jsx)(_,{status:e.disabled?`Blocked`:`Active`})}),(0,y.jsx)(g,{children:new Date(e.createdAt).toLocaleString()}),(0,y.jsx)(g,{children:(0,y.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:T&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(l,{variant:`outline`,size:`sm`,onClick:()=>E(`auth-password`,`Change user password`,{id:e.id},[D]),children:`Change password`}),(0,y.jsx)(l,{variant:`outline`,size:`sm`,onClick:()=>E(`auth-revoke`,`Revoke all sessions`,{id:e.id}),children:`Revoke sessions`}),(0,y.jsx)(l,{variant:`outline`,size:`sm`,onClick:()=>E(`auth-disable`,e.disabled?`Unblock user`:`Block user`,{id:e.id,disabled:!e.disabled}),children:e.disabled?`Unblock`:`Block`})]})})})]},e.id))})]}),!C.data.users.length&&(0,y.jsx)(u,{title:`No users`}),(0,y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,y.jsx)(l,{variant:`outline`,disabled:!c,onClick:()=>b(``),children:`First page`}),(0,y.jsx)(l,{variant:`outline`,disabled:!C.data.next,onClick:()=>b(C.data.next),children:`Next page`})]})]}),x&&(0,y.jsx)(i,{modal:x,onClose:()=>S(void 0)})]})}export{b as default};
@@ -1 +0,0 @@
1
- import{Ot as e,_t as t,vt as n,yt as r}from"./common.HrRZXwD9.js";function i(e){return r(e.defaultTagName??`div`,e,e)}var a=n(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-none border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,success:`border-emerald-600/20 bg-emerald-100/50 text-emerald-700 dark:border-emerald-400/20 dark:bg-emerald-900/50 dark:text-emerald-200`,warning:`border-amber-600/20 bg-amber-100/50 text-amber-700 dark:border-amber-400/20 dark:bg-amber-900/50 dark:text-amber-200`,info:`border-blue-600/20 bg-blue-100/50 text-blue-700 dark:border-blue-400/20 dark:bg-blue-900/50 dark:text-blue-200`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function o({className:n,variant:r=`default`,render:o,...s}){return i({defaultTagName:`span`,props:e({className:t(a({variant:r}),n)},s),render:o,state:{slot:`badge`,variant:r}})}export{o as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./react-dom.DwX89IcG.js";import{_t as t,gt as n}from"./common.HrRZXwD9.js";e();var r=n();function i({className:e,size:n=`default`,...i}){return(0,r.jsx)(`div`,{"data-slot":`card`,"data-size":n,className:t(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-none bg-card py-(--card-spacing) text-xs/relaxed text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-none *:[img:last-child]:rounded-none`,e),...i})}function a({className:e,...n}){return(0,r.jsx)(`div`,{"data-slot":`card-header`,className:t(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-none px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...n})}function o({className:e,...n}){return(0,r.jsx)(`div`,{"data-slot":`card-title`,className:t(`font-heading text-sm font-medium group-data-[size=sm]/card:text-sm`,e),...n})}function s({className:e,...n}){return(0,r.jsx)(`div`,{"data-slot":`card-content`,className:t(`px-(--card-spacing)`,e),...n})}export{o as i,s as n,a as r,i as t};
@@ -1 +0,0 @@
1
- import{i as e,n as t}from"./react-dom.DwX89IcG.js";import{M as n,Y as r,gt as i,ht as a,j as o,k as s,m as c,p as l,r as u,t as d}from"./common.HrRZXwD9.js";var f=e(t(),1),p=i();function m(){let e=new URLSearchParams(location.search).get(`cli`)??``,[t,i]=(0,f.useState)(``),[m,h]=(0,f.useState)([]),[g,_]=(0,f.useState)(`new`),[v,y]=(0,f.useState)(``),[b,x]=(0,f.useState)(``),[S,C]=(0,f.useState)(!1),[w,T]=(0,f.useState)(!1);(0,f.useEffect)(()=>{let t=new AbortController;return Promise.all([l(`cli/approval?id=`+encodeURIComponent(e),void 0,t.signal),l(`projects`,void 0,t.signal)]).then(([e,t])=>{i(e.code),h(t),_(`new`)}).catch(e=>{t.signal.aborted||x(c(e))}),()=>t.abort()},[e]);async function E(){C(!0),x(``);try{let t=g;if(t===`new`){let e=await l(`projects`,{name:v,customer:`Applications`,origins:[]});t=e.id,h(t=>[...t,{id:e.id,name:v,customer:`Applications`}]),_(t)}await l(`cli/approval`,{id:e,project:t}),T(!0)}catch(e){x(c(e))}finally{C(!1)}}return(0,p.jsxs)(`main`,{className:`mx-auto max-w-lg p-8`,children:[(0,p.jsx)(`h1`,{className:`mb-4 text-xl font-semibold`,children:`Connect Flare CLI`}),w?(0,p.jsx)(`p`,{children:`Connected. Return to your terminal. You can close this tab.`}):(0,p.jsxs)(o,{children:[(0,p.jsx)(`p`,{children:`Approve only a login you just started. Compare this code with your terminal:`}),(0,p.jsx)(`strong`,{className:`text-2xl font-mono`,children:t||`Loading…`}),(0,p.jsx)(`p`,{children:`Grants this computer deployment access to the selected project, including production. The credential expires in 30 days and can be revoked in Settings.`}),(0,p.jsxs)(s,{children:[(0,p.jsx)(n,{children:`Project`}),(0,p.jsx)(d,{label:`CLI project`,value:g,onChange:_,items:[...m.map(e=>({value:e.id,label:e.name})),{value:`new`,label:`Create new project`}]})]}),g===`new`&&(0,p.jsxs)(s,{children:[(0,p.jsx)(n,{children:`New project name`}),(0,p.jsx)(r,{value:v,onChange:e=>y(e.target.value),maxLength:100})]}),b&&(0,p.jsx)(u,{children:b}),(0,p.jsx)(a,{disabled:S||!t||!g||g===`new`&&!v.trim(),onClick:E,children:`Approve connection`})]})]})}export{m as default};