@docbrasil/api-systemmanager 1.1.39 → 1.1.41

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/.project ADDED
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <projectDescription>
3
+ <name>api-systemmanager</name>
4
+ <comment></comment>
5
+ <projects>
6
+ </projects>
7
+ <buildSpec>
8
+ </buildSpec>
9
+ <natures>
10
+ </natures>
11
+ </projectDescription>
package/api/ai.js CHANGED
@@ -54,8 +54,11 @@ class MyndAI {
54
54
  * @param {string} params.model The model to use for the explain
55
55
  * @param {object} params.context The context to apply to a prompt
56
56
  * @param {string} params.text The text to add to the prompt
57
- * @param {array<base64>} params.medias Medias to add to the case in base64 (PDF, Image, Video, Audio)
58
- * @param {array<string>} params.mediaIds Media Ids to add - id of an internal document (PDF, Image, Video, Audio)
57
+ * @param {array<object>} params.medias Medias to add (PDF, Image, Video, Audio)
58
+ * @param {string} params.medias.type can be base64 | document
59
+ * @param {string} params.medias.mime the mime type of the media
60
+ * @param {string} params.medias.base64 the base64 of the image (in the case the type is base64)
61
+ * @param {string} params.medias.document the document path for the image (in the case the type is document)
59
62
  * @param {string} params.prompt The actual prompt with context and text to apply to
60
63
  * @param {boolean} params.json=false If we return in json format or not
61
64
  * @return {Promise<object>} data
@@ -439,7 +439,7 @@ class Process {
439
439
  }
440
440
  }
441
441
 
442
- /**
442
+ /**
443
443
  * @author Myndware <augusto.pissarra@myndware.com>
444
444
  * @description Get DocType properties of process
445
445
  * @param {object} params Params to get document DocType
@@ -476,6 +476,76 @@ class Process {
476
476
  throw ex;
477
477
  }
478
478
  }
479
+
480
+ /**
481
+ * @author Myndware <augusto.pissarra@myndware.com>
482
+ * @description Get Org Groups
483
+ * @param {object} params Params to get Org Groups
484
+ * @param {string} params.orgId Organization id (_id database);
485
+ * @param {string} session Session, token JWT
486
+ * @return {Promise}
487
+ * @public
488
+ * @async
489
+ * @example
490
+ *
491
+ * const API = require('@docbrasil/api-systemmanager');
492
+ * const api = new API();
493
+ * const params = {
494
+ * orgId: '5edd11c46b6ce9729c2c297c',
495
+ * }
496
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
497
+ * await api.user.process.getOrgGroups(params, session);
498
+ */
499
+ async getOrgGroups(params, session) {
500
+ const self = this;
501
+
502
+ try {
503
+ Joi.assert(params, Joi.object().required());
504
+ Joi.assert(params.orgId, Joi.string().required());
505
+ Joi.assert(session, Joi.string().required());
506
+
507
+ const {orgId} = params;
508
+ const apiCall = self._client.get(`/organizations/${orgId}/groups`, self._setHeader(session));
509
+ return self._returnData(await apiCall);
510
+ } catch (ex) {
511
+ throw ex;
512
+ }
513
+ }
514
+
515
+ /**
516
+ * @author Myndware <augusto.pissarra@myndware.com>
517
+ * @description Get Org Users
518
+ * @param {object} params Params to get Org Users
519
+ * @param {string} params.orgId Organization id (_id database);
520
+ * @param {string} session Session, token JWT
521
+ * @return {Promise}
522
+ * @public
523
+ * @async
524
+ * @example
525
+ *
526
+ * const API = require('@docbrasil/api-systemmanager');
527
+ * const api = new API();
528
+ * const params = {
529
+ * orgId: '5edd11c46b6ce9729c2c297c',
530
+ * }
531
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
532
+ * await api.user.process.getOrgUsers(params, session);
533
+ */
534
+ async getOrgUsers(params, session) {
535
+ const self = this;
536
+
537
+ try {
538
+ Joi.assert(params, Joi.object().required());
539
+ Joi.assert(params.orgId, Joi.string().required());
540
+ Joi.assert(session, Joi.string().required());
541
+
542
+ const {orgId} = params;
543
+ const apiCall = self._client.get(`/organizations/${orgId}/users`, self._setHeader(session));
544
+ return self._returnData(await apiCall);
545
+ } catch (ex) {
546
+ throw ex;
547
+ }
548
+ }
479
549
  }
480
550
 
481
551
  export default Process;
