bx-rest 0.6.5 → 0.6.6

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.
Files changed (135) hide show
  1. package/consts/part-name-methods.d.ts +18 -0
  2. package/esm2022/consts/part-name-methods.mjs +19 -1
  3. package/esm2022/map/channel/public.mjs +12 -0
  4. package/esm2022/map/im/dialog.mjs +16 -0
  5. package/esm2022/map/im/gialog/messages.mjs +29 -0
  6. package/esm2022/map/im/gialog/users.mjs +15 -0
  7. package/esm2022/map/im/recent.mjs +62 -0
  8. package/esm2022/map/im/user/list.mjs +10 -0
  9. package/esm2022/map/im/user.mjs +16 -0
  10. package/esm2022/map/pull/application/config.mjs +34 -0
  11. package/esm2022/map/pull.mjs +17 -0
  12. package/esm2022/request/pull/application/config.mjs +11 -0
  13. package/esm2022/request/pull/channel/public.mjs +18 -0
  14. package/esm2022/request/pull/config.mjs +13 -0
  15. package/esm2022/request/pull.mjs +11 -0
  16. package/esm2022/request-navvy/im/chat/user.mjs +25 -0
  17. package/esm2022/request-navvy/im/chat.mjs +72 -11
  18. package/esm2022/request-navvy/im/counters.mjs +11 -0
  19. package/esm2022/request-navvy/im/dialog/messages.mjs +12 -0
  20. package/esm2022/request-navvy/im/dialog/read.mjs +19 -0
  21. package/esm2022/request-navvy/im/dialog/users.mjs +12 -0
  22. package/esm2022/request-navvy/im/dialog.mjs +39 -0
  23. package/esm2022/request-navvy/im/recent.mjs +46 -0
  24. package/esm2022/request-navvy/im/user/list.mjs +13 -0
  25. package/esm2022/request-navvy/im/user/status/idle.mjs +14 -0
  26. package/esm2022/request-navvy/im/user/status.mjs +22 -0
  27. package/esm2022/request-navvy/im/user.mjs +21 -0
  28. package/esm2022/request-navvy/im.mjs +9 -1
  29. package/esm2022/request-navvy/pull/application/config.mjs +12 -0
  30. package/esm2022/request-navvy/pull/channel/public.mjs +15 -0
  31. package/esm2022/request-navvy/pull/config.mjs +20 -0
  32. package/esm2022/request-navvy/pull.mjs +15 -0
  33. package/esm2022/rest/base.mjs +3 -3
  34. package/esm2022/rest/navvy.mjs +3 -1
  35. package/esm2022/typification/rest/im/chat/add.mjs +1 -1
  36. package/esm2022/typification/rest/im/chat/get.mjs +2 -0
  37. package/esm2022/typification/rest/im/chat/leave.mjs +2 -0
  38. package/esm2022/typification/rest/im/chat/mute.mjs +2 -0
  39. package/esm2022/typification/rest/im/chat/setOwner.mjs +2 -0
  40. package/esm2022/typification/rest/im/chat/updateAvatar.mjs +2 -0
  41. package/esm2022/typification/rest/im/chat/updateColor.mjs +2 -0
  42. package/esm2022/typification/rest/im/chat/updateTitle.mjs +2 -0
  43. package/esm2022/typification/rest/im/chat/user/add.mjs +2 -0
  44. package/esm2022/typification/rest/im/chat/user/delete.mjs +2 -0
  45. package/esm2022/typification/rest/im/chat/user/list.mjs +2 -0
  46. package/esm2022/typification/rest/im/counters/get.mjs +2 -0
  47. package/esm2022/typification/rest/im/dialog/get.mjs +2 -0
  48. package/esm2022/typification/rest/im/dialog/messages/get.mjs +2 -0
  49. package/esm2022/typification/rest/im/dialog/read.mjs +2 -0
  50. package/esm2022/typification/rest/im/dialog/recent/get.mjs +2 -0
  51. package/esm2022/typification/rest/im/dialog/recent/list.mjs +2 -0
  52. package/esm2022/typification/rest/im/dialog/recent/unread.mjs +2 -0
  53. package/esm2022/typification/rest/im/dialog/unread.mjs +2 -0
  54. package/esm2022/typification/rest/im/dialog/user/get.mjs +2 -0
  55. package/esm2022/typification/rest/im/dialog/writing.mjs +2 -0
  56. package/esm2022/typification/rest/im/user/get.mjs +2 -0
  57. package/esm2022/typification/rest/im/user/list/get.mjs +2 -0
  58. package/esm2022/typification/rest/im/user/status/get.mjs +2 -0
  59. package/esm2022/typification/rest/im/user/status/idle.mjs +2 -0
  60. package/esm2022/typification/rest/im/user/status/set.mjs +2 -0
  61. package/esm2022/typification/rest/pull/application/config/get.mjs +2 -0
  62. package/esm2022/typification/rest/pull/channel/get.mjs +2 -0
  63. package/esm2022/typification/rest/pull/config/get.mjs +2 -0
  64. package/esm2022/typification/rest/pull.mjs +2 -0
  65. package/esm2022/typification/rest/user/get.mjs +1 -1
  66. package/fesm2022/bx-rest.mjs +607 -27
  67. package/fesm2022/bx-rest.mjs.map +1 -1
  68. package/map/channel/public.d.ts +4 -0
  69. package/map/im/dialog.d.ts +4 -0
  70. package/map/im/gialog/messages.d.ts +4 -0
  71. package/map/im/gialog/users.d.ts +4 -0
  72. package/map/im/recent.d.ts +6 -0
  73. package/map/im/user/list.d.ts +5 -0
  74. package/map/im/user.d.ts +4 -0
  75. package/map/pull/application/config.d.ts +4 -0
  76. package/map/pull.d.ts +4 -0
  77. package/package.json +1 -1
  78. package/request/pull/application/config.d.ts +5 -0
  79. package/request/pull/channel/public.d.ts +5 -0
  80. package/request/pull/config.d.ts +7 -0
  81. package/request/pull.d.ts +8 -0
  82. package/request-navvy/im/chat/user.d.ts +17 -0
  83. package/request-navvy/im/chat.d.ts +65 -2
  84. package/request-navvy/im/counters.d.ts +5 -0
  85. package/request-navvy/im/dialog/messages.d.ts +5 -0
  86. package/request-navvy/im/dialog/read.d.ts +9 -0
  87. package/request-navvy/im/dialog/users.d.ts +5 -0
  88. package/request-navvy/im/dialog.d.ts +32 -0
  89. package/request-navvy/im/recent.d.ts +33 -0
  90. package/request-navvy/im/user/list.d.ts +7 -0
  91. package/request-navvy/im/user/status/idle.d.ts +6 -0
  92. package/request-navvy/im/user/status.d.ts +15 -0
  93. package/request-navvy/im/user.d.ts +14 -0
  94. package/request-navvy/im.d.ts +8 -0
  95. package/request-navvy/pull/application/config.d.ts +5 -0
  96. package/request-navvy/pull/channel/public.d.ts +8 -0
  97. package/request-navvy/pull/config.d.ts +13 -0
  98. package/request-navvy/pull.d.ts +12 -0
  99. package/rest/base.d.ts +2 -2
  100. package/rest/navvy.d.ts +4 -1
  101. package/typification/rest/im/chat/add.d.ts +1 -1
  102. package/typification/rest/im/chat/get.d.ts +18 -0
  103. package/typification/rest/im/chat/leave.d.ts +4 -0
  104. package/typification/rest/im/chat/mute.d.ts +10 -0
  105. package/typification/rest/im/chat/setOwner.d.ts +6 -0
  106. package/typification/rest/im/chat/updateAvatar.d.ts +6 -0
  107. package/typification/rest/im/chat/updateColor.d.ts +9 -0
  108. package/typification/rest/im/chat/updateTitle.d.ts +8 -0
  109. package/typification/rest/im/chat/user/add.d.ts +12 -0
  110. package/typification/rest/im/chat/user/delete.d.ts +6 -0
  111. package/typification/rest/im/chat/user/list.d.ts +4 -0
  112. package/typification/rest/im/counters/get.d.ts +13 -0
  113. package/typification/rest/im/dialog/get.d.ts +83 -0
  114. package/typification/rest/im/dialog/messages/get.d.ts +180 -0
  115. package/typification/rest/im/dialog/read.d.ts +25 -0
  116. package/typification/rest/im/dialog/recent/get.d.ts +172 -0
  117. package/typification/rest/im/dialog/recent/list.d.ts +186 -0
  118. package/typification/rest/im/dialog/recent/unread.d.ts +12 -0
  119. package/typification/rest/im/dialog/unread.d.ts +3 -0
  120. package/typification/rest/im/dialog/user/get.d.ts +71 -0
  121. package/typification/rest/im/dialog/writing.d.ts +2 -0
  122. package/typification/rest/im/user/get.d.ts +73 -0
  123. package/typification/rest/im/user/list/get.d.ts +5 -0
  124. package/typification/rest/im/user/status/get.d.ts +7 -0
  125. package/typification/rest/im/user/status/idle.d.ts +4 -0
  126. package/typification/rest/im/user/status/set.d.ts +4 -0
  127. package/typification/rest/pull/application/config/get.d.ts +3 -0
  128. package/typification/rest/pull/channel/get.d.ts +13 -0
  129. package/typification/rest/pull/config/get.d.ts +70 -0
  130. package/typification/rest/pull.d.ts +1 -0
  131. package/typification/rest/user/get.d.ts +3 -3
  132. package/esm2022/request/im/chat.mjs +0 -12
  133. package/esm2022/request/im.mjs +0 -7
  134. package/request/im/chat.d.ts +0 -6
  135. package/request/im.d.ts +0 -4
