@diafunc/cli 0.21.0 → 0.22.0
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/bin/diafunc.js +3 -3
- package/dist/{chunk-M34533JL.js → chunk-5WKI5YMX.js} +2 -2
- package/dist/{chunk-M34533JL.js.map → chunk-5WKI5YMX.js.map} +1 -1
- package/dist/{chunk-ZCJKBLEW.js → chunk-KIHRD6SW.js} +2 -2
- package/dist/{chunk-IV75CA5V.js → chunk-LEDCBZ3S.js} +105 -18
- package/dist/chunk-LEDCBZ3S.js.map +1 -0
- package/dist/src/index.js +2 -2
- package/dist/update-check-RWCYYDVC.js +8 -0
- package/package.json +1 -1
- package/dist/chunk-IV75CA5V.js.map +0 -1
- package/dist/update-check-EW6JPLJT.js +0 -8
- /package/dist/{chunk-ZCJKBLEW.js.map → chunk-KIHRD6SW.js.map} +0 -0
- /package/dist/{update-check-EW6JPLJT.js.map → update-check-RWCYYDVC.js.map} +0 -0
package/dist/bin/diafunc.js
CHANGED
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
PromptCancelled,
|
|
5
5
|
createProgram,
|
|
6
6
|
handleError
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-LEDCBZ3S.js";
|
|
8
8
|
import {
|
|
9
9
|
getUpdateNotice
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-KIHRD6SW.js";
|
|
11
11
|
import {
|
|
12
12
|
package_default
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-5WKI5YMX.js";
|
|
14
14
|
|
|
15
15
|
// bin/diafunc.ts
|
|
16
16
|
import chalk2 from "chalk";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "@diafunc/cli",
|
|
4
|
-
version: "0.
|
|
4
|
+
version: "0.22.0",
|
|
5
5
|
description: "Diafunc CLI: the command-line interface for the Diafunc platform",
|
|
6
6
|
type: "module",
|
|
7
7
|
bin: {
|
|
@@ -62,4 +62,4 @@ var package_default = {
|
|
|
62
62
|
export {
|
|
63
63
|
package_default
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=chunk-
|
|
65
|
+
//# sourceMappingURL=chunk-5WKI5YMX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@diafunc/cli\",\n \"version\": \"0.
|
|
1
|
+
{"version":3,"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@diafunc/cli\",\n \"version\": \"0.22.0\",\n \"description\": \"Diafunc CLI: the command-line interface for the Diafunc platform\",\n \"type\": \"module\",\n \"bin\": {\n \"diafunc\": \"./dist/bin/diafunc.js\"\n },\n \"homepage\": \"https://diafunc.com\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://gitlab.com/diafunc/cli.git\"\n },\n \"bugs\": {\n \"url\": \"https://gitlab.com/diafunc/cli/-/issues\"\n },\n \"author\": \"Markus Pollak <markus.pollak@diafunc.com>\",\n \"scripts\": {\n \"build\": \"tsup && node -e \\\"const fs=require('fs');const f='dist/bin/diafunc.js';fs.writeFileSync(f,'#!/usr/bin/env node\\\\n'+fs.readFileSync(f,'utf8'))\\\"\",\n \"dev\": \"tsup --watch\",\n \"test\": \"vitest run\",\n \"test:watch\": \"vitest\",\n \"lint\": \"tsc --noEmit\",\n \"start\": \"node dist/bin/diafunc.js\",\n \"prepublishOnly\": \"npm run lint && npm test && npm run build\"\n },\n \"files\": [\n \"dist\",\n \"LICENSE\",\n \"README.md\"\n ],\n \"keywords\": [\n \"diafunc\",\n \"cli\",\n \"data-science\",\n \"symbolic-regression\"\n ],\n \"license\": \"Apache-2.0\",\n \"publishConfig\": {\n \"access\": \"public\",\n \"registry\": \"https://registry.npmjs.org/\"\n },\n \"engines\": {\n \"node\": \">=20.0.0\"\n },\n \"dependencies\": {\n \"@inquirer/prompts\": \"^7.0.0\",\n \"chalk\": \"^5.4.0\",\n \"cli-table3\": \"^0.6.5\",\n \"commander\": \"^12.1.0\",\n \"ora\": \"^8.1.0\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^22.0.0\",\n \"tsup\": \"^8.3.0\",\n \"typescript\": \"^5.6.0\",\n \"vitest\": \"^2.1.0\"\n }\n}\n"],"mappings":";AAAA;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,KAAO;AAAA,IACL,SAAW;AAAA,EACb;AAAA,EACA,UAAY;AAAA,EACZ,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,EACT;AAAA,EACA,MAAQ;AAAA,IACN,KAAO;AAAA,EACT;AAAA,EACA,QAAU;AAAA,EACV,SAAW;AAAA,IACT,OAAS;AAAA,IACT,KAAO;AAAA,IACP,MAAQ;AAAA,IACR,cAAc;AAAA,IACd,MAAQ;AAAA,IACR,OAAS;AAAA,IACT,gBAAkB;AAAA,EACpB;AAAA,EACA,OAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,SAAW;AAAA,EACX,eAAiB;AAAA,IACf,QAAU;AAAA,IACV,UAAY;AAAA,EACd;AAAA,EACA,SAAW;AAAA,IACT,MAAQ;AAAA,EACV;AAAA,EACA,cAAgB;AAAA,IACd,qBAAqB;AAAA,IACrB,OAAS;AAAA,IACT,cAAc;AAAA,IACd,WAAa;AAAA,IACb,KAAO;AAAA,EACT;AAAA,EACA,iBAAmB;AAAA,IACjB,eAAe;AAAA,IACf,MAAQ;AAAA,IACR,YAAc;AAAA,IACd,QAAU;AAAA,EACZ;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
package_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5WKI5YMX.js";
|
|
4
4
|
|
|
5
5
|
// src/util/update-check.ts
|
|
6
6
|
import * as fs from "fs";
|
|
@@ -72,4 +72,4 @@ async function getUpdateNotice() {
|
|
|
72
72
|
export {
|
|
73
73
|
getUpdateNotice
|
|
74
74
|
};
|
|
75
|
-
//# sourceMappingURL=chunk-
|
|
75
|
+
//# sourceMappingURL=chunk-KIHRD6SW.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
package_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5WKI5YMX.js";
|
|
4
4
|
|
|
5
5
|
// src/index.ts
|
|
6
6
|
import chalk37 from "chalk";
|
|
@@ -1691,6 +1691,15 @@ function createAnalysisService(client) {
|
|
|
1691
1691
|
path: `/${encodeURIComponent(analysisId)}/sources`
|
|
1692
1692
|
});
|
|
1693
1693
|
},
|
|
1694
|
+
/** Sets whether a source is read as uploaded, rather than through the reshape its shape suggests. */
|
|
1695
|
+
async updateSource(analysisId, sourceId, changes) {
|
|
1696
|
+
return client.request({
|
|
1697
|
+
method: "PATCH",
|
|
1698
|
+
service: SERVICE2,
|
|
1699
|
+
path: `/${encodeURIComponent(analysisId)}/sources/${encodeURIComponent(sourceId)}`,
|
|
1700
|
+
body: changes
|
|
1701
|
+
});
|
|
1702
|
+
},
|
|
1694
1703
|
async removeSource(analysisId, sourceId) {
|
|
1695
1704
|
return client.request({
|
|
1696
1705
|
method: "DELETE",
|
|
@@ -1698,6 +1707,17 @@ function createAnalysisService(client) {
|
|
|
1698
1707
|
path: `/${encodeURIComponent(analysisId)}/sources/${encodeURIComponent(sourceId)}`
|
|
1699
1708
|
});
|
|
1700
1709
|
},
|
|
1710
|
+
/**
|
|
1711
|
+
* The tables of the analysis's files that do not look like one row per observation, read from their
|
|
1712
|
+
* first rows only. Empty when the data is as it should be.
|
|
1713
|
+
*/
|
|
1714
|
+
async sourceShapes(analysisId) {
|
|
1715
|
+
return client.request({
|
|
1716
|
+
method: "GET",
|
|
1717
|
+
service: SERVICE2,
|
|
1718
|
+
path: `/${encodeURIComponent(analysisId)}/sources/shapes`
|
|
1719
|
+
});
|
|
1720
|
+
},
|
|
1701
1721
|
/** What building from the sources would yield: for `recipe`, or for the platform's proposal when it is null. */
|
|
1702
1722
|
async planSources(analysisId, recipe) {
|
|
1703
1723
|
return client.request({
|
|
@@ -6295,7 +6315,7 @@ var HELP = [
|
|
|
6295
6315
|
];
|
|
6296
6316
|
async function runChatRepl(options) {
|
|
6297
6317
|
const { input: promptInput } = await import("@inquirer/prompts");
|
|
6298
|
-
const { getUpdateNotice } = await import("./update-check-
|
|
6318
|
+
const { getUpdateNotice } = await import("./update-check-RWCYYDVC.js");
|
|
6299
6319
|
let sessionId = options.session;
|
|
6300
6320
|
let lastReportedSession;
|
|
6301
6321
|
console.log(chalk19.bold("Diafunc chat") + chalk19.dim(" \xB7 /help for commands, /quit to exit"));
|
|
@@ -8043,7 +8063,8 @@ var CAUTIONS = /* @__PURE__ */ new Set([
|
|
|
8043
8063
|
"MANY_TO_MANY",
|
|
8044
8064
|
"NO_KEY",
|
|
8045
8065
|
"TOO_LARGE",
|
|
8046
|
-
"HINT_REJECTED"
|
|
8066
|
+
"HINT_REJECTED",
|
|
8067
|
+
"RESHAPE_REFUSED"
|
|
8047
8068
|
]);
|
|
8048
8069
|
function recipeWithChoices(proposal, choices) {
|
|
8049
8070
|
if (proposal.parts.length < 2) return null;
|
|
@@ -8070,6 +8091,50 @@ function recipeWithRowsOf(proposal, rowsOf) {
|
|
|
8070
8091
|
hint: alternative ? `The rows can come from ${rows} or from ${alternative.parts.map((part) => part.label).join(", ")}.` : `These files have one reading: the rows come from ${rows}.`
|
|
8071
8092
|
});
|
|
8072
8093
|
}
|
|
8094
|
+
function sourcesAsUploaded(uploaded, asUploaded) {
|
|
8095
|
+
const chosen = [];
|
|
8096
|
+
for (const name of asUploaded) {
|
|
8097
|
+
const wanted = path7.basename(name).trim().toLowerCase();
|
|
8098
|
+
const matches = uploaded.filter((source) => {
|
|
8099
|
+
const fileName = source.fileName.trim().toLowerCase();
|
|
8100
|
+
return fileName === wanted || labelOf(fileName) === labelOf(wanted);
|
|
8101
|
+
});
|
|
8102
|
+
if (matches.length === 0) {
|
|
8103
|
+
throw new CliError(`--as-uploaded names ${name}, which is not among the files.`, {
|
|
8104
|
+
exitCode: EXIT_USAGE,
|
|
8105
|
+
hint: `The files are: ${uploaded.map((source) => source.fileName).join(", ")}.`
|
|
8106
|
+
});
|
|
8107
|
+
}
|
|
8108
|
+
for (const match of matches) {
|
|
8109
|
+
if (!chosen.includes(match)) chosen.push(match);
|
|
8110
|
+
}
|
|
8111
|
+
}
|
|
8112
|
+
return chosen;
|
|
8113
|
+
}
|
|
8114
|
+
function readsReshaped(recipe) {
|
|
8115
|
+
const parts = [...recipe.parts, ...(recipe.lookups ?? []).flatMap((lookup) => lookup.parts)];
|
|
8116
|
+
return parts.some((part) => (part.reshapes ?? []).length > 0);
|
|
8117
|
+
}
|
|
8118
|
+
async function reshapeSingle(api, analysisId, human) {
|
|
8119
|
+
let plan;
|
|
8120
|
+
try {
|
|
8121
|
+
if ((await api.analysis.sourceShapes(analysisId)).length === 0) return null;
|
|
8122
|
+
plan = await withStatus("Reading how the file should be read", () => api.analysis.planSources(analysisId, null));
|
|
8123
|
+
} catch (error) {
|
|
8124
|
+
if (error instanceof ApiError && error.status >= 400 && error.status < 500 && error.status !== 401 && error.status !== 403) {
|
|
8125
|
+
return null;
|
|
8126
|
+
}
|
|
8127
|
+
throw error;
|
|
8128
|
+
}
|
|
8129
|
+
if (!readsReshaped(plan.recipe)) return null;
|
|
8130
|
+
if (human) {
|
|
8131
|
+
for (const finding of plan.findings) {
|
|
8132
|
+
if (finding.kind === "RESHAPED") detail(finding.message);
|
|
8133
|
+
}
|
|
8134
|
+
hint("The reshape is a function in the analysis's project and can be changed in the Lab. To read the file exactly as it is, add --as-uploaded.");
|
|
8135
|
+
}
|
|
8136
|
+
return withStatus("Building the data from the reshaped file", () => api.analysis.buildSources(analysisId, plan.recipe));
|
|
8137
|
+
}
|
|
8073
8138
|
function planLines(plan) {
|
|
8074
8139
|
const lines = [{
|
|
8075
8140
|
text: `One table of ${plan.rows.toLocaleString("en-US")} rows and ${plan.columns.toLocaleString("en-US")} columns.`,
|
|
@@ -8094,8 +8159,12 @@ async function uploadSeveral(api, analysisId, files, choices, human) {
|
|
|
8094
8159
|
for (const earlier of await api.analysis.listSources(analysisId)) {
|
|
8095
8160
|
await api.analysis.removeSource(analysisId, earlier.sourceId);
|
|
8096
8161
|
}
|
|
8162
|
+
const uploaded = [];
|
|
8097
8163
|
for (const file of files) {
|
|
8098
|
-
await withStatus(`Uploading ${path7.basename(file)}`, () => api.analysis.addSource(analysisId, multipart(file)));
|
|
8164
|
+
uploaded.push(await withStatus(`Uploading ${path7.basename(file)}`, () => api.analysis.addSource(analysisId, multipart(file))));
|
|
8165
|
+
}
|
|
8166
|
+
for (const source of sourcesAsUploaded(uploaded, choices.asUploaded ?? [])) {
|
|
8167
|
+
await api.analysis.updateSource(analysisId, source.sourceId, { asUploaded: true });
|
|
8099
8168
|
}
|
|
8100
8169
|
let other = null;
|
|
8101
8170
|
const plan = await withStatus("Reading the files together", async () => {
|
|
@@ -8114,6 +8183,9 @@ async function uploadSeveral(api, analysisId, files, choices, human) {
|
|
|
8114
8183
|
if (line.caution) warn(line.text);
|
|
8115
8184
|
else detail(line.text);
|
|
8116
8185
|
}
|
|
8186
|
+
if (readsReshaped(plan.recipe)) {
|
|
8187
|
+
hint("A reshape is a function in the analysis's project and can be changed in the Lab. To read a file exactly as it is, add --as-uploaded <file>.");
|
|
8188
|
+
}
|
|
8117
8189
|
if (other) {
|
|
8118
8190
|
hint(`These files can be read two ways. For one row per row of ${other}, add --rows-of ${other}.`);
|
|
8119
8191
|
}
|
|
@@ -8276,10 +8348,7 @@ async function runAnalysis(files, options, cmd) {
|
|
|
8276
8348
|
}
|
|
8277
8349
|
detail(`depth: ${depthLabel(stored)}${created.depthPreselection ? " (the account's starting depth)" : ""}`);
|
|
8278
8350
|
}
|
|
8279
|
-
await sendData(importContext(api, created.analysisId, cmd, "stream"), () => files.length > 1 ? uploadSeveral(api, created.analysisId, files, stackChoices(options), outputFormat === "human") :
|
|
8280
|
-
`Uploading ${path8.basename(file)}`,
|
|
8281
|
-
() => api.analysis.uploadDataMultipart(created.analysisId, multipartFromFile(file))
|
|
8282
|
-
));
|
|
8351
|
+
await sendData(importContext(api, created.analysisId, cmd, "stream"), () => files.length > 1 ? uploadSeveral(api, created.analysisId, files, stackChoices(options, files), outputFormat === "human") : uploadOne(api, created.analysisId, file, asUploadedOf(options.asUploaded, files), outputFormat === "human"));
|
|
8283
8352
|
const columns = await readColumns(api, created.analysisId);
|
|
8284
8353
|
const named = namedColumns(
|
|
8285
8354
|
created.analysisId,
|
|
@@ -8729,14 +8798,35 @@ async function patchColumns(analysisId, given, send, successLabel, cmd) {
|
|
|
8729
8798
|
const columns = resolveColumnArguments(occurrences(given) ?? [], await columnNames(api, analysisId), analysisId);
|
|
8730
8799
|
await patchAndPrint(analysisId, "", () => send(api, columns), successLabel, cmd);
|
|
8731
8800
|
}
|
|
8732
|
-
function
|
|
8801
|
+
function collectAsUploaded(value, previous) {
|
|
8802
|
+
return [...Array.isArray(previous) ? previous : [], value];
|
|
8803
|
+
}
|
|
8804
|
+
var AS_UPLOADED_HELP = "Read a file exactly as it is, without the reshape its shape suggests (a column per year read as a row per year, a header over several rows, several numbers in one cell). Without a file name: every file; repeat the flag for several";
|
|
8805
|
+
function asUploadedOf(asUploaded, files) {
|
|
8806
|
+
if (asUploaded === true) return files;
|
|
8807
|
+
return asUploaded ?? [];
|
|
8808
|
+
}
|
|
8809
|
+
function stackChoices(options, files) {
|
|
8733
8810
|
return {
|
|
8811
|
+
asUploaded: asUploadedOf(options.asUploaded, files),
|
|
8734
8812
|
fileColumn: options.fileColumn !== false,
|
|
8735
8813
|
keepDuplicates: options.keepDuplicates === true,
|
|
8736
8814
|
rowsOf: options.rowsOf,
|
|
8737
8815
|
planOnly: options.planOnly === true
|
|
8738
8816
|
};
|
|
8739
8817
|
}
|
|
8818
|
+
async function uploadOne(api, analysisId, file, asUploaded, human) {
|
|
8819
|
+
const uploaded = await withStatus(
|
|
8820
|
+
`Uploading ${path8.basename(file)}`,
|
|
8821
|
+
() => api.analysis.uploadDataMultipart(analysisId, multipartFromFile(file))
|
|
8822
|
+
);
|
|
8823
|
+
if (isDryRun() || uploaded.dataImport) return uploaded;
|
|
8824
|
+
if (asUploaded.length > 0) {
|
|
8825
|
+
sourcesAsUploaded([{ fileName: path8.basename(file) }], asUploaded);
|
|
8826
|
+
return uploaded;
|
|
8827
|
+
}
|
|
8828
|
+
return await reshapeSingle(api, analysisId, human) ?? uploaded;
|
|
8829
|
+
}
|
|
8740
8830
|
async function uploadData(analysisId, files, options, cmd) {
|
|
8741
8831
|
const api = createApiClient();
|
|
8742
8832
|
const outputFormat = getOutputFormat15(cmd);
|
|
@@ -8748,7 +8838,7 @@ async function uploadData(analysisId, files, options, cmd) {
|
|
|
8748
8838
|
}
|
|
8749
8839
|
const built = await sendData(
|
|
8750
8840
|
ctx,
|
|
8751
|
-
() => uploadSeveral(api, analysisId, files, stackChoices(options), outputFormat === "human")
|
|
8841
|
+
() => uploadSeveral(api, analysisId, files, stackChoices(options, files), outputFormat === "human")
|
|
8752
8842
|
);
|
|
8753
8843
|
if (outputFormat !== "human") {
|
|
8754
8844
|
format({
|
|
@@ -8775,10 +8865,7 @@ async function uploadData(analysisId, files, options, cmd) {
|
|
|
8775
8865
|
throw new CliError(`File not found: ${file}`, { exitCode: EXIT_USAGE });
|
|
8776
8866
|
}
|
|
8777
8867
|
}
|
|
8778
|
-
const uploaded = await sendData(ctx, () => dataUrl ? withStatus(`Uploading from ${dataUrl}`, () => api.analysis.uploadDataUrl(analysisId, { dataUrl })) :
|
|
8779
|
-
`Uploading ${path8.basename(file)}`,
|
|
8780
|
-
() => api.analysis.uploadDataMultipart(analysisId, multipartFromFile(file))
|
|
8781
|
-
));
|
|
8868
|
+
const uploaded = await sendData(ctx, () => dataUrl ? withStatus(`Uploading from ${dataUrl}`, () => api.analysis.uploadDataUrl(analysisId, { dataUrl })) : uploadOne(api, analysisId, file, asUploadedOf(options.asUploaded, files), outputFormat === "human"));
|
|
8782
8869
|
if (isDryRun()) {
|
|
8783
8870
|
hint("Dry run: nothing was uploaded.");
|
|
8784
8871
|
return;
|
|
@@ -8987,7 +9074,7 @@ var COLUMN_LIST_HELP = "one argument each or comma-separated; a name that contai
|
|
|
8987
9074
|
var TARGETS_HELP = `Target column names: repeat the flag or separate them with commas; a name that contains a comma is one flag of its own, or goes in double quotes inside a list`;
|
|
8988
9075
|
function registerAnalyzeCommand(program) {
|
|
8989
9076
|
const analyze = program.command("analyze").description("Run and manage automatic analyses");
|
|
8990
|
-
analyze.command("run", { isDefault: true }).description("Create an analysis from a data file, configure it and run it (the default: `analyze <file>`)").argument("[files...]", "Data file to analyze (CSV, Excel and more than 45 file formats; see `table import-formats`). Several files are combined into one table: files with the same columns are stacked, a file that shares a key adds its columns").option("--name <name>", "Analysis name (asked for, or derived from the filename)").option("--description <text>", "Analysis description").option("--visibility <vis>", "PRIVATE or PUBLIC (default: PRIVATE)").option("--hours <hours>", `Time budget (hours). ${STARTING_DEPTH_RULE}`).option("--budget <credits>", `Credit budget. ${STARTING_DEPTH_RULE}`).option("--targets <columns>", `${TARGETS_HELP} (required when not interactive)`, collectColumns).option("--question <text>", "A question for the analysis to answer; repeat the flag for several", collectQuestion).option("--segment <name>", "Column to segment the analysis by").option("--introduction <markdown>", "Markdown introduction shown at the top of the notebook").option("--preset <id>", "Apply a saved preset as defaults (explicit flags override it)").option("--no-file-column", "With several files: do not add the column that records the file each row came from").option("--keep-duplicates", "With several files: keep rows that occur in more than one file").option("--rows-of <file>", "With several files that can be read two ways: the file in which one row is one observation").action(async (files, options, cmd) => {
|
|
9077
|
+
analyze.command("run", { isDefault: true }).description("Create an analysis from a data file, configure it and run it (the default: `analyze <file>`)").argument("[files...]", "Data file to analyze (CSV, Excel and more than 45 file formats; see `table import-formats`). Several files are combined into one table: files with the same columns are stacked, a file that shares a key adds its columns").option("--name <name>", "Analysis name (asked for, or derived from the filename)").option("--description <text>", "Analysis description").option("--visibility <vis>", "PRIVATE or PUBLIC (default: PRIVATE)").option("--hours <hours>", `Time budget (hours). ${STARTING_DEPTH_RULE}`).option("--budget <credits>", `Credit budget. ${STARTING_DEPTH_RULE}`).option("--targets <columns>", `${TARGETS_HELP} (required when not interactive)`, collectColumns).option("--question <text>", "A question for the analysis to answer; repeat the flag for several", collectQuestion).option("--segment <name>", "Column to segment the analysis by").option("--introduction <markdown>", "Markdown introduction shown at the top of the notebook").option("--preset <id>", "Apply a saved preset as defaults (explicit flags override it)").option("--no-file-column", "With several files: do not add the column that records the file each row came from").option("--keep-duplicates", "With several files: keep rows that occur in more than one file").option("--rows-of <file>", "With several files that can be read two ways: the file in which one row is one observation").option("--as-uploaded [file]", AS_UPLOADED_HELP, collectAsUploaded).action(async (files, options, cmd) => {
|
|
8991
9078
|
try {
|
|
8992
9079
|
if (files.length === 0) {
|
|
8993
9080
|
analyze.help();
|
|
@@ -9195,7 +9282,7 @@ function registerAnalyzeCommand(program) {
|
|
|
9195
9282
|
handleError(error);
|
|
9196
9283
|
}
|
|
9197
9284
|
});
|
|
9198
|
-
analyze.command("upload").description("Replace the analysis data with a new file (any supported format; see `table import-formats`). An import that takes long is followed until it has finished").argument("<id>", "Analysis ID").argument("[files...]", "Data file to upload (CSV, Excel and more than 45 file formats; see `table import-formats`). Several files are combined into one table: files with the same columns are stacked, a file that shares a key adds its columns").option("--url <url>", "HTTPS URL to fetch the data file from, instead of a file path").option("--no-file-column", "With several files: do not add the column that records the file each row came from").option("--keep-duplicates", "With several files: keep rows that occur in more than one file").option("--rows-of <file>", "With several files that can be read two ways: the file in which one row is one observation").option("--plan-only", "With several files: store them and print how they fit together, without building the table").action(async (id, files, options, cmd) => {
|
|
9285
|
+
analyze.command("upload").description("Replace the analysis data with a new file (any supported format; see `table import-formats`). An import that takes long is followed until it has finished").argument("<id>", "Analysis ID").argument("[files...]", "Data file to upload (CSV, Excel and more than 45 file formats; see `table import-formats`). Several files are combined into one table: files with the same columns are stacked, a file that shares a key adds its columns").option("--url <url>", "HTTPS URL to fetch the data file from, instead of a file path").option("--no-file-column", "With several files: do not add the column that records the file each row came from").option("--keep-duplicates", "With several files: keep rows that occur in more than one file").option("--rows-of <file>", "With several files that can be read two ways: the file in which one row is one observation").option("--as-uploaded [file]", AS_UPLOADED_HELP, collectAsUploaded).option("--plan-only", "With several files: store them and print how they fit together, without building the table").action(async (id, files, options, cmd) => {
|
|
9199
9286
|
try {
|
|
9200
9287
|
await uploadData(id, files, options, cmd);
|
|
9201
9288
|
} catch (error) {
|
|
@@ -10706,7 +10793,7 @@ function registerShellCommand(program) {
|
|
|
10706
10793
|
});
|
|
10707
10794
|
const api = createApiClient();
|
|
10708
10795
|
const { input: promptInput } = await import("@inquirer/prompts");
|
|
10709
|
-
const { getUpdateNotice } = await import("./update-check-
|
|
10796
|
+
const { getUpdateNotice } = await import("./update-check-RWCYYDVC.js");
|
|
10710
10797
|
const resolvedLanguage = await resolveLanguage(api, fnRef.projectId, options.language);
|
|
10711
10798
|
console.log(chalk32.bold("Diafunc shell") + chalk32.dim(` \xB7 function ${fnRef.entityId} \xB7 ${resolvedLanguage}`));
|
|
10712
10799
|
console.log(chalk32.dim(`Endpoint: ${config.profiles[config.currentProfile]?.endpoint}`));
|
|
@@ -11756,4 +11843,4 @@ export {
|
|
|
11756
11843
|
PromptCancelled,
|
|
11757
11844
|
createProgram
|
|
11758
11845
|
};
|
|
11759
|
-
//# sourceMappingURL=chunk-
|
|
11846
|
+
//# sourceMappingURL=chunk-LEDCBZ3S.js.map
|