@extrahorizon/javascript-sdk 8.5.0-dev-71-b217382 → 8.5.0-dev-73-2ae1c71
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/CHANGELOG.md +4 -0
- package/build/index.cjs.js +1 -1
- package/build/index.mjs +1 -1
- package/build/types/services/data/types.d.ts +39 -8
- package/build/types/version.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -17,11 +17,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
17
17
|
- Added `TransitionActionTask` to the `AfterActions`
|
|
18
18
|
- Added `TRANSITION_DOCUMENTS` permission to the `GlobalPermissionName` enum
|
|
19
19
|
- Added `TRANSITION_DOCUMENTS` permission to the documentation of the transition document function
|
|
20
|
+
- Added a `name` field to the `exh.data.documents.transition` body, allowing a transition to be triggered by its name rather then its id
|
|
20
21
|
|
|
21
22
|
### Changed
|
|
22
23
|
- RQL `contains` and `excludes` now have their different variations better separated in the type definitions
|
|
23
24
|
- `exh.data.documents.unlinkUsers` and `unlinkGroups` now also accept an array of user or group ids directly rather than nested in a request body object
|
|
24
25
|
- Thanks to `tran-simon` for the pointing out the initially incorrect `unlinkUsers` type definition!
|
|
26
|
+
- Data service schemas `createMode`, `readMode`, `updateMode` and `deleteMode` accepted values updated
|
|
27
|
+
- Matching the access mode changes in Data Service 1.4.0
|
|
28
|
+
- `readMode`, `updateMode` and `deleteMode` now also accept an array of relational modes
|
|
25
29
|
|
|
26
30
|
### Deprecated
|
|
27
31
|
- `exh.data.documents.unlinkUsers` usage with an object is deprecated in favor of an array of ids directly or `unlinkAllUsers` for unlinking all users
|
package/build/index.cjs.js
CHANGED
package/build/index.mjs
CHANGED
|
@@ -35,22 +35,39 @@ export declare type JSONSchemaBoolean = {
|
|
|
35
35
|
enum: boolean[];
|
|
36
36
|
const: boolean;
|
|
37
37
|
};
|
|
38
|
+
export declare type RelationalAccessMode = 'creator' | 'linkedUsers' | 'linkedGroupStaff' | 'linkedGroupPatients';
|
|
38
39
|
/**
|
|
39
40
|
* Specifies the conditions to be met in order to be able to create a document for a schema
|
|
40
41
|
*/
|
|
41
|
-
export declare type CreateMode = '
|
|
42
|
+
export declare type CreateMode = 'permissionRequired' | 'allUsers'
|
|
43
|
+
/** @deprecated use 'allUsers' instead */
|
|
44
|
+
| 'default';
|
|
42
45
|
/**
|
|
43
46
|
* Specifies the conditions to be met in order to be able to view a document for a schema
|
|
44
47
|
*/
|
|
45
|
-
export declare type ReadMode = '
|
|
48
|
+
export declare type ReadMode = 'permissionRequired' | 'allUsers' | Array<RelationalAccessMode>
|
|
49
|
+
/** @deprecated use ['linkedUsers', 'linkedGroupStaff'] instead */
|
|
50
|
+
| 'default'
|
|
51
|
+
/** @deprecated use ['linkedGroupPatients', 'linkedGroupStaff'] instead */
|
|
52
|
+
| 'enlistedInLinkedGroups';
|
|
46
53
|
/**
|
|
47
54
|
* Specifies the conditions to be met in order to be able to update a document for a schema
|
|
48
55
|
*/
|
|
49
|
-
export declare type UpdateMode = '
|
|
56
|
+
export declare type UpdateMode = 'permissionRequired' | Array<RelationalAccessMode>
|
|
57
|
+
/** @deprecated use ['linkedUsers', 'linkedGroupStaff'] instead */
|
|
58
|
+
| 'default'
|
|
59
|
+
/** @deprecated use ['creator'] instead */
|
|
60
|
+
| 'creatorOnly'
|
|
61
|
+
/** @deprecated use 'permissionRequired' instead */
|
|
62
|
+
| 'disabled'
|
|
63
|
+
/** @deprecated use ['linkedGroupStaff'] instead */
|
|
64
|
+
| 'linkedGroupsStaffOnly';
|
|
50
65
|
/**
|
|
51
66
|
* Specifies the conditions to be met in order to be able to delete a document for a schema
|
|
52
67
|
*/
|
|
53
|
-
export declare type DeleteMode = 'permissionRequired' |
|
|
68
|
+
export declare type DeleteMode = 'permissionRequired' | Array<RelationalAccessMode>
|
|
69
|
+
/** @deprecated use ['linkedUsers','linkedGroupStaff'] instead */
|
|
70
|
+
| 'linkedUsersOnly';
|
|
54
71
|
export declare type GroupSyncMode = 'disabled' | 'creatorPatientEnlistments' | 'linkedUsersPatientEnlistments';
|
|
55
72
|
interface BaseConfiguration {
|
|
56
73
|
queryable?: boolean;
|
|
@@ -236,6 +253,15 @@ export interface Index {
|
|
|
236
253
|
system?: boolean;
|
|
237
254
|
}
|
|
238
255
|
export declare type IndexInput = Pick<Index, 'fields' | 'options'>;
|
|
256
|
+
export declare type TransitionDocumentInput = {
|
|
257
|
+
id: ObjectId;
|
|
258
|
+
name?: string;
|
|
259
|
+
data?: Record<string, unknown>;
|
|
260
|
+
} | {
|
|
261
|
+
id?: ObjectId;
|
|
262
|
+
name: string;
|
|
263
|
+
data?: Record<string, unknown>;
|
|
264
|
+
};
|
|
239
265
|
export interface Document<CustomData = null, CustomStatus = null> {
|
|
240
266
|
id: ObjectId;
|
|
241
267
|
userIds: ObjectId[];
|
|
@@ -538,6 +564,14 @@ export interface DataDocumentsService {
|
|
|
538
564
|
*
|
|
539
565
|
* Start a transition manually for the selected document where the conditions of a manual transition are met.
|
|
540
566
|
*
|
|
567
|
+
* Either the `id` or the `name` of a transition must be provided.
|
|
568
|
+
* If both are provided, they must match the same transition, otherwise a `ResourceUnknownError` will be thrown.
|
|
569
|
+
*
|
|
570
|
+
* If `name` is provided, multiple transitions could match.
|
|
571
|
+
* In this case, the first matching transition will be triggered:
|
|
572
|
+
* - The first transition with a `fromStatuses` matching the current status of the document
|
|
573
|
+
* - And all the transition its `conditions` are met
|
|
574
|
+
*
|
|
541
575
|
* Permission | Scope | Effect
|
|
542
576
|
* - | - | -
|
|
543
577
|
* none | | Update your own documents
|
|
@@ -553,10 +587,7 @@ export interface DataDocumentsService {
|
|
|
553
587
|
* @throws {IllegalArgumentError}
|
|
554
588
|
* @throws {ResourceUnknownError}
|
|
555
589
|
*/
|
|
556
|
-
transition(schemaIdOrName: ObjectId | string, documentId: ObjectId, requestBody:
|
|
557
|
-
id: ObjectId;
|
|
558
|
-
data?: Record<string, any>;
|
|
559
|
-
}, options?: OptionsWithRql): Promise<AffectedRecords>;
|
|
590
|
+
transition(schemaIdOrName: ObjectId | string, documentId: ObjectId, requestBody: TransitionDocumentInput, options?: OptionsWithRql): Promise<AffectedRecords>;
|
|
560
591
|
/**
|
|
561
592
|
* Link groups to a document
|
|
562
593
|
*
|
package/build/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "8.5.0-dev-
|
|
1
|
+
export declare const version = "8.5.0-dev-73-2ae1c71";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@extrahorizon/javascript-sdk",
|
|
3
|
-
"version": "8.5.0-dev-
|
|
3
|
+
"version": "8.5.0-dev-73-2ae1c71",
|
|
4
4
|
"description": "This package serves as a JavaScript wrapper around all Extra Horizon cloud services.",
|
|
5
5
|
"main": "build/index.cjs.js",
|
|
6
6
|
"types": "build/types/index.d.ts",
|