bx-rest 0.1.1 → 0.1.5
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/consts/part-name-metods.d.ts +9 -0
- package/esm2020/consts/part-name-metods.mjs +10 -1
- package/esm2020/map/lists.mjs +2 -2
- package/esm2020/map/task.mjs +10 -1
- package/esm2020/public-api.mjs +2 -2
- package/esm2020/request/bizproc/activity.mjs +23 -0
- package/esm2020/request/bizproc/event.mjs +19 -0
- package/esm2020/request/bizproc/robot.mjs +22 -0
- package/esm2020/request/bizproc/task.mjs +20 -0
- package/esm2020/request/bizproc/workflow/instance.mjs +19 -0
- package/esm2020/request/bizproc/workflow/template.mjs +27 -0
- package/esm2020/request/bizproc/workflow.mjs +31 -0
- package/esm2020/request/bizproc.mjs +25 -0
- package/esm2020/request/lists/element.mjs +4 -3
- package/esm2020/request/lists.mjs +2 -2
- package/esm2020/request/tasks/task.mjs +34 -1
- package/esm2020/request/user.mjs +9 -6
- package/esm2020/request-navvy/bizproc/workflow.mjs +22 -0
- package/esm2020/request-navvy/bizproc.mjs +60 -0
- package/esm2020/request-navvy/disk/storage.mjs +7 -10
- package/esm2020/request-navvy/lists/element.mjs +6 -3
- package/esm2020/request-navvy/lists.mjs +2 -10
- package/esm2020/request-navvy/tasks/task.mjs +67 -19
- package/esm2020/request-navvy/user.mjs +7 -8
- package/esm2020/rest.mjs +21 -17
- package/esm2020/services/base.mjs +3 -3
- package/esm2020/services/http/HttpBX.mjs +34 -36
- package/esm2020/services/http/http.mjs +36 -38
- package/esm2020/services/http/sessionKey.mjs +128 -113
- package/esm2020/services/vanilla/sessionStorage.mjs +7 -7
- package/esm2020/settings.mjs +2 -2
- package/esm2020/typification/auth/save.mjs +1 -1
- package/esm2020/typification/rest/base/OrderOptions.mjs +2 -0
- package/esm2020/typification/rest/base/sort.mjs +2 -0
- package/esm2020/typification/rest/bizproc/base/filedEnum.mjs +2 -0
- package/esm2020/typification/rest/bizproc/workflow/start.mjs +2 -0
- package/esm2020/typification/rest/bizproc/workflow/template/list.mjs +2 -0
- package/esm2020/typification/rest/lists/element/add.mjs +2 -0
- package/esm2020/typification/rest/task/base/fieldsName.mjs +2 -0
- package/esm2020/typification/rest/tasks/task/add.mjs +2 -0
- package/esm2020/typification/rest/tasks/task/get.mjs +2 -0
- package/esm2020/typification/rest/tasks/task/list.mjs +2 -0
- package/esm2020/typification/rest/user/get.mjs +1 -1
- package/fesm2015/bx-rest.mjs +794 -490
- package/fesm2015/bx-rest.mjs.map +1 -1
- package/fesm2020/bx-rest.mjs +797 -488
- package/fesm2020/bx-rest.mjs.map +1 -1
- package/map/lists.d.ts +1 -1
- package/map/task.d.ts +4 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -1
- package/request/bizproc/activity.d.ts +12 -0
- package/request/bizproc/event.d.ts +8 -0
- package/request/bizproc/robot.d.ts +11 -0
- package/request/bizproc/task.d.ts +9 -0
- package/request/bizproc/workflow/instance.d.ts +8 -0
- package/request/bizproc/workflow/template.d.ts +16 -0
- package/request/bizproc/workflow.d.ts +20 -0
- package/request/bizproc.d.ts +16 -0
- package/request/lists/element.d.ts +2 -1
- package/request/lists.d.ts +1 -1
- package/request/tasks/task.d.ts +9 -1
- package/request-navvy/bizproc/workflow.d.ts +12 -0
- package/request-navvy/bizproc.d.ts +24 -0
- package/request-navvy/disk/storage.d.ts +1 -3
- package/request-navvy/lists/element.d.ts +3 -1
- package/request-navvy/lists.d.ts +1 -8
- package/request-navvy/tasks/task.d.ts +13 -3
- package/request-navvy/user.d.ts +1 -3
- package/rest.d.ts +13 -9
- package/services/http/sessionKey.d.ts +3 -23
- package/services/vanilla/sessionStorage.d.ts +5 -5
- package/settings.d.ts +1 -1
- package/typification/auth/save.d.ts +1 -1
- package/typification/rest/base/OrderOptions.d.ts +1 -0
- package/typification/rest/base/sort.d.ts +1 -0
- package/typification/rest/bizproc/base/filedEnum.d.ts +1 -0
- package/typification/rest/bizproc/workflow/start.d.ts +5 -0
- package/typification/rest/bizproc/workflow/template/list.d.ts +8 -0
- package/typification/rest/lists/element/add.d.ts +9 -0
- package/typification/rest/task/base/fieldsName.d.ts +1 -0
- package/typification/rest/{task/fieldsForSend.d.ts → tasks/task/add.d.ts} +1 -1
- package/typification/rest/tasks/task/get.d.ts +5 -0
- package/typification/rest/tasks/task/list.d.ts +65 -0
- package/typification/rest/user/get.d.ts +6 -1
- package/esm2020/store/auth.mjs +0 -26
- package/esm2020/typification/rest/task/fieldsForSend.mjs +0 -2
- package/store/auth.d.ts +0 -20
package/fesm2015/bx-rest.mjs
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { NgModule, inject, Component, ViewEncapsulation, Inject, Injectable
|
|
3
|
-
import { Subscription,
|
|
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
|
|
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
|
|
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(
|
|
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,114 +625,136 @@ 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(
|
|
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
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
//
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
let save = {
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
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.
|
|
663
|
+
SessionStorage.setItem(this.constructor.name, save);
|
|
749
664
|
this.subscribeAll();
|
|
750
665
|
}
|
|
751
666
|
}
|
|
752
667
|
}
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
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
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
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 (
|
|
755
|
+
switch (BX_REST_SETTINGS.auth.key) {
|
|
815
756
|
case 'auth':
|
|
757
|
+
console.log('Cookies.get(\'auth\')', CookiesServices.get('auth'));
|
|
816
758
|
return CookiesServices.get('auth');
|
|
817
759
|
default:
|
|
818
760
|
if (window.BX && window.BX.bitrix_sessid()) {
|
|
@@ -828,8 +770,8 @@ class SessionKeyServices extends BaseServices {
|
|
|
828
770
|
}
|
|
829
771
|
}
|
|
830
772
|
getKeyAuth() {
|
|
831
|
-
if (
|
|
832
|
-
return
|
|
773
|
+
if (BX_REST_SETTINGS.auth.key.length) {
|
|
774
|
+
return BX_REST_SETTINGS.auth.key;
|
|
833
775
|
}
|
|
834
776
|
else {
|
|
835
777
|
if (window.BX && window.BX.bitrix_sessid()
|
|
@@ -864,36 +806,30 @@ class SessionKeyServices extends BaseServices {
|
|
|
864
806
|
return false;
|
|
865
807
|
}
|
|
866
808
|
getAuthParams() {
|
|
867
|
-
|
|
809
|
+
console.log('BX_REST_SETTINGS', BX_REST_SETTINGS);
|
|
810
|
+
switch (BX_REST_SETTINGS.auth.source) {
|
|
868
811
|
case 'cookies':
|
|
869
|
-
return
|
|
812
|
+
return this.getAuth();
|
|
870
813
|
default:
|
|
871
|
-
return this.authData
|
|
814
|
+
return (this.authData) ? this.authData.access_token : undefined;
|
|
872
815
|
}
|
|
873
816
|
}
|
|
874
817
|
getBaseUrl() {
|
|
875
|
-
return of(this.prepareBaseAddress(
|
|
818
|
+
return of(this.prepareBaseAddress(BX_REST_SETTINGS.urls.home, 'rest'));
|
|
876
819
|
// return this.authData$.pipe( // TODO: разобраться позже
|
|
877
820
|
// take(1),
|
|
878
821
|
// map(v => (v && v.domain) ? this.prepareBaseAddress(v.domain) : undefined)
|
|
879
822
|
// )
|
|
880
823
|
}
|
|
881
824
|
}
|
|
882
|
-
SessionKeyServices.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SessionKeyServices, deps: [{ token:
|
|
825
|
+
SessionKeyServices.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SessionKeyServices, deps: [{ token: RestServices }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
883
826
|
SessionKeyServices.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SessionKeyServices, providedIn: 'root' });
|
|
884
827
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SessionKeyServices, decorators: [{
|
|
885
828
|
type: Injectable,
|
|
886
829
|
args: [{
|
|
887
830
|
providedIn: 'root'
|
|
888
831
|
}]
|
|
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
|
-
} });
|
|
832
|
+
}], ctorParameters: function () { return [{ type: RestServices }]; } });
|
|
897
833
|
|
|
898
834
|
class HttpData extends BaseServices {
|
|
899
835
|
constructor() {
|
|
@@ -1024,14 +960,14 @@ class BaseHttp extends HttpData {
|
|
|
1024
960
|
};
|
|
1025
961
|
}
|
|
1026
962
|
}
|
|
1027
|
-
BaseHttp.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseHttp, deps: [{ token: i1$
|
|
963
|
+
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
964
|
BaseHttp.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseHttp, providedIn: 'root' });
|
|
1029
965
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BaseHttp, decorators: [{
|
|
1030
966
|
type: Injectable,
|
|
1031
967
|
args: [{
|
|
1032
968
|
providedIn: 'root'
|
|
1033
969
|
}]
|
|
1034
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
970
|
+
}], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: SnackBarService }]; } });
|
|
1035
971
|
|
|
1036
972
|
class BaseHttpServices extends BaseHttp {
|
|
1037
973
|
httpGet(url, params = {}, settings = this.defSettings) {
|
|
@@ -1050,56 +986,54 @@ class HttpServices extends BaseHttpServices {
|
|
|
1050
986
|
this.session = session;
|
|
1051
987
|
}
|
|
1052
988
|
httpPost(url, params = {}, settings = this.defSettings) {
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
}));
|
|
989
|
+
let auth = this.session.getAuthParams();
|
|
990
|
+
if (auth) {
|
|
991
|
+
const paramsClone = clone(params);
|
|
992
|
+
paramsClone[this.session.getKeyAuth()] = auth;
|
|
993
|
+
return this.session.getBaseUrl().pipe(mergeMap(v => {
|
|
994
|
+
if (v) {
|
|
995
|
+
return this.http.post(this.prepareBaseAddress(v) + url, this.getHttpParamsPost(paramsClone, new FormData(), false, [], settings));
|
|
996
|
+
}
|
|
997
|
+
return throwError(() => 'get base url error');
|
|
998
|
+
}));
|
|
999
|
+
}
|
|
1000
|
+
else {
|
|
1001
|
+
this.snackBar.error('Error: Auth not get');
|
|
1002
|
+
return throwError(() => 'auth not get');
|
|
1003
|
+
}
|
|
1069
1004
|
}
|
|
1070
1005
|
httpGet(url, params = {}, settings = this.defSettings) {
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
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');
|
|
1006
|
+
let auth = this.session.getAuthParams();
|
|
1007
|
+
if (auth) {
|
|
1008
|
+
if (params === null) {
|
|
1009
|
+
params = {};
|
|
1091
1010
|
}
|
|
1092
|
-
|
|
1011
|
+
const paramsClone = clone(params);
|
|
1012
|
+
paramsClone[this.session.getKeyAuth()] = auth;
|
|
1013
|
+
let options = {
|
|
1014
|
+
params: this.getHttpParamsGet(paramsClone)
|
|
1015
|
+
};
|
|
1016
|
+
return this.session.getBaseUrl().pipe(mergeMap(v => {
|
|
1017
|
+
if (v) {
|
|
1018
|
+
return this.http.get(this.prepareBaseAddress(v) + url, options);
|
|
1019
|
+
}
|
|
1020
|
+
return throwError(() => 'get base url error');
|
|
1021
|
+
}));
|
|
1022
|
+
}
|
|
1023
|
+
else {
|
|
1024
|
+
this.snackBar.error('Error: Auth not get');
|
|
1025
|
+
return throwError(() => 'auth not get');
|
|
1026
|
+
}
|
|
1093
1027
|
}
|
|
1094
1028
|
}
|
|
1095
|
-
HttpServices.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HttpServices, deps: [{ token: i1$
|
|
1029
|
+
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
1030
|
HttpServices.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HttpServices, providedIn: 'root' });
|
|
1097
1031
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: HttpServices, decorators: [{
|
|
1098
1032
|
type: Injectable,
|
|
1099
1033
|
args: [{
|
|
1100
1034
|
providedIn: 'root'
|
|
1101
1035
|
}]
|
|
1102
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
1036
|
+
}], ctorParameters: function () { return [{ type: i1$2.HttpClient }, { type: SnackBarService }, { type: SessionKeyServices }]; } });
|
|
1103
1037
|
|
|
1104
1038
|
// type TransformFunction<T, R> = (input: T) => R;
|
|
1105
1039
|
class HttpBXServices extends HttpServices {
|
|
@@ -1159,44 +1093,42 @@ class HttpBXServices extends HttpServices {
|
|
|
1159
1093
|
return this.httpGet(this.getNameMethod(name), params, settings);
|
|
1160
1094
|
}
|
|
1161
1095
|
httpPost(url, params = {}, settings = this.defSettings) {
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
}));
|
|
1096
|
+
let auth = this.session.getAuthParams();
|
|
1097
|
+
if (auth) {
|
|
1098
|
+
const paramsClone = clone(params);
|
|
1099
|
+
paramsClone[this.session.getKeyAuth()] = auth;
|
|
1100
|
+
return this.session.getBaseUrl().pipe(mergeMap(v => {
|
|
1101
|
+
if (v) {
|
|
1102
|
+
return this.http.post(this.prepareBaseAddress(v) + url, this.getHttpParamsPost(paramsClone, new FormData(), false, [], settings));
|
|
1103
|
+
}
|
|
1104
|
+
return throwError(() => 'get base url error');
|
|
1105
|
+
}));
|
|
1106
|
+
}
|
|
1107
|
+
else {
|
|
1108
|
+
return throwError(() => 'auth not get');
|
|
1109
|
+
}
|
|
1177
1110
|
}
|
|
1178
1111
|
httpGet(url, params = {}, settings = this.defSettings) {
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
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
|
-
}));
|
|
1112
|
+
let auth = this.session.getAuthParams();
|
|
1113
|
+
if (auth) {
|
|
1114
|
+
if (params === null) {
|
|
1115
|
+
params = {};
|
|
1195
1116
|
}
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1117
|
+
const paramsClone = clone(params);
|
|
1118
|
+
paramsClone[this.session.getKeyAuth()] = auth;
|
|
1119
|
+
let options = {
|
|
1120
|
+
params: this.getHttpParamsGet(paramsClone)
|
|
1121
|
+
};
|
|
1122
|
+
return this.session.getBaseUrl().pipe(mergeMap(v => {
|
|
1123
|
+
if (v) {
|
|
1124
|
+
return this.http.get(this.prepareBaseAddress(v) + url, options);
|
|
1125
|
+
}
|
|
1126
|
+
return throwError(() => 'get base url error');
|
|
1127
|
+
}));
|
|
1128
|
+
}
|
|
1129
|
+
else {
|
|
1130
|
+
return throwError(() => 'auth not get');
|
|
1131
|
+
}
|
|
1200
1132
|
}
|
|
1201
1133
|
getNameMethod(arr) {
|
|
1202
1134
|
return arr.join('.');
|
|
@@ -1211,157 +1143,100 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
1211
1143
|
}]
|
|
1212
1144
|
}] });
|
|
1213
1145
|
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
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 }]; } });
|
|
1146
|
+
const $get = 'get';
|
|
1147
|
+
const $add = 'add';
|
|
1148
|
+
const $set = 'set';
|
|
1149
|
+
const $event = 'event';
|
|
1150
|
+
const $update = 'update';
|
|
1151
|
+
const $user = 'user';
|
|
1152
|
+
const $task = 'task';
|
|
1153
|
+
const $calendar = 'calendar';
|
|
1154
|
+
const $meeting = 'meeting';
|
|
1155
|
+
const $list = 'list';
|
|
1156
|
+
const $search = 'search';
|
|
1157
|
+
const $accessibility = 'accessibility';
|
|
1158
|
+
const $delete = 'delete';
|
|
1159
|
+
const $nearest = 'nearest';
|
|
1160
|
+
const $params = 'params';
|
|
1161
|
+
const $status = 'status';
|
|
1162
|
+
const $resource = 'resource';
|
|
1163
|
+
const $booking = 'booking';
|
|
1164
|
+
const $section = 'section';
|
|
1165
|
+
const $settings = 'settings';
|
|
1166
|
+
const $tasks = 'tasks';
|
|
1167
|
+
const $elapseditem = 'elapseditem';
|
|
1168
|
+
const $getlist = 'getlist';
|
|
1169
|
+
const $approve = 'approve';
|
|
1170
|
+
const $complete = 'complete';
|
|
1171
|
+
const $counters = 'counters';
|
|
1172
|
+
const $deger = 'deger';
|
|
1173
|
+
const $delegate = 'delegate';
|
|
1174
|
+
const $disapprove = 'disapprove';
|
|
1175
|
+
const $favorite = 'favorite';
|
|
1176
|
+
const $files = 'files';
|
|
1177
|
+
const $file = 'file';
|
|
1178
|
+
const $attach = 'attach';
|
|
1179
|
+
const $field = 'field';
|
|
1180
|
+
const $getFields = 'get' + $field + 's';
|
|
1181
|
+
const $getaccess = 'getaccess';
|
|
1182
|
+
const $history = 'history';
|
|
1183
|
+
const $pause = 'pause';
|
|
1184
|
+
const $renew = 'renew';
|
|
1185
|
+
const $start = 'start';
|
|
1186
|
+
const $result = 'result';
|
|
1187
|
+
const $planner = 'planner';
|
|
1188
|
+
const $disk = 'disk';
|
|
1189
|
+
const $rename = 'rename';
|
|
1190
|
+
const $markdeleted = 'markdeleted';
|
|
1191
|
+
const $restore = 'restore';
|
|
1192
|
+
const $folder = 'folder';
|
|
1193
|
+
const $getchildren = 'getchildren';
|
|
1194
|
+
const $copyto = 'copyto';
|
|
1195
|
+
const $moveto = 'moveto';
|
|
1196
|
+
const $uploadfile = 'uploadfile';
|
|
1197
|
+
const $storage = 'storage';
|
|
1198
|
+
const $getTypes = 'getTypes';
|
|
1199
|
+
const $stages = 'stages';
|
|
1200
|
+
const $getmanifest = 'getmanifest';
|
|
1201
|
+
const $isactionallowed = 'isactionallowed';
|
|
1202
|
+
const $commentitem = 'commentitem';
|
|
1203
|
+
const $department = 'department';
|
|
1204
|
+
const $sonet_group = 'sonet_group';
|
|
1205
|
+
const $create = 'create';
|
|
1206
|
+
const $feature = 'feature';
|
|
1207
|
+
const $access = 'access';
|
|
1208
|
+
const $request = 'request';
|
|
1209
|
+
const $socialnetwork = 'socialnetwork';
|
|
1210
|
+
const $api = 'api';
|
|
1211
|
+
const $workgroup = 'workgroup';
|
|
1212
|
+
const $log = 'log';
|
|
1213
|
+
const $blogpost = 'blogpost';
|
|
1214
|
+
const $lists = 'lists';
|
|
1215
|
+
const $iblock = 'iblock';
|
|
1216
|
+
const $type = 'type';
|
|
1217
|
+
const $id = 'id';
|
|
1218
|
+
const $element = 'element';
|
|
1219
|
+
const $url = 'url';
|
|
1220
|
+
const $bizproc = 'bizproc';
|
|
1221
|
+
const $workflow = 'workflow';
|
|
1222
|
+
const $instances = 'instances';
|
|
1223
|
+
const $terminate = '$terminate';
|
|
1224
|
+
const $kill = 'kill';
|
|
1225
|
+
const $template = 'template';
|
|
1226
|
+
const $activity = 'activity';
|
|
1227
|
+
const $robot = 'robot';
|
|
1228
|
+
const $send = 'send';
|
|
1344
1229
|
|
|
1345
|
-
class
|
|
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
|
-
|
|
1358
|
-
|
|
1359
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type:
|
|
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
|
-
}]
|
|
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,185 @@ 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
|
|
1707
|
-
|
|
1708
|
-
|
|
1665
|
+
class BXRestBizprocWorkflowInstance {
|
|
1666
|
+
constructor() {
|
|
1667
|
+
this.url = {
|
|
1668
|
+
list: [$bizproc, $workflow, $instances, $list], // Возвращает список запущенных бизнес-процессов. Алиас bizproc.workflow.instances
|
|
1669
|
+
};
|
|
1709
1670
|
}
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
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
|
+
};
|
|
1716
1738
|
}
|
|
1717
1739
|
}
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type:
|
|
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: [{
|
|
1721
1743
|
type: Injectable,
|
|
1722
1744
|
args: [{
|
|
1723
1745
|
providedIn: 'root'
|
|
1724
1746
|
}]
|
|
1725
1747
|
}] });
|
|
1726
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
|
+
};
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
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: [{
|
|
1795
|
+
type: Injectable,
|
|
1796
|
+
args: [{
|
|
1797
|
+
providedIn: 'root'
|
|
1798
|
+
}]
|
|
1799
|
+
}] });
|
|
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 Navvy {
|
|
1820
|
+
constructor(snackBar) {
|
|
1821
|
+
this.snackBar = snackBar;
|
|
1822
|
+
}
|
|
1823
|
+
mapAndSnackBarError(request, errorText) {
|
|
1824
|
+
return request.pipe(map(v => BXRestMapResult(v)), catchError(err => {
|
|
1825
|
+
this.snackBar.error(errorText);
|
|
1826
|
+
return throwError(() => err);
|
|
1827
|
+
}));
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
Navvy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: Navvy, deps: [{ token: SnackBarService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1831
|
+
Navvy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: Navvy, providedIn: 'root' });
|
|
1832
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: Navvy, decorators: [{
|
|
1833
|
+
type: Injectable,
|
|
1834
|
+
args: [{
|
|
1835
|
+
providedIn: 'root'
|
|
1836
|
+
}]
|
|
1837
|
+
}], ctorParameters: function () { return [{ type: SnackBarService }]; } });
|
|
1838
|
+
|
|
1727
1839
|
class BXRestNavvyUser {
|
|
1728
|
-
constructor(BXRestUser, BXRestUserMap, Navvy
|
|
1840
|
+
constructor(BXRestUser, BXRestUserMap, Navvy) {
|
|
1729
1841
|
this.BXRestUser = BXRestUser;
|
|
1730
1842
|
this.BXRestUserMap = BXRestUserMap;
|
|
1731
1843
|
this.Navvy = Navvy;
|
|
1732
|
-
this.SessionStorage = SessionStorage;
|
|
1733
1844
|
}
|
|
1734
1845
|
get(params = {}) {
|
|
1735
1846
|
return this.Navvy.mapAndSnackBarError(this.BXRestUser.get(params), 'Не удалось получить пользователей');
|
|
@@ -1739,7 +1850,7 @@ class BXRestNavvyUser {
|
|
|
1739
1850
|
return this.self();
|
|
1740
1851
|
}
|
|
1741
1852
|
else {
|
|
1742
|
-
let self =
|
|
1853
|
+
let self = SessionStorage.getItem(this.constructor.name + this.self.name);
|
|
1743
1854
|
if (self) {
|
|
1744
1855
|
return of(self);
|
|
1745
1856
|
}
|
|
@@ -1758,7 +1869,7 @@ class BXRestNavvyUser {
|
|
|
1758
1869
|
return undefined;
|
|
1759
1870
|
}), tap(v => {
|
|
1760
1871
|
if (v) {
|
|
1761
|
-
|
|
1872
|
+
SessionStorage.setItem(this.constructor.name + this.self.name, v);
|
|
1762
1873
|
}
|
|
1763
1874
|
}));
|
|
1764
1875
|
}
|
|
@@ -1772,16 +1883,80 @@ class BXRestNavvyUser {
|
|
|
1772
1883
|
return this.Navvy.mapAndSnackBarError(this.BXRestUser.fields(), 'Не удалось поля');
|
|
1773
1884
|
}
|
|
1774
1885
|
}
|
|
1775
|
-
BXRestNavvyUser.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyUser, deps: [{ token: BXRestUser }, { token: BXRestUserMap }, { token: Navvy }
|
|
1886
|
+
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
1887
|
BXRestNavvyUser.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyUser, providedIn: 'root' });
|
|
1777
1888
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyUser, decorators: [{
|
|
1778
1889
|
type: Injectable,
|
|
1779
1890
|
args: [{
|
|
1780
1891
|
providedIn: 'root'
|
|
1781
1892
|
}]
|
|
1782
|
-
}], ctorParameters: function () { return [{ type: BXRestUser }, { type: BXRestUserMap }, { type: Navvy }
|
|
1893
|
+
}], ctorParameters: function () { return [{ type: BXRestUser }, { type: BXRestUserMap }, { type: Navvy }]; } });
|
|
1894
|
+
|
|
1895
|
+
class BXRestMapListsElement extends BaseMapServices {
|
|
1896
|
+
get(items) {
|
|
1897
|
+
return items.map(item => Object.assign(item, {
|
|
1898
|
+
BP_PUBLISHED: item.BP_PUBLISHED === 'Y',
|
|
1899
|
+
CREATED_BY: this.toNum(item.CREATED_BY),
|
|
1900
|
+
IBLOCK_ID: this.toNum(item.IBLOCK_ID),
|
|
1901
|
+
ID: this.toNum(item.ID)
|
|
1902
|
+
}));
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
BXRestMapListsElement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapListsElement, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1906
|
+
BXRestMapListsElement.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapListsElement, providedIn: 'root' });
|
|
1907
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapListsElement, decorators: [{
|
|
1908
|
+
type: Injectable,
|
|
1909
|
+
args: [{
|
|
1910
|
+
providedIn: 'root'
|
|
1911
|
+
}]
|
|
1912
|
+
}] });
|
|
1913
|
+
|
|
1914
|
+
class BXRestNavvyListsElement {
|
|
1915
|
+
constructor(BXRestListsElement, BXRestMap, Navvy) {
|
|
1916
|
+
this.BXRestListsElement = BXRestListsElement;
|
|
1917
|
+
this.BXRestMap = BXRestMap;
|
|
1918
|
+
this.Navvy = Navvy;
|
|
1919
|
+
}
|
|
1920
|
+
get(param) {
|
|
1921
|
+
return this.Navvy.mapAndSnackBarError(this.BXRestListsElement.get(param), 'Не удалось получить элемент списка').pipe(map(v => (v) ? this.BXRestMap.get(v) : undefined));
|
|
1922
|
+
}
|
|
1923
|
+
add(param) {
|
|
1924
|
+
return this.Navvy.mapAndSnackBarError(this.BXRestListsElement.add(param), 'Не удалось получить элемент списка');
|
|
1925
|
+
}
|
|
1926
|
+
}
|
|
1927
|
+
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 });
|
|
1928
|
+
BXRestNavvyListsElement.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyListsElement, providedIn: 'root' });
|
|
1929
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyListsElement, decorators: [{
|
|
1930
|
+
type: Injectable,
|
|
1931
|
+
args: [{
|
|
1932
|
+
providedIn: 'root'
|
|
1933
|
+
}]
|
|
1934
|
+
}], ctorParameters: function () { return [{ type: BXRestListsElement }, { type: BXRestMapListsElement }, { type: Navvy }]; } });
|
|
1935
|
+
|
|
1936
|
+
class BXRestNavvyLists {
|
|
1937
|
+
constructor(element) {
|
|
1938
|
+
this.element = element;
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
BXRestNavvyLists.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLists, deps: [{ token: BXRestNavvyListsElement }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1942
|
+
BXRestNavvyLists.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLists, providedIn: 'root' });
|
|
1943
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyLists, decorators: [{
|
|
1944
|
+
type: Injectable,
|
|
1945
|
+
args: [{
|
|
1946
|
+
providedIn: 'root'
|
|
1947
|
+
}]
|
|
1948
|
+
}], ctorParameters: function () { return [{ type: BXRestNavvyListsElement }]; } });
|
|
1783
1949
|
|
|
1784
1950
|
class BXRestTaskMap extends BaseMapServices {
|
|
1951
|
+
add(item) {
|
|
1952
|
+
return this.TaskBXHttpToTaskBX(item);
|
|
1953
|
+
}
|
|
1954
|
+
get(item) {
|
|
1955
|
+
return this.TaskBXHttpToTaskBX(item);
|
|
1956
|
+
}
|
|
1957
|
+
list(item) {
|
|
1958
|
+
return item.map(i => this.TaskBXHttpToTaskBX(i));
|
|
1959
|
+
}
|
|
1785
1960
|
TaskBXHttpToTaskBX(item) {
|
|
1786
1961
|
let result = {};
|
|
1787
1962
|
if (item.id) {
|
|
@@ -1898,23 +2073,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
1898
2073
|
// next: number
|
|
1899
2074
|
// }
|
|
1900
2075
|
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
2076
|
// storeTask$: Observable<iStoreTask>
|
|
1912
|
-
constructor(
|
|
2077
|
+
constructor(BXRestTasksTask, snackBar,
|
|
1913
2078
|
// private store: Store<{ tasks: IStoreTask }>,
|
|
1914
|
-
taskMap
|
|
1915
|
-
|
|
2079
|
+
taskMap,
|
|
2080
|
+
// private taskResultMap: BitrixApiTaskResultMapServices
|
|
2081
|
+
Navvy) {
|
|
2082
|
+
this.BXRestTasksTask = BXRestTasksTask;
|
|
1916
2083
|
this.snackBar = snackBar;
|
|
1917
2084
|
this.taskMap = taskMap;
|
|
2085
|
+
this.Navvy = Navvy;
|
|
2086
|
+
// pageSize = 50
|
|
2087
|
+
// nowLoad$ = new ReplaySubject<TimeProcess>(1)
|
|
2088
|
+
this.def = {
|
|
2089
|
+
select: ['ID', 'PARENT_ID', 'TITLE', 'DESCRIPTION', 'MARK', 'PRIORITY', 'STATUS', 'MULTITASK',
|
|
2090
|
+
'GROUP_ID', 'STAGE_ID', 'CREATED_BY', 'CREATED_DATE', 'RESPONSIBLE_ID', 'ACCOMPLICES', 'AUDITORS',
|
|
2091
|
+
'CHANGED_BY', 'CHANGED_DATE', 'STATUS_CHANGED_DATE', 'CLOSED_BY', 'CLOSED_DATE', 'DATE_START', 'VIEWED_DATE',
|
|
2092
|
+
'DEADLINE', 'START_DATE_PLAN', 'END_DATE_PLAN', 'FORKED_BY_TEMPLATE_ID', 'TIME_ESTIMATE', 'TIME_SPENT_IN_LOGS',
|
|
2093
|
+
'TAGS', 'ALLOW_TIME_TRACKING'
|
|
2094
|
+
]
|
|
2095
|
+
};
|
|
1918
2096
|
// this.storeTask$ = this.store.select('tasks')
|
|
1919
2097
|
// this.nowLoad$.next({
|
|
1920
2098
|
// total: 0,
|
|
@@ -1922,9 +2100,9 @@ class BXRestNavvyTasksTask {
|
|
|
1922
2100
|
// })
|
|
1923
2101
|
}
|
|
1924
2102
|
add(param) {
|
|
1925
|
-
return this.
|
|
1926
|
-
if (v && v.
|
|
1927
|
-
return this.taskMap.
|
|
2103
|
+
return this.Navvy.mapAndSnackBarError(this.BXRestTasksTask.add(param), 'Не удалось получить задачу').pipe(map(v => {
|
|
2104
|
+
if (v && v.task) {
|
|
2105
|
+
return this.taskMap.add(v.task);
|
|
1928
2106
|
}
|
|
1929
2107
|
return undefined;
|
|
1930
2108
|
}));
|
|
@@ -1941,15 +2119,57 @@ class BXRestNavvyTasksTask {
|
|
|
1941
2119
|
// }
|
|
1942
2120
|
// ))
|
|
1943
2121
|
}
|
|
2122
|
+
/*
|
|
2123
|
+
update(taskId: number, updateFields: iBXRestTaskFieldsName[], task: iBXRestTask) {
|
|
2124
|
+
let sendTask: Record<string, any> = {}
|
|
2125
|
+
let taskTS: Record<string, any> = task
|
|
2126
|
+
if (updateFields.length) {
|
|
2127
|
+
for (let updateField of updateFields) {
|
|
2128
|
+
if (taskTS[camelCase(updateField)]) {
|
|
2129
|
+
sendTask[updateField] = taskTS[camelCase(updateField)]
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
if (Object.values(sendTask).length) {
|
|
2133
|
+
return this.http.post(
|
|
2134
|
+
this.url.update,
|
|
2135
|
+
{taskId: taskId, fields: sendTask},
|
|
2136
|
+
'error to update task')
|
|
2137
|
+
} else {
|
|
2138
|
+
this.snackBar.error('not valid send data task')
|
|
2139
|
+
console.error('not valid send data task', sendTask, task)
|
|
2140
|
+
return of(undefined)
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
|
|
2144
|
+
this.snackBar.warning('not have field for update')
|
|
2145
|
+
return of(undefined)
|
|
2146
|
+
}
|
|
2147
|
+
*/
|
|
2148
|
+
get(requestArray) {
|
|
2149
|
+
if (!requestArray.select) {
|
|
2150
|
+
requestArray.select = this.def.select;
|
|
2151
|
+
}
|
|
2152
|
+
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));
|
|
2153
|
+
}
|
|
2154
|
+
list(param = {}) {
|
|
2155
|
+
if (!param.select) {
|
|
2156
|
+
param.select = this.def.select;
|
|
2157
|
+
}
|
|
2158
|
+
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 => {
|
|
2159
|
+
if (v) {
|
|
2160
|
+
SessionStorage.setItem(this.constructor.name + this.list.name, v);
|
|
2161
|
+
}
|
|
2162
|
+
}));
|
|
2163
|
+
}
|
|
1944
2164
|
}
|
|
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 });
|
|
2165
|
+
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
2166
|
BXRestNavvyTasksTask.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyTasksTask, providedIn: 'root' });
|
|
1947
2167
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyTasksTask, decorators: [{
|
|
1948
2168
|
type: Injectable,
|
|
1949
2169
|
args: [{
|
|
1950
2170
|
providedIn: 'root'
|
|
1951
2171
|
}]
|
|
1952
|
-
}], ctorParameters: function () { return [{ type: BXRestTasksTask }, { type: SnackBarService }, { type: BXRestTaskMap }]; } });
|
|
2172
|
+
}], ctorParameters: function () { return [{ type: BXRestTasksTask }, { type: SnackBarService }, { type: BXRestTaskMap }, { type: Navvy }]; } });
|
|
1953
2173
|
|
|
1954
2174
|
class BXRestNavvyTasks {
|
|
1955
2175
|
constructor(task) {
|
|
@@ -2162,24 +2382,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
2162
2382
|
|
|
2163
2383
|
class BXRestNavvyDiskStorage {
|
|
2164
2384
|
// BXDiskFolder$ = new Observable<BXDiskFolderStore>()
|
|
2165
|
-
constructor(BXRestDiskStorage, BXRestMapDiskStorage, Navvy
|
|
2166
|
-
// private store: Store<{ BXDiskFolder: BXDiskFolderStore }>,
|
|
2167
|
-
) {
|
|
2385
|
+
constructor(BXRestDiskStorage, BXRestMapDiskStorage, Navvy) {
|
|
2168
2386
|
this.BXRestDiskStorage = BXRestDiskStorage;
|
|
2169
2387
|
this.BXRestMapDiskStorage = BXRestMapDiskStorage;
|
|
2170
2388
|
this.Navvy = Navvy;
|
|
2171
|
-
this.SessionStorage = SessionStorage;
|
|
2172
2389
|
// this.BXDiskFolder$ = this.store.select('BXDiskFolder')
|
|
2173
2390
|
}
|
|
2174
2391
|
getforapp() {
|
|
2175
|
-
let res =
|
|
2392
|
+
let res = SessionStorage.getItem(this.constructor.name + this.getforapp.name);
|
|
2176
2393
|
if (res) {
|
|
2177
2394
|
return of(res);
|
|
2178
2395
|
}
|
|
2179
2396
|
else {
|
|
2180
2397
|
return this.Navvy.mapAndSnackBarError(this.BXRestDiskStorage.getforapp(), 'get root app folder').pipe(tap(v => {
|
|
2181
2398
|
if (v) {
|
|
2182
|
-
|
|
2399
|
+
SessionStorage.setItem(this.constructor.name + this.getforapp.name, v);
|
|
2183
2400
|
}
|
|
2184
2401
|
}));
|
|
2185
2402
|
}
|
|
@@ -2201,14 +2418,14 @@ class BXRestNavvyDiskStorage {
|
|
|
2201
2418
|
return this.BXRestDiskStorage.uploadfile(param);
|
|
2202
2419
|
}
|
|
2203
2420
|
}
|
|
2204
|
-
BXRestNavvyDiskStorage.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyDiskStorage, deps: [{ token: BXRestDiskStorage }, { token: BXRestMapDiskStorage }, { token: Navvy }
|
|
2421
|
+
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
2422
|
BXRestNavvyDiskStorage.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyDiskStorage, providedIn: 'root' });
|
|
2206
2423
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyDiskStorage, decorators: [{
|
|
2207
2424
|
type: Injectable,
|
|
2208
2425
|
args: [{
|
|
2209
2426
|
providedIn: 'root'
|
|
2210
2427
|
}]
|
|
2211
|
-
}], ctorParameters: function () { return [{ type: BXRestDiskStorage }, { type: BXRestMapDiskStorage }, { type: Navvy }
|
|
2428
|
+
}], ctorParameters: function () { return [{ type: BXRestDiskStorage }, { type: BXRestMapDiskStorage }, { type: Navvy }]; } });
|
|
2212
2429
|
|
|
2213
2430
|
class BXRestNavvyDiskOperation {
|
|
2214
2431
|
constructor(folder, disk, storage) {
|
|
@@ -2218,7 +2435,7 @@ class BXRestNavvyDiskOperation {
|
|
|
2218
2435
|
}
|
|
2219
2436
|
// данные файла в base64
|
|
2220
2437
|
loadFileInAppFolder(file) {
|
|
2221
|
-
return this.storage.getforapp().pipe(take
|
|
2438
|
+
return this.storage.getforapp().pipe(take(1), mergeMap$1(infoFolder => {
|
|
2222
2439
|
if (infoFolder) {
|
|
2223
2440
|
return this.storage.uploadfile({
|
|
2224
2441
|
id: infoFolder.ID,
|
|
@@ -2313,38 +2530,125 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
2313
2530
|
}]
|
|
2314
2531
|
}], ctorParameters: function () { return [{ type: BXRestNavvyDiskFile }, { type: BXRestDiskNavvyFolder }, { type: BXRestNavvyDiskOperation }]; } });
|
|
2315
2532
|
|
|
2533
|
+
class BXRestNavvyBizprocWorkflow {
|
|
2534
|
+
constructor(BXRestBizprocWorkflow, Navvy) {
|
|
2535
|
+
this.BXRestBizprocWorkflow = BXRestBizprocWorkflow;
|
|
2536
|
+
this.Navvy = Navvy;
|
|
2537
|
+
}
|
|
2538
|
+
start(param) {
|
|
2539
|
+
return this.Navvy.mapAndSnackBarError(this.BXRestBizprocWorkflow.start(param), 'Не удалось запустить бизнес процесс');
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
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 });
|
|
2543
|
+
BXRestNavvyBizprocWorkflow.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyBizprocWorkflow, providedIn: 'root' });
|
|
2544
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyBizprocWorkflow, decorators: [{
|
|
2545
|
+
type: Injectable,
|
|
2546
|
+
args: [{
|
|
2547
|
+
providedIn: 'root'
|
|
2548
|
+
}]
|
|
2549
|
+
}], ctorParameters: function () { return [{ type: BXRestBizprocWorkflow }, { type: Navvy }]; } });
|
|
2550
|
+
|
|
2551
|
+
class BXRestNavvyBizproc {
|
|
2552
|
+
constructor(workflow, BXRestNavvyLists) {
|
|
2553
|
+
this.workflow = workflow;
|
|
2554
|
+
this.BXRestNavvyLists = BXRestNavvyLists;
|
|
2555
|
+
}
|
|
2556
|
+
/**
|
|
2557
|
+
* Метод по запуску бизнес процессов из ленты
|
|
2558
|
+
*
|
|
2559
|
+
* @param id
|
|
2560
|
+
* @param parametersElement
|
|
2561
|
+
* @param parametersBizproc
|
|
2562
|
+
* @param templateIDs
|
|
2563
|
+
*/
|
|
2564
|
+
startProcFormNewsFeed(id, parametersElement, parametersBizproc, templateIDs) {
|
|
2565
|
+
return this.BXRestNavvyLists.element.add({
|
|
2566
|
+
IBLOCK_TYPE_ID: 'bitrix_processes',
|
|
2567
|
+
IBLOCK_ID: id,
|
|
2568
|
+
ELEMENT_CODE: 'trace_studio_' + Date.now() + '_' + Math.random(),
|
|
2569
|
+
// тут должно быть уникально значение (генерация уникальных значений на фронте лол),
|
|
2570
|
+
// как ещё уникальнее сделать я просто не знаю
|
|
2571
|
+
// это поле обязательно без него не работает
|
|
2572
|
+
FIELDS: Object.assign({ NAME: parametersElement['NAME'] }, parametersElement)
|
|
2573
|
+
}).pipe(mergeMap(v => {
|
|
2574
|
+
if (v) {
|
|
2575
|
+
if (Object.keys(parametersBizproc).length) {
|
|
2576
|
+
let reques = [];
|
|
2577
|
+
for (let templateID of templateIDs) {
|
|
2578
|
+
reques.push(this.workflow.start({
|
|
2579
|
+
TEMPLATE_ID: templateID,
|
|
2580
|
+
DOCUMENT_ID: ['lists', 'BizprocDocument', String(v)],
|
|
2581
|
+
PARAMETERS: parametersBizproc
|
|
2582
|
+
}));
|
|
2583
|
+
}
|
|
2584
|
+
return forkJoin(reques);
|
|
2585
|
+
}
|
|
2586
|
+
else {
|
|
2587
|
+
return of(true);
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2590
|
+
return of(false);
|
|
2591
|
+
}));
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2594
|
+
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 });
|
|
2595
|
+
BXRestNavvyBizproc.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyBizproc, providedIn: 'root' });
|
|
2596
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvyBizproc, decorators: [{
|
|
2597
|
+
type: Injectable,
|
|
2598
|
+
args: [{
|
|
2599
|
+
providedIn: 'root'
|
|
2600
|
+
}]
|
|
2601
|
+
}], ctorParameters: function () { return [{ type: BXRestNavvyBizprocWorkflow }, { type: BXRestNavvyLists }]; } });
|
|
2602
|
+
|
|
2603
|
+
class BXRestMapLists extends BaseMapServices {
|
|
2604
|
+
constructor(element) {
|
|
2605
|
+
super();
|
|
2606
|
+
this.element = element;
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
BXRestMapLists.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapLists, deps: [{ token: BXRestMapListsElement }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2610
|
+
BXRestMapLists.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapLists, providedIn: 'root' });
|
|
2611
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestMapLists, decorators: [{
|
|
2612
|
+
type: Injectable,
|
|
2613
|
+
args: [{
|
|
2614
|
+
providedIn: 'root'
|
|
2615
|
+
}]
|
|
2616
|
+
}], ctorParameters: function () { return [{ type: BXRestMapListsElement }]; } });
|
|
2617
|
+
|
|
2316
2618
|
class BXRest {
|
|
2317
|
-
constructor(user, lists, tasks, disk) {
|
|
2619
|
+
constructor(user, lists, tasks, disk, bizproc) {
|
|
2318
2620
|
this.user = user;
|
|
2319
2621
|
this.lists = lists;
|
|
2320
2622
|
this.tasks = tasks;
|
|
2321
2623
|
this.disk = disk;
|
|
2624
|
+
this.bizproc = bizproc;
|
|
2322
2625
|
}
|
|
2323
2626
|
}
|
|
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 });
|
|
2627
|
+
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 }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2325
2628
|
BXRest.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRest, providedIn: 'root' });
|
|
2326
2629
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRest, decorators: [{
|
|
2327
2630
|
type: Injectable,
|
|
2328
2631
|
args: [{
|
|
2329
2632
|
providedIn: 'root'
|
|
2330
2633
|
}]
|
|
2331
|
-
}], ctorParameters: function () { return [{ type: BXRestUser }, { type: BXRestLists }, { type: BXRestTasks }, { type: BXRestDisk }]; } });
|
|
2634
|
+
}], ctorParameters: function () { return [{ type: BXRestUser }, { type: BXRestLists }, { type: BXRestTasks }, { type: BXRestDisk }, { type: BXRestBizproc }]; } });
|
|
2332
2635
|
class BXRestNavvy {
|
|
2333
|
-
constructor(user, lists, tasks, disk) {
|
|
2636
|
+
constructor(user, lists, tasks, disk, bizproc) {
|
|
2334
2637
|
this.user = user;
|
|
2335
2638
|
this.lists = lists;
|
|
2336
2639
|
this.tasks = tasks;
|
|
2337
2640
|
this.disk = disk;
|
|
2641
|
+
this.bizproc = bizproc;
|
|
2338
2642
|
}
|
|
2339
2643
|
}
|
|
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 });
|
|
2644
|
+
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 }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2341
2645
|
BXRestNavvy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvy, providedIn: 'root' });
|
|
2342
2646
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: BXRestNavvy, decorators: [{
|
|
2343
2647
|
type: Injectable,
|
|
2344
2648
|
args: [{
|
|
2345
2649
|
providedIn: 'root'
|
|
2346
2650
|
}]
|
|
2347
|
-
}], ctorParameters: function () { return [{ type: BXRestNavvyUser }, { type: BXRestNavvyLists }, { type: BXRestNavvyTasks }, { type: BXRestNavvyDisk }]; } });
|
|
2651
|
+
}], ctorParameters: function () { return [{ type: BXRestNavvyUser }, { type: BXRestNavvyLists }, { type: BXRestNavvyTasks }, { type: BXRestNavvyDisk }, { type: BXRestNavvyBizproc }]; } });
|
|
2348
2652
|
class BXRestMap {
|
|
2349
2653
|
constructor(lists) {
|
|
2350
2654
|
this.lists = lists;
|
|
@@ -2367,5 +2671,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
2367
2671
|
* Generated bundle index. Do not edit.
|
|
2368
2672
|
*/
|
|
2369
2673
|
|
|
2370
|
-
export { BXRest, BXRestMap, BXRestMapResult, BXRestNavvy,
|
|
2674
|
+
export { BXRest, BXRestMap, BXRestMapResult, BXRestNavvy, BX_REST_SETTINGS };
|
|
2371
2675
|
//# sourceMappingURL=bx-rest.mjs.map
|