@@ -721,6 +721,24 @@ const $mute = 'mute';
721
721
  const $timeMan = 'timeman';
722
722
  const $item = 'item';
723
723
  const $userfield = 'userfield';
724
+ const $config = 'config';
725
+ const $pull = 'pull';
726
+ const $channel = 'channel';
727
+ const $public = 'public';
728
+ const $application = 'application';
729
+ const $dialog = 'dialog';
730
+ const $users = 'users';
731
+ const $messages = 'messages';
732
+ const $read = 'read';
733
+ const $unread = 'unread';
734
+ const $writing = 'writing';
735
+ const $all = 'all';
736
+ const $leave = 'leave';
737
+ const $recent = 'recent';
738
+ const $hide = 'hide';
739
+ const $pin = 'pin';
740
+ const $end = 'end';
741
+ const $idle = 'idle';
724
742
 
725
743
  var partNameMethods$1 = /*#__PURE__*/Object.freeze({
726
744
  __proto__: null,
@@ -728,7 +746,9 @@ var partNameMethods$1 = /*#__PURE__*/Object.freeze({
728
746
  $accessibility: $accessibility,
729
747
  $activity: $activity,
730
748
  $add: $add,
749
+ $all: $all,
731
750
  $api: $api,
751
+ $application: $application,
732
752
  $approve: $approve,
733
753
  $attach: $attach,
734
754
  $bizproc: $bizproc,
@@ -736,9 +756,11 @@ var partNameMethods$1 = /*#__PURE__*/Object.freeze({
736
756
  $blogpost: $blogpost,
737
757
  $booking: $booking,
738
758
  $calendar: $calendar,
759
+ $channel: $channel,
739
760
  $chat: $chat,
740
761
  $commentitem: $commentitem,
741
762
  $complete: $complete,
763
+ $config: $config,
742
764
  $copyto: $copyto,
743
765
  $counters: $counters,
744
766
  $create: $create,
@@ -746,10 +768,12 @@ var partNameMethods$1 = /*#__PURE__*/Object.freeze({
746
768
  $delegate: $delegate,
747
769
  $delete: $delete,
748
770
  $department: $department,
771
+ $dialog: $dialog,
749
772
  $disapprove: $disapprove,
750
773
  $disk: $disk,
751
774
  $elapseditem: $elapseditem,
752
775
  $element: $element,
776
+ $end: $end,
753
777
  $event: $event,
754
778
  $favorite: $favorite,
755
779
  $feature: $feature,
@@ -764,26 +788,35 @@ var partNameMethods$1 = /*#__PURE__*/Object.freeze({
764
788
  $getchildren: $getchildren,
765
789
  $getlist: $getlist,
766
790
  $getmanifest: $getmanifest,
791
+ $hide: $hide,
767
792
  $history: $history,
768
793
  $iblock: $iblock,
769
794
  $id: $id,
795
+ $idle: $idle,
770
796
  $im: $im,
771
797
  $instances: $instances,
772
798
  $isactionallowed: $isactionallowed,
773
799
  $item: $item,
774
800
  $kill: $kill,
801
+ $leave: $leave,
775
802
  $list: $list,
776
803
  $lists: $lists,
777
804
  $log: $log,
778
805
  $markdeleted: $markdeleted,
779
806
  $meeting: $meeting,
780
807
  $message: $message,
808
+ $messages: $messages,
781
809
  $moveto: $moveto,
782
810
  $mute: $mute,
783
811
  $nearest: $nearest,
784
812
  $params: $params,
785
813
  $pause: $pause,
814
+ $pin: $pin,
786
815
  $planner: $planner,
816
+ $public: $public,
817
+ $pull: $pull,
818
+ $read: $read,
819
+ $recent: $recent,
787
820
  $rename: $rename,
788
821
  $renew: $renew,
789
822
  $request: $request,
@@ -812,6 +845,7 @@ var partNameMethods$1 = /*#__PURE__*/Object.freeze({
812
845
  $time: $time,
813
846
  $timeMan: $timeMan,
814
847
  $type: $type,
848
+ $unread: $unread,
815
849
  $update: $update,
816
850
  $updateAvatar: $updateAvatar,
817
851
  $updateColor: $updateColor,
@@ -820,8 +854,10 @@ var partNameMethods$1 = /*#__PURE__*/Object.freeze({
820
854
  $url: $url,
821
855
  $user: $user,
822
856
  $userfield: $userfield,
857
+ $users: $users,
823
858
  $workflow: $workflow,
824
- $workgroup: $workgroup
859
+ $workgroup: $workgroup,
860
+ $writing: $writing
825
861
  });
826
862
 
827
863
  /**
@@ -2165,22 +2201,6 @@ class BXRestDepartment {
2165
2201
  }
2166
2202
  }
2167
2203
 
2168
- class BXRestImChat {
2169
- constructor() {
2170
- this.url = methods.im.chat;
2171
- this.http = new HttpBXServices();
2172
- }
2173
- add(param) {
2174
- return this.http.post(this.url.add, param);
2175
- }
2176
- }
2177
-
2178
- class BXRestIm {
2179
- constructor() {
2180
- this.chat = new BXRestImChat();
2181
- }
2182
- }
2183
-
2184
2204
  class BXRestApp {
2185
2205
  constructor() {
2186
2206
  this.http = new HttpBXServices();
@@ -2295,6 +2315,50 @@ class BXRestSocialNetWork {
2295
2315
  }
2296
2316
  }
2297
2317
 
2318
+ class BXRestPullApplicationConfig {
2319
+ constructor() {
2320
+ this.http = new HttpBXServices();
2321
+ }
2322
+ get() {
2323
+ return this.http.post([$pull, $application, $config, $get]);
2324
+ }
2325
+ }
2326
+
2327
+ class BXRestPullConfig {
2328
+ constructor() {
2329
+ this.http = new HttpBXServices();
2330
+ this.config = new BXRestPullApplicationConfig();
2331
+ }
2332
+ get() {
2333
+ return this.http.post([$pull, $config, $get]);
2334
+ }
2335
+ }
2336
+
2337
+ class BXRestPullChannelPublic {
2338
+ constructor() {
2339
+ this.http = new HttpBXServices();
2340
+ /**
2341
+ * Пес его знает что за метод такой, судя по коду нужно всю инфу json объектом о пользователе передать,
2342
+ * но это не точно
2343
+ */
2344
+ // list() {
2345
+ // return this.http.post<iBXRestPullChannelPublicGetHttp>([$pull, $channel, $public, $list])
2346
+ // }
2347
+ }
2348
+ get() {
2349
+ return this.http.post([$pull, $channel, $public, $get]);
2350
+ }
2351
+ }
2352
+
2353
+ class BXRestPull {
2354
+ constructor() {
2355
+ this.config = new BXRestPullConfig();
2356
+ this.channel = {
2357
+ public: new BXRestPullChannelPublic()
2358
+ };
2359
+ }
2360
+ }
2361
+
2298
2362
  class BXRest {
2299
2363
  constructor() {
2300
2364
  this.http = new HttpBXServices();
@@ -2308,10 +2372,10 @@ class BXRest {
2308
2372
  this.sonet_group = new BXRestSonetGroup();
2309
2373
  this.server = new BXRestServer();
2310
2374
  this.department = new BXRestDepartment();
2311
- this.im = new BXRestIm();
2312
2375
  this.app = new BXRestApp();
2313
2376
  this.timeMan = new BXRestTimeMan();
2314
2377
  this.socialNetWork = new BXRestSocialNetWork();
2378
+ this.pull = new BXRestPull();
2315
2379
  }
2316
2380
  profile() {
2317
2381
  return this.http.post(['profile']);
@@ -5232,30 +5296,437 @@ class BXRestNavvyDepartment {
5232
5296
  }
5233
5297
  }
5234
5298
 
5299
+ class BXRestNavvyImChatUser {
5300
+ constructor() {
5301
+ this.Navvy = new Navvy();
5302
+ this.url = {
5303
+ add: [$im, $chat, $user, $add],
5304
+ list: [$im, $chat, $user, $list],
5305
+ delete: [$im, $chat, $user, $delete],
5306
+ };
5307
+ }
5308
+ list(param) {
5309
+ return this.Navvy.simple(this.url.list, param);
5310
+ }
5311
+ delete(param) {
5312
+ return this.Navvy.simple(this.url.delete, param);
5313
+ }
5314
+ /**
5315
+ * Приглаcить участников в чат
5316
+ */
5317
+ add(param) {
5318
+ return this.Navvy.simple(this.url.add, param);
5319
+ }
5320
+ }
5321
+
5235
5322
  class BXRestNavvyImChat {
5236
5323
  constructor() {
5237
5324
  this.url = {
5238
5325
  add: [$im, $chat, $add],
5239
- // list: [$im, $chat, $user, $list],
5240
- // add: [$im, $chat, $user, $add],
5241
- // delete: [$im, $chat, $user, $delete],
5242
- // updateTitle: [$im, $chat, $updateTitle],
5243
- // updateColor: [$im, $chat, $updateColor],
5244
- // updateAvatar: [$im, $chat, $updateAvatar],
5245
- // setOwner: [$im, $chat, $setOwner],
5246
- // get: [$im, $chat, $get],
5247
- // mute: [$im, $chat, $mute],
5326
+ get: [$im, $chat, $get],
5327
+ setOwner: [$im, $chat, $setOwner],
5328
+ updateAvatar: [$im, $chat, $updateAvatar],
5329
+ updateColor: [$im, $chat, $updateColor],
5330
+ updateTitle: [$im, $chat, $updateTitle],
5331
+ leave: [$im, $chat, $leave],
5332
+ mute: [$im, $chat, $mute],
5248
5333
  };
5249
5334
  this.Navvy = new Navvy();
5335
+ this.user = new BXRestNavvyImChatUser();
5250
5336
  }
5337
+ /**
5338
+ * Создать чат
5339
+ *
5340
+ * @param param
5341
+ */
5251
5342
  add(param) {
5252
5343
  return this.Navvy.simple(this.url.add, param);
5253
5344
  }
5345
+ /**
5346
+ * Получить идентификатор чата
5347
+ *
5348
+ * @param param
5349
+ */
5350
+ get(param) {
5351
+ return this.Navvy.simple(this.url.get, param);
5352
+ }
5353
+ /**
5354
+ * Сменить владельца чата
5355
+ *
5356
+ * @param param
5357
+ */
5358
+ setOwner(param) {
5359
+ return this.Navvy.simple(this.url.setOwner, param);
5360
+ }
5361
+ /**
5362
+ * Изменить аватарку чата
5363
+ *
5364
+ * @param param
5365
+ */
5366
+ updateAvatar(param) {
5367
+ return this.Navvy.simple(this.url.updateAvatar, param);
5368
+ }
5369
+ /**
5370
+ * Изменить заголовок чата
5371
+ *
5372
+ * @param param
5373
+ */
5374
+ updateTitle(param) {
5375
+ return this.Navvy.simple(this.url.updateTitle, param);
5376
+ }
5377
+ /**
5378
+ * Покинуть чат
5379
+ *
5380
+ * @param param
5381
+ */
5382
+ leave(param) {
5383
+ return this.Navvy.simple(this.url.leave, param);
5384
+ }
5385
+ /**
5386
+ * Отключить уведомления от чата
5387
+ *
5388
+ * @param param
5389
+ */
5390
+ mute(param) {
5391
+ return this.Navvy.simple(this.url.mute, param);
5392
+ }
5393
+ /**
5394
+ * Изменить цвет чата
5395
+ *
5396
+ * @param param
5397
+ */
5398
+ updateColor(param) {
5399
+ return this.Navvy.simple(this.url.updateColor, param);
5400
+ }
5401
+ }
5402
+
5403
+ class BXRestNavvyImCounters {
5404
+ constructor() {
5405
+ this.Navvy = new Navvy();
5406
+ }
5407
+ get() {
5408
+ return this.Navvy.simple([$im, $counters, $get]);
5409
+ }
5410
+ }
5411
+
5412
+ class BXRestMapImDialogUsers {
5413
+ static list(value) {
5414
+ return (value)
5415
+ ? {
5416
+ ...value,
5417
+ ...{
5418
+ last_activity_date: toDate(value.last_activity_date),
5419
+ mobile_last_date: value.mobile_last_date ? toDate(value.mobile_last_date) : false,
5420
+ }
5421
+ }
5422
+ : undefined;
5423
+ }
5424
+ }
5425
+
5426
+ class BXRestNavvyImDialogUsers {
5427
+ constructor() {
5428
+ this.Navvy = new Navvy();
5429
+ }
5430
+ list(param) {
5431
+ return this.Navvy.simple([$im, $dialog, $users, $list], param, BXRestMapImDialogUsers.list);
5432
+ }
5433
+ }
5434
+
5435
+ class BXRestMapImDialog {
5436
+ static get(value) {
5437
+ return (value)
5438
+ ? {
5439
+ ...value,
5440
+ ...{
5441
+ id: toNum(value.id),
5442
+ owner: toNum(value.owner),
5443
+ date_create: toDate(value.date_create),
5444
+ }
5445
+ }
5446
+ : undefined;
5447
+ }
5448
+ }
5449
+
5450
+ class BXRestMapImDialogMessages {
5451
+ static get(value) {
5452
+ return (value)
5453
+ ? {
5454
+ ...value,
5455
+ ...{
5456
+ messages: value.messages.map(mes => ({
5457
+ ...mes,
5458
+ ...{
5459
+ date: toDate(mes.date),
5460
+ params: (mes.params)
5461
+ ? {
5462
+ ...mes,
5463
+ ...{
5464
+ URL_ONLY: mes.params.URL_ONLY === 'Y',
5465
+ IS_EDITED: mes.params.IS_DELETED === 'Y',
5466
+ IS_DELETED: mes.params.IS_DELETED === 'Y',
5467
+ }
5468
+ }
5469
+ : null
5470
+ }
5471
+ }))
5472
+ }
5473
+ }
5474
+ : undefined;
5475
+ }
5476
+ }
5477
+
5478
+ class BXRestNavvyImDialogMessages {
5479
+ constructor() {
5480
+ this.Navvy = new Navvy();
5481
+ }
5482
+ get(param) {
5483
+ return this.Navvy.simple([$im, $dialog, $messages, $get], param, BXRestMapImDialogMessages.get);
5484
+ }
5485
+ }
5486
+
5487
+ function BXRestNavvyImDialogRead(navvy) {
5488
+ const readFunc = (param) => {
5489
+ /**
5490
+ * Установить признак «прочитано» у сообщений
5491
+ *
5492
+ * @param param
5493
+ */
5494
+ return navvy.simple([$im, $dialog, $read], param);
5495
+ };
5496
+ /**
5497
+ * Установить признак «прочитано» у всех чатов
5498
+ */
5499
+ readFunc.all = () => {
5500
+ return navvy.simple([$im, $dialog, $read, $all]);
5501
+ };
5502
+ return readFunc;
5503
+ }
5504
+
5505
+ class BXRestNavvyImDialog {
5506
+ constructor() {
5507
+ this.Navvy = new Navvy();
5508
+ this.users = new BXRestNavvyImDialogUsers();
5509
+ this.messages = new BXRestNavvyImDialogMessages();
5510
+ this.read = BXRestNavvyImDialogRead(this.Navvy);
5511
+ }
5512
+ /**
5513
+ * Получить данные о чате
5514
+ *
5515
+ * @param param
5516
+ */
5517
+ get(param) {
5518
+ return this.Navvy.simple([$im, $dialog, $get], param, BXRestMapImDialog.get);
5519
+ }
5520
+ /**
5521
+ * Установить признак «прочитано» у сообщений
5522
+ *
5523
+ * @param param
5524
+ */
5525
+ unread(param) {
5526
+ return this.Navvy.simple([$im, $dialog, $unread], param);
5527
+ }
5528
+ /**
5529
+ * Отправить признак «вам пишут...»
5530
+ *
5531
+ * @param param
5532
+ */
5533
+ writing(param) {
5534
+ return this.Navvy.simple([$im, $dialog, $writing], param);
5535
+ }
5536
+ }
5537
+
5538
+ class BXRestMapImRecent {
5539
+ static get(value) {
5540
+ return value
5541
+ ? value.map(i => ({
5542
+ ...i,
5543
+ ...{
5544
+ date_update: toDate(i.date_update),
5545
+ counter: toNum(i.counter),
5546
+ user: i.user && i.user.id
5547
+ ? {
5548
+ ...i.user,
5549
+ ...{
5550
+ id: toNum(i.user.id),
5551
+ last_activity_date: i.user.last_activity_date ? toDate(i.user.last_activity_date) : false,
5552
+ mobile_last_date: i.user.mobile_last_date ? toDate(i.user.mobile_last_date) : false,
5553
+ absent: i.user.absent ? toDate(i.user.absent) : false,
5554
+ }
5555
+ }
5556
+ : undefined,
5557
+ chat: i.chat
5558
+ ? {
5559
+ ...i.chat,
5560
+ ...{
5561
+ id: toNum(i.chat.id),
5562
+ date_create: toDate(i.chat.date_create)
5563
+ }
5564
+ }
5565
+ : undefined,
5566
+ }
5567
+ }))
5568
+ : undefined;
5569
+ }
5570
+ static list(value) {
5571
+ return (value)
5572
+ ? {
5573
+ ...value, ...{
5574
+ items: value.items.map(i => ({
5575
+ ...i, ...{
5576
+ id: toNum(i.id),
5577
+ date_update: toDate(i.date_update),
5578
+ lines: (i.lines) ? { ...i.lines, ...{ date_create: toDate(i.lines.date_create) } } : undefined,
5579
+ message: { ...i.message, ...{ date: toDate(i.message.date) } },
5580
+ chat: (i.chat) ? { ...i.chat, ...{ date_create: toDate(i.chat.date_create) } } : undefined,
5581
+ user: (i.user)
5582
+ ? {
5583
+ ...i.user,
5584
+ ...{
5585
+ birthday: (i.user.birthday) ? toDate(i.user.birthday) : false,
5586
+ last_activity_date: (i.user.last_activity_date) ? toDate(i.user.last_activity_date) : undefined,
5587
+ mobile_last_date: (i.user.mobile_last_date) ? toDate(i.user.mobile_last_date) : false,
5588
+ }
5589
+ }
5590
+ : undefined,
5591
+ }
5592
+ }))
5593
+ }
5594
+ }
5595
+ : undefined;
5596
+ }
5597
+ }
5598
+
5599
+ class BXRestNavvyImRecent {
5600
+ constructor() {
5601
+ this.Navvy = new Navvy();
5602
+ this.url = {
5603
+ get: [$im, $recent, $get],
5604
+ list: [$im, $recent, $list],
5605
+ hide: [$im, $recent, $hide],
5606
+ pin: [$im, $recent, $pin],
5607
+ unread: [$im, $recent, $unread],
5608
+ };
5609
+ }
5610
+ /**
5611
+ * Получить сокращенный список последних чатов
5612
+ */
5613
+ get(param) {
5614
+ return this.Navvy.simple(this.url.get, param, BXRestMapImRecent.get);
5615
+ }
5616
+ /**
5617
+ * Получить список чатов
5618
+ */
5619
+ list(param) {
5620
+ return this.Navvy.simple(this.url.list, param, BXRestMapImRecent.list);
5621
+ }
5622
+ /**
5623
+ * Удалить чат из списка последних
5624
+ */
5625
+ hide(param) {
5626
+ return this.Navvy.simple(this.url.unread, param);
5627
+ }
5628
+ /**
5629
+ * Закрепить чат вверху списка
5630
+ */
5631
+ pin(param) {
5632
+ return this.Navvy.simple(this.url.pin, param);
5633
+ }
5634
+ /**
5635
+ * Установить или снять признак «прочитано» у чата
5636
+ */
5637
+ unread(param) {
5638
+ return this.Navvy.simple(this.url.unread, param);
5639
+ }
5640
+ }
5641
+
5642
+ class BXRestMapImUser {
5643
+ static get(value) {
5644
+ return (value)
5645
+ ? {
5646
+ ...value,
5647
+ ...{
5648
+ last_activity_date: toDate(value.last_activity_date),
5649
+ mobile_last_date: value.mobile_last_date ? toDate(value.mobile_last_date) : false,
5650
+ desktop_last_date: value.desktop_last_date ? toDate(value.desktop_last_date) : false,
5651
+ }
5652
+ }
5653
+ : undefined;
5654
+ }
5655
+ }
5656
+
5657
+ class BXRestNavvyImUserStatusIdle {
5658
+ constructor() {
5659
+ this.Navvy = new Navvy();
5660
+ }
5661
+ start(param) {
5662
+ return this.Navvy.simple([$im, $user, $status, $idle, $start], param);
5663
+ }
5664
+ end() {
5665
+ return this.Navvy.simple([$im, $user, $status, $idle, $end]);
5666
+ }
5667
+ }
5668
+
5669
+ class BXRestNavvyImUserStatus {
5670
+ constructor() {
5671
+ this.Navvy = new Navvy();
5672
+ this.idle = new BXRestNavvyImUserStatusIdle();
5673
+ }
5674
+ /**
5675
+ * Получить информацию об установленном статусе пользователя
5676
+ */
5677
+ get() {
5678
+ return this.Navvy.simple([$im, $user, $status, $get]);
5679
+ }
5680
+ /**
5681
+ * Установить статус пользователя
5682
+ */
5683
+ set(param) {
5684
+ return this.Navvy.simple([$im, $user, $status, $set], param);
5685
+ }
5686
+ }
5687
+
5688
+ class BXRestMapImUserList {
5689
+ /** Получить данные о пользователях */
5690
+ static get(value) {
5691
+ return value ?
5692
+ value.map(i => (i) ? BXRestMapImUser.get(i) : undefined)
5693
+ : undefined;
5694
+ }
5695
+ }
5696
+
5697
+ class BXRestNavvyImUserList {
5698
+ constructor() {
5699
+ this.Navvy = new Navvy();
5700
+ }
5701
+ /** Получить данные о пользователях */
5702
+ get(param) {
5703
+ return this.Navvy.simple([$im, $user, $list, $get], param, BXRestMapImUserList.get);
5704
+ }
5705
+ }
5706
+
5707
+ class BXRestNavvyImUser {
5708
+ constructor() {
5709
+ this.Navvy = new Navvy();
5710
+ this.list = new BXRestNavvyImUserList();
5711
+ this.status = new BXRestNavvyImUserStatus();
5712
+ }
5713
+ /**
5714
+ * Получить данные о пользователе
5715
+ *
5716
+ * @param param
5717
+ */
5718
+ get(param) {
5719
+ return this.Navvy.simple([$im, $dialog, $get], param, BXRestMapImUser.get);
5720
+ }
5254
5721
  }
5255
5722
 
5256
5723
  class BXRestNavvyIm {
5257
5724
  constructor() {
5258
5725
  this.chat = new BXRestNavvyImChat();
5726
+ this.counters = new BXRestNavvyImCounters();
5727
+ this.dialog = new BXRestNavvyImDialog();
5728
+ this.recent = new BXRestNavvyImRecent();
5729
+ this.user = new BXRestNavvyImUser();
5259
5730
  }
5260
5731
  }
5261
5732
 
@@ -5419,6 +5890,114 @@ class BXRestNavvySocialNetWork {
5419
5890
  }
5420
5891
  }
5421
5892
 
5893
+ class BXRestMapPullApplicationConfig {
5894
+ static get(value) {
5895
+ return value ?
5896
+ {
5897
+ ...value,
5898
+ ...{
5899
+ channels: {
5900
+ shared: {
5901
+ ...value.channels.shared, ...{
5902
+ start: toDate(value.channels.shared.start),
5903
+ end: toDate(value.channels.shared.end),
5904
+ }
5905
+ },
5906
+ private: {
5907
+ ...value.channels.private, ...{
5908
+ start: toDate(value.channels.private.start),
5909
+ end: toDate(value.channels.private.end),
5910
+ }
5911
+ }
5912
+ },
5913
+ publicChannels: Object.fromEntries(Object.entries(value.publicChannels).map(([key, val]) => ([key,
5914
+ {
5915
+ ...val,
5916
+ start: toDate(val.start),
5917
+ end: toDate(val.end)
5918
+ }
5919
+ ]))),
5920
+ }
5921
+ }
5922
+ : undefined;
5923
+ }
5924
+ }
5925
+
5926
+ class BXRestMapPull {
5927
+ static get(value) {
5928
+ console.log('Object.entries(value.publicChannels)', value);
5929
+ if (value?.publicChannels) {
5930
+ console.log('Object.entries(value.publicChannels)', value.publicChannels, Object.entries(value.publicChannels), Object.fromEntries(Object.entries(value.publicChannels).map(([key, val]) => ([key,
5931
+ {
5932
+ ...val,
5933
+ start: toDate(val.start), end: toDate(val.end)
5934
+ }
5935
+ ]))));
5936
+ }
5937
+ return value ? { ...BXRestMapPullApplicationConfig.get(value), ...{ serverTime: toDate(value.serverTime) } } : undefined;
5938
+ }
5939
+ }
5940
+
5941
+ class BXRestMapPullChannelPublic {
5942
+ static get(value) {
5943
+ return value ? {
5944
+ ...value,
5945
+ start: toDate(value.start),
5946
+ end: toDate(value.end)
5947
+ }
5948
+ : undefined;
5949
+ }
5950
+ }
5951
+
5952
+ class BXRestNavvyPullConfig {
5953
+ constructor() {
5954
+ this.url = {
5955
+ /**
5956
+ * Получает информацию для подключения в веб сокету
5957
+ */
5958
+ get: [$pull, $config, $get]
5959
+ };
5960
+ this.Navvy = new Navvy();
5961
+ }
5962
+ static { this.public = new BXRestMapPullChannelPublic(); }
5963
+ get() {
5964
+ return this.Navvy.simple(this.url.get, undefined, BXRestMapPull.get);
5965
+ }
5966
+ }
5967
+
5968
+ class BXRestNavvyPullChannelPublic {
5969
+ constructor() {
5970
+ this.url = {
5971
+ get: [$log, $blogpost, $add]
5972
+ };
5973
+ this.Navvy = new Navvy();
5974
+ }
5975
+ get() {
5976
+ return this.Navvy.simple([$pull, $channel, $public, $get], undefined, BXRestMapPullChannelPublic.get);
5977
+ }
5978
+ }
5979
+
5980
+ class BXRestNavvyPullApplicationConfig {
5981
+ constructor() {
5982
+ this.Navvy = new Navvy();
5983
+ }
5984
+ get() {
5985
+ return this.Navvy.simple([$pull, $application, $config, $get], undefined, BXRestMapPullApplicationConfig.get);
5986
+ }
5987
+ }
5988
+
5989
+ class BXRestNavvyPull {
5990
+ constructor() {
5991
+ this.config = new BXRestNavvyPullConfig();
5992
+ this.channel = {
5993
+ public: new BXRestNavvyPullChannelPublic()
5994
+ };
5995
+ this.application = {
5996
+ config: new BXRestNavvyPullApplicationConfig(),
5997
+ };
5998
+ }
5999
+ }
6000
+
5422
6001
  class BXRestNavvy {
5423
6002
  constructor() {
5424
6003
  this.user = new BXRestNavvyUser();
@@ -5436,6 +6015,7 @@ class BXRestNavvy {
5436
6015
  this.app = new BXRestNavvyApp();
5437
6016
  this.timeMan = new BXRestNavvyTimeMan();
5438
6017
  this.socialNetWork = new BXRestNavvySocialNetWork();
6018
+ this.pull = new BXRestNavvyPull();
5439
6019
  this.Navvy = new Navvy();
5440
6020
  // public batch<T, C, M>(param: iBXRestNavvyParamBatch<T, C, M>) {
5441
6021
  // const modifiedObject = Object.fromEntries(