@docbrasil/api-systemmanager 1.1.60 → 1.1.62

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.
Files changed (82) hide show
  1. package/api/user/index.js +3 -0
  2. package/api/user/kanban.js +510 -0
  3. package/dist/bundle.cjs +504 -0
  4. package/dist/bundle.mjs +1 -1
  5. package/doc/api.md +354 -24
  6. package/docs/Admin.html +1 -1
  7. package/docs/AdminDocuments.html +1 -1
  8. package/docs/AdminForm.html +1 -1
  9. package/docs/AdminLists.html +1 -1
  10. package/docs/AdminMessage.html +1 -1
  11. package/docs/AdminNotification.html +1 -1
  12. package/docs/AdminPlugin.html +1 -1
  13. package/docs/AdminPolicy.html +1 -1
  14. package/docs/AdminProcesses.html +1 -1
  15. package/docs/AdminTask.html +1 -1
  16. package/docs/AdminUser.html +1 -1
  17. package/docs/Application.html +1 -1
  18. package/docs/Chart.html +1 -1
  19. package/docs/Dashboard.html +1 -1
  20. package/docs/Datasource.html +1 -1
  21. package/docs/Dispatch.html +132 -41
  22. package/docs/Documents.html +8 -8
  23. package/docs/External.html +1 -1
  24. package/docs/GeoLocation.html +1 -1
  25. package/docs/Help.html +1 -1
  26. package/docs/Kanban.html +3038 -0
  27. package/docs/Login.html +2 -2
  28. package/docs/MyTasks.html +1 -1
  29. package/docs/MyndAI.html +1 -1
  30. package/docs/Notification.html +1 -1
  31. package/docs/Organization.html +1 -1
  32. package/docs/Page.html +1 -1
  33. package/docs/Process.html +1 -1
  34. package/docs/Register.html +1 -1
  35. package/docs/Session.html +1 -1
  36. package/docs/Settings.html +1 -1
  37. package/docs/Task.html +1 -1
  38. package/docs/TaskAvailable.html +1 -1
  39. package/docs/Updates.html +1 -1
  40. package/docs/User.html +1 -1
  41. package/docs/Users.html +2 -2
  42. package/docs/admin_doctypes.js.html +2 -2
  43. package/docs/admin_document.js.html +2 -2
  44. package/docs/admin_form.js.html +2 -2
  45. package/docs/admin_index.js.html +1 -1
  46. package/docs/admin_list.js.html +2 -2
  47. package/docs/admin_message.js.html +2 -2
  48. package/docs/admin_notification.js.html +2 -2
  49. package/docs/admin_organization.js.html +2 -2
  50. package/docs/admin_plugin.js.html +2 -2
  51. package/docs/admin_policy.js.html +1 -1
  52. package/docs/admin_processes.js.html +2 -2
  53. package/docs/admin_task.js.html +2 -2
  54. package/docs/admin_user.js.html +2 -2
  55. package/docs/ai.js.html +2 -2
  56. package/docs/dispatch.js.html +75 -78
  57. package/docs/external.js.html +2 -2
  58. package/docs/general_geoLocation.js.html +2 -2
  59. package/docs/general_index.js.html +1 -1
  60. package/docs/index.html +1 -1
  61. package/docs/login.js.html +3 -3
  62. package/docs/session.js.html +2 -2
  63. package/docs/user_application.js.html +2 -2
  64. package/docs/user_dashboard.js.html +2 -2
  65. package/docs/user_datasource.js.html +2 -2
  66. package/docs/user_document.js.html +5 -4
  67. package/docs/user_help.js.html +2 -2
  68. package/docs/user_index.js.html +4 -1
  69. package/docs/user_kanban.js.html +627 -0
  70. package/docs/user_my_tasks.js.html +9 -9
  71. package/docs/user_notification.js.html +2 -2
  72. package/docs/user_organization.js.html +3 -3
  73. package/docs/user_page.js.html +2 -2
  74. package/docs/user_process.js.html +14 -14
  75. package/docs/user_register.js.html +2 -2
  76. package/docs/user_settings.js.html +2 -2
  77. package/docs/user_task.js.html +2 -2
  78. package/docs/user_task_available.js.html +2 -2
  79. package/docs/user_updates.js.html +2 -2
  80. package/docs/user_user.js.html +2 -2
  81. package/docs/utils_promises.js.html +1 -1
  82. package/package.json +1 -1
