@docbrasil/api-systemmanager 1.1.75 → 1.1.77
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/list.js +214 -0
- package/api/user/help.js +41 -0
- package/dist/bundle.cjs +255 -0
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +169 -0
- package/docs/AdminLists.html +1591 -49
- package/docs/Help.html +275 -0
- package/docs/admin_list.js.html +214 -0
- package/docs/user_help.js.html +41 -0
- package/package.json +1 -1
package/doc/api.md
CHANGED
|
@@ -478,6 +478,11 @@ Admin Class for lists, permission admin
|
|
|
478
478
|
* [AdminLists](#AdminLists)
|
|
479
479
|
* [.findById(params, session)](#AdminLists+findById) ⇒ <code>Promise</code>
|
|
480
480
|
* [.find(params, session)](#AdminLists+find) ⇒ <code>Promise</code>
|
|
481
|
+
* [.filterByName(params, session)](#AdminLists+filterByName) ⇒ <code>Promise.<array></code>
|
|
482
|
+
* [.create(params, session)](#AdminLists+create) ⇒ <code>Promise.<object></code>
|
|
483
|
+
* [.update(params, session)](#AdminLists+update) ⇒ <code>Promise.<object></code>
|
|
484
|
+
* [.remove(params, session)](#AdminLists+remove) ⇒ <code>Promise.<object></code>
|
|
485
|
+
* [.updateListItems(params, session)](#AdminLists+updateListItems) ⇒ <code>Promise.<object></code>
|
|
481
486
|
|
|
482
487
|
<a name="AdminLists+findById"></a>
|
|
483
488
|
|
|
@@ -533,6 +538,138 @@ const params = {
|
|
|
533
538
|
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
534
539
|
await api.admin.list.find(params, session);
|
|
535
540
|
```
|
|
541
|
+
<a name="AdminLists+filterByName"></a>
|
|
542
|
+
|
|
543
|
+
### adminLists.filterByName(params, session) ⇒ <code>Promise.<array></code>
|
|
544
|
+
Filter organization lists by name
|
|
545
|
+
|
|
546
|
+
**Kind**: instance method of [<code>AdminLists</code>](#AdminLists)
|
|
547
|
+
**Returns**: <code>Promise.<array></code> - Array of matching org lists sorted by name
|
|
548
|
+
**Access**: public
|
|
549
|
+
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
550
|
+
|
|
551
|
+
| Param | Type | Default | Description |
|
|
552
|
+
| --- | --- | --- | --- |
|
|
553
|
+
| params | <code>object</code> | | Parameters |
|
|
554
|
+
| params.orgId | <code>string</code> | | Organization ID (required) |
|
|
555
|
+
| [params.names] | <code>array</code> | <code>[]</code> | Array of list names to filter (empty = all) |
|
|
556
|
+
| session | <code>string</code> | | JWT session token |
|
|
557
|
+
|
|
558
|
+
**Example**
|
|
559
|
+
```js
|
|
560
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
561
|
+
const api = new API();
|
|
562
|
+
const params = { orgId: '5edd11c46b6ce9729c2c297c', names: ['Tags', 'Categorias'] };
|
|
563
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
564
|
+
const lists = await api.admin.list.filterByName(params, session);
|
|
565
|
+
```
|
|
566
|
+
<a name="AdminLists+create"></a>
|
|
567
|
+
|
|
568
|
+
### adminLists.create(params, session) ⇒ <code>Promise.<object></code>
|
|
569
|
+
Create a new organization list
|
|
570
|
+
|
|
571
|
+
**Kind**: instance method of [<code>AdminLists</code>](#AdminLists)
|
|
572
|
+
**Returns**: <code>Promise.<object></code> - Created list document
|
|
573
|
+
**Access**: public
|
|
574
|
+
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
575
|
+
|
|
576
|
+
| Param | Type | Default | Description |
|
|
577
|
+
| --- | --- | --- | --- |
|
|
578
|
+
| params | <code>object</code> | | Parameters |
|
|
579
|
+
| params.orgId | <code>string</code> | | Organization ID (required) |
|
|
580
|
+
| params.name | <code>string</code> | | List name (required) |
|
|
581
|
+
| [params.list] | <code>array</code> | <code>[]</code> | Initial list items |
|
|
582
|
+
| session | <code>string</code> | | JWT session token |
|
|
583
|
+
|
|
584
|
+
**Example**
|
|
585
|
+
```js
|
|
586
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
587
|
+
const api = new API();
|
|
588
|
+
const params = { orgId: '5edd11c46b6ce9729c2c297c', name: 'My List', list: [] };
|
|
589
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
590
|
+
const list = await api.admin.list.create(params, session);
|
|
591
|
+
```
|
|
592
|
+
<a name="AdminLists+update"></a>
|
|
593
|
+
|
|
594
|
+
### adminLists.update(params, session) ⇒ <code>Promise.<object></code>
|
|
595
|
+
Update an organization list
|
|
596
|
+
|
|
597
|
+
**Kind**: instance method of [<code>AdminLists</code>](#AdminLists)
|
|
598
|
+
**Returns**: <code>Promise.<object></code> - Updated list document
|
|
599
|
+
**Access**: public
|
|
600
|
+
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
601
|
+
|
|
602
|
+
| Param | Type | Description |
|
|
603
|
+
| --- | --- | --- |
|
|
604
|
+
| params | <code>object</code> | Parameters |
|
|
605
|
+
| params.orgId | <code>string</code> | Organization ID (required) |
|
|
606
|
+
| params.id | <code>string</code> | List ID (required) |
|
|
607
|
+
| params.data | <code>object</code> | Fields to update (name, list, etc.) |
|
|
608
|
+
| session | <code>string</code> | JWT session token |
|
|
609
|
+
|
|
610
|
+
**Example**
|
|
611
|
+
```js
|
|
612
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
613
|
+
const api = new API();
|
|
614
|
+
const params = { orgId: '5edd11c46b6ce9729c2c297c', id: '55e4a3bd6be6b45210833fae', data: { name: 'Renamed' } };
|
|
615
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
616
|
+
const list = await api.admin.list.update(params, session);
|
|
617
|
+
```
|
|
618
|
+
<a name="AdminLists+remove"></a>
|
|
619
|
+
|
|
620
|
+
### adminLists.remove(params, session) ⇒ <code>Promise.<object></code>
|
|
621
|
+
Remove an organization list
|
|
622
|
+
|
|
623
|
+
**Kind**: instance method of [<code>AdminLists</code>](#AdminLists)
|
|
624
|
+
**Returns**: <code>Promise.<object></code> - Removal confirmation
|
|
625
|
+
**Access**: public
|
|
626
|
+
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
627
|
+
|
|
628
|
+
| Param | Type | Description |
|
|
629
|
+
| --- | --- | --- |
|
|
630
|
+
| params | <code>object</code> | Parameters |
|
|
631
|
+
| params.orgId | <code>string</code> | Organization ID (required) |
|
|
632
|
+
| params.id | <code>string</code> | List ID to remove (required) |
|
|
633
|
+
| session | <code>string</code> | JWT session token |
|
|
634
|
+
|
|
635
|
+
**Example**
|
|
636
|
+
```js
|
|
637
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
638
|
+
const api = new API();
|
|
639
|
+
const params = { orgId: '5edd11c46b6ce9729c2c297c', id: '55e4a3bd6be6b45210833fae' };
|
|
640
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
641
|
+
await api.admin.list.remove(params, session);
|
|
642
|
+
```
|
|
643
|
+
<a name="AdminLists+updateListItems"></a>
|
|
644
|
+
|
|
645
|
+
### adminLists.updateListItems(params, session) ⇒ <code>Promise.<object></code>
|
|
646
|
+
Update list items of an organization list
|
|
647
|
+
|
|
648
|
+
**Kind**: instance method of [<code>AdminLists</code>](#AdminLists)
|
|
649
|
+
**Returns**: <code>Promise.<object></code> - Updated list document
|
|
650
|
+
**Access**: public
|
|
651
|
+
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
652
|
+
|
|
653
|
+
| Param | Type | Description |
|
|
654
|
+
| --- | --- | --- |
|
|
655
|
+
| params | <code>object</code> | Parameters |
|
|
656
|
+
| params.orgId | <code>string</code> | Organization ID (required) |
|
|
657
|
+
| params.id | <code>string</code> | List ID (required) |
|
|
658
|
+
| params.list | <code>array</code> | Updated list items array (required) |
|
|
659
|
+
| session | <code>string</code> | JWT session token |
|
|
660
|
+
|
|
661
|
+
**Example**
|
|
662
|
+
```js
|
|
663
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
664
|
+
const api = new API();
|
|
665
|
+
const params = {
|
|
666
|
+
orgId: '5edd11c46b6ce9729c2c297c',
|
|
667
|
+
id: '55e4a3bd6be6b45210833fae',
|
|
668
|
+
list: [{ _id: '1', value: 'Item 1', filter: '', order: 0 }]
|
|
669
|
+
};
|
|
670
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
671
|
+
const list = await api.admin.list.updateListItems(params, session);
|
|
672
|
+
```
|
|
536
673
|
<a name="AdminMessage"></a>
|
|
537
674
|
|
|
538
675
|
## AdminMessage
|
|
@@ -2330,6 +2467,7 @@ Class for user registration in a user
|
|
|
2330
2467
|
* [.getTopics(filter, session)](#Help+getTopics)
|
|
2331
2468
|
* [.get(params, session)](#Help+get) ⇒ <code>promise</code>
|
|
2332
2469
|
* [.listExternalUrls(session)](#Help+listExternalUrls) ⇒ <code>promise.<Array></code>
|
|
2470
|
+
* [.updateSchedule(params, session)](#Help+updateSchedule) ⇒ <code>promise.<object></code>
|
|
2333
2471
|
|
|
2334
2472
|
<a name="Help+getTopics"></a>
|
|
2335
2473
|
|
|
@@ -2409,6 +2547,37 @@ const externalUrls = await api.user.help.listExternalUrls(session);
|
|
|
2409
2547
|
// }
|
|
2410
2548
|
// ]
|
|
2411
2549
|
```
|
|
2550
|
+
<a name="Help+updateSchedule"></a>
|
|
2551
|
+
|
|
2552
|
+
### help.updateSchedule(params, session) ⇒ <code>promise.<object></code>
|
|
2553
|
+
Update a schedule associated with a help page.
|
|
2554
|
+
Allows partial updates (e.g., just the cron expression).
|
|
2555
|
+
|
|
2556
|
+
**Kind**: instance method of [<code>Help</code>](#Help)
|
|
2557
|
+
**Returns**: <code>promise.<object></code> - Updated schedule document
|
|
2558
|
+
**Access**: public
|
|
2559
|
+
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
2560
|
+
|
|
2561
|
+
| Param | Type | Description |
|
|
2562
|
+
| --- | --- | --- |
|
|
2563
|
+
| params | <code>object</code> | Params for update |
|
|
2564
|
+
| params.id | <code>string</code> | Schedule id (_id database) |
|
|
2565
|
+
| params.data | <code>object</code> | Partial update data (e.g., { schedule: { cron: '0 9 * * *' } }) |
|
|
2566
|
+
| session | <code>string</code> | Session, token JWT |
|
|
2567
|
+
|
|
2568
|
+
**Example**
|
|
2569
|
+
```js
|
|
2570
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
2571
|
+
const api = new API();
|
|
2572
|
+
const params = {
|
|
2573
|
+
id: '5dadd01dc4af3941d42f8c5c',
|
|
2574
|
+
data: {
|
|
2575
|
+
schedule: { cron: '0 9 * * *' }
|
|
2576
|
+
}
|
|
2577
|
+
};
|
|
2578
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
2579
|
+
await api.user.help.updateSchedule(params, session);
|
|
2580
|
+
```
|
|
2412
2581
|
<a name="Users"></a>
|
|
2413
2582
|
|
|
2414
2583
|
## Users
|