@extrahorizon/javascript-sdk 8.4.1 → 8.5.0-dev-72-f6603f3

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
@@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [8.5.0]
9
+
10
+ ### Fixed
11
+ - Corrected `functioName` field to `functionName` in the `TransitionActionTask` type
12
+ - `exh.templates.findFirst`, `findById` and `findByName` now correctly state `undefined` can be returned
13
+
14
+ ### Added
15
+ - Added `exh.data.documents.unlinkAllUsers` and `unlinkAllGroups` methods to unlink all users or groups from a document
16
+ - Added `priority` field to the `TransitionActionTask` type
17
+ - Added `TransitionActionTask` to the `AfterActions`
18
+ - Added `TRANSITION_DOCUMENTS` permission to the `GlobalPermissionName` enum
19
+ - Added `TRANSITION_DOCUMENTS` permission to the documentation of the transition document function
20
+
21
+ ### Changed
22
+ - RQL `contains` and `excludes` now have their different variations better separated in the type definitions
23
+ - `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
+ - Thanks to `tran-simon` for the pointing out the initially incorrect `unlinkUsers` type definition!
25
+ - Data service schemas `createMode`, `readMode`, `updateMode` and `deleteMode` accepted values updated
26
+ - Matching the access mode changes in Data Service 1.4.0
27
+ - `readMode`, `updateMode` and `deleteMode` now also accept an array of relational modes
28
+
29
+ ### Deprecated
30
+ - `exh.data.documents.unlinkUsers` usage with an object is deprecated in favor of an array of ids directly or `unlinkAllUsers` for unlinking all users
31
+ - `exh.data.documents.unlinkGroups` usage with an object is deprecated in favor of an array of ids directly or `unlinkAllGroups` for unlinking all groups
32
+
8
33
  ## [8.4.1]
9
34
 
10
35
  ### Fixed
@@ -1070,6 +1070,7 @@ exports.GlobalPermissionName = void 0;
1070
1070
  GlobalPermissionName["SEND_MAILS"] = "SEND_MAILS";
1071
1071
  GlobalPermissionName["SYNC_PROFILE_GROUPS"] = "SYNC_PROFILE_GROUPS";
1072
1072
  GlobalPermissionName["TRANSFER_PERIOD"] = "TRANSFER_PERIOD";
1073
+ GlobalPermissionName["TRANSITION_DOCUMENTS"] = "TRANSITION_DOCUMENTS";
1073
1074
  GlobalPermissionName["TRIGGER_APP_STORE_SUBSCRIPTION_REEVALUATION"] = "TRIGGER_APP_STORE_SUBSCRIPTION_REEVALUATION";
1074
1075
  GlobalPermissionName["TRIGGER_PLAY_STORE_SUBSCRIPTION_REEVALUATION"] = "TRIGGER_PLAY_STORE_SUBSCRIPTION_REEVALUATION";
1075
1076
  GlobalPermissionName["UNLINK_USER_FROM_OIDC"] = "UNLINK_USER_FROM_OIDC";
@@ -1207,8 +1208,6 @@ exports.GlobalPermissionName = void 0;
1207
1208
  /** @deprecated Not in use any longer */
1208
1209
  GlobalPermissionName["MANAGE_SERVICE_ALERTS"] = "MANAGE_SERVICE_ALERTS";
1209
1210
  /** @deprecated Not in use any longer */
1210
- GlobalPermissionName["TRANSITION_DOCUMENTS"] = "TRANSITION_DOCUMENTS";
1211
- /** @deprecated Not in use any longer */
1212
1211
  GlobalPermissionName["VIEW_AWS_SES_STATISTICS"] = "VIEW_AWS_SES_STATISTICS";
1213
1212
  /** @deprecated Not in use any longer */
1214
1213
  GlobalPermissionName["CREATE_USER_PERIODS"] = "CREATE_USER_PERIODS";
@@ -3603,15 +3602,23 @@ var documents = (client, httpAuth) => {
3603
3602
  async linkGroups(schemaIdOrName, documentId, requestBody, options) {
3604
3603
  return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/linkGroups`, requestBody, options)).data;
3605
3604
  },
