@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 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
@@ -5375,7 +5375,7 @@ const logsService = (httpWithAuth) => {
5375
5375
  };
5376
5376
  };
5377
5377
 
5378
- const version = '8.5.0-dev-71-b217382';
5378
+ const version = '8.5.0-dev-73-2ae1c71';
5379
5379
 
5380
5380
  /**
5381
5381
  * Create ExtraHorizon client.
package/build/index.mjs CHANGED
@@ -5345,7 +5345,7 @@ const logsService = (httpWithAuth) => {
5345
5345
  };
5346
5346
  };
5347
5347
 
5348
- const version = '8.5.0-dev-71-b217382';
5348
+ const version = '8.5.0-dev-73-2ae1c71';
5349
5349
 
5350
5350
  /**
5351
5351
  * Create ExtraHorizon client.
@@ -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 = 'default' | 'permissionRequired';
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 = 'allUsers' | 'default' | 'enlistedInLinkedGroups';
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 = 'default' | 'creatorOnly' | 'disabled' | 'linkedGroupsStaffOnly';
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' | 'linkedUsersOnly';
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
  *
@@ -1 +1 @@
1
- export declare const version = "8.5.0-dev-71-b217382";
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-71-b217382",
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",