@openmrs/esm-framework 10.0.1-pre.5539 → 10.0.1-pre.5545

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.
Files changed (175) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/dist/deprecated.d.ts +63 -0
  3. package/dist/deprecated.d.ts.map +1 -0
  4. package/dist/deprecated.js +65 -0
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1 -1
  8. package/dist/internal.d.ts +1 -1
  9. package/dist/internal.d.ts.map +1 -1
  10. package/dist/internal.js +1 -1
  11. package/docs/API.md +0 -47
  12. package/docs/classes/OpenmrsFetchError.md +4 -4
  13. package/docs/enumerations/VisitMode.md +4 -4
  14. package/docs/enumerations/VisitStatus.md +3 -3
  15. package/docs/functions/attach.md +1 -1
  16. package/docs/functions/clearCurrentUser.md +1 -1
  17. package/docs/functions/createErrorHandler.md +1 -1
  18. package/docs/functions/detach.md +1 -1
  19. package/docs/functions/detachAll.md +1 -1
  20. package/docs/functions/fetchCurrentPatient.md +5 -15
  21. package/docs/functions/getAssignedExtensions.md +1 -1
  22. package/docs/functions/getCoreTranslation.md +1 -1
  23. package/docs/functions/getCurrentUser.md +31 -41
  24. package/docs/functions/getDynamicOfflineDataEntries.md +11 -10
  25. package/docs/functions/getExtensionNameFromId.md +1 -1
  26. package/docs/functions/getExtensionStore.md +1 -1
  27. package/docs/functions/getLocations.md +3 -3
  28. package/docs/functions/getLoggedInUser.md +1 -1
  29. package/docs/functions/getSessionLocation.md +1 -1
  30. package/docs/functions/getSessionStore.md +1 -1
  31. package/docs/functions/getSynchronizationItems.md +11 -9
  32. package/docs/functions/getVisitStore.md +1 -1
  33. package/docs/functions/getVisitTypes.md +15 -8
  34. package/docs/functions/getVisitsForPatient.md +1 -1
  35. package/docs/functions/isVersionSatisfied.md +1 -1
  36. package/docs/functions/makeUrl.md +1 -1
  37. package/docs/functions/messageOmrsServiceWorker.md +13 -11
  38. package/docs/functions/openmrsFetch.md +1 -1
  39. package/docs/functions/refetchCurrentUser.md +4 -4
  40. package/docs/functions/renderExtension.md +1 -1
  41. package/docs/functions/reportError.md +1 -1
  42. package/docs/functions/saveVisit.md +1 -1
  43. package/docs/functions/setCurrentVisit.md +1 -1
  44. package/docs/functions/setSessionLocation.md +1 -1
  45. package/docs/functions/setUserLanguage.md +1 -1
  46. package/docs/functions/setUserProperties.md +1 -1
  47. package/docs/functions/setupDynamicOfflineDataHandler.md +17 -9
  48. package/docs/functions/setupOfflineSync.md +17 -24
  49. package/docs/functions/subscribeActionableNotificationShown.md +1 -1
  50. package/docs/functions/subscribeNotificationShown.md +1 -1
  51. package/docs/functions/subscribePrecacheStaticDependencies.md +11 -4
  52. package/docs/functions/subscribeSnackbarShown.md +1 -1
  53. package/docs/functions/subscribeToastShown.md +1 -1
  54. package/docs/functions/toLocationObject.md +1 -1
  55. package/docs/functions/toVisitTypeObject.md +1 -1
  56. package/docs/functions/updateVisit.md +1 -1
  57. package/docs/functions/useConnectivity.md +6 -16
  58. package/docs/functions/useLocations.md +1 -1
  59. package/docs/functions/useVisitTypes.md +1 -1
  60. package/docs/functions/userHasAccess.md +1 -1
  61. package/docs/interfaces/AssignedExtension.md +8 -24
  62. package/docs/interfaces/CancelLoading.md +2 -2
  63. package/docs/interfaces/ConnectedExtension.md +6 -6
  64. package/docs/interfaces/CurrentPatientOptions.md +2 -2
  65. package/docs/interfaces/DisplayConditionsConfigObject.md +0 -20
  66. package/docs/interfaces/ExtensionRegistration.md +3 -19
  67. package/docs/interfaces/ExtensionSlotConfig.md +5 -5
  68. package/docs/interfaces/ExtensionSlotConfigureValueObject.md +1 -1
  69. package/docs/interfaces/ExtensionSlotProps.md +2 -2
  70. package/docs/interfaces/ExtensionSlotState.md +3 -3
  71. package/docs/interfaces/ExtensionStore.md +2 -2
  72. package/docs/interfaces/FeatureFlagDefinition.md +4 -4
  73. package/docs/interfaces/FetchConfig.md +3 -3
  74. package/docs/interfaces/FetchError.md +3 -3
  75. package/docs/interfaces/FetchHeaders.md +1 -1
  76. package/docs/interfaces/FetchResponseJson.md +1 -1
  77. package/docs/interfaces/ImportMap.md +2 -2
  78. package/docs/interfaces/OnlyThePatient.md +2 -2
  79. package/docs/interfaces/OpenmrsAppRoutes.md +13 -13
  80. package/docs/interfaces/OpenmrsRoutes.md +3 -3
  81. package/docs/interfaces/PatientWithFullResponse.md +2 -2
  82. package/docs/interfaces/ResourceLoader.md +2 -2
  83. package/docs/interfaces/ShowActionableNotificationEvent.md +7 -7
  84. package/docs/interfaces/ShowNotificationEvent.md +6 -6
  85. package/docs/interfaces/ShowSnackbarEvent.md +9 -9
  86. package/docs/interfaces/ShowToastEvent.md +6 -6
  87. package/docs/interfaces/SpaConfig.md +5 -21
  88. package/docs/interfaces/VisitItem.md +5 -5
  89. package/docs/interfaces/VisitStoreState.md +3 -3
  90. package/docs/interfaces/WorkspaceDefinition2.md +5 -5
  91. package/docs/interfaces/WorkspaceGroupDefinition.md +3 -3
  92. package/docs/interfaces/WorkspaceGroupDefinition2.md +6 -6
  93. package/docs/interfaces/WorkspaceWindowDefinition2.md +7 -7
  94. package/docs/type-aliases/ConfigValue.md +1 -1
  95. package/docs/type-aliases/CurrentPatient.md +1 -1
  96. package/docs/type-aliases/ExtensionDefinition.md +10 -30
  97. package/docs/type-aliases/ExtensionSlotCustomState.md +1 -1
  98. package/docs/type-aliases/LoadedSessionStore.md +3 -3
  99. package/docs/type-aliases/ModalDefinition.md +3 -3
  100. package/docs/type-aliases/NameUse.md +1 -1
  101. package/docs/type-aliases/PageDefinition.md +1 -13
  102. package/docs/type-aliases/PatientUuid.md +1 -1
  103. package/docs/type-aliases/ProvidedConfig.md +3 -3
  104. package/docs/type-aliases/SessionStore.md +1 -1
  105. package/docs/type-aliases/SpaEnvironment.md +1 -1
  106. package/docs/type-aliases/UnloadedSessionStore.md +3 -3
  107. package/docs/type-aliases/Validator.md +1 -1
  108. package/docs/type-aliases/ValidatorFunction.md +1 -1
  109. package/docs/type-aliases/WorkspaceDefinition.md +10 -10
  110. package/docs/type-aliases/WorkspaceWindowState.md +1 -1
  111. package/docs/variables/defaultVisitCustomRepresentation.md +1 -1
  112. package/docs/variables/fhirBaseUrl.md +1 -1
  113. package/docs/variables/restBaseUrl.md +1 -1
  114. package/docs/variables/sessionEndpoint.md +1 -1
  115. package/docs/variables/visitTypesUrl.md +9 -0
  116. package/mock-jest.tsx +12 -4
  117. package/mock.tsx +12 -4
  118. package/package.json +19 -21
  119. package/src/deprecated.ts +87 -0
  120. package/src/index.ts +1 -1
  121. package/src/internal.ts +1 -1
  122. package/tsconfig.typedoc.json +0 -2
  123. package/docs/functions/beginEditSynchronizationItem.md +0 -22
  124. package/docs/functions/canBeginEditSynchronizationItemsOfType.md +0 -22
  125. package/docs/functions/deleteSynchronizationItem.md +0 -21
  126. package/docs/functions/generateOfflineUuid.md +0 -13
  127. package/docs/functions/getCurrentOfflineMode.md +0 -11
  128. package/docs/functions/getDynamicOfflineDataEntriesFor.md +0 -34
  129. package/docs/functions/getDynamicOfflineDataHandlers.md +0 -13
  130. package/docs/functions/getFullSynchronizationItems.md +0 -27
  131. package/docs/functions/getFullSynchronizationItemsFor.md +0 -33
  132. package/docs/functions/getOfflinePatientDataStore.md +0 -15
  133. package/docs/functions/getSynchronizationItem.md +0 -27
  134. package/docs/functions/isOfflineUuid.md +0 -19
  135. package/docs/functions/isOnline.md +0 -27
  136. package/docs/functions/openmrsObservableFetch.md +0 -55
  137. package/docs/functions/putDynamicOfflineData.md +0 -28
  138. package/docs/functions/putDynamicOfflineDataFor.md +0 -34
  139. package/docs/functions/queueSynchronizationItem.md +0 -39
  140. package/docs/functions/registerOfflinePatientHandler.md +0 -25
  141. package/docs/functions/removeDynamicOfflineData.md +0 -28
  142. package/docs/functions/removeDynamicOfflineDataFor.md +0 -34
  143. package/docs/functions/subscribeConnectivity.md +0 -21
  144. package/docs/functions/subscribeConnectivityChanged.md +0 -21
  145. package/docs/functions/syncAllDynamicOfflineData.md +0 -27
  146. package/docs/functions/syncDynamicOfflineData.md +0 -33
  147. package/docs/functions/syncOfflinePatientData.md +0 -21
  148. package/docs/interfaces/ClearDynamicRoutesMessage.md +0 -21
  149. package/docs/interfaces/ConnectivityChangedEvent.md +0 -13
  150. package/docs/interfaces/DynamicOfflineData.md +0 -60
  151. package/docs/interfaces/DynamicOfflineDataHandler.md +0 -98
  152. package/docs/interfaces/DynamicOfflineDataSyncState.md +0 -65
  153. package/docs/interfaces/MessageServiceWorkerResult.md +0 -35
  154. package/docs/interfaces/OfflineModeResult.md +0 -29
  155. package/docs/interfaces/OfflinePatientArgs.md +0 -25
  156. package/docs/interfaces/OfflinePatientDataSyncHandler.md +0 -35
  157. package/docs/interfaces/OfflinePatientDataSyncState.md +0 -61
  158. package/docs/interfaces/OfflinePatientDataSyncStore.md +0 -25
  159. package/docs/interfaces/OmrsServiceWorkerMessage.md +0 -25
  160. package/docs/interfaces/OnImportMapChangedMessage.md +0 -29
  161. package/docs/interfaces/PrecacheStaticDependenciesEvent.md +0 -5
  162. package/docs/interfaces/QueueItemDescriptor.md +0 -50
  163. package/docs/interfaces/RegisterDynamicRouteMessage.md +0 -45
  164. package/docs/interfaces/SyncItem.md +0 -79
  165. package/docs/interfaces/SyncProcessOptions.md +0 -53
  166. package/docs/type-aliases/KnownOmrsServiceWorkerMessages.md +0 -7
  167. package/docs/type-aliases/OfflineMode.md +0 -7
  168. package/docs/type-aliases/OmrsOfflineCachingStrategy.md +0 -12
  169. package/docs/type-aliases/OmrsOfflineHttpHeaderNames.md +0 -7
  170. package/docs/type-aliases/OmrsOfflineHttpHeaders.md +0 -44
  171. package/docs/variables/getStartedVisit.md +0 -9
  172. package/docs/variables/offlineUuidPrefix.md +0 -7
  173. package/docs/variables/omrsOfflineCachingStrategyHttpHeaderName.md +0 -7
  174. package/docs/variables/omrsOfflineResponseBodyHttpHeaderName.md +0 -7
  175. package/docs/variables/omrsOfflineResponseStatusHttpHeaderName.md +0 -7
