bx-rest 0.1.1 → 0.1.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.
Files changed (102) hide show
  1. package/consts/part-name-metods.d.ts +11 -0
  2. package/esm2020/consts/part-name-metods.mjs +12 -1
  3. package/esm2020/map/lists.mjs +2 -2
  4. package/esm2020/map/task.mjs +10 -1
  5. package/esm2020/public-api.mjs +2 -2
  6. package/esm2020/request/bizproc/activity.mjs +23 -0
  7. package/esm2020/request/bizproc/event.mjs +19 -0
  8. package/esm2020/request/bizproc/robot.mjs +22 -0
  9. package/esm2020/request/bizproc/task.mjs +20 -0
  10. package/esm2020/request/bizproc/workflow/instance.mjs +19 -0
  11. package/esm2020/request/bizproc/workflow/template.mjs +27 -0
  12. package/esm2020/request/bizproc/workflow.mjs +31 -0
  13. package/esm2020/request/bizproc.mjs +25 -0
  14. package/esm2020/request/lists/element.mjs +4 -3
  15. package/esm2020/request/lists.mjs +2 -2
  16. package/esm2020/request/log/blogcomment.mjs +19 -0
  17. package/esm2020/request/log/blogpost.mjs +31 -0
  18. package/esm2020/request/log.mjs +19 -0
  19. package/esm2020/request/tasks/task.mjs +34 -1
  20. package/esm2020/request/user.mjs +9 -6
  21. package/esm2020/request-navvy/bizproc/workflow.mjs +22 -0
  22. package/esm2020/request-navvy/bizproc.mjs +60 -0
  23. package/esm2020/request-navvy/disk/storage.mjs +7 -10
  24. package/esm2020/request-navvy/lists/element.mjs +6 -3
  25. package/esm2020/request-navvy/lists.mjs +2 -10
  26. package/esm2020/request-navvy/log/blogcomment.mjs +19 -0
  27. package/esm2020/request-navvy/log/blogpost.mjs +33 -0
  28. package/esm2020/request-navvy/log.mjs +19 -0
  29. package/esm2020/request-navvy/tasks/task.mjs +67 -19
  30. package/esm2020/request-navvy/user.mjs +7 -8
  31. package/esm2020/rest.mjs +25 -17
  32. package/esm2020/services/base.mjs +3 -3
  33. package/esm2020/services/http/HttpBX.mjs +34 -36
  34. package/esm2020/services/http/http.mjs +36 -38
  35. package/esm2020/services/http/sessionKey.mjs +126 -113
  36. package/esm2020/services/vanilla/sessionStorage.mjs +7 -7
  37. package/esm2020/settings.mjs +2 -2
  38. package/esm2020/typification/auth/save.mjs +1 -1
  39. package/esm2020/typification/rest/base/OrderOptions.mjs +2 -0
  40. package/esm2020/typification/rest/base/sort.mjs +2 -0
  41. package/esm2020/typification/rest/bizproc/base/filedEnum.mjs +2 -0
  42. package/esm2020/typification/rest/bizproc/workflow/start.mjs +2 -0
  43. package/esm2020/typification/rest/bizproc/workflow/template/list.mjs +2 -0
  44. package/esm2020/typification/rest/lists/element/add.mjs +2 -0
  45. package/esm2020/typification/rest/log/blogpost/add.mjs +2 -0
  46. package/esm2020/typification/rest/task/base/fieldsName.mjs +2 -0
  47. package/esm2020/typification/rest/tasks/task/add.mjs +2 -0
  48. package/esm2020/typification/rest/tasks/task/get.mjs +2 -0
  49. package/esm2020/typification/rest/tasks/task/list.mjs +2 -0
  50. package/esm2020/typification/rest/user/get.mjs +1 -1
  51. package/fesm2015/bx-rest.mjs +913 -490
  52. package/fesm2015/bx-rest.mjs.map +1 -1
  53. package/fesm2020/bx-rest.mjs +916 -488
  54. package/fesm2020/bx-rest.mjs.map +1 -1
  55. package/map/lists.d.ts +1 -1
  56. package/map/task.d.ts +4 -1
  57. package/package.json +1 -1
  58. package/public-api.d.ts +1 -1
  59. package/request/bizproc/activity.d.ts +12 -0
  60. package/request/bizproc/event.d.ts +8 -0
  61. package/request/bizproc/robot.d.ts +11 -0
  62. package/request/bizproc/task.d.ts +9 -0
  63. package/request/bizproc/workflow/instance.d.ts +8 -0
  64. package/request/bizproc/workflow/template.d.ts +16 -0
  65. package/request/bizproc/workflow.d.ts +20 -0
  66. package/request/bizproc.d.ts +16 -0
  67. package/request/lists/element.d.ts +2 -1
  68. package/request/lists.d.ts +1 -1
  69. package/request/log/blogcomment.d.ts +8 -0
  70. package/request/log/blogpost.d.ts +17 -0
  71. package/request/log.d.ts +10 -0
  72. package/request/tasks/task.d.ts +9 -1
  73. package/request-navvy/bizproc/workflow.d.ts +12 -0
  74. package/request-navvy/bizproc.d.ts +24 -0
  75. package/request-navvy/disk/storage.d.ts +1 -3
  76. package/request-navvy/lists/element.d.ts +3 -1
  77. package/request-navvy/lists.d.ts +1 -8
  78. package/request-navvy/log/blogcomment.d.ts +8 -0
  79. package/request-navvy/log/blogpost.d.ts +19 -0
  80. package/request-navvy/log.d.ts +10 -0
  81. package/request-navvy/tasks/task.d.ts +13 -3
  82. package/request-navvy/user.d.ts +1 -3
  83. package/rest.d.ts +17 -9
  84. package/services/http/sessionKey.d.ts +3 -23
  85. package/services/vanilla/sessionStorage.d.ts +5 -5
  86. package/settings.d.ts +1 -1
  87. package/typification/auth/save.d.ts +1 -1
  88. package/typification/rest/base/OrderOptions.d.ts +1 -0
  89. package/typification/rest/base/sort.d.ts +1 -0
  90. package/typification/rest/bizproc/base/filedEnum.d.ts +1 -0
  91. package/typification/rest/bizproc/workflow/start.d.ts +5 -0
  92. package/typification/rest/bizproc/workflow/template/list.d.ts +8 -0
  93. package/typification/rest/lists/element/add.d.ts +9 -0
  94. package/typification/rest/log/blogpost/add.d.ts +12 -0
  95. package/typification/rest/task/base/fieldsName.d.ts +1 -0
  96. package/typification/rest/{task/fieldsForSend.d.ts → tasks/task/add.d.ts} +1 -1
  97. package/typification/rest/tasks/task/get.d.ts +5 -0
  98. package/typification/rest/tasks/task/list.d.ts +65 -0
  99. package/typification/rest/user/get.d.ts +6 -1
  100. package/esm2020/store/auth.mjs +0 -26
  101. package/esm2020/typification/rest/task/fieldsForSend.mjs +0 -2
  102. package/store/auth.d.ts +0 -20
@@ -1,23 +1,20 @@
1
1
  import * as i0 from '@angular/core';
2
- import { NgModule, inject, Component, ViewEncapsulation, Inject, Injectable, Optional } from '@angular/core';
3
- import { Subscription, filter, take, of, mergeMap, throwError, forkJoin, tap } from 'rxjs';
4
- import { map, catchError, take as take$1, mergeMap as mergeMap$1 } from 'rxjs/operators';
2
+ import { NgModule, inject, Component, ViewEncapsulation, Inject, Injectable } from '@angular/core';
3
+ import { Subscription, of, mergeMap, throwError, forkJoin, tap } from 'rxjs';
5
4
  import clone from 'just-clone';
5
+ import { map, catchError, take, mergeMap as mergeMap$1 } from 'rxjs/operators';
6
6
  import * as i1$1 from '@angular/material/snack-bar';
7
7
  import { MatSnackBarRef, MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar';
8
8
  import * as i2 from '@angular/material/icon';
9
9
  import { MatIconModule } from '@angular/material/icon';
10
10
  import * as i1 from '@angular/material/button';
11
11
  import { MatButtonModule } from '@angular/material/button';
12
- import * as i1$2 from '@ngrx/store';
13
- import { createAction, props, createReducer, on } from '@ngrx/store';
14
12
  import { __awaiter } from 'tslib';
15
13
  import { DateTime } from 'luxon';
16
- import * as i2$1 from '@angular/router';
17
- import * as i1$3 from '@angular/common/http';
14
+ import * as i1$2 from '@angular/common/http';
18
15
  import { HttpParams } from '@angular/common/http';
19
16
 
20
- const REST_SETTINGS = {
17
+ const BX_REST_SETTINGS = {
21
18
  auth: {
22
19
  source: 'cookies',
23
20
  key: 'auth'
@@ -34,81 +31,6 @@ function BXRestMapResult(v) {
34
31
  return undefined;
35
32
  }
36
33
 
37
- const $get = 'get';
38
- const $add = 'add';
39
- const $set = 'set';
40
- const $event = 'event';
41
- const $update = 'update';
42
- const $user = 'user';
43
- const $task = 'task';
44
- const $calendar = 'calendar';
45
- const $meeting = 'meeting';
46
- const $list = 'list';
47
- const $search = 'search';
48
- const $accessibility = 'accessibility';
49
- const $delete = 'delete';
50
- const $nearest = 'nearest';
51
- const $params = 'params';
52
- const $status = 'status';
53
- const $resource = 'resource';
54
- const $booking = 'booking';
55
- const $section = 'section';
56
- const $settings = 'settings';
57
- const $tasks = 'tasks';
58
- const $elapseditem = 'elapseditem';
59
- const $getlist = 'getlist';
60
- const $approve = 'approve';
61
- const $complete = 'complete';
62
- const $counters = 'counters';
63
- const $deger = 'deger';
64
- const $delegate = 'delegate';
65
- const $disapprove = 'disapprove';
66
- const $favorite = 'favorite';
67
- const $files = 'files';
68
- const $file = 'file';
69
- const $attach = 'attach';
70
- const $field = 'field';
71
- const $getFields = 'get' + $field + 's';
72
- const $getaccess = 'getaccess';
73
- const $history = 'history';
74
- const $pause = 'pause';
75
- const $renew = 'renew';
76
- const $start = 'start';
77
- const $result = 'result';
78
- const $planner = 'planner';
79
- const $disk = 'disk';
80
- const $rename = 'rename';
81
- const $markdeleted = 'markdeleted';
82
- const $restore = 'restore';
83
- const $folder = 'folder';
84
- const $getchildren = 'getchildren';
85
- const $copyto = 'copyto';
86
- const $moveto = 'moveto';
87
- const $uploadfile = 'uploadfile';
88
- const $storage = 'storage';
89
- const $getTypes = 'getTypes';
90
- const $stages = 'stages';
91
- const $getmanifest = 'getmanifest';
92
- const $isactionallowed = 'isactionallowed';
93
- const $commentitem = 'commentitem';
94
- const $department = 'department';
95
- const $sonet_group = 'sonet_group';
96
- const $create = 'create';
97
- const $feature = 'feature';
98
- const $access = 'access';
99
- const $request = 'request';
100
- const $socialnetwork = 'socialnetwork';
101
- const $api = 'api';
102
- const $workgroup = 'workgroup';
103
- const $log = 'log';
104
- const $blogpost = 'blogpost';
105
- const $lists = 'lists';
106
- const $iblock = 'iblock';
107
- const $type = 'type';
108
- const $id = 'id';
109
- const $element = 'element';
110
- const $url = 'url';
111
-
112
34
  class BxRestModule {
113
35
  }
114
36
  BxRestModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BxRestModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
@@ -455,29 +377,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
455
377
  }]
456
378
  }] });
