fcr-core 3.4.2 → 3.4.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.
- package/lib/room-control/ability-control/index.d.ts +1 -0
- package/lib/room-control/ability-control/index.js +69 -0
- package/lib/room-control/ability-control/type.d.ts +9 -0
- package/lib/room-control/ability-control/type.js +11 -0
- package/lib/schema.d.ts +964 -0
- package/lib/schema.js +259 -0
- package/lib/utilities/validate-params.d.ts +2 -0
- package/lib/utilities/validate-params.js +14 -0
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.symbol.description.js");
|
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
|
5
|
+
require("core-js/modules/es.array.push.js");
|
|
6
|
+
require("core-js/modules/esnext.function.metadata.js");
|
|
7
|
+
require("core-js/modules/esnext.map.delete-all.js");
|
|
8
|
+
require("core-js/modules/esnext.map.emplace.js");
|
|
9
|
+
require("core-js/modules/esnext.map.every.js");
|
|
10
|
+
require("core-js/modules/esnext.map.filter.js");
|
|
11
|
+
require("core-js/modules/esnext.map.find.js");
|
|
12
|
+
require("core-js/modules/esnext.map.find-key.js");
|
|
13
|
+
require("core-js/modules/esnext.map.includes.js");
|
|
14
|
+
require("core-js/modules/esnext.map.key-of.js");
|
|
15
|
+
require("core-js/modules/esnext.map.map-keys.js");
|
|
16
|
+
require("core-js/modules/esnext.map.map-values.js");
|
|
17
|
+
require("core-js/modules/esnext.map.merge.js");
|
|
18
|
+
require("core-js/modules/esnext.map.reduce.js");
|
|
19
|
+
require("core-js/modules/esnext.map.some.js");
|
|
20
|
+
require("core-js/modules/esnext.map.update.js");
|
|
21
|
+
require("core-js/modules/esnext.symbol.metadata.js");
|
|
22
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
23
|
+
Object.defineProperty(exports, "__esModule", {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
exports.FcrAbilityControlImpl = void 0;
|
|
27
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
28
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
29
|
+
var _imports = require("../../imports");
|
|
30
|
+
var _logger = require("../../utilities/logger");
|
|
31
|
+
var _FcrAbilityControlImpl;
|
|
32
|
+
let _initProto;
|
|
33
|
+
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)]; } }; }
|
|
34
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
35
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
36
|
+
function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
37
|
+
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
|
|
38
|
+
/**
|
|
39
|
+
* 平台能力控制的实现类
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
class FcrAbilityControlImpl {
|
|
43
|
+
constructor(_scene) {
|
|
44
|
+
//@internal
|
|
45
|
+
(0, _defineProperty2.default)(this, "logger", (_initProto(this), (0, _logger.createLogger)({
|
|
46
|
+
prefix: 'FcrAbilityControlImpl'
|
|
47
|
+
})));
|
|
48
|
+
this._scene = _scene;
|
|
49
|
+
}
|
|
50
|
+
getPlatformAbility(ability) {
|
|
51
|
+
const platforms = this._scene.getScenePropertiesByKeyPath("setting.ability.".concat(ability));
|
|
52
|
+
if (!Array.isArray(platforms)) {
|
|
53
|
+
return [];
|
|
54
|
+
}
|
|
55
|
+
return platforms;
|
|
56
|
+
}
|
|
57
|
+
isAbilitySupported(ability) {
|
|
58
|
+
const platforms = this.getPlatformAbility(ability);
|
|
59
|
+
const currentPlatform = (0, _imports.getPlatform)();
|
|
60
|
+
return platforms.includes(currentPlatform);
|
|
61
|
+
}
|
|
62
|
+
isPlatformAbilitySupported(platform, ability) {
|
|
63
|
+
const platforms = this.getPlatformAbility(ability);
|
|
64
|
+
return platforms.includes(platform);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.FcrAbilityControlImpl = FcrAbilityControlImpl;
|
|
68
|
+
_FcrAbilityControlImpl = FcrAbilityControlImpl;
|
|
69
|
+
[_initProto] = _applyDecs(_FcrAbilityControlImpl, [[_logger.trace, 2, "getPlatformAbility"], [_logger.trace, 2, "isAbilitySupported"], [_logger.trace, 2, "isPlatformAbilitySupported"]], []).e;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FcrPlatform } from '../../type';
|
|
2
|
+
export declare enum FcrAbility {
|
|
3
|
+
RoleHost = "role:host",
|
|
4
|
+
RoomDetail = "room:detail"
|
|
5
|
+
}
|
|
6
|
+
export interface FcrAbilityControl {
|
|
7
|
+
isAbilitySupported(ability: FcrAbility): boolean;
|
|
8
|
+
isPlatformAbilitySupported(platform: FcrPlatform, ability: FcrAbility): boolean;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FcrAbility = void 0;
|
|
7
|
+
let FcrAbility = exports.FcrAbility = /*#__PURE__*/function (FcrAbility) {
|
|
8
|
+
FcrAbility["RoleHost"] = "role:host";
|
|
9
|
+
FcrAbility["RoomDetail"] = "room:detail";
|
|
10
|
+
return FcrAbility;
|
|
11
|
+
}({});
|