3606
- async unlinkGroups(schemaIdOrName, documentId, requestBody, options) {
3605
+ async unlinkGroups(schemaIdOrName, documentId, data, options) {
3606
+ const requestBody = Array.isArray(data) ? { groupIds: data } : data;
3607
3607
  return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/unlinkGroups`, requestBody, options)).data;
3608
3608
  },
3609
+ async unlinkAllGroups(schemaIdOrName, documentId, options) {
3610
+ return await this.unlinkGroups(schemaIdOrName, documentId, {}, options); // Empty object to remove all groups
3611
+ },
3609
3612
  async linkUsers(schemaIdOrName, documentId, requestBody, options) {
3610
3613
  return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/linkUsers`, requestBody, options)).data;
3611
3614
  },
3612
- async unlinkUsers(schemaIdOrName, documentId, requestBody, options) {
3615
+ async unlinkUsers(schemaIdOrName, documentId, data, options) {
3616
+ const requestBody = Array.isArray(data) ? { userIds: data } : data;
3613
3617
  return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/unlinkUsers`, requestBody, options)).data;
3614
3618
  },
3619
+ async unlinkAllUsers(schemaIdOrName, documentId, options) {
3620
+ return await this.unlinkUsers(schemaIdOrName, documentId, {}, options); // Empty object to remove all users
3621
+ },
3615
3622
  };
3616
3623
  };
3617
3624
 
@@ -5368,7 +5375,7 @@ const logsService = (httpWithAuth) => {
5368
5375
  };
5369
5376
  };
5370
5377
 
5371
- const version = '8.4.1';
5378
+ const version = '8.5.0-dev-72-f6603f3';
5372
5379
 
5373
5380
  /**
5374
5381
  * Create ExtraHorizon client.
package/build/index.mjs CHANGED
@@ -1040,6 +1040,7 @@ var GlobalPermissionName;
1040
1040
  GlobalPermissionName["SEND_MAILS"] = "SEND_MAILS";
1041
1041
  GlobalPermissionName["SYNC_PROFILE_GROUPS"] = "SYNC_PROFILE_GROUPS";
1042
1042
  GlobalPermissionName["TRANSFER_PERIOD"] = "TRANSFER_PERIOD";
1043
+ GlobalPermissionName["TRANSITION_DOCUMENTS"] = "TRANSITION_DOCUMENTS";
1043
1044
  GlobalPermissionName["TRIGGER_APP_STORE_SUBSCRIPTION_REEVALUATION"] = "TRIGGER_APP_STORE_SUBSCRIPTION_REEVALUATION";
1044
1045
  GlobalPermissionName["TRIGGER_PLAY_STORE_SUBSCRIPTION_REEVALUATION"] = "TRIGGER_PLAY_STORE_SUBSCRIPTION_REEVALUATION";
1045
1046
  GlobalPermissionName["UNLINK_USER_FROM_OIDC"] = "UNLINK_USER_FROM_OIDC";
@@ -1177,8 +1178,6 @@ var GlobalPermissionName;
1177
1178
  /** @deprecated Not in use any longer */
1178
1179
  GlobalPermissionName["MANAGE_SERVICE_ALERTS"] = "MANAGE_SERVICE_ALERTS";
1179
1180
  /** @deprecated Not in use any longer */
1180
- GlobalPermissionName["TRANSITION_DOCUMENTS"] = "TRANSITION_DOCUMENTS";
1181
- /** @deprecated Not in use any longer */
1182
1181
  GlobalPermissionName["VIEW_AWS_SES_STATISTICS"] = "VIEW_AWS_SES_STATISTICS";
1183
1182
  /** @deprecated Not in use any longer */
1184
1183
  GlobalPermissionName["CREATE_USER_PERIODS"] = "CREATE_USER_PERIODS";
@@ -3573,15 +3572,23 @@ var documents = (client, httpAuth) => {
3573
3572
  async linkGroups(schemaIdOrName, documentId, requestBody, options) {
3574
3573
  return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/linkGroups`, requestBody, options)).data;
3575
3574
  },
3576
- async unlinkGroups(schemaIdOrName, documentId, requestBody, options) {
3575
+ async unlinkGroups(schemaIdOrName, documentId, data, options) {
3576
+ const requestBody = Array.isArray(data) ? { groupIds: data } : data;
3577
3577
  return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/unlinkGroups`, requestBody, options)).data;
3578
3578
  },
3579
+ async unlinkAllGroups(schemaIdOrName, documentId, options) {
3580
+ return await this.unlinkGroups(schemaIdOrName, documentId, {}, options); // Empty object to remove all groups
3581
+ },
3579
3582
  async linkUsers(schemaIdOrName, documentId, requestBody, options) {
3580
3583
  return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/linkUsers`, requestBody, options)).data;