@@ -1,3 +1,3 @@
1
- [0] Successfully compiled: 3 files with swc (134.86ms)
1
+ [0] Successfully compiled: 4 files with swc (136.75ms)
2
2
  [0] swc --strip-leading-paths src -d dist exited with code 0
3
3
  [1] tsc --project tsconfig.build.json exited with code 0
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Compatibility shims for APIs that have been removed from the framework.
3
+ *
4
+ * These exist only so that frontend modules built against an older framework
5
+ * don't break at runtime while their authors migrate. They are intentionally
6
+ * no-ops and will be removed in a future major release.
7
+ */
8
+ /**
9
+ * @deprecated Offline support has been removed from the framework. This is a
10
+ * no-op kept only so that frontend modules that still call `setupOfflineSync`
11
+ * during registration don't throw. Remove your offline sync handlers; queued
12
+ * items will no longer be synchronized.
13
+ */
14
+ export declare function setupOfflineSync<T = unknown>(_type: string, _dependsOn: Array<string>, _process: (item: T, options: unknown) => Promise<unknown>, _options?: unknown): void;
15
+ /**
16
+ * @deprecated Offline support has been removed from the framework. This is a
17
+ * no-op kept only so that frontend modules that still call
18
+ * `setupDynamicOfflineDataHandler` during registration don't throw. Remove your
19
+ * dynamic offline data handlers; their data will no longer be cached for offline use.
20
+ */
21
+ export declare function setupDynamicOfflineDataHandler(_handler: {
22
+ id: string;
23
+ type: string;
24
+ [key: string]: unknown;
25
+ }): void;
26
+ /**
27
+ * @deprecated Offline support has been removed from the framework. This is a stub kept only so that
28
+ * frontend modules that still read the dynamic offline data registry keep working. It always resolves
29
+ * to an empty array, since nothing is registered for offline use any more.
30
+ */
31
+ export declare function getDynamicOfflineDataEntries<T = unknown>(_type?: string): Promise<Array<T>>;
32
+ /**
33
+ * @deprecated Offline support has been removed from the framework. This is a stub kept only so that
34
+ * frontend modules that still read the sync queue keep working. It always resolves to an empty array,
35
+ * since nothing is queued for synchronization any more.
36
+ */
37
+ export declare function getSynchronizationItems<T = unknown>(_type?: string): Promise<Array<T>>;
38
+ /**
39
+ * @deprecated The offline service worker has been removed from the framework.
40
+ * This is a no-op kept only so that frontend modules that still call
41
+ * `messageOmrsServiceWorker` don't throw. It always resolves to an
42
+ * unsuccessful result, mirroring the previous "no service worker registered"
43
+ * behavior.
44
+ */
45
+ export declare function messageOmrsServiceWorker(_message: unknown): Promise<{
46
+ success: false;
47
+ result: undefined;
48
+ error: string;
49
+ }>;
50
+ /**
51
+ * @deprecated Offline support has been removed from the framework. This is a
52
+ * no-op kept only so that frontend modules that still call
53
+ * `subscribePrecacheStaticDependencies` don't throw. The callback is never
54
+ * invoked. Returns a no-op unsubscribe function so existing teardown code keeps working.
55
+ */
56
+ export declare function subscribePrecacheStaticDependencies(_callback: (data: unknown) => void): () => void;
57
+ /**
58
+ * @deprecated Offline support has been removed from the framework. This is a
59
+ * no-op kept only so that frontend modules that still call
60
+ * `useConnectivity` don't throw.
61
+ */
62
+ export declare function useConnectivity(): boolean;
63
+ //# sourceMappingURL=deprecated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecated.d.ts","sourceRoot":"","sources":["../src/deprecated.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,GAAG,OAAO,EAC1C,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,EACzB,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,EACzD,QAAQ,CAAC,EAAE,OAAO,GACjB,IAAI,CAEN;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GAAG,IAAI,CAEnH;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAE3F;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAEtF;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAM/D;AAED;;;;;GAKG;AACH,wBAAgB,mCAAmC,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI,CAGlG;AAED;;;;GAIG;AACH,wBAAgB,eAAe,YAE9B"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Compatibility shims for APIs that have been removed from the framework.
3
+ *
4
+ * These exist only so that frontend modules built against an older framework
5
+ * don't break at runtime while their authors migrate. They are intentionally
6
+ * no-ops and will be removed in a future major release.
7
+ */ /**
8
+ * @deprecated Offline support has been removed from the framework. This is a
9
+ * no-op kept only so that frontend modules that still call `setupOfflineSync`
10
+ * during registration don't throw. Remove your offline sync handlers; queued
11
+ * items will no longer be synchronized.
12
+ */ export function setupOfflineSync(_type, _dependsOn, _process, _options) {
13
+ // no-op: offline synchronization was removed from the framework
14
+ }
15
+ /**
16
+ * @deprecated Offline support has been removed from the framework. This is a
17
+ * no-op kept only so that frontend modules that still call
18
+ * `setupDynamicOfflineDataHandler` during registration don't throw. Remove your
19
+ * dynamic offline data handlers; their data will no longer be cached for offline use.
20
+ */ export function setupDynamicOfflineDataHandler(_handler) {
21
+ // no-op: dynamic offline data was removed from the framework
22
+ }
23
+ /**
24
+ * @deprecated Offline support has been removed from the framework. This is a stub kept only so that
25
+ * frontend modules that still read the dynamic offline data registry keep working. It always resolves
26
+ * to an empty array, since nothing is registered for offline use any more.
27
+ */ export function getDynamicOfflineDataEntries(_type) {
28
+ return Promise.resolve([]);
29
+ }
30
+ /**
31
+ * @deprecated Offline support has been removed from the framework. This is a stub kept only so that
32
+ * frontend modules that still read the sync queue keep working. It always resolves to an empty array,
33
+ * since nothing is queued for synchronization any more.
34
+ */ export function getSynchronizationItems(_type) {
35
+ return Promise.resolve([]);
36
+ }
37
+ /**
38
+ * @deprecated The offline service worker has been removed from the framework.
39
+ * This is a no-op kept only so that frontend modules that still call
40
+ * `messageOmrsServiceWorker` don't throw. It always resolves to an
41
+ * unsuccessful result, mirroring the previous "no service worker registered"
42
+ * behavior.
43
+ */ export function messageOmrsServiceWorker(_message) {
44
+ return Promise.resolve({
45
+ success: false,
46
+ result: undefined,
47
+ error: 'No service worker has been registered. Offline-related features have been removed from the framework.'
48
+ });
49
+ }
50
+ /**
51
+ * @deprecated Offline support has been removed from the framework. This is a
52
+ * no-op kept only so that frontend modules that still call
53
+ * `subscribePrecacheStaticDependencies` don't throw. The callback is never
54
+ * invoked. Returns a no-op unsubscribe function so existing teardown code keeps working.
55
+ */ export function subscribePrecacheStaticDependencies(_callback) {
56
+ // no-op: static dependency precaching was removed from the framework
57
+ return ()=>{};
58
+ }
59
+ /**
60
+ * @deprecated Offline support has been removed from the framework. This is a
61
+ * no-op kept only so that frontend modules that still call
62
+ * `useConnectivity` don't throw.
63
+ */ export function useConnectivity() {
64
+ return true;
65
+ }
package/dist/index.d.ts CHANGED
@@ -9,10 +9,10 @@ export * from '@openmrs/esm-extensions/src/public';
9
9
  export * from '@openmrs/esm-feature-flags/src/public';
