node-nim 9.14.3 → 9.14.4

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 (127) hide show
  1. package/dist/chatroom/chatroom.js +262 -262
  2. package/dist/chatroom_def/chatroom_def.js +119 -119
  3. package/dist/loader.js +35 -35
  4. package/dist/nim/client.js +184 -184
  5. package/dist/nim/data_sync.js +19 -19
  6. package/dist/nim/friend.js +150 -150
  7. package/dist/nim/global.js +131 -131
  8. package/dist/nim/msglog.js +687 -687
  9. package/dist/nim/nos.js +180 -180
  10. package/dist/nim/online_session.js +85 -85
  11. package/dist/nim/pass_through_proxy.js +39 -39
  12. package/dist/nim/plugin.js +65 -65
  13. package/dist/nim/session.js +392 -392
  14. package/dist/nim/subscribe_event.js +142 -142
  15. package/dist/nim/super_team.js +651 -615
  16. package/dist/nim/super_team.js.map +1 -1
  17. package/dist/nim/sysmsg.js +194 -194
  18. package/dist/nim/talk.js +209 -209
  19. package/dist/nim/talkex.js +191 -191
  20. package/dist/nim/team.js +866 -830
  21. package/dist/nim/team.js.map +1 -1
  22. package/dist/nim/tool.js +119 -119
  23. package/dist/nim/user.js +201 -201
  24. package/dist/nim_def/client_def.js +245 -245
  25. package/dist/nim_def/data_sync_def.js +20 -20
  26. package/dist/nim_def/doc_trans_def.js +16 -16
  27. package/dist/nim_def/friend_def.js +37 -37
  28. package/dist/nim_def/global_def.js +39 -39
  29. package/dist/nim_def/msglog_def.js +148 -148
  30. package/dist/nim_def/nos_def.js +16 -16
  31. package/dist/nim_def/online_session_def.js +2 -2
  32. package/dist/nim_def/pass_through_proxy_def.js +10 -10
  33. package/dist/nim_def/plugin_def.js +2 -2
  34. package/dist/nim_def/session_def.js +26 -26
  35. package/dist/nim_def/subscribe_event_def.js +52 -52
  36. package/dist/nim_def/super_team_def.js +71 -71
  37. package/dist/nim_def/sysmsg_def.js +28 -28
  38. package/dist/nim_def/talk_def.js +2 -2
  39. package/dist/nim_def/talkex_def.js +2 -2
  40. package/dist/nim_def/team_def.js +76 -76
  41. package/dist/nim_def/tool_def.js +11 -11
  42. package/dist/nim_def/user_def.js +22 -22
  43. package/dist/node-nim.js +171 -171
  44. package/dist/qchat/attachment.js +63 -63
  45. package/dist/qchat/channel.js +314 -314
  46. package/dist/qchat/channel_category.js +187 -187
  47. package/dist/qchat/instance.js +77 -77
  48. package/dist/qchat/message.js +285 -285
  49. package/dist/qchat/role.js +423 -423
  50. package/dist/qchat/server.js +453 -453
  51. package/dist/qchat/system_notification.js +74 -74
  52. package/dist/qchat_def/attachment_def.js +2 -2
  53. package/dist/qchat_def/channel_def.js +2 -2
  54. package/dist/qchat_def/instance_def.js +2 -2
  55. package/dist/qchat_def/message_def.js +2 -2
  56. package/dist/qchat_def/public_def.js +649 -649
  57. package/dist/qchat_def/role_def.js +2 -2
  58. package/dist/qchat_def/server_def.js +2 -2
  59. package/dist/qchat_def/system_notification_def.js +2 -2
  60. package/dist/v2/v2_nim_instance.js +43 -43
  61. package/dist/v2/v2_nim_login_service.js +123 -123
  62. package/dist/v2_def/v2_nim_callback_def.js +2 -2
  63. package/dist/v2_def/v2_nim_enum_def.js +325 -325
  64. package/dist/v2_def/v2_nim_struct_def.js +2 -2
  65. package/package.json +1 -1
  66. package/types/chatroom/chatroom.d.ts +55 -55
  67. package/types/chatroom_def/chatroom_def.d.ts +448 -448
  68. package/types/loader.d.ts +2 -2
  69. package/types/nim/client.d.ts +123 -123
  70. package/types/nim/data_sync.d.ts +12 -12
  71. package/types/nim/friend.d.ts +82 -82
  72. package/types/nim/global.d.ts +69 -69
  73. package/types/nim/msglog.d.ts +392 -392
  74. package/types/nim/nos.d.ts +118 -118
  75. package/types/nim/online_session.d.ts +44 -44
  76. package/types/nim/pass_through_proxy.d.ts +24 -24
  77. package/types/nim/plugin.d.ts +39 -39
  78. package/types/nim/session.d.ts +212 -212
  79. package/types/nim/subscribe_event.d.ts +87 -87
  80. package/types/nim/super_team.d.ts +356 -342
  81. package/types/nim/sysmsg.d.ts +105 -105
  82. package/types/nim/talk.d.ts +94 -94
  83. package/types/nim/talkex.d.ts +95 -95
  84. package/types/nim/team.d.ts +481 -467
  85. package/types/nim/tool.d.ts +77 -77
  86. package/types/nim/user.d.ts +111 -111
  87. package/types/nim_def/client_def.d.ts +284 -284
  88. package/types/nim_def/data_sync_def.d.ts +19 -19
  89. package/types/nim_def/doc_trans_def.d.ts +11 -11
  90. package/types/nim_def/friend_def.d.ts +65 -65
  91. package/types/nim_def/global_def.d.ts +62 -62
  92. package/types/nim_def/msglog_def.d.ts +373 -373
  93. package/types/nim_def/nos_def.d.ts +72 -72
  94. package/types/nim_def/online_session_def.d.ts +34 -34
  95. package/types/nim_def/pass_through_proxy_def.d.ts +13 -13
  96. package/types/nim_def/plugin_def.d.ts +8 -8
  97. package/types/nim_def/session_def.d.ts +114 -114
  98. package/types/nim_def/subscribe_event_def.d.ts +83 -83
  99. package/types/nim_def/super_team_def.d.ts +165 -163
  100. package/types/nim_def/sysmsg_def.d.ts +70 -70
  101. package/types/nim_def/talk_def.d.ts +96 -96
  102. package/types/nim_def/talkex_def.d.ts +112 -112
  103. package/types/nim_def/team_def.d.ts +186 -184
  104. package/types/nim_def/tool_def.d.ts +28 -28
  105. package/types/nim_def/user_def.d.ts +59 -59
  106. package/types/node-nim.d.ts +93 -93
  107. package/types/qchat/attachment.d.ts +40 -40
  108. package/types/qchat/channel.d.ts +139 -139
  109. package/types/qchat/channel_category.d.ts +82 -82
  110. package/types/qchat/instance.d.ts +46 -46
  111. package/types/qchat/message.d.ts +128 -128
  112. package/types/qchat/role.d.ts +166 -166
  113. package/types/qchat/server.d.ts +198 -198
  114. package/types/qchat/system_notification.d.ts +39 -39
  115. package/types/qchat_def/attachment_def.d.ts +71 -71
  116. package/types/qchat_def/channel_def.d.ts +643 -643
  117. package/types/qchat_def/instance_def.d.ts +214 -214
  118. package/types/qchat_def/message_def.d.ts +565 -565
  119. package/types/qchat_def/public_def.d.ts +754 -754
  120. package/types/qchat_def/role_def.d.ts +413 -413
  121. package/types/qchat_def/server_def.d.ts +529 -529
  122. package/types/qchat_def/system_notification_def.d.ts +172 -172
  123. package/types/v2/v2_nim_instance.d.ts +25 -25
  124. package/types/v2/v2_nim_login_service.d.ts +96 -96
  125. package/types/v2_def/v2_nim_callback_def.d.ts +20 -20
  126. package/types/v2_def/v2_nim_enum_def.d.ts +300 -300
  127. package/types/v2_def/v2_nim_struct_def.d.ts +338 -338