3581
3584
  },
3582
- async unlinkUsers(schemaIdOrName, documentId, requestBody, options) {
3585
+ async unlinkUsers(schemaIdOrName, documentId, data, options) {
3586
+ const requestBody = Array.isArray(data) ? { userIds: data } : data;
3583
3587
  return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/unlinkUsers`, requestBody, options)).data;
3584
3588
  },
3589
+ async unlinkAllUsers(schemaIdOrName, documentId, options) {
3590
+ return await this.unlinkUsers(schemaIdOrName, documentId, {}, options); // Empty object to remove all users
3591
+ },
3585
3592
  };
3586
3593
  };
3587
3594
 
@@ -5338,7 +5345,7 @@ const logsService = (httpWithAuth) => {
5338
5345
  };
5339
5346
  };
5340
5347
 
5341
- const version = '8.4.1';
5348
+ const version = '8.5.0-dev-72-f6603f3';
5342
5349
 
5343
5350
  /**
5344
5351
  * Create ExtraHorizon client.
@@ -132,8 +132,10 @@ export declare type MockClientOAuth1<MockFn> = {
132
132
  transition: MockFn;
133
133
  linkGroups: MockFn;
134
134
  unlinkGroups: MockFn;
135
+ unlinkAllGroups: MockFn;
135
136
  linkUsers: MockFn;
136
137
  unlinkUsers: MockFn;
138
+ unlinkAllUsers: MockFn;
137
139
  };
138
140
  transitions: {
139
141
  updateCreation: MockFn;
@@ -661,8 +663,10 @@ export declare type MockClientOAuth2<MockFn> = {
661
663
  transition: MockFn;
662
664
  linkGroups: MockFn;
663
665
  unlinkGroups: MockFn;
666
+ unlinkAllGroups: MockFn;
664
667
  linkUsers: MockFn;
665
668
  unlinkUsers: MockFn;
669
+ unlinkAllUsers: MockFn;
666
670
  };
667
671
  transitions: {
668
672
  updateCreation: MockFn;
@@ -1190,8 +1194,10 @@ export declare type MockClientProxy<MockFn> = {
1190
1194
  transition: MockFn;
1191
1195
  linkGroups: MockFn;
1192
1196
  unlinkGroups: MockFn;
1197
+ unlinkAllGroups: MockFn;
1193
1198
  linkUsers: MockFn;
1194
1199
  unlinkUsers: MockFn;
1200
+ unlinkAllUsers: MockFn;
1195
1201
  };
1196
1202
  transitions: {
1197
1203
  updateCreation: MockFn;
@@ -95,14 +95,15 @@ export interface RQLBuilder {
95
95
  */
96
96
  or: (...conditions: RQLString[]) => RQLBuilder;
97
97
  /**
98
- * @description `contains(field)` only returns records having this field as property
98
+ * @description Only returns records having this field as property
99
99
  * @example
100
- * await exh.data.documents.find(
101
- * schemaId,
102
- * { rql: rqlBuilder().contains('data.indicator').build()
100
+ * await exh.data.documents.find(schemaId, {
101
+ * rql: rqlBuilder().contains('data.indicator').build()
103
102
  * });
104
103
  * @returns returns documents containing the `data.indicator` field
105
- *
104
+ */
105
+ contains(field: string): RQLBuilder;
106
+ /**
106
107
  * @description Filters for objects where the specified property's value is an array and the array contains
107
108
  * any value that equals the provided value or satisfies the provided condition.
108
109
  * `contains(field, itemField > 30)` only returns records having a property `field` which have a prop `itemField` for which the condition is valid
@@ -113,34 +114,39 @@ export interface RQLBuilder {
113
114
  * .contains(
114
115
  * "data",
115
116
  * rqlBuilder().gt("heartrate", "60").intermediate(),
116
- * rqlBuilder().lt("heartrate", "90").intermediate()
117
+ * rqlBuilder().lt("heartrate", "90").intermediate()
117
118
  * )
118
- * .build();
119
+ * .build(),
119
120
  * });
120
121
  * @return Only returns documents with a data object containing `heartrate > 60` and `heartrate > 90`
121
122
  */
122
- contains: (field: string, ...conditions: RQLString[]) => RQLBuilder;
123
+ contains(field: string, ...conditions: RQLString[]): RQLBuilder;
123
124
  /**
124
- * @description `excludes(field)` only returns records not having this field as property
125
+ * @description Only returns records not having this field as property
125
126
  * @example
126
- * await exh.data.documents.find(
127
- * schemaId,
128
- * { rql: rqlBuilder().excludes('data.indicator').build()
127
+ * await exh.data.documents.find(schemaId, {
128
+ * rql: rqlBuilder().excludes('data.indicator').build()
129
129
  * });
130
130
  * @returns returns documents not containing the `data.indicator` field
131
- *
131
+ */
132
+ excludes(field: string): RQLBuilder;
133
+ /**
132
134
  * @description Filters for objects where the specified property's value is an array and the array excludes
133
135
  * any value that equals the provided value or satisfies the provided condition.
134
136
  * `excludes(field, itemField > 30)` only returns records having a property `field` which have a prop `itemField` for which the condition is invalid
135
137
  * @example
136
138
  * await exh.data.documents.find(schemaId, {
137
139
  * rql: rqlBuilder()
138
- * .excludes("data", rqlBuilder().gt("heartrate", "60").intermediate())
139
- * .build(),
140
+ * .excludes(
141
+ * "data",
142
+ * rqlBuilder().gt("heartrate", "60").intermediate(),
143
+ * rqlBuilder().lt("heartrate", "90").intermediate()
144
+ * )
145
+ * .build(),
140
146
  * });
141
- * @return Only returns documents excluding documents where `data.heartrate > 60`
147
+ * @return Only returns documents excluding documents where `heartrate > 60` and `heartrate > 90`
142
148
  */
143
- excludes: (field: string, ...conditions: RQLString[]) => RQLBuilder;
149
+ excludes(field: string, ...conditions: RQLString[]): RQLBuilder;
144
150
  /**
145
151
  * @description skipCount() Skips the record counting step of a request to increase performance.
146
152
  *
@@ -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;
@@ -133,7 +150,8 @@ export interface TransitionActionRemoveItems {
133
150
  }
134
151
  export interface TransitionActionTask {
135
152
  type: 'task';
136
- functioName: string;
153
+ functionName: string;
154
+ priority?: number;
137
155
  data: Record<string, unknown>;
138
156
  }
139
157
  export interface TransitionActionLinkCreator {
@@ -155,15 +173,22 @@ export interface TransitionActionDelay {
155
173
  type: 'delay';
156
174
  time: number;
157
175
  }
176
+ /**
177
+ * @deprecated Legacy action, should not be used in new projects
178
+ */
158
179
  export interface TransitionActionMeasurementReviewedNotification {
159
180
  type: 'measurementReviewedNotification';
160
181
  }
161
- export declare type TransitionAction = TransitionActionSet | TransitionActionUnset | TransitionActionAddItems | TransitionActionRemoveItems | TransitionActionTask | TransitionActionLinkCreator | TransitionActionLinkEnlistedGroups | TransitionActionLinkUserFromData | TransitionActionLinkGroupFromData | TransitionActionDelay | TransitionActionMeasurementReviewedNotification;
162
- export interface TransitionAfterAction {
182
+ /**
183
+ * @deprecated Legacy action, the AlgoQueueManager does not exist anymore
184
+ */
185
+ export interface TransitionActionNotifyAlgoQueueManager {
163
186
  type: 'notifyAlgoQueueManager';
164
187
  id: string;
165
188
  version: string;
166
189
  }
190
+ export declare type TransitionAction = TransitionActionSet | TransitionActionUnset | TransitionActionAddItems | TransitionActionRemoveItems | TransitionActionTask | TransitionActionLinkCreator | TransitionActionLinkEnlistedGroups | TransitionActionLinkUserFromData | TransitionActionLinkGroupFromData | TransitionActionDelay | TransitionActionMeasurementReviewedNotification;
191
+ export declare type TransitionAfterAction = TransitionActionNotifyAlgoQueueManager | TransitionActionTask;
167
192
  export interface CreationTransition {
168
193
  toStatus: string;
169
194
  type: CreationTransitionType;
@@ -534,7 +559,10 @@ export interface DataDocumentsService {
534
559
  * - | - | -
535
560
  * none | | Update your own documents
536
561
  * none | `staff enlistment` | Update all the documents belonging to the group
537
- * `UPDATE_DOCUMENTS` | `global` | Update all the documents
562
+ * `UPDATE_DOCUMENTS` | `global` | Transition all the documents
563
+ * `TRANSITION_DOCUMENTS` | `global` | Transition all the documents
564
+ * `TRANSITION_DOCUMENTS:{SCHEMA_NAME}` | `global` | Transition all the documents of the specified schema
565
+ * `TRANSITION_DOCUMENTS:{SCHEMA_NAME}:{TRANSITION_NAME}` | `global` | Transition all the documents of the specified schema with the specified transition name
538
566
  * @param schemaIdOrName The id or name of the targeted schema.
539
567
  * @param documentId The id of the targeted document.
540
568
  * @param requestBody
@@ -563,6 +591,8 @@ export interface DataDocumentsService {
563
591
  groupIds: Array<ObjectId>;
564
592
  }, options?: OptionsBase): Promise<AffectedRecords>;
565
593
  /**
594
+ * @deprecated Use `unlinkGroups(schemaIdOrName, documentId, groupIds)` or `unlinkAllGroups(schemaIdOrName, documentId)` instead.
595
+ *
566
596
  * Unlink groups from a document
567
597
  *
568
598
  * Unlink the specified groups from a document
@@ -582,6 +612,26 @@ export interface DataDocumentsService {
582
612
  unlinkGroups(schemaIdOrName: ObjectId | string, documentId: ObjectId, requestBody: {
583
613
  groupIds?: Array<ObjectId>;
584
614
  }, options?: OptionsBase): Promise<AffectedRecords>;
615
+ /**
616
+ * Unlink groups from a document
617
+ *
618
+ * Unlink the specified groups from a document
619
+ *
620
+ * Specifying an **empty** `groupIds` array will have **no effect** on the document.
621
+ *
622
+ * Permission | Scope | Effect
623
+ * - | - | -
624
+ * `UPDATE_ACCESS_TO_DOCUMENT` | `global` | **Required** for this endpoint
625
+ */
626
+ unlinkGroups(schemaIdOrName: ObjectId | string, documentId: ObjectId, groupIds: Array<ObjectId>, options?: OptionsBase): Promise<AffectedRecords>;
627
+ /**
628
+ * Unlink all groups from a document
629
+ *
630
+ * Permission | Scope | Effect
631
+ * - | - | -
632
+ * `UPDATE_ACCESS_TO_DOCUMENT` | `global` | **Required** for this endpoint
633
+ */
634
+ unlinkAllGroups(schemaIdOrName: ObjectId | string, documentId: ObjectId, options?: OptionsBase): Promise<AffectedRecords>;
585
635
  /**
586
636
  * Link users to a document
587
637
  *
@@ -601,6 +651,8 @@ export interface DataDocumentsService {
601
651
  userIds: Array<ObjectId>;
602
652
  }, options?: OptionsBase): Promise<AffectedRecords>;
603
653
  /**
654
+ * @deprecated Use `unlinkUsers(schemaIdOrName, documentId, userIds)` or `unlinkAllUsers(schemaIdOrName, documentId)` instead.
655
+ *
604
656
  * Unlink users from a document
605
657
  *
606
658
  * Unlink the specified users from a document.
@@ -620,8 +672,32 @@ export interface DataDocumentsService {
620
672
  * @returns AffectedRecords
621
673
  */
622
674
  unlinkUsers(schemaIdOrName: ObjectId | string, documentId: ObjectId, requestBody: {
623
- userIds: Array<ObjectId>;
675
+ userIds?: Array<ObjectId>;
624
676
  }, options?: OptionsBase): Promise<AffectedRecords>;
677
+ /**
678
+ * Unlink users from a document
679
+ *
680
+ * Unlink the specified users from a document.
681
+ *
682
+ * Specifying an **empty** `userIds` array will have **no effect** on the document.
683
+ *
684
+ * Permission | Scope | Effect
685
+ * - | - | -
686
+ * `UPDATE_ACCESS_TO_DOCUMENT` | `global` | **Required** for this endpoint
687
+ *
688
+ * Note: When GroupSyncMode.LINKED_USERS_PATIENT_ENLISTMENT is set for a document, all the groups where the specified user is enlisted as patient will also be removed from the document.
689
+ */
690
+ unlinkUsers(schemaIdOrName: ObjectId | string, documentId: ObjectId, userIds: Array<ObjectId>, options?: OptionsBase): Promise<AffectedRecords>;
691
+ /**
692
+ * Unlink all users from a document
693
+ *
694
+ * Permission | Scope | Effect
695
+ * - | - | -
696
+ * `UPDATE_ACCESS_TO_DOCUMENT` | `global` | **Required** for this endpoint
697
+ *
698
+ * Note: When GroupSyncMode.LINKED_USERS_PATIENT_ENLISTMENT is set for a document, all the groups where the specified user is enlisted as patient will also be removed from the document.
699
+ */
700
+ unlinkAllUsers(schemaIdOrName: ObjectId | string, documentId: ObjectId, options?: OptionsBase): Promise<AffectedRecords>;
625
701
  }
626
702
  export interface DataIndexesService {
627
703
  /**
@@ -89,23 +89,20 @@ export interface TemplatesService {
89
89
  /**
90
90
  * Find By Id
91
91
  * @param id the Id to search for
92
- * @param rql an optional rql string
93
92
  * @returns the first element found
94
93
  */
95
- findById(id: ObjectId, options?: OptionsWithRql): Promise<TemplateOut>;
94
+ findById(id: ObjectId, options?: OptionsWithRql): Promise<TemplateOut | undefined>;
96
95
  /**
97
96
  * Find By Name
98
97
  * @param name the name to search for
99
- * @param rql an optional rql string
100
98
  * @returns the first element found
101
99
  */
102
- findByName(name: string, options?: OptionsWithRql): Promise<TemplateOut>;
100
+ findByName(name: string, options?: OptionsWithRql): Promise<TemplateOut | undefined>;
103
101
  /**
104
102
  * Find First
105
- * @param rql an optional rql string
106
103
  * @returns the first element found
107
104
  */
108
- findFirst(options?: OptionsWithRql): Promise<TemplateOut>;
105
+ findFirst(options?: OptionsWithRql): Promise<TemplateOut | undefined>;
109
106
  /**
110
107
  * Create a new template
111
108
  *
@@ -210,6 +210,7 @@ export declare enum GlobalPermissionName {
210
210
  SEND_MAILS = "SEND_MAILS",
211
211
  SYNC_PROFILE_GROUPS = "SYNC_PROFILE_GROUPS",
212
212
  TRANSFER_PERIOD = "TRANSFER_PERIOD",
213
+ TRANSITION_DOCUMENTS = "TRANSITION_DOCUMENTS",
213
214
  TRIGGER_APP_STORE_SUBSCRIPTION_REEVALUATION = "TRIGGER_APP_STORE_SUBSCRIPTION_REEVALUATION",
214
215
  TRIGGER_PLAY_STORE_SUBSCRIPTION_REEVALUATION = "TRIGGER_PLAY_STORE_SUBSCRIPTION_REEVALUATION",
215
216
  UNLINK_USER_FROM_OIDC = "UNLINK_USER_FROM_OIDC",
@@ -347,8 +348,6 @@ export declare enum GlobalPermissionName {
347
348
  /** @deprecated Not in use any longer */
348
349
  MANAGE_SERVICE_ALERTS = "MANAGE_SERVICE_ALERTS",
349
350
  /** @deprecated Not in use any longer */
350
- TRANSITION_DOCUMENTS = "TRANSITION_DOCUMENTS",
351
- /** @deprecated Not in use any longer */
352
351
  VIEW_AWS_SES_STATISTICS = "VIEW_AWS_SES_STATISTICS",
353
352
  /** @deprecated Not in use any longer */
354
353
  CREATE_USER_PERIODS = "CREATE_USER_PERIODS",
@@ -1 +1 @@
1
- export declare const version = "8.4.1";
1
+ export declare const version = "8.5.0-dev-72-f6603f3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extrahorizon/javascript-sdk",
3
- "version": "8.4.1",
3
+ "version": "8.5.0-dev-72-f6603f3",
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",