@openmrs/esm-framework 10.0.1-pre.5542 → 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
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
[O3 Framework](../API.md) / getDynamicOfflineDataEntries
|
|
2
2
|
|
|
3
|
-
# Function: getDynamicOfflineDataEntries()
|
|
3
|
+
# Function: ~~getDynamicOfflineDataEntries()~~
|
|
4
4
|
|
|
5
|
-
> **getDynamicOfflineDataEntries**\<`T`\>(`
|
|
5
|
+
> **getDynamicOfflineDataEntries**\<`T`\>(`_type?`): `Promise`\<`T`[]\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-
|
|
8
|
-
|
|
9
|
-
Returns all [DynamicOfflineData](../interfaces/DynamicOfflineData.md) entries which registered for the currently logged in user.
|
|
10
|
-
Optionally returns only entries of a given type.
|
|
7
|
+
Defined in: [packages/framework/esm-framework/src/deprecated.ts:39](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-framework/src/deprecated.ts#L39)
|
|
11
8
|
|
|
12
9
|
## Type Parameters
|
|
13
10
|
|
|
14
11
|
### T
|
|
15
12
|
|
|
16
|
-
`T`
|
|
13
|
+
`T` = `unknown`
|
|
17
14
|
|
|
18
15
|
## Parameters
|
|
19
16
|
|
|
20
|
-
###
|
|
17
|
+
### \_type?
|
|
21
18
|
|
|
22
19
|
`string`
|
|
23
20
|
|
|
24
|
-
The type of the entries to be returned. If `undefined`, returns all types.
|
|
25
|
-
|
|
26
21
|
## Returns
|
|
27
22
|
|
|
28
23
|
`Promise`\<`T`[]\>
|
|
24
|
+
|
|
25
|
+
## Deprecated
|
|
26
|
+
|
|
27
|
+
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.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **getExtensionNameFromId**(`extensionId`): `string`
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-extensions/src/extensions.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-extensions/src/extensions.ts:251](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/extensions.ts#L251)
|
|
8
8
|
|
|
9
9
|
Given an extension ID, which is a string uniquely identifying
|
|
10
10
|
an instance of an extension within an extension slot, this
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **getExtensionStore**(): `StoreApi`\<[`ExtensionStore`](../interfaces/ExtensionStore.md)\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-extensions/src/store.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-extensions/src/store.ts:232](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/store.ts#L232)
|
|
8
8
|
|
|
9
9
|
This returns a store that modules can use to get information about the
|
|
10
10
|
state of the extension system.
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Function: getLocations()
|
|
4
4
|
|
|
5
|
-
> **getLocations**(`tagUuidOrName`, `query`): `
|
|
5
|
+
> **getLocations**(`tagUuidOrName`, `query`): `Promise`\<[`Location`](../interfaces/Location.md)[]\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-emr-api/src/location.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-emr-api/src/location.ts:12](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/location.ts#L12)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -18,4 +18,4 @@ Defined in: [packages/framework/esm-emr-api/src/location.ts:14](https://github.c
|
|
|
18
18
|
|
|
19
19
|
## Returns
|
|
20
20
|
|
|
21
|
-
`
|
|
21
|
+
`Promise`\<[`Location`](../interfaces/Location.md)[]\>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **getLoggedInUser**(): `Promise`\<[`LoggedInUser`](../interfaces/LoggedInUser.md)\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-api/src/current-user.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-api/src/current-user.ts:318](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/current-user.ts#L318)
|
|
8
8
|
|
|
9
9
|
Returns a Promise that resolves with the currently logged-in user object.
|
|
10
10
|
If the user is already loaded in the session store, the Promise resolves immediately.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **getSessionLocation**(): `Promise`\<`undefined` \| [`SessionLocation`](../interfaces/SessionLocation.md)\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-api/src/current-user.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-api/src/current-user.ts:356](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/current-user.ts#L356)
|
|
8
8
|
|
|
9
9
|
Returns a Promise that resolves with the current session location, if one is set.
|
|
10
10
|
The session location represents the physical location where the user is currently
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **getSessionStore**(): `StoreApi`\<[`SessionStore`](../type-aliases/SessionStore.md)\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-api/src/current-user.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-api/src/current-user.ts:141](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/current-user.ts#L141)
|
|
8
8
|
|
|
9
9
|
Returns the global session store containing the current user's session information.
|
|
10
10
|
If the session data is stale (older than 1 minute) or not yet loaded, this function
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
[O3 Framework](../API.md) / getSynchronizationItems
|
|
2
2
|
|
|
3
|
-
# Function: getSynchronizationItems()
|
|
3
|
+
# Function: ~~getSynchronizationItems()~~
|
|
4
4
|
|
|
5
|
-
> **getSynchronizationItems**\<`T`\>(`
|
|
5
|
+
> **getSynchronizationItems**\<`T`\>(`_type?`): `Promise`\<`T`[]\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-
|
|
8
|
-
|
|
9
|
-
Returns the content of all currently queued up sync items of the currently signed in user.
|
|
7
|
+
Defined in: [packages/framework/esm-framework/src/deprecated.ts:48](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-framework/src/deprecated.ts#L48)
|
|
10
8
|
|
|
11
9
|
## Type Parameters
|
|
12
10
|
|
|
13
11
|
### T
|
|
14
12
|
|
|
15
|
-
`T`
|
|
13
|
+
`T` = `unknown`
|
|
16
14
|
|
|
17
15
|
## Parameters
|
|
18
16
|
|
|
19
|
-
###
|
|
17
|
+
### \_type?
|
|
20
18
|
|
|
21
19
|
`string`
|
|
22
20
|
|
|
23
|
-
The identifying type of the synchronization items to be returned.
|
|
24
|
-
|
|
25
21
|
## Returns
|
|
26
22
|
|
|
27
23
|
`Promise`\<`T`[]\>
|
|
24
|
+
|
|
25
|
+
## Deprecated
|
|
26
|
+
|
|
27
|
+
Offline support has been removed from the framework. This is a stub kept only so that
|
|
28
|
+
frontend modules that still read the sync queue keep working. It always resolves to an empty array,
|
|
29
|
+
since nothing is queued for synchronization any more.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **getVisitStore**(): `StoreApi`\<[`VisitStoreState`](../interfaces/VisitStoreState.md)\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:67](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L67)
|
|
8
8
|
|
|
9
9
|
Returns the global visit store that manages the current visit state. The store
|
|
10
10
|
contains information about the current patient's visit and provides methods
|
|
@@ -2,24 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Function: getVisitTypes()
|
|
4
4
|
|
|
5
|
-
> **getVisitTypes**(): `
|
|
5
|
+
> **getVisitTypes**(`url`): `Promise`\<[`VisitType`](../interfaces/VisitType.md)[]\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-emr-api/src/visit-type.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-emr-api/src/visit-type.ts:30](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-type.ts#L30)
|
|
8
8
|
|
|
9
9
|
Fetches all available visit types from the OpenMRS REST API.
|
|
10
10
|
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
### url
|
|
14
|
+
|
|
15
|
+
`string` = `visitTypesUrl`
|
|
16
|
+
|
|
17
|
+
The endpoint to read from, defaulting to [visitTypesUrl](../variables/visitTypesUrl.md). This exists so that the
|
|
18
|
+
function can be passed straight to SWR as a fetcher, which calls it with the cache key.
|
|
19
|
+
|
|
11
20
|
## Returns
|
|
12
21
|
|
|
13
|
-
`
|
|
22
|
+
`Promise`\<[`VisitType`](../interfaces/VisitType.md)[]\>
|
|
14
23
|
|
|
15
|
-
|
|
16
|
-
The Observable will emit exactly one value containing all visit types.
|
|
24
|
+
A Promise that resolves with an array of VisitType objects.
|
|
17
25
|
|
|
18
26
|
## Example
|
|
19
27
|
|
|
20
28
|
```ts
|
|
21
29
|
import { getVisitTypes } from '@openmrs/esm-framework';
|
|
22
|
-
getVisitTypes()
|
|
23
|
-
|
|
24
|
-
});
|
|
30
|
+
const visitTypes = await getVisitTypes();
|
|
31
|
+
console.log('Available visit types:', visitTypes);
|
|
25
32
|
```
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **getVisitsForPatient**(`patientUuid`, `abortController`, `v?`): `Promise`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<\{ `results`: [`Visit`](../interfaces/Visit.md)[]; \}\>\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:172](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L172)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **isVersionSatisfied**(`requiredVersion`, `installedVersion`): `boolean`
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-utils/src/version.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-utils/src/version.ts:33](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/version.ts#L33)
|
|
8
8
|
|
|
9
9
|
Checks if an installed version satisfies a required version range using
|
|
10
10
|
semver comparison. Handles prerelease versions and normalizes version strings.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **makeUrl**(`path`): `string`
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-api/src/openmrs-fetch.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-api/src/openmrs-fetch.ts:29](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/openmrs-fetch.ts#L29)
|
|
8
8
|
|
|
9
9
|
Append `path` to the OpenMRS SPA base.
|
|
10
10
|
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
[O3 Framework](../API.md) / messageOmrsServiceWorker
|
|
2
2
|
|
|
3
|
-
# Function: messageOmrsServiceWorker()
|
|
3
|
+
# Function: ~~messageOmrsServiceWorker()~~
|
|
4
4
|
|
|
5
|
-
> **messageOmrsServiceWorker**(`
|
|
5
|
+
> **messageOmrsServiceWorker**(`_message`): `Promise`\<\{ `error`: `string`; `result`: `undefined`; `success`: `false`; \}\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-
|
|
8
|
-
|
|
9
|
-
Sends the specified message to the application's service worker.
|
|
7
|
+
Defined in: [packages/framework/esm-framework/src/deprecated.ts:59](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-framework/src/deprecated.ts#L59)
|
|
10
8
|
|
|
11
9
|
## Parameters
|
|
12
10
|
|
|
13
|
-
###
|
|
14
|
-
|
|
15
|
-
[`KnownOmrsServiceWorkerMessages`](../type-aliases/KnownOmrsServiceWorkerMessages.md)
|
|
11
|
+
### \_message
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
`unknown`
|
|
18
14
|
|
|
19
15
|
## Returns
|
|
20
16
|
|
|
21
|
-
`Promise
|
|
17
|
+
`Promise`\<\{ `error`: `string`; `result`: `undefined`; `success`: `false`; \}\>
|
|
18
|
+
|
|
19
|
+
## Deprecated
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
The offline service worker has been removed from the framework.
|
|
22
|
+
This is a no-op kept only so that frontend modules that still call
|
|
23
|
+
`messageOmrsServiceWorker` don't throw. It always resolves to an
|
|
24
|
+
unsuccessful result, mirroring the previous "no service worker registered"
|
|
25
|
+
behavior.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **openmrsFetch**\<`T`\>(`path`, `fetchInit`): `Promise`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<`T`\>\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-api/src/openmrs-fetch.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-api/src/openmrs-fetch.ts:89](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/openmrs-fetch.ts#L89)
|
|
8
8
|
|
|
9
9
|
The openmrsFetch function is a wrapper around the
|
|
10
10
|
[browser's built-in fetch function](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch),
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
> **refetchCurrentUser**(`username?`, `password?`): `Promise`\<[`SessionStore`](../type-aliases/SessionStore.md)\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-api/src/current-user.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-api/src/current-user.ts:223](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/current-user.ts#L223)
|
|
8
8
|
|
|
9
9
|
The `refetchCurrentUser` function causes a network request to redownload
|
|
10
|
-
the user. All subscribers to the
|
|
11
|
-
new
|
|
10
|
+
the user. All subscribers to the session store will be notified of the
|
|
11
|
+
new user once the new version of the user object is downloaded.
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -24,7 +24,7 @@ new users once the new version of the user object is downloaded.
|
|
|
24
24
|
|
|
25
25
|
`Promise`\<[`SessionStore`](../type-aliases/SessionStore.md)\>
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
A Promise resolving to the updated session store state.
|
|
28
28
|
|
|
29
29
|
## Example
|
|
30
30
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **renderExtension**(`domElement`, `extensionSlotName`, `extensionSlotModuleName`, `extensionId`, `renderFunction`, `additionalProps`): `Promise`\<`null` \| `Parcel`\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-extensions/src/render.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-extensions/src/render.ts:374](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/render.ts#L374)
|
|
8
8
|
|
|
9
9
|
Mounts into a DOM node (representing an extension slot)
|
|
10
10
|
a lazy-loaded component from *any* frontend module
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **reportError**(`err`): `void`
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-error-handling/src/index.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-error-handling/src/index.ts:67](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-error-handling/src/index.ts#L67)
|
|
8
8
|
|
|
9
9
|
Reports an error to the global error handler. The error will be displayed
|
|
10
10
|
to the user as a toast notification. This function ensures the error is
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **saveVisit**(`payload`, `abortController`): `Promise`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<[`Visit`](../interfaces/Visit.md)\>\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:126](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L126)
|
|
8
8
|
|
|
9
9
|
Creates a new visit by sending a POST request to the OpenMRS REST API.
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **setCurrentVisit**(`patientUuid`, `visitUuid`): `void`
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:87](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L87)
|
|
8
8
|
|
|
9
9
|
Sets the current visit for a patient in the global visit store. This is used
|
|
10
10
|
to manually specify which visit should be considered "active" for the given patient.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **setSessionLocation**(`locationUuid`, `abortController`): `Promise`\<`any`\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-api/src/current-user.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-api/src/current-user.ts:378](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/current-user.ts#L378)
|
|
8
8
|
|
|
9
9
|
Sets the session location for the current user. The session location represents
|
|
10
10
|
the physical location where the user is working (e.g., a clinic or ward).
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **setUserLanguage**(`data`): `void`
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-api/src/current-user.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-api/src/current-user.ts:172](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/current-user.ts#L172)
|
|
8
8
|
|
|
9
9
|
Sets the document's language attribute based on the user's locale preference
|
|
10
10
|
from the session data. This affects the HTML `lang` attribute which is used
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **setUserProperties**(`userUuid`, `userProperties`, `abortController?`): `Promise`\<[`SessionStore`](../type-aliases/SessionStore.md)\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-api/src/current-user.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-api/src/current-user.ts:414](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/current-user.ts#L414)
|
|
8
8
|
|
|
9
9
|
Updates the user properties for a specific user. User properties are key-value
|
|
10
10
|
pairs that store user-specific settings and preferences. After updating the
|
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
[O3 Framework](../API.md) / setupDynamicOfflineDataHandler
|
|
2
2
|
|
|
3
|
-
# Function: setupDynamicOfflineDataHandler()
|
|
3
|
+
# Function: ~~setupDynamicOfflineDataHandler()~~
|
|
4
4
|
|
|
5
|
-
> **setupDynamicOfflineDataHandler**(`
|
|
5
|
+
> **setupDynamicOfflineDataHandler**(`_handler`): `void`
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-
|
|
8
|
-
|
|
9
|
-
Sets up a handler for synchronizing dynamic offline data.
|
|
10
|
-
See [DynamicOfflineDataHandler](../interfaces/DynamicOfflineDataHandler.md) for details.
|
|
7
|
+
Defined in: [packages/framework/esm-framework/src/deprecated.ts:30](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-framework/src/deprecated.ts#L30)
|
|
11
8
|
|
|
12
9
|
## Parameters
|
|
13
10
|
|
|
14
|
-
###
|
|
11
|
+
### \_handler
|
|
12
|
+
|
|
13
|
+
#### id
|
|
14
|
+
|
|
15
|
+
`string`
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
#### type
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
`string`
|
|
19
20
|
|
|
20
21
|
## Returns
|
|
21
22
|
|
|
22
23
|
`void`
|
|
24
|
+
|
|
25
|
+
## Deprecated
|
|
26
|
+
|
|
27
|
+
Offline support has been removed from the framework. This is a
|
|
28
|
+
no-op kept only so that frontend modules that still call
|
|
29
|
+
`setupDynamicOfflineDataHandler` during registration don't throw. Remove your
|
|
30
|
+
dynamic offline data handlers; their data will no longer be cached for offline use.
|
|
@@ -1,49 +1,42 @@
|
|
|
1
1
|
[O3 Framework](../API.md) / setupOfflineSync
|
|
2
2
|
|
|
3
|
-
# Function: setupOfflineSync()
|
|
3
|
+
# Function: ~~setupOfflineSync()~~
|
|
4
4
|
|
|
5
|
-
> **setupOfflineSync**\<`T`\>(`
|
|
5
|
+
> **setupOfflineSync**\<`T`\>(`_type`, `_dependsOn`, `_process`, `_options?`): `void`
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-
|
|
8
|
-
|
|
9
|
-
Registers a new synchronization handler which is able to synchronize data of a specific type.
|
|
7
|
+
Defined in: [packages/framework/esm-framework/src/deprecated.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-framework/src/deprecated.ts#L15)
|
|
10
8
|
|
|
11
9
|
## Type Parameters
|
|
12
10
|
|
|
13
11
|
### T
|
|
14
12
|
|
|
15
|
-
`T`
|
|
13
|
+
`T` = `unknown`
|
|
16
14
|
|
|
17
15
|
## Parameters
|
|
18
16
|
|
|
19
|
-
###
|
|
17
|
+
### \_type
|
|
20
18
|
|
|
21
19
|
`string`
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
### dependsOn
|
|
21
|
+
### \_dependsOn
|
|
26
22
|
|
|
27
23
|
`string`[]
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
can synchronize its own data. Items of these types are effectively dependencies of the data
|
|
31
|
-
synchronized by this handler.
|
|
32
|
-
|
|
33
|
-
### process
|
|
34
|
-
|
|
35
|
-
`ProcessSyncItem`\<`T`\>
|
|
25
|
+
### \_process
|
|
36
26
|
|
|
37
|
-
|
|
38
|
-
`item` (which is the actual data to be synchronized).
|
|
27
|
+
(`item`, `options`) => `Promise`\<`unknown`\>
|
|
39
28
|
|
|
40
|
-
###
|
|
29
|
+
### \_options?
|
|
41
30
|
|
|
42
|
-
`
|
|
43
|
-
|
|
44
|
-
Additional options which can optionally be provided when setting up a synchronization callback
|
|
45
|
-
for a specific synchronization item type.
|
|
31
|
+
`unknown`
|
|
46
32
|
|
|
47
33
|
## Returns
|
|
48
34
|
|
|
49
35
|
`void`
|
|
36
|
+
|
|
37
|
+
## Deprecated
|
|
38
|
+
|
|
39
|
+
Offline support has been removed from the framework. This is a
|
|
40
|
+
no-op kept only so that frontend modules that still call `setupOfflineSync`
|
|
41
|
+
during registration don't throw. Remove your offline sync handlers; queued
|
|
42
|
+
items will no longer be synchronized.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **subscribeActionableNotificationShown**(`cb`): () => `void`
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-globals/src/events.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-globals/src/events.ts:72](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L72)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **subscribeNotificationShown**(`cb`): () => `void`
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-globals/src/events.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-globals/src/events.ts:65](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L65)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
[O3 Framework](../API.md) / subscribePrecacheStaticDependencies
|
|
2
2
|
|
|
3
|
-
# Function: subscribePrecacheStaticDependencies()
|
|
3
|
+
# Function: ~~subscribePrecacheStaticDependencies()~~
|
|
4
4
|
|
|
5
|
-
> **subscribePrecacheStaticDependencies**(`
|
|
5
|
+
> **subscribePrecacheStaticDependencies**(`_callback`): () => `void`
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-
|
|
7
|
+
Defined in: [packages/framework/esm-framework/src/deprecated.ts:75](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-framework/src/deprecated.ts#L75)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
11
|
-
###
|
|
11
|
+
### \_callback
|
|
12
12
|
|
|
13
13
|
(`data`) => `void`
|
|
14
14
|
|
|
@@ -19,3 +19,10 @@ Defined in: [packages/framework/esm-globals/src/events.ts:38](https://github.com
|
|
|
19
19
|
### Returns
|
|
20
20
|
|
|
21
21
|
`void`
|
|
22
|
+
|
|
23
|
+
## Deprecated
|
|
24
|
+
|
|
25
|
+
Offline support has been removed from the framework. This is a
|
|
26
|
+
no-op kept only so that frontend modules that still call
|
|
27
|
+
`subscribePrecacheStaticDependencies` don't throw. The callback is never
|
|
28
|
+
invoked. Returns a no-op unsubscribe function so existing teardown code keeps working.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **subscribeSnackbarShown**(`cb`): () => `void`
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-globals/src/events.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-globals/src/events.ts:86](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L86)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **subscribeToastShown**(`cb`): () => `void`
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-globals/src/events.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-globals/src/events.ts:79](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L79)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **toLocationObject**(`openmrsRestForm`): [`Location`](../interfaces/Location.md)
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-emr-api/src/location.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-emr-api/src/location.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/location.ts#L5)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **toVisitTypeObject**(`openmrsRestForm`): [`VisitType`](../interfaces/VisitType.md)
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-emr-api/src/visit-type.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-emr-api/src/visit-type.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-type.ts#L5)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **updateVisit**(`uuid`, `payload`, `abortController`): `Promise`\<[`FetchResponse`](../interfaces/FetchResponse.md)\<[`Visit`](../interfaces/Visit.md)\>\>
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:
|
|
7
|
+
Defined in: [packages/framework/esm-emr-api/src/visit-utils.ts:154](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-emr-api/src/visit-utils.ts#L154)
|
|
8
8
|
|
|
9
9
|
Updates an existing visit by sending a POST request to the OpenMRS REST API.
|
|
10
10
|
|
|
@@ -1,27 +1,17 @@
|
|
|
1
1
|
[O3 Framework](../API.md) / useConnectivity
|
|
2
2
|
|
|
3
|
-
# Function: useConnectivity()
|
|
3
|
+
# Function: ~~useConnectivity()~~
|
|
4
4
|
|
|
5
5
|
> **useConnectivity**(): `boolean`
|
|
6
6
|
|
|
7
|
-
Defined in: [packages/framework/esm-
|
|
8
|
-
|
|
9
|
-
A React hook that returns the current online/offline status and automatically
|
|
10
|
-
updates when connectivity changes. Useful for showing offline indicators or
|
|
11
|
-
conditionally rendering UI based on network availability.
|
|
7
|
+
Defined in: [packages/framework/esm-framework/src/deprecated.ts:85](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-framework/src/deprecated.ts#L85)
|
|
12
8
|
|
|
13
9
|
## Returns
|
|
14
10
|
|
|
15
11
|
`boolean`
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
## Example
|
|
13
|
+
## Deprecated
|
|
20
14
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const isOnline = useConnectivity();
|
|
25
|
-
return <span>{isOnline ? 'Online' : 'Offline'}</span>;
|
|
26
|
-
}
|
|
27
|
-
```
|
|
15
|
+
Offline support has been removed from the framework. This is a
|
|
16
|
+
no-op kept only so that frontend modules that still call
|
|
17
|
+
`useConnectivity` don't throw.
|