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