@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.
- package/.turbo/turbo-build.log +1 -1
- package/dist/deprecated.d.ts +63 -0
- package/dist/deprecated.d.ts.map +1 -0
- package/dist/deprecated.js +65 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +1 -1
- package/docs/API.md +0 -47
- package/docs/classes/OpenmrsFetchError.md +4 -4
- package/docs/enumerations/VisitMode.md +4 -4
- package/docs/enumerations/VisitStatus.md +3 -3
- package/docs/functions/attach.md +1 -1
- package/docs/functions/clearCurrentUser.md +1 -1
- package/docs/functions/createErrorHandler.md +1 -1
- package/docs/functions/detach.md +1 -1
- package/docs/functions/detachAll.md +1 -1
- package/docs/functions/fetchCurrentPatient.md +5 -15
- package/docs/functions/getAssignedExtensions.md +1 -1
- package/docs/functions/getCoreTranslation.md +1 -1
- package/docs/functions/getCurrentUser.md +31 -41
- package/docs/functions/getDynamicOfflineDataEntries.md +11 -10
- package/docs/functions/getExtensionNameFromId.md +1 -1
- package/docs/functions/getExtensionStore.md +1 -1
- package/docs/functions/getLocations.md +3 -3
- package/docs/functions/getLoggedInUser.md +1 -1
- package/docs/functions/getSessionLocation.md +1 -1
- package/docs/functions/getSessionStore.md +1 -1
- package/docs/functions/getSynchronizationItems.md +11 -9
- package/docs/functions/getVisitStore.md +1 -1
- package/docs/functions/getVisitTypes.md +15 -8
- package/docs/functions/getVisitsForPatient.md +1 -1
- package/docs/functions/isVersionSatisfied.md +1 -1
- package/docs/functions/makeUrl.md +1 -1
- package/docs/functions/messageOmrsServiceWorker.md +13 -11
- package/docs/functions/openmrsFetch.md +1 -1
- package/docs/functions/refetchCurrentUser.md +4 -4
- package/docs/functions/renderExtension.md +1 -1
- package/docs/functions/reportError.md +1 -1
- package/docs/functions/saveVisit.md +1 -1
- package/docs/functions/setCurrentVisit.md +1 -1
- package/docs/functions/setSessionLocation.md +1 -1
- package/docs/functions/setUserLanguage.md +1 -1
- package/docs/functions/setUserProperties.md +1 -1
- package/docs/functions/setupDynamicOfflineDataHandler.md +17 -9
- package/docs/functions/setupOfflineSync.md +17 -24
- package/docs/functions/subscribeActionableNotificationShown.md +1 -1
- package/docs/functions/subscribeNotificationShown.md +1 -1
- package/docs/functions/subscribePrecacheStaticDependencies.md +11 -4
- package/docs/functions/subscribeSnackbarShown.md +1 -1
- package/docs/functions/subscribeToastShown.md +1 -1
- package/docs/functions/toLocationObject.md +1 -1
- package/docs/functions/toVisitTypeObject.md +1 -1
- package/docs/functions/updateVisit.md +1 -1
- package/docs/functions/useConnectivity.md +6 -16
- package/docs/functions/useLocations.md +1 -1
- package/docs/functions/useVisitTypes.md +1 -1
- package/docs/functions/userHasAccess.md +1 -1
- package/docs/interfaces/AssignedExtension.md +8 -24
- package/docs/interfaces/CancelLoading.md +2 -2
- package/docs/interfaces/ConnectedExtension.md +6 -6
- package/docs/interfaces/CurrentPatientOptions.md +2 -2
- package/docs/interfaces/DisplayConditionsConfigObject.md +0 -20
- package/docs/interfaces/ExtensionRegistration.md +3 -19
- package/docs/interfaces/ExtensionSlotConfig.md +5 -5
- package/docs/interfaces/ExtensionSlotConfigureValueObject.md +1 -1
- package/docs/interfaces/ExtensionSlotProps.md +2 -2
- package/docs/interfaces/ExtensionSlotState.md +3 -3
- package/docs/interfaces/ExtensionStore.md +2 -2
- package/docs/interfaces/FeatureFlagDefinition.md +4 -4
- package/docs/interfaces/FetchConfig.md +3 -3
- package/docs/interfaces/FetchError.md +3 -3
- package/docs/interfaces/FetchHeaders.md +1 -1
- package/docs/interfaces/FetchResponseJson.md +1 -1
- package/docs/interfaces/ImportMap.md +2 -2
- package/docs/interfaces/OnlyThePatient.md +2 -2
- package/docs/interfaces/OpenmrsAppRoutes.md +13 -13
- package/docs/interfaces/OpenmrsRoutes.md +3 -3
- package/docs/interfaces/PatientWithFullResponse.md +2 -2
- package/docs/interfaces/ResourceLoader.md +2 -2
- package/docs/interfaces/ShowActionableNotificationEvent.md +7 -7
- package/docs/interfaces/ShowNotificationEvent.md +6 -6
- package/docs/interfaces/ShowSnackbarEvent.md +9 -9
- package/docs/interfaces/ShowToastEvent.md +6 -6
- package/docs/interfaces/SpaConfig.md +5 -21
- package/docs/interfaces/VisitItem.md +5 -5
- package/docs/interfaces/VisitStoreState.md +3 -3
- package/docs/interfaces/WorkspaceDefinition2.md +5 -5
- package/docs/interfaces/WorkspaceGroupDefinition.md +3 -3
- package/docs/interfaces/WorkspaceGroupDefinition2.md +6 -6
- package/docs/interfaces/WorkspaceWindowDefinition2.md +7 -7
- package/docs/type-aliases/ConfigValue.md +1 -1
- package/docs/type-aliases/CurrentPatient.md +1 -1
- package/docs/type-aliases/ExtensionDefinition.md +10 -30
- package/docs/type-aliases/ExtensionSlotCustomState.md +1 -1
- package/docs/type-aliases/LoadedSessionStore.md +3 -3
- package/docs/type-aliases/ModalDefinition.md +3 -3
- package/docs/type-aliases/NameUse.md +1 -1
- package/docs/type-aliases/PageDefinition.md +1 -13
- package/docs/type-aliases/PatientUuid.md +1 -1
- package/docs/type-aliases/ProvidedConfig.md +3 -3
- package/docs/type-aliases/SessionStore.md +1 -1
- package/docs/type-aliases/SpaEnvironment.md +1 -1
- package/docs/type-aliases/UnloadedSessionStore.md +3 -3
- package/docs/type-aliases/Validator.md +1 -1
- package/docs/type-aliases/ValidatorFunction.md +1 -1
- package/docs/type-aliases/WorkspaceDefinition.md +10 -10
- package/docs/type-aliases/WorkspaceWindowState.md +1 -1
- package/docs/variables/defaultVisitCustomRepresentation.md +1 -1
- package/docs/variables/fhirBaseUrl.md +1 -1
- package/docs/variables/restBaseUrl.md +1 -1
- package/docs/variables/sessionEndpoint.md +1 -1
- package/docs/variables/visitTypesUrl.md +9 -0
- package/mock-jest.tsx +12 -4
- package/mock.tsx +12 -4
- package/package.json +19 -21
- package/src/deprecated.ts +87 -0
- package/src/index.ts +1 -1
- package/src/internal.ts +1 -1
- package/tsconfig.typedoc.json +0 -2
- package/docs/functions/beginEditSynchronizationItem.md +0 -22
- package/docs/functions/canBeginEditSynchronizationItemsOfType.md +0 -22
- package/docs/functions/deleteSynchronizationItem.md +0 -21
- package/docs/functions/generateOfflineUuid.md +0 -13
- package/docs/functions/getCurrentOfflineMode.md +0 -11
- package/docs/functions/getDynamicOfflineDataEntriesFor.md +0 -34
- package/docs/functions/getDynamicOfflineDataHandlers.md +0 -13
- package/docs/functions/getFullSynchronizationItems.md +0 -27
- package/docs/functions/getFullSynchronizationItemsFor.md +0 -33
- package/docs/functions/getOfflinePatientDataStore.md +0 -15
- package/docs/functions/getSynchronizationItem.md +0 -27
- package/docs/functions/isOfflineUuid.md +0 -19
- package/docs/functions/isOnline.md +0 -27
- package/docs/functions/openmrsObservableFetch.md +0 -55
- package/docs/functions/putDynamicOfflineData.md +0 -28
- package/docs/functions/putDynamicOfflineDataFor.md +0 -34
- package/docs/functions/queueSynchronizationItem.md +0 -39
- package/docs/functions/registerOfflinePatientHandler.md +0 -25
- package/docs/functions/removeDynamicOfflineData.md +0 -28
- package/docs/functions/removeDynamicOfflineDataFor.md +0 -34
- package/docs/functions/subscribeConnectivity.md +0 -21
- package/docs/functions/subscribeConnectivityChanged.md +0 -21
- package/docs/functions/syncAllDynamicOfflineData.md +0 -27
- package/docs/functions/syncDynamicOfflineData.md +0 -33
- package/docs/functions/syncOfflinePatientData.md +0 -21
- package/docs/interfaces/ClearDynamicRoutesMessage.md +0 -21
- package/docs/interfaces/ConnectivityChangedEvent.md +0 -13
- package/docs/interfaces/DynamicOfflineData.md +0 -60
- package/docs/interfaces/DynamicOfflineDataHandler.md +0 -98
- package/docs/interfaces/DynamicOfflineDataSyncState.md +0 -65
- package/docs/interfaces/MessageServiceWorkerResult.md +0 -35
- package/docs/interfaces/OfflineModeResult.md +0 -29
- package/docs/interfaces/OfflinePatientArgs.md +0 -25
- package/docs/interfaces/OfflinePatientDataSyncHandler.md +0 -35
- package/docs/interfaces/OfflinePatientDataSyncState.md +0 -61
- package/docs/interfaces/OfflinePatientDataSyncStore.md +0 -25
- package/docs/interfaces/OmrsServiceWorkerMessage.md +0 -25
- package/docs/interfaces/OnImportMapChangedMessage.md +0 -29
- package/docs/interfaces/PrecacheStaticDependenciesEvent.md +0 -5
- package/docs/interfaces/QueueItemDescriptor.md +0 -50
- package/docs/interfaces/RegisterDynamicRouteMessage.md +0 -45
- package/docs/interfaces/SyncItem.md +0 -79
- package/docs/interfaces/SyncProcessOptions.md +0 -53
- package/docs/type-aliases/KnownOmrsServiceWorkerMessages.md +0 -7
- package/docs/type-aliases/OfflineMode.md +0 -7
- package/docs/type-aliases/OmrsOfflineCachingStrategy.md +0 -12
- package/docs/type-aliases/OmrsOfflineHttpHeaderNames.md +0 -7
- package/docs/type-aliases/OmrsOfflineHttpHeaders.md +0 -44
- package/docs/variables/getStartedVisit.md +0 -9
- package/docs/variables/offlineUuidPrefix.md +0 -7
- package/docs/variables/omrsOfflineCachingStrategyHttpHeaderName.md +0 -7
- package/docs/variables/omrsOfflineResponseBodyHttpHeaderName.md +0 -7
- 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()
|
|
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
|
-
/*
|
|
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
|
|
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.
|
|
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.
|
|
64
|
-
"@openmrs/esm-config": "10.0.1-pre.
|
|
65
|
-
"@openmrs/esm-context": "10.0.1-pre.
|
|
66
|
-
"@openmrs/esm-dynamic-loading": "10.0.1-pre.
|
|
67
|
-
"@openmrs/esm-emr-api": "10.0.1-pre.
|
|
68
|
-
"@openmrs/esm-error-handling": "10.0.1-pre.
|
|
69
|
-
"@openmrs/esm-expression-evaluator": "10.0.1-pre.
|
|
70
|
-
"@openmrs/esm-extensions": "10.0.1-pre.
|
|
71
|
-
"@openmrs/esm-feature-flags": "10.0.1-pre.
|
|
72
|
-
"@openmrs/esm-globals": "10.0.1-pre.
|
|
73
|
-
"@openmrs/esm-navigation": "10.0.1-pre.
|
|
74
|
-
"@openmrs/esm-
|
|
75
|
-
"@openmrs/esm-
|
|
76
|
-
"@openmrs/esm-
|
|
77
|
-
"@openmrs/esm-
|
|
78
|
-
"@openmrs/esm-
|
|
79
|
-
"@openmrs/esm-
|
|
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.
|
|
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';
|
package/tsconfig.typedoc.json
CHANGED
|
@@ -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`\>
|