@openmrs/esm-framework 4.0.1-pre.224 → 4.0.1-pre.232

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.
Files changed (35) hide show
  1. package/.turbo/turbo-build.log +8 -8
  2. package/dist/openmrs-esm-framework.js +1 -1
  3. package/dist/openmrs-esm-framework.js.map +1 -1
  4. package/docs/API.md +633 -100
  5. package/docs/classes/OpenmrsFetchError.md +6 -0
  6. package/docs/enums/Type.md +9 -9
  7. package/docs/enums/VisitMode.md +3 -3
  8. package/docs/enums/VisitStatus.md +2 -2
  9. package/docs/interfaces/AssignedExtension.md +2 -0
  10. package/docs/interfaces/BreadcrumbSettings.md +18 -0
  11. package/docs/interfaces/ComponentDefinition.md +13 -0
  12. package/docs/interfaces/Config.md +17 -3
  13. package/docs/interfaces/ConfigObject.md +17 -3
  14. package/docs/interfaces/ConnectedExtension.md +2 -0
  15. package/docs/interfaces/DynamicOfflineData.md +15 -0
  16. package/docs/interfaces/DynamicOfflineDataHandler.md +21 -4
  17. package/docs/interfaces/DynamicOfflineDataSyncState.md +12 -0
  18. package/docs/interfaces/ExtensionDefinition.md +25 -0
  19. package/docs/interfaces/ExtensionSlotBaseProps.md +2 -0
  20. package/docs/interfaces/ExtensionSlotConfigObject.md +6 -0
  21. package/docs/interfaces/FHIRRequestObj.md +2 -0
  22. package/docs/interfaces/FHIRRequestOptions.md +2 -0
  23. package/docs/interfaces/OfflinePatientArgs.md +2 -0
  24. package/docs/interfaces/OfflinePatientDataSyncHandler.md +2 -0
  25. package/docs/interfaces/OfflinePatientDataSyncState.md +2 -0
  26. package/docs/interfaces/OfflinePatientDataSyncStore.md +2 -0
  27. package/docs/interfaces/OldExtensionSlotBaseProps.md +2 -0
  28. package/docs/interfaces/PageDefinition.md +17 -0
  29. package/docs/interfaces/QueueItemDescriptor.md +5 -0
  30. package/docs/interfaces/RetryOptions.md +15 -4
  31. package/docs/interfaces/SpaConfig.md +14 -0
  32. package/docs/interfaces/SyncItem.md +4 -0
  33. package/docs/interfaces/SyncProcessOptions.md +2 -0
  34. package/mock.tsx +7 -4
  35. package/package.json +13 -13
@@ -34,6 +34,8 @@
34
34
 
35
35
  • **appName**: `string`
36
36
 
37
+ The module/app that defines the component
38
+
37
39
  #### Inherited from
38
40
 
