UNPKG

reveal-sdk-node

Version:

RevealBI Node.js SDK

46 lines (45 loc) 1.65 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RVJsonDataSourceItem = void 0; const RVResourceBasedDataSourceItem_1 = require("../AbstractClasses/RVResourceBasedDataSourceItem"); const RVJsonDataSource_1 = require("./RVJsonDataSource"); const RVDataSourceItem_1 = require("../AbstractClasses/RVDataSourceItem"); /** The data source item used to represent a dataset from a JSON file, it includes the optional parsing configuration. */ class RVJsonDataSourceItem extends RVResourceBasedDataSourceItem_1.RVResourceBasedDataSourceItem { /** @hidden */ constructor(arg) { super(new RVJsonDataSource_1.RVJsonDataSource(), arg); this._config = null; if (!(arg instanceof RVDataSourceItem_1.RVDataSourceItem)) { var params = arg['Parameters']; this._config = params["config"] ? JSON.stringify(params["config"]) : null; } } /** @hidden */ toJson() { var json = super.toJson(); var params = json['Parameters']; if (this._config) { params['config'] = JSON.parse(this._config); } return json; } /** The configuration of the JSON parser. */ get config() { return this._config; } set config(value) { this._config = value; } /** @hidden */ getType() { return "RVJsonDataSourceItem"; } /** @hidden */ _getWrapper() { var wrapper = super._getWrapper(); wrapper.config(this.config); return wrapper; } } exports.RVJsonDataSourceItem = RVJsonDataSourceItem;