@openmrs/esm-framework 3.4.1-pre.110 → 3.4.1-pre.120
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 +43 -11
- package/dist/openmrs-esm-framework.js +1 -1
- package/dist/openmrs-esm-framework.js.map +1 -1
- package/docs/API.md +321 -66
- package/docs/interfaces/ConfigurableLinkProps.md +12 -1
- package/docs/interfaces/ErrorStateProps.md +30 -0
- package/docs/interfaces/FHIRCode.md +13 -2
- package/docs/interfaces/FHIRResource.md +3 -0
- package/docs/interfaces/NavigateOptions.md +12 -1
- package/docs/interfaces/OfflinePatientArgs.md +4 -6
- package/docs/interfaces/OfflinePatientDataSyncHandler.md +7 -14
- package/docs/interfaces/OfflinePatientDataSyncState.md +8 -24
- package/docs/interfaces/OfflinePatientDataSyncStore.md +3 -8
- package/docs/interfaces/QueueItemDescriptor.md +4 -4
- package/docs/interfaces/SyncItem.md +7 -7
- package/docs/interfaces/SyncProcessOptions.md +5 -5
- package/package.json +13 -13
package/docs/API.md
CHANGED
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
|
|
103
103
|
### Navigation Functions
|
|
104
104
|
|
|
105
|
+
- [ConfigurableLink](API.md#configurablelink)
|
|
105
106
|
- [interpolateString](API.md#interpolatestring)
|
|
106
107
|
- [interpolateUrl](API.md#interpolateurl)
|
|
107
108
|
- [navigate](API.md#navigate)
|
|
@@ -113,20 +114,29 @@
|
|
|
113
114
|
- [deleteSynchronizationItem](API.md#deletesynchronizationitem)
|
|
114
115
|
- [generateOfflineUuid](API.md#generateofflineuuid)
|
|
115
116
|
- [getCurrentOfflineMode](API.md#getcurrentofflinemode)
|
|
117
|
+
- [getDynamicOfflineDataEntries](API.md#getdynamicofflinedataentries)
|
|
118
|
+
- [getDynamicOfflineDataEntriesFor](API.md#getdynamicofflinedataentriesfor)
|
|
119
|
+
- [getDynamicOfflineDataHandlers](API.md#getdynamicofflinedatahandlers)
|
|
116
120
|
- [getFullSynchronizationItems](API.md#getfullsynchronizationitems)
|
|
117
121
|
- [getFullSynchronizationItemsFor](API.md#getfullsynchronizationitemsfor)
|
|
118
122
|
- [getOfflinePatientDataStore](API.md#getofflinepatientdatastore)
|
|
119
123
|
- [getSynchronizationItem](API.md#getsynchronizationitem)
|
|
120
124
|
- [getSynchronizationItems](API.md#getsynchronizationitems)
|
|
121
125
|
- [isOfflineUuid](API.md#isofflineuuid)
|
|
122
|
-
- [loadPersistedPatientDataSyncState](API.md#loadpersistedpatientdatasyncstate)
|
|
123
126
|
- [messageOmrsServiceWorker](API.md#messageomrsserviceworker)
|
|
127
|
+
- [putDynamicOfflineData](API.md#putdynamicofflinedata)
|
|
128
|
+
- [putDynamicOfflineDataFor](API.md#putdynamicofflinedatafor)
|
|
124
129
|
- [queueSynchronizationItem](API.md#queuesynchronizationitem)
|
|
125
130
|
- [registerOfflinePatientHandler](API.md#registerofflinepatienthandler)
|
|
131
|
+
- [removeDynamicOfflineData](API.md#removedynamicofflinedata)
|
|
132
|
+
- [removeDynamicOfflineDataFor](API.md#removedynamicofflinedatafor)
|
|
133
|
+
- [setupDynamicOfflineDataHandler](API.md#setupdynamicofflinedatahandler)
|
|
126
134
|
- [setupOfflineSync](API.md#setupofflinesync)
|
|
127
135
|
- [subscribeConnectivity](API.md#subscribeconnectivity)
|
|
128
136
|
- [subscribeConnectivityChanged](API.md#subscribeconnectivitychanged)
|
|
129
137
|
- [subscribePrecacheStaticDependencies](API.md#subscribeprecachestaticdependencies)
|
|
138
|
+
- [syncAllDynamicOfflineData](API.md#syncalldynamicofflinedata)
|
|
139
|
+
- [syncDynamicOfflineData](API.md#syncdynamicofflinedata)
|
|
130
140
|
- [syncOfflinePatientData](API.md#syncofflinepatientdata)
|
|
131
141
|
- [useConnectivity](API.md#useconnectivity)
|
|
132
142
|
|
|
@@ -280,6 +290,22 @@ ___
|
|
|
280
290
|
|
|
281
291
|
___
|
|
282
292
|
|
|
293
|
+
## Navigation Type aliases
|
|
294
|
+
|
|
295
|
+
### TemplateParams
|
|
296
|
+
|
|
297
|
+
Ƭ **TemplateParams**: `Object`
|
|
298
|
+
|
|
299
|
+
#### Index signature
|
|
300
|
+
|
|
301
|
+
▪ [key: `string`]: `string`
|
|
302
|
+
|
|
303
|
+
#### Defined in
|
|
304
|
+
|
|
305
|
+
[packages/framework/esm-config/src/navigation/navigate.ts:10](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/navigation/navigate.ts#L10)
|
|
306
|
+
|
|
307
|
+
___
|
|
308
|
+
|
|
283
309
|
## Offline Type aliases
|
|
284
310
|
|
|
285
311
|
### KnownOmrsServiceWorkerMessages
|
|
@@ -599,26 +625,6 @@ ___
|
|
|
599
625
|
|
|
600
626
|
___
|
|
601
627
|
|
|
602
|
-
## Navigation Variables
|
|
603
|
-
|
|
604
|
-
### ConfigurableLink
|
|
605
|
-
|
|
606
|
-
• **ConfigurableLink**: `React.FC`<[`ConfigurableLinkProps`](interfaces/ConfigurableLinkProps.md)\>
|
|
607
|
-
|
|
608
|
-
A React link component which calls [navigate](API.md#navigate) when clicked
|
|
609
|
-
|
|
610
|
-
**`param`** The target path or URL. Supports interpolation. See [navigate](API.md#navigate)
|
|
611
|
-
|
|
612
|
-
**`param`** Inline elements within the link
|
|
613
|
-
|
|
614
|
-
**`param`** Any other valid props for an <a> tag except `href` and `onClick`
|
|
615
|
-
|
|
616
|
-
#### Defined in
|
|
617
|
-
|
|
618
|
-
[packages/framework/esm-react-utils/src/ConfigurableLink.tsx:32](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/ConfigurableLink.tsx#L32)
|
|
619
|
-
|
|
620
|
-
___
|
|
621
|
-
|
|
622
628
|
## Offline Variables
|
|
623
629
|
|
|
624
630
|
### offlineUuidPrefix
|
|
@@ -663,6 +669,16 @@ ___
|
|
|
663
669
|
|
|
664
670
|
## Other Variables
|
|
665
671
|
|
|
672
|
+
### ErrorState
|
|
673
|
+
|
|
674
|
+
• **ErrorState**: `React.FC`<[`ErrorStateProps`](interfaces/ErrorStateProps.md)\>
|
|
675
|
+
|
|
676
|
+
#### Defined in
|
|
677
|
+
|
|
678
|
+
[packages/framework/esm-styleguide/src/error-state/error-state.component.tsx:12](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/error-state/error-state.component.tsx#L12)
|
|
679
|
+
|
|
680
|
+
___
|
|
681
|
+
|
|
666
682
|
### Extension
|
|
667
683
|
|
|
668
684
|
• **Extension**: `React.FC`<[`ExtensionProps`](interfaces/ExtensionProps.md)\>
|
|
@@ -716,7 +732,7 @@ ___
|
|
|
716
732
|
|
|
717
733
|
#### Defined in
|
|
718
734
|
|
|
719
|
-
[packages/framework/esm-styleguide/src/left-nav/index.tsx:
|
|
735
|
+
[packages/framework/esm-styleguide/src/left-nav/index.tsx:32](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/left-nav/index.tsx#L32)
|
|
720
736
|
|
|
721
737
|
## API Functions
|
|
722
738
|
|
|
@@ -1750,6 +1766,8 @@ When time is included, it is appended with a comma and a space. This
|
|
|
1750
1766
|
agrees with the output of `Date.prototype.toLocaleString` for *most*
|
|
1751
1767
|
locales.
|
|
1752
1768
|
|
|
1769
|
+
TODO: Shouldn't throw on null input
|
|
1770
|
+
|
|
1753
1771
|
#### Parameters
|
|
1754
1772
|
|
|
1755
1773
|
| Name | Type |
|
|
@@ -1763,7 +1781,7 @@ locales.
|
|
|
1763
1781
|
|
|
1764
1782
|
#### Defined in
|
|
1765
1783
|
|
|
1766
|
-
[packages/framework/esm-utils/src/omrs-dates.ts:
|
|
1784
|
+
[packages/framework/esm-utils/src/omrs-dates.ts:184](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L184)
|
|
1767
1785
|
|
|
1768
1786
|
___
|
|
1769
1787
|
|
|
@@ -1792,7 +1810,7 @@ output of `Date.prototype.toLocaleString` for *most* locales.
|
|
|
1792
1810
|
|
|
1793
1811
|
#### Defined in
|
|
1794
1812
|
|
|
1795
|
-
[packages/framework/esm-utils/src/omrs-dates.ts:
|
|
1813
|
+
[packages/framework/esm-utils/src/omrs-dates.ts:251](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L251)
|
|
1796
1814
|
|
|
1797
1815
|
___
|
|
1798
1816
|
|
|
@@ -1815,7 +1833,7 @@ Formats the input as a time, according to the current locale.
|
|
|
1815
1833
|
|
|
1816
1834
|
#### Defined in
|
|
1817
1835
|
|
|
1818
|
-
[packages/framework/esm-utils/src/omrs-dates.ts:
|
|
1836
|
+
[packages/framework/esm-utils/src/omrs-dates.ts:235](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L235)
|
|
1819
1837
|
|
|
1820
1838
|
___
|
|
1821
1839
|
|
|
@@ -2577,6 +2595,28 @@ ___
|
|
|
2577
2595
|
|
|
2578
2596
|
## Navigation Functions
|
|
2579
2597
|
|
|
2598
|
+
### ConfigurableLink
|
|
2599
|
+
|
|
2600
|
+
▸ **ConfigurableLink**(`__namedParameters`): `Element`
|
|
2601
|
+
|
|
2602
|
+
A React link component which calls [navigate](API.md#navigate) when clicked
|
|
2603
|
+
|
|
2604
|
+
#### Parameters
|
|
2605
|
+
|
|
2606
|
+
| Name | Type |
|
|
2607
|
+
| :------ | :------ |
|
|
2608
|
+
| `__namedParameters` | [`ConfigurableLinkProps`](interfaces/ConfigurableLinkProps.md) |
|
|
2609
|
+
|
|
2610
|
+
#### Returns
|
|
2611
|
+
|
|
2612
|
+
`Element`
|
|
2613
|
+
|
|
2614
|
+
#### Defined in
|
|
2615
|
+
|
|
2616
|
+
[packages/framework/esm-react-utils/src/ConfigurableLink.tsx:38](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/ConfigurableLink.tsx#L38)
|
|
2617
|
+
|
|
2618
|
+
___
|
|
2619
|
+
|
|
2580
2620
|
### interpolateString
|
|
2581
2621
|
|
|
2582
2622
|
▸ **interpolateString**(`template`, `params`): `string`
|
|
@@ -2600,7 +2640,7 @@ navigate({
|
|
|
2600
2640
|
| Name | Type | Description |
|
|
2601
2641
|
| :------ | :------ | :------ |
|
|
2602
2642
|
| `template` | `string` | With optional params wrapped in `${ }` |
|
|
2603
|
-
| `params` | `
|
|
2643
|
+
| `params` | `Object` | Values to interpolate into the string template |
|
|
2604
2644
|
|
|
2605
2645
|
#### Returns
|
|
2606
2646
|
|
|
@@ -2608,13 +2648,13 @@ navigate({
|
|
|
2608
2648
|
|
|
2609
2649
|
#### Defined in
|
|
2610
2650
|
|
|
2611
|
-
[packages/framework/esm-config/src/navigation/interpolate-string.ts:
|
|
2651
|
+
[packages/framework/esm-config/src/navigation/interpolate-string.ts:46](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/navigation/interpolate-string.ts#L46)
|
|
2612
2652
|
|
|
2613
2653
|
___
|
|
2614
2654
|
|
|
2615
2655
|
### interpolateUrl
|
|
2616
2656
|
|
|
2617
|
-
▸ **interpolateUrl**(`template`): `string`
|
|
2657
|
+
▸ **interpolateUrl**(`template`, `additionalParams?`): `string`
|
|
2618
2658
|
|
|
2619
2659
|
Interpolates a string with openmrsBase and openmrsSpaBase.
|
|
2620
2660
|
|
|
@@ -2626,6 +2666,7 @@ parameters in configurable URLs.
|
|
|
2626
2666
|
| Name | Type | Description |
|
|
2627
2667
|
| :------ | :------ | :------ |
|
|
2628
2668
|
| `template` | `string` | A string to interpolate |
|
|
2669
|
+
| `additionalParams?` | `Object` | Additional values to interpolate into the string template |
|
|
2629
2670
|
|
|
2630
2671
|
#### Returns
|
|
2631
2672
|
|
|
@@ -2633,7 +2674,7 @@ parameters in configurable URLs.
|
|
|
2633
2674
|
|
|
2634
2675
|
#### Defined in
|
|
2635
2676
|
|
|
2636
|
-
[packages/framework/esm-config/src/navigation/interpolate-string.ts:
|
|
2677
|
+
[packages/framework/esm-config/src/navigation/interpolate-string.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/navigation/interpolate-string.ts#L16)
|
|
2637
2678
|
|
|
2638
2679
|
___
|
|
2639
2680
|
|
|
@@ -2645,7 +2686,7 @@ Calls `location.assign` for non-SPA paths and [navigateToUrl](https://single-spa
|
|
|
2645
2686
|
|
|
2646
2687
|
Example usage:
|
|
2647
2688
|
```js
|
|
2648
|
-
const config =
|
|
2689
|
+
const config = useConfig();
|
|
2649
2690
|
const submitHandler = () => {
|
|
2650
2691
|
navigate({ to: config.links.submitSuccess });
|
|
2651
2692
|
};
|
|
@@ -2655,7 +2696,7 @@ const submitHandler = () => {
|
|
|
2655
2696
|
|
|
2656
2697
|
| Name | Type | Description |
|
|
2657
2698
|
| :------ | :------ | :------ |
|
|
2658
|
-
| `to` | [`NavigateOptions`](interfaces/NavigateOptions.md) | The target path or URL. Supports templating with 'openmrsBase'
|
|
2699
|
+
| `to` | [`NavigateOptions`](interfaces/NavigateOptions.md) | The target path or URL. Supports templating with 'openmrsBase', 'openmrsSpaBase', and any additional template parameters defined in `templateParams`. For example, `${openmrsSpaBase}/home` will resolve to `/openmrs/spa/home` for implementations using the standard OpenMRS and SPA base paths. If `templateParams` contains `{ foo: "bar" }`, then the URL `${openmrsBase}/${foo}` will become `/openmrs/bar`. |
|
|
2659
2700
|
|
|
2660
2701
|
#### Returns
|
|
2661
2702
|
|
|
@@ -2663,7 +2704,7 @@ const submitHandler = () => {
|
|
|
2663
2704
|
|
|
2664
2705
|
#### Defined in
|
|
2665
2706
|
|
|
2666
|
-
[packages/framework/esm-config/src/navigation/navigate.ts:
|
|
2707
|
+
[packages/framework/esm-config/src/navigation/navigate.ts:35](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/navigation/navigate.ts#L35)
|
|
2667
2708
|
|
|
2668
2709
|
___
|
|
2669
2710
|
|
|
@@ -2688,7 +2729,7 @@ If this is not possible, throws an error.
|
|
|
2688
2729
|
|
|
2689
2730
|
#### Defined in
|
|
2690
2731
|
|
|
2691
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
2732
|
+
[packages/framework/esm-offline/src/sync.ts:357](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L357)
|
|
2692
2733
|
|
|
2693
2734
|
___
|
|
2694
2735
|
|
|
@@ -2711,7 +2752,7 @@ registered synchronization handlers.
|
|
|
2711
2752
|
|
|
2712
2753
|
#### Defined in
|
|
2713
2754
|
|
|
2714
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
2755
|
+
[packages/framework/esm-offline/src/sync.ts:347](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L347)
|
|
2715
2756
|
|
|
2716
2757
|
___
|
|
2717
2758
|
|
|
@@ -2733,7 +2774,7 @@ Deletes a queued up sync item with the given ID.
|
|
|
2733
2774
|
|
|
2734
2775
|
#### Defined in
|
|
2735
2776
|
|
|
2736
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
2777
|
+
[packages/framework/esm-offline/src/sync.ts:377](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L377)
|
|
2737
2778
|
|
|
2738
2779
|
___
|
|
2739
2780
|
|
|
@@ -2767,6 +2808,69 @@ ___
|
|
|
2767
2808
|
|
|
2768
2809
|
___
|
|
2769
2810
|
|
|
2811
|
+
### getDynamicOfflineDataEntries
|
|
2812
|
+
|
|
2813
|
+
▸ **getDynamicOfflineDataEntries**(`type?`): `Promise`<[`DynamicOfflineData`](interfaces/DynamicOfflineData.md)[]\>
|
|
2814
|
+
|
|
2815
|
+
Returns all [DynamicOfflineData](interfaces/DynamicOfflineData.md) entries which registered for the currently logged in user.
|
|
2816
|
+
Optionally returns only entries of a given type.
|
|
2817
|
+
|
|
2818
|
+
#### Parameters
|
|
2819
|
+
|
|
2820
|
+
| Name | Type | Description |
|
|
2821
|
+
| :------ | :------ | :------ |
|
|
2822
|
+
| `type?` | `string` | The type of the entries to be returned. If `undefined`, returns all types. |
|
|
2823
|
+
|
|
2824
|
+
#### Returns
|
|
2825
|
+
|
|
2826
|
+
`Promise`<[`DynamicOfflineData`](interfaces/DynamicOfflineData.md)[]\>
|
|
2827
|
+
|
|
2828
|
+
#### Defined in
|
|
2829
|
+
|
|
2830
|
+
[packages/framework/esm-offline/src/dynamic-offline-data.ts:131](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/dynamic-offline-data.ts#L131)
|
|
2831
|
+
|
|
2832
|
+
___
|
|
2833
|
+
|
|
2834
|
+
### getDynamicOfflineDataEntriesFor
|
|
2835
|
+
|
|
2836
|
+
▸ **getDynamicOfflineDataEntriesFor**(`userId`, `type?`): `Promise`<[`DynamicOfflineData`](interfaces/DynamicOfflineData.md)[]\>
|
|
2837
|
+
|
|
2838
|
+
Returns all [DynamicOfflineData](interfaces/DynamicOfflineData.md) entries which registered for the given user.
|
|
2839
|
+
Optionally returns only entries of a given type.
|
|
2840
|
+
|
|
2841
|
+
#### Parameters
|
|
2842
|
+
|
|
2843
|
+
| Name | Type | Description |
|
|
2844
|
+
| :------ | :------ | :------ |
|
|
2845
|
+
| `userId` | `string` | The ID of the user whose entries are to be retrieved. |
|
|
2846
|
+
| `type?` | `string` | The type of the entries to be returned. If `undefined`, returns all types. |
|
|
2847
|
+
|
|
2848
|
+
#### Returns
|
|
2849
|
+
|
|
2850
|
+
`Promise`<[`DynamicOfflineData`](interfaces/DynamicOfflineData.md)[]\>
|
|
2851
|
+
|
|
2852
|
+
#### Defined in
|
|
2853
|
+
|
|
2854
|
+
[packages/framework/esm-offline/src/dynamic-offline-data.ts:144](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/dynamic-offline-data.ts#L144)
|
|
2855
|
+
|
|
2856
|
+
___
|
|
2857
|
+
|
|
2858
|
+
### getDynamicOfflineDataHandlers
|
|
2859
|
+
|
|
2860
|
+
▸ **getDynamicOfflineDataHandlers**(): [`DynamicOfflineDataHandler`](interfaces/DynamicOfflineDataHandler.md)[]
|
|
2861
|
+
|
|
2862
|
+
Returns all handlers which have been setup using the [setupDynamicOfflineDataHandler](API.md#setupdynamicofflinedatahandler) function.
|
|
2863
|
+
|
|
2864
|
+
#### Returns
|
|
2865
|
+
|
|
2866
|
+
[`DynamicOfflineDataHandler`](interfaces/DynamicOfflineDataHandler.md)[]
|
|
2867
|
+
|
|
2868
|
+
#### Defined in
|
|
2869
|
+
|
|
2870
|
+
[packages/framework/esm-offline/src/dynamic-offline-data.ts:105](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/dynamic-offline-data.ts#L105)
|
|
2871
|
+
|
|
2872
|
+
___
|
|
2873
|
+
|
|
2770
2874
|
### getFullSynchronizationItems
|
|
2771
2875
|
|
|
2772
2876
|
▸ **getFullSynchronizationItems**<`T`\>(`type?`): `Promise`<[`SyncItem`](interfaces/SyncItem.md)<`T`\>[]\>
|
|
@@ -2791,7 +2895,7 @@ Returns all currently queued up sync items of the currently signed in user.
|
|
|
2791
2895
|
|
|
2792
2896
|
#### Defined in
|
|
2793
2897
|
|
|
2794
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
2898
|
+
[packages/framework/esm-offline/src/sync.ts:325](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L325)
|
|
2795
2899
|
|
|
2796
2900
|
___
|
|
2797
2901
|
|
|
@@ -2820,7 +2924,7 @@ Returns all currently queued up sync items of a given user.
|
|
|
2820
2924
|
|
|
2821
2925
|
#### Defined in
|
|
2822
2926
|
|
|
2823
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
2927
|
+
[packages/framework/esm-offline/src/sync.ts:301](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L301)
|
|
2824
2928
|
|
|
2825
2929
|
___
|
|
2826
2930
|
|
|
@@ -2828,13 +2932,15 @@ ___
|
|
|
2828
2932
|
|
|
2829
2933
|
▸ **getOfflinePatientDataStore**(): `Store`<[`OfflinePatientDataSyncStore`](interfaces/OfflinePatientDataSyncStore.md)\>
|
|
2830
2934
|
|
|
2935
|
+
**`deprecated`** Will be removed once all modules have been migrated to the new dynamic offline data API.
|
|
2936
|
+
|
|
2831
2937
|
#### Returns
|
|
2832
2938
|
|
|
2833
2939
|
`Store`<[`OfflinePatientDataSyncStore`](interfaces/OfflinePatientDataSyncStore.md)\>
|
|
2834
2940
|
|
|
2835
2941
|
#### Defined in
|
|
2836
2942
|
|
|
2837
|
-
[packages/framework/esm-offline/src/offline-patient-data.ts:
|
|
2943
|
+
[packages/framework/esm-offline/src/offline-patient-data.ts:45](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L45)
|
|
2838
2944
|
|
|
2839
2945
|
___
|
|
2840
2946
|
|
|
@@ -2862,7 +2968,7 @@ Returns a queued sync item with the given ID or `undefined` if no such item exis
|
|
|
2862
2968
|
|
|
2863
2969
|
#### Defined in
|
|
2864
2970
|
|
|
2865
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
2971
|
+
[packages/framework/esm-offline/src/sync.ts:334](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L334)
|
|
2866
2972
|
|
|
2867
2973
|
___
|
|
2868
2974
|
|
|
@@ -2890,7 +2996,7 @@ Returns the content of all currently queued up sync items of the currently signe
|
|
|
2890
2996
|
|
|
2891
2997
|
#### Defined in
|
|
2892
2998
|
|
|
2893
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
2999
|
+
[packages/framework/esm-offline/src/sync.ts:316](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L316)
|
|
2894
3000
|
|
|
2895
3001
|
___
|
|
2896
3002
|
|
|
@@ -2916,41 +3022,76 @@ Checks whether the given string has the format of an offline UUID generated by [
|
|
|
2916
3022
|
|
|
2917
3023
|
___
|
|
2918
3024
|
|
|
2919
|
-
###
|
|
3025
|
+
### messageOmrsServiceWorker
|
|
3026
|
+
|
|
3027
|
+
▸ **messageOmrsServiceWorker**(`message`): `Promise`<[`MessageServiceWorkerResult`](interfaces/MessageServiceWorkerResult.md)<`any`\>\>
|
|
3028
|
+
|
|
3029
|
+
Sends the specified message to the application's service worker.
|
|
2920
3030
|
|
|
2921
|
-
|
|
3031
|
+
#### Parameters
|
|
3032
|
+
|
|
3033
|
+
| Name | Type | Description |
|
|
3034
|
+
| :------ | :------ | :------ |
|
|
3035
|
+
| `message` | [`KnownOmrsServiceWorkerMessages`](API.md#knownomrsserviceworkermessages) | The message to be sent. |
|
|
2922
3036
|
|
|
2923
3037
|
#### Returns
|
|
2924
3038
|
|
|
2925
|
-
`Promise
|
|
3039
|
+
`Promise`<[`MessageServiceWorkerResult`](interfaces/MessageServiceWorkerResult.md)<`any`\>\>
|
|
3040
|
+
|
|
3041
|
+
A promise which completes when the message has been successfully processed by the Service Worker.
|
|
2926
3042
|
|
|
2927
3043
|
#### Defined in
|
|
2928
3044
|
|
|
2929
|
-
[packages/framework/esm-offline/src/
|
|
3045
|
+
[packages/framework/esm-offline/src/service-worker-messaging.ts:11](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L11)
|
|
2930
3046
|
|
|
2931
3047
|
___
|
|
2932
3048
|
|
|
2933
|
-
###
|
|
3049
|
+
### putDynamicOfflineData
|
|
2934
3050
|
|
|
2935
|
-
▸ **
|
|
3051
|
+
▸ **putDynamicOfflineData**(`type`, `identifier`): `Promise`<`void`\>
|
|
2936
3052
|
|
|
2937
|
-
|
|
3053
|
+
Declares that dynamic offline data of the given [type](interfaces/FetchResponse.md#type) with the given [identifier](interfaces/FHIRResource.md#identifier)
|
|
3054
|
+
should be made available offline for the currently logged in user.
|
|
2938
3055
|
|
|
2939
3056
|
#### Parameters
|
|
2940
3057
|
|
|
2941
3058
|
| Name | Type | Description |
|
|
2942
3059
|
| :------ | :------ | :------ |
|
|
2943
|
-
| `
|
|
3060
|
+
| `type` | `string` | The type of the offline data. See [DynamicOfflineData](interfaces/DynamicOfflineData.md) for details. |
|
|
3061
|
+
| `identifier` | `string` | The identifier of the offline data. See [DynamicOfflineData](interfaces/DynamicOfflineData.md) for details. |
|
|
2944
3062
|
|
|
2945
3063
|
#### Returns
|
|
2946
3064
|
|
|
2947
|
-
`Promise
|
|
3065
|
+
`Promise`<`void`\>
|
|
2948
3066
|
|
|
2949
|
-
|
|
3067
|
+
#### Defined in
|
|
3068
|
+
|
|
3069
|
+
[packages/framework/esm-offline/src/dynamic-offline-data.ts:162](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/dynamic-offline-data.ts#L162)
|
|
3070
|
+
|
|
3071
|
+
___
|
|
3072
|
+
|
|
3073
|
+
### putDynamicOfflineDataFor
|
|
3074
|
+
|
|
3075
|
+
▸ **putDynamicOfflineDataFor**(`userId`, `type`, `identifier`): `Promise`<`void`\>
|
|
3076
|
+
|
|
3077
|
+
Declares that dynamic offline data of the given [type](interfaces/FetchResponse.md#type) with the given [identifier](interfaces/FHIRResource.md#identifier)
|
|
3078
|
+
should be made available offline for the user with the given ID.
|
|
3079
|
+
|
|
3080
|
+
#### Parameters
|
|
3081
|
+
|
|
3082
|
+
| Name | Type | Description |
|
|
3083
|
+
| :------ | :------ | :------ |
|
|
3084
|
+
| `userId` | `string` | The ID of the user for whom the dynamic offline data should be made available. |
|
|
3085
|
+
| `type` | `string` | The type of the offline data. See [DynamicOfflineData](interfaces/DynamicOfflineData.md) for details. |
|
|
3086
|
+
| `identifier` | `string` | The identifier of the offline data. See [DynamicOfflineData](interfaces/DynamicOfflineData.md) for details. |
|
|
3087
|
+
|
|
3088
|
+
#### Returns
|
|
3089
|
+
|
|
3090
|
+
`Promise`<`void`\>
|
|
2950
3091
|
|
|
2951
3092
|
#### Defined in
|
|
2952
3093
|
|
|
2953
|
-
[packages/framework/esm-offline/src/
|
|
3094
|
+
[packages/framework/esm-offline/src/dynamic-offline-data.ts:177](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/dynamic-offline-data.ts#L177)
|
|
2954
3095
|
|
|
2955
3096
|
___
|
|
2956
3097
|
|
|
@@ -2980,7 +3121,7 @@ Enqueues a new item in the sync queue and associates the item with the currently
|
|
|
2980
3121
|
|
|
2981
3122
|
#### Defined in
|
|
2982
3123
|
|
|
2983
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
3124
|
+
[packages/framework/esm-offline/src/sync.ts:274](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L274)
|
|
2984
3125
|
|
|
2985
3126
|
___
|
|
2986
3127
|
|
|
@@ -2988,25 +3129,94 @@ ___
|
|
|
2988
3129
|
|
|
2989
3130
|
▸ **registerOfflinePatientHandler**(`identifier`, `handler`): `void`
|
|
2990
3131
|
|
|
2991
|
-
|
|
3132
|
+
**`deprecated`** Will be removed once all modules have been migrated to the new dynamic offline data API.
|
|
3133
|
+
|
|
3134
|
+
#### Parameters
|
|
3135
|
+
|
|
3136
|
+
| Name | Type |
|
|
3137
|
+
| :------ | :------ |
|
|
3138
|
+
| `identifier` | `string` |
|
|
3139
|
+
| `handler` | [`OfflinePatientDataSyncHandler`](interfaces/OfflinePatientDataSyncHandler.md) |
|
|
3140
|
+
|
|
3141
|
+
#### Returns
|
|
3142
|
+
|
|
3143
|
+
`void`
|
|
3144
|
+
|
|
3145
|
+
#### Defined in
|
|
3146
|
+
|
|
3147
|
+
[packages/framework/esm-offline/src/offline-patient-data.ts:51](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L51)
|
|
3148
|
+
|
|
3149
|
+
___
|
|
3150
|
+
|
|
3151
|
+
### removeDynamicOfflineData
|
|
3152
|
+
|
|
3153
|
+
▸ **removeDynamicOfflineData**(`type`, `identifier`): `Promise`<`void`\>
|
|
3154
|
+
|
|
3155
|
+
Declares that dynamic offline data of the given [type](interfaces/FetchResponse.md#type) with the given [identifier](interfaces/FHIRResource.md#identifier)
|
|
3156
|
+
no longer needs to be available offline for the currently logged in user.
|
|
2992
3157
|
|
|
2993
3158
|
#### Parameters
|
|
2994
3159
|
|
|
2995
3160
|
| Name | Type | Description |
|
|
2996
3161
|
| :------ | :------ | :------ |
|
|
2997
|
-
| `
|
|
2998
|
-
| `
|
|
3162
|
+
| `type` | `string` | The type of the offline data. See [DynamicOfflineData](interfaces/DynamicOfflineData.md) for details. |
|
|
3163
|
+
| `identifier` | `string` | The identifier of the offline data. See [DynamicOfflineData](interfaces/DynamicOfflineData.md) for details. |
|
|
2999
3164
|
|
|
3000
3165
|
#### Returns
|
|
3001
3166
|
|
|
3002
|
-
`void
|
|
3167
|
+
`Promise`<`void`\>
|
|
3168
|
+
|
|
3169
|
+
#### Defined in
|
|
3170
|
+
|
|
3171
|
+
[packages/framework/esm-offline/src/dynamic-offline-data.ts:213](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/dynamic-offline-data.ts#L213)
|
|
3172
|
+
|
|
3173
|
+
___
|
|
3174
|
+
|
|
3175
|
+
### removeDynamicOfflineDataFor
|
|
3003
3176
|
|
|
3004
|
-
`
|
|
3005
|
-
|
|
3177
|
+
▸ **removeDynamicOfflineDataFor**(`userId`, `type`, `identifier`): `Promise`<`void`\>
|
|
3178
|
+
|
|
3179
|
+
Declares that dynamic offline data of the given [type](interfaces/FetchResponse.md#type) with the given [identifier](interfaces/FHIRResource.md#identifier)
|
|
3180
|
+
no longer needs to be available offline for the user with the given ID.
|
|
3181
|
+
|
|
3182
|
+
#### Parameters
|
|
3183
|
+
|
|
3184
|
+
| Name | Type | Description |
|
|
3185
|
+
| :------ | :------ | :------ |
|
|
3186
|
+
| `userId` | `string` | The ID of the user who doesn't require the specified offline data. |
|
|
3187
|
+
| `type` | `string` | The type of the offline data. See [DynamicOfflineData](interfaces/DynamicOfflineData.md) for details. |
|
|
3188
|
+
| `identifier` | `string` | The identifier of the offline data. See [DynamicOfflineData](interfaces/DynamicOfflineData.md) for details. |
|
|
3189
|
+
|
|
3190
|
+
#### Returns
|
|
3191
|
+
|
|
3192
|
+
`Promise`<`void`\>
|
|
3193
|
+
|
|
3194
|
+
#### Defined in
|
|
3195
|
+
|
|
3196
|
+
[packages/framework/esm-offline/src/dynamic-offline-data.ts:228](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/dynamic-offline-data.ts#L228)
|
|
3197
|
+
|
|
3198
|
+
___
|
|
3199
|
+
|
|
3200
|
+
### setupDynamicOfflineDataHandler
|
|
3201
|
+
|
|
3202
|
+
▸ **setupDynamicOfflineDataHandler**(`handler`): `void`
|
|
3203
|
+
|
|
3204
|
+
Sets up a handler for synchronizing dynamic offline data.
|
|
3205
|
+
See [DynamicOfflineDataHandler](interfaces/DynamicOfflineDataHandler.md) for details.
|
|
3206
|
+
|
|
3207
|
+
#### Parameters
|
|
3208
|
+
|
|
3209
|
+
| Name | Type | Description |
|
|
3210
|
+
| :------ | :------ | :------ |
|
|
3211
|
+
| `handler` | [`DynamicOfflineDataHandler`](interfaces/DynamicOfflineDataHandler.md) | The handler to be setup. |
|
|
3212
|
+
|
|
3213
|
+
#### Returns
|
|
3214
|
+
|
|
3215
|
+
`void`
|
|
3006
3216
|
|
|
3007
3217
|
#### Defined in
|
|
3008
3218
|
|
|
3009
|
-
[packages/framework/esm-offline/src/offline-
|
|
3219
|
+
[packages/framework/esm-offline/src/dynamic-offline-data.ts:114](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/dynamic-offline-data.ts#L114)
|
|
3010
3220
|
|
|
3011
3221
|
___
|
|
3012
3222
|
|
|
@@ -3037,7 +3247,7 @@ Registers a new synchronization handler which is able to synchronize data of a s
|
|
|
3037
3247
|
|
|
3038
3248
|
#### Defined in
|
|
3039
3249
|
|
|
3040
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
3250
|
+
[packages/framework/esm-offline/src/sync.ts:392](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L392)
|
|
3041
3251
|
|
|
3042
3252
|
___
|
|
3043
3253
|
|
|
@@ -3119,11 +3329,58 @@ ___
|
|
|
3119
3329
|
|
|
3120
3330
|
___
|
|
3121
3331
|
|
|
3332
|
+
### syncAllDynamicOfflineData
|
|
3333
|
+
|
|
3334
|
+
▸ **syncAllDynamicOfflineData**(`type`, `abortSignal?`): `Promise`<`void`\>
|
|
3335
|
+
|
|
3336
|
+
Synchronizes all offline data entries of the given [type](interfaces/FetchResponse.md#type) for the currently logged in user.
|
|
3337
|
+
|
|
3338
|
+
#### Parameters
|
|
3339
|
+
|
|
3340
|
+
| Name | Type | Description |
|
|
3341
|
+
| :------ | :------ | :------ |
|
|
3342
|
+
| `type` | `string` | The type of the offline data. See [DynamicOfflineData](interfaces/DynamicOfflineData.md) for details. |
|
|
3343
|
+
| `abortSignal?` | `AbortSignal` | An {@link AbortSignal} which can be used to cancel the operation. |
|
|
3344
|
+
|
|
3345
|
+
#### Returns
|
|
3346
|
+
|
|
3347
|
+
`Promise`<`void`\>
|
|
3348
|
+
|
|
3349
|
+
#### Defined in
|
|
3350
|
+
|
|
3351
|
+
[packages/framework/esm-offline/src/dynamic-offline-data.ts:262](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/dynamic-offline-data.ts#L262)
|
|
3352
|
+
|
|
3353
|
+
___
|
|
3354
|
+
|
|
3355
|
+
### syncDynamicOfflineData
|
|
3356
|
+
|
|
3357
|
+
▸ **syncDynamicOfflineData**(`type`, `identifier`, `abortSignal?`): `Promise`<`void`\>
|
|
3358
|
+
|
|
3359
|
+
Synchronizes a single offline data entry of the given [type](interfaces/FetchResponse.md#type) for the currently logged in user.
|
|
3360
|
+
|
|
3361
|
+
#### Parameters
|
|
3362
|
+
|
|
3363
|
+
| Name | Type | Description |
|
|
3364
|
+
| :------ | :------ | :------ |
|
|
3365
|
+
| `type` | `string` | The type of the offline data. See [DynamicOfflineData](interfaces/DynamicOfflineData.md) for details. |
|
|
3366
|
+
| `identifier` | `string` | The identifier of the offline data. See [DynamicOfflineData](interfaces/DynamicOfflineData.md) for details. |
|
|
3367
|
+
| `abortSignal?` | `AbortSignal` | An {@link AbortSignal} which can be used to cancel the operation. |
|
|
3368
|
+
|
|
3369
|
+
#### Returns
|
|
3370
|
+
|
|
3371
|
+
`Promise`<`void`\>
|
|
3372
|
+
|
|
3373
|
+
#### Defined in
|
|
3374
|
+
|
|
3375
|
+
[packages/framework/esm-offline/src/dynamic-offline-data.ts:280](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/dynamic-offline-data.ts#L280)
|
|
3376
|
+
|
|
3377
|
+
___
|
|
3378
|
+
|
|
3122
3379
|
### syncOfflinePatientData
|
|
3123
3380
|
|
|
3124
3381
|
▸ **syncOfflinePatientData**(`patientUuid`): `Promise`<`void`\>
|
|
3125
3382
|
|
|
3126
|
-
|
|
3383
|
+
**`deprecated`** Will be removed once all modules have been migrated to the new dynamic offline data API.
|
|
3127
3384
|
|
|
3128
3385
|
#### Parameters
|
|
3129
3386
|
|
|
@@ -3135,11 +3392,9 @@ Notifies all registered offline patient handlers that a new patient must be made
|
|
|
3135
3392
|
|
|
3136
3393
|
`Promise`<`void`\>
|
|
3137
3394
|
|
|
3138
|
-
A promise which resolves once all registered handlers have finished synchronizing.
|
|
3139
|
-
|
|
3140
3395
|
#### Defined in
|
|
3141
3396
|
|
|
3142
|
-
[packages/framework/esm-offline/src/offline-patient-data.ts:
|
|
3397
|
+
[packages/framework/esm-offline/src/offline-patient-data.ts:71](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L71)
|
|
3143
3398
|
|
|
3144
3399
|
___
|
|
3145
3400
|
|
|
@@ -3471,7 +3726,7 @@ ___
|
|
|
3471
3726
|
|
|
3472
3727
|
#### Defined in
|
|
3473
3728
|
|
|
3474
|
-
[packages/framework/esm-styleguide/src/left-nav/index.tsx:
|
|
3729
|
+
[packages/framework/esm-styleguide/src/left-nav/index.tsx:20](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/left-nav/index.tsx#L20)
|
|
3475
3730
|
|
|
3476
3731
|
___
|
|
3477
3732
|
|
|
@@ -3619,7 +3874,7 @@ ___
|
|
|
3619
3874
|
|
|
3620
3875
|
#### Defined in
|
|
3621
3876
|
|
|
3622
|
-
[packages/framework/esm-styleguide/src/left-nav/index.tsx:
|
|
3877
|
+
[packages/framework/esm-styleguide/src/left-nav/index.tsx:24](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/left-nav/index.tsx#L24)
|
|
3623
3878
|
|
|
3624
3879
|
___
|
|
3625
3880
|
|