bx-rest 0.4.16 → 0.4.18
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/esm2022/index.mjs +13 -0
- package/esm2022/public-api.mjs +6 -4
- package/esm2022/request-navvy/user.mjs +3 -6
- package/esm2022/rest/base.mjs +51 -0
- package/esm2022/rest/map.mjs +17 -0
- package/esm2022/rest/navvy.mjs +62 -0
- package/esm2022/rest.mjs +1 -1
- package/esm2022/services/Navvy/NavvySupport.mjs +3 -4
- package/esm2022/typification/rest/user/get.mjs +1 -1
- package/fesm2022/bx-rest.mjs +456 -457
- package/fesm2022/bx-rest.mjs.map +1 -1
- package/package.json +8 -7
- package/public-api.d.ts +7 -2
- package/request-navvy/user.d.ts +1 -1
- package/rest/base.d.ts +40 -0
- package/rest/map.d.ts +8 -0
- package/rest/navvy.d.ts +45 -0
- package/typification/rest/user/get.d.ts +4 -2
package/fesm2022/bx-rest.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, Injectable } from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
import { throwError, ReplaySubject, last, shareReplay, mergeMap, concat, from, concatMap, tap, Subscription, of, forkJoin } from 'rxjs';
|
|
3
|
+
import { Subscription, of, mergeMap, throwError, forkJoin, ReplaySubject, last, shareReplay, concat, from, concatMap, tap } from 'rxjs';
|
|
5
4
|
import clone from 'just-clone';
|
|
6
5
|
import { DateTime } from 'luxon';
|
|
7
6
|
import * as i2 from '@angular/common/http';
|
|
8
7
|
import { HttpParams, HttpHeaders } from '@angular/common/http';
|
|
9
8
|
import flatten from 'just-flatten-it';
|
|
9
|
+
import { map, catchError, take, mergeMap as mergeMap$1 } from 'rxjs/operators';
|
|
10
10
|
import camelCase from 'just-camel-case';
|
|
11
11
|
import values from 'just-values';
|
|
12
12
|
|
|
@@ -34,266 +34,6 @@ function instanceOfiBXRestAnswerSuccess(object) {
|
|
|
34
34
|
return 'result' in object;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
class NavvySupport {
|
|
38
|
-
constructor(requestClass, mapClass) {
|
|
39
|
-
this.requestClass = requestClass;
|
|
40
|
-
this.mapClass = mapClass;
|
|
41
|
-
this.pageSize = 50; // стандартный размер страницы
|
|
42
|
-
}
|
|
43
|
-
mapAndError(request) {
|
|
44
|
-
return request.pipe(map(v => BXRestMapResult(v)), catchError(err => {
|
|
45
|
-
console.error(err);
|
|
46
|
-
return throwError(() => err);
|
|
47
|
-
}));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
class NavvySimple extends NavvySupport {
|
|
52
|
-
constructor(requestClass, mapClass, func, map = undefined) {
|
|
53
|
-
super(requestClass, mapClass);
|
|
54
|
-
this.func = func;
|
|
55
|
-
this.map = map;
|
|
56
|
-
}
|
|
57
|
-
resultVanilla() {
|
|
58
|
-
return this.func;
|
|
59
|
-
}
|
|
60
|
-
result() {
|
|
61
|
-
return this.mapAndError(this.func).pipe(map(v => (this.map) ? this.map.call(this.mapClass, v) : v));
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
class NavvyPagNavBase extends NavvySupport {
|
|
66
|
-
constructor(requestClass, mapClass, func, param, map = undefined) {
|
|
67
|
-
super(requestClass, mapClass);
|
|
68
|
-
this.func = func;
|
|
69
|
-
this.param = param;
|
|
70
|
-
this.map = map;
|
|
71
|
-
// load: number = 0
|
|
72
|
-
this.load$ = new ReplaySubject(1);
|
|
73
|
-
this.load$.next(0.001);
|
|
74
|
-
}
|
|
75
|
-
resultVanilla() {
|
|
76
|
-
return this.func.call(this.requestClass, this.param);
|
|
77
|
-
}
|
|
78
|
-
mapForVanilla() {
|
|
79
|
-
return this.mapForVanillaEnd(this.func, this.param);
|
|
80
|
-
}
|
|
81
|
-
mapForVanillaEnd(func, param) {
|
|
82
|
-
return func.call(this.requestClass, param).pipe(map(v => (v && instanceOfiBXRestAnswerSuccess(v) && this.map) ? Object.assign(v, { result: this.map.call(this.mapClass, v.result) }) : v));
|
|
83
|
-
}
|
|
84
|
-
result() {
|
|
85
|
-
return this.resultEnd(this.func, this.param);
|
|
86
|
-
}
|
|
87
|
-
resultEnd(func, param) {
|
|
88
|
-
return this.mapAndError(func.call(this.requestClass, param)).pipe(map(v => (v && this.map) ? this.map.call(this.mapClass, v) : v));
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Класс-прослойка-обработчик для методов работающих на альтернативной постраничной навигации тика как методы по
|
|
94
|
-
* затраченному времени на задачи https://dev.1c-bitrix.ru/rest_help/tasks/task/elapseditem/index.php
|
|
95
|
-
*
|
|
96
|
-
* не завершенный класс, работаем от частного к общему
|
|
97
|
-
*/
|
|
98
|
-
class NavvyAlterPagNav extends NavvyPagNavBase {
|
|
99
|
-
resultAll() {
|
|
100
|
-
let save = [];
|
|
101
|
-
return this.resultAllEnd()
|
|
102
|
-
.pipe(map(v => {
|
|
103
|
-
if (v) {
|
|
104
|
-
save.push(...v);
|
|
105
|
-
}
|
|
106
|
-
return save;
|
|
107
|
-
}), last(), shareReplay(1));
|
|
108
|
-
}
|
|
109
|
-
resultAllEnd() {
|
|
110
|
-
// return this.mapForVanillaEnd(this.func, this.param)
|
|
111
|
-
return this.resultVanilla().pipe(mergeMap(items => {
|
|
112
|
-
if (items && instanceOfiBXRestAnswerSuccess(items)) {
|
|
113
|
-
if (items.total && items.next) {
|
|
114
|
-
let requests = [];
|
|
115
|
-
for (let i = items.next; i < items.total; i = i + this.pageSize) {
|
|
116
|
-
let paramClone = clone(this.param);
|
|
117
|
-
paramClone.PARAMS = {
|
|
118
|
-
NAV_PARAMS: {
|
|
119
|
-
nPageSize: this.pageSize,
|
|
120
|
-
iNumPage: i / this.pageSize + 1
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
requests.push(paramClone);
|
|
124
|
-
}
|
|
125
|
-
return concat(this.mapResultForGetAll(items), from(requests).pipe(concatMap(param => this.resultEnd(this.func, param).pipe(tap(_ => {
|
|
126
|
-
if (param && param.PARAMS && items.total) {
|
|
127
|
-
this.load$.next((param.PARAMS.NAV_PARAMS.iNumPage * this.pageSize + this.pageSize) / items.total);
|
|
128
|
-
}
|
|
129
|
-
})))));
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return this.mapResultForGetAll(items);
|
|
133
|
-
}), catchError(err => {
|
|
134
|
-
// this.snackBar.error("Проблемы с поточным получение затреканого времени")
|
|
135
|
-
console.error(err);
|
|
136
|
-
return throwError(() => err);
|
|
137
|
-
}));
|
|
138
|
-
}
|
|
139
|
-
mapResultForGetAll(items) {
|
|
140
|
-
return (instanceOfiBXRestAnswerSuccess(items)) ? from([items.result]).pipe(map(v => (v && this.map) ? this.map.call(this.mapClass, v) : v)) : from([]);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
class NavvyPagNav extends NavvyPagNavBase {
|
|
145
|
-
// TODO: test for all methods
|
|
146
|
-
// resultAll() {
|
|
147
|
-
// this.param.start = -1
|
|
148
|
-
// return this.resultEnd(this.func, this.param)
|
|
149
|
-
// }
|
|
150
|
-
resultAll() {
|
|
151
|
-
let save = [];
|
|
152
|
-
return this.resultAllEnd()
|
|
153
|
-
.pipe(map(v => {
|
|
154
|
-
if (v) {
|
|
155
|
-
save.push(...v);
|
|
156
|
-
}
|
|
157
|
-
return save;
|
|
158
|
-
}), last(), shareReplay(1));
|
|
159
|
-
}
|
|
160
|
-
resultAllEnd() {
|
|
161
|
-
return this.resultVanilla().pipe(mergeMap(items => {
|
|
162
|
-
if (items && instanceOfiBXRestAnswerSuccess(items)) {
|
|
163
|
-
if (items.total && items.next) {
|
|
164
|
-
let requests = [];
|
|
165
|
-
for (let i = items.next; i < items.total; i = i + this.pageSize) {
|
|
166
|
-
let paramClone = clone(this.param);
|
|
167
|
-
paramClone.start = i;
|
|
168
|
-
requests.push(paramClone);
|
|
169
|
-
}
|
|
170
|
-
return concat(this.mapResultForGetAll(items), from(requests).pipe(concatMap(param => this.resultEnd(this.func, param))));
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return this.mapResultForGetAll(items);
|
|
174
|
-
}), catchError(err => {
|
|
175
|
-
console.error(err);
|
|
176
|
-
return throwError(() => err);
|
|
177
|
-
}));
|
|
178
|
-
}
|
|
179
|
-
mapResultForGetAll(items) {
|
|
180
|
-
return (instanceOfiBXRestAnswerSuccess(items)) ? from([items.result]).pipe(map(v => (v && this.map) ? this.map.call(this.mapClass, v) : v)) : from([]);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
class NavvyPagNavWithUselessKey extends NavvyPagNavBase {
|
|
185
|
-
resultAll() {
|
|
186
|
-
let save = [];
|
|
187
|
-
return this.resultAllEnd()
|
|
188
|
-
.pipe(map(v => {
|
|
189
|
-
if (v) {
|
|
190
|
-
save.push(...v);
|
|
191
|
-
}
|
|
192
|
-
return save;
|
|
193
|
-
}), last());
|
|
194
|
-
}
|
|
195
|
-
resultAllEnd() {
|
|
196
|
-
return this.mapForVanillaEnd(this.func, this.param).pipe(mergeMap(items => {
|
|
197
|
-
if (items && instanceOfiBXRestAnswerSuccess(items)) {
|
|
198
|
-
if (items.total && items.next) {
|
|
199
|
-
let requests = [];
|
|
200
|
-
for (let i = 0; i < items.total; i = i + this.pageSize) {
|
|
201
|
-
let paramClone = clone(this.param);
|
|
202
|
-
paramClone.start = i;
|
|
203
|
-
requests.push(paramClone);
|
|
204
|
-
}
|
|
205
|
-
/*
|
|
206
|
-
return from(requests.map(param => this.resultEnd(this.func, param))).pipe(
|
|
207
|
-
// toArray(),
|
|
208
|
-
mergeMap(v => {
|
|
209
|
-
return v
|
|
210
|
-
})
|
|
211
|
-
)
|
|
212
|
-
*/
|
|
213
|
-
return from(requests).pipe(concatMap(param => this.resultEnd(this.func, param)));
|
|
214
|
-
/*
|
|
215
|
-
return this.getAllTaskElapsedItem(func, param).pipe(
|
|
216
|
-
map(vEnd => {
|
|
217
|
-
if (vEnd && vEnd.result && items.result) {
|
|
218
|
-
return merge(clone(vEnd), {result: [...items.result, ...vEnd.result]})
|
|
219
|
-
}
|
|
220
|
-
return items
|
|
221
|
-
})
|
|
222
|
-
)
|
|
223
|
-
*/
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
return from([1]).pipe(concatMap(_ => this.resultEnd(this.func, this.param)));
|
|
227
|
-
// return from([BXRestMapResult(items)])
|
|
228
|
-
// as ReturnType<Observable<T | undefined>, Observable<R | undefined>>
|
|
229
|
-
}), catchError(err => {
|
|
230
|
-
// this.snackBar.error("Проблемы с поточным получение затреканого времени")
|
|
231
|
-
console.error(err);
|
|
232
|
-
return throwError(() => err);
|
|
233
|
-
}));
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
class NavvyPagNavTasks extends NavvyPagNavBase {
|
|
238
|
-
resultAll() {
|
|
239
|
-
let save = [];
|
|
240
|
-
return this.resultAllEnd()
|
|
241
|
-
.pipe(map(v => {
|
|
242
|
-
if (v) {
|
|
243
|
-
save.push(...v);
|
|
244
|
-
}
|
|
245
|
-
return save;
|
|
246
|
-
}), last(), shareReplay(1));
|
|
247
|
-
}
|
|
248
|
-
resultAllEnd() {
|
|
249
|
-
return this.resultVanilla().pipe(mergeMap(items => {
|
|
250
|
-
if (items && instanceOfiBXRestAnswerSuccess(items)) {
|
|
251
|
-
if (items.total && items.next) {
|
|
252
|
-
let requests = [];
|
|
253
|
-
for (let i = items.next; i < items.total; i = i + this.pageSize) {
|
|
254
|
-
let paramClone = clone(this.param);
|
|
255
|
-
paramClone.start = i;
|
|
256
|
-
requests.push(paramClone);
|
|
257
|
-
}
|
|
258
|
-
return concat(this.mapResultForGetAll(items), from(requests).pipe(concatMap(param => this.resultEnd(this.func, param))));
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
return this.mapResultForGetAll(items);
|
|
262
|
-
}), catchError(err => {
|
|
263
|
-
console.error(err);
|
|
264
|
-
return throwError(() => err);
|
|
265
|
-
}));
|
|
266
|
-
}
|
|
267
|
-
mapResultForGetAll(items) {
|
|
268
|
-
return (instanceOfiBXRestAnswerSuccess(items)) ? from([items.result]).pipe(map(v => (v && this.map) ? this.map.call(this.mapClass, v) : v)) : from([]);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
class Navvy {
|
|
273
|
-
constructor(requestClass, mapClass) {
|
|
274
|
-
this.requestClass = requestClass;
|
|
275
|
-
this.mapClass = mapClass;
|
|
276
|
-
}
|
|
277
|
-
simple(func, map = undefined) {
|
|
278
|
-
return new NavvySimple(this.requestClass, this.mapClass, func.call(this.requestClass), map);
|
|
279
|
-
}
|
|
280
|
-
simpleWithArg(func, arg, map = undefined) {
|
|
281
|
-
return new NavvySimple(this.requestClass, this.mapClass, func.call(this.requestClass, arg), map);
|
|
282
|
-
}
|
|
283
|
-
PagNav(func, arg, map = undefined) {
|
|
284
|
-
return new NavvyPagNav(this.requestClass, this.mapClass, func, arg, map);
|
|
285
|
-
}
|
|
286
|
-
PagNavTasks(func, arg, map = undefined) {
|
|
287
|
-
return new NavvyPagNavTasks(this.requestClass, this.mapClass, func, arg, map);
|
|
288
|
-
}
|
|
289
|
-
PagNavWithUselessKey(func, arg, map = undefined) {
|
|
290
|
-
return new NavvyPagNavWithUselessKey(this.requestClass, this.mapClass, func, arg, map);
|
|
291
|
-
}
|
|
292
|
-
alterPagNav(func, arg, map = undefined) {
|
|
293
|
-
return new NavvyAlterPagNav(this.requestClass, this.mapClass, func, arg, map);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
37
|
const $get = 'get';
|
|
298
38
|
const $add = 'add';
|
|
299
39
|
const $set = 'set';
|
|
@@ -2619,229 +2359,523 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImpo
|
|
|
2619
2359
|
class BXRestLogBlogPost {
|
|
2620
2360
|
constructor(http) {
|
|
2621
2361
|
this.http = http;
|
|
2622
|
-
this.url = methods.log.blogpost;
|
|
2362
|
+
this.url = methods.log.blogpost;
|
|
2363
|
+
}
|
|
2364
|
+
add(param) {
|
|
2365
|
+
return this.http.post(this.url.add, param);
|
|
2366
|
+
}
|
|
2367
|
+
get(param = {}) {
|
|
2368
|
+
return this.http.post(this.url.get, param);
|
|
2369
|
+
}
|
|
2370
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestLogBlogPost, deps: [{ token: HttpBXServices }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2371
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestLogBlogPost, providedIn: 'root' }); }
|
|
2372
|
+
}
|
|
2373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestLogBlogPost, decorators: [{
|
|
2374
|
+
type: Injectable,
|
|
2375
|
+
args: [{
|
|
2376
|
+
providedIn: 'root'
|
|
2377
|
+
}]
|
|
2378
|
+
}], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
|
|
2379
|
+
|
|
2380
|
+
class BXRestLogBlogComment {
|
|
2381
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestLogBlogComment, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2382
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestLogBlogComment, providedIn: 'root' }); }
|
|
2383
|
+
}
|
|
2384
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestLogBlogComment, decorators: [{
|
|
2385
|
+
type: Injectable,
|
|
2386
|
+
args: [{
|
|
2387
|
+
providedIn: 'root'
|
|
2388
|
+
}]
|
|
2389
|
+
}] });
|
|
2390
|
+
|
|
2391
|
+
class BXRestLog {
|
|
2392
|
+
constructor(blogPost, blogComment) {
|
|
2393
|
+
this.blogPost = blogPost;
|
|
2394
|
+
this.blogComment = blogComment;
|
|
2395
|
+
}
|
|
2396
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestLog, deps: [{ token: BXRestLogBlogPost }, { token: BXRestLogBlogComment }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2397
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestLog, providedIn: 'root' }); }
|
|
2398
|
+
}
|
|
2399
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestLog, decorators: [{
|
|
2400
|
+
type: Injectable,
|
|
2401
|
+
args: [{
|
|
2402
|
+
providedIn: 'root'
|
|
2403
|
+
}]
|
|
2404
|
+
}], ctorParameters: function () { return [{ type: BXRestLogBlogPost }, { type: BXRestLogBlogComment }]; } });
|
|
2405
|
+
|
|
2406
|
+
class BXRestCalendarEvent {
|
|
2407
|
+
constructor(http) {
|
|
2408
|
+
this.http = http;
|
|
2409
|
+
this.url = methods.calendar.event;
|
|
2410
|
+
}
|
|
2411
|
+
get(param) {
|
|
2412
|
+
return this.http.post(this.url.get, param);
|
|
2413
|
+
}
|
|
2414
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestCalendarEvent, deps: [{ token: HttpBXServices }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2415
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestCalendarEvent, providedIn: 'root' }); }
|
|
2416
|
+
}
|
|
2417
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestCalendarEvent, decorators: [{
|
|
2418
|
+
type: Injectable,
|
|
2419
|
+
args: [{
|
|
2420
|
+
providedIn: 'root'
|
|
2421
|
+
}]
|
|
2422
|
+
}], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
|
|
2423
|
+
|
|
2424
|
+
class BXRestCalendar {
|
|
2425
|
+
constructor(event) {
|
|
2426
|
+
this.event = event;
|
|
2427
|
+
}
|
|
2428
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestCalendar, deps: [{ token: BXRestCalendarEvent }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2429
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestCalendar, providedIn: 'root' }); }
|
|
2430
|
+
}
|
|
2431
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestCalendar, decorators: [{
|
|
2432
|
+
type: Injectable,
|
|
2433
|
+
args: [{
|
|
2434
|
+
providedIn: 'root'
|
|
2435
|
+
}]
|
|
2436
|
+
}], ctorParameters: function () { return [{ type: BXRestCalendarEvent }]; } });
|
|
2437
|
+
|
|
2438
|
+
class BXRestSonetGroup {
|
|
2439
|
+
constructor(http) {
|
|
2440
|
+
this.http = http;
|
|
2441
|
+
this.url = methods.sonet_group;
|
|
2442
|
+
}
|
|
2443
|
+
// // TODO: filter и select позже нормально описать
|
|
2444
|
+
// getList(filter: any = {}, select: iWorkgroupFields[] = ['ID', 'NAME']){
|
|
2445
|
+
// return this.httpPost<iHttpAnswerBX<{workgroups: iListWorkgroup[]}>>(
|
|
2446
|
+
// this.url.get,
|
|
2447
|
+
// {
|
|
2448
|
+
// order: select,
|
|
2449
|
+
// filter: filter
|
|
2450
|
+
// }
|
|
2451
|
+
// )
|
|
2452
|
+
// }
|
|
2453
|
+
get(param = {}) {
|
|
2454
|
+
return this.http.post(this.url.get, param);
|
|
2455
|
+
}
|
|
2456
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestSonetGroup, deps: [{ token: HttpBXServices }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2457
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestSonetGroup, providedIn: 'root' }); }
|
|
2458
|
+
}
|
|
2459
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestSonetGroup, decorators: [{
|
|
2460
|
+
type: Injectable,
|
|
2461
|
+
args: [{
|
|
2462
|
+
providedIn: 'root'
|
|
2463
|
+
}]
|
|
2464
|
+
}], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
|
|
2465
|
+
|
|
2466
|
+
class BXRestServer {
|
|
2467
|
+
constructor(http) {
|
|
2468
|
+
this.http = http;
|
|
2469
|
+
this.url = methods.server;
|
|
2470
|
+
}
|
|
2471
|
+
time() {
|
|
2472
|
+
return this.http.post(this.url.time);
|
|
2473
|
+
}
|
|
2474
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestServer, deps: [{ token: HttpBXServices }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2475
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestServer, providedIn: 'root' }); }
|
|
2476
|
+
}
|
|
2477
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestServer, decorators: [{
|
|
2478
|
+
type: Injectable,
|
|
2479
|
+
args: [{
|
|
2480
|
+
providedIn: 'root'
|
|
2481
|
+
}]
|
|
2482
|
+
}], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
|
|
2483
|
+
|
|
2484
|
+
class BXRestDepartment {
|
|
2485
|
+
constructor(http) {
|
|
2486
|
+
this.http = http;
|
|
2487
|
+
this.url = {
|
|
2488
|
+
get: [$department, $get],
|
|
2489
|
+
del: [$department, $delete],
|
|
2490
|
+
add: [$department, $add],
|
|
2491
|
+
update: [$department, $update]
|
|
2492
|
+
};
|
|
2493
|
+
}
|
|
2494
|
+
get(param = {}) {
|
|
2495
|
+
return this.http.post(this.url.get, param);
|
|
2623
2496
|
}
|
|
2624
2497
|
add(param) {
|
|
2625
2498
|
return this.http.post(this.url.add, param);
|
|
2626
2499
|
}
|
|
2627
|
-
|
|
2628
|
-
return this.http.post(this.url.
|
|
2500
|
+
del(param) {
|
|
2501
|
+
return this.http.post(this.url.del, param);
|
|
2629
2502
|
}
|
|
2630
|
-
|
|
2631
|
-
|
|
2503
|
+
update(param) {
|
|
2504
|
+
return this.http.post(this.url.update, param);
|
|
2505
|
+
}
|
|
2506
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestDepartment, deps: [{ token: HttpBXServices }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2507
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestDepartment, providedIn: 'root' }); }
|
|
2632
2508
|
}
|
|
2633
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type:
|
|
2509
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestDepartment, decorators: [{
|
|
2634
2510
|
type: Injectable,
|
|
2635
2511
|
args: [{
|
|
2636
2512
|
providedIn: 'root'
|
|
2637
2513
|
}]
|
|
2638
2514
|
}], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
|
|
2639
2515
|
|
|
2640
|
-
class
|
|
2641
|
-
|
|
2642
|
-
|
|
2516
|
+
class BXRestImChat {
|
|
2517
|
+
constructor(http) {
|
|
2518
|
+
this.http = http;
|
|
2519
|
+
this.url = methods.im.chat;
|
|
2520
|
+
}
|
|
2521
|
+
add(param) {
|
|
2522
|
+
return this.http.post(this.url.add, param);
|
|
2523
|
+
}
|
|
2524
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestImChat, deps: [{ token: HttpBXServices }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2525
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestImChat, providedIn: 'root' }); }
|
|
2643
2526
|
}
|
|
2644
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type:
|
|
2527
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestImChat, decorators: [{
|
|
2645
2528
|
type: Injectable,
|
|
2646
2529
|
args: [{
|
|
2647
2530
|
providedIn: 'root'
|
|
2648
2531
|
}]
|
|
2649
|
-
}] });
|
|
2532
|
+
}], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
|
|
2650
2533
|
|
|
2651
|
-
class
|
|
2652
|
-
constructor(
|
|
2653
|
-
this.
|
|
2654
|
-
this.blogComment = blogComment;
|
|
2534
|
+
class BXRestIm {
|
|
2535
|
+
constructor(chat) {
|
|
2536
|
+
this.chat = chat;
|
|
2655
2537
|
}
|
|
2656
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type:
|
|
2657
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type:
|
|
2538
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestIm, deps: [{ token: BXRestImChat }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2539
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestIm, providedIn: 'root' }); }
|
|
2658
2540
|
}
|
|
2659
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type:
|
|
2541
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestIm, decorators: [{
|
|
2660
2542
|
type: Injectable,
|
|
2661
2543
|
args: [{
|
|
2662
2544
|
providedIn: 'root'
|
|
2663
2545
|
}]
|
|
2664
|
-
}], ctorParameters: function () { return [{ type:
|
|
2546
|
+
}], ctorParameters: function () { return [{ type: BXRestImChat }]; } });
|
|
2665
2547
|
|
|
2666
|
-
class
|
|
2548
|
+
class BXRestApp {
|
|
2667
2549
|
constructor(http) {
|
|
2668
2550
|
this.http = http;
|
|
2669
|
-
this.url = methods.calendar.event;
|
|
2670
2551
|
}
|
|
2671
|
-
|
|
2672
|
-
|
|
2552
|
+
/**
|
|
2553
|
+
* Показ информации о приложении. Метод поддерживает безопасный вызов
|
|
2554
|
+
*/
|
|
2555
|
+
info() {
|
|
2556
|
+
return this.http.post(methods.app.info);
|
|
2673
2557
|
}
|
|
2674
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type:
|
|
2675
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type:
|
|
2558
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestApp, deps: [{ token: HttpBXServices }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2559
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestApp, providedIn: 'root' }); }
|
|
2676
2560
|
}
|
|
2677
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type:
|
|
2561
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestApp, decorators: [{
|
|
2678
2562
|
type: Injectable,
|
|
2679
2563
|
args: [{
|
|
2680
2564
|
providedIn: 'root'
|
|
2681
2565
|
}]
|
|
2682
2566
|
}], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
|
|
2683
2567
|
|
|
2684
|
-
class
|
|
2685
|
-
constructor(
|
|
2686
|
-
this.
|
|
2568
|
+
class BXRestTimeMan {
|
|
2569
|
+
constructor(http) {
|
|
2570
|
+
this.http = http;
|
|
2571
|
+
this.url = methods.timeman;
|
|
2687
2572
|
}
|
|
2688
|
-
|
|
2689
|
-
|
|
2573
|
+
status(param = undefined) {
|
|
2574
|
+
return this.http.post(this.url.status, param);
|
|
2575
|
+
}
|
|
2576
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestTimeMan, deps: [{ token: HttpBXServices }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2577
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestTimeMan, providedIn: 'root' }); }
|
|
2690
2578
|
}
|
|
2691
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type:
|
|
2579
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestTimeMan, decorators: [{
|
|
2692
2580
|
type: Injectable,
|
|
2693
2581
|
args: [{
|
|
2694
2582
|
providedIn: 'root'
|
|
2695
2583
|
}]
|
|
2696
|
-
}], ctorParameters: function () { return [{ type:
|
|
2584
|
+
}], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
|
|
2697
2585
|
|
|
2698
|
-
class
|
|
2699
|
-
constructor(http) {
|
|
2586
|
+
class BXRest {
|
|
2587
|
+
constructor(user, lists, task, tasks, disk, bizProc, log, calendar, sonet_group, server, department, im, app, timeMan, http) {
|
|
2588
|
+
this.user = user;
|
|
2589
|
+
this.lists = lists;
|
|
2590
|
+
this.task = task;
|
|
2591
|
+
this.tasks = tasks;
|
|
2592
|
+
this.disk = disk;
|
|
2593
|
+
this.bizProc = bizProc;
|
|
2594
|
+
this.log = log;
|
|
2595
|
+
this.calendar = calendar;
|
|
2596
|
+
this.sonet_group = sonet_group;
|
|
2597
|
+
this.server = server;
|
|
2598
|
+
this.department = department;
|
|
2599
|
+
this.im = im;
|
|
2600
|
+
this.app = app;
|
|
2601
|
+
this.timeMan = timeMan;
|
|
2700
2602
|
this.http = http;
|
|
2701
|
-
this.url = methods.sonet_group;
|
|
2702
2603
|
}
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
// return this.httpPost<iHttpAnswerBX<{workgroups: iListWorkgroup[]}>>(
|
|
2706
|
-
// this.url.get,
|
|
2707
|
-
// {
|
|
2708
|
-
// order: select,
|
|
2709
|
-
// filter: filter
|
|
2710
|
-
// }
|
|
2711
|
-
// )
|
|
2712
|
-
// }
|
|
2713
|
-
get(param = {}) {
|
|
2714
|
-
return this.http.post(this.url.get, param);
|
|
2604
|
+
profile() {
|
|
2605
|
+
return this.http.post(['profile']);
|
|
2715
2606
|
}
|
|
2716
|
-
|
|
2717
|
-
|
|
2607
|
+
batch(param) {
|
|
2608
|
+
return this.http.post(['batch'], param);
|
|
2609
|
+
}
|
|
2610
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRest, deps: [{ token: BXRestUser }, { token: BXRestLists }, { token: BXRestTask }, { token: BXRestTasks }, { token: BXRestDisk }, { token: BXRestBizProc }, { token: BXRestLog }, { token: BXRestCalendar }, { token: BXRestSonetGroup }, { token: BXRestServer }, { token: BXRestDepartment }, { token: BXRestIm }, { token: BXRestApp }, { token: BXRestTimeMan }, { token: HttpBXServices }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2611
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRest, providedIn: 'root' }); }
|
|
2718
2612
|
}
|
|
2719
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type:
|
|
2613
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRest, decorators: [{
|
|
2720
2614
|
type: Injectable,
|
|
2721
2615
|
args: [{
|
|
2722
2616
|
providedIn: 'root'
|
|
2723
2617
|
}]
|
|
2724
|
-
}], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
|
|
2618
|
+
}], ctorParameters: function () { return [{ type: BXRestUser }, { type: BXRestLists }, { type: BXRestTask }, { type: BXRestTasks }, { type: BXRestDisk }, { type: BXRestBizProc }, { type: BXRestLog }, { type: BXRestCalendar }, { type: BXRestSonetGroup }, { type: BXRestServer }, { type: BXRestDepartment }, { type: BXRestIm }, { type: BXRestApp }, { type: BXRestTimeMan }, { type: HttpBXServices }]; } });
|
|
2725
2619
|
|
|
2726
|
-
class
|
|
2727
|
-
constructor(
|
|
2728
|
-
this.
|
|
2729
|
-
this.
|
|
2620
|
+
class NavvySupport {
|
|
2621
|
+
constructor(requestClass, mapClass) {
|
|
2622
|
+
this.requestClass = requestClass;
|
|
2623
|
+
this.mapClass = mapClass;
|
|
2624
|
+
this.pageSize = 50; // стандартный размер страницы
|
|
2625
|
+
}
|
|
2626
|
+
mapAndError(request) {
|
|
2627
|
+
return request.pipe(map(v => BXRestMapResult(v)), catchError((err) => {
|
|
2628
|
+
console.error(err);
|
|
2629
|
+
throw new Error((err.error) ? err.error : err);
|
|
2630
|
+
}));
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
class NavvySimple extends NavvySupport {
|
|
2635
|
+
constructor(requestClass, mapClass, func, map = undefined) {
|
|
2636
|
+
super(requestClass, mapClass);
|
|
2637
|
+
this.func = func;
|
|
2638
|
+
this.map = map;
|
|
2639
|
+
}
|
|
2640
|
+
resultVanilla() {
|
|
2641
|
+
return this.func;
|
|
2642
|
+
}
|
|
2643
|
+
result() {
|
|
2644
|
+
return this.mapAndError(this.func).pipe(map(v => (this.map) ? this.map.call(this.mapClass, v) : v));
|
|
2645
|
+
}
|
|
2646
|
+
}
|
|
2647
|
+
|
|
2648
|
+
class NavvyPagNavBase extends NavvySupport {
|
|
2649
|
+
constructor(requestClass, mapClass, func, param, map = undefined) {
|
|
2650
|
+
super(requestClass, mapClass);
|
|
2651
|
+
this.func = func;
|
|
2652
|
+
this.param = param;
|
|
2653
|
+
this.map = map;
|
|
2654
|
+
// load: number = 0
|
|
2655
|
+
this.load$ = new ReplaySubject(1);
|
|
2656
|
+
this.load$.next(0.001);
|
|
2657
|
+
}
|
|
2658
|
+
resultVanilla() {
|
|
2659
|
+
return this.func.call(this.requestClass, this.param);
|
|
2660
|
+
}
|
|
2661
|
+
mapForVanilla() {
|
|
2662
|
+
return this.mapForVanillaEnd(this.func, this.param);
|
|
2663
|
+
}
|
|
2664
|
+
mapForVanillaEnd(func, param) {
|
|
2665
|
+
return func.call(this.requestClass, param).pipe(map(v => (v && instanceOfiBXRestAnswerSuccess(v) && this.map) ? Object.assign(v, { result: this.map.call(this.mapClass, v.result) }) : v));
|
|
2666
|
+
}
|
|
2667
|
+
result() {
|
|
2668
|
+
return this.resultEnd(this.func, this.param);
|
|
2669
|
+
}
|
|
2670
|
+
resultEnd(func, param) {
|
|
2671
|
+
return this.mapAndError(func.call(this.requestClass, param)).pipe(map(v => (v && this.map) ? this.map.call(this.mapClass, v) : v));
|
|
2672
|
+
}
|
|
2673
|
+
}
|
|
2674
|
+
|
|
2675
|
+
/**
|
|
2676
|
+
* Класс-прослойка-обработчик для методов работающих на альтернативной постраничной навигации тика как методы по
|
|
2677
|
+
* затраченному времени на задачи https://dev.1c-bitrix.ru/rest_help/tasks/task/elapseditem/index.php
|
|
2678
|
+
*
|
|
2679
|
+
* не завершенный класс, работаем от частного к общему
|
|
2680
|
+
*/
|
|
2681
|
+
class NavvyAlterPagNav extends NavvyPagNavBase {
|
|
2682
|
+
resultAll() {
|
|
2683
|
+
let save = [];
|
|
2684
|
+
return this.resultAllEnd()
|
|
2685
|
+
.pipe(map(v => {
|
|
2686
|
+
if (v) {
|
|
2687
|
+
save.push(...v);
|
|
2688
|
+
}
|
|
2689
|
+
return save;
|
|
2690
|
+
}), last(), shareReplay(1));
|
|
2691
|
+
}
|
|
2692
|
+
resultAllEnd() {
|
|
2693
|
+
// return this.mapForVanillaEnd(this.func, this.param)
|
|
2694
|
+
return this.resultVanilla().pipe(mergeMap(items => {
|
|
2695
|
+
if (items && instanceOfiBXRestAnswerSuccess(items)) {
|
|
2696
|
+
if (items.total && items.next) {
|
|
2697
|
+
let requests = [];
|
|
2698
|
+
for (let i = items.next; i < items.total; i = i + this.pageSize) {
|
|
2699
|
+
let paramClone = clone(this.param);
|
|
2700
|
+
paramClone.PARAMS = {
|
|
2701
|
+
NAV_PARAMS: {
|
|
2702
|
+
nPageSize: this.pageSize,
|
|
2703
|
+
iNumPage: i / this.pageSize + 1
|
|
2704
|
+
}
|
|
2705
|
+
};
|
|
2706
|
+
requests.push(paramClone);
|
|
2707
|
+
}
|
|
2708
|
+
return concat(this.mapResultForGetAll(items), from(requests).pipe(concatMap(param => this.resultEnd(this.func, param).pipe(tap(_ => {
|
|
2709
|
+
if (param && param.PARAMS && items.total) {
|
|
2710
|
+
this.load$.next((param.PARAMS.NAV_PARAMS.iNumPage * this.pageSize + this.pageSize) / items.total);
|
|
2711
|
+
}
|
|
2712
|
+
})))));
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
return this.mapResultForGetAll(items);
|
|
2716
|
+
}), catchError(err => {
|
|
2717
|
+
// this.snackBar.error("Проблемы с поточным получение затреканого времени")
|
|
2718
|
+
console.error(err);
|
|
2719
|
+
return throwError(() => err);
|
|
2720
|
+
}));
|
|
2721
|
+
}
|
|
2722
|
+
mapResultForGetAll(items) {
|
|
2723
|
+
return (instanceOfiBXRestAnswerSuccess(items)) ? from([items.result]).pipe(map(v => (v && this.map) ? this.map.call(this.mapClass, v) : v)) : from([]);
|
|
2724
|
+
}
|
|
2725
|
+
}
|
|
2726
|
+
|
|
2727
|
+
class NavvyPagNav extends NavvyPagNavBase {
|
|
2728
|
+
// TODO: test for all methods
|
|
2729
|
+
// resultAll() {
|
|
2730
|
+
// this.param.start = -1
|
|
2731
|
+
// return this.resultEnd(this.func, this.param)
|
|
2732
|
+
// }
|
|
2733
|
+
resultAll() {
|
|
2734
|
+
let save = [];
|
|
2735
|
+
return this.resultAllEnd()
|
|
2736
|
+
.pipe(map(v => {
|
|
2737
|
+
if (v) {
|
|
2738
|
+
save.push(...v);
|
|
2739
|
+
}
|
|
2740
|
+
return save;
|
|
2741
|
+
}), last(), shareReplay(1));
|
|
2730
2742
|
}
|
|
2731
|
-
|
|
2732
|
-
return this.
|
|
2743
|
+
resultAllEnd() {
|
|
2744
|
+
return this.resultVanilla().pipe(mergeMap(items => {
|
|
2745
|
+
if (items && instanceOfiBXRestAnswerSuccess(items)) {
|
|
2746
|
+
if (items.total && items.next) {
|
|
2747
|
+
let requests = [];
|
|
2748
|
+
for (let i = items.next; i < items.total; i = i + this.pageSize) {
|
|
2749
|
+
let paramClone = clone(this.param);
|
|
2750
|
+
paramClone.start = i;
|
|
2751
|
+
requests.push(paramClone);
|
|
2752
|
+
}
|
|
2753
|
+
return concat(this.mapResultForGetAll(items), from(requests).pipe(concatMap(param => this.resultEnd(this.func, param))));
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
return this.mapResultForGetAll(items);
|
|
2757
|
+
}), catchError(err => {
|
|
2758
|
+
console.error(err);
|
|
2759
|
+
return throwError(() => err);
|
|
2760
|
+
}));
|
|
2733
2761
|
}
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
}
|
|
2737
|
-
|
|
2738
|
-
type: Injectable,
|
|
2739
|
-
args: [{
|
|
2740
|
-
providedIn: 'root'
|
|
2741
|
-
}]
|
|
2742
|
-
}], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
|
|
2762
|
+
mapResultForGetAll(items) {
|
|
2763
|
+
return (instanceOfiBXRestAnswerSuccess(items)) ? from([items.result]).pipe(map(v => (v && this.map) ? this.map.call(this.mapClass, v) : v)) : from([]);
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
2743
2766
|
|
|
2744
|
-
class
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
this.
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2767
|
+
class NavvyPagNavWithUselessKey extends NavvyPagNavBase {
|
|
2768
|
+
resultAll() {
|
|
2769
|
+
let save = [];
|
|
2770
|
+
return this.resultAllEnd()
|
|
2771
|
+
.pipe(map(v => {
|
|
2772
|
+
if (v) {
|
|
2773
|
+
save.push(...v);
|
|
2774
|
+
}
|
|
2775
|
+
return save;
|
|
2776
|
+
}), last());
|
|
2753
2777
|
}
|
|
2754
|
-
|
|
2755
|
-
return this.
|
|
2778
|
+
resultAllEnd() {
|
|
2779
|
+
return this.mapForVanillaEnd(this.func, this.param).pipe(mergeMap(items => {
|
|
2780
|
+
if (items && instanceOfiBXRestAnswerSuccess(items)) {
|
|
2781
|
+
if (items.total && items.next) {
|
|
2782
|
+
let requests = [];
|
|
2783
|
+
for (let i = 0; i < items.total; i = i + this.pageSize) {
|
|
2784
|
+
let paramClone = clone(this.param);
|
|
2785
|
+
paramClone.start = i;
|
|
2786
|
+
requests.push(paramClone);
|
|
2787
|
+
}
|
|
2788
|
+
/*
|
|
2789
|
+
return from(requests.map(param => this.resultEnd(this.func, param))).pipe(
|
|
2790
|
+
// toArray(),
|
|
2791
|
+
mergeMap(v => {
|
|
2792
|
+
return v
|
|
2793
|
+
})
|
|
2794
|
+
)
|
|
2795
|
+
*/
|
|
2796
|
+
return from(requests).pipe(concatMap(param => this.resultEnd(this.func, param)));
|
|
2797
|
+
/*
|
|
2798
|
+
return this.getAllTaskElapsedItem(func, param).pipe(
|
|
2799
|
+
map(vEnd => {
|
|
2800
|
+
if (vEnd && vEnd.result && items.result) {
|
|
2801
|
+
return merge(clone(vEnd), {result: [...items.result, ...vEnd.result]})
|
|
2802
|
+
}
|
|
2803
|
+
return items
|
|
2804
|
+
})
|
|
2805
|
+
)
|
|
2806
|
+
*/
|
|
2807
|
+
}
|
|
2808
|
+
}
|
|
2809
|
+
return from([1]).pipe(concatMap(_ => this.resultEnd(this.func, this.param)));
|
|
2810
|
+
// return from([BXRestMapResult(items)])
|
|
2811
|
+
// as ReturnType<Observable<T | undefined>, Observable<R | undefined>>
|
|
2812
|
+
}), catchError(err => {
|
|
2813
|
+
// this.snackBar.error("Проблемы с поточным получение затреканого времени")
|
|
2814
|
+
console.error(err);
|
|
2815
|
+
return throwError(() => err);
|
|
2816
|
+
}));
|
|
2756
2817
|
}
|
|
2757
|
-
|
|
2758
|
-
|
|
2818
|
+
}
|
|
2819
|
+
|
|
2820
|
+
class NavvyPagNavTasks extends NavvyPagNavBase {
|
|
2821
|
+
resultAll() {
|
|
2822
|
+
let save = [];
|
|
2823
|
+
return this.resultAllEnd()
|
|
2824
|
+
.pipe(map(v => {
|
|
2825
|
+
if (v) {
|
|
2826
|
+
save.push(...v);
|
|
2827
|
+
}
|
|
2828
|
+
return save;
|
|
2829
|
+
}), last(), shareReplay(1));
|
|
2759
2830
|
}
|
|
2760
|
-
|
|
2761
|
-
return this.
|
|
2831
|
+
resultAllEnd() {
|
|
2832
|
+
return this.resultVanilla().pipe(mergeMap(items => {
|
|
2833
|
+
if (items && instanceOfiBXRestAnswerSuccess(items)) {
|
|
2834
|
+
if (items.total && items.next) {
|
|
2835
|
+
let requests = [];
|
|
2836
|
+
for (let i = items.next; i < items.total; i = i + this.pageSize) {
|
|
2837
|
+
let paramClone = clone(this.param);
|
|
2838
|
+
paramClone.start = i;
|
|
2839
|
+
requests.push(paramClone);
|
|
2840
|
+
}
|
|
2841
|
+
return concat(this.mapResultForGetAll(items), from(requests).pipe(concatMap(param => this.resultEnd(this.func, param))));
|
|
2842
|
+
}
|
|
2843
|
+
}
|
|
2844
|
+
return this.mapResultForGetAll(items);
|
|
2845
|
+
}), catchError(err => {
|
|
2846
|
+
console.error(err);
|
|
2847
|
+
return throwError(() => err);
|
|
2848
|
+
}));
|
|
2762
2849
|
}
|
|
2763
|
-
|
|
2764
|
-
return this.
|
|
2850
|
+
mapResultForGetAll(items) {
|
|
2851
|
+
return (instanceOfiBXRestAnswerSuccess(items)) ? from([items.result]).pipe(map(v => (v && this.map) ? this.map.call(this.mapClass, v) : v)) : from([]);
|
|
2765
2852
|
}
|
|
2766
|
-
|
|
2767
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestDepartment, providedIn: 'root' }); }
|
|
2768
|
-
}
|
|
2769
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestDepartment, decorators: [{
|
|
2770
|
-
type: Injectable,
|
|
2771
|
-
args: [{
|
|
2772
|
-
providedIn: 'root'
|
|
2773
|
-
}]
|
|
2774
|
-
}], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
|
|
2853
|
+
}
|
|
2775
2854
|
|
|
2776
|
-
class
|
|
2777
|
-
constructor(
|
|
2778
|
-
this.
|
|
2779
|
-
this.
|
|
2855
|
+
class Navvy {
|
|
2856
|
+
constructor(requestClass, mapClass) {
|
|
2857
|
+
this.requestClass = requestClass;
|
|
2858
|
+
this.mapClass = mapClass;
|
|
2780
2859
|
}
|
|
2781
|
-
|
|
2782
|
-
return this.
|
|
2860
|
+
simple(func, map = undefined) {
|
|
2861
|
+
return new NavvySimple(this.requestClass, this.mapClass, func.call(this.requestClass), map);
|
|
2783
2862
|
}
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
}
|
|
2787
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestImChat, decorators: [{
|
|
2788
|
-
type: Injectable,
|
|
2789
|
-
args: [{
|
|
2790
|
-
providedIn: 'root'
|
|
2791
|
-
}]
|
|
2792
|
-
}], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
|
|
2793
|
-
|
|
2794
|
-
class BXRestIm {
|
|
2795
|
-
constructor(chat) {
|
|
2796
|
-
this.chat = chat;
|
|
2863
|
+
simpleWithArg(func, arg, map = undefined) {
|
|
2864
|
+
return new NavvySimple(this.requestClass, this.mapClass, func.call(this.requestClass, arg), map);
|
|
2797
2865
|
}
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
}
|
|
2801
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestIm, decorators: [{
|
|
2802
|
-
type: Injectable,
|
|
2803
|
-
args: [{
|
|
2804
|
-
providedIn: 'root'
|
|
2805
|
-
}]
|
|
2806
|
-
}], ctorParameters: function () { return [{ type: BXRestImChat }]; } });
|
|
2807
|
-
|
|
2808
|
-
class BXRestApp {
|
|
2809
|
-
constructor(http) {
|
|
2810
|
-
this.http = http;
|
|
2866
|
+
PagNav(func, arg, map = undefined) {
|
|
2867
|
+
return new NavvyPagNav(this.requestClass, this.mapClass, func, arg, map);
|
|
2811
2868
|
}
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
*/
|
|
2815
|
-
info() {
|
|
2816
|
-
return this.http.post(methods.app.info);
|
|
2869
|
+
PagNavTasks(func, arg, map = undefined) {
|
|
2870
|
+
return new NavvyPagNavTasks(this.requestClass, this.mapClass, func, arg, map);
|
|
2817
2871
|
}
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
}
|
|
2821
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestApp, decorators: [{
|
|
2822
|
-
type: Injectable,
|
|
2823
|
-
args: [{
|
|
2824
|
-
providedIn: 'root'
|
|
2825
|
-
}]
|
|
2826
|
-
}], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
|
|
2827
|
-
|
|
2828
|
-
class BXRestTimeMan {
|
|
2829
|
-
constructor(http) {
|
|
2830
|
-
this.http = http;
|
|
2831
|
-
this.url = methods.timeman;
|
|
2872
|
+
PagNavWithUselessKey(func, arg, map = undefined) {
|
|
2873
|
+
return new NavvyPagNavWithUselessKey(this.requestClass, this.mapClass, func, arg, map);
|
|
2832
2874
|
}
|
|
2833
|
-
|
|
2834
|
-
return this.
|
|
2875
|
+
alterPagNav(func, arg, map = undefined) {
|
|
2876
|
+
return new NavvyAlterPagNav(this.requestClass, this.mapClass, func, arg, map);
|
|
2835
2877
|
}
|
|
2836
|
-
|
|
2837
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestTimeMan, providedIn: 'root' }); }
|
|
2838
|
-
}
|
|
2839
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRestTimeMan, decorators: [{
|
|
2840
|
-
type: Injectable,
|
|
2841
|
-
args: [{
|
|
2842
|
-
providedIn: 'root'
|
|
2843
|
-
}]
|
|
2844
|
-
}], ctorParameters: function () { return [{ type: HttpBXServices }]; } });
|
|
2878
|
+
}
|
|
2845
2879
|
|
|
2846
2880
|
class BaseMapServices extends BaseServices {
|
|
2847
2881
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BaseMapServices, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -2972,7 +3006,7 @@ class BXRestNavvyUser {
|
|
|
2972
3006
|
this.BXRestUser = BXRestUser;
|
|
2973
3007
|
this.userField = userField;
|
|
2974
3008
|
this.def = {
|
|
2975
|
-
params: { ACTIVE:
|
|
3009
|
+
params: { ACTIVE: true, start: 0 }
|
|
2976
3010
|
};
|
|
2977
3011
|
this.Navvy = new Navvy(this.BXRestUser, this.BXRestUserMap);
|
|
2978
3012
|
}
|
|
@@ -3100,12 +3134,9 @@ class BXRestNavvyUser {
|
|
|
3100
3134
|
if (!params.FILTER) {
|
|
3101
3135
|
params.FILTER = {};
|
|
3102
3136
|
}
|
|
3103
|
-
if (!params.hasOwnProperty('ACTIVE')) {
|
|
3137
|
+
if (!params.FILTER.hasOwnProperty('ACTIVE')) {
|
|
3104
3138
|
params.FILTER.ACTIVE = this.def.params.ACTIVE;
|
|
3105
3139
|
}
|
|
3106
|
-
if (params.FILTER.ACTIVE && params.FILTER.ACTIVE === 2) {
|
|
3107
|
-
delete params.FILTER.ACTIVE;
|
|
3108
|
-
}
|
|
3109
3140
|
if (!params.hasOwnProperty('start')) {
|
|
3110
3141
|
params.start = this.def.params.start;
|
|
3111
3142
|
}
|
|
@@ -5389,39 +5420,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImpo
|
|
|
5389
5420
|
}]
|
|
5390
5421
|
}] });
|
|
5391
5422
|
|
|
5392
|
-
class BXRest {
|
|
5393
|
-
constructor(user, lists, task, tasks, disk, bizProc, log, calendar, sonet_group, server, department, im, app, timeMan, http) {
|
|
5394
|
-
this.user = user;
|
|
5395
|
-
this.lists = lists;
|
|
5396
|
-
this.task = task;
|
|
5397
|
-
this.tasks = tasks;
|
|
5398
|
-
this.disk = disk;
|
|
5399
|
-
this.bizProc = bizProc;
|
|
5400
|
-
this.log = log;
|
|
5401
|
-
this.calendar = calendar;
|
|
5402
|
-
this.sonet_group = sonet_group;
|
|
5403
|
-
this.server = server;
|
|
5404
|
-
this.department = department;
|
|
5405
|
-
this.im = im;
|
|
5406
|
-
this.app = app;
|
|
5407
|
-
this.timeMan = timeMan;
|
|
5408
|
-
this.http = http;
|
|
5409
|
-
}
|
|
5410
|
-
profile() {
|
|
5411
|
-
return this.http.post(['profile']);
|
|
5412
|
-
}
|
|
5413
|
-
batch(param) {
|
|
5414
|
-
return this.http.post(['batch'], param);
|
|
5415
|
-
}
|
|
5416
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRest, deps: [{ token: BXRestUser }, { token: BXRestLists }, { token: BXRestTask }, { token: BXRestTasks }, { token: BXRestDisk }, { token: BXRestBizProc }, { token: BXRestLog }, { token: BXRestCalendar }, { token: BXRestSonetGroup }, { token: BXRestServer }, { token: BXRestDepartment }, { token: BXRestIm }, { token: BXRestApp }, { token: BXRestTimeMan }, { token: HttpBXServices }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
5417
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRest, providedIn: 'root' }); }
|
|
5418
|
-
}
|
|
5419
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BXRest, decorators: [{
|
|
5420
|
-
type: Injectable,
|
|
5421
|
-
args: [{
|
|
5422
|
-
providedIn: 'root'
|
|
5423
|
-
}]
|
|
5424
|
-
}], ctorParameters: function () { return [{ type: BXRestUser }, { type: BXRestLists }, { type: BXRestTask }, { type: BXRestTasks }, { type: BXRestDisk }, { type: BXRestBizProc }, { type: BXRestLog }, { type: BXRestCalendar }, { type: BXRestSonetGroup }, { type: BXRestServer }, { type: BXRestDepartment }, { type: BXRestIm }, { type: BXRestApp }, { type: BXRestTimeMan }, { type: HttpBXServices }]; } });
|
|
5425
5423
|
class BXRestNavvy {
|
|
5426
5424
|
constructor(user, lists, task, tasks, disk, bizProc, log, calendar, sonet_group, server, department, im, app, timeMan, BXRest, BXRestMap) {
|
|
5427
5425
|
this.user = user;
|
|
@@ -5463,7 +5461,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImpo
|
|
|
5463
5461
|
args: [{
|
|
5464
5462
|
providedIn: 'root'
|
|
5465
5463
|
}]
|
|
5466
|
-
}], ctorParameters: function () { return [{ type: BXRestNavvyUser }, { type: BXRestNavvyLists }, { type: BXRestNavvyTask }, { type: BXRestNavvyTasks }, { type: BXRestNavvyDisk }, { type: BXRestNavvyBizProc }, { type: BXRestNavvyLog }, { type: BXRestNavvyCalendar }, { type: BXRestNavvySonetGroup }, { type: BXRestNavvyServer }, { type: BXRestNavvyDepartment }, { type: BXRestNavvyIm }, { type: BXRestNavvyApp }, { type: BXRestNavvyTimeMan }, { type: BXRest }, { type: BXRestMaps }]; } });
|
|
5464
|
+
}], ctorParameters: function () { return [{ type: BXRestNavvyUser }, { type: BXRestNavvyLists }, { type: BXRestNavvyTask }, { type: BXRestNavvyTasks }, { type: BXRestNavvyDisk }, { type: BXRestNavvyBizProc }, { type: BXRestNavvyLog }, { type: BXRestNavvyCalendar }, { type: BXRestNavvySonetGroup }, { type: BXRestNavvyServer }, { type: BXRestNavvyDepartment }, { type: BXRestNavvyIm }, { type: BXRestNavvyApp }, { type: BXRestNavvyTimeMan }, { type: BXRest }, { type: BXRestMaps }]; } });
|
|
5465
|
+
|
|
5467
5466
|
class BXRestMap {
|
|
5468
5467
|
constructor(lists) {
|
|
5469
5468
|
this.lists = lists;
|
|
@@ -5576,7 +5575,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImpo
|
|
|
5576
5575
|
}]
|
|
5577
5576
|
}], ctorParameters: function () { return [{ type: BXRestMapUser }, { type: BXRestMapSonetGroup }, { type: BXRestMapServer }, { type: BXRestMapLists }, { type: BXRestDisk }, { type: BXRestMapCalendar }, { type: BXRestMapLog }, { type: BXRestMapTask }, { type: BXRestMapTasks }]; } });
|
|
5578
5577
|
|
|
5579
|
-
|
|
5578
|
+
/**
|
|
5580
5579
|
* Public API Surface of bx-rest
|
|
5581
5580
|
*/
|
|
5582
5581
|
|