457
379
 
458
- const save = createAction('[Auth Component] Save', props());
459
- const saveAccessToken = createAction('[Auth Component] SaveAccessToken', props());
460
- const initialState = {
461
- access_token: '',
462
- client_endpoint: '',
463
- domain: '',
464
- expires: 0,
465
- expires_in: 0,
466
- member_id: '',
467
- refresh_token: '',
468
- scope: '',
469
- server_endpoint: '',
470
- status: '',
471
- user_id: 0
472
- };
473
- const _authReducer = createReducer(initialState, on(saveAccessToken, (s, data) => {
474
- let copy = clone(s);
475
- return Object.assign(copy, data);
476
- }));
477
- function authReducer(state = initialState, action) {
478
- return _authReducer(state, action);
479
- }
480
-
481
380
  const time = {
482
381
  oneDayMilliseconds: 1000 * 60 * 60 * 24
483
382
  };
@@ -579,7 +478,7 @@ class BaseServices {
579
478
  }
580
479
  getHomeAddress() {
581
480
  // return this.prepareBaseAddress(environment.urls.home)
582
- return this.prepareBaseAddress(REST_SETTINGS.urls.home);
481
+ return this.prepareBaseAddress(BX_REST_SETTINGS.urls.home);
583
482
  }
584
483
  dateDiff(a, b) {
585
484
  return new Date(a.valueOf() - b.valueOf());
@@ -685,6 +584,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
685
584
  }]
686
585
  }] });
687
586
 
587
+ class SessionStorage {
588
+ static setItem(name, value) {
589
+ sessionStorage.setItem(name, JSON.stringify(value));
590
+ }
591
+ static getItem(name) {
592
+ const res = sessionStorage.getItem(name);
593
+ if (res) {
594
+ return JSON.parse(res);
595
+ }
596
+ return undefined;
597
+ }
598
+ }
599
+ SessionStorage.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SessionStorage, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
600
+ SessionStorage.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SessionStorage, providedIn: 'root' });
601
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SessionStorage, decorators: [{
602
+ type: Injectable,
603
+ args: [{
604
+ providedIn: 'root'
605
+ }]
606
+ }] });
607
+
688
608
  class RestServices {
689
609
  constructor() {
690
610
  this.BX24 = false;
@@ -705,113 +625,134 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
705
625
  }], ctorParameters: function () { return []; } });
706
626
 
707
627
  class SessionKeyServices extends BaseServices {
708
- constructor(store, route, BxApiLib, REST_SETTINGS) {
628
+ constructor(
629
+ // private route: ActivatedRoute,
630
+ BxApiLib) {
709
631
  super();
710
- this.store = store;
711
- this.route = route;
712
632
  this.BxApiLib = BxApiLib;
713
633
  this.authHave = false;
714
634
  this.subscribe = {
715
635
  authData: new Subscription()
716
636
  };
717
- this.REST_SETTINGS = REST_SETTINGS;
718
- this.authData$ = this.store.select('auth');
719
- this.authData$.subscribe(authData => {
720
- if ((authData && !authData.access_token.length) || !authData) {
721
- // получаем токен по собственным каналом (в битриксе приложение trace:apps.trace)
722
- window.addEventListener('message', (event) => {
723
- if (event.origin !== window.origin) { // проверяем что это не наше сообщение (с текущего приложения)
724
- if (event.data && event.data.param) {
725
- if (typeof event.data.param === 'string') {
726
- event.data.param = JSON.parse(event.data.param);
727
- }
728
- let save = {};
729
- if (event.data.param.access_token) {
730
- let param = event.data.param;
731
- save.access_token = event.data.param.access_token;
732
- save = {
733
- access_token: (param.access_token) ? param.access_token : undefined,
734
- client_endpoint: (param.client_endpoint) ? param.client_endpoint : undefined,
735
- domain: (param.domain) ? param.domain : undefined,
736
- expires: (param.expires) ? param.expires : undefined,
737
- expires_in: (param.expires_in) ? param.expires_in : undefined,
738
- member_id: (param.member_id) ? param.member_id : undefined,
739
- refresh_token: (param.refresh_token) ? param.refresh_token : undefined,
740
- scope: (param.scope) ? param.scope : undefined,
741
- server_endpoint: (param.server_endpoint) ? param.server_endpoint : undefined,
742
- status: (param.status) ? param.status : undefined,
743
- user_id: (param.user_id) ? param.user_id : undefined,
744
- type: (param.type) ? param.type : undefined,
745
- };
746
- }
637
+ let authData = SessionStorage.getItem(this.constructor.name);
638
+ if ((authData && !authData.access_token.length) || !authData) {
639
+ // получаем токен по собственным каналом (в битриксе приложение trace:apps.trace)
640
+ window.addEventListener('message', (event) => {
641
+ if (event.origin !== window.origin) { // проверяем что это не наше сообщение (с текущего приложения)
642
+ if (event.data && event.data.param) {
643
+ if (typeof event.data.param === 'string') {
644
+ event.data.param = JSON.parse(event.data.param);
645
+ }
646
+ if (event.data.param.access_token) {
647
+ let param = event.data.param;
648
+ let save = {
649
+ access_token: (param.access_token) ? param.access_token : undefined,
650
+ client_endpoint: (param.client_endpoint) ? param.client_endpoint : undefined,
651
+ domain: (param.domain) ? param.domain : undefined,
652
+ expires: (param.expires) ? param.expires : undefined,
653
+ expires_in: (param.expires_in) ? param.expires_in : undefined,
654
+ member_id: (param.member_id) ? param.member_id : undefined,
655
+ refresh_token: (param.refresh_token) ? param.refresh_token : undefined,
656
+ scope: (param.scope) ? param.scope : undefined,
657
+ server_endpoint: (param.server_endpoint) ? param.server_endpoint : undefined,
658
+ status: (param.status) ? param.status : undefined,
659
+ user_id: (param.user_id) ? param.user_id : undefined,
660
+ type: (param.type) ? param.type : undefined,
661
+ };
747
662
  if (Object.keys(save).length && save.access_token) {
748
- this.store.dispatch(saveAccessToken(save));
663
+ SessionStorage.setItem(this.constructor.name, save);
749
664
  this.subscribeAll();
750
665
  }
751
666
  }
752
667
  }
753
- });
754
- this.subscribe.authData = this.route.queryParamMap
755
- .pipe(filter(param => param.has('AUTH_ID')
756
- || param.has('access_token')
757
- || param.has('REFRESH_ID')
758
- || param.has('DOMAIN')))
759
- .subscribe((param) => {
760
- let save = {};
761
- if (param.has('AUTH_ID') && !authData.access_token.length) {
762
- const get = param.get('AUTH_ID');
763
- if (get) {
764
- CookiesServices.set('auth', get); // потом убрать
765
- save.access_token = get;
766
- }
767
- }
768
- if (param.has('access_token') && !authData.access_token.length) {
769
- const get = param.get('access_token');
770
- if (get) {
771
- CookiesServices.set('auth', get); // потом убрать
772
- save.access_token = get;
773
- }
774
- }
775
- if (param.has('REFRESH_ID') && !authData.refresh_token.length) {
776
- const get = param.get('REFRESH_ID');
777
- if (get) {
778
- save.refresh_token = get;
779
- }
780
- }
781
- if (param.has('DOMAIN') && !authData.domain.length) {
782
- const get = param.get('DOMAIN');
783
- if (get) {
784
- save.domain = get;
785
- }
786
- }
787
- if (Object.keys(save).length && save.access_token) {
788
- this.store.dispatch(saveAccessToken(save));
789
- this.subscribeAll();
790
- }
791
- else {
792
- // если битрикс не шлёт нужные мне параметры на прямую
793
- // просим их мне отдать так как описано это в документации
794
- let f = () => {
795
- if (this.BxApiLib.BX24) {
796
- const initDate = this.BxApiLib.BX24.getAuth();
797
- this.store.dispatch(saveAccessToken(initDate));
798
- }
799
- };
800
- this.BxApiLib.init(f);
668
+ }
669
+ });
670
+ /*
671
+ this.subscribe.authData = this.route.queryParamMap
672
+ .pipe(
673
+ filter(param =>
674
+ param.has('AUTH_ID')
675
+ || param.has('access_token')
676
+ || param.has('REFRESH_ID')
677
+ || param.has('DOMAIN')
678
+ )
679
+ )
680
+ .subscribe((param: ParamMap) => {
681
+ if(!save) {
682
+ let save = {
683
+ access_token: undefined,
684
+ client_endpoint: (param.client_endpoint) ? param.client_endpoint : undefined,
685
+ domain: (param.domain) ? param.domain : undefined,
686
+ expires: (param.expires) ? param.expires : undefined,
687
+ expires_in: (param.expires_in) ? param.expires_in : undefined,
688
+ member_id: (param.member_id) ? param.member_id : undefined,
689
+ refresh_token: (param.refresh_token) ? param.refresh_token : undefined,
690
+ scope: (param.scope) ? param.scope : undefined,
691
+ server_endpoint: (param.server_endpoint) ? param.server_endpoint : undefined,
692
+ status: (param.status) ? param.status : undefined,
693
+ user_id: (param.user_id) ? param.user_id : undefined,
694
+ type: (param.type) ? param.type : undefined,
695
+ }
696
+ }
697
+
698
+ if (param.has('AUTH_ID') && !authData?.access_token.length) {
699
+ const get = param.get('AUTH_ID')
700
+ if (get) {
701
+ Cookies.set('auth', get) //TODO: потом убрать
702
+ save.access_token = get
703
+ }
704
+ }
705
+
706
+ if (param.has('access_token') && !authData.access_token.length) {
707
+ const get = param.get('access_token')
708
+ if (get) {
709
+ Cookies.set('auth', get) // TODO: потом убрать
710
+ save.access_token = get
711
+ }
712
+ }
713
+
714
+ if (param.has('REFRESH_ID') && !authData.refresh_token.length) {
715
+ const get = param.get('REFRESH_ID')
716
+ if (get) {
717
+ save.refresh_token = get
718
+ }
719
+ }
720
+
721
+ if (param.has('DOMAIN') && !authData.domain.length) {
722
+ const get = param.get('DOMAIN')
723
+ if (get) {
724
+ save.domain = get
725
+ }
726
+ }
727
+ if (Object.keys(save).length && save.access_token) {
728
+ SessionStorage.setItem(this.constructor.name, save)
729
+ this.subscribeAll()
730
+ } else {
731
+ // если битрикс не шлёт нужные мне параметры на прямую
732
+ // просим их мне отдать так как описано это в документации
733
+ let f = () => {
734
+ if (this.BxApiLib.BX24) {
735
+ const initDate = this.BxApiLib.BX24.getAuth()
736
+ SessionStorage.setItem(this.constructor.name, save)
801
737
  }
802
- });
803
- }
804
- else if (this.getAuth().length) {
805
- this.authHave = true;
806
- }
807
- this.authData = authData;
808
- });
738
+ }
739
+
740
+ this.BxApiLib.init(f)
741
+ }
742
+
743
+ })
744
+ */
745
+ }
746
+ else if (this.getAuth().length) {
747
+ this.authHave = true;
748
+ }
749
+ this.authData = authData;
809
750
  }
810
751
  subscribeAll() {
811
752
  this.subscribe.authData.unsubscribe();
812
753
  }
813
754
  getAuth() {
814
- switch (REST_SETTINGS.auth.key) {
755
+ switch (BX_REST_SETTINGS.auth.key) {
815
756
  case 'auth':
816
757
  return CookiesServices.get('auth');
817
758
  default:
@@ -828,8 +769,8 @@ class SessionKeyServices extends BaseServices {
828
769
  }
829
770
  }
830
771
  getKeyAuth() {
831
- if (REST_SETTINGS.auth.key.length) {
832
- return REST_SETTINGS.auth.key;
772
+ if (BX_REST_SETTINGS.auth.key.length) {
773
+ return BX_REST_SETTINGS.auth.key;
833
774
  }
834
775
  else {
835
776
  if (window.BX && window.BX.bitrix_sessid()
@@ -864,36 +805,29 @@ class SessionKeyServices extends BaseServices {
864
805
  return false;
865
806
  }
866
807
  getAuthParams() {
867
- switch (REST_SETTINGS.auth.source) {
808
+ switch (BX_REST_SETTINGS.auth.source) {
868
809
  case 'cookies':
869
- return of(this.getAuth());
810
+ return this.getAuth();
870
811
  default:
871
- return this.authData$.pipe(take(1), map(v => (v) ? v.access_token : undefined));
812
+ return (this.authData) ? this.authData.access_token : undefined;
872
813
  }
873
814
  }
874
815
  getBaseUrl() {
875
- return of(this.prepareBaseAddress(this.REST_SETTINGS.urls.home, 'rest'));
816
+ return of(this.prepareBaseAddress(BX_REST_SETTINGS.urls.home, 'rest'));
876
817
  // return this.authData$.pipe( // TODO: разобраться позже
877
818
  // take(1),
878
819
  // map(v => (v && v.domain) ? this.prepareBaseAddress(v.domain) : undefined)
879
820
  // )
880
821
  }
881
822
  }
882
- SessionKeyServices.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SessionKeyServices, deps: [{ token: i1$2.Store }, { token: i2$1.ActivatedRoute }, { token: RestServices }, { token: REST_SETTINGS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
823
+ SessionKeyServices.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SessionKeyServices, deps: [{ token: RestServices }], target: i0.ɵɵFactoryTarget.Injectable });
883
824
  SessionKeyServices.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SessionKeyServices, providedIn: 'root' });
884
825
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SessionKeyServices, decorators: [{
885
826
  type: Injectable,
886
827
  args: [{
887
828
  providedIn: 'root'
888
829
  }]
889
- }], ctorParameters: function () {
890
- return [{ type: i1$2.Store }, { type: i2$1.ActivatedRoute }, { type: RestServices }, { type: undefined, decorators: [{
891
- type: Optional
892
- }, {
893
- type: Inject,
894
- args: [REST_SETTINGS]
895
- }] }];
896
- } });
830
+ }], ctorParameters: function () { return [{ type: RestServices }]; } });
897
831
 
898
832
  class HttpData extends BaseServices {
899
833
  constructor() {
@@ -1024,14 +958,14 @@ class BaseHttp extends HttpData {
1024
958
  };
1025
959
  }
1026
960
  }
1027
- BaseHttp.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseHttp, deps: [{ token: i1$3.HttpClient }, { token: SnackBarService }], target: i0.ɵɵFactoryTarget.Injectable });
961
+ BaseHttp.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseHttp, deps: [{ token: i1$2.HttpClient }, { token: SnackBarService }], target: i0.ɵɵFactoryTarget.Injectable });
1028
962
  BaseHttp.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseHttp, providedIn: 'root' });
1029
963
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseHttp, decorators: [{
1030
964
  type: Injectable,
1031
965
  args: [{
1032
966
  providedIn: 'root'
1033
967
  }]
1034
- }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: SnackBarService }]; } });
968
+ }], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: SnackBarService }]; } });
1035
969
 
