@docbrasil/api-systemmanager 1.1.67 → 1.1.68
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/document.js +33 -4
- package/dist/bundle.cjs +33 -4
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +27 -0
- package/docs/AdminDocuments.html +251 -3
- package/docs/admin_document.js.html +33 -4
- package/package.json +1 -1
package/doc/api.md
CHANGED
|
@@ -131,6 +131,7 @@ Admin Class for documents, permission admin
|
|
|
131
131
|
* [.updateContent(params, apiKey)](#AdminDocuments+updateContent) ⇒ <code>Promise.<object></code>
|
|
132
132
|
* [.updateAI(params, apiKey)](#AdminDocuments+updateAI) ⇒ <code>Promise.<object></code>
|
|
133
133
|
* [.getContent(params, apiKey)](#AdminDocuments+getContent) ⇒ <code>Promise.<object></code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>number</code>
|
|
134
|
+
* [.getDocumentData(params, apiKey)](#AdminDocuments+getDocumentData) ⇒ <code>Promise.<object></code>
|
|
134
135
|
|
|
135
136
|
<a name="AdminDocuments+advancedSearch"></a>
|
|
136
137
|
|
|
@@ -334,6 +335,32 @@ const params - {
|
|
|
334
335
|
const apiKey: '...';
|
|
335
336
|
await api.admin.document.getContent(params, apiKey);
|
|
336
337
|
```
|
|
338
|
+
<a name="AdminDocuments+getDocumentData"></a>
|
|
339
|
+
|
|
340
|
+
### adminDocuments.getDocumentData(params, apiKey) ⇒ <code>Promise.<object></code>
|
|
341
|
+
Get the data of a document
|
|
342
|
+
|
|
343
|
+
**Kind**: instance method of [<code>AdminDocuments</code>](#AdminDocuments)
|
|
344
|
+
**Returns**: <code>Promise.<object></code> - data the document data
|
|
345
|
+
**Access**: public
|
|
346
|
+
**Author**: Myndware <augusto.pissarra@myndware.com>
|
|
347
|
+
|
|
348
|
+
| Param | Type | Description |
|
|
349
|
+
| --- | --- | --- |
|
|
350
|
+
| params | <code>object</code> | Params to request signed url |
|
|
351
|
+
| params.id | <code>string</code> | The unique id of the document |
|
|
352
|
+
| apiKey | <code>string</code> | Api Key as permission to use this functionality |
|
|
353
|
+
|
|
354
|
+
**Example**
|
|
355
|
+
```js
|
|
356
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
357
|
+
const api = new API();
|
|
358
|
+
const params - {
|
|
359
|
+
id: '5dadd01dc4af3941d42f8c5c'
|
|
360
|
+
};
|
|
361
|
+
const apiKey: '...';
|
|
362
|
+
await api.admin.document.getDocumentData(params, apiKey);
|
|
363
|
+
```
|
|
337
364
|
<a name="AdminForm"></a>
|
|
338
365
|
|
|
339
366
|
## AdminForm
|
package/docs/AdminDocuments.html
CHANGED
|
@@ -984,7 +984,7 @@ await api.admin.document.findById(params, session);</code></pre>
|
|
|
984
984
|
<p class="tag-source">
|
|
985
985
|
<a href="admin_document.js.html" class="button">View Source</a>
|
|
986
986
|
<span>
|
|
987
|
-
<a href="admin_document.js.html">admin/document.js</a>, <a href="admin_document.js.html#
|
|
987
|
+
<a href="admin_document.js.html">admin/document.js</a>, <a href="admin_document.js.html#line312">line 312</a>
|
|
988
988
|
</span>
|
|
989
989
|
</p>
|
|
990
990
|
|
|
@@ -1139,6 +1139,254 @@ await api.admin.document.getContent(params, apiKey);</code></pre>
|
|
|
1139
1139
|
|
|
1140
1140
|
|
|
1141
1141
|
|
|
1142
|
+
</div>
|
|
1143
|
+
|
|
1144
|
+
<div class="member">
|
|
1145
|
+
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
<h4 class="name" id="getDocumentData">
|
|
1149
|
+
<a class="href-link" href="#getDocumentData">#</a>
|
|
1150
|
+
|
|
1151
|
+
|
|
1152
|
+
<span class='tag'>async</span>
|
|
1153
|
+
|
|
1154
|
+
|
|
1155
|
+
<span class="code-name">
|
|
1156
|
+
|
|
1157
|
+
getDocumentData<span class="signature">(params, apiKey)</span><span class="type-signature"> → {Promise.<object>}</span>
|
|
1158
|
+
|
|
1159
|
+
</span>
|
|
1160
|
+
</h4>
|
|
1161
|
+
|
|
1162
|
+
|
|
1163
|
+
|
|
1164
|
+
|
|
1165
|
+
<div class="description">
|
|
1166
|
+
Get the data of a document
|
|
1167
|
+
</div>
|
|
1168
|
+
|
|
1169
|
+
|
|
1170
|
+
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
|
|
1174
|
+
|
|
1175
|
+
|
|
1176
|
+
|
|
1177
|
+
|
|
1178
|
+
<h5>Parameters:</h5>
|
|
1179
|
+
|
|
1180
|
+
<div class="table-container">
|
|
1181
|
+
<table class="params table">
|
|
1182
|
+
<thead>
|
|
1183
|
+
<tr>
|
|
1184
|
+
|
|
1185
|
+
<th>Name</th>
|
|
1186
|
+
|
|
1187
|
+
|
|
1188
|
+
<th>Type</th>
|
|
1189
|
+
|
|
1190
|
+
|
|
1191
|
+
|
|
1192
|
+
|
|
1193
|
+
|
|
1194
|
+
<th class="last">Description</th>
|
|
1195
|
+
</tr>
|
|
1196
|
+
</thead>
|
|
1197
|
+
|
|
1198
|
+
<tbody>
|
|
1199
|
+
|
|
1200
|
+
|
|
1201
|
+
|
|
1202
|
+
<tr class="deep-level-0">
|
|
1203
|
+
|
|
1204
|
+
<td class="name"><code>params</code></td>
|
|
1205
|
+
|
|
1206
|
+
|
|
1207
|
+
<td class="type">
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
<code class="param-type">object</code>
|
|
1211
|
+
|
|
1212
|
+
|
|
1213
|
+
|
|
1214
|
+
</td>
|
|
1215
|
+
|
|
1216
|
+
|
|
1217
|
+
|
|
1218
|
+
|
|
1219
|
+
|
|
1220
|
+
<td class="description last">Params to request signed url</td>
|
|
1221
|
+
</tr>
|
|
1222
|
+
|
|
1223
|
+
|
|
1224
|
+
|
|
1225
|
+
|
|
1226
|
+
<tr class="deep-level-1">
|
|
1227
|
+
|
|
1228
|
+
<td class="name"><code>id</code></td>
|
|
1229
|
+
|
|
1230
|
+
|
|
1231
|
+
<td class="type">
|
|
1232
|
+
|
|
1233
|
+
|
|
1234
|
+
<code class="param-type">string</code>
|
|
1235
|
+
|
|
1236
|
+
|
|
1237
|
+
|
|
1238
|
+
</td>
|
|
1239
|
+
|
|
1240
|
+
|
|
1241
|
+
|
|
1242
|
+
|
|
1243
|
+
|
|
1244
|
+
<td class="description last">The unique id of the document</td>
|
|
1245
|
+
</tr>
|
|
1246
|
+
|
|
1247
|
+
|
|
1248
|
+
|
|
1249
|
+
|
|
1250
|
+
|
|
1251
|
+
|
|
1252
|
+
|
|
1253
|
+
<tr class="deep-level-0">
|
|
1254
|
+
|
|
1255
|
+
<td class="name"><code>apiKey</code></td>
|
|
1256
|
+
|
|
1257
|
+
|
|
1258
|
+
<td class="type">
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
<code class="param-type">string</code>
|
|
1262
|
+
|
|
1263
|
+
|
|
1264
|
+
|
|
1265
|
+
</td>
|
|
1266
|
+
|
|
1267
|
+
|
|
1268
|
+
|
|
1269
|
+
|
|
1270
|
+
|
|
1271
|
+
<td class="description last">Api Key as permission to use this functionality</td>
|
|
1272
|
+
</tr>
|
|
1273
|
+
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
</tbody>
|
|
1277
|
+
</table>
|
|
1278
|
+
</div>
|
|
1279
|
+
|
|
1280
|
+
|
|
1281
|
+
|
|
1282
|
+
|
|
1283
|
+
|
|
1284
|
+
<dl class="details">
|
|
1285
|
+
|
|
1286
|
+
|
|
1287
|
+
|
|
1288
|
+
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
|
|
1292
|
+
|
|
1293
|
+
|
|
1294
|
+
|
|
1295
|
+
|
|
1296
|
+
|
|
1297
|
+
|
|
1298
|
+
|
|
1299
|
+
|
|
1300
|
+
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
<dt class="tag-author">Author:</dt>
|
|
1304
|
+
<dd class="tag-author">
|
|
1305
|
+
<ul>
|
|
1306
|
+
<li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
|
|
1307
|
+
</ul>
|
|
1308
|
+
</dd>
|
|
1309
|
+
|
|
1310
|
+
|
|
1311
|
+
|
|
1312
|
+
|
|
1313
|
+
|
|
1314
|
+
|
|
1315
|
+
|
|
1316
|
+
|
|
1317
|
+
|
|
1318
|
+
|
|
1319
|
+
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
<p class="tag-source">
|
|
1324
|
+
<a href="admin_document.js.html" class="button">View Source</a>
|
|
1325
|
+
<span>
|
|
1326
|
+
<a href="admin_document.js.html">admin/document.js</a>, <a href="admin_document.js.html#line346">line 346</a>
|
|
1327
|
+
</span>
|
|
1328
|
+
</p>
|
|
1329
|
+
|
|
1330
|
+
</dl>
|
|
1331
|
+
|
|
1332
|
+
|
|
1333
|
+
|
|
1334
|
+
|
|
1335
|
+
|
|
1336
|
+
|
|
1337
|
+
|
|
1338
|
+
|
|
1339
|
+
|
|
1340
|
+
|
|
1341
|
+
|
|
1342
|
+
|
|
1343
|
+
|
|
1344
|
+
|
|
1345
|
+
|
|
1346
|
+
|
|
1347
|
+
|
|
1348
|
+
|
|
1349
|
+
<div class='columns method-parameter'>
|
|
1350
|
+
<div class="column is-2"><label>Returns:</label></div>
|
|
1351
|
+
<div class="column is-10">
|
|
1352
|
+
|
|
1353
|
+
|
|
1354
|
+
|
|
1355
|
+
<div class="columns">
|
|
1356
|
+
|
|
1357
|
+
<div class='param-desc column is-7'>data the document data</div>
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
<div class='column is-5 has-text-left'>
|
|
1361
|
+
<label>Type: </label>
|
|
1362
|
+
|
|
1363
|
+
<code class="param-type">Promise.<object></code>
|
|
1364
|
+
|
|
1365
|
+
|
|
1366
|
+
</div>
|
|
1367
|
+
|
|
1368
|
+
</div>
|
|
1369
|
+
|
|
1370
|
+
|
|
1371
|
+
</div>
|
|
1372
|
+
</div>
|
|
1373
|
+
|
|
1374
|
+
|
|
1375
|
+
|
|
1376
|
+
|
|
1377
|
+
<h5>Example</h5>
|
|
1378
|
+
|
|
1379
|
+
|
|
1380
|
+
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
1381
|
+
const api = new API();
|
|
1382
|
+
const params - {
|
|
1383
|
+
id: '5dadd01dc4af3941d42f8c5c'
|
|
1384
|
+
};
|
|
1385
|
+
const apiKey: '...';
|
|
1386
|
+
await api.admin.document.getDocumentData(params, apiKey);</code></pre>
|
|
1387
|
+
|
|
1388
|
+
|
|
1389
|
+
|
|
1142
1390
|
</div>
|
|
1143
1391
|
|
|
1144
1392
|
<div class="member">
|
|
@@ -1857,7 +2105,7 @@ const { signedUrl, imageType } = await api.admin.document.signedUrl(params, apiK
|
|
|
1857
2105
|
<p class="tag-source">
|
|
1858
2106
|
<a href="admin_document.js.html" class="button">View Source</a>
|
|
1859
2107
|
<span>
|
|
1860
|
-
<a href="admin_document.js.html">admin/document.js</a>, <a href="admin_document.js.html#
|
|
2108
|
+
<a href="admin_document.js.html">admin/document.js</a>, <a href="admin_document.js.html#line268">line 268</a>
|
|
1861
2109
|
</span>
|
|
1862
2110
|
</p>
|
|
1863
2111
|
|
|
@@ -2129,7 +2377,7 @@ await api.admin.document.updateContent(params, apiKey);</code></pre>
|
|
|
2129
2377
|
<p class="tag-source">
|
|
2130
2378
|
<a href="admin_document.js.html" class="button">View Source</a>
|
|
2131
2379
|
<span>
|
|
2132
|
-
<a href="admin_document.js.html">admin/document.js</a>, <a href="admin_document.js.html#
|
|
2380
|
+
<a href="admin_document.js.html">admin/document.js</a>, <a href="admin_document.js.html#line222">line 222</a>
|
|
2133
2381
|
</span>
|
|
2134
2382
|
</p>
|
|
2135
2383
|
|
|
@@ -270,7 +270,6 @@ class AdminDocuments {
|
|
|
270
270
|
* const { signedUrl, imageType } = await api.admin.document.signedUrl(params, apiKey);
|
|
271
271
|
*/
|
|
272
272
|
async signedUrl(params = {}, apiKey) {
|
|
273
|
-
|
|
274
273
|
Joi.assert(params, Joi.object().required());
|
|
275
274
|
Joi.assert(params.methodType, Joi.string().required());
|
|
276
275
|
Joi.assert(params.docId, Joi.string().required());
|
|
@@ -308,7 +307,6 @@ class AdminDocuments {
|
|
|
308
307
|
* await api.admin.document.updateContent(params, apiKey);
|
|
309
308
|
*/
|
|
310
309
|
async updateContent(params = {}, apiKey) {
|
|
311
|
-
|
|
312
310
|
Joi.assert(params, Joi.object().required());
|
|
313
311
|
Joi.assert(params.content, Joi.string().required());
|
|
314
312
|
Joi.assert(params.docId, Joi.string().required());
|
|
@@ -355,7 +353,6 @@ class AdminDocuments {
|
|
|
355
353
|
* await api.admin.document.updateContent(params, apiKey);
|
|
356
354
|
*/
|
|
357
355
|
async updateAI(params = {}, apiKey) {
|
|
358
|
-
|
|
359
356
|
Joi.assert(params, Joi.object().required());
|
|
360
357
|
Joi.assert(params.docId, Joi.string().required());
|
|
361
358
|
Joi.assert(apiKey, Joi.string().required());
|
|
@@ -400,7 +397,6 @@ class AdminDocuments {
|
|
|
400
397
|
* await api.admin.document.getContent(params, apiKey);
|
|
401
398
|
*/
|
|
402
399
|
async getContent(params = {}, apiKey) {
|
|
403
|
-
|
|
404
400
|
Joi.assert(params, Joi.object().required());
|
|
405
401
|
Joi.assert(params.docId, Joi.string().required());
|
|
406
402
|
Joi.assert(params.page, Joi.string().required());
|
|
@@ -414,6 +410,39 @@ class AdminDocuments {
|
|
|
414
410
|
return self._returnData(await apiCall);
|
|
415
411
|
}
|
|
416
412
|
|
|
413
|
+
/**
|
|
414
|
+
*
|
|
415
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
416
|
+
* @description Get the data of a document
|
|
417
|
+
* @param {object} params Params to request signed url
|
|
418
|
+
* @param {string} params.id The unique id of the document
|
|
419
|
+
* @param {string} apiKey Api Key as permission to use this functionality
|
|
420
|
+
* @return {Promise<object>} data the document data
|
|
421
|
+
* @public
|
|
422
|
+
* @async
|
|
423
|
+
* @example
|
|
424
|
+
*
|
|
425
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
426
|
+
* const api = new API();
|
|
427
|
+
* const params - {
|
|
428
|
+
* id: '5dadd01dc4af3941d42f8c5c'
|
|
429
|
+
* };
|
|
430
|
+
* const apiKey: '...';
|
|
431
|
+
* await api.admin.document.getDocumentData(params, apiKey);
|
|
432
|
+
*/
|
|
433
|
+
async getDocumentData(params = {}, apiKey) {
|
|
434
|
+
Joi.assert(params, Joi.object().required());
|
|
435
|
+
Joi.assert(params.id, Joi.string().required());
|
|
436
|
+
Joi.assert(apiKey, Joi.string().required());
|
|
437
|
+
|
|
438
|
+
const self = this;
|
|
439
|
+
const { id } = params;
|
|
440
|
+
const url = `/api/documents/${id}?apiKey=${apiKey}`;
|
|
441
|
+
const apiCall = self._client
|
|
442
|
+
.get(url);
|
|
443
|
+
return self._returnData(await apiCall);
|
|
444
|
+
}
|
|
445
|
+
|
|
417
446
|
}
|
|
418
447
|
|
|
419
448
|
export default AdminDocuments;
|
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.
|
|
4
|
+
"version": "1.1.68",
|
|
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",
|