@docbrasil/api-systemmanager 1.2.5 → 1.2.6

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/task.js CHANGED
@@ -256,6 +256,7 @@ class Task {
256
256
  * @param {string=} params.title - Task title
257
257
  * @param {array=} params.tags - Task tags
258
258
  * @param {string=} params.dueDate - Due date ISO string
259
+ * @param {object=} params.processProperties - Keys merged into the process's processProperties bag (search, task cards, BI); omitted when empty
259
260
  * @param {string} session - Session, token JWT
260
261
  * @return {Promise}
261
262
  * @public
@@ -279,7 +280,8 @@ class Task {
279
280
  * order: 0,
280
281
  * title: 'My Task',
281
282
  * tags: [],
282
- * dueDate: '2024-01-15T00:00:00Z'
283
+ * dueDate: '2024-01-15T00:00:00Z',
284
+ * processProperties: { surgicalPatientName: 'Maria' } // optional, merged into the process bag
283
285
  * };
284
286
  * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
285
287
  * await api.user.task.saveTask(params, session);
@@ -304,6 +306,7 @@ class Task {
304
306
  Joi.assert(params.title, Joi.string().allow(''), 'Task title');
305
307
  Joi.assert(params.tags, Joi.array(), 'Task tags');
306
308
  Joi.assert(params.dueDate, Joi.string(), 'Due date ISO string');
309
+ Joi.assert(params.processProperties, Joi.object(), 'Process properties to merge into the process bag');
307
310
  Joi.assert(session, Joi.string().required(), 'Session token JWT');
308
311
 
309
312
  const {
@@ -321,7 +324,8 @@ class Task {
321
324
  order = 0,
322
325
  title = '',
323
326
  tags = [],
324
- dueDate
327
+ dueDate,
328
+ processProperties
325
329
  } = params;
326
330
 
327
331
  const body = {
@@ -337,6 +341,13 @@ class Task {
337
341
  tags
338
342
  };
339
343
  if (dueDate) body.dueDate = dueDate;
344
+ // Forwarded verbatim; the server MERGES each key into the process's own
345
+ // `processProperties` bag (site setStepData). Omitted when empty so a save
346
+ // that has nothing to publish carries no key at all. Only a plain object
347
+ // travels: an array or scalar would be folded into the bag index by index.
348
+ if (_.isPlainObject(processProperties) && !_.isEmpty(processProperties)) {
349
+ body.processProperties = processProperties;
350
+ }
340
351
 
341
352
  const url = `organizations/${orgId}/adhoc/${processId}/save/${taskId}/${flowName}`;
342
353
  const apiCall = self._client.put(url, body, self._setHeader(session));
@@ -366,6 +377,7 @@ class Task {
366
377
  * @param {string=} params.title - Task title
367
378
  * @param {array=} params.tags - Task tags
368
379
  * @param {string=} params.dueDate - Due date ISO string
380
+ * @param {object=} params.processProperties - Keys merged into the process's processProperties bag (search, task cards, BI); omitted when empty
369
381
  * @param {string} session - Session, token JWT
370
382
  * @return {Promise}
371
383
  * @public
@@ -389,7 +401,8 @@ class Task {
389
401
  * order: 0,
390
402
  * title: 'My Task',
391
403
  * tags: [],
392
- * dueDate: '2024-01-15T00:00:00Z'
404
+ * dueDate: '2024-01-15T00:00:00Z',
405
+ * processProperties: { surgicalPatientName: 'Maria' } // optional, merged into the process bag
393
406
  * };
394
407
  * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
395
408
  * await api.user.task.endTask(params, session);
@@ -414,6 +427,7 @@ class Task {
414
427
  Joi.assert(params.title, Joi.string().allow(''), 'Task title');
415
428
  Joi.assert(params.tags, Joi.array(), 'Task tags');
416
429
  Joi.assert(params.dueDate, Joi.string(), 'Due date ISO string');
430
+ Joi.assert(params.processProperties, Joi.object(), 'Process properties to merge into the process bag');
417
431
  Joi.assert(session, Joi.string().required(), 'Session token JWT');
418
432
 
419
433
  const {
@@ -431,7 +445,8 @@ class Task {
431
445
  order = 0,
432
446
  title = '',
433
447
  tags = [],
434
- dueDate
448
+ dueDate,
449
+ processProperties
435
450
  } = params;
436
451
 
437
452
  const body = {
@@ -447,6 +462,13 @@ class Task {
447
462
  tags
448
463
  };
449
464
  if (dueDate) body.dueDate = dueDate;
465
+ // Forwarded verbatim; the server MERGES each key into the process's own
466
+ // `processProperties` bag (site setStepData). Omitted when empty so a save
467
+ // that has nothing to publish carries no key at all. Only a plain object
468
+ // travels: an array or scalar would be folded into the bag index by index.
469
+ if (_.isPlainObject(processProperties) && !_.isEmpty(processProperties)) {
470
+ body.processProperties = processProperties;
471
+ }
450
472
 
451
473
  const url = `organizations/${orgId}/adhoc/${processId}/endprocess/${taskId}/${flowName}`;
452
474
  const apiCall = self._client.put(url, body, self._setHeader(session));
package/dist/bundle.cjs CHANGED
@@ -3660,6 +3660,7 @@ class Task {
3660
3660
  * @param {string=} params.title - Task title
3661
3661
  * @param {array=} params.tags - Task tags
3662
3662
  * @param {string=} params.dueDate - Due date ISO string
3663
+ * @param {object=} params.processProperties - Keys merged into the process's processProperties bag (search, task cards, BI); omitted when empty
3663
3664
  * @param {string} session - Session, token JWT
3664
3665
  * @return {Promise}
3665
3666
  * @public
@@ -3683,7 +3684,8 @@ class Task {
3683
3684
  * order: 0,
3684
3685
  * title: 'My Task',
3685
3686
  * tags: [],
3686
- * dueDate: '2024-01-15T00:00:00Z'
3687
+ * dueDate: '2024-01-15T00:00:00Z',
3688
+ * processProperties: { surgicalPatientName: 'Maria' } // optional, merged into the process bag
3687
3689
  * };
3688
3690
  * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
3689
3691
  * await api.user.task.saveTask(params, session);
@@ -3708,6 +3710,7 @@ class Task {
3708
3710
  Joi__default["default"].assert(params.title, Joi__default["default"].string().allow(''), 'Task title');
3709
3711
  Joi__default["default"].assert(params.tags, Joi__default["default"].array(), 'Task tags');
3710
3712
  Joi__default["default"].assert(params.dueDate, Joi__default["default"].string(), 'Due date ISO string');
3713
+ Joi__default["default"].assert(params.processProperties, Joi__default["default"].object(), 'Process properties to merge into the process bag');
3711
3714
  Joi__default["default"].assert(session, Joi__default["default"].string().required(), 'Session token JWT');
3712
3715
 
3713
3716
  const {
@@ -3725,7 +3728,8 @@ class Task {
3725
3728
  order = 0,
3726
3729
  title = '',
3727
3730
  tags = [],
3728
- dueDate
3731
+ dueDate,
3732
+ processProperties
3729
3733
  } = params;
3730
3734
 
3731
3735
  const body = {
@@ -3741,6 +3745,13 @@ class Task {
3741
3745
  tags
3742
3746
  };
3743
3747
  if (dueDate) body.dueDate = dueDate;
3748
+ // Forwarded verbatim; the server MERGES each key into the process's own
3749
+ // `processProperties` bag (site setStepData). Omitted when empty so a save
3750
+ // that has nothing to publish carries no key at all. Only a plain object
3751
+ // travels: an array or scalar would be folded into the bag index by index.
3752
+ if (___default["default"].isPlainObject(processProperties) && !___default["default"].isEmpty(processProperties)) {
3753
+ body.processProperties = processProperties;
3754
+ }
3744
3755
 
3745
3756
  const url = `organizations/${orgId}/adhoc/${processId}/save/${taskId}/${flowName}`;
3746
3757
  const apiCall = self._client.put(url, body, self._setHeader(session));
@@ -3770,6 +3781,7 @@ class Task {
3770
3781
  * @param {string=} params.title - Task title
3771
3782
  * @param {array=} params.tags - Task tags
3772
3783
  * @param {string=} params.dueDate - Due date ISO string
3784
+ * @param {object=} params.processProperties - Keys merged into the process's processProperties bag (search, task cards, BI); omitted when empty
3773
3785
  * @param {string} session - Session, token JWT
3774
3786
  * @return {Promise}
3775
3787
  * @public
@@ -3793,7 +3805,8 @@ class Task {
3793
3805
  * order: 0,
3794
3806
  * title: 'My Task',
3795
3807
  * tags: [],
3796
- * dueDate: '2024-01-15T00:00:00Z'
3808
+ * dueDate: '2024-01-15T00:00:00Z',
3809
+ * processProperties: { surgicalPatientName: 'Maria' } // optional, merged into the process bag
3797
3810
  * };
3798
3811
  * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
3799
3812
  * await api.user.task.endTask(params, session);
@@ -3818,6 +3831,7 @@ class Task {
3818
3831
  Joi__default["default"].assert(params.title, Joi__default["default"].string().allow(''), 'Task title');
3819
3832
  Joi__default["default"].assert(params.tags, Joi__default["default"].array(), 'Task tags');
3820
3833
  Joi__default["default"].assert(params.dueDate, Joi__default["default"].string(), 'Due date ISO string');
3834
+ Joi__default["default"].assert(params.processProperties, Joi__default["default"].object(), 'Process properties to merge into the process bag');
3821
3835
  Joi__default["default"].assert(session, Joi__default["default"].string().required(), 'Session token JWT');
3822
3836
 
3823
3837
  const {
@@ -3835,7 +3849,8 @@ class Task {
3835
3849
  order = 0,
3836
3850
  title = '',
3837
3851
  tags = [],
3838
- dueDate
3852
+ dueDate,
3853
+ processProperties
3839
3854
  } = params;
3840
3855
 
3841
3856
  const body = {
@@ -3851,6 +3866,13 @@ class Task {
3851
3866
  tags
3852
3867
  };
3853
3868
  if (dueDate) body.dueDate = dueDate;
3869
+ // Forwarded verbatim; the server MERGES each key into the process's own
3870
+ // `processProperties` bag (site setStepData). Omitted when empty so a save
3871
+ // that has nothing to publish carries no key at all. Only a plain object
3872
+ // travels: an array or scalar would be folded into the bag index by index.
3873
+ if (___default["default"].isPlainObject(processProperties) && !___default["default"].isEmpty(processProperties)) {
3874
+ body.processProperties = processProperties;
3875
+ }
3854
3876
 
3855
3877
  const url = `organizations/${orgId}/adhoc/${processId}/endprocess/${taskId}/${flowName}`;
3856
3878
  const apiCall = self._client.put(url, body, self._setHeader(session));