1036
970
  class BaseHttpServices extends BaseHttp {
1037
971
  httpGet(url, params = {}, settings = this.defSettings) {
@@ -1050,56 +984,54 @@ class HttpServices extends BaseHttpServices {
1050
984
  this.session = session;
1051
985
  }
1052
986
  httpPost(url, params = {}, settings = this.defSettings) {
1053
- return this.session.getAuthParams().pipe(mergeMap(auth => {
1054
- if (auth) {
1055
- const paramsClone = clone(params);
1056
- paramsClone[this.session.getKeyAuth()] = auth;
1057
- return this.session.getBaseUrl().pipe(mergeMap(v => {
1058
- if (v) {
1059
- return this.http.post(this.prepareBaseAddress(v) + url, this.getHttpParamsPost(paramsClone, new FormData(), false, [], settings));
1060
- }
1061
- return throwError(() => 'get base url error');
1062
- }));
1063
- }
1064
- else {
1065
- this.snackBar.error('Error: Auth not get');
1066
- return throwError(() => 'auth not get');
1067
- }
1068
- }));
987
+ let auth = this.session.getAuthParams();
988
+ if (auth) {
989
+ const paramsClone = clone(params);
990
+ paramsClone[this.session.getKeyAuth()] = auth;
991
+ return this.session.getBaseUrl().pipe(mergeMap(v => {
992
+ if (v) {
993
+ return this.http.post(this.prepareBaseAddress(v) + url, this.getHttpParamsPost(paramsClone, new FormData(), false, [], settings));
994
+ }
995
+ return throwError(() => 'get base url error');
996
+ }));
997
+ }
998
+ else {
999
+ this.snackBar.error('Error: Auth not get');
1000
+ return throwError(() => 'auth not get');
1001
+ }
1069
1002
  }
1070
1003
  httpGet(url, params = {}, settings = this.defSettings) {
1071
- return this.session.getAuthParams().pipe(mergeMap(auth => {
1072
- if (auth) {
1073
- if (params === null) {
1074
- params = {};
1075
- }
1076
- const paramsClone = clone(params);
1077
- paramsClone[this.session.getKeyAuth()] = auth;
1078
- let options = {
1079
- params: this.getHttpParamsGet(paramsClone)
1080
- };
1081
- return this.session.getBaseUrl().pipe(mergeMap(v => {
1082
- if (v) {
1083
- return this.http.get(this.prepareBaseAddress(v) + url, options);
1084
- }
1085
- return throwError(() => 'get base url error');
1086
- }));
1087
- }
1088
- else {
1089
- this.snackBar.error('Error: Auth not get');
1090
- return throwError(() => 'auth not get');
1004
+ let auth = this.session.getAuthParams();
1005
+ if (auth) {
1006
+ if (params === null) {
1007
+ params = {};
1091
1008
  }
1092
- }));
1009
+ const paramsClone = clone(params);
1010
+ paramsClone[this.session.getKeyAuth()] = auth;
1011
+ let options = {
1012
+ params: this.getHttpParamsGet(paramsClone)
1013
+ };
1014
+ return this.session.getBaseUrl().pipe(mergeMap(v => {
1015
+ if (v) {
1016
+ return this.http.get(this.prepareBaseAddress(v) + url, options);
1017
+ }
1018
+ return throwError(() => 'get base url error');
1019
+ }));
1020
+ }
1021
+ else {
1022
+ this.snackBar.error('Error: Auth not get');
1023
+ return throwError(() => 'auth not get');
1024
+ }
1093
1025
  }
1094
1026
  }
1095
- HttpServices.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HttpServices, deps: [{ token: i1$3.HttpClient }, { token: SnackBarService }, { token: SessionKeyServices }], target: i0.ɵɵFactoryTarget.Injectable });
1027
+ HttpServices.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HttpServices, deps: [{ token: i1$2.HttpClient }, { token: SnackBarService }, { token: SessionKeyServices }], target: i0.ɵɵFactoryTarget.Injectable });
1096
1028
  HttpServices.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HttpServices, providedIn: 'root' });
1097
1029
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HttpServices, decorators: [{
1098
1030
  type: Injectable,
1099
1031
  args: [{
1100
1032
  providedIn: 'root'
1101
1033
  }]
1102
- }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: SnackBarService }, { type: SessionKeyServices }]; } });
1034
+ }], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: SnackBarService }, { type: SessionKeyServices }]; } });
1103
1035
 
1104
1036
  // type TransformFunction<T, R> = (input: T) => R;
1105
1037
  class HttpBXServices extends HttpServices {
@@ -1159,44 +1091,42 @@ class HttpBXServices extends HttpServices {
1159
1091
  return this.httpGet(this.getNameMethod(name), params, settings);
1160
1092
  }
1161
1093
  httpPost(url, params = {}, settings = this.defSettings) {
1162
- return this.session.getAuthParams().pipe(mergeMap(auth => {
1163
- if (auth) {
1164
- const paramsClone = clone(params);
1165
- paramsClone[this.session.getKeyAuth()] = auth;
1166
- return this.session.getBaseUrl().pipe(mergeMap(v => {
1167
- if (v) {
1168
- return this.http.post(this.prepareBaseAddress(v) + url, this.getHttpParamsPost(paramsClone, new FormData(), false, [], settings));
1169
- }
1170
- return throwError(() => 'get base url error');
1171
- }));
1172
- }
1173
- else {
1174
- return throwError(() => 'auth not get');
1175
- }
1176
- }));
1094
+ let auth = this.session.getAuthParams();
1095
+ if (auth) {
1096
+ const paramsClone = clone(params);
1097
+ paramsClone[this.session.getKeyAuth()] = auth;
1098
+ return this.session.getBaseUrl().pipe(mergeMap(v => {
1099
+ if (v) {
1100
+ return this.http.post(this.prepareBaseAddress(v) + url, this.getHttpParamsPost(paramsClone, new FormData(), false, [], settings));
1101
+ }
1102
+ return throwError(() => 'get base url error');
1103
+ }));
1104
+ }
1105
+ else {
1106
+ return throwError(() => 'auth not get');
1107
+ }
1177
1108
  }
1178
1109
  httpGet(url, params = {}, settings = this.defSettings) {
1179
- return this.session.getAuthParams().pipe(mergeMap(auth => {
1180
- if (auth) {
1181
- if (params === null) {
1182
- params = {};
1183
- }
1184
- const paramsClone = clone(params);
1185
- paramsClone[this.session.getKeyAuth()] = auth;
1186
- let options = {
1187
- params: this.getHttpParamsGet(paramsClone)
1188
- };
1189
- return this.session.getBaseUrl().pipe(mergeMap(v => {
1190
- if (v) {
1191
- return this.http.get(this.prepareBaseAddress(v) + url, options);
1192
- }
1193
- return throwError(() => 'get base url error');
1194
- }));
1110
+ let auth = this.session.getAuthParams();
1111
+ if (auth) {
1112
+ if (params === null) {
1113
+ params = {};
1195
1114
  }
1196
- else {
1197
- return throwError(() => 'auth not get');
1198
- }
1199
- }));
1115
+ const paramsClone = clone(params);
1116
+ paramsClone[this.session.getKeyAuth()] = auth;
1117
+ let options = {
1118
+ params: this.getHttpParamsGet(paramsClone)
1119
+ };
1120
+ return this.session.getBaseUrl().pipe(mergeMap(v => {
1121
+ if (v) {
1122
+ return this.http.get(this.prepareBaseAddress(v) + url, options);
1123
+ }
1124
+ return throwError(() => 'get base url error');
1125
+ }));
1126
+ }
1127
+ else {
1128
+ return throwError(() => 'auth not get');
1129
+ }
1200
1130
  }
1201
1131
  getNameMethod(arr) {
1202
1132
  return arr.join('.');
@@ -1211,157 +1141,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1211
1141
  }]
1212
1142
  }] });