package/dist/bundle.cjs CHANGED
@@ -2247,7 +2247,7 @@ class Process {
2247
2247
  }
2248
2248
  }
2249
2249
 
2250
- /**
2250
+ /**
2251
2251
  * @author Myndware <augusto.pissarra@myndware.com>
2252
2252
  * @description Get DocType properties of process
2253
2253
  * @param {object} params Params to get document DocType
@@ -2284,6 +2284,76 @@ class Process {
2284
2284
  throw ex;
2285
2285
  }
2286
2286
  }
2287
+
2288
+ /**
2289
+ * @author Myndware <augusto.pissarra@myndware.com>
2290
+ * @description Get Org Groups
2291
+ * @param {object} params Params to get Org Groups
2292
+ * @param {string} params.orgId Organization id (_id database);
2293
+ * @param {string} session Session, token JWT
2294
+ * @return {Promise}
2295
+ * @public
2296
+ * @async
2297
+ * @example
2298
+ *
2299
+ * const API = require('@docbrasil/api-systemmanager');
2300
+ * const api = new API();
2301
+ * const params = {
2302
+ * orgId: '5edd11c46b6ce9729c2c297c',
2303
+ * }
2304
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
2305
+ * await api.user.process.getOrgGroups(params, session);
2306
+ */
2307
+ async getOrgGroups(params, session) {
2308
+ const self = this;
2309
+
2310
+ try {
2311
+ Joi__default["default"].assert(params, Joi__default["default"].object().required());
2312
+ Joi__default["default"].assert(params.orgId, Joi__default["default"].string().required());
2313
+ Joi__default["default"].assert(session, Joi__default["default"].string().required());
2314
+
2315
+ const {orgId} = params;
2316
+ const apiCall = self._client.get(`/organizations/${orgId}/groups`, self._setHeader(session));
2317
+ return self._returnData(await apiCall);
2318
+ } catch (ex) {
2319
+ throw ex;
2320
+ }
2321
+ }
2322
+
2323
+ /**
2324
+ * @author Myndware <augusto.pissarra@myndware.com>
2325
+ * @description Get Org Users
2326
+ * @param {object} params Params to get Org Users
2327
+ * @param {string} params.orgId Organization id (_id database);
2328
+ * @param {string} session Session, token JWT
2329
+ * @return {Promise}
2330
+ * @public
2331
+ * @async
2332
+ * @example
2333
+ *
2334
+ * const API = require('@docbrasil/api-systemmanager');
2335
+ * const api = new API();
2336
+ * const params = {
2337
+ * orgId: '5edd11c46b6ce9729c2c297c',
2338
+ * }
2339
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
2340
+ * await api.user.process.getOrgUsers(params, session);
2341
+ */
2342
+ async getOrgUsers(params, session) {
2343
+ const self = this;
2344
+
2345
+ try {
2346
+ Joi__default["default"].assert(params, Joi__default["default"].object().required());
2347
+ Joi__default["default"].assert(params.orgId, Joi__default["default"].string().required());
2348
+ Joi__default["default"].assert(session, Joi__default["default"].string().required());
2349
+
2350
+ const {orgId} = params;
2351
+ const apiCall = self._client.get(`/organizations/${orgId}/users`, self._setHeader(session));
2352
+ return self._returnData(await apiCall);
2353
+ } catch (ex) {
2354
+ throw ex;
2355
+ }
2356
+ }
2287
2357
  }
2288
2358
 
2289
2359
  /**
@@ -14110,8 +14180,11 @@ class MyndAI {
14110
14180
  * @param {string} params.model The model to use for the explain
14111
14181
  * @param {object} params.context The context to apply to a prompt
14112
14182
  * @param {string} params.text The text to add to the prompt
14113
- * @param {array<base64>} params.medias Medias to add to the case in base64 (PDF, Image, Video, Audio)
14114
- * @param {array<string>} params.mediaIds Media Ids to add - id of an internal document (PDF, Image, Video, Audio)
14183
+ * @param {array<object>} params.medias Medias to add (PDF, Image, Video, Audio)
14184
+ * @param {string} params.medias.type can be base64 | document
14185
+ * @param {string} params.medias.mime the mime type of the media
14186
+ * @param {string} params.medias.base64 the base64 of the image (in the case the type is base64)
14187
+ * @param {string} params.medias.document the document path for the image (in the case the type is document)
14115
14188
  * @param {string} params.prompt The actual prompt with context and text to apply to
14116
14189
  * @param {boolean} params.json=false If we return in json format or not
14117
14190
  * @return {Promise<object>} data