fcr-core 3.8.2 → 3.9.0-alpha

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 (159) hide show
  1. package/lib/chat-connector/type.d.ts +40 -0
  2. package/lib/{chat-connection → chat-connector}/type.js +1 -1
  3. package/lib/engine/index.d.ts +10 -11
  4. package/lib/engine/index.js +63 -72
  5. package/lib/engine/type.d.ts +96 -0
  6. package/lib/engine/type.js +5 -0
  7. package/lib/imports.d.ts +7 -4
  8. package/lib/imports.js +30 -4
  9. package/lib/index.d.ts +3 -2
  10. package/lib/index.js +21 -2
  11. package/lib/media-control/desktop.js +12 -12
  12. package/lib/media-control/mobile.js +4 -0
  13. package/lib/media-control/type.d.ts +32 -33
  14. package/lib/monitor-control/index.js +3 -3
  15. package/lib/peer-session/index.js +14 -14
  16. package/lib/peer-session/type.d.ts +1 -1
  17. package/lib/plugins/chat/chatroom.js +417 -0
  18. package/lib/{chat-connection → plugins/chat}/config.d.ts +1 -0
  19. package/lib/{chat-connection → plugins/chat}/config.js +2 -1
  20. package/lib/plugins/chat/connector.d.ts +38 -0
  21. package/lib/{chat-connection/index.js → plugins/chat/connector.js} +181 -61
  22. package/lib/room-control/ability-control/index.js +5 -4
  23. package/lib/room-control/ability-control/type.d.ts +5 -1
  24. package/lib/room-control/ability-control/type.js +4 -0
  25. package/lib/room-control/chatroom-control/type.d.ts +44 -35
  26. package/lib/room-control/group-control/index.js +9 -9
  27. package/lib/room-control/index.js +37 -22
  28. package/lib/room-control/interpreter-control/index.js +7 -4
  29. package/lib/room-control/interpreter-control/room.js +3 -3
  30. package/lib/room-control/interpreter-control/types.d.ts +2 -2
  31. package/lib/room-control/join-before-host-waitingroom-control/index.js +3 -3
  32. package/lib/room-control/mainroom-control/index.js +15 -13
  33. package/lib/room-control/privilege-control/index.js +39 -24
  34. package/lib/room-control/privilege-control/type.d.ts +15 -15
  35. package/lib/room-control/room-connector-control/index.js +7 -5
  36. package/lib/room-control/room-connector-control/type.d.ts +1 -1
  37. package/lib/room-control/room-control-factory.d.ts +3 -3
  38. package/lib/room-control/room-control-factory.js +7 -7
  39. package/lib/room-control/room-session/index.js +17 -15
  40. package/lib/room-control/room-session/type.d.ts +3 -3
  41. package/lib/room-control/sharing-control/index.js +13 -7
  42. package/lib/room-control/stream-control/index.js +18 -16
  43. package/lib/room-control/stream-control/type.d.ts +5 -5
  44. package/lib/room-control/stt-control/index.js +38 -31
  45. package/lib/room-control/type.d.ts +19 -19
  46. package/lib/room-control/user-control/index.js +20 -22
  47. package/lib/room-control/user-control/type.d.ts +1 -1
  48. package/lib/room-control/waitingroom-control/index.js +11 -11
  49. package/lib/room-control/whiteboard-control-v1/board-window.d.ts +21 -20
  50. package/lib/room-control/whiteboard-control-v1/board-window.js +27 -8
  51. package/lib/room-control/whiteboard-control-v1/factory.js +1 -1
  52. package/lib/room-control/whiteboard-control-v1/index.js +26 -18
  53. package/lib/room-control/whiteboard-control-v1/type.d.ts +26 -25
  54. package/lib/room-control/whiteboard-control-v1/type.js +1 -0
  55. package/lib/room-control/whiteboard-control-v2/annotation-control/control.d.ts +15 -6
  56. package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +39 -5
  57. package/lib/room-control/whiteboard-control-v2/annotation-control/factory.d.ts +4 -5
  58. package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +6 -5
  59. package/lib/room-control/whiteboard-control-v2/annotation-control/type.d.ts +7 -1
  60. package/lib/room-control/whiteboard-control-v2/base/index.d.ts +9 -8
  61. package/lib/room-control/whiteboard-control-v2/base/index.js +84 -42
  62. package/lib/room-control/whiteboard-control-v2/base/main-window.d.ts +16 -15
  63. package/lib/room-control/whiteboard-control-v2/base/main-window.js +23 -4
  64. package/lib/room-control/whiteboard-control-v2/type.d.ts +17 -17
  65. package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.d.ts +12 -6
  66. package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +64 -18
  67. package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.d.ts +2 -2
  68. package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +10 -10
  69. package/lib/room-control/whiteboard-control-v2/whiteboard-control/type.d.ts +1 -1
  70. package/lib/room-router/index.js +10 -7
  71. package/lib/room-router/type.d.ts +1 -1
  72. package/lib/schema.d.ts +24 -46
  73. package/lib/schema.js +1 -2
  74. package/lib/service/api.d.ts +5 -3
  75. package/lib/service/api.js +17 -12
  76. package/lib/type.d.ts +64 -45
  77. package/lib/type.js +76 -11
  78. package/lib/utilities/abortable-retry.d.ts +38 -0
  79. package/lib/utilities/abortable-retry.js +61 -0
  80. package/lib/utilities/dual-video-stream-config.d.ts +6 -0
  81. package/lib/utilities/dual-video-stream-config.js +25 -0
  82. package/lib/utilities/error-helpers.d.ts +10 -9
  83. package/lib/utilities/error-helpers.js +12 -11
  84. package/lib/utilities/error.d.ts +4 -40
  85. package/lib/utilities/error.js +20 -77
  86. package/lib/utilities/join-helper.js +2 -2
  87. package/lib/utilities/logger.d.ts +2 -2
  88. package/lib/utilities/logger.js +6 -25
  89. package/lib/utilities/package-info.d.ts +1 -2
  90. package/lib/utilities/package-info.js +4 -8
  91. package/lib/utilities/parameters.js +88 -15
  92. package/lib/utilities/validate-params.js +1 -1
  93. package/lib/utilities/video-encoder-config.d.ts +9 -0
  94. package/lib/utilities/video-encoder-config.js +109 -0
  95. package/lib-es/{chat-connection → chat-connector}/type.js +1 -1
  96. package/lib-es/engine/index.js +46 -56
  97. package/lib-es/engine/type.js +1 -0
  98. package/lib-es/imports.js +5 -3
  99. package/lib-es/index.js +2 -1
  100. package/lib-es/media-control/desktop.js +12 -12
  101. package/lib-es/media-control/mobile.js +4 -0
  102. package/lib-es/monitor-control/index.js +3 -3
  103. package/lib-es/peer-session/index.js +16 -15
  104. package/lib-es/plugins/chat/chatroom.js +409 -0
  105. package/lib-es/{chat-connection → plugins/chat}/config.js +2 -1
  106. package/lib-es/{chat-connection/index.js → plugins/chat/connector.js} +178 -58
  107. package/lib-es/room-control/ability-control/index.js +5 -4
  108. package/lib-es/room-control/ability-control/type.js +4 -0
  109. package/lib-es/room-control/group-control/index.js +11 -10
  110. package/lib-es/room-control/index.js +40 -26
  111. package/lib-es/room-control/interpreter-control/index.js +10 -5
  112. package/lib-es/room-control/interpreter-control/room.js +3 -3
  113. package/lib-es/room-control/join-before-host-waitingroom-control/index.js +4 -3
  114. package/lib-es/room-control/mainroom-control/index.js +16 -17
  115. package/lib-es/room-control/privilege-control/index.js +43 -29
  116. package/lib-es/room-control/room-connector-control/index.js +9 -6
  117. package/lib-es/room-control/room-control-factory.js +6 -6
  118. package/lib-es/room-control/room-session/index.js +21 -22
  119. package/lib-es/room-control/sharing-control/index.js +13 -7
  120. package/lib-es/room-control/stream-control/index.js +21 -18
  121. package/lib-es/room-control/stt-control/index.js +23 -15
  122. package/lib-es/room-control/user-control/index.js +23 -23
  123. package/lib-es/room-control/waitingroom-control/index.js +10 -9
  124. package/lib-es/room-control/whiteboard-control-v1/board-window.js +27 -8
  125. package/lib-es/room-control/whiteboard-control-v1/factory.js +1 -1
  126. package/lib-es/room-control/whiteboard-control-v1/index.js +26 -17
  127. package/lib-es/room-control/whiteboard-control-v1/type.js +1 -0
  128. package/lib-es/room-control/whiteboard-control-v2/annotation-control/control.js +39 -5
  129. package/lib-es/room-control/whiteboard-control-v2/annotation-control/factory.js +7 -6
  130. package/lib-es/room-control/whiteboard-control-v2/base/index.js +86 -42
  131. package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +23 -4
  132. package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/control.js +60 -13
  133. package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/factory.js +10 -10
  134. package/lib-es/room-router/index.js +10 -6
  135. package/lib-es/schema.js +1 -2
  136. package/lib-es/service/api.js +17 -12
  137. package/lib-es/type.js +70 -18
  138. package/lib-es/utilities/abortable-retry.js +54 -0
  139. package/lib-es/utilities/dual-video-stream-config.js +19 -0
  140. package/lib-es/utilities/error-helpers.js +13 -12
  141. package/lib-es/utilities/error.js +9 -75
  142. package/lib-es/utilities/join-helper.js +4 -3
  143. package/lib-es/utilities/logger.js +7 -23
  144. package/lib-es/utilities/package-info.js +4 -6
  145. package/lib-es/utilities/parameters.js +88 -15
  146. package/lib-es/utilities/validate-params.js +3 -2
  147. package/lib-es/utilities/video-encoder-config.js +103 -0
  148. package/package.json +7 -7
  149. package/lib/chat-connection/index.d.ts +0 -24
  150. package/lib/chat-connection/type.d.ts +0 -17
  151. package/lib/plugins/chatroom.js +0 -454
  152. package/lib/room-control/chatroom-control/config.d.ts +0 -51
  153. package/lib/room-control/chatroom-control/config.js +0 -105
  154. package/lib/utilities/storage.d.ts +0 -8
  155. package/lib/utilities/storage.js +0 -33
  156. package/lib-es/plugins/chatroom.js +0 -446
  157. package/lib-es/room-control/chatroom-control/config.js +0 -100
  158. package/lib-es/utilities/storage.js +0 -27
  159. /package/lib/plugins/{chatroom.d.ts → chat/chatroom.d.ts} +0 -0