1213
1143
 
1214
- class BXRestListsElement {
1215
- constructor(http) {
1216
- this.http = http;
1217
- this.url = {
1218
- add: [$lists, $element, $add],
1219
- delete: [$lists, $element, $delete],
1220
- get: [$lists, $element, $get],
1221
- update: [$lists, $element, $update],
1222
- getFileUrl: [$lists, $element, $get, $file, $url] // Метод возвращает путь к файлу
1223
- };
1224
- }
1225
- get(pram) {
1226
- return this.http.post(this.url.get, pram);
1227
- }
1228
- customPipe() {
1229
- }
1230
- }
1231
- BXRestListsElement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestListsElement, deps: [{ token: HttpBXServices }], target: i0.ɵɵFactoryTarget.Injectable });
1232
- BXRestListsElement.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestListsElement, providedIn: 'root' });
1233
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestListsElement, decorators: [{
1234
- type: Injectable,
1235
- args: [{
1236
- providedIn: 'root'
1237
- }]
1238
- }], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
1239
-
1240
- class BXRestLists {
1241
- constructor(element) {
1242
- this.element = element;
1243
- this.url = {
1244
- add: [$lists, $add],
1245
- delete: [$lists, $delete],
1246
- get: [$lists, $get],
1247
- update: [$lists, $update],
1248
- getIblockTypeId: [$lists, $get, $iblock, $type, $id], // Метод возвращает id типа инфоблока
1249
- };
1250
- }
1251
- }
1252
- BXRestLists.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestLists, deps: [{ token: BXRestListsElement }], target: i0.ɵɵFactoryTarget.Injectable });
1253
- BXRestLists.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestLists, providedIn: 'root' });
1254
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestLists, decorators: [{
1255
- type: Injectable,
1256
- args: [{
1257
- providedIn: 'root'
1258
- }]
1259
- }], ctorParameters: function () { return [{ type: BXRestListsElement }]; } });
1260
-
1261
- class BaseMapServices extends BaseServices {
1262
- }
1263
- BaseMapServices.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseMapServices, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1264
- BaseMapServices.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseMapServices, providedIn: 'root' });
1265
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseMapServices, decorators: [{
1266
- type: Injectable,
1267
- args: [{
1268
- providedIn: 'root'
1269
- }]
1270
- }] });
1271
-
1272
- class BXRestMapListsElement extends BaseMapServices {
1273
- get(items) {
1274
- return items.map(item => Object.assign(item, {
1275
- BP_PUBLISHED: item.BP_PUBLISHED === 'Y',
1276
- CREATED_BY: this.toNum(item.CREATED_BY),
1277
- IBLOCK_ID: this.toNum(item.IBLOCK_ID),
1278
- ID: this.toNum(item.ID)
1279
- }));
1280
- }
1281
- }
1282
- BXRestMapListsElement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapListsElement, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1283
- BXRestMapListsElement.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapListsElement, providedIn: 'root' });
1284
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapListsElement, decorators: [{
1285
- type: Injectable,
1286
- args: [{
1287
- providedIn: 'root'
1288
- }]
1289
- }] });
1290
-
1291
- class BXRestMapLists extends BaseMapServices {
1292
- constructor(element) {
1293
- super();
1294
- this.element = element;
1295
- }
1296
- }
1297
- BXRestMapLists.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapLists, deps: [{ token: BXRestMapListsElement }], target: i0.ɵɵFactoryTarget.Injectable });
1298
- BXRestMapLists.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapLists, providedIn: 'root' });
1299
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapLists, decorators: [{
1300
- type: Injectable,
1301
- args: [{
1302
- providedIn: 'root'
1303
- }]
1304
- }], ctorParameters: function () { return [{ type: BXRestMapListsElement }]; } });
1305
-
1306
- class Navvy {
1307
- constructor(snackBar) {
1308
- this.snackBar = snackBar;
1309
- }
1310
- mapAndSnackBarError(request, errorText) {
1311
- return request.pipe(map(v => BXRestMapResult(v)), catchError(err => {
1312
- this.snackBar.error(errorText);
1313
- return throwError(() => err);
1314
- }));
1315
- }
1316
- }
1317
- Navvy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: Navvy, deps: [{ token: SnackBarService }], target: i0.ɵɵFactoryTarget.Injectable });
1318
- Navvy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: Navvy, providedIn: 'root' });
1319
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: Navvy, decorators: [{
1320
- type: Injectable,
1321
- args: [{
1322
- providedIn: 'root'
1323
- }]
1324
- }], ctorParameters: function () { return [{ type: SnackBarService }]; } });
1325
-
1326
- class BXRestNavvyListsElement {
1327
- constructor(BXRestListsElement, BXRestMap, Navvy) {
1328
- this.BXRestListsElement = BXRestListsElement;
1329
- this.BXRestMap = BXRestMap;
1330
- this.Navvy = Navvy;
1331
- }
1332
- get(pram) {
1333
- return this.Navvy.mapAndSnackBarError(this.BXRestListsElement.get(pram), 'Не удалось получить элемент списка').pipe(map(v => (v) ? this.BXRestMap.get(v) : undefined));
1334
- }
1335
- }
1336
- BXRestNavvyListsElement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyListsElement, deps: [{ token: BXRestListsElement }, { token: BXRestMapListsElement }, { token: Navvy }], target: i0.ɵɵFactoryTarget.Injectable });
1337
- BXRestNavvyListsElement.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyListsElement, providedIn: 'root' });
1338
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyListsElement, decorators: [{
1339
- type: Injectable,
1340
- args: [{
1341
- providedIn: 'root'
1342
- }]
1343
- }], ctorParameters: function () { return [{ type: BXRestListsElement }, { type: BXRestMapListsElement }, { type: Navvy }]; } });
1144
+ const $get = 'get';
1145
+ const $add = 'add';
1146
+ const $set = 'set';
1147
+ const $event = 'event';
1148
+ const $update = 'update';
1149
+ const $user = 'user';
1150
+ const $task = 'task';
1151
+ const $calendar = 'calendar';
1152
+ const $meeting = 'meeting';
1153
+ const $list = 'list';
1154
+ const $search = 'search';
1155
+ const $accessibility = 'accessibility';
1156
+ const $delete = 'delete';
1157
+ const $nearest = 'nearest';
1158
+ const $params = 'params';
1159
+ const $status = 'status';
1160
+ const $resource = 'resource';
1161
+ const $booking = 'booking';
1162
+ const $section = 'section';
1163
+ const $settings = 'settings';
1164
+ const $tasks = 'tasks';
1165
+ const $elapseditem = 'elapseditem';
1166
+ const $getlist = 'getlist';
1167
+ const $approve = 'approve';
1168
+ const $complete = 'complete';
1169
+ const $counters = 'counters';
1170
+ const $deger = 'deger';
1171
+ const $delegate = 'delegate';
1172
+ const $disapprove = 'disapprove';
1173
+ const $favorite = 'favorite';
1174
+ const $files = 'files';
1175
+ const $file = 'file';
1176
+ const $attach = 'attach';
1177
+ const $field = 'field';
1178
+ const $getFields = 'get' + $field + 's';
1179
+ const $getaccess = 'getaccess';
1180
+ const $history = 'history';
1181
+ const $pause = 'pause';
1182
+ const $renew = 'renew';
1183
+ const $start = 'start';
1184
+ const $result = 'result';
1185
+ const $planner = 'planner';
1186
+ const $disk = 'disk';
1187
+ const $rename = 'rename';
1188
+ const $markdeleted = 'markdeleted';
1189
+ const $restore = 'restore';
1190
+ const $folder = 'folder';
1191
+ const $getchildren = 'getchildren';
1192
+ const $copyto = 'copyto';
1193
+ const $moveto = 'moveto';
1194
+ const $uploadfile = 'uploadfile';
1195
+ const $storage = 'storage';
1196
+ const $getTypes = 'getTypes';
1197
+ const $stages = 'stages';
1198
+ const $getmanifest = 'getmanifest';
1199
+ const $isactionallowed = 'isactionallowed';
1200
+ const $commentitem = 'commentitem';
1201
+ const $department = 'department';
1202
+ const $sonet_group = 'sonet_group';
1203
+ const $create = 'create';
1204
+ const $feature = 'feature';
1205
+ const $access = 'access';
1206
+ const $request = 'request';
1207
+ const $socialnetwork = 'socialnetwork';
1208
+ const $api = 'api';
1209
+ const $workgroup = 'workgroup';
1210
+ const $log = 'log';
1211
+ const $blogpost = 'blogpost';
1212
+ const $lists = 'lists';
1213
+ const $iblock = 'iblock';
1214
+ const $type = 'type';
1215
+ const $id = 'id';
1216
+ const $element = 'element';
1217
+ const $url = 'url';
1218
+ const $bizproc = 'bizproc';
1219
+ const $workflow = 'workflow';
1220
+ const $instances = 'instances';
1221
+ const $terminate = '$terminate';
1222
+ const $kill = 'kill';
1223
+ const $template = 'template';
1224
+ const $activity = 'activity';
1225
+ const $robot = 'robot';
1226
+ const $send = 'send';
1227
+ const $share = 'share';
1228
+ const $blogcomment = 'blogcomment';
1344
1229
 
1345
- class BXRestNavvyLists {
1346
- constructor(element) {
1347
- this.element = element;
1348
- this.url = {
1349
- add: [$lists, $add],
1350
- delete: [$lists, $delete],
1351
- get: [$lists, $get],
1352
- update: [$lists, $update],
1353
- getIblockTypeId: [$lists, $get, $iblock, $type, $id], // Метод возвращает id типа инфоблока
1354
- };
1355
- }
1230
+ class BaseMapServices extends BaseServices {
1356
1231
  }
1357
- BXRestNavvyLists.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLists, deps: [{ token: BXRestNavvyListsElement }], target: i0.ɵɵFactoryTarget.Injectable });
1358
- BXRestNavvyLists.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLists, providedIn: 'root' });
1359
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLists, decorators: [{
1232
+ BaseMapServices.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseMapServices, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1233
+ BaseMapServices.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseMapServices, providedIn: 'root' });
1234
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseMapServices, decorators: [{
1360
1235
  type: Injectable,
1361
1236
  args: [{
1362
1237
  providedIn: 'root'
1363
1238
  }]
1364
- }], ctorParameters: function () { return [{ type: BXRestNavvyListsElement }]; } });
1239
+ }] });
1365
1240
 
