bx-rest 0.6.0 → 0.6.2
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/README.md +2 -2
- package/esm2022/map/calendar/event.mjs +8 -5
- package/esm2022/map/calendar/section.mjs +17 -0
- package/esm2022/request-navvy/calendar/event.mjs +44 -24
- package/esm2022/request-navvy/calendar/section.mjs +35 -0
- package/esm2022/request-navvy/calendar.mjs +3 -7
- package/esm2022/request-navvy/department.mjs +2 -2
- package/esm2022/request-navvy/lists/element.mjs +2 -2
- package/esm2022/request-navvy/lists/field.mjs +2 -2
- package/esm2022/request-navvy/lists.mjs +2 -2
- package/esm2022/request-navvy/log/blogpost.mjs +2 -2
- package/esm2022/request-navvy/task/delegate/elapseditem.mjs +3 -3
- package/esm2022/request-navvy/task/item/userfield.mjs +2 -2
- package/esm2022/request-navvy/tasks/task/result.mjs +2 -2
- package/esm2022/request-navvy/tasks/task.mjs +2 -2
- package/esm2022/request-navvy/user.mjs +3 -3
- package/esm2022/rest/base.mjs +1 -3
- package/esm2022/services/navvy/navvy-alternative-pagination-navigation.mjs +25 -24
- package/esm2022/services/navvy/navvy-pag-nav-tasks.mjs +19 -15
- package/esm2022/services/navvy/navvy-pag-nav-with-useless-key.mjs +5 -4
- package/esm2022/services/navvy/navvy-pag.mjs +16 -15
- package/esm2022/services/navvy/navvy-support.mjs +1 -1
- package/esm2022/services/navvy.mjs +4 -4
- package/esm2022/typification/rest/batch.mjs +1 -1
- package/esm2022/typification/rest/calendar/event/add.mjs +2 -0
- package/esm2022/typification/rest/calendar/event/delete.mjs +2 -0
- package/esm2022/typification/rest/calendar/event/get/nearest.mjs +2 -0
- package/esm2022/typification/rest/calendar/event/get.mjs +2 -0
- package/esm2022/typification/rest/calendar/event/update.mjs +2 -0
- package/esm2022/typification/rest/calendar/get/answer.mjs +1 -1
- package/esm2022/typification/rest/calendar/section/add.mjs +2 -0
- package/esm2022/typification/rest/calendar/section/delete.mjs +2 -0
- package/esm2022/typification/rest/calendar/section/get.mjs +2 -0
- package/esm2022/typification/rest/calendar/section/update.mjs +2 -0
- package/fesm2022/bx-rest.mjs +169 -113
- package/fesm2022/bx-rest.mjs.map +1 -1
- package/map/calendar/event.d.ts +2 -1
- package/map/calendar/section.d.ts +5 -0
- package/package.json +2 -2
- package/request-navvy/calendar/event.d.ts +17 -2
- package/request-navvy/calendar/section.d.ts +16 -0
- package/request-navvy/calendar.d.ts +2 -0
- package/rest/base.d.ts +0 -2
- package/services/navvy/navvy-support.d.ts +2 -2
- package/services/navvy.d.ts +3 -3
- package/typification/rest/batch.d.ts +1 -1
- package/typification/rest/calendar/event/add.d.ts +145 -0
- package/typification/rest/calendar/event/delete.d.ts +3 -0
- package/typification/rest/calendar/event/get/nearest.d.ts +24 -0
- package/typification/rest/calendar/event/get.d.ts +136 -0
- package/typification/rest/calendar/event/update.d.ts +6 -0
- package/typification/rest/calendar/get/answer.d.ts +1 -1
- package/typification/rest/calendar/section/add.d.ts +10 -0
- package/typification/rest/calendar/section/delete.d.ts +6 -0
- package/typification/rest/calendar/section/get.d.ts +50 -0
- package/typification/rest/calendar/section/update.d.ts +10 -0
package/fesm2022/bx-rest.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Subscription, of, throwError, from, forkJoin, last, shareReplay, mergeMap, tap } from 'rxjs';
|
|
1
|
+
import { Subscription, of, throwError, from, forkJoin, last, shareReplay, mergeMap, concatMap, toArray, tap } from 'rxjs';
|
|
2
2
|
import clone from 'just-clone';
|
|
3
3
|
import { switchMap, map, catchError, take, mergeMap as mergeMap$1 } from 'rxjs/operators';
|
|
4
4
|
import axios from 'axios';
|
|
@@ -2116,22 +2116,6 @@ class BXRestLog {
|
|
|
2116
2116
|
}
|
|
2117
2117
|
}
|
|
2118
2118
|
|
|
2119
|
-
class BXRestCalendarEvent {
|
|
2120
|
-
constructor() {
|
|
2121
|
-
this.url = methods.calendar.event;
|
|
2122
|
-
this.http = new HttpBXServices();
|
|
2123
|
-
}
|
|
2124
|
-
get(param) {
|
|
2125
|
-
return this.http.post(this.url.get, param);
|
|
2126
|
-
}
|
|
2127
|
-
}
|
|
2128
|
-
|
|
2129
|
-
class BXRestCalendar {
|
|
2130
|
-
constructor() {
|
|
2131
|
-
this.event = new BXRestCalendarEvent();
|
|
2132
|
-
}
|
|
2133
|
-
}
|
|
2134
|
-
|
|
2135
2119
|
class BXRestSonetGroup {
|
|
2136
2120
|
constructor() {
|
|
2137
2121
|
this.url = methods.sonet_group;
|
|
@@ -2321,7 +2305,6 @@ class BXRest {
|
|
|
2321
2305
|
this.disk = new BXRestDisk();
|
|
2322
2306
|
this.bizProc = new BXRestBizProc();
|
|
2323
2307
|
this.log = new BXRestLog();
|
|
2324
|
-
this.calendar = new BXRestCalendar();
|
|
2325
2308
|
this.sonet_group = new BXRestSonetGroup();
|
|
2326
2309
|
this.server = new BXRestServer();
|
|
2327
2310
|
this.department = new BXRestDepartment();
|
|
@@ -2409,43 +2392,44 @@ class NavvyAlterPagNav extends NavvyPagBase {
|
|
|
2409
2392
|
if (items && instanceOfiBXRestAnswerSuccess(items)) {
|
|
2410
2393
|
if (items.total && items.next) {
|
|
2411
2394
|
const count = [...Array(Math.floor(items.total / this.pageSize)).keys()];
|
|
2412
|
-
const param = clone(this.param);
|
|
2413
2395
|
// Разделяем массив на блоки
|
|
2414
2396
|
const chunks = [];
|
|
2415
2397
|
for (let i = 0; i < count.length; i += this.pageSize) {
|
|
2416
2398
|
chunks.push(count.slice(i, i + this.pageSize));
|
|
2417
2399
|
}
|
|
2418
2400
|
const batchRequests = chunks.map(chunk => {
|
|
2419
|
-
if (!param.PARAMS) {
|
|
2420
|
-
param.PARAMS = {
|
|
2421
|
-
NAV_PARAMS: {
|
|
2422
|
-
iNumPage: 0,
|
|
2423
|
-
nPageSize: 50
|
|
2424
|
-
}
|
|
2425
|
-
};
|
|
2426
|
-
}
|
|
2427
2401
|
return BXRestClass.batch({
|
|
2428
2402
|
halt: 1,
|
|
2429
2403
|
cmd: chunk.map(i => {
|
|
2404
|
+
const param = clone(this.param);
|
|
2405
|
+
if (!param.PARAMS) {
|
|
2406
|
+
param.PARAMS = {
|
|
2407
|
+
NAV_PARAMS: {
|
|
2408
|
+
iNumPage: 0,
|
|
2409
|
+
nPageSize: 50
|
|
2410
|
+
}
|
|
2411
|
+
};
|
|
2412
|
+
}
|
|
2430
2413
|
// Устанавливаем start в зависимости от индекса
|
|
2431
|
-
param.PARAMS.NAV_PARAMS.iNumPage =
|
|
2414
|
+
param.PARAMS.NAV_PARAMS.iNumPage = i + 2; // первая страница уже есть, старт со второй
|
|
2432
2415
|
// Формируем строку запроса
|
|
2433
2416
|
return this.http.getNameMethod(this.url)
|
|
2434
2417
|
+ '?' + qs.stringify(param, { arrayFormat: 'brackets' });
|
|
2435
2418
|
})
|
|
2436
|
-
})
|
|
2437
|
-
if (v && instanceOfiBXRestAnswerSuccess(v) && v.result && v.result.result) {
|
|
2438
|
-
const res = items.result;
|
|
2439
|
-
res.push(...v.result.result.map(i => i).flat());
|
|
2440
|
-
return (this.map) ?
|
|
2441
|
-
this.map(res)
|
|
2442
|
-
: res;
|
|
2443
|
-
}
|
|
2444
|
-
throw new Error('wrong batch');
|
|
2445
|
-
}));
|
|
2419
|
+
});
|
|
2446
2420
|
});
|
|
2447
|
-
return
|
|
2448
|
-
|
|
2421
|
+
return from(batchRequests).pipe(concatMap(request => request), // Выполняет запросы по очереди
|
|
2422
|
+
toArray(), // Собирает все результаты в массив
|
|
2423
|
+
map(results => {
|
|
2424
|
+
const res = items.result;
|
|
2425
|
+
for (let result of results) {
|
|
2426
|
+
if (result && instanceOfiBXRestAnswerSuccess(result) && result.result && result.result.result) {
|
|
2427
|
+
res.push(...result.result.result.map(i => i).flat());
|
|
2428
|
+
}
|
|
2429
|
+
}
|
|
2430
|
+
return (this.map) ?
|
|
2431
|
+
this.map(res)
|
|
2432
|
+
: res;
|
|
2449
2433
|
}));
|
|
2450
2434
|
}
|
|
2451
2435
|
}
|
|
@@ -2472,7 +2456,6 @@ class NavvyPagNavWithUselessKey extends NavvyPagBase {
|
|
|
2472
2456
|
if (items && instanceOfiBXRestAnswerSuccess(items)) {
|
|
2473
2457
|
if (items.total && items.next) {
|
|
2474
2458
|
const count = [...Array(Math.floor(items.total / this.pageSize)).keys()];
|
|
2475
|
-
const param = clone(this.param);
|
|
2476
2459
|
// Разделяем массив на блоки
|
|
2477
2460
|
const chunks = [];
|
|
2478
2461
|
for (let i = 0; i < count.length; i += this.pageSize) {
|
|
@@ -2482,6 +2465,7 @@ class NavvyPagNavWithUselessKey extends NavvyPagBase {
|
|
|
2482
2465
|
return BXRestClass.batch({
|
|
2483
2466
|
halt: 1,
|
|
2484
2467
|
cmd: chunk.map(i => {
|
|
2468
|
+
const param = clone(this.param);
|
|
2485
2469
|
// Устанавливаем start в зависимости от индекса
|
|
2486
2470
|
param.start = (i + 1) * this.pageSize;
|
|
2487
2471
|
// Формируем строку запроса
|
|
@@ -2495,7 +2479,8 @@ class NavvyPagNavWithUselessKey extends NavvyPagBase {
|
|
|
2495
2479
|
throw new Error('wrong batch');
|
|
2496
2480
|
}));
|
|
2497
2481
|
});
|
|
2498
|
-
return
|
|
2482
|
+
return from(batchRequests).pipe(concatMap(request => request), // Выполняет запросы по очереди
|
|
2483
|
+
toArray()); // Собирает все результаты в массив
|
|
2499
2484
|
/*
|
|
2500
2485
|
return this.getAllTaskElapsedItem(func, param).pipe(
|
|
2501
2486
|
map(vEnd => {
|
|
@@ -2557,7 +2542,6 @@ class NavvyPagNavTasks extends NavvyPagBase {
|
|
|
2557
2542
|
// TODO: проверить будет ли быстрее работать метод в случаях когда total < 100 (то есть можно обойтись двумя прямыми запросами)
|
|
2558
2543
|
if (items.total && items.total > 50) {
|
|
2559
2544
|
const count = [...Array(Math.floor(items.total / this.pageSize)).keys()];
|
|
2560
|
-
const param = clone(this.param);
|
|
2561
2545
|
// Разделяем массив на блоки
|
|
2562
2546
|
const chunks = [];
|
|
2563
2547
|
for (let i = 0; i < count.length; i += this.pageSize) {
|
|
@@ -2567,25 +2551,30 @@ class NavvyPagNavTasks extends NavvyPagBase {
|
|
|
2567
2551
|
return BXRestClass.batch({
|
|
2568
2552
|
halt: 1,
|
|
2569
2553
|
cmd: chunk.map(i => {
|
|
2554
|
+
const param = clone(this.param);
|
|
2570
2555
|
// Устанавливаем start в зависимости от индекса
|
|
2571
2556
|
param.start = (i + 1) * this.pageSize;
|
|
2572
2557
|
// Формируем строку запроса
|
|
2573
2558
|
return this.http.getNameMethod(this.url)
|
|
2574
2559
|
+ '?' + qs.stringify(param, { arrayFormat: 'brackets' });
|
|
2575
2560
|
})
|
|
2576
|
-
})
|
|
2577
|
-
if (v && instanceOfiBXRestAnswerSuccess(v) && v.result && v.result.result && items.result && items.result.tasks) {
|
|
2578
|
-
const res = items.result.tasks;
|
|
2579
|
-
res.push(...v.result.result.filter(i => i).map(i => i.tasks).flat());
|
|
2580
|
-
return (this.map) ?
|
|
2581
|
-
this.map({ tasks: res })
|
|
2582
|
-
: res;
|
|
2583
|
-
}
|
|
2584
|
-
throw new Error('wrong batch');
|
|
2585
|
-
}));
|
|
2561
|
+
});
|
|
2586
2562
|
});
|
|
2587
|
-
return
|
|
2588
|
-
|
|
2563
|
+
return from(batchRequests).pipe(concatMap(request => request), // Выполняет запросы по очереди
|
|
2564
|
+
toArray(), // Собирает все результаты в массив
|
|
2565
|
+
map(results => {
|
|
2566
|
+
if (items.result && items.result.tasks) {
|
|
2567
|
+
const res = items.result.tasks;
|
|
2568
|
+
for (let result of results) {
|
|
2569
|
+
if (result && instanceOfiBXRestAnswerSuccess(result) && result.result && result.result.result) {
|
|
2570
|
+
res.push(...result.result.result.filter(i => i).map(i => i.tasks).flat());
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
return (this.map) ?
|
|
2574
|
+
this.map({ tasks: res })
|
|
2575
|
+
: res;
|
|
2576
|
+
}
|
|
2577
|
+
throw new Error('wrong batch');
|
|
2589
2578
|
}));
|
|
2590
2579
|
}
|
|
2591
2580
|
return this.mapResForGetAll(items);
|
|
@@ -2614,7 +2603,6 @@ class NavvyPag extends NavvyPagBase {
|
|
|
2614
2603
|
// TODO: проверить будет ли быстрее работать метод в случаях когда total < 100 (то есть можно обойтись двумя прямыми запросами)
|
|
2615
2604
|
if (items.total && items.total > 50) {
|
|
2616
2605
|
const count = [...Array(Math.floor(items.total / this.pageSize)).keys()];
|
|
2617
|
-
const param = clone(this.param);
|
|
2618
2606
|
// Разделяем массив на блоки
|
|
2619
2607
|
const chunks = [];
|
|
2620
2608
|
for (let i = 0; i < count.length; i += this.pageSize) {
|
|
@@ -2624,25 +2612,27 @@ class NavvyPag extends NavvyPagBase {
|
|
|
2624
2612
|
return BXRestClass.batch({
|
|
2625
2613
|
halt: 1,
|
|
2626
2614
|
cmd: chunk.map(i => {
|
|
2615
|
+
const param = clone(this.param);
|
|
2627
2616
|
// Устанавливаем start в зависимости от индекса
|
|
2628
2617
|
param.start = (i + 1) * this.pageSize;
|
|
2629
2618
|
// Формируем строку запроса
|
|
2630
2619
|
return this.http.getNameMethod(this.url)
|
|
2631
2620
|
+ '?' + qs.stringify(param, { arrayFormat: 'brackets' });
|
|
2632
2621
|
})
|
|
2633
|
-
}).pipe(
|
|
2634
|
-
if (v && instanceOfiBXRestAnswerSuccess(v) && v.result && v.result.result) {
|
|
2635
|
-
const res = items.result;
|
|
2636
|
-
res.push(...v.result.result.map(i => i).flat());
|
|
2637
|
-
return (this.map) ?
|
|
2638
|
-
this.map(res)
|
|
2639
|
-
: res;
|
|
2640
|
-
}
|
|
2641
|
-
throw new Error('wrong batch');
|
|
2642
|
-
}));
|
|
2622
|
+
}).pipe();
|
|
2643
2623
|
});
|
|
2644
|
-
return
|
|
2645
|
-
|
|
2624
|
+
return from(batchRequests).pipe(concatMap(request => request), // Выполняет запросы по очереди
|
|
2625
|
+
toArray(), // Собирает все результаты в массив
|
|
2626
|
+
map(results => {
|
|
2627
|
+
const res = items.result;
|
|
2628
|
+
for (let result of results) {
|
|
2629
|
+
if (result && instanceOfiBXRestAnswerSuccess(result) && result.result && result.result.result) {
|
|
2630
|
+
res.push(...result.result.result.map(i => i).flat());
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
return (this.map) ?
|
|
2634
|
+
this.map(res)
|
|
2635
|
+
: res;
|
|
2646
2636
|
}));
|
|
2647
2637
|
}
|
|
2648
2638
|
return this.mapResForGetAll(items);
|
|
@@ -2672,7 +2662,7 @@ class Navvy {
|
|
|
2672
2662
|
* @param map
|
|
2673
2663
|
* @constructor
|
|
2674
2664
|
*/
|
|
2675
|
-
|
|
2665
|
+
pagNav(url, arg, map) {
|
|
2676
2666
|
return new NavvyPag(url, arg, map);
|
|
2677
2667
|
}
|
|
2678
2668
|
// old PagNav
|
|
@@ -2688,12 +2678,12 @@ class Navvy {
|
|
|
2688
2678
|
// map: ((param: T[] | undefined) => R[] | undefined) | undefined) {
|
|
2689
2679
|
// return new NavvyBatch(this.requestClass, this.mapClass, func, arg, map)
|
|
2690
2680
|
// }
|
|
2691
|
-
|
|
2681
|
+
pagNavTasks(url,
|
|
2692
2682
|
// func: (param: A) => Observable<iBXRestAnswer<{tasks: T[] | undefined}> | undefined>,
|
|
2693
2683
|
arg, map) {
|
|
2694
2684
|
return new NavvyPagNavTasks(url, arg, map);
|
|
2695
2685
|
}
|
|
2696
|
-
|
|
2686
|
+
pagNavWithUselessKey(url,
|
|
2697
2687
|
// func: (param: A) => Observable<iBXRestAnswer<{ [key: string]: T }> | undefined>,
|
|
2698
2688
|
arg, map) {
|
|
2699
2689
|
return new NavvyPagNavWithUselessKey(url, arg, map);
|
|
@@ -2847,7 +2837,7 @@ class BXRestNavvyUser {
|
|
|
2847
2837
|
get(params = {}) {
|
|
2848
2838
|
let copyParams = clone(params);
|
|
2849
2839
|
this.setDefParam(copyParams);
|
|
2850
|
-
return this.Navvy.
|
|
2840
|
+
return this.Navvy.pagNav(this.url.get, copyParams, BXRestMapUser.get);
|
|
2851
2841
|
}
|
|
2852
2842
|
current() {
|
|
2853
2843
|
return this.Navvy.simple(this.url.current, undefined, BXRestMapUser.current);
|
|
@@ -2881,7 +2871,7 @@ class BXRestNavvyUser {
|
|
|
2881
2871
|
}
|
|
2882
2872
|
*/
|
|
2883
2873
|
search(params) {
|
|
2884
|
-
return this.Navvy.
|
|
2874
|
+
return this.Navvy.pagNav(this.url.search, params, BXRestMapUser.get);
|
|
2885
2875
|
}
|
|
2886
2876
|
access(params) {
|
|
2887
2877
|
return this.Navvy.simple(this.url.access, params);
|
|
@@ -3008,7 +2998,7 @@ class BXRestNavvyListsElement {
|
|
|
3008
2998
|
this.Navvy = new Navvy();
|
|
3009
2999
|
}
|
|
3010
3000
|
get(param) {
|
|
3011
|
-
return this.Navvy.
|
|
3001
|
+
return this.Navvy.pagNav(this.url.get, param, BXRestMapListsElement.get);
|
|
3012
3002
|
}
|
|
3013
3003
|
add(param) {
|
|
3014
3004
|
return this.Navvy.simple(this.url.add, param);
|
|
@@ -3110,7 +3100,7 @@ class BXRestNavvyListsField {
|
|
|
3110
3100
|
this.Navvy = new Navvy();
|
|
3111
3101
|
}
|
|
3112
3102
|
get(param) {
|
|
3113
|
-
return this.Navvy.
|
|
3103
|
+
return this.Navvy.pagNavWithUselessKey(this.url.get, param, BXRestMapListsField.get);
|
|
3114
3104
|
}
|
|
3115
3105
|
}
|
|
3116
3106
|
|
|
@@ -3198,7 +3188,7 @@ class BXRestNavvyLists {
|
|
|
3198
3188
|
// }
|
|
3199
3189
|
}
|
|
3200
3190
|
get(param) {
|
|
3201
|
-
return this.Navvy.
|
|
3191
|
+
return this.Navvy.pagNav(this.url.get, param, BXRestMapLists.get);
|
|
3202
3192
|
}
|
|
3203
3193
|
}
|
|
3204
3194
|
|
|
@@ -3395,7 +3385,7 @@ class BXRestNavvyTasksTaskResult {
|
|
|
3395
3385
|
return this.Navvy.simple(this.url.addFromComment, param, BXRestMapTasksTaskResult.addFromComment);
|
|
3396
3386
|
}
|
|
3397
3387
|
list(param) {
|
|
3398
|
-
return this.Navvy.
|
|
3388
|
+
return this.Navvy.pagNav(this.url.list, param, BXRestMapTasksTaskResult.list);
|
|
3399
3389
|
}
|
|
3400
3390
|
}
|
|
3401
3391
|
|
|
@@ -3544,7 +3534,7 @@ class BXRestNavvyTasksTask {
|
|
|
3544
3534
|
// Возможно можно обойтись без "S extends iBXRestTaskFieldsName[]",
|
|
3545
3535
|
// надо что бы понять то как генерировать интейфейс на лету исходя их входящих данных
|
|
3546
3536
|
list(param = {}) {
|
|
3547
|
-
return this.Navvy.
|
|
3537
|
+
return this.Navvy.pagNavTasks(this.url.list, param, (BXRestMapTasksTask.list));
|
|
3548
3538
|
}
|
|
3549
3539
|
/*
|
|
3550
3540
|
listArray(requestArray: RequestApiTaskListBX = {}) {
|
|
@@ -3640,7 +3630,7 @@ class BXRestNavvyDelegateElapsedItem {
|
|
|
3640
3630
|
};
|
|
3641
3631
|
}
|
|
3642
3632
|
}
|
|
3643
|
-
return this.Navvy.alterPagNav(
|
|
3633
|
+
return this.Navvy.alterPagNav([$task, $elapseditem, $getlist], param, BXRestMapTaskElapsedItem.getList);
|
|
3644
3634
|
}
|
|
3645
3635
|
}
|
|
3646
3636
|
|
|
@@ -4154,7 +4144,7 @@ class BXRestNavvyTaskItemUserField {
|
|
|
4154
4144
|
this.Navvy = new Navvy();
|
|
4155
4145
|
}
|
|
4156
4146
|
getList(param = {}) {
|
|
4157
|
-
return this.Navvy.
|
|
4147
|
+
return this.Navvy.pagNav(this.url.getList, param, BXRestMapTaskUserField.getList);
|
|
4158
4148
|
}
|
|
4159
4149
|
}
|
|
4160
4150
|
|
|
@@ -4848,7 +4838,7 @@ class BXRestNavvyLogBlogPost {
|
|
|
4848
4838
|
return this.Navvy.simple(this.url.add, param);
|
|
4849
4839
|
}
|
|
4850
4840
|
get(param = {}) {
|
|
4851
|
-
return this.Navvy.
|
|
4841
|
+
return this.Navvy.pagNav(this.url.get, param, BXRestMapLogBlogPost.get);
|
|
4852
4842
|
}
|
|
4853
4843
|
}
|
|
4854
4844
|
|
|
@@ -4868,6 +4858,9 @@ class BXRestNavvyLog {
|
|
|
4868
4858
|
}
|
|
4869
4859
|
|
|
4870
4860
|
class BXRestMapCalendarEvent {
|
|
4861
|
+
static getById(item) {
|
|
4862
|
+
return (item) ? BXRestMapCalendarEvent.CalendarEventGetAnswerHttpToCalendarEventGetAnswer(item) : undefined;
|
|
4863
|
+
}
|
|
4871
4864
|
static get(item) {
|
|
4872
4865
|
return (item) ? item.map(i => BXRestMapCalendarEvent.CalendarEventGetAnswerHttpToCalendarEventGetAnswer(i)) : undefined;
|
|
4873
4866
|
}
|
|
@@ -4884,13 +4877,13 @@ class BXRestMapCalendarEvent {
|
|
|
4884
4877
|
TZ_OFFSET_FROM: toNum(item.TZ_OFFSET_FROM),
|
|
4885
4878
|
TZ_OFFSET_TO: toNum(item.TZ_OFFSET_TO),
|
|
4886
4879
|
VERSION: toNum(item.VERSION),
|
|
4887
|
-
DATE_CREATE: toDate(item.DATE_CREATE, 'dd.MM.yyyy HH:mm:ss'
|
|
4888
|
-
DATE_FROM: toDate(item.DATE_FROM, 'dd.MM.yyyy HH:mm:ss'
|
|
4880
|
+
DATE_CREATE: toDate(item.DATE_CREATE, 'dd.MM.yyyy HH:mm:ss'),
|
|
4881
|
+
DATE_FROM: toDate(item.DATE_FROM, 'dd.MM.yyyy HH:mm:ss'),
|
|
4889
4882
|
ORIGINAL_DATE_FROM: (item.ORIGINAL_DATE_FROM)
|
|
4890
4883
|
? toDate(item.ORIGINAL_DATE_FROM, 'dd.MM.yyyy HH:mm:ss')
|
|
4891
4884
|
: null,
|
|
4892
|
-
DATE_TO: toDate(item.DATE_TO, 'dd.MM.yyyy HH:mm:ss'
|
|
4893
|
-
TIMESTAMP_X: toDate(item.TIMESTAMP_X, 'dd.MM.yyyy HH:mm:ss'
|
|
4885
|
+
DATE_TO: toDate(item.DATE_TO, 'dd.MM.yyyy HH:mm:ss'),
|
|
4886
|
+
TIMESTAMP_X: toDate(item.TIMESTAMP_X, 'dd.MM.yyyy HH:mm:ss'),
|
|
4894
4887
|
DATE_FROM_TS_UTC: toNum(item.DATE_FROM_TS_UTC),
|
|
4895
4888
|
DATE_TO_TS_UTC: toNum(item.DATE_TO_TS_UTC),
|
|
4896
4889
|
DELETED: item.DELETED === 'Y',
|
|
@@ -4913,31 +4906,99 @@ class BXRestMapCalendarEvent {
|
|
|
4913
4906
|
class BXRestNavvyRestCalendarEvent {
|
|
4914
4907
|
constructor() {
|
|
4915
4908
|
this.url = {
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
// * Возвращает список будущих событий для текущего пользователя
|
|
4930
|
-
// */
|
|
4931
|
-
// getNearest: [$calendar, $event, $get, $nearest],
|
|
4932
|
-
// /**
|
|
4933
|
-
// * Редактирует существующее событие
|
|
4934
|
-
// */
|
|
4935
|
-
// update: [$calendar, $event, $get, $update],
|
|
4909
|
+
/** Добавляет новое событие */
|
|
4910
|
+
add: [$calendar, $event, $add],
|
|
4911
|
+
/** Удаляет событие */
|
|
4912
|
+
delete: [$calendar, $event, $delete],
|
|
4913
|
+
/** Возвращает список событий календаря */
|
|
4914
|
+
get: Object.assign([$calendar, $event, $get], {
|
|
4915
|
+
/** Возвращает список будущих событий для текущего пользователя */
|
|
4916
|
+
nearest: [$calendar, $event, $get, $nearest],
|
|
4917
|
+
}),
|
|
4918
|
+
/** Метод получает информацию о событии календаря по идентификатору */
|
|
4919
|
+
getById: [$calendar, $event, 'getById'],
|
|
4920
|
+
/** Редактирует существующее событие */
|
|
4921
|
+
update: [$calendar, $event, $update],
|
|
4936
4922
|
};
|
|
4937
4923
|
this.Navvy = new Navvy();
|
|
4924
|
+
// /** Возвращает список событий календаря, всегда весь список, паганации в методе нет да и не нужна */
|
|
4925
|
+
// get(param: iBXRestCalendarEventGetParam) {
|
|
4926
|
+
// return this.Navvy.simple(
|
|
4927
|
+
// this.url.get,
|
|
4928
|
+
// param,
|
|
4929
|
+
// BXRestMapCalendarEvent.get
|
|
4930
|
+
// )
|
|
4931
|
+
// }
|
|
4932
|
+
this.get = Object.assign(
|
|
4933
|
+
/** Возвращает список событий календаря, всегда весь список, паганации в методе нет да и не нужна */
|
|
4934
|
+
(param) => this.Navvy.simple(this.url.get, param, BXRestMapCalendarEvent.get), {
|
|
4935
|
+
/** Метод получает список будущих событий */
|
|
4936
|
+
nearest: (param) => this.Navvy.simple(this.url.get.nearest, param, BXRestMapCalendarEvent.get),
|
|
4937
|
+
});
|
|
4938
4938
|
}
|
|
4939
|
+
/** Добавляет событие в календарь */
|
|
4940
|
+
add(param) {
|
|
4941
|
+
return this.Navvy.simple(this.url.add, param);
|
|
4942
|
+
}
|
|
4943
|
+
/** Добавляет событие в календарь */
|
|
4944
|
+
delete(param) {
|
|
4945
|
+
return this.Navvy.simple(this.url.delete, param);
|
|
4946
|
+
}
|
|
4947
|
+
/** Обновление событие в календарь */
|
|
4948
|
+
update(param) {
|
|
4949
|
+
return this.Navvy.simple(this.url.update, param);
|
|
4950
|
+
}
|
|
4951
|
+
/** Метод получает информацию о событии календаря по идентификатору */
|
|
4952
|
+
getById(param) {
|
|
4953
|
+
return this.Navvy.simple(this.url.getById, param, BXRestMapCalendarEvent.getById);
|
|
4954
|
+
}
|
|
4955
|
+
}
|
|
4956
|
+
|
|
4957
|
+
class BXRestMapCalendarSection {
|
|
4958
|
+
static get(item) {
|
|
4959
|
+
return (item) ? item.map(i => BXRestMapCalendarSection.CalendarSectionGetHttpToCalendarSectionGetHttp(i)) : undefined;
|
|
4960
|
+
}
|
|
4961
|
+
static CalendarSectionGetHttpToCalendarSectionGetHttp(item) {
|
|
4962
|
+
return {
|
|
4963
|
+
...item,
|
|
4964
|
+
ID: toNum(item.ID),
|
|
4965
|
+
OWNER_ID: toNum(item.OWNER_ID),
|
|
4966
|
+
CREATED_BY: toNum(item.CREATED_BY),
|
|
4967
|
+
DATE_CREATE: toDate(item.DATE_CREATE, 'dd.MM.yyyy HH:mm:ss'),
|
|
4968
|
+
TIMESTAMP_X: toDate(item.TIMESTAMP_X, 'dd.MM.yyyy HH:mm:ss')
|
|
4969
|
+
};
|
|
4970
|
+
}
|
|
4971
|
+
}
|
|
4972
|
+
|
|
4973
|
+
class BXRestNavvyRestCalendarSection {
|
|
4974
|
+
constructor() {
|
|
4975
|
+
this.url = {
|
|
4976
|
+
/** Добавляет новый раздел */
|
|
4977
|
+
add: [$calendar, $section, $add],
|
|
4978
|
+
/** Удаляет раздел */
|
|
4979
|
+
delete: [$calendar, $section, $delete],
|
|
4980
|
+
/** Возвращает описание разделов */
|
|
4981
|
+
get: [$calendar, $section, $get],
|
|
4982
|
+
/** Редактирует существующее разделы */
|
|
4983
|
+
update: [$calendar, $section, $update],
|
|
4984
|
+
};
|
|
4985
|
+
this.Navvy = new Navvy();
|
|
4986
|
+
}
|
|
4987
|
+
/** Возвращает описание разделов, всегда весь список, паганации в методе нет да и не нужна */
|
|
4939
4988
|
get(param) {
|
|
4940
|
-
return this.Navvy.simple(this.url.get, param,
|
|
4989
|
+
return this.Navvy.simple(this.url.get, param, BXRestMapCalendarSection.get);
|
|
4990
|
+
}
|
|
4991
|
+
/** Добавляет новый раздел */
|
|
4992
|
+
add(param) {
|
|
4993
|
+
return this.Navvy.simple(this.url.add, param);
|
|
4994
|
+
}
|
|
4995
|
+
/** Удаляет раздел */
|
|
4996
|
+
delete(param) {
|
|
4997
|
+
return this.Navvy.simple(this.url.delete, param);
|
|
4998
|
+
}
|
|
4999
|
+
/** Редактирует существующее разделы */
|
|
5000
|
+
update(param) {
|
|
5001
|
+
return this.Navvy.simple(this.url.update, param);
|
|
4941
5002
|
}
|
|
4942
5003
|
}
|
|
4943
5004
|
|
|
@@ -4965,12 +5026,6 @@ class BXRestNavvyCalendar {
|
|
|
4965
5026
|
list: getNameMethod([$calendar, $resource, $booking, $list]), // Предоставляет возможность выбрать бронирования ресурсов
|
|
4966
5027
|
}
|
|
4967
5028
|
},
|
|
4968
|
-
section: {
|
|
4969
|
-
add: getNameMethod([$calendar, $section, $add]), // Добавляет новый календарь
|
|
4970
|
-
delete: getNameMethod([$calendar, $section, $delete]), // Удаляет календарь
|
|
4971
|
-
get: getNameMethod([$calendar, $section, $get]), // Возвращает список календарей
|
|
4972
|
-
update: getNameMethod([$calendar, $section, $update]) //Обновляет календарь
|
|
4973
|
-
},
|
|
4974
5029
|
settings: {
|
|
4975
5030
|
get: getNameMethod([$calendar, $settings, $get]), // Возвращает основные настройки календаря
|
|
4976
5031
|
set: getNameMethod([$calendar, $user, $settings, $set]), // Сохраняет пользовательские настройки календаря
|
|
@@ -4979,6 +5034,7 @@ class BXRestNavvyCalendar {
|
|
|
4979
5034
|
}
|
|
4980
5035
|
*/
|
|
4981
5036
|
this.event = new BXRestNavvyRestCalendarEvent();
|
|
5037
|
+
this.section = new BXRestNavvyRestCalendarSection();
|
|
4982
5038
|
}
|
|
4983
5039
|
}
|
|
4984
5040
|
|
|
@@ -5100,7 +5156,7 @@ class BXRestNavvyDepartment {
|
|
|
5100
5156
|
this.Navvy = new Navvy();
|
|
5101
5157
|
}
|
|
5102
5158
|
get(param = {}) {
|
|
5103
|
-
return this.Navvy.
|
|
5159
|
+
return this.Navvy.pagNav(this.url.get, param, BXRestMapDepartment.get);
|
|
5104
5160
|
}
|
|
5105
5161
|
add(param) {
|
|
5106
5162
|
return this.Navvy.simple(this.url.add, param);
|