@@ -26,12 +26,13 @@ var _imports = require("../imports");
26
26
  var _roomControlFactory = require("../room-control/room-control-factory");
27
27
  var _type = require("../room-control/type");
28
28
  var _schema = require("../schema");
29
+ var _type2 = require("../type");
29
30
  var _error = require("../utilities/error");
30
31
  var _joinHelper = require("../utilities/join-helper");
31
32
  var _retryHelpers = require("../utilities/retry-helpers");
32
33
  var _logger = require("../utilities/logger");
33
34
  var _validateParams = _interopRequireDefault(require("../utilities/validate-params"));
34
- var _type2 = require("./type");
35
+ var _type3 = require("./type");
35
36
  let _initProto, _initDecs, _joinRoomDecs;
36
37
  function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function (e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O.static = l, O.private = f, f ? 2 === o ? k = function (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function (t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
37
38
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
@@ -46,7 +47,7 @@ class FcrRoomRouterImpl {
46
47
  static {
47
48
  [_initProto] = _applyDecs(this, [[_initDecs, 2, "_init"], [_joinRoomDecs, 2, "joinRoom"], [_imports.trace, 2, "leaveRoom"]], []).e;
48
49
  }
49
- [(_initDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _joinRoomDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrRoomJoinOptionsSchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
50
+ [(_initDecs = [(0, _imports.trace)(['roomId']), (0, _validateParams.default)(_schema.stringSchema)], _joinRoomDecs = [(0, _imports.trace)(['options']), (0, _validateParams.default)(_schema.fcrRoomJoinOptionsSchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
50
51
  prefix: 'FcrRoomRouterImpl'
51
52
  }));
52
53
  _abortController = null;
@@ -90,6 +91,7 @@ class FcrRoomRouterImpl {
90
91
  isJoined: false
91
92
  };
92
93
  this._bypass = undefined;
94
+ return _type2.FcrReturnCode.SUCCESS;
93
95
  }
94
96
  async joinRoom(options) {
95
97
  this._abortController = new AbortController();
@@ -110,6 +112,7 @@ class FcrRoomRouterImpl {
110
112
  this._abortController = null;
111
113
  this._roomControl?.leave();
112
114
  this._roomControl = null;
115
+ return _type2.FcrReturnCode.SUCCESS;
113
116
  }
114
117
 
115
118
  /**
@@ -118,7 +121,7 @@ class FcrRoomRouterImpl {
118
121
  */
119
122
  _validateRoomJoinState() {
120
123
  if (this._nextRoomRoute.isJoined) {
121
- throw (0, _error.generateFcrCoreClientError)(_error.FcrErrorModuleCode.ROOM, _error.FcrErrorCode.UNDEFINED_ERROR, 'Room join failed: The user has an active connection to the room.', new Error('Room join failed: The user has an active connection to the room.'));
124
+ throw (0, _error.generateFcrCoreClientError)(_imports.ErrorModuleCode.FCR_ROOM, _imports.DetailErrorCode.UNDEFINED_ERROR, 'Room join failed: The user has an active connection to the room.', new Error('Room join failed: The user has an active connection to the room.'));
122
125
  }
123
126
  }
124
127
 
@@ -129,7 +132,7 @@ class FcrRoomRouterImpl {
129
132
  async _executeJoinRoomWithRetry(options) {
130
133
  const abortController = this._abortController;
131
134
  return (0, _imports.retryAttempt)(() => this._performSingleJoinAttempt(options), [], {
132
- retriesMax: _type2.ROOM_ROUTER_CONSTANTS.MAX_JOIN_ATTEMPTS
135
+ retriesMax: _type3.ROOM_ROUTER_CONSTANTS.MAX_JOIN_ATTEMPTS
133
136
  }).fail(async ({
134
137
  error,
135
138
  timeFn: waitBeforeRetry,
@@ -169,7 +172,7 @@ class FcrRoomRouterImpl {
169
172
  const {
170
173
  data,
171
174
  ts
172
- } = await (0, _error.handleRequestError)(() => this._apiService.checkIn(checkInParams), _error.FcrErrorModuleCode.ENGINE);
175
+ } = await (0, _error.handleRequestError)(() => this._apiService.checkIn(checkInParams), _imports.ErrorModuleCode.FCR_ENGINE);
173
176
  return {
174
177
  data,
175
178
  ts
@@ -224,7 +227,7 @@ class FcrRoomRouterImpl {
224
227
  */
225
228
  _handleJoinRoomError(error) {
226
229
  this.logger.error(`Failed to join the room: ${error.message}`);
227
- const fcrError = (0, _error.generateFcrCoreClientErrorNew)(_error.FcrErrorModuleCode.ROOM, _error.FcrErrorCode.LOCAL_HTTP_REQUEST_FAILED, `join room failed: ${error.message}`);
230
+ const fcrError = (0, _error.generateFcrCoreClientError)(_imports.ErrorModuleCode.FCR_ROOM, _imports.DetailErrorCode.LOCAL_HTTP_REQUEST_FAILED, `join room failed: ${error.message}`);
228
231
  this._observable.notifyObservers('onErrorOccurred', fcrError);
229
232
  }
230
233
 
@@ -254,7 +257,7 @@ class FcrRoomRouterImpl {
254
257
  }
255
258
  }
256
259
  _addLogObserver() {
257
- this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onErrorOccurred', 'onRoomJoined', 'onRoomRouteSwitched']));
260
+ this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onErrorOccurred', ['error']], ['onRoomJoined', ['roomControl']], ['onRoomRouteSwitched', ['nextRoomRoute']]]));
258
261
  }
259
262
  addObserver(observer) {
260
263
  this._observable.addObserver(observer);
@@ -38,7 +38,7 @@ export interface FcrRoomRouter {
38
38
  /**
39
39
  * 离开会议
40
40
  */
41
- leaveRoom(): Promise<void>;
41
+ leaveRoom(): Promise<number>;
42
42
  addObserver(observer: FcrRoomRouterObserver): void;
43
43
  removeObserver(observer: FcrRoomRouterObserver): void;
44
44
  }
package/lib/schema.d.ts CHANGED
@@ -83,17 +83,17 @@ export declare const fcrSessionBaseSchema: z.ZodObject<{
83
83
  senderId: z.ZodString;
84
84
  interval: z.ZodNumber;
85
85
  }, "strip", z.ZodTypeAny, {
86
- payload: Record<string, unknown>;
87
86
  sessionKey: string;
88
87
  duration: number;
88
+ payload: Record<string, unknown>;
89
89
  sessionId: string;
90
90
  timestamp: number;
91
91
  senderId: string;
92
92
  interval: number;
93
93
  }, {
94
- payload: Record<string, unknown>;
95
94
  sessionKey: string;
96
95
  duration: number;
96
+ payload: Record<string, unknown>;
97
97
  sessionId: string;
98
98
  timestamp: number;
99
99
  senderId: string;
@@ -189,13 +189,13 @@ export declare const fcrRoomSessionParamsSchema: z.ZodObject<{
189
189
  duration: z.ZodNumber;
190
190
  payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
191
191
  }, "strip", z.ZodTypeAny, {
192
- payload: Record<string, unknown>;
193
192
  sessionKey: string;
194
193
  duration: number;
195
- }, {
196
194
  payload: Record<string, unknown>;
195
+ }, {
197
196
  sessionKey: string;
198
197
  duration: number;
198
+ payload: Record<string, unknown>;
199
199
  }>;
200
200
  export type FcrRoomSessionParamsSchema = z.infer<typeof fcrRoomSessionParamsSchema>;
201
201
  export declare const colorSchema: z.ZodObject<{
@@ -221,15 +221,15 @@ export declare const fcrPeerSessionParamsSchema: z.ZodObject<{
221
221
  duration: z.ZodNumber;
222
222
  payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
223
223
  }, "strip", z.ZodTypeAny, {
224
- payload: Record<string, unknown>;
225
224
  sessionKey: string;
226
- duration: number;
227
225
  receiverId: string;
228
- }, {
226
+ duration: number;
229
227
  payload: Record<string, unknown>;
228
+ }, {
230
229
  sessionKey: string;
231
- duration: number;
232
230
  receiverId: string;
231
+ duration: number;
232
+ payload: Record<string, unknown>;
233
233
  }>;
234
234
  export type FcrPeerSessionParamsSchema = z.infer<typeof fcrPeerSessionParamsSchema>;
235
235
  export declare const fcrGroupCreateConfigSchema: z.ZodObject<{
@@ -283,13 +283,13 @@ export declare const fcrChatRoomFileSchema: z.ZodObject<{
283
283
  }, "strip", z.ZodTypeAny, {
284
284
  fileName: string;
285
285
  fileType: string;
286
- filePath?: string | undefined;
287
286
  data?: any;
287
+ filePath?: string | undefined;
288
288
  }, {
289
289
  fileName: string;
290
290
  fileType: string;
291
- filePath?: string | undefined;
292
291
  data?: any;
292
+ filePath?: string | undefined;
293
293
  }>;
294
294
  export type FcrChatRoomFileSchema = z.infer<typeof fcrChatRoomFileSchema>;
295
295
  export declare const fcrChatRoomSendImageMessageSchema: z.ZodObject<{
@@ -301,13 +301,13 @@ export declare const fcrChatRoomSendImageMessageSchema: z.ZodObject<{
301
301
  }, "strip", z.ZodTypeAny, {
302
302
  fileName: string;
303
303
  fileType: string;
304
- filePath?: string | undefined;
305
304
  data?: any;
305
+ filePath?: string | undefined;
306
306
  }, {
307
307
  fileName: string;
308
308
  fileType: string;
309
- filePath?: string | undefined;
310
309
  data?: any;
310
+ filePath?: string | undefined;
311
311
  }>;
312
312
  } & {
313
313
  type: z.ZodNativeEnum<typeof FcrChatRoomMessageType>;
@@ -318,8 +318,8 @@ export declare const fcrChatRoomSendImageMessageSchema: z.ZodObject<{
318
318
  file: {
319
319
  fileName: string;
320
320
  fileType: string;
321
- filePath?: string | undefined;
322
321
  data?: any;
322
+ filePath?: string | undefined;
323
323
  };
324
324
  properties?: Record<string, unknown> | undefined;
325
325
  to?: string[] | undefined;
@@ -328,8 +328,8 @@ export declare const fcrChatRoomSendImageMessageSchema: z.ZodObject<{
328
328
  file: {
329
329
  fileName: string;
330
330
  fileType: string;
331
- filePath?: string | undefined;
332
331
  data?: any;
332
+ filePath?: string | undefined;
333
333
  };
334
334
  properties?: Record<string, unknown> | undefined;
335
335
  to?: string[] | undefined;
@@ -360,13 +360,13 @@ export declare const messageSchema: z.ZodUnion<[z.ZodObject<{
360
360
  }, "strip", z.ZodTypeAny, {
361
361
  fileName: string;
362
362
  fileType: string;
363
- filePath?: string | undefined;
364
363
  data?: any;
364
+ filePath?: string | undefined;
365
365
  }, {
366
366
  fileName: string;
367
367
  fileType: string;
368
- filePath?: string | undefined;
369
368
  data?: any;
369
+ filePath?: string | undefined;
370
370
  }>;
371
371
  } & {
372
372
  type: z.ZodNativeEnum<typeof FcrChatRoomMessageType>;
@@ -377,8 +377,8 @@ export declare const messageSchema: z.ZodUnion<[z.ZodObject<{
377
377
  file: {
378
378
  fileName: string;
379
379
  fileType: string;
380
- filePath?: string | undefined;
381
380
  data?: any;
381
+ filePath?: string | undefined;
382
382
  };
383
383
  properties?: Record<string, unknown> | undefined;
384
384
  to?: string[] | undefined;
@@ -387,8 +387,8 @@ export declare const messageSchema: z.ZodUnion<[z.ZodObject<{
387
387
  file: {
388
388
  fileName: string;
389
389
  fileType: string;
390
- filePath?: string | undefined;
391
390
  data?: any;
391
+ filePath?: string | undefined;
392
392
  };
393
393
  properties?: Record<string, unknown> | undefined;
394
394
  to?: string[] | undefined;
@@ -430,7 +430,6 @@ export declare const agoraRtcVideoEncoderConfigurationSchema: z.ZodObject<{
430
430
  }>;
431
431
  frameRate: z.ZodNumber;
432
432
  bitrate: z.ZodNumber;
433
- isMirror: z.ZodBoolean;
434
433
  }, "strip", z.ZodTypeAny, {
435
434
  dimensions: {
436
435
  width: number;
@@ -438,7 +437,6 @@ export declare const agoraRtcVideoEncoderConfigurationSchema: z.ZodObject<{
438
437
  };
439
438
  frameRate: number;
440
439
  bitrate: number;
441
- isMirror: boolean;
442
440
  }, {
443
441
  dimensions: {
444
442
  width: number;
@@ -446,7 +444,6 @@ export declare const agoraRtcVideoEncoderConfigurationSchema: z.ZodObject<{
446
444
  };
447
445
  frameRate: number;
448
446
  bitrate: number;
449
- isMirror: boolean;
450
447
  }>;
451
448
  export type FcrVideoEncoderConfigurationSchema = z.infer<typeof agoraRtcVideoEncoderConfigurationSchema>;
452
449
  export declare const fcrStreamJoinConfig: z.ZodObject<{
@@ -463,7 +460,6 @@ export declare const fcrStreamJoinConfig: z.ZodObject<{
463
460
  }>;
464
461
  frameRate: z.ZodNumber;
465
462
  bitrate: z.ZodNumber;
466
- isMirror: z.ZodBoolean;
467
463
  }, "strip", z.ZodTypeAny, {
468
464
  dimensions: {
469
465
  width: number;
@@ -471,7 +467,6 @@ export declare const fcrStreamJoinConfig: z.ZodObject<{
471
467
  };
472
468
  frameRate: number;
473
469
  bitrate: number;
474
- isMirror: boolean;
475
470
  }, {
476
471
  dimensions: {
477
472
  width: number;
@@ -479,7 +474,6 @@ export declare const fcrStreamJoinConfig: z.ZodObject<{
479
474
  };
480
475
  frameRate: number;
481
476
  bitrate: number;
482
- isMirror: boolean;
483
477
  }>>;
484
478
  videoSourceId: z.ZodOptional<z.ZodString>;
485
479
  audioSourceId: z.ZodOptional<z.ZodString>;
@@ -503,7 +497,6 @@ export declare const fcrStreamJoinConfig: z.ZodObject<{
503
497
  };
504
498
  frameRate: number;
505
499
  bitrate: number;
506
- isMirror: boolean;
507
500
  } | undefined;
508
501
  audioSourceState?: AgoraRtcMediaSourceState | undefined;
509
502
  videoSourceState?: AgoraRtcMediaSourceState | undefined;
@@ -521,7 +514,6 @@ export declare const fcrStreamJoinConfig: z.ZodObject<{
521
514
  };
522
515
  frameRate: number;
523
516
  bitrate: number;
524
- isMirror: boolean;
525
517
  } | undefined;
526
518
  audioSourceState?: AgoraRtcMediaSourceState | undefined;
527
519
  videoSourceState?: AgoraRtcMediaSourceState | undefined;
@@ -557,7 +549,6 @@ export declare const fcrRoomJoinOptionsSchema: z.ZodObject<{
557
549
  }>;
558
550
  frameRate: z.ZodNumber;
559
551
  bitrate: z.ZodNumber;
560
- isMirror: z.ZodBoolean;
561
552
  }, "strip", z.ZodTypeAny, {
562
553
  dimensions: {
563
554
  width: number;
@@ -565,7 +556,6 @@ export declare const fcrRoomJoinOptionsSchema: z.ZodObject<{
565
556
  };
566
557
  frameRate: number;
567
558
  bitrate: number;
568
- isMirror: boolean;
569
559
  }, {
570
560
  dimensions: {
571
561
  width: number;
@@ -573,7 +563,6 @@ export declare const fcrRoomJoinOptionsSchema: z.ZodObject<{
573
563
  };
574
564
  frameRate: number;
575
565
  bitrate: number;
576
- isMirror: boolean;
577
566
  }>>;
578
567
  videoSourceId: z.ZodOptional<z.ZodString>;
579
568
  audioSourceId: z.ZodOptional<z.ZodString>;
@@ -597,7 +586,6 @@ export declare const fcrRoomJoinOptionsSchema: z.ZodObject<{
597
586
  };
598
587
  frameRate: number;
599
588
  bitrate: number;
600
- isMirror: boolean;
601
589
  } | undefined;
602
590
  audioSourceState?: AgoraRtcMediaSourceState | undefined;
603
591
  videoSourceState?: AgoraRtcMediaSourceState | undefined;
@@ -615,7 +603,6 @@ export declare const fcrRoomJoinOptionsSchema: z.ZodObject<{
615
603
  };
616
604
  frameRate: number;
617
605
  bitrate: number;
618
- isMirror: boolean;
619
606
  } | undefined;
620
607
  audioSourceState?: AgoraRtcMediaSourceState | undefined;
621
608
  videoSourceState?: AgoraRtcMediaSourceState | undefined;
@@ -642,18 +629,17 @@ export declare const fcrRoomJoinOptionsSchema: z.ZodObject<{
642
629
  };
643
630
  frameRate: number;
644
631
  bitrate: number;
645
- isMirror: boolean;
646
632
  } | undefined;
647
633
  audioSourceState?: AgoraRtcMediaSourceState | undefined;
648
634
  videoSourceState?: AgoraRtcMediaSourceState | undefined;
649
635
  }[];
650
636
  password?: string | undefined;
637
+ platform?: number | undefined;
651
638
  userProperties?: Record<string, unknown> | undefined;
652
639
  streamEncryptionConfig?: {
653
640
  encryptionKey: string;
654
641
  encryptionMode: AgoraRtcEncryptionMode;
655
642
  } | undefined;
656
- platform?: number | undefined;
657
643
  avatar?: string | undefined;
658
644
  }, {
659
645
  userName: string;
@@ -674,18 +660,17 @@ export declare const fcrRoomJoinOptionsSchema: z.ZodObject<{
674
660
  };
675
661
  frameRate: number;
676
662
  bitrate: number;
677
- isMirror: boolean;
678
663
  } | undefined;
679
664
  audioSourceState?: AgoraRtcMediaSourceState | undefined;
680
665
  videoSourceState?: AgoraRtcMediaSourceState | undefined;
681
666
  }[];
682
667
  password?: string | undefined;
668
+ platform?: number | undefined;
683
669
  userProperties?: Record<string, unknown> | undefined;
684
670
  streamEncryptionConfig?: {
685
671
  encryptionKey: string;
686
672
  encryptionMode: AgoraRtcEncryptionMode;
687
673
  } | undefined;
688
- platform?: number | undefined;
689
674
  avatar?: string | undefined;
690
675
  }>;
691
676
  export type FcrRoomJoinOptionsSchema = z.infer<typeof fcrRoomJoinOptionsSchema>;
@@ -693,11 +678,11 @@ export declare const fcrRenderConfigSchema: z.ZodObject<{
693
678
  renderMode: z.ZodNativeEnum<typeof AgoraRtcRenderMode>;
694
679
  isMirror: z.ZodBoolean;
695
680
  }, "strip", z.ZodTypeAny, {
696
- isMirror: boolean;
697
681
  renderMode: AgoraRtcRenderMode;
698
- }, {
699
682
  isMirror: boolean;
683
+ }, {
700
684
  renderMode: AgoraRtcRenderMode;
685
+ isMirror: boolean;
701
686
  }>;
702
687
  export type FcrRenderConfigSchema = z.infer<typeof fcrRenderConfigSchema>;
703
688
  export declare const fcrGroupUpdateOptionsSchema: z.ZodObject<{
@@ -743,7 +728,6 @@ export declare const fcrRoomJoinOptionsWithTicketSchema: z.ZodObject<{
743
728
  }>;
744
729
  frameRate: z.ZodNumber;
745
730
  bitrate: z.ZodNumber;
746
- isMirror: z.ZodBoolean;
747
731
  }, "strip", z.ZodTypeAny, {
748
732
  dimensions: {
749
733
  width: number;
@@ -751,7 +735,6 @@ export declare const fcrRoomJoinOptionsWithTicketSchema: z.ZodObject<{
751
735
  };
752
736
  frameRate: number;
753
737
  bitrate: number;
754
- isMirror: boolean;
755
738
  }, {
756
739
  dimensions: {
757
740
  width: number;
@@ -759,7 +742,6 @@ export declare const fcrRoomJoinOptionsWithTicketSchema: z.ZodObject<{
759
742
  };
760
743
  frameRate: number;
761
744
  bitrate: number;
762
- isMirror: boolean;
763
745
  }>>;
764
746
  videoSourceId: z.ZodOptional<z.ZodString>;
765
747
  audioSourceId: z.ZodOptional<z.ZodString>;
@@ -783,7 +765,6 @@ export declare const fcrRoomJoinOptionsWithTicketSchema: z.ZodObject<{
783
765
  };
784
766
  frameRate: number;
785
767
  bitrate: number;
786
- isMirror: boolean;
787
768
  } | undefined;
788
769
  audioSourceState?: AgoraRtcMediaSourceState | undefined;
789
770
  videoSourceState?: AgoraRtcMediaSourceState | undefined;
@@ -801,7 +782,6 @@ export declare const fcrRoomJoinOptionsWithTicketSchema: z.ZodObject<{
801
782
  };
802
783
  frameRate: number;
803
784
  bitrate: number;
804
- isMirror: boolean;
805
785
  } | undefined;
806
786
  audioSourceState?: AgoraRtcMediaSourceState | undefined;
807
787
  videoSourceState?: AgoraRtcMediaSourceState | undefined;
@@ -828,18 +808,17 @@ export declare const fcrRoomJoinOptionsWithTicketSchema: z.ZodObject<{
828
808
  };
829
809
  frameRate: number;
830
810
  bitrate: number;
831
- isMirror: boolean;
832
811
  } | undefined;
833
812
  audioSourceState?: AgoraRtcMediaSourceState | undefined;
834
813
  videoSourceState?: AgoraRtcMediaSourceState | undefined;
835
814
  }[];
836
815
  password?: string | undefined;
816
+ platform?: number | undefined;
837
817
  userProperties?: Record<string, unknown> | undefined;
838
818
  streamEncryptionConfig?: {
839
819
  encryptionKey: string;
840
820
  encryptionMode: AgoraRtcEncryptionMode;
841
821
  } | undefined;
842
- platform?: number | undefined;
843
822
  avatar?: string | undefined;
844
823
  ticket?: string | undefined;
845
824
  }, {
@@ -861,18 +840,17 @@ export declare const fcrRoomJoinOptionsWithTicketSchema: z.ZodObject<{
861
840
  };
862
841
  frameRate: number;
863
842
  bitrate: number;
864
- isMirror: boolean;
865
843
  } | undefined;
866
844
  audioSourceState?: AgoraRtcMediaSourceState | undefined;
867
845
  videoSourceState?: AgoraRtcMediaSourceState | undefined;
868
846
  }[];
869
847
  password?: string | undefined;
848
+ platform?: number | undefined;
870
849
  userProperties?: Record<string, unknown> | undefined;
871
850
  streamEncryptionConfig?: {
872
851
  encryptionKey: string;
873
852
  encryptionMode: AgoraRtcEncryptionMode;
874
853
  } | undefined;
875
- platform?: number | undefined;
876
854
  avatar?: string | undefined;
877
855
  ticket?: string | undefined;
878
856
  }>;
package/lib/schema.js CHANGED
@@ -207,8 +207,7 @@ const AgoraRtcDimensions = exports.AgoraRtcDimensions = _imports.z.object({
207
207
  const agoraRtcVideoEncoderConfigurationSchema = exports.agoraRtcVideoEncoderConfigurationSchema = _imports.z.object({
208
208
  dimensions: AgoraRtcDimensions,
209
209
  frameRate: _imports.numberSchema,
210
- bitrate: _imports.numberSchema,
211
- isMirror: _imports.booleanSchema
210
+ bitrate: _imports.numberSchema
212
211
  });
213
212
  // Stream Config Schemas
214
213
  const fcrStreamJoinConfig = exports.fcrStreamJoinConfig = _imports.z.object({
@@ -212,11 +212,9 @@ export declare class FcrCoreServiceApi {
212
212
  remoteRole: string;
213
213
  localRole?: string;
214
214
  }): Promise<any>;
215
- revokeUserRole({ roomId, remoteRole, localRole, userId, }: {
215
+ revokeUserRole({ roomId, remoteRole }: {
216
216
  roomId: string;
217
- userId: string;
218
217
  remoteRole: string;
219
- localRole: string;
220
218
  }): Promise<any>;
221
219
  claimHost({ roomId, userId, hostKey, }: {
222
220
  roomId: string;
@@ -316,6 +314,10 @@ export declare class FcrCoreServiceApi {
316
314
  code: number;
317
315
  ts: number;
318
316
  }>;
317
+ /**
318
+ * @description 准备 / 取消白板
319
+ */
320
+ toggleWhiteboardPreloadState(roomId: string, state: FcrSharePermissionState): Promise<any>;
319
321
  /**
320
322
  * @description 开 / 关白板
321
323
  */
@@ -18,7 +18,7 @@ class FcrCoreServiceApi {
18
18
  if (pathIncludeRegion) {
19
19
  pathPrefix = `/${(0, _imports.toLower)(region)}${pathPrefix}`;
20
20
  }
21
- this.logger.info('[FcrCoreServiceApi] set path prefix for Core Service API:', pathPrefix);
21
+ this.logger.info('set path prefix for Core Service API:', pathPrefix);
22
22
  this._pathPrefix = pathPrefix;
23
23
  this._client.setPathPrefix(pathPrefix);
24
24
  }
@@ -429,9 +429,7 @@ class FcrCoreServiceApi {
429
429
  const res = await this._client.fetch({
430
430
  path: `/v1/rooms/${roomId}/users/${userUuid}/properties`,
431
431
  method: 'DELETE',
432
- data: {
433
- users: data
434
- }
432
+ data: data
435
433
  });
436
434
  return res.data;
437
435
  }
@@ -720,16 +718,13 @@ class FcrCoreServiceApi {
720
718
  }
721
719
  async revokeUserRole({
722
720
  roomId,
723
- remoteRole,
724
- localRole,
725
- userId
721
+ remoteRole
726
722
  }) {
727
723
  const res = await this._client.fetch({
728
- path: `/v1/rooms/${roomId}/users/${userId}/role`,
729
- method: 'DELETE',
724
+ path: `/v1/rooms/${roomId}/claim/host`,
725
+ method: 'POST',
730
726
  data: {
731
- remoteRole,
732
- localRole
727
+ remoteRole
733
728
  }
734
729
  });
735
730
  return res.data;
@@ -929,12 +924,22 @@ class FcrCoreServiceApi {
929
924
  });
930
925
  }
931
926
 
927
+ /**
928
+ * @description 准备 / 取消白板
929
+ */
930
+ async toggleWhiteboardPreloadState(roomId, state) {
931
+ return this._client.fetch({
932
+ path: `/v1/rooms/${roomId}/widgets/netlessBoard/preload/${state}`,
933
+ method: 'PUT'
934
+ });
935
+ }
936
+
932
937
  /**
933
938
  * @description 开 / 关白板
934
939
  */
935
940
  async toggleWhiteboardActivityState(roomId, state) {
936
941
  return this._client.fetch({
937
- path: `/v1/rooms/${roomId}/widgets/netlessBoard/states/${state}`,
942
+ path: `/v2/rooms/${roomId}/widgets/netlessBoard/states/${state}`,
938
943
  method: 'PUT'
939
944
  });
940
945
  }