@extrahorizon/javascript-sdk 8.10.0-dev-159-0e9a0f1 → 8.10.0-dev-160-0c77af1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [8.10.0]
9
9
 
10
+ ### Added
11
+ - `exh.users.getEmailTemplates` and `exh.users.setEmailTemplates` now support `_name` variants
12
+ - `activationEmailTemplateName`
13
+ - `reactivationEmailTemplateName`
14
+ - `passwordResetEmailTemplateName`
15
+ - `oidcUnlinkEmailTemplateName`
16
+ - `oidcUnlinkPinEmailTemplateName`
17
+ - `activationPinEmailTemplateName`
18
+ - `reactivationPinEmailTemplateName`
19
+ - `passwordResetPinEmailTemplateName`
20
+
21
+ ### Deprecated
22
+ - `exh.users.getEmailTemplates` and `exh.users.setEmailTemplates` deprecates `_id` in favour of `_name` variants
23
+ - `activationEmailTemplateId`
24
+ - `reactivationEmailTemplateId`
25
+ - `passwordResetEmailTemplateId`
26
+ - `oidcUnlinkEmailTemplateId`
27
+ - `oidcUnlinkPinEmailTemplateId`
28
+ - `activationPinEmailTemplateId`
29
+ - `reactivationPinEmailTemplateId`
30
+ - `passwordResetPinEmailTemplateId`
31
+
10
32
  ## [8.9.1]
11
33
 
12
34
  ### Fixed
@@ -5615,7 +5615,7 @@ const templatesV2Service = (httpWithAuth) => {
5615
5615
  };
5616
5616
  };
5617
5617
 
5618
- const version = '8.10.0-dev-159-0e9a0f1';
5618
+ const version = '8.10.0-dev-160-0c77af1';
5619
5619
 
5620
5620
  /**
5621
5621
  * Create ExtraHorizon client.
package/build/index.mjs CHANGED
@@ -5585,7 +5585,7 @@ const templatesV2Service = (httpWithAuth) => {
5585
5585
  };
5586
5586
  };
5587
5587
 
5588
- const version = '8.10.0-dev-159-0e9a0f1';
5588
+ const version = '8.10.0-dev-160-0c77af1';
5589
5589
 
5590
5590
  /**
5591
5591
  * Create ExtraHorizon client.
@@ -419,22 +419,64 @@ export interface UserRoles {
419
419
  roles: ObjectId[];
420
420
  }
421
421
  export interface EmailTemplates {
422
- /** Template id used by the User Service for the account activation email. */
422
+ /**
423
+ * Template id used by the User Service for the account activation email.
424
+ * @deprecated activationEmailTemplateId is deprecated in favor of activationEmailTemplateName
425
+ */
423
426
  activationEmailTemplateId: string;
424
- /** Template id used by the User Service for the account reactivation email. */
427
+ /**
428
+ * Template name used by the User Service for the account activation email.
429
+ */
430
+ activationEmailTemplateName: string;
431
+ /**
432
+ * Template id used by the User Service for the account reactivation email.
433
+ * @deprecated reactivationEmailTemplateId is deprecated in favor of reactivationEmailTemplateName
434
+ */
425
435
  reactivationEmailTemplateId: string;
426
- /** Template id used by the User Service for the password reset email. */
436
+ /** Template name used by the User Service for the account reactivation email. */
437
+ reactivationEmailTemplateName: string;
438
+ /**
439
+ * Template id used by the User Service for the password reset email.
440
+ * @deprecated passwordResetEmailTemplateId is deprecated in favor of passwordResetEmailTemplateName
441
+ */
427
442
  passwordResetEmailTemplateId: string;
428
- /** Template id used by the User Service for the OIDC unlink email. */
443
+ /** Template name used by the User Service for the password reset email. */
444
+ passwordResetEmailTemplateName: string;
445
+ /**
446
+ * Template id used by the User Service for the OIDC unlink email.
447
+ * @deprecated oidcUnlinkEmailTemplateId is deprecated in favor of oidcUnlinkEmailTemplateName
448
+ */
429
449
  oidcUnlinkEmailTemplateId: string;
430
- /** Template id used by the User Service for the OIDC unlink pin code email. */
450
+ /** Template name used by the User Service for the OIDC unlink email. */
451
+ oidcUnlinkEmailTemplateName: string;
452
+ /**
453
+ * Template id used by the User Service for the OIDC unlink pin code email.
454
+ * @deprecated oidcUnlinkPinEmailTemplateId is deprecated in favor of oidcUnlinkPinEmailTemplateName
455
+ */
431
456
  oidcUnlinkPinEmailTemplateId: string;
