@docbrasil/api-systemmanager 1.1.19 → 1.1.21
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/admin/doctypes.js +3 -3
- package/api/admin/document.js +7 -7
- package/api/admin/form.js +3 -3
- package/api/admin/index.js +1 -1
- package/api/admin/list.js +3 -3
- package/api/admin/message.js +2 -2
- package/api/admin/notification.js +5 -5
- package/api/admin/organization.js +3 -3
- package/api/admin/plugin.js +2 -2
- package/api/admin/policy.js +3 -3
- package/api/admin/processes.js +4 -4
- package/api/admin/task.js +3 -3
- package/api/admin/user.js +6 -6
- package/api/dispatch.js +2 -2
- package/api/external.js +5 -5
- package/api/general/geoLocation.js +3 -3
- package/api/general/index.js +1 -1
- package/api/login.js +7 -7
- package/api/session.js +1 -1
- package/api/user/application.js +2 -2
- package/api/user/datasource.js +2 -2
- package/api/user/document.js +13 -13
- package/api/user/help.js +2 -2
- package/api/user/index.js +1 -1
- package/api/user/my_tasks.js +11 -11
- package/api/user/notification.js +4 -4
- package/api/user/organization.js +4 -4
- package/api/user/page.js +2 -2
- package/api/user/process.js +12 -12
- package/api/user/register.js +4 -4
- package/api/user/settings.js +5 -5
- package/api/user/task.js +41 -4
- package/api/user/task_available.js +3 -3
- package/api/user/updates.js +1 -1
- package/api/user/user.js +108 -9
- package/dist/bundle.cjs +279 -143
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +202 -102
- package/docs/Admin.html +1 -1
- package/docs/AdminDocuments.html +6 -6
- package/docs/AdminForm.html +2 -2
- package/docs/AdminLists.html +2 -2
- package/docs/AdminNotification.html +4 -4
- package/docs/AdminPlugin.html +1 -1
- package/docs/AdminPolicy.html +1 -1
- package/docs/AdminProcesses.html +2 -2
- package/docs/AdminTask.html +1 -1
- package/docs/AdminUser.html +4 -4
- package/docs/Application.html +1 -1
- package/docs/Datasource.html +1 -1
- package/docs/Dispatch.html +1 -1
- package/docs/Documents.html +10 -10
- package/docs/External.html +4 -4
- package/docs/GeoLocation.html +1 -1
- package/docs/Help.html +1 -1
- package/docs/Login.html +6 -6
- package/docs/MyTasks.html +11 -11
- package/docs/Notification.html +3 -3
- package/docs/Organization.html +6 -6
- package/docs/Page.html +1 -1
- package/docs/Process.html +9 -9
- package/docs/Register.html +3 -3
- package/docs/Settings.html +3 -3
- package/docs/Task.html +287 -3
- package/docs/TaskAvailable.html +2 -2
- package/docs/User.html +925 -7
- package/docs/Users.html +2 -2
- package/docs/admin_doctypes.js.html +3 -3
- package/docs/admin_document.js.html +7 -7
- package/docs/admin_form.js.html +3 -3
- package/docs/admin_index.js.html +1 -1
- package/docs/admin_list.js.html +3 -3
- package/docs/admin_message.js.html +2 -2
- package/docs/admin_notification.js.html +5 -5
- package/docs/admin_organization.js.html +3 -3
- package/docs/admin_plugin.js.html +2 -2
- package/docs/admin_policy.js.html +3 -3
- package/docs/admin_processes.js.html +4 -4
- package/docs/admin_task.js.html +3 -3
- package/docs/admin_user.js.html +6 -6
- package/docs/dispatch.js.html +2 -2
- package/docs/external.js.html +5 -5
- package/docs/general_geoLocation.js.html +3 -3
- package/docs/general_index.js.html +1 -1
- package/docs/login.js.html +7 -7
- package/docs/session.js.html +1 -1
- package/docs/user_application.js.html +2 -2
- package/docs/user_datasource.js.html +2 -2
- package/docs/user_document.js.html +13 -13
- package/docs/user_help.js.html +2 -2
- package/docs/user_index.js.html +1 -1
- package/docs/user_my_tasks.js.html +12 -12
- package/docs/user_notification.js.html +4 -4
- package/docs/user_organization.js.html +4 -4
- package/docs/user_page.js.html +2 -2
- package/docs/user_process.js.html +12 -12
- package/docs/user_register.js.html +4 -4
- package/docs/user_settings.js.html +5 -5
- package/docs/user_task.js.html +41 -4
- package/docs/user_task_available.js.html +3 -3
- package/docs/user_updates.js.html +1 -1
- package/docs/user_user.js.html +108 -9
- package/package.json +1 -1
- package/.project +0 -11
package/api/user/user.js
CHANGED
|
@@ -23,7 +23,7 @@ class User {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* @author
|
|
26
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
27
27
|
* @description Get the return data and check for errors
|
|
28
28
|
* @param {object} retData Response HTTP
|
|
29
29
|
* @return {*}
|
|
@@ -38,7 +38,7 @@ class User {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
* @author
|
|
41
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
42
42
|
* @description Set header with new session
|
|
43
43
|
* @param {string} session Session, token JWT
|
|
44
44
|
* @return {object} header with new session
|
|
@@ -53,7 +53,7 @@ class User {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
* @author
|
|
56
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
57
57
|
* @description Update avatar of user by session of user not allow session user SU
|
|
58
58
|
* @param {object} params Params to update avatar
|
|
59
59
|
* @param {string} params.avatar Image in base64 to update
|
|
@@ -93,7 +93,7 @@ class User {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
|
-
* @author
|
|
96
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
97
97
|
* @description Remove avatar of user by session of user not allow session user SU
|
|
98
98
|
* @param {string} session Is token JWT of user NOT allow SU
|
|
99
99
|
* @return {Promise}
|
|
@@ -120,7 +120,7 @@ class User {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
|
-
* @author
|
|
123
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
124
124
|
* @description Remove the signature of user by session
|
|
125
125
|
* @param {string} session Is token JWT of user NOT allow SU
|
|
126
126
|
* @return {Promise}
|
|
@@ -147,7 +147,7 @@ class User {
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
|
-
* @author
|
|
150
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
151
151
|
* @description Sava a new signature of user by session
|
|
152
152
|
* @param {object} data The signature data to save
|
|
153
153
|
* @param {string} data.type CURSIVE or HANDWRITE
|
|
@@ -194,7 +194,7 @@ class User {
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
/**
|
|
197
|
-
* @author
|
|
197
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
198
198
|
* @description Update a user profile by id
|
|
199
199
|
* @param {object} params Params to update task
|
|
200
200
|
* @param {string} params.name The name of the user
|
|
@@ -254,7 +254,7 @@ class User {
|
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
/**
|
|
257
|
-
* @author
|
|
257
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
258
258
|
* @description Change a user's organization
|
|
259
259
|
* @param {string} id Organization id
|
|
260
260
|
* @param {string} session Is token JWT of user NOT allow SU
|
|
@@ -267,7 +267,7 @@ class User {
|
|
|
267
267
|
* const api = new API();
|
|
268
268
|
* const id = '616eccaaa9360a05293b10fe';
|
|
269
269
|
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
270
|
-
* await api.user.changeOrganization
|
|
270
|
+
* await api.user.changeOrganization(id, session);
|
|
271
271
|
*/
|
|
272
272
|
async changeOrganization(id, session) {
|
|
273
273
|
const self = this;
|
|
@@ -282,6 +282,105 @@ class User {
|
|
|
282
282
|
throw ex;
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
288
|
+
* @description Get the Atlas Chart JWT Token, so we can access authorized the created charts
|
|
289
|
+
* @param {object} query={} The query, if any, to add to the JWT token
|
|
290
|
+
* @param {array<string>} query.orgIds An array of orgIds that we want to filter by
|
|
291
|
+
* @param {array<string>} query.orgProcessIds An array of orgProcessId that we want to filter by
|
|
292
|
+
* @param {array<string>} query.tags An array of org processes tags that we want to filter by
|
|
293
|
+
* @param {date} query.startDate The start date in ISO format that we want to filter by
|
|
294
|
+
* @param {date} query.endDate The start date in ISO format that we want to filter by
|
|
295
|
+
* @param {string} session Is token JWT of user NOT allow SU
|
|
296
|
+
* @return {Promise<string>} JWT Token
|
|
297
|
+
* @public
|
|
298
|
+
* @async
|
|
299
|
+
* @example
|
|
300
|
+
*
|
|
301
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
302
|
+
* const api = new API();
|
|
303
|
+
* const query = { orgIds: ['616eccaaa9360a05293b10fe'] };
|
|
304
|
+
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
305
|
+
* const jwtToken = await api.user.changeOrganization.getChartJWT(query, session);
|
|
306
|
+
*/
|
|
307
|
+
async getChartJWT(query = {}, session) {
|
|
308
|
+
const self = this;
|
|
309
|
+
|
|
310
|
+
try {
|
|
311
|
+
Joi.assert(session, Joi.string().required());
|
|
312
|
+
const url = `/users/charts/info?query=${JSON.stringify(query)}`;
|
|
313
|
+
|
|
314
|
+
const apiCall = self._client.get(url, self._setHeader(session));
|
|
315
|
+
return self._returnData(await apiCall);
|
|
316
|
+
} catch (ex) {
|
|
317
|
+
throw ex;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
323
|
+
* @description Get the user organizations to run dashboard filtering
|
|
324
|
+
* @param {string} session Is token JWT of user NOT allow SU
|
|
325
|
+
* @return {Promise}
|
|
326
|
+
* @return {array<object>} Array of organizations
|
|
327
|
+
* @return {array<object>} id The id of the organization
|
|
328
|
+
* @return {array<object>} text The name of the organization
|
|
329
|
+
* @public
|
|
330
|
+
* @async
|
|
331
|
+
* @example
|
|
332
|
+
*
|
|
333
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
334
|
+
* const api = new API();
|
|
335
|
+
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
336
|
+
* const organizations = await api.user.changeOrganization.getChartOrganizations(session);
|
|
337
|
+
*/
|
|
338
|
+
async getChartOrganizations(session) {
|
|
339
|
+
const self = this;
|
|
340
|
+
|
|
341
|
+
try {
|
|
342
|
+
Joi.assert(session, Joi.string().required());
|
|
343
|
+
const apiCall = self._client.get('/users/charts/organizations', self._setHeader(session));
|
|
344
|
+
return self._returnData(await apiCall);
|
|
345
|
+
} catch (ex) {
|
|
346
|
+
throw ex;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
352
|
+
* @description Given orgIds, return all the tags and org processes ids that can be used to filter dashboards
|
|
353
|
+
* @param {array<string>} orgIds=[] An array of orgIds
|
|
354
|
+
* @param {string} session Is token JWT of user NOT allow SU
|
|
355
|
+
* @return {Promise}
|
|
356
|
+
* @return {array<object>} The array of each org process and tags associated with them
|
|
357
|
+
* @return {srting} id The id of the org process
|
|
358
|
+
* @return {srting} name The name of the org process
|
|
359
|
+
* @return {array<srting>} tags The array of tags of the org process
|
|
360
|
+
* @public
|
|
361
|
+
* @async
|
|
362
|
+
* @example
|
|
363
|
+
*
|
|
364
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
365
|
+
* const api = new API();
|
|
366
|
+
* const orgIds: ['616eccaaa9360a05293b10fe'];
|
|
367
|
+
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
368
|
+
* const jwtToken = await api.user.changeOrganization.getChartTags(orgIds, session);
|
|
369
|
+
*/
|
|
370
|
+
async getChartTags(orgIds = [], session) {
|
|
371
|
+
const self = this;
|
|
372
|
+
|
|
373
|
+
try {
|
|
374
|
+
Joi.assert(session, Joi.string().required());
|
|
375
|
+
const url = `/users/charts/tags?orgIds=${JSON.stringify(orgIds)}`;
|
|
376
|
+
|
|
377
|
+
const apiCall = self._client.get(url, self._setHeader(session));
|
|
378
|
+
return self._returnData(await apiCall);
|
|
379
|
+
} catch (ex) {
|
|
380
|
+
throw ex;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
285
384
|
}
|
|
286
385
|
|
|
287
386
|
export default User;
|