@openmrs/esm-framework 3.2.1-pre.924 → 3.2.1-pre.944
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/dist/openmrs-esm-framework.js +1 -1
- package/dist/openmrs-esm-framework.js.map +1 -1
- package/docs/API.md +196 -36
- package/docs/interfaces/FHIRResource.md +5 -5
- package/docs/interfaces/OfflineModeResult.md +41 -0
- package/docs/interfaces/OfflineSynchronizationStore.md +4 -1
- package/docs/interfaces/QueueItemDescriptor.md +9 -4
- package/docs/interfaces/SyncItem.md +19 -9
- package/docs/interfaces/SyncProcessOptions.md +7 -5
- package/package.json +13 -13
package/docs/API.md
CHANGED
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
- [NavigationContext](interfaces/NavigationContext.md)
|
|
68
68
|
- [NetworkRequestFailedEvent](interfaces/NetworkRequestFailedEvent.md)
|
|
69
69
|
- [NewVisitPayload](interfaces/NewVisitPayload.md)
|
|
70
|
+
- [OfflineModeResult](interfaces/OfflineModeResult.md)
|
|
70
71
|
- [OfflinePatientArgs](interfaces/OfflinePatientArgs.md)
|
|
71
72
|
- [OfflinePatientDataSyncHandler](interfaces/OfflinePatientDataSyncHandler.md)
|
|
72
73
|
- [OfflinePatientDataSyncState](interfaces/OfflinePatientDataSyncState.md)
|
|
@@ -120,6 +121,7 @@
|
|
|
120
121
|
- [LoggedInUserData](API.md#loggedinuserdata)
|
|
121
122
|
- [MaybeAsync](API.md#maybeasync)
|
|
122
123
|
- [NavigationContextType](API.md#navigationcontexttype)
|
|
124
|
+
- [OfflineMode](API.md#offlinemode)
|
|
123
125
|
- [OmrsOfflineCachingStrategy](API.md#omrsofflinecachingstrategy)
|
|
124
126
|
- [OmrsOfflineHttpHeaderNames](API.md#omrsofflinehttpheadernames)
|
|
125
127
|
- [OmrsOfflineHttpHeaders](API.md#omrsofflinehttpheaders)
|
|
@@ -187,8 +189,11 @@
|
|
|
187
189
|
|
|
188
190
|
### Other Functions
|
|
189
191
|
|
|
192
|
+
- [activateOfflineCapability](API.md#activateofflinecapability)
|
|
190
193
|
- [age](API.md#age)
|
|
191
194
|
- [attach](API.md#attach)
|
|
195
|
+
- [beginEditSynchronizationItem](API.md#begineditsynchronizationitem)
|
|
196
|
+
- [canBeginEditSynchronizationItemsOfType](API.md#canbegineditsynchronizationitemsoftype)
|
|
192
197
|
- [checkStatus](API.md#checkstatus)
|
|
193
198
|
- [checkStatusFor](API.md#checkstatusfor)
|
|
194
199
|
- [createErrorHandler](API.md#createerrorhandler)
|
|
@@ -213,6 +218,7 @@
|
|
|
213
218
|
- [getAsyncLifecycle](API.md#getasynclifecycle)
|
|
214
219
|
- [getConfig](API.md#getconfig)
|
|
215
220
|
- [getConfigStore](API.md#getconfigstore)
|
|
221
|
+
- [getCurrentOfflineMode](API.md#getcurrentofflinemode)
|
|
216
222
|
- [getCustomProps](API.md#getcustomprops)
|
|
217
223
|
- [getExtensionConfigStore](API.md#getextensionconfigstore)
|
|
218
224
|
- [getExtensionNameFromId](API.md#getextensionnamefromid)
|
|
@@ -229,6 +235,7 @@
|
|
|
229
235
|
- [getOmrsServiceWorker](API.md#getomrsserviceworker)
|
|
230
236
|
- [getSessionLocation](API.md#getsessionlocation)
|
|
231
237
|
- [getSyncLifecycle](API.md#getsynclifecycle)
|
|
238
|
+
- [getSynchronizationItem](API.md#getsynchronizationitem)
|
|
232
239
|
- [getSynchronizationItems](API.md#getsynchronizationitems)
|
|
233
240
|
- [getSynchronizationItemsFor](API.md#getsynchronizationitemsfor)
|
|
234
241
|
- [getUpdatedExtensionSlotInfo](API.md#getupdatedextensionslotinfo)
|
|
@@ -267,6 +274,7 @@
|
|
|
267
274
|
- [retry](API.md#retry)
|
|
268
275
|
- [runSynchronization](API.md#runsynchronization)
|
|
269
276
|
- [saveVisit](API.md#savevisit)
|
|
277
|
+
- [setCurrentOfflineMode](API.md#setcurrentofflinemode)
|
|
270
278
|
- [setSessionLocation](API.md#setsessionlocation)
|
|
271
279
|
- [setupOfflineSync](API.md#setupofflinesync)
|
|
272
280
|
- [setupPaths](API.md#setuppaths)
|
|
@@ -490,6 +498,16 @@ ___
|
|
|
490
498
|
|
|
491
499
|
___
|
|
492
500
|
|
|
501
|
+
### OfflineMode
|
|
502
|
+
|
|
503
|
+
Ƭ **OfflineMode**: ``"on"`` \| ``"off"`` \| ``"unavailable"``
|
|
504
|
+
|
|
505
|
+
#### Defined in
|
|
506
|
+
|
|
507
|
+
[packages/framework/esm-offline/src/mode.ts:36](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/mode.ts#L36)
|
|
508
|
+
|
|
509
|
+
___
|
|
510
|
+
|
|
493
511
|
### OmrsOfflineCachingStrategy
|
|
494
512
|
|
|
495
513
|
Ƭ **OmrsOfflineCachingStrategy**: ``"network-only-or-cache-only"`` \| ``"network-first"``
|
|
@@ -560,6 +578,11 @@ ___
|
|
|
560
578
|
|
|
561
579
|
▸ (`item`, `options`): `Promise`<`any`\>
|
|
562
580
|
|
|
581
|
+
A function which, when invoked, performs the actual client-server synchronization of the given
|
|
582
|
+
`item` (which is the actual data to be synchronized).
|
|
583
|
+
The function receives additional `options` which provide additional data that can be used
|
|
584
|
+
for synchronizing.
|
|
585
|
+
|
|
563
586
|
##### Parameters
|
|
564
587
|
|
|
565
588
|
| Name | Type |
|
|
@@ -573,7 +596,7 @@ ___
|
|
|
573
596
|
|
|
574
597
|
#### Defined in
|
|
575
598
|
|
|
576
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
599
|
+
[packages/framework/esm-offline/src/sync.ts:45](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L45)
|
|
577
600
|
|
|
578
601
|
___
|
|
579
602
|
|
|
@@ -1364,6 +1387,20 @@ ___
|
|
|
1364
1387
|
|
|
1365
1388
|
## Other Functions
|
|
1366
1389
|
|
|
1390
|
+
### activateOfflineCapability
|
|
1391
|
+
|
|
1392
|
+
▸ **activateOfflineCapability**(): `Promise`<`void`\>
|
|
1393
|
+
|
|
1394
|
+
#### Returns
|
|
1395
|
+
|
|
1396
|
+
`Promise`<`void`\>
|
|
1397
|
+
|
|
1398
|
+
#### Defined in
|
|
1399
|
+
|
|
1400
|
+
[packages/framework/esm-offline/src/mode.ts:65](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/mode.ts#L65)
|
|
1401
|
+
|
|
1402
|
+
___
|
|
1403
|
+
|
|
1367
1404
|
### age
|
|
1368
1405
|
|
|
1369
1406
|
▸ **age**(`dateString`): `string`
|
|
@@ -1409,6 +1446,52 @@ ___
|
|
|
1409
1446
|
|
|
1410
1447
|
___
|
|
1411
1448
|
|
|
1449
|
+
### beginEditSynchronizationItem
|
|
1450
|
+
|
|
1451
|
+
▸ **beginEditSynchronizationItem**(`id`): `Promise`<`void`\>
|
|
1452
|
+
|
|
1453
|
+
Triggers an edit flow for the given synchronization item.
|
|
1454
|
+
If this is not possible, throws an error.
|
|
1455
|
+
|
|
1456
|
+
#### Parameters
|
|
1457
|
+
|
|
1458
|
+
| Name | Type | Description |
|
|
1459
|
+
| :------ | :------ | :------ |
|
|
1460
|
+
| `id` | `number` | The ID of the synchronization item to be edited. |
|
|
1461
|
+
|
|
1462
|
+
#### Returns
|
|
1463
|
+
|
|
1464
|
+
`Promise`<`void`\>
|
|
1465
|
+
|
|
1466
|
+
#### Defined in
|
|
1467
|
+
|
|
1468
|
+
[packages/framework/esm-offline/src/sync.ts:354](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L354)
|
|
1469
|
+
|
|
1470
|
+
___
|
|
1471
|
+
|
|
1472
|
+
### canBeginEditSynchronizationItemsOfType
|
|
1473
|
+
|
|
1474
|
+
▸ **canBeginEditSynchronizationItemsOfType**(`type`): `boolean`
|
|
1475
|
+
|
|
1476
|
+
Returns whether editing synchronization items of the given type is supported by the currently
|
|
1477
|
+
registered synchronization handlers.
|
|
1478
|
+
|
|
1479
|
+
#### Parameters
|
|
1480
|
+
|
|
1481
|
+
| Name | Type | Description |
|
|
1482
|
+
| :------ | :------ | :------ |
|
|
1483
|
+
| `type` | `string` | The identifying type of the synchronization item which should be edited. |
|
|
1484
|
+
|
|
1485
|
+
#### Returns
|
|
1486
|
+
|
|
1487
|
+
`boolean`
|
|
1488
|
+
|
|
1489
|
+
#### Defined in
|
|
1490
|
+
|
|
1491
|
+
[packages/framework/esm-offline/src/sync.ts:344](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L344)
|
|
1492
|
+
|
|
1493
|
+
___
|
|
1494
|
+
|
|
1412
1495
|
### checkStatus
|
|
1413
1496
|
|
|
1414
1497
|
▸ **checkStatus**(`online?`, `offline?`): `boolean`
|
|
@@ -1614,11 +1697,13 @@ ___
|
|
|
1614
1697
|
|
|
1615
1698
|
▸ **deleteSynchronizationItem**(`id`): `Promise`<`void`\>
|
|
1616
1699
|
|
|
1700
|
+
Deletes a queued up sync item with the given ID.
|
|
1701
|
+
|
|
1617
1702
|
#### Parameters
|
|
1618
1703
|
|
|
1619
|
-
| Name | Type |
|
|
1620
|
-
| :------ | :------ |
|
|
1621
|
-
| `id` | `number` |
|
|
1704
|
+
| Name | Type | Description |
|
|
1705
|
+
| :------ | :------ | :------ |
|
|
1706
|
+
| `id` | `number` | The ID of the synchronization item to be deleted. |
|
|
1622
1707
|
|
|
1623
1708
|
#### Returns
|
|
1624
1709
|
|
|
@@ -1626,7 +1711,7 @@ ___
|
|
|
1626
1711
|
|
|
1627
1712
|
#### Defined in
|
|
1628
1713
|
|
|
1629
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
1714
|
+
[packages/framework/esm-offline/src/sync.ts:374](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L374)
|
|
1630
1715
|
|
|
1631
1716
|
___
|
|
1632
1717
|
|
|
@@ -2011,6 +2096,20 @@ ___
|
|
|
2011
2096
|
|
|
2012
2097
|
___
|
|
2013
2098
|
|
|
2099
|
+
### getCurrentOfflineMode
|
|
2100
|
+
|
|
2101
|
+
▸ **getCurrentOfflineMode**(): [`OfflineModeResult`](interfaces/OfflineModeResult.md)
|
|
2102
|
+
|
|
2103
|
+
#### Returns
|
|
2104
|
+
|
|
2105
|
+
[`OfflineModeResult`](interfaces/OfflineModeResult.md)
|
|
2106
|
+
|
|
2107
|
+
#### Defined in
|
|
2108
|
+
|
|
2109
|
+
[packages/framework/esm-offline/src/mode.ts:47](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/mode.ts#L47)
|
|
2110
|
+
|
|
2111
|
+
___
|
|
2112
|
+
|
|
2014
2113
|
### getCustomProps
|
|
2015
2114
|
|
|
2016
2115
|
▸ **getCustomProps**(`online`, `offline`): `object`
|
|
@@ -2266,7 +2365,7 @@ ___
|
|
|
2266
2365
|
|
|
2267
2366
|
#### Defined in
|
|
2268
2367
|
|
|
2269
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
2368
|
+
[packages/framework/esm-offline/src/sync.ts:133](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L133)
|
|
2270
2369
|
|
|
2271
2370
|
___
|
|
2272
2371
|
|
|
@@ -2339,10 +2438,40 @@ ___
|
|
|
2339
2438
|
|
|
2340
2439
|
___
|
|
2341
2440
|
|
|
2441
|
+
### getSynchronizationItem
|
|
2442
|
+
|
|
2443
|
+
▸ **getSynchronizationItem**<`T`\>(`id`): `Promise`<[`SyncItem`](interfaces/SyncItem.md)<`T`\> \| `undefined`\>
|
|
2444
|
+
|
|
2445
|
+
Returns a queued sync item with the given ID or `undefined` if no such item exists.
|
|
2446
|
+
|
|
2447
|
+
#### Type parameters
|
|
2448
|
+
|
|
2449
|
+
| Name | Type |
|
|
2450
|
+
| :------ | :------ |
|
|
2451
|
+
| `T` | `any` |
|
|
2452
|
+
|
|
2453
|
+
#### Parameters
|
|
2454
|
+
|
|
2455
|
+
| Name | Type | Description |
|
|
2456
|
+
| :------ | :------ | :------ |
|
|
2457
|
+
| `id` | `number` | The ID of the requested sync item. |
|
|
2458
|
+
|
|
2459
|
+
#### Returns
|
|
2460
|
+
|
|
2461
|
+
`Promise`<[`SyncItem`](interfaces/SyncItem.md)<`T`\> \| `undefined`\>
|
|
2462
|
+
|
|
2463
|
+
#### Defined in
|
|
2464
|
+
|
|
2465
|
+
[packages/framework/esm-offline/src/sync.ts:333](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L333)
|
|
2466
|
+
|
|
2467
|
+
___
|
|
2468
|
+
|
|
2342
2469
|
### getSynchronizationItems
|
|
2343
2470
|
|
|
2344
2471
|
▸ **getSynchronizationItems**<`T`\>(`type`): `Promise`<`T`[]\>
|
|
2345
2472
|
|
|
2473
|
+
Returns all currently queued up sync items of the currently signed in user.
|
|
2474
|
+
|
|
2346
2475
|
#### Type parameters
|
|
2347
2476
|
|
|
2348
2477
|
| Name |
|
|
@@ -2351,9 +2480,9 @@ ___
|
|
|
2351
2480
|
|
|
2352
2481
|
#### Parameters
|
|
2353
2482
|
|
|
2354
|
-
| Name | Type |
|
|
2355
|
-
| :------ | :------ |
|
|
2356
|
-
| `type` | `string` |
|
|
2483
|
+
| Name | Type | Description |
|
|
2484
|
+
| :------ | :------ | :------ |
|
|
2485
|
+
| `type` | `string` | The identifying type of the synchronization items to be returned. |
|
|
2357
2486
|
|
|
2358
2487
|
#### Returns
|
|
2359
2488
|
|
|
@@ -2361,7 +2490,7 @@ ___
|
|
|
2361
2490
|
|
|
2362
2491
|
#### Defined in
|
|
2363
2492
|
|
|
2364
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
2493
|
+
[packages/framework/esm-offline/src/sync.ts:324](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L324)
|
|
2365
2494
|
|
|
2366
2495
|
___
|
|
2367
2496
|
|
|
@@ -2369,6 +2498,8 @@ ___
|
|
|
2369
2498
|
|
|
2370
2499
|
▸ **getSynchronizationItemsFor**<`T`\>(`userId`, `type`): `Promise`<`T`[]\>
|
|
2371
2500
|
|
|
2501
|
+
Returns all currently queued up sync items of a given user.
|
|
2502
|
+
|
|
2372
2503
|
#### Type parameters
|
|
2373
2504
|
|
|
2374
2505
|
| Name |
|
|
@@ -2377,10 +2508,10 @@ ___
|
|
|
2377
2508
|
|
|
2378
2509
|
#### Parameters
|
|
2379
2510
|
|
|
2380
|
-
| Name | Type |
|
|
2381
|
-
| :------ | :------ |
|
|
2382
|
-
| `userId` | `string` |
|
|
2383
|
-
| `type` | `string` |
|
|
2511
|
+
| Name | Type | Description |
|
|
2512
|
+
| :------ | :------ | :------ |
|
|
2513
|
+
| `userId` | `string` | The ID of the user whose synchronization items should be returned. |
|
|
2514
|
+
| `type` | `string` | The identifying type of the synchronization items to be returned.. |
|
|
2384
2515
|
|
|
2385
2516
|
#### Returns
|
|
2386
2517
|
|
|
@@ -2388,7 +2519,7 @@ ___
|
|
|
2388
2519
|
|
|
2389
2520
|
#### Defined in
|
|
2390
2521
|
|
|
2391
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
2522
|
+
[packages/framework/esm-offline/src/sync.ts:306](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L306)
|
|
2392
2523
|
|
|
2393
2524
|
___
|
|
2394
2525
|
|
|
@@ -2855,6 +2986,8 @@ ___
|
|
|
2855
2986
|
|
|
2856
2987
|
▸ **queueSynchronizationItem**<`T`\>(`type`, `content`, `descriptor?`): `Promise`<`number`\>
|
|
2857
2988
|
|
|
2989
|
+
Enqueues a new item in the sync queue and associates the item with the currently signed in user.
|
|
2990
|
+
|
|
2858
2991
|
#### Type parameters
|
|
2859
2992
|
|
|
2860
2993
|
| Name |
|
|
@@ -2863,11 +2996,11 @@ ___
|
|
|
2863
2996
|
|
|
2864
2997
|
#### Parameters
|
|
2865
2998
|
|
|
2866
|
-
| Name | Type |
|
|
2867
|
-
| :------ | :------ |
|
|
2868
|
-
| `type` | `string` |
|
|
2869
|
-
| `content` | `T` |
|
|
2870
|
-
| `descriptor?` | [`QueueItemDescriptor`](interfaces/QueueItemDescriptor.md) |
|
|
2999
|
+
| Name | Type | Description |
|
|
3000
|
+
| :------ | :------ | :------ |
|
|
3001
|
+
| `type` | `string` | The identifying type of the synchronization item. |
|
|
3002
|
+
| `content` | `T` | The actual data to be synchronized. |
|
|
3003
|
+
| `descriptor?` | [`QueueItemDescriptor`](interfaces/QueueItemDescriptor.md) | An optional descriptor providing additional metadata about the sync item. |
|
|
2871
3004
|
|
|
2872
3005
|
#### Returns
|
|
2873
3006
|
|
|
@@ -2875,7 +3008,7 @@ ___
|
|
|
2875
3008
|
|
|
2876
3009
|
#### Defined in
|
|
2877
3010
|
|
|
2878
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
3011
|
+
[packages/framework/esm-offline/src/sync.ts:292](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L292)
|
|
2879
3012
|
|
|
2880
3013
|
___
|
|
2881
3014
|
|
|
@@ -2883,6 +3016,8 @@ ___
|
|
|
2883
3016
|
|
|
2884
3017
|
▸ **queueSynchronizationItemFor**<`T`\>(`userId`, `type`, `content`, `descriptor?`): `Promise`<`number`\>
|
|
2885
3018
|
|
|
3019
|
+
Enqueues a new item in the sync queue for a specific user.
|
|
3020
|
+
|
|
2886
3021
|
#### Type parameters
|
|
2887
3022
|
|
|
2888
3023
|
| Name |
|
|
@@ -2891,12 +3026,12 @@ ___
|
|
|
2891
3026
|
|
|
2892
3027
|
#### Parameters
|
|
2893
3028
|
|
|
2894
|
-
| Name | Type |
|
|
2895
|
-
| :------ | :------ |
|
|
2896
|
-
| `userId` | `string` |
|
|
2897
|
-
| `type` | `string` |
|
|
2898
|
-
| `content` | `T` |
|
|
2899
|
-
| `descriptor?` | [`QueueItemDescriptor`](interfaces/QueueItemDescriptor.md) |
|
|
3029
|
+
| Name | Type | Description |
|
|
3030
|
+
| :------ | :------ | :------ |
|
|
3031
|
+
| `userId` | `string` | The user with whom the sync item should be associated with. |
|
|
3032
|
+
| `type` | `string` | The identifying type of the synchronization item. |
|
|
3033
|
+
| `content` | `T` | The actual data to be synchronized. |
|
|
3034
|
+
| `descriptor?` | [`QueueItemDescriptor`](interfaces/QueueItemDescriptor.md) | An optional descriptor providing additional metadata about the sync item. |
|
|
2900
3035
|
|
|
2901
3036
|
#### Returns
|
|
2902
3037
|
|
|
@@ -2904,7 +3039,7 @@ ___
|
|
|
2904
3039
|
|
|
2905
3040
|
#### Defined in
|
|
2906
3041
|
|
|
2907
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
3042
|
+
[packages/framework/esm-offline/src/sync.ts:258](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L258)
|
|
2908
3043
|
|
|
2909
3044
|
___
|
|
2910
3045
|
|
|
@@ -3185,13 +3320,15 @@ ___
|
|
|
3185
3320
|
|
|
3186
3321
|
▸ **runSynchronization**(): `Promise`<`void`\>
|
|
3187
3322
|
|
|
3323
|
+
Runs a full synchronization of **all** queued synchronization items.
|
|
3324
|
+
|
|
3188
3325
|
#### Returns
|
|
3189
3326
|
|
|
3190
3327
|
`Promise`<`void`\>
|
|
3191
3328
|
|
|
3192
3329
|
#### Defined in
|
|
3193
3330
|
|
|
3194
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
3331
|
+
[packages/framework/esm-offline/src/sync.ts:140](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L140)
|
|
3195
3332
|
|
|
3196
3333
|
___
|
|
3197
3334
|
|
|
@@ -3216,6 +3353,26 @@ ___
|
|
|
3216
3353
|
|
|
3217
3354
|
___
|
|
3218
3355
|
|
|
3356
|
+
### setCurrentOfflineMode
|
|
3357
|
+
|
|
3358
|
+
▸ **setCurrentOfflineMode**(`mode`): `void`
|
|
3359
|
+
|
|
3360
|
+
#### Parameters
|
|
3361
|
+
|
|
3362
|
+
| Name | Type |
|
|
3363
|
+
| :------ | :------ |
|
|
3364
|
+
| `mode` | [`OfflineMode`](API.md#offlinemode) |
|
|
3365
|
+
|
|
3366
|
+
#### Returns
|
|
3367
|
+
|
|
3368
|
+
`void`
|
|
3369
|
+
|
|
3370
|
+
#### Defined in
|
|
3371
|
+
|
|
3372
|
+
[packages/framework/esm-offline/src/mode.ts:55](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/mode.ts#L55)
|
|
3373
|
+
|
|
3374
|
+
___
|
|
3375
|
+
|
|
3219
3376
|
### setSessionLocation
|
|
3220
3377
|
|
|
3221
3378
|
▸ **setSessionLocation**(`locationUuid`, `abortController`): `Promise`<`any`\>
|
|
@@ -3239,7 +3396,9 @@ ___
|
|
|
3239
3396
|
|
|
3240
3397
|
### setupOfflineSync
|
|
3241
3398
|
|
|
3242
|
-
▸ **setupOfflineSync**<`T`\>(`type`, `dependsOn`, `process`): `void`
|
|
3399
|
+
▸ **setupOfflineSync**<`T`\>(`type`, `dependsOn`, `process`, `options?`): `void`
|
|
3400
|
+
|
|
3401
|
+
Registers a new synchronization handler which is able to synchronize data of a specific type.
|
|
3243
3402
|
|
|
3244
3403
|
#### Type parameters
|
|
3245
3404
|
|
|
@@ -3249,11 +3408,12 @@ ___
|
|
|
3249
3408
|
|
|
3250
3409
|
#### Parameters
|
|
3251
3410
|
|
|
3252
|
-
| Name | Type |
|
|
3253
|
-
| :------ | :------ |
|
|
3254
|
-
| `type` | `string` |
|
|
3255
|
-
| `dependsOn` | `string`[] |
|
|
3256
|
-
| `process` | [`ProcessSyncItem`](API.md#processsyncitem)<`T`\> |
|
|
3411
|
+
| Name | Type | Description |
|
|
3412
|
+
| :------ | :------ | :------ |
|
|
3413
|
+
| `type` | `string` | The identifying type of the synchronization items which can be handled by this handler. |
|
|
3414
|
+
| `dependsOn` | `string`[] | An array of other sync item types which must be synchronized before this handler can synchronize its own data. Items of these types are effectively dependencies of the data synchronized by this handler. |
|
|
3415
|
+
| `process` | [`ProcessSyncItem`](API.md#processsyncitem)<`T`\> | A function which, when invoked, performs the actual client-server synchronization of the given `item` (which is the actual data to be synchronized). |
|
|
3416
|
+
| `options` | `SetupOfflineSyncOptions`<`T`\> | Additional options which can optionally be provided when setting up a synchronization callback for a specific synchronization item type. |
|
|
3257
3417
|
|
|
3258
3418
|
#### Returns
|
|
3259
3419
|
|
|
@@ -3261,7 +3421,7 @@ ___
|
|
|
3261
3421
|
|
|
3262
3422
|
#### Defined in
|
|
3263
3423
|
|
|
3264
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
3424
|
+
[packages/framework/esm-offline/src/sync.ts:389](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L389)
|
|
3265
3425
|
|
|
3266
3426
|
___
|
|
3267
3427
|
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
|
|
19
19
|
| Name | Type |
|
|
20
20
|
| :------ | :------ |
|
|
21
|
-
| `code` | `
|
|
21
|
+
| `code` | { `coding`: [`FHIRCode`](FHIRCode.md)[] } |
|
|
22
22
|
| `code.coding` | [`FHIRCode`](FHIRCode.md)[] |
|
|
23
23
|
| `effectiveDateTime` | `Date` |
|
|
24
|
-
| `encounter` | `
|
|
24
|
+
| `encounter` | { `reference`: `string` ; `type`: `string` } |
|
|
25
25
|
| `encounter.reference` | `string` |
|
|
26
26
|
| `encounter.type` | `string` |
|
|
27
27
|
| `id` | `string` |
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
| `referenceRange` | `any` |
|
|
30
30
|
| `resourceType` | `string` |
|
|
31
31
|
| `status` | `string` |
|
|
32
|
-
| `subject` | `
|
|
32
|
+
| `subject` | { `display`: `string` ; `identifier`: { `id`: `string` ; `system`: `string` ; `use`: `string` ; `value`: `string` } ; `reference`: `string` ; `type`: `string` } |
|
|
33
33
|
| `subject.display` | `string` |
|
|
34
|
-
| `subject.identifier` | `
|
|
34
|
+
| `subject.identifier` | { `id`: `string` ; `system`: `string` ; `use`: `string` ; `value`: `string` } |
|
|
35
35
|
| `subject.identifier.id` | `string` |
|
|
36
36
|
| `subject.identifier.system` | `string` |
|
|
37
37
|
| `subject.identifier.use` | `string` |
|
|
38
38
|
| `subject.identifier.value` | `string` |
|
|
39
39
|
| `subject.reference` | `string` |
|
|
40
40
|
| `subject.type` | `string` |
|
|
41
|
-
| `valueQuantity` | `
|
|
41
|
+
| `valueQuantity` | { `value`: `number` } |
|
|
42
42
|
| `valueQuantity.value` | `number` |
|
|
43
43
|
|
|
44
44
|
#### Defined in
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[@openmrs/esm-framework](../API.md) / OfflineModeResult
|
|
2
|
+
|
|
3
|
+
# Interface: OfflineModeResult
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
- [active](OfflineModeResult.md#active)
|
|
10
|
+
- [current](OfflineModeResult.md#current)
|
|
11
|
+
- [notAvailable](OfflineModeResult.md#notavailable)
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### active
|
|
16
|
+
|
|
17
|
+
• **active**: `boolean`
|
|
18
|
+
|
|
19
|
+
#### Defined in
|
|
20
|
+
|
|
21
|
+
[packages/framework/esm-offline/src/mode.ts:41](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/mode.ts#L41)
|
|
22
|
+
|
|
23
|
+
___
|
|
24
|
+
|
|
25
|
+
### current
|
|
26
|
+
|
|
27
|
+
• **current**: [`OfflineMode`](../API.md#offlinemode)
|
|
28
|
+
|
|
29
|
+
#### Defined in
|
|
30
|
+
|
|
31
|
+
[packages/framework/esm-offline/src/mode.ts:39](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/mode.ts#L39)
|
|
32
|
+
|
|
33
|
+
___
|
|
34
|
+
|
|
35
|
+
### notAvailable
|
|
36
|
+
|
|
37
|
+
• **notAvailable**: `boolean`
|
|
38
|
+
|
|
39
|
+
#### Defined in
|
|
40
|
+
|
|
41
|
+
[packages/framework/esm-offline/src/mode.ts:40](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/mode.ts#L40)
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: OfflineSynchronizationStore
|
|
4
4
|
|
|
5
|
+
Represents the data inside the global offline synchronization store.
|
|
6
|
+
Provides information about a currently ongoing synchronization.
|
|
7
|
+
|
|
5
8
|
## Table of contents
|
|
6
9
|
|
|
7
10
|
### Properties
|
|
@@ -24,4 +27,4 @@
|
|
|
24
27
|
|
|
25
28
|
#### Defined in
|
|
26
29
|
|
|
27
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
30
|
+
[packages/framework/esm-offline/src/sync.ts:93](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L93)
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: QueueItemDescriptor
|
|
4
4
|
|
|
5
|
+
Contains information about the sync item which has been provided externally by the caller
|
|
6
|
+
who added the item to the queue.
|
|
7
|
+
This information is all optional, but, when provided while enqueuing the item, can be used in other
|
|
8
|
+
locations to better represent the sync item, e.g. in the UI.
|
|
9
|
+
|
|
5
10
|
## Table of contents
|
|
6
11
|
|
|
7
12
|
### Properties
|
|
@@ -19,7 +24,7 @@
|
|
|
19
24
|
|
|
20
25
|
#### Defined in
|
|
21
26
|
|
|
22
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
27
|
+
[packages/framework/esm-offline/src/sync.ts:31](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L31)
|
|
23
28
|
|
|
24
29
|
___
|
|
25
30
|
|
|
@@ -29,7 +34,7 @@ ___
|
|
|
29
34
|
|
|
30
35
|
#### Defined in
|
|
31
36
|
|
|
32
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
37
|
+
[packages/framework/esm-offline/src/sync.ts:36](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L36)
|
|
33
38
|
|
|
34
39
|
___
|
|
35
40
|
|
|
@@ -39,7 +44,7 @@ ___
|
|
|
39
44
|
|
|
40
45
|
#### Defined in
|
|
41
46
|
|
|
42
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
47
|
+
[packages/framework/esm-offline/src/sync.ts:30](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L30)
|
|
43
48
|
|
|
44
49
|
___
|
|
45
50
|
|
|
@@ -49,4 +54,4 @@ ___
|
|
|
49
54
|
|
|
50
55
|
#### Defined in
|
|
51
56
|
|
|
52
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
57
|
+
[packages/framework/esm-offline/src/sync.ts:35](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L35)
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
[@openmrs/esm-framework](../API.md) / SyncItem
|
|
2
2
|
|
|
3
|
-
# Interface: SyncItem
|
|
3
|
+
# Interface: SyncItem<T\>
|
|
4
|
+
|
|
5
|
+
Defines an item queued up in the offline synchronization queue.
|
|
6
|
+
A `SyncItem` contains both meta information about the item in the sync queue, as well as the
|
|
7
|
+
actual data to be synchronized (i.e. the item's `content`).
|
|
8
|
+
|
|
9
|
+
## Type parameters
|
|
10
|
+
|
|
11
|
+
| Name | Type |
|
|
12
|
+
| :------ | :------ |
|
|
13
|
+
| `T` | `any` |
|
|
4
14
|
|
|
5
15
|
## Table of contents
|
|
6
16
|
|
|
@@ -18,11 +28,11 @@
|
|
|
18
28
|
|
|
19
29
|
### content
|
|
20
30
|
|
|
21
|
-
• **content**: `
|
|
31
|
+
• **content**: `T`
|
|
22
32
|
|
|
23
33
|
#### Defined in
|
|
24
34
|
|
|
25
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
35
|
+
[packages/framework/esm-offline/src/sync.ts:14](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L14)
|
|
26
36
|
|
|
27
37
|
___
|
|
28
38
|
|
|
@@ -32,7 +42,7 @@ ___
|
|
|
32
42
|
|
|
33
43
|
#### Defined in
|
|
34
44
|
|
|
35
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
45
|
+
[packages/framework/esm-offline/src/sync.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L15)
|
|
36
46
|
|
|
37
47
|
___
|
|
38
48
|
|
|
@@ -42,7 +52,7 @@ ___
|
|
|
42
52
|
|
|
43
53
|
#### Defined in
|
|
44
54
|
|
|
45
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
55
|
+
[packages/framework/esm-offline/src/sync.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L16)
|
|
46
56
|
|
|
47
57
|
___
|
|
48
58
|
|
|
@@ -52,7 +62,7 @@ ___
|
|
|
52
62
|
|
|
53
63
|
#### Defined in
|
|
54
64
|
|
|
55
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
65
|
+
[packages/framework/esm-offline/src/sync.ts:11](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L11)
|
|
56
66
|
|
|
57
67
|
___
|
|
58
68
|
|
|
@@ -69,7 +79,7 @@ ___
|
|
|
69
79
|
|
|
70
80
|
#### Defined in
|
|
71
81
|
|
|
72
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
82
|
+
[packages/framework/esm-offline/src/sync.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L17)
|
|
73
83
|
|
|
74
84
|
___
|
|
75
85
|
|
|
@@ -79,7 +89,7 @@ ___
|
|
|
79
89
|
|
|
80
90
|
#### Defined in
|
|
81
91
|
|
|
82
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
92
|
+
[packages/framework/esm-offline/src/sync.ts:13](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L13)
|
|
83
93
|
|
|
84
94
|
___
|
|
85
95
|
|
|
@@ -89,4 +99,4 @@ ___
|
|
|
89
99
|
|
|
90
100
|
#### Defined in
|
|
91
101
|
|
|
92
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
102
|
+
[packages/framework/esm-offline/src/sync.ts:12](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L12)
|