@@ -0,0 +1,627 @@
1
+
2
+
3
+ <!DOCTYPE html>
4
+ <html lang="en">
5
+
6
+ <head>
7
+
8
+ <meta charset="utf-8">
9
+ <meta name="viewport" content="width=device-width, initial-scale=1">
10
+ <title> user/kanban.js</title>
11
+
12
+ <script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
13
+ <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
14
+ <script src="./build/entry.js"></script>
15
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
16
+ <!--[if lt IE 9]>
17
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
18
+ <![endif]-->
19
+ <link href="https://fonts.googleapis.com/css?family=Roboto:100,400,700|Inconsolata,700" rel="stylesheet">
20
+ <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
21
+ <link type="text/css" rel="stylesheet" href="https://jmblog.github.io/color-themes-for-google-code-prettify/themes/tomorrow-night.min.css">
22
+ <link type="text/css" rel="stylesheet" href="styles/app.min.css">
23
+ <link type="text/css" rel="stylesheet" href="styles/iframe.css">
24
+ <link type="text/css" rel="stylesheet" href="">
25
+ <script async defer src="https://buttons.github.io/buttons.js"></script>
26
+
27
+
28
+ </head>
29
+
30
+
31
+
32
+ <body class="layout small-header">
33
+ <div id="stickyNavbarOverlay"></div>
34
+
35
+
36
+ <div class="top-nav">
37
+ <div class="inner">
38
+ <a id="hamburger" role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
39
+ <span aria-hidden="true"></span>
40
+ <span aria-hidden="true"></span>
41
+ <span aria-hidden="true"></span>
42
+ </a>
43
+ <div class="logo">
44
+
45
+
46
+ </div>
47
+ <div class="menu">
48
+
49
+ <div class="navigation">
50
+ <a
51
+ href="index.html"
52
+ class="link"
53
+ >
54
+ Documentation
55
+ </a>
56
+
57
+
58
+
59
+ </div>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ <div id="main">
64
+ <div
65
+ class="sidebar "
66
+ id="sidebarNav"
67
+ >
68
+
69
+ <nav>
70
+
71
+ <h2><a href="index.html">Documentation</a></h2><div class="category"><h3>Classes</h3><ul><li><a href="Admin.html">Admin</a></li><li><a href="AdminDocuments.html">AdminDocuments</a></li><li><a href="AdminForm.html">AdminForm</a></li><li><a href="AdminLists.html">AdminLists</a></li><li><a href="AdminMessage.html">AdminMessage</a></li><li><a href="AdminNotification.html">AdminNotification</a></li><li><a href="AdminPlugin.html">AdminPlugin</a></li><li><a href="AdminPolicy.html">AdminPolicy</a></li><li><a href="AdminProcesses.html">AdminProcesses</a></li><li><a href="AdminTask.html">AdminTask</a></li><li><a href="AdminUser.html">AdminUser</a></li><li><a href="Application.html">Application</a></li><li><a href="Chart.html">Chart</a></li><li><a href="Dashboard.html">Dashboard</a></li><li><a href="Datasource.html">Datasource</a></li><li><a href="Dispatch.html">Dispatch</a></li><li><a href="Documents.html">Documents</a></li><li><a href="External.html">External</a></li><li><a href="GeoLocation.html">GeoLocation</a></li><li><a href="Help.html">Help</a></li><li><a href="Kanban.html">Kanban</a></li><li><a href="Login.html">Login</a></li><li><a href="MyTasks.html">MyTasks</a></li><li><a href="MyndAI.html">MyndAI</a></li><li><a href="Notification.html">Notification</a></li><li><a href="Organization.html">Organization</a></li><li><a href="Page.html">Page</a></li><li><a href="Process.html">Process</a></li><li><a href="Register.html">Register</a></li><li><a href="Session.html">Session</a></li><li><a href="Settings.html">Settings</a></li><li><a href="Task.html">Task</a></li><li><a href="TaskAvailable.html">TaskAvailable</a></li><li><a href="Updates.html">Updates</a></li><li><a href="User.html">User</a></li><li><a href="Users.html">Users</a></li></ul></div>
72
+
73
+ </nav>
74
+ </div>
75
+ <div class="core" id="main-content-wrapper">
76
+ <div class="content">
77
+ <header class="page-title">
78
+ <p>Source</p>
79
+ <h1>user/kanban.js</h1>
80
+ </header>
81
+
82
+
83
+
84
+
85
+
86
+ <section>
87
+ <article>
88
+ <pre class="prettyprint source linenums"><code>import _ from 'lodash';
89
+ import Boom from '@hapi/boom';
90
+ import Joi from 'joi';
91
+ import TaskAvailable from './task_available.js';
92
+ import MyTasks from './my_tasks.js';
93
+
94
+ /**
95
+ * Class for task, permission user
96
+ * @class
97
+ */
98
+ class Kanban {
99
+
100
+ constructor(options) {
101
+ Joi.assert(options, Joi.object().required());
102
+ Joi.assert(options.parent, Joi.object().required());
103
+
104
+ const self = this;
105
+ self.parent = options.parent;
106
+ self._client = self.parent.dispatch.getClient();
107
+ self.available = new TaskAvailable(options);
108
+ self.mytasks = new MyTasks(options);
109
+ }
110
+
111
+ /**
112
+ * @author Augusto Pissarra &lt;abernardo.br@gmail.com>
113
+ * @description Get the return data and check for errors
114
+ * @param {object} retData Response HTTP
115
+ * @return {*}
116
+ * @private
117
+ */
118
+ _returnData(retData, def = {}) {
119
+ if (retData.status !== 200) {
120
+ return Boom.badRequest(_.get(retData, 'message', 'No error message reported!'))
121
+ } else {
122
+ return _.get(retData, 'data', def);
123
+ }
124
+ }
125
+
126
+ /**
127
+ * @author Myndware &lt;augusto.pissarra@myndware.com>
128
+ * @description Set header with new session
129
+ * @param {string} session Session, token JWT
130
+ * @return {object} header with new session
131
+ * @private
132
+ */
133
+ _setHeader(session) {
134
+ return {
135
+ headers: {
136
+ Authorization: session,
137
+ }
138
+ };
139
+ }
140
+
141
+ /**
142
+ * @author Myndware &lt;augusto.pissarra@myndware.com>
143
+ * @description Retrieves the Kanban board data for a specified organization process
144
+ * @param {Object} params - Parameters object
145
+ * @param {string} params.orgId - Organization id (_id database)
146
+ * @param {string} params.orgProcessName - The name of the organization process
147
+ * @param {string} params.flowId - Flow id for the specific kanban flow
148
+ * @param {string} session - Session, token JWT
149
+ * @returns {promise} Promise that resolves to Kanban board data
150
+ * @returns {Object} returns.data - The response data containing:
151
+ * @returns {boolean} returns.data.success - Indicates if the operation was successful
152
+ * @returns {Array} returns.data.kanban - Array of status columns with their tasks
153
+ * @returns {string} returns.data.kanban[].id - Unique identifier for the status column
154
+ * @returns {string} returns.data.kanban[].title - Display title of the status column
155
+ * @returns {boolean} returns.data.kanban[].isExpanded - Whether the status column is expanded or collapsed
156
+ * @returns {Array} returns.data.kanban[].taskList - Array of tasks within this status column
157
+ * @returns {Array} returns.data.kanban[].statusTagsList - List of status tags available for filtering
158
+ * @public
159
+ * @example
160
+ *
161
+ * const API = require('@docbrasil/api-systemmanager');
162
+ * const api = new API();
163
+ * const params = {
164
+ * orgId: '55e4a3bd6be6b45210833fae',
165
+ * orgProcessName: 'employee-onboarding',
166
+ * flowId: 'Task_16888el'
167
+ * };
168
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
169
+ * const kanbanData = await api.user.kanban.get(params, session);
170
+ *
171
+ * Expected response structure:
172
+ * {
173
+ * success: true,
174
+ * kanban: [
175
+ * {
176
+ * id: 'pending',
177
+ * title: 'Pending Tasks',
178
+ * isExpanded: true,
179
+ * taskList: [
180
+ * { taskId: '507f1f77bcf86cd799439011', title: 'Review Document', ... },
181
+ * { taskId: '507f1f77bcf86cd799439012', title: 'Approve Request', ... }
182
+ * ],
183
+ * statusTagsList: ['urgent', 'review', 'approved', 'rejected']
184
+ * },
185
+ * {
186
+ * id: 'in-progress',
187
+ * title: 'In Progress',
188
+ * isExpanded: true,
189
+ * taskList: [...],
190
+ * statusTagsList: ['urgent', 'review', 'approved', 'rejected']
191
+ * }
192
+ * ]
193
+ * }
194
+ */
195
+ async get(params, session) {
196
+ const self = this;
197
+
198
+ try {
199
+ Joi.assert(params, Joi.object().required(), 'Params to get task');
200
+ Joi.assert(params.orgId, Joi.string().required(), 'Organization id (_id database)');
201
+ Joi.assert(params.orgProcessName, Joi.string().required(), 'The organization process name');
202
+ Joi.assert(params.flowId, Joi.string().required(), 'Flow id for the specific kanban flow');
203
+ Joi.assert(session, Joi.string().required(), 'Session token JWT');
204
+
205
+ const { orgId, orgProcessName, flowId } = params;
206
+
207
+ // Build API endpoint with flowName as part of the path
208
+ const endpoint = `/organization/${orgId}/kanban/${orgProcessName}/flow/${flowId}`;
209
+
210
+ const apiCall = self._client
211
+ .get(endpoint, self._setHeader(session));
212
+
213
+ return self._returnData(await apiCall);
214
+ } catch (ex) {
215
+ throw ex;
216
+ }
217
+ }
218
+
219
+ /**
220
+ * @author Myndware &lt;augusto.pissarra@myndware.com>
221
+ * @description Updates the order of a task in its status column on the Kanban board
222
+ * @param {Object} params - Parameters object
223
+ * @param {string} params.orgId - Organization id (_id database)
224
+ * @param {string} params.taskId - The ID of the task to update
225
+ * @param {number} params.order - The new order position of the task
226
+ * @param {string} session - Session, token JWT
227
+ * @returns {promise} Promise that resolves to operation status
228
+ * @returns {Object} returns.data - The response data containing:
229
+ * @returns {boolean} returns.data.success - Indicates if the operation was successful
230
+ * @returns {string} [returns.data.error] - Error message if operation failed
231
+ * @public
232
+ * @example
233
+ *
234
+ * const API = require('@docbrasil/api-systemmanager');
235
+ * const api = new API();
236
+ * const params = {
237
+ * orgId: '55e4a3bd6be6b45210833fae',
238
+ * taskId: '507f1f77bcf86cd799439011',
239
+ * order: 3
240
+ * };
241
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
242
+ * const result = await api.user.kanban.updateTaskOrder(params, session);
243
+ *
244
+ * Expected response structure (success):
245
+ * {
246
+ * success: true
247
+ * }
248
+ *
249
+ * Expected response structure (error):
250
+ * {
251
+ * success: false,
252
+ * error: "Task not found"
253
+ * }
254
+ */
255
+ async updateTaskOrder(params, session) {
256
+ const self = this;
257
+
258
+ try {
259
+ Joi.assert(params, Joi.object().required(), 'Params to update task order');
260
+ Joi.assert(params.orgId, Joi.string().required(), 'Organization id (_id database)');
261
+ Joi.assert(params.taskId, Joi.string().required(), 'The ID of the task to update');
262
+ Joi.assert(params.order, Joi.number().required(), 'The new order position of the task');
263
+ Joi.assert(session, Joi.string().required(), 'Session token JWT');
264
+
265
+ const { orgId, taskId, order } = params;
266
+
267
+ // Build API endpoint for updating task order
268
+ const endpoint = `/organization/${orgId}/kanban/task/${taskId}/order`;
269
+
270
+ const apiCall = self._client
271
+ .put(endpoint, { order }, self._setHeader(session));
272
+
273
+ return self._returnData(await apiCall);
274
+ } catch (ex) {
275
+ throw ex;
276
+ }
277
+ }
278
+
279
+ /**
280
+ * @author Myndware &lt;augusto.pissarra@myndware.com>
281
+ * @description Updates the order of multiple tasks in their status columns on the Kanban board
282
+ * @param {Object} params - Parameters object
283
+ * @param {string} params.orgId - Organization id (_id database)
284
+ * @param {Array} params.tasks - Array of task objects containing taskId and order
285
+ * @param {string} params.tasks[].taskId - The unique identifier of the task to update
286
+ * @param {number} params.tasks[].order - The new order position for the task
287
+ * @param {string} session - Session, token JWT
288
+ * @returns {promise} Promise that resolves to operation status
289
+ * @returns {Object} returns.data - The response data containing:
290
+ * @returns {boolean} returns.data.success - Indicates if the operation was successful
291
+ * @returns {string} [returns.data.error] - Error message if operation failed
292
+ * @public
293
+ * @example
294
+ *
295
+ * const API = require('@docbrasil/api-systemmanager');
296
+ * const api = new API();
297
+ * const params = {
298
+ * orgId: '55e4a3bd6be6b45210833fae',
299
+ * tasks: [
300
+ * { taskId: '507f1f77bcf86cd799439011', order: 1 },
301
+ * { taskId: '507f1f77bcf86cd799439012', order: 2 },
302
+ * { taskId: '507f1f77bcf86cd799439013', order: 3 }
303
+ * ]
304
+ * };
305
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
306
+ * const result = await api.user.kanban.updateTasksOrder(params, session);
307
+ *
308
+ * Expected response structure (success):
309
+ * {
310
+ * success: true
311
+ * }
312
+ *
313
+ * Expected response structure (error):
314
+ * {
315
+ * success: false,
316
+ * error: "One or more tasks not found"
317
+ * }
318
+ */
319
+ async updateTasksOrder(params, session) {
320
+ const self = this;
321
+
322
+ try {
323
+ Joi.assert(params, Joi.object().required(), 'Params to update tasks order');
324
+ Joi.assert(params.orgId, Joi.string().required(), 'Organization id (_id database)');
325
+ Joi.assert(params.tasks, Joi.array().required(), 'Array of task objects containing taskId and order');
326
+ Joi.assert(session, Joi.string().required(), 'Session token JWT');
327
+
328
+ const { orgId, tasks } = params;
329
+
330
+ // Build API endpoint for updating multiple tasks order
331
+ const endpoint = `/organization/${orgId}/kanban/task/orders`;
332
+
333
+ const apiCall = self._client
334
+ .put(endpoint, { tasks }, self._setHeader(session));
335
+
336
+ return self._returnData(await apiCall);
337
+ } catch (ex) {
338
+ throw ex;
339
+ }
340
+ }
341
+
342
+ /**
343
+ * @author Myndware &lt;augusto.pissarra@myndware.com>
344
+ * @description Updates the status of a task on the Kanban board when moved between columns
345
+ * @param {Object} params - Parameters object
346
+ * @param {string} params.orgId - Organization id (_id database)
347
+ * @param {string} params.taskId - The ID of the task to update
348
+ * @param {string} params.status - The new status value for the task
349
+ * @param {string} session - Session, token JWT
350
+ * @returns {promise} Promise that resolves to operation status
351
+ * @returns {Object} returns.data - The response data containing:
352
+ * @returns {boolean} returns.data.success - Indicates if the operation was successful
353
+ * @returns {string} [returns.data.error] - Error message if operation failed
354
+ * @public
355
+ * @example
356
+ *
357
+ * const API = require('@docbrasil/api-systemmanager');
358
+ * const api = new API();
359
+ * const params = {
360
+ * orgId: '55e4a3bd6be6b45210833fae',
361
+ * taskId: '507f1f77bcf86cd799439011',
362
+ * status: 'in-progress'
363
+ * };
364
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
365
+ * const result = await api.user.kanban.updateTaskStatus(params, session);
366
+ *
367
+ * Expected response structure (success):
368
+ * {
369
+ * success: true
370
+ * }
371
+ *
372
+ * Expected response structure (error):
373
+ * {
374
+ * success: false,
375
+ * error: "Task not found"
376
+ * }
377
+ */
378
+ async updateTaskStatus(params, session) {
379
+ const self = this;
380
+
381
+ try {
382
+ Joi.assert(params, Joi.object().required(), 'Params to update task status');
383
+ Joi.assert(params.orgId, Joi.string().required(), 'Organization id (_id database)');
384
+ Joi.assert(params.taskId, Joi.string().required(), 'The ID of the task to update');
385
+ Joi.assert(params.status, Joi.string().required(), 'The new status value for the task');
386
+ Joi.assert(session, Joi.string().required(), 'Session token JWT');
387
+
388
+ const { orgId, taskId, status } = params;
389
+
390
+ // Build API endpoint for updating task status
391
+ const endpoint = `/organization/${orgId}/kanban/task/${taskId}/status`;
392
+
393
+ const apiCall = self._client
394
+ .put(endpoint, { status }, self._setHeader(session));
395
+
396
+ return self._returnData(await apiCall);
397
+ } catch (ex) {
398
+ throw ex;
399
+ }
400
+ }
401
+
402
+ /**
403
+ * @author Myndware &lt;augusto.pissarra@myndware.com>
404
+ * @description Adds a tag to a task on the Kanban board without creating duplicates
405
+ * @param {Object} params - Parameters object
406
+ * @param {string} params.orgId - Organization id (_id database)
407
+ * @param {string} params.taskId - The ID of the task to update
408
+ * @param {string} params.tag - The tag to add to the task
409
+ * @param {string} session - Session, token JWT
410
+ * @returns {promise} Promise that resolves to operation status
411
+ * @returns {Object} returns.data - The response data containing:
412
+ * @returns {boolean} returns.data.success - Indicates if the operation was successful
413
+ * @returns {string} [returns.data.error] - Error message if operation failed
414
+ * @public
415
+ * @example
416
+ *
417
+ * const API = require('@docbrasil/api-systemmanager');
418
+ * const api = new API();
419
+ * const params = {
420
+ * orgId: '55e4a3bd6be6b45210833fae',
421
+ * taskId: '507f1f77bcf86cd799439011',
422
+ * tag: 'urgent'
423
+ * };
424
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
425
+ * const result = await api.user.kanban.addTaskTag(params, session);
426
+ *
427
+ * Expected response structure (success):
428
+ * {
429
+ * success: true
430
+ * }
431
+ *
432
+ * Expected response structure (error):
433
+ * {
434
+ * success: false,
435
+ * error: "Task not found"
436
+ * }
437
+ */
438
+ async addTaskTag(params, session) {
439
+ const self = this;
440
+
441
+ try {
442
+ Joi.assert(params, Joi.object().required(), 'Params to add task tag');
443
+ Joi.assert(params.orgId, Joi.string().required(), 'Organization id (_id database)');
444
+ Joi.assert(params.taskId, Joi.string().required(), 'The ID of the task to update');
445
+ Joi.assert(params.tag, Joi.string().required(), 'The tag to add to the task');
446
+ Joi.assert(session, Joi.string().required(), 'Session token JWT');
447
+
448
+ const { orgId, taskId, tag } = params;
449
+
450
+ // Build API endpoint for adding task tag
451
+ const endpoint = `/organization/${orgId}/kanban/task/${taskId}/tag`;
452
+
453
+ const apiCall = self._client
454
+ .put(endpoint, { tag }, self._setHeader(session));
455
+
456
+ return self._returnData(await apiCall);
457
+ } catch (ex) {
458
+ throw ex;
459
+ }
460
+ }
461
+
462
+ /**
463
+ * @author Myndware &lt;augusto.pissarra@myndware.com>
464
+ * @description Removes a specific tag from a task on the Kanban board
465
+ * @param {Object} params - Parameters object
466
+ * @param {string} params.orgId - Organization id (_id database)
467
+ * @param {string} params.taskId - The ID of the task to update
468
+ * @param {string} params.tag - The tag to remove from the task
469
+ * @param {string} session - Session, token JWT
470
+ * @returns {promise} Promise that resolves to operation status
471
+ * @returns {Object} returns.data - The response data containing:
472
+ * @returns {boolean} returns.data.success - Indicates if the operation was successful
473
+ * @returns {string} [returns.data.error] - Error message if operation failed
474
+ * @public
475
+ * @example
476
+ *
477
+ * const API = require('@docbrasil/api-systemmanager');
478
+ * const api = new API();
479
+ * const params = {
480
+ * orgId: '55e4a3bd6be6b45210833fae',
481
+ * taskId: '507f1f77bcf86cd799439011',
482
+ * tag: 'urgent'
483
+ * };
484
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
485
+ * const result = await api.user.kanban.removeTaskTag(params, session);
486
+ *
487
+ * Expected response structure (success):
488
+ * {
489
+ * success: true
490
+ * }
491
+ *
492
+ * Expected response structure (error):
493
+ * {
494
+ * success: false,
495
+ * error: "Task not found"
496
+ * }
497
+ */
498
+ async removeTaskTag(params, session) {
499
+ const self = this;
500
+
501
+ try {
502
+ Joi.assert(params, Joi.object().required(), 'Params to remove task tag');
503
+ Joi.assert(params.orgId, Joi.string().required(), 'Organization id (_id database)');
504
+ Joi.assert(params.taskId, Joi.string().required(), 'The ID of the task to update');
505
+ Joi.assert(params.tag, Joi.string().required(), 'The tag to remove from the task');
506
+ Joi.assert(session, Joi.string().required(), 'Session token JWT');
507
+
508
+ const { orgId, taskId, tag } = params;
509
+
510
+ // Build API endpoint for removing task tag
511
+ const endpoint = `/organization/${orgId}/kanban/task/${taskId}/tag/${tag}`;
512
+
513
+ const apiCall = self._client
514
+ .delete(endpoint, self._setHeader(session));
515
+
516
+ return self._returnData(await apiCall);
517
+ } catch (ex) {
518
+ throw ex;
519
+ }
520
+ }
521
+
522
+ /**
523
+ * @author Myndware &lt;augusto.pissarra@myndware.com>
524
+ * @description Updates the status list order for a specific flow in an organization process on the Kanban board
525
+ * Can also be used to update the name, expanded and or the color value of an status of the status list
526
+ * That is: updates the whole status list
527
+ * @param {Object} params - Parameters object
528
+ * @param {string} params.orgId - Organization id (_id database)
529
+ * @param {string} params.orgProcessName - The name of the organization process
530
+ * @param {string} params.flowName - The name of the organization process step flowName
531
+ * @param {Array} params.statusList - The status list with new order
532
+ * @param {Object} params.statusList[] - Status object configuration
533
+ * @param {string} params.statusList[].value - The title of the status
534
+ * @param {boolean} params.statusList[].expanded - If the status column is expanded or not
535
+ * @param {string} params.statusList[].color - The hexadecimal color code for the status
536
+ * @param {string} session - Session, token JWT
537
+ * @returns {promise} Promise that resolves to operation status
538
+ * @returns {Object} returns.data - The response data containing:
539
+ * @returns {boolean} returns.data.success - Indicates if the operation was successful
540
+ * @returns {string} [returns.data.error] - Error message if operation failed
541
+ * @public
542
+ * @example
543
+ *
544
+ * const API = require('@docbrasil/api-systemmanager');
545
+ * const api = new API();
546
+ * const params = {
547
+ * orgId: '55e4a3bd6be6b45210833fae',
548
+ * orgProcessName: 'employee-onboarding',
549
+ * flowName: 'approval-flow',
550
+ * statusList: [
551
+ * { value: 'Pending', expanded: true, color: '#FF6B6B' },
552
+ * { value: 'In Progress', expanded: true, color: '#4ECDC4' },
553
+ * { value: 'Under Review', expanded: false, color: '#45B7D1' },
554
+ * { value: 'Completed', expanded: true, color: '#96CEB4' }
555
+ * ]
556
+ * };
557
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
558
+ * const result = await api.user.kanban.updateStatusList(params, session);
559
+ *
560
+ * Expected response structure (success):
561
+ * {
562
+ * success: true
563
+ * }
564
+ *
565
+ * Expected response structure (error):
566
+ * {
567
+ * success: false,
568
+ * error: "Organization process not found"
569
+ * }
570
+ */
571
+ async updateStatusList(params, session) {
572
+ const self = this;
573
+
574
+ try {
575
+ Joi.assert(params, Joi.object().required(), 'Params to update status list');
576
+ Joi.assert(params.orgId, Joi.string().required(), 'Organization id (_id database)');
577
+ Joi.assert(params.orgProcessName, Joi.string().required(), 'The name of the organization process');
578
+ Joi.assert(params.flowName, Joi.string().required(), 'The name of the organization process step flowName');
579
+ Joi.assert(params.statusList, Joi.array().required(), 'The status list with new order');
580
+ Joi.assert(session, Joi.string().required(), 'Session token JWT');
581
+
582
+ const { orgId, orgProcessName, flowName, statusList } = params;
583
+
584
+ // Build API endpoint for updating status list
585
+ const endpoint = `/organization/${orgId}/kanban/${orgProcessName}/flow/${flowName}`;
586
+
587
+ const apiCall = self._client
588
+ .put(endpoint, { statusList }, self._setHeader(session));
589
+
590
+ return self._returnData(await apiCall);
591
+ } catch (ex) {
592
+ throw ex;
593
+ }
594
+ }
595
+ }
596
+
597
+ export default Kanban;
598
+ </code></pre>
599
+ </article>
600
+ </section>
601
+
602
+
603
+
604
+
605
+ </div>
606
+
607
+ <footer class="footer">
608
+ <div class="content has-text-centered">
609
+ <p>Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a></p>
610
+ <p class="sidebar-created-by">
611
+ <a href="https://github.com/SoftwareBrothers/better-docs" target="_blank">BetterDocs theme</a> provided with <i class="fas fa-heart"></i> by
612
+ <a href="http://softwarebrothers.co" target="_blank">SoftwareBrothers - JavaScript Development Agency</a>
613
+ </p>
614
+ </div>
615
+ </footer>
616
+
617
+ </div>
618
+ <div id="side-nav" class="side-nav">
619
+ </div>
620
+ </div>
621
+ <script src="scripts/app.min.js"></script>
622
+ <script>PR.prettyPrint();</script>
623
+ <script src="scripts/linenumber.js"> </script>
624
+
625
+
626
+ </body>
627
+ </html>