New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@gooddata/gdc-embed-gdui

Package Overview
Dependencies
Maintainers
37
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gooddata/gdc-embed-gdui - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

122

lib/index.js

@@ -23,8 +23,8 @@ #!/usr/bin/env node

projectId,
dashboardUri,
tabId,
insightId,
s3host,
s3accessKeyId,
s3secretAccessKey
// dashboardUri,
// tabId,
insightId
// s3host,
// s3accessKeyId,
// s3secretAccessKey
} = configFileOptions;

@@ -84,27 +84,27 @@

const dashboardSpinner = (0, _ora2.default)();
try {
if (dashboardUri) {
(0, _loggers.log)('Dashboard URI', dashboardUri);
} else {
dashboardUri = yield (0, _prompts.promptDashboardUri)(projectId);
}
} catch (err) {
dashboardSpinner.stop();
(0, _loggers.logError)(`${err.name}: ${err.message}`);
process.exit(1);
}
// const dashboardSpinner = ora();
// try {
// if (dashboardUri) {
// log('Dashboard URI', dashboardUri);
// } else {
// dashboardUri = await promptDashboardUri(projectId);
// }
// } catch (err) {
// dashboardSpinner.stop();
// logError(`${err.name}: ${err.message}`);
// process.exit(1);
// }
const tabSpinner = (0, _ora2.default)();
try {
if (tabId) {
(0, _loggers.log)('Tab ID', tabId);
} else {
tabId = yield (0, _prompts.promptTabId)(dashboardUri);
}
} catch (err) {
tabSpinner.stop();
(0, _loggers.logError)(`${err.name}: ${err.message}`);
process.exit(1);
}
// const tabSpinner = ora();
// try {
// if (tabId) {
// log('Tab ID', tabId);
// } else {
// tabId = await promptTabId(dashboardUri);
// }
// } catch (err) {
// tabSpinner.stop();
// logError(`${err.name}: ${err.message}`);
// process.exit(1);
// }

@@ -124,30 +124,30 @@ const insightSpinner = (0, _ora2.default)();

const s3hostSpinner = (0, _ora2.default)();
try {
if (s3host) {
(0, _loggers.log)('S3 Host', s3host);
} else {
s3host = yield (0, _prompts.promptS3hostId)(projectId);
}
} catch (err) {
s3hostSpinner.stop();
(0, _loggers.logError)(`${err.name}: ${err.message}`);
process.exit(1);
}
// const s3hostSpinner = ora();
// try {
// if (s3host) {
// log('S3 Host', s3host);
// } else {
// s3host = await promptS3hostId(projectId);
// }
// } catch (err) {
// s3hostSpinner.stop();
// logError(`${err.name}: ${err.message}`);
// process.exit(1);
// }
if (s3host) {
if (s3accessKeyId) {
(0, _loggers.log)('S3 Access Key ID', s3accessKeyId);
} else {
s3accessKeyId = yield (0, _prompts.promptS3accessKeyId)();
}
// if (s3host) {
// if (s3accessKeyId) {
// log('S3 Access Key ID', s3accessKeyId);
// } else {
// s3accessKeyId = await promptS3accessKeyId();
// }
s3secretAccessKey = s3secretAccessKey || (yield (0, _prompts.promptS3secretAccessKey)());
// s3secretAccessKey = s3secretAccessKey || await promptS3secretAccessKey();
(0, _postWebContent.postWebContent)({
dashboardUri,
tabId,
s3host
});
}
// postWebContent({
// dashboardUri,
// tabId,
// s3host
// });
// }

@@ -157,6 +157,6 @@ (0, _prepareFiles.prepareFiles)({

projectId,
insightId,
s3host,
s3accessKeyId,
s3secretAccessKey
insightId
// s3host,
// s3accessKeyId,
// s3secretAccessKey
});

@@ -194,4 +194,2 @@ });

var _postWebContent = require('./postWebContent');
var _parseConfigFile = require('./parseConfigFile');

@@ -206,5 +204,7 @@

