generio-sdk 1.0.94 → 1.0.95

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
@@ -313,11 +313,38 @@ function getGenerioRecognizeExaminationUrl(studyInstanceUId, modality, studyDesc
313
313
  if (bodyPartExamined) url = url + `&bodyPartExamined=${bodyPartExamined}`;
314
314
  return url;
315
315
  }
316
+ async function checkAuthentication(origin) {
317
+ try {
318
+ const response = await fetch(`${origin ?? GENERIO_ORIGIN}/api/CookiesAuth/isAuthenticated`, {
319
+ method: "GET",
320
+ credentials: "include",
321
+ headers: { "Content-Type": "application/json" }
322
+ });
323
+ if (response.ok) {
324
+ const data = await response.json();
325
+ if (data.isAuthenticated) return {
326
+ isAuthenticated: true,
327
+ email: data.email
328
+ };
329
+ return {
330
+ isAuthenticated: false,
331
+ email: ""
332
+ };
333
+ }
334
+ } catch (error) {
335
+ console.error("Auth check failed:", error);
336
+ }
337
+ return {
338
+ isAuthenticated: false,
339
+ email: ""
340
+ };
341
+ }
316
342
 
317
343
  //#endregion
318
344
  exports.ExaminationDataHelpers = ExaminationDataHelpers;
319
345
  exports.FormTypeEnum = FormTypeEnum;
320
346
  exports.GENERIO_ORIGIN = GENERIO_ORIGIN;
347
+ exports.checkAuthentication = checkAuthentication;
321
348
  exports.getAnnotationPlacements = getAnnotationPlacements;
322
349
  exports.getExaminationMessage = getExaminationMessage;
323
350
  exports.getExtParamValueByStudyInstanceUId = getExtParamValueByStudyInstanceUId;
