UNPKG

reveal-sdk-node

Version:

RevealBI Node.js SDK

42 lines (41 loc) 1.44 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RVS3DataSourceItem = void 0; const RVDataSourceItem_1 = require("../AbstractClasses/RVDataSourceItem"); const RVS3DataSource_1 = require("./RVS3DataSource"); /** Amazon S3 data source item. */ class RVS3DataSourceItem extends RVDataSourceItem_1.RVDataSourceItem { /** @hidden */ constructor(arg) { super(arg); this._path = null; if (!(arg instanceof RVS3DataSource_1.RVS3DataSource)) { var props = arg.Properties; this._path = `s3://${props['bucketName']}/${props['key']}`; } } /** @hidden */ toJson() { var json = super.toJson(); var props = json['Properties']; if (this._path) { var schemeLessPath = this._path.substring(5); var pathStart = schemeLessPath.indexOf('/'); props['bucketName'] = schemeLessPath.substring(0, pathStart); props['key'] = schemeLessPath.substring(pathStart + 1); } return json; } /** S3 path for the file represented by this item. For example: 's3://my-bucket/path/to/file.csv' */ get path() { return this._path; } set path(value) { this._path = value; } /** @hidden */ getType() { return "RVS3DataSourceItem"; } } exports.RVS3DataSourceItem = RVS3DataSourceItem;