@extrahorizon/javascript-sdk 8.5.0 → 8.6.0-feat-94-2fc8886
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 +12 -0
- package/build/index.cjs.js +119 -11
- package/build/index.mjs +119 -11
- package/build/types/client.d.ts +6 -1
- package/build/types/constants.d.ts +1 -0
- package/build/types/mockType.d.ts +57 -0
- package/build/types/services/data/types.d.ts +219 -0
- package/build/types/services/index.d.ts +1 -0
- package/build/types/services/notificationsV2/health.d.ts +9 -0
- package/build/types/services/notificationsV2/index.d.ts +7 -0
- package/build/types/services/notificationsV2/notificationsV2.d.ts +5 -0
- package/build/types/services/notificationsV2/types.d.ts +109 -0
- package/build/types/services/notificationsV2/users/index.d.ts +5 -0
- package/build/types/services/notificationsV2/users/types.d.ts +79 -0
- package/build/types/services/payments/types.d.ts +9 -0
- package/build/types/types.d.ts +1 -0
- package/build/types/version.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ 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.6.0]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Introduced methods to manage objects in arrays in the Data Service
|
|
12
|
+
- `exh.data.documents.appendObjectToArray`
|
|
13
|
+
- `exh.data.documents.updateObjectInArray`
|
|
14
|
+
- `exh.data.documents.removeObjectFromArray`
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- Added missing properties `userId` and `applicationId` for the method `sdk.payments.appStore.completeTransaction`
|
|
18
|
+
- Bumped Axios version to `0.30` to fix vulnerability `CVE-2025-27152`
|
|
19
|
+
|
|
8
20
|
## [8.5.0]
|
|
9
21
|
|
|
10
22
|
### Added
|
package/build/index.cjs.js
CHANGED
|
@@ -1636,6 +1636,7 @@ 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';
|
|
1639
1640
|
const LOCALIZATIONS_BASE = '/localizations/v1';
|
|
1640
1641
|
const EVENTS_BASE = '/events/v1';
|
|
1641
1642
|
const LOGS_BASE = '/logs/v1';
|
|
@@ -3596,6 +3597,21 @@ var documents = (client, httpAuth) => {
|
|
|
3596
3597
|
async removeFields(schemaIdOrName, documentId, requestBody, options) {
|
|
3597
3598
|
return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/deleteFields${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, requestBody, options)).data;
|
|
3598
3599
|
},
|
|
3600
|
+
async appendObjectToArray(schemaIdOrName, documentId, arrayField, requestBody, options) {
|
|
3601
|
+
return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/${arrayField}/`, requestBody, {
|
|
3602
|
+
...options,
|
|
3603
|
+
customKeys: ['*'],
|
|
3604
|
+
})).data;
|
|
3605
|
+
},
|
|
3606
|
+
async updateObjectInArray(schemaIdOrName, documentId, arrayField, objectId, requestBody, options) {
|
|
3607
|
+
return (await client.put(httpAuth, `/${schemaIdOrName}/documents/${documentId}/${arrayField}/${objectId}`, requestBody, {
|
|
3608
|
+
...options,
|
|
3609
|
+
customRequestKeys: ['*'],
|
|
3610
|
+
})).data;
|
|
3611
|
+
},
|
|
3612
|
+
async removeObjectFromArray(schemaIdOrName, documentId, arrayField, objectId, options) {
|
|
3613
|
+
return (await client.delete(httpAuth, `/${schemaIdOrName}/documents/${documentId}/${arrayField}/${objectId}`, options)).data;
|
|
3614
|
+
},
|
|
3599
3615
|
async transition(schemaIdOrName, documentId, requestBody, options) {
|
|
3600
3616
|
return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/transition${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, requestBody, options)).data;
|
|
3601
3617
|
},
|
|
@@ -4214,7 +4230,7 @@ var groupRoles = (client, httpWithAuth) => ({
|
|
|
4214
4230
|
},
|
|
4215
4231
|
});
|
|
4216
4232
|
|
|
4217
|
-
var health$
|
|
4233
|
+
var health$6 = (userClient, http) => ({
|
|
4218
4234
|
/**
|
|
4219
4235
|
* Perform a health check
|
|
4220
4236
|
* @returns {boolean} success
|
|
@@ -4411,7 +4427,7 @@ const usersService = (httpWithAuth, http) => {
|
|
|
4411
4427
|
basePath: USER_BASE,
|
|
4412
4428
|
transformRequestData: decamelizeRequestData,
|
|
4413
4429
|
});
|
|
4414
|
-
const healthMethods = health$
|
|
4430
|
+
const healthMethods = health$6(userClient, httpWithAuth);
|
|
4415
4431
|
const usersMethods = users$1(userClient, httpWithAuth, http);
|
|
4416
4432
|
const groupRolesMethods = groupRoles(userClient, httpWithAuth);
|
|
4417
4433
|
const globalRolesMethods = globalRoles(userClient, httpWithAuth);
|
|
@@ -4792,7 +4808,7 @@ var appStoreSubscriptions = (client, httpAuth) => ({
|
|
|
4792
4808
|
},
|
|
4793
4809
|
});
|
|
4794
4810
|
|
|
4795
|
-
var health$
|
|
4811
|
+
var health$5 = (client, httpAuth) => ({
|
|
4796
4812
|
/**
|
|
4797
4813
|
* Check if the service is available
|
|
4798
4814
|
* @returns true if service is up and running
|
|
@@ -4998,7 +5014,7 @@ const paymentsService = (httpWithAuth) => {
|
|
|
4998
5014
|
basePath: PAYMENTS_BASE,
|
|
4999
5015
|
});
|
|
5000
5016
|
return {
|
|
5001
|
-
...health$
|
|
5017
|
+
...health$5(client, httpWithAuth),
|
|
5002
5018
|
products: products(client, httpWithAuth),
|
|
5003
5019
|
orders: orders(client, httpWithAuth),
|
|
5004
5020
|
subscriptions: subscriptions$1(client, httpWithAuth),
|
|
@@ -5020,7 +5036,7 @@ var countries = (client, httpAuth) => ({
|
|
|
5020
5036
|
},
|
|
5021
5037
|
});
|
|
5022
5038
|
|
|
5023
|
-
var health$
|
|
5039
|
+
var health$4 = (client, http) => ({
|
|
5024
5040
|
/**
|
|
5025
5041
|
* Perform a health check
|
|
5026
5042
|
* @returns {boolean} success
|
|
@@ -5073,7 +5089,7 @@ const localizationsService = (httpWithAuth) => {
|
|
|
5073
5089
|
basePath: LOCALIZATIONS_BASE,
|
|
5074
5090
|
});
|
|
5075
5091
|
return {
|
|
5076
|
-
...health$
|
|
5092
|
+
...health$4(client, httpWithAuth),
|
|
5077
5093
|
...localizations(client, httpWithAuth),
|
|
5078
5094
|
...countries(client, httpWithAuth),
|
|
5079
5095
|
...languages(client, httpWithAuth),
|
|
@@ -5098,7 +5114,7 @@ var groups = (client, httpAuth) => ({
|
|
|
5098
5114
|
},
|
|
5099
5115
|
});
|
|
5100
5116
|
|
|
5101
|
-
var health$
|
|
5117
|
+
var health$3 = (client, httpAuth) => ({
|
|
5102
5118
|
/**
|
|
5103
5119
|
* Perform a health check for profiles service
|
|
5104
5120
|
* @returns {boolean} success
|
|
@@ -5188,14 +5204,14 @@ const profilesService = (httpWithAuth) => {
|
|
|
5188
5204
|
basePath: PROFILES_BASE,
|
|
5189
5205
|
});
|
|
5190
5206
|
return {
|
|
5191
|
-
...health$
|
|
5207
|
+
...health$3(client, httpWithAuth),
|
|
5192
5208
|
...profiles(client, httpWithAuth),
|
|
5193
5209
|
groups: groups(client, httpWithAuth),
|
|
5194
5210
|
logs: logs(client, httpWithAuth),
|
|
5195
5211
|
};
|
|
5196
5212
|
};
|
|
5197
5213
|
|
|
5198
|
-
var health$
|
|
5214
|
+
var health$2 = (client, http) => ({
|
|
5199
5215
|
/**
|
|
5200
5216
|
* Perform a health check
|
|
5201
5217
|
* @returns {boolean} success
|
|
@@ -5282,12 +5298,103 @@ const notificationsService = (httpWithAuth) => {
|
|
|
5282
5298
|
transformRequestData: decamelizeRequestData,
|
|
5283
5299
|
});
|
|
5284
5300
|
return {
|
|
5285
|
-
...health$
|
|
5301
|
+
...health$2(client, httpWithAuth),
|
|
5286
5302
|
...notifications(client, httpWithAuth),
|
|
5287
5303
|
settings: settings(client, httpWithAuth),
|
|
5288
5304
|
};
|
|
5289
5305
|
};
|
|
5290
5306
|
|
|
5307
|
+
var health$1 = (client, http) => ({
|
|
5308
|
+
/**
|
|
5309
|
+
* Perform a health check
|
|
5310
|
+
* @returns {boolean} success
|
|
5311
|
+
*/
|
|
5312
|
+
async health() {
|
|
5313
|
+
const result = await client.get(http, '/health');
|
|
5314
|
+
return result.status === exports.Results.Success;
|
|
5315
|
+
},
|
|
5316
|
+
});
|
|
5317
|
+
|
|
5318
|
+
var notificationsV2 = (client, httpWithAuth) => {
|
|
5319
|
+
async function find(options) {
|
|
5320
|
+
const result = await client.get(httpWithAuth, `/${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, {
|
|
5321
|
+
...options,
|
|
5322
|
+
customResponseKeys: ['data.data'],
|
|
5323
|
+
});
|
|
5324
|
+
return result.data;
|
|
5325
|
+
}
|
|
5326
|
+
return {
|
|
5327
|
+
async create(requestBody, options) {
|
|
5328
|
+
const result = await client.post(httpWithAuth, '/', requestBody, {
|
|
5329
|
+
...options,
|
|
5330
|
+
customKeys: ['data'],
|
|
5331
|
+
});
|
|
5332
|
+
return result.data;
|
|
5333
|
+
},
|
|
5334
|
+
async find(options) {
|
|
5335
|
+
const result = await find(options);
|
|
5336
|
+
return addPagersFn(find, options, result);
|
|
5337
|
+
},
|
|
5338
|
+
async findAll(options) {
|
|
5339
|
+
return findAllGeneric(find, options);
|
|
5340
|
+
},
|
|
5341
|
+
async findByTargetUserId(targetUserId, options) {
|
|
5342
|
+
const rqlWithTargetUserId = rqlBuilder(options === null || options === void 0 ? void 0 : options.rql).eq('targetUserId', targetUserId).build();
|
|
5343
|
+
const result = await find({ ...options, rql: rqlWithTargetUserId });
|
|
5344
|
+
return addPagersFn(find, { ...options, rql: rqlWithTargetUserId }, result);
|
|
5345
|
+
},
|
|
5346
|
+
async findFirst(options) {
|
|
5347
|
+
const result = await find(options);
|
|
5348
|
+
return result.data[0];
|
|
5349
|
+
},
|
|
5350
|
+
async findById(notificationId, options) {
|
|
5351
|
+
const rqlWithNotificationId = rqlBuilder().eq('id', notificationId).build();
|
|
5352
|
+
const result = await find({ ...options, rql: rqlWithNotificationId });
|
|
5353
|
+
return result.data[0];
|
|
5354
|
+
},
|
|
5355
|
+
};
|
|
5356
|
+
};
|
|
5357
|
+
|
|
5358
|
+
var notificationV2Users = (client, httpWithAuth) => {
|
|
5359
|
+
async function find(options) {
|
|
5360
|
+
const result = await client.get(httpWithAuth, `/users/${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options);
|
|
5361
|
+
return result.data;
|
|
5362
|
+
}
|
|
5363
|
+
return {
|
|
5364
|
+
async update(userId, requestBody, options) {
|
|
5365
|
+
const result = await client.put(httpWithAuth, `/users/${userId}`, requestBody, options);
|
|
5366
|
+
return result.data;
|
|
5367
|
+
},
|
|
5368
|
+
async find(options) {
|
|
5369
|
+
const result = await find(options);
|
|
5370
|
+
return addPagersFn(find, options, result);
|
|
5371
|
+
},
|
|
5372
|
+
async findAll(options) {
|
|
5373
|
+
return findAllGeneric(find, options);
|
|
5374
|
+
},
|
|
5375
|
+
async findByUserId(userId, options) {
|
|
5376
|
+
const rqlWithUserId = rqlBuilder(options === null || options === void 0 ? void 0 : options.rql).eq('id', userId).build();
|
|
5377
|
+
const result = await find({ ...options, rql: rqlWithUserId });
|
|
5378
|
+
return result.data[0];
|
|
5379
|
+
},
|
|
5380
|
+
async findFirst(options) {
|
|
5381
|
+
const result = await find(options);
|
|
5382
|
+
return result.data[0];
|
|
5383
|
+
},
|
|
5384
|
+
};
|
|
5385
|
+
};
|
|
5386
|
+
|
|
5387
|
+
const notificationsV2Service = (httpWithAuth) => {
|
|
5388
|
+
const client = httpClient({
|
|
5389
|
+
basePath: NOTIFICATIONS_V2_BASE,
|
|
5390
|
+
});
|
|
5391
|
+
return {
|
|
5392
|
+
...health$1(client, httpWithAuth),
|
|
5393
|
+
...notificationsV2(client, httpWithAuth),
|
|
5394
|
+
users: notificationV2Users(client, httpWithAuth),
|
|
5395
|
+
};
|
|
5396
|
+
};
|
|
5397
|
+
|
|
5291
5398
|
var events = (client, httpAuth) => ({
|
|
5292
5399
|
async find(options) {
|
|
5293
5400
|
return (await client.get(httpAuth, `/${(options === null || options === void 0 ? void 0 : options.rql) || ''}`)).data;
|
|
@@ -5380,7 +5487,7 @@ const logsService = (httpWithAuth) => {
|
|
|
5380
5487
|
};
|
|
5381
5488
|
};
|
|
5382
5489
|
|
|
5383
|
-
const version = '8.
|
|
5490
|
+
const version = '8.6.0-feat-94-2fc8886';
|
|
5384
5491
|
|
|
5385
5492
|
/**
|
|
5386
5493
|
* Create ExtraHorizon client.
|
|
@@ -5420,6 +5527,7 @@ function createClient(rawConfig) {
|
|
|
5420
5527
|
localizations: localizationsService(httpWithAuth),
|
|
5421
5528
|
profiles: profilesService(httpWithAuth),
|
|
5422
5529
|
notifications: notificationsService(httpWithAuth),
|
|
5530
|
+
notificationsV2: notificationsV2Service(httpWithAuth),
|
|
5423
5531
|
events: eventsService(httpWithAuth),
|
|
5424
5532
|
logs: logsService(httpWithAuth),
|
|
5425
5533
|
auth: {
|
package/build/index.mjs
CHANGED
|
@@ -1606,6 +1606,7 @@ 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';
|
|
1609
1610
|
const LOCALIZATIONS_BASE = '/localizations/v1';
|
|
1610
1611
|
const EVENTS_BASE = '/events/v1';
|
|
1611
1612
|
const LOGS_BASE = '/logs/v1';
|
|
@@ -3566,6 +3567,21 @@ var documents = (client, httpAuth) => {
|
|
|
3566
3567
|
async removeFields(schemaIdOrName, documentId, requestBody, options) {
|
|
3567
3568
|
return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/deleteFields${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, requestBody, options)).data;
|
|
3568
3569
|
},
|
|
3570
|
+
async appendObjectToArray(schemaIdOrName, documentId, arrayField, requestBody, options) {
|
|
3571
|
+
return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/${arrayField}/`, requestBody, {
|
|
3572
|
+
...options,
|
|
3573
|
+
customKeys: ['*'],
|
|
3574
|
+
})).data;
|
|
3575
|
+
},
|
|
3576
|
+
async updateObjectInArray(schemaIdOrName, documentId, arrayField, objectId, requestBody, options) {
|
|
3577
|
+
return (await client.put(httpAuth, `/${schemaIdOrName}/documents/${documentId}/${arrayField}/${objectId}`, requestBody, {
|
|
3578
|
+
...options,
|
|
3579
|
+
customRequestKeys: ['*'],
|
|
3580
|
+
})).data;
|
|
3581
|
+
},
|
|
3582
|
+
async removeObjectFromArray(schemaIdOrName, documentId, arrayField, objectId, options) {
|
|
3583
|
+
return (await client.delete(httpAuth, `/${schemaIdOrName}/documents/${documentId}/${arrayField}/${objectId}`, options)).data;
|
|
3584
|
+
},
|
|
3569
3585
|
async transition(schemaIdOrName, documentId, requestBody, options) {
|
|
3570
3586
|
return (await client.post(httpAuth, `/${schemaIdOrName}/documents/${documentId}/transition${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, requestBody, options)).data;
|
|
3571
3587
|
},
|
|
@@ -4184,7 +4200,7 @@ var groupRoles = (client, httpWithAuth) => ({
|
|
|
4184
4200
|
},
|
|
4185
4201
|
});
|
|
4186
4202
|
|
|
4187
|
-
var health$
|
|
4203
|
+
var health$6 = (userClient, http) => ({
|
|
4188
4204
|
/**
|
|
4189
4205
|
* Perform a health check
|
|
4190
4206
|
* @returns {boolean} success
|
|
@@ -4381,7 +4397,7 @@ const usersService = (httpWithAuth, http) => {
|
|
|
4381
4397
|
basePath: USER_BASE,
|
|
4382
4398
|
transformRequestData: decamelizeRequestData,
|
|
4383
4399
|
});
|
|
4384
|
-
const healthMethods = health$
|
|
4400
|
+
const healthMethods = health$6(userClient, httpWithAuth);
|
|
4385
4401
|
const usersMethods = users$1(userClient, httpWithAuth, http);
|
|
4386
4402
|
const groupRolesMethods = groupRoles(userClient, httpWithAuth);
|
|
4387
4403
|
const globalRolesMethods = globalRoles(userClient, httpWithAuth);
|
|
@@ -4762,7 +4778,7 @@ var appStoreSubscriptions = (client, httpAuth) => ({
|
|
|
4762
4778
|
},
|
|
4763
4779
|
});
|
|
4764
4780
|
|
|
4765
|
-
var health$
|
|
4781
|
+
var health$5 = (client, httpAuth) => ({
|
|
4766
4782
|
/**
|
|
4767
4783
|
* Check if the service is available
|
|
4768
4784
|
* @returns true if service is up and running
|
|
@@ -4968,7 +4984,7 @@ const paymentsService = (httpWithAuth) => {
|
|
|
4968
4984
|
basePath: PAYMENTS_BASE,
|
|
4969
4985
|
});
|
|
4970
4986
|
return {
|
|
4971
|
-
...health$
|
|
4987
|
+
...health$5(client, httpWithAuth),
|
|
4972
4988
|
products: products(client, httpWithAuth),
|
|
4973
4989
|
orders: orders(client, httpWithAuth),
|
|
4974
4990
|
subscriptions: subscriptions$1(client, httpWithAuth),
|
|
@@ -4990,7 +5006,7 @@ var countries = (client, httpAuth) => ({
|
|
|
4990
5006
|
},
|
|
4991
5007
|
});
|
|
4992
5008
|
|
|
4993
|
-
var health$
|
|
5009
|
+
var health$4 = (client, http) => ({
|
|
4994
5010
|
/**
|
|
4995
5011
|
* Perform a health check
|
|
4996
5012
|
* @returns {boolean} success
|
|
@@ -5043,7 +5059,7 @@ const localizationsService = (httpWithAuth) => {
|
|
|
5043
5059
|
basePath: LOCALIZATIONS_BASE,
|
|
5044
5060
|
});
|
|
5045
5061
|
return {
|
|
5046
|
-
...health$
|
|
5062
|
+
...health$4(client, httpWithAuth),
|
|
5047
5063
|
...localizations(client, httpWithAuth),
|
|
5048
5064
|
...countries(client, httpWithAuth),
|
|
5049
5065
|
...languages(client, httpWithAuth),
|
|
@@ -5068,7 +5084,7 @@ var groups = (client, httpAuth) => ({
|
|
|
5068
5084
|
},
|
|
5069
5085
|
});
|
|
5070
5086
|
|
|
5071
|
-
var health$
|
|
5087
|
+
var health$3 = (client, httpAuth) => ({
|
|
5072
5088
|
/**
|
|
5073
5089
|
* Perform a health check for profiles service
|
|
5074
5090
|
* @returns {boolean} success
|
|
@@ -5158,14 +5174,14 @@ const profilesService = (httpWithAuth) => {
|
|
|
5158
5174
|
basePath: PROFILES_BASE,
|
|
5159
5175
|
});
|
|
5160
5176
|
return {
|
|
5161
|
-
...health$
|
|
5177
|
+
...health$3(client, httpWithAuth),
|
|
5162
5178
|
...profiles(client, httpWithAuth),
|
|
5163
5179
|
groups: groups(client, httpWithAuth),
|
|
5164
5180
|
logs: logs(client, httpWithAuth),
|
|
5165
5181
|
};
|
|
5166
5182
|
};
|
|
5167
5183
|
|
|
5168
|
-
var health$
|
|
5184
|
+
var health$2 = (client, http) => ({
|
|
5169
5185
|
/**
|
|
5170
5186
|
* Perform a health check
|
|
5171
5187
|
* @returns {boolean} success
|
|
@@ -5252,12 +5268,103 @@ const notificationsService = (httpWithAuth) => {
|
|
|
5252
5268
|
transformRequestData: decamelizeRequestData,
|
|
5253
5269
|
});
|
|
5254
5270
|
return {
|
|
5255
|
-
...health$
|
|
5271
|
+
...health$2(client, httpWithAuth),
|
|
5256
5272
|
...notifications(client, httpWithAuth),
|
|
5257
5273
|
settings: settings(client, httpWithAuth),
|
|
5258
5274
|
};
|
|
5259
5275
|
};
|
|
5260
5276
|
|
|
5277
|
+
var health$1 = (client, http) => ({
|
|
5278
|
+
/**
|
|
5279
|
+
* Perform a health check
|
|
5280
|
+
* @returns {boolean} success
|
|
5281
|
+
*/
|
|
5282
|
+
async health() {
|
|
5283
|
+
const result = await client.get(http, '/health');
|
|
5284
|
+
return result.status === Results.Success;
|
|
5285
|
+
},
|
|
5286
|
+
});
|
|
5287
|
+
|
|
5288
|
+
var notificationsV2 = (client, httpWithAuth) => {
|
|
5289
|
+
async function find(options) {
|
|
5290
|
+
const result = await client.get(httpWithAuth, `/${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, {
|
|
5291
|
+
...options,
|
|
5292
|
+
customResponseKeys: ['data.data'],
|
|
5293
|
+
});
|
|
5294
|
+
return result.data;
|
|
5295
|
+
}
|
|
5296
|
+
return {
|
|
5297
|
+
async create(requestBody, options) {
|
|
5298
|
+
const result = await client.post(httpWithAuth, '/', requestBody, {
|
|
5299
|
+
...options,
|
|
5300
|
+
customKeys: ['data'],
|
|
5301
|
+
});
|
|
5302
|
+
return result.data;
|
|
5303
|
+
},
|
|
5304
|
+
async find(options) {
|
|
5305
|
+
const result = await find(options);
|
|
5306
|
+
return addPagersFn(find, options, result);
|
|
5307
|
+
},
|
|
5308
|
+
async findAll(options) {
|
|
5309
|
+
return findAllGeneric(find, options);
|
|
5310
|
+
},
|
|
5311
|
+
async findByTargetUserId(targetUserId, options) {
|
|
5312
|
+
const rqlWithTargetUserId = rqlBuilder(options === null || options === void 0 ? void 0 : options.rql).eq('targetUserId', targetUserId).build();
|
|
5313
|
+
const result = await find({ ...options, rql: rqlWithTargetUserId });
|
|
5314
|
+
return addPagersFn(find, { ...options, rql: rqlWithTargetUserId }, result);
|
|
5315
|
+
},
|
|
5316
|
+
async findFirst(options) {
|
|
5317
|
+
const result = await find(options);
|
|
5318
|
+
return result.data[0];
|
|
5319
|
+
},
|
|
5320
|
+
async findById(notificationId, options) {
|
|
5321
|
+
const rqlWithNotificationId = rqlBuilder().eq('id', notificationId).build();
|
|
5322
|
+
const result = await find({ ...options, rql: rqlWithNotificationId });
|
|
5323
|
+
return result.data[0];
|
|
5324
|
+
},
|
|
5325
|
+
};
|
|
5326
|
+
};
|
|
5327
|
+
|
|
5328
|
+
var notificationV2Users = (client, httpWithAuth) => {
|
|
5329
|
+
async function find(options) {
|
|
5330
|
+
const result = await client.get(httpWithAuth, `/users/${(options === null || options === void 0 ? void 0 : options.rql) || ''}`, options);
|
|
5331
|
+
return result.data;
|
|
5332
|
+
}
|
|
5333
|
+
return {
|
|
5334
|
+
async update(userId, requestBody, options) {
|
|
5335
|
+
const result = await client.put(httpWithAuth, `/users/${userId}`, requestBody, options);
|
|
5336
|
+
return result.data;
|
|
5337
|
+
},
|
|
5338
|
+
async find(options) {
|
|
5339
|
+
const result = await find(options);
|
|
5340
|
+
return addPagersFn(find, options, result);
|
|
5341
|
+
},
|
|
5342
|
+
async findAll(options) {
|
|
5343
|
+
return findAllGeneric(find, options);
|
|
5344
|
+
},
|
|
5345
|
+
async findByUserId(userId, options) {
|
|
5346
|
+
const rqlWithUserId = rqlBuilder(options === null || options === void 0 ? void 0 : options.rql).eq('id', userId).build();
|
|
5347
|
+
const result = await find({ ...options, rql: rqlWithUserId });
|
|
5348
|
+
return result.data[0];
|
|
5349
|
+
},
|
|
5350
|
+
async findFirst(options) {
|
|
5351
|
+
const result = await find(options);
|
|
5352
|
+
return result.data[0];
|
|
5353
|
+
},
|
|
5354
|
+
};
|
|
5355
|
+
};
|
|
5356
|
+
|
|
5357
|
+
const notificationsV2Service = (httpWithAuth) => {
|
|
5358
|
+
const client = httpClient({
|
|
5359
|
+
basePath: NOTIFICATIONS_V2_BASE,
|
|
5360
|
+
});
|
|
5361
|
+
return {
|
|
5362
|
+
...health$1(client, httpWithAuth),
|
|
5363
|
+
...notificationsV2(client, httpWithAuth),
|
|
5364
|
+
users: notificationV2Users(client, httpWithAuth),
|
|
5365
|
+
};
|
|
5366
|
+
};
|
|
5367
|
+
|
|
5261
5368
|
var events = (client, httpAuth) => ({
|
|
5262
5369
|
async find(options) {
|
|
5263
5370
|
return (await client.get(httpAuth, `/${(options === null || options === void 0 ? void 0 : options.rql) || ''}`)).data;
|
|
@@ -5350,7 +5457,7 @@ const logsService = (httpWithAuth) => {
|
|
|
5350
5457
|
};
|
|
5351
5458
|
};
|
|
5352
5459
|
|
|
5353
|
-
const version = '8.
|
|
5460
|
+
const version = '8.6.0-feat-94-2fc8886';
|
|
5354
5461
|
|
|
5355
5462
|
/**
|
|
5356
5463
|
* Create ExtraHorizon client.
|
|
@@ -5390,6 +5497,7 @@ function createClient(rawConfig) {
|
|
|
5390
5497
|
localizations: localizationsService(httpWithAuth),
|
|
5391
5498
|
profiles: profilesService(httpWithAuth),
|
|
5392
5499
|
notifications: notificationsService(httpWithAuth),
|
|
5500
|
+
notificationsV2: notificationsV2Service(httpWithAuth),
|
|
5393
5501
|
events: eventsService(httpWithAuth),
|
|
5394
5502
|
logs: logsService(httpWithAuth),
|
|
5395
5503
|
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, paymentsService, profilesService, tasksService, templatesService, usersService } from './services';
|
|
2
|
+
import { authService, configurationsService, dataService, dispatchersService, eventsService, filesService, localizationsService, logsService, mailsService, notificationsService, notificationsV2Service, 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,6 +58,11 @@ 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>;
|
|
61
66
|
/**
|
|
62
67
|
* Service that provides event (publish/subscribe) functionality for other services.
|
|
63
68
|
* @see https://swagger.extrahorizon.com/listing/?service=events-service&redirectToVersion=1
|
|
@@ -10,6 +10,7 @@ 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";
|
|
13
14
|
export declare const LOCALIZATIONS_BASE = "/localizations/v1";
|
|
14
15
|
export declare const EVENTS_BASE = "/events/v1";
|
|
15
16
|
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,6 +427,22 @@ export declare type MockClientOAuth1<MockFn> = {
|
|
|
424
427
|
remove: MockFn;
|
|
425
428
|
};
|
|
426
429
|
};
|
|
430
|
+
notificationsV2: {
|
|
431
|
+
health: MockFn;
|
|
432
|
+
create: MockFn;
|
|
433
|
+
find: MockFn;
|
|
434
|
+
findAll: MockFn;
|
|
435
|
+
findByTargetUserId: MockFn;
|
|
436
|
+
findFirst: MockFn;
|
|
437
|
+
findById: MockFn;
|
|
438
|
+
users: {
|
|
439
|
+
update: MockFn;
|
|
440
|
+
find: MockFn;
|
|
441
|
+
findAll: MockFn;
|
|
442
|
+
findByUserId: MockFn;
|
|
443
|
+
findFirst: MockFn;
|
|
444
|
+
};
|
|
445
|
+
};
|
|
427
446
|
events: {
|
|
428
447
|
health: MockFn;
|
|
429
448
|
find: MockFn;
|
|
@@ -660,6 +679,9 @@ export declare type MockClientOAuth2<MockFn> = {
|
|
|
660
679
|
update: MockFn;
|
|
661
680
|
remove: MockFn;
|
|
662
681
|
removeFields: MockFn;
|
|
682
|
+
appendObjectToArray: MockFn;
|
|
683
|
+
updateObjectInArray: MockFn;
|
|
684
|
+
removeObjectFromArray: MockFn;
|
|
663
685
|
transition: MockFn;
|
|
664
686
|
linkGroups: MockFn;
|
|
665
687
|
unlinkGroups: MockFn;
|
|
@@ -955,6 +977,22 @@ export declare type MockClientOAuth2<MockFn> = {
|
|
|
955
977
|
remove: MockFn;
|
|
956
978
|
};
|
|
957
979
|
};
|
|
980
|
+
notificationsV2: {
|
|
981
|
+
health: MockFn;
|
|
982
|
+
create: MockFn;
|
|
983
|
+
find: MockFn;
|
|
984
|
+
findAll: MockFn;
|
|
985
|
+
findByTargetUserId: MockFn;
|
|
986
|
+
findFirst: MockFn;
|
|
987
|
+
findById: MockFn;
|
|
988
|
+
users: {
|
|
989
|
+
update: MockFn;
|
|
990
|
+
find: MockFn;
|
|
991
|
+
findAll: MockFn;
|
|
992
|
+
findByUserId: MockFn;
|
|
993
|
+
findFirst: MockFn;
|
|
994
|
+
};
|
|
995
|
+
};
|
|
958
996
|
events: {
|
|
959
997
|
health: MockFn;
|
|
960
998
|
find: MockFn;
|
|
@@ -1191,6 +1229,9 @@ export declare type MockClientProxy<MockFn> = {
|
|
|
1191
1229
|
update: MockFn;
|
|
1192
1230
|
remove: MockFn;
|
|
1193
1231
|
removeFields: MockFn;
|
|
1232
|
+
appendObjectToArray: MockFn;
|
|
1233
|
+
updateObjectInArray: MockFn;
|
|
1234
|
+
removeObjectFromArray: MockFn;
|
|
1194
1235
|
transition: MockFn;
|
|
1195
1236
|
linkGroups: MockFn;
|
|
1196
1237
|
unlinkGroups: MockFn;
|
|
@@ -1486,6 +1527,22 @@ export declare type MockClientProxy<MockFn> = {
|
|
|
1486
1527
|
remove: MockFn;
|
|
1487
1528
|
};
|
|
1488
1529
|
};
|
|
1530
|
+
notificationsV2: {
|
|
1531
|
+
health: MockFn;
|
|
1532
|
+
create: MockFn;
|
|
1533
|
+
find: MockFn;
|
|
1534
|
+
findAll: MockFn;
|
|
1535
|
+
findByTargetUserId: MockFn;
|
|
1536
|
+
findFirst: MockFn;
|
|
1537
|
+
findById: MockFn;
|
|
1538
|
+
users: {
|
|
1539
|
+
update: MockFn;
|
|
1540
|
+
find: MockFn;
|
|
1541
|
+
findAll: MockFn;
|
|
1542
|
+
findByUserId: MockFn;
|
|
1543
|
+
findFirst: MockFn;
|
|
1544
|
+
};
|
|
1545
|
+
};
|
|
1489
1546
|
events: {
|
|
1490
1547
|
health: MockFn;
|
|
1491
1548
|
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
|
*
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,109 @@
|
|
|
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
|
+
* See https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#AndroidConfig
|
|
10
|
+
*/
|
|
11
|
+
android?: any;
|
|
12
|
+
/**
|
|
13
|
+
* See https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#ApnsConfig
|
|
14
|
+
*/
|
|
15
|
+
apns?: any;
|
|
16
|
+
/**
|
|
17
|
+
* See https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#WebpushConfig
|
|
18
|
+
*/
|
|
19
|
+
webpush?: any;
|
|
20
|
+
}
|
|
21
|
+
export interface NotificationV2<T extends Record<string, string> = Record<string, string>> extends NotificationV2Creation<T> {
|
|
22
|
+
id: ObjectId;
|
|
23
|
+
creatorId: ObjectId;
|
|
24
|
+
sent: boolean;
|
|
25
|
+
creationTimestamp: Date;
|
|
26
|
+
updateTimestamp: Date;
|
|
27
|
+
}
|
|
28
|
+
export interface NotificationV2Service {
|
|
29
|
+
/**
|
|
30
|
+
* # Create a notification
|
|
31
|
+
*
|
|
32
|
+
* ## Access via permissions
|
|
33
|
+
* Permission | Scopes | Effect
|
|
34
|
+
* - | - | -
|
|
35
|
+
* `CREATE_NOTIFICATIONS` | `global` | Create notifications for any user
|
|
36
|
+
* `CREATE_NOTIFICATIONS` | `group` | Create notifications for any patient in group
|
|
37
|
+
* none | | Create notifications for yourself
|
|
38
|
+
*
|
|
39
|
+
* # Interface
|
|
40
|
+
* @param requestBody
|
|
41
|
+
* @param options
|
|
42
|
+
* @returns NotificationV2<T>
|
|
43
|
+
*/
|
|
44
|
+
create<T extends Record<string, string>>(requestBody: NotificationV2Creation<T>, options?: OptionsBase): Promise<NotificationV2<T>>;
|
|
45
|
+
/**
|
|
46
|
+
* # Request a list of notifications
|
|
47
|
+
*
|
|
48
|
+
* ## Access via permissions
|
|
49
|
+
* Permission | Scopes | Effect
|
|
50
|
+
* - | - | -
|
|
51
|
+
* `VIEW_NOTIFICATIONS` | `global` | View all notifications
|
|
52
|
+
*
|
|
53
|
+
* # Interface
|
|
54
|
+
* @returns PagedResultWithPager<NotificationV2<T>>
|
|
55
|
+
*/
|
|
56
|
+
find<T extends Record<string, string>>(options?: OptionsWithRql): Promise<PagedResultWithPager<NotificationV2<T>>>;
|
|
57
|
+
/**
|
|
58
|
+
* # Request a list of notifications
|
|
59
|
+
*
|
|
60
|
+
* Do not pass in an rql with limit operator!
|
|
61
|
+
*
|
|
62
|
+
* ## Access via permissions
|
|
63
|
+
* Permission | Scopes | Effect
|
|
64
|
+
* - | - | -
|
|
65
|
+
* `VIEW_NOTIFICATIONS` | `global` | View all notifications
|
|
66
|
+
*
|
|
67
|
+
* # Interface
|
|
68
|
+
* @returns NotificationV2<T>[]
|
|
69
|
+
*/
|
|
70
|
+
findAll<T extends Record<string, string>>(options?: OptionsWithRql): Promise<NotificationV2<T>[]>;
|
|
71
|
+
/**
|
|
72
|
+
* # Request a list of notifications created for a user
|
|
73
|
+
*
|
|
74
|
+
* ## Access via permissions
|
|
75
|
+
* Permission | Scopes | Effect
|
|
76
|
+
* - | - | -
|
|
77
|
+
* `VIEW_NOTIFICATIONS` | `global` | View all notifications
|
|
78
|
+
*
|
|
79
|
+
* # Interface
|
|
80
|
+
* @param targetUserId the user id to search for
|
|
81
|
+
* @returns PagedResultWithPager<NotificationV2<T>>
|
|
82
|
+
*/
|
|
83
|
+
findByTargetUserId<T extends Record<string, string>>(targetUserId: ObjectId, options?: OptionsWithRql): Promise<PagedResultWithPager<NotificationV2<T>>>;
|
|
84
|
+
/**
|
|
85
|
+
* # Request the first notification found
|
|
86
|
+
*
|
|
87
|
+
* ## Access via permissions
|
|
88
|
+
* Permission | Scopes | Effect
|
|
89
|
+
* - | - | -
|
|
90
|
+
* `VIEW_NOTIFICATIONS` | `global` | View all notifications
|
|
91
|
+
*
|
|
92
|
+
* # Interface
|
|
93
|
+
* @returns NotificationV2<T> | undefined
|
|
94
|
+
*/
|
|
95
|
+
findFirst<T extends Record<string, string>>(options?: OptionsWithRql): Promise<NotificationV2<T> | undefined>;
|
|
96
|
+
/**
|
|
97
|
+
* # Request a notification by id
|
|
98
|
+
*
|
|
99
|
+
* ## Access via permissions
|
|
100
|
+
* Permission | Scopes | Effect
|
|
101
|
+
* - | - | -
|
|
102
|
+
* `VIEW_NOTIFICATIONS` | `global` | View all notifications
|
|
103
|
+
*
|
|
104
|
+
* # Interface
|
|
105
|
+
* @param notificationId the Id to search for
|
|
106
|
+
* @returns NotificationV2<T> | undefined
|
|
107
|
+
*/
|
|
108
|
+
findById<T extends Record<string, string>>(notificationId: ObjectId, options?: OptionsBase): Promise<NotificationV2<T> | undefined>;
|
|
109
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
}
|
|
@@ -182,6 +182,14 @@ export interface TransactionCompletionDataSchema {
|
|
|
182
182
|
* The id of the transition inside the receipt to complete
|
|
183
183
|
*/
|
|
184
184
|
transactionId: string;
|
|
185
|
+
/**
|
|
186
|
+
* The id of the user to complete the transaction for (requires the `ASSUME_PAYMENT_ENTITY` permission)
|
|
187
|
+
*/
|
|
188
|
+
userId?: ObjectId;
|
|
189
|
+
/**
|
|
190
|
+
* The id of the application to complete the transaction for (requires the `ASSUME_PAYMENT_ENTITY` permission)
|
|
191
|
+
*/
|
|
192
|
+
applicationId?: ObjectId;
|
|
185
193
|
}
|
|
186
194
|
export declare type AppleReceiptExampleSchema = any;
|
|
187
195
|
export interface ReceiptVerificationDataSchema {
|
|
@@ -350,6 +358,7 @@ export interface PaymentsAppStoreService {
|
|
|
350
358
|
* Permission | Scope | Effect
|
|
351
359
|
* - | - | -
|
|
352
360
|
* none | | Everyone can use this endpoint
|
|
361
|
+
* `ASSUME_PAYMENT_ENTITY` | `global` | Complete a transaction for another application or user
|
|
353
362
|
* @param requestBody TransactionCompletionDataSchema
|
|
354
363
|
* @returns AppleReceiptExampleSchema
|
|
355
364
|
* A detailed description of the data can be found in the [official App Store documentation](https://developer.apple.com/documentation/appstorereceipts/responsebody).
|
package/build/types/types.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ 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';
|
|
18
19
|
export * from './services/events/types';
|
|
19
20
|
export interface ParamsOauth1WithEmail {
|
|
20
21
|
email: string;
|
package/build/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "8.
|
|
1
|
+
export declare const version = "8.6.0-feat-94-2fc8886";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@extrahorizon/javascript-sdk",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.6.0-feat-94-2fc8886",
|
|
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",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"build"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"axios": "0.
|
|
35
|
+
"axios": "0.30.0",
|
|
36
36
|
"buffer": "6.0.3",
|
|
37
37
|
"fflate": "0.8.2",
|
|
38
38
|
"form-data": "4.0.0",
|