1366
1241
  class BXRestUserMap extends BaseMapServices {
1367
1242
  current(user) {
@@ -1518,17 +1393,20 @@ class BXRestUser {
1518
1393
  return this.http.get(this.url.fields);
1519
1394
  }
1520
1395
  setDefParam(params) {
1396
+ if (!params.FILTER) {
1397
+ params.FILTER = {};
1398
+ }
1521
1399
  if (!params.hasOwnProperty('ACTIVE')) {
1522
- params.ACTIVE = this.def.params.ACTIVE;
1400
+ params.FILTER.ACTIVE = this.def.params.ACTIVE;
1523
1401
  }
1524
- if (params.ACTIVE && params.ACTIVE === 2) {
1525
- delete params.ACTIVE;
1402
+ if (params.FILTER.ACTIVE && params.FILTER.ACTIVE === 2) {
1403
+ delete params.FILTER.ACTIVE;
1526
1404
  }
1527
1405
  if (!params.hasOwnProperty('start')) {
1528
1406
  params.start = this.def.params.start;
1529
1407
  }
1530
- if (params.UF_DEPARTMENT && !params.UF_DEPARTMENT.length) {
1531
- delete params.UF_DEPARTMENT;
1408
+ if (params.FILTER.UF_DEPARTMENT && !params.FILTER.UF_DEPARTMENT.length) {
1409
+ delete params.FILTER.UF_DEPARTMENT;
1532
1410
  }
1533
1411
  }
1534
1412
  }
@@ -1541,6 +1419,55 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1541
1419
  }]
1542
1420
  }], ctorParameters: function () { return [{ type: HttpBXServices }, { type: BXRestUserMap }]; } });
1543
1421
 
1422
+ class BXRestListsElement {
1423
+ constructor(http) {
1424
+ this.http = http;
1425
+ this.url = {
1426
+ add: [$lists, $element, $add],
1427
+ delete: [$lists, $element, $delete],
1428
+ get: [$lists, $element, $get],
1429
+ update: [$lists, $element, $update],
1430
+ getFileUrl: [$lists, $element, $get, $file, $url] // Метод возвращает путь к файлу // TODO: Реализовать
1431
+ };
1432
+ }
1433
+ get(pram) {
1434
+ return this.http.post(this.url.get, pram);
1435
+ }
1436
+ add(param) {
1437
+ return this.http.post(this.url.add, param);
1438
+ }
1439
+ }
1440
+ BXRestListsElement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestListsElement, deps: [{ token: HttpBXServices }], target: i0.ɵɵFactoryTarget.Injectable });
1441
+ BXRestListsElement.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestListsElement, providedIn: 'root' });
1442
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestListsElement, decorators: [{
1443
+ type: Injectable,
1444
+ args: [{
1445
+ providedIn: 'root'
1446
+ }]
1447
+ }], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
1448
+
1449
+ class BXRestLists {
1450
+ constructor(element) {
1451
+ this.element = element;
1452
+ this.url = {
1453
+ add: [$lists, $add],
1454
+ delete: [$lists, $delete],
1455
+ get: [$lists, $get],
1456
+ update: [$lists, $update],
1457
+ getIblockTypeId: [$lists, $get, $iblock, $type, $id], // Метод возвращает id типа инфоблока
1458
+ };
1459
+ }
1460
+ }
1461
+ BXRestLists.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestLists, deps: [{ token: BXRestListsElement }], target: i0.ɵɵFactoryTarget.Injectable });
1462
+ BXRestLists.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestLists, providedIn: 'root' });
1463
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestLists, decorators: [{
1464
+ type: Injectable,
1465
+ args: [{
1466
+ providedIn: 'root'
1467
+ }]
1468
+ }], ctorParameters: function () { return [{ type: BXRestListsElement }]; } });
1469
+
1470
+ // import { AnswerApiTaskBX } from '../../typification/rest/task/answers/task';
1544
1471
  class BXRestTasksTask {
1545
1472
  constructor(http) {
1546
1473
  this.http = http;
@@ -1588,6 +1515,38 @@ class BXRestTasksTask {
1588
1515
  add(param) {
1589
1516
  return this.http.post(this.url.add, param);
1590
1517
  }
1518
+ /*
1519
+ update(taskId: number, updateFields: iBXRestTaskFieldsName[], task: iBXRestTask) {
1520
+ let sendTask: Record<string, any> = {}
1521
+ let taskTS: Record<string, any> = task
1522
+ if (updateFields.length) {
1523
+ for (let updateField of updateFields) {
1524
+ if (taskTS[camelCase(updateField)]) {
1525
+ sendTask[updateField] = taskTS[camelCase(updateField)]
1526
+ }
1527
+ }
1528
+ if (Object.values(sendTask).length) {
1529
+ return this.http.post(
1530
+ this.url.update,
1531
+ {taskId: taskId, fields: sendTask},
1532
+ 'error to update task')
1533
+ } else {
1534
+ this.snackBar.error('not valid send data task')
1535
+ console.error('not valid send data task', sendTask, task)
1536
+ return of(undefined)
1537
+ }
1538
+ }
1539
+
1540
+ this.snackBar.warning('not have field for update')
1541
+ return of(undefined)
1542
+ }
1543
+ */
1544
+ get(requestArray) {
1545
+ return this.http.post(this.url.get, requestArray);
1546
+ }
1547
+ list(param = {}) {
1548
+ return this.http.post(this.url.list, param);
1549
+ }
1591
1550
  }
1592
1551
  BXRestTasksTask.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestTasksTask, deps: [{ token: HttpBXServices }], target: i0.ɵɵFactoryTarget.Injectable });
1593
1552
  BXRestTasksTask.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestTasksTask, providedIn: 'root' });
@@ -1703,33 +1662,243 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1703
1662
  }]
1704
1663
  }], ctorParameters: function () { return [{ type: BXRestDiskFile }, { type: BXRestDiskFolder }]; } });
1705
1664
 
1706
- class SessionStorageServices {
1707
- setItem(name, value) {
1708
- sessionStorage.setItem(name, JSON.stringify(value));
1665
+ class BXRestBizprocWorkflowInstance {
1666
+ constructor() {
1667
+ this.url = {
1668
+ list: [$bizproc, $workflow, $instances, $list], // Возвращает список запущенных бизнес-процессов. Алиас bizproc.workflow.instances
1669
+ };
1709
1670
  }
1710
- getItem(name) {
1711
- const res = sessionStorage.getItem(name);
1712
- if (res) {
1713
- return JSON.parse(res);
1714
- }
1715
- return undefined;
1671
+ }
1672
+ BXRestBizprocWorkflowInstance.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocWorkflowInstance, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1673
+ BXRestBizprocWorkflowInstance.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocWorkflowInstance, providedIn: 'root' });
1674
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocWorkflowInstance, decorators: [{
1675
+ type: Injectable,
1676
+ args: [{
1677
+ providedIn: 'root'
1678
+ }]
1679
+ }] });
1680
+
1681
+ class BXRestBizprocWorkflowTemplate {
1682
+ constructor(http) {
1683
+ this.http = http;
1684
+ this.url = {
1685
+ add: [$bizproc, $workflow, $template, $add],
1686
+ delete: [$bizproc, $workflow, $template, $delete],
1687
+ update: [$bizproc, $workflow, $template, $update],
1688
+ list: [$bizproc, $workflow, $template, $list] // Возвращает список шаблонов Бизнес-процессов, установленных на сайте
1689
+ };
1690
+ }
1691
+ list(param = { select: [], filter: {} }) {
1692
+ return this.http.post(this.url.list, param);
1693
+ }
1694
+ }
1695
+ BXRestBizprocWorkflowTemplate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocWorkflowTemplate, deps: [{ token: HttpBXServices }], target: i0.ɵɵFactoryTarget.Injectable });
1696
+ BXRestBizprocWorkflowTemplate.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocWorkflowTemplate, providedIn: 'root' });
1697
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocWorkflowTemplate, decorators: [{
1698
+ type: Injectable,
1699
+ args: [{
1700
+ providedIn: 'root'
1701
+ }]
1702
+ }], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
1703
+
1704
+ class BXRestBizprocWorkflow {
1705
+ constructor(instances, template, http) {
1706
+ this.instances = instances;
1707
+ this.template = template;
1708
+ this.http = http;
1709
+ this.url = {
1710
+ instances: [$bizproc, $workflow, $instances],
1711
+ terminate: [$bizproc, $workflow, $terminate],
1712
+ start: [$bizproc, $workflow, $start],
1713
+ kill: [$bizproc, $workflow, $kill], // Удаляет запущенный бизнес-процесс // TODO: реализовать
1714
+ };
1715
+ }
1716
+ start(param) {
1717
+ return this.http.post(this.url.start, param);
1718
+ }
1719
+ }
1720
+ BXRestBizprocWorkflow.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocWorkflow, deps: [{ token: BXRestBizprocWorkflowInstance }, { token: BXRestBizprocWorkflowTemplate }, { token: HttpBXServices }], target: i0.ɵɵFactoryTarget.Injectable });
1721
+ BXRestBizprocWorkflow.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocWorkflow, providedIn: 'root' });
1722
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocWorkflow, decorators: [{
1723
+ type: Injectable,
1724
+ args: [{
1725
+ providedIn: 'root'
1726
+ }]
1727
+ }], ctorParameters: function () { return [{ type: BXRestBizprocWorkflowInstance }, { type: BXRestBizprocWorkflowTemplate }, { type: HttpBXServices }]; } });
1728
+
1729
+ class BXRestBizprocActivity {
1730
+ constructor() {
1731
+ this.url = {
1732
+ add: [$bizproc, $activity, $add],
1733
+ delete: [$bizproc, $activity, $delete],
1734
+ list: [$bizproc, $activity, $list],
1735
+ update: [$bizproc, $activity, $update],
1736
+ log: [$bizproc, $activity, $log] // Записывает информацию в лог бизнес-процесса
1737
+ };
1738
+ }
1739
+ }
1740
+ BXRestBizprocActivity.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1741
+ BXRestBizprocActivity.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocActivity, providedIn: 'root' });
1742
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocActivity, decorators: [{
1743
+ type: Injectable,
1744
+ args: [{
1745
+ providedIn: 'root'
1746
+ }]
1747
+ }] });
1748
+
1749
+ class BXRestBizprocTask {
1750
+ constructor() {
1751
+ this.url = {
1752
+ complete: [$bizproc, $task, $complete],
1753
+ list: [$bizproc, $task, $list], // Возвращает список заданий бизнес-процессов
1754
+ };
1755
+ }
1756
+ }
1757
+ BXRestBizprocTask.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocTask, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1758
+ BXRestBizprocTask.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocTask, providedIn: 'root' });
1759
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocTask, decorators: [{
1760
+ type: Injectable,
1761
+ args: [{
1762
+ providedIn: 'root'
1763
+ }]
1764
+ }] });
1765
+
1766
+ class BXRestBizprocRobot {
1767
+ constructor() {
1768
+ this.url = {
1769
+ add: [$bizproc, $robot, $add],
1770
+ delete: [$bizproc, $robot, $delete],
1771
+ list: [$bizproc, $robot, $list],
1772
+ update: [$bizproc, $robot, $update] // Обновляет поля робота
1773
+ };
1774
+ }
1775
+ }
1776
+ BXRestBizprocRobot.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocRobot, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1777
+ BXRestBizprocRobot.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocRobot, providedIn: 'root' });
1778
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocRobot, decorators: [{
1779
+ type: Injectable,
1780
+ args: [{
1781
+ providedIn: 'root'
1782
+ }]
1783
+ }] });
1784
+
1785
+ class BXRestBizprocEvent {
1786
+ constructor() {
1787
+ this.url = {
1788
+ send: [$bizproc, $event, $send], // Возвращает действию выходные параметры, заданные в описании действия
1789
+ };
1716
1790
  }
1717
1791
  }
