@extrahorizon/javascript-sdk 8.9.0-dev-136-24be1b9 → 8.9.0-dev-138-3022f93

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.
Files changed (31) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/build/index.cjs.js +89 -89
  3. package/build/index.mjs +90 -90
  4. package/build/types/mockType.d.ts +48 -21
  5. package/build/types/services/auth/oidc/providers/types.d.ts +4 -0
  6. package/build/types/services/events/index.d.ts +1 -2
  7. package/build/types/services/events/types.d.ts +5 -0
  8. package/build/types/services/localizations/index.d.ts +1 -2
  9. package/build/types/services/localizations/types.d.ts +5 -0
  10. package/build/types/services/notifications/index.d.ts +1 -2
  11. package/build/types/services/notifications/types.d.ts +5 -0
  12. package/build/types/services/notificationsV2/index.d.ts +1 -2
  13. package/build/types/services/notificationsV2/types.d.ts +5 -0
  14. package/build/types/services/profiles/index.d.ts +1 -2
  15. package/build/types/services/profiles/types.d.ts +5 -0
  16. package/build/types/services/tasks/functions/types.d.ts +145 -1
  17. package/build/types/services/tasks/schedules/types.d.ts +4 -0
  18. package/build/types/services/tasks/types.d.ts +11 -0
  19. package/build/types/services/templatesV2/index.d.ts +1 -2
  20. package/build/types/services/templatesV2/types.d.ts +5 -0
  21. package/build/types/services/users/index.d.ts +2 -4
  22. package/build/types/services/users/types.d.ts +5 -0
  23. package/build/types/version.d.ts +1 -1
  24. package/package.json +1 -1
  25. package/build/types/services/events/health.d.ts +0 -9
  26. package/build/types/services/localizations/health.d.ts +0 -9
  27. package/build/types/services/notifications/health.d.ts +0 -9
  28. package/build/types/services/notificationsV2/health.d.ts +0 -9
  29. package/build/types/services/profiles/health.d.ts +0 -9
  30. package/build/types/services/templatesV2/health.d.ts +0 -9
  31. package/build/types/services/users/health.d.ts +0 -9
