Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
restservice.php
1<?php
3
20
21Loader::includeModule("rest");
22
23class RestService extends \IRestService
24{
25 const SCOPE = "lists";
26
27 public static function onRestServiceBuildDescription()
28 {
29 return array(
30 static::SCOPE => array(
31 "lists.get.iblock.type.id" => array(__CLASS__, "getIblockTypeId"),
32
33 "lists.add" => array(__CLASS__, "addLists"),
34 "lists.get" => array(__CLASS__, "getLists"),
35 "lists.update" => array(__CLASS__, "updateLists"),
36 "lists.delete" => array(__CLASS__, "deleteLists"),
37
38 "lists.section.add" => array(__CLASS__, "addSection"),
39 "lists.section.get" => array(__CLASS__, "getSection"),
40 "lists.section.update" => array(__CLASS__, "updateSection"),
41 "lists.section.delete" => array(__CLASS__, "deleteSection"),
42
43 "lists.field.add" => array(__CLASS__, "addField"),
44 "lists.field.get" => array(__CLASS__, "getFields"),
45 "lists.field.update" => array(__CLASS__, "updateField"),
46 "lists.field.delete" => array(__CLASS__, "deleteField"),
47 "lists.field.type.get" => array(__CLASS__, "getFieldTypes"),
48
49 "lists.element.add" => array(__CLASS__, "addElement"),
50 "lists.element.get" => array(__CLASS__, "getElement"),
51 "lists.element.update" => array(__CLASS__, "updateElement"),
52 "lists.element.delete" => array(__CLASS__, "deleteElement"),
53 "lists.element.get.file.url" => array(__CLASS__, "getFileUrl"),
54 )
55 );
56 }
57
58 public static function getIblockTypeId(array $params, $n, \CRestServer $server)
59 {
60 $param = new Param($params);
61
62 $iblockType = new IblockType($param);
63
64 $iblockTypeId = $iblockType->getIblockTypeId();
65 if ($iblockType->hasErrors())
66 {
67 self::throwError($iblockType->getErrors());
68 }
69
70 return $iblockTypeId;
71 }
72
73 public static function addLists(array $params, $n, \CRestServer $server)
74 {
75 $param = new Param($params);
76
77 $iblock = new Iblock($param);
78 if ($iblock->isExist())
79 {
80 self::throwError($iblock->getErrors(), "Iblock already exists", Iblock::ERROR_IBLOCK_ALREADY_EXISTS);
81 }
82
83 global $USER;
84 $rightParam = new RightParam($param);
85 $rightParam->setUser($USER);
86
87 if (!\CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
88 {
89 throw new AccessException('Available only on extended plans');
90 }
91
92 $right = new Right($rightParam, new IblockRight($rightParam));
93 $right->checkPermission(IblockRight::EDIT);
94 if ($right->hasErrors())
95 {
96 self::throwError($right->getErrors());
97 }
98
99 $iblockId = $iblock->add();
100 if ($iblock->hasErrors())
101 {
102 self::throwError($iblock->getErrors());
103 }
104
105 return $iblockId;
106 }
107
108 public static function getLists(array $params, $n, \CRestServer $server)
109 {
110 $param = new Param($params);
111
112 global $USER;
113 $rightParam = new RightParam($param);
114 $rightParam->setUser($USER);
115
116 if (!\CLists::isListFeatureEnabled((string)$rightParam->getIblockTypeId()))
117 {
118 throw new AccessException('Available only on extended plans');
119 }
120
121 $right = new Right($rightParam, new IblockRight($rightParam));
122 $right->checkPermission(IblockRight::READ);
123 if ($right->hasErrors())
124 {
125 self::throwError($right->getErrors());
126 }
127
128 $iblock = new Iblock($param);
129 list ($iblocks, $queryObject) = $iblock->get(self::getNavData($n));
130 if (empty($iblocks) || $iblock->hasErrors())
131 {
132 return [];
133 }
134 else
135 {
136 return self::setNavData(array_values($iblocks), $queryObject);
137 }
138 }
139
140 public static function updateLists(array $params, $n, \CRestServer $server)
141 {
142 $param = new Param($params);
143
144 $iblock = new Iblock($param);
145 if (!$iblock->isExist())
146 {
147 self::throwError($iblock->getErrors(), "Iblock not found", Iblock::ERROR_IBLOCK_NOT_FOUND);
148 }
149
150 global $USER;
151 $rightParam = new RightParam($param);
152 $rightParam->setUser($USER);
153
154 if (!\CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
155 {
156 throw new AccessException('Available only on extended plans');
157 }
158
159 $right = new Right($rightParam, new IblockRight($rightParam));
160 $right->checkPermission(IblockRight::EDIT);
161 if ($right->hasErrors())
162 {
163 self::throwError($right->getErrors());
164 }
165
166 if ($iblock->update())
167 {
168 return true;
169 }
170 else
171 {
172 self::throwError($iblock->getErrors());
173 }
174 }
175
176 public static function deleteLists(array $params, $n, \CRestServer $server)
177 {
178 $param = new Param($params);
179
180 $iblock = new Iblock($param);
181 if (!$iblock->isExist())
182 {
183 self::throwError($iblock->getErrors(), "Iblock not found", Iblock::ERROR_IBLOCK_NOT_FOUND);
184 }
185
186 global $USER;
187 $rightParam = new RightParam($param);
188 $rightParam->setUser($USER);
189
190 if (!\CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
191 {
192 throw new AccessException('Available only on extended plans');
193 }
194
195 $right = new Right($rightParam, new IblockRight($rightParam));
196 $right->checkPermission(IblockRight::EDIT);
197 if ($right->hasErrors())
198 {
199 self::throwError($right->getErrors());
200 }
201
202 if ($iblock->delete())
203 {
204 return true;
205 }
206 else
207 {
208 self::throwError($iblock->getErrors());
209 }
210 }
211
212 public static function addSection(array $params, $n, \CRestServer $server)
213 {
214 $param = new Param($params);
215 $params = $param->getParams();
216
217 global $USER;
218 $rightParam = new RightParam($param);
219 $rightParam->setUser($USER);
220 $rightParam->setEntityId($params["IBLOCK_SECTION_ID"]);
221
222 if (!\CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
223 {
224 throw new AccessException('Available only on extended plans');
225 }
226
227 $right = new Right($rightParam, new SectionRight($rightParam));
228 $right->checkPermission(SectionRight::ADD);
229 if ($right->hasErrors())
230 {
231 self::throwError($right->getErrors());
232 }
233
234 $section = new Section($param);
235 $sectionId = $section->add();
236 if ($section->hasErrors())
237 {
238 self::throwError($section->getErrors());
239 }
240
241 return $sectionId;
242 }
243
244 public static function getSection(array $params, $n, \CRestServer $server)
245 {
246 $param = new Param($params);
247 $params = $param->getParams();
248
249 global $USER;
250 $rightParam = new RightParam($param);
251 $rightParam->setUser($USER);
252 $rightParam->setEntityId($params["IBLOCK_SECTION_ID"]);
253
254 if (!\CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
255 {
256 throw new AccessException('Available only on extended plans');
257 }
258
259 $right = new Right($rightParam, new SectionRight($rightParam));
260 $right->checkPermission(SectionRight::READ);
261 if ($right->hasErrors())
262 {
263 self::throwError($right->getErrors());
264 }
265
266 $section = new Section($param);
267 list ($sections, $queryObject) = $section->get(self::getNavData($n));
268 if (empty($sections) || $section->hasErrors())
269 {
270 return [];
271 }
272 else
273 {
274 return self::setNavData(array_values($sections), $queryObject);
275 }
276 }
277
278 public static function updateSection(array $params, $n, \CRestServer $server)
279 {
280 $param = new Param($params);
281 $params = $param->getParams();
282
283 $section = new Section($param);
284 if (!$section->isExist())
285 {
286 self::throwError($section->getErrors(), "Section not found", Section::ERROR_SECTION_NOT_FOUND);
287 }
288
289 global $USER;
290 $rightParam = new RightParam($param);
291 $rightParam->setUser($USER);
292 $rightParam->setEntityId($params["IBLOCK_SECTION_ID"]);
293
294 if (!\CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
295 {
296 throw new AccessException('Available only on extended plans');
297 }
298
299 $right = new Right($rightParam, new SectionRight($rightParam));
300 $right->checkPermission(SectionRight::EDIT);
301 if ($right->hasErrors())
302 {
303 self::throwError($right->getErrors());
304 }
305
306 if ($section->update())
307 {
308 return true;
309 }
310 else
311 {
312 self::throwError($section->getErrors());
313 }
314 }
315
316 public static function deleteSection(array $params, $n, \CRestServer $server)
317 {
318 $param = new Param($params);
319 $params = $param->getParams();
320
321 $section = new Section($param);
322 if (!$section->isExist())
323 {
324 self::throwError($section->getErrors(), "Section not found", Section::ERROR_SECTION_NOT_FOUND);
325 }
326
327 global $USER;
328 $rightParam = new RightParam($param);
329 $rightParam->setUser($USER);
330 $rightParam->setEntityId($params["IBLOCK_SECTION_ID"]);
331
332 if (!\CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
333 {
334 throw new AccessException('Available only on extended plans');
335 }
336
337 $right = new Right($rightParam, new SectionRight($rightParam));
338 $right->checkPermission(SectionRight::DELETE);
339 if ($right->hasErrors())
340 {
341 self::throwError($right->getErrors());
342 }
343
344 if ($section->delete())
345 {
346 return true;
347 }
348 else
349 {
350 self::throwError($section->getErrors());
351 }
352 }
353
354 public static function addField(array $params, $n, \CRestServer $server)
355 {
356 $param = new Param($params);
357
358 $iblock = new Iblock($param);
359 if (!$iblock->isExist())
360 {
361 self::throwError($iblock->getErrors(), "Iblock not found", Iblock::ERROR_IBLOCK_NOT_FOUND);
362 }
363
364 global $USER;
365 $rightParam = new RightParam($param);
366 $rightParam->setUser($USER);
367
368 if (!\CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
369 {
370 throw new AccessException('Available only on extended plans');
371 }
372
373 $right = new Right($rightParam, new IblockRight($rightParam));
374 $right->checkPermission(IblockRight::EDIT);
375 if ($right->hasErrors())
376 {
377 self::throwError($right->getErrors());
378 }
379
380 $field = new Field($param);
381 $fieldId = $field->add();
382 if ($field->hasErrors())
383 {
384 self::throwError($field->getErrors());
385 }
386 else
387 {
388 return $fieldId;
389 }
390 }
391
392 public static function getFields(array $params, $n, \CRestServer $server)
393 {
394 $param = new Param($params);
395
396 $iblock = new Iblock($param);
397 if (!$iblock->isExist())
398 {
399 self::throwError($iblock->getErrors(), "Iblock not found", Iblock::ERROR_IBLOCK_NOT_FOUND);
400 }
401
402 global $USER;
403 $rightParam = new RightParam($param);
404 $rightParam->setUser($USER);
405
406 if (!\CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
407 {
408 throw new AccessException('Available only on extended plans');
409 }
410
411 $right = new Right($rightParam, new IblockRight($rightParam));
412 $right->checkPermission();
413 if ($right->hasErrors())
414 {
415 self::throwError($right->getErrors());
416 }
417
418 $field = new Field($param);
419 return $field->get();
420 }
421
422 public static function updateField(array $params, $n, \CRestServer $server)
423 {
424 $param = new Param($params);
425
426 $iblock = new Iblock($param);
427 if (!$iblock->isExist())
428 {
429 self::throwError($iblock->getErrors(), "Iblock not found", Iblock::ERROR_IBLOCK_NOT_FOUND);
430 }
431
432 global $USER;
433 $rightParam = new RightParam($param);
434 $rightParam->setUser($USER);
435
436 if (!\CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
437 {
438 throw new AccessException('Available only on extended plans');
439 }
440
441 $right = new Right($rightParam, new IblockRight($rightParam));
442 $right->checkPermission(IblockRight::EDIT);
443 if ($right->hasErrors())
444 {
445 self::throwError($right->getErrors());
446 }
447
448 $field = new Field($param);
449 if ($field->update())
450 {
451 return true;
452 }
453 else
454 {
455 self::throwError($field->getErrors());
456 }
457 }
458
459 public static function deleteField(array $params, $n, \CRestServer $server)
460 {
461 $param = new Param($params);
462
463 $iblock = new Iblock($param);
464 if (!$iblock->isExist())
465 {
466 self::throwError($iblock->getErrors(), "Iblock not found", Iblock::ERROR_IBLOCK_NOT_FOUND);
467 }
468
469 global $USER;
470 $rightParam = new RightParam($param);
471 $rightParam->setUser($USER);
472
473 if (!\CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
474 {
475 throw new AccessException('Available only on extended plans');
476 }
477
478 $right = new Right($rightParam, new IblockRight($rightParam));
479 $right->checkPermission(IblockRight::EDIT);
480 if ($right->hasErrors())
481 {
482 self::throwError($right->getErrors());
483 }
484
485 $field = new Field($param);
486 $field->delete();
487
488 return true;
489 }
490
491 public static function getFieldTypes(array $params, $n, \CRestServer $server)
492 {
493 $param = new Param($params);
494
495 $iblock = new Iblock($param);
496 if (!$iblock->isExist())
497 {
498 self::throwError($iblock->getErrors(), "Iblock not found", Iblock::ERROR_IBLOCK_NOT_FOUND);
499 }
500
501 global $USER;
502 $rightParam = new RightParam($param);
503 $rightParam->setUser($USER);
504
505 if (!\CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
506 {
507 throw new AccessException('Available only on extended plans');
508 }
509
510 $right = new Right($rightParam, new IblockRight($rightParam));
511 $right->checkPermission(IblockRight::EDIT);
512 if ($right->hasErrors())
513 {
514 self::throwError($right->getErrors());
515 }
516
517 $field = new Field($param);
518 return $field->getAvailableTypes();
519 }
520
521 public static function addElement(array $params, $n, \CRestServer $server)
522 {
523 $param = new Param($params);
524 $params = $param->getParams();
525
526 $iblock = new Iblock($param);
527 if (!$iblock->isExist())
528 {
529 self::throwError($iblock->getErrors(), "Iblock not found", Iblock::ERROR_IBLOCK_NOT_FOUND);
530 }
531
532 global $USER;
533 $rightParam = new RightParam($param);
534 $rightParam->setUser($USER);
535 $rightParam->setEntityId($params["IBLOCK_SECTION_ID"]);
536
537 if (!\CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
538 {
539 throw new AccessException('Available only on extended plans');
540 }
541
542 $elementRight = new ElementRight($rightParam);
543 $right = new Right($rightParam, $elementRight);
544 $right->checkPermission(ElementRight::ADD);
545 if ($right->hasErrors())
546 {
547 self::throwError($right->getErrors());
548 }
549
550 $element = new Element($param);
551 if ($element->isExist())
552 {
553 self::throwError($element->getErrors(), "Element already exists", Element::ERROR_ELEMENT_ALREADY_EXISTS);
554 }
555
556 $elementId = $element->add();
557 if ($element->hasErrors())
558 {
559 self::throwError($element->getErrors());
560 }
561
562 return $elementId;
563 }
564
565 public static function getElement(array $params, $n, \CRestServer $server)
566 {
567 $param = new Param($params);
568 $params = $param->getParams();
569
570 $iblock = new Iblock($param);
571 if (!$iblock->isExist())
572 {
573 self::throwError($iblock->getErrors(), "Iblock not found", Iblock::ERROR_IBLOCK_NOT_FOUND);
574 }
575
576 global $USER;
577 $rightParam = new RightParam($param);
578 $rightParam->setUser($USER);
579 $rightParam->setEntityId(Utils::getElementId($param->getParams()));
580
581 if (!\CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
582 {
583 throw new AccessException('Available only on extended plans');
584 }
585
586 $elementRight = new ElementRight($rightParam);
587 $param->setParam(["CAN_FULL_EDIT" => ($elementRight->canFullEdit() ? "Y" : "N")]);
588
589 $right = new Right($rightParam, $elementRight);
590 $right->checkPermission(ElementRight::READ);
591 if ($right->hasErrors())
592 {
593 self::throwError($right->getErrors());
594 }
595
596 $element = new Element($param);
597 if (is_array($params["FILTER"]))
598 {
599 list($availableFields, $listCustomFields) = $element->getAvailableFields();
600 $element->resultSanitizeFilter = self::getSanitizeFilter(
601 $params["FILTER"], $availableFields, $listCustomFields);
602 }
603 list ($elements, $queryObject) = $element->get(self::getNavData($n));
604 if ($elements)
605 {
606 return self::setNavData(array_values($elements), $queryObject);
607 }
608 else
609 {
610 return [];
611 }
612 }
613
614 public static function updateElement(array $params, $n, \CRestServer $server)
615 {
616 $param = new Param($params);
617
618 $iblock = new Iblock($param);
619 if (!$iblock->isExist())
620 {
621 self::throwError($iblock->getErrors(), "Iblock not found", Iblock::ERROR_IBLOCK_NOT_FOUND);
622 }
623
624 global $USER;
625 $rightParam = new RightParam($param);
626 $rightParam->setUser($USER);
627 $rightParam->setEntityId(Utils::getElementId($param->getParams()));
628
629 if (!\CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
630 {
631 throw new AccessException('Available only on extended plans');
632 }
633
634 $elementRight = new ElementRight($rightParam);
635 $right = new Right($rightParam, $elementRight);
636 $right->checkPermission(ElementRight::EDIT);
637 if ($right->hasErrors())
638 {
639 self::throwError($right->getErrors());
640 }
641
642 $element = new Element($param);
643 if (!$element->isExist())
644 {
645 self::throwError($element->getErrors(), "Element not found", Element::ERROR_ELEMENT_NOT_FOUND);
646 }
647
648 if ($element->update())
649 {
650 return true;
651 }
652 else
653 {
654 self::throwError($element->getErrors());
655 }
656 }
657
658 public static function deleteElement(array $params, $n, \CRestServer $server)
659 {
660 $param = new Param($params);
661
662 $iblock = new Iblock($param);
663 if (!$iblock->isExist())
664 {
665 self::throwError($iblock->getErrors(), "Iblock not found", Iblock::ERROR_IBLOCK_NOT_FOUND);
666 }
667
668 global $USER;
669 $rightParam = new RightParam($param);
670 $rightParam->setUser($USER);
671 $rightParam->setEntityId(Utils::getElementId($param->getParams()));
672
673 if (!\CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
674 {
675 throw new AccessException('Available only on extended plans');
676 }
677
678 $elementRight = new ElementRight($rightParam);
679 $right = new Right($rightParam, $elementRight);
680 $right->checkPermission(ElementRight::EDIT);
681 if ($right->hasErrors())
682 {
683 self::throwError($right->getErrors());
684 }
685
686 $element = new Element($param);
687 if (!$element->isExist())
688 {
689 self::throwError($element->getErrors(), "Element not found", Element::ERROR_ELEMENT_NOT_FOUND);
690 }
691
692 $elementRight->canDelete();
693 if ($elementRight->hasErrors())
694 {
695 self::throwError($elementRight->getErrors());
696 }
697
698 if ($element->delete())
699 {
700 return true;
701 }
702 else
703 {
704 self::throwError($element->getErrors());
705 }
706 }
707
708 public static function getFileUrl(array $params, $n, \CRestServer $server)
709 {
710 $param = new Param($params);
711
712 $iblock = new Iblock($param);
713 if (!$iblock->isExist())
714 {
715 self::throwError($iblock->getErrors(), "Iblock not found", Iblock::ERROR_IBLOCK_NOT_FOUND);
716 }
717
718 global $USER;
719 $rightParam = new RightParam($param);
720 $rightParam->setUser($USER);
721 $rightParam->setEntityId(Utils::getElementId($param->getParams()));
722
723 if (!\CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
724 {
725 throw new AccessException('Available only on extended plans');
726 }
727
728 $elementRight = new ElementRight($rightParam);
729 $right = new Right($rightParam, $elementRight);
730 $right->checkPermission(ElementRight::READ);
731 if ($right->hasErrors())
732 {
733 self::throwError($right->getErrors());
734 }
735
736 $element = new Element($param);
737 if (!$element->isExist())
738 {
739 self::throwError($element->getErrors(), "Element not found", Element::ERROR_ELEMENT_NOT_FOUND);
740 }
741
742 return $element->getFileUrl();
743 }
744
745 private static function throwError(array $errors, $message = "", $code = "")
746 {
747 $error = end($errors);
748
749 if ($error instanceof Error)
750 {
751 $message = $error->getMessage();
752 if (is_array($message) && array_key_exists("message", $message))
753 {
754 $message = $message["message"];
755 }
756 else
757 {
758 $message = $message ?: "Unknown error";
759 }
760 throw new RestException($message, $error->getCode());
761 }
762 elseif ($error)
763 {
764 throw new RestException($error, RestException::ERROR_CORE);
765 }
766 elseif ($message && $code)
767 {
768 throw new RestException($message, $code);
769 }
770
771 throw new RestException("Unknown error", RestException::ERROR_NOT_FOUND);
772 }
773
774 private static function getSanitizeFilter($filter, $availableFields, $listCustomFields)
775 {
776 return parent::sanitizeFilter(
777 $filter,
778 $availableFields,
779 function($field, $value) use ($listCustomFields)
780 {
781 if (array_key_exists($field, $listCustomFields))
782 {
783 $callback = $listCustomFields[$field];
784 if ($callback instanceof \Closure)
785 {
786 return $callback($value);
787 }
788 else
789 {
790 return call_user_func_array($listCustomFields[$field], [[], ["VALUE" => $value]]);
791 }
792 }
793 return $value;
794 },
795 ["", "!%", ">=", "><", "!><", ">", "<=", "<", "%", "=", "*", "!"]
796 );
797 }
798
803 const ERROR_REQUIRED_PARAMETERS_MISSING = "ERROR_REQUIRED_PARAMETERS_MISSING";
804 const ERROR_IBLOCK_ALREADY_EXISTS = "ERROR_IBLOCK_ALREADY_EXISTS";
805 const ERROR_SAVE_IBLOCK = "ERROR_SAVE_IBLOCK";
806 const ERROR_IBLOCK_NOT_FOUND = "ERROR_IBLOCK_NOT_FOUND";
807 const ERROR_SAVE_FIELD = "ERROR_SAVE_FIELD";
808 const ERROR_PROPERTY_ALREADY_EXISTS = "ERROR_PROPERTY_ALREADY_EXISTS";
809 const ERROR_SAVE_ELEMENT = "ERROR_SAVE_ELEMENT";
810 const ERROR_DELETE_ELEMENT = "ERROR_DELETE_ELEMENT";
811 const ERROR_BIZPROC = "ERROR_BIZPROC";
812}
static addLists(array $params, $n, \CRestServer $server)
static getFieldTypes(array $params, $n, \CRestServer $server)
static getIblockTypeId(array $params, $n, \CRestServer $server)
static addField(array $params, $n, \CRestServer $server)
static getFields(array $params, $n, \CRestServer $server)
static addElement(array $params, $n, \CRestServer $server)
static getElement(array $params, $n, \CRestServer $server)
static getSection(array $params, $n, \CRestServer $server)
static updateElement(array $params, $n, \CRestServer $server)
static deleteSection(array $params, $n, \CRestServer $server)
static deleteElement(array $params, $n, \CRestServer $server)
static addSection(array $params, $n, \CRestServer $server)
static updateSection(array $params, $n, \CRestServer $server)
static deleteLists(array $params, $n, \CRestServer $server)
static getFileUrl(array $params, $n, \CRestServer $server)
static deleteField(array $params, $n, \CRestServer $server)
static updateField(array $params, $n, \CRestServer $server)
static getLists(array $params, $n, \CRestServer $server)
static updateLists(array $params, $n, \CRestServer $server)