@docbrasil/api-systemmanager 1.1.65 → 1.1.67

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/doc/api.md CHANGED
@@ -1593,6 +1593,7 @@ Class for documents, permission user
1593
1593
  * [Documents](#Documents)
1594
1594
  * [.add(params, session)](#Documents+add) ⇒ <code>Promise</code>
1595
1595
  * [.findByIdAndUpdate(id, params, session)](#Documents+findByIdAndUpdate) ⇒ <code>Promise</code>
1596
+ * [.findByIdsAndUpdate(ids, params, session)](#Documents+findByIdsAndUpdate) ⇒ <code>Promise</code>
1596
1597
  * [.findById(id, session)](#Documents+findById) ⇒ <code>Promise</code>
1597
1598
  * [.find(params, session)](#Documents+find) ⇒ <code>Promise</code>
1598
1599
  * [.findByIdAndRemove(params, session)](#Documents+findByIdAndRemove) ⇒ <code>Promise.&lt;object&gt;</code> \| <code>number</code> \| <code>array.&lt;object&gt;</code> \| <code>string</code> \| <code>string</code> \| <code>string</code>
@@ -1689,6 +1690,31 @@ const params = { ... };
1689
1690
  const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
1690
1691
  await api.user.document.findByIdAndUpdate('5edf9f8ee896b817e45b8dad', params, session);
1691
1692
  ```
1693
+ <a name="Documents+findByIdsAndUpdate"></a>
1694
+
1695
+ ### documents.findByIdsAndUpdate(ids, params, session) ⇒ <code>Promise</code>
1696
+ Updates a document
1697
+
1698
+ **Kind**: instance method of [<code>Documents</code>](#Documents)
1699
+ **Access**: public
1700
+ **Author**: Myndware <augusto.pissarra@myndware.com>
1701
+
1702
+ | Param | Type | Description |
1703
+ | --- | --- | --- |
1704
+ | ids | <code>array.&lt;string&gt;</code> | array of document _id |
1705
+ | params | <code>object</code> | Object for document payload to update. It has the orgId and areaId (required) and the fields to update. Partial updates accepted, such as docTypeFieldsData.extraFieldName |
1706
+ | params.orgId | <code>string</code> | The orgId of the organization |
1707
+ | params.areaId | <code>string</code> | The areaId to update in batch |
1708
+ | session | <code>string</code> | Session, token JWT |
1709
+
1710
+ **Example**
1711
+ ```js
1712
+ const API = require('@docbrasil/api-systemmanager');
1713
+ const api = new API();
1714
+ const params = { orgId: '5edf9f8ee896b817e45b8da7', areaId: '5edf9f8ee896b817e45b8da8', 'docTypeFieldsData.extraName': 'New name' };
1715
+ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
1716
+ await api.user.document.findByIdsAndUpdate(['5edf9f8ee896b817e45b8dad'], params, session);
1717
+ ```
1692
1718
  <a name="Documents+findById"></a>
1693
1719
 
1694
1720
  ### documents.findById(id, session) ⇒ <code>Promise</code>
@@ -2636,10 +2662,10 @@ Expected response structure (error):
2636
2662
  <a name="Kanban+startTask"></a>
2637
2663
 
2638
2664
  ### kanban.startTask(params, session) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>string</code> \| <code>string</code>
2639
- Starts a new task in the Kanban board for a specific organization process
2665
+ The new task is the full object of the task, like when you search the task
2640
2666
 
2641
2667
  **Kind**: instance method of [<code>Kanban</code>](#Kanban)
2642
- **Returns**: <code>promise</code> - Promise that resolves to operation status<code>Object</code> - returns.data - The response data containing:<code>boolean</code> - returns.data.success - Indicates if the operation was successful<code>string</code> - [returns.data.taskId] - The ID of the newly created task<code>string</code> - [returns.data.error] - Error message if operation failed
2668
+ **Returns**: <code>promise</code> - Promise that resolves to operation status<code>Object</code> - returns.data - The response data containing:<code>boolean</code> - returns.data.success - Indicates if the operation was successful<code>string</code> - [returns.data.task] - The created task and its properties<code>string</code> - [returns.data.error] - Error message if operation failed
2643
2669
  **Access**: public
2644
2670
  **Author**: Myndware <augusto.pissarra@myndware.com>
2645
2671
 
@@ -2651,7 +2677,7 @@ Starts a new task in the Kanban board for a specific organization process
2651
2677
  | params.title | <code>string</code> | The title of the new task |
2652
2678
  | params.status | <code>string</code> | The status id of the new task |
2653
2679
  | [params.tags] | <code>Array</code> | Array of tag ids for the new task (optional) |
2654
- | [params.tasks] | <code>Array</code> | The task ids of each task inside the same status (optional) |
2680
+ | [params.tasks] | <code>Array</code> | The task ids, in their current order, of each task inside the same status (optional) |
2655
2681
  | session | <code>string</code> | Session, token JWT |
2656
2682
 
2657
2683
  **Example**
@@ -2672,7 +2698,7 @@ const result = await api.user.kanban.startTask(params, session);
2672
2698
  Expected response structure (success):
2673
2699
  {
2674
2700
  success: true,
2675
- taskId: '507f1f77bcf86cd799439013'
2701
+ task: { _id: '507f1f77bcf86cd799439013', ... }
2676
2702
  }
2677
2703
 
2678
2704
  Expected response structure (error):
@@ -1657,7 +1657,7 @@ Checks if a document can be added and it does not repeat its primary key</li>
1657
1657
  <p class="tag-source">
1658
1658
  <a href="user_document.js.html" class="button">View Source</a>
1659
1659
  <span>
1660
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line794">line 794</a>
1660
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line834">line 834</a>
1661
1661
  </span>
1662
1662
  </p>
1663
1663
 
@@ -1950,7 +1950,7 @@ const retDocs = await api.user.document.checkPrimaryKeys(params, session);</code
1950
1950
  <p class="tag-source">
1951
1951
  <a href="user_document.js.html" class="button">View Source</a>
1952
1952
  <span>
1953
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line882">line 882</a>
1953
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line922">line 922</a>
1954
1954
  </span>
1955
1955
  </p>
1956
1956
 
@@ -2222,7 +2222,7 @@ const retSearch = await api.user.document.exportExcelForAllPages(params, session
2222
2222
  <p class="tag-source">
2223
2223
  <a href="user_document.js.html" class="button">View Source</a>
2224
2224
  <span>
2225
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line922">line 922</a>
2225
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line962">line 962</a>
2226
2226
  </span>
2227
2227
  </p>
2228
2228
 
@@ -2912,7 +2912,7 @@ const retSearch = await api.user.document.exportWmsExcelForAllPages(params, sess
2912
2912
  <p class="tag-source">
2913
2913
  <a href="user_document.js.html" class="button">View Source</a>
2914
2914
  <span>
2915
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line341">line 341</a>
2915
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line381">line 381</a>
2916
2916
  </span>
2917
2917
  </p>
2918
2918
 
@@ -3138,7 +3138,7 @@ await api.user.document.findByIdAndRemove(params, session);</code></pre>
3138
3138
  <p class="tag-source">
3139
3139
  <a href="user_document.js.html" class="button">View Source</a>
3140
3140
  <span>
3141
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line290">line 290</a>
3141
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line330">line 330</a>
3142
3142
  </span>
3143
3143
  </p>
3144
3144
 
@@ -3404,7 +3404,7 @@ await api.user.document.findById('5edf9f8ee896b817e45b8dad', session);</code></p
3404
3404
  <p class="tag-source">
3405
3405
  <a href="user_document.js.html" class="button">View Source</a>
3406
3406
  <span>
3407
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line425">line 425</a>
3407
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line465">line 465</a>
3408
3408
  </span>
3409
3409
  </p>
3410
3410
 
@@ -4032,7 +4032,7 @@ await api.user.document.findByIdAndUpdate('5edf9f8ee896b817e45b8dad', params, se
4032
4032
  <p class="tag-source">
4033
4033
  <a href="user_document.js.html" class="button">View Source</a>
4034
4034
  <span>
4035
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line470">line 470</a>
4035
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line510">line 510</a>
4036
4036
  </span>
4037
4037
  </p>
4038
4038
 
@@ -4187,6 +4187,299 @@ await api.user.document.findByIdsAndRemove(params, session);</code></pre>
4187
4187
 
4188
4188
 
4189
4189
 
4190
+ </div>
4191
+
4192
+ <div class="member">
4193
+
4194
+
4195
+
4196
+ <h4 class="name" id="findByIdsAndUpdate">
4197
+ <a class="href-link" href="#findByIdsAndUpdate">#</a>
4198
+
4199
+
4200
+ <span class='tag'>async</span>
4201
+
4202
+
4203
+ <span class="code-name">
4204
+
4205
+ findByIdsAndUpdate<span class="signature">(ids, params, session)</span><span class="type-signature"> &rarr; {Promise}</span>
4206
+
4207
+ </span>
4208
+ </h4>
4209
+
4210
+
4211
+
4212
+
4213
+ <div class="description">
4214
+ Updates a document
4215
+ </div>
4216
+
4217
+
4218
+
4219
+
4220
+
4221
+
4222
+
4223
+
4224
+
4225
+
4226
+ <h5>Parameters:</h5>
4227
+
4228
+ <div class="table-container">
4229
+ <table class="params table">
4230
+ <thead>
4231
+ <tr>
4232
+
4233
+ <th>Name</th>
4234
+
4235
+
4236
+ <th>Type</th>
4237
+
4238
+
4239
+
4240
+
4241
+
4242
+ <th class="last">Description</th>
4243
+ </tr>
4244
+ </thead>
4245
+
4246
+ <tbody>
4247
+
4248
+
4249
+
4250
+ <tr class="deep-level-0">
4251
+
4252
+ <td class="name"><code>ids</code></td>
4253
+
4254
+
4255
+ <td class="type">
4256
+
4257
+
4258
+ <code class="param-type">array.&lt;string></code>
4259
+
4260
+
4261
+
4262
+ </td>
4263
+
4264
+
4265
+
4266
+
4267
+
4268
+ <td class="description last">array of document _id</td>
4269
+ </tr>
4270
+
4271
+
4272
+
4273
+
4274
+
4275
+ <tr class="deep-level-0">
4276
+
4277
+ <td class="name"><code>params</code></td>
4278
+
4279
+
4280
+ <td class="type">
4281
+
4282
+
4283
+ <code class="param-type">object</code>
4284
+
4285
+
4286
+
4287
+ </td>
4288
+
4289
+
4290
+
4291
+
4292
+
4293
+ <td class="description last">Object for document payload to update. It has the orgId and areaId (required) and the fields to update.
4294
+ Partial updates accepted, such as docTypeFieldsData.extraFieldName</td>
4295
+ </tr>
4296
+
4297
+
4298
+
4299
+
4300
+ <tr class="deep-level-1">
4301
+
4302
+ <td class="name"><code>orgId</code></td>
4303
+
4304
+
4305
+ <td class="type">
4306
+
4307
+
4308
+ <code class="param-type">string</code>
4309
+
4310
+
4311
+
4312
+ </td>
4313
+
4314
+
4315
+
4316
+
4317
+
4318
+ <td class="description last">The orgId of the organization</td>
4319
+ </tr>
4320
+
4321
+
4322
+
4323
+ <tr class="deep-level-1">
4324
+
4325
+ <td class="name"><code>areaId</code></td>
4326
+
4327
+
4328
+ <td class="type">
4329
+
4330
+
4331
+ <code class="param-type">string</code>
4332
+
4333
+
4334
+
4335
+ </td>
4336
+
4337
+
4338
+
4339
+
4340
+
4341
+ <td class="description last">The areaId to update in batch</td>
4342
+ </tr>
4343
+
4344
+
4345
+
4346
+
4347
+
4348
+
4349
+
4350
+ <tr class="deep-level-0">
4351
+
4352
+ <td class="name"><code>session</code></td>
4353
+
4354
+
4355
+ <td class="type">
4356
+
4357
+
4358
+ <code class="param-type">string</code>
4359
+
4360
+
4361
+
4362
+ </td>
4363
+
4364
+
4365
+
4366
+
4367
+
4368
+ <td class="description last">Session, token JWT</td>
4369
+ </tr>
4370
+
4371
+
4372
+
4373
+ </tbody>
4374
+ </table>
4375
+ </div>
4376
+
4377
+
4378
+
4379
+
4380
+
4381
+ <dl class="details">
4382
+
4383
+
4384
+
4385
+
4386
+
4387
+
4388
+
4389
+
4390
+
4391
+
4392
+
4393
+
4394
+
4395
+
4396
+
4397
+
4398
+
4399
+
4400
+ <dt class="tag-author">Author:</dt>
4401
+ <dd class="tag-author">
4402
+ <ul>
4403
+ <li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
4404
+ </ul>
4405
+ </dd>
4406
+
4407
+
4408
+
4409
+
4410
+
4411
+
4412
+
4413
+
4414
+
4415
+
4416
+
4417
+
4418
+
4419
+
4420
+ <p class="tag-source">
4421
+ <a href="user_document.js.html" class="button">View Source</a>
4422
+ <span>
4423
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line294">line 294</a>
4424
+ </span>
4425
+ </p>
4426
+
4427
+ </dl>
4428
+
4429
+
4430
+
4431
+
4432
+
4433
+
4434
+
4435
+
4436
+
4437
+
4438
+
4439
+
4440
+
4441
+
4442
+
4443
+
4444
+
4445
+
4446
+ <div class='columns method-parameter'>
4447
+ <div class="column is-2"><label>Returns:</label></div>
4448
+ <div class="column is-10">
4449
+
4450
+
4451
+
4452
+ <div class="columns">
4453
+
4454
+
4455
+ <div class='column is-5 has-text-left'>
4456
+ <label>Type: </label>
4457
+
4458
+ <code class="param-type">Promise</code>
4459
+
4460
+
4461
+ </div>
4462
+
4463
+ </div>
4464
+
4465
+
4466
+ </div>
4467
+ </div>
4468
+
4469
+
4470
+
4471
+
4472
+ <h5>Example</h5>
4473
+
4474
+
4475
+ <pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
4476
+ const api = new API();
4477
+ const params = { orgId: '5edf9f8ee896b817e45b8da7', areaId: '5edf9f8ee896b817e45b8da8', 'docTypeFieldsData.extraName': 'New name' };
4478
+ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
4479
+ await api.user.document.findByIdsAndUpdate(['5edf9f8ee896b817e45b8dad'], params, session);</code></pre>
4480
+
4481
+
4482
+
4190
4483
  </div>
4191
4484
 
4192
4485
  <div class="member">
@@ -4417,7 +4710,7 @@ await api.user.document.findByIdsAndRemove(params, session);</code></pre>
4417
4710
  <p class="tag-source">
4418
4711
  <a href="user_document.js.html" class="button">View Source</a>
4419
4712
  <span>
4420
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line972">line 972</a>
4713
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line1012">line 1012</a>
4421
4714
  </span>
4422
4715
  </p>
4423
4716
 
@@ -4698,7 +4991,7 @@ const retSearch = await api.user.document.performDownloadComplete(params, sessio
4698
4991
  <p class="tag-source">
4699
4992
  <a href="user_document.js.html" class="button">View Source</a>
4700
4993
  <span>
4701
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line842">line 842</a>
4994
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line882">line 882</a>
4702
4995
  </span>
4703
4996
  </p>
4704
4997
 
@@ -5042,7 +5335,7 @@ const retSearch = await api.user.document.searchDocuments(params, session);</cod
5042
5335
  <p class="tag-source">
5043
5336
  <a href="user_document.js.html" class="button">View Source</a>
5044
5337
  <span>
5045
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line1017">line 1017</a>
5338
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line1057">line 1057</a>
5046
5339
  </span>
5047
5340
  </p>
5048
5341
 
@@ -5501,7 +5794,7 @@ const retSearch = await api.user.document.searchDocumentsDirect(params, session)
5501
5794
  <p class="tag-source">
5502
5795
  <a href="user_document.js.html" class="button">View Source</a>
5503
5796
  <span>
5504
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line536">line 536</a>
5797
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line576">line 576</a>
5505
5798
  </span>
5506
5799
  </p>
5507
5800
 
@@ -6017,7 +6310,7 @@ const base64Data = await api.user.document.signedUrl(params, session);</code></p
6017
6310
  <p class="tag-source">
6018
6311
  <a href="user_document.js.html" class="button">View Source</a>
6019
6312
  <span>
6020
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line632">line 632</a>
6313
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line672">line 672</a>
6021
6314
  </span>
6022
6315
  </p>
6023
6316
 
@@ -6415,7 +6708,7 @@ const base64Data = await api.user.document.signedUrls(params, session);</code></
6415
6708
  <p class="tag-source">
6416
6709
  <a href="user_document.js.html" class="button">View Source</a>
6417
6710
  <span>
6418
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line736">line 736</a>
6711
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line776">line 776</a>
6419
6712
  </span>
6420
6713
  </p>
6421
6714
 
@@ -6706,7 +6999,7 @@ onUploadProgress return the progressEvent
6706
6999
  <p class="tag-source">
6707
7000
  <a href="user_document.js.html" class="button">View Source</a>
6708
7001
  <span>
6709
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line680">line 680</a>
7002
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line720">line 720</a>
6710
7003
  </span>
6711
7004
  </p>
6712
7005
 
package/docs/Kanban.html CHANGED
@@ -1428,7 +1428,7 @@ Expected response structure (error):
1428
1428
 
1429
1429
 
1430
1430
  <div class="description">
1431
- Starts a new task in the Kanban board for a specific organization process
1431
+ The new task is the full object of the task, like when you search the task
1432
1432
  </div>
1433
1433
 
1434
1434
 
@@ -1683,7 +1683,7 @@ Expected response structure (error):
1683
1683
 
1684
1684
 
1685
1685
 
1686
- <td class="description last">The task ids of each task inside the same status (optional)</td>
1686
+ <td class="description last">The task ids, in their current order, of each task inside the same status (optional)</td>
1687
1687
  </tr>
1688
1688
 
1689
1689
 
@@ -1773,7 +1773,7 @@ Expected response structure (error):
1773
1773
  <p class="tag-source">
1774
1774
  <a href="user_kanban.js.html" class="button">View Source</a>
1775
1775
  <span>
1776
- <a href="user_kanban.js.html">user/kanban.js</a>, <a href="user_kanban.js.html#line618">line 618</a>
1776
+ <a href="user_kanban.js.html">user/kanban.js</a>, <a href="user_kanban.js.html#line620">line 620</a>
1777
1777
  </span>
1778
1778
  </p>
1779
1779
 
@@ -1858,7 +1858,7 @@ Expected response structure (error):
1858
1858
 
1859
1859
  <div class="columns">
1860
1860
 
1861
- <div class='param-desc column is-7'>[returns.data.taskId] - The ID of the newly created task</div>
1861
+ <div class='param-desc column is-7'>[returns.data.task] - The created task and its properties</div>
1862
1862
 
1863
1863
 
1864
1864
  <div class='column is-5 has-text-left'>
@@ -1915,7 +1915,7 @@ const result = await api.user.kanban.startTask(params, session);
1915
1915
  Expected response structure (success):
1916
1916
  {
1917
1917
  success: true,
1918
- taskId: '507f1f77bcf86cd799439013'
1918
+ task: { _id: '507f1f77bcf86cd799439013', ... }
1919
1919
  }
1920
1920
 
1921
1921
  Expected response structure (error):
@@ -358,6 +358,46 @@ class Documents {
358
358
  }
359
359
  }
360
360
 
361
+ /**
362
+ * @author Myndware &lt;augusto.pissarra@myndware.com>
363
+ * @description Updates a document
364
+ * @param {array&lt;string>} ids array of document _id
365
+ * @param {object} params Object for document payload to update. It has the orgId and areaId (required) and the fields to update.
366
+ * Partial updates accepted, such as docTypeFieldsData.extraFieldName
367
+ * @param {string} params.orgId The orgId of the organization
368
+ * @param {string} params.areaId The areaId to update in batch
369
+ * @param {string} session Session, token JWT
370
+ * @return {Promise}
371
+ * @public
372
+ * @async
373
+ * @example
374
+ *
375
+ * const API = require('@docbrasil/api-systemmanager');
376
+ * const api = new API();
377
+ * const params = { orgId: '5edf9f8ee896b817e45b8da7', areaId: '5edf9f8ee896b817e45b8da8', 'docTypeFieldsData.extraName': 'New name' };
378
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
379
+ * await api.user.document.findByIdsAndUpdate(['5edf9f8ee896b817e45b8dad'], params, session);
380
+ */
381
+ async findByIdsAndUpdate(ids, params, session) {
382
+ const self = this;
383
+ try {
384
+ Joi.assert(ids, Joi.array().required().error(new Error('ids is required')));
385
+ Joi.assert(params, Joi.object().required().error(new Error('params is required')));
386
+ Joi.assert(params.orgId, Joi.string().required().error(new Error('orgId is required')));
387
+ Joi.assert(params.areaId, Joi.string().required().error(new Error('areaId is required')));
388
+ Joi.assert(session, Joi.string().required().error(new Error('session is required')));
389
+ const { areaId, orgId } = params;
390
+ delete params.areaId;
391
+ delete params.orgId;
392
+ const apiCall = self._client
393
+ .put(`/organizations/${orgId}/areas/${areaId}/documents/batch`, { ids, data: params }, self._setHeader(session));
394
+
395
+ return self._returnData(await apiCall);
396
+ } catch (ex) {
397
+ throw ex;
398
+ }
399
+ }
400
+
361
401
  /**
362
402
  * @author Myndware &lt;augusto.pissarra@myndware.com>
363
403
  * @description Updates a document.
@@ -661,18 +661,20 @@ class Kanban {
661
661
  /**
662
662
  * @author Myndware &lt;augusto.pissarra@myndware.com>
663
663
  * @description Starts a new task in the Kanban board for a specific organization process
664
+ * @description It will create the task, set the new order for all tasks (if you send them) and return the the task
665
+ * @description The new task is the full object of the task, like when you search the task
664
666
  * @param {Object} params - Parameters object
665
667
  * @param {string} params.orgId - Organization id (_id database)
666
668
  * @param {string} params.orgProcessName - The name of the organization process
667
669
  * @param {string} params.title - The title of the new task
668
670
  * @param {string} params.status - The status id of the new task
669
671
  * @param {Array} [params.tags] - Array of tag ids for the new task (optional)
670
- * @param {Array} [params.tasks] - The task ids of each task inside the same status (optional)
672
+ * @param {Array} [params.tasks] - The task ids, in their current order, of each task inside the same status (optional)
671
673
  * @param {string} session - Session, token JWT
672
674
  * @returns {promise} Promise that resolves to operation status
673
675
  * @returns {Object} returns.data - The response data containing:
674
676
  * @returns {boolean} returns.data.success - Indicates if the operation was successful
675
- * @returns {string} [returns.data.taskId] - The ID of the newly created task
677
+ * @returns {string} [returns.data.task] - The created task and its properties
676
678
  * @returns {string} [returns.data.error] - Error message if operation failed
677
679
  * @public
678
680
  * @example
@@ -693,7 +695,7 @@ class Kanban {
693
695
  * Expected response structure (success):
694
696
  * {
695
697
  * success: true,
696
- * taskId: '507f1f77bcf86cd799439013'
698
+ * task: { _id: '507f1f77bcf86cd799439013', ... }
697
699
  * }
698
700
  *
699
701
  * Expected response structure (error):
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@docbrasil/api-systemmanager",
3
3
  "description": "Module API System Manager",
4
- "version": "1.1.65",
4
+ "version": "1.1.67",
5
5
  "scripts": {
6
6
  "htmldoc": "rm -rf docs && jsdoc api/** -d docs -t ./node_modules/better-docs",
7
7
  "doc": "rm -rf doc && mkdir doc && jsdoc2md api/**/* api/* > doc/api.md",