1718
- SessionStorageServices.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SessionStorageServices, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1719
- SessionStorageServices.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SessionStorageServices, providedIn: 'root' });
1720
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SessionStorageServices, decorators: [{
1792
+ BXRestBizprocEvent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocEvent, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1793
+ BXRestBizprocEvent.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocEvent, providedIn: 'root' });
1794
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizprocEvent, decorators: [{
1721
1795
  type: Injectable,
1722
1796
  args: [{
1723
1797
  providedIn: 'root'
1724
1798
  }]
1725
1799
  }] });
1726
1800
 
1801
+ class BXRestBizproc {
1802
+ constructor(workflow, activity, task, robot, event) {
1803
+ this.workflow = workflow;
1804
+ this.activity = activity;
1805
+ this.task = task;
1806
+ this.robot = robot;
1807
+ this.event = event;
1808
+ }
1809
+ }
1810
+ BXRestBizproc.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizproc, deps: [{ token: BXRestBizprocWorkflow }, { token: BXRestBizprocActivity }, { token: BXRestBizprocTask }, { token: BXRestBizprocRobot }, { token: BXRestBizprocEvent }], target: i0.ɵɵFactoryTarget.Injectable });
1811
+ BXRestBizproc.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizproc, providedIn: 'root' });
1812
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestBizproc, decorators: [{
1813
+ type: Injectable,
1814
+ args: [{
1815
+ providedIn: 'root'
1816
+ }]
1817
+ }], ctorParameters: function () { return [{ type: BXRestBizprocWorkflow }, { type: BXRestBizprocActivity }, { type: BXRestBizprocTask }, { type: BXRestBizprocRobot }, { type: BXRestBizprocEvent }]; } });
1818
+
1819
+ class BXRestLogBlogPost {
1820
+ constructor(http) {
1821
+ this.http = http;
1822
+ this.url = {
1823
+ add: [$log, $blogpost, $add],
1824
+ // getusers: {
1825
+ // important: 'log.blogpost.getusers.important' // Отдает массив ID пользователей, прочитавших Важное сообщение
1826
+ // },
1827
+ get: [$log, $blogpost, $get],
1828
+ delete: [$log, $blogpost, $delete],
1829
+ share: [$log, $blogpost, $share],
1830
+ update: [$log, $blogpost, $update], // Изменяет сообщение Живой Ленты
1831
+ };
1832
+ }
1833
+ add(param) {
1834
+ return this.http.post(this.url.add, param);
1835
+ }
1836
+ }
1837
+ BXRestLogBlogPost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestLogBlogPost, deps: [{ token: HttpBXServices }], target: i0.ɵɵFactoryTarget.Injectable });
1838
+ BXRestLogBlogPost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestLogBlogPost, providedIn: 'root' });
1839
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestLogBlogPost, decorators: [{
1840
+ type: Injectable,
1841
+ args: [{
1842
+ providedIn: 'root'
1843
+ }]
1844
+ }], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
1845
+
1846
+ class BXRestLogBlogComment {
1847
+ constructor() {
1848
+ this.url = {
1849
+ add: [$log, $blogcomment, $add], // Добавляет комментарий к сообщению Живой ленты
1850
+ };
1851
+ }
1852
+ }
1853
+ BXRestLogBlogComment.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestLogBlogComment, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1854
+ BXRestLogBlogComment.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestLogBlogComment, providedIn: 'root' });
1855
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestLogBlogComment, decorators: [{
1856
+ type: Injectable,
1857
+ args: [{
1858
+ providedIn: 'root'
1859
+ }]
1860
+ }] });
1861
+
1862
+ class BXRestLog {
1863
+ constructor(blogPost, blogComment) {
1864
+ this.blogPost = blogPost;
1865
+ this.blogComment = blogComment;
1866
+ }
1867
+ }
1868
+ BXRestLog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestLog, deps: [{ token: BXRestLogBlogPost }, { token: BXRestLogBlogComment }], target: i0.ɵɵFactoryTarget.Injectable });
1869
+ BXRestLog.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestLog, providedIn: 'root' });
1870
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestLog, decorators: [{
1871
+ type: Injectable,
1872
+ args: [{
1873
+ providedIn: 'root'
1874
+ }]
1875
+ }], ctorParameters: function () { return [{ type: BXRestLogBlogPost }, { type: BXRestLogBlogComment }]; } });
1876
+
1877
+ class Navvy {
1878
+ constructor(snackBar) {
1879
+ this.snackBar = snackBar;
1880
+ }
1881
+ mapAndSnackBarError(request, errorText) {
1882
+ return request.pipe(map(v => BXRestMapResult(v)), catchError(err => {
1883
+ this.snackBar.error(errorText);
1884
+ return throwError(() => err);
1885
+ }));
1886
+ }
1887
+ }
1888
+ Navvy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: Navvy, deps: [{ token: SnackBarService }], target: i0.ɵɵFactoryTarget.Injectable });
1889
+ Navvy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: Navvy, providedIn: 'root' });
1890
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: Navvy, decorators: [{
1891
+ type: Injectable,
1892
+ args: [{
1893
+ providedIn: 'root'
1894
+ }]
1895
+ }], ctorParameters: function () { return [{ type: SnackBarService }]; } });
1896
+
1727
1897
  class BXRestNavvyUser {
1728
- constructor(BXRestUser, BXRestUserMap, Navvy, SessionStorage) {
1898
+ constructor(BXRestUser, BXRestUserMap, Navvy) {
1729
1899
  this.BXRestUser = BXRestUser;
1730
1900
  this.BXRestUserMap = BXRestUserMap;
1731
1901
  this.Navvy = Navvy;
1732
- this.SessionStorage = SessionStorage;
1733
1902
  }
1734
1903
  get(params = {}) {
1735
1904
  return this.Navvy.mapAndSnackBarError(this.BXRestUser.get(params), 'Не удалось получить пользователей');
@@ -1739,7 +1908,7 @@ class BXRestNavvyUser {
1739
1908
  return this.self();
1740
1909
  }
1741
1910
  else {
1742
- let self = this.SessionStorage.getItem(this.constructor.name + this.self.name);
1911
+ let self = SessionStorage.getItem(this.constructor.name + this.self.name);
1743
1912
  if (self) {
1744
1913
  return of(self);
1745
1914
  }
@@ -1758,7 +1927,7 @@ class BXRestNavvyUser {
1758
1927
  return undefined;
1759
1928
  }), tap(v => {
1760
1929
  if (v) {
1761
- this.SessionStorage.setItem(this.constructor.name + this.self.name, v);
1930
+ SessionStorage.setItem(this.constructor.name + this.self.name, v);
1762
1931
  }
1763
1932
  }));
1764
1933
  }
@@ -1772,16 +1941,80 @@ class BXRestNavvyUser {
1772
1941
  return this.Navvy.mapAndSnackBarError(this.BXRestUser.fields(), 'Не удалось поля');
1773
1942
  }
1774
1943
  }
1775
- BXRestNavvyUser.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyUser, deps: [{ token: BXRestUser }, { token: BXRestUserMap }, { token: Navvy }, { token: SessionStorageServices }], target: i0.ɵɵFactoryTarget.Injectable });
1944
+ BXRestNavvyUser.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyUser, deps: [{ token: BXRestUser }, { token: BXRestUserMap }, { token: Navvy }], target: i0.ɵɵFactoryTarget.Injectable });
1776
1945
  BXRestNavvyUser.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyUser, providedIn: 'root' });
1777
1946
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyUser, decorators: [{
1778
1947
  type: Injectable,
1779
1948
  args: [{
1780
1949
  providedIn: 'root'
1781
1950
  }]
1782
- }], ctorParameters: function () { return [{ type: BXRestUser }, { type: BXRestUserMap }, { type: Navvy }, { type: SessionStorageServices }]; } });
1951
+ }], ctorParameters: function () { return [{ type: BXRestUser }, { type: BXRestUserMap }, { type: Navvy }]; } });
1952
+
1953
+ class BXRestMapListsElement extends BaseMapServices {
1954
+ get(items) {
1955
+ return items.map(item => Object.assign(item, {
1956
+ BP_PUBLISHED: item.BP_PUBLISHED === 'Y',
1957
+ CREATED_BY: this.toNum(item.CREATED_BY),
1958
+ IBLOCK_ID: this.toNum(item.IBLOCK_ID),
1959
+ ID: this.toNum(item.ID)
1960
+ }));
1961
+ }
1962
+ }
1963
+ BXRestMapListsElement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapListsElement, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1964
+ BXRestMapListsElement.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapListsElement, providedIn: 'root' });
1965
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapListsElement, decorators: [{
1966
+ type: Injectable,
1967
+ args: [{
1968
+ providedIn: 'root'
1969
+ }]
1970
+ }] });
1971
+
1972
+ class BXRestNavvyListsElement {
1973
+ constructor(BXRestListsElement, BXRestMap, Navvy) {
1974
+ this.BXRestListsElement = BXRestListsElement;
1975
+ this.BXRestMap = BXRestMap;
1976
+ this.Navvy = Navvy;
1977
+ }
1978
+ get(param) {
1979
+ return this.Navvy.mapAndSnackBarError(this.BXRestListsElement.get(param), 'Не удалось получить элемент списка').pipe(map(v => (v) ? this.BXRestMap.get(v) : undefined));
1980
+ }
1981
+ add(param) {
1982
+ return this.Navvy.mapAndSnackBarError(this.BXRestListsElement.add(param), 'Не удалось получить элемент списка');
1983
+ }
1984
+ }
1985
+ BXRestNavvyListsElement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyListsElement, deps: [{ token: BXRestListsElement }, { token: BXRestMapListsElement }, { token: Navvy }], target: i0.ɵɵFactoryTarget.Injectable });
1986
+ BXRestNavvyListsElement.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyListsElement, providedIn: 'root' });
1987
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyListsElement, decorators: [{
1988
+ type: Injectable,
1989
+ args: [{
1990
+ providedIn: 'root'
1991
+ }]
1992
+ }], ctorParameters: function () { return [{ type: BXRestListsElement }, { type: BXRestMapListsElement }, { type: Navvy }]; } });
1993
+
1994
+ class BXRestNavvyLists {
1995
+ constructor(element) {
1996
+ this.element = element;
1997
+ }
1998
+ }
1999
+ BXRestNavvyLists.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLists, deps: [{ token: BXRestNavvyListsElement }], target: i0.ɵɵFactoryTarget.Injectable });
2000
+ BXRestNavvyLists.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLists, providedIn: 'root' });
2001
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLists, decorators: [{
2002
+ type: Injectable,
2003
+ args: [{
2004
+ providedIn: 'root'
2005
+ }]
2006
+ }], ctorParameters: function () { return [{ type: BXRestNavvyListsElement }]; } });
1783
2007
 