@@ -1,6 +1,5 @@
1
1
  export declare type MockClientOAuth1<MockFn> = {
2
2
  users: {
3
- health: MockFn;
4
3
  me: MockFn;
5
4
  findById: MockFn;
6
5
  update: MockFn;
@@ -31,6 +30,7 @@ export declare type MockClientOAuth1<MockFn> = {
31
30
  updatePasswordPolicy: MockFn;
32
31
  getEmailTemplates: MockFn;
33
32
  setEmailTemplates: MockFn;
33
+ health: MockFn;
34
34
  groupRoles: {
35
35
  getPermissions: MockFn;
36
36
  find: MockFn;
@@ -175,6 +175,7 @@ export declare type MockClientOAuth1<MockFn> = {
175
175
  cancel: MockFn;
176
176
  schedules: {
177
177
  create: MockFn;
178
+ remove: MockFn;
178
179
  delete: MockFn;
179
180
  find: MockFn;
180
181
  findAll: MockFn;
@@ -182,6 +183,13 @@ export declare type MockClientOAuth1<MockFn> = {
182
183
  findFirst: MockFn;
183
184
  };
184
185
  functions: {
186
+ find: MockFn;
187
+ create: MockFn;
188
+ getByName: MockFn;
189
+ update: MockFn;
190
+ remove: MockFn;
191
+ enable: MockFn;
192
+ disable: MockFn;
185
193
  execute: MockFn;
186
194
  };
187
195
  api: {
@@ -223,7 +231,6 @@ export declare type MockClientOAuth1<MockFn> = {
223
231
  resolveAsJsonUsingCode: MockFn;
224
232
  };
225
233
  templatesV2: {
226
- health: MockFn;
227
234
  create: MockFn;
228
235
  update: MockFn;
229
236
  remove: MockFn;
@@ -233,6 +240,7 @@ export declare type MockClientOAuth1<MockFn> = {
233
240
  findById: MockFn;
234
241
  findByName: MockFn;
235
242
  findFirst: MockFn;
243
+ health: MockFn;
236
244
  };
237
245
  mails: {
238
246
  health: MockFn;
@@ -382,7 +390,6 @@ export declare type MockClientOAuth1<MockFn> = {
382
390
  };
383
391
  };
384
392
  localizations: {
385
- health: MockFn;
386
393
  find: MockFn;
387
394
  findByKey: MockFn;
388
395
  findFirst: MockFn;
@@ -390,12 +397,12 @@ export declare type MockClientOAuth1<MockFn> = {
390
397
  update: MockFn;
391
398
  remove: MockFn;
392
399
  getByKeys: MockFn;
400
+ health: MockFn;
393
401
  getCountries: MockFn;
394
402
  getRegions: MockFn;
395
403
  getLanguages: MockFn;
396
404
  };
397
405
  profiles: {
398
- health: MockFn;
399
406
  find: MockFn;
400
407
  findAll: MockFn;
401
408
  findAllIterator: MockFn;
@@ -406,6 +413,7 @@ export declare type MockClientOAuth1<MockFn> = {
406
413
  removeFields: MockFn;
407
414
  getComorbidities: MockFn;
408
415
  getImpediments: MockFn;
416
+ health: MockFn;
409
417
  groups: {
410
418
  create: MockFn;
411
419
  update: MockFn;
@@ -422,7 +430,6 @@ export declare type MockClientOAuth1<MockFn> = {
422
430
  };
423
431
  };
424
432
  notifications: {
425
- health: MockFn;
426
433
  create: MockFn;
427
434
  find: MockFn;
428
435
  findAll: MockFn;
@@ -432,6 +439,7 @@ export declare type MockClientOAuth1<MockFn> = {
432
439
  remove: MockFn;
433
440
  markAsViewed: MockFn;
434
441
  getTypes: MockFn;
442
+ health: MockFn;
435
443
  settings: {
436
444
  find: MockFn;
437
445
  findById: MockFn;
@@ -441,13 +449,13 @@ export declare type MockClientOAuth1<MockFn> = {
441
449
  };
442
450
  };
443
451
  notificationsV2: {
444
- health: MockFn;
445
452
  create: MockFn;
446
453
  find: MockFn;
447
454
  findAll: MockFn;
448
455
  findByTargetUserId: MockFn;
449
456
  findFirst: MockFn;
450
457
  findById: MockFn;
458
+ health: MockFn;
451
459
  userSettings: {
452
460
  getById: MockFn;
453
461
  update: MockFn;
@@ -460,11 +468,11 @@ export declare type MockClientOAuth1<MockFn> = {
460
468
  };
461
469
  };
462
470
  events: {
463
- health: MockFn;
464
471
  find: MockFn;
465
472
  findById: MockFn;
466
473
  findFirst: MockFn;
467
474
  create: MockFn;
475
+ health: MockFn;
468
476
  subscriptions: {
469
477
  find: MockFn;
470
478
  findById: MockFn;
@@ -534,6 +542,7 @@ export declare type MockClientOAuth1<MockFn> = {
534
542
  update: MockFn;
535
543
  enable: MockFn;
536
544
  disable: MockFn;
545
+ remove: MockFn;
537
546
  delete: MockFn;
538
547
  };
539
548
  loginAttempts: {
@@ -566,7 +575,6 @@ export declare type MockClientOAuth1<MockFn> = {
566
575
  };
567
576
  export declare type MockClientOAuth2<MockFn> = {
568
577
  users: {
569
- health: MockFn;
570
578
  me: MockFn;
571
579
  findById: MockFn;
572
580
  update: MockFn;
@@ -597,6 +605,7 @@ export declare type MockClientOAuth2<MockFn> = {
597
605
  updatePasswordPolicy: MockFn;
598
606
  getEmailTemplates: MockFn;
599
607
  setEmailTemplates: MockFn;
608
+ health: MockFn;
600
609
  groupRoles: {
601
610
  getPermissions: MockFn;
602
611
  find: MockFn;
@@ -741,6 +750,7 @@ export declare type MockClientOAuth2<MockFn> = {
741
750
  cancel: MockFn;
742
751
  schedules: {
743
752
  create: MockFn;
753
+ remove: MockFn;
744
754
  delete: MockFn;
745
755
  find: MockFn;
746
756
  findAll: MockFn;
@@ -748,6 +758,13 @@ export declare type MockClientOAuth2<MockFn> = {
748
758
  findFirst: MockFn;
749
759
  };
750
760
  functions: {
761
+ find: MockFn;
762
+ create: MockFn;
763
+ getByName: MockFn;
764
+ update: MockFn;
765
+ remove: MockFn;
766
+ enable: MockFn;
767
+ disable: MockFn;
751
768
  execute: MockFn;
752
769
  };
753
770
  api: {
@@ -789,7 +806,6 @@ export declare type MockClientOAuth2<MockFn> = {
789
806
  resolveAsJsonUsingCode: MockFn;
790
807
  };
791
808
  templatesV2: {
792
- health: MockFn;
793
809
  create: MockFn;
794
810
  update: MockFn;
795
811
  remove: MockFn;
@@ -799,6 +815,7 @@ export declare type MockClientOAuth2<MockFn> = {
799
815
  findById: MockFn;
800
816
  findByName: MockFn;
801
817
  findFirst: MockFn;
818
+ health: MockFn;
802
819
  };
803
820
  mails: {
804
821
  health: MockFn;
@@ -948,7 +965,6 @@ export declare type MockClientOAuth2<MockFn> = {
948
965
  };
949
966
  };
950
967
  localizations: {
951
- health: MockFn;
952
968
  find: MockFn;
953
969
  findByKey: MockFn;
954
970
  findFirst: MockFn;
@@ -956,12 +972,12 @@ export declare type MockClientOAuth2<MockFn> = {
956
972
  update: MockFn;
957
973
  remove: MockFn;
958
974
  getByKeys: MockFn;
975
+ health: MockFn;
959
976
  getCountries: MockFn;
960
977
  getRegions: MockFn;
961
978
  getLanguages: MockFn;
962
979
  };
963
980
  profiles: {
964
- health: MockFn;
965
981
  find: MockFn;
966
982
  findAll: MockFn;
967
983
  findAllIterator: MockFn;
@@ -972,6 +988,7 @@ export declare type MockClientOAuth2<MockFn> = {
972
988
  removeFields: MockFn;
973
989
  getComorbidities: MockFn;
974
990
  getImpediments: MockFn;
991
+ health: MockFn;
975
992
  groups: {
976
993
  create: MockFn;
977
994
  update: MockFn;
@@ -988,7 +1005,6 @@ export declare type MockClientOAuth2<MockFn> = {
988
1005
  };
989
1006
  };
990
1007
  notifications: {
991
- health: MockFn;
992
1008
  create: MockFn;
993
1009
  find: MockFn;
994
1010
  findAll: MockFn;
@@ -998,6 +1014,7 @@ export declare type MockClientOAuth2<MockFn> = {
998
1014
  remove: MockFn;
999
1015
  markAsViewed: MockFn;
1000
1016
  getTypes: MockFn;
1017
+ health: MockFn;
1001
1018
  settings: {
1002
1019
  find: MockFn;
1003
1020
  findById: MockFn;
@@ -1007,13 +1024,13 @@ export declare type MockClientOAuth2<MockFn> = {
1007
1024
  };
1008
1025
  };
1009
1026
  notificationsV2: {
1010
- health: MockFn;
1011
1027
  create: MockFn;
1012
1028
  find: MockFn;
1013
1029
  findAll: MockFn;
1014
1030
  findByTargetUserId: MockFn;
1015
1031
  findFirst: MockFn;
1016
1032
  findById: MockFn;
1033
+ health: MockFn;
1017
1034
  userSettings: {
1018
1035
  getById: MockFn;
1019
1036
  update: MockFn;
@@ -1026,11 +1043,11 @@ export declare type MockClientOAuth2<MockFn> = {
1026
1043
  };
1027
1044
  };
1028
1045
  events: {
1029
- health: MockFn;
1030
1046
  find: MockFn;
1031
1047
  findById: MockFn;
1032
1048
  findFirst: MockFn;
1033
1049
  create: MockFn;
1050
+ health: MockFn;
1034
1051
  subscriptions: {
1035
1052
  find: MockFn;
1036
1053
  findById: MockFn;
@@ -1100,6 +1117,7 @@ export declare type MockClientOAuth2<MockFn> = {
1100
1117
  update: MockFn;
1101
1118
  enable: MockFn;
1102
1119
  disable: MockFn;
1120
+ remove: MockFn;
1103
1121
  delete: MockFn;
1104
1122
  };
1105
1123
  loginAttempts: {
@@ -1132,7 +1150,6 @@ export declare type MockClientOAuth2<MockFn> = {
1132
1150
  };
1133
1151
  export declare type MockClientProxy<MockFn> = {
1134
1152
  users: {
1135
- health: MockFn;
1136
1153
  me: MockFn;
1137
1154
  findById: MockFn;
1138
1155
  update: MockFn;
@@ -1163,6 +1180,7 @@ export declare type MockClientProxy<MockFn> = {
1163
1180
  updatePasswordPolicy: MockFn;
1164
1181
  getEmailTemplates: MockFn;
1165
1182
  setEmailTemplates: MockFn;
1183
+ health: MockFn;
1166
1184
  groupRoles: {
1167
1185
  getPermissions: MockFn;
1168
1186
  find: MockFn;
@@ -1307,6 +1325,7 @@ export declare type MockClientProxy<MockFn> = {
1307
1325
  cancel: MockFn;
1308
1326
  schedules: {
1309
1327
  create: MockFn;
1328
+ remove: MockFn;
1310
1329
  delete: MockFn;
1311
1330
  find: MockFn;
1312
1331
  findAll: MockFn;
@@ -1314,6 +1333,13 @@ export declare type MockClientProxy<MockFn> = {
1314
1333
  findFirst: MockFn;
1315
1334
  };
1316
1335
  functions: {
1336
+ find: MockFn;
1337
+ create: MockFn;
1338
+ getByName: MockFn;
1339
+ update: MockFn;
1340
+ remove: MockFn;
1341
+ enable: MockFn;
1342
+ disable: MockFn;
1317
1343
  execute: MockFn;
1318
1344
  };
1319
1345
  api: {
@@ -1355,7 +1381,6 @@ export declare type MockClientProxy<MockFn> = {
1355
1381
  resolveAsJsonUsingCode: MockFn;
1356
1382
  };
1357
1383
  templatesV2: {
1358
- health: MockFn;
1359
1384
  create: MockFn;
1360
1385
  update: MockFn;
1361
1386
  remove: MockFn;
@@ -1365,6 +1390,7 @@ export declare type MockClientProxy<MockFn> = {
1365
1390
  findById: MockFn;
1366
1391
  findByName: MockFn;
1367
1392
  findFirst: MockFn;
1393
+ health: MockFn;
1368
1394
  };
1369
1395
  mails: {
1370
1396
  health: MockFn;
@@ -1514,7 +1540,6 @@ export declare type MockClientProxy<MockFn> = {
1514
1540
  };
1515
1541
  };
1516
1542
  localizations: {
1517
- health: MockFn;
1518
1543
  find: MockFn;
1519
1544
  findByKey: MockFn;
1520
1545
  findFirst: MockFn;
@@ -1522,12 +1547,12 @@ export declare type MockClientProxy<MockFn> = {
1522
1547
  update: MockFn;
1523
1548
  remove: MockFn;
1524
1549
  getByKeys: MockFn;
1550
+ health: MockFn;
1525
1551
  getCountries: MockFn;
1526
1552
  getRegions: MockFn;
1527
1553
  getLanguages: MockFn;
1528
1554
  };
1529
1555
  profiles: {
1530
- health: MockFn;
1531
1556
  find: MockFn;
1532
1557
  findAll: MockFn;
1533
1558
  findAllIterator: MockFn;
@@ -1538,6 +1563,7 @@ export declare type MockClientProxy<MockFn> = {
1538
1563
  removeFields: MockFn;
1539
1564
  getComorbidities: MockFn;
1540
1565
  getImpediments: MockFn;
1566
+ health: MockFn;
1541
1567
  groups: {
1542
1568
  create: MockFn;
1543
1569
  update: MockFn;
@@ -1554,7 +1580,6 @@ export declare type MockClientProxy<MockFn> = {
1554
1580
  };
1555
1581
  };
1556
1582
  notifications: {
1557
- health: MockFn;
1558
1583
  create: MockFn;
1559
1584
  find: MockFn;
1560
1585
  findAll: MockFn;
@@ -1564,6 +1589,7 @@ export declare type MockClientProxy<MockFn> = {
1564
1589
  remove: MockFn;
1565
1590
  markAsViewed: MockFn;
1566
1591
  getTypes: MockFn;
1592
+ health: MockFn;
1567
1593
  settings: {
1568
1594
  find: MockFn;
1569
1595
  findById: MockFn;
@@ -1573,13 +1599,13 @@ export declare type MockClientProxy<MockFn> = {
1573
1599
  };
1574
1600
  };
1575
1601
  notificationsV2: {
1576
- health: MockFn;
1577
1602
  create: MockFn;
1578
1603
  find: MockFn;
1579
1604
  findAll: MockFn;
1580
1605
  findByTargetUserId: MockFn;
1581
1606
  findFirst: MockFn;
1582
1607
  findById: MockFn;
1608
+ health: MockFn;
1583
1609
  userSettings: {
1584
1610
  getById: MockFn;
1585
1611
  update: MockFn;
@@ -1592,11 +1618,11 @@ export declare type MockClientProxy<MockFn> = {
1592
1618
  };
1593
1619
  };
1594
1620
  events: {
1595
- health: MockFn;
1596
1621
  find: MockFn;
1597
1622
  findById: MockFn;
1598
1623
  findFirst: MockFn;
1599
1624
  create: MockFn;
1625
+ health: MockFn;
1600
1626
  subscriptions: {
1601
1627
  find: MockFn;
1602
1628
  findById: MockFn;
@@ -1666,6 +1692,7 @@ export declare type MockClientProxy<MockFn> = {
1666
1692
  update: MockFn;
1667
1693
  enable: MockFn;
1668
1694
  disable: MockFn;
1695
+ remove: MockFn;
1669
1696
  delete: MockFn;
1670
1697
  };
1671
1698
  loginAttempts: {
@@ -83,6 +83,10 @@ export interface OidcProviderService {
83
83
  * @throws {@link ResourceUnknownError} when no provider is found for the specified providerId.
84
84
  * @throws {@link IllegalStateError} when the provider is enabled (Only disabled providers can be removed) or when there are still users linked to this provider.
85
85
  */
86
+ remove(providerId: string): Promise<AffectedRecords>;
87
+ /**
88
+ * @deprecated Use `remove` instead.
89
+ */
86
90
  delete(providerId: string): Promise<AffectedRecords>;
87
91
  /**
88
92
  * ## Enable an OpenID Connect provider
@@ -1,6 +1,5 @@
1
1
  import type { EventsService, HttpInstance, SubscriptionsService } from '../../types';
2
- import health from './health';
3
2
  import subscriptions from './subscriptions';
4
- export declare const eventsService: (httpWithAuth: HttpInstance) => ReturnType<typeof health> & EventsService & {
3
+ export declare const eventsService: (httpWithAuth: HttpInstance) => EventsService & {
5
4
  subscriptions: SubscriptionsService;
6
5
  };
@@ -62,6 +62,11 @@ export interface EventsService {
62
62
  * @returns Event
63
63
  */
64
64
  create(requestBody: CreateEvent, options?: CreateEventOptions): Promise<Event>;
65
+ /**
66
+ * Perform a health check
67
+ * @returns {boolean} success
68
+ */
69
+ health(): Promise<boolean>;
65
70
  }
66
71
  export interface SubscriptionsService {
67
72
  /**
@@ -1,4 +1,3 @@
1
1
  import type { HttpInstance } from '../../types';
2
- import health from './health';
3
2
  import { CountriesService, LanguagesService, LocalizationsService } from './types';
4
- export declare const localizationsService: (httpWithAuth: HttpInstance) => ReturnType<typeof health> & LocalizationsService & CountriesService & LanguagesService;
3
+ export declare const localizationsService: (httpWithAuth: HttpInstance) => LocalizationsService & CountriesService & LanguagesService;
@@ -141,5 +141,10 @@ export interface LocalizationsService {
141
141
  * @returns Record<string, MappedText>
142
142
  */
143
143
  getByKeys(requestBody: LocalizationRequest, options?: OptionsBase): Promise<Record<string, MappedText>>;
144
+ /**
145
+ * Perform a health check
146
+ * @returns {boolean} success
147
+ */
148
+ health(): Promise<boolean>;
144
149
  }
145
150
  export {};
@@ -1,7 +1,6 @@
1
1
  import type { AuthHttpClient } from '../../types';
2
- import health from './health';
3
2
  import settings from './settings';
4
3
  import { NotificationSettingsServices, NotificationsService } from './types';
5
- export declare const notificationsService: (httpWithAuth: AuthHttpClient) => NotificationsService & ReturnType<typeof health> & {
4
+ export declare const notificationsService: (httpWithAuth: AuthHttpClient) => NotificationsService & {
6
5
  settings: NotificationSettingsServices;
7
6
  };
@@ -178,6 +178,11 @@ export interface NotificationsService {
178
178
  * @returns PagedResult<NotifTypeDef>
179
179
  */
180
180
  getTypes(options?: OptionsBase): Promise<PagedResult<NotifTypeDef>>;
181
+ /**
182
+ * Perform a health check
183
+ * @returns {boolean} success
184
+ */
185
+ health(): Promise<boolean>;
181
186
  }
182
187
  export interface NotificationSettingsServices {
183
188
  /**
@@ -1,7 +1,6 @@
1
1
  import { AuthHttpClient } from '../../types';
2
- import health from './health';
3
2
  import { NotificationV2Service } from './types';
4
3
  import { NotificationV2UserSettingsService } from './userSettings/types';
5
- export declare const notificationsV2Service: (httpWithAuth: AuthHttpClient) => ReturnType<typeof health> & NotificationV2Service & {
4
+ export declare const notificationsV2Service: (httpWithAuth: AuthHttpClient) => NotificationV2Service & {
6
5
  userSettings: NotificationV2UserSettingsService;
7
6
  };
@@ -158,4 +158,9 @@ export interface NotificationV2Service {
158
158
  * @returns NotificationV2<T> | undefined
159
159
  */
160
160
  findById<T extends Record<string, string>>(notificationId: ObjectId, options?: OptionsBase): Promise<NotificationV2<T> | undefined>;
161
+ /**
162
+ * Perform a health check
163
+ * @returns {boolean} success
164
+ */
165
+ health(): Promise<boolean>;
161
166
  }
@@ -1,9 +1,8 @@
1
1
  import type { HttpInstance } from '../../types';
2
2
  import groups from './groups';
3
- import health from './health';
4
3
  import logs from './logs';
5
4
  import { ProfilesGroupsService, ProfilesLogsService, ProfilesService } from './types';
6
- export declare const profilesService: (httpWithAuth: HttpInstance) => ReturnType<typeof health> & ProfilesService & {
5
+ export declare const profilesService: (httpWithAuth: HttpInstance) => ProfilesService & {
7
6
  groups: ProfilesGroupsService;
8
7
  logs: ProfilesLogsService;
9
8
  };
@@ -367,4 +367,9 @@ export interface ProfilesService {
367
367
  * @returns PagedResult<Impediments>
368
368
  */
369
369
  getImpediments(options?: OptionsBase): Promise<PagedResult<Impediments>>;
370
+ /**
371
+ * Perform a health check for profiles service
372
+ * @returns {boolean} success
373
+ */
374
+ health(): Promise<boolean>;
370
375
  }
@@ -1,6 +1,82 @@
1
- import { OptionsBase } from '../../types';
1
+ import { OptionsBase, type AffectedRecords, type PagedResult } from '../../types';
2
2
  import { Task } from '../types';
3
3
  export interface FunctionsService {
4
+ /**
5
+ * View a list of functions.
6
+ *
7
+ * Although this endpoint is a paged-like endpoint, it will return all functions in a single page.
8
+ * RQL is not supported for this endpoint, and any RQL provided will be ignored.
9
+ *
10
+ * Permission | Scope | Effect
11
+ * - | - | -
12
+ * `VIEW_TASK_FUNCTIONS` | `global` | **Required** for this endpoint
13
+ */
14
+ find(options?: OptionsBase): Promise<PagedResult<FunctionBase>>;
15
+ /**
16
+ * View a list of functions.
17
+ *
18
+ * Although this endpoint is a paged-like endpoint, it will return all functions in a single page.
19
+ * RQL is not supported for this endpoint, and any RQL provided will be ignored.
20
+ *
21
+ * Permission | Scope | Effect
22
+ * - | - | -
23
+ * `VIEW_TASK_FUNCTIONS` | `global` | **Required** for this endpoint
24
+ */
25
+ create(body: FunctionCreation, options?: OptionsBase): Promise<FunctionDetails>;
26
+ /**
27
+ * View details of a function by its name.
28
+ *
29
+ * Permission | Scope | Effect
30
+ * - | - | -
31
+ * `VIEW_TASK_FUNCTION_DETAILS` | `global` | **Required** for this endpoint
32
+ *
33
+ * @throws {ResourceUnknownError} When no function with the specified name is found
34
+ */
35
+ getByName(name: string, options?: OptionsBase): Promise<FunctionDetails>;
36
+ /**
37
+ * Update a function by its name.
38
+ *
39
+ * Permission | Scope | Effect
40
+ * - | - | -
41
+ * `UPDATE_TASK_FUNCTION` | `global` | **Required** for this endpoint
42
+ *
43
+ * @throws {ResourceUnknownError} When no function with the specified name is found
44
+ */
45
+ update(name: string, body: Partial<FunctionCreation>, options?: OptionsBase): Promise<AffectedRecords>;
46
+ /**
47
+ * Delete a function by its name.
48
+ *
49
+ * Permission | Scope | Effect
50
+ * - | - | -
51
+ * `DELETE_TASK_FUNCTION` | `global` | **Required** for this endpoint
52
+ *
53
+ * @throws {ResourceUnknownError} When no function with the specified name is found
54
+ */
55
+ remove(name: string, options?: OptionsBase): Promise<AffectedRecords>;
56
+ /**
57
+ * Enable a function by its name.
58
+ *
59
+ * Does nothing if the function is already enabled.
60
+ *
61
+ * Permission | Scope | Effect
62
+ * - | - | -
63
+ * `UPDATE_TASK_FUNCTION` | `global` | **Required** for this endpoint
64
+ *
65
+ * @throws {ResourceUnknownError} When no function with the specified name is found
66
+ */
67
+ enable(name: string, options?: OptionsBase): Promise<AffectedRecords>;
68
+ /**
69
+ * Disable a function by its name.
70
+ *
71
+ * Does nothing if the function is already disabled.
72
+ *
73
+ * Permission | Scope | Effect
74
+ * - | - | -
75
+ * `UPDATE_TASK_FUNCTION` | `global` | **Required** for this endpoint
76
+ *
77
+ * @throws {ResourceUnknownError} When no function with the specified name is found
78
+ */
79
+ disable(name: string, options?: OptionsBase): Promise<AffectedRecords>;
4
80
  /**
5
81
  * ## Execute a Function directly
6
82
  *
@@ -21,6 +97,74 @@ export interface FunctionsService {
21
97
  */
22
98
  execute<T = any, U = any>(functionName: string, data?: U, options?: OptionsBase): Promise<DirectExecutionResponse<T, U>>;
23
99
  }
100
+ export interface FunctionBase {
101
+ /** The name of the Function */
102
+ name: string;
103
+ /** A description of the Function */
104
+ description: string;
105
+ /** The timestamp when the Function was last updated */
106
+ updateTimestamp: Date;
107
+ }
108
+ export interface FunctionCreation {
109
+ /** The name of the Function, this serves as the unique identifier amongst all Functions */
110
+ name: string;
111
+ /** A description of the Function */
112
+ description?: string;
113
+ /** Base64 Encoded binary value of the compressed (.zip) function code */
114
+ code: string;
115
+ /** Entry point for execution of the function, e.g. `index.handler` */
116
+ entryPoint: string;
117
+ /**
118
+ * The runtime environment for the Function, e.g. `nodejs24.x`
119
+ * The supported runtimes can be found in the [task service documentation](https://docs.extrahorizon.com/extrahorizon/services/automation/task-service/functions#runtime)
120
+ */
121
+ runtime: string;
122
+ /**
123
+ * Maximum execution time (seconds) of the function.
124
+ * Should be between 3 and 300 seconds, defaults to 30 seconds if not provided.
125
+ */
126
+ timeLimit?: number;
127
+ /**
128
+ * Memory limit (MB) for the function.
129
+ * Should be between 128 and 10240, defaults to 128 if not provided.
130
+ */
131
+ memoryLimit?: number;
132
+ /** Environment variables to be made available to the function during execution */
133
+ environmentVariables?: {
134
+ [key: string]: {
135
+ value: string;
136
+ };
137
+ };
138
+ /** Options related to the execution of the function, such as permission an priority */
139
+ executionOptions?: {
140
+ /** Defines access for executing the function directly or for invoking it as an API function. */
141
+ permissionMode?: FunctionPermissionMode;
142
+ /** The default priority assigned to all tasks created for this function, unless a priority is specified for a task explicitly */
143
+ defaultPriority?: number;
144
+ };
145
+ /** The policy that determines system behavior after the execution of a Function fails. */
146
+ retryPolicy?: {
147
+ /**
148
+ * The retry policy is disabled by default, If this field is set to true, the retry policy becomes active.
149
+ * If active the policy will retry a maximum of 3 times, with an increasing timeout of 2, 5 and 10 seconds respectively.
150
+ */
151
+ enabled: boolean;
152
+ /** A list of error names that should trigger a retry. If not specified, the default is to retry on all errors. */
153
+ errorsToRetry: string[];
154
+ };
155
+ }
156
+ export declare type FunctionDetails = Omit<FunctionCreation, 'code'> & FunctionBase & {
157
+ /** Indicates whether the function is enabled or disabled for execution/invocation. Enabled by default. */
158
+ enabled: boolean;
159
+ };
160
+ export declare enum FunctionPermissionMode {
161
+ /** To execute this function directly the user needs the EXECUTE_TASK_FUNCTION permission */
162
+ PERMISSION_REQUIRED = "permissionRequired",
163
+ /** Every logged in user can execute this function directly */
164
+ ALL_USERS = "allUsers",
165
+ /** The function can be executed even by unauthenticated requests */
166
+ PUBLIC = "public"
167
+ }
24
168
  export interface DirectExecutionResponse<T, U> extends Task<U> {
25
169
  /** The result of the Function execution, this may be user defined */
26
170
  result: T;
@@ -20,6 +20,10 @@ export interface SchedulesService {
20
20
  * @param scheduleId - The id of the schedule to delete
21
21
  * @param options - Additional options for the request
22
22
  */
23
+ remove(scheduleId: ObjectId, options?: OptionsBase): Promise<AffectedRecords>;
24
+ /**
25
+ * @deprecated Use `remove` instead.
26
+ */
23
27
  delete(scheduleId: ObjectId, options?: OptionsBase): Promise<AffectedRecords>;
24
28
  /**
25
29
  * ## Retrieve a paged list of schedules