10
10
  export * from '@openmrs/esm-globals/src/public';
11
11
  export * from '@openmrs/esm-navigation/src/public';
12
- export * from '@openmrs/esm-offline/src/public';
13
12
  export * from '@openmrs/esm-react-utils/src/public';
14
13
  export * from '@openmrs/esm-state/src/public';
15
14
  export * from '@openmrs/esm-styleguide/src/public';
16
15
  export * from '@openmrs/esm-translations/src/public';
17
16
  export * from '@openmrs/esm-utils';
17
+ export * from './deprecated';
18
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8CAA8C,CAAC;AAC7D,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8CAA8C,CAAC;AAC7D,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -9,9 +9,9 @@ export * from "@openmrs/esm-extensions/src/public";
9
9
  export * from "@openmrs/esm-feature-flags/src/public";
10
10
  export * from "@openmrs/esm-globals/src/public";
11
11
  export * from "@openmrs/esm-navigation/src/public";
12
- export * from "@openmrs/esm-offline/src/public";
13
12
  export * from "@openmrs/esm-react-utils/src/public";
14
13
  export * from "@openmrs/esm-state/src/public";
15
14
  export * from "@openmrs/esm-styleguide/src/public";
16
15
  export * from "@openmrs/esm-translations/src/public";
17
16
  export * from "@openmrs/esm-utils";