1784
2008
  class BXRestTaskMap extends BaseMapServices {
2009
+ add(item) {
2010
+ return this.TaskBXHttpToTaskBX(item);
2011
+ }
2012
+ get(item) {
2013
+ return this.TaskBXHttpToTaskBX(item);
2014
+ }
2015
+ list(item) {
2016
+ return item.map(i => this.TaskBXHttpToTaskBX(i));
2017
+ }
1785
2018
  TaskBXHttpToTaskBX(item) {
1786
2019
  let result = {};
1787
2020
  if (item.id) {
@@ -1898,23 +2131,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1898
2131
  // next: number
1899
2132
  // }
1900
2133
  class BXRestNavvyTasksTask {
1901
- // pageSize = 50
1902
- // nowLoad$ = new ReplaySubject<TimeProcess>(1)
1903
- // def: { select: iBXRestTaskFieldsName[] } = {
1904
- // select: ['ID', 'PARENT_ID', 'TITLE', 'DESCRIPTION', 'MARK', 'PRIORITY', 'STATUS', 'MULTITASK',
1905
- // 'GROUP_ID', 'STAGE_ID', 'CREATED_BY', 'CREATED_DATE', 'RESPONSIBLE_ID', 'ACCOMPLICES', 'AUDITORS',
1906
- // 'CHANGED_BY', 'CHANGED_DATE', 'STATUS_CHANGED_DATE', 'CLOSED_BY', 'CLOSED_DATE', 'DATE_START', 'VIEWED_DATE',
1907
- // 'DEADLINE', 'START_DATE_PLAN', 'END_DATE_PLAN', 'FORKED_BY_TEMPLATE_ID', 'TIME_ESTIMATE', 'TIME_SPENT_IN_LOGS',
1908
- // 'TAGS', 'ALLOW_TIME_TRACKING'
1909
- // ]
1910
- // }
1911
2134
  // storeTask$: Observable<iStoreTask>
1912
- constructor(BXRestTasks, snackBar,
2135
+ constructor(BXRestTasksTask, snackBar,
1913
2136
  // private store: Store<{ tasks: IStoreTask }>,
1914
- taskMap) {
1915
- this.BXRestTasks = BXRestTasks;
2137
+ taskMap,
2138
+ // private taskResultMap: BitrixApiTaskResultMapServices
2139
+ Navvy) {
2140
+ this.BXRestTasksTask = BXRestTasksTask;
1916
2141
  this.snackBar = snackBar;
1917
2142
  this.taskMap = taskMap;
2143
+ this.Navvy = Navvy;
2144
+ // pageSize = 50
2145
+ // nowLoad$ = new ReplaySubject<TimeProcess>(1)
2146
+ this.def = {
2147
+ select: ['ID', 'PARENT_ID', 'TITLE', 'DESCRIPTION', 'MARK', 'PRIORITY', 'STATUS', 'MULTITASK',
2148
+ 'GROUP_ID', 'STAGE_ID', 'CREATED_BY', 'CREATED_DATE', 'RESPONSIBLE_ID', 'ACCOMPLICES', 'AUDITORS',
2149
+ 'CHANGED_BY', 'CHANGED_DATE', 'STATUS_CHANGED_DATE', 'CLOSED_BY', 'CLOSED_DATE', 'DATE_START', 'VIEWED_DATE',
2150
+ 'DEADLINE', 'START_DATE_PLAN', 'END_DATE_PLAN', 'FORKED_BY_TEMPLATE_ID', 'TIME_ESTIMATE', 'TIME_SPENT_IN_LOGS',
2151
+ 'TAGS', 'ALLOW_TIME_TRACKING'
2152
+ ]
2153
+ };
1918
2154
  // this.storeTask$ = this.store.select('tasks')
1919
2155
  // this.nowLoad$.next({
1920
2156
  // total: 0,
@@ -1922,9 +2158,9 @@ class BXRestNavvyTasksTask {
1922
2158
  // })
1923
2159
  }
1924
2160
  add(param) {
1925
- return this.BXRestTasks.add(param).pipe(map(v => {
1926
- if (v && v.result && v.result.task) {
1927
- return this.taskMap.TaskBXHttpToTaskBX(v.result.task);
2161
+ return this.Navvy.mapAndSnackBarError(this.BXRestTasksTask.add(param), 'Не удалось получить задачу').pipe(map(v => {
2162
+ if (v && v.task) {
2163
+ return this.taskMap.add(v.task);
1928
2164
  }
1929
2165
  return undefined;
1930
2166
  }));
@@ -1941,15 +2177,57 @@ class BXRestNavvyTasksTask {
1941
2177
  // }
1942
2178
  // ))
1943
2179
  }
2180
+ /*
2181
+ update(taskId: number, updateFields: iBXRestTaskFieldsName[], task: iBXRestTask) {
2182
+ let sendTask: Record<string, any> = {}
2183
+ let taskTS: Record<string, any> = task
2184
+ if (updateFields.length) {
2185
+ for (let updateField of updateFields) {
2186
+ if (taskTS[camelCase(updateField)]) {
2187
+ sendTask[updateField] = taskTS[camelCase(updateField)]
2188
+ }
2189
+ }
2190
+ if (Object.values(sendTask).length) {
2191
+ return this.http.post(
2192
+ this.url.update,
2193
+ {taskId: taskId, fields: sendTask},
2194
+ 'error to update task')
2195
+ } else {
2196
+ this.snackBar.error('not valid send data task')
2197
+ console.error('not valid send data task', sendTask, task)
2198
+ return of(undefined)
2199
+ }
2200
+ }
2201
+
2202
+ this.snackBar.warning('not have field for update')
2203
+ return of(undefined)
2204
+ }
2205
+ */
2206
+ get(requestArray) {
2207
+ if (!requestArray.select) {
2208
+ requestArray.select = this.def.select;
2209
+ }
2210
+ return this.Navvy.mapAndSnackBarError(this.BXRestTasksTask.get(requestArray), 'Не удалось получить задачу').pipe(map(v => (v && v.task) ? v.task : undefined), map(v => (v) ? this.taskMap.get(v) : undefined));
2211
+ }
2212
+ list(param = {}) {
2213
+ if (!param.select) {
2214
+ param.select = this.def.select;
2215
+ }
2216
+ return this.Navvy.mapAndSnackBarError(this.BXRestTasksTask.list(param), 'Не удалось получить задачи').pipe(map(v => (v && v.tasks) ? v.tasks : undefined), map(v => (v) ? this.taskMap.list(v) : undefined), tap(v => {
2217
+ if (v) {
2218
+ SessionStorage.setItem(this.constructor.name + this.list.name, v);
2219
+ }
2220
+ }));
2221
+ }
1944
2222
  }
1945
- BXRestNavvyTasksTask.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyTasksTask, deps: [{ token: BXRestTasksTask }, { token: SnackBarService }, { token: BXRestTaskMap }], target: i0.ɵɵFactoryTarget.Injectable });
2223
+ BXRestNavvyTasksTask.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyTasksTask, deps: [{ token: BXRestTasksTask }, { token: SnackBarService }, { token: BXRestTaskMap }, { token: Navvy }], target: i0.ɵɵFactoryTarget.Injectable });
1946
2224
  BXRestNavvyTasksTask.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyTasksTask, providedIn: 'root' });
1947
2225
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyTasksTask, decorators: [{
1948
2226
  type: Injectable,
1949
2227
  args: [{
1950
2228
  providedIn: 'root'
1951
2229
  }]
1952
- }], ctorParameters: function () { return [{ type: BXRestTasksTask }, { type: SnackBarService }, { type: BXRestTaskMap }]; } });
2230
+ }], ctorParameters: function () { return [{ type: BXRestTasksTask }, { type: SnackBarService }, { type: BXRestTaskMap }, { type: Navvy }]; } });
1953
2231
 
1954
2232
  class BXRestNavvyTasks {
1955
2233
  constructor(task) {
@@ -2162,24 +2440,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2162
2440
 
2163
2441
  class BXRestNavvyDiskStorage {
2164
2442
  // BXDiskFolder$ = new Observable<BXDiskFolderStore>()
2165
- constructor(BXRestDiskStorage, BXRestMapDiskStorage, Navvy, SessionStorage
2166
- // private store: Store<{ BXDiskFolder: BXDiskFolderStore }>,
2167
- ) {
2443
+ constructor(BXRestDiskStorage, BXRestMapDiskStorage, Navvy) {
2168
2444
  this.BXRestDiskStorage = BXRestDiskStorage;
2169
2445
  this.BXRestMapDiskStorage = BXRestMapDiskStorage;
2170
2446
  this.Navvy = Navvy;
2171
- this.SessionStorage = SessionStorage;
2172
2447
  // this.BXDiskFolder$ = this.store.select('BXDiskFolder')
2173
2448
  }
2174
2449
  getforapp() {
2175
- let res = this.SessionStorage.getItem(this.constructor.name + this.getforapp.name);
2450
+ let res = SessionStorage.getItem(this.constructor.name + this.getforapp.name);
2176
2451
  if (res) {
2177
2452
  return of(res);
2178
2453
  }
2179
2454
  else {
2180
2455
  return this.Navvy.mapAndSnackBarError(this.BXRestDiskStorage.getforapp(), 'get root app folder').pipe(tap(v => {
2181
2456
  if (v) {
2182
- this.SessionStorage.setItem(this.constructor.name + this.getforapp.name, v);
2457
+ SessionStorage.setItem(this.constructor.name + this.getforapp.name, v);
2183
2458
  }
2184
2459
  }));
2185
2460
  }
@@ -2201,14 +2476,14 @@ class BXRestNavvyDiskStorage {
2201
2476
  return this.BXRestDiskStorage.uploadfile(param);
2202
2477
  }
2203
2478
  }
2204
- BXRestNavvyDiskStorage.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyDiskStorage, deps: [{ token: BXRestDiskStorage }, { token: BXRestMapDiskStorage }, { token: Navvy }, { token: SessionStorageServices }], target: i0.ɵɵFactoryTarget.Injectable });
2479
+ BXRestNavvyDiskStorage.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyDiskStorage, deps: [{ token: BXRestDiskStorage }, { token: BXRestMapDiskStorage }, { token: Navvy }], target: i0.ɵɵFactoryTarget.Injectable });
2205
2480
  BXRestNavvyDiskStorage.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyDiskStorage, providedIn: 'root' });
2206
2481
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyDiskStorage, decorators: [{
2207
2482
  type: Injectable,
2208
2483
  args: [{
2209
2484
  providedIn: 'root'
2210
2485
  }]
2211
- }], ctorParameters: function () { return [{ type: BXRestDiskStorage }, { type: BXRestMapDiskStorage }, { type: Navvy }, { type: SessionStorageServices }]; } });
2486
+ }], ctorParameters: function () { return [{ type: BXRestDiskStorage }, { type: BXRestMapDiskStorage }, { type: Navvy }]; } });
2212
2487
 
