bx-rest 0.9.8 → 0.9.10

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.
@@ -1038,6 +1038,11 @@ const $pin = 'pin';
1038
1038
  const $end = 'end';
1039
1039
  const $idle = 'idle';
1040
1040
  const $crm = 'crm';
1041
+ const $automation = 'automation';
1042
+ const $trigger = 'trigger';
1043
+ const $execute = 'execute';
1044
+ const $enum = 'enum';
1045
+ const $multifield = 'multifield';
1041
1046
  const $lead = 'lead';
1042
1047
  const $deal = 'deal';
1043
1048
  const $contact = 'contact';
@@ -1056,6 +1061,7 @@ var partNameMethods$1 = /*#__PURE__*/Object.freeze({
1056
1061
  $application: $application,
1057
1062
  $approve: $approve,
1058
1063
  $attach: $attach,
1064
+ $automation: $automation,
1059
1065
  $bizproc: $bizproc,
1060
1066
  $blogcomment: $blogcomment,
1061
1067
  $blogpost: $blogpost,
@@ -1083,7 +1089,9 @@ var partNameMethods$1 = /*#__PURE__*/Object.freeze({
1083
1089
  $elapseditem: $elapseditem,
1084
1090
  $element: $element,
1085
1091
  $end: $end,
1092
+ $enum: $enum,
1086
1093
  $event: $event,
1094
+ $execute: $execute,
1087
1095
  $favorite: $favorite,
1088
1096
  $feature: $feature,
1089
1097
  $field: $field,
@@ -1117,6 +1125,7 @@ var partNameMethods$1 = /*#__PURE__*/Object.freeze({
1117
1125
  $message: $message,
1118
1126
  $messages: $messages,
1119
1127
  $moveto: $moveto,
1128
+ $multifield: $multifield,
1120
1129
  $mute: $mute,
1121
1130
  $nearest: $nearest,
1122
1131
  $params: $params,
@@ -1156,6 +1165,7 @@ var partNameMethods$1 = /*#__PURE__*/Object.freeze({
1156
1165
  $terminate: $terminate,
1157
1166
  $time: $time,
1158
1167
  $timeMan: $timeMan,
1168
+ $trigger: $trigger,
1159
1169
  $type: $type,
1160
1170
  $unread: $unread,
1161
1171
  $update: $update,
@@ -6496,8 +6506,223 @@ class BXRestNavvyCrmQuote {
6496
6506
  }
6497
6507
  }
6498
6508
 
6509
+ /** Перечисления настроек CRM (`crm.enum.settings.*`). */
6510
+ class BXRestNavvyCrmEnumSettings {
6511
+ constructor() {
6512
+ this.Navvy = new Navvy();
6513
+ this.url = {
6514
+ mode: [$crm, 'enum', $settings, 'mode']
6515
+ };
6516
+ }
6517
+ /**
6518
+ * Возвращает список режимов работы CRM для расшифровки значения,
6519
+ * полученного методом `crm.settings.mode.get`.
6520
+ *
6521
+ * @see https://apidocs.bitrix24.ru/api-reference/crm/auxiliary/enum/crm-enum-settings-mode.html
6522
+ */
6523
+ mode() {
6524
+ return this.Navvy.simple(this.url.mode);
6525
+ }
6526
+ }
6527
+
6528
+ /** Методы перечислений CRM (`crm.enum.*`). */
6529
+ class BXRestNavvyCrmEnum {
6530
+ constructor() {
6531
+ this.Navvy = new Navvy();
6532
+ this.url = {
6533
+ fields: [$crm, $enum, 'fields'],
6534
+ ownertype: [$crm, $enum, 'ownertype'],
6535
+ addresstype: [$crm, $enum, 'addresstype'],
6536
+ activitytype: [$crm, $enum, 'activitytype'],
6537
+ activitypriority: [$crm, $enum, 'activitypriority'],
6538
+ activitydirection: [$crm, $enum, 'activitydirection'],
6539
+ activitynotifytype: [$crm, $enum, 'activitynotifytype'],
6540
+ activitystatus: [$crm, $enum, 'activitystatus'],
6541
+ contenttype: [$crm, $enum, 'contenttype'],
6542
+ getorderownertypes: [$crm, $enum, 'getorderownertypes']
6543
+ };
6544
+ /** Перечисления настроек CRM (`crm.enum.settings.*`). */
6545
+ this.settings = new BXRestNavvyCrmEnumSettings();
6546
+ }
6547
+ /**
6548
+ * Возвращает описание полей элементов перечислений CRM.
6549
+ *
6550
+ * @see https://apidocs.bitrix24.ru/api-reference/crm/auxiliary/enum/crm-enum-fields.html
6551
+ */
6552
+ fields() {
6553
+ return this.Navvy.simple(this.url.fields);
6554
+ }
6555
+ /**
6556
+ * Возвращает типы объектов CRM.
6557
+ *
6558
+ * @see https://apidocs.bitrix24.ru/api-reference/crm/auxiliary/enum/crm-enum-owner-type.html
6559
+ */
6560
+ ownertype() {
6561
+ return this.enumItems(this.url.ownertype);
6562
+ }
6563
+ /**
6564
+ * Возвращает типы адресов CRM.
6565
+ *
6566
+ * @see https://apidocs.bitrix24.ru/api-reference/crm/auxiliary/enum/crm-enum-address-type.html
6567
+ */
6568
+ addresstype() {
6569
+ return this.enumItems(this.url.addresstype);
6570
+ }
6571
+ /**
6572
+ * Возвращает значения поля `TYPE_ID` дел CRM.
6573
+ *
6574
+ * @deprecated Развитие метода остановлено. Используйте `crm.activity.todo.*`.
6575
+ * @see https://apidocs.bitrix24.ru/api-reference/crm/auxiliary/enum/outdated/crm-enum-activity-type.html
6576
+ */
6577
+ activitytype() {
6578
+ return this.enumItems(this.url.activitytype);
6579
+ }
6580
+ /**
6581
+ * Возвращает приоритеты дел CRM.
6582
+ *
6583
+ * @deprecated Развитие метода остановлено. Используйте `crm.activity.todo.*`.
6584
+ * @see https://apidocs.bitrix24.ru/api-reference/crm/auxiliary/enum/outdated/crm-enum-activity-priority.html
6585
+ */
6586
+ activitypriority() {
6587
+ return this.enumItems(this.url.activitypriority);
6588
+ }
6589
+ /**
6590
+ * Возвращает направления активности: входящее и исходящее.
6591
+ *
6592
+ * @deprecated Развитие метода остановлено. Используйте `crm.activity.todo.*`.
6593
+ * @see https://apidocs.bitrix24.ru/api-reference/crm/auxiliary/enum/outdated/crm-enum-activity-direction.html
6594
+ */
6595
+ activitydirection() {
6596
+ return this.enumItems(this.url.activitydirection);
6597
+ }
6598
+ /**
6599
+ * Возвращает типы уведомлений о начале активности.
6600
+ *
6601
+ * @deprecated Развитие метода остановлено. Используйте `crm.activity.todo.*`.
6602
+ * @see https://apidocs.bitrix24.ru/api-reference/crm/auxiliary/enum/outdated/crm-enum-activity-notify-type.html
6603
+ */
6604
+ activitynotifytype() {
6605
+ return this.enumItems(this.url.activitynotifytype);
6606
+ }
6607
+ /**
6608
+ * Возвращает статусы активности.
6609
+ *
6610
+ * @deprecated Развитие метода остановлено. Используйте `crm.activity.todo.*`.
6611
+ * @see https://apidocs.bitrix24.ru/api-reference/crm/auxiliary/enum/outdated/crm-enum-activity-status.html
6612
+ */
6613
+ activitystatus() {
6614
+ return this.enumItems(this.url.activitystatus);
6615
+ }
6616
+ /**
6617
+ * Возвращает типы описания дел: plain text, bbCode и HTML.
6618
+ *
6619
+ * @deprecated Развитие метода остановлено. Используйте `crm.activity.todo.*`.
6620
+ * @see https://apidocs.bitrix24.ru/api-reference/crm/auxiliary/enum/outdated/crm-enum-content-type.html
6621
+ */
6622
+ contenttype() {
6623
+ return this.enumItems(this.url.contenttype);
6624
+ }
6625
+ /**
6626
+ * Возвращает типы объектов, к которым можно привязать заказ.
6627
+ * Идентификатор результата передаётся как `ownerTypeId` в `crm.orderentity.*`.
6628
+ *
6629
+ * @see https://apidocs.bitrix24.ru/api-reference/crm/auxiliary/enum/crm-enum-get-order-owner-types.html
6630
+ */
6631
+ getorderownertypes() {
6632
+ return this.Navvy.simple(this.url.getorderownertypes);
6633
+ }
6634
+ enumItems(url) {
6635
+ return this.Navvy.simple(url);
6636
+ }
6637
+ }
6638
+
6639
+ /** Методы описания множественных полей CRM (`crm.multifield.*`). */
6640
+ class BXRestNavvyCrmMultifield {
6641
+ constructor() {
6642
+ this.Navvy = new Navvy();
6643
+ this.url = {
6644
+ fields: [$crm, $multifield, 'fields']
6645
+ };
6646
+ }
6647
+ /**
6648
+ * Возвращает описание множественных полей для телефонов, email-адресов
6649
+ * и другой контактной информации лидов, контактов и компаний.
6650
+ *
6651
+ * @see https://apidocs.bitrix24.ru/api-reference/crm/auxiliary/multifield/crm-multifield-fields.html
6652
+ */
6653
+ fields() {
6654
+ return this.Navvy.simple(this.url.fields);
6655
+ }
6656
+ }
6657
+
6658
+ /** Методы автоматизации CRM (`crm.automation.*`). */
6659
+ class BXRestNavvyCrmAutomation {
6660
+ constructor() {
6661
+ this.Navvy = new Navvy();
6662
+ this.url = {
6663
+ trigger: [$crm, $automation, $trigger],
6664
+ triggerAdd: [$crm, $automation, $trigger, $add],
6665
+ triggerList: [$crm, $automation, $trigger, $list],
6666
+ triggerExecute: [$crm, $automation, $trigger, $execute],
6667
+ triggerDelete: [$crm, $automation, $trigger, $delete]
6668
+ };
6669
+ /**
6670
+ * Запускает webhook-триггер, настроенный в автоматизации CRM.
6671
+ * Значение `target` передается в формате `TYPENAME_ID`, например `DEAL_25`.
6672
+ *
6673
+ * @see https://apidocs.bitrix24.ru/api-reference/crm/automation/crm-automation-trigger.html
6674
+ */
6675
+ this.trigger = Object.assign((param) => {
6676
+ return this.Navvy.simple(this.url.trigger, param);
6677
+ }, {
6678
+ /**
6679
+ * Добавляет триггер приложения.
6680
+ * Метод доступен только в контексте приложения; повторный `CODE` обновит `NAME`.
6681
+ *
6682
+ * @see https://apidocs.bitrix24.ru/api-reference/crm/automation/triggers/crm-automation-trigger-add.html
6683
+ */
6684
+ add: (param) => {
6685
+ return this.Navvy.simple(this.url.triggerAdd, param);
6686
+ },
6687
+ /**
6688
+ * Возвращает список триггеров приложения.
6689
+ * Метод доступен только в контексте приложения.
6690
+ *
6691
+ * @see https://apidocs.bitrix24.ru/api-reference/crm/automation/triggers/crm-automation-trigger-list.html
6692
+ */
6693
+ list: () => {
6694
+ return this.Navvy.simple(this.url.triggerList);
6695
+ },
6696
+ /**
6697
+ * Запускает триггер приложения для конкретного объекта CRM.
6698
+ * Тип объекта берется из `crm.enum.ownertype`, идентификатор объекта - из CRM-элемента.
6699
+ *
6700
+ * @see https://apidocs.bitrix24.ru/api-reference/crm/automation/triggers/crm-automation-trigger-execute.html
6701
+ */
6702
+ execute: (param) => {
6703
+ return this.Navvy.simple(this.url.triggerExecute, param);
6704
+ },
6705
+ /**
6706
+ * Удаляет триггер приложения.
6707
+ * Метод доступен только в контексте приложения.
6708
+ *
6709
+ * @see https://apidocs.bitrix24.ru/api-reference/crm/automation/triggers/crm-automation-trigger-delete.html
6710
+ */
6711
+ delete: (param) => {
6712
+ return this.Navvy.simple(this.url.triggerDelete, param);
6713
+ }
6714
+ });
6715
+ }
6716
+ }
6717
+
6499
6718
  class BXRestNavvyCrm {
6500
6719
  constructor() {
6720
+ /** Автоматизация CRM (`crm.automation.*`). */
6721
+ this.automation = new BXRestNavvyCrmAutomation();
6722
+ /** Перечисления CRM (`crm.enum.*`). */
6723
+ this.enum = new BXRestNavvyCrmEnum();
6724
+ /** Описание множественных полей CRM (`crm.multifield.*`). */
6725
+ this.multifield = new BXRestNavvyCrmMultifield();
6501
6726
  this.lead = new BXRestNavvyCrmLead();
6502
6727
  this.deal = new BXRestNavvyCrmDeal();
6503
6728
  this.contact = new BXRestNavvyCrmContact();