17
+ export * from "./deprecated.js";
@@ -8,11 +8,11 @@ export * from '@openmrs/esm-extensions';
8
8
  export * from '@openmrs/esm-feature-flags';
9
9
  export * from '@openmrs/esm-globals';
10
10
  export * from '@openmrs/esm-navigation';
11
- export * from '@openmrs/esm-offline';
12
11
  export * from '@openmrs/esm-react-utils';
13
12
  export * from '@openmrs/esm-routes';
14
13
  export * from '@openmrs/esm-state';
15
14
  export * from '@openmrs/esm-styleguide/src/internal';
16
15
  export * from '@openmrs/esm-translations';
17
16
  export * from '@openmrs/esm-utils';
17
+ export * from './deprecated';
18
18
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC"}
package/dist/internal.js CHANGED
@@ -8,10 +8,10 @@ export * from "@openmrs/esm-extensions";
8
8
  export * from "@openmrs/esm-feature-flags";
9
9
  export * from "@openmrs/esm-globals";
10
10
  export * from "@openmrs/esm-navigation";
11
- export * from "@openmrs/esm-offline";
12
11
  export * from "@openmrs/esm-react-utils";
13
12
  export * from "@openmrs/esm-routes";
14
13
  export * from "@openmrs/esm-state";
15
14
  export * from "@openmrs/esm-styleguide/src/internal";
16
15
  export * from "@openmrs/esm-translations";
17
16
  export * from "@openmrs/esm-utils";
17
+ export * from "./deprecated.js";
package/docs/API.md CHANGED
@@ -4,7 +4,6 @@
4
4
 
5
5
  - [makeUrl](functions/makeUrl.md)
6
6
  - [openmrsFetch](functions/openmrsFetch.md)
7
- - [openmrsObservableFetch](functions/openmrsObservableFetch.md)
8
7
  - [OpenmrsFetchError](classes/OpenmrsFetchError.md)
9
8
  - [FetchConfig](interfaces/FetchConfig.md)
10
9
  - [FetchHeaders](interfaces/FetchHeaders.md)
@@ -98,52 +97,6 @@
98
97
  - [getHistory](functions/getHistory.md)
99
98
  - [goBackInHistory](functions/goBackInHistory.md)
100
99
 