@@ -1,143 +1,143 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.NIMSubscribeEvent = void 0;
7
- const loader_1 = __importDefault(require("../loader"));
8
- const eventemitter3_1 = require("eventemitter3");
9
- class NIMSubscribeEvent extends eventemitter3_1.EventEmitter {
10
- constructor() {
11
- super();
12
- this.subscribeEvent = new loader_1.default.NIMSubscribeEvent({ emit: this.emit.bind(this) });
13
- }
14
- /** 注册全局回调 */
15
- initEventHandlers() {
16
- return this.subscribeEvent.InitEventHandlers();
17
- }
18
- /** 发布事件
19
- * @param event_data 事件
20
- * @param cb 发布事件回调函数
21
- * @param jsonExtension json扩展参数(备用,目前不需要)
22
- * @return boolean 检查参数如果不符合要求则返回失败
23
- * @note
24
- * <pre>
25
- * 200:成功
26
- * 403:应用没开通事件服务
27
- * 404:禁用了特定事件
28
- * 414:参数错误
29
- * 500:未知错误
30
- * </pre>
31
- */
32
- publish(data, cb, jsonExtension) {
33
- return new Promise((resolve) => {
34
- this.subscribeEvent.Publish(data, (rescode, eventType, data) => {
35
- if (cb) {
36
- cb(rescode, eventType, data);
37
- }
38
- resolve([rescode, eventType, data]);
39
- }, jsonExtension);
40
- });
41
- }
42
- /** 订阅事件
43
- * @param event_type 事件类型
44
- * @param ttl 订阅有效期,单位:秒,范围:60s到30天
45
- * @param sync_type 订阅后是否立即同步最新事件
46
- * @param accid_list 要订阅的用户列表
47
- * @param cb 订阅事件回调函数
48
- * @param jsonExtension json扩展参数(备用,目前不需要)
49
- * @return boolean 检查参数如果不符合要求则返回失败
50
- * @note
51
- * <pre>
52
- * 200:成功
53
- * 414:参数错误
54
- * 500:未知错误
55
- * </pre>
56
- */
57
- subscribe(eventType, ttl, syncType, accids, cb, jsonExtension) {
58
- return new Promise((resolve) => {
59
- if (!this.subscribeEvent.Subscribe(eventType, ttl, syncType, accids, (rescode, eventType, failedList) => {
60
- if (cb) {
61
- cb(rescode, eventType, failedList);
62
- }
63
- resolve([rescode, eventType, failedList]);
64
- }, jsonExtension)) {
65
- resolve(null);
66
- }
67
- });
68
- }
69
- /** 按账号取消指定事件的订阅关系
70
- * @param event_type 事件类型
71
- * @param accid_list 要取消订阅的用户列表
72
- * @param cb 取消订阅事件回调函数
73
- * @param jsonExtension json扩展参数(备用,目前不需要)
74
- * @return boolean 检查参数如果不符合要求则返回失败
75
- * @note
76
- * <pre>
77
- * 200:成功
78
- * 414:参数错误
79
- * 500:未知错误
80
- * </pre>
81
- */
82
- unSubscribe(eventType, accids, cb, jsonExtension) {
83
- return new Promise((resolve) => {
84
- if (!this.subscribeEvent.UnSubscribe(eventType, accids, (rescode, eventType, failedList) => {
85
- if (cb) {
86
- cb(rescode, eventType, failedList);
87
- }
88
- resolve([rescode, eventType, failedList]);
89
- }, jsonExtension)) {
90
- resolve(null);
91
- }
92
- });
93
- }
94
- /** 取消指定事件的全部订阅关系
95
- * @param event_type 事件类型
96
- * @param cb 取消订阅事件回调函数
97
- * @param jsonExtension json扩展参数(备用,目前不需要)
98
- * @return boolean 检查参数如果不符合要求则返回失败
99
- * @note
100
- * <pre>
101
- * 200:成功
102
- * 414:参数错误
103
- * 500:未知错误
104
- * </pre>
105
- */
106
- batchUnSubscribe(eventType, cb, jsonExtension) {
107
- return new Promise((resolve) => {
108
- if (!this.subscribeEvent.BatchUnSubscribe(eventType, (rescode, eventType) => {
109
- if (cb) {
110
- cb(rescode, eventType);
111
- }
112
- resolve([rescode, eventType]);
113
- }, jsonExtension)) {
114
- resolve(null);
115
- }
116
- });
117
- }
118
- /** 按账号查询指定事件订阅关系
119
- * @param event_type 事件类型
120
- * @param accid_list 要查询订阅关系的用户列表
121
- * @param cb 查询订阅关系回调函数
122
- * @param jsonExtension json扩展参数(备用,目前不需要)
123
- * @return boolean 检查参数如果不符合要求则返回失败
124
- * @note
125
- * <pre>
126
- * 200:成功
127
- * 414:参数错误
128
- * 500:未知错误
129
- * </pre>
130
- */
131
- querySubscribe(eventType, accids, cb, jsonExtension) {
132
- return new Promise((resolve) => {
133
- this.subscribeEvent.QuerySubscribe(eventType, accids, (rescode, eventType, datas) => {
134
- if (cb) {
135
- cb(rescode, eventType, datas);
136
- }
137
- resolve([rescode, eventType, datas]);
138
- }, jsonExtension);
139
- });
140
- }
141
- }
142
- exports.NIMSubscribeEvent = NIMSubscribeEvent;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.NIMSubscribeEvent = void 0;
7
+ const loader_1 = __importDefault(require("../loader"));
8
+ const eventemitter3_1 = require("eventemitter3");
9
+ class NIMSubscribeEvent extends eventemitter3_1.EventEmitter {
10
+ constructor() {
11
+ super();
12
+ this.subscribeEvent = new loader_1.default.NIMSubscribeEvent({ emit: this.emit.bind(this) });
13
+ }
14
+ /** 注册全局回调 */
15
+ initEventHandlers() {
16
+ return this.subscribeEvent.InitEventHandlers();
17
+ }
18
+ /** 发布事件
19
+ * @param event_data 事件
20
+ * @param cb 发布事件回调函数
21
+ * @param jsonExtension json扩展参数(备用,目前不需要)
22
+ * @return boolean 检查参数如果不符合要求则返回失败
23
+ * @note
24
+ * <pre>
25
+ * 200:成功
26
+ * 403:应用没开通事件服务
27
+ * 404:禁用了特定事件
28
+ * 414:参数错误
29
+ * 500:未知错误
30
+ * </pre>
31
+ */
32
+ publish(data, cb, jsonExtension) {
33
+ return new Promise((resolve) => {
34
+ this.subscribeEvent.Publish(data, (rescode, eventType, data) => {
35
+ if (cb) {
36
+ cb(rescode, eventType, data);
37
+ }
38
+ resolve([rescode, eventType, data]);
39
+ }, jsonExtension);
40
+ });
41
+ }
42
+ /** 订阅事件
43
+ * @param event_type 事件类型
44
+ * @param ttl 订阅有效期,单位:秒,范围:60s到30天
45
+ * @param sync_type 订阅后是否立即同步最新事件
46
+ * @param accid_list 要订阅的用户列表
47
+ * @param cb 订阅事件回调函数
48
+ * @param jsonExtension json扩展参数(备用,目前不需要)
49
+ * @return boolean 检查参数如果不符合要求则返回失败
50
+ * @note
51
+ * <pre>
52
+ * 200:成功
53
+ * 414:参数错误
54
+ * 500:未知错误
55
+ * </pre>
56
+ */
57
+ subscribe(eventType, ttl, syncType, accids, cb, jsonExtension) {
58
+ return new Promise((resolve) => {
59
+ if (!this.subscribeEvent.Subscribe(eventType, ttl, syncType, accids, (rescode, eventType, failedList) => {
60
+ if (cb) {
61
+ cb(rescode, eventType, failedList);
62
+ }
63
+ resolve([rescode, eventType, failedList]);
64
+ }, jsonExtension)) {
65
+ resolve(null);
66
+ }
67
+ });
68
+ }
69
+ /** 按账号取消指定事件的订阅关系
70
+ * @param event_type 事件类型
71
+ * @param accid_list 要取消订阅的用户列表
72
+ * @param cb 取消订阅事件回调函数
73
+ * @param jsonExtension json扩展参数(备用,目前不需要)
74
+ * @return boolean 检查参数如果不符合要求则返回失败
75
+ * @note
76
+ * <pre>
77
+ * 200:成功
78
+ * 414:参数错误
79
+ * 500:未知错误
80
+ * </pre>
81
+ */
82
+ unSubscribe(eventType, accids, cb, jsonExtension) {
83
+ return new Promise((resolve) => {
84
+ if (!this.subscribeEvent.UnSubscribe(eventType, accids, (rescode, eventType, failedList) => {
85
+ if (cb) {
86
+ cb(rescode, eventType, failedList);
87
+ }
88
+ resolve([rescode, eventType, failedList]);
89
+ }, jsonExtension)) {
90
+ resolve(null);
91
+ }
92
+ });
93
+ }
94
+ /** 取消指定事件的全部订阅关系
95
+ * @param event_type 事件类型
96
+ * @param cb 取消订阅事件回调函数
97
+ * @param jsonExtension json扩展参数(备用,目前不需要)
98
+ * @return boolean 检查参数如果不符合要求则返回失败
99
+ * @note
100
+ * <pre>
101
+ * 200:成功
102
+ * 414:参数错误
103
+ * 500:未知错误
104
+ * </pre>
105
+ */
106
+ batchUnSubscribe(eventType, cb, jsonExtension) {
107
+ return new Promise((resolve) => {
108
+ if (!this.subscribeEvent.BatchUnSubscribe(eventType, (rescode, eventType) => {
109
+ if (cb) {
110
+ cb(rescode, eventType);
111
+ }
112
+ resolve([rescode, eventType]);
113
+ }, jsonExtension)) {
114
+ resolve(null);
115
+ }
116
+ });
117
+ }
118
+ /** 按账号查询指定事件订阅关系
119
+ * @param event_type 事件类型
120
+ * @param accid_list 要查询订阅关系的用户列表
121
+ * @param cb 查询订阅关系回调函数
122
+ * @param jsonExtension json扩展参数(备用,目前不需要)
123
+ * @return boolean 检查参数如果不符合要求则返回失败
124
+ * @note
125
+ * <pre>
126
+ * 200:成功
127
+ * 414:参数错误
128
+ * 500:未知错误
129
+ * </pre>
130
+ */
131
+ querySubscribe(eventType, accids, cb, jsonExtension) {
132
+ return new Promise((resolve) => {
133
+ this.subscribeEvent.QuerySubscribe(eventType, accids, (rescode, eventType, datas) => {
134
+ if (cb) {
135
+ cb(rescode, eventType, datas);
136
+ }
137
+ resolve([rescode, eventType, datas]);
138
+ }, jsonExtension);
139
+ });
140
+ }
141
+ }
142
+ exports.NIMSubscribeEvent = NIMSubscribeEvent;
143
143
  //# sourceMappingURL=subscribe_event.js.map