@docbrasil/api-systemmanager 1.0.57 → 1.0.60

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/api/login.js CHANGED
@@ -231,6 +231,37 @@ class Login {
231
231
  throw ex;
232
232
  }
233
233
  }
234
+
235
+ /**
236
+ * @author CloudBrasil <abernardo.br@gmail.com>
237
+ * @description Recover the password
238
+ * @param {string} username The username or email
239
+ * @return {promise<object>}} data
240
+ * @return {boolean} data.success true|false
241
+ * @public
242
+ * @async
243
+ * @example
244
+ *
245
+ * const API = require('@docbrasil/api-systemmanager');
246
+ *
247
+ * // Params of the instance
248
+ * const params = {...}
249
+ * const api = new API(params);
250
+ * const { success } = await api.login.recover('myusername');
251
+ */
252
+ async recover(username) {
253
+ const self = this;
254
+
255
+ try {
256
+ Joi.assert(username, Joi.string().required());
257
+
258
+ const url = `users/${username}/sendResetEmail`;
259
+ const apiCall = self._client.get(url);
260
+ return self._returnData(await apiCall);
261
+ } catch (ex) {
262
+ throw ex;
263
+ }
264
+ }
234
265
  }
235
266
 
236
267
  export default Login;
@@ -98,6 +98,7 @@ class Documents {
98
98
  ocrDocumentBackend: _.get(params, 'ocrDocumentBackend', false),
99
99
  bytes: _.get(params, 'bytes'),
100
100
  docAreaPermission: _.get(params, 'docAreaPermission', {}),
101
+ docTypeFields: _.get(params, 'docTypeFields', {}), // {"extraId": userId},
101
102
  docTypeFieldsData: _.get(params, 'docTypeFieldsData', {}), // {"extraId": userId},
102
103
  signedUrl: _.get(params, 'signedUrl', ''),
103
104
  urlType: _.get(params, 'urlType', 'S3'),
package/dist/bundle.cjs CHANGED
@@ -420,6 +420,37 @@ class Login {
420
420
  throw ex;
421
421
  }
422
422
  }
423
+
424
+ /**
425
+ * @author CloudBrasil <abernardo.br@gmail.com>
426
+ * @description Recover the password
427
+ * @param {string} username The username or email
428
+ * @return {promise<object>}} data
429
+ * @return {boolean} data.success true|false
430
+ * @public
431
+ * @async
432
+ * @example
433
+ *
434
+ * const API = require('@docbrasil/api-systemmanager');
435
+ *
436
+ * // Params of the instance
437
+ * const params = {...}
438
+ * const api = new API(params);
439
+ * const { success } = await api.login.recover('myusername');
440
+ */
441
+ async recover(username) {
442
+ const self = this;
443
+
444
+ try {
445
+ Joi__default["default"].assert(username, Joi__default["default"].string().required());
446
+
447
+ const url = `users/${username}/sendResetEmail`;
448
+ const apiCall = self._client.get(url);
449
+ return self._returnData(await apiCall);
450
+ } catch (ex) {
451
+ throw ex;
452
+ }
453
+ }
423
454
  }
424
455
 
425
456
  /**