@insight-health/aura 0.0.9 → 0.0.10-beta.0

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.
@@ -1,4 +1,4 @@
1
- import { AuraRegisterTemplatePayload, AuraWidgetInitParams, AuraWidgetEmitEvent, AuthParams } from './types';
1
+ import { AuraRegisterTemplatePayload, AuraWidgetInitParams, AuraWidgetEmitEvent, AuthParams, SupportedMethods } from './types';
2
2
 
3
3
  /**
4
4
  * Aura service class
@@ -10,6 +10,7 @@ declare class AuraWidgetService {
10
10
  private unsubsciptions;
11
11
  private messageQueue;
12
12
  private isQueueingEnabled;
13
+ private methodRegistry;
13
14
  isFrameReady: boolean;
14
15
  isFrameAuthenticated: boolean;
15
16
  constructor();
@@ -19,6 +20,7 @@ declare class AuraWidgetService {
19
20
  private flushQueue;
20
21
  private clearQueue;
21
22
  private sendOrQueue;
23
+ private handleMethodCall;
22
24
  init: (params: AuraWidgetInitParams) => Promise<void>;
23
25
  setUser: (params: AuthParams) => void;
24
26
  show: () => void;
@@ -28,6 +30,18 @@ declare class AuraWidgetService {
28
30
  emit: (event: AuraWidgetEmitEvent) => void;
29
31
  on: (type: string, callback: (payload: unknown) => void) => (() => void);
30
32
  registerTemplates: (payload: AuraRegisterTemplatePayload) => void;
33
+ /**
34
+ * Register a method that can be called by the iframe widget
35
+ * @param name - The method name identifier
36
+ * @param handler - The handler function (can be async)
37
+ */
38
+ registerMethod: <N extends keyof SupportedMethods>(name: N, handler: SupportedMethods[N]) => void;
39
+ /**
40
+ * Unregister a previously registered method
41
+ * @param name - The method name to unregister
42
+ * @returns true if the method was found and removed, false otherwise
43
+ */
44
+ unregisterMethod: <N extends keyof SupportedMethods>(name: N) => boolean;
31
45
  /**
32
46
  * Get SDK version
33
47
  */
