@docbrasil/api-systemmanager 1.1.64 → 1.1.66

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,29 @@ 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 to be the FULL document data, that you can get with findById |
1706
+ | session | <code>string</code> | Session, token JWT |
1707
+
1708
+ **Example**
1709
+ ```js
1710
+ const API = require('@docbrasil/api-systemmanager');
1711
+ const api = new API();
1712
+ const params = { ... };
1713
+ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
1714
+ await api.user.document.findByIdsAndUpdate(['5edf9f8ee896b817e45b8dad'], params, session);
1715
+ ```
1692
1716
  <a name="Documents+findById"></a>
1693
1717
 
1694
1718
  ### documents.findById(id, session) ⇒ <code>Promise</code>
@@ -2267,6 +2291,7 @@ Class for task, permission user
2267
2291
  * [.addTaskTag(params, session)](#Kanban+addTaskTag) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>string</code>
2268
2292
  * [.removeTaskTag(params, session)](#Kanban+removeTaskTag) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>string</code>
2269
2293
  * [.updateStatusList(params, session)](#Kanban+updateStatusList) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>string</code>
2294
+ * [.startTask(params, session)](#Kanban+startTask) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>string</code> \| <code>string</code>
2270
2295
 
2271
2296
  <a name="Kanban+get"></a>
2272
2297
 
@@ -2597,6 +2622,7 @@ Updates the status list order for a specific flow in an organization process on
2597
2622
  | params.flowId | <code>string</code> | The id of the organization process step flowId |
2598
2623
  | params.statusList | <code>Array</code> | The status list with new order |
2599
2624
  | params.statusList[ | <code>Object</code> | Status object configuration |
2625
+ | params.statusList[].guid | <code>string</code> | The guid of the status (the id) |
2600
2626
  | params.statusList[].value | <code>string</code> | The title of the status |
2601
2627
  | params.statusList[].expanded | <code>boolean</code> | If the status column is expanded or not |
2602
2628
  | params.statusList[].color | <code>string</code> | The hexadecimal color code for the status |
@@ -2625,6 +2651,54 @@ Expected response structure (success):
2625
2651
  success: true
2626
2652
  }
2627
2653
 
2654
+ Expected response structure (error):
2655
+ {
2656
+ success: false,
2657
+ error: "Organization process not found"
2658
+ }
2659
+ ```
2660
+ <a name="Kanban+startTask"></a>
2661
+
2662
+ ### kanban.startTask(params, session) ⇒ <code>promise</code> \| <code>Object</code> \| <code>boolean</code> \| <code>string</code> \| <code>string</code>
2663
+ The new task is the full object of the task, like when you search the task
2664
+
2665
+ **Kind**: instance method of [<code>Kanban</code>](#Kanban)
2666
+ **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
2667
+ **Access**: public
2668
+ **Author**: Myndware <augusto.pissarra@myndware.com>
2669
+
2670
+ | Param | Type | Description |
2671
+ | --- | --- | --- |
2672
+ | params | <code>Object</code> | Parameters object |
2673
+ | params.orgId | <code>string</code> | Organization id (_id database) |
2674
+ | params.orgProcessName | <code>string</code> | The name of the organization process |
2675
+ | params.title | <code>string</code> | The title of the new task |
2676
+ | params.status | <code>string</code> | The status id of the new task |
2677
+ | [params.tags] | <code>Array</code> | Array of tag ids for the new task (optional) |
2678
+ | [params.tasks] | <code>Array</code> | The task ids, in their current order, of each task inside the same status (optional) |
2679
+ | session | <code>string</code> | Session, token JWT |
2680
+
2681
+ **Example**
2682
+ ```js
2683
+ const API = require('@docbrasil/api-systemmanager');
2684
+ const api = new API();
2685
+ const params = {
2686
+ orgId: '55e4a3bd6be6b45210833fae',
2687
+ orgProcessName: 'employee-onboarding',
2688
+ title: 'Complete employee documentation',
2689
+ status: '507f1f77bcf86cd799439014',
2690
+ tags: ['507f1f77bcf86cd799439015', '507f1f77bcf86cd799439016'],
2691
+ tasks: ['507f1f77bcf86cd799439011', '507f1f77bcf86cd799439012']
2692
+ };
2693
+ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
2694
+ const result = await api.user.kanban.startTask(params, session);
2695
+
2696
+ Expected response structure (success):
2697
+ {
2698
+ success: true,
2699
+ task: { _id: '507f1f77bcf86cd799439013', ... }
2700
+ }
2701
+
2628
2702
  Expected response structure (error):
2629
2703
  {
2630
2704
  success: false,
@@ -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#line828">line 828</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#line916">line 916</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#line956">line 956</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#line375">line 375</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#line324">line 324</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#line459">line 459</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#line504">line 504</a>
4036
4036
  </span>
4037
4037
  </p>
4038
4038
 
@@ -4187,6 +4187,249 @@ 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 to be the FULL document data, that you can get with findById</td>
4294
+ </tr>
4295
+
4296
+
4297
+
4298
+
4299
+
4300
+ <tr class="deep-level-0">
4301
+
4302
+ <td class="name"><code>session</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">Session, token JWT</td>
4319
+ </tr>
4320
+
4321
+
4322
+
4323
+ </tbody>
4324
+ </table>
4325
+ </div>
4326
+
4327
+
4328
+
4329
+
4330
+
4331
+ <dl class="details">
4332
+
4333
+
4334
+
4335
+
4336
+
4337
+
4338
+
4339
+
4340
+
4341
+
4342
+
4343
+
4344
+
4345
+
4346
+
4347
+
4348
+
4349
+
4350
+ <dt class="tag-author">Author:</dt>
4351
+ <dd class="tag-author">
4352
+ <ul>
4353
+ <li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
4354
+ </ul>
4355
+ </dd>
4356
+
4357
+
4358
+
4359
+
4360
+
4361
+
4362
+
4363
+
4364
+
4365
+
4366
+
4367
+
4368
+
4369
+
4370
+ <p class="tag-source">
4371
+ <a href="user_document.js.html" class="button">View Source</a>
4372
+ <span>
4373
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line291">line 291</a>
4374
+ </span>
4375
+ </p>
4376
+
4377
+ </dl>
4378
+
4379
+
4380
+
4381
+
4382
+
4383
+
4384
+
4385
+
4386
+
4387
+
4388
+
4389
+
4390
+
4391
+
4392
+
4393
+
4394
+
4395
+
4396
+ <div class='columns method-parameter'>
4397
+ <div class="column is-2"><label>Returns:</label></div>
4398
+ <div class="column is-10">
4399
+
4400
+
4401
+
4402
+ <div class="columns">
4403
+
4404
+
4405
+ <div class='column is-5 has-text-left'>
4406
+ <label>Type: </label>
4407
+
4408
+ <code class="param-type">Promise</code>
4409
+
4410
+
4411
+ </div>
4412
+
4413
+ </div>
4414
+
4415
+
4416
+ </div>
4417
+ </div>
4418
+
4419
+
4420
+
4421
+
4422
+ <h5>Example</h5>
4423
+
4424
+
4425
+ <pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
4426
+ const api = new API();
4427
+ const params = { ... };
4428
+ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
4429
+ await api.user.document.findByIdsAndUpdate(['5edf9f8ee896b817e45b8dad'], params, session);</code></pre>
4430
+
4431
+
4432
+
4190
4433
  </div>
4191
4434
 
4192
4435
  <div class="member">
@@ -4417,7 +4660,7 @@ await api.user.document.findByIdsAndRemove(params, session);</code></pre>
4417
4660
  <p class="tag-source">
4418
4661
  <a href="user_document.js.html" class="button">View Source</a>
4419
4662
  <span>
4420
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line972">line 972</a>
4663
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line1006">line 1006</a>
4421
4664
  </span>
4422
4665
  </p>
4423
4666
 
@@ -4698,7 +4941,7 @@ const retSearch = await api.user.document.performDownloadComplete(params, sessio
4698
4941
  <p class="tag-source">
4699
4942
  <a href="user_document.js.html" class="button">View Source</a>
4700
4943
  <span>
4701
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line842">line 842</a>
4944
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line876">line 876</a>
4702
4945
  </span>
4703
4946
  </p>
4704
4947
 
@@ -5042,7 +5285,7 @@ const retSearch = await api.user.document.searchDocuments(params, session);</cod
5042
5285
  <p class="tag-source">
5043
5286
  <a href="user_document.js.html" class="button">View Source</a>
5044
5287
  <span>
5045
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line1017">line 1017</a>
5288
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line1051">line 1051</a>
5046
5289
  </span>
5047
5290
  </p>
5048
5291
 
@@ -5501,7 +5744,7 @@ const retSearch = await api.user.document.searchDocumentsDirect(params, session)
5501
5744
  <p class="tag-source">
5502
5745
  <a href="user_document.js.html" class="button">View Source</a>
5503
5746
  <span>
5504
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line536">line 536</a>
5747
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line570">line 570</a>
5505
5748
  </span>
5506
5749
  </p>
5507
5750
 
@@ -6017,7 +6260,7 @@ const base64Data = await api.user.document.signedUrl(params, session);</code></p
6017
6260
  <p class="tag-source">
6018
6261
  <a href="user_document.js.html" class="button">View Source</a>
6019
6262
  <span>
6020
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line632">line 632</a>
6263
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line666">line 666</a>
6021
6264
  </span>
6022
6265
  </p>
6023
6266
 
@@ -6415,7 +6658,7 @@ const base64Data = await api.user.document.signedUrls(params, session);</code></
6415
6658
  <p class="tag-source">
6416
6659
  <a href="user_document.js.html" class="button">View Source</a>
6417
6660
  <span>
6418
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line736">line 736</a>
6661
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line770">line 770</a>
6419
6662
  </span>
6420
6663
  </p>
6421
6664
 
@@ -6706,7 +6949,7 @@ onUploadProgress return the progressEvent
6706
6949
  <p class="tag-source">
6707
6950
  <a href="user_document.js.html" class="button">View Source</a>
6708
6951
  <span>
6709
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line680">line 680</a>
6952
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line714">line 714</a>
6710
6953
  </span>
6711
6954
  </p>
6712
6955