@dotbase/safe-frame-sync 1.13.2 → 1.14.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.
- package/dist/index.d.ts +39 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type MessageType = "editResource" | "createResource" | "closeBuilder" | "closeDocument" | "setBreadcrumbs" | "goToPatient" | "iframeRouteChange" | "sessionExpired" | "iframeReady" | "createDraft" | "createdDraft" | "draftSaved" | "openDocumentCapture" | "documentLoadError" | "reloadDocument" | "openDoctorsLetterExport";
|
|
1
|
+
export type MessageType = "editResource" | "createResource" | "closeBuilder" | "closeDocument" | "setBreadcrumbs" | "goToPatient" | "iframeRouteChange" | "sessionExpired" | "iframeReady" | "createDraft" | "createdDraft" | "draftSaved" | "openDocumentCapture" | "documentLoadError" | "reloadDocument" | "openDoctorsLetterExport" | "patientLoaded" | "createDraftFailed";
|
|
2
2
|
export type WorkflowType = "document" | "patient-report";
|
|
3
3
|
export interface BreadcrumbItemType {
|
|
4
4
|
to: string;
|
|
@@ -45,15 +45,50 @@ export interface SessionExpiredType {
|
|
|
45
45
|
export interface IframeReadyType {
|
|
46
46
|
type: "iframeReady";
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* The embedded app has a patient open and is able to answer messages about it.
|
|
50
|
+
*
|
|
51
|
+
* `iframeReady` only says the shell mounted; the handlers for patient-scoped messages live in the
|
|
52
|
+
* lazily loaded patient view and do not exist yet at that point, so a message sent in between is
|
|
53
|
+
* delivered to a window with no listener and lost. This carries the patient id because readiness is
|
|
54
|
+
* per patient: a patient switch makes the frame un-ready until the next one arrives.
|
|
55
|
+
*/
|
|
56
|
+
export interface PatientLoadedType {
|
|
57
|
+
type: "patientLoaded";
|
|
58
|
+
patientId: string;
|
|
59
|
+
}
|
|
48
60
|
export interface CreateDraftType {
|
|
49
61
|
type: "createDraft";
|
|
50
62
|
templateId: string;
|
|
51
63
|
patientId: string;
|
|
64
|
+
/**
|
|
65
|
+
* Correlates the reply with this request, so an answer to a superseded or already abandoned
|
|
66
|
+
* request is not mistaken for the answer to the current one.
|
|
67
|
+
*/
|
|
68
|
+
requestId: string;
|
|
52
69
|
}
|
|
53
70
|
export interface CreatedDraftType {
|
|
54
71
|
type: "createdDraft";
|
|
55
72
|
documentId: string;
|
|
56
73
|
patientId: string;
|
|
74
|
+
/** Echoes `CreateDraftType.requestId`. */
|
|
75
|
+
requestId: string;
|
|
76
|
+
}
|
|
77
|
+
/** Why a `createDraft` request produced no draft, at the granularity the sender can act on. */
|
|
78
|
+
export type CreateDraftFailureReason =
|
|
79
|
+
/** The template could not be resolved or could not be assembled into a draft. */
|
|
80
|
+
"template-unavailable"
|
|
81
|
+
/** The patient could not be loaded, or is no longer the one the request named. */
|
|
82
|
+
| "patient-unavailable"
|
|
83
|
+
/** The draft was built but could not be stored locally. */
|
|
84
|
+
| "save-failed";
|
|
85
|
+
export interface CreateDraftFailedType {
|
|
86
|
+
type: "createDraftFailed";
|
|
87
|
+
templateId: string;
|
|
88
|
+
patientId: string;
|
|
89
|
+
reason: CreateDraftFailureReason;
|
|
90
|
+
/** Echoes `CreateDraftType.requestId`. */
|
|
91
|
+
requestId: string;
|
|
57
92
|
}
|
|
58
93
|
export interface DraftSavedType {
|
|
59
94
|
type: "draftSaved";
|
|
@@ -75,7 +110,7 @@ export interface OpenDoctorsLetterExportType {
|
|
|
75
110
|
procedureId: string;
|
|
76
111
|
documentTemplateId: string;
|
|
77
112
|
}
|
|
78
|
-
export type MesssageDataType = EditResourceType | CreateResourceType | CloseBuilderType | CloseDocumentType | SetBreadcrumbsType | GoToPatientType | IframeRouteChangeType | SessionExpiredType | IframeReadyType | CreateDraftType | CreatedDraftType | DraftSavedType | OpenDocumentCaptureType | DocumentLoadErrorType | ReloadDocumentType | OpenDoctorsLetterExportType;
|
|
113
|
+
export type MesssageDataType = EditResourceType | CreateResourceType | CloseBuilderType | CloseDocumentType | SetBreadcrumbsType | GoToPatientType | IframeRouteChangeType | SessionExpiredType | IframeReadyType | PatientLoadedType | CreateDraftType | CreatedDraftType | CreateDraftFailedType | DraftSavedType | OpenDocumentCaptureType | DocumentLoadErrorType | ReloadDocumentType | OpenDoctorsLetterExportType;
|
|
79
114
|
export interface MessageDataMapType {
|
|
80
115
|
editResource: EditResourceType;
|
|
81
116
|
createResource: CreateResourceType;
|
|
@@ -86,8 +121,10 @@ export interface MessageDataMapType {
|
|
|
86
121
|
iframeRouteChange: IframeRouteChangeType;
|
|
87
122
|
sessionExpired: SessionExpiredType;
|
|
88
123
|
iframeReady: IframeReadyType;
|
|
124
|
+
patientLoaded: PatientLoadedType;
|
|
89
125
|
createDraft: CreateDraftType;
|
|
90
126
|
createdDraft: CreatedDraftType;
|
|
127
|
+
createDraftFailed: CreateDraftFailedType;
|
|
91
128
|
draftSaved: DraftSavedType;
|
|
92
129
|
openDocumentCapture: OpenDocumentCaptureType;
|
|
93
130
|
documentLoadError: DocumentLoadErrorType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotbase/safe-frame-sync",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "Typesafe iframe and parent communication between Dotstudio and Dotclinic",
|
|
5
5
|
"homepage": "https://github.com/dot-base/safe-frame-sync",
|
|
6
6
|
"types": "dist/index.d.ts",
|