@@ -1 +1 @@
1
- {"version":3,"file":"auraWidget.d.ts","sourceRoot":"","sources":["../src/auraWidget.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,2BAA2B,EAC3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ywhere.insighthealth.ai"};let w=null;function E(){return w}function B(s){w={...C,...s}}function I(s){B(s)}function g(){const s=E();if(!s)throw new Error("Aura SDK not configured. Call configure() first to set global configuration.");return s}function b(){return"0.0.9"}class S{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(i=>i!==t)}),this.emit=(e,t)=>{this.events[e]&&this.events[e].forEach(i=>i(t))}}}const o=new S,f={log:s=>{console.log(`[Insight Health Aura Widget]: ${s}`)},warn:s=>{console.warn(`[Insight Health Aura Widget]: ${s}`)},error:s=>{console.error(`[Insight Health Aura Widget]: ${s}`)}},m={opacity:"0",pointerEvents:"none",width:"0",height:"0",maxWidth:"0",maxHeight:"0"},U={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 v{constructor(){this.config=null,this.widgetFrame=null,this.unsubsciptions=[],this.messageQueue=[],this.isQueueingEnabled=!1,this.isFrameReady=!1,this.isFrameAuthenticated=!1,this.postMessage=e=>{var i;if(!((i=this.widgetFrame)!=null&&i.contentWindow)){f.warn("No widget iframe to communicate with");return}const t=g();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.init=e=>new Promise(t=>{if(!this.widgetFrame){this.reset(),this.enableQueue();const i=g(),{tenantId:r,tenantName:a,user:h,language:p,container:d,widgetId:F,widgetStyles:n}=e;this.config=e,this.isFrameReady=!1,this.widgetFrame=document.createElement("iframe");const y=(n==null?void 0:n.width)||"350px",Q=(n==null?void 0:n.height)||"600px",A={...U,...n,...m};Object.assign(this.widgetFrame.style,A),this.widgetFrame.id=F||"aura-widget",this.widgetFrame.setAttribute("allow",`microphone ${i.insightBaseUrl}; camera ${i.insightBaseUrl}; clipboard-read ${i.insightBaseUrl}; clipboard-write ${i.insightBaseUrl};`),this.widgetFrame.src=`${i.insightBaseUrl}`,this.widgetFrame.__desiredWidth=y,this.widgetFrame.__desiredHeight=Q,this.widgetFrame.onerror=()=>{f.error(`Failed to load iframe. Please ensure your Content Security Policy includes:
2
- frame-src ${i.insightBaseUrl}
3
- `)},(d&&document.querySelector(d)||document.body).appendChild(this.widgetFrame);const x=o.subscribe("Auth.Ready",()=>{this.isFrameReady=!0,this.setUser({tenantId:r,tenantName:a,user:h,language:p})}),W=o.subscribe("Auth.Complete",l=>{var c;this.isFrameAuthenticated=!0,this.disableQueue(!0),t(l),(c=e.onAuthenticated)==null||c.call(e,l)});this.unsubsciptions.push(x,W)}}),this.setUser=e=>{const t=this.config.partnerKey,{tenantId:i,tenantName:r,user:a,language:h}=e;this.config.tenantId=i,this.config.tenantName=r,this.config.user=a,this.config.language=h,this.isFrameAuthenticated=!1,this.postMessage({type:"Auth.Login",payload:{partnerKey:t,tenantId:i,tenantName:r,user:a,language:h}})},this.show=()=>{if(this.widgetFrame){const e=this.widgetFrame.__desiredWidth||"350px",t=this.widgetFrame.__desiredHeight||"600px",i={opacity:"1",pointerEvents:"auto",width:e,height:t,maxWidth:e,maxHeight:t};Object.assign(this.widgetFrame.style,{...i})}},this.hide=()=>{this.widgetFrame&&Object.assign(this.widgetFrame.style,{...m})},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.command=e=>{this.sendOrQueue(e),this.show()},this.emit=this.command,this.on=(e,t)=>o.subscribe(e,t),this.registerTemplates=e=>{this.sendOrQueue({type:"Template.Register",payload:e})},this.getConfig=()=>this.config,this.getVersion=()=>b(),window.addEventListener("message",e=>{var t;e.source!==((t=this.widgetFrame)==null?void 0:t.contentWindow)||!e.data||o.emit(e.data.type,e.data.payload)})}}let u=null;function H(){return u||(u=new v),u}const $=H();exports.AuraWidget=$;exports.configure=I;exports.getConfig=g;exports.getVersion=b;
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 g(){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.0"}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 d=new O,f={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)){f.warn("No widget iframe to communicate with");return}const t=g();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,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,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,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=g(),{tenantId:h,tenantName:r,user:n,language:a,container:c,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",Q=(o==null?void 0:o.height)||"600px",E={...I,...o,...p};Object.assign(this.widgetFrame.style,E),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=Q,this.widgetFrame.onerror=()=>{f.error(`Failed to load iframe. Please ensure your Content Security Policy includes:
2
+ frame-src ${s.insightBaseUrl}
3
+ `)},(c&&document.querySelector(c)||document.body).appendChild(this.widgetFrame);const M=d.subscribe("Auth.Ready",()=>{this.isFrameReady=!0,this.setUser({tenantId:h,tenantName:r,user:n,language:a})}),R=d.subscribe("Auth.Complete",l=>{var m;this.isFrameAuthenticated=!0,this.disableQueue(!0),t(l),(m=e.onAuthenticated)==null||m.call(e,l)});this.unsubsciptions.push(M,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)=>d.subscribe(e,t),this.registerTemplates=e=>{this.sendOrQueue({type:"Template.Register",payload:e})},this.registerMethod=(e,t)=>{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}d.emit(e.data.type,e.data.payload)}})}}let u=null;function _(){return u||(u=new U),u}const H=_();exports.AuraWidget=H;exports.configure=W;exports.getConfig=g;exports.getVersion=y;
package/dist/index.js CHANGED
@@ -1,54 +1,54 @@
1
- const W = {
1
+ const M = {
2
2
  insightBaseUrl: "https://anywhere.insighthealth.ai"
3
3
  };
4
4
  let w = null;
5
- function C() {
5
+ function x() {
6
6
  return w;
7
7
  }
8
- function E(s) {
9
- w = { ...W, ...s };
8
+ function C(i) {
9
+ w = { ...M, ...i };
10
10
  }
11
- function v(s) {
12
- E(s);
11
+ function _(i) {
12
+ C(i);
13
13
  }
14
- function c() {
15
- const s = C();
16
- if (!s)
14
+ function m() {
15
+ const i = x();
16
+ if (!i)
17
17
  throw new Error(
18
18
  "Aura SDK not configured. Call configure() first to set global configuration."
19
19
  );
20
- return s;
20
+ return i;
21
21
  }
22
- function B() {
23
- return "0.0.9";
22
+ function A() {
23
+ return "0.0.10-beta.0";
24
24
  }
25
- class I {
25
+ class W {
26
26
  constructor() {
27
27
  this.events = {}, this.subscribe = (e, t) => (this.events[e] || (this.events[e] = []), this.events[e].push(t), () => {
28
- this.events[e] = this.events[e].filter((i) => i !== t);
28
+ this.events[e] = this.events[e].filter((s) => s !== t);
29
29
  }), this.emit = (e, t) => {
30
- this.events[e] && this.events[e].forEach((i) => i(t));
30
+ this.events[e] && this.events[e].forEach((s) => s(t));
31
31
  };
32
32
  }
33
33
  }
34
- const o = new I(), f = {
35
- log: (s) => {
36
- console.log(`[Insight Health Aura Widget]: ${s}`);
34
+ const d = new W(), f = {
35
+ log: (i) => {
36
+ console.log(`[Insight Health Aura Widget]: ${i}`);
37
37
  },
38
- warn: (s) => {
39
- console.warn(`[Insight Health Aura Widget]: ${s}`);
38
+ warn: (i) => {
39
+ console.warn(`[Insight Health Aura Widget]: ${i}`);
40
40
  },
41
- error: (s) => {
42
- console.error(`[Insight Health Aura Widget]: ${s}`);
41
+ error: (i) => {
42
+ console.error(`[Insight Health Aura Widget]: ${i}`);
43
43
  }
44
- }, m = {
44
+ }, p = {
45
45
  opacity: "0",
46
46
  pointerEvents: "none",
47
47
  width: "0",
48
48
  height: "0",
49
49
  maxWidth: "0",
50
50
  maxHeight: "0"
51
- }, U = {
51
+ }, O = {
52
52
  border: "none",
53
53
  borderRadius: "10px",
54
54
  boxShadow: "0 0 10px 0 rgba(0, 0, 0, 0.1)",
@@ -60,15 +60,15 @@ const o = new I(), f = {
60
60
  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",
61
61
  zIndex: "9999"
62
62
  };
63
- class H {
63
+ class I {
64
64
  constructor() {
65
- this.config = null, this.widgetFrame = null, this.unsubsciptions = [], this.messageQueue = [], this.isQueueingEnabled = !1, this.isFrameReady = !1, this.isFrameAuthenticated = !1, this.postMessage = (e) => {
66
- var i;
67
- if (!((i = this.widgetFrame) != null && i.contentWindow)) {
65
+ this.config = null, this.widgetFrame = null, this.unsubsciptions = [], this.messageQueue = [], this.isQueueingEnabled = !1, this.methodRegistry = {}, this.isFrameReady = !1, this.isFrameAuthenticated = !1, this.postMessage = (e) => {
66
+ var s;
67
+ if (!((s = this.widgetFrame) != null && s.contentWindow)) {
68
68
  f.warn("No widget iframe to communicate with");
69
69
  return;
70
70
  }
71
- const t = c();
71
+ const t = m();
72
72
  this.widgetFrame.contentWindow.postMessage(e, {
73
73
  targetOrigin: t.insightBaseUrl
74
74
  });
@@ -89,60 +89,104 @@ class H {
89
89
  return;
90
90
  }
91
91
  this.postMessage(e);
92
+ }, this.handleMethodCall = async (e) => {
93
+ const { callId: t, methodName: s, args: o } = e, a = this.methodRegistry[s];
94
+ if (!a) {
95
+ this.postMessage({
96
+ type: "Method.Response",
97
+ payload: {
98
+ callId: t,
99
+ success: !1,
100
+ error: {
101
+ message: `Method "${s}" is not registered`,
102
+ code: "METHOD_NOT_FOUND"
103
+ }
104
+ }
105
+ });
106
+ return;
107
+ }
108
+ try {
109
+ const n = await a(o || {});
110
+ this.postMessage({
111
+ type: "Method.Response",
112
+ payload: {
113
+ callId: t,
114
+ success: !0,
115
+ result: n
116
+ }
117
+ });
118
+ } catch (n) {
119
+ const r = n instanceof Error ? n : new Error(String(n));
120
+ this.postMessage({
121
+ type: "Method.Response",
122
+ payload: {
123
+ callId: t,
124
+ success: !1,
125
+ error: {
126
+ message: r.message,
127
+ code: "METHOD_EXECUTION_ERROR",
128
+ stack: r.stack,
129
+ name: r.name,
130
+ cause: r.cause,
131
+ apiResponse: r.response
132
+ }
133
+ }
134
+ });
135
+ }
92
136
  }, this.init = (e) => new Promise((t) => {
93
137
  if (!this.widgetFrame) {
94
138
  this.reset(), this.enableQueue();
95
- const i = c(), {
96
- tenantId: a,
97
- tenantName: r,
98
- user: h,
99
- language: p,
100
- container: d,
101
- widgetId: b,
102
- widgetStyles: n
139
+ const s = m(), {
140
+ tenantId: o,
141
+ tenantName: a,
142
+ user: n,
143
+ language: r,
144
+ container: g,
145
+ widgetId: y,
146
+ widgetStyles: h
103
147
  } = e;
104
148
  this.config = e, this.isFrameReady = !1, this.widgetFrame = document.createElement("iframe");
105
- const F = (n == null ? void 0 : n.width) || "350px", y = (n == null ? void 0 : n.height) || "600px", Q = {
106
- ...U,
107
- ...n,
108
- ...m
149
+ const b = (h == null ? void 0 : h.width) || "350px", F = (h == null ? void 0 : h.height) || "600px", Q = {
150
+ ...O,
151
+ ...h,
152
+ ...p
109
153
  };
110
- Object.assign(this.widgetFrame.style, Q), this.widgetFrame.id = b || "aura-widget", this.widgetFrame.setAttribute(
154
+ Object.assign(this.widgetFrame.style, Q), this.widgetFrame.id = y || "aura-widget", this.widgetFrame.setAttribute(
111
155
  "allow",
112
- `microphone ${i.insightBaseUrl}; camera ${i.insightBaseUrl}; clipboard-read ${i.insightBaseUrl}; clipboard-write ${i.insightBaseUrl};`
113
- ), this.widgetFrame.src = `${i.insightBaseUrl}`, this.widgetFrame.__desiredWidth = F, this.widgetFrame.__desiredHeight = y, this.widgetFrame.onerror = () => {
156
+ `microphone ${s.insightBaseUrl}; camera ${s.insightBaseUrl}; clipboard-read ${s.insightBaseUrl}; clipboard-write ${s.insightBaseUrl};`
157
+ ), this.widgetFrame.src = `${s.insightBaseUrl}`, this.widgetFrame.__desiredWidth = b, this.widgetFrame.__desiredHeight = F, this.widgetFrame.onerror = () => {
114
158
  f.error(
115
159
  `Failed to load iframe. Please ensure your Content Security Policy includes:
116
- frame-src ${i.insightBaseUrl}
160
+ frame-src ${s.insightBaseUrl}
117
161
  `
118
162
  );
119
- }, (d && document.querySelector(d) || document.body).appendChild(this.widgetFrame);
120
- const x = o.subscribe("Auth.Ready", () => {
121
- this.isFrameReady = !0, this.setUser({ tenantId: a, tenantName: r, user: h, language: p });
122
- }), A = o.subscribe(
163
+ }, (g && document.querySelector(g) || document.body).appendChild(this.widgetFrame);
164
+ const E = d.subscribe("Auth.Ready", () => {
165
+ this.isFrameReady = !0, this.setUser({ tenantId: o, tenantName: a, user: n, language: r });
166
+ }), R = d.subscribe(
123
167
  "Auth.Complete",
124
- (g) => {
168
+ (c) => {
125
169
  var l;
126
- this.isFrameAuthenticated = !0, this.disableQueue(!0), t(g), (l = e.onAuthenticated) == null || l.call(e, g);
170
+ this.isFrameAuthenticated = !0, this.disableQueue(!0), t(c), (l = e.onAuthenticated) == null || l.call(e, c);
127
171
  }
128
172
  );
129
- this.unsubsciptions.push(x, A);
173
+ this.unsubsciptions.push(E, R);
130
174
  }
131
175
  }), this.setUser = (e) => {
132
- const t = this.config.partnerKey, { tenantId: i, tenantName: a, user: r, language: h } = e;
133
- this.config.tenantId = i, this.config.tenantName = a, this.config.user = r, this.config.language = h, this.isFrameAuthenticated = !1, this.postMessage({
176
+ const t = this.config.partnerKey, { tenantId: s, tenantName: o, user: a, language: n } = e;
177
+ this.config.tenantId = s, this.config.tenantName = o, this.config.user = a, this.config.language = n, this.isFrameAuthenticated = !1, this.postMessage({
134
178
  type: "Auth.Login",
135
179
  payload: {
136
180
  partnerKey: t,
137
- tenantId: i,
138
- tenantName: a,
139
- user: r,
140
- language: h
181
+ tenantId: s,
182
+ tenantName: o,
183
+ user: a,
184
+ language: n
141
185
  }
142
186
  });
143
187
  }, this.show = () => {
144
188
  if (this.widgetFrame) {
145
- const e = this.widgetFrame.__desiredWidth || "350px", t = this.widgetFrame.__desiredHeight || "600px", i = {
189
+ const e = this.widgetFrame.__desiredWidth || "350px", t = this.widgetFrame.__desiredHeight || "600px", s = {
146
190
  opacity: "1",
147
191
  pointerEvents: "auto",
148
192
  width: e,
@@ -150,36 +194,46 @@ class H {
150
194
  maxWidth: e,
151
195
  maxHeight: t
152
196
  };
153
- Object.assign(this.widgetFrame.style, { ...i });
197
+ Object.assign(this.widgetFrame.style, { ...s });
154
198
  }
155
199
  }, this.hide = () => {
156
- this.widgetFrame && Object.assign(this.widgetFrame.style, { ...m });
200
+ this.widgetFrame && Object.assign(this.widgetFrame.style, { ...p });
157
201
  }, this.reset = () => {
158
- 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();
202
+ 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 = {};
159
203
  }, this.command = (e) => {
160
204
  this.sendOrQueue(e), this.show();
161
- }, this.emit = this.command, this.on = (e, t) => o.subscribe(e, t), this.registerTemplates = (e) => {
205
+ }, this.emit = this.command, this.on = (e, t) => d.subscribe(e, t), this.registerTemplates = (e) => {
162
206
  this.sendOrQueue({
163
207
  type: "Template.Register",
164
208
  payload: e
165
209
  });
166
- }, this.getConfig = () => this.config, this.getVersion = () => B(), window.addEventListener(
210
+ }, this.registerMethod = (e, t) => {
211
+ this.methodRegistry[e] = t;
212
+ }, this.unregisterMethod = (e) => delete this.methodRegistry[e], this.getConfig = () => this.config, this.getVersion = () => A(), window.addEventListener(
167
213
  "message",
168
214
  (e) => {
169
215
  var t;
170
- e.source !== ((t = this.widgetFrame) == null ? void 0 : t.contentWindow) || !e.data || o.emit(e.data.type, e.data.payload);
216
+ if (!(e.source !== ((t = this.widgetFrame) == null ? void 0 : t.contentWindow) || !e.data)) {
217
+ if (e.data.type === "Method.Call") {
218
+ this.handleMethodCall(
219
+ e.data.payload
220
+ );
221
+ return;
222
+ }
223
+ d.emit(e.data.type, e.data.payload);
224
+ }
171
225
  }
172
226
  );
173
227
  }
174
228
  }
175
229
  let u = null;
176
- function $() {
177
- return u || (u = new H()), u;
230
+ function U() {
231
+ return u || (u = new I()), u;
178
232
  }
179
- const R = $();
233
+ const H = U();
180
234
  export {
181
- R as AuraWidget,
182
- v as configure,
183
- c as getConfig,
184
- B as getVersion
235
+ H as AuraWidget,
236
+ _ as configure,
237
+ m as getConfig,
238
+ A as getVersion
185
239
  };
package/dist/index.umd.js CHANGED
@@ -1,3 +1,3 @@
1
- (function(n,a){typeof exports=="object"&&typeof module<"u"?a(exports):typeof define=="function"&&define.amd?define(["exports"],a):(n=typeof globalThis<"u"?globalThis:n||self,a(n.InsightAura={}))})(this,function(n){"use strict";const a={insightBaseUrl:"https://anywhere.insighthealth.ai"};let c=null;function y(){return c}function Q(s){c={...a,...s}}function A(s){Q(s)}function g(){const s=y();if(!s)throw new Error("Aura SDK not configured. Call configure() first to set global configuration.");return s}function f(){return"0.0.9"}class x{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(i=>i!==t)}),this.emit=(e,t)=>{this.events[e]&&this.events[e].forEach(i=>i(t))}}}const h=new x,m={log:s=>{console.log(`[Insight Health Aura Widget]: ${s}`)},warn:s=>{console.warn(`[Insight Health Aura Widget]: ${s}`)},error:s=>{console.error(`[Insight Health Aura Widget]: ${s}`)}},w={opacity:"0",pointerEvents:"none",width:"0",height:"0",maxWidth:"0",maxHeight:"0"},W={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.isFrameReady=!1,this.isFrameAuthenticated=!1,this.postMessage=e=>{var i;if(!((i=this.widgetFrame)!=null&&i.contentWindow)){m.warn("No widget iframe to communicate with");return}const t=g();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.init=e=>new Promise(t=>{if(!this.widgetFrame){this.reset(),this.enableQueue();const i=g(),{tenantId:o,tenantName:u,user:d,language:B,container:p,widgetId:S,widgetStyles:r}=e;this.config=e,this.isFrameReady=!1,this.widgetFrame=document.createElement("iframe");const U=(r==null?void 0:r.width)||"350px",v=(r==null?void 0:r.height)||"600px",H={...W,...r,...w};Object.assign(this.widgetFrame.style,H),this.widgetFrame.id=S||"aura-widget",this.widgetFrame.setAttribute("allow",`microphone ${i.insightBaseUrl}; camera ${i.insightBaseUrl}; clipboard-read ${i.insightBaseUrl}; clipboard-write ${i.insightBaseUrl};`),this.widgetFrame.src=`${i.insightBaseUrl}`,this.widgetFrame.__desiredWidth=U,this.widgetFrame.__desiredHeight=v,this.widgetFrame.onerror=()=>{m.error(`Failed to load iframe. Please ensure your Content Security Policy includes:
2
- frame-src ${i.insightBaseUrl}
3
- `)},(p&&document.querySelector(p)||document.body).appendChild(this.widgetFrame);const $=h.subscribe("Auth.Ready",()=>{this.isFrameReady=!0,this.setUser({tenantId:o,tenantName:u,user:d,language:B})}),O=h.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($,O)}}),this.setUser=e=>{const t=this.config.partnerKey,{tenantId:i,tenantName:o,user:u,language:d}=e;this.config.tenantId=i,this.config.tenantName=o,this.config.user=u,this.config.language=d,this.isFrameAuthenticated=!1,this.postMessage({type:"Auth.Login",payload:{partnerKey:t,tenantId:i,tenantName:o,user:u,language:d}})},this.show=()=>{if(this.widgetFrame){const e=this.widgetFrame.__desiredWidth||"350px",t=this.widgetFrame.__desiredHeight||"600px",i={opacity:"1",pointerEvents:"auto",width:e,height:t,maxWidth:e,maxHeight:t};Object.assign(this.widgetFrame.style,{...i})}},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.command=e=>{this.sendOrQueue(e),this.show()},this.emit=this.command,this.on=(e,t)=>h.subscribe(e,t),this.registerTemplates=e=>{this.sendOrQueue({type:"Template.Register",payload:e})},this.getConfig=()=>this.config,this.getVersion=()=>f(),window.addEventListener("message",e=>{var t;e.source!==((t=this.widgetFrame)==null?void 0:t.contentWindow)||!e.data||h.emit(e.data.type,e.data.payload)})}}let l=null;function E(){return l||(l=new C),l}const I=E();n.AuraWidget=I,n.configure=A,n.getConfig=g,n.getVersion=f,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
1
+ (function(a,u){typeof exports=="object"&&typeof module<"u"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(a=typeof globalThis<"u"?globalThis:a||self,u(a.InsightAura={}))})(this,function(a){"use strict";const u={insightBaseUrl:"https://anywhere.insighthealth.ai"};let f=null;function Q(){return f}function E(i){f={...u,...i}}function M(i){E(i)}function c(){const i=Q();if(!i)throw new Error("Aura SDK not configured. Call configure() first to set global configuration.");return i}function m(){return"0.0.10-beta.0"}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,p={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)){p.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:d}=e,r=this.methodRegistry[s];if(!r){this.postMessage({type:"Method.Response",payload:{callId:t,success:!1,error:{message:`Method "${s}" is not registered`,code:"METHOD_NOT_FOUND"}}});return}try{const n=await r(d||{});this.postMessage({type:"Method.Response",payload:{callId:t,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,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=c(),{tenantId:d,tenantName:r,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=()=>{p.error(`Failed to load iframe. Please ensure your Content Security Policy includes:
2
+ frame-src ${s.insightBaseUrl}
3
+ `)},(y&&document.querySelector(y)||document.body).appendChild(this.widgetFrame);const H=g.subscribe("Auth.Ready",()=>{this.isFrameReady=!0,this.setUser({tenantId:d,tenantName:r,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:r,language:n}=e;this.config.tenantId=s,this.config.tenantName=d,this.config.user=r,this.config.language=n,this.isFrameAuthenticated=!1,this.postMessage({type:"Auth.Login",payload:{partnerKey:t,tenantId:s,tenantName:d,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,{...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)=>{this.methodRegistry[e]=t},this.unregisterMethod=e=>delete this.methodRegistry[e],this.getConfig=()=>this.config,this.getVersion=()=>m(),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 l=null;function x(){return l||(l=new C),l}const W=x();a.AuraWidget=W,a.configure=M,a.getConfig=c,a.getVersion=m,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
package/dist/types.d.ts CHANGED
@@ -35,4 +35,33 @@ export type AuraTemplate = {
35
35
  export type AuraRegisterTemplatePayload = {
36
36
  templates: AuraTemplate[];
37
37
  };
38
+ export type Extended<T> = T & {
39
+ [key: string]: unknown;
40
+ };
41
+ export type MethodHandler<TArgs extends Extended<unknown>, TResult = unknown> = (args: TArgs) => TResult | Promise<TResult>;
42
+ export type SupportedMethods = {
43
+ getProviderNotes: MethodHandler<{
44
+ providerId: string;
45
+ }, {
46
+ notes: string[];
47
+ }>;
48
+ };
49
+ export type MethodCallPayload<N extends keyof SupportedMethods, TArgs = Parameters<SupportedMethods[N]>[0]> = {
50
+ callId: string;
51
+ methodName: N;
52
+ args?: TArgs;
53
+ };
54
+ export type MethodResponsePayload<N extends keyof SupportedMethods, TResult = ReturnType<SupportedMethods[N]>> = {
55
+ callId: string;
56
+ success: boolean;
57
+ result?: TResult;
58
+ error?: {
59
+ message: string;
60
+ code?: string;
61
+ stack?: string;
62
+ name?: string;
63
+ cause?: unknown;
64
+ responseStatus?: number;
65
+ };
66
+ };
38
67
  //# sourceMappingURL=types.d.ts.map
@@ -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,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KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;CAC9E,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAC3B,CAAC,SAAS,MAAM,gBAAgB,EAChC,KAAK,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IACxC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,CAAC,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,qBAAqB,CAC/B,CAAC,SAAS,MAAM,gBAAgB,EAChC,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,IACvC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,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,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insight-health/aura",
3
- "version": "0.0.9",
3
+ "version": "0.0.10-beta.0",
4
4
  "description": "Aura SDK package for Insight Health AI",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",