@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
package/mock.tsx CHANGED
@@ -1,6 +1,5 @@
1
1
  import React, { useState } from 'react';
2
2
  import dayjs from 'dayjs';
3
- import { NEVER } from 'rxjs';
4
3
  import { vi } from 'vitest';
5
4
  import type {} from '@openmrs/esm-globals';
6
5
  import * as utils from '@openmrs/esm-utils/mock';
@@ -48,7 +47,7 @@ export function setupPaths(config: any) {
48
47
  export const importDynamic = vi.fn();
49
48
 
50
49
  /* esm-error-handling */
51
- export const createErrorHandler = () => vi.fn().mockReturnValue(NEVER);
50
+ export const createErrorHandler = () => vi.fn();
52
51
 
53
52
  export const reportError = vi.fn().mockImplementation((error) => {
54
53
  throw error;
@@ -66,9 +65,18 @@ export const getHistory = vi.fn(() => ['https://o3.openmrs.org/home']);
66
65
  export const clearHistory = vi.fn();
67
66
  export const goBackInHistory = vi.fn();
68
67
 
69
- /* esm-offline */
68
+ /* deprecated offline shims; these mirror the no-op implementations in src/deprecated.ts */
70
69
  export const useConnectivity = vi.fn().mockReturnValue(true);
71
- export const subscribeConnectivity = vi.fn();
70
+ export const setupOfflineSync = vi.fn();
71
+ export const setupDynamicOfflineDataHandler = vi.fn();
72
+ export const getDynamicOfflineDataEntries = vi.fn().mockResolvedValue([]);
73
+ export const getSynchronizationItems = vi.fn().mockResolvedValue([]);
74
+ export const subscribePrecacheStaticDependencies = vi.fn(() => () => {});
75
+ export const messageOmrsServiceWorker = vi.fn().mockResolvedValue({
76
+ success: false,
77
+ result: undefined,
78
+ error: 'No service worker has been registered. Offline-related features have been removed from the framework.',
79
+ });
72
80
 
73
81
  /* esm-styleguide */
74
82
  export const showNotification = vi.fn();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-framework",
3
- "version": "10.0.1-pre.5539",
3
+ "version": "10.0.1-pre.5545",
4
4
  "license": "MPL-2.0",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
@@ -60,24 +60,23 @@
60
60
  "access": "public"
61
61
  },
62
62
  "dependencies": {
63
- "@openmrs/esm-api": "10.0.1-pre.5539",
64
- "@openmrs/esm-config": "10.0.1-pre.5539",
65
- "@openmrs/esm-context": "10.0.1-pre.5539",
66
- "@openmrs/esm-dynamic-loading": "10.0.1-pre.5539",
67
- "@openmrs/esm-emr-api": "10.0.1-pre.5539",
68
- "@openmrs/esm-error-handling": "10.0.1-pre.5539",
69
- "@openmrs/esm-expression-evaluator": "10.0.1-pre.5539",
70
- "@openmrs/esm-extensions": "10.0.1-pre.5539",
71
- "@openmrs/esm-feature-flags": "10.0.1-pre.5539",
72
- "@openmrs/esm-globals": "10.0.1-pre.5539",
73
- "@openmrs/esm-navigation": "10.0.1-pre.5539",
74
- "@openmrs/esm-offline": "10.0.1-pre.5539",
75
- "@openmrs/esm-react-utils": "10.0.1-pre.5539",
76
- "@openmrs/esm-routes": "10.0.1-pre.5539",
77
- "@openmrs/esm-state": "10.0.1-pre.5539",
78
- "@openmrs/esm-styleguide": "10.0.1-pre.5539",
79
- "@openmrs/esm-translations": "10.0.1-pre.5539",
80
- "@openmrs/esm-utils": "10.0.1-pre.5539"
63
+ "@openmrs/esm-api": "10.0.1-pre.5545",
64
+ "@openmrs/esm-config": "10.0.1-pre.5545",
65
+ "@openmrs/esm-context": "10.0.1-pre.5545",
66
+ "@openmrs/esm-dynamic-loading": "10.0.1-pre.5545",
67
+ "@openmrs/esm-emr-api": "10.0.1-pre.5545",
68
+ "@openmrs/esm-error-handling": "10.0.1-pre.5545",
69
+ "@openmrs/esm-expression-evaluator": "10.0.1-pre.5545",
70
+ "@openmrs/esm-extensions": "10.0.1-pre.5545",
71
+ "@openmrs/esm-feature-flags": "10.0.1-pre.5545",
72
+ "@openmrs/esm-globals": "10.0.1-pre.5545",
73
+ "@openmrs/esm-navigation": "10.0.1-pre.5545",
74
+ "@openmrs/esm-react-utils": "10.0.1-pre.5545",
75
+ "@openmrs/esm-routes": "10.0.1-pre.5545",
76
+ "@openmrs/esm-state": "10.0.1-pre.5545",
77
+ "@openmrs/esm-styleguide": "10.0.1-pre.5545",
78
+ "@openmrs/esm-translations": "10.0.1-pre.5545",
79
+ "@openmrs/esm-utils": "10.0.1-pre.5545"
81
80
  },
82
81
  "peerDependencies": {
83
82
  "dayjs": "1.x",
@@ -85,12 +84,11 @@
85
84
  "react": "18.x",
86
85
  "react-dom": "18.x",
87
86
  "react-i18next": "16.x",
88
- "rxjs": "6.x",
89
87
  "single-spa": "6.x",
90
88
  "swr": "2.x"
91
89
  },
92
90
  "devDependencies": {
93
- "@openmrs/typedoc-plugin-file-categories": "10.0.1-pre.5539",
91
+ "@openmrs/typedoc-plugin-file-categories": "10.0.1-pre.5545",
94
92
  "@swc/cli": "0.8.1",
95
93
  "@swc/core": "1.15.21",
96
94
  "@vitest/coverage-v8": "^4.1.2",
@@ -0,0 +1,87 @@
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
+ /**
10
+ * @deprecated Offline support has been removed from the framework. This is a
11
+ * no-op kept only so that frontend modules that still call `setupOfflineSync`
12
+ * during registration don't throw. Remove your offline sync handlers; queued
13
+ * items will no longer be synchronized.
14
+ */
15
+ export function setupOfflineSync<T = unknown>(
16
+ _type: string,
17
+ _dependsOn: Array<string>,
18
+ _process: (item: T, options: unknown) => Promise<unknown>,
19
+ _options?: unknown,
20
+ ): void {
21
+ // no-op: offline synchronization was removed from the framework
22
+ }
23
+
24
+ /**
25
+ * @deprecated Offline support has been removed from the framework. This is a
26
+ * no-op kept only so that frontend modules that still call
27
+ * `setupDynamicOfflineDataHandler` during registration don't throw. Remove your
28
+ * dynamic offline data handlers; their data will no longer be cached for offline use.
29
+ */
30
+ export function setupDynamicOfflineDataHandler(_handler: { id: string; type: string; [key: string]: unknown }): void {
31
+ // no-op: dynamic offline data was removed from the framework
32
+ }
33
+
34
+ /**
35
+ * @deprecated Offline support has been removed from the framework. This is a stub kept only so that
36
+ * frontend modules that still read the dynamic offline data registry keep working. It always resolves
37
+ * to an empty array, since nothing is registered for offline use any more.
38
+ */
39
+ export function getDynamicOfflineDataEntries<T = unknown>(_type?: string): Promise<Array<T>> {
40
+ return Promise.resolve([]);
41
+ }
42
+
43
+ /**
44
+ * @deprecated Offline support has been removed from the framework. This is a stub kept only so that
45
+ * frontend modules that still read the sync queue keep working. It always resolves to an empty array,
46
+ * since nothing is queued for synchronization any more.
47
+ */
48
+ export function getSynchronizationItems<T = unknown>(_type?: string): Promise<Array<T>> {
49
+ return Promise.resolve([]);
50
+ }
51
+
52
+ /**
53
+ * @deprecated The offline service worker has been removed from the framework.
54
+ * This is a no-op kept only so that frontend modules that still call
55
+ * `messageOmrsServiceWorker` don't throw. It always resolves to an
56
+ * unsuccessful result, mirroring the previous "no service worker registered"
57
+ * behavior.
58
+ */
59
+ export function messageOmrsServiceWorker(
60
+ _message: unknown,
61
+ ): Promise<{ success: false; result: undefined; error: string }> {
62
+ return Promise.resolve({
63
+ success: false,
64
+ result: undefined,
65
+ error: 'No service worker has been registered. Offline-related features have been removed from the framework.',
66
+ });
67
+ }
68
+
69
+ /**
70
+ * @deprecated Offline support has been removed from the framework. This is a
71
+ * no-op kept only so that frontend modules that still call
72
+ * `subscribePrecacheStaticDependencies` don't throw. The callback is never
73
+ * invoked. Returns a no-op unsubscribe function so existing teardown code keeps working.
74
+ */
75
+ export function subscribePrecacheStaticDependencies(_callback: (data: unknown) => void): () => void {
76
+ // no-op: static dependency precaching was removed from the framework
77
+ return () => {};
78
+ }
79
+
80
+ /**
81
+ * @deprecated Offline support has been removed from the framework. This is a
82
+ * no-op kept only so that frontend modules that still call
83
+ * `useConnectivity` don't throw.
84
+ */
85
+ export function useConnectivity() {
86
+ return true;
87
+ }
package/src/index.ts 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';
package/src/internal.ts 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';
@@ -23,8 +23,6 @@
23
23
  "@openmrs/esm-globals/src/public": ["../esm-globals/src/public.ts"],
24
24
  "@openmrs/esm-navigation": ["../esm-navigation/src/index.ts"],
25
25
  "@openmrs/esm-navigation/src/public": ["../esm-navigation/src/public.ts"],
26
- "@openmrs/esm-offline": ["../esm-offline/src/index.ts"],
27
- "@openmrs/esm-offline/src/public": ["../esm-offline/src/public.ts"],
28
26
  "@openmrs/esm-react-utils": ["../esm-react-utils/src/index.ts"],
29
27
  "@openmrs/esm-react-utils/src/public": ["../esm-react-utils/src/public.ts"],
30
28
  "@openmrs/esm-routes": ["../esm-routes/src/index.ts"],
@@ -1,22 +0,0 @@
1
- [O3 Framework](../API.md) / beginEditSynchronizationItem
2
-
3
- # Function: beginEditSynchronizationItem()
4
-
5
- > **beginEditSynchronizationItem**(`id`): `Promise`\<`void`\>
6
-
7
- Defined in: [packages/framework/esm-offline/src/sync.ts:330](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-offline/src/sync.ts#L330)
8
-
9
- Triggers an edit flow for the given synchronization item.
10
- If this is not possible, throws an error.
11
-
12
- ## Parameters
13
-
14
- ### id
15
-
16
- `number`
17
-
18
- The ID of the synchronization item to be edited.
19
-
20
- ## Returns
21
-
22
- `Promise`\<`void`\>
@@ -1,22 +0,0 @@
1
- [O3 Framework](../API.md) / canBeginEditSynchronizationItemsOfType
2
-
3
- # Function: canBeginEditSynchronizationItemsOfType()
4
-
5
- > **canBeginEditSynchronizationItemsOfType**(`type`): `boolean`
6
-
7
- Defined in: [packages/framework/esm-offline/src/sync.ts:320](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-offline/src/sync.ts#L320)
8
-
9
- Returns whether editing synchronization items of the given type is supported by the currently
10
- registered synchronization handlers.
11
-
12
- ## Parameters
13
-
14
- ### type
15
-
16
- `string`
17
-
18
- The identifying type of the synchronization item which should be edited.
19
-
20
- ## Returns
21
-
22
- `boolean`
@@ -1,21 +0,0 @@
1
- [O3 Framework](../API.md) / deleteSynchronizationItem
2
-
3
- # Function: deleteSynchronizationItem()
4
-
5
- > **deleteSynchronizationItem**(`id`): `Promise`\<`void`\>
6
-
7
- Defined in: [packages/framework/esm-offline/src/sync.ts:350](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-offline/src/sync.ts#L350)
8
-
9
- Deletes a queued up sync item with the given ID.
10
-
11
- ## Parameters
12
-
13
- ### id
14
-
15
- `number`
16
-
17
- The ID of the synchronization item to be deleted.
18
-
19
- ## Returns
20
-
21
- `Promise`\<`void`\>
@@ -1,13 +0,0 @@
1
- [O3 Framework](../API.md) / generateOfflineUuid
2
-
3
- # Function: generateOfflineUuid()
4
-
5
- > **generateOfflineUuid**(): `string`
6
-
7
- Defined in: [packages/framework/esm-offline/src/uuid-support.ts:7](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-offline/src/uuid-support.ts#L7)
8
-
9
- Generates a UUID-like string which is used for uniquely identifying objects while offline.
10
-
11
- ## Returns
12
-
13
- `string`
@@ -1,11 +0,0 @@
1
- [O3 Framework](../API.md) / getCurrentOfflineMode
2
-
3
- # Function: getCurrentOfflineMode()
4
-
5
- > **getCurrentOfflineMode**(): [`OfflineModeResult`](../interfaces/OfflineModeResult.md)
6
-
7
- Defined in: [packages/framework/esm-offline/src/mode.ts:45](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-offline/src/mode.ts#L45)
8
-
9
- ## Returns
10
-
11
- [`OfflineModeResult`](../interfaces/OfflineModeResult.md)
@@ -1,34 +0,0 @@
1
- [O3 Framework](../API.md) / getDynamicOfflineDataEntriesFor
2
-
3
- # Function: getDynamicOfflineDataEntriesFor()
4
-
5
- > **getDynamicOfflineDataEntriesFor**\<`T`\>(`userId`, `type?`): `Promise`\<`T`[]\>
6
-
7
- Defined in: [packages/framework/esm-offline/src/dynamic-offline-data.ts:139](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-offline/src/dynamic-offline-data.ts#L139)
8
-
9
- Returns all [DynamicOfflineData](../interfaces/DynamicOfflineData.md) entries which registered for the given user.
10
- Optionally returns only entries of a given type.
11
-
12
- ## Type Parameters
13
-
14
- ### T
15
-
16
- `T` *extends* [`DynamicOfflineData`](../interfaces/DynamicOfflineData.md)
17
-
18
- ## Parameters
19
-
20
- ### userId
21
-
22
- `string`
23
-
24
- The ID of the user whose entries are to be retrieved.
25
-
26
- ### type?
27
-
28
- `string`
29
-
30
- The type of the entries to be returned. If `undefined`, returns all types.
31
-
32
- ## Returns
33
-
34
- `Promise`\<`T`[]\>
@@ -1,13 +0,0 @@
1
- [O3 Framework](../API.md) / getDynamicOfflineDataHandlers
2
-
3
- # Function: getDynamicOfflineDataHandlers()
4
-
5
- > **getDynamicOfflineDataHandlers**(): [`DynamicOfflineDataHandler`](../interfaces/DynamicOfflineDataHandler.md)[]
6
-
7
- Defined in: [packages/framework/esm-offline/src/dynamic-offline-data.ts:104](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-offline/src/dynamic-offline-data.ts#L104)
8
-
9
- Returns all handlers which have been setup using the [setupDynamicOfflineDataHandler](setupDynamicOfflineDataHandler.md) function.
10
-
11
- ## Returns
12
-
13
- [`DynamicOfflineDataHandler`](../interfaces/DynamicOfflineDataHandler.md)[]
@@ -1,27 +0,0 @@
1
- [O3 Framework](../API.md) / getFullSynchronizationItems
2
-
3
- # Function: getFullSynchronizationItems()
4
-
5
- > **getFullSynchronizationItems**\<`T`\>(`type?`): `Promise`\<[`SyncItem`](../interfaces/SyncItem.md)\<`T`\>[]\>
6
-
7
- Defined in: [packages/framework/esm-offline/src/sync.ts:302](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-offline/src/sync.ts#L302)
8
-
9
- Returns all currently queued up sync items of the currently signed in user.
10
-
11
- ## Type Parameters
12
-
13
- ### T
14
-
15
- `T`
16
-
17
- ## Parameters
18
-
19
- ### type?
20
-
21
- `string`
22
-
23
- The identifying type of the synchronization items to be returned.
24
-
25
- ## Returns
26
-
27
- `Promise`\<[`SyncItem`](../interfaces/SyncItem.md)\<`T`\>[]\>
@@ -1,33 +0,0 @@
1
- [O3 Framework](../API.md) / getFullSynchronizationItemsFor
2
-
3
- # Function: getFullSynchronizationItemsFor()
4
-
5
- > **getFullSynchronizationItemsFor**\<`T`\>(`userId`, `type?`): `Promise`\<[`SyncItem`](../interfaces/SyncItem.md)\<`T`\>[]\>
6
-
7
- Defined in: [packages/framework/esm-offline/src/sync.ts:281](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-offline/src/sync.ts#L281)
8
-
9
- Returns all currently queued up sync items of a given user.
10
-
11
- ## Type Parameters
12
-
13
- ### T
14
-
15
- `T`
16
-
17
- ## Parameters
18
-
19
- ### userId
20
-
21
- `string`
22
-
23
- The ID of the user whose synchronization items should be returned.
24
-
25
- ### type?
26
-
27
- `string`
28
-
29
- The identifying type of the synchronization items to be returned..
30
-
31
- ## Returns
32
-
33
- `Promise`\<[`SyncItem`](../interfaces/SyncItem.md)\<`T`\>[]\>
@@ -1,15 +0,0 @@
1
- [O3 Framework](../API.md) / getOfflinePatientDataStore
2
-
3
- # Function: ~~getOfflinePatientDataStore()~~
4
-
5
- > **getOfflinePatientDataStore**(): `StoreApi`\<[`OfflinePatientDataSyncStore`](../interfaces/OfflinePatientDataSyncStore.md)\>
6
-
7
- Defined in: [packages/framework/esm-offline/src/offline-patient-data.ts:39](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-offline/src/offline-patient-data.ts#L39)
8
-
9
- ## Returns
10
-
11
- `StoreApi`\<[`OfflinePatientDataSyncStore`](../interfaces/OfflinePatientDataSyncStore.md)\>
12
-
13
- ## Deprecated
14
-
15
- Will be removed once all modules have been migrated to the new dynamic offline data API.
@@ -1,27 +0,0 @@
1
- [O3 Framework](../API.md) / getSynchronizationItem
2
-
3
- # Function: getSynchronizationItem()
4
-
5
- > **getSynchronizationItem**\<`T`\>(`id`): `Promise`\<`undefined` \| [`SyncItem`](../interfaces/SyncItem.md)\<`T`\>\>
6
-
7
- Defined in: [packages/framework/esm-offline/src/sync.ts:311](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-offline/src/sync.ts#L311)
8
-
9
- Returns a queued sync item with the given ID or `undefined` if no such item exists.
10
-
11
- ## Type Parameters
12
-
13
- ### T
14
-
15
- `T` = `any`
16
-
17
- ## Parameters
18
-
19
- ### id
20
-
21
- `number`
22
-
23
- The ID of the requested sync item.
24
-
25
- ## Returns
26
-
27
- `Promise`\<`undefined` \| [`SyncItem`](../interfaces/SyncItem.md)\<`T`\>\>
@@ -1,19 +0,0 @@
1
- [O3 Framework](../API.md) / isOfflineUuid
2
-
3
- # Function: isOfflineUuid()
4
-
5
- > **isOfflineUuid**(`uuid`): `boolean`
6
-
7
- Defined in: [packages/framework/esm-offline/src/uuid-support.ts:12](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-offline/src/uuid-support.ts#L12)
8
-
9
- Checks whether the given string has the format of an offline UUID generated by [generateOfflineUuid](generateOfflineUuid.md)
10
-
11
- ## Parameters
12
-
13
- ### uuid
14
-
15
- `string`
16
-
17
- ## Returns
18
-
19
- `boolean`
@@ -1,27 +0,0 @@
1
- [O3 Framework](../API.md) / isOnline
2
-
3
- # Function: isOnline()
4
-
5
- > **isOnline**(`online?`): `boolean`
6
-
7
- Defined in: [packages/framework/esm-utils/src/is-online.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/is-online.ts#L15)
8
-
9
- Determines if the application should behave as if it is online.
10
- When offline mode is enabled (`window.offlineEnabled`), this returns the
11
- provided `online` parameter or falls back to `navigator.onLine`.
12
- When offline mode is disabled, this always returns `true`.
13
-
14
- ## Parameters
15
-
16
- ### online?
17
-
18
- `boolean`
19
-
20
- Optional override for the online status. If provided and offline
21
- mode is enabled, this value is returned directly.
22
-
23
- ## Returns
24
-
25
- `boolean`
26
-
27
- `true` if the application should behave as online, `false` otherwise.
@@ -1,55 +0,0 @@
1
- [O3 Framework](../API.md) / openmrsObservableFetch
2
-
3
- # Function: openmrsObservableFetch()
4
-
5
- > **openmrsObservableFetch**\<`T`\>(`url`, `fetchInit`): `Observable`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<`T`\>\>
6
-
7
- Defined in: [packages/framework/esm-api/src/openmrs-fetch.ts:288](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/openmrs-fetch.ts#L288)
8
-
9
- The openmrsObservableFetch function is a wrapper around openmrsFetch
10
- that returns an [Observable](https://rxjs-dev.firebaseapp.com/guide/observable)
11
- instead of a promise. It exists in case using an Observable is
12
- preferred or more convenient than a promise.
13
-
14
- ## Type Parameters
15
-
16
- ### T
17
-
18
- `T`
19
-
20
- ## Parameters
21
-
22
- ### url
23
-
24
- `string`
25
-
26
- See [[openmrsFetch]]
27
-
28
- ### fetchInit
29
-
30
- [`FetchConfig`](../interfaces/FetchConfig.md) = `{}`
31
-
32
- See [[openmrsFetch]]
33
-
34
- ## Returns
35
-
36
- `Observable`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<`T`\>\>
37
-
38
- An Observable that produces exactly one Response object.
39
- The response object is exactly the same as for [[openmrsFetch]].
40
-
41
- ## Example
42
-
43
- ```js
44
- import { openmrsObservableFetch } from '@openmrs/esm-api'
45
- const subscription = openmrsObservableFetch(`${restBaseUrl}/session').subscribe(
46
- response => console.log(response.data),
47
- err => {throw err},
48
- () => console.log('finished')
49
- )
50
- subscription.unsubscribe()
51
- ```
52
-
53
- #### Cancellation
54
-
55
- To cancel the network request, simply call `subscription.unsubscribe();`
@@ -1,28 +0,0 @@
1
- [O3 Framework](../API.md) / putDynamicOfflineData
2
-
3
- # Function: putDynamicOfflineData()
4
-
5
- > **putDynamicOfflineData**(`type`, `identifier`): `Promise`\<`void`\>
6
-
7
- Defined in: [packages/framework/esm-offline/src/dynamic-offline-data.ts:157](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-offline/src/dynamic-offline-data.ts#L157)
8
-
9
- Declares that dynamic offline data of the given [type](#putdynamicofflinedata) with the given [identifier](#putdynamicofflinedata)
10
- should be made available offline for the currently logged in user.
11
-
12
- ## Parameters
13
-
14
- ### type
15
-
16
- `string`
17
-
18
- The type of the offline data. See [DynamicOfflineData](../interfaces/DynamicOfflineData.md) for details.
19
-
20
- ### identifier
21
-
22
- `string`
23
-
24
- The identifier of the offline data. See [DynamicOfflineData](../interfaces/DynamicOfflineData.md) for details.
25
-
26
- ## Returns
27
-
28
- `Promise`\<`void`\>
@@ -1,34 +0,0 @@
1
- [O3 Framework](../API.md) / putDynamicOfflineDataFor
2
-
3
- # Function: putDynamicOfflineDataFor()
4
-
5
- > **putDynamicOfflineDataFor**(`userId`, `type`, `identifier`): `Promise`\<`void`\>
6
-
7
- Defined in: [packages/framework/esm-offline/src/dynamic-offline-data.ts:169](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-offline/src/dynamic-offline-data.ts#L169)
8
-
9
- Declares that dynamic offline data of the given [type](#putdynamicofflinedatafor) with the given [identifier](#putdynamicofflinedatafor)
10
- should be made available offline for the user with the given ID.
11
-
12
- ## Parameters
13
-
14
- ### userId
15
-
16
- `string`
17
-
18
- The ID of the user for whom the dynamic offline data should be made available.
19
-
20
- ### type
21
-
22
- `string`
23
-
24
- The type of the offline data. See [DynamicOfflineData](../interfaces/DynamicOfflineData.md) for details.
25
-
26
- ### identifier
27
-
28
- `string`
29
-
30
- The identifier of the offline data. See [DynamicOfflineData](../interfaces/DynamicOfflineData.md) for details.
31
-
32
- ## Returns
33
-
34
- `Promise`\<`void`\>