generio-sdk 1.0.23 → 1.0.25

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.d.ts CHANGED
@@ -81,12 +81,12 @@ interface LogoutOutputModel {
81
81
  isSuccess: boolean;
82
82
  }
83
83
  //#endregion
84
+ //#region src/models/GenerioReadyOutputModel.d.ts
85
+ interface GenerioReadyOutputModel {
86
+ studyInstanceUId: string;
87
+ }
88
+ //#endregion
84
89
  //#region src/index.d.ts
85
- type HandlerType = (event: {
86
- source: Window | null;
87
- origin: string;
88
- data: any;
89
- }) => Promise<void>;
90
90
  declare const GENERIO_ORIGIN = "https://localhost:7052";
91
91
  declare function recognizeExamination(model: RecognizeExaminationInputModel): Promise<RecognizeExaminationOutputModel>;
92
92
  declare function setExtParams(model: SetExtParamsInputModel, win: Window): Promise<SetExtParamsOutputModel>;
@@ -96,7 +96,6 @@ declare function getExaminationMessage(win: Window): Promise<GetExaminationMessa
96
96
  declare function login(model: LoginInputModel): Promise<LoginOutputModel>;
97
97
  declare function logout(): Promise<LogoutOutputModel>;
98
98
  declare function getLoggedInEmail(): string | null;
99
- declare function setupGenerioReadyListener(handler: HandlerType): void;
100
- declare const generioReadyHandler: HandlerType;
99
+ declare function setupPostMessageListener(generioReadyHandler?: (payload: GenerioReadyOutputModel) => void): void;
101
100
  //#endregion
102
- export { GENERIO_ORIGIN, GetExaminationMessageOutputModel, GetExtParamValueByStudyInstanceUIdInputModel, GetExtParamValueByStudyInstanceUIdOutputModel, KeyValueModel, LoginInputModel, LoginOutputModel, LogoutOutputModel, MeasurementModel, RecognizeExaminationInputModel, RecognizeExaminationOutputModel, SendMeasurementsInputModel, SendMeasurementsOutputModel, SetExtParamsInputModel, SetExtParamsOutputModel, generioReadyHandler, getExaminationMessage, getExtParamValueByStudyInstanceUId, getLoggedInEmail, login, logout, recognizeExamination, sendMeasurements, setExtParams, setupGenerioReadyListener };
101
+ export { GENERIO_ORIGIN, GetExaminationMessageOutputModel, GetExtParamValueByStudyInstanceUIdInputModel, GetExtParamValueByStudyInstanceUIdOutputModel, KeyValueModel, LoginInputModel, LoginOutputModel, LogoutOutputModel, MeasurementModel, RecognizeExaminationInputModel, RecognizeExaminationOutputModel, SendMeasurementsInputModel, SendMeasurementsOutputModel, SetExtParamsInputModel, SetExtParamsOutputModel, getExaminationMessage, getExtParamValueByStudyInstanceUId, getLoggedInEmail, login, logout, recognizeExamination, sendMeasurements, setExtParams, setupPostMessageListener };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import*as e from"post-robot";const t=`https://localhost:7052`;async function n(e){t+``;let n=await fetch(`https://localhost:7052/api/generioApp/recognizeExaminationByUserContext`,{method:`POST`,credentials:`include`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});return n.ok?n.json():{isSuccess:!1}}async function r(n,r){let{data:i}=await e.send(r,`setExtParams`,n,{domain:t});return i}async function i(n,r){let{data:i}=await e.send(r,`sendMeasurements`,n,{domain:t});return i}async function a(n,r){let{data:i}=await e.send(r,`getExtParamValueByStudyInstanceUId`,n,{domain:t});return i}async function o(n){let{data:r}=await e.send(n,`getExaminationMessage`,void 0,{domain:t});return r}async function s(e){return(await fetch(t+`/api/cookiesAuth/login`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})).ok?(localStorage.setItem(`generio_logged_in_email`,e.email),{isSuccess:!0}):{isSuccess:!1}}async function c(){return(await fetch(t+`/api/cookiesAuth/logout`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`}})).ok?(localStorage.removeItem(`generio_logged_in_email`),{isSuccess:!0}):{isSuccess:!1}}function l(){return localStorage.getItem(`generio_logged_in_email`)}function u(n){e.on(`generioReady`,{domain:t},e=>n(e))}const d=async({source:e,origin:t,data:n})=>{console.log(`Generio is ready:`,t,n),await r({keyValues:[{key:`mr_protocol`,value:`mr_protocol test`}]},e)};export{t as GENERIO_ORIGIN,d as generioReadyHandler,o as getExaminationMessage,a as getExtParamValueByStudyInstanceUId,l as getLoggedInEmail,s as login,c as logout,n as recognizeExamination,i as sendMeasurements,r as setExtParams,u as setupGenerioReadyListener};
1
+ const e=`https://localhost:7052`;async function t(t){e+``;let n=await fetch(`https://localhost:7052/api/generioApp/recognizeExaminationByUserContext`,{method:`POST`,credentials:`include`,body:JSON.stringify(t),headers:{"Content-Type":`application/json`}});return n.ok?n.json():{isSuccess:!1}}async function n(e,t){return{}}async function r(e,t){return{}}async function i(e,t){return{}}async function a(e){return{}}async function o(t){return(await fetch(e+`/api/cookiesAuth/login`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})).ok?(localStorage.setItem(`generio_logged_in_email`,t.email),{isSuccess:!0}):{isSuccess:!1}}async function s(){return(await fetch(e+`/api/cookiesAuth/logout`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`}})).ok?(localStorage.removeItem(`generio_logged_in_email`),{isSuccess:!0}):{isSuccess:!1}}function c(){return localStorage.getItem(`generio_logged_in_email`)}function l(t){window.addEventListener(`message`,n=>{e==n.origin&&(console.info(`PostMessageListener: Received message from origin: ${n.origin}`,n.data),n.data.action==`generioReady`&&t&&t(n.data.payload))},!1)}export{e as GENERIO_ORIGIN,a as getExaminationMessage,i as getExtParamValueByStudyInstanceUId,c as getLoggedInEmail,o as login,s as logout,t as recognizeExamination,r as sendMeasurements,n as setExtParams,l as setupPostMessageListener};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generio-sdk",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
4
4
  "description": "SDK library for generio integration",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -36,8 +36,5 @@
36
36
  "tsdown": "^0.15.11",
37
37
  "typescript": "^5.9.3",
38
38
  "vitest": "^4.0.4"
39
- },
40
- "dependencies": {
41
- "post-robot": "^8.0.32"
42
39
  }
43
40
  }