@docbrasil/api-systemmanager 1.0.81 → 1.0.82
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/user/datasource.js +144 -0
- package/api/user/index.js +2 -0
- package/dist/bundle.cjs +141 -1
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +42 -0
- package/package.json +1 -1
package/doc/api.md
CHANGED
|
@@ -43,6 +43,9 @@
|
|
|
43
43
|
<dt><a href="#Users">Users</a></dt>
|
|
44
44
|
<dd><p>API request, user permission level</p>
|
|
45
45
|
</dd>
|
|
46
|
+
<dt><a href="#Datasource">Datasource</a></dt>
|
|
47
|
+
<dd><p>Class for user datasource access, to be used with documents</p>
|
|
48
|
+
</dd>
|
|
46
49
|
<dt><a href="#Documents">Documents</a></dt>
|
|
47
50
|
<dd><p>Class for documents, permission user</p>
|
|
48
51
|
</dd>
|
|
@@ -1189,6 +1192,45 @@ API request, user permission level
|
|
|
1189
1192
|
| options | <code>object</code> | Params of the constructor |
|
|
1190
1193
|
| options.parent | <code>object</code> | This of the pararent |
|
|
1191
1194
|
|
|
1195
|
+
<a name="Datasource"></a>
|
|
1196
|
+
|
|
1197
|
+
## Datasource
|
|
1198
|
+
Class for user datasource access, to be used with documents
|
|
1199
|
+
|
|
1200
|
+
**Kind**: global class
|
|
1201
|
+
<a name="Datasource+autocomplete"></a>
|
|
1202
|
+
|
|
1203
|
+
### datasource.autocomplete(params, session) ⇒ <code>promise.<array></code> \| <code>string</code> \| <code>object</code>
|
|
1204
|
+
Method to get autocomplete data from a datasource
|
|
1205
|
+
|
|
1206
|
+
**Kind**: instance method of [<code>Datasource</code>](#Datasource)
|
|
1207
|
+
**Returns**: <code>promise.<array></code> - docs The returned documents field with autocomplete<code>string</code> - docs._id the _id of the document<code>object</code> - data.docTypeFieldsData the field values
|
|
1208
|
+
**Access**: public
|
|
1209
|
+
**Author**: CloudBrasil <abernardo.br@gmail.com>
|
|
1210
|
+
|
|
1211
|
+
| Param | Type | Description |
|
|
1212
|
+
| --- | --- | --- |
|
|
1213
|
+
| params | <code>object</code> | Params to add notification token |
|
|
1214
|
+
| params.orgId | <code>string</code> | The user organization _id |
|
|
1215
|
+
| params.dataSources | <code>array.<object></code> | The document type data sources information |
|
|
1216
|
+
| params.dataSources._id | <code>string</code> | The document type data sources _id |
|
|
1217
|
+
| params.dataSources.fields | <code>array.<object></code> | The document type data sources list of fields |
|
|
1218
|
+
| params.documents | <code>array.<object></code> | The document list |
|
|
1219
|
+
| params.documents._id | <code>string</code> | The document _id |
|
|
1220
|
+
| session | <code>string</code> | Is token JWT of user NOT allow SU |
|
|
1221
|
+
|
|
1222
|
+
**Example**
|
|
1223
|
+
```js
|
|
1224
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
1225
|
+
const api = new API();
|
|
1226
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
1227
|
+
const params = {
|
|
1228
|
+
orgId: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
|
|
1229
|
+
dataSources: [{}],
|
|
1230
|
+
documents: [{}]
|
|
1231
|
+
};
|
|
1232
|
+
const retData = await api.user.datasource.autocomplete(params, session);
|
|
1233
|
+
```
|
|
1192
1234
|
<a name="Documents"></a>
|
|
1193
1235
|
|
|
1194
1236
|
## Documents
|
package/package.json
CHANGED