dataiku-sdk 0.10.1 → 0.11.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/packages/types/src/index.d.ts +15 -2
- package/dist/packages/types/src/index.js +9 -1
- package/dist/src/cli/coerce.d.ts +36 -0
- package/dist/src/cli/coerce.js +239 -0
- package/dist/src/cli/commands/api-deployer.d.ts +2 -0
- package/dist/src/cli/commands/api-deployer.js +170 -0
- package/dist/src/cli/commands/api-service.d.ts +2 -0
- package/dist/src/cli/commands/api-service.js +102 -0
- package/dist/src/cli/commands/app.d.ts +2 -0
- package/dist/src/cli/commands/app.js +78 -0
- package/dist/src/cli/commands/bundle.d.ts +2 -0
- package/dist/src/cli/commands/bundle.js +107 -0
- package/dist/src/cli/commands/business-app.d.ts +2 -0
- package/dist/src/cli/commands/business-app.js +76 -0
- package/dist/src/cli/commands/code-env.d.ts +2 -0
- package/dist/src/cli/commands/code-env.js +255 -0
- package/dist/src/cli/commands/code.d.ts +2 -0
- package/dist/src/cli/commands/code.js +63 -0
- package/dist/src/cli/commands/connection.d.ts +2 -0
- package/dist/src/cli/commands/connection.js +54 -0
- package/dist/src/cli/commands/continuous-activity.d.ts +2 -0
- package/dist/src/cli/commands/continuous-activity.js +38 -0
- package/dist/src/cli/commands/dashboard.d.ts +2 -0
- package/dist/src/cli/commands/dashboard.js +99 -0
- package/dist/src/cli/commands/data-quality.d.ts +2 -0
- package/dist/src/cli/commands/data-quality.js +235 -0
- package/dist/src/cli/commands/dataset.d.ts +2 -0
- package/dist/src/cli/commands/dataset.js +288 -0
- package/dist/src/cli/commands/discussion.d.ts +2 -0
- package/dist/src/cli/commands/discussion.js +47 -0
- package/dist/src/cli/commands/doctor.d.ts +2 -0
- package/dist/src/cli/commands/doctor.js +9 -0
- package/dist/src/cli/commands/flow-zone.d.ts +2 -0
- package/dist/src/cli/commands/flow-zone.js +282 -0
- package/dist/src/cli/commands/folder.d.ts +2 -0
- package/dist/src/cli/commands/folder.js +202 -0
- package/dist/src/cli/commands/future.d.ts +2 -0
- package/dist/src/cli/commands/future.js +57 -0
- package/dist/src/cli/commands/index.d.ts +2 -0
- package/dist/src/cli/commands/index.js +70 -0
- package/dist/src/cli/commands/insight.d.ts +2 -0
- package/dist/src/cli/commands/insight.js +156 -0
- package/dist/src/cli/commands/job.d.ts +2 -0
- package/dist/src/cli/commands/job.js +406 -0
- package/dist/src/cli/commands/meaning.d.ts +2 -0
- package/dist/src/cli/commands/meaning.js +115 -0
- package/dist/src/cli/commands/metrics.d.ts +2 -0
- package/dist/src/cli/commands/metrics.js +39 -0
- package/dist/src/cli/commands/notebook.d.ts +2 -0
- package/dist/src/cli/commands/notebook.js +242 -0
- package/dist/src/cli/commands/project-deployer.d.ts +2 -0
- package/dist/src/cli/commands/project-deployer.js +118 -0
- package/dist/src/cli/commands/project-library.d.ts +2 -0
- package/dist/src/cli/commands/project-library.js +197 -0
- package/dist/src/cli/commands/project.d.ts +2 -0
- package/dist/src/cli/commands/project.js +132 -0
- package/dist/src/cli/commands/recipe.d.ts +2 -0
- package/dist/src/cli/commands/recipe.js +632 -0
- package/dist/src/cli/commands/scenario.d.ts +2 -0
- package/dist/src/cli/commands/scenario.js +190 -0
- package/dist/src/cli/commands/sql.d.ts +2 -0
- package/dist/src/cli/commands/sql.js +109 -0
- package/dist/src/cli/commands/statistics.d.ts +2 -0
- package/dist/src/cli/commands/statistics.js +165 -0
- package/dist/src/cli/commands/streaming-endpoint.d.ts +2 -0
- package/dist/src/cli/commands/streaming-endpoint.js +50 -0
- package/dist/src/cli/commands/variable.d.ts +2 -0
- package/dist/src/cli/commands/variable.js +49 -0
- package/dist/src/cli/commands/webapp.d.ts +2 -0
- package/dist/src/cli/commands/webapp.js +67 -0
- package/dist/src/cli/commands/wiki.d.ts +2 -0
- package/dist/src/cli/commands/wiki.js +123 -0
- package/dist/src/cli/commands/workspace.d.ts +2 -0
- package/dist/src/cli/commands/workspace.js +68 -0
- package/dist/src/cli/contract.d.ts +104 -0
- package/dist/src/cli/contract.js +2031 -0
- package/dist/src/cli/doctor.d.ts +104 -0
- package/dist/src/cli/doctor.js +356 -0
- package/dist/src/cli/env.d.ts +2 -0
- package/dist/src/cli/env.js +37 -0
- package/dist/src/cli/flags.d.ts +16 -0
- package/dist/src/cli/flags.js +255 -0
- package/dist/src/cli/helpers/cleanup.d.ts +3 -0
- package/dist/src/cli/helpers/cleanup.js +158 -0
- package/dist/src/cli/helpers/dataset.d.ts +2 -0
- package/dist/src/cli/helpers/dataset.js +17 -0
- package/dist/src/cli/helpers/flow-zone.d.ts +69 -0
- package/dist/src/cli/helpers/flow-zone.js +420 -0
- package/dist/src/cli/helpers/recipe.d.ts +11 -0
- package/dist/src/cli/helpers/recipe.js +83 -0
- package/dist/src/cli/output.d.ts +38 -0
- package/dist/src/cli/output.js +159 -0
- package/dist/src/cli/runtime.d.ts +15 -0
- package/dist/src/cli/runtime.js +59 -0
- package/dist/src/cli/types.d.ts +25 -0
- package/dist/src/cli/types.js +1 -0
- package/dist/src/cli/usage.d.ts +16 -0
- package/dist/src/cli/usage.js +80 -0
- package/dist/src/cli/version.d.ts +14 -0
- package/dist/src/cli/version.js +63 -0
- package/dist/src/cli.js +671 -8254
- package/dist/src/client.d.ts +1 -1
- package/dist/src/client.js +14 -13
- package/dist/src/errors.d.ts +6 -0
- package/dist/src/errors.js +102 -4
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.js +2 -2
- package/dist/src/resources/applications.d.ts +1 -1
- package/dist/src/resources/applications.js +27 -1
- package/dist/src/resources/continuous-activities.js +1 -0
- package/dist/src/resources/data-quality.js +5 -3
- package/dist/src/resources/datasets.d.ts +3 -0
- package/dist/src/resources/datasets.js +3 -0
- package/dist/src/resources/flow-zones.d.ts +2 -2
- package/dist/src/resources/flow-zones.js +4 -1
- package/dist/src/resources/meanings.d.ts +2 -0
- package/dist/src/resources/meanings.js +4 -0
- package/dist/src/resources/notebooks.d.ts +5 -7
- package/dist/src/resources/notebooks.js +10 -7
- package/dist/src/resources/projects.d.ts +1 -1
- package/dist/src/resources/projects.js +2 -2
- package/dist/src/resources/recipes.d.ts +3 -3
- package/dist/src/resources/recipes.js +50 -7
- package/dist/src/resources/scenarios.js +67 -26
- package/dist/src/resources/statistics.js +9 -0
- package/dist/src/schemas.d.ts +2 -2
- package/dist/src/schemas.js +1 -1
- package/dist/src/skill.js +2 -2
- package/dist/src/utils/sanitize.js +2 -1
- package/package.json +1 -1
- package/packages/types/dist/index.d.ts +15 -2
- package/packages/types/dist/index.js +9 -1
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { unsupportedHelpFlag, UsageError, } from "./usage.js";
|
|
2
|
+
export const BOOLEAN_FLAGS = new Set([
|
|
3
|
+
"verbose",
|
|
4
|
+
"version",
|
|
5
|
+
"stdin",
|
|
6
|
+
"insecure",
|
|
7
|
+
"global",
|
|
8
|
+
"list-agents",
|
|
9
|
+
"include-raw",
|
|
10
|
+
"raw",
|
|
11
|
+
"include-payload",
|
|
12
|
+
"no-payload",
|
|
13
|
+
"include-logs",
|
|
14
|
+
"summary",
|
|
15
|
+
"replace",
|
|
16
|
+
"dry-run",
|
|
17
|
+
"plan",
|
|
18
|
+
"apply",
|
|
19
|
+
"capabilities",
|
|
20
|
+
"fast",
|
|
21
|
+
"include-all-partitions",
|
|
22
|
+
"wait",
|
|
23
|
+
"if-not-exists",
|
|
24
|
+
"if-exists",
|
|
25
|
+
"json",
|
|
26
|
+
"no-wait",
|
|
27
|
+
"force-rebuild",
|
|
28
|
+
"latest",
|
|
29
|
+
"copy-output-settings",
|
|
30
|
+
"continue-on-error",
|
|
31
|
+
"no-backup",
|
|
32
|
+
"payload-only",
|
|
33
|
+
"allow-same-path",
|
|
34
|
+
"sync",
|
|
35
|
+
"validate-objects",
|
|
36
|
+
"errors-only",
|
|
37
|
+
"keep",
|
|
38
|
+
"full-log",
|
|
39
|
+
"drop-data",
|
|
40
|
+
]);
|
|
41
|
+
export const SHORT_FLAGS = {
|
|
42
|
+
v: "verbose",
|
|
43
|
+
V: "version",
|
|
44
|
+
o: "output",
|
|
45
|
+
};
|
|
46
|
+
/** Long-flag aliases: these are normalized to the canonical name in parseArgs. */
|
|
47
|
+
export const FLAG_ALIASES = {
|
|
48
|
+
project: "project-key",
|
|
49
|
+
dryrun: "dry-run",
|
|
50
|
+
"skip-tls-verify": "insecure",
|
|
51
|
+
"extra-ca-certs": "ca-cert",
|
|
52
|
+
explain: "plan",
|
|
53
|
+
"zone-name": "zone",
|
|
54
|
+
rows: "max-rows",
|
|
55
|
+
};
|
|
56
|
+
export const VALUE_FLAGS = new Set([
|
|
57
|
+
"fields",
|
|
58
|
+
"owner",
|
|
59
|
+
"topic",
|
|
60
|
+
"reply",
|
|
61
|
+
"text",
|
|
62
|
+
"partitions",
|
|
63
|
+
"since",
|
|
64
|
+
"activity",
|
|
65
|
+
"agent",
|
|
66
|
+
"api-key",
|
|
67
|
+
"build-mode",
|
|
68
|
+
"backup-dir",
|
|
69
|
+
"backup",
|
|
70
|
+
"ca-cert",
|
|
71
|
+
"catalog",
|
|
72
|
+
"cell-id",
|
|
73
|
+
"allow-types",
|
|
74
|
+
"color",
|
|
75
|
+
"connection",
|
|
76
|
+
"contains",
|
|
77
|
+
"content",
|
|
78
|
+
"content-type",
|
|
79
|
+
"data",
|
|
80
|
+
"active",
|
|
81
|
+
"deployment-mode",
|
|
82
|
+
"env-version",
|
|
83
|
+
"data-file",
|
|
84
|
+
"database",
|
|
85
|
+
"dataset",
|
|
86
|
+
"file",
|
|
87
|
+
"env",
|
|
88
|
+
"install-core-packages",
|
|
89
|
+
"folder",
|
|
90
|
+
"input",
|
|
91
|
+
"from",
|
|
92
|
+
"knowledge-bank",
|
|
93
|
+
"labeling-task",
|
|
94
|
+
"lang",
|
|
95
|
+
"package",
|
|
96
|
+
"packages",
|
|
97
|
+
"local",
|
|
98
|
+
"max-edges",
|
|
99
|
+
"max-lines",
|
|
100
|
+
"max-log-lines",
|
|
101
|
+
"max-log-bytes",
|
|
102
|
+
"listed",
|
|
103
|
+
"max-nodes",
|
|
104
|
+
"max-rows",
|
|
105
|
+
"limit",
|
|
106
|
+
"max-timestamp",
|
|
107
|
+
"only-monitored",
|
|
108
|
+
"min-timestamp",
|
|
109
|
+
"mode",
|
|
110
|
+
"log-filter",
|
|
111
|
+
"log-id",
|
|
112
|
+
"model-evaluation-store",
|
|
113
|
+
"name",
|
|
114
|
+
"object",
|
|
115
|
+
"metastore-table",
|
|
116
|
+
"output",
|
|
117
|
+
"output-file",
|
|
118
|
+
"output-connection",
|
|
119
|
+
"output-folder",
|
|
120
|
+
"page",
|
|
121
|
+
"partition",
|
|
122
|
+
"parent",
|
|
123
|
+
"path",
|
|
124
|
+
"preview",
|
|
125
|
+
"project-key",
|
|
126
|
+
"recipe",
|
|
127
|
+
"request-timeout",
|
|
128
|
+
"params",
|
|
129
|
+
"results-per-page",
|
|
130
|
+
"record-cleanup",
|
|
131
|
+
"rule-id",
|
|
132
|
+
"role",
|
|
133
|
+
"retries",
|
|
134
|
+
"poll-interval",
|
|
135
|
+
"python-interpreter",
|
|
136
|
+
"replace-input",
|
|
137
|
+
"replace-output",
|
|
138
|
+
"replace-payload-text",
|
|
139
|
+
"retain",
|
|
140
|
+
"saved-model",
|
|
141
|
+
"sql",
|
|
142
|
+
"schema",
|
|
143
|
+
"sql-file",
|
|
144
|
+
"standard",
|
|
145
|
+
"state",
|
|
146
|
+
"streaming-endpoint",
|
|
147
|
+
"target",
|
|
148
|
+
"target-type",
|
|
149
|
+
"timeout",
|
|
150
|
+
"table",
|
|
151
|
+
"type",
|
|
152
|
+
"url",
|
|
153
|
+
"until",
|
|
154
|
+
"to",
|
|
155
|
+
"zone",
|
|
156
|
+
"zone-id",
|
|
157
|
+
]);
|
|
158
|
+
export const REPEATABLE_VALUE_FLAGS = new Set([
|
|
159
|
+
"dataset",
|
|
160
|
+
"folder",
|
|
161
|
+
"input",
|
|
162
|
+
"object",
|
|
163
|
+
"package",
|
|
164
|
+
"recipe",
|
|
165
|
+
"replace-input",
|
|
166
|
+
"replace-output",
|
|
167
|
+
"replace-payload-text",
|
|
168
|
+
]);
|
|
169
|
+
export const KNOWN_LONG_FLAGS = new Set([
|
|
170
|
+
...BOOLEAN_FLAGS,
|
|
171
|
+
...VALUE_FLAGS,
|
|
172
|
+
...Object.keys(FLAG_ALIASES),
|
|
173
|
+
...Object.values(FLAG_ALIASES),
|
|
174
|
+
]);
|
|
175
|
+
export function normalizeLongFlag(rawFlagName) {
|
|
176
|
+
if (rawFlagName === "help")
|
|
177
|
+
throw unsupportedHelpFlag();
|
|
178
|
+
const flagName = FLAG_ALIASES[rawFlagName] ?? rawFlagName;
|
|
179
|
+
if (!KNOWN_LONG_FLAGS.has(rawFlagName) && !KNOWN_LONG_FLAGS.has(flagName)) {
|
|
180
|
+
throw new UsageError(`Unknown flag: --${rawFlagName}`, "unknown_flag");
|
|
181
|
+
}
|
|
182
|
+
return flagName;
|
|
183
|
+
}
|
|
184
|
+
export function isNegativeNumberToken(value) {
|
|
185
|
+
return value.startsWith("-") && Number.isFinite(Number(value));
|
|
186
|
+
}
|
|
187
|
+
export function requireFlagValue(flagLabel, next) {
|
|
188
|
+
if (next === undefined || (next !== "-" && next.startsWith("-") && !isNegativeNumberToken(next))) {
|
|
189
|
+
throw new UsageError(`Flag ${flagLabel} requires a value.`, "missing_required_flag");
|
|
190
|
+
}
|
|
191
|
+
return next;
|
|
192
|
+
}
|
|
193
|
+
export function setParsedFlagValue(flags, flagName, value) {
|
|
194
|
+
const current = flags[flagName];
|
|
195
|
+
if (REPEATABLE_VALUE_FLAGS.has(flagName) && typeof current === "string" && current.length > 0) {
|
|
196
|
+
flags[flagName] = `${current},${value}`;
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
flags[flagName] = value;
|
|
200
|
+
}
|
|
201
|
+
export function parseArgs(argv) {
|
|
202
|
+
const positional = [];
|
|
203
|
+
const flags = {};
|
|
204
|
+
let i = 0;
|
|
205
|
+
while (i < argv.length) {
|
|
206
|
+
const arg = argv[i];
|
|
207
|
+
if (arg === "--") {
|
|
208
|
+
positional.push(...argv.slice(i + 1));
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
if (arg.startsWith("--")) {
|
|
212
|
+
const eqIdx = arg.indexOf("=");
|
|
213
|
+
if (eqIdx !== -1) {
|
|
214
|
+
const raw = arg.slice(2, eqIdx);
|
|
215
|
+
const flagName = normalizeLongFlag(raw);
|
|
216
|
+
setParsedFlagValue(flags, flagName, arg.slice(eqIdx + 1));
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
const rawFlagName = arg.slice(2);
|
|
220
|
+
const flagName = normalizeLongFlag(rawFlagName);
|
|
221
|
+
if (BOOLEAN_FLAGS.has(flagName)) {
|
|
222
|
+
flags[flagName] = true;
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
const next = requireFlagValue(`--${rawFlagName}`, argv[i + 1]);
|
|
226
|
+
setParsedFlagValue(flags, flagName, next);
|
|
227
|
+
i++;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
else if (arg.length === 2 && arg[0] === "-" && arg[1] !== "-") {
|
|
232
|
+
const long = SHORT_FLAGS[arg[1]];
|
|
233
|
+
if (long) {
|
|
234
|
+
if (BOOLEAN_FLAGS.has(long)) {
|
|
235
|
+
flags[long] = true;
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
const next = requireFlagValue(`-${arg[1]}`, argv[i + 1]);
|
|
239
|
+
setParsedFlagValue(flags, long, next);
|
|
240
|
+
i++;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
if (arg[1] === "h")
|
|
245
|
+
throw unsupportedHelpFlag();
|
|
246
|
+
throw new UsageError(`Unknown flag: -${arg[1]}`, "unknown_flag");
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
positional.push(arg);
|
|
251
|
+
}
|
|
252
|
+
i++;
|
|
253
|
+
}
|
|
254
|
+
return { positional, flags, };
|
|
255
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CleanupLedgerEntry } from "../../utils/cleanup-ledger.js";
|
|
2
|
+
export declare function projectArg(projectKey: string | undefined): string[];
|
|
3
|
+
export declare function cleanupLedgerEntry(resource: string, action: string, args: string[], flags: Record<string, string | boolean>, result: unknown, projectKey: string | undefined): CleanupLedgerEntry | undefined;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { resultRecord, stringField, } from "../coerce.js";
|
|
2
|
+
export function projectArg(projectKey) {
|
|
3
|
+
return projectKey ? ["--project-key", projectKey,] : [];
|
|
4
|
+
}
|
|
5
|
+
export function cleanupLedgerEntry(resource, action, args, flags, result, projectKey) {
|
|
6
|
+
if (!(action.startsWith("create") || action === "clone" || action === "upload"))
|
|
7
|
+
return undefined;
|
|
8
|
+
const record = resultRecord(result);
|
|
9
|
+
if (record.skipped !== undefined)
|
|
10
|
+
return undefined;
|
|
11
|
+
const project = flags["project-key"] ?? projectKey;
|
|
12
|
+
const withProject = projectArg(project);
|
|
13
|
+
const ts = new Date().toISOString();
|
|
14
|
+
const base = { ts, action, resource, ...(project ? { projectKey: project, } : {}), };
|
|
15
|
+
switch (`${resource}.${action}`) {
|
|
16
|
+
case "dataset.create": {
|
|
17
|
+
const name = stringField(record, ["created", "name",]) ?? flags["name"];
|
|
18
|
+
if (!name)
|
|
19
|
+
return undefined;
|
|
20
|
+
return {
|
|
21
|
+
...base,
|
|
22
|
+
name,
|
|
23
|
+
cleanup: { argv: ["dataset", "delete", name, "--if-exists", ...withProject,], },
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
case "dataset.clone": {
|
|
27
|
+
const name = stringField(record, ["target", "created", "name",]) ?? args[1];
|
|
28
|
+
if (!name)
|
|
29
|
+
return undefined;
|
|
30
|
+
return {
|
|
31
|
+
...base,
|
|
32
|
+
name,
|
|
33
|
+
cleanup: { argv: ["dataset", "delete", name, "--if-exists", ...withProject,], },
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
case "recipe.create": {
|
|
37
|
+
const name = stringField(record, ["created", "recipeName", "name",])
|
|
38
|
+
?? flags["name"];
|
|
39
|
+
if (!name)
|
|
40
|
+
return undefined;
|
|
41
|
+
return {
|
|
42
|
+
...base,
|
|
43
|
+
name,
|
|
44
|
+
cleanup: { argv: ["recipe", "delete", name, "--if-exists", ...withProject,], },
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
case "recipe.clone": {
|
|
48
|
+
const name = stringField(record, ["recipeName", "target", "created", "name",])
|
|
49
|
+
?? flags["name"];
|
|
50
|
+
if (!name)
|
|
51
|
+
return undefined;
|
|
52
|
+
return {
|
|
53
|
+
...base,
|
|
54
|
+
name,
|
|
55
|
+
cleanup: { argv: ["recipe", "delete", name, "--if-exists", ...withProject,], },
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
case "scenario.create": {
|
|
59
|
+
const id = args[0];
|
|
60
|
+
return {
|
|
61
|
+
...base,
|
|
62
|
+
id,
|
|
63
|
+
name: args[1],
|
|
64
|
+
cleanup: { argv: ["scenario", "delete", id, "--if-exists", ...withProject,], },
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
case "flow-zone.create": {
|
|
68
|
+
const id = stringField(record, ["created", "id",]);
|
|
69
|
+
if (!id)
|
|
70
|
+
return undefined;
|
|
71
|
+
return {
|
|
72
|
+
...base,
|
|
73
|
+
id,
|
|
74
|
+
name: flags["name"],
|
|
75
|
+
cleanup: { argv: ["flow-zone", "delete", id, "--if-exists", ...withProject,], },
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
case "folder.create": {
|
|
79
|
+
const id = stringField(record, ["created", "id",]) ?? flags["name"];
|
|
80
|
+
if (!id)
|
|
81
|
+
return undefined;
|
|
82
|
+
return {
|
|
83
|
+
...base,
|
|
84
|
+
id,
|
|
85
|
+
name: flags["name"],
|
|
86
|
+
cleanup: { argv: ["folder", "delete", id, "--if-exists", ...withProject,], },
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
case "wiki.create": {
|
|
90
|
+
const article = record.article && typeof record.article === "object" && !Array.isArray(record.article)
|
|
91
|
+
? record.article
|
|
92
|
+
: {};
|
|
93
|
+
const id = stringField(record, ["created",]) ?? stringField(article, ["id",]);
|
|
94
|
+
if (!id)
|
|
95
|
+
return undefined;
|
|
96
|
+
return {
|
|
97
|
+
...base,
|
|
98
|
+
id,
|
|
99
|
+
name: flags["name"],
|
|
100
|
+
cleanup: { argv: ["wiki", "delete", id, "--if-exists", ...withProject,], },
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
case "dashboard.create": {
|
|
104
|
+
const id = stringField(record, ["created", "id",]);
|
|
105
|
+
if (!id)
|
|
106
|
+
return undefined;
|
|
107
|
+
return {
|
|
108
|
+
...base,
|
|
109
|
+
id,
|
|
110
|
+
name: flags["name"],
|
|
111
|
+
cleanup: { argv: ["dashboard", "delete", id, "--if-exists", ...withProject,], },
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
case "insight.create": {
|
|
115
|
+
const id = stringField(record, ["created", "id",]);
|
|
116
|
+
if (!id)
|
|
117
|
+
return undefined;
|
|
118
|
+
return {
|
|
119
|
+
...base,
|
|
120
|
+
id,
|
|
121
|
+
name: flags["name"],
|
|
122
|
+
cleanup: { argv: ["insight", "delete", id, "--if-exists", ...withProject,], },
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
case "data-quality.create-rule": {
|
|
126
|
+
const ruleId = stringField(record, ["id", "created",]);
|
|
127
|
+
if (!ruleId)
|
|
128
|
+
return undefined;
|
|
129
|
+
return {
|
|
130
|
+
...base,
|
|
131
|
+
id: ruleId,
|
|
132
|
+
name: args[0],
|
|
133
|
+
cleanup: {
|
|
134
|
+
argv: ["data-quality", "delete-rule", args[0], ruleId, "--if-exists", ...withProject,],
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
case "code-env.create": {
|
|
139
|
+
const lang = args[0];
|
|
140
|
+
const name = args[1];
|
|
141
|
+
return {
|
|
142
|
+
...base,
|
|
143
|
+
id: `${lang}:${name}`,
|
|
144
|
+
name,
|
|
145
|
+
cleanup: { argv: ["code-env", "delete", lang, name, "--if-exists",], },
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
case "folder.upload":
|
|
149
|
+
return {
|
|
150
|
+
...base,
|
|
151
|
+
name: args[0],
|
|
152
|
+
path: args[1],
|
|
153
|
+
cleanup: { argv: ["folder", "delete-file", args[0], args[1], ...withProject,], },
|
|
154
|
+
};
|
|
155
|
+
default:
|
|
156
|
+
return undefined;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function datasetSourceSummary(details) {
|
|
2
|
+
const params = details.params ?? {};
|
|
3
|
+
return {
|
|
4
|
+
resource: "dataset",
|
|
5
|
+
name: details.name,
|
|
6
|
+
projectKey: details.projectKey,
|
|
7
|
+
type: details.type,
|
|
8
|
+
managed: details.managed,
|
|
9
|
+
connection: params.connection,
|
|
10
|
+
catalog: params.catalog,
|
|
11
|
+
schema: params.schema,
|
|
12
|
+
table: params.table,
|
|
13
|
+
path: params.path,
|
|
14
|
+
folderSmartId: params.folderSmartId,
|
|
15
|
+
formatType: details.formatType,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { DataikuClient } from "../../client.js";
|
|
2
|
+
import type { FlowZoneItemInput } from "../../resources/flow-zones.js";
|
|
3
|
+
import type { FlowZone, FlowZoneObjectType, FlowZonePosition } from "../../schemas.js";
|
|
4
|
+
export declare function flowZoneId(value: string): string;
|
|
5
|
+
export declare function flowZoneName(value: string | boolean | undefined): string;
|
|
6
|
+
export declare function flowZoneColor(value: string | boolean | undefined): string | undefined;
|
|
7
|
+
export declare function flowZoneObjectType(value: string): FlowZoneObjectType;
|
|
8
|
+
export declare function addFlowZoneFlagItems(items: FlowZoneItemInput[], flags: Record<string, string | boolean>, flagName: string, objectType: FlowZoneObjectType): void;
|
|
9
|
+
export declare function parseFlowZoneObject(value: string): FlowZoneItemInput;
|
|
10
|
+
export declare function flowZoneMoveItems(flags: Record<string, string | boolean>): FlowZoneItemInput[];
|
|
11
|
+
export declare function flowZoneItems(zone: FlowZone): FlowZoneItemInput[];
|
|
12
|
+
export declare function flowZoneContains(zone: FlowZone, object: FlowZoneItemInput): boolean;
|
|
13
|
+
export declare function flowZoneSummary(zone: FlowZone, object?: FlowZoneItemInput): Record<string, unknown>;
|
|
14
|
+
export declare function flowZoneDetailSummary(zone: FlowZone): Record<string, unknown>;
|
|
15
|
+
export interface FlowZoneOrganizeZonePlan {
|
|
16
|
+
id?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
color?: string;
|
|
19
|
+
position?: FlowZonePosition;
|
|
20
|
+
items: FlowZoneItemInput[];
|
|
21
|
+
}
|
|
22
|
+
export interface FlowZoneOrganizePlan {
|
|
23
|
+
zones: FlowZoneOrganizeZonePlan[];
|
|
24
|
+
}
|
|
25
|
+
export interface FlowZoneOrganizeValidationIssue {
|
|
26
|
+
zone: string;
|
|
27
|
+
objectId: string;
|
|
28
|
+
objectType: FlowZoneObjectType;
|
|
29
|
+
projectKey?: string;
|
|
30
|
+
reason: string;
|
|
31
|
+
}
|
|
32
|
+
export interface FlowZoneOrganizeValidationResult {
|
|
33
|
+
valid: boolean;
|
|
34
|
+
missing: FlowZoneOrganizeValidationIssue[];
|
|
35
|
+
}
|
|
36
|
+
export interface FlowZoneOrganizeValidationIndex {
|
|
37
|
+
projectKey: string;
|
|
38
|
+
all: Set<string>;
|
|
39
|
+
datasets: Set<string>;
|
|
40
|
+
recipes: Set<string>;
|
|
41
|
+
folders: Set<string>;
|
|
42
|
+
}
|
|
43
|
+
export declare function flowZonePlanColor(value: unknown, source: string): string | undefined;
|
|
44
|
+
export declare function flowZonePlanPosition(value: unknown, source: string): FlowZonePosition | undefined;
|
|
45
|
+
export declare function flowZoneCurrentPosition(zone: FlowZone): FlowZonePosition | undefined;
|
|
46
|
+
export declare function flowZoneSamePosition(a: FlowZonePosition | undefined, b: FlowZonePosition | undefined): boolean;
|
|
47
|
+
export declare function parseFlowZonePlanItem(value: unknown, source: string): FlowZoneItemInput;
|
|
48
|
+
export declare function addFlowZonePlanTypedItems(items: FlowZoneItemInput[], record: Record<string, unknown>, key: string, objectType: FlowZoneObjectType, source: string): void;
|
|
49
|
+
export declare function flowZoneItemKey(item: FlowZoneItemInput): string;
|
|
50
|
+
export declare function flowZonePlanLabel(plan: FlowZoneOrganizeZonePlan): string;
|
|
51
|
+
export declare function dedupeFlowZonePlanItems(items: FlowZoneItemInput[]): FlowZoneItemInput[];
|
|
52
|
+
export declare function flowZonePlanItemKeys(plan: FlowZoneOrganizePlan): Set<string>;
|
|
53
|
+
export declare function validateUniqueFlowZoneAssignments(plan: FlowZoneOrganizePlan): void;
|
|
54
|
+
export declare function parseFlowZoneOrganizePlan(input: Record<string, unknown>): FlowZoneOrganizePlan;
|
|
55
|
+
export declare function readFlowZoneOrganizePlan(flags: Record<string, string | boolean>, usage: string): FlowZoneOrganizePlan;
|
|
56
|
+
export declare function findFlowZoneForPlan(zones: FlowZone[], plan: FlowZoneOrganizeZonePlan): FlowZone | undefined;
|
|
57
|
+
export declare function ensureFlowZonePlanTarget(plan: FlowZoneOrganizeZonePlan, existing: FlowZone | undefined): void;
|
|
58
|
+
export declare function flowZoneExplicitItems(zone: FlowZone): FlowZoneItemInput[];
|
|
59
|
+
export declare function flowZonePruneItems(existing: FlowZone | undefined, plannedItemKeys: Set<string>): FlowZoneItemInput[];
|
|
60
|
+
export declare function flowZoneOrganizeStep(plan: FlowZoneOrganizeZonePlan, existing: FlowZone | undefined, sync: boolean, plannedItemKeys: Set<string>): Record<string, unknown>;
|
|
61
|
+
export declare function flowZoneValidationBucket(index: FlowZoneOrganizeValidationIndex, objectType: FlowZoneObjectType): Set<string>;
|
|
62
|
+
export declare function flowZoneValidationIndex(client: DataikuClient, projectKey: string | undefined): Promise<FlowZoneOrganizeValidationIndex>;
|
|
63
|
+
export declare function validateFlowZoneOrganizeObjects(client: DataikuClient, plan: FlowZoneOrganizePlan, projectKey: string | undefined): Promise<FlowZoneOrganizeValidationResult>;
|
|
64
|
+
export declare function throwFlowZoneValidationError(validation: FlowZoneOrganizeValidationResult): void;
|
|
65
|
+
export declare function resolveFlowZoneIdFromFlags(client: DataikuClient, flags: Record<string, string | boolean>, projectKey?: string): Promise<string | undefined>;
|
|
66
|
+
export declare function moveCreatedItemsToZone(client: DataikuClient, flags: Record<string, string | boolean>, items: FlowZoneItemInput[], projectKey?: string): Promise<{
|
|
67
|
+
zoneId?: string;
|
|
68
|
+
moved?: FlowZoneItemInput[];
|
|
69
|
+
}>;
|