auth0 2.41.0 → 2.42.0
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 +8 -0
- package/package.json +4 -4
- package/src/management/BrandingManager.js +122 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## [v2.42.0](https://github.com/auth0/node-auth0/tree/v2.42.0) (2022-05-23)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/auth0/node-auth0/compare/v2.41.0...v2.42.0)
|
|
6
|
+
|
|
7
|
+
**Added**
|
|
8
|
+
|
|
9
|
+
- chore: add branding theme routes [\#725](https://github.com/auth0/node-auth0/pull/725) ([alejofernandez](https://github.com/alejofernandez))
|
|
10
|
+
|
|
3
11
|
## [v2.41.0](https://github.com/auth0/node-auth0/tree/v2.41.0) (2022-05-20)
|
|
4
12
|
|
|
5
13
|
[Full Changelog](https://github.com/auth0/node-auth0/compare/v2.40.0...v2.41.0)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "auth0",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.42.0",
|
|
4
4
|
"description": "SDK for Auth0 API v2",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"chai": "^4.2.0",
|
|
47
47
|
"codecov": "^3.7.2",
|
|
48
48
|
"cross-env": "^5.2.0",
|
|
49
|
-
"eslint": "^8.
|
|
50
|
-
"eslint-config-prettier": "^8.
|
|
49
|
+
"eslint": "^8.16.0",
|
|
50
|
+
"eslint-config-prettier": "^8.5.0",
|
|
51
51
|
"eslint-plugin-jsdoc": "^37.0.3",
|
|
52
52
|
"eslint-plugin-node": "^11.1.0",
|
|
53
53
|
"eslint-plugin-prettier": "^4.0.0",
|
|
54
|
-
"eslint-plugin-promise": "^
|
|
54
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
55
55
|
"husky": "^3.0.1",
|
|
56
56
|
"jsdoc": "^3.6.7",
|
|
57
57
|
"json-loader": "^0.5.7",
|
|
@@ -56,6 +56,19 @@ class BrandingManager {
|
|
|
56
56
|
options.tokenProvider
|
|
57
57
|
);
|
|
58
58
|
this.brandingTemplates = new RetryRestClient(brandingTemplateAuth0RestClient, options.retry);
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Provides an abstraction layer for consuming the
|
|
62
|
+
* {@link https://auth0.com/docs/api/management/v2#!/Branding/get_branding_theme Branding theme endpoint}.
|
|
63
|
+
*
|
|
64
|
+
* @type {external:RestClient}
|
|
65
|
+
*/
|
|
66
|
+
const brandingThemesAuth0RestClient = new Auth0RestClient(
|
|
67
|
+
`${options.baseUrl}/branding/themes/:id`,
|
|
68
|
+
clientOptions,
|
|
69
|
+
options.tokenProvider
|
|
70
|
+
);
|
|
71
|
+
this.brandingThemes = new RetryRestClient(brandingThemesAuth0RestClient, options.retry);
|
|
59
72
|
}
|
|
60
73
|
|
|
61
74
|
/**
|
|
@@ -156,6 +169,115 @@ class BrandingManager {
|
|
|
156
169
|
deleteUniversalLoginTemplate(...args) {
|
|
157
170
|
return this.brandingTemplates.delete(...args);
|
|
158
171
|
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Get the new universal login theme by id.
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* var params = { id: THEME_ID };
|
|
178
|
+
*
|
|
179
|
+
* management.branding.getTheme(params, function (err, theme) {
|
|
180
|
+
* if (err) {
|
|
181
|
+
* // Handle error.
|
|
182
|
+
* }
|
|
183
|
+
*
|
|
184
|
+
* // Theme
|
|
185
|
+
* console.log(theme);
|
|
186
|
+
* });
|
|
187
|
+
* @param {object} params Theme params
|
|
188
|
+
* @param {object} params.id Theme identifier.
|
|
189
|
+
* @param {Function} [cb] Callback function.
|
|
190
|
+
* @returns {Promise|undefined}
|
|
191
|
+
*/
|
|
192
|
+
getTheme(...args) {
|
|
193
|
+
return this.brandingThemes.get(...args);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Get the default new universal login theme.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* management.branding.getDefaultTheme(function (err, theme) {
|
|
201
|
+
* if (err) {
|
|
202
|
+
* // Handle error.
|
|
203
|
+
* }
|
|
204
|
+
*
|
|
205
|
+
* // Theme
|
|
206
|
+
* console.log(theme);
|
|
207
|
+
* });
|
|
208
|
+
* @param {Function} [cb] Callback function.
|
|
209
|
+
* @returns {Promise|undefined}
|
|
210
|
+
*/
|
|
211
|
+
getDefaultTheme(...args) {
|
|
212
|
+
return this.brandingThemes.get(...[{ id: 'default' }].concat(args));
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Create a new theme.
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* management.branding.createTheme(data, function (err, theme) {
|
|
220
|
+
* if (err) {
|
|
221
|
+
* // Handle error.
|
|
222
|
+
* }
|
|
223
|
+
*
|
|
224
|
+
* // Theme created.
|
|
225
|
+
* console.log(theme);
|
|
226
|
+
* });
|
|
227
|
+
* @param {object} data theme data object.
|
|
228
|
+
* @param {Function} [cb] Callback function.
|
|
229
|
+
* @returns {Promise|undefined}
|
|
230
|
+
*/
|
|
231
|
+
createTheme(...args) {
|
|
232
|
+
return this.brandingThemes.create(...args);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Update a theme.
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* var data = THEME_OBJ;
|
|
240
|
+
* var params = { id: THEME_ID };
|
|
241
|
+
*
|
|
242
|
+
* management.branding.updateTheme(params, data, function (err, theme) {
|
|
243
|
+
* if (err) {
|
|
244
|
+
* // Handle error.
|
|
245
|
+
* }
|
|
246
|
+
*
|
|
247
|
+
* // Theme updated.
|
|
248
|
+
* console.log(theme);
|
|
249
|
+
* });
|
|
250
|
+
* @param {object} params Theme parameters.
|
|
251
|
+
* @param {object} params.id Theme identifier.
|
|
252
|
+
* @param {object} data Updated theme data.
|
|
253
|
+
* @param {Function} [cb] Callback function.
|
|
254
|
+
* @returns {Promise|undefined}
|
|
255
|
+
*/
|
|
256
|
+
updateTheme(...args) {
|
|
257
|
+
return this.brandingThemes.patch(...args);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Delete a theme.
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* var params = { id: THEME_ID };
|
|
265
|
+
*
|
|
266
|
+
* management.branding.deleteTheme(params, function (err) {
|
|
267
|
+
* if (err) {
|
|
268
|
+
* // Handle error.
|
|
269
|
+
* }
|
|
270
|
+
*
|
|
271
|
+
* // Theme deleted.
|
|
272
|
+
* });
|
|
273
|
+
* @param {object} params Theme parameters.
|
|
274
|
+
* @param {object} params.id Theme identifier.
|
|
275
|
+
* @param {Function} [cb] Callback function.
|
|
276
|
+
* @returns {Promise|undefined}
|
|
277
|
+
*/
|
|
278
|
+
deleteTheme(...args) {
|
|
279
|
+
return this.brandingThemes.delete(...args);
|
|
280
|
+
}
|
|
159
281
|
}
|
|
160
282
|
|
|
161
283
|
module.exports = BrandingManager;
|