101
- ## Offline
102
-
103
- - [~~getOfflinePatientDataStore~~](functions/getOfflinePatientDataStore.md)
104
- - [~~registerOfflinePatientHandler~~](functions/registerOfflinePatientHandler.md)
105
- - [~~syncOfflinePatientData~~](functions/syncOfflinePatientData.md)
106
- - [~~OfflinePatientDataSyncStore~~](interfaces/OfflinePatientDataSyncStore.md)
107
- - [~~OfflinePatientDataSyncState~~](interfaces/OfflinePatientDataSyncState.md)
108
- - [~~OfflinePatientDataSyncHandler~~](interfaces/OfflinePatientDataSyncHandler.md)
109
- - [~~OfflinePatientArgs~~](interfaces/OfflinePatientArgs.md)
110
- - [messageOmrsServiceWorker](functions/messageOmrsServiceWorker.md)
111
- - [OmrsServiceWorkerMessage](interfaces/OmrsServiceWorkerMessage.md)
112
- - [OnImportMapChangedMessage](interfaces/OnImportMapChangedMessage.md)
113
- - [ClearDynamicRoutesMessage](interfaces/ClearDynamicRoutesMessage.md)
114
- - [RegisterDynamicRouteMessage](interfaces/RegisterDynamicRouteMessage.md)
115
- - [MessageServiceWorkerResult](interfaces/MessageServiceWorkerResult.md)
116
- - [generateOfflineUuid](functions/generateOfflineUuid.md)
117
- - [isOfflineUuid](functions/isOfflineUuid.md)
118
- - [getDynamicOfflineDataHandlers](functions/getDynamicOfflineDataHandlers.md)
119
- - [setupDynamicOfflineDataHandler](functions/setupDynamicOfflineDataHandler.md)
120
- - [getDynamicOfflineDataEntries](functions/getDynamicOfflineDataEntries.md)
121
- - [getDynamicOfflineDataEntriesFor](functions/getDynamicOfflineDataEntriesFor.md)
122
- - [putDynamicOfflineData](functions/putDynamicOfflineData.md)
123
- - [putDynamicOfflineDataFor](functions/putDynamicOfflineDataFor.md)
124
- - [removeDynamicOfflineData](functions/removeDynamicOfflineData.md)
125
- - [removeDynamicOfflineDataFor](functions/removeDynamicOfflineDataFor.md)
126
- - [syncAllDynamicOfflineData](functions/syncAllDynamicOfflineData.md)
127
- - [syncDynamicOfflineData](functions/syncDynamicOfflineData.md)
128
- - [DynamicOfflineDataHandler](interfaces/DynamicOfflineDataHandler.md)
129
- - [DynamicOfflineData](interfaces/DynamicOfflineData.md)
130
- - [DynamicOfflineDataSyncState](interfaces/DynamicOfflineDataSyncState.md)
131
- - [useConnectivity](functions/useConnectivity.md)
132
- - [OfflineModeResult](interfaces/OfflineModeResult.md)
133
- - [getCurrentOfflineMode](functions/getCurrentOfflineMode.md)
134
- - [QueueItemDescriptor](interfaces/QueueItemDescriptor.md)
135
- - [SyncItem](interfaces/SyncItem.md)
136
- - [SyncProcessOptions](interfaces/SyncProcessOptions.md)
137
- - [queueSynchronizationItem](functions/queueSynchronizationItem.md)
138
- - [getSynchronizationItem](functions/getSynchronizationItem.md)
139
- - [getSynchronizationItems](functions/getSynchronizationItems.md)
140
- - [getFullSynchronizationItems](functions/getFullSynchronizationItems.md)
141
- - [getFullSynchronizationItemsFor](functions/getFullSynchronizationItemsFor.md)
142
- - [canBeginEditSynchronizationItemsOfType](functions/canBeginEditSynchronizationItemsOfType.md)
143
- - [beginEditSynchronizationItem](functions/beginEditSynchronizationItem.md)
144
- - [deleteSynchronizationItem](functions/deleteSynchronizationItem.md)
145
- - [setupOfflineSync](functions/setupOfflineSync.md)
146
-
147
100
  ## Extension
148
101
 
149
102
  - [ExtensionSlot](functions/ExtensionSlot.md)
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Class: OpenmrsFetchError
4
4
 
5
- Defined in: [packages/framework/esm-api/src/openmrs-fetch.ts:320](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/openmrs-fetch.ts#L320)
5
+ Defined in: [packages/framework/esm-api/src/openmrs-fetch.ts:258](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/openmrs-fetch.ts#L258)
6
6
 
7
7
  ## Extends
8
8
 
@@ -18,7 +18,7 @@ Defined in: [packages/framework/esm-api/src/openmrs-fetch.ts:320](https://github
18
18
 
19
19
  > **new OpenmrsFetchError**(`url`, `response`, `responseBody`, `requestStacktrace`): `OpenmrsFetchError`
20
20
 
21
- Defined in: [packages/framework/esm-api/src/openmrs-fetch.ts:321](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/openmrs-fetch.ts#L321)
21
+ Defined in: [packages/framework/esm-api/src/openmrs-fetch.ts:259](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/openmrs-fetch.ts#L259)
22
22
 
23
23
  #### Parameters
24
24
 
@@ -88,7 +88,7 @@ Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076
88
88
 
89
89
  > **response**: `Response`
90
90
 
91
- Defined in: [packages/framework/esm-api/src/openmrs-fetch.ts:329](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/openmrs-fetch.ts#L329)
91
+ Defined in: [packages/framework/esm-api/src/openmrs-fetch.ts:267](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/openmrs-fetch.ts#L267)
92
92
 
93
93
  #### Implementation of
94
94
 
@@ -100,7 +100,7 @@ Defined in: [packages/framework/esm-api/src/openmrs-fetch.ts:329](https://github
100
100
 
101
101
  > **responseBody**: `null` \| `string` \| [`FetchResponseJson`](../interfaces/FetchResponseJson.md)
102
102
 
103
- Defined in: [packages/framework/esm-api/src/openmrs-fetch.ts:330](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/openmrs-fetch.ts#L330)
103
+ Defined in: [packages/framework/esm-api/src/openmrs-fetch.ts:268](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/openmrs-fetch.ts#L268)
104
104
 
105
105
  #### Implementation of
106
106
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Enumeration: VisitMode
4
4
 
5
- Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:14](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L14)
5
+ Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:13](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L13)
6
6
 
7
7
  ## Enumeration Members
8
8
 
@@ -10,7 +10,7 @@ Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:14](https://githu
10
10
 
11
11
  > **EDITVISIT**: `"editVisit"`
12
12
 
13
- Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L16)
13
+ Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L15)
14
14
 
15
15
  ***
16
16
 
@@ -18,7 +18,7 @@ Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:16](https://githu
18
18
 
19
19
  > **LOADING**: `"loadingVisit"`
20
20
 
21
- Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L17)
21
+ Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L16)
22
22
 
23
23
  ***
24
24
 
@@ -26,4 +26,4 @@ Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:17](https://githu
26
26
 
27
27
  > **NEWVISIT**: `"startVisit"`
28
28
 
29
- Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L15)
29
+ Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:14](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L14)
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Enumeration: VisitStatus
4
4
 
5
- Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:20](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L20)
5
+ Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:19](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L19)
6
6
 
