@overscore/cli 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +29 -29
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -295,7 +295,7 @@ async function queryList() {
|
|
|
295
295
|
if (data.queries.length === 0) {
|
|
296
296
|
console.log(" No queries registered yet.\n");
|
|
297
297
|
console.log(" Add one with:");
|
|
298
|
-
console.log(' npx overscore query add <name> "SELECT ..."\n');
|
|
298
|
+
console.log(' npx @overscore/cli query add <name> "SELECT ..."\n');
|
|
299
299
|
return;
|
|
300
300
|
}
|
|
301
301
|
for (const q of data.queries) {
|
|
@@ -311,7 +311,7 @@ async function queryList() {
|
|
|
311
311
|
}
|
|
312
312
|
async function queryShow(name) {
|
|
313
313
|
if (!name) {
|
|
314
|
-
console.error("\n Usage: npx overscore query show <name>\n");
|
|
314
|
+
console.error("\n Usage: npx @overscore/cli query show <name>\n");
|
|
315
315
|
process.exit(1);
|
|
316
316
|
}
|
|
317
317
|
const { dashboardSlug } = loadEnv();
|
|
@@ -356,9 +356,9 @@ function resolveSql(sqlOrNext) {
|
|
|
356
356
|
async function queryAdd(name, sql) {
|
|
357
357
|
const resolvedSql = resolveSql(sql);
|
|
358
358
|
if (!name || !resolvedSql) {
|
|
359
|
-
console.error('\n Usage: npx overscore query add <name> "<sql>"\n');
|
|
359
|
+
console.error('\n Usage: npx @overscore/cli query add <name> "<sql>"\n');
|
|
360
360
|
console.error(" Or with a file:");
|
|
361
|
-
console.error(" npx overscore query add <name> --file query.sql\n");
|
|
361
|
+
console.error(" npx @overscore/cli query add <name> --file query.sql\n");
|
|
362
362
|
process.exit(1);
|
|
363
363
|
}
|
|
364
364
|
if (!/^[a-z][a-z0-9_]*$/.test(name) || name.length > 100) {
|
|
@@ -374,9 +374,9 @@ async function queryAdd(name, sql) {
|
|
|
374
374
|
async function queryUpdate(name, sql) {
|
|
375
375
|
const resolvedSql = resolveSql(sql);
|
|
376
376
|
if (!name || !resolvedSql) {
|
|
377
|
-
console.error('\n Usage: npx overscore query update <name> "<sql>"\n');
|
|
377
|
+
console.error('\n Usage: npx @overscore/cli query update <name> "<sql>"\n');
|
|
378
378
|
console.error(" Or with a file:");
|
|
379
|
-
console.error(" npx overscore query update <name> --file query.sql\n");
|
|
379
|
+
console.error(" npx @overscore/cli query update <name> --file query.sql\n");
|
|
380
380
|
process.exit(1);
|
|
381
381
|
}
|
|
382
382
|
const { dashboardSlug } = loadEnv();
|
|
@@ -386,7 +386,7 @@ async function queryUpdate(name, sql) {
|
|
|
386
386
|
}
|
|
387
387
|
async function queryRemove(name) {
|
|
388
388
|
if (!name) {
|
|
389
|
-
console.error("\n Usage: npx overscore query remove <name>\n");
|
|
389
|
+
console.error("\n Usage: npx @overscore/cli query remove <name>\n");
|
|
390
390
|
process.exit(1);
|
|
391
391
|
}
|
|
392
392
|
const yes = await confirm(`Delete query "${name}"? This cannot be undone.`);
|
|
@@ -400,9 +400,9 @@ async function queryRemove(name) {
|
|
|
400
400
|
}
|
|
401
401
|
async function queryTest(sql) {
|
|
402
402
|
if (!sql) {
|
|
403
|
-
console.error('\n Usage: npx overscore query test "<sql>"\n');
|
|
403
|
+
console.error('\n Usage: npx @overscore/cli query test "<sql>"\n');
|
|
404
404
|
console.error(" Example:");
|
|
405
|
-
console.error(' npx overscore query test "SELECT * FROM dataset.table LIMIT 10"\n');
|
|
405
|
+
console.error(' npx @overscore/cli query test "SELECT * FROM dataset.table LIMIT 10"\n');
|
|
406
406
|
process.exit(1);
|
|
407
407
|
}
|
|
408
408
|
const { dashboardSlug } = loadEnv();
|
|
@@ -449,9 +449,9 @@ function formatCell(value) {
|
|
|
449
449
|
}
|
|
450
450
|
async function pull(slug) {
|
|
451
451
|
if (!slug) {
|
|
452
|
-
console.error("\n Usage: npx overscore pull <dashboard-slug> [--version N]\n");
|
|
452
|
+
console.error("\n Usage: npx @overscore/cli pull <dashboard-slug> [--version N]\n");
|
|
453
453
|
console.error(" Example:");
|
|
454
|
-
console.error(" npx overscore pull my-dashboard\n");
|
|
454
|
+
console.error(" npx @overscore/cli pull my-dashboard\n");
|
|
455
455
|
process.exit(1);
|
|
456
456
|
}
|
|
457
457
|
// Parse --version flag
|
|
@@ -558,7 +558,7 @@ VITE_OVERSCORE_API_URL=https://overscore.dev/api
|
|
|
558
558
|
|
|
559
559
|
When ready to deploy:
|
|
560
560
|
|
|
561
|
-
npx overscore deploy --message "your changes"
|
|
561
|
+
npx @overscore/cli deploy --message "your changes"
|
|
562
562
|
`);
|
|
563
563
|
}
|
|
564
564
|
async function versions() {
|
|
@@ -583,7 +583,7 @@ async function versions() {
|
|
|
583
583
|
const by = v.deployed_by ? ` by ${v.deployed_by}` : "";
|
|
584
584
|
console.log(` v${v.version_number} ${date} ${v.file_count} files ${size} ${source}${msg}${by}`);
|
|
585
585
|
}
|
|
586
|
-
console.log(`\n Pull a version: npx overscore pull ${dashboardSlug} --version N\n`);
|
|
586
|
+
console.log(`\n Pull a version: npx @overscore/cli pull ${dashboardSlug} --version N\n`);
|
|
587
587
|
}
|
|
588
588
|
async function listDashboards() {
|
|
589
589
|
const { apiUrl, apiKey } = loadEnv();
|
|
@@ -676,12 +676,12 @@ else if (command === "query") {
|
|
|
676
676
|
test "<sql>" Test SQL without saving
|
|
677
677
|
|
|
678
678
|
Examples:
|
|
679
|
-
npx overscore query list
|
|
680
|
-
npx overscore query show monthly_revenue
|
|
681
|
-
npx overscore query add monthly_revenue --file queries/revenue.sql
|
|
682
|
-
npx overscore query add monthly_revenue "SELECT ..."
|
|
683
|
-
npx overscore query update monthly_revenue --file queries/revenue.sql
|
|
684
|
-
npx overscore query test "SELECT * FROM dataset.table LIMIT 10"
|
|
679
|
+
npx @overscore/cli query list
|
|
680
|
+
npx @overscore/cli query show monthly_revenue
|
|
681
|
+
npx @overscore/cli query add monthly_revenue --file queries/revenue.sql
|
|
682
|
+
npx @overscore/cli query add monthly_revenue "SELECT ..."
|
|
683
|
+
npx @overscore/cli query update monthly_revenue --file queries/revenue.sql
|
|
684
|
+
npx @overscore/cli query test "SELECT * FROM dataset.table LIMIT 10"
|
|
685
685
|
`);
|
|
686
686
|
}
|
|
687
687
|
}
|
|
@@ -697,15 +697,15 @@ else {
|
|
|
697
697
|
query <subcommand> Manage dashboard queries
|
|
698
698
|
|
|
699
699
|
Usage:
|
|
700
|
-
npx overscore list
|
|
701
|
-
npx overscore deploy --message "description"
|
|
702
|
-
npx overscore pull <slug>
|
|
703
|
-
npx overscore pull <slug> --version 3
|
|
704
|
-
npx overscore versions
|
|
705
|
-
npx overscore query list
|
|
706
|
-
npx overscore query add <name> "<sql>"
|
|
707
|
-
npx overscore query update <name> "<sql>"
|
|
708
|
-
npx overscore query remove <name>
|
|
709
|
-
npx overscore query test "<sql>"
|
|
700
|
+
npx @overscore/cli list
|
|
701
|
+
npx @overscore/cli deploy --message "description"
|
|
702
|
+
npx @overscore/cli pull <slug>
|
|
703
|
+
npx @overscore/cli pull <slug> --version 3
|
|
704
|
+
npx @overscore/cli versions
|
|
705
|
+
npx @overscore/cli query list
|
|
706
|
+
npx @overscore/cli query add <name> "<sql>"
|
|
707
|
+
npx @overscore/cli query update <name> "<sql>"
|
|
708
|
+
npx @overscore/cli query remove <name>
|
|
709
|
+
npx @overscore/cli query test "<sql>"
|
|
710
710
|
`);
|
|
711
711
|
}
|