UNPKG

kitten-cloud-function

Version:

用于编程猫源码云功能(云变量、云列表等)的客户端工具

22 lines (21 loc) 2.46 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.KittenCloudFunctionConfigLayer = void 0; const other_1 = require("../utils/other"); const single_config_1 = require("../utils/single-config"); /** * 源码云功能的配置层,用于管理源码云功能的配置项。 */ class KittenCloudFunctionConfigLayer { constructor(upper = other_1.None, { autoReconnectIntervalTime, localPreupdate, cacheTime, uploadIntervalTime, uploadTimeout, stringLengthLimit, listLengthLimit } = {}) { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p; this.autoReconnectIntervalTime = new single_config_1.SingleConfig((_b = (_a = upper === null || upper === void 0 ? void 0 : upper.autoReconnectIntervalTime) !== null && _a !== void 0 ? _a : autoReconnectIntervalTime) !== null && _b !== void 0 ? _b : 8000, autoReconnectIntervalTime); this.localPreupdate = new single_config_1.SingleConfig((_d = (_c = upper === null || upper === void 0 ? void 0 : upper.localPreupdate) !== null && _c !== void 0 ? _c : localPreupdate) !== null && _d !== void 0 ? _d : true, localPreupdate); this.cacheTime = new single_config_1.SingleConfig((_f = (_e = upper === null || upper === void 0 ? void 0 : upper.cacheTime) !== null && _e !== void 0 ? _e : cacheTime) !== null && _f !== void 0 ? _f : 0, cacheTime); this.uploadIntervalTime = new single_config_1.SingleConfig((_h = (_g = upper === null || upper === void 0 ? void 0 : upper.uploadIntervalTime) !== null && _g !== void 0 ? _g : uploadIntervalTime) !== null && _h !== void 0 ? _h : 0, uploadIntervalTime); this.uploadTimeout = new single_config_1.SingleConfig((_k = (_j = upper === null || upper === void 0 ? void 0 : upper.uploadTimeout) !== null && _j !== void 0 ? _j : uploadTimeout) !== null && _k !== void 0 ? _k : 4000, uploadTimeout); this.stringLengthLimit = new single_config_1.SingleConfig((_m = (_l = upper === null || upper === void 0 ? void 0 : upper.stringLengthLimit) !== null && _l !== void 0 ? _l : stringLengthLimit) !== null && _m !== void 0 ? _m : 1024, stringLengthLimit); this.listLengthLimit = new single_config_1.SingleConfig((_p = (_o = upper === null || upper === void 0 ? void 0 : upper.listLengthLimit) !== null && _o !== void 0 ? _o : listLengthLimit) !== null && _p !== void 0 ? _p : 1000, listLengthLimit); } } exports.KittenCloudFunctionConfigLayer = KittenCloudFunctionConfigLayer;