7
7
  ## Enumeration Members
8
8
 
@@ -10,7 +10,7 @@ Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:20](https://githu
10
10
 
11
11
  > **NOTSTARTED**: `"notStarted"`
12
12
 
13
- Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:21](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L21)
13
+ Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:20](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L20)
14
14
 
15
15
  ***
16
16
 
@@ -18,4 +18,4 @@ Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:21](https://githu
18
18
 
19
19
  > **ONGOING**: `"ongoing"`
20
20
 
21
- Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:22](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L22)
21
+ Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:21](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L21)
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **attach**(`slotName`, `extensionId`): `void`
6
6
 
7
- Defined in: [packages/framework/esm-extensions/src/extensions.ts:309](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/extensions.ts#L309)
7
+ Defined in: [packages/framework/esm-extensions/src/extensions.ts:303](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/extensions.ts#L303)
8
8
 
9
9
  Attach an extension to an extension slot.
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **clearCurrentUser**(): `void`
6
6
 
7
- Defined in: [packages/framework/esm-api/src/current-user.ts:234](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/current-user.ts#L234)
7
+ Defined in: [packages/framework/esm-api/src/current-user.ts:261](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/current-user.ts#L261)
8
8
 
9
9
  Clears the current user session from the session store, setting the session
10
10
  to an unauthenticated state. This is typically called during logout to reset
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **createErrorHandler**(): (`incomingErr`) => `void`
6
6
 
7
- Defined in: [packages/framework/esm-error-handling/src/index.ts:70](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-error-handling/src/index.ts#L70)
7
+ Defined in: [packages/framework/esm-error-handling/src/index.ts:94](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-error-handling/src/index.ts#L94)
8
8
 
9
9
  Creates an error handler function that captures the current stack trace at
10
10
  the time of creation. When the returned handler is invoked with an error,
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **detach**(`extensionSlotName`, `extensionId`): `void`
6
6
 
7
- Defined in: [packages/framework/esm-extensions/src/extensions.ts:347](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/extensions.ts#L347)
7
+ Defined in: [packages/framework/esm-extensions/src/extensions.ts:341](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/extensions.ts#L341)
8
8
 
9
9
  Detaches an extension from an extension slot.
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **detachAll**(`extensionSlotName`): `void`
6
6
 
7
- Defined in: [packages/framework/esm-extensions/src/extensions.ts:375](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/extensions.ts#L375)
7
+ Defined in: [packages/framework/esm-extensions/src/extensions.ts:369](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/extensions.ts#L369)
8
8
 
9
9
  Detaches all extensions from an extension slot.
10
10
 
@@ -2,14 +2,11 @@
2
2
 
3
3
  # Function: fetchCurrentPatient()
4
4
 
5
- > **fetchCurrentPatient**(`patientUuid`, `fetchInit?`, `includeOfflinePatients?`): `Promise`\<`null` \| `Patient`\>
5
+ > **fetchCurrentPatient**(`patientUuid`, `fetchInit?`): `Promise`\<`null` \| `Patient`\>
6
6
 
7
- Defined in: [packages/framework/esm-emr-api/src/current-patient.ts:44](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/current-patient.ts#L44)
7
+ Defined in: [packages/framework/esm-emr-api/src/current-patient.ts:38](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/current-patient.ts#L38)
8
8
 
9
- Fetches a patient by their UUID from the FHIR API. This function first attempts
10
- to fetch the patient from the server. If the server request fails and offline
11
- patients are included, it will check for a matching patient in the offline
12
- patient registration sync queue.
9
+ Fetches a patient by their UUID from the FHIR API.
13
10
 
14
11
  ## Parameters
15
12
 
@@ -25,23 +22,16 @@ The UUID of the patient to fetch, or `null`.
25
22
 
26
23
  Optional fetch configuration options to pass to the request.
27
24
 
28
- ### includeOfflinePatients?
29
-
30
- `boolean` = `true`
31
-
32
- Whether to include patients from the offline
33
- registration queue if the server request fails. Defaults to `true`.
34
-
35
25
  ## Returns
36
26
 
37
27
  `Promise`\<`null` \| `Patient`\>
38
28
 
39
29
  A Promise that resolves with the FHIR Patient object, or `null` if
40
- the patient UUID is null or the patient is not found.
30
+ the patient UUID is null.
41
31
 
42
32
  ## Throws
43
33
 
44
- Rethrows any error from the server request if no offline patient is found.
34
+ Rethrows any error from the server request.
45
35
 
46
36
  ## Example
47
37
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **getAssignedExtensions**(`slotName`, `state?`): [`AssignedExtension`](../interfaces/AssignedExtension.md)[]
6
6
 
7
- Defined in: [packages/framework/esm-extensions/src/extensions.ts:554](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/extensions.ts#L554)
7
+ Defined in: [packages/framework/esm-extensions/src/extensions.ts:541](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/extensions.ts#L541)
8
8
 
9
9
  Gets the extensions a given rendering of a slot should display, in order. This is the supported
10
10
  way to ask what belongs in a slot; reading the extension store directly skips display conditions.
@@ -19,7 +19,7 @@ invalid key to this function will result in a type error.
19
19
 
20
20
  The translation key from the set of core translations.
21
21
 
22
- `"cancel"` | `"change"` | `"close"` | `"error"` | `"unknown"` | `"state"` | `"Clinic"` | `"abnormalValue"` | `"actions"` | `"actionableNotification"` | `"address"` | `"age"` | `"batchActionItemSelected"` | `"batchActionsItemsSelected"` | `"closesActionableNotification"` | `"closeSnackbar"` | `"confirm"` | `"contactAdministratorIfIssuePersists"` | `"contactDetails"` | `"delete"` | `"discardChanges"` | `"edit"` | `"emptyStateText"` | `"errorCopy"` | `"errorLoadingLoginLocations"` | `"female"` | `"leftNavigation"` | `"loading"` | `"localVersion"` | `"male"` | `"navigateNonHttp"` | `"noResultsToDisplay"` | `"notAvailable"` | `"other"` | `"paginationItemsCount"` | `"paginationOfPages"` | `"patientAvatarAlt"` | `"patientIdentifierSticker"` | `"patientLists"` | `"patientPhotoAlt"` | `"patientPhotoPlaceholder"` | `"prereleaseVersion"` | `"print"` | `"printError"` | `"printErrorExplainer"` | `"printIdentifierSticker"` | `"printing"` | `"recordNewEntry"` | `"relationships"` | `"resetOverrides"` | `"save"` | `"scriptLoadingFailed"` | `"scriptLoadingError"` | `"searchForLocation"` | `"seeAll"` | `"seeMoreLists"` | `"selectAll"` | `"sex"` | `"showLess"` | `"showMore"` | `"snackbarNotification"` | `"toggleDevTools"` | `"yearAbbreviation"` | `"yearsAbbreviation"` | `"discardUnsavedChangesPromptBodyMultiple"` | `"discardUnsavedChangesPromptBodySingle"` | `"discardUnsavedChangesPromptTitle"` | `"keepEditing"` | `"closeAllOpenedWorkspaces"` | `"closingAllWorkspacesPromptBody"` | `"closingAllWorkspacesPromptTitle"` | `"discard"` | `"hide"` | `"maximize"` | `"minimize"` | `"openAnyway"` | `"unsavedChangesInOpenedWorkspace"` | `"unsavedChangesInWorkspace"` | `"unsavedChangesTitleText"` | `"workspaceHeader"` | `"address1"` | `"address2"` | `"address3"` | `"address4"` | `"address5"` | `"address6"` | `"city"` | `"cityVillage"` | `"country"` | `"countyDistrict"` | `"district"` | `"postalCode"` | `"stateProvince"`
22
+ `"error"` | `"cancel"` | `"change"` | `"close"` | `"unknown"` | `"state"` | `"Clinic"` | `"abnormalValue"` | `"actions"` | `"actionableNotification"` | `"address"` | `"age"` | `"batchActionItemSelected"` | `"batchActionsItemsSelected"` | `"closesActionableNotification"` | `"closeSnackbar"` | `"confirm"` | `"contactAdministratorIfIssuePersists"` | `"contactDetails"` | `"delete"` | `"discardChanges"` | `"edit"` | `"emptyStateText"` | `"errorCopy"` | `"errorLoadingLoginLocations"` | `"female"` | `"leftNavigation"` | `"loading"` | `"localVersion"` | `"male"` | `"navigateNonHttp"` | `"noResultsToDisplay"` | `"notAvailable"` | `"other"` | `"paginationItemsCount"` | `"paginationOfPages"` | `"patientAvatarAlt"` | `"patientIdentifierSticker"` | `"patientLists"` | `"patientPhotoAlt"` | `"patientPhotoPlaceholder"` | `"prereleaseVersion"` | `"print"` | `"printError"` | `"printErrorExplainer"` | `"printIdentifierSticker"` | `"printing"` | `"recordNewEntry"` | `"relationships"` | `"resetOverrides"` | `"save"` | `"scriptLoadingFailed"` | `"scriptLoadingError"` | `"searchForLocation"` | `"seeAll"` | `"seeMoreLists"` | `"selectAll"` | `"sex"` | `"showLess"` | `"showMore"` | `"snackbarNotification"` | `"toggleDevTools"` | `"yearAbbreviation"` | `"yearsAbbreviation"` | `"discardUnsavedChangesPromptBodyMultiple"` | `"discardUnsavedChangesPromptBodySingle"` | `"discardUnsavedChangesPromptTitle"` | `"keepEditing"` | `"closeAllOpenedWorkspaces"` | `"closingAllWorkspacesPromptBody"` | `"closingAllWorkspacesPromptTitle"` | `"discard"` | `"hide"` | `"maximize"` | `"minimize"` | `"openAnyway"` | `"unsavedChangesInOpenedWorkspace"` | `"unsavedChangesInWorkspace"` | `"unsavedChangesTitleText"` | `"workspaceHeader"` | `"address1"` | `"address2"` | `"address3"` | `"address4"` | `"address5"` | `"address6"` | `"city"` | `"cityVillage"` | `"country"` | `"countyDistrict"` | `"district"` | `"postalCode"` | `"stateProvince"`
23
23
 
24
24
  ### defaultText?
25
25
 
@@ -4,56 +4,46 @@
4
4
 
5
5
  ## Call Signature
6
6
 
7
- > **getCurrentUser**(): `Observable`\<[`Session`](../interfaces/Session.md)\>
7
+ > **getCurrentUser**(): `Promise`\<[`Session`](../interfaces/Session.md)\>
8
8
 
9
- Defined in: [packages/framework/esm-api/src/current-user.ts:66](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/current-user.ts#L66)
9
+ Defined in: [packages/framework/esm-api/src/current-user.ts:88](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/current-user.ts#L88)
10
10
 
11
- The getCurrentUser function returns an observable that produces
12
- **zero or more values, over time**. It will produce zero values
13
- by default if the user is not logged in. And it will provide a
14
- first value when the logged in user is fetched from the server.
15
- Subsequent values will be produced whenever the user object is
16
- updated.
11
+ The getCurrentUser function returns a Promise that resolves once with the
12
+ current user's session. If the session hasn't been loaded, was loaded more than
13
+ a minute ago, or is in the middle of being refetched, the Promise waits for the
14
+ fetch in question rather than resolving with data that may be out of date. The
15
+ session it resolves with is therefore never more than a minute old.
17
16
 
18
- The function accepts an optional `opts` object with an `includeAuthStatus`
19
- boolean property that defaults to `true`. When `includeAuthStatus` is `true`,
20
- the entire [Session](../interfaces/Session.md) object from the API will be provided. When
21
- `includeAuthStatus` is `false`, only the [LoggedInUser](../interfaces/LoggedInUser.md) property of the
22
- response object will be provided.
17
+ The function accepts an optional `opts` object with an `includeAuthStatus` boolean
18
+ property that defaults to `true`. When `true`, the entire [Session](../interfaces/Session.md) object
19
+ from the API is provided. When `false`, only the [LoggedInUser](../interfaces/LoggedInUser.md) property of
20
+ the response is provided.
21
+
22
+ To react to subsequent session changes (login, logout, user-property updates),
23
+ use [getSessionStore](getSessionStore.md) (`getState()` / `subscribe()`) or the `useSession`
24
+ React hook rather than calling this repeatedly.
23
25
 
24
26
  ### Returns
25
27
 
26
- `Observable`\<[`Session`](../interfaces/Session.md)\>
28
+ `Promise`\<[`Session`](../interfaces/Session.md)\>
27
29
 
28
- An Observable that produces zero or more values (as described above).
29
- The values produced will be a [LoggedInUser](../interfaces/LoggedInUser.md) object (if `includeAuthStatus`
30
- is set to `false`) or a [Session](../interfaces/Session.md) object with authentication status
31
- (if `includeAuthStatus` is set to `true` or not provided).
30
+ A Promise resolving to a [LoggedInUser](../interfaces/LoggedInUser.md) object (if `includeAuthStatus`
31
+ is `false`) or a [Session](../interfaces/Session.md) object (if `includeAuthStatus` is `true` or not
32
+ provided).
32
33
 
33
34
  ### Example
34
35
 
35
36
  ```js
36
37
  import { getCurrentUser } from '@openmrs/esm-api'
37
- const subscription = getCurrentUser().subscribe(
38
- user => console.log(user)
39
- )
40
- subscription.unsubscribe()
41
- getCurrentUser({includeAuthStatus: true}).subscribe(
42
- data => console.log(data.authenticated)
43
- )
38
+ const session = await getCurrentUser({ includeAuthStatus: true })
39
+ console.log(session.authenticated)
44
40
  ```
45
41
 
46
- #### Be sure to unsubscribe when your component unmounts
47
-
48
- Otherwise your code will continue getting updates to the user object
49
- even after the UI component is gone from the screen. This is a memory
50
- leak and source of bugs.
51
-
52
42
  ## Call Signature
53
43
 
54
- > **getCurrentUser**(`opts`): `Observable`\<[`Session`](../interfaces/Session.md)\>
44
+ > **getCurrentUser**(`opts`): `Promise`\<[`Session`](../interfaces/Session.md)\>
55
45
 
56
- Defined in: [packages/framework/esm-api/src/current-user.ts:73](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/current-user.ts#L73)
46
+ Defined in: [packages/framework/esm-api/src/current-user.ts:95](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/current-user.ts#L95)
57
47
 
58
48
  ### Parameters
59
49
 
@@ -65,20 +55,20 @@ Options for controlling the response format.
65
55
 
66
56
  `true`
67
57
 
68
- When `true`, returns the full [Session](../interfaces/Session.md) object
58
+ When `true`, resolves with the full [Session](../interfaces/Session.md) object
69
59
  including authentication status.
70
60
 
71
61
  ### Returns
72
62
 
73
- `Observable`\<[`Session`](../interfaces/Session.md)\>
63
+ `Promise`\<[`Session`](../interfaces/Session.md)\>
74
64
 
75
- An Observable that produces [Session](../interfaces/Session.md) objects.
65
+ A Promise resolving to a [Session](../interfaces/Session.md) object.
76
66
 
77
67
  ## Call Signature
78
68
 
79
- > **getCurrentUser**(`opts`): `Observable`\<[`LoggedInUser`](../interfaces/LoggedInUser.md)\>
69
+ > **getCurrentUser**(`opts`): `Promise`\<[`LoggedInUser`](../interfaces/LoggedInUser.md)\>
80
70
 
81
- Defined in: [packages/framework/esm-api/src/current-user.ts:80](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/current-user.ts#L80)
71
+ Defined in: [packages/framework/esm-api/src/current-user.ts:102](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/current-user.ts#L102)
82
72
 
83
73
  ### Parameters
84
74
 
@@ -90,11 +80,11 @@ Options for controlling the response format.
90
80
 
91
81
  `false`
92
82
 
93
- When `false`, returns only the [LoggedInUser](../interfaces/LoggedInUser.md) object
83
+ When `false`, resolves with only the [LoggedInUser](../interfaces/LoggedInUser.md) object
94
84
  without the surrounding session information.
95
85
 
96
86
  ### Returns
97
87
 
98
- `Observable`\<[`LoggedInUser`](../interfaces/LoggedInUser.md)\>
88
+ `Promise`\<[`LoggedInUser`](../interfaces/LoggedInUser.md)\>
99
89
 
100
- An Observable that produces [LoggedInUser](../interfaces/LoggedInUser.md) objects.
90
+ A Promise resolving to a [LoggedInUser](../interfaces/LoggedInUser.md) object.