432
- /** Template id used by the User Service for the account activation pin code email. */
457
+ /** Template name used by the User Service for the OIDC unlink pin code email. */
458
+ oidcUnlinkPinEmailTemplateName: string;
459
+ /**
460
+ * Template id used by the User Service for the account activation pin code email.
461
+ * @deprecated activationPinEmailTemplateId is deprecated in favor of activationPinEmailTemplateName
462
+ */
433
463
  activationPinEmailTemplateId: string;
434
- /** Template id used by the User Service for the account reactivation pin code email. */
464
+ /** Template name used by the User Service for the account activation pin code email. */
465
+ activationPinEmailTemplateName: string;
466
+ /**
467
+ * Template id used by the User Service for the account reactivation pin code email.
468
+ * @deprecated reactivationPinEmailTemplateId is deprecated in favor of reactivationPinEmailTemplateName
469
+ */
435
470
  reactivationPinEmailTemplateId: string;
436
- /** Template id used by the User Service for the password reset pin code email. */
471
+ /** Template name used by the User Service for the account reactivation pin code email. */
472
+ reactivationPinEmailTemplateName: string;
473
+ /**
474
+ * Template id used by the User Service for the password reset pin code email.
475
+ * @deprecated passwordResetPinEmailTemplateId is deprecated in favor of passwordResetPinEmailTemplateName
476
+ */
437
477
  passwordResetPinEmailTemplateId: string;
478
+ /** Template name used by the User Service for the password reset pin code email. */
479
+ passwordResetPinEmailTemplateName: string;
438
480
  }
