@docbrasil/api-systemmanager 1.1.26 → 1.1.27
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/user/dashboard.js +40 -0
- package/dist/bundle.cjs +40 -0
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +35 -0
- package/docs/Chart.html +296 -0
- package/docs/Dashboard.html +2 -2
- package/docs/Documents.html +1291 -443
- package/docs/user_dashboard.js.html +41 -1
- package/docs/user_document.js.html +131 -0
- package/package.json +1 -1
- package/.project +0 -11
- package/package-lock.json +0 -7337
package/api/user/dashboard.js
CHANGED
|
@@ -81,6 +81,46 @@ class Chart {
|
|
|
81
81
|
throw ex;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
87
|
+
* @description Get the question data from a chart data
|
|
88
|
+
* @param {object} params Params to get helps from topic
|
|
89
|
+
* @param {object} params.orgId The organization id of the question
|
|
90
|
+
* @param {object} params.processId The process id of the question
|
|
91
|
+
* @param {object} params.path The path of the question so we can retrieve it
|
|
92
|
+
* @param {string} session Session, token JWT
|
|
93
|
+
* @returns {promise} data the question data
|
|
94
|
+
* @public
|
|
95
|
+
* @example
|
|
96
|
+
*
|
|
97
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
98
|
+
* const api = new API();
|
|
99
|
+
* const params = {
|
|
100
|
+
* orgId: '637e7523f555fabdfb1ed7b6',
|
|
101
|
+
* processId: '123e7523f555fabdfb1ed7c6',
|
|
102
|
+
* path: 'Checklist.Group Name.Field Name'
|
|
103
|
+
* };
|
|
104
|
+
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
105
|
+
* await api.user.dashboard.chart.getQuestion(params, session);
|
|
106
|
+
*/
|
|
107
|
+
async getQuestion(params, session) {
|
|
108
|
+
const self = this;
|
|
109
|
+
|
|
110
|
+
try {
|
|
111
|
+
Joi.assert(params, Joi.object().required(), 'Params to helps from a topic');
|
|
112
|
+
Joi.assert(params.orgId, Joi.string().required(), 'The organization id of the question');
|
|
113
|
+
Joi.assert(params.processId, Joi.string().required(), 'The process id of the question');
|
|
114
|
+
Joi.assert(params.path, Joi.string().required(), 'The path of the field of the question');
|
|
115
|
+
Joi.assert(session, Joi.string().required(), 'Session token JWT');
|
|
116
|
+
|
|
117
|
+
const apiCall = self._client.post(`/organizations/dashboard/chart/question/data`, params, self._setHeader(session));
|
|
118
|
+
|
|
119
|
+
return self._returnData(await apiCall);
|
|
120
|
+
} catch (ex) {
|
|
121
|
+
throw ex;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
84
124
|
}
|
|
85
125
|
|
|
86
126
|
/**
|
package/dist/bundle.cjs
CHANGED
|
@@ -11212,6 +11212,46 @@ class Chart {
|
|
|
11212
11212
|
throw ex;
|
|
11213
11213
|
}
|
|
11214
11214
|
}
|
|
11215
|
+
|
|
11216
|
+
/**
|
|
11217
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
11218
|
+
* @description Get the question data from a chart data
|
|
11219
|
+
* @param {object} params Params to get helps from topic
|
|
11220
|
+
* @param {object} params.orgId The organization id of the question
|
|
11221
|
+
* @param {object} params.processId The process id of the question
|
|
11222
|
+
* @param {object} params.path The path of the question so we can retrieve it
|
|
11223
|
+
* @param {string} session Session, token JWT
|
|
11224
|
+
* @returns {promise} data the question data
|
|
11225
|
+
* @public
|
|
11226
|
+
* @example
|
|
11227
|
+
*
|
|
11228
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
11229
|
+
* const api = new API();
|
|
11230
|
+
* const params = {
|
|
11231
|
+
* orgId: '637e7523f555fabdfb1ed7b6',
|
|
11232
|
+
* processId: '123e7523f555fabdfb1ed7c6',
|
|
11233
|
+
* path: 'Checklist.Group Name.Field Name'
|
|
11234
|
+
* };
|
|
11235
|
+
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
11236
|
+
* await api.user.dashboard.chart.getQuestion(params, session);
|
|
11237
|
+
*/
|
|
11238
|
+
async getQuestion(params, session) {
|
|
11239
|
+
const self = this;
|
|
11240
|
+
|
|
11241
|
+
try {
|
|
11242
|
+
Joi__default["default"].assert(params, Joi__default["default"].object().required(), 'Params to helps from a topic');
|
|
11243
|
+
Joi__default["default"].assert(params.orgId, Joi__default["default"].string().required(), 'The organization id of the question');
|
|
11244
|
+
Joi__default["default"].assert(params.processId, Joi__default["default"].string().required(), 'The process id of the question');
|
|
11245
|
+
Joi__default["default"].assert(params.path, Joi__default["default"].string().required(), 'The path of the field of the question');
|
|
11246
|
+
Joi__default["default"].assert(session, Joi__default["default"].string().required(), 'Session token JWT');
|
|
11247
|
+
|
|
11248
|
+
const apiCall = self._client.post(`/organizations/dashboard/chart/question/data`, params, self._setHeader(session));
|
|
11249
|
+
|
|
11250
|
+
return self._returnData(await apiCall);
|
|
11251
|
+
} catch (ex) {
|
|
11252
|
+
throw ex;
|
|
11253
|
+
}
|
|
11254
|
+
}
|
|
11215
11255
|
}
|
|
11216
11256
|
|
|
11217
11257
|
/**
|