39
41
  [ComponentDefinition](ComponentDefinition.md).[appName](ComponentDefinition.md#appname)
@@ -48,6 +50,8 @@ ___
48
50
 
49
51
  • `Optional` **id**: `string`
50
52
 
53
+ **`deprecated`** A confusing way to specify the name of the extension
54
+
51
55
  #### Defined in
52
56
 
53
57
  [packages/framework/esm-globals/src/types.ts:135](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/types.ts#L135)
@@ -58,6 +62,8 @@ ___
58
62
 
59
63
  • `Optional` **meta**: `Record`<`string`, `any`\>
60
64
 
65
+ The meta data used for reflection by other components
66
+
61
67
  #### Defined in
62
68
 
63
69
  [packages/framework/esm-globals/src/types.ts:131](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/types.ts#L131)
@@ -68,6 +74,8 @@ ___
68
74
 
69
75
  • **name**: `string`
70
76
 
77
+ The name of the extension being registered
78
+
71
79
  #### Defined in
72
80
 
73
81
  [packages/framework/esm-globals/src/types.ts:125](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/types.ts#L125)
@@ -78,6 +86,8 @@ ___
78
86
 
79
87
  • `Optional` **offline**: `boolean` \| `object`
80
88
 
89
+ Defines the offline support / properties of the component.
90
+
81
91
  #### Inherited from
82
92
 
83
93
  [ComponentDefinition](ComponentDefinition.md).[offline](ComponentDefinition.md#offline)
@@ -92,6 +102,8 @@ ___
92
102
 
93
103
  • `Optional` **online**: `boolean` \| `object`
94
104
 
105
+ Defines the online support / properties of the component.
106
+
95
107
  #### Inherited from
96
108
 
97
109
  [ComponentDefinition](ComponentDefinition.md).[online](ComponentDefinition.md#online)
@@ -106,6 +118,8 @@ ___
106
118
 
107
119
  • `Optional` **order**: `number`
108
120
 
121
+ Specifies the relative order in which the extension renders in a slot
122
+
109
123
  #### Defined in
110
124
 
111
125
  [packages/framework/esm-globals/src/types.ts:133](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/types.ts#L133)
@@ -116,6 +130,9 @@ ___
116
130
 
117
131
  • `Optional` **privilege**: `string` \| `string`[]
118
132
 
133
+ Defines the access privilege(s) required for this component, if any.
134
+ If more than one privilege is provided, the user must have all specified permissions.
135
+
119
136
  #### Inherited from
120
137
 
121
138
  [ComponentDefinition](ComponentDefinition.md).[privilege](ComponentDefinition.md#privilege)
@@ -130,6 +147,8 @@ ___
130
147
 
131
148
  • `Optional` **resources**: `Record`<`string`, [`ResourceLoader`](ResourceLoader.md)<`any`\>\>
132
149
 
150
+ Defines resources that are loaded when the component should mount.
151
+
133
152
  #### Inherited from
134
153
 
135
154
  [ComponentDefinition](ComponentDefinition.md).[resources](ComponentDefinition.md#resources)
@@ -144,6 +163,8 @@ ___
144
163
 
145
164
  • `Optional` **slot**: `string`
146
165
 
166
+ A slot to attach to
167
+
147
168
  #### Defined in
148
169
 
149
170
  [packages/framework/esm-globals/src/types.ts:127](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/types.ts#L127)
@@ -154,6 +175,8 @@ ___
154
175
 
155
176
  • `Optional` **slots**: `string`[]
156
177
 
178
+ Slots to attach to
179
+
157
180
  #### Defined in
158
181
 
159
182
  [packages/framework/esm-globals/src/types.ts:129](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/types.ts#L129)
@@ -164,6 +187,8 @@ ___
164
187
 
165
188
  ▸ **load**(): `Promise`<`any`\>
166
189
 
190
+ Defines a function to use for actually loading the component's lifecycle.
191
+
167
192
  #### Returns
168
193
 
169
194
  `Promise`<`any`\>
@@ -20,6 +20,8 @@
20
20
 
21
21
  • `Optional` **extensionSlotName**: `string`
22
22
 
23
+ **`deprecated`** Use `name`
24
+
23
25
  #### Defined in
24
26
 
25
27
  [packages/framework/esm-react-utils/src/ExtensionSlot.tsx:10](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/ExtensionSlot.tsx#L10)
@@ -16,6 +16,8 @@
16
16
 
17
17
  • `Optional` **add**: `string`[]
18
18
 
19
+ Additional extension IDs to assign to this slot, in addition to those `attach`ed in code.
20
+
19
21
  #### Defined in
20
22
 
21
23
  [packages/framework/esm-config/src/types.ts:58](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-config/src/types.ts#L58)
@@ -26,6 +28,8 @@ ___
26
28
 
27
29
  • `Optional` **order**: `string`[]
28
30
 
31
+ Overrides the default ordering of extensions.
32
+
29
33
  #### Defined in
30
34
 
31
35
  [packages/framework/esm-config/src/types.ts:62](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-config/src/types.ts#L62)
@@ -36,6 +40,8 @@ ___
36
40
 
37
41
  • `Optional` **remove**: `string`[]
38
42
 
43
+ Extension IDs which were `attach`ed to the slot but which should not be assigned.
44
+
39
45
  #### Defined in
40
46
 
41
47
  [packages/framework/esm-config/src/types.ts:60](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-config/src/types.ts#L60)
@@ -2,6 +2,8 @@
2
2
 
3
3
  # Interface: FHIRRequestObj
4
4
 
5
+ **`deprecated`**
6
+
5
7
  ## Table of contents
6
8
 
7
9
  ### API Properties
@@ -2,6 +2,8 @@
2
2
 
3
3
  # Interface: FHIRRequestOptions
4
4
 
5
+ **`deprecated`**
6
+
5
7
  ## Table of contents
6
8
 
7
9
  ### API Properties
@@ -2,6 +2,8 @@
2
2
 
3
3
  # Interface: OfflinePatientArgs
4
4
 
5
+ **`deprecated`** Will be removed once all modules have been migrated to the new dynamic offline data API.
6
+
5
7
  ## Table of contents
6
8
 
7
9
  ### Offline Properties
@@ -2,6 +2,8 @@
2
2
 
3
3
  # Interface: OfflinePatientDataSyncHandler
4
4
 
5
+ **`deprecated`** Will be removed once all modules have been migrated to the new dynamic offline data API.
6
+
5
7
  ## Table of contents
6
8
 
7
9
  ### Offline Properties
@@ -2,6 +2,8 @@
2
2
 
3
3
  # Interface: OfflinePatientDataSyncState
4
4
 
5
+ **`deprecated`** Will be removed once all modules have been migrated to the new dynamic offline data API.
6
+
5
7
  ## Table of contents
6
8
 
7
9
  ### Offline Properties
@@ -2,6 +2,8 @@
2
2
 
3
3
  # Interface: OfflinePatientDataSyncStore
4
4
 
5
+ **`deprecated`** Will be removed once all modules have been migrated to the new dynamic offline data API.
6
+
5
7
  ## Table of contents
6
8
 
7
9
  ### Offline Properties
@@ -20,6 +20,8 @@
20
20
 
21
21
  • **extensionSlotName**: `string`
22
22
 
23
+ **`deprecated`** Use `name`
24
+
23
25
  #### Defined in
24
26
 
25
27
  [packages/framework/esm-react-utils/src/ExtensionSlot.tsx:18](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/ExtensionSlot.tsx#L18)
@@ -30,6 +30,8 @@
30
30
 
31
31
  • **appName**: `string`
32
32
 
33
+ The module/app that defines the component
34
+
33
35
  #### Inherited from
34
36
 
35
37
  [ComponentDefinition](ComponentDefinition.md).[appName](ComponentDefinition.md#appname)
@@ -44,6 +46,8 @@ ___
44
46
 
45
47
  • `Optional` **offline**: `boolean` \| `object`
46
48
 
49
+ Defines the offline support / properties of the component.
50
+
47
51
  #### Inherited from
48
52
 
49
53
  [ComponentDefinition](ComponentDefinition.md).[offline](ComponentDefinition.md#offline)
@@ -58,6 +62,8 @@ ___
58
62
 
59
63
  • `Optional` **online**: `boolean` \| `object`
60
64
 
65
+ Defines the online support / properties of the component.
66
+
61
67
  #### Inherited from
62
68
 
63
69
  [ComponentDefinition](ComponentDefinition.md).[online](ComponentDefinition.md#online)
@@ -72,6 +78,8 @@ ___
72
78
 
73
79
  • **order**: `number`
74
80
 
81
+ The order in which to load the page. This determines DOM order.
82
+
75
83
  #### Defined in
76
84
 
77
85
  [packages/framework/esm-globals/src/types.ts:146](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/types.ts#L146)
@@ -82,6 +90,9 @@ ___
82
90
 
83
91
  • `Optional` **privilege**: `string` \| `string`[]
84
92
 
93
+ Defines the access privilege(s) required for this component, if any.
94
+ If more than one privilege is provided, the user must have all specified permissions.
95
+
85
96
  #### Inherited from
86
97
 
87
98
  [ComponentDefinition](ComponentDefinition.md).[privilege](ComponentDefinition.md#privilege)
@@ -96,6 +107,8 @@ ___
96
107
 
97
108
  • `Optional` **resources**: `Record`<`string`, [`ResourceLoader`](ResourceLoader.md)<`any`\>\>
98
109
 
110
+ Defines resources that are loaded when the component should mount.
111
+
99
112
  #### Inherited from
100
113
 
101
114
  [ComponentDefinition](ComponentDefinition.md).[resources](ComponentDefinition.md#resources)
@@ -110,6 +123,8 @@ ___
110
123
 
111
124
  • **route**: `string`
112
125
 
126
+ The route of the page.
127
+
113
128
  #### Defined in
114
129
 
115
130
  [packages/framework/esm-globals/src/types.ts:142](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/types.ts#L142)
@@ -120,6 +135,8 @@ ___
120
135
 
121
136
  ▸ **load**(): `Promise`<`any`\>
122
137
 
138
+ Defines a function to use for actually loading the component's lifecycle.
139
+
123
140
  #### Returns
124
141
 
125
142
  `Promise`<`any`\>
@@ -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
  ### Offline Properties
@@ -2,6 +2,8 @@
2
2
 
3
3
  # Interface: RetryOptions
4
4
 
5
+ Options for configuring the behavior of the [retry](../API.md#retry) function.
6
+
5
7
  ## Table of contents
6
8
 
7
9
  ### Methods
@@ -16,11 +18,14 @@
16
18
 
17
19
  ▸ `Optional` **getDelay**(`attempt`): `number`
18
20
 
21
+ Calculates the next delay (in milliseconds) before a retry attempt.
22
+ Returning a value for the inital attempt (`0`) delays the initial function invocation.
23
+
19
24
  #### Parameters
20
25
 
21
26
  | Name | Type | Description |
22
27
  | :------ | :------ | :------ |
23
- | `attempt` | `number` | |
28
+ | `attempt` | `number` | The current (zero-based) retry attempt. `0` indicates the initial attempt. |
24
29
 
25
30
  #### Returns
26
31
 
@@ -36,12 +41,15 @@ ___
36
41
 
37
42
  ▸ `Optional` **onError**(`e`, `attempt`): `void`
38
43
 
44
+ Called when invoking the function resulted in an error.
45
+ Allows running side-effects on errors, e.g. logging.
46
+
39
47
  #### Parameters
40
48
 
41
49
  | Name | Type | Description |
42
50
  | :------ | :------ | :------ |
43
- | `e` | `any` | |
44
- | `attempt` | `number` | |
51
+ | `e` | `any` | The error thrown by the function. |
52
+ | `attempt` | `number` | The current (zero-based) retry attempt. `0` indicates the initial attempt. |
45
53
 
46
54
  #### Returns
47
55
 
@@ -57,11 +65,14 @@ ___
57
65
 
58
66
  ▸ `Optional` **shouldRetry**(`attempt`): `any`
59
67
 
68
+ Determines whether the retry function should retry executing the function after it failed
69
+ with an error on the current attempt.
70
+
60
71
  #### Parameters
61
72
 
62
73
  | Name | Type | Description |
63
74
  | :------ | :------ | :------ |
64
- | `attempt` | `number` | |
75
+ | `attempt` | `number` | The current (zero-based) retry attempt. `0` indicates the initial attempt. |
65
76
 
66
77
  #### Returns
67
78
 
@@ -18,6 +18,8 @@
18
18
 
19
19
  • **apiUrl**: `string`
20
20
 
21
+ The base path or URL for the OpenMRS API / endpoints.
22
+
21
23
  #### Defined in
22
24
 
23
25
  [packages/framework/esm-globals/src/types.ts:70](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/types.ts#L70)
@@ -28,6 +30,8 @@ ___
28
30
 
29
31
  • `Optional` **configUrls**: `string`[]
30
32
 
33
+ URLs of configurations to load in the system.
34
+
31
35
  #### Defined in
32
36
 
33
37
  [packages/framework/esm-globals/src/types.ts:83](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/types.ts#L83)
@@ -38,6 +42,10 @@ ___
38
42
 
39
43
  • `Optional` **env**: [`SpaEnvironment`](../API.md#spaenvironment)
40
44
 
45
+ The environment to use.
46
+
47
+ **`default`** production
48
+
41
49
  #### Defined in
42
50
 
43
51
  [packages/framework/esm-globals/src/types.ts:79](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/types.ts#L79)
@@ -48,6 +56,10 @@ ___
48
56
 
49
57
  • `Optional` **offline**: `boolean`
50
58
 
59
+ Defines if offline should be supported by installing a service worker.
60
+
61
+ **`default`** true
62
+
51
63
  #### Defined in
52
64
 
53
65
  [packages/framework/esm-globals/src/types.ts:88](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/types.ts#L88)
@@ -58,6 +70,8 @@ ___
58
70
 
59
71
  • **spaPath**: `string`
60
72
 
73
+ The base path for the SPA root path.
74
+
61
75
  #### Defined in
62
76
 
63
77
  [packages/framework/esm-globals/src/types.ts:74](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/types.ts#L74)
@@ -2,6 +2,10 @@
2
2
 
3
3
  # Interface: SyncItem<T\>
4
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
+
5
9
  ## Type parameters
6
10
 
7
11
  | Name | Type |
@@ -2,6 +2,8 @@
2
2
 
3
3
  # Interface: SyncProcessOptions<T\>
4
4
 
5
+ Additional data which can be used for synchronizing data in a {@link ProcessSyncItem} function.
6
+
5
7
  ## Type parameters
6
8
 
7
9
  | Name |
package/mock.tsx CHANGED
@@ -53,10 +53,13 @@ export function getCurrentUser() {
53
53
  return of({ authenticated: false });
54
54
  }
55
55
 
56
- export const mockSessionStore = createGlobalStore<SessionStore>("mock-session-store", {
57
- loaded: false,
58
- session: null,
59
- });
56
+ export const mockSessionStore = createGlobalStore<SessionStore>(
57
+ "mock-session-store",
58
+ {
59
+ loaded: false,
60
+ session: null,
61
+ }
62
+ );
60
63
 
61
64
  export const getSessionStore = jest.fn(() => mockSessionStore);
62
65
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-framework",
3
- "version": "4.0.1-pre.224",
3
+ "version": "4.0.1-pre.232",
4
4
  "license": "MPL-2.0",
5
5
  "browser": "dist/openmrs-esm-framework.js",
6
6
  "main": "src/index.ts",
@@ -35,18 +35,18 @@
35
35
  "access": "public"
36
36
  },
37
37
  "dependencies": {
38
- "@openmrs/esm-api": "^4.0.1-pre.224",
39
- "@openmrs/esm-breadcrumbs": "^4.0.1-pre.224",
40
- "@openmrs/esm-config": "^4.0.1-pre.224",
41
- "@openmrs/esm-error-handling": "^4.0.1-pre.224",
42
- "@openmrs/esm-extensions": "^4.0.1-pre.224",
43
- "@openmrs/esm-globals": "^4.0.1-pre.224",
44
- "@openmrs/esm-offline": "^4.0.1-pre.224",
45
- "@openmrs/esm-react-utils": "^4.0.1-pre.224",
46
- "@openmrs/esm-state": "^4.0.1-pre.224",
47
- "@openmrs/esm-styleguide": "^4.0.1-pre.224",
48
- "@openmrs/esm-utils": "^4.0.1-pre.224",
38
+ "@openmrs/esm-api": "^4.0.1-pre.232",
39
+ "@openmrs/esm-breadcrumbs": "^4.0.1-pre.232",
40
+ "@openmrs/esm-config": "^4.0.1-pre.232",
41
+ "@openmrs/esm-error-handling": "^4.0.1-pre.232",
42
+ "@openmrs/esm-extensions": "^4.0.1-pre.232",
43
+ "@openmrs/esm-globals": "^4.0.1-pre.232",
44
+ "@openmrs/esm-offline": "^4.0.1-pre.232",
45
+ "@openmrs/esm-react-utils": "^4.0.1-pre.232",
46
+ "@openmrs/esm-state": "^4.0.1-pre.232",
47
+ "@openmrs/esm-styleguide": "^4.0.1-pre.232",
48
+ "@openmrs/esm-utils": "^4.0.1-pre.232",
49
49
  "dayjs": "^1.10.7"
50
50
  },
51
- "gitHead": "7550cc37d76a576c84b553a1eac0400afe06eac9"
51
+ "gitHead": "e88075df046134996990f4bb06fb3e26f37a9d04"
52
52
  }