439
481
  export interface PasswordResetRequestData {
440
482
  email: string;
@@ -897,14 +939,14 @@ export interface UsersService {
897
939
  * An email is send to the new email address with a token and instructions to reactivate the account.
898
940
  * The token should be used to complete the account activation via `exh.users.validateEmailActivation`.
899
941
  *
900
- * By default the email send to the user is the email template configured by `reactivationEmailTemplateId`.
942
+ * By default the email send to the user is the email template configured by `reactivationEmailTemplateName`.
901
943
  * The template receives a 40 hexadecimal character hash in the `content.activation_hash` variable.
902
944
  * The hash should be used within 60 minutes, otherwise `exh.users.requestEmailActivation` should be used to request a new email.
903
945
  *
904
946
  * If enabled, a pin code can be used rather than a hash.
905
947
  * The pin code mode must be enabled by the `enablePinCodeActivationRequests` verification setting.
906
948
  * To use the pin code mode, the `activationMode` field can be set to `pin_code`.
907
- * Then the email send to the user is the email template configured by `reactivationPinEmailTemplateId`.
949
+ * Then the email send to the user is the email template configured by `reactivationPinEmailTemplateName`.
908
950
  * The pin code template receives a 8 digit pin code in the `content.pin_code` variable.
909
951
  * The pin code should be used within 15 minutes, otherwise `exh.users.requestEmailActivation` should be used to request a new email.
910
952
  *
@@ -953,14 +995,14 @@ export interface UsersService {
953
995
  * An email is send to the supplied email address with a token and instructions to activate the account.
954
996
  * The token should be used to complete the account activation via `exh.users.validateEmailActivation`.
955
997
  *
956
- * By default the email send to the user is the email template configured by `activationEmailTemplateId`.
998
+ * By default the email send to the user is the email template configured by `activationEmailTemplateName`.
957
999
  * The template receives a 40 hexadecimal character hash in the `content.activation_hash` variable.
958
1000
  * The hash should be used within 60 minutes, otherwise `exh.users.requestEmailActivation` should be used to request a new email.
959
1001
  *
960
1002
  * If enabled, a pin code can be used rather than a hash.
961
1003
  * The pin code mode must be enabled by the `enablePinCodeActivationRequests` verification setting.
962
1004
  * To use the pin code mode, the `activationMode` field can be set to `pin_code`.
963
- * Then the email send to the user is the email template configured by `activationPinEmailTemplateId`.
1005
+ * Then the email send to the user is the email template configured by `activationPinEmailTemplateName`.
964
1006
  * The pin code template receives a 8 digit pin code in the `content.pin_code` variable.
965
1007
  * The pin code should be used within 15 minutes, otherwise `exh.users.requestEmailActivation` should be used to request a new email.
966
1008
  *
@@ -1006,7 +1048,7 @@ export interface UsersService {
1006
1048
  * An email is send to the supplied email address with a token and instructions to activate the account.
1007
1049
  * The token should be used to complete the account activation via `exh.users.validateEmailActivation`.
1008
1050
  *
1009
- * The email send to the user is the email template configured by `activationEmailTemplateId`.
1051
+ * The email send to the user is the email template configured by `activationEmailTemplateName`.
1010
1052
  * The template receives a 40 hexadecimal character hash in the `content.activation_hash` variable.
1011
1053
  * The hash should be used within 60 minutes, otherwise this method should be called again to request a new email.
1012
1054
  *
@@ -1016,7 +1058,7 @@ export interface UsersService {
1016
1058
  *
1017
1059
  * @throws {EmailUnknownError}
1018
1060
  * @throws {AlreadyActivatedError}
1019
- * @throws {IllegalStateError} Attempting to use `activationEmailTemplateId` while not configured. See `exh.users.setEmailTemplates`.
1061
+ * @throws {IllegalStateError} Attempting to use `activationEmailTemplateName` while not configured. See `exh.users.setEmailTemplates`.
1020
1062
  * @throws {ActivationRequestLimitError} The maximum allowed consecutive activation requests is reached
1021
1063
  * @throws {ActivationRequestTimeoutError} Activation request too short after the previous one
1022
1064
  */
@@ -1027,14 +1069,14 @@ export interface UsersService {
1027
1069
  * An email is send to the supplied email address with a token and instructions to activate the account.
1028
1070
  * The token should be used to complete the account activation via `exh.users.validateEmailActivation`.
1029
1071
  *
1030
- * By default the email send to the user is the email template configured by `activationEmailTemplateId`.
1072
+ * By default the email send to the user is the email template configured by `activationEmailTemplateName`.
1031
1073
  * The template receives a 40 hexadecimal character hash in the `content.activation_hash` variable.
1032
1074
  * The hash should be used within 60 minutes, otherwise this method should be called again to request a new email.
1033
1075
  *
1034
1076
  * If enabled, a pin code can be used rather than a hash.
1035
1077
  * The pin code mode must be enabled by the `enablePinCodeActivationRequests` verification setting.
1036
1078
  * To use the pin code mode, the `activationMode` field can be set to `pin_code`.
1037
- * Then the email send to the user is the email template configured by `activationPinEmailTemplateId`.
1079
+ * Then the email send to the user is the email template configured by `activationPinEmailTemplateName`.
1038
1080
  * The pin code template receives a 8 digit pin code in the `content.pin_code` variable.
1039
1081
  * The pin code should be used within 15 minutes, otherwise this method should be called again to request a new email.
1040
1082
  *
@@ -1044,7 +1086,7 @@ export interface UsersService {
1044
1086
  *
1045
1087
  * @throws {EmailUnknownError}
1046
1088
  * @throws {AlreadyActivatedError}
1047
- * @throws {IllegalStateError} Attempting to use either `activationEmailTemplateId` or `activationPinEmailTemplateId` while not configured. See `exh.users.setEmailTemplates`.
1089
+ * @throws {IllegalStateError} Attempting to use either `activationEmailTemplateName` or `activationPinEmailTemplateName` while not configured. See `exh.users.setEmailTemplates`.
1048
1090
  * @throws {ActivationRequestLimitError} The maximum allowed consecutive activation requests is reached
1049
1091
  * @throws {ActivationRequestTimeoutError} Activation request too short after the previous one
1050
1092
  */
@@ -1070,7 +1112,7 @@ export interface UsersService {
1070
1112
  * An email is send to the targeted user with a token and instructions to reset their password.
1071
1113
  * The token should be used to complete the password reset via `exh.users.validatePasswordReset`.
1072
1114
  *
1073
- * The email send to the user is the email template configured by `passwordResetEmailTemplateId`.
1115
+ * The email send to the user is the email template configured by `passwordResetEmailTemplateName`.
1074
1116
  * The template receives a 40 hexadecimal character hash in the `content.reset_hash` variable.
1075
1117
  * The hash should be used within 60 minutes, otherwise this method should be called again to request a new email.
1076
1118
  *
@@ -1080,7 +1122,7 @@ export interface UsersService {
1080
1122
  *
1081
1123
  * @throws {EmailUnknownError}
1082
1124
  * @throws {NotActivatedError}
1083
- * @throws {IllegalStateError} Attempting to use either `passwordResetEmailTemplateId` or `passwordResetPinEmailTemplateId` while not configured. See `exh.users.setEmailTemplates`.
1125
+ * @throws {IllegalStateError} Attempting to use either `passwordResetEmailTemplateName` or `passwordResetPinEmailTemplateName` while not configured. See `exh.users.setEmailTemplates`.
1084
1126
  * @throws {ForgotPasswordRequestLimitError} The maximum allowed consecutive forgot password requests is reached
1085
1127
  * @throws {ForgotPasswordRequestTimeoutError} Forgot password request too short after the previous one
1086
1128
  */
@@ -1091,14 +1133,14 @@ export interface UsersService {
1091
1133
  * An email is send to the targeted user with a token and instructions to reset their password.
1092
1134
  * The token should be used to complete the password reset via `exh.users.validatePasswordReset`.
1093
1135
  *
1094
- * By default the email send to the user is the email template configured by `passwordResetEmailTemplateId`.
1136
+ * By default the email send to the user is the email template configured by `passwordResetEmailTemplateName`.
1095
1137
  * The template receives a 40 hexadecimal character hash in the `content.reset_hash` variable.
1096
1138
  * The hash should be used within 60 minutes, otherwise this method should be called again to request a new email.
1097
1139
  *
1098
1140
  * If enabled, a pin code can be used rather than a hash.
1099
1141
  * The pin code mode must be enabled by the `enablePinCodeForgotPasswordRequests` verification setting.
1100
1142
  * To use the pin code mode, the `mode` field can be set to `pin_code`.
1101
- * Then the email send to the user is the email template configured by `passwordResetPinEmailTemplateId`.
1143
+ * Then the email send to the user is the email template configured by `passwordResetPinEmailTemplateName`.
1102
1144
  * The pin code template receives a 8 digit pin code in the `content.pin_code` variable.
1103
1145
  * The pin code should be used within 15 minutes, otherwise this method should be called again to request a new email.
1104
1146
  *
@@ -1108,7 +1150,7 @@ export interface UsersService {
1108
1150
  *
1109
1151
  * @throws {EmailUnknownError}
1110
1152
  * @throws {NotActivatedError}
1111
- * @throws {IllegalStateError} Attempting to use either `passwordResetEmailTemplateId` or `passwordResetPinEmailTemplateId` while not configured. See `exh.users.setEmailTemplates`.
1153
+ * @throws {IllegalStateError} Attempting to use either `passwordResetEmailTemplateName` or `passwordResetPinEmailTemplateName` while not configured. See `exh.users.setEmailTemplates`.
1112
1154
  * @throws {DisabledForOidcUsersError}
1113
1155
  * @throws {PinCodesNotEnabledError} Pin codes are not enabled, please check the verification settings
1114
1156
  * @throws {ForgotPasswordRequestLimitError} The maximum allowed consecutive forgot password requests is reached
@@ -1213,7 +1255,7 @@ export interface UsersService {
1213
1255
  * @param options {@link OptionsBase} - Add options to the request
1214
1256
  * @returns A list of email templates {@link EmailTemplates}
1215
1257
  */
1216
- getEmailTemplates(options?: OptionsBase): Promise<EmailTemplates>;
1258
+ getEmailTemplates(options?: OptionsBase): Promise<Partial<EmailTemplates>>;
1217
1259
  /**
1218
1260
  * ## Set the list of email templates
1219
1261
  *
@@ -1222,10 +1264,12 @@ export interface UsersService {
1222
1264
  *
1223
1265
  * **Notes:**
1224
1266
  * - This operation works as an update and will only update the templates that are provided
1225
- * @param templates {@link EmailTemplatesUpdate} - A partial list of email templates to update
1267
+ * - id fields are deprecated and will be removed in a future release, it is recommended to use the name fields instead
1268
+ * - name and id fields are mutually exclusive, e.g., setting `activation_email_template_name` will remove `activation_email_template_id` and vice versa
1269
+ * @param templates {@link EmailTemplates} - A partial list of email templates to update
1226
1270
  * @returns A list of email templates {@link EmailTemplates}
1227
1271
  */
1228
- setEmailTemplates(templates: Partial<EmailTemplates>): Promise<EmailTemplates>;
1272
+ setEmailTemplates(templates: Partial<EmailTemplates>): Promise<Partial<EmailTemplates>>;
1229
1273
  /**
1230
1274
  * Perform a health check
1231
1275
  * @returns {boolean} success
@@ -1 +1 @@
1
- export declare const version = "8.10.0-dev-159-0e9a0f1";
1
+ export declare const version = "8.10.0-dev-160-0c77af1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extrahorizon/javascript-sdk",
3
- "version": "8.10.0-dev-159-0e9a0f1",
3
+ "version": "8.10.0-dev-160-0c77af1",
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",