@docbrasil/api-systemmanager 1.1.88 → 1.1.90
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/ai/sessions.js +83 -0
- package/api/user/process.js +377 -249
- package/dist/bundle.cjs +447 -236
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +137 -10
- package/docs/AISession.html +761 -215
- package/docs/Process.html +665 -68
- package/docs/ai_sessions.js.html +83 -0
- package/docs/user_process.js.html +377 -249
- package/package.json +1 -1
package/doc/api.md
CHANGED
|
@@ -1816,6 +1816,8 @@ Class for AI Session management
|
|
|
1816
1816
|
* [.updateData(params, authorization)](#AISession+updateData) ⇒ <code>Promise.<object></code> \| <code>array.<object></code> \| <code>object</code> \| <code>object</code>
|
|
1817
1817
|
* [.create(params, authorization)](#AISession+create) ⇒ <code>Promise.<object></code> \| <code>string</code> \| <code>string</code>
|
|
1818
1818
|
* [.execute(params, authorization)](#AISession+execute) ⇒ <code>Promise.<object></code> \| <code>string</code> \| <code>string</code>
|
|
1819
|
+
* [.addDocuments(params, authorization)](#AISession+addDocuments) ⇒ <code>Promise.<object></code>
|
|
1820
|
+
* [.removeDocuments(params, authorization)](#AISession+removeDocuments) ⇒ <code>Promise.<object></code>
|
|
1819
1821
|
|
|
1820
1822
|
<a name="AISession+getByDocument"></a>
|
|
1821
1823
|
|
|
@@ -1956,6 +1958,64 @@ const params = {
|
|
|
1956
1958
|
};
|
|
1957
1959
|
const retData = await api.ai.sessions.execute(params, authorization);
|
|
1958
1960
|
```
|
|
1961
|
+
<a name="AISession+addDocuments"></a>
|
|
1962
|
+
|
|
1963
|
+
### aiSession.addDocuments(params, authorization) ⇒ <code>Promise.<object></code>
|
|
1964
|
+
Add documents to an existing agent session.
|
|
1965
|
+
The agent will handle the documentIds accordingly.
|
|
1966
|
+
|
|
1967
|
+
**Kind**: instance method of [<code>AISession</code>](#AISession)
|
|
1968
|
+
**Returns**: <code>Promise.<object></code> - data The result from the agent
|
|
1969
|
+
**Access**: public
|
|
1970
|
+
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
1971
|
+
|
|
1972
|
+
| Param | Type | Description |
|
|
1973
|
+
| --- | --- | --- |
|
|
1974
|
+
| params | <code>object</code> | Parameters |
|
|
1975
|
+
| params.sessionId | <code>string</code> | The session ID |
|
|
1976
|
+
| params.documentIds | <code>array.<string></code> | Array of document IDs to add |
|
|
1977
|
+
| authorization | <code>string</code> | Authorization token |
|
|
1978
|
+
|
|
1979
|
+
**Example**
|
|
1980
|
+
```js
|
|
1981
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
1982
|
+
const api = new API();
|
|
1983
|
+
const authorization = '...';
|
|
1984
|
+
const params = {
|
|
1985
|
+
sessionId: 'session-abc-123',
|
|
1986
|
+
documentIds: ['doc-123', 'doc-456']
|
|
1987
|
+
};
|
|
1988
|
+
const retData = await api.ai.sessions.addDocuments(params, authorization);
|
|
1989
|
+
```
|
|
1990
|
+
<a name="AISession+removeDocuments"></a>
|
|
1991
|
+
|
|
1992
|
+
### aiSession.removeDocuments(params, authorization) ⇒ <code>Promise.<object></code>
|
|
1993
|
+
Remove documents from an existing agent session.
|
|
1994
|
+
The agent will handle the documentIds accordingly.
|
|
1995
|
+
|
|
1996
|
+
**Kind**: instance method of [<code>AISession</code>](#AISession)
|
|
1997
|
+
**Returns**: <code>Promise.<object></code> - data The result from the agent
|
|
1998
|
+
**Access**: public
|
|
1999
|
+
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
2000
|
+
|
|
2001
|
+
| Param | Type | Description |
|
|
2002
|
+
| --- | --- | --- |
|
|
2003
|
+
| params | <code>object</code> | Parameters |
|
|
2004
|
+
| params.sessionId | <code>string</code> | The session ID |
|
|
2005
|
+
| params.documentIds | <code>array.<string></code> | Array of document IDs to remove |
|
|
2006
|
+
| authorization | <code>string</code> | Authorization token |
|
|
2007
|
+
|
|
2008
|
+
**Example**
|
|
2009
|
+
```js
|
|
2010
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
2011
|
+
const api = new API();
|
|
2012
|
+
const authorization = '...';
|
|
2013
|
+
const params = {
|
|
2014
|
+
sessionId: 'session-abc-123',
|
|
2015
|
+
documentIds: ['doc-123', 'doc-456']
|
|
2016
|
+
};
|
|
2017
|
+
const retData = await api.ai.sessions.removeDocuments(params, authorization);
|
|
2018
|
+
```
|
|
1959
2019
|
<a name="GeoLocation"></a>
|
|
1960
2020
|
|
|
1961
2021
|
## GeoLocation
|
|
@@ -4245,7 +4305,9 @@ Class for process, permission user
|
|
|
4245
4305
|
* [.getOrgDocTypes(params, session)](#Process+getOrgDocTypes) ⇒ <code>Promise</code>
|
|
4246
4306
|
* [.getOrgGroups(params, session)](#Process+getOrgGroups) ⇒ <code>Promise</code>
|
|
4247
4307
|
* [.getOrgUsers(params, session)](#Process+getOrgUsers) ⇒ <code>Promise</code>
|
|
4248
|
-
* [.
|
|
4308
|
+
* [.restart(params, session)](#Process+restart) ⇒ <code>Promise.<object></code>
|
|
4309
|
+
* [.reexecute(params, session)](#Process+reexecute) ⇒ <code>Promise.<object></code>
|
|
4310
|
+
* [.reexecuteTask(params, session)](#Process+reexecuteTask) ⇒ <code>Promise.<object></code>
|
|
4249
4311
|
|
|
4250
4312
|
<a name="Process+start"></a>
|
|
4251
4313
|
|
|
@@ -4582,22 +4644,54 @@ const params = {
|
|
|
4582
4644
|
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
4583
4645
|
await api.user.process.getOrgUsers(params, session);
|
|
4584
4646
|
```
|
|
4585
|
-
<a name="Process+
|
|
4647
|
+
<a name="Process+restart"></a>
|
|
4586
4648
|
|
|
4587
|
-
### process.
|
|
4588
|
-
|
|
4649
|
+
### process.restart(params, session) ⇒ <code>Promise.<object></code>
|
|
4650
|
+
Restart a finished process from a specific flow step. Resets the process completion state
|
|
4651
|
+
and triggers re-execution from the specified flow name.
|
|
4589
4652
|
|
|
4590
4653
|
**Kind**: instance method of [<code>Process</code>](#Process)
|
|
4591
|
-
**Returns**: <code>Promise.<
|
|
4654
|
+
**Returns**: <code>Promise.<object></code> - { response: 'OK' } on success
|
|
4592
4655
|
**Access**: public
|
|
4593
4656
|
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
4594
4657
|
|
|
4595
4658
|
| Param | Type | Description |
|
|
4596
4659
|
| --- | --- | --- |
|
|
4597
|
-
| params | <code>object</code> | Params to
|
|
4660
|
+
| params | <code>object</code> | Params to restart the process |
|
|
4661
|
+
| params.processId | <code>string</code> | Process id (_id database); |
|
|
4598
4662
|
| params.orgId | <code>string</code> | Organization id (_id database); |
|
|
4663
|
+
| params.flowName | <code>string</code> | The flow name of the step to restart from; |
|
|
4664
|
+
| session | <code>string</code> | Session, token JWT |
|
|
4665
|
+
|
|
4666
|
+
**Example**
|
|
4667
|
+
```js
|
|
4668
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
4669
|
+
const api = new API();
|
|
4670
|
+
const params = {
|
|
4671
|
+
processId: '5dadd01dc4af3941d42f8c5c',
|
|
4672
|
+
orgId: '5edd11c46b6ce9729c2c297c',
|
|
4673
|
+
flowName: 'Task_1'
|
|
4674
|
+
};
|
|
4675
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
4676
|
+
await api.user.process.restart(params, session);
|
|
4677
|
+
```
|
|
4678
|
+
<a name="Process+reexecute"></a>
|
|
4679
|
+
|
|
4680
|
+
### process.reexecute(params, session) ⇒ <code>Promise.<object></code>
|
|
4681
|
+
Re-execute a specific flow step in a running process. Unlike restart, this does not
|
|
4682
|
+
reset the process completion state. Task creation is deferred to the BPMN engine via RabbitMQ.
|
|
4683
|
+
|
|
4684
|
+
**Kind**: instance method of [<code>Process</code>](#Process)
|
|
4685
|
+
**Returns**: <code>Promise.<object></code> - { response: 'OK' } on success
|
|
4686
|
+
**Access**: public
|
|
4687
|
+
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
4688
|
+
|
|
4689
|
+
| Param | Type | Description |
|
|
4690
|
+
| --- | --- | --- |
|
|
4691
|
+
| params | <code>object</code> | Params to re-execute the process step |
|
|
4599
4692
|
| params.processId | <code>string</code> | Process id (_id database); |
|
|
4600
|
-
| params.
|
|
4693
|
+
| params.orgId | <code>string</code> | Organization id (_id database); |
|
|
4694
|
+
| params.flowName | <code>string</code> | The flow name of the step to re-execute; |
|
|
4601
4695
|
| session | <code>string</code> | Session, token JWT |
|
|
4602
4696
|
|
|
4603
4697
|
**Example**
|
|
@@ -4605,12 +4699,45 @@ Get step history of a process flow
|
|
|
4605
4699
|
const API = require('@docbrasil/api-systemmanager');
|
|
4606
4700
|
const api = new API();
|
|
4607
4701
|
const params = {
|
|
4702
|
+
processId: '5dadd01dc4af3941d42f8c5c',
|
|
4608
4703
|
orgId: '5edd11c46b6ce9729c2c297c',
|
|
4704
|
+
flowName: 'Task_1'
|
|
4705
|
+
};
|
|
4706
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
4707
|
+
await api.user.process.reexecute(params, session);
|
|
4708
|
+
```
|
|
4709
|
+
<a name="Process+reexecuteTask"></a>
|
|
4710
|
+
|
|
4711
|
+
### process.reexecuteTask(params, session) ⇒ <code>Promise.<object></code>
|
|
4712
|
+
Re-execute a specific user task step in a running process, creating a new task
|
|
4713
|
+
synchronously with optional userId reassignment. For non-group tasks, the task is reassigned
|
|
4714
|
+
to the current logged-in user. For group tasks, the original assignment is preserved.
|
|
4715
|
+
|
|
4716
|
+
**Kind**: instance method of [<code>Process</code>](#Process)
|
|
4717
|
+
**Returns**: <code>Promise.<object></code> - { response: 'OK', taskId } on success
|
|
4718
|
+
**Access**: public
|
|
4719
|
+
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
4720
|
+
|
|
4721
|
+
| Param | Type | Description |
|
|
4722
|
+
| --- | --- | --- |
|
|
4723
|
+
| params | <code>object</code> | Params to re-execute the task |
|
|
4724
|
+
| params.processId | <code>string</code> | Process id (_id database); |
|
|
4725
|
+
| params.orgId | <code>string</code> | Organization id (_id database); |
|
|
4726
|
+
| params.flowName | <code>string</code> | The flow name of the user task step to re-execute; |
|
|
4727
|
+
| session | <code>string</code> | Session, token JWT |
|
|
4728
|
+
|
|
4729
|
+
**Example**
|
|
4730
|
+
```js
|
|
4731
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
4732
|
+
const api = new API();
|
|
4733
|
+
const params = {
|
|
4609
4734
|
processId: '5dadd01dc4af3941d42f8c5c',
|
|
4610
|
-
|
|
4611
|
-
|
|
4735
|
+
orgId: '5edd11c46b6ce9729c2c297c',
|
|
4736
|
+
flowName: 'Task_1'
|
|
4737
|
+
};
|
|
4612
4738
|
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
4613
|
-
const
|
|
4739
|
+
const result = await api.user.process.reexecuteTask(params, session);
|
|
4740
|
+
console.log(result.taskId);
|
|
4614
4741
|
```
|
|
4615
4742
|
<a name="Register"></a>
|
|
4616
4743
|
|