function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
// import { postWebContent } from './postWebContent';
_commander2.default.version(pkg.version).option('--hostname <url>', `Instance of GoodData platform. The default is ${_constants.DEFAULT_HOSTNAME}`).option('--username <email>', 'Your username that you use to log in to GoodData platform').option('--password <value>', 'Your password that you use to log in to GoodData platform').option('--project-id <id>', 'Project id where you want to include the WebContent (iframe) component').option('--project-name <value>', 'Project name where you want to include the WebContent (iframe) component').option('--dashboard-uri <value>', 'Dashboard URI where you want to include the WebContent (iframe) component').option('--tab-id <id>', 'Tab ID where you want to include the WebContent (iframe) component').option('--insight-id <id>', 'Insight ID of the embedded visualization').option('--s3host <url>', 'URL of AWS S3 bucket where to upload source files. Leave blank to output files locally').option('--s3access-key-id <value>', 'Access Key ID of AWS S3 where to upload source files').option('--s3secret-access-key <value>', 'Secret Access Key of AWS S3 where to upload source files').option('--config <path>', `Custom config file (default ${_constants.DEFAULT_CONFIG_FILE_NAME}).`).option('--accept-untrusted-ssl', 'Allows to run the tool with host, that has untrusted ssl certificate').parse(process.argv);
run();

@@ -6,3 +6,3 @@ 'use strict';

});
exports.promptS3secretAccessKey = exports.promptS3accessKeyId = exports.promptS3hostId = exports.promptInsightId = exports.promptTabId = exports.promptDashboardUri = exports.promptProjectId = exports.promptPassword = exports.promptUsername = undefined;
exports.promptInsightId = exports.promptProjectId = exports.promptPassword = exports.promptUsername = undefined;

