kitten-cloud-function
Version:
用于编程猫源码云功能(云变量、云列表等)的客户端工具
35 lines (34 loc) • 1.56 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.KittenCloudPublicVariable = void 0;
const kitten_cloud_variable_1 = require("./kitten-cloud-variable");
const kitten_cloud_data_update_source_1 = require("./update/kitten-cloud-data-update-source");
const kitten_cloud_public_variable_set_command_1 = require("./update/command/kitten-cloud-public-variable-set-command");
/**
* 公有云变量。
*/
class KittenCloudPublicVariable extends kitten_cloud_variable_1.KittenCloudVariable {
constructor(connection, group, cvid, name, value) {
super(connection, group, cvid, name, value);
this.group = group;
}
update(value) {
value = this.singleValueProcess(value);
this.updateManager.addUpdateCommand(new kitten_cloud_public_variable_set_command_1.KittenCloudPublicVariableSetCommand(kitten_cloud_data_update_source_1.KittenCloudDataUpdateSource.CLOUD, this, value));
}
/**
* 设置公有云变量的值。
*
* @param value 要设置的值
*/
set(value) {
value = this.singleValueProcess(value);
const command = new kitten_cloud_public_variable_set_command_1.KittenCloudPublicVariableSetCommand(kitten_cloud_data_update_source_1.KittenCloudDataUpdateSource.LOCAL, this, value);
this.updateManager.addUpdateCommand(command);
command.promise.catch((error) => {
this.connection.errored.emit(error);
});
return command.promise;
}
}
exports.KittenCloudPublicVariable = KittenCloudPublicVariable;
;