@rockcarver/frodo-lib 0.12.2 → 0.12.3
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 +9 -1
- package/cjs/ops/EmailTemplateOps.js +5 -3
- package/cjs/ops/EmailTemplateOps.js.map +1 -1
- package/cjs/ops/EmailTemplateOps.test.js.map +1 -0
- package/cjs/test/mocks/ForgeRockApiMockEngine.js +12 -0
- package/cjs/test/mocks/ForgeRockApiMockEngine.js.map +1 -1
- package/cjs/test/mocks/IdmConfigApi/getConfigEntitiesByType/emailTemplate.json +304 -0
- package/esm/ops/EmailTemplateOps.mjs +5 -3
- package/esm/ops/EmailTemplateOps.test.mjs +59 -0
- package/esm/test/mocks/ForgeRockApiMockEngine.mjs +10 -0
- package/esm/test/mocks/IdmConfigApi/getConfigEntitiesByType/emailTemplate.json +304 -0
- package/package.json +1 -1
- package/types/ops/EmailTemplateOps.d.ts +2 -1
- package/types/ops/EmailTemplateOps.d.ts.map +1 -1
- package/types/test/mocks/ForgeRockApiMockEngine.d.ts +1 -0
- package/types/test/mocks/ForgeRockApiMockEngine.d.ts.map +1 -1
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
{
|
|
2
|
+
"result": [
|
|
3
|
+
{
|
|
4
|
+
"_id": "emailTemplate/foohoo",
|
|
5
|
+
"defaultLocale": "en",
|
|
6
|
+
"displayName": "foo",
|
|
7
|
+
"enabled": true,
|
|
8
|
+
"from": "",
|
|
9
|
+
"html": {
|
|
10
|
+
"en": "<div class=\"content\"><p>Hello</p><table><thead><tr><th>Header 1</th><th>Header 2</th><th>Header 3</th></tr></thead><tbody><tr><td>Cell Text 1</td><td>Cell Text 2</td><td>Cell Text 3</td></tr></tbody></table></div>",
|
|
11
|
+
"enz": "<div class=\"content\"><p>Hello</p></div>"
|
|
12
|
+
},
|
|
13
|
+
"message": {
|
|
14
|
+
"en": "<html><head></head><body style=\"background-color: #324054; color: #455469; padding: 60px; text-align: center;\"><div class=\"content\" style=\"background-color: #fff; border-radius: 4px; margin: 0 auto; padding: 48px; width: 235px;\"><p>Hello</p><table><thead><tr><th>Header 1</th><th>Header 2</th><th>Header 3</th></tr></thead><tbody><tr><td>Cell Text 1</td><td>Cell Text 2</td><td>Cell Text 3</td></tr></tbody></table></div></body></html>",
|
|
15
|
+
"enz": "<html><head></head><body style=\"background-color: #324054; color: #455469; padding: 60px; text-align: center;\"><div class=\"content\" style=\"background-color: #fff; border-radius: 4px; margin: 0 auto; padding: 48px; width: 235px;\"><p>Hello</p></div></body></html>"
|
|
16
|
+
},
|
|
17
|
+
"mimeType": "text/html",
|
|
18
|
+
"styles": "body {\n\tbackground-color: #324054;\n\tcolor: #455469;\n\tpadding: 60px;\n\ttext-align: center\n}\n\na {\n\ttext-decoration: none;\n\tcolor: #109cf1;\n}\n\n.content {\n\tbackground-color: #fff;\n\tborder-radius: 4px;\n\tmargin: 0 auto;\n\tpadding: 48px;\n\twidth: 235px\n}\n",
|
|
19
|
+
"subject": {
|
|
20
|
+
"en": "Informations sur le compte - nom d'utilisateur",
|
|
21
|
+
"enz": "Informations sur le compte - nom d'utilisateur"
|
|
22
|
+
},
|
|
23
|
+
"templateId": "foohoo"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"_id": "emailTemplate/forgottenUsername",
|
|
27
|
+
"defaultLocale": "en",
|
|
28
|
+
"enabled": true,
|
|
29
|
+
"from": "",
|
|
30
|
+
"html": {
|
|
31
|
+
"en": "<html><body>{{#if object.userName}}<p>Your username is '{{object.userName}}'.</p>{{else}}If you received this email in error, please disregard.{{/if}}<p><a href=\"{{object.resumeURI}}\">Click here to login</a></p></body></html>",
|
|
32
|
+
"fr": "<html><body>{{#if object.userName}}<p>Votre nom d'utilisateur est '{{object.userName}}'.</p>{{else}}Si vous avez reçu cet e-mail par erreur, veuillez ne pas en tenir compte.{{/if}}<p><a href=\"{{object.resumeURI}}\">Cliquez ici pour vous connecter</a></p></body></html>"
|
|
33
|
+
},
|
|
34
|
+
"message": {
|
|
35
|
+
"en": "<html><head></head><body style=\"background-color: #324054; color: #455469; padding: 60px; text-align: center;\"><div class=\"content\" style=\"background-color: #fff; border-radius: 4px; margin: 0 auto; padding: 48px; width: 235px;\"><p>{{#if object.userName}}Your username is '{{object.userName}}'.</p><p>{{else}}If you received this email in error, please disregard.{{/if}}</p><p><a href=\"{{object.resumeURI}}\" style=\"text-decoration: none; color: #109cf1;\">Click here to login</a></p></div></body></html>",
|
|
36
|
+
"fr": "<html><head></head><body style=\"background-color: #324054; color: #455469; padding: 60px; text-align: center;\"><div class=\"content\" style=\"background-color: #fff; border-radius: 4px; margin: 0 auto; padding: 48px; width: 235px;\">{{#if object.userName}}<p>Votre nom d'utilisateur est '{{object.userName}}'.</p>{{else}}Si vous avez reçu cet e-mail par erreur, veuillez ne pas en tenir compte.{{/if}}<p><a href=\"{{object.resumeURI}}\" style=\"text-decoration: none; color: #109cf1;\">Cliquez ici pour vous connecter</a></p></div></body></html>"
|
|
37
|
+
},
|
|
38
|
+
"mimeType": "text/html",
|
|
39
|
+
"styles": "body{background-color:#324054;color:#5e6d82;padding:60px;text-align:center}a{text-decoration:none;color:#109cf1}.content{background-color:#fff;border-radius:4px;margin:0 auto;padding:48px;width:235px}",
|
|
40
|
+
"subject": {
|
|
41
|
+
"en": "Account Information - username",
|
|
42
|
+
"fr": "Informations sur le compte - nom d'utilisateur"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"_id": "emailTemplate/FraudNotification",
|
|
47
|
+
"defaultLocale": "en",
|
|
48
|
+
"displayName": "Fraud Notification",
|
|
49
|
+
"enabled": true,
|
|
50
|
+
"from": "saas@forgerock.com",
|
|
51
|
+
"html": {
|
|
52
|
+
"en": "<div class=\"content\"><p>Hello {{object.givenName}} {{object.sn}},</p><p>we blocked an attempt to access your Expanse account from a suspicious device!</p><p>Your Expanse Security Team.</p></div>"
|
|
53
|
+
},
|
|
54
|
+
"message": {
|
|
55
|
+
"en": "<html><head></head><body style=\"background-color: #324054; color: #455469; padding: 60px; text-align: center;\"><div class=\"content\" style=\"background-color: red; border-radius: 4px; margin: 0 auto; padding: 48px; width: 235px;\"><p>Hello {{object.givenName}} {{object.sn}},</p><p>we blocked an attempt to access your Expanse account from a suspicious device!</p><p>Your Expanse Security Team.</p></div></body></html>"
|
|
56
|
+
},
|
|
57
|
+
"mimeType": "text/html",
|
|
58
|
+
"styles": "body {\n background-color: #324054;\n color: #455469;\n padding: 60px;\n text-align: center \n}\n a {\n text-decoration: none;\n color: #109cf1;\n}\n .content {\n background-color: red;\n border-radius: 4px;\n margin: 0 auto;\n padding: 48px;\n width: 235px \n}\n ",
|
|
59
|
+
"subject": {
|
|
60
|
+
"en": "Fraud alert from your Expanse Account!"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"_id": "emailTemplate/MobileEmailOTP",
|
|
65
|
+
"defaultLocale": "en",
|
|
66
|
+
"displayName": "Mobile Email OTP",
|
|
67
|
+
"enabled": true,
|
|
68
|
+
"from": "saas@forgerock.com",
|
|
69
|
+
"html": {
|
|
70
|
+
"en": "<div class=\"content\"><h3 id=\"thisisyouronetimepassword\">This is your one-time password:</h3><h4 id=\"objectfrunindexedinteger5\">{{object.frUnindexedInteger5}}</h4></div>"
|
|
71
|
+
},
|
|
72
|
+
"message": {
|
|
73
|
+
"en": "<html><head></head><body style=\"background-color: #324054; color: #455469; padding: 60px; text-align: center;\"><div class=\"content\" style=\"background-color: #fff; border-radius: 4px; margin: 0 auto; padding: 48px; width: 235px;\"><h3 id=\"thisisyouronetimepassword\">This is your one-time password:</h3><h4 id=\"objectfrunindexedinteger5\">{{object.frUnindexedInteger5}}</h4></div></body></html>"
|
|
74
|
+
},
|
|
75
|
+
"mimeType": "text/html",
|
|
76
|
+
"styles": "body {\n background-color: #324054;\n color: #455469;\n padding: 60px;\n text-align: center \n}\n a {\n text-decoration: none;\n color: #109cf1;\n}\n .content {\n background-color: #fff;\n border-radius: 4px;\n margin: 0 auto;\n padding: 48px;\n width: 235px \n}\n ",
|
|
77
|
+
"subject": {
|
|
78
|
+
"en": "One-Time Password for Login"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"_id": "emailTemplate/multiFactorEmailLink",
|
|
83
|
+
"defaultLocale": "en",
|
|
84
|
+
"enabled": true,
|
|
85
|
+
"from": "",
|
|
86
|
+
"message": {
|
|
87
|
+
"en": "<html><body><h3>You started a login or profile update that requires MFA. </h3><h4><a href=\"{{object.resumeURI}}\">Click to Proceed</a></h4></body></html>"
|
|
88
|
+
},
|
|
89
|
+
"mimeType": "text/html",
|
|
90
|
+
"subject": {
|
|
91
|
+
"en": "Multi-Factor Email for Identity Cloud login"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"_id": "emailTemplate/mytemplate",
|
|
96
|
+
"defaultLocale": "en",
|
|
97
|
+
"displayName": "mytemplate",
|
|
98
|
+
"enabled": true,
|
|
99
|
+
"from": "",
|
|
100
|
+
"message": {
|
|
101
|
+
"en": ""
|
|
102
|
+
},
|
|
103
|
+
"mimeType": "text/html",
|
|
104
|
+
"styles": "body {\n\tbackground-color: #324054;\n\tcolor: #455469;\n\tpadding: 60px;\n\ttext-align: center\n}\n\na {\n\ttext-decoration: none;\n\tcolor: #109cf1;\n}\n\n.content {\n\tbackground-color: #fff;\n\tborder-radius: 4px;\n\tmargin: 0 auto;\n\tpadding: 48px;\n\twidth: 235px\n}\n",
|
|
105
|
+
"subject": {
|
|
106
|
+
"en": ""
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"_id": "emailTemplate/oneTimePassword",
|
|
111
|
+
"defaultLocale": "en",
|
|
112
|
+
"enabled": true,
|
|
113
|
+
"from": "",
|
|
114
|
+
"message": {
|
|
115
|
+
"en": "<h3>This is your one-time password:</h3><h4>{{object.description}}</a></h4>"
|
|
116
|
+
},
|
|
117
|
+
"mimeType": "text/html",
|
|
118
|
+
"subject": {
|
|
119
|
+
"en": "One-Time Password for login"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"_id": "emailTemplate/profileUpdated",
|
|
124
|
+
"defaultLocale": "en",
|
|
125
|
+
"displayName": "Profile Updated",
|
|
126
|
+
"enabled": true,
|
|
127
|
+
"from": "noreply@mytestrun.com",
|
|
128
|
+
"html": {
|
|
129
|
+
"en": "<div class=\"content\"><p>Hello {{object.givenName}}.</p><p>We have detected that your account has been updated. This update required a multi-factor challenge which was successful.</p><p>If you feel this message is in error or fraudulent activity has occurred on your account then please contact the Fedex Security Team.</p><p>Thanks,</p><p>Your FedEx Customer Team.</p></div>"
|
|
130
|
+
},
|
|
131
|
+
"message": {
|
|
132
|
+
"en": "<html><head></head><body style=\"background-color: #324054; color: #455469; padding: 60px; text-align: center;\"><div class=\"content\" style=\"background-color: #fff; border-radius: 4px; margin: 0 auto; padding: 48px; width: 235px;\"><p>Hello {{object.givenName}}.</p><p>We have detected that your account has been updated. This update required a multi-factor challenge which was successful.</p><p>If you feel this message is in error or fraudulent activity has occurred on your account then please contact the Fedex Security Team.</p><p>Thanks,</p><p>Your FedEx Customer Team.</p></div></body></html>"
|
|
133
|
+
},
|
|
134
|
+
"mimeType": "text/html",
|
|
135
|
+
"styles": "body {\n background-color: #324054;\n color: #455469;\n padding: 60px;\n text-align: center \n}\n a {\n text-decoration: none;\n color: #109cf1;\n}\n .content {\n background-color: #fff;\n border-radius: 4px;\n margin: 0 auto;\n padding: 48px;\n width: 235px \n}\n ",
|
|
136
|
+
"subject": {
|
|
137
|
+
"en": "User Profile Updated"
|
|
138
|
+
},
|
|
139
|
+
"templateId": "profileUpdated"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"_id": "emailTemplate/profileUpdateNotification",
|
|
143
|
+
"defaultLocale": "en",
|
|
144
|
+
"displayName": "Profile Update Notification",
|
|
145
|
+
"enabled": true,
|
|
146
|
+
"from": "saas@forgerock.com",
|
|
147
|
+
"html": {
|
|
148
|
+
"en": "<div class=\"content\"><p>Hello {{object.givenName}},</p><p>your user profile has been updated. If you did not make those changes yourself or requested them, please contact us immediately.</p><p>Kindest regards.</p></div>"
|
|
149
|
+
},
|
|
150
|
+
"message": {
|
|
151
|
+
"en": "<html><head></head><body style=\"background-color: #324054; color: #455469; padding: 60px; text-align: center;\"><div class=\"content\" style=\"background-color: #fff; border-radius: 4px; margin: 0 auto; padding: 48px; width: 235px;\"><p>Hello {{object.givenName}},</p><p>your user profile has been updated. If you did not make those changes yourself or requested them, please contact us immediately.</p><p>Kindest regards.</p></div></body></html>"
|
|
152
|
+
},
|
|
153
|
+
"mimeType": "text/html",
|
|
154
|
+
"styles": "body {\n background-color: #324054;\n color: #455469;\n padding: 60px;\n text-align: center \n}\n a {\n text-decoration: none;\n color: #109cf1;\n}\n .content {\n background-color: #fff;\n border-radius: 4px;\n margin: 0 auto;\n padding: 48px;\n width: 235px \n}\n ",
|
|
155
|
+
"subject": {
|
|
156
|
+
"en": "Your user profile has been updated"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"_id": "emailTemplate/profileUpdateNotificationEmailChange",
|
|
161
|
+
"defaultLocale": "en",
|
|
162
|
+
"displayName": "Email Address Change Notification",
|
|
163
|
+
"enabled": true,
|
|
164
|
+
"from": "saas@forgerock.com",
|
|
165
|
+
"html": {
|
|
166
|
+
"en": "<div class=\"content\"><p>Hello {{object.givenName}},</p><p>your user profile has been updated and your email address has changed. This email is sent to the old address we had on file. If you did not make those changes yourself or requested them, please contact us immediately.</p><p>Old: {{object.frUnindexedString5}}<br>\nNew: {{object.mail}}</p><p>Kindest regards.</p></div>"
|
|
167
|
+
},
|
|
168
|
+
"message": {
|
|
169
|
+
"en": "<html><head></head><body style=\"background-color: #324054; color: #455469; padding: 60px; text-align: left;\"><div class=\"content\" style=\"background-color: #fff; border-radius: 4px; margin: 0 auto; padding: 48px; width: 235px;\"><p>Hello {{object.givenName}},</p><p>your user profile has been updated and your email address has changed. This email is sent to the old address we had on file. If you did not make those changes yourself or requested them, please contact us immediately.</p><p>Old: {{object.frUnindexedString5}}<br>\nNew: {{object.mail}}</p><p>Kindest regards.</p></div></body></html>"
|
|
170
|
+
},
|
|
171
|
+
"mimeType": "text/html",
|
|
172
|
+
"styles": "body {\n background-color: #324054;\n color: #455469;\n padding: 60px;\n text-align: left \n}\n a {\n text-decoration: none;\n color: #109cf1;\n}\n .content {\n background-color: #fff;\n border-radius: 4px;\n margin: 0 auto;\n padding: 48px;\n width: 235px \n}\n ",
|
|
173
|
+
"subject": {
|
|
174
|
+
"en": "You email address and profile has been updated"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"_id": "emailTemplate/registration",
|
|
179
|
+
"enabled": true,
|
|
180
|
+
"from": "",
|
|
181
|
+
"subject": {
|
|
182
|
+
"en": "Register new account",
|
|
183
|
+
"fr": "Créer un nouveau compte"
|
|
184
|
+
},
|
|
185
|
+
"message": {
|
|
186
|
+
"en": "<html><head></head><body style=\"background-color: #324054; color: #5e6d82; padding: 60px; text-align: center;\"><div class=\"content\" style=\"background-color: #fff; border-radius: 4px; margin: 0 auto; padding: 48px; width: 235px;\"><h3>This is your registration email.</h3><p><a href=\"{{object.resumeURI}}\" style=\"text-decoration: none; color: #109cf1;\">Email verification link</a></p></div></body></html>",
|
|
187
|
+
"fr": "<html><head></head><body style=\"background-color: #324054; color: #5e6d82; padding: 60px; text-align: center;\"><div class=\"content\" style=\"background-color: #fff; border-radius: 4px; margin: 0 auto; padding: 48px; width: 235px;\"><h3>Ceci est votre mail d'inscription.</h3><p><a href=\"{{object.resumeURI}}\" style=\"text-decoration: none; color: #109cf1;\">Lien de vérification email</a></p></div></body></html>"
|
|
188
|
+
},
|
|
189
|
+
"html": {
|
|
190
|
+
"en": "<html><body><h3>This is your registration email.</h3><p><a href=\"{{object.resumeURI}}\">Email verification link</a></p></body></html>",
|
|
191
|
+
"fr": "<html><body><h3>Ceci est votre mail d'inscription.</h3><p><a href=\"{{object.resumeURI}}\">Lien de vérification email</a></p></body></html>"
|
|
192
|
+
},
|
|
193
|
+
"styles": "body{background-color:#324054;color:#5e6d82;padding:60px;text-align:center}a{text-decoration:none;color:#109cf1}.content{background-color:#fff;border-radius:4px;margin:0 auto;padding:48px;width:235px}",
|
|
194
|
+
"defaultLocale": "en",
|
|
195
|
+
"mimeType": "text/html"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"_id": "emailTemplate/resetPassword",
|
|
199
|
+
"enabled": true,
|
|
200
|
+
"from": "",
|
|
201
|
+
"subject": {
|
|
202
|
+
"en": "Reset your password",
|
|
203
|
+
"fr": "Réinitialisez votre mot de passe"
|
|
204
|
+
},
|
|
205
|
+
"message": {
|
|
206
|
+
"en": "<h3>Click to reset your password</h3><h4><a href=\"{{object.resumeURI}}\">Password reset link</a></h4>",
|
|
207
|
+
"fr": "<h3>Cliquez pour réinitialiser votre mot de passe</h3><h4><a href=\"{{object.resumeURI}}\">Mot de passe lien de réinitialisation</a></h4>"
|
|
208
|
+
},
|
|
209
|
+
"defaultLocale": "en",
|
|
210
|
+
"mimeType": "text/html"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"_id": "emailTemplate/test",
|
|
214
|
+
"defaultLocale": "en",
|
|
215
|
+
"displayName": "test",
|
|
216
|
+
"enabled": true,
|
|
217
|
+
"from": "",
|
|
218
|
+
"message": {
|
|
219
|
+
"en": ""
|
|
220
|
+
},
|
|
221
|
+
"mimeType": "text/html",
|
|
222
|
+
"styles": "body {\n\tbackground-color: #324054;\n\tcolor: #455469;\n\tpadding: 60px;\n\ttext-align: center\n}\n\na {\n\ttext-decoration: none;\n\tcolor: #109cf1;\n}\n\n.content {\n\tbackground-color: #fff;\n\tborder-radius: 4px;\n\tmargin: 0 auto;\n\tpadding: 48px;\n\twidth: 235px\n}\n",
|
|
223
|
+
"subject": {
|
|
224
|
+
"en": ""
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"_id": "emailTemplate/UnknownDeviceNotification",
|
|
229
|
+
"defaultLocale": "en",
|
|
230
|
+
"displayName": "Unknown Device Notification",
|
|
231
|
+
"enabled": true,
|
|
232
|
+
"from": "saas@forgerock.com",
|
|
233
|
+
"html": {
|
|
234
|
+
"en": "<div class=\"content\"><p>Hello {{object.givenName}} {{object.sn}},</p><p>your Expanse account was accessed from an unknown device!</p><p>Your Expanse Security Team.</p></div>"
|
|
235
|
+
},
|
|
236
|
+
"message": {
|
|
237
|
+
"en": "<html><head></head><body style=\"background-color: #324054; color: black; padding: 60px; text-align: center;\"><div class=\"content\" style=\"background-color: orange; border-radius: 4px; margin: 0 auto; padding: 48px; width: 235px;\"><p>Hello {{object.givenName}} {{object.sn}},</p><p>your Expanse account was accessed from an unknown device!</p><p>Your Expanse Security Team.</p></div></body></html>"
|
|
238
|
+
},
|
|
239
|
+
"mimeType": "text/html",
|
|
240
|
+
"styles": "body {\n background-color: #324054;\n color: black;\n padding: 60px;\n text-align: center \n}\n a {\n text-decoration: none;\n color: #109cf1;\n}\n .content {\n background-color: orange;\n border-radius: 4px;\n margin: 0 auto;\n padding: 48px;\n width: 235px \n}\n ",
|
|
241
|
+
"subject": {
|
|
242
|
+
"en": "Your Expanse account was accessed from an unknown device!"
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"_id": "emailTemplate/updatePassword",
|
|
247
|
+
"defaultLocale": "en",
|
|
248
|
+
"enabled": true,
|
|
249
|
+
"from": "",
|
|
250
|
+
"html": {
|
|
251
|
+
"en": "<h3>Verify email to update password</h3><p><a href=\"{{object.resumeURI}}\">Update password link</a></p>"
|
|
252
|
+
},
|
|
253
|
+
"message": {
|
|
254
|
+
"en": "<html><head></head><body style=\"background-color: #324054; color: #5e6d82; padding: 60px; text-align: center;\"><div class=\"content\" style=\"background-color: #fff; border-radius: 4px; margin: 0 auto; padding: 48px; width: 235px;\"><h3 id=\"verifyemailtoupdatepassword\">Verify email to update password</h3><p><a href=\"{{object.resumeURI}}\" style=\"text-decoration: none; color: #109cf1;\">Update password link</a></p></div></body></html>"
|
|
255
|
+
},
|
|
256
|
+
"mimeType": "text/html",
|
|
257
|
+
"styles": "body{background-color:#324054;color:#5e6d82;padding:60px;text-align:center}a{text-decoration:none;color:#109cf1}.content{background-color:#fff;border-radius:4px;margin:0 auto;padding:48px;width:235px}",
|
|
258
|
+
"subject": {
|
|
259
|
+
"en": "Update your password"
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"_id": "emailTemplate/welcome",
|
|
264
|
+
"defaultLocale": "en",
|
|
265
|
+
"displayName": "Welcome",
|
|
266
|
+
"enabled": true,
|
|
267
|
+
"from": "saas@forgerock.com",
|
|
268
|
+
"html": {
|
|
269
|
+
"en": "<div class=\"content\"><p>Welcome. Your username is '{{object.userName}}'.</p></div>"
|
|
270
|
+
},
|
|
271
|
+
"message": {
|
|
272
|
+
"en": "<html><head></head><body style=\"background-color: #324054; color: #5e6d82; padding: 60px; text-align: center;\"><div class=\"content\" style=\"background-color: #fff; border-radius: 4px; margin: 0 auto; padding: 48px; width: 235px;\"><p>Welcome. Your username is '{{object.userName}}'.</p></div></body></html>"
|
|
273
|
+
},
|
|
274
|
+
"mimeType": "text/html",
|
|
275
|
+
"styles": "body{\n background-color:#324054;\n color:#5e6d82;\n padding:60px;\n text-align:center\n}\na{\n text-decoration:none;\n color:#109cf1\n}\n.content{\n background-color:#fff;\n border-radius:4px;\n margin:0 auto;\n padding:48px;\n width:235px\n}\n",
|
|
276
|
+
"subject": {
|
|
277
|
+
"en": "Your account has been created"
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"_id": "emailTemplate/Welcome",
|
|
282
|
+
"defaultLocale": "en",
|
|
283
|
+
"displayName": "Welcome",
|
|
284
|
+
"enabled": true,
|
|
285
|
+
"from": "saas@forgerock.com",
|
|
286
|
+
"html": {
|
|
287
|
+
"en": "<div class=\"content\"><p>Welcome to Expanse, {{object.givenName}}!</p><p><a href=\"https://openam-huntington-dev.forgeblocks.com/am/XUI/?realm=/alpha#/service/Login\">Access your account</a> with your new username: {{object.userName}}</p><p>We are looking forward to servicing all your banking needs!</p><p>Your Expanse Team.</p></div>"
|
|
288
|
+
},
|
|
289
|
+
"message": {
|
|
290
|
+
"en": "<html><head></head><body style=\"background-color: #324054; color: black; padding: 10px; text-align: left;\"><div class=\"content\" style=\"background-color: #ffffff; border-radius: 4px; margin: 0 auto; padding: 10px; width: 300px;\"><p>Welcome to Expanse, {{object.givenName}}!</p><p><a href=\"https://openam-huntington-dev.forgeblocks.com/am/XUI/?realm=/alpha#/service/Login\" style=\"text-decoration: none; color: #109cf1;\">Access your account</a> with your new username: {{object.userName}}</p><p>We are looking forward to servicing all your banking needs!</p><p>Your Expanse Team.</p></div></body></html>"
|
|
291
|
+
},
|
|
292
|
+
"mimeType": "text/html",
|
|
293
|
+
"styles": "body {\n background-color: #324054;\n color: black;\n padding: 10px;\n text-align: left \n}\n a {\n text-decoration: none;\n color: #109cf1;\n}\n .content {\n background-color: #ffffff;\n border-radius: 4px;\n margin: 0 auto;\n padding: 10px;\n width: 300px \n}\n ",
|
|
294
|
+
"subject": {
|
|
295
|
+
"en": "Your registration with Expanse"
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
],
|
|
299
|
+
"resultCount": 17,
|
|
300
|
+
"pagedResultsCookie": null,
|
|
301
|
+
"totalPagedResultsPolicy": "EXACT",
|
|
302
|
+
"totalPagedResults": 17,
|
|
303
|
+
"remainingPagedResults": -1
|
|
304
|
+
}
|
|
@@ -23,6 +23,7 @@ function getFileDataTemplate() {
|
|
|
23
23
|
/**
|
|
24
24
|
* List email templates
|
|
25
25
|
* @param {boolean} long Long list format with details
|
|
26
|
+
* @return {Promise<unknown[]>} a promise that resolves to an array of email template objects
|
|
26
27
|
*/
|
|
27
28
|
|
|
28
29
|
|
|
@@ -30,10 +31,9 @@ export async function listEmailTemplates(long = false) {
|
|
|
30
31
|
let emailTemplates = [];
|
|
31
32
|
|
|
32
33
|
try {
|
|
33
|
-
emailTemplates = (await getEmailTemplates()).
|
|
34
|
+
emailTemplates = (await getEmailTemplates()).result;
|
|
34
35
|
} catch (error) {
|
|
35
|
-
printMessage(
|
|
36
|
-
printMessage(error.response.data, 'error');
|
|
36
|
+
printMessage(`Error retrieving email templates: ${error.message}`, 'error');
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
emailTemplates.sort((a, b) => a._id.localeCompare(b._id));
|
|
@@ -57,6 +57,8 @@ export async function listEmailTemplates(long = false) {
|
|
|
57
57
|
|
|
58
58
|
printMessage(table.toString(), 'data');
|
|
59
59
|
}
|
|
60
|
+
|
|
61
|
+
return emailTemplates;
|
|
60
62
|
}
|
|
61
63
|
/**
|
|
62
64
|
* Export a single email template to file
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import MockAdapter from 'axios-mock-adapter';
|
|
3
|
+
import { EmailTemplate, state } from '../index';
|
|
4
|
+
import * as global from '../storage/StaticStorage';
|
|
5
|
+
import { mockGetConfigEntitiesByType } from '../test/mocks/ForgeRockApiMockEngine';
|
|
6
|
+
const mock = new MockAdapter(axios);
|
|
7
|
+
state.default.session.setTenant('https://openam-frodo-dev.forgeblocks.com/am');
|
|
8
|
+
state.default.session.setRealm('alpha');
|
|
9
|
+
state.default.session.setCookieName('cookieName');
|
|
10
|
+
state.default.session.setCookieValue('cookieValue');
|
|
11
|
+
state.default.session.setDeploymentType(global.CLOUD_DEPLOYMENT_TYPE_KEY);
|
|
12
|
+
describe('EmailTemplateOps - exportEmailTemplateToFile()', () => {
|
|
13
|
+
test('exportEmailTemplateToFile() 0: Method is implemented', async () => {
|
|
14
|
+
expect(EmailTemplate.exportEmailTemplateToFile).toBeDefined();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
describe('EmailTemplateOps - exportEmailTemplatesToFile()', () => {
|
|
18
|
+
test('exportEmailTemplatesToFile() 0: Method is implemented', async () => {
|
|
19
|
+
expect(EmailTemplate.exportEmailTemplatesToFile).toBeDefined();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
describe('EmailTemplateOps - exportEmailTemplatesToFiles()', () => {
|
|
23
|
+
test('exportEmailTemplatesToFiles() 0: Method is implemented', async () => {
|
|
24
|
+
expect(EmailTemplate.exportEmailTemplatesToFiles).toBeDefined();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
describe('EmailTemplateOps - importEmailTemplateFromFile()', () => {
|
|
28
|
+
test('importEmailTemplateFromFile() 0: Method is implemented', async () => {
|
|
29
|
+
expect(EmailTemplate.importEmailTemplateFromFile).toBeDefined();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
describe('EmailTemplateOps - importEmailTemplatesFromFile()', () => {
|
|
33
|
+
test('importEmailTemplatesFromFile() 0: Method is implemented', async () => {
|
|
34
|
+
expect(EmailTemplate.importEmailTemplatesFromFile).toBeDefined();
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
describe('EmailTemplateOps - importEmailTemplatesFromFiles()', () => {
|
|
38
|
+
test('importEmailTemplatesFromFiles() 0: Method is implemented', async () => {
|
|
39
|
+
expect(EmailTemplate.importEmailTemplatesFromFiles).toBeDefined();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
describe('EmailTemplateOps - importFirstEmailTemplateFromFile()', () => {
|
|
43
|
+
test('importFirstEmailTemplateFromFile() 0: Method is implemented', async () => {
|
|
44
|
+
expect(EmailTemplate.importFirstEmailTemplateFromFile).toBeDefined();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
describe('EmailTemplateOps - listEmailTemplates()', () => {
|
|
48
|
+
test('listEmailTemplates() 0: Method is implemented', async () => {
|
|
49
|
+
expect(EmailTemplate.listEmailTemplates).toBeDefined();
|
|
50
|
+
});
|
|
51
|
+
test('listEmailTemplates() 1: List email templates', async () => {
|
|
52
|
+
mockGetConfigEntitiesByType(mock);
|
|
53
|
+
expect.assertions(2);
|
|
54
|
+
const emailTemplates = await EmailTemplate.listEmailTemplates();
|
|
55
|
+
expect(emailTemplates).toBeTruthy();
|
|
56
|
+
expect(emailTemplates.length).toBe(17);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=EmailTemplateOps.test.js.map
|
|
@@ -276,4 +276,14 @@ export function mockPutConfigEntity(mock, callback) {
|
|
|
276
276
|
return [mockStatus, mockResponse];
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
|
+
export function mockGetConfigEntitiesByType(mock) {
|
|
280
|
+
mock.onGet(/.*?\/openidm\/config\?_queryFilter=_id%20sw%20'.+?'/).reply(function (config) {
|
|
281
|
+
console.log('config.url=' + config.url);
|
|
282
|
+
const entityType = config.url ? config.url.match(/.*?\/openidm\/config\?_queryFilter=_id%20sw%20'(.+?)'/)[1] : '';
|
|
283
|
+
const mockStatus = 200;
|
|
284
|
+
console.log('entityType=' + entityType);
|
|
285
|
+
const mockResponse = JSON.parse(fs.readFileSync(path.resolve(__dirname, `./IdmConfigApi/getConfigEntitiesByType/${entityType}.json`), 'utf8'));
|
|
286
|
+
return [mockStatus, mockResponse];
|
|
287
|
+
});
|
|
288
|
+
}
|
|
279
289
|
//# sourceMappingURL=ForgeRockApiMockEngine.js.map
|