@@ -70,62 +70,51 @@ let promptUsername = exports.promptUsername = (() => {

let promptDashboardUri = exports.promptDashboardUri = (() => {
var _ref4 = _asyncToGenerator(function* (projectId) {
const metadataResponse = yield _gooddataJs2.default.xhr.get(`/gdc/md/${projectId}/objects/query?category=projectDashboard&limit=5`);
const metadata = metadataResponse.getData();
// export async function promptDashboardUri(projectId) {
// const metadataResponse = await gooddata.xhr.get(`/gdc/md/${projectId}/objects/query?category=projectDashboard&limit=5`);
// const metadata = metadataResponse.getData();
const dashboardChoices = metadata.objects.items.filter(function (dashboard) {
return dashboard.projectDashboard && !dashboard.projectDashboard.meta.unlisted;
}).map(function (dashboard) {
return {
name: dashboard.projectDashboard.meta.title,
value: dashboard.projectDashboard.meta.uri
};
});
// const dashboardChoices = metadata.objects.items
// .filter(dashboard => dashboard.projectDashboard && !dashboard.projectDashboard.meta.unlisted)
// .map((dashboard) => {
// return {
// name: dashboard.projectDashboard.meta.title,
// value: dashboard.projectDashboard.meta.uri
// };
// });
const dashboardQuestion = {
type: 'list',
name: 'dashboardUri',
message: 'Choose a dashboard:',
choices: dashboardChoices
};
// const dashboardQuestion = {
// type: 'list',
// name: 'dashboardUri',
// message: 'Choose a dashboard:',
// choices: dashboardChoices
// };
const dashboardResponse = yield (0, _inquirer.prompt)(dashboardQuestion);
return dashboardResponse.dashboardUri;
});
// const dashboardResponse = await prompt(dashboardQuestion);
// return dashboardResponse.dashboardUri;
// }
return function promptDashboardUri(_x) {
return _ref4.apply(this, arguments);
};
})();
// export async function promptTabId(dashboardUri) {
// const metadataResponse = await gooddata.xhr.get(dashboardUri);
// const metadata = metadataResponse.getData();
let promptTabId = exports.promptTabId = (() => {
var _ref5 = _asyncToGenerator(function* (dashboardUri) {
const metadataResponse = yield _gooddataJs2.default.xhr.get(dashboardUri);
const metadata = metadataResponse.getData();
// const tabChoices = metadata.projectDashboard.content.tabs
// .map((tab) => {
// return {
// name: tab.title,
// value: tab.identifier
// };
// });
const tabChoices = metadata.projectDashboard.content.tabs.map(function (tab) {
return {
name: tab.title,
value: tab.identifier
};
});
// const tabQuestion = {
// type: 'list',
// name: 'tabId',
// message: 'Choose a tab:',
// choices: tabChoices
// };
const tabQuestion = {
type: 'list',
name: 'tabId',
message: 'Choose a tab:',
choices: tabChoices
};
// const tabResponse = await prompt(tabQuestion);
// return tabResponse.tabId;
// }
const tabResponse = yield (0, _inquirer.prompt)(tabQuestion);
return tabResponse.tabId;
});
return function promptTabId(_x2) {
return _ref5.apply(this, arguments);
};
})();
let promptInsightId = exports.promptInsightId = (() => {
var _ref6 = _asyncToGenerator(function* (projectId) {
var _ref4 = _asyncToGenerator(function* (projectId) {
const metadataResponse = yield _gooddataJs2.default.xhr.get(`/gdc/md/${projectId}/query/visualizationobjects`);

@@ -154,58 +143,41 @@ const metadata = metadataResponse.getData();

return function promptInsightId(_x3) {
return _ref6.apply(this, arguments);
return function promptInsightId(_x) {
return _ref4.apply(this, arguments);
};
})();
let promptS3hostId = exports.promptS3hostId = (() => {
var _ref7 = _asyncToGenerator(function* () {
const s3hostQuestion = {
type: 'input',
name: 's3host',
message: 'Enter S3 Host:'
};
const s3hostResponse = yield (0, _inquirer.prompt)(s3hostQuestion);
// export async function promptS3hostId() {
// const s3hostQuestion = {
// type: 'input',
// name: 's3host',
// message: 'Enter S3 Host:'
// };
// const s3hostResponse = await prompt(s3hostQuestion);
return s3hostResponse.s3host;
});
// return s3hostResponse.s3host;
// }
return function promptS3hostId() {
return _ref7.apply(this, arguments);
};
})();
// export async function promptS3accessKeyId() {
// const s3accessKeyIdQuestion = {
// type: 'input',
// name: 's3accessKeyId',
// message: 'Enter S3 Access Key ID:'
// };
// const s3accessKeyIdResponse = await prompt(s3accessKeyIdQuestion);
let promptS3accessKeyId = exports.promptS3accessKeyId = (() => {
var _ref8 = _asyncToGenerator(function* () {
const s3accessKeyIdQuestion = {
type: 'input',
name: 's3accessKeyId',
message: 'Enter S3 Access Key ID:'
};
const s3accessKeyIdResponse = yield (0, _inquirer.prompt)(s3accessKeyIdQuestion);
// return s3accessKeyIdResponse.s3accessKeyId;
// }
return s3accessKeyIdResponse.s3accessKeyId;
});
// export async function promptS3secretAccessKey() {
// const s3secretAccessKeyQuestion = {
// type: 'password',
// name: 's3secretAccessKey',
// message: 'Enter S3 Secret Access Key:'
// };
// const s3secretAccessKeyResponse = await prompt(s3secretAccessKeyQuestion);
return function promptS3accessKeyId() {
return _ref8.apply(this, arguments);
};
})();
// return s3secretAccessKeyResponse.s3secretAccessKey;
// }
let promptS3secretAccessKey = exports.promptS3secretAccessKey = (() => {
var _ref9 = _asyncToGenerator(function* () {
const s3secretAccessKeyQuestion = {
type: 'password',
name: 's3secretAccessKey',
message: 'Enter S3 Secret Access Key:'
};
const s3secretAccessKeyResponse = yield (0, _inquirer.prompt)(s3secretAccessKeyQuestion);
return s3secretAccessKeyResponse.s3secretAccessKey;
});
return function promptS3secretAccessKey() {
return _ref9.apply(this, arguments);
};
})();
var _inquirer = require('inquirer');

@@ -212,0 +184,0 @@

{
"name": "@gooddata/gdc-embed-gdui",
"version": "0.0.11",
"version": "0.0.12",
"author": "GoodData",

@@ -5,0 +5,0 @@ "description": "GoodData Variable Names generator",

# @gooddata/gdc-embed-gdui
## TODOs
1. Implement uploading to S3 bucket (currently experimental)
[Documentation](https://sdk.gooddata.com/gooddata-ui/docs/gdc_embed_ui.html)

@@ -17,11 +17,11 @@ #!/usr/bin/env node

promptProjectId,
promptDashboardUri,
promptTabId,
promptInsightId,
promptS3hostId,
promptS3accessKeyId,
promptS3secretAccessKey
// promptDashboardUri,
// promptTabId,
promptInsightId
// promptS3hostId,
// promptS3accessKeyId,
// promptS3secretAccessKey
} from './prompts';
import { prepareFiles } from './prepareFiles';
import { postWebContent } from './postWebContent';
// import { postWebContent } from './postWebContent';
import { getConfigFromConfigFile, getConfigFromProgram } from './parseConfigFile';

@@ -65,8 +65,8 @@ import { DEFAULT_CONFIG_FILE_NAME, DEFAULT_HOSTNAME } from './constants';

projectId,
dashboardUri,
tabId,
insightId,
s3host,
s3accessKeyId,
s3secretAccessKey
// dashboardUri,
// tabId,
insightId
// s3host,
// s3accessKeyId,
// s3secretAccessKey
} = configFileOptions;

@@ -126,27 +126,27 @@

const dashboardSpinner = ora();
try {
if (dashboardUri) {
log('Dashboard URI', dashboardUri);
} else {
dashboardUri = await promptDashboardUri(projectId);
}
} catch (err) {
dashboardSpinner.stop();
logError(`${err.name}: ${err.message}`);
process.exit(1);
}
// const dashboardSpinner = ora();
// try {
// if (dashboardUri) {
// log('Dashboard URI', dashboardUri);
// } else {
// dashboardUri = await promptDashboardUri(projectId);
// }
// } catch (err) {
// dashboardSpinner.stop();
// logError(`${err.name}: ${err.message}`);
// process.exit(1);
// }
const tabSpinner = ora();
try {
if (tabId) {
log('Tab ID', tabId);
} else {
tabId = await promptTabId(dashboardUri);
}
} catch (err) {
tabSpinner.stop();
logError(`${err.name}: ${err.message}`);
process.exit(1);
}
// const tabSpinner = ora();
// try {
// if (tabId) {
// log('Tab ID', tabId);
// } else {
// tabId = await promptTabId(dashboardUri);
// }
// } catch (err) {
// tabSpinner.stop();
// logError(`${err.name}: ${err.message}`);
// process.exit(1);
// }

@@ -166,30 +166,30 @@ const insightSpinner = ora();

const s3hostSpinner = ora();
try {
if (s3host) {
log('S3 Host', s3host);
} else {
s3host = await promptS3hostId(projectId);
}
} catch (err) {
s3hostSpinner.stop();
logError(`${err.name}: ${err.message}`);
process.exit(1);
}
// const s3hostSpinner = ora();
// try {
// if (s3host) {
// log('S3 Host', s3host);
// } else {
// s3host = await promptS3hostId(projectId);
// }
// } catch (err) {
// s3hostSpinner.stop();
// logError(`${err.name}: ${err.message}`);
// process.exit(1);
// }
if (s3host) {
if (s3accessKeyId) {
log('S3 Access Key ID', s3accessKeyId);
} else {
s3accessKeyId = await promptS3accessKeyId();
}
// if (s3host) {
// if (s3accessKeyId) {
// log('S3 Access Key ID', s3accessKeyId);
// } else {
// s3accessKeyId = await promptS3accessKeyId();
// }
s3secretAccessKey = s3secretAccessKey || await promptS3secretAccessKey();
// s3secretAccessKey = s3secretAccessKey || await promptS3secretAccessKey();
postWebContent({
dashboardUri,
tabId,
s3host
});
}
// postWebContent({
// dashboardUri,
// tabId,
// s3host
// });
// }

@@ -199,6 +199,6 @@ prepareFiles({

projectId,
insightId,
s3host,
s3accessKeyId,
s3secretAccessKey
insightId
// s3host,
// s3accessKeyId,
// s3secretAccessKey
});

@@ -205,0 +205,0 @@ }

@@ -47,48 +47,48 @@ import { prompt } from 'inquirer';

export async function promptDashboardUri(projectId) {
const metadataResponse = await gooddata.xhr.get(`/gdc/md/${projectId}/objects/query?category=projectDashboard&limit=5`);
const metadata = metadataResponse.getData();
// export async function promptDashboardUri(projectId) {
// const metadataResponse = await gooddata.xhr.get(`/gdc/md/${projectId}/objects/query?category=projectDashboard&limit=5`);
// const metadata = metadataResponse.getData();
const dashboardChoices = metadata.objects.items
.filter(dashboard => dashboard.projectDashboard && !dashboard.projectDashboard.meta.unlisted)
.map((dashboard) => {
return {
name: dashboard.projectDashboard.meta.title,
value: dashboard.projectDashboard.meta.uri
};
});
// const dashboardChoices = metadata.objects.items
// .filter(dashboard => dashboard.projectDashboard && !dashboard.projectDashboard.meta.unlisted)
// .map((dashboard) => {
// return {
// name: dashboard.projectDashboard.meta.title,
// value: dashboard.projectDashboard.meta.uri
// };
// });
const dashboardQuestion = {
type: 'list',
name: 'dashboardUri',
message: 'Choose a dashboard:',
choices: dashboardChoices
};
// const dashboardQuestion = {
// type: 'list',
// name: 'dashboardUri',
// message: 'Choose a dashboard:',
// choices: dashboardChoices
// };
const dashboardResponse = await prompt(dashboardQuestion);
return dashboardResponse.dashboardUri;
}
// const dashboardResponse = await prompt(dashboardQuestion);
// return dashboardResponse.dashboardUri;
// }
export async function promptTabId(dashboardUri) {
const metadataResponse = await gooddata.xhr.get(dashboardUri);
const metadata = metadataResponse.getData();
// export async function promptTabId(dashboardUri) {
// const metadataResponse = await gooddata.xhr.get(dashboardUri);
// const metadata = metadataResponse.getData();
const tabChoices = metadata.projectDashboard.content.tabs
.map((tab) => {
return {
name: tab.title,
value: tab.identifier
};
});
// const tabChoices = metadata.projectDashboard.content.tabs
// .map((tab) => {
// return {
// name: tab.title,
// value: tab.identifier
// };
// });
const tabQuestion = {
type: 'list',
name: 'tabId',
message: 'Choose a tab:',
choices: tabChoices
};
// const tabQuestion = {
// type: 'list',
// name: 'tabId',
// message: 'Choose a tab:',
// choices: tabChoices
// };
const tabResponse = await prompt(tabQuestion);
return tabResponse.tabId;
}
// const tabResponse = await prompt(tabQuestion);
// return tabResponse.tabId;
// }

@@ -119,33 +119,33 @@ export async function promptInsightId(projectId) {

export async function promptS3hostId() {
const s3hostQuestion = {
type: 'input',
name: 's3host',
message: 'Enter S3 Host:'
};
const s3hostResponse = await prompt(s3hostQuestion);
// export async function promptS3hostId() {
// const s3hostQuestion = {
// type: 'input',
// name: 's3host',
// message: 'Enter S3 Host:'
// };
// const s3hostResponse = await prompt(s3hostQuestion);
return s3hostResponse.s3host;
}
// return s3hostResponse.s3host;
// }
export async function promptS3accessKeyId() {
const s3accessKeyIdQuestion = {
type: 'input',
name: 's3accessKeyId',
message: 'Enter S3 Access Key ID:'
};
const s3accessKeyIdResponse = await prompt(s3accessKeyIdQuestion);
// export async function promptS3accessKeyId() {
// const s3accessKeyIdQuestion = {
// type: 'input',
// name: 's3accessKeyId',
// message: 'Enter S3 Access Key ID:'
// };
// const s3accessKeyIdResponse = await prompt(s3accessKeyIdQuestion);
return s3accessKeyIdResponse.s3accessKeyId;
}
// return s3accessKeyIdResponse.s3accessKeyId;
// }
export async function promptS3secretAccessKey() {
const s3secretAccessKeyQuestion = {
type: 'password',
name: 's3secretAccessKey',
message: 'Enter S3 Secret Access Key:'
};
const s3secretAccessKeyResponse = await prompt(s3secretAccessKeyQuestion);
// export async function promptS3secretAccessKey() {
// const s3secretAccessKeyQuestion = {
// type: 'password',
// name: 's3secretAccessKey',
// message: 'Enter S3 Secret Access Key:'
// };
// const s3secretAccessKeyResponse = await prompt(s3secretAccessKeyQuestion);
return s3secretAccessKeyResponse.s3secretAccessKey;
}
// return s3secretAccessKeyResponse.s3secretAccessKey;
// }
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc