@extrahorizon/javascript-sdk 8.5.0-feat-82-38b4e34 → 8.5.0-feat-84-2fc5d36
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/build/index.cjs.js +26 -104
- package/build/index.mjs +26 -104
- package/build/types/client.d.ts +1 -6
- package/build/types/constants.d.ts +0 -1
- package/build/types/mockType.d.ts +9 -48
- package/build/types/services/data/types.d.ts +219 -0
- package/build/types/services/index.d.ts +0 -1
- package/build/types/types.d.ts +0 -1
- package/build/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/build/types/services/notificationsV2/health.d.ts +0 -9
- package/build/types/services/notificationsV2/index.d.ts +0 -7
- package/build/types/services/notificationsV2/notificationsV2.d.ts +0 -5
- package/build/types/services/notificationsV2/types.d.ts +0 -97
- package/build/types/services/notificationsV2/users/index.d.ts +0 -5
- package/build/types/services/notificationsV2/users/types.d.ts +0 -79
package/build/index.cjs.js
CHANGED
|
@@ -1636,7 +1636,6 @@ const DISPATCHERS_BASE = '/dispatchers/v1';
|
|
|
1636
1636
|
const PAYMENTS_BASE = '/payments/v1';
|
|
1637
1637
|
const PROFILES_BASE = '/profiles/v1';
|
|
1638
1638
|
const NOTIFICATIONS_BASE = '/notifications/v1';
|
|
1639
|
-
const NOTIFICATIONS_V2_BASE = '/notifications/v2';
|
|
1640
1639
|
const LOCALIZATIONS_BASE = '/localizations/v1';
|
|
1641
1640
|
const EVENTS_BASE = '/events/v1';
|
|
1642
1641
|
const LOGS_BASE = '/logs/v1';
|
|
@@ -3597,6 +3596,21 @@ var documents = (client, httpAuth) => {
|
|
|
3597
3596
|
async removeFields(schemaIdOrName, documentId, requestBody, options) {
|
|
3598
3597
|
return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/deleteFields${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, requestBody, options)).data;
|
|
3599
3598
|
},
|
|
3599
|
+
async appendObjectToArray(schemaIdOrName, documentId, arrayField, requestBody, options) {
|
|
3600
|
+
return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/${arrayField}/`, requestBody, {
|
|
3601
|
+
...options,
|
|
3602
|
+
customKeys: ['*'],
|
|
3603
|
+
})).data;
|
|
3604
|
+
},
|
|
3605
|
+
async updateObjectInArray(schemaIdOrName, documentId, arrayField, objectId, requestBody, options) {
|
|
3606
|
+
return (await client.put(httpAuth, `/${schemaIdOrName}/documents/${documentId}/${arrayField}/${objectId}`, requestBody, {
|
|
3607
|
+
...options,
|
|
3608
|
+
customRequestKeys: ['*'],
|
|
3609
|
+
})).data;
|
|
3610
|
+
},
|
|
3611
|
+
async removeObjectFromArray(schemaIdOrName, documentId, arrayField, objectId, options) {
|
|
3612
|
+
return (await client.delete(httpAuth, `/${schemaIdOrName}/documents/${documentId}/${arrayField}/${objectId}`, options)).data;
|
|
3613
|
+
},
|
|
3600
3614
|
async transition(schemaIdOrName, documentId, requestBody, options) {
|
|
3601
3615
|
return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/transition${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, requestBody, options)).data;
|
|
3602
3616
|
},
|
|
@@ -4215,7 +4229,7 @@ var groupRoles = (client, httpWithAuth) => ({
|
|
|
4215
4229
|
},
|
|
4216
4230
|
});
|
|
4217
4231
|
|
|
4218
|
-
var health$
|
|
4232
|
+
var health$5 = (userClient, http) => ({
|
|
4219
4233
|
/**
|
|
4220
4234
|
* Perform a health check
|
|
4221
4235
|
* @returns {boolean} success
|
|
@@ -4412,7 +4426,7 @@ const usersService = (httpWithAuth, http) => {
|
|
|
4412
4426
|
basePath: USER_BASE,
|
|
4413
4427
|
transformRequestData: decamelizeRequestData,
|
|
4414
4428
|
});
|
|
4415
|
-
const healthMethods = health$
|
|
4429
|
+
const healthMethods = health$5(userClient, httpWithAuth);
|
|
4416
4430
|
const usersMethods = users$1(userClient, httpWithAuth, http);
|
|
4417
4431
|
const groupRolesMethods = groupRoles(userClient, httpWithAuth);
|
|
4418
4432
|
const globalRolesMethods = globalRoles(userClient, httpWithAuth);
|
|
@@ -4793,7 +4807,7 @@ var appStoreSubscriptions = (client, httpAuth) => ({
|
|
|
4793
4807
|
},
|
|
4794
4808
|
});
|
|
4795
4809
|
|
|
4796
|
-
var health$
|
|
4810
|
+
var health$4 = (client, httpAuth) => ({
|
|
4797
4811
|
/**
|
|
4798
4812
|
* Check if the service is available
|
|
4799
4813
|
* @returns true if service is up and running
|
|
@@ -4999,7 +5013,7 @@ const paymentsService = (httpWithAuth) => {
|
|
|
4999
5013
|
basePath: PAYMENTS_BASE,
|
|
5000
5014
|
});
|
|
5001
5015
|
return {
|
|
5002
|
-
...health$
|
|
5016
|
+
...health$4(client, httpWithAuth),
|
|
5003
5017
|
products: products(client, httpWithAuth),
|
|
5004
5018
|
orders: orders(client, httpWithAuth),
|
|
5005
5019
|
subscriptions: subscriptions$1(client, httpWithAuth),
|
|
@@ -5021,7 +5035,7 @@ var countries = (client, httpAuth) => ({
|
|
|
5021
5035
|
},
|
|
5022
5036
|
});
|
|
5023
5037
|
|
|
5024
|
-
var health$
|
|
5038
|
+
var health$3 = (client, http) => ({
|
|
5025
5039
|
/**
|
|
5026
5040
|
* Perform a health check
|
|
5027
5041
|
* @returns {boolean} success
|
|
@@ -5074,7 +5088,7 @@ const localizationsService = (httpWithAuth) => {
|
|
|
5074
5088
|
basePath: LOCALIZATIONS_BASE,
|
|
5075
5089
|
});
|
|
5076
5090
|
return {
|
|
5077
|
-
...health$
|
|
5091
|
+
...health$3(client, httpWithAuth),
|
|
5078
5092
|
...localizations(client, httpWithAuth),
|
|
5079
5093
|
...countries(client, httpWithAuth),
|
|
5080
5094
|
...languages(client, httpWithAuth),
|
|
@@ -5099,7 +5113,7 @@ var groups = (client, httpAuth) => ({
|
|
|
5099
5113
|
},
|
|
5100
5114
|
});
|
|
5101
5115
|
|
|
5102
|
-
var health$
|
|
5116
|
+
var health$2 = (client, httpAuth) => ({
|
|
5103
5117
|
/**
|
|
5104
5118
|
* Perform a health check for profiles service
|
|
5105
5119
|
* @returns {boolean} success
|
|
@@ -5189,14 +5203,14 @@ const profilesService = (httpWithAuth) => {
|
|
|
5189
5203
|
basePath: PROFILES_BASE,
|
|
5190
5204
|
});
|
|
5191
5205
|
return {
|
|
5192
|
-
...health$
|
|
5206
|
+
...health$2(client, httpWithAuth),
|
|
5193
5207
|
...profiles(client, httpWithAuth),
|
|
5194
5208
|
groups: groups(client, httpWithAuth),
|
|
5195
5209
|
logs: logs(client, httpWithAuth),
|
|
5196
5210
|
};
|
|
5197
5211
|
};
|
|
5198
5212
|
|
|
5199
|
-
var health$
|
|
5213
|
+
var health$1 = (client, http) => ({
|
|
5200
5214
|
/**
|
|
5201
5215
|
* Perform a health check
|
|
5202
5216
|
* @returns {boolean} success
|
|
@@ -5283,103 +5297,12 @@ const notificationsService = (httpWithAuth) => {
|
|
|
5283
5297
|
transformRequestData: decamelizeRequestData,
|
|
5284
5298
|
});
|
|
5285
5299
|
return {
|
|
5286
|
-
...health$
|
|
5300
|
+
...health$1(client, httpWithAuth),
|
|
5287
5301
|
...notifications(client, httpWithAuth),
|
|
5288
5302
|
settings: settings(client, httpWithAuth),
|
|
5289
5303
|
};
|
|
5290
5304
|
};
|
|
5291
5305
|
|
|
5292
|
-
var health$1 = (client, http) => ({
|
|
5293
|
-
/**
|
|
5294
|
-
* Perform a health check
|
|
5295
|
-
* @returns {boolean} success
|
|
5296
|
-
*/
|
|
5297
|
-
async health() {
|
|
5298
|
-
const result = await client.get(http, '/health');
|
|
5299
|
-
return result.status === exports.Results.Success;
|
|
5300
|
-
},
|
|
5301
|
-
});
|
|
5302
|
-
|
|
5303
|
-
var notificationsV2 = (client, httpWithAuth) => {
|
|
5304
|
-
async function find(options) {
|
|
5305
|
-
const result = await client.get(httpWithAuth, `/${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, {
|
|
5306
|
-
...options,
|
|
5307
|
-
customResponseKeys: ['data.data'],
|
|
5308
|
-
});
|
|
5309
|
-
return result.data;
|
|
5310
|
-
}
|
|
5311
|
-
return {
|
|
5312
|
-
async create(requestBody, options) {
|
|
5313
|
-
const result = await client.post(httpWithAuth, '/', requestBody, {
|
|
5314
|
-
...options,
|
|
5315
|
-
customKeys: ['data'],
|
|
5316
|
-
});
|
|
5317
|
-
return result.data;
|
|
5318
|
-
},
|
|
5319
|
-
async find(options) {
|
|
5320
|
-
const result = await find(options);
|
|
5321
|
-
return addPagersFn(find, options, result);
|
|
5322
|
-
},
|
|
5323
|
-
async findAll(options) {
|
|
5324
|
-
return findAllGeneric(find, options);
|
|
5325
|
-
},
|
|
5326
|
-
async findByTargetUserId(targetUserId, options) {
|
|
5327
|
-
const rqlWithTargetUserId = rqlBuilder(options === null || options === void 0 ? void 0 : options.rql).eq('targetUserId', targetUserId).build();
|
|
5328
|
-
const result = await find({ ...options, rql: rqlWithTargetUserId });
|
|
5329
|
-
return addPagersFn(find, { ...options, rql: rqlWithTargetUserId }, result);
|
|
5330
|
-
},
|
|
5331
|
-
async findFirst(options) {
|
|
5332
|
-
const result = await find(options);
|
|
5333
|
-
return result.data[0];
|
|
5334
|
-
},
|
|
5335
|
-
async findById(notificationId, options) {
|
|
5336
|
-
const rqlWithNotificationId = rqlBuilder().eq('id', notificationId).build();
|
|
5337
|
-
const result = await find({ ...options, rql: rqlWithNotificationId });
|
|
5338
|
-
return result.data[0];
|
|
5339
|
-
},
|
|
5340
|
-
};
|
|
5341
|
-
};
|
|
5342
|
-
|
|
5343
|
-
var notificationV2Users = (client, httpWithAuth) => {
|
|
5344
|
-
async function find(options) {
|
|
5345
|
-
const result = await client.get(httpWithAuth, `/users/${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options);
|
|
5346
|
-
return result.data;
|
|
5347
|
-
}
|
|
5348
|
-
return {
|
|
5349
|
-
async update(userId, requestBody, options) {
|
|
5350
|
-
const result = await client.put(httpWithAuth, `/users/${userId}`, requestBody, options);
|
|
5351
|
-
return result.data;
|
|
5352
|
-
},
|
|
5353
|
-
async find(options) {
|
|
5354
|
-
const result = await find(options);
|
|
5355
|
-
return addPagersFn(find, options, result);
|
|
5356
|
-
},
|
|
5357
|
-
async findAll(options) {
|
|
5358
|
-
return findAllGeneric(find, options);
|
|
5359
|
-
},
|
|
5360
|
-
async findByUserId(userId, options) {
|
|
5361
|
-
const rqlWithUserId = rqlBuilder(options === null || options === void 0 ? void 0 : options.rql).eq('id', userId).build();
|
|
5362
|
-
const result = await find({ ...options, rql: rqlWithUserId });
|
|
5363
|
-
return result.data[0];
|
|
5364
|
-
},
|
|
5365
|
-
async findFirst(options) {
|
|
5366
|
-
const result = await find(options);
|
|
5367
|
-
return result.data[0];
|
|
5368
|
-
},
|
|
5369
|
-
};
|
|
5370
|
-
};
|
|
5371
|
-
|
|
5372
|
-
const notificationsV2Service = (httpWithAuth) => {
|
|
5373
|
-
const client = httpClient({
|
|
5374
|
-
basePath: NOTIFICATIONS_V2_BASE,
|
|
5375
|
-
});
|
|
5376
|
-
return {
|
|
5377
|
-
...health$1(client, httpWithAuth),
|
|
5378
|
-
...notificationsV2(client, httpWithAuth),
|
|
5379
|
-
users: notificationV2Users(client, httpWithAuth),
|
|
5380
|
-
};
|
|
5381
|
-
};
|
|
5382
|
-
|
|
5383
5306
|
var events = (client, httpAuth) => ({
|
|
5384
5307
|
async find(options) {
|
|
5385
5308
|
return (await client.get(httpAuth, `/${(options === null || options === void 0 ? void 0 : options.rql) || ''}`)).data;
|
|
@@ -5472,7 +5395,7 @@ const logsService = (httpWithAuth) => {
|
|
|
5472
5395
|
};
|
|
5473
5396
|
};
|
|
5474
5397
|
|
|
5475
|
-
const version = '8.5.0-feat-
|
|
5398
|
+
const version = '8.5.0-feat-84-2fc5d36';
|
|
5476
5399
|
|
|
5477
5400
|
/**
|
|
5478
5401
|
* Create ExtraHorizon client.
|
|
@@ -5512,7 +5435,6 @@ function createClient(rawConfig) {
|
|
|
5512
5435
|
localizations: localizationsService(httpWithAuth),
|
|
5513
5436
|
profiles: profilesService(httpWithAuth),
|
|
5514
5437
|
notifications: notificationsService(httpWithAuth),
|
|
5515
|
-
notificationsV2: notificationsV2Service(httpWithAuth),
|
|
5516
5438
|
events: eventsService(httpWithAuth),
|
|
5517
5439
|
logs: logsService(httpWithAuth),
|
|
5518
5440
|
auth: {
|
package/build/index.mjs
CHANGED
|
@@ -1606,7 +1606,6 @@ const DISPATCHERS_BASE = '/dispatchers/v1';
|
|
|
1606
1606
|
const PAYMENTS_BASE = '/payments/v1';
|
|
1607
1607
|
const PROFILES_BASE = '/profiles/v1';
|
|
1608
1608
|
const NOTIFICATIONS_BASE = '/notifications/v1';
|
|
1609
|
-
const NOTIFICATIONS_V2_BASE = '/notifications/v2';
|
|
1610
1609
|
const LOCALIZATIONS_BASE = '/localizations/v1';
|
|
1611
1610
|
const EVENTS_BASE = '/events/v1';
|
|
1612
1611
|
const LOGS_BASE = '/logs/v1';
|
|
@@ -3567,6 +3566,21 @@ var documents = (client, httpAuth) => {
|
|
|
3567
3566
|
async removeFields(schemaIdOrName, documentId, requestBody, options) {
|
|
3568
3567
|
return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/deleteFields${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, requestBody, options)).data;
|
|
3569
3568
|
},
|
|
3569
|
+
async appendObjectToArray(schemaIdOrName, documentId, arrayField, requestBody, options) {
|
|
3570
|
+
return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/${arrayField}/`, requestBody, {
|
|
3571
|
+
...options,
|
|
3572
|
+
customKeys: ['*'],
|
|
3573
|
+
})).data;
|
|
3574
|
+
},
|
|
3575
|
+
async updateObjectInArray(schemaIdOrName, documentId, arrayField, objectId, requestBody, options) {
|
|
3576
|
+
return (await client.put(httpAuth, `/${schemaIdOrName}/documents/${documentId}/${arrayField}/${objectId}`, requestBody, {
|
|
3577
|
+
...options,
|
|
3578
|
+
customRequestKeys: ['*'],
|
|
3579
|
+
})).data;
|
|
3580
|
+
},
|
|
3581
|
+
async removeObjectFromArray(schemaIdOrName, documentId, arrayField, objectId, options) {
|
|
3582
|
+
return (await client.delete(httpAuth, `/${schemaIdOrName}/documents/${documentId}/${arrayField}/${objectId}`, options)).data;
|
|
3583
|
+
},
|
|
3570
3584
|
async transition(schemaIdOrName, documentId, requestBody, options) {
|
|
3571
3585
|
return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/transition${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, requestBody, options)).data;
|
|
3572
3586
|
},
|
|
@@ -4185,7 +4199,7 @@ var groupRoles = (client, httpWithAuth) => ({
|
|
|
4185
4199
|
},
|
|
4186
4200
|
});
|
|
4187
4201
|
|
|
4188
|
-
var health$
|
|
4202
|
+
var health$5 = (userClient, http) => ({
|
|
4189
4203
|
/**
|
|
4190
4204
|
* Perform a health check
|
|
4191
4205
|
* @returns {boolean} success
|
|
@@ -4382,7 +4396,7 @@ const usersService = (httpWithAuth, http) => {
|
|
|
4382
4396
|
basePath: USER_BASE,
|
|
4383
4397
|
transformRequestData: decamelizeRequestData,
|
|
4384
4398
|
});
|
|
4385
|
-
const healthMethods = health$
|
|
4399
|
+
const healthMethods = health$5(userClient, httpWithAuth);
|
|
4386
4400
|
const usersMethods = users$1(userClient, httpWithAuth, http);
|
|
4387
4401
|
const groupRolesMethods = groupRoles(userClient, httpWithAuth);
|
|
4388
4402
|
const globalRolesMethods = globalRoles(userClient, httpWithAuth);
|
|
@@ -4763,7 +4777,7 @@ var appStoreSubscriptions = (client, httpAuth) => ({
|
|
|
4763
4777
|
},
|
|
4764
4778
|
});
|
|
4765
4779
|
|
|
4766
|
-
var health$
|
|
4780
|
+
var health$4 = (client, httpAuth) => ({
|
|
4767
4781
|
/**
|
|
4768
4782
|
* Check if the service is available
|
|
4769
4783
|
* @returns true if service is up and running
|
|
@@ -4969,7 +4983,7 @@ const paymentsService = (httpWithAuth) => {
|
|
|
4969
4983
|
basePath: PAYMENTS_BASE,
|
|
4970
4984
|
});
|
|
4971
4985
|
return {
|
|
4972
|
-
...health$
|
|
4986
|
+
...health$4(client, httpWithAuth),
|
|
4973
4987
|
products: products(client, httpWithAuth),
|
|
4974
4988
|
orders: orders(client, httpWithAuth),
|
|
4975
4989
|
subscriptions: subscriptions$1(client, httpWithAuth),
|
|
@@ -4991,7 +5005,7 @@ var countries = (client, httpAuth) => ({
|
|
|
4991
5005
|
},
|
|
4992
5006
|
});
|
|
4993
5007
|
|
|
4994
|
-
var health$
|
|
5008
|
+
var health$3 = (client, http) => ({
|
|
4995
5009
|
/**
|
|
4996
5010
|
* Perform a health check
|
|
4997
5011
|
* @returns {boolean} success
|
|
@@ -5044,7 +5058,7 @@ const localizationsService = (httpWithAuth) => {
|
|
|
5044
5058
|
basePath: LOCALIZATIONS_BASE,
|
|
5045
5059
|
});
|
|
5046
5060
|
return {
|
|
5047
|
-
...health$
|
|
5061
|
+
...health$3(client, httpWithAuth),
|
|
5048
5062
|
...localizations(client, httpWithAuth),
|
|
5049
5063
|
...countries(client, httpWithAuth),
|
|
5050
5064
|
...languages(client, httpWithAuth),
|
|
@@ -5069,7 +5083,7 @@ var groups = (client, httpAuth) => ({
|
|
|
5069
5083
|
},
|
|
5070
5084
|
});
|
|
5071
5085
|
|
|
5072
|
-
var health$
|
|
5086
|
+
var health$2 = (client, httpAuth) => ({
|
|
5073
5087
|
/**
|
|
5074
5088
|
* Perform a health check for profiles service
|
|
5075
5089
|
* @returns {boolean} success
|
|
@@ -5159,14 +5173,14 @@ const profilesService = (httpWithAuth) => {
|
|
|
5159
5173
|
basePath: PROFILES_BASE,
|
|
5160
5174
|
});
|
|
5161
5175
|
return {
|
|
5162
|
-
...health$
|
|
5176
|
+
...health$2(client, httpWithAuth),
|
|
5163
5177
|
...profiles(client, httpWithAuth),
|
|
5164
5178
|
groups: groups(client, httpWithAuth),
|
|
5165
5179
|
logs: logs(client, httpWithAuth),
|
|
5166
5180
|
};
|
|
5167
5181
|
};
|
|
5168
5182
|
|
|
5169
|
-
var health$
|
|
5183
|
+
var health$1 = (client, http) => ({
|
|
5170
5184
|
/**
|
|
5171
5185
|
* Perform a health check
|
|
5172
5186
|
* @returns {boolean} success
|
|
@@ -5253,103 +5267,12 @@ const notificationsService = (httpWithAuth) => {
|
|
|
5253
5267
|
transformRequestData: decamelizeRequestData,
|
|
5254
5268
|
});
|
|
5255
5269
|
return {
|
|
5256
|
-
...health$
|
|
5270
|
+
...health$1(client, httpWithAuth),
|
|
5257
5271
|
...notifications(client, httpWithAuth),
|
|
5258
5272
|
settings: settings(client, httpWithAuth),
|
|
5259
5273
|
};
|
|
5260
5274
|
};
|
|
5261
5275
|
|
|
5262
|
-
var health$1 = (client, http) => ({
|
|
5263
|
-
/**
|
|
5264
|
-
* Perform a health check
|
|
5265
|
-
* @returns {boolean} success
|
|
5266
|
-
*/
|
|
5267
|
-
async health() {
|
|
5268
|
-
const result = await client.get(http, '/health');
|
|
5269
|
-
return result.status === Results.Success;
|
|
5270
|
-
},
|
|
5271
|
-
});
|
|
5272
|
-
|
|
5273
|
-
var notificationsV2 = (client, httpWithAuth) => {
|
|
5274
|
-
async function find(options) {
|
|
5275
|
-
const result = await client.get(httpWithAuth, `/${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, {
|
|
5276
|
-
...options,
|
|
5277
|
-
customResponseKeys: ['data.data'],
|
|
5278
|
-
});
|
|
5279
|
-
return result.data;
|
|
5280
|
-
}
|
|
5281
|
-
return {
|
|
5282
|
-
async create(requestBody, options) {
|
|
5283
|
-
const result = await client.post(httpWithAuth, '/', requestBody, {
|
|
5284
|
-
...options,
|
|
5285
|
-
customKeys: ['data'],
|
|
5286
|
-
});
|
|
5287
|
-
return result.data;
|
|
5288
|
-
},
|
|
5289
|
-
async find(options) {
|
|
5290
|
-
const result = await find(options);
|
|
5291
|
-
return addPagersFn(find, options, result);
|
|
5292
|
-
},
|
|
5293
|
-
async findAll(options) {
|
|
5294
|
-
return findAllGeneric(find, options);
|
|
5295
|
-
},
|
|
5296
|
-
async findByTargetUserId(targetUserId, options) {
|
|
5297
|
-
const rqlWithTargetUserId = rqlBuilder(options === null || options === void 0 ? void 0 : options.rql).eq('targetUserId', targetUserId).build();
|
|
5298
|
-
const result = await find({ ...options, rql: rqlWithTargetUserId });
|
|
5299
|
-
return addPagersFn(find, { ...options, rql: rqlWithTargetUserId }, result);
|
|
5300
|
-
},
|
|
5301
|
-
async findFirst(options) {
|
|
5302
|
-
const result = await find(options);
|
|
5303
|
-
return result.data[0];
|
|
5304
|
-
},
|
|
5305
|
-
async findById(notificationId, options) {
|
|
5306
|
-
const rqlWithNotificationId = rqlBuilder().eq('id', notificationId).build();
|
|
5307
|
-
const result = await find({ ...options, rql: rqlWithNotificationId });
|
|
5308
|
-
return result.data[0];
|
|
5309
|
-
},
|
|
5310
|
-
};
|
|
5311
|
-
};
|
|
5312
|
-
|
|
5313
|
-
var notificationV2Users = (client, httpWithAuth) => {
|
|
5314
|
-
async function find(options) {
|
|
5315
|
-
const result = await client.get(httpWithAuth, `/users/${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options);
|
|
5316
|
-
return result.data;
|
|
5317
|
-
}
|
|
5318
|
-
return {
|
|
5319
|
-
async update(userId, requestBody, options) {
|
|
5320
|
-
const result = await client.put(httpWithAuth, `/users/${userId}`, requestBody, options);
|
|
5321
|
-
return result.data;
|
|
5322
|
-
},
|
|
5323
|
-
async find(options) {
|
|
5324
|
-
const result = await find(options);
|
|
5325
|
-
return addPagersFn(find, options, result);
|
|
5326
|
-
},
|
|
5327
|
-
async findAll(options) {
|
|
5328
|
-
return findAllGeneric(find, options);
|
|
5329
|
-
},
|
|
5330
|
-
async findByUserId(userId, options) {
|
|
5331
|
-
const rqlWithUserId = rqlBuilder(options === null || options === void 0 ? void 0 : options.rql).eq('id', userId).build();
|
|
5332
|
-
const result = await find({ ...options, rql: rqlWithUserId });
|
|
5333
|
-
return result.data[0];
|
|
5334
|
-
},
|
|
5335
|
-
async findFirst(options) {
|
|
5336
|
-
const result = await find(options);
|
|
5337
|
-
return result.data[0];
|
|
5338
|
-
},
|
|
5339
|
-
};
|
|
5340
|
-
};
|
|
5341
|
-
|
|
5342
|
-
const notificationsV2Service = (httpWithAuth) => {
|
|
5343
|
-
const client = httpClient({
|
|
5344
|
-
basePath: NOTIFICATIONS_V2_BASE,
|
|
5345
|
-
});
|
|
5346
|
-
return {
|
|
5347
|
-
...health$1(client, httpWithAuth),
|
|
5348
|
-
...notificationsV2(client, httpWithAuth),
|
|
5349
|
-
users: notificationV2Users(client, httpWithAuth),
|
|
5350
|
-
};
|
|
5351
|
-
};
|
|
5352
|
-
|
|
5353
5276
|
var events = (client, httpAuth) => ({
|
|
5354
5277
|
async find(options) {
|
|
5355
5278
|
return (await client.get(httpAuth, `/${(options === null || options === void 0 ? void 0 : options.rql) || ''}`)).data;
|
|
@@ -5442,7 +5365,7 @@ const logsService = (httpWithAuth) => {
|
|
|
5442
5365
|
};
|
|
5443
5366
|
};
|
|
5444
5367
|
|
|
5445
|
-
const version = '8.5.0-feat-
|
|
5368
|
+
const version = '8.5.0-feat-84-2fc5d36';
|
|
5446
5369
|
|
|
5447
5370
|
/**
|
|
5448
5371
|
* Create ExtraHorizon client.
|
|
@@ -5482,7 +5405,6 @@ function createClient(rawConfig) {
|
|
|
5482
5405
|
localizations: localizationsService(httpWithAuth),
|
|
5483
5406
|
profiles: profilesService(httpWithAuth),
|
|
5484
5407
|
notifications: notificationsService(httpWithAuth),
|
|
5485
|
-
notificationsV2: notificationsV2Service(httpWithAuth),
|
|
5486
5408
|
events: eventsService(httpWithAuth),
|
|
5487
5409
|
logs: logsService(httpWithAuth),
|
|
5488
5410
|
auth: {
|
package/build/types/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AuthHttpClient, OAuth1HttpClient, OAuth2HttpClient, ProxyInstance } from './http/types';
|
|
2
|
-
import { authService, configurationsService, dataService, dispatchersService, eventsService, filesService, localizationsService, logsService, mailsService, notificationsService,
|
|
2
|
+
import { authService, configurationsService, dataService, dispatchersService, eventsService, filesService, localizationsService, logsService, mailsService, notificationsService, paymentsService, profilesService, tasksService, templatesService, usersService } from './services';
|
|
3
3
|
import { ClientParams, ParamsOauth1, ParamsOauth2, ParamsProxy } from './types';
|
|
4
4
|
export interface Client<T extends ClientParams> {
|
|
5
5
|
raw: AuthHttpClient;
|
|
@@ -58,11 +58,6 @@ export interface Client<T extends ClientParams> {
|
|
|
58
58
|
* @see https://swagger.extrahorizon.com/listing/?service=notifications-service&redirectToVersion=1
|
|
59
59
|
*/
|
|
60
60
|
notifications: ReturnType<typeof notificationsService>;
|
|
61
|
-
/**
|
|
62
|
-
* A service that handles push notifications.
|
|
63
|
-
* @see https://swagger.extrahorizon.com/listing/?service=notifications-service&redirectToVersion=2
|
|
64
|
-
*/
|
|
65
|
-
notificationsV2: ReturnType<typeof notificationsV2Service>;
|
|
66
61
|
/**
|
|
67
62
|
* Service that provides event (publish/subscribe) functionality for other services.
|
|
68
63
|
* @see https://swagger.extrahorizon.com/listing/?service=events-service&redirectToVersion=1
|
|
@@ -10,7 +10,6 @@ export declare const DISPATCHERS_BASE = "/dispatchers/v1";
|
|
|
10
10
|
export declare const PAYMENTS_BASE = "/payments/v1";
|
|
11
11
|
export declare const PROFILES_BASE = "/profiles/v1";
|
|
12
12
|
export declare const NOTIFICATIONS_BASE = "/notifications/v1";
|
|
13
|
-
export declare const NOTIFICATIONS_V2_BASE = "/notifications/v2";
|
|
14
13
|
export declare const LOCALIZATIONS_BASE = "/localizations/v1";
|
|
15
14
|
export declare const EVENTS_BASE = "/events/v1";
|
|
16
15
|
export declare const LOGS_BASE = "/logs/v1";
|
|
@@ -129,6 +129,9 @@ export declare type MockClientOAuth1<MockFn> = {
|
|
|
129
129
|
update: MockFn;
|
|
130
130
|
remove: MockFn;
|
|
131
131
|
removeFields: MockFn;
|
|
132
|
+
appendObjectToArray: MockFn;
|
|
133
|
+
updateObjectInArray: MockFn;
|
|
134
|
+
removeObjectFromArray: MockFn;
|
|
132
135
|
transition: MockFn;
|
|
133
136
|
linkGroups: MockFn;
|
|
134
137
|
unlinkGroups: MockFn;
|
|
@@ -424,22 +427,6 @@ export declare type MockClientOAuth1<MockFn> = {
|
|
|
424
427
|
remove: MockFn;
|
|
425
428
|
};
|
|
426
429
|
};
|
|
427
|
-
notificationsV2: {
|
|
428
|
-
health: MockFn;
|
|
429
|
-
create: MockFn;
|
|
430
|
-
find: MockFn;
|
|
431
|
-
findAll: MockFn;
|
|
432
|
-
findByTargetUserId: MockFn;
|
|
433
|
-
findFirst: MockFn;
|
|
434
|
-
findById: MockFn;
|
|
435
|
-
users: {
|
|
436
|
-
update: MockFn;
|
|
437
|
-
find: MockFn;
|
|
438
|
-
findAll: MockFn;
|
|
439
|
-
findByUserId: MockFn;
|
|
440
|
-
findFirst: MockFn;
|
|
441
|
-
};
|
|
442
|
-
};
|
|
443
430
|
events: {
|
|
444
431
|
health: MockFn;
|
|
445
432
|
find: MockFn;
|
|
@@ -676,6 +663,9 @@ export declare type MockClientOAuth2<MockFn> = {
|
|
|
676
663
|
update: MockFn;
|
|
677
664
|
remove: MockFn;
|
|
678
665
|
removeFields: MockFn;
|
|
666
|
+
appendObjectToArray: MockFn;
|
|
667
|
+
updateObjectInArray: MockFn;
|
|
668
|
+
removeObjectFromArray: MockFn;
|
|
679
669
|
transition: MockFn;
|
|
680
670
|
linkGroups: MockFn;
|
|
681
671
|
unlinkGroups: MockFn;
|
|
@@ -971,22 +961,6 @@ export declare type MockClientOAuth2<MockFn> = {
|
|
|
971
961
|
remove: MockFn;
|
|
972
962
|
};
|
|
973
963
|
};
|
|
974
|
-
notificationsV2: {
|
|
975
|
-
health: MockFn;
|
|
976
|
-
create: MockFn;
|
|
977
|
-
find: MockFn;
|
|
978
|
-
findAll: MockFn;
|
|
979
|
-
findByTargetUserId: MockFn;
|
|
980
|
-
findFirst: MockFn;
|
|
981
|
-
findById: MockFn;
|
|
982
|
-
users: {
|
|
983
|
-
update: MockFn;
|
|
984
|
-
find: MockFn;
|
|
985
|
-
findAll: MockFn;
|
|
986
|
-
findByUserId: MockFn;
|
|
987
|
-
findFirst: MockFn;
|
|
988
|
-
};
|
|
989
|
-
};
|
|
990
964
|
events: {
|
|
991
965
|
health: MockFn;
|
|
992
966
|
find: MockFn;
|
|
@@ -1223,6 +1197,9 @@ export declare type MockClientProxy<MockFn> = {
|
|
|
1223
1197
|
update: MockFn;
|
|
1224
1198
|
remove: MockFn;
|
|
1225
1199
|
removeFields: MockFn;
|
|
1200
|
+
appendObjectToArray: MockFn;
|
|
1201
|
+
updateObjectInArray: MockFn;
|
|
1202
|
+
removeObjectFromArray: MockFn;
|
|
1226
1203
|
transition: MockFn;
|
|
1227
1204
|
linkGroups: MockFn;
|
|
1228
1205
|
unlinkGroups: MockFn;
|
|
@@ -1518,22 +1495,6 @@ export declare type MockClientProxy<MockFn> = {
|
|
|
1518
1495
|
remove: MockFn;
|
|
1519
1496
|
};
|
|
1520
1497
|
};
|
|
1521
|
-
notificationsV2: {
|
|
1522
|
-
health: MockFn;
|
|
1523
|
-
create: MockFn;
|
|
1524
|
-
find: MockFn;
|
|
1525
|
-
findAll: MockFn;
|
|
1526
|
-
findByTargetUserId: MockFn;
|
|
1527
|
-
findFirst: MockFn;
|
|
1528
|
-
findById: MockFn;
|
|
1529
|
-
users: {
|
|
1530
|
-
update: MockFn;
|
|
1531
|
-
find: MockFn;
|
|
1532
|
-
findAll: MockFn;
|
|
1533
|
-
findByUserId: MockFn;
|
|
1534
|
-
findFirst: MockFn;
|
|
1535
|
-
};
|
|
1536
|
-
};
|
|
1537
1498
|
events: {
|
|
1538
1499
|
health: MockFn;
|
|
1539
1500
|
find: MockFn;
|
|
@@ -775,6 +775,225 @@ export interface DataDocumentsService {
|
|
|
775
775
|
removeFields(schemaIdOrName: ObjectId | string, documentId: ObjectId, requestBody: {
|
|
776
776
|
fields: Array<string>;
|
|
777
777
|
}, options?: OptionsWithRql): Promise<AffectedRecords>;
|
|
778
|
+
/**
|
|
779
|
+
* # Append an object to an array
|
|
780
|
+
*
|
|
781
|
+
* Append an object to an array field in the selected document.
|
|
782
|
+
*
|
|
783
|
+
* When the object is appended to the array, the object will automatically be assigned a unique `id`.
|
|
784
|
+
*
|
|
785
|
+
* ## Example
|
|
786
|
+
*
|
|
787
|
+
* For a schema with the name `daily-summary`, a document looking like:
|
|
788
|
+
*
|
|
789
|
+
* ```json
|
|
790
|
+
* {
|
|
791
|
+
* "id": "5f7b1b3b1f7b4b0001f7b4b2",
|
|
792
|
+
* "data": {
|
|
793
|
+
* "userId": "67e66ef64f0ea8488aba8f2f",
|
|
794
|
+
* "date": "2025-03-28",
|
|
795
|
+
* "hourlySummaries": [
|
|
796
|
+
* { "id": "6568d05351c0f5307421e196", "avg": 5, "max": 10, "min": 2 },
|
|
797
|
+
* { "id": "67e66793ae59de5bba4b262f", "avg": 7, "max": 15, "min": 3 }
|
|
798
|
+
* ]
|
|
799
|
+
* }
|
|
800
|
+
* }
|
|
801
|
+
* ```
|
|
802
|
+
*
|
|
803
|
+
* Appending an item to the `hourlySummaries`, looking like:
|
|
804
|
+
*
|
|
805
|
+
* ```json
|
|
806
|
+
* {
|
|
807
|
+
* "avg": 10,
|
|
808
|
+
* "max": 20,
|
|
809
|
+
* "min": 5
|
|
810
|
+
* }
|
|
811
|
+
* ```
|
|
812
|
+
*
|
|
813
|
+
* Would be done like:
|
|
814
|
+
*
|
|
815
|
+
* ```ts
|
|
816
|
+
* const documentId = '5f7b1b3b1f7b4b0001f7b4b2';
|
|
817
|
+
* const hourlySummary = { avg: 10, max: 20, min: 5 };
|
|
818
|
+
* await exh.data.documents.appendObjectToArray('daily-summary', documentId, 'hourlySummaries', hourlySummary);
|
|
819
|
+
* ```
|
|
820
|
+
*
|
|
821
|
+
* ## Access via permissions
|
|
822
|
+
* Regardless of how the access modes (described below) are set, a user is always able to perform an operation on a document if they are assigned a specific permission. This permission can come from a global role of the user or a staff enlistment role the user has in the group of the document.
|
|
823
|
+
* Permission | Scopes | Effect
|
|
824
|
+
* - | - | -
|
|
825
|
+
* `UPDATE_DOCUMENTS` | `global` | Update any document
|
|
826
|
+
* `UPDATE_DOCUMENTS:{SCHEMA_NAME}` | `global` | Update any document of the specified schema
|
|
827
|
+
* `UPDATE_DOCUMENTS` | `staff_enlistment` | Update any document belonging to the group
|
|
828
|
+
* `UPDATE_DOCUMENTS:{SCHEMA_NAME}` | `staff_enlistment` | Update any document of the specified schema belonging to the group
|
|
829
|
+
* <br>
|
|
830
|
+
*
|
|
831
|
+
* ## General access mode values
|
|
832
|
+
* The general access mode values determine if a user requires permission to perform the action for the Schema. A general access mode value is provided as one of the following strings.
|
|
833
|
+
* General updateMode value | Description
|
|
834
|
+
* - | -
|
|
835
|
+
* `"permissionRequired"` | The permissions above apply
|
|
836
|
+
* <br>
|
|
837
|
+
*
|
|
838
|
+
* ## Relational access mode values
|
|
839
|
+
* Relational access mode values are supplied as an array. When multiple relational access mode values are supplied, a user adhering to any relation in this array is allowed to perform the action on the document.
|
|
840
|
+
* Relational updateMode value | Description
|
|
841
|
+
* - | -
|
|
842
|
+
* `["creator"]` | The user that created the document can update the document.
|
|
843
|
+
* `["linkedUsers"]` | All users where their user id is in the list of userIds of the document can update the document.
|
|
844
|
+
* `["linkedGroupPatients"]` | All users that have a patient enlistment in a group that is in the list of groupIds of the document can update the document.
|
|
845
|
+
* `["linkedGroupStaff"]` | All users that have a staff enlistment in a group that is in the list of groupIds of the document can update the document.
|
|
846
|
+
* <br>
|
|
847
|
+
*
|
|
848
|
+
* ## Legacy access mode values
|
|
849
|
+
* Listed below are the deprecated values with their current equivalent
|
|
850
|
+
* Legacy updateMode value | Description
|
|
851
|
+
* - | -
|
|
852
|
+
* `"default"` | Translates to `["linkedUsers","linkedGroupStaff"]` relational access mode
|
|
853
|
+
* `"creatorOnly"` | Translates to `["creator"]` relational access mode
|
|
854
|
+
* `"disabled"` | Translates to the `"permissionRequired"` general access mode value
|
|
855
|
+
* `"linkedGroupsStaffOnly"` | Translates to `["linkedGroupStaff"]` relational access mode
|
|
856
|
+
*/
|
|
857
|
+
appendObjectToArray<UpdateData = Record<string, any>>(schemaIdOrName: ObjectId | string, documentId: ObjectId, arrayField: string, requestBody: UpdateData, options?: OptionsBase): Promise<UpdateData & {
|
|
858
|
+
id: ObjectId;
|
|
859
|
+
}>;
|
|
860
|
+
/**
|
|
861
|
+
* # Update an object in an array
|
|
862
|
+
*
|
|
863
|
+
* Update an object in an array field in the selected document.
|
|
864
|
+
*
|
|
865
|
+
* ## Example
|
|
866
|
+
*
|
|
867
|
+
* For a schema with the name `daily-summary`, a document looking like:
|
|
868
|
+
*
|
|
869
|
+
* ```json
|
|
870
|
+
* {
|
|
871
|
+
* "id": "5f7b1b3b1f7b4b0001f7b4b2",
|
|
872
|
+
* "data": {
|
|
873
|
+
* "userId": "67e66ef64f0ea8488aba8f2f",
|
|
874
|
+
* "date": "2025-03-28",
|
|
875
|
+
* "hourlySummaries": [
|
|
876
|
+
* { "id": "6568d05351c0f5307421e196", "avg": 5, "max": 10, "min": 2 },
|
|
877
|
+
* { "id": "67e66793ae59de5bba4b262f", "avg": 7, "max": 15, "min": 3 }
|
|
878
|
+
* ]
|
|
879
|
+
* }
|
|
880
|
+
* }
|
|
881
|
+
* ```
|
|
882
|
+
*
|
|
883
|
+
* Updating the object with the id `67e66793ae59de5bba4b262f` in the `hourlySummaries` array would be done like:
|
|
884
|
+
*
|
|
885
|
+
* ```ts
|
|
886
|
+
* const documentId = '5f7b1b3b1f7b4b0001f7b4b2';
|
|
887
|
+
* const objectId = '67e66793ae59de5bba4b262f';
|
|
888
|
+
* const updateData = { avg: 8, max: 16, min: 4 };
|
|
889
|
+
* await exh.data.documents.updateObjectInArray('daily-summary', documentId, 'hourlySummaries', objectId, updateData);
|
|
890
|
+
* ```
|
|
891
|
+
*
|
|
892
|
+
* ## Access via permissions
|
|
893
|
+
* Regardless of how the access modes (described below) are set, a user is always able to perform an operation on a document if they are assigned a specific permission. This permission can come from a global role of the user or a staff enlistment role the user has in the group of the document.
|
|
894
|
+
* Permission | Scopes | Effect
|
|
895
|
+
* - | - | -
|
|
896
|
+
* `UPDATE_DOCUMENTS` | `global` | Update any document
|
|
897
|
+
* `UPDATE_DOCUMENTS:{SCHEMA_NAME}` | `global` | Update any document of the specified schema
|
|
898
|
+
* `UPDATE_DOCUMENTS` | `staff_enlistment` | Update any document belonging to the group
|
|
899
|
+
* `UPDATE_DOCUMENTS:{SCHEMA_NAME}` | `staff_enlistment` | Update any document of the specified schema belonging to the group
|
|
900
|
+
* <br>
|
|
901
|
+
*
|
|
902
|
+
* ## General access mode values
|
|
903
|
+
* The general access mode values determine if a user requires permission to perform the action for the Schema. A general access mode value is provided as one of the following strings.
|
|
904
|
+
* General updateMode value | Description
|
|
905
|
+
* - | -
|
|
906
|
+
* `"permissionRequired"` | The permissions above apply
|
|
907
|
+
* <br>
|
|
908
|
+
*
|
|
909
|
+
* ## Relational access mode values
|
|
910
|
+
* Relational access mode values are supplied as an array. When multiple relational access mode values are supplied, a user adhering to any relation in this array is allowed to perform the action on the document.
|
|
911
|
+
* Relational updateMode value | Description
|
|
912
|
+
* - | -
|
|
913
|
+
* `["creator"]` | The user that created the document can update the document.
|
|
914
|
+
* `["linkedUsers"]` | All users where their user id is in the list of userIds of the document can update the document.
|
|
915
|
+
* `["linkedGroupPatients"]` | All users that have a patient enlistment in a group that is in the list of groupIds of the document can update the document.
|
|
916
|
+
* `["linkedGroupStaff"]` | All users that have a staff enlistment in a group that is in the list of groupIds of the document can update the document.
|
|
917
|
+
* <br>
|
|
918
|
+
*
|
|
919
|
+
* ## Legacy access mode values
|
|
920
|
+
* Listed below are the deprecated values with their current equivalent
|
|
921
|
+
* Legacy updateMode value | Description
|
|
922
|
+
* - | -
|
|
923
|
+
* `"default"` | Translates to `["linkedUsers","linkedGroupStaff"]` relational access mode
|
|
924
|
+
* `"creatorOnly"` | Translates to `["creator"]` relational access mode
|
|
925
|
+
* `"disabled"` | Translates to the `"permissionRequired"` general access mode value
|
|
926
|
+
* `"linkedGroupsStaffOnly"` | Translates to `["linkedGroupStaff"]` relational access mode
|
|
927
|
+
*/
|
|
928
|
+
updateObjectInArray<UpdateData = Record<string, any>>(schemaIdOrName: ObjectId | string, documentId: ObjectId, arrayField: string, objectId: ObjectId, requestBody: UpdateData, options?: OptionsBase): Promise<AffectedRecords>;
|
|
929
|
+
/**
|
|
930
|
+
* # Remove an object from an array
|
|
931
|
+
*
|
|
932
|
+
* Remove an object from an array field in the selected document.
|
|
933
|
+
*
|
|
934
|
+
* ## Example
|
|
935
|
+
*
|
|
936
|
+
* For a schema with the name `daily-summary`, a document looking like:
|
|
937
|
+
*
|
|
938
|
+
* ```json
|
|
939
|
+
* {
|
|
940
|
+
* "id": "5f7b1b3b1f7b4b0001f7b4b2",
|
|
941
|
+
* "data": {
|
|
942
|
+
* "userId": "67e66ef64f0ea8488aba8f2f",
|
|
943
|
+
* "date": "2025-03-28",
|
|
944
|
+
* "hourlySummaries": [
|
|
945
|
+
* { "id": "6568d05351c0f5307421e196", "avg": 5, "max": 10, "min": 2 },
|
|
946
|
+
* { "id": "67e66793ae59de5bba4b262f", "avg": 7, "max": 15, "min": 3 }
|
|
947
|
+
* ]
|
|
948
|
+
* }
|
|
949
|
+
* }
|
|
950
|
+
* ```
|
|
951
|
+
*
|
|
952
|
+
* Removing the object with the id `67e66793ae59de5bba4b262f` from the `hourlySummaries` array would be done like:
|
|
953
|
+
*
|
|
954
|
+
* ```ts
|
|
955
|
+
* const documentId = '5f7b1b3b1f7b4b0001f7b4b2';
|
|
956
|
+
* const objectId = '67e66793ae59de5bba4b262f';
|
|
957
|
+
* await exh.data.documents.removeObjectFromArray('daily-summary', documentId, 'hourlySummaries', objectId);
|
|
958
|
+
* ```
|
|
959
|
+
*
|
|
960
|
+
* ## Access via permissions
|
|
961
|
+
* Regardless of how the access modes (described below) are set, a user is always able to perform an operation on a document if they are assigned a specific permission. This permission can come from a global role of the user or a staff enlistment role the user has in the group of the document.
|
|
962
|
+
* Permission | Scopes | Effect
|
|
963
|
+
* - | - | -
|
|
964
|
+
* `UPDATE_DOCUMENTS` | `global` | Update any document
|
|
965
|
+
* `UPDATE_DOCUMENTS:{SCHEMA_NAME}` | `global` | Update any document of the specified schema
|
|
966
|
+
* `UPDATE_DOCUMENTS` | `staff_enlistment` | Update any document belonging to the group
|
|
967
|
+
* `UPDATE_DOCUMENTS:{SCHEMA_NAME}` | `staff_enlistment` | Update any document of the specified schema belonging to the group
|
|
968
|
+
* <br>
|
|
969
|
+
*
|
|
970
|
+
* ## General access mode values
|
|
971
|
+
* The general access mode values determine if a user requires permission to perform the action for the Schema. A general access mode value is provided as one of the following strings.
|
|
972
|
+
* General updateMode value | Description
|
|
973
|
+
* - | -
|
|
974
|
+
* `"permissionRequired"` | The permissions above apply
|
|
975
|
+
* <br>
|
|
976
|
+
*
|
|
977
|
+
* ## Relational access mode values
|
|
978
|
+
* Relational access mode values are supplied as an array. When multiple relational access mode values are supplied, a user adhering to any relation in this array is allowed to perform the action on the document.
|
|
979
|
+
* Relational updateMode value | Description
|
|
980
|
+
* - | -
|
|
981
|
+
* `["creator"]` | The user that created the document can update the document.
|
|
982
|
+
* `["linkedUsers"]` | All users where their user id is in the list of userIds of the document can update the document.
|
|
983
|
+
* `["linkedGroupPatients"]` | All users that have a patient enlistment in a group that is in the list of groupIds of the document can update the document.
|
|
984
|
+
* `["linkedGroupStaff"]` | All users that have a staff enlistment in a group that is in the list of groupIds of the document can update the document.
|
|
985
|
+
* <br>
|
|
986
|
+
*
|
|
987
|
+
* ## Legacy access mode values
|
|
988
|
+
* Listed below are the deprecated values with their current equivalent
|
|
989
|
+
* Legacy updateMode value | Description
|
|
990
|
+
* - | -
|
|
991
|
+
* `"default"` | Translates to `["linkedUsers","linkedGroupStaff"]` relational access mode
|
|
992
|
+
* `"creatorOnly"` | Translates to `["creator"]` relational access mode
|
|
993
|
+
* `"disabled"` | Translates to the `"permissionRequired"` general access mode value
|
|
994
|
+
* `"linkedGroupsStaffOnly"` | Translates to `["linkedGroupStaff"]` relational access mode
|
|
995
|
+
*/
|
|
996
|
+
removeObjectFromArray(schemaIdOrName: ObjectId | string, documentId: ObjectId, arrayField: string, objectId: ObjectId, options?: OptionsBase): Promise<AffectedRecords>;
|
|
778
997
|
/**
|
|
779
998
|
* # Transition a document
|
|
780
999
|
*
|
package/build/types/types.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ export * from './services/payments/types';
|
|
|
15
15
|
export * from './services/localizations/types';
|
|
16
16
|
export * from './services/profiles/types';
|
|
17
17
|
export * from './services/notifications/types';
|
|
18
|
-
export * from './services/notificationsV2/types';
|
|
19
18
|
export * from './services/events/types';
|
|
20
19
|
export interface ParamsOauth1WithEmail {
|
|
21
20
|
email: string;
|
package/build/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "8.5.0-feat-
|
|
1
|
+
export declare const version = "8.5.0-feat-84-2fc5d36";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@extrahorizon/javascript-sdk",
|
|
3
|
-
"version": "8.5.0-feat-
|
|
3
|
+
"version": "8.5.0-feat-84-2fc5d36",
|
|
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",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AuthHttpClient } from '../../types';
|
|
2
|
-
import health from './health';
|
|
3
|
-
import { NotificationV2Service } from './types';
|
|
4
|
-
import { NotificationV2UserService } from './users/types';
|
|
5
|
-
export declare const notificationsV2Service: (httpWithAuth: AuthHttpClient) => ReturnType<typeof health> & NotificationV2Service & {
|
|
6
|
-
users: NotificationV2UserService;
|
|
7
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { AuthHttpClient } from '../../types';
|
|
2
|
-
import { HttpClient } from '../http-client';
|
|
3
|
-
import { NotificationV2Service } from './types';
|
|
4
|
-
declare const _default: (client: HttpClient, httpWithAuth: AuthHttpClient) => NotificationV2Service;
|
|
5
|
-
export default _default;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { ObjectId, OptionsBase, OptionsWithRql, PagedResultWithPager } from '../types';
|
|
2
|
-
export * from './users/types';
|
|
3
|
-
export interface NotificationV2Creation<T extends Record<string, string> = Record<string, string>> {
|
|
4
|
-
targetUserId: string;
|
|
5
|
-
title: string;
|
|
6
|
-
body: string;
|
|
7
|
-
data?: T;
|
|
8
|
-
}
|
|
9
|
-
export interface NotificationV2<T extends Record<string, string> = Record<string, string>> extends NotificationV2Creation<T> {
|
|
10
|
-
id: ObjectId;
|
|
11
|
-
creatorId: ObjectId;
|
|
12
|
-
sent: boolean;
|
|
13
|
-
creationTimestamp: Date;
|
|
14
|
-
updateTimestamp: Date;
|
|
15
|
-
}
|
|
16
|
-
export interface NotificationV2Service {
|
|
17
|
-
/**
|
|
18
|
-
* # Create a notification
|
|
19
|
-
*
|
|
20
|
-
* ## Access via permissions
|
|
21
|
-
* Permission | Scopes | Effect
|
|
22
|
-
* - | - | -
|
|
23
|
-
* `CREATE_NOTIFICATIONS` | `global` | Create notifications for any user
|
|
24
|
-
* `CREATE_NOTIFICATIONS` | `group` | Create notifications for any patient in group
|
|
25
|
-
* none | | Create notifications for yourself
|
|
26
|
-
*
|
|
27
|
-
* # Interface
|
|
28
|
-
* @param requestBody
|
|
29
|
-
* @param options
|
|
30
|
-
* @returns NotificationV2<T>
|
|
31
|
-
*/
|
|
32
|
-
create<T extends Record<string, string>>(requestBody: NotificationV2Creation<T>, options?: OptionsBase): Promise<NotificationV2<T>>;
|
|
33
|
-
/**
|
|
34
|
-
* # Request a list of notifications
|
|
35
|
-
*
|
|
36
|
-
* ## Access via permissions
|
|
37
|
-
* Permission | Scopes | Effect
|
|
38
|
-
* - | - | -
|
|
39
|
-
* `VIEW_NOTIFICATIONS` | `global` | View all notifications
|
|
40
|
-
*
|
|
41
|
-
* # Interface
|
|
42
|
-
* @returns PagedResultWithPager<NotificationV2<T>>
|
|
43
|
-
*/
|
|
44
|
-
find<T extends Record<string, string>>(options?: OptionsWithRql): Promise<PagedResultWithPager<NotificationV2<T>>>;
|
|
45
|
-
/**
|
|
46
|
-
* # Request a list of notifications
|
|
47
|
-
*
|
|
48
|
-
* Do not pass in an rql with limit operator!
|
|
49
|
-
*
|
|
50
|
-
* ## Access via permissions
|
|
51
|
-
* Permission | Scopes | Effect
|
|
52
|
-
* - | - | -
|
|
53
|
-
* `VIEW_NOTIFICATIONS` | `global` | View all notifications
|
|
54
|
-
*
|
|
55
|
-
* # Interface
|
|
56
|
-
* @returns NotificationV2<T>[]
|
|
57
|
-
*/
|
|
58
|
-
findAll<T extends Record<string, string>>(options?: OptionsWithRql): Promise<NotificationV2<T>[]>;
|
|
59
|
-
/**
|
|
60
|
-
* # Request a list of notifications created for a user
|
|
61
|
-
*
|
|
62
|
-
* ## Access via permissions
|
|
63
|
-
* Permission | Scopes | Effect
|
|
64
|
-
* - | - | -
|
|
65
|
-
* `VIEW_NOTIFICATIONS` | `global` | View all notifications
|
|
66
|
-
*
|
|
67
|
-
* # Interface
|
|
68
|
-
* @param targetUserId the user id to search for
|
|
69
|
-
* @returns PagedResultWithPager<NotificationV2<T>>
|
|
70
|
-
*/
|
|
71
|
-
findByTargetUserId<T extends Record<string, string>>(targetUserId: ObjectId, options?: OptionsWithRql): Promise<PagedResultWithPager<NotificationV2<T>>>;
|
|
72
|
-
/**
|
|
73
|
-
* # Request the first notification found
|
|
74
|
-
*
|
|
75
|
-
* ## Access via permissions
|
|
76
|
-
* Permission | Scopes | Effect
|
|
77
|
-
* - | - | -
|
|
78
|
-
* `VIEW_NOTIFICATIONS` | `global` | View all notifications
|
|
79
|
-
*
|
|
80
|
-
* # Interface
|
|
81
|
-
* @returns NotificationV2<T> | undefined
|
|
82
|
-
*/
|
|
83
|
-
findFirst<T extends Record<string, string>>(options?: OptionsWithRql): Promise<NotificationV2<T> | undefined>;
|
|
84
|
-
/**
|
|
85
|
-
* # Request a notification by id
|
|
86
|
-
*
|
|
87
|
-
* ## Access via permissions
|
|
88
|
-
* Permission | Scopes | Effect
|
|
89
|
-
* - | - | -
|
|
90
|
-
* `VIEW_NOTIFICATIONS` | `global` | View all notifications
|
|
91
|
-
*
|
|
92
|
-
* # Interface
|
|
93
|
-
* @param notificationId the Id to search for
|
|
94
|
-
* @returns NotificationV2<T> | undefined
|
|
95
|
-
*/
|
|
96
|
-
findById<T extends Record<string, string>>(notificationId: ObjectId, options?: OptionsBase): Promise<NotificationV2<T> | undefined>;
|
|
97
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { AuthHttpClient } from '../../../types';
|
|
2
|
-
import { HttpClient } from '../../http-client';
|
|
3
|
-
import { NotificationV2UserService } from './types';
|
|
4
|
-
declare const _default: (client: HttpClient, httpWithAuth: AuthHttpClient) => NotificationV2UserService;
|
|
5
|
-
export default _default;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { AffectedRecords, ObjectId, OptionsBase, OptionsWithRql, PagedResultWithPager } from '../../types';
|
|
2
|
-
export interface NotificationV2UserUpsert {
|
|
3
|
-
fcmToken: string;
|
|
4
|
-
}
|
|
5
|
-
export interface NotificationV2User extends NotificationV2UserUpsert {
|
|
6
|
-
id: ObjectId;
|
|
7
|
-
creationTimestamp: Date;
|
|
8
|
-
updateTimestamp: Date;
|
|
9
|
-
}
|
|
10
|
-
export interface NotificationV2UserService {
|
|
11
|
-
/**
|
|
12
|
-
* # Update a user its notification settings
|
|
13
|
-
*
|
|
14
|
-
* Updates (or creates if non exists) a user its settings for the specified user id.
|
|
15
|
-
*
|
|
16
|
-
* ## Access via permissions
|
|
17
|
-
* Permission | Scopes | Effect
|
|
18
|
-
* - | - | -
|
|
19
|
-
* `UPDATE_NOTIFICATION_SETTINGS` | `global` | Update the notification settings of any user
|
|
20
|
-
* none | | Update your own notification settings
|
|
21
|
-
*
|
|
22
|
-
* # Interface
|
|
23
|
-
* @param requestBody
|
|
24
|
-
* @param options
|
|
25
|
-
* @returns AffectedRecords
|
|
26
|
-
*/
|
|
27
|
-
update(userId: ObjectId, requestBody: NotificationV2UserUpsert, options?: OptionsBase): Promise<AffectedRecords>;
|
|
28
|
-
/**
|
|
29
|
-
* # Request a list of user notification settings
|
|
30
|
-
*
|
|
31
|
-
* ## Access via permissions
|
|
32
|
-
* Permission | Scopes | Effect
|
|
33
|
-
* - | - | -
|
|
34
|
-
* `VIEW_NOTIFICATION_SETTINGS` | `global` | View all notifications
|
|
35
|
-
*
|
|
36
|
-
* # Interface
|
|
37
|
-
* @returns PagedResultWithPager<NotificationV2User>
|
|
38
|
-
*/
|
|
39
|
-
find(options?: OptionsWithRql): Promise<PagedResultWithPager<NotificationV2User>>;
|
|
40
|
-
/**
|
|
41
|
-
* # Request a list of user notification settings
|
|
42
|
-
*
|
|
43
|
-
* Do not pass in an rql with limit operator!
|
|
44
|
-
*
|
|
45
|
-
* ## Access via permissions
|
|
46
|
-
* Permission | Scopes | Effect
|
|
47
|
-
* - | - | -
|
|
48
|
-
* `VIEW_NOTIFICATION_SETTINGS` | `global` | View all notifications
|
|
49
|
-
*
|
|
50
|
-
* # Interface
|
|
51
|
-
* @returns NotificationV2User[]
|
|
52
|
-
*/
|
|
53
|
-
findAll(options?: OptionsWithRql): Promise<NotificationV2User[]>;
|
|
54
|
-
/**
|
|
55
|
-
* # Request notification settings for a specific user
|
|
56
|
-
*
|
|
57
|
-
* ## Access via permissions
|
|
58
|
-
* Permission | Scopes | Effect
|
|
59
|
-
* - | - | -
|
|
60
|
-
* `VIEW_NOTIFICATION_SETTINGS` | `global` | View all notifications
|
|
61
|
-
*
|
|
62
|
-
* # Interface
|
|
63
|
-
* @param userId the user id to search for
|
|
64
|
-
* @returns NotificationV2User | undefined
|
|
65
|
-
*/
|
|
66
|
-
findByUserId(userId: ObjectId, options?: OptionsWithRql): Promise<NotificationV2User | undefined>;
|
|
67
|
-
/**
|
|
68
|
-
* # Request the first user notification settings
|
|
69
|
-
*
|
|
70
|
-
* ## Access via permissions
|
|
71
|
-
* Permission | Scopes | Effect
|
|
72
|
-
* - | - | -
|
|
73
|
-
* `VIEW_NOTIFICATION_SETTINGS` | `global` | View all notifications
|
|
74
|
-
*
|
|
75
|
-
* # Interface
|
|
76
|
-
* @returns NotificationV2User | undefined
|
|
77
|
-
*/
|
|
78
|
-
findFirst(options?: OptionsWithRql): Promise<NotificationV2User | undefined>;
|
|
79
|
-
}
|