package/dist/index.d.cts CHANGED
@@ -315,5 +315,9 @@ declare function sendMeasurements(model: SendMeasurementsInputModel, origin?: st
315
315
  declare function getExaminationMessage(model: GetExaminationMessageInputModel, origin?: string): Promise<GetExaminationMessageOutputModel>;
316
316
  declare function setupPostMessageListeners(generioReadyHandler?: (model: GenerioReadyOutputModel, event: MessageEvent) => void, origin?: string): void;
317
317
  declare function getGenerioRecognizeExaminationUrl(studyInstanceUId: string, modality: string, studyDescription?: string, bodyPartExamined?: string, origin?: string): string;
318
+ declare function checkAuthentication(origin?: string): Promise<{
319
+ isAuthenticated: boolean;
320
+ email: string;
321
+ }>;
318
322
  //#endregion
319
- export { AnnotationPlacement, type AppendDiagnoseFormHandlebarsModel, type Column, type ElementColumn, type ElementRow, type ElementSubRow, ExaminationDataHelpers, type FindingGeneratorFormHandlebarsModel, FormElementStateInputModel, FormElementStateViewModel, FormTypeEnum, GENERIO_ORIGIN, GenerioReadyOutputModel, GetAnnotationPlacementsInputModel, GetAnnotationPlacementsOutputModel, GetExaminationMessageInputModel, GetExaminationMessageOutputModel, GetExtParamValueByStudyInstanceUIdInputModel, GetExtParamValueByStudyInstanceUIdOutputModel, KeyValueModel, LoadFormDataOutputModel, LoadStudyViewModel, LoginInputModel, LoginOutputModel, LogoutOutputModel, MeasurementModel, type OriginDataItem, type OriginDetail, type OriginElementDetail, RecognizeExaminationInputModel, RecognizeExaminationOutputModel, SendMeasurementsInputModel, SendMeasurementsOutputModel, SetExtParamsInputModel, SetExtParamsOutputModel, UpdateStudyInputModel, UpdateStudyOutputModel, getAnnotationPlacements, getExaminationMessage, getExtParamValueByStudyInstanceUId, getGenerioRecognizeExaminationUrl, loadFormData, loadStudy, login, logout, recognizeExamination, sendMeasurements, setExtParams, setExtParamsPostMessage, setupPostMessageListeners, updateStudy };
323
+ export { AnnotationPlacement, type AppendDiagnoseFormHandlebarsModel, type Column, type ElementColumn, type ElementRow, type ElementSubRow, ExaminationDataHelpers, type FindingGeneratorFormHandlebarsModel, FormElementStateInputModel, FormElementStateViewModel, FormTypeEnum, GENERIO_ORIGIN, GenerioReadyOutputModel, GetAnnotationPlacementsInputModel, GetAnnotationPlacementsOutputModel, GetExaminationMessageInputModel, GetExaminationMessageOutputModel, GetExtParamValueByStudyInstanceUIdInputModel, GetExtParamValueByStudyInstanceUIdOutputModel, KeyValueModel, LoadFormDataOutputModel, LoadStudyViewModel, LoginInputModel, LoginOutputModel, LogoutOutputModel, MeasurementModel, type OriginDataItem, type OriginDetail, type OriginElementDetail, RecognizeExaminationInputModel, RecognizeExaminationOutputModel, SendMeasurementsInputModel, SendMeasurementsOutputModel, SetExtParamsInputModel, SetExtParamsOutputModel, UpdateStudyInputModel, UpdateStudyOutputModel, checkAuthentication, getAnnotationPlacements, getExaminationMessage, getExtParamValueByStudyInstanceUId, getGenerioRecognizeExaminationUrl, loadFormData, loadStudy, login, logout, recognizeExamination, sendMeasurements, setExtParams, setExtParamsPostMessage, setupPostMessageListeners, updateStudy };
package/dist/index.d.ts CHANGED
@@ -315,5 +315,9 @@ declare function sendMeasurements(model: SendMeasurementsInputModel, origin?: st
315
315
  declare function getExaminationMessage(model: GetExaminationMessageInputModel, origin?: string): Promise<GetExaminationMessageOutputModel>;
316
316
  declare function setupPostMessageListeners(generioReadyHandler?: (model: GenerioReadyOutputModel, event: MessageEvent) => void, origin?: string): void;
317
317
  declare function getGenerioRecognizeExaminationUrl(studyInstanceUId: string, modality: string, studyDescription?: string, bodyPartExamined?: string, origin?: string): string;
318
+ declare function checkAuthentication(origin?: string): Promise<{
319
+ isAuthenticated: boolean;
320
+ email: string;
321
+ }>;
318
322
  //#endregion
319
- export { AnnotationPlacement, type AppendDiagnoseFormHandlebarsModel, type Column, type ElementColumn, type ElementRow, type ElementSubRow, ExaminationDataHelpers, type FindingGeneratorFormHandlebarsModel, FormElementStateInputModel, FormElementStateViewModel, FormTypeEnum, GENERIO_ORIGIN, GenerioReadyOutputModel, GetAnnotationPlacementsInputModel, GetAnnotationPlacementsOutputModel, GetExaminationMessageInputModel, GetExaminationMessageOutputModel, GetExtParamValueByStudyInstanceUIdInputModel, GetExtParamValueByStudyInstanceUIdOutputModel, KeyValueModel, LoadFormDataOutputModel, LoadStudyViewModel, LoginInputModel, LoginOutputModel, LogoutOutputModel, MeasurementModel, type OriginDataItem, type OriginDetail, type OriginElementDetail, RecognizeExaminationInputModel, RecognizeExaminationOutputModel, SendMeasurementsInputModel, SendMeasurementsOutputModel, SetExtParamsInputModel, SetExtParamsOutputModel, UpdateStudyInputModel, UpdateStudyOutputModel, getAnnotationPlacements, getExaminationMessage, getExtParamValueByStudyInstanceUId, getGenerioRecognizeExaminationUrl, loadFormData, loadStudy, login, logout, recognizeExamination, sendMeasurements, setExtParams, setExtParamsPostMessage, setupPostMessageListeners, updateStudy };
323
+ export { AnnotationPlacement, type AppendDiagnoseFormHandlebarsModel, type Column, type ElementColumn, type ElementRow, type ElementSubRow, ExaminationDataHelpers, type FindingGeneratorFormHandlebarsModel, FormElementStateInputModel, FormElementStateViewModel, FormTypeEnum, GENERIO_ORIGIN, GenerioReadyOutputModel, GetAnnotationPlacementsInputModel, GetAnnotationPlacementsOutputModel, GetExaminationMessageInputModel, GetExaminationMessageOutputModel, GetExtParamValueByStudyInstanceUIdInputModel, GetExtParamValueByStudyInstanceUIdOutputModel, KeyValueModel, LoadFormDataOutputModel, LoadStudyViewModel, LoginInputModel, LoginOutputModel, LogoutOutputModel, MeasurementModel, type OriginDataItem, type OriginDetail, type OriginElementDetail, RecognizeExaminationInputModel, RecognizeExaminationOutputModel, SendMeasurementsInputModel, SendMeasurementsOutputModel, SetExtParamsInputModel, SetExtParamsOutputModel, UpdateStudyInputModel, UpdateStudyOutputModel, checkAuthentication, getAnnotationPlacements, getExaminationMessage, getExtParamValueByStudyInstanceUId, getGenerioRecognizeExaminationUrl, loadFormData, loadStudy, login, logout, recognizeExamination, sendMeasurements, setExtParams, setExtParamsPostMessage, setupPostMessageListeners, updateStudy };
package/dist/index.js CHANGED
@@ -289,6 +289,32 @@ function getGenerioRecognizeExaminationUrl(studyInstanceUId, modality, studyDesc
289
289
  if (bodyPartExamined) url = url + `&bodyPartExamined=${bodyPartExamined}`;
290
290
  return url;
291
291
  }
292
+ async function checkAuthentication(origin) {
293
+ try {
294
+ const response = await fetch(`${origin ?? GENERIO_ORIGIN}/api/CookiesAuth/isAuthenticated`, {
295
+ method: "GET",
296
+ credentials: "include",
297
+ headers: { "Content-Type": "application/json" }
298
+ });
299
+ if (response.ok) {
300
+ const data = await response.json();
301
+ if (data.isAuthenticated) return {
302
+ isAuthenticated: true,
303
+ email: data.email
304
+ };
305
+ return {
306
+ isAuthenticated: false,
307
+ email: ""
308
+ };
309
+ }
310
+ } catch (error) {
311
+ console.error("Auth check failed:", error);
312
+ }
313
+ return {
314
+ isAuthenticated: false,
315
+ email: ""
316
+ };
317
+ }
292
318
 
293
319
  //#endregion
294
- export { ExaminationDataHelpers, FormTypeEnum, GENERIO_ORIGIN, getAnnotationPlacements, getExaminationMessage, getExtParamValueByStudyInstanceUId, getGenerioRecognizeExaminationUrl, loadFormData, loadStudy, login, logout, recognizeExamination, sendMeasurements, setExtParams, setExtParamsPostMessage, setupPostMessageListeners, updateStudy };
320
+ export { ExaminationDataHelpers, FormTypeEnum, GENERIO_ORIGIN, checkAuthentication, getAnnotationPlacements, getExaminationMessage, getExtParamValueByStudyInstanceUId, getGenerioRecognizeExaminationUrl, loadFormData, loadStudy, login, logout, recognizeExamination, sendMeasurements, setExtParams, setExtParamsPostMessage, setupPostMessageListeners, updateStudy };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generio-sdk",
3
- "version": "1.0.94",
3
+ "version": "1.0.95",
4
4
  "description": "SDK library for generio integration",
5
5
  "type": "module",
6
6
  "license": "MIT",