@insight-health/aura 0.0.10-beta.2 → 0.0.10-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C={insightBaseUrl:"https://anywhere.insighthealth.ai"};let w=null;function A(){return w}function x(i){w={...C,...i}}function W(i){x(i)}function c(){const i=A();if(!i)throw new Error("Aura SDK not configured. Call configure() first to set global configuration.");return i}function y(){return"0.0.10-beta.2"}class O{constructor(){this.events={},this.subscribe=(e,t)=>(this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter(s=>s!==t)}),this.emit=(e,t)=>{this.events[e]&&this.events[e].forEach(s=>s(t))}}}const u=new O,d={log:i=>{console.log(`[Insight Health Aura Widget]: ${i}`)},warn:i=>{console.warn(`[Insight Health Aura Widget]: ${i}`)},error:i=>{console.error(`[Insight Health Aura Widget]: ${i}`)}},p={opacity:"0",pointerEvents:"none",width:"0",height:"0",maxWidth:"0",maxHeight:"0"},I={border:"none",borderRadius:"10px",boxShadow:"0 0 10px 0 rgba(0, 0, 0, 0.1)",overflow:"hidden",background:"#fff",position:"fixed",bottom:"20px",right:"20px",transition:"opacity 0.2s ease-in-out, width 0.2s ease-in-out, height 0.2s ease-in-out, max-width 0.2s ease-in-out, max-height 0.2s ease-in-out",zIndex:"9999"};class U{constructor(){this.config=null,this.widgetFrame=null,this.unsubsciptions=[],this.messageQueue=[],this.isQueueingEnabled=!1,this.methodRegistry={},this.isFrameReady=!1,this.isFrameAuthenticated=!1,this.postMessage=e=>{var s;if(!((s=this.widgetFrame)!=null&&s.contentWindow)){d.warn("No widget iframe to communicate with");return}const t=c();this.widgetFrame.contentWindow.postMessage(e,{targetOrigin:t.insightBaseUrl})},this.enableQueue=()=>{this.isQueueingEnabled=!0},this.disableQueue=(e=!1)=>{this.isQueueingEnabled=!1,e&&this.flushQueue()},this.flushQueue=()=>{const e=[...this.messageQueue];this.clearQueue(),e.forEach(t=>{this.postMessage(t)})},this.clearQueue=()=>{this.messageQueue=[]},this.sendOrQueue=e=>{if(this.isQueueingEnabled){this.messageQueue.push(e);return}this.postMessage(e)},this.handleMethodCall=async e=>{const{callId:t,methodName:s,args:h}=e,r=this.methodRegistry[s];if(!r){this.postMessage({type:"Method.Response",payload:{callId:t,methodName:s,success:!1,error:{message:`Method "${s}" is not registered`,code:"METHOD_NOT_FOUND"}}});return}try{const n=await r(h||{});this.postMessage({type:"Method.Response",payload:{callId:t,methodName:s,success:!0,result:n}})}catch(n){const a=n instanceof Error?n:new Error(String(n));this.postMessage({type:"Method.Response",payload:{callId:t,success:!1,methodName:s,error:{message:a.message,code:"METHOD_EXECUTION_ERROR",stack:a.stack,name:a.name,cause:a.cause,apiResponse:a.response}}})}},this.init=e=>new Promise(t=>{if(!this.widgetFrame){this.reset(),this.enableQueue();const s=c(),{tenantId:h,tenantName:r,user:n,language:a,container:l,widgetId:b,widgetStyles:o}=e;this.config=e,this.isFrameReady=!1,this.widgetFrame=document.createElement("iframe");const F=(o==null?void 0:o.width)||"350px",M=(o==null?void 0:o.height)||"600px",Q={...I,...o,...p};Object.assign(this.widgetFrame.style,Q),this.widgetFrame.id=b||"aura-widget",this.widgetFrame.setAttribute("allow",`microphone ${s.insightBaseUrl}; camera ${s.insightBaseUrl}; clipboard-read ${s.insightBaseUrl}; clipboard-write ${s.insightBaseUrl};`),this.widgetFrame.src=`${s.insightBaseUrl}`,this.widgetFrame.__desiredWidth=F,this.widgetFrame.__desiredHeight=M,this.widgetFrame.onerror=()=>{d.error(`Failed to load iframe. Please ensure your Content Security Policy includes:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C={insightBaseUrl:"https://anywhere.insighthealth.ai"};let w=null;function A(){return w}function x(i){w={...C,...i}}function W(i){x(i)}function c(){const i=A();if(!i)throw new Error("Aura SDK not configured. Call configure() first to set global configuration.");return i}function y(){return"0.0.10-beta.3"}class O{constructor(){this.events={},this.subscribe=(e,t)=>(this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter(s=>s!==t)}),this.emit=(e,t)=>{this.events[e]&&this.events[e].forEach(s=>s(t))}}}const u=new O,d={log:i=>{console.log(`[Insight Health Aura Widget]: ${i}`)},warn:i=>{console.warn(`[Insight Health Aura Widget]: ${i}`)},error:i=>{console.error(`[Insight Health Aura Widget]: ${i}`)}},p={opacity:"0",pointerEvents:"none",width:"0",height:"0",maxWidth:"0",maxHeight:"0"},I={border:"none",borderRadius:"10px",boxShadow:"0 0 10px 0 rgba(0, 0, 0, 0.1)",overflow:"hidden",background:"#fff",position:"fixed",bottom:"20px",right:"20px",transition:"opacity 0.2s ease-in-out, width 0.2s ease-in-out, height 0.2s ease-in-out, max-width 0.2s ease-in-out, max-height 0.2s ease-in-out",zIndex:"9999"};class U{constructor(){this.config=null,this.widgetFrame=null,this.unsubsciptions=[],this.messageQueue=[],this.isQueueingEnabled=!1,this.methodRegistry={},this.isFrameReady=!1,this.isFrameAuthenticated=!1,this.postMessage=e=>{var s;if(!((s=this.widgetFrame)!=null&&s.contentWindow)){d.warn("No widget iframe to communicate with");return}const t=c();this.widgetFrame.contentWindow.postMessage(e,{targetOrigin:t.insightBaseUrl})},this.enableQueue=()=>{this.isQueueingEnabled=!0},this.disableQueue=(e=!1)=>{this.isQueueingEnabled=!1,e&&this.flushQueue()},this.flushQueue=()=>{const e=[...this.messageQueue];this.clearQueue(),e.forEach(t=>{this.postMessage(t)})},this.clearQueue=()=>{this.messageQueue=[]},this.sendOrQueue=e=>{if(this.isQueueingEnabled){this.messageQueue.push(e);return}this.postMessage(e)},this.handleMethodCall=async e=>{const{callId:t,methodName:s,args:h}=e,r=this.methodRegistry[s];if(!r){this.postMessage({type:"Method.Response",payload:{callId:t,methodName:s,success:!1,error:{message:`Method "${s}" is not registered`,code:"METHOD_NOT_FOUND"}}});return}try{const n=await r(h||{});this.postMessage({type:"Method.Response",payload:{callId:t,methodName:s,success:!0,result:n}})}catch(n){const a=n instanceof Error?n:new Error(String(n));this.postMessage({type:"Method.Response",payload:{callId:t,success:!1,methodName:s,error:{message:a.message,code:"METHOD_EXECUTION_ERROR",stack:a.stack,name:a.name,cause:a.cause,apiResponse:a.response}}})}},this.init=e=>new Promise(t=>{if(!this.widgetFrame){this.reset(),this.enableQueue();const s=c(),{tenantId:h,tenantName:r,user:n,language:a,container:l,widgetId:b,widgetStyles:o}=e;this.config=e,this.isFrameReady=!1,this.widgetFrame=document.createElement("iframe");const F=(o==null?void 0:o.width)||"350px",M=(o==null?void 0:o.height)||"600px",Q={...I,...o,...p};Object.assign(this.widgetFrame.style,Q),this.widgetFrame.id=b||"aura-widget",this.widgetFrame.setAttribute("allow",`microphone ${s.insightBaseUrl}; camera ${s.insightBaseUrl}; clipboard-read ${s.insightBaseUrl}; clipboard-write ${s.insightBaseUrl};`),this.widgetFrame.src=`${s.insightBaseUrl}`,this.widgetFrame.__desiredWidth=F,this.widgetFrame.__desiredHeight=M,this.widgetFrame.onerror=()=>{d.error(`Failed to load iframe. Please ensure your Content Security Policy includes:
2
2
  frame-src ${s.insightBaseUrl}
3
3
  `)},(l&&document.querySelector(l)||document.body).appendChild(this.widgetFrame);const E=u.subscribe("Auth.Ready",()=>{this.isFrameReady=!0,this.setUser({tenantId:h,tenantName:r,user:n,language:a})}),R=u.subscribe("Auth.Complete",f=>{var m;this.isFrameAuthenticated=!0,this.disableQueue(!0),t(f),(m=e.onAuthenticated)==null||m.call(e,f)});this.unsubsciptions.push(E,R)}}),this.setUser=e=>{const t=this.config.partnerKey,{tenantId:s,tenantName:h,user:r,language:n}=e;this.config.tenantId=s,this.config.tenantName=h,this.config.user=r,this.config.language=n,this.isFrameAuthenticated=!1,this.postMessage({type:"Auth.Login",payload:{partnerKey:t,tenantId:s,tenantName:h,user:r,language:n}})},this.show=()=>{if(this.widgetFrame){const e=this.widgetFrame.__desiredWidth||"350px",t=this.widgetFrame.__desiredHeight||"600px",s={opacity:"1",pointerEvents:"auto",width:e,height:t,maxWidth:e,maxHeight:t};Object.assign(this.widgetFrame.style,{...s})}},this.hide=()=>{this.widgetFrame&&Object.assign(this.widgetFrame.style,{...p})},this.reset=()=>{this.widgetFrame&&this.widgetFrame.remove(),this.widgetFrame=null,this.isFrameReady=!1,this.isFrameAuthenticated=!1,this.unsubsciptions.forEach(e=>e==null?void 0:e()),this.unsubsciptions=[],this.disableQueue(),this.clearQueue(),this.methodRegistry={}},this.command=e=>{this.sendOrQueue(e),this.show()},this.emit=this.command,this.on=(e,t)=>u.subscribe(e,t),this.registerTemplates=e=>{this.sendOrQueue({type:"Template.Register",payload:e})},this.registerMethod=(e,t)=>{if(typeof e!="string"){d.error("Method name must be a string");return}if(typeof t!="function"){d.error("Method handler for name "+e+" must be a function");return}this.methodRegistry[e]=t},this.unregisterMethod=e=>delete this.methodRegistry[e],this.getConfig=()=>this.config,this.getVersion=()=>y(),window.addEventListener("message",e=>{var t;if(!(e.source!==((t=this.widgetFrame)==null?void 0:t.contentWindow)||!e.data)){if(e.data.type==="Method.Call"){this.handleMethodCall(e.data.payload);return}u.emit(e.data.type,e.data.payload)}})}}let g=null;function _(){return g||(g=new U),g}const H=_();exports.AuraWidget=H;exports.configure=W;exports.getConfig=c;exports.getVersion=y;
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@ function f() {
20
20
  return i;
21
21
  }
22
22
  function A() {
23
- return "0.0.10-beta.2";
23
+ return "0.0.10-beta.3";
24
24
  }
25
25
  class W {
26
26
  constructor() {
package/dist/index.umd.js CHANGED
@@ -1,3 +1,3 @@
1
- (function(r,u){typeof exports=="object"&&typeof module<"u"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(r=typeof globalThis<"u"?globalThis:r||self,u(r.InsightAura={}))})(this,function(r){"use strict";const u={insightBaseUrl:"https://anywhere.insighthealth.ai"};let m=null;function M(){return m}function Q(i){m={...u,...i}}function E(i){Q(i)}function l(){const i=M();if(!i)throw new Error("Aura SDK not configured. Call configure() first to set global configuration.");return i}function p(){return"0.0.10-beta.2"}class R{constructor(){this.events={},this.subscribe=(e,t)=>(this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter(s=>s!==t)}),this.emit=(e,t)=>{this.events[e]&&this.events[e].forEach(s=>s(t))}}}const g=new R,c={log:i=>{console.log(`[Insight Health Aura Widget]: ${i}`)},warn:i=>{console.warn(`[Insight Health Aura Widget]: ${i}`)},error:i=>{console.error(`[Insight Health Aura Widget]: ${i}`)}},w={opacity:"0",pointerEvents:"none",width:"0",height:"0",maxWidth:"0",maxHeight:"0"},A={border:"none",borderRadius:"10px",boxShadow:"0 0 10px 0 rgba(0, 0, 0, 0.1)",overflow:"hidden",background:"#fff",position:"fixed",bottom:"20px",right:"20px",transition:"opacity 0.2s ease-in-out, width 0.2s ease-in-out, height 0.2s ease-in-out, max-width 0.2s ease-in-out, max-height 0.2s ease-in-out",zIndex:"9999"};class C{constructor(){this.config=null,this.widgetFrame=null,this.unsubsciptions=[],this.messageQueue=[],this.isQueueingEnabled=!1,this.methodRegistry={},this.isFrameReady=!1,this.isFrameAuthenticated=!1,this.postMessage=e=>{var s;if(!((s=this.widgetFrame)!=null&&s.contentWindow)){c.warn("No widget iframe to communicate with");return}const t=l();this.widgetFrame.contentWindow.postMessage(e,{targetOrigin:t.insightBaseUrl})},this.enableQueue=()=>{this.isQueueingEnabled=!0},this.disableQueue=(e=!1)=>{this.isQueueingEnabled=!1,e&&this.flushQueue()},this.flushQueue=()=>{const e=[...this.messageQueue];this.clearQueue(),e.forEach(t=>{this.postMessage(t)})},this.clearQueue=()=>{this.messageQueue=[]},this.sendOrQueue=e=>{if(this.isQueueingEnabled){this.messageQueue.push(e);return}this.postMessage(e)},this.handleMethodCall=async e=>{const{callId:t,methodName:s,args:d}=e,a=this.methodRegistry[s];if(!a){this.postMessage({type:"Method.Response",payload:{callId:t,methodName:s,success:!1,error:{message:`Method "${s}" is not registered`,code:"METHOD_NOT_FOUND"}}});return}try{const n=await a(d||{});this.postMessage({type:"Method.Response",payload:{callId:t,methodName:s,success:!0,result:n}})}catch(n){const o=n instanceof Error?n:new Error(String(n));this.postMessage({type:"Method.Response",payload:{callId:t,success:!1,methodName:s,error:{message:o.message,code:"METHOD_EXECUTION_ERROR",stack:o.stack,name:o.name,cause:o.cause,apiResponse:o.response}}})}},this.init=e=>new Promise(t=>{if(!this.widgetFrame){this.reset(),this.enableQueue();const s=l(),{tenantId:d,tenantName:a,user:n,language:o,container:y,widgetId:O,widgetStyles:h}=e;this.config=e,this.isFrameReady=!1,this.widgetFrame=document.createElement("iframe");const I=(h==null?void 0:h.width)||"350px",U=(h==null?void 0:h.height)||"600px",_={...A,...h,...w};Object.assign(this.widgetFrame.style,_),this.widgetFrame.id=O||"aura-widget",this.widgetFrame.setAttribute("allow",`microphone ${s.insightBaseUrl}; camera ${s.insightBaseUrl}; clipboard-read ${s.insightBaseUrl}; clipboard-write ${s.insightBaseUrl};`),this.widgetFrame.src=`${s.insightBaseUrl}`,this.widgetFrame.__desiredWidth=I,this.widgetFrame.__desiredHeight=U,this.widgetFrame.onerror=()=>{c.error(`Failed to load iframe. Please ensure your Content Security Policy includes:
1
+ (function(r,u){typeof exports=="object"&&typeof module<"u"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(r=typeof globalThis<"u"?globalThis:r||self,u(r.InsightAura={}))})(this,function(r){"use strict";const u={insightBaseUrl:"https://anywhere.insighthealth.ai"};let m=null;function M(){return m}function Q(i){m={...u,...i}}function E(i){Q(i)}function l(){const i=M();if(!i)throw new Error("Aura SDK not configured. Call configure() first to set global configuration.");return i}function p(){return"0.0.10-beta.3"}class R{constructor(){this.events={},this.subscribe=(e,t)=>(this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter(s=>s!==t)}),this.emit=(e,t)=>{this.events[e]&&this.events[e].forEach(s=>s(t))}}}const g=new R,c={log:i=>{console.log(`[Insight Health Aura Widget]: ${i}`)},warn:i=>{console.warn(`[Insight Health Aura Widget]: ${i}`)},error:i=>{console.error(`[Insight Health Aura Widget]: ${i}`)}},w={opacity:"0",pointerEvents:"none",width:"0",height:"0",maxWidth:"0",maxHeight:"0"},A={border:"none",borderRadius:"10px",boxShadow:"0 0 10px 0 rgba(0, 0, 0, 0.1)",overflow:"hidden",background:"#fff",position:"fixed",bottom:"20px",right:"20px",transition:"opacity 0.2s ease-in-out, width 0.2s ease-in-out, height 0.2s ease-in-out, max-width 0.2s ease-in-out, max-height 0.2s ease-in-out",zIndex:"9999"};class C{constructor(){this.config=null,this.widgetFrame=null,this.unsubsciptions=[],this.messageQueue=[],this.isQueueingEnabled=!1,this.methodRegistry={},this.isFrameReady=!1,this.isFrameAuthenticated=!1,this.postMessage=e=>{var s;if(!((s=this.widgetFrame)!=null&&s.contentWindow)){c.warn("No widget iframe to communicate with");return}const t=l();this.widgetFrame.contentWindow.postMessage(e,{targetOrigin:t.insightBaseUrl})},this.enableQueue=()=>{this.isQueueingEnabled=!0},this.disableQueue=(e=!1)=>{this.isQueueingEnabled=!1,e&&this.flushQueue()},this.flushQueue=()=>{const e=[...this.messageQueue];this.clearQueue(),e.forEach(t=>{this.postMessage(t)})},this.clearQueue=()=>{this.messageQueue=[]},this.sendOrQueue=e=>{if(this.isQueueingEnabled){this.messageQueue.push(e);return}this.postMessage(e)},this.handleMethodCall=async e=>{const{callId:t,methodName:s,args:d}=e,a=this.methodRegistry[s];if(!a){this.postMessage({type:"Method.Response",payload:{callId:t,methodName:s,success:!1,error:{message:`Method "${s}" is not registered`,code:"METHOD_NOT_FOUND"}}});return}try{const n=await a(d||{});this.postMessage({type:"Method.Response",payload:{callId:t,methodName:s,success:!0,result:n}})}catch(n){const o=n instanceof Error?n:new Error(String(n));this.postMessage({type:"Method.Response",payload:{callId:t,success:!1,methodName:s,error:{message:o.message,code:"METHOD_EXECUTION_ERROR",stack:o.stack,name:o.name,cause:o.cause,apiResponse:o.response}}})}},this.init=e=>new Promise(t=>{if(!this.widgetFrame){this.reset(),this.enableQueue();const s=l(),{tenantId:d,tenantName:a,user:n,language:o,container:y,widgetId:O,widgetStyles:h}=e;this.config=e,this.isFrameReady=!1,this.widgetFrame=document.createElement("iframe");const I=(h==null?void 0:h.width)||"350px",U=(h==null?void 0:h.height)||"600px",_={...A,...h,...w};Object.assign(this.widgetFrame.style,_),this.widgetFrame.id=O||"aura-widget",this.widgetFrame.setAttribute("allow",`microphone ${s.insightBaseUrl}; camera ${s.insightBaseUrl}; clipboard-read ${s.insightBaseUrl}; clipboard-write ${s.insightBaseUrl};`),this.widgetFrame.src=`${s.insightBaseUrl}`,this.widgetFrame.__desiredWidth=I,this.widgetFrame.__desiredHeight=U,this.widgetFrame.onerror=()=>{c.error(`Failed to load iframe. Please ensure your Content Security Policy includes:
2
2
  frame-src ${s.insightBaseUrl}
3
3
  `)},(y&&document.querySelector(y)||document.body).appendChild(this.widgetFrame);const H=g.subscribe("Auth.Ready",()=>{this.isFrameReady=!0,this.setUser({tenantId:d,tenantName:a,user:n,language:o})}),S=g.subscribe("Auth.Complete",b=>{var F;this.isFrameAuthenticated=!0,this.disableQueue(!0),t(b),(F=e.onAuthenticated)==null||F.call(e,b)});this.unsubsciptions.push(H,S)}}),this.setUser=e=>{const t=this.config.partnerKey,{tenantId:s,tenantName:d,user:a,language:n}=e;this.config.tenantId=s,this.config.tenantName=d,this.config.user=a,this.config.language=n,this.isFrameAuthenticated=!1,this.postMessage({type:"Auth.Login",payload:{partnerKey:t,tenantId:s,tenantName:d,user:a,language:n}})},this.show=()=>{if(this.widgetFrame){const e=this.widgetFrame.__desiredWidth||"350px",t=this.widgetFrame.__desiredHeight||"600px",s={opacity:"1",pointerEvents:"auto",width:e,height:t,maxWidth:e,maxHeight:t};Object.assign(this.widgetFrame.style,{...s})}},this.hide=()=>{this.widgetFrame&&Object.assign(this.widgetFrame.style,{...w})},this.reset=()=>{this.widgetFrame&&this.widgetFrame.remove(),this.widgetFrame=null,this.isFrameReady=!1,this.isFrameAuthenticated=!1,this.unsubsciptions.forEach(e=>e==null?void 0:e()),this.unsubsciptions=[],this.disableQueue(),this.clearQueue(),this.methodRegistry={}},this.command=e=>{this.sendOrQueue(e),this.show()},this.emit=this.command,this.on=(e,t)=>g.subscribe(e,t),this.registerTemplates=e=>{this.sendOrQueue({type:"Template.Register",payload:e})},this.registerMethod=(e,t)=>{if(typeof e!="string"){c.error("Method name must be a string");return}if(typeof t!="function"){c.error("Method handler for name "+e+" must be a function");return}this.methodRegistry[e]=t},this.unregisterMethod=e=>delete this.methodRegistry[e],this.getConfig=()=>this.config,this.getVersion=()=>p(),window.addEventListener("message",e=>{var t;if(!(e.source!==((t=this.widgetFrame)==null?void 0:t.contentWindow)||!e.data)){if(e.data.type==="Method.Call"){this.handleMethodCall(e.data.payload);return}g.emit(e.data.type,e.data.payload)}})}}let f=null;function x(){return f||(f=new C),f}const W=x();r.AuraWidget=W,r.configure=E,r.getConfig=l,r.getVersion=p,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
package/dist/types.d.ts CHANGED
@@ -1,3 +1,13 @@
1
+ /**
2
+ * A type that represents an object with any key and value.
3
+ */
4
+ export type AnyObject = Record<string | number | symbol, any>;
5
+ /**
6
+ * Require at least one of the specified keys to be present.
7
+ */
8
+ export type AtLeastOneOf<T extends AnyObject, K extends keyof T> = Omit<T, K> & {
9
+ [P in K]: Required<Pick<T, P>> & Partial<Pick<T, Exclude<K, P>>>;
10
+ }[K];
1
11
  export type AuraWidgetEmitEvent<T = any> = {
2
12
  type: string;
3
13
  payload: T;
@@ -23,15 +33,26 @@ export type AuraWidgetMessageEvent<T = any> = {
23
33
  type: string;
24
34
  payload: T;
25
35
  };
26
- export type AuraTemplate = {
27
- id: string;
36
+ export type AuraTemplateDefinition = {
28
37
  name: string;
29
- body: {
30
- sections: Record<string, any>[];
38
+ type: 'openText' | 'singleSelect' | 'multiSelect' | 'openSingleSelect' | 'openMultiSelect' | 'boolean';
39
+ options?: string[];
40
+ meta?: {
41
+ additionalInstructions?: string;
42
+ examples?: string[];
31
43
  };
44
+ };
45
+ export type AuraTemplate = AtLeastOneOf<{
46
+ id: string;
47
+ name: string;
32
48
  description: string;
33
49
  encounterPhase: 'pre-chart' | 'in-visit';
34
- };
50
+ body?: {
51
+ sections: Record<string, any>[];
52
+ };
53
+ definition?: AuraTemplateDefinition;
54
+ exampleNotes?: any[];
55
+ }, 'definition' | 'body'>;
35
56
  export type AuraRegisterTemplatePayload = {
36
57
  templates: AuraTemplate[];
37
58
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,CAAC,CAAC,GAAG,GAAG,IAAI;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CACpB,IAAI,CACF,mBAAmB,EACjB,OAAO,GACP,QAAQ,GACR,cAAc,GACd,WAAW,GACX,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,CACV,CACF,CAAC;IACF,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;CAC9C,CAAC;A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,gBAAgB,EAChC,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,IAChD;IACF,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,CAAC,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;CACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insight-health/aura",
3
- "version": "0.0.10-beta.2",
3
+ "version": "0.0.10-beta.3",
4
4
  "description": "Aura SDK package for Insight Health AI",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",