2213
2488
  class BXRestNavvyDiskOperation {
2214
2489
  constructor(folder, disk, storage) {
@@ -2218,7 +2493,7 @@ class BXRestNavvyDiskOperation {
2218
2493
  }
2219
2494
  // данные файла в base64
2220
2495
  loadFileInAppFolder(file) {
2221
- return this.storage.getforapp().pipe(take$1(1), mergeMap$1(infoFolder => {
2496
+ return this.storage.getforapp().pipe(take(1), mergeMap$1(infoFolder => {
2222
2497
  if (infoFolder) {
2223
2498
  return this.storage.uploadfile({
2224
2499
  id: infoFolder.ID,
@@ -2313,38 +2588,186 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2313
2588
  }]
2314
2589
  }], ctorParameters: function () { return [{ type: BXRestNavvyDiskFile }, { type: BXRestDiskNavvyFolder }, { type: BXRestNavvyDiskOperation }]; } });
2315
2590
 
2591
+ class BXRestNavvyBizprocWorkflow {
2592
+ constructor(BXRestBizprocWorkflow, Navvy) {
2593
+ this.BXRestBizprocWorkflow = BXRestBizprocWorkflow;
2594
+ this.Navvy = Navvy;
2595
+ }
2596
+ start(param) {
2597
+ return this.Navvy.mapAndSnackBarError(this.BXRestBizprocWorkflow.start(param), 'Не удалось запустить бизнес процесс');
2598
+ }
2599
+ }
2600
+ BXRestNavvyBizprocWorkflow.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyBizprocWorkflow, deps: [{ token: BXRestBizprocWorkflow }, { token: Navvy }], target: i0.ɵɵFactoryTarget.Injectable });
2601
+ BXRestNavvyBizprocWorkflow.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyBizprocWorkflow, providedIn: 'root' });
2602
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyBizprocWorkflow, decorators: [{
2603
+ type: Injectable,
2604
+ args: [{
2605
+ providedIn: 'root'
2606
+ }]
2607
+ }], ctorParameters: function () { return [{ type: BXRestBizprocWorkflow }, { type: Navvy }]; } });
2608
+
2609
+ class BXRestNavvyBizproc {
2610
+ constructor(workflow, BXRestNavvyLists) {
2611
+ this.workflow = workflow;
2612
+ this.BXRestNavvyLists = BXRestNavvyLists;
2613
+ }
2614
+ /**
2615
+ * Метод по запуску бизнес процессов из ленты
2616
+ *
2617
+ * @param id
2618
+ * @param parametersElement
2619
+ * @param parametersBizproc
2620
+ * @param templateIDs
2621
+ */
2622
+ startProcFormNewsFeed(id, parametersElement, parametersBizproc, templateIDs) {
2623
+ return this.BXRestNavvyLists.element.add({
2624
+ IBLOCK_TYPE_ID: 'bitrix_processes',
2625
+ IBLOCK_ID: id,
2626
+ ELEMENT_CODE: 'trace_studio_' + Date.now() + '_' + Math.random(),
2627
+ // тут должно быть уникально значение (генерация уникальных значений на фронте лол),
2628
+ // как ещё уникальнее сделать я просто не знаю
2629
+ // это поле обязательно без него не работает
2630
+ FIELDS: Object.assign({ NAME: parametersElement['NAME'] }, parametersElement)
2631
+ }).pipe(mergeMap(v => {
2632
+ if (v) {
2633
+ if (Object.keys(parametersBizproc).length) {
2634
+ let reques = [];
2635
+ for (let templateID of templateIDs) {
2636
+ reques.push(this.workflow.start({
2637
+ TEMPLATE_ID: templateID,
2638
+ DOCUMENT_ID: ['lists', 'BizprocDocument', String(v)],
2639
+ PARAMETERS: parametersBizproc
2640
+ }));
2641
+ }
2642
+ return forkJoin(reques);
2643
+ }
2644
+ else {
2645
+ return of(true);
2646
+ }
2647
+ }
2648
+ return of(false);
2649
+ }));
2650
+ }
2651
+ }
2652
+ BXRestNavvyBizproc.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyBizproc, deps: [{ token: BXRestNavvyBizprocWorkflow }, { token: BXRestNavvyLists }], target: i0.ɵɵFactoryTarget.Injectable });
2653
+ BXRestNavvyBizproc.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyBizproc, providedIn: 'root' });
2654
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyBizproc, decorators: [{
2655
+ type: Injectable,
2656
+ args: [{
2657
+ providedIn: 'root'
2658
+ }]
2659
+ }], ctorParameters: function () { return [{ type: BXRestNavvyBizprocWorkflow }, { type: BXRestNavvyLists }]; } });
2660
+
2661
+ class BXRestNavvyLogBlogPost {
2662
+ constructor(BXRestLogBlogPost, Navvy) {
2663
+ this.BXRestLogBlogPost = BXRestLogBlogPost;
2664
+ this.Navvy = Navvy;
2665
+ this.url = {
2666
+ add: [$log, $blogpost, $add],
2667
+ // getusers: {
2668
+ // important: 'log.blogpost.getusers.important' // Отдает массив ID пользователей, прочитавших Важное сообщение
2669
+ // },
2670
+ get: [$log, $blogpost, $get],
2671
+ delete: [$log, $blogpost, $delete],
2672
+ share: [$log, $blogpost, $share],
2673
+ update: [$log, $blogpost, $update], // Изменяет сообщение Живой Ленты
2674
+ };
2675
+ }
2676
+ add(param) {
2677
+ return this.Navvy.mapAndSnackBarError(this.BXRestLogBlogPost.add(param), 'При добавлении поста');
2678
+ }
2679
+ }
2680
+ BXRestNavvyLogBlogPost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLogBlogPost, deps: [{ token: BXRestLogBlogPost }, { token: Navvy }], target: i0.ɵɵFactoryTarget.Injectable });
2681
+ BXRestNavvyLogBlogPost.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLogBlogPost, providedIn: 'root' });
2682
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLogBlogPost, decorators: [{
2683
+ type: Injectable,
2684
+ args: [{
2685
+ providedIn: 'root'
2686
+ }]
2687
+ }], ctorParameters: function () { return [{ type: BXRestLogBlogPost }, { type: Navvy }]; } });
2688
+
2689
+ class BXRestNavvyLogBlogComment {
2690
+ constructor() {
2691
+ this.url = {
2692
+ add: [$log, $blogcomment, $add], // Добавляет комментарий к сообщению Живой ленты
2693
+ };
2694
+ }
2695
+ }
2696
+ BXRestNavvyLogBlogComment.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLogBlogComment, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2697
+ BXRestNavvyLogBlogComment.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLogBlogComment, providedIn: 'root' });
2698
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLogBlogComment, decorators: [{
2699
+ type: Injectable,
2700
+ args: [{
2701
+ providedIn: 'root'
2702
+ }]
2703
+ }] });
2704
+
2705
+ class BXRestNavvyLog {
2706
+ constructor(blogPost, blogComment) {
2707
+ this.blogPost = blogPost;
2708
+ this.blogComment = blogComment;
2709
+ }
2710
+ }
2711
+ BXRestNavvyLog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLog, deps: [{ token: BXRestNavvyLogBlogPost }, { token: BXRestNavvyLogBlogComment }], target: i0.ɵɵFactoryTarget.Injectable });
2712
+ BXRestNavvyLog.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLog, providedIn: 'root' });
2713
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLog, decorators: [{
2714
+ type: Injectable,
2715
+ args: [{
2716
+ providedIn: 'root'
2717
+ }]
2718
+ }], ctorParameters: function () { return [{ type: BXRestNavvyLogBlogPost }, { type: BXRestNavvyLogBlogComment }]; } });
2719
+
2720
+ class BXRestMapLists extends BaseMapServices {
2721
+ constructor(element) {
2722
+ super();
2723
+ this.element = element;
2724
+ }
2725
+ }
2726
+ BXRestMapLists.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapLists, deps: [{ token: BXRestMapListsElement }], target: i0.ɵɵFactoryTarget.Injectable });
2727
+ BXRestMapLists.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapLists, providedIn: 'root' });
2728
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapLists, decorators: [{
2729
+ type: Injectable,
2730
+ args: [{
2731
+ providedIn: 'root'
2732
+ }]
2733
+ }], ctorParameters: function () { return [{ type: BXRestMapListsElement }]; } });
2734
+
2316
2735
  class BXRest {
2317
- constructor(user, lists, tasks, disk) {
2736
+ constructor(user, lists, tasks, disk, bizproc, log) {
2318
2737
  this.user = user;
2319
2738
  this.lists = lists;
2320
2739
  this.tasks = tasks;
2321
2740
  this.disk = disk;
2741
+ this.bizproc = bizproc;
2742
+ this.log = log;
2322
2743
  }
2323
2744
  }
2324
- BXRest.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRest, deps: [{ token: BXRestUser }, { token: BXRestLists }, { token: BXRestTasks }, { token: BXRestDisk }], target: i0.ɵɵFactoryTarget.Injectable });
2745
+ BXRest.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRest, deps: [{ token: BXRestUser }, { token: BXRestLists }, { token: BXRestTasks }, { token: BXRestDisk }, { token: BXRestBizproc }, { token: BXRestLog }], target: i0.ɵɵFactoryTarget.Injectable });
2325
2746
  BXRest.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRest, providedIn: 'root' });
2326
2747
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRest, decorators: [{
2327
2748
  type: Injectable,
2328
2749
  args: [{
2329
2750
  providedIn: 'root'
2330
2751
  }]
2331
- }], ctorParameters: function () { return [{ type: BXRestUser }, { type: BXRestLists }, { type: BXRestTasks }, { type: BXRestDisk }]; } });
2752
+ }], ctorParameters: function () { return [{ type: BXRestUser }, { type: BXRestLists }, { type: BXRestTasks }, { type: BXRestDisk }, { type: BXRestBizproc }, { type: BXRestLog }]; } });
2332
2753
  class BXRestNavvy {
2333
- constructor(user, lists, tasks, disk) {
2754
+ constructor(user, lists, tasks, disk, bizproc, log) {
2334
2755
  this.user = user;
2335
2756
  this.lists = lists;
2336
2757
  this.tasks = tasks;
2337
2758
  this.disk = disk;
2759
+ this.bizproc = bizproc;
2760
+ this.log = log;
2338
2761
  }
2339
2762
  }
2340
- BXRestNavvy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvy, deps: [{ token: BXRestNavvyUser }, { token: BXRestNavvyLists }, { token: BXRestNavvyTasks }, { token: BXRestNavvyDisk }], target: i0.ɵɵFactoryTarget.Injectable });
2763
+ BXRestNavvy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvy, deps: [{ token: BXRestNavvyUser }, { token: BXRestNavvyLists }, { token: BXRestNavvyTasks }, { token: BXRestNavvyDisk }, { token: BXRestNavvyBizproc }, { token: BXRestNavvyLog }], target: i0.ɵɵFactoryTarget.Injectable });
2341
2764
  BXRestNavvy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvy, providedIn: 'root' });
2342
2765
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvy, decorators: [{
2343
2766
  type: Injectable,
2344
2767
  args: [{
2345
2768
  providedIn: 'root'
2346
2769
  }]
2347
- }], ctorParameters: function () { return [{ type: BXRestNavvyUser }, { type: BXRestNavvyLists }, { type: BXRestNavvyTasks }, { type: BXRestNavvyDisk }]; } });
2770
+ }], ctorParameters: function () { return [{ type: BXRestNavvyUser }, { type: BXRestNavvyLists }, { type: BXRestNavvyTasks }, { type: BXRestNavvyDisk }, { type: BXRestNavvyBizproc }, { type: BXRestNavvyLog }]; } });
2348
2771
  class BXRestMap {
2349
2772
  constructor(lists) {
2350
2773
  this.lists = lists;
@@ -2367,5 +2790,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2367
2790
  * Generated bundle index. Do not edit.
2368
2791
  */
2369
2792
 
2370
- export { BXRest, BXRestMap, BXRestMapResult, BXRestNavvy, REST_SETTINGS };
2793
+ export { BXRest, BXRestMap, BXRestMapResult, BXRestNavvy, BX_REST_SETTINGS };
2371
2794
  //# sourceMappingURL=bx-rest.mjs.map