windmill-cli 1.778.0 → 1.780.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/esm/main.js +428 -347
- package/package.json +1 -1
package/esm/main.js
CHANGED
|
@@ -16784,7 +16784,7 @@ var init_OpenAPI = __esm(() => {
|
|
|
16784
16784
|
PASSWORD: undefined,
|
|
16785
16785
|
TOKEN: getEnv3("WM_TOKEN"),
|
|
16786
16786
|
USERNAME: undefined,
|
|
16787
|
-
VERSION: "1.
|
|
16787
|
+
VERSION: "1.780.0",
|
|
16788
16788
|
WITH_CREDENTIALS: true,
|
|
16789
16789
|
interceptors: {
|
|
16790
16790
|
request: new Interceptors,
|
|
@@ -17098,6 +17098,7 @@ __export(exports_services_gen, {
|
|
|
17098
17098
|
updateDraft: () => updateDraft,
|
|
17099
17099
|
updateConfig: () => updateConfig,
|
|
17100
17100
|
updateAzureTrigger: () => updateAzureTrigger,
|
|
17101
|
+
updateAppRawSource: () => updateAppRawSource,
|
|
17101
17102
|
updateAppRaw: () => updateAppRaw,
|
|
17102
17103
|
updateAppHistory: () => updateAppHistory,
|
|
17103
17104
|
updateApp: () => updateApp,
|
|
@@ -17413,6 +17414,7 @@ __export(exports_services_gen, {
|
|
|
17413
17414
|
listAllTgoogleTopicSubscriptions: () => listAllTgoogleTopicSubscriptions,
|
|
17414
17415
|
listAllDedicatedWithDeps: () => listAllDedicatedWithDeps,
|
|
17415
17416
|
listAiSkills: () => listAiSkills,
|
|
17417
|
+
listAddableInstanceUsers: () => listAddableInstanceUsers,
|
|
17416
17418
|
leaveWorkspace: () => leaveWorkspace,
|
|
17417
17419
|
leaveInstance: () => leaveInstance,
|
|
17418
17420
|
isValidPostgresConfiguration: () => isValidPostgresConfiguration,
|
|
@@ -17808,6 +17810,7 @@ __export(exports_services_gen, {
|
|
|
17808
17810
|
createDatatableMigration: () => createDatatableMigration,
|
|
17809
17811
|
createCustomerPortalSession: () => createCustomerPortalSession,
|
|
17810
17812
|
createAzureTrigger: () => createAzureTrigger,
|
|
17813
|
+
createAppRawSource: () => createAppRawSource,
|
|
17811
17814
|
createAppRaw: () => createAppRaw,
|
|
17812
17815
|
createApp: () => createApp,
|
|
17813
17816
|
createAmqpTrigger: () => createAmqpTrigger,
|
|
@@ -19699,6 +19702,18 @@ var backendVersion = () => {
|
|
|
19699
19702
|
workspace: data3.workspace
|
|
19700
19703
|
}
|
|
19701
19704
|
});
|
|
19705
|
+
}, listAddableInstanceUsers = (data3) => {
|
|
19706
|
+
return request(OpenAPI, {
|
|
19707
|
+
method: "GET",
|
|
19708
|
+
url: "/w/{workspace}/users/list_addable",
|
|
19709
|
+
path: {
|
|
19710
|
+
workspace: data3.workspace
|
|
19711
|
+
},
|
|
19712
|
+
query: {
|
|
19713
|
+
search: data3.search,
|
|
19714
|
+
per_page: data3.perPage
|
|
19715
|
+
}
|
|
19716
|
+
});
|
|
19702
19717
|
}, listUsersUsage = (data3) => {
|
|
19703
19718
|
return request(OpenAPI, {
|
|
19704
19719
|
method: "GET",
|
|
@@ -21988,6 +22003,27 @@ var backendVersion = () => {
|
|
|
21988
22003
|
body: data3.requestBody,
|
|
21989
22004
|
mediaType: "application/json"
|
|
21990
22005
|
});
|
|
22006
|
+
}, createAppRawSource = (data3) => {
|
|
22007
|
+
return request(OpenAPI, {
|
|
22008
|
+
method: "POST",
|
|
22009
|
+
url: "/w/{workspace}/apps/create_raw_source",
|
|
22010
|
+
path: {
|
|
22011
|
+
workspace: data3.workspace
|
|
22012
|
+
},
|
|
22013
|
+
body: data3.requestBody,
|
|
22014
|
+
mediaType: "application/json"
|
|
22015
|
+
});
|
|
22016
|
+
}, updateAppRawSource = (data3) => {
|
|
22017
|
+
return request(OpenAPI, {
|
|
22018
|
+
method: "POST",
|
|
22019
|
+
url: "/w/{workspace}/apps/update_raw_source/{path}",
|
|
22020
|
+
path: {
|
|
22021
|
+
workspace: data3.workspace,
|
|
22022
|
+
path: data3.path
|
|
22023
|
+
},
|
|
22024
|
+
body: data3.requestBody,
|
|
22025
|
+
mediaType: "application/json"
|
|
22026
|
+
});
|
|
21991
22027
|
}, updateAppRaw = (data3) => {
|
|
21992
22028
|
return request(OpenAPI, {
|
|
21993
22029
|
method: "POST",
|
|
@@ -26440,6 +26476,7 @@ __export(exports_gen, {
|
|
|
26440
26476
|
updateDraft: () => updateDraft,
|
|
26441
26477
|
updateConfig: () => updateConfig,
|
|
26442
26478
|
updateAzureTrigger: () => updateAzureTrigger,
|
|
26479
|
+
updateAppRawSource: () => updateAppRawSource,
|
|
26443
26480
|
updateAppRaw: () => updateAppRaw,
|
|
26444
26481
|
updateAppHistory: () => updateAppHistory,
|
|
26445
26482
|
updateApp: () => updateApp,
|
|
@@ -26755,6 +26792,7 @@ __export(exports_gen, {
|
|
|
26755
26792
|
listAllTgoogleTopicSubscriptions: () => listAllTgoogleTopicSubscriptions,
|
|
26756
26793
|
listAllDedicatedWithDeps: () => listAllDedicatedWithDeps,
|
|
26757
26794
|
listAiSkills: () => listAiSkills,
|
|
26795
|
+
listAddableInstanceUsers: () => listAddableInstanceUsers,
|
|
26758
26796
|
leaveWorkspace: () => leaveWorkspace,
|
|
26759
26797
|
leaveInstance: () => leaveInstance,
|
|
26760
26798
|
isValidPostgresConfiguration: () => isValidPostgresConfiguration,
|
|
@@ -27150,6 +27188,7 @@ __export(exports_gen, {
|
|
|
27150
27188
|
createDatatableMigration: () => createDatatableMigration,
|
|
27151
27189
|
createCustomerPortalSession: () => createCustomerPortalSession,
|
|
27152
27190
|
createAzureTrigger: () => createAzureTrigger,
|
|
27191
|
+
createAppRawSource: () => createAppRawSource,
|
|
27153
27192
|
createAppRaw: () => createAppRaw,
|
|
27154
27193
|
createApp: () => createApp,
|
|
27155
27194
|
createAmqpTrigger: () => createAmqpTrigger,
|
|
@@ -27333,7 +27372,7 @@ var init_auth = __esm(async () => {
|
|
|
27333
27372
|
});
|
|
27334
27373
|
|
|
27335
27374
|
// src/core/constants.ts
|
|
27336
|
-
var WM_FORK_PREFIX = "wm-fork", VERSION = "1.
|
|
27375
|
+
var WM_FORK_PREFIX = "wm-fork", VERSION = "1.780.0";
|
|
27337
27376
|
|
|
27338
27377
|
// src/utils/git.ts
|
|
27339
27378
|
var exports_git = {};
|
|
@@ -61550,7 +61589,7 @@ var init_openflow = __esm(() => {
|
|
|
61550
61589
|
openflow_default = {
|
|
61551
61590
|
openapi: "3.0.3",
|
|
61552
61591
|
info: {
|
|
61553
|
-
version: "1.
|
|
61592
|
+
version: "1.780.0",
|
|
61554
61593
|
title: "OpenFlow Spec",
|
|
61555
61594
|
contact: {
|
|
61556
61595
|
name: "Ruben Fiszel",
|
|
@@ -76572,9 +76611,47 @@ var init_lint2 = __esm(async () => {
|
|
|
76572
76611
|
lint_default2 = command11;
|
|
76573
76612
|
});
|
|
76574
76613
|
|
|
76614
|
+
// src/commands/app/bundle_command.ts
|
|
76615
|
+
import * as fs15 from "node:fs";
|
|
76616
|
+
import * as path19 from "node:path";
|
|
76617
|
+
import process19 from "node:process";
|
|
76618
|
+
function entryPointFor(appDir) {
|
|
76619
|
+
const frameworks = detectFrameworks(appDir);
|
|
76620
|
+
const candidates = frameworks.svelte || frameworks.vue ? ["index.ts", "index.tsx", "index.js"] : ["index.tsx", "index.ts", "index.js"];
|
|
76621
|
+
const entry = candidates.find((c) => fs15.existsSync(path19.join(appDir, c)));
|
|
76622
|
+
if (!entry) {
|
|
76623
|
+
throw new Error(`No entry point in ${appDir}: expected one of ${candidates.join(", ")}`);
|
|
76624
|
+
}
|
|
76625
|
+
return path19.join(appDir, entry);
|
|
76626
|
+
}
|
|
76627
|
+
async function bundleApp(opts, appFolder) {
|
|
76628
|
+
const appDir = path19.resolve(appFolder ?? process19.cwd());
|
|
76629
|
+
const { js, css } = await createBundle({
|
|
76630
|
+
entryPoint: entryPointFor(appDir),
|
|
76631
|
+
production: true,
|
|
76632
|
+
minify: opts.minify ?? true,
|
|
76633
|
+
sharedUiDir: path19.join(process19.cwd(), "ui"),
|
|
76634
|
+
outDir: `.wmill-bundle-${process19.pid}`
|
|
76635
|
+
});
|
|
76636
|
+
const outDir = path19.resolve(opts.out ?? path19.join(appDir, "dist"));
|
|
76637
|
+
fs15.mkdirSync(outDir, { recursive: true });
|
|
76638
|
+
fs15.writeFileSync(path19.join(outDir, "bundle.js"), js);
|
|
76639
|
+
fs15.writeFileSync(path19.join(outDir, "bundle.css"), css);
|
|
76640
|
+
info(colors.green(`Wrote bundle.js and bundle.css to ${outDir}`));
|
|
76641
|
+
}
|
|
76642
|
+
var command12, bundle_command_default;
|
|
76643
|
+
var init_bundle_command = __esm(async () => {
|
|
76644
|
+
init_mod3();
|
|
76645
|
+
init_log();
|
|
76646
|
+
init_colors2();
|
|
76647
|
+
await init_bundle();
|
|
76648
|
+
command12 = new Command().description("Bundle a raw app folder to js/css without deploying it").arguments("[app_folder:string]").option("--out <dir:string>", "Directory to write bundle.js and bundle.css into (default: <app_folder>/dist)").option("--no-minify", "Skip minification").action(bundleApp);
|
|
76649
|
+
bundle_command_default = command12;
|
|
76650
|
+
});
|
|
76651
|
+
|
|
76575
76652
|
// src/commands/app/new.ts
|
|
76576
76653
|
import { stat as stat9, writeFile as writeFile10, mkdir as mkdir7, rm as rm4 } from "node:fs/promises";
|
|
76577
|
-
import
|
|
76654
|
+
import path20 from "node:path";
|
|
76578
76655
|
import { execSync as execSync5, exec, execFile as execFile6 } from "node:child_process";
|
|
76579
76656
|
function validateAppPath(appPath) {
|
|
76580
76657
|
if (!appPath.startsWith("u/") && !appPath.startsWith("f/")) {
|
|
@@ -76830,7 +76907,7 @@ CREATE SCHEMA IF NOT EXISTS ${schemaName};
|
|
|
76830
76907
|
}
|
|
76831
76908
|
await loadNonDottedPathsSetting();
|
|
76832
76909
|
const folderName2 = buildFolderPath(appPath, "raw_app");
|
|
76833
|
-
const appDir =
|
|
76910
|
+
const appDir = path20.join(process.cwd(), folderName2);
|
|
76834
76911
|
let dirExists = false;
|
|
76835
76912
|
try {
|
|
76836
76913
|
await stat9(appDir);
|
|
@@ -76855,17 +76932,17 @@ CREATE SCHEMA IF NOT EXISTS ${schemaName};
|
|
|
76855
76932
|
await rm4(appDir, { recursive: true, force: true });
|
|
76856
76933
|
}
|
|
76857
76934
|
await mkdir7(appDir, { recursive: true });
|
|
76858
|
-
await mkdir7(
|
|
76859
|
-
await mkdir7(
|
|
76935
|
+
await mkdir7(path20.join(appDir, "backend"), { recursive: true });
|
|
76936
|
+
await mkdir7(path20.join(appDir, "sql_to_apply"), { recursive: true });
|
|
76860
76937
|
const rawAppConfig = {
|
|
76861
76938
|
summary
|
|
76862
76939
|
};
|
|
76863
76940
|
if (dataConfig.datatable) {
|
|
76864
76941
|
rawAppConfig.data = dataConfig;
|
|
76865
76942
|
}
|
|
76866
|
-
await writeFile10(
|
|
76943
|
+
await writeFile10(path20.join(appDir, "raw_app.yaml"), import_yaml23.stringify(rawAppConfig, yamlOptions), "utf-8");
|
|
76867
76944
|
for (const [filePath, content] of Object.entries(template.files)) {
|
|
76868
|
-
const fullPath =
|
|
76945
|
+
const fullPath = path20.join(appDir, filePath.slice(1));
|
|
76869
76946
|
await writeFile10(fullPath, content.trim() + `
|
|
76870
76947
|
`, "utf-8");
|
|
76871
76948
|
}
|
|
@@ -76875,21 +76952,21 @@ CREATE SCHEMA IF NOT EXISTS ${schemaName};
|
|
|
76875
76952
|
schema: dataConfig.schema
|
|
76876
76953
|
} : undefined;
|
|
76877
76954
|
const agentsContent = generateAgentsDocumentation(dataForDocs);
|
|
76878
|
-
await writeFile10(
|
|
76879
|
-
await writeFile10(
|
|
76955
|
+
await writeFile10(path20.join(appDir, "AGENTS.md"), agentsContent, "utf-8");
|
|
76956
|
+
await writeFile10(path20.join(appDir, "CLAUDE.md"), `Instructions are in @AGENTS.md
|
|
76880
76957
|
`, "utf-8");
|
|
76881
76958
|
const datatablesContent = generateDatatablesDocumentation(dataForDocs);
|
|
76882
|
-
await writeFile10(
|
|
76959
|
+
await writeFile10(path20.join(appDir, "DATATABLES.md"), datatablesContent, "utf-8");
|
|
76883
76960
|
const exampleRunnable = {
|
|
76884
76961
|
type: "inline",
|
|
76885
76962
|
path: undefined
|
|
76886
76963
|
};
|
|
76887
|
-
await writeFile10(
|
|
76888
|
-
await writeFile10(
|
|
76964
|
+
await writeFile10(path20.join(appDir, "backend", "a.yaml"), import_yaml23.stringify(exampleRunnable, yamlOptions), "utf-8");
|
|
76965
|
+
await writeFile10(path20.join(appDir, "backend", "a.ts"), `export async function main(x: number): Promise<string> {
|
|
76889
76966
|
return \`Hello from backend! x = \${x}\`;
|
|
76890
76967
|
}
|
|
76891
76968
|
`, "utf-8");
|
|
76892
|
-
await writeFile10(
|
|
76969
|
+
await writeFile10(path20.join(appDir, "sql_to_apply", "README.md"), `# SQL Migrations Folder
|
|
76893
76970
|
|
|
76894
76971
|
This folder is for SQL migration files that will be applied to datatables during development.
|
|
76895
76972
|
|
|
@@ -76917,7 +76994,7 @@ This folder is for SQL migration files that will be applied to datatables during
|
|
|
76917
76994
|
- Use idempotent SQL (\`CREATE TABLE IF NOT EXISTS\`, etc.)
|
|
76918
76995
|
`);
|
|
76919
76996
|
if (createSchemaSQL && schemaName) {
|
|
76920
|
-
await writeFile10(
|
|
76997
|
+
await writeFile10(path20.join(appDir, "sql_to_apply", `000_create_schema_${schemaName}.sql`), createSchemaSQL, "utf-8");
|
|
76921
76998
|
}
|
|
76922
76999
|
info("");
|
|
76923
77000
|
info(colors.bold.green(`App created successfully at ${folderName2}/`));
|
|
@@ -76973,9 +77050,9 @@ This folder is for SQL migration files that will be applied to datatables during
|
|
|
76973
77050
|
});
|
|
76974
77051
|
if (openInDesktop) {
|
|
76975
77052
|
try {
|
|
76976
|
-
const absAppDir =
|
|
76977
|
-
const claudeDir =
|
|
76978
|
-
const launchPath =
|
|
77053
|
+
const absAppDir = path20.resolve(appDir);
|
|
77054
|
+
const claudeDir = path20.join(absAppDir, ".claude");
|
|
77055
|
+
const launchPath = path20.join(claudeDir, "launch.json");
|
|
76979
77056
|
if (!await stat9(launchPath).catch(() => null)) {
|
|
76980
77057
|
const launchJson = JSON.stringify({
|
|
76981
77058
|
version: "0.0.1",
|
|
@@ -76990,7 +77067,7 @@ This folder is for SQL migration files that will be applied to datatables during
|
|
|
76990
77067
|
`;
|
|
76991
77068
|
await mkdir7(claudeDir, { recursive: true });
|
|
76992
77069
|
await writeFile10(launchPath, launchJson, "utf-8");
|
|
76993
|
-
info(colors.gray(`Seeded ${
|
|
77070
|
+
info(colors.gray(`Seeded ${path20.relative(process.cwd(), launchPath)}`));
|
|
76994
77071
|
}
|
|
76995
77072
|
const sessionId = crypto.randomUUID();
|
|
76996
77073
|
const frames = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
@@ -76999,8 +77076,8 @@ This folder is for SQL migration files that will be applied to datatables during
|
|
|
76999
77076
|
process.stdout.write(`\r${colors.gray(`${frames[i++ % frames.length]} Creating Claude session...`)}`);
|
|
77000
77077
|
}, 80);
|
|
77001
77078
|
try {
|
|
77002
|
-
await new Promise((
|
|
77003
|
-
exec(`claude --session-id "${sessionId}" -p "Say: Your app is ready, click on preview to test it!"`, { cwd: absAppDir }, (error2) => error2 ? reject(error2) :
|
|
77079
|
+
await new Promise((resolve11, reject) => {
|
|
77080
|
+
exec(`claude --session-id "${sessionId}" -p "Say: Your app is ready, click on preview to test it!"`, { cwd: absAppDir }, (error2) => error2 ? reject(error2) : resolve11());
|
|
77004
77081
|
});
|
|
77005
77082
|
} finally {
|
|
77006
77083
|
clearInterval(spinner);
|
|
@@ -77105,7 +77182,7 @@ createApp(App).mount('#root')`, indexCss = `body {
|
|
|
77105
77182
|
.myclass {
|
|
77106
77183
|
border: 1px solid gray;
|
|
77107
77184
|
padding: 2px;
|
|
77108
|
-
}`, templates,
|
|
77185
|
+
}`, templates, command13, new_default;
|
|
77109
77186
|
var init_new = __esm(async () => {
|
|
77110
77187
|
init_mod3();
|
|
77111
77188
|
init_colors2();
|
|
@@ -77190,8 +77267,8 @@ var init_new = __esm(async () => {
|
|
|
77190
77267
|
}
|
|
77191
77268
|
}
|
|
77192
77269
|
};
|
|
77193
|
-
|
|
77194
|
-
new_default =
|
|
77270
|
+
command13 = new Command().description("create a new raw app from a template").option("--summary <summary:string>", "App summary (short description). Skips the prompt when provided. Triggers non-interactive mode.").option("--path <path:string>", "App path (e.g., f/folder/my_app or u/username/my_app). Skips the prompt when provided. Triggers non-interactive mode.").option("--framework <framework:string>", "Framework template: react19 | react18 | svelte5 | vue. Skips the prompt when provided. Triggers non-interactive mode.").option("--datatable <datatable:string>", "Datatable to wire up. Without this flag in non-interactive mode, no datatable is configured.").option("--schema <schema:string>", "Schema to use with --datatable. Created (CREATE SCHEMA IF NOT EXISTS) if it doesn't already exist.").option("--overwrite", "Overwrite the target directory if it already exists, without prompting.").option("--no-open-in-desktop", "Do not prompt to open the new app in Claude Desktop.").action(newApp);
|
|
77271
|
+
new_default = command13;
|
|
77195
77272
|
});
|
|
77196
77273
|
|
|
77197
77274
|
// src/commands/app/app.ts
|
|
@@ -77292,8 +77369,8 @@ async function pushApp(workspace, remotePath, localPath, message, permissionedAs
|
|
|
77292
77369
|
if (!localPath.endsWith(SEP14)) {
|
|
77293
77370
|
localPath += SEP14;
|
|
77294
77371
|
}
|
|
77295
|
-
const
|
|
77296
|
-
const localApp = await yamlParseFile(
|
|
77372
|
+
const path21 = localPath + "app.yaml";
|
|
77373
|
+
const localApp = await yamlParseFile(path21);
|
|
77297
77374
|
replaceInlineScripts2(localApp.value, localPath, true);
|
|
77298
77375
|
await generatingPolicy2(localApp, remotePath, localApp?.["public"] ?? localApp?.["policy"]?.["execution_mode"] == "anonymous");
|
|
77299
77376
|
const preserveFields = {};
|
|
@@ -77339,13 +77416,13 @@ async function pushApp(workspace, remotePath, localPath, message, permissionedAs
|
|
|
77339
77416
|
}
|
|
77340
77417
|
await applyExtraPermsDiff(workspace, "app", remotePath, localPerms, app?.extra_perms);
|
|
77341
77418
|
}
|
|
77342
|
-
async function generatingPolicy2(app,
|
|
77343
|
-
info(colors.gray(`Generating fresh policy for app ${
|
|
77419
|
+
async function generatingPolicy2(app, path21, publicApp) {
|
|
77420
|
+
info(colors.gray(`Generating fresh policy for app ${path21}...`));
|
|
77344
77421
|
try {
|
|
77345
77422
|
app.policy = await updatePolicy(app.value, undefined);
|
|
77346
77423
|
app.policy.execution_mode = publicApp ? "anonymous" : "publisher";
|
|
77347
77424
|
} catch (e) {
|
|
77348
|
-
error(colors.red(`Error generating policy for app ${
|
|
77425
|
+
error(colors.red(`Error generating policy for app ${path21}: ${e}`));
|
|
77349
77426
|
throw e;
|
|
77350
77427
|
}
|
|
77351
77428
|
}
|
|
@@ -77374,12 +77451,12 @@ async function list6(opts) {
|
|
|
77374
77451
|
new Table2().header(["path", "summary"]).padding(2).border(true).body(total.map((x) => [x.path, x.summary])).render();
|
|
77375
77452
|
}
|
|
77376
77453
|
}
|
|
77377
|
-
async function get4(opts,
|
|
77454
|
+
async function get4(opts, path21) {
|
|
77378
77455
|
const workspace = await resolveWorkspace(opts);
|
|
77379
77456
|
await requireLogin(opts);
|
|
77380
77457
|
const a = await getAppByPath({
|
|
77381
77458
|
workspace: workspace.workspaceId,
|
|
77382
|
-
path:
|
|
77459
|
+
path: path21
|
|
77383
77460
|
});
|
|
77384
77461
|
if (opts.json) {
|
|
77385
77462
|
console.log(JSON.stringify(a));
|
|
@@ -77459,7 +77536,7 @@ async function push5(opts, filePath, remotePath) {
|
|
|
77459
77536
|
info(colors.bold.underline.green("App pushed"));
|
|
77460
77537
|
}
|
|
77461
77538
|
}
|
|
77462
|
-
var alreadySynced2, APP_FOLDER_SUFFIXES,
|
|
77539
|
+
var alreadySynced2, APP_FOLDER_SUFFIXES, command14, app_default;
|
|
77463
77540
|
var init_app = __esm(async () => {
|
|
77464
77541
|
init_mod3();
|
|
77465
77542
|
init_mod6();
|
|
@@ -77478,12 +77555,13 @@ var init_app = __esm(async () => {
|
|
|
77478
77555
|
init_utils(),
|
|
77479
77556
|
init_dev(),
|
|
77480
77557
|
init_lint2(),
|
|
77558
|
+
init_bundle_command(),
|
|
77481
77559
|
init_new(),
|
|
77482
77560
|
init_generate_agents()
|
|
77483
77561
|
]);
|
|
77484
77562
|
alreadySynced2 = [];
|
|
77485
77563
|
APP_FOLDER_SUFFIXES = ["__raw_app", ".raw_app", "__app", ".app"];
|
|
77486
|
-
|
|
77564
|
+
command14 = new Command().description("app related commands").option("--json", "Output as JSON (for piping to jq)").action(list6).command("list", "list all apps").option("--json", "Output as JSON (for piping to jq)").action(list6).command("get", "get an app's details").arguments("<path:string>").option("--json", "Output as JSON (for piping to jq)").action(get4).command("push", "push a local app. With no args, infers the app from the current directory and the remote path from its location relative to wmill.yaml.").arguments("[file_path:string] [remote_path:string]").action(push5).command("dev", dev_default).command("lint", lint_default2).command("bundle", bundle_command_default).command("new", new_default).command("generate-agents", generate_agents_default).command("generate-locks", 'DEPRECATED: re-generate app lockfiles. Use "wmill generate-metadata" instead.').arguments("[app_folder:string]").option("--yes", "Skip confirmation prompt").option("--dry-run", "Perform a dry run without making changes").option("--default-ts <runtime:string>", "Default TypeScript runtime (bun or deno)").action(async (opts, appFolder) => {
|
|
77487
77565
|
warn(colors.yellow('This command is deprecated. Use "wmill generate-metadata" instead.'));
|
|
77488
77566
|
const { generateLocksCommand: generateLocksCommand2 } = await init_app_metadata().then(() => exports_app_metadata);
|
|
77489
77567
|
await generateLocksCommand2(opts, appFolder);
|
|
@@ -77514,7 +77592,7 @@ var init_app = __esm(async () => {
|
|
|
77514
77592
|
});
|
|
77515
77593
|
info(colors.green(`Updated permissioned_as for app ${appPath} to ${email}`));
|
|
77516
77594
|
});
|
|
77517
|
-
app_default =
|
|
77595
|
+
app_default = command14;
|
|
77518
77596
|
});
|
|
77519
77597
|
|
|
77520
77598
|
// src/commands/folder/folder.ts
|
|
@@ -77678,7 +77756,7 @@ async function addMissing(opts) {
|
|
|
77678
77756
|
info(`
|
|
77679
77757
|
Created ${missing.length} folder.meta.yaml file(s). You can now run 'wmill sync push' to push them.`);
|
|
77680
77758
|
}
|
|
77681
|
-
var import_yaml25,
|
|
77759
|
+
var import_yaml25, command15, folder_default;
|
|
77682
77760
|
var init_folder = __esm(async () => {
|
|
77683
77761
|
init_colors2();
|
|
77684
77762
|
init_mod3();
|
|
@@ -77692,7 +77770,7 @@ var init_folder = __esm(async () => {
|
|
|
77692
77770
|
init_types()
|
|
77693
77771
|
]);
|
|
77694
77772
|
import_yaml25 = __toESM(require_dist(), 1);
|
|
77695
|
-
|
|
77773
|
+
command15 = new Command().description("folder related commands").option("--json", "Output as JSON (for piping to jq)").action(list7).command("list", "list all folders").option("--json", "Output as JSON (for piping to jq)").action(list7).command("get", "get a folder's details").arguments("<name:string>").option("--json", "Output as JSON (for piping to jq)").action(get5).command("new", "create a new folder locally").arguments("<name:string>").option("--summary <summary:string>", "folder summary").action(newFolder).command("push", "push a local folder to the remote by name. This overrides any remote versions.").arguments("<name:string>").action(push6).command("add-missing", "create default folder.meta.yaml for all subdirectories of f/ that are missing one").option("-y, --yes", "skip confirmation prompt").action(addMissing).command("show-rules", "Show default_permissioned_as rules for a folder. Use --test-path to see which rule matches a given item path.").arguments("<name:string>").option("--test-path <path:string>", "Test which rule matches this item path (e.g. f/prod/jobs/my_script)").option("--json", "Output as JSON").action(async (opts, folderName2) => {
|
|
77696
77774
|
const workspace = await resolveWorkspace(opts);
|
|
77697
77775
|
await requireLogin(opts);
|
|
77698
77776
|
const folder = await getFolder({
|
|
@@ -77740,7 +77818,7 @@ var init_folder = __esm(async () => {
|
|
|
77740
77818
|
info(colors.yellow(`No rule matches path '${testPath}' (relative: '${relative8}')`));
|
|
77741
77819
|
}
|
|
77742
77820
|
});
|
|
77743
|
-
folder_default =
|
|
77821
|
+
folder_default = command15;
|
|
77744
77822
|
});
|
|
77745
77823
|
|
|
77746
77824
|
// src/commands/variable/variable.ts
|
|
@@ -77766,11 +77844,11 @@ async function list8(opts) {
|
|
|
77766
77844
|
])).render();
|
|
77767
77845
|
}
|
|
77768
77846
|
}
|
|
77769
|
-
async function newVariable(opts,
|
|
77770
|
-
if (!validatePath(
|
|
77847
|
+
async function newVariable(opts, path21) {
|
|
77848
|
+
if (!validatePath(path21)) {
|
|
77771
77849
|
return;
|
|
77772
77850
|
}
|
|
77773
|
-
const filePath =
|
|
77851
|
+
const filePath = path21 + ".variable.yaml";
|
|
77774
77852
|
try {
|
|
77775
77853
|
await stat12(filePath);
|
|
77776
77854
|
throw new Error("File already exists: " + filePath);
|
|
@@ -77790,14 +77868,14 @@ async function newVariable(opts, path20) {
|
|
|
77790
77868
|
});
|
|
77791
77869
|
info(colors.green(`Created ${filePath}`));
|
|
77792
77870
|
}
|
|
77793
|
-
async function get6(opts,
|
|
77871
|
+
async function get6(opts, path21) {
|
|
77794
77872
|
if (opts.json)
|
|
77795
77873
|
setSilent(true);
|
|
77796
77874
|
const workspace = await resolveWorkspace(opts);
|
|
77797
77875
|
await requireLogin(opts);
|
|
77798
77876
|
const v = await getVariable({
|
|
77799
77877
|
workspace: workspace.workspaceId,
|
|
77800
|
-
path:
|
|
77878
|
+
path: path21
|
|
77801
77879
|
});
|
|
77802
77880
|
if (opts.json) {
|
|
77803
77881
|
console.log(JSON.stringify(v));
|
|
@@ -77948,7 +78026,7 @@ async function add2(opts, value, remotePath) {
|
|
|
77948
78026
|
}
|
|
77949
78027
|
info(colors.bold.underline.green(`Variable ${remotePath} pushed`));
|
|
77950
78028
|
}
|
|
77951
|
-
var import_yaml26,
|
|
78029
|
+
var import_yaml26, command16, variable_default;
|
|
77952
78030
|
var init_variable = __esm(async () => {
|
|
77953
78031
|
init_mod3();
|
|
77954
78032
|
init_mod6();
|
|
@@ -77962,8 +78040,8 @@ var init_variable = __esm(async () => {
|
|
|
77962
78040
|
init_confirm()
|
|
77963
78041
|
]);
|
|
77964
78042
|
import_yaml26 = __toESM(require_dist(), 1);
|
|
77965
|
-
|
|
77966
|
-
variable_default =
|
|
78043
|
+
command16 = new Command().description("variable related commands").option("--json", "Output as JSON (for piping to jq)").action(list8).command("list", "list all variables").option("--json", "Output as JSON (for piping to jq)").action(list8).command("get", "get a variable's details").arguments("<path:string>").option("--json", "Output as JSON (for piping to jq)").action(get6).command("new", "create a new variable locally").arguments("<path:string>").action(newVariable).command("push", "Push a local variable spec. This overrides any remote versions.").arguments("<file_path:string> <remote_path:string>").option("--plain-secrets", "Push secrets as plain text").action(push7).command("add", "Create a new variable on the remote. This will update the variable if it already exists.").arguments("<value:string> <remote_path:string>").option("--yes", "Skip confirmation prompt when updating an existing variable").option("--secret", "Mark the variable as secret (default when creating a new variable)").option("--no-secret", "Mark the variable as non-secret (when updating, the existing setting is preserved if neither --secret nor --no-secret is passed)").option("--description <description:string>", "Set the variable description (when updating, the existing description is preserved if not passed)").option("--plain-secrets", "Push secrets as plain text").option("--public", "Legacy option, use --no-secret instead").action(add2);
|
|
78044
|
+
variable_default = command16;
|
|
77967
78045
|
});
|
|
77968
78046
|
|
|
77969
78047
|
// src/commands/schedule/schedule.ts
|
|
@@ -77984,11 +78062,11 @@ async function list9(opts) {
|
|
|
77984
78062
|
new Table2().header(["Path", "Schedule"]).padding(2).border(true).body(schedules.map((x) => [x.path, x.schedule])).render();
|
|
77985
78063
|
}
|
|
77986
78064
|
}
|
|
77987
|
-
async function newSchedule(opts,
|
|
77988
|
-
if (!validatePath(
|
|
78065
|
+
async function newSchedule(opts, path21) {
|
|
78066
|
+
if (!validatePath(path21)) {
|
|
77989
78067
|
return;
|
|
77990
78068
|
}
|
|
77991
|
-
const filePath =
|
|
78069
|
+
const filePath = path21 + ".schedule.yaml";
|
|
77992
78070
|
try {
|
|
77993
78071
|
await stat13(filePath);
|
|
77994
78072
|
throw new Error("File already exists: " + filePath);
|
|
@@ -78012,14 +78090,14 @@ async function newSchedule(opts, path20) {
|
|
|
78012
78090
|
});
|
|
78013
78091
|
info(colors.green(`Created ${filePath}`));
|
|
78014
78092
|
}
|
|
78015
|
-
async function get7(opts,
|
|
78093
|
+
async function get7(opts, path21) {
|
|
78016
78094
|
if (opts.json)
|
|
78017
78095
|
setSilent(true);
|
|
78018
78096
|
const workspace = await resolveWorkspace(opts);
|
|
78019
78097
|
await requireLogin(opts);
|
|
78020
78098
|
const s = await getSchedule({
|
|
78021
78099
|
workspace: workspace.workspaceId,
|
|
78022
|
-
path:
|
|
78100
|
+
path: path21
|
|
78023
78101
|
});
|
|
78024
78102
|
if (opts.json) {
|
|
78025
78103
|
console.log(JSON.stringify(s));
|
|
@@ -78032,14 +78110,14 @@ async function get7(opts, path20) {
|
|
|
78032
78110
|
console.log(colors.bold("Enabled:") + " " + (s.enabled ? "true" : "false"));
|
|
78033
78111
|
}
|
|
78034
78112
|
}
|
|
78035
|
-
async function pushSchedule(workspace,
|
|
78036
|
-
|
|
78037
|
-
debug(`Processing local schedule ${
|
|
78113
|
+
async function pushSchedule(workspace, path21, schedule, localSchedule, permissionedAsContext) {
|
|
78114
|
+
path21 = removeType(path21, "schedule").replaceAll(SEP17, "/");
|
|
78115
|
+
debug(`Processing local schedule ${path21}`);
|
|
78038
78116
|
try {
|
|
78039
|
-
schedule = await getSchedule({ workspace, path:
|
|
78040
|
-
debug(`Schedule ${
|
|
78117
|
+
schedule = await getSchedule({ workspace, path: path21 });
|
|
78118
|
+
debug(`Schedule ${path21} exists on remote`);
|
|
78041
78119
|
} catch {
|
|
78042
|
-
debug(`Schedule ${
|
|
78120
|
+
debug(`Schedule ${path21} does not exist on remote`);
|
|
78043
78121
|
}
|
|
78044
78122
|
delete localSchedule.has_permissioned_as;
|
|
78045
78123
|
const preserveFields = {};
|
|
@@ -78048,31 +78126,31 @@ async function pushSchedule(workspace, path20, schedule, localSchedule, permissi
|
|
|
78048
78126
|
preserveFields.preserve_permissioned_as = true;
|
|
78049
78127
|
if (schedule.permissioned_as) {
|
|
78050
78128
|
preserveFields.permissioned_as = schedule.permissioned_as;
|
|
78051
|
-
info(`Preserving ${schedule.permissioned_as} as permissioned_as for schedule ${
|
|
78129
|
+
info(`Preserving ${schedule.permissioned_as} as permissioned_as for schedule ${path21}`);
|
|
78052
78130
|
}
|
|
78053
78131
|
}
|
|
78054
78132
|
}
|
|
78055
78133
|
if (schedule) {
|
|
78056
78134
|
if (isSuperset(localSchedule, schedule)) {
|
|
78057
|
-
debug(`Schedule ${
|
|
78135
|
+
debug(`Schedule ${path21} is up to date`);
|
|
78058
78136
|
return;
|
|
78059
78137
|
}
|
|
78060
|
-
debug(`Updating schedule ${
|
|
78138
|
+
debug(`Updating schedule ${path21}`);
|
|
78061
78139
|
try {
|
|
78062
|
-
info(colors.bold.yellow(`Updating schedule ${
|
|
78140
|
+
info(colors.bold.yellow(`Updating schedule ${path21}`));
|
|
78063
78141
|
await updateSchedule({
|
|
78064
78142
|
workspace,
|
|
78065
|
-
path:
|
|
78143
|
+
path: path21,
|
|
78066
78144
|
requestBody: {
|
|
78067
78145
|
...localSchedule,
|
|
78068
78146
|
...preserveFields
|
|
78069
78147
|
}
|
|
78070
78148
|
});
|
|
78071
78149
|
if (localSchedule.enabled !== undefined && localSchedule.enabled !== schedule.enabled) {
|
|
78072
|
-
info(colors.bold.yellow(`Schedule ${
|
|
78150
|
+
info(colors.bold.yellow(`Schedule ${path21} is ${localSchedule.enabled ? "enabled" : "disabled"} locally but not on remote, updating remote`));
|
|
78073
78151
|
await setScheduleEnabled({
|
|
78074
78152
|
workspace,
|
|
78075
|
-
path:
|
|
78153
|
+
path: path21,
|
|
78076
78154
|
requestBody: {
|
|
78077
78155
|
enabled: localSchedule.enabled
|
|
78078
78156
|
}
|
|
@@ -78083,12 +78161,12 @@ async function pushSchedule(workspace, path20, schedule, localSchedule, permissi
|
|
|
78083
78161
|
throw e;
|
|
78084
78162
|
}
|
|
78085
78163
|
} else {
|
|
78086
|
-
console.log(colors.bold.yellow("Creating new schedule " +
|
|
78164
|
+
console.log(colors.bold.yellow("Creating new schedule " + path21));
|
|
78087
78165
|
try {
|
|
78088
78166
|
await createSchedule({
|
|
78089
78167
|
workspace,
|
|
78090
78168
|
requestBody: {
|
|
78091
|
-
path:
|
|
78169
|
+
path: path21,
|
|
78092
78170
|
...localSchedule,
|
|
78093
78171
|
...preserveFields
|
|
78094
78172
|
}
|
|
@@ -78099,26 +78177,26 @@ async function pushSchedule(workspace, path20, schedule, localSchedule, permissi
|
|
|
78099
78177
|
}
|
|
78100
78178
|
}
|
|
78101
78179
|
}
|
|
78102
|
-
async function enable(opts,
|
|
78180
|
+
async function enable(opts, path21) {
|
|
78103
78181
|
opts = await mergeConfigWithConfigFile(opts);
|
|
78104
78182
|
const workspace = await resolveWorkspace(opts);
|
|
78105
78183
|
await requireLogin(opts);
|
|
78106
78184
|
try {
|
|
78107
78185
|
await setScheduleEnabled({
|
|
78108
78186
|
workspace: workspace.workspaceId,
|
|
78109
|
-
path:
|
|
78187
|
+
path: path21,
|
|
78110
78188
|
requestBody: { enabled: true, force: opts.force }
|
|
78111
78189
|
});
|
|
78112
78190
|
} catch (e) {
|
|
78113
78191
|
const conflict = parseForkConflict(e);
|
|
78114
78192
|
if (conflict) {
|
|
78115
|
-
error(`Cannot enable schedule '${
|
|
78193
|
+
error(`Cannot enable schedule '${path21}': the parent workspace '${conflict.parentWorkspaceId}' has the same path configured. ` + `Both crons would fire on every tick and the script would run twice per scheduled time.
|
|
78116
78194
|
` + `Re-run with --force to enable anyway.`);
|
|
78117
78195
|
process.exit(1);
|
|
78118
78196
|
}
|
|
78119
78197
|
throw e;
|
|
78120
78198
|
}
|
|
78121
|
-
info(colors.green(`Schedule ${
|
|
78199
|
+
info(colors.green(`Schedule ${path21} enabled.`));
|
|
78122
78200
|
}
|
|
78123
78201
|
function parseForkConflict(e) {
|
|
78124
78202
|
const body = e?.body;
|
|
@@ -78128,16 +78206,16 @@ function parseForkConflict(e) {
|
|
|
78128
78206
|
return;
|
|
78129
78207
|
return { kind: m[1], parentWorkspaceId: m[2].trim() };
|
|
78130
78208
|
}
|
|
78131
|
-
async function disable(opts,
|
|
78209
|
+
async function disable(opts, path21) {
|
|
78132
78210
|
opts = await mergeConfigWithConfigFile(opts);
|
|
78133
78211
|
const workspace = await resolveWorkspace(opts);
|
|
78134
78212
|
await requireLogin(opts);
|
|
78135
78213
|
await setScheduleEnabled({
|
|
78136
78214
|
workspace: workspace.workspaceId,
|
|
78137
|
-
path:
|
|
78215
|
+
path: path21,
|
|
78138
78216
|
requestBody: { enabled: false }
|
|
78139
78217
|
});
|
|
78140
|
-
info(colors.yellow(`Schedule ${
|
|
78218
|
+
info(colors.yellow(`Schedule ${path21} disabled.`));
|
|
78141
78219
|
}
|
|
78142
78220
|
async function push8(opts, filePath, remotePath) {
|
|
78143
78221
|
const workspace = await resolveWorkspace(opts);
|
|
@@ -78153,7 +78231,7 @@ async function push8(opts, filePath, remotePath) {
|
|
|
78153
78231
|
await pushSchedule(workspace.workspaceId, remotePath, undefined, parseFromFile(filePath));
|
|
78154
78232
|
console.log(colors.bold.underline.green("Schedule pushed"));
|
|
78155
78233
|
}
|
|
78156
|
-
var import_yaml27,
|
|
78234
|
+
var import_yaml27, command17, schedule_default2;
|
|
78157
78235
|
var init_schedule2 = __esm(async () => {
|
|
78158
78236
|
init_mod3();
|
|
78159
78237
|
init_mod6();
|
|
@@ -78168,7 +78246,7 @@ var init_schedule2 = __esm(async () => {
|
|
|
78168
78246
|
init_types()
|
|
78169
78247
|
]);
|
|
78170
78248
|
import_yaml27 = __toESM(require_dist(), 1);
|
|
78171
|
-
|
|
78249
|
+
command17 = new Command().description("schedule related commands").option("--json", "Output as JSON (for piping to jq)").action(list9).command("list", "list all schedules").option("--json", "Output as JSON (for piping to jq)").action(list9).command("get", "get a schedule's details").arguments("<path:string>").option("--json", "Output as JSON (for piping to jq)").action(get7).command("new", "create a new schedule locally").arguments("<path:string>").action(newSchedule).command("push", "push a local schedule spec. This overrides any remote versions.").arguments("<file_path:string> <remote_path:string>").action(push8).command("enable", "Enable a schedule").option("--force", "Bypass the fork-conflict warning when the parent workspace has the same schedule (acknowledges that both crons will fire)").arguments("<path:string>").action(enable).command("disable", "Disable a schedule").arguments("<path:string>").action(disable).command("set-permissioned-as", "Set the email (run-as user) for a schedule (requires admin or wm_deployers group)").arguments("<path:string> <email:string>").action(async (opts, schedulePath, email) => {
|
|
78172
78250
|
const workspace = await resolveWorkspace(opts);
|
|
78173
78251
|
await requireLogin(opts);
|
|
78174
78252
|
const cache3 = new Map;
|
|
@@ -78190,7 +78268,7 @@ var init_schedule2 = __esm(async () => {
|
|
|
78190
78268
|
});
|
|
78191
78269
|
info(colors.green(`Updated permissioned_as for schedule ${schedulePath} to ${email} (username: ${username})`));
|
|
78192
78270
|
});
|
|
78193
|
-
schedule_default2 =
|
|
78271
|
+
schedule_default2 = command17;
|
|
78194
78272
|
});
|
|
78195
78273
|
|
|
78196
78274
|
// src/commands/instance/slack.ts
|
|
@@ -78280,7 +78358,7 @@ async function decrypt(combinedCiphertext, keyString) {
|
|
|
78280
78358
|
var init_local_encryption = () => {};
|
|
78281
78359
|
|
|
78282
78360
|
// src/core/settings.ts
|
|
78283
|
-
import
|
|
78361
|
+
import process20 from "node:process";
|
|
78284
78362
|
import { writeFile as writeFile14 } from "node:fs/promises";
|
|
78285
78363
|
function migrateToGroupedFormat(settings) {
|
|
78286
78364
|
const result = { name: settings.name ?? "" };
|
|
@@ -78563,7 +78641,7 @@ async function pushWorkspaceKey(workspace, _path, key, localKey, opts) {
|
|
|
78563
78641
|
}
|
|
78564
78642
|
if (localKey && key !== localKey) {
|
|
78565
78643
|
let reencrypt;
|
|
78566
|
-
const explicitSkip = opts?.skipReencrypt || (
|
|
78644
|
+
const explicitSkip = opts?.skipReencrypt || (process20.env.WMILL_NO_REENCRYPT_ON_KEY_CHANGE ?? "").toLowerCase() === "true";
|
|
78567
78645
|
if (explicitSkip) {
|
|
78568
78646
|
reencrypt = false;
|
|
78569
78647
|
info("Workspace encryption key changed; leaving remote ciphertexts untouched (skip re-encryption requested).");
|
|
@@ -78602,7 +78680,7 @@ async function readInstanceSettings(opts) {
|
|
|
78602
78680
|
return localSettings;
|
|
78603
78681
|
}
|
|
78604
78682
|
async function processInstanceSettings(settings, mode) {
|
|
78605
|
-
const encKey =
|
|
78683
|
+
const encKey = process20.env.WMILL_INSTANCE_LOCAL_ENCRYPTION_KEY;
|
|
78606
78684
|
if (encKey) {
|
|
78607
78685
|
const res = [];
|
|
78608
78686
|
for (const s of settings) {
|
|
@@ -78776,7 +78854,7 @@ var init_settings = __esm(async () => {
|
|
|
78776
78854
|
// src/commands/instance/instance.ts
|
|
78777
78855
|
import { writeFile as writeFile15, readdir as readdir9, mkdir as mkdir11, rm as rm5, stat as stat14 } from "node:fs/promises";
|
|
78778
78856
|
import { appendFile } from "node:fs/promises";
|
|
78779
|
-
import * as
|
|
78857
|
+
import * as path21 from "node:path";
|
|
78780
78858
|
async function allInstances() {
|
|
78781
78859
|
try {
|
|
78782
78860
|
const file = await getInstancesConfigFilePath();
|
|
@@ -78968,7 +79046,7 @@ async function instancePull(opts) {
|
|
|
78968
79046
|
if (confirm) {
|
|
78969
79047
|
if (uChanges > 0) {
|
|
78970
79048
|
if (opts.folderPerInstance && opts.prefixSettings) {
|
|
78971
|
-
await mkdir11(
|
|
79049
|
+
await mkdir11(path21.join(rootDir, opts.prefix), {
|
|
78972
79050
|
recursive: true
|
|
78973
79051
|
});
|
|
78974
79052
|
}
|
|
@@ -79002,10 +79080,10 @@ Pulling all workspaces`);
|
|
|
79002
79080
|
info(`
|
|
79003
79081
|
Pulling workspace ` + remoteWorkspace.id);
|
|
79004
79082
|
const workspaceName = opts?.folderPerInstance ? instance.prefix + "/" + remoteWorkspace.id : instance.prefix + "_" + remoteWorkspace.id;
|
|
79005
|
-
await mkdir11(
|
|
79083
|
+
await mkdir11(path21.join(rootDir, workspaceName), {
|
|
79006
79084
|
recursive: true
|
|
79007
79085
|
});
|
|
79008
|
-
process.chdir(
|
|
79086
|
+
process.chdir(path21.join(rootDir, workspaceName));
|
|
79009
79087
|
await addWorkspace({
|
|
79010
79088
|
remote: instance.remote,
|
|
79011
79089
|
name: workspaceName,
|
|
@@ -79040,7 +79118,7 @@ Pulling workspace ` + remoteWorkspace.id);
|
|
|
79040
79118
|
if (confirmDelete) {
|
|
79041
79119
|
for (const workspace of localWorkspacesToDelete) {
|
|
79042
79120
|
await removeWorkspace(workspace.id, false, {});
|
|
79043
|
-
await rm5(
|
|
79121
|
+
await rm5(path21.join(rootDir, workspace.dir), {
|
|
79044
79122
|
recursive: true
|
|
79045
79123
|
});
|
|
79046
79124
|
}
|
|
@@ -79129,12 +79207,12 @@ Pushing all workspaces: ${localWorkspaces.map((x) => x.id).join(", ")}`);
|
|
|
79129
79207
|
info(`
|
|
79130
79208
|
Pushing workspace ` + localWorkspace.id);
|
|
79131
79209
|
try {
|
|
79132
|
-
process.chdir(
|
|
79210
|
+
process.chdir(path21.join(rootDir, localWorkspace.dir));
|
|
79133
79211
|
} catch (_) {
|
|
79134
79212
|
throw new Error("Workspace folder not found, are you in the right directory?");
|
|
79135
79213
|
}
|
|
79136
79214
|
try {
|
|
79137
|
-
const workspaceSettings = await yamlParseFile(
|
|
79215
|
+
const workspaceSettings = await yamlParseFile(path21.join(process.cwd(), "settings.yaml"));
|
|
79138
79216
|
await add({
|
|
79139
79217
|
token: instance.token,
|
|
79140
79218
|
workspace: undefined,
|
|
@@ -79273,7 +79351,7 @@ async function whoami3(opts) {
|
|
|
79273
79351
|
error(colors.red(`Failed to retrieve whoami information: ${error2.message}`));
|
|
79274
79352
|
}
|
|
79275
79353
|
}
|
|
79276
|
-
var import_yaml30,
|
|
79354
|
+
var import_yaml30, command18, instance_default;
|
|
79277
79355
|
var init_instance = __esm(async () => {
|
|
79278
79356
|
init_colors2();
|
|
79279
79357
|
init_mod3();
|
|
@@ -79298,7 +79376,7 @@ var init_instance = __esm(async () => {
|
|
|
79298
79376
|
init_workspace()
|
|
79299
79377
|
]);
|
|
79300
79378
|
import_yaml30 = __toESM(require_dist(), 1);
|
|
79301
|
-
|
|
79379
|
+
command18 = new Command().description("sync local with a remote instance or the opposite (push or pull)").action(async () => {
|
|
79302
79380
|
info("4 actions available, add, remove, switch, pull and push. Use -h to display help.");
|
|
79303
79381
|
const activeInstance = await getActiveInstance({});
|
|
79304
79382
|
new Table2().header(["name", "remote", "token"]).padding(2).border(true).body((await allInstances()).map((x) => [
|
|
@@ -79324,7 +79402,7 @@ var init_instance = __esm(async () => {
|
|
|
79324
79402
|
await removeInstance(choice);
|
|
79325
79403
|
info(colors.green.underline(`Removed instance ${choice}`));
|
|
79326
79404
|
}).command("switch").complete("instance", async () => (await allInstances()).map((x) => x.name)).arguments("<instance:string:instance>").description("Switch the current instance").action(switchI).command("pull").description("Pull instance settings, users, configs, instance groups and overwrite local").option("--yes", "Pull without needing confirmation").option("--dry-run", "Perform a dry run without making changes").option("--skip-users", "Skip pulling users").option("--skip-settings", "Skip pulling settings").option("--skip-configs", "Skip pulling configs (worker groups)").option("--skip-groups", "Skip pulling instance groups").option("--include-workspaces", "Also pull workspaces").option("--folder-per-instance", "Create a folder per instance").option("--instance <instance:string>", "Name of the instance to pull from, override the active instance").option("--prefix <prefix:string>", "Prefix of the local workspaces to pull, used to create the folders when using --include-workspaces").option("--prefix-settings", "Store instance yamls inside prefixed folders when using --prefix and --folder-per-instance").action(instancePull).command("push").description("Push instance settings, users, configs, group and overwrite remote").option("--yes", "Push without needing confirmation").option("--dry-run", "Perform a dry run without making changes").option("--skip-users", "Skip pushing users").option("--skip-settings", "Skip pushing settings").option("--skip-configs", "Skip pushing configs (worker groups)").option("--skip-groups", "Skip pushing instance groups").option("--include-workspaces", "Also push workspaces").option("--folder-per-instance", "Create a folder per instance").option("--instance <instance:string>", "Name of the instance to push to, override the active instance").option("--prefix <prefix:string>", "Prefix of the local workspaces folders to push").option("--prefix-settings", "Store instance yamls inside prefixed folders when using --prefix and --folder-per-instance").action(instancePush).command("whoami").description("Display information about the currently logged-in user").action(whoami3).command("get-config").description("Dump the current instance config (global settings + worker configs) as YAML").option("-o, --output-file <file:string>", "Write YAML to a file instead of stdout").option("--show-secrets", "Include sensitive fields (license key, JWT secret) without prompting").option("--instance <instance:string>", "Name of the instance, override the active instance").action(getConfig2).command("connect-slack").description("Non-interactively connect Slack at the instance level using a pre-minted bot token (xoxb-...). Produces the same artifacts as the UI OAuth flow: global_settings 'slack' row + encrypted f/slack_bot/global_bot_token variable and resource in the admins workspace.").option("--bot-token <bot_token:string>", "Slack bot token (xoxb-...)", { required: true }).option("--team-id <team_id:string>", "Slack team id", { required: true }).option("--team-name <team_name:string>", "Slack team name", { required: true }).option("--instance <instance:string>", "Instance profile to connect against (defaults to the active instance)").action((opts) => connectSlackInstance2(opts));
|
|
79327
|
-
instance_default =
|
|
79405
|
+
instance_default = command18;
|
|
79328
79406
|
});
|
|
79329
79407
|
|
|
79330
79408
|
// src/commands/user/user.ts
|
|
@@ -79398,8 +79476,8 @@ async function createToken2(opts) {
|
|
|
79398
79476
|
}
|
|
79399
79477
|
info("Token: " + await createToken({ requestBody: {} }));
|
|
79400
79478
|
}
|
|
79401
|
-
async function pushWorkspaceUser(workspace,
|
|
79402
|
-
const email = removePathPrefix(removeType(
|
|
79479
|
+
async function pushWorkspaceUser(workspace, path22, user, localUser) {
|
|
79480
|
+
const email = removePathPrefix(removeType(path22, "user"), "users");
|
|
79403
79481
|
debug(`Processing local user ${email}`);
|
|
79404
79482
|
if (!["operator", "developer", "admin"].includes(localUser.role)) {
|
|
79405
79483
|
throw new Error(`Invalid role for user ${email}: ${localUser.role}`);
|
|
@@ -79462,8 +79540,8 @@ async function pushWorkspaceUser(workspace, path21, user, localUser) {
|
|
|
79462
79540
|
}
|
|
79463
79541
|
}
|
|
79464
79542
|
}
|
|
79465
|
-
async function pushGroup(workspace,
|
|
79466
|
-
const name = removePathPrefix(removeType(
|
|
79543
|
+
async function pushGroup(workspace, path22, group, localGroup) {
|
|
79544
|
+
const name = removePathPrefix(removeType(path22, "group"), "groups");
|
|
79467
79545
|
debug(`Processing local group ${name}`);
|
|
79468
79546
|
try {
|
|
79469
79547
|
const remoteGroup = await getGroup({
|
|
@@ -79679,7 +79757,7 @@ async function pushInstanceGroups(opts, preview2 = false) {
|
|
|
79679
79757
|
info(colors.green("Groups pushed to the instance"));
|
|
79680
79758
|
}
|
|
79681
79759
|
}
|
|
79682
|
-
var import_yaml32, INSTANCE_USERS_PATH = "instance_users.yaml", instanceUsersPath, INSTANCE_GROUPS_PATH = "instance_groups.yaml", instanceGroupsPath,
|
|
79760
|
+
var import_yaml32, INSTANCE_USERS_PATH = "instance_users.yaml", instanceUsersPath, INSTANCE_GROUPS_PATH = "instance_groups.yaml", instanceGroupsPath, command19, user_default;
|
|
79683
79761
|
var init_user = __esm(async () => {
|
|
79684
79762
|
init_colors2();
|
|
79685
79763
|
init_mod3();
|
|
@@ -79695,29 +79773,29 @@ var init_user = __esm(async () => {
|
|
|
79695
79773
|
import_yaml32 = __toESM(require_dist(), 1);
|
|
79696
79774
|
instanceUsersPath = INSTANCE_USERS_PATH;
|
|
79697
79775
|
instanceGroupsPath = INSTANCE_GROUPS_PATH;
|
|
79698
|
-
|
|
79776
|
+
command19 = new Command().description("user related commands").action(list10).command("add", "Create a user").arguments("<email:string> [password:string]").option("--superadmin", "Specify to make the new user superadmin.").option("--company <company:string>", "Specify to set the company of the new user.").option("--name <name:string>", "Specify to set the name of the new user.").action(add3).command("remove", "Delete a user").arguments("<email:string>").action(remove2).command("create-token", "Create a new API token for the authenticated user").option("--email <email:string>", "Specify credentials to use for authentication. This will not be stored. It will only be used to exchange for a token with the API server, which will not be stored either.", {
|
|
79699
79777
|
depends: ["password"]
|
|
79700
79778
|
}).option("--password <password:string>", "Specify credentials to use for authentication. This will not be stored. It will only be used to exchange for a token with the API server, which will not be stored either.", {
|
|
79701
79779
|
depends: ["email"]
|
|
79702
79780
|
}).action(createToken2);
|
|
79703
|
-
user_default =
|
|
79781
|
+
user_default = command19;
|
|
79704
79782
|
});
|
|
79705
79783
|
|
|
79706
79784
|
// src/commands/dependencies/dependencies.ts
|
|
79707
|
-
import
|
|
79785
|
+
import fs16 from "node:fs";
|
|
79708
79786
|
async function push9(opts, filePath) {
|
|
79709
79787
|
const workspace = await resolveWorkspace(opts);
|
|
79710
79788
|
await requireLogin(opts);
|
|
79711
|
-
if (!
|
|
79789
|
+
if (!fs16.existsSync(filePath)) {
|
|
79712
79790
|
throw new Error(`File not found: ${filePath}`);
|
|
79713
79791
|
}
|
|
79714
79792
|
const content = readTextFileSync(filePath);
|
|
79715
79793
|
await pushWorkspaceDependencies(workspace.workspaceId, filePath, null, content);
|
|
79716
79794
|
}
|
|
79717
|
-
async function pushWorkspaceDependencies(workspace,
|
|
79718
|
-
const res = workspaceDependenciesPathToLanguageAndFilename(
|
|
79795
|
+
async function pushWorkspaceDependencies(workspace, path22, _befObj, newDependenciesContent) {
|
|
79796
|
+
const res = workspaceDependenciesPathToLanguageAndFilename(path22);
|
|
79719
79797
|
if (!res) {
|
|
79720
|
-
throw new Error(`Unknown workspace dependencies file format: ${
|
|
79798
|
+
throw new Error(`Unknown workspace dependencies file format: ${path22}. ` + `Valid files: package.json, requirements.in, composer.json, go.mod, modules.json`);
|
|
79721
79799
|
}
|
|
79722
79800
|
const { language, name } = res;
|
|
79723
79801
|
const displayName = name ? `named dependencies "${name}"` : `workspace default dependencies`;
|
|
@@ -79749,7 +79827,7 @@ async function pushWorkspaceDependencies(workspace, path21, _befObj, newDependen
|
|
|
79749
79827
|
});
|
|
79750
79828
|
info(colors.green(`Successfully pushed ${displayName} for ${language}`));
|
|
79751
79829
|
}
|
|
79752
|
-
var
|
|
79830
|
+
var command20, dependencies_default;
|
|
79753
79831
|
var init_dependencies = __esm(async () => {
|
|
79754
79832
|
init_colors2();
|
|
79755
79833
|
init_mod3();
|
|
@@ -79761,15 +79839,15 @@ var init_dependencies = __esm(async () => {
|
|
|
79761
79839
|
init_metadata(),
|
|
79762
79840
|
init_utils()
|
|
79763
79841
|
]);
|
|
79764
|
-
|
|
79765
|
-
dependencies_default =
|
|
79842
|
+
command20 = new Command().alias("deps").description("workspace dependencies related commands").command("push", "Push workspace dependencies from a local file").arguments("<file_path:string>").action(push9);
|
|
79843
|
+
dependencies_default = command20;
|
|
79766
79844
|
});
|
|
79767
79845
|
|
|
79768
79846
|
// src/commands/trigger/trigger.ts
|
|
79769
79847
|
import { mkdir as mkdir12, stat as stat15, writeFile as writeFile17 } from "node:fs/promises";
|
|
79770
79848
|
import { dirname as dirname17 } from "node:path";
|
|
79771
79849
|
import { sep as SEP18 } from "node:path";
|
|
79772
|
-
async function getTrigger(triggerType, workspace,
|
|
79850
|
+
async function getTrigger(triggerType, workspace, path22) {
|
|
79773
79851
|
const triggerFunctions = {
|
|
79774
79852
|
http: getHttpTrigger,
|
|
79775
79853
|
websocket: getWebsocketTrigger,
|
|
@@ -79784,10 +79862,10 @@ async function getTrigger(triggerType, workspace, path21) {
|
|
|
79784
79862
|
email: getEmailTrigger
|
|
79785
79863
|
};
|
|
79786
79864
|
const triggerFunction = triggerFunctions[triggerType];
|
|
79787
|
-
const trigger = await triggerFunction({ workspace, path:
|
|
79865
|
+
const trigger = await triggerFunction({ workspace, path: path22 });
|
|
79788
79866
|
return trigger;
|
|
79789
79867
|
}
|
|
79790
|
-
async function updateTrigger(triggerType, workspace,
|
|
79868
|
+
async function updateTrigger(triggerType, workspace, path22, trigger) {
|
|
79791
79869
|
const triggerFunctions = {
|
|
79792
79870
|
http: updateHttpTrigger,
|
|
79793
79871
|
websocket: updateWebsocketTrigger,
|
|
@@ -79802,9 +79880,9 @@ async function updateTrigger(triggerType, workspace, path21, trigger) {
|
|
|
79802
79880
|
email: updateEmailTrigger
|
|
79803
79881
|
};
|
|
79804
79882
|
const triggerFunction = triggerFunctions[triggerType];
|
|
79805
|
-
await triggerFunction({ workspace, path:
|
|
79883
|
+
await triggerFunction({ workspace, path: path22, requestBody: trigger });
|
|
79806
79884
|
}
|
|
79807
|
-
async function createTrigger(triggerType, workspace,
|
|
79885
|
+
async function createTrigger(triggerType, workspace, path22, trigger) {
|
|
79808
79886
|
const triggerFunctions = {
|
|
79809
79887
|
http: createHttpTrigger,
|
|
79810
79888
|
websocket: createWebsocketTrigger,
|
|
@@ -79819,16 +79897,16 @@ async function createTrigger(triggerType, workspace, path21, trigger) {
|
|
|
79819
79897
|
email: createEmailTrigger
|
|
79820
79898
|
};
|
|
79821
79899
|
const triggerFunction = triggerFunctions[triggerType];
|
|
79822
|
-
await triggerFunction({ workspace, path:
|
|
79900
|
+
await triggerFunction({ workspace, path: path22, requestBody: trigger });
|
|
79823
79901
|
}
|
|
79824
|
-
async function pushTrigger(triggerType, workspace,
|
|
79825
|
-
|
|
79826
|
-
debug(`Processing local ${triggerType} trigger ${
|
|
79902
|
+
async function pushTrigger(triggerType, workspace, path22, trigger, localTrigger, permissionedAsContext) {
|
|
79903
|
+
path22 = removeType(path22, triggerType + "_trigger").replaceAll(SEP18, "/");
|
|
79904
|
+
debug(`Processing local ${triggerType} trigger ${path22}`);
|
|
79827
79905
|
try {
|
|
79828
|
-
trigger = await getTrigger(triggerType, workspace,
|
|
79829
|
-
debug(`${triggerType} trigger ${
|
|
79906
|
+
trigger = await getTrigger(triggerType, workspace, path22);
|
|
79907
|
+
debug(`${triggerType} trigger ${path22} exists on remote`);
|
|
79830
79908
|
} catch {
|
|
79831
|
-
debug(`${triggerType} trigger ${
|
|
79909
|
+
debug(`${triggerType} trigger ${path22} does not exist on remote`);
|
|
79832
79910
|
}
|
|
79833
79911
|
delete localTrigger.has_permissioned_as;
|
|
79834
79912
|
const preserveFields = {};
|
|
@@ -79837,33 +79915,33 @@ async function pushTrigger(triggerType, workspace, path21, trigger, localTrigger
|
|
|
79837
79915
|
preserveFields.preserve_permissioned_as = true;
|
|
79838
79916
|
if (trigger.permissioned_as) {
|
|
79839
79917
|
preserveFields.permissioned_as = trigger.permissioned_as;
|
|
79840
|
-
info(`Preserving ${trigger.permissioned_as} as permissioned_as for trigger ${
|
|
79918
|
+
info(`Preserving ${trigger.permissioned_as} as permissioned_as for trigger ${path22}`);
|
|
79841
79919
|
}
|
|
79842
79920
|
}
|
|
79843
79921
|
}
|
|
79844
79922
|
if (trigger) {
|
|
79845
79923
|
if (isSuperset(localTrigger, trigger)) {
|
|
79846
|
-
debug(`${triggerType} trigger ${
|
|
79924
|
+
debug(`${triggerType} trigger ${path22} is up to date`);
|
|
79847
79925
|
return;
|
|
79848
79926
|
}
|
|
79849
|
-
debug(`${triggerType} trigger ${
|
|
79927
|
+
debug(`${triggerType} trigger ${path22} is not up-to-date, updating...`);
|
|
79850
79928
|
try {
|
|
79851
|
-
await updateTrigger(triggerType, workspace,
|
|
79929
|
+
await updateTrigger(triggerType, workspace, path22, {
|
|
79852
79930
|
...localTrigger,
|
|
79853
79931
|
...preserveFields,
|
|
79854
|
-
path:
|
|
79932
|
+
path: path22
|
|
79855
79933
|
});
|
|
79856
79934
|
} catch (e) {
|
|
79857
79935
|
console.error(e.body);
|
|
79858
79936
|
throw e;
|
|
79859
79937
|
}
|
|
79860
79938
|
} else {
|
|
79861
|
-
console.log(colors.bold.yellow(`Creating new ${triggerType} trigger: ${
|
|
79939
|
+
console.log(colors.bold.yellow(`Creating new ${triggerType} trigger: ${path22}`));
|
|
79862
79940
|
try {
|
|
79863
|
-
await createTrigger(triggerType, workspace,
|
|
79941
|
+
await createTrigger(triggerType, workspace, path22, {
|
|
79864
79942
|
...localTrigger,
|
|
79865
79943
|
...preserveFields,
|
|
79866
|
-
path:
|
|
79944
|
+
path: path22
|
|
79867
79945
|
});
|
|
79868
79946
|
} catch (e) {
|
|
79869
79947
|
console.error(e.body);
|
|
@@ -79948,8 +80026,8 @@ async function pushNativeTrigger(workspace, filePath, _remoteTrigger, localTrigg
|
|
|
79948
80026
|
}
|
|
79949
80027
|
}
|
|
79950
80028
|
}
|
|
79951
|
-
async function newTrigger(opts,
|
|
79952
|
-
if (!validatePath(
|
|
80029
|
+
async function newTrigger(opts, path22) {
|
|
80030
|
+
if (!validatePath(path22)) {
|
|
79953
80031
|
return;
|
|
79954
80032
|
}
|
|
79955
80033
|
if (!opts.kind) {
|
|
@@ -79959,7 +80037,7 @@ async function newTrigger(opts, path21) {
|
|
|
79959
80037
|
throw new Error("Invalid trigger kind: " + opts.kind + ". Valid kinds: " + TRIGGER_TYPES.join(", "));
|
|
79960
80038
|
}
|
|
79961
80039
|
const kind = opts.kind;
|
|
79962
|
-
const filePath = `${
|
|
80040
|
+
const filePath = `${path22}.${kind}_trigger.yaml`;
|
|
79963
80041
|
try {
|
|
79964
80042
|
await stat15(filePath);
|
|
79965
80043
|
throw new Error("File already exists: " + filePath);
|
|
@@ -79995,7 +80073,7 @@ function printTriggerDetails(trigger, kind) {
|
|
|
79995
80073
|
console.log(colors.bold(label + ":") + " " + display);
|
|
79996
80074
|
}
|
|
79997
80075
|
}
|
|
79998
|
-
async function get8(opts,
|
|
80076
|
+
async function get8(opts, path22) {
|
|
79999
80077
|
if (opts.json)
|
|
80000
80078
|
setSilent(true);
|
|
80001
80079
|
const workspace = await resolveWorkspace(opts);
|
|
@@ -80004,7 +80082,7 @@ async function get8(opts, path21) {
|
|
|
80004
80082
|
if (!checkIfValidTrigger(opts.kind)) {
|
|
80005
80083
|
throw new Error("Invalid trigger kind: " + opts.kind + ". Valid kinds: " + TRIGGER_TYPES.join(", "));
|
|
80006
80084
|
}
|
|
80007
|
-
const trigger = await getTrigger(opts.kind, workspace.workspaceId,
|
|
80085
|
+
const trigger = await getTrigger(opts.kind, workspace.workspaceId, path22);
|
|
80008
80086
|
if (opts.json) {
|
|
80009
80087
|
console.log(JSON.stringify(trigger));
|
|
80010
80088
|
} else {
|
|
@@ -80015,12 +80093,12 @@ async function get8(opts, path21) {
|
|
|
80015
80093
|
const matches = [];
|
|
80016
80094
|
for (const kind of TRIGGER_TYPES) {
|
|
80017
80095
|
try {
|
|
80018
|
-
const trigger = await getTrigger(kind, workspace.workspaceId,
|
|
80096
|
+
const trigger = await getTrigger(kind, workspace.workspaceId, path22);
|
|
80019
80097
|
matches.push({ kind, trigger });
|
|
80020
80098
|
} catch {}
|
|
80021
80099
|
}
|
|
80022
80100
|
if (matches.length === 0) {
|
|
80023
|
-
throw new Error("No trigger found at path: " +
|
|
80101
|
+
throw new Error("No trigger found at path: " + path22);
|
|
80024
80102
|
}
|
|
80025
80103
|
if (matches.length === 1) {
|
|
80026
80104
|
const { kind, trigger } = matches[0];
|
|
@@ -80031,7 +80109,7 @@ async function get8(opts, path21) {
|
|
|
80031
80109
|
}
|
|
80032
80110
|
return;
|
|
80033
80111
|
}
|
|
80034
|
-
console.log("Multiple triggers found at path " +
|
|
80112
|
+
console.log("Multiple triggers found at path " + path22 + ":");
|
|
80035
80113
|
for (const m of matches) {
|
|
80036
80114
|
console.log(" - " + m.kind);
|
|
80037
80115
|
}
|
|
@@ -80131,7 +80209,7 @@ async function push10(opts, filePath, remotePath) {
|
|
|
80131
80209
|
await pushTrigger(triggerKind, workspace.workspaceId, remotePath, undefined, parseFromFile(filePath));
|
|
80132
80210
|
console.log(colors.bold.underline.green("Trigger pushed"));
|
|
80133
80211
|
}
|
|
80134
|
-
var import_yaml34, triggerTemplates, TRIGGER_SKIP_FIELDS,
|
|
80212
|
+
var import_yaml34, triggerTemplates, TRIGGER_SKIP_FIELDS, command21, trigger_default;
|
|
80135
80213
|
var init_trigger = __esm(async () => {
|
|
80136
80214
|
init_services_gen();
|
|
80137
80215
|
init_mod3();
|
|
@@ -80244,7 +80322,7 @@ var init_trigger = __esm(async () => {
|
|
|
80244
80322
|
}
|
|
80245
80323
|
};
|
|
80246
80324
|
TRIGGER_SKIP_FIELDS = new Set(["workspace_id", "extra_perms", "edited_by", "edited_at"]);
|
|
80247
|
-
|
|
80325
|
+
command21 = new Command().description("trigger related commands").option("--json", "Output as JSON (for piping to jq)").action(list11).command("list", "list all triggers").option("--json", "Output as JSON (for piping to jq)").action(list11).command("get", "get a trigger's details").arguments("<path:string>").option("--json", "Output as JSON (for piping to jq)").option("--kind <kind:string>", "Trigger kind (http, websocket, kafka, nats, postgres, mqtt, amqp, sqs, gcp, azure, email). Recommended for faster lookup").action(get8).command("new", "create a new trigger locally").arguments("<path:string>").option("--kind <kind:string>", "Trigger kind (required: http, websocket, kafka, nats, postgres, mqtt, amqp, sqs, gcp, azure, email)").action(newTrigger).command("push", "push a local trigger spec. This overrides any remote versions.").arguments("<file_path:string> <remote_path:string>").action(push10).command("set-permissioned-as", "Set the email (run-as user) for a trigger (requires admin or wm_deployers group)").arguments("<path:string> <email:string>").option("--kind <kind:string>", "Trigger kind (required: http, websocket, kafka, nats, postgres, mqtt, amqp, sqs, gcp, azure, email)").action(async (opts, triggerPath, email) => {
|
|
80248
80326
|
const workspace = await resolveWorkspace(opts);
|
|
80249
80327
|
await requireLogin(opts);
|
|
80250
80328
|
if (!opts.kind) {
|
|
@@ -80267,11 +80345,11 @@ var init_trigger = __esm(async () => {
|
|
|
80267
80345
|
});
|
|
80268
80346
|
info(colors.green(`Updated permissioned_as for ${opts.kind} trigger ${triggerPath} to ${email} (username: ${username})`));
|
|
80269
80347
|
});
|
|
80270
|
-
trigger_default =
|
|
80348
|
+
trigger_default = command21;
|
|
80271
80349
|
});
|
|
80272
80350
|
|
|
80273
80351
|
// src/types.ts
|
|
80274
|
-
import * as
|
|
80352
|
+
import * as path22 from "node:path";
|
|
80275
80353
|
import { sep as SEP19 } from "node:path";
|
|
80276
80354
|
function isSuperset(subset, superset) {
|
|
80277
80355
|
return Object.keys(subset).every((key) => {
|
|
@@ -80315,11 +80393,11 @@ function showDiff(local, remote) {
|
|
|
80315
80393
|
}
|
|
80316
80394
|
info(finalString);
|
|
80317
80395
|
}
|
|
80318
|
-
function showConflict(
|
|
80319
|
-
info(colors.yellow(`- ${
|
|
80396
|
+
function showConflict(path23, local, remote) {
|
|
80397
|
+
info(colors.yellow(`- ${path23}`));
|
|
80320
80398
|
let isEncryptionKey = false;
|
|
80321
80399
|
try {
|
|
80322
|
-
isEncryptionKey = getTypeStrFromPath(
|
|
80400
|
+
isEncryptionKey = getTypeStrFromPath(path23) === "encryption_key";
|
|
80323
80401
|
} catch {}
|
|
80324
80402
|
if (isEncryptionKey) {
|
|
80325
80403
|
showDiff(redactEncryptionKey(local), redactEncryptionKey(remote));
|
|
@@ -80476,7 +80554,7 @@ function getTypeStrFromPath(p) {
|
|
|
80476
80554
|
if (isFileResource(p) || isFilesetResource(p)) {
|
|
80477
80555
|
return "resource";
|
|
80478
80556
|
}
|
|
80479
|
-
const parsed =
|
|
80557
|
+
const parsed = path22.parse(p);
|
|
80480
80558
|
if (parsed.ext == ".go" || parsed.ext == ".ts" || parsed.ext == ".sh" || parsed.ext == ".py" || parsed.ext == ".sql" || parsed.ext == ".gql" || parsed.ext == ".ps1" || parsed.ext == ".js" || parsed.ext == ".php" || parsed.ext == ".rs" || parsed.ext == ".cs" || parsed.ext == ".nu" || parsed.ext == ".java" || parsed.ext == ".rb" || parsed.ext == ".r" || parsed.ext == ".yml" && parsed.name.split(".").pop() == "playbook" || isDbtDescriptorPath(p)) {
|
|
80481
80559
|
return "script";
|
|
80482
80560
|
}
|
|
@@ -80500,7 +80578,7 @@ function getTypeStrFromPath(p) {
|
|
|
80500
80578
|
}
|
|
80501
80579
|
}
|
|
80502
80580
|
function removeType(str, type) {
|
|
80503
|
-
const normalizedStr =
|
|
80581
|
+
const normalizedStr = path22.normalize(str).replaceAll(SEP19, "/");
|
|
80504
80582
|
if (normalizedStr.endsWith("." + type + ".yaml") || normalizedStr.endsWith("." + type + ".json")) {
|
|
80505
80583
|
return normalizedStr.slice(0, normalizedStr.length - type.length - 6);
|
|
80506
80584
|
}
|
|
@@ -80510,7 +80588,7 @@ function removeType(str, type) {
|
|
|
80510
80588
|
return normalizedStr;
|
|
80511
80589
|
}
|
|
80512
80590
|
function extractNativeTriggerInfo(p) {
|
|
80513
|
-
const normalizedPath =
|
|
80591
|
+
const normalizedPath = path22.normalize(p).replaceAll(SEP19, "/");
|
|
80514
80592
|
const withoutExt = normalizedPath.replace(/\.(json|yaml)$/, "");
|
|
80515
80593
|
const match2 = withoutExt.match(/^(.+)\.(flow|script)\.([^.]+)\.(\w+)_native_trigger$/);
|
|
80516
80594
|
if (!match2) {
|
|
@@ -80524,8 +80602,8 @@ function extractNativeTriggerInfo(p) {
|
|
|
80524
80602
|
};
|
|
80525
80603
|
}
|
|
80526
80604
|
function removePathPrefix(str, prefix) {
|
|
80527
|
-
const normalizedStr =
|
|
80528
|
-
const normalizedPrefix =
|
|
80605
|
+
const normalizedStr = path22.normalize(str).replaceAll(SEP19, "/");
|
|
80606
|
+
const normalizedPrefix = path22.normalize(prefix).replaceAll(SEP19, "/");
|
|
80529
80607
|
if (normalizedStr === normalizedPrefix) {
|
|
80530
80608
|
return "";
|
|
80531
80609
|
}
|
|
@@ -80701,7 +80779,7 @@ var init_local_path_scripts = __esm(async () => {
|
|
|
80701
80779
|
|
|
80702
80780
|
// src/commands/flow/flow.ts
|
|
80703
80781
|
import { dirname as dirname18, sep as SEP20 } from "node:path";
|
|
80704
|
-
import { mkdirSync as
|
|
80782
|
+
import { mkdirSync as mkdirSync8, writeFileSync as writeFileSync8 } from "node:fs";
|
|
80705
80783
|
function normalizeOptionalString(value) {
|
|
80706
80784
|
return typeof value === "string" && value.trim() === "" ? undefined : value ?? undefined;
|
|
80707
80785
|
}
|
|
@@ -80743,12 +80821,12 @@ function warnAboutLocalPathScriptDivergence(divergence) {
|
|
|
80743
80821
|
const details = [];
|
|
80744
80822
|
if (divergence.changed.length > 0) {
|
|
80745
80823
|
details.push(`These workspace scripts differ from the deployed version:
|
|
80746
|
-
${divergence.changed.map((
|
|
80824
|
+
${divergence.changed.map((path23) => `- ${path23}`).join(`
|
|
80747
80825
|
`)}`);
|
|
80748
80826
|
}
|
|
80749
80827
|
if (divergence.missing.length > 0) {
|
|
80750
80828
|
details.push(`These scripts do not exist in the workspace yet:
|
|
80751
|
-
${divergence.missing.map((
|
|
80829
|
+
${divergence.missing.map((path23) => `- ${path23}`).join(`
|
|
80752
80830
|
`)}`);
|
|
80753
80831
|
}
|
|
80754
80832
|
warn(`Using local PathScript files for flow preview.
|
|
@@ -80797,7 +80875,7 @@ async function pushFlow(workspace, remotePath, localPath, message, permissionedA
|
|
|
80797
80875
|
localPath += SEP20;
|
|
80798
80876
|
}
|
|
80799
80877
|
const localFlow = await yamlParseFile(localPath + "flow.yaml");
|
|
80800
|
-
const fileReader = async (
|
|
80878
|
+
const fileReader = async (path23) => await readTextFile(localPath + path23);
|
|
80801
80879
|
const missingFiles = [];
|
|
80802
80880
|
await replaceInlineScripts(localFlow.value.modules, fileReader, exports_log, localPath, SEP20, undefined, missingFiles);
|
|
80803
80881
|
if (localFlow.value.failure_module) {
|
|
@@ -80899,14 +80977,14 @@ async function list12(opts) {
|
|
|
80899
80977
|
new Table2().header(["path", "summary", "edited by"]).padding(2).border(true).body(total.map((x) => [x.path, x.summary, x.edited_by])).render();
|
|
80900
80978
|
}
|
|
80901
80979
|
}
|
|
80902
|
-
async function get9(opts,
|
|
80980
|
+
async function get9(opts, path23) {
|
|
80903
80981
|
if (opts.json)
|
|
80904
80982
|
setSilent(true);
|
|
80905
80983
|
const workspace = await resolveWorkspace(opts);
|
|
80906
80984
|
await requireLogin(opts);
|
|
80907
80985
|
const f = await getFlowByPath({
|
|
80908
80986
|
workspace: workspace.workspaceId,
|
|
80909
|
-
path:
|
|
80987
|
+
path: path23
|
|
80910
80988
|
});
|
|
80911
80989
|
if (opts.json) {
|
|
80912
80990
|
console.log(JSON.stringify(f));
|
|
@@ -80944,7 +81022,7 @@ async function get9(opts, path22) {
|
|
|
80944
81022
|
}
|
|
80945
81023
|
}
|
|
80946
81024
|
}
|
|
80947
|
-
async function run3(opts,
|
|
81025
|
+
async function run3(opts, path23) {
|
|
80948
81026
|
if (opts.silent) {
|
|
80949
81027
|
setSilent(true);
|
|
80950
81028
|
}
|
|
@@ -80955,7 +81033,7 @@ async function run3(opts, path22) {
|
|
|
80955
81033
|
try {
|
|
80956
81034
|
const flow = await getFlowByPath({
|
|
80957
81035
|
workspace: workspace.workspaceId,
|
|
80958
|
-
path:
|
|
81036
|
+
path: path23
|
|
80959
81037
|
});
|
|
80960
81038
|
validateRequiredArgs(flow.schema);
|
|
80961
81039
|
} catch (e) {
|
|
@@ -80966,7 +81044,7 @@ async function run3(opts, path22) {
|
|
|
80966
81044
|
}
|
|
80967
81045
|
const id = await runFlowByPath({
|
|
80968
81046
|
workspace: workspace.workspaceId,
|
|
80969
|
-
path:
|
|
81047
|
+
path: path23,
|
|
80970
81048
|
tag: opts.tag,
|
|
80971
81049
|
requestBody: input
|
|
80972
81050
|
});
|
|
@@ -81031,7 +81109,7 @@ async function run3(opts, path22) {
|
|
|
81031
81109
|
forLoopFailed = refreshedModule.type === "Failure";
|
|
81032
81110
|
break;
|
|
81033
81111
|
}
|
|
81034
|
-
await new Promise((
|
|
81112
|
+
await new Promise((resolve11) => setTimeout(resolve11, 200));
|
|
81035
81113
|
}
|
|
81036
81114
|
if (forLoopFailed)
|
|
81037
81115
|
break;
|
|
@@ -81047,7 +81125,7 @@ async function run3(opts, path22) {
|
|
|
81047
81125
|
info(colors.dim(status));
|
|
81048
81126
|
lastStatus = status;
|
|
81049
81127
|
}
|
|
81050
|
-
await new Promise((
|
|
81128
|
+
await new Promise((resolve11, _) => setTimeout(() => resolve11(undefined), 100));
|
|
81051
81129
|
if (isCompleted)
|
|
81052
81130
|
break;
|
|
81053
81131
|
continue;
|
|
@@ -81083,7 +81161,7 @@ async function run3(opts, path22) {
|
|
|
81083
81161
|
break;
|
|
81084
81162
|
} catch {
|
|
81085
81163
|
retries++;
|
|
81086
|
-
await new Promise((
|
|
81164
|
+
await new Promise((resolve11) => setTimeout(resolve11, 100));
|
|
81087
81165
|
}
|
|
81088
81166
|
}
|
|
81089
81167
|
if (retries >= MAX_RETRIES) {
|
|
@@ -81113,7 +81191,7 @@ async function preview2(opts, flowPath) {
|
|
|
81113
81191
|
flowPath += SEP20;
|
|
81114
81192
|
}
|
|
81115
81193
|
const localFlow = await yamlParseFile(flowPath + "flow.yaml");
|
|
81116
|
-
const fileReader = async (
|
|
81194
|
+
const fileReader = async (path23) => await readTextFile(flowPath + path23);
|
|
81117
81195
|
await replaceInlineScripts(localFlow.value.modules, fileReader, exports_log, flowPath, SEP20);
|
|
81118
81196
|
if (localFlow.value.failure_module) {
|
|
81119
81197
|
await replaceInlineScripts([localFlow.value.failure_module], fileReader, exports_log, flowPath, SEP20);
|
|
@@ -81378,7 +81456,7 @@ async function bootstrap2(opts, flowPath) {
|
|
|
81378
81456
|
}
|
|
81379
81457
|
await loadNonDottedPathsSetting();
|
|
81380
81458
|
const flowDirFullPath = buildFolderPath(flowPath, "flow");
|
|
81381
|
-
|
|
81459
|
+
mkdirSync8(flowDirFullPath, { recursive: true });
|
|
81382
81460
|
const newFlowDefinition = defaultFlowDefinition();
|
|
81383
81461
|
if (opts.summary !== undefined) {
|
|
81384
81462
|
newFlowDefinition.summary = opts.summary;
|
|
@@ -81389,7 +81467,7 @@ async function bootstrap2(opts, flowPath) {
|
|
|
81389
81467
|
const newFlowDefinitionYaml = import_yaml37.stringify(newFlowDefinition);
|
|
81390
81468
|
const metadataFile = getMetadataFileName("flow", "yaml");
|
|
81391
81469
|
const flowYamlPath = `${flowDirFullPath}/${metadataFile}`;
|
|
81392
|
-
|
|
81470
|
+
writeFileSync8(flowYamlPath, newFlowDefinitionYaml, { flag: "wx", encoding: "utf-8" });
|
|
81393
81471
|
info(colors.green(`Created flow at ${flowDirFullPath}`));
|
|
81394
81472
|
info("");
|
|
81395
81473
|
info(colors.bold("To preview this flow:"));
|
|
@@ -81442,7 +81520,7 @@ async function showVersion(opts, flowPath, version) {
|
|
|
81442
81520
|
console.log(JSON.stringify(flow.value, null, 2));
|
|
81443
81521
|
}
|
|
81444
81522
|
}
|
|
81445
|
-
var import_yaml37, alreadySynced3,
|
|
81523
|
+
var import_yaml37, alreadySynced3, command22, flow_default;
|
|
81446
81524
|
var init_flow = __esm(async () => {
|
|
81447
81525
|
init_colors2();
|
|
81448
81526
|
init_mod3();
|
|
@@ -81468,7 +81546,7 @@ var init_flow = __esm(async () => {
|
|
|
81468
81546
|
]);
|
|
81469
81547
|
import_yaml37 = __toESM(require_dist(), 1);
|
|
81470
81548
|
alreadySynced3 = [];
|
|
81471
|
-
|
|
81549
|
+
command22 = new Command().description("flow related commands").option("--show-archived", "Enable archived flows in output").option("--json", "Output as JSON (for piping to jq)").action(list12).command("list", "list all flows").option("--show-archived", "Enable archived flows in output").option("--json", "Output as JSON (for piping to jq)").action(list12).command("get", "get a flow's details").arguments("<path:string>").option("--json", "Output as JSON (for piping to jq)").action(get9).command("push", "push a local flow spec. This overrides any remote versions.").arguments("<file_path:string> <remote_path:string>").option("--message <message:string>", "Deployment message").action(push11).command("run", "run a flow by path.").arguments("<path:string>").option("-d --data <data:string>", "Inputs specified as a JSON string or a file using @<filename> or stdin using @-.").option("-s --silent", "Do not ouput anything other then the final output. Useful for scripting.").option("--tag <tag:string>", "Override the worker tag the run is dispatched to (e.g. to route it to dev workers instead of the flow's default tag).").action(run3).command("preview", "preview a local flow without deploying it. Runs the flow definition from local files and uses local PathScripts by default. Pass --step <id> to run only one module in isolation (resolves nested steps inside branchone/branchall/forloopflow/whileloopflow plus the special preprocessor/failure modules; supported step types: rawscript, script, flow).").arguments("<flow_path:string>").option("-d --data <data:string>", "Inputs specified as a JSON string or a file using @<filename> or stdin using @-.").option("-s --silent", "Do not output anything other then the final output. Useful for scripting.").option("--remote", "Use deployed workspace scripts for PathScript steps instead of local files.").option("--step <step_id:string>", "Run only the named step instead of the whole flow. Honors --data as the step's args and --remote / local-PathScript resolution the same way the full-flow preview does.").option("--tag <tag:string>", "Override the worker tag the preview is dispatched to (e.g. to route it to dev workers instead of the flow's default tag).").action(preview2).command("generate-locks", 'DEPRECATED: re-generate flow lock files. Use "wmill generate-metadata" instead.').arguments("[flow:file]").option("--yes", "Skip confirmation prompt").option("--dry-run", "Perform a dry run without making changes").option("-i --includes <patterns:file[]>", "Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string)").option("-e --excludes <patterns:file[]>", "Comma separated patterns to specify which file to NOT take into account.").action(generateLocks).command("new", "create a new empty flow").arguments("<flow_path:string>").option("--summary <summary:string>", "flow summary").option("--description <description:string>", "flow description").action(bootstrap2).command("bootstrap", "create a new empty flow (alias for new)").arguments("<flow_path:string>").option("--summary <summary:string>", "flow summary").option("--description <description:string>", "flow description").action(bootstrap2).command("history", "Show version history for a flow").arguments("<path:string>").option("--json", "Output as JSON (for piping to jq)").action(history2).command("show-version", "Show a specific version of a flow").arguments("<path:string> <version:string>").option("--json", "Output as JSON (for piping to jq)").action(showVersion).command("set-permissioned-as", "Set the on_behalf_of_email for a flow (requires admin or wm_deployers group)").arguments("<path:string> <email:string>").action(async (opts, flowPath, email) => {
|
|
81472
81550
|
const workspace = await resolveWorkspace(opts);
|
|
81473
81551
|
await requireLogin(opts);
|
|
81474
81552
|
const remote = await getFlowByPath({
|
|
@@ -81491,7 +81569,7 @@ var init_flow = __esm(async () => {
|
|
|
81491
81569
|
});
|
|
81492
81570
|
info(colors.green(`Updated permissioned_as for flow ${flowPath} to ${email}`));
|
|
81493
81571
|
});
|
|
81494
|
-
flow_default =
|
|
81572
|
+
flow_default = command22;
|
|
81495
81573
|
});
|
|
81496
81574
|
|
|
81497
81575
|
// src/commands/gitsync-settings/converter.ts
|
|
@@ -81634,7 +81712,7 @@ class GitSyncSettingsConverter {
|
|
|
81634
81712
|
}
|
|
81635
81713
|
|
|
81636
81714
|
// src/commands/gitsync-settings/legacySettings.ts
|
|
81637
|
-
import
|
|
81715
|
+
import process21 from "node:process";
|
|
81638
81716
|
async function handleLegacyRepositoryMigration(selectedRepo, gitSyncSettings, workspace, opts, operationName = "operation") {
|
|
81639
81717
|
if (selectedRepo.settings) {
|
|
81640
81718
|
return selectedRepo;
|
|
@@ -81644,7 +81722,7 @@ async function handleLegacyRepositoryMigration(selectedRepo, gitSyncSettings, wo
|
|
|
81644
81722
|
}
|
|
81645
81723
|
const workspaceIncludePath = gitSyncSettings.include_path;
|
|
81646
81724
|
const workspaceIncludeType = gitSyncSettings.include_type;
|
|
81647
|
-
if (!!
|
|
81725
|
+
if (!!process21.stdout.isTTY && !opts.yes) {
|
|
81648
81726
|
console.log(colors.yellow(`
|
|
81649
81727
|
⚠️ Legacy git-sync settings detected!`));
|
|
81650
81728
|
console.log(`
|
|
@@ -81750,7 +81828,7 @@ Repository "${selectedRepo.git_repo_resource_path}" has legacy settings format.`
|
|
|
81750
81828
|
console.error(` wmill gitsync-settings push
|
|
81751
81829
|
`);
|
|
81752
81830
|
}
|
|
81753
|
-
|
|
81831
|
+
process21.exit(1);
|
|
81754
81832
|
}
|
|
81755
81833
|
}
|
|
81756
81834
|
var init_legacySettings = __esm(async () => {
|
|
@@ -81795,8 +81873,8 @@ function outputResult(opts, result) {
|
|
|
81795
81873
|
error(colors.red(result.error));
|
|
81796
81874
|
}
|
|
81797
81875
|
}
|
|
81798
|
-
function normalizeRepoPath(
|
|
81799
|
-
return
|
|
81876
|
+
function normalizeRepoPath(path23) {
|
|
81877
|
+
return path23.replace(/^\$res:/, "");
|
|
81800
81878
|
}
|
|
81801
81879
|
function getOrCreateBranchConfig(config, branchName) {
|
|
81802
81880
|
if (!config.workspaces) {
|
|
@@ -82207,14 +82285,14 @@ var init_pull2 = __esm(async () => {
|
|
|
82207
82285
|
});
|
|
82208
82286
|
|
|
82209
82287
|
// src/commands/gitsync-settings/push.ts
|
|
82210
|
-
import
|
|
82288
|
+
import process22 from "node:process";
|
|
82211
82289
|
async function pushGitSyncSettings(opts) {
|
|
82212
82290
|
try {
|
|
82213
82291
|
await validateBranchConfiguration({ yes: opts.yes });
|
|
82214
82292
|
} catch (error2) {
|
|
82215
82293
|
if (error2 instanceof Error && error2.message.includes("overrides")) {
|
|
82216
82294
|
error(error2.message);
|
|
82217
|
-
|
|
82295
|
+
process22.exit(1);
|
|
82218
82296
|
}
|
|
82219
82297
|
throw error2;
|
|
82220
82298
|
}
|
|
@@ -82224,7 +82302,7 @@ async function pushGitSyncSettings(opts) {
|
|
|
82224
82302
|
const wmillYamlPath = getWmillYamlPath();
|
|
82225
82303
|
if (!wmillYamlPath) {
|
|
82226
82304
|
error(colors.red("No wmill.yaml file found. Please run 'wmill init' first to create the configuration file."));
|
|
82227
|
-
|
|
82305
|
+
process22.exit(1);
|
|
82228
82306
|
}
|
|
82229
82307
|
const localConfig = await readConfigFile();
|
|
82230
82308
|
let settings;
|
|
@@ -82340,7 +82418,7 @@ async function pushGitSyncSettings(opts) {
|
|
|
82340
82418
|
displayChanges(changes);
|
|
82341
82419
|
}
|
|
82342
82420
|
}
|
|
82343
|
-
if (!opts.yes && !!
|
|
82421
|
+
if (!opts.yes && !!process22.stdin.isTTY) {
|
|
82344
82422
|
const confirmed = await Confirm.prompt({
|
|
82345
82423
|
message: `Do you want to apply these changes to the remote?`,
|
|
82346
82424
|
default: true
|
|
@@ -82470,7 +82548,7 @@ __export(exports_gitsync_settings, {
|
|
|
82470
82548
|
gitSyncStatus: () => gitSyncStatus,
|
|
82471
82549
|
default: () => gitsync_settings_default
|
|
82472
82550
|
});
|
|
82473
|
-
var
|
|
82551
|
+
var command24, gitsync_settings_default;
|
|
82474
82552
|
var init_gitsync_settings = __esm(async () => {
|
|
82475
82553
|
init_mod3();
|
|
82476
82554
|
await __promiseAll([
|
|
@@ -82478,8 +82556,8 @@ var init_gitsync_settings = __esm(async () => {
|
|
|
82478
82556
|
init_push(),
|
|
82479
82557
|
init_status()
|
|
82480
82558
|
]);
|
|
82481
|
-
|
|
82482
|
-
gitsync_settings_default =
|
|
82559
|
+
command24 = new Command().description("Manage git-sync settings between local wmill.yaml and Windmill backend").command("pull").description("Pull git-sync settings from Windmill backend to local wmill.yaml").option("--repository <repo:string>", "Specify repository path (e.g., u/user/repo)").option("--default", "Write settings to top-level defaults instead of overrides").option("--replace", "Replace existing settings (non-interactive mode)").option("--override", "Add branch-specific override (non-interactive mode)").option("--diff", "Show differences without applying changes").option("--json-output", "Output in JSON format").option("--with-backend-settings <json:string>", "Use provided JSON settings instead of querying backend (for testing)").option("--yes", "Skip interactive prompts and use default behavior").option("--promotion <branch:string>", "Use promotionOverrides from the specified branch instead of regular overrides").action(pullGitSyncSettings).command("push").description("Push git-sync settings from local wmill.yaml to Windmill backend").option("--repository <repo:string>", "Specify repository path (e.g., u/user/repo)").option("--diff", "Show what would be pushed without applying changes").option("--json-output", "Output in JSON format").option("--with-backend-settings <json:string>", "Use provided JSON settings instead of querying backend (for testing)").option("--yes", "Skip interactive prompts and use default behavior").option("--promotion <branch:string>", "Use promotionOverrides from the specified branch instead of regular overrides").action(pushGitSyncSettings).command("status").description("Report how local changes deploy to the workspace (git push vs wmill sync push)").option("--json-output", "Output in JSON format").action(gitSyncStatus);
|
|
82560
|
+
gitsync_settings_default = command24;
|
|
82483
82561
|
});
|
|
82484
82562
|
|
|
82485
82563
|
// src/guidance/core.ts
|
|
@@ -89393,6 +89471,9 @@ app related commands
|
|
|
89393
89471
|
- \`--recording\` - Frame the app in a shell with a Record button, to capture a replayable session recording of the app under development
|
|
89394
89472
|
- \`app lint [app_folder:string]\` - Lint a raw app folder to validate structure and buildability
|
|
89395
89473
|
- \`--fix\` - Attempt to fix common issues (not implemented yet)
|
|
89474
|
+
- \`app bundle [app_folder:string]\` - Bundle a raw app folder to js/css without deploying it
|
|
89475
|
+
- \`--out <dir:string>\` - Directory to write bundle.js and bundle.css into (default: <app_folder>/dist)
|
|
89476
|
+
- \`--no-minify\` - Skip minification
|
|
89396
89477
|
- \`app new\` - create a new raw app from a template
|
|
89397
89478
|
- \`--summary <summary:string>\` - App summary (short description). Skips the prompt when provided. Triggers non-interactive mode.
|
|
89398
89479
|
- \`--path <path:string>\` - App path (e.g., f/folder/my_app or u/username/my_app). Skips the prompt when provided. Triggers non-interactive mode.
|
|
@@ -91787,17 +91868,17 @@ async function warnIfPromptsStale(opts) {
|
|
|
91787
91868
|
return;
|
|
91788
91869
|
const cwd = opts?.cwd ?? process.cwd();
|
|
91789
91870
|
let fileName = AGENTS_WMILL_FILENAME;
|
|
91790
|
-
let
|
|
91791
|
-
if (!await stat18(
|
|
91871
|
+
let path24 = `${cwd}/${fileName}`;
|
|
91872
|
+
if (!await stat18(path24).catch(() => null)) {
|
|
91792
91873
|
fileName = LEGACY_AGENTS_CLI_FILENAME;
|
|
91793
|
-
|
|
91794
|
-
if (!await stat18(
|
|
91874
|
+
path24 = `${cwd}/${fileName}`;
|
|
91875
|
+
if (!await stat18(path24).catch(() => null)) {
|
|
91795
91876
|
return;
|
|
91796
91877
|
}
|
|
91797
91878
|
}
|
|
91798
91879
|
let content;
|
|
91799
91880
|
try {
|
|
91800
|
-
content = await readTextFile(
|
|
91881
|
+
content = await readTextFile(path24);
|
|
91801
91882
|
} catch {
|
|
91802
91883
|
return;
|
|
91803
91884
|
}
|
|
@@ -91843,9 +91924,9 @@ __export(exports_tsconfig, {
|
|
|
91843
91924
|
});
|
|
91844
91925
|
import { execSync as execSync6 } from "node:child_process";
|
|
91845
91926
|
import { createHash as createHash2 } from "node:crypto";
|
|
91846
|
-
import { existsSync as
|
|
91847
|
-
import
|
|
91848
|
-
import
|
|
91927
|
+
import { existsSync as existsSync18, readFileSync as readFileSync5, writeFileSync as writeFileSync9 } from "node:fs";
|
|
91928
|
+
import path24 from "node:path";
|
|
91929
|
+
import process25 from "node:process";
|
|
91849
91930
|
function buildManagedTsconfig() {
|
|
91850
91931
|
const paths = {};
|
|
91851
91932
|
for (const dir of WORKSPACE_IMPORT_DIRS) {
|
|
@@ -91896,7 +91977,7 @@ async function refreshTsconfig(opts) {
|
|
|
91896
91977
|
const assumeYes = opts?.yes === true;
|
|
91897
91978
|
const mode = {
|
|
91898
91979
|
assumeYes,
|
|
91899
|
-
interactive: !!
|
|
91980
|
+
interactive: !!process25.stdin.isTTY && !assumeYes
|
|
91900
91981
|
};
|
|
91901
91982
|
await refreshManagedTsconfig(defaultTs2, mode);
|
|
91902
91983
|
if (defaultTs2 === "deno") {
|
|
@@ -91911,7 +91992,7 @@ async function refreshManagedTsconfig(defaultTs2, mode) {
|
|
|
91911
91992
|
}
|
|
91912
91993
|
const header = MANAGED_NOTICE + TSCONFIG_HASH_PREFIX + currentTsconfigHash() + `
|
|
91913
91994
|
`;
|
|
91914
|
-
|
|
91995
|
+
writeFileSync9(path24.join(process25.cwd(), MANAGED_TSCONFIG), header + JSON.stringify(managed, null, 2) + `
|
|
91915
91996
|
`);
|
|
91916
91997
|
info(colors.green(`Refreshed ${MANAGED_TSCONFIG}`));
|
|
91917
91998
|
await ensureUserReferencesManaged({
|
|
@@ -91947,7 +92028,7 @@ async function refreshManagedDenoImportMap(mode) {
|
|
|
91947
92028
|
for (const dir of WORKSPACE_IMPORT_DIRS) {
|
|
91948
92029
|
imports[`/${dir}/`] = `./${dir}/`;
|
|
91949
92030
|
}
|
|
91950
|
-
|
|
92031
|
+
writeFileSync9(path24.join(process25.cwd(), MANAGED_IMPORT_MAP), JSON.stringify({ imports }, null, 2) + `
|
|
91951
92032
|
`);
|
|
91952
92033
|
info(colors.green(`Refreshed ${MANAGED_IMPORT_MAP}`));
|
|
91953
92034
|
await ensureUserReferencesManaged({
|
|
@@ -91970,15 +92051,15 @@ async function refreshManagedDenoImportMap(mode) {
|
|
|
91970
92051
|
});
|
|
91971
92052
|
}
|
|
91972
92053
|
async function ensureUserReferencesManaged(opts) {
|
|
91973
|
-
const existing = [opts.file, ...opts.altFiles ?? []].map((f) =>
|
|
92054
|
+
const existing = [opts.file, ...opts.altFiles ?? []].map((f) => path24.join(process25.cwd(), f)).find((p) => existsSync18(p));
|
|
91974
92055
|
if (!existing) {
|
|
91975
|
-
const userPath =
|
|
91976
|
-
|
|
92056
|
+
const userPath = path24.join(process25.cwd(), opts.file);
|
|
92057
|
+
writeFileSync9(userPath, JSON.stringify(opts.create, null, 2) + `
|
|
91977
92058
|
`);
|
|
91978
92059
|
info(colors.green(`Created ${opts.file} (references ${opts.token})`));
|
|
91979
92060
|
return;
|
|
91980
92061
|
}
|
|
91981
|
-
const existingName =
|
|
92062
|
+
const existingName = path24.basename(existing);
|
|
91982
92063
|
let text = "";
|
|
91983
92064
|
try {
|
|
91984
92065
|
text = readFileSync5(existing, "utf-8");
|
|
@@ -91997,7 +92078,7 @@ async function ensureUserReferencesManaged(opts) {
|
|
|
91997
92078
|
return;
|
|
91998
92079
|
}
|
|
91999
92080
|
if (opts.legacyFormats?.some((fmt) => deepEqual2(parsed, fmt))) {
|
|
92000
|
-
|
|
92081
|
+
writeFileSync9(existing, JSON.stringify(opts.create, null, 2) + `
|
|
92001
92082
|
`);
|
|
92002
92083
|
info(colors.green(`Migrated previously-generated ${existingName} to reference ${opts.token}`));
|
|
92003
92084
|
return;
|
|
@@ -92016,13 +92097,13 @@ async function ensureUserReferencesManaged(opts) {
|
|
|
92016
92097
|
info(colors.gray(`Left ${existingName} unchanged — add ${opts.hint} when ready to enable ` + `workspace /f/, /u/ import resolution (or re-run \`wmill refresh tsconfig\`).`));
|
|
92017
92098
|
return;
|
|
92018
92099
|
}
|
|
92019
|
-
|
|
92100
|
+
writeFileSync9(existing, JSON.stringify(next, null, 2) + `
|
|
92020
92101
|
`);
|
|
92021
92102
|
info(colors.green(`Linked ${existingName} → ${opts.token}`));
|
|
92022
92103
|
}
|
|
92023
92104
|
function ensureBunTypesAvailable() {
|
|
92024
|
-
const cwd =
|
|
92025
|
-
if (
|
|
92105
|
+
const cwd = process25.cwd();
|
|
92106
|
+
if (existsSync18(path24.join(cwd, "node_modules", "bun-types"))) {
|
|
92026
92107
|
return true;
|
|
92027
92108
|
}
|
|
92028
92109
|
try {
|
|
@@ -92043,9 +92124,9 @@ function ensureBunTypesAvailable() {
|
|
|
92043
92124
|
}
|
|
92044
92125
|
}
|
|
92045
92126
|
async function warnIfTsconfigStale(opts) {
|
|
92046
|
-
const cwd = opts?.cwd ??
|
|
92047
|
-
const managedPath =
|
|
92048
|
-
if (!
|
|
92127
|
+
const cwd = opts?.cwd ?? process25.cwd();
|
|
92128
|
+
const managedPath = path24.join(cwd, MANAGED_TSCONFIG);
|
|
92129
|
+
if (!existsSync18(managedPath))
|
|
92049
92130
|
return;
|
|
92050
92131
|
let managedText;
|
|
92051
92132
|
try {
|
|
@@ -92063,10 +92144,10 @@ async function warnIfTsconfigStale(opts) {
|
|
|
92063
92144
|
}
|
|
92064
92145
|
}
|
|
92065
92146
|
function emitTsconfigWarning(message) {
|
|
92066
|
-
|
|
92147
|
+
process25.stderr.write(`${colors.yellow(message)}
|
|
92067
92148
|
`);
|
|
92068
92149
|
}
|
|
92069
|
-
var WORKSPACE_IMPORT_DIRS, MANAGED_TSCONFIG = "tsconfig.wmill.json", MANAGED_IMPORT_MAP = "import_map.wmill.json", MANAGED_NOTICE, TSCONFIG_HASH_PREFIX = "// wmill-tsconfig-hash: ", TSCONFIG_HASH_REGEX, LEGACY_GENERATED_TSCONFIGS,
|
|
92150
|
+
var WORKSPACE_IMPORT_DIRS, MANAGED_TSCONFIG = "tsconfig.wmill.json", MANAGED_IMPORT_MAP = "import_map.wmill.json", MANAGED_NOTICE, TSCONFIG_HASH_PREFIX = "// wmill-tsconfig-hash: ", TSCONFIG_HASH_REGEX, LEGACY_GENERATED_TSCONFIGS, command31, tsconfig_default;
|
|
92070
92151
|
var init_tsconfig = __esm(async () => {
|
|
92071
92152
|
init_colors2();
|
|
92072
92153
|
init_mod3();
|
|
@@ -92102,10 +92183,10 @@ var init_tsconfig = __esm(async () => {
|
|
|
92102
92183
|
include: ["**/*.ts", "rt.d.ts"]
|
|
92103
92184
|
}
|
|
92104
92185
|
];
|
|
92105
|
-
|
|
92186
|
+
command31 = new Command().description("Refresh the wmill-managed tsconfig.wmill.json (and Deno import map for Deno projects)").option("--yes", "Non-interactive: wire an existing custom tsconfig.json/deno.json to the managed file without prompting (a previously-generated config is always migrated automatically).").action(async (opts) => {
|
|
92106
92187
|
await refreshTsconfig({ yes: opts.yes === true });
|
|
92107
92188
|
});
|
|
92108
|
-
tsconfig_default =
|
|
92189
|
+
tsconfig_default = command31;
|
|
92109
92190
|
});
|
|
92110
92191
|
|
|
92111
92192
|
// src/main.ts
|
|
@@ -93382,8 +93463,8 @@ async function pull2(opts) {
|
|
|
93382
93463
|
await pushResourceType(workspace.workspaceId, x.name + ".resource-type.json", undefined, x);
|
|
93383
93464
|
}
|
|
93384
93465
|
}
|
|
93385
|
-
var
|
|
93386
|
-
var hub_default =
|
|
93466
|
+
var command23 = new Command().name("hub").description("Hub related commands. EXPERIMENTAL. INTERNAL USE ONLY.").command("pull").description("pull any supported definitions. EXPERIMENTAL.").action(pull2);
|
|
93467
|
+
var hub_default = command23;
|
|
93387
93468
|
|
|
93388
93469
|
// src/main.ts
|
|
93389
93470
|
await __promiseAll([
|
|
@@ -93484,27 +93565,27 @@ await __promiseAll([
|
|
|
93484
93565
|
init_context()
|
|
93485
93566
|
]);
|
|
93486
93567
|
var import_yaml40 = __toESM(require_dist(), 1);
|
|
93487
|
-
import { existsSync as
|
|
93568
|
+
import { existsSync as existsSync15 } from "node:fs";
|
|
93488
93569
|
import { writeFile as writeFile19 } from "node:fs/promises";
|
|
93489
|
-
import { dirname as dirname19, join as
|
|
93570
|
+
import { dirname as dirname19, join as join21 } from "node:path";
|
|
93490
93571
|
var PROTECTION_RULES_FILENAME = "protection-rules.yaml";
|
|
93491
93572
|
function getProtectionRulesPath() {
|
|
93492
93573
|
const wmillPath = getWmillYamlPath();
|
|
93493
93574
|
if (!wmillPath)
|
|
93494
93575
|
return null;
|
|
93495
|
-
return
|
|
93576
|
+
return join21(dirname19(wmillPath), PROTECTION_RULES_FILENAME);
|
|
93496
93577
|
}
|
|
93497
|
-
async function readProtectionRulesFile(
|
|
93498
|
-
if (!
|
|
93578
|
+
async function readProtectionRulesFile(path23) {
|
|
93579
|
+
if (!existsSync15(path23))
|
|
93499
93580
|
return {};
|
|
93500
|
-
const parsed = await yamlParseFile(
|
|
93581
|
+
const parsed = await yamlParseFile(path23);
|
|
93501
93582
|
return parsed ?? {};
|
|
93502
93583
|
}
|
|
93503
|
-
async function writeProtectionRulesFile(
|
|
93584
|
+
async function writeProtectionRulesFile(path23, data3) {
|
|
93504
93585
|
const sorted = {};
|
|
93505
93586
|
for (const k of Object.keys(data3).sort())
|
|
93506
93587
|
sorted[k] = data3[k];
|
|
93507
|
-
await writeFile19(
|
|
93588
|
+
await writeFile19(path23, import_yaml40.stringify(sorted, yamlOptions), "utf-8");
|
|
93508
93589
|
}
|
|
93509
93590
|
|
|
93510
93591
|
class WorkspaceResolver {
|
|
@@ -93549,7 +93630,7 @@ async function configureClientForWorkspace(opts, ws, resolver) {
|
|
|
93549
93630
|
// src/commands/protection-rules/utils.ts
|
|
93550
93631
|
init_colors2();
|
|
93551
93632
|
init_log();
|
|
93552
|
-
import
|
|
93633
|
+
import process23 from "node:process";
|
|
93553
93634
|
function outputResult2(opts, result) {
|
|
93554
93635
|
if (opts.jsonOutput) {
|
|
93555
93636
|
console.log(JSON.stringify(result));
|
|
@@ -93561,7 +93642,7 @@ function outputResult2(opts, result) {
|
|
|
93561
93642
|
}
|
|
93562
93643
|
function fail(opts, result) {
|
|
93563
93644
|
outputResult2(opts, { ...result, success: false });
|
|
93564
|
-
|
|
93645
|
+
process23.exit(1);
|
|
93565
93646
|
}
|
|
93566
93647
|
function describeEntry(entry) {
|
|
93567
93648
|
const n = ProtectionRulesConverter.normalizeEntry(entry);
|
|
@@ -93705,8 +93786,8 @@ await __promiseAll([
|
|
|
93705
93786
|
init_confirm(),
|
|
93706
93787
|
init_conf()
|
|
93707
93788
|
]);
|
|
93708
|
-
import
|
|
93709
|
-
import { existsSync as
|
|
93789
|
+
import process24 from "node:process";
|
|
93790
|
+
import { existsSync as existsSync16 } from "node:fs";
|
|
93710
93791
|
async function pushProtectionRules(opts, workspaceArg) {
|
|
93711
93792
|
if (opts.jsonOutput)
|
|
93712
93793
|
setSilent(true);
|
|
@@ -93716,7 +93797,7 @@ async function pushProtectionRules(opts, workspaceArg) {
|
|
|
93716
93797
|
error: "No wmill.yaml found. Run 'wmill init' first — protection-rules.yaml lives next to it."
|
|
93717
93798
|
});
|
|
93718
93799
|
}
|
|
93719
|
-
if (!
|
|
93800
|
+
if (!existsSync16(prPath)) {
|
|
93720
93801
|
fail(opts, {
|
|
93721
93802
|
error: "No protection-rules.yaml found. Run 'wmill protection-rules pull' first."
|
|
93722
93803
|
});
|
|
@@ -93786,7 +93867,7 @@ async function pushProtectionRules(opts, workspaceArg) {
|
|
|
93786
93867
|
workspaces: Object.fromEntries(wsPlans.map((w) => [w.ws, structuredPlan(w.plan)]))
|
|
93787
93868
|
}));
|
|
93788
93869
|
if (hadError)
|
|
93789
|
-
|
|
93870
|
+
process24.exit(1);
|
|
93790
93871
|
return;
|
|
93791
93872
|
}
|
|
93792
93873
|
if (!opts.jsonOutput) {
|
|
@@ -93800,7 +93881,7 @@ async function pushProtectionRules(opts, workspaceArg) {
|
|
|
93800
93881
|
error: "One or more workspaces failed (see errors above); the rest are in sync",
|
|
93801
93882
|
partialFailure: true
|
|
93802
93883
|
});
|
|
93803
|
-
|
|
93884
|
+
process24.exit(1);
|
|
93804
93885
|
}
|
|
93805
93886
|
if (!opts.dryRun) {
|
|
93806
93887
|
outputResult2(opts, {
|
|
@@ -93812,7 +93893,7 @@ async function pushProtectionRules(opts, workspaceArg) {
|
|
|
93812
93893
|
}
|
|
93813
93894
|
if (opts.dryRun) {
|
|
93814
93895
|
if (hadError)
|
|
93815
|
-
|
|
93896
|
+
process24.exit(1);
|
|
93816
93897
|
return;
|
|
93817
93898
|
}
|
|
93818
93899
|
for (const w of wsPlans) {
|
|
@@ -93821,7 +93902,7 @@ async function pushProtectionRules(opts, workspaceArg) {
|
|
|
93821
93902
|
}
|
|
93822
93903
|
}
|
|
93823
93904
|
const totalDeletes = changed.reduce((n, w) => n + w.plan.toDelete.length, 0);
|
|
93824
|
-
if (!opts.yes && !!
|
|
93905
|
+
if (!opts.yes && !!process24.stdin.isTTY) {
|
|
93825
93906
|
const confirmed = await Confirm.prompt({
|
|
93826
93907
|
message: totalDeletes > 0 ? `Apply these changes? This DELETES ${totalDeletes} protection rule(s) across ${changed.length} workspace(s).` : `Apply these changes to ${changed.length} workspace(s)?`,
|
|
93827
93908
|
default: totalDeletes === 0
|
|
@@ -93883,7 +93964,7 @@ async function pushProtectionRules(opts, workspaceArg) {
|
|
|
93883
93964
|
partialFailure: true,
|
|
93884
93965
|
...applied
|
|
93885
93966
|
});
|
|
93886
|
-
|
|
93967
|
+
process24.exit(1);
|
|
93887
93968
|
}
|
|
93888
93969
|
outputResult2(opts, {
|
|
93889
93970
|
success: true,
|
|
@@ -93893,8 +93974,8 @@ async function pushProtectionRules(opts, workspaceArg) {
|
|
|
93893
93974
|
}
|
|
93894
93975
|
|
|
93895
93976
|
// src/commands/protection-rules/protection-rules.ts
|
|
93896
|
-
var
|
|
93897
|
-
var protection_rules_default =
|
|
93977
|
+
var command25 = new Command().description("Sync workspace protection rules between protection-rules.yaml and Windmill. The file is keyed by workspace name; keys must match wmill.yaml 'workspaces'.").command("pull").description("Pull protection rules from Windmill into protection-rules.yaml for a workspace").arguments("[workspace:string]").option("--all", "Pull every workspace defined in wmill.yaml").option("--dry-run", "Show what would change without writing the file").option("--json-output", "Output in JSON format").action(pullProtectionRules).command("push").description("Push protection rules from protection-rules.yaml to Windmill for a workspace (full reconcile: creates, updates, and deletes)").arguments("[workspace:string]").option("--all", "Push every workspace defined in protection-rules.yaml").option("--dry-run", "Show what would change without applying").option("--json-output", "Output in JSON format").option("--yes", "Skip the confirmation prompt (including deletions)").action(pushProtectionRules);
|
|
93978
|
+
var protection_rules_default = command25;
|
|
93898
93979
|
|
|
93899
93980
|
// src/main.ts
|
|
93900
93981
|
await init_instance();
|
|
@@ -93978,8 +94059,8 @@ async function pushWorkerGroups(opts) {
|
|
|
93978
94059
|
await pushInstanceConfigs(opts, false);
|
|
93979
94060
|
}
|
|
93980
94061
|
}
|
|
93981
|
-
var
|
|
93982
|
-
var worker_groups_default =
|
|
94062
|
+
var command26 = new Command().description("display worker groups, pull and push worker groups configs").action(displayWorkerGroups).command("pull").description("Pull worker groups (similar to `wmill instance pull --skip-users --skip-settings --skip-groups`)").option("--instance", "Name of the instance to push to, override the active instance").option("--base-url", "Base url to be passed to the instance settings instead of the local one").option("--yes", "Pull without needing confirmation").action(pullWorkerGroups).command("push").description("Push worker groups (similar to `wmill instance push --skip-users --skip-settings --skip-groups`)").option("--instance [instance]", "Name of the instance to push to, override the active instance").option("--base-url [baseUrl]", "If used with --token, will be used as the base url for the instance").option("--yes", "Push without needing confirmation").action(pushWorkerGroups);
|
|
94063
|
+
var worker_groups_default = command26;
|
|
93983
94064
|
|
|
93984
94065
|
// src/main.ts
|
|
93985
94066
|
await init_lint();
|
|
@@ -94014,8 +94095,8 @@ import * as http3 from "node:http";
|
|
|
94014
94095
|
import * as https from "node:https";
|
|
94015
94096
|
import { access, readdir as readdir10, realpath, stat as stat17, unlink, writeFile as writeFile20 } from "node:fs/promises";
|
|
94016
94097
|
import { watch as watch2 } from "node:fs";
|
|
94017
|
-
import * as
|
|
94018
|
-
import * as
|
|
94098
|
+
import * as path23 from "node:path";
|
|
94099
|
+
import * as fs17 from "node:fs";
|
|
94019
94100
|
|
|
94020
94101
|
// src/commands/dev/pathscript-restore.ts
|
|
94021
94102
|
var TAG_KEY = "_originalPathScript";
|
|
@@ -94110,7 +94191,7 @@ var PORT = 3001;
|
|
|
94110
94191
|
var FLOW_SUFFIXES = [".flow", "__flow"];
|
|
94111
94192
|
var APP_SUFFIXES = [".app", "__app", ".raw_app", "__raw_app"];
|
|
94112
94193
|
var INLINE_SCRIPT_EXTS = new Set([
|
|
94113
|
-
...exts.map((e) =>
|
|
94194
|
+
...exts.map((e) => path23.extname("x" + e)).filter((e) => e !== ".yml"),
|
|
94114
94195
|
".js"
|
|
94115
94196
|
]);
|
|
94116
94197
|
function stripFolderSuffix(rel, suffixes) {
|
|
@@ -94151,13 +94232,13 @@ async function listWorkspacePaths() {
|
|
|
94151
94232
|
if (entry.name.startsWith(".") || entry.name === "node_modules")
|
|
94152
94233
|
continue;
|
|
94153
94234
|
const childRel = rel ? `${rel}/${entry.name}` : entry.name;
|
|
94154
|
-
const childAbs =
|
|
94235
|
+
const childAbs = path23.join(dir, entry.name);
|
|
94155
94236
|
if (entry.isDirectory()) {
|
|
94156
94237
|
if (isFlowFolderName(entry.name)) {
|
|
94157
94238
|
items.push({
|
|
94158
94239
|
path: stripFolderSuffix(childRel, FLOW_SUFFIXES),
|
|
94159
94240
|
kind: "flow",
|
|
94160
|
-
_metaPath:
|
|
94241
|
+
_metaPath: path23.join(childAbs, "flow.yaml")
|
|
94161
94242
|
});
|
|
94162
94243
|
continue;
|
|
94163
94244
|
}
|
|
@@ -94205,25 +94286,25 @@ async function listWorkspacePaths() {
|
|
|
94205
94286
|
async function dev2(opts) {
|
|
94206
94287
|
if (!opts.path) {
|
|
94207
94288
|
const cwd = process.cwd();
|
|
94208
|
-
const cwdBasename =
|
|
94289
|
+
const cwdBasename = path23.basename(cwd);
|
|
94209
94290
|
await loadNonDottedPathsSetting();
|
|
94210
94291
|
if (isFlowFolderName(cwdBasename)) {
|
|
94211
94292
|
GLOBAL_CONFIG_OPT.noCdToRoot = true;
|
|
94212
94293
|
let searchDir = cwd;
|
|
94213
94294
|
let workspaceRoot;
|
|
94214
94295
|
while (true) {
|
|
94215
|
-
const wmillYaml =
|
|
94216
|
-
if (
|
|
94296
|
+
const wmillYaml = path23.join(searchDir, "wmill.yaml");
|
|
94297
|
+
if (fs17.existsSync(wmillYaml)) {
|
|
94217
94298
|
workspaceRoot = searchDir;
|
|
94218
94299
|
break;
|
|
94219
94300
|
}
|
|
94220
|
-
const parentDir =
|
|
94301
|
+
const parentDir = path23.dirname(searchDir);
|
|
94221
94302
|
if (parentDir === searchDir)
|
|
94222
94303
|
break;
|
|
94223
94304
|
searchDir = parentDir;
|
|
94224
94305
|
}
|
|
94225
94306
|
if (workspaceRoot) {
|
|
94226
|
-
const relPath =
|
|
94307
|
+
const relPath = path23.relative(workspaceRoot, cwd).replaceAll("\\", "/");
|
|
94227
94308
|
opts.path = stripFolderSuffix(relPath, FLOW_SUFFIXES);
|
|
94228
94309
|
info(`Detected flow folder, path: ${opts.path}`);
|
|
94229
94310
|
process.chdir(workspaceRoot);
|
|
@@ -94316,7 +94397,7 @@ async function dev2(opts) {
|
|
|
94316
94397
|
return;
|
|
94317
94398
|
const wmFlowPath = stripFolderSuffix(localPath.replace(/\/$/, ""), FLOW_SUFFIXES);
|
|
94318
94399
|
const localFlow = await yamlParseFile(localPath + "flow.yaml");
|
|
94319
|
-
await replaceInlineScripts(localFlow.value.modules, async (
|
|
94400
|
+
await replaceInlineScripts(localFlow.value.modules, async (path24) => await readTextFile(localPath + path24), exports_log, localPath, SEP21, undefined);
|
|
94320
94401
|
snapshotPathScripts(localFlow.value);
|
|
94321
94402
|
const localScriptReader = createPreviewLocalScriptReader({
|
|
94322
94403
|
exts,
|
|
@@ -94486,7 +94567,7 @@ async function dev2(opts) {
|
|
|
94486
94567
|
for (const file of dirFiles) {
|
|
94487
94568
|
if (file === "flow.yaml" || file === "flow.json" || file.startsWith("."))
|
|
94488
94569
|
continue;
|
|
94489
|
-
if (!INLINE_SCRIPT_EXTS.has(
|
|
94570
|
+
if (!INLINE_SCRIPT_EXTS.has(path23.extname(file)))
|
|
94490
94571
|
continue;
|
|
94491
94572
|
if (!extractedPaths.has(file)) {
|
|
94492
94573
|
await unlink(flowDir + file);
|
|
@@ -94678,7 +94759,7 @@ async function dev2(opts) {
|
|
|
94678
94759
|
}
|
|
94679
94760
|
socket.destroy();
|
|
94680
94761
|
});
|
|
94681
|
-
return new Promise((
|
|
94762
|
+
return new Promise((resolve11) => {
|
|
94682
94763
|
proxyServer.listen(proxyPort, BIND_HOST, () => {
|
|
94683
94764
|
console.log(`Dev proxy listening on http://localhost:${proxyPort}`);
|
|
94684
94765
|
if (opts.path) {
|
|
@@ -94688,7 +94769,7 @@ async function dev2(opts) {
|
|
|
94688
94769
|
console.log("(pass --path <path> to skip the picker)");
|
|
94689
94770
|
}
|
|
94690
94771
|
maybeOpenBrowser(`http://localhost:${proxyPort}/`);
|
|
94691
|
-
|
|
94772
|
+
resolve11();
|
|
94692
94773
|
});
|
|
94693
94774
|
});
|
|
94694
94775
|
}
|
|
@@ -94724,8 +94805,8 @@ async function dev2(opts) {
|
|
|
94724
94805
|
await Promise.all([startServer(), watchChanges()]);
|
|
94725
94806
|
console.log("Stopped dev mode");
|
|
94726
94807
|
}
|
|
94727
|
-
var
|
|
94728
|
-
var dev_default2 =
|
|
94808
|
+
var command27 = new Command().description("Watch local file changes and live-reload the dev page for preview. Does NOT deploy to the remote workspace — use wmill sync push for that.").option("--includes <pattern...:string>", "Filter paths given a glob pattern or path").option("--proxy-port <port:number>", "Port for a localhost reverse proxy to the remote Windmill server").option("--path <path:string>", "Watch a specific windmill path (e.g., u/admin/my_script or f/my_flow)").option("--no-open", "Do not open the browser automatically").action(dev2);
|
|
94809
|
+
var dev_default2 = command27;
|
|
94729
94810
|
|
|
94730
94811
|
// src/main.ts
|
|
94731
94812
|
init_gen();
|
|
@@ -94794,9 +94875,9 @@ class NpmProvider extends Provider {
|
|
|
94794
94875
|
if (verbose)
|
|
94795
94876
|
process.stderr.write(d);
|
|
94796
94877
|
});
|
|
94797
|
-
const exitCode = await new Promise((
|
|
94878
|
+
const exitCode = await new Promise((resolve11, reject) => {
|
|
94798
94879
|
proc.on("error", reject);
|
|
94799
|
-
proc.on("close",
|
|
94880
|
+
proc.on("close", resolve11);
|
|
94800
94881
|
}).catch((e) => {
|
|
94801
94882
|
throw new Error(`failed to run npm: ${e instanceof Error ? e.message : e}
|
|
94802
94883
|
|
|
@@ -94882,8 +94963,8 @@ Worker Group: ${group.groupName} (${group.workers.length} workers)`);
|
|
|
94882
94963
|
info("Use 'wmill instance add' to add a new instance");
|
|
94883
94964
|
}
|
|
94884
94965
|
}
|
|
94885
|
-
var
|
|
94886
|
-
var workers_default =
|
|
94966
|
+
var command28 = new Command().description("List all workers grouped by worker groups").option("--instance [instance]", "Name of the instance to push to, override the active instance").option("--base-url [baseUrl]", "If used with --token, will be used as the base url for the instance").action(displayWorkers);
|
|
94967
|
+
var workers_default = command28;
|
|
94887
94968
|
|
|
94888
94969
|
// src/commands/queues/queues.ts
|
|
94889
94970
|
init_mod3();
|
|
@@ -94991,8 +95072,8 @@ async function displayQueues(opts, workspace) {
|
|
|
94991
95072
|
info("Use 'wmill instance add' to add a new instance");
|
|
94992
95073
|
}
|
|
94993
95074
|
}
|
|
94994
|
-
var
|
|
94995
|
-
var queues_default =
|
|
95075
|
+
var command29 = new Command().description("List all queues with their metrics").arguments("[workspace:string] the optional workspace to filter by (default to all workspaces)").option("--instance [instance]", "Name of the instance to push to, override the active instance").option("--base-url [baseUrl]", "If used with --token, will be used as the base url for the instance").action(displayQueues);
|
|
95076
|
+
var queues_default = command29;
|
|
94996
95077
|
|
|
94997
95078
|
// src/main.ts
|
|
94998
95079
|
await init_dependencies();
|
|
@@ -95492,7 +95573,7 @@ await __promiseAll([
|
|
|
95492
95573
|
init_freshness()
|
|
95493
95574
|
]);
|
|
95494
95575
|
import { cp, mkdir as mkdir13, readdir as readdir11, rm as rm6, stat as stat19, writeFile as writeFile21 } from "node:fs/promises";
|
|
95495
|
-
import { join as
|
|
95576
|
+
import { join as join23 } from "node:path";
|
|
95496
95577
|
var WMILL_INIT_AI_SKILLS_SOURCE_ENV = "WMILL_INIT_AI_SKILLS_SOURCE";
|
|
95497
95578
|
var WMILL_INIT_AI_AGENTS_SOURCE_ENV = "WMILL_INIT_AI_AGENTS_SOURCE";
|
|
95498
95579
|
var WMILL_INIT_AI_CLAUDE_SOURCE_ENV = "WMILL_INIT_AI_CLAUDE_SOURCE";
|
|
@@ -95505,20 +95586,20 @@ async function writeAiGuidanceFiles(options) {
|
|
|
95505
95586
|
const skillMetadata = options.skillsSourcePath ? await readSkillMetadataFromDirectory(options.skillsSourcePath) : getGeneratedSkillMetadata();
|
|
95506
95587
|
const rawAgentsCliContent = options.agentsSourcePath != null ? await readTextFile(options.agentsSourcePath) : generateAgentsCliMdContent(buildSkillsReference(skillMetadata));
|
|
95507
95588
|
const agentsCliContent = injectPromptsHashMarker(rawAgentsCliContent, currentPromptsHash(nonDottedPaths));
|
|
95508
|
-
const agentsCliPath =
|
|
95589
|
+
const agentsCliPath = join23(options.targetDir, AGENTS_WMILL_FILENAME);
|
|
95509
95590
|
await writeFile21(agentsCliPath, agentsCliContent, "utf8");
|
|
95510
95591
|
const agentsCliWritten = true;
|
|
95511
95592
|
const legacyManagedRemoved = await migrateLegacyManagedFile(options.targetDir);
|
|
95512
95593
|
const resolveMigration = cacheOnce(options.resolveAgentsMdMigration);
|
|
95513
95594
|
const agentsMdResult = await reconcileIncludingFile({
|
|
95514
|
-
path:
|
|
95595
|
+
path: join23(options.targetDir, "AGENTS.md"),
|
|
95515
95596
|
includeLine: AGENTS_WMILL_INCLUDE_LINE,
|
|
95516
95597
|
skeleton: generateAgentsMdSkeleton(),
|
|
95517
95598
|
resolveMigration
|
|
95518
95599
|
});
|
|
95519
95600
|
const claudeSkeleton = options.claudeSourcePath != null ? await readTextFile(options.claudeSourcePath) : CLAUDE_MD_DEFAULT;
|
|
95520
95601
|
const claudeMdResult = await reconcileIncludingFile({
|
|
95521
|
-
path:
|
|
95602
|
+
path: join23(options.targetDir, "CLAUDE.md"),
|
|
95522
95603
|
includeLine: CLAUDE_MD_INCLUDE_LINE,
|
|
95523
95604
|
skeleton: claudeSkeleton,
|
|
95524
95605
|
resolveMigration
|
|
@@ -95540,7 +95621,7 @@ async function writeAiGuidanceFiles(options) {
|
|
|
95540
95621
|
}
|
|
95541
95622
|
async function migrateLegacyManagedFile(targetDir) {
|
|
95542
95623
|
for (const fileName of ["AGENTS.md", "CLAUDE.md"]) {
|
|
95543
|
-
const filePath =
|
|
95624
|
+
const filePath = join23(targetDir, fileName);
|
|
95544
95625
|
const existing = await readTextFile(filePath).catch(() => null);
|
|
95545
95626
|
if (existing == null)
|
|
95546
95627
|
continue;
|
|
@@ -95549,7 +95630,7 @@ async function migrateLegacyManagedFile(targetDir) {
|
|
|
95549
95630
|
await writeFile21(filePath, rewritten, "utf8");
|
|
95550
95631
|
}
|
|
95551
95632
|
}
|
|
95552
|
-
const legacyPath =
|
|
95633
|
+
const legacyPath = join23(targetDir, LEGACY_AGENTS_CLI_FILENAME);
|
|
95553
95634
|
const legacyExists = await stat19(legacyPath).catch(() => null) != null;
|
|
95554
95635
|
if (legacyExists) {
|
|
95555
95636
|
await rm6(legacyPath, { force: true });
|
|
@@ -95626,9 +95707,9 @@ async function copySkillsFromSource(targetDir, skillsSourcePath) {
|
|
|
95626
95707
|
async function writeGeneratedSkills(targetDir, nonDottedPaths) {
|
|
95627
95708
|
const skillsDirs = await ensureSkillsDirectories(targetDir);
|
|
95628
95709
|
await Promise.all(skillsDirs.flatMap((skillsDir) => SKILLS.map(async (skill) => {
|
|
95629
|
-
const skillDir =
|
|
95710
|
+
const skillDir = join23(skillsDir, skill.name);
|
|
95630
95711
|
await mkdir13(skillDir, { recursive: true });
|
|
95631
|
-
await writeFile21(
|
|
95712
|
+
await writeFile21(join23(skillDir, "SKILL.md"), renderGeneratedSkillContent(skill.name, nonDottedPaths), "utf8");
|
|
95632
95713
|
})));
|
|
95633
95714
|
return SKILLS.map((skill) => ({
|
|
95634
95715
|
...skill,
|
|
@@ -95642,14 +95723,14 @@ function getGeneratedSkillMetadata() {
|
|
|
95642
95723
|
}));
|
|
95643
95724
|
}
|
|
95644
95725
|
async function ensureSkillsDirectories(targetDir) {
|
|
95645
|
-
const skillsDirs = SKILL_TARGET_ROOTS.map((root) =>
|
|
95726
|
+
const skillsDirs = SKILL_TARGET_ROOTS.map((root) => join23(targetDir, root, "skills"));
|
|
95646
95727
|
await Promise.all(skillsDirs.map((skillsDir) => mkdir13(skillsDir, { recursive: true })));
|
|
95647
95728
|
return skillsDirs;
|
|
95648
95729
|
}
|
|
95649
95730
|
async function copyDirectoryContents(sourceDir, targetDir) {
|
|
95650
95731
|
const entries = await readdir11(sourceDir, { withFileTypes: true });
|
|
95651
95732
|
await Promise.all(entries.map(async (entry) => {
|
|
95652
|
-
await cp(
|
|
95733
|
+
await cp(join23(sourceDir, entry.name), join23(targetDir, entry.name), {
|
|
95653
95734
|
recursive: true,
|
|
95654
95735
|
force: true
|
|
95655
95736
|
});
|
|
@@ -95692,7 +95773,7 @@ async function readSkillMetadataFromDirectory(skillsDir) {
|
|
|
95692
95773
|
if (!entry.isDirectory()) {
|
|
95693
95774
|
continue;
|
|
95694
95775
|
}
|
|
95695
|
-
const skillPath =
|
|
95776
|
+
const skillPath = join23(skillsDir, entry.name, "SKILL.md");
|
|
95696
95777
|
if (!await stat19(skillPath).catch(() => null)) {
|
|
95697
95778
|
continue;
|
|
95698
95779
|
}
|
|
@@ -95838,8 +95919,8 @@ async function promptMigration() {
|
|
|
95838
95919
|
async function promptsAction(opts) {
|
|
95839
95920
|
await refreshPrompts({ yes: opts.yes === true });
|
|
95840
95921
|
}
|
|
95841
|
-
var
|
|
95842
|
-
var prompts_default =
|
|
95922
|
+
var command30 = new Command().description("Refresh AGENTS.wmill.md and managed skills. User-owned AGENTS.md and CLAUDE.md are never overwritten unless you opt in.").option("--yes", "Non-interactive: append the @AGENTS.wmill.md include to an existing AGENTS.md / CLAUDE.md without prompting. Without it, a non-interactive run leaves an unlinked file untouched.").action(promptsAction);
|
|
95923
|
+
var prompts_default = command30;
|
|
95843
95924
|
|
|
95844
95925
|
// src/commands/init/init.ts
|
|
95845
95926
|
await init_tsconfig();
|
|
@@ -96033,14 +96114,14 @@ async function initAction(opts) {
|
|
|
96033
96114
|
}
|
|
96034
96115
|
}
|
|
96035
96116
|
}
|
|
96036
|
-
var
|
|
96037
|
-
var init_default =
|
|
96117
|
+
var command32 = new Command().description("Bootstrap a windmill project with a wmill.yaml file").option("--use-default", "Use default settings without checking backend").option("--use-backend", "Use backend git-sync settings if available").option("--repository <repo:string>", "Specify repository path (e.g., u/user/repo) when using backend settings").option("--bind-profile", "Automatically bind active workspace profile to current Git branch").option("--no-bind-profile", "Skip workspace profile binding prompt").action(initAction);
|
|
96118
|
+
var init_default = command32;
|
|
96038
96119
|
|
|
96039
96120
|
// src/commands/refresh/refresh.ts
|
|
96040
96121
|
init_mod3();
|
|
96041
96122
|
await init_tsconfig();
|
|
96042
|
-
var
|
|
96043
|
-
var refresh_default =
|
|
96123
|
+
var command33 = new Command().description("Refresh wmill-managed project files (AGENTS.wmill.md, skills, tsconfig.wmill.json)").command("prompts", prompts_default).command("tsconfig", tsconfig_default);
|
|
96124
|
+
var refresh_default = command33;
|
|
96044
96125
|
|
|
96045
96126
|
// src/main.ts
|
|
96046
96127
|
init_freshness_gate();
|
|
@@ -96057,7 +96138,7 @@ await __promiseAll([
|
|
|
96057
96138
|
init_conf(),
|
|
96058
96139
|
init_utils()
|
|
96059
96140
|
]);
|
|
96060
|
-
import * as
|
|
96141
|
+
import * as fs18 from "node:fs/promises";
|
|
96061
96142
|
async function pullJobs(opts, workspace) {
|
|
96062
96143
|
opts = await mergeConfigWithConfigFile(opts);
|
|
96063
96144
|
const ws = await resolveWorkspace({ ...opts, workspace });
|
|
@@ -96101,7 +96182,7 @@ Warning: Found ${workers.length} active worker(s) on the instance.`));
|
|
|
96101
96182
|
page++;
|
|
96102
96183
|
}
|
|
96103
96184
|
const completedPath = opts.completedOutput || "completed_jobs.json";
|
|
96104
|
-
await
|
|
96185
|
+
await fs18.writeFile(completedPath, JSON.stringify(completedJobs, null, 2));
|
|
96105
96186
|
info(colors.green(`Successfully pulled ${completedJobs.length} completed jobs to ${completedPath}`));
|
|
96106
96187
|
let queuedJobs = [];
|
|
96107
96188
|
page = 1;
|
|
@@ -96119,7 +96200,7 @@ Warning: Found ${workers.length} active worker(s) on the instance.`));
|
|
|
96119
96200
|
page++;
|
|
96120
96201
|
}
|
|
96121
96202
|
const queuedPath = opts.queuedOutput || "queued_jobs.json";
|
|
96122
|
-
await
|
|
96203
|
+
await fs18.writeFile(queuedPath, JSON.stringify(queuedJobs, null, 2));
|
|
96123
96204
|
info(colors.green(`Successfully pulled ${queuedJobs.length} queued jobs to ${queuedPath}`));
|
|
96124
96205
|
const allJobs = [...queuedJobs, ...completedJobs];
|
|
96125
96206
|
if (allJobs.length > 0) {
|
|
@@ -96209,8 +96290,8 @@ Warning: Found ${workers.length} active worker(s) on the instance.`));
|
|
|
96209
96290
|
}
|
|
96210
96291
|
var pull3 = new Command().description("Pull completed and queued jobs from workspace").option("-c, --completed-output <file:string>", "Completed jobs output file (default: completed_jobs.json)").option("-q, --queued-output <file:string>", "Queued jobs output file (default: queued_jobs.json)").option("--skip-worker-check", "Skip checking for active workers before export").arguments("[workspace:string]").action(pullJobs);
|
|
96211
96292
|
var push12 = new Command().description("Push completed and queued jobs to workspace").option("-c, --completed-file <file:string>", "Completed jobs input file (default: completed_jobs.json)").option("-q, --queued-file <file:string>", "Queued jobs input file (default: queued_jobs.json)").option("--skip-worker-check", "Skip checking for active workers before import").arguments("[workspace:string]").action(pushJobs);
|
|
96212
|
-
var
|
|
96213
|
-
var jobs_default =
|
|
96293
|
+
var command34 = new Command().description("Manage jobs (import/export)").command("pull", pull3).command("push", push12);
|
|
96294
|
+
var jobs_default = command34;
|
|
96214
96295
|
|
|
96215
96296
|
// src/commands/job/job.ts
|
|
96216
96297
|
init_mod3();
|
|
@@ -96571,8 +96652,8 @@ async function restart(opts, id) {
|
|
|
96571
96652
|
console.log(newId);
|
|
96572
96653
|
}
|
|
96573
96654
|
var listOptions = (cmd) => cmd.option("--json", "Output as JSON (for piping to jq)").option("--script-path <scriptPath:string>", "Filter by exact script/flow path").option("--created-by <createdBy:string>", "Filter by creator username").option("--running", "Show only running jobs").option("--failed", "Show only failed jobs").option("--success <success:boolean>", "Filter by success status (true/false)").option("--limit <limit:number>", "Number of jobs to return (default 30, max 100)").option("--job-kinds <jobKinds:string>", "Filter by job kinds (default: script,flow,singlestepflow)").option("--label <label:string>", "Filter by job label").option("--all", "Include sub-jobs (flow steps). By default only top-level jobs are shown").option("--parent <parent:string>", "Filter by parent job ID (show sub-jobs of a specific flow)").option("--is-flow-step", "Show only flow step jobs");
|
|
96574
|
-
var
|
|
96575
|
-
var job_default =
|
|
96655
|
+
var command35 = listOptions(new Command().description("Manage jobs (list, inspect, cancel)")).action(list13).command("list", listOptions(new Command().description("List recent jobs"))).action(list13).command("get", "Get job details. For flows: shows step tree with sub-job IDs").arguments("<id:string>").option("--json", "Output as JSON (for piping to jq)").action(get10).command("result", "Get the result of a completed job (machine-friendly)").arguments("<id:string>").action(result).command("logs", "Get job logs. For flows: aggregates all step logs").arguments("<id:string>").action(logs).command("cancel", "Cancel a running or queued job").arguments("<id:string>").option("--reason <reason:string>", "Reason for cancellation").action(cancel).command("rerun", "Re-run a completed job with the same args. Prints the new job UUID on stdout.").arguments("<id:string>").action(rerun).command("restart", "Restart a completed flow at a given top-level step. Prints the new flow job UUID on stdout.").arguments("<id:string>").option("--step <stepId:string>", "Top-level step id to restart the flow from", { required: true }).option("--iteration <n:number>", "For a top-level branchall or for-loop step, the iteration to restart at").action(restart);
|
|
96656
|
+
var job_default = command35;
|
|
96576
96657
|
|
|
96577
96658
|
// src/commands/group/group.ts
|
|
96578
96659
|
init_mod3();
|
|
@@ -96671,8 +96752,8 @@ async function removeUser(opts, name, username) {
|
|
|
96671
96752
|
});
|
|
96672
96753
|
info(colors.green(`User '${username}' removed from group '${name}'.`));
|
|
96673
96754
|
}
|
|
96674
|
-
var
|
|
96675
|
-
var group_default =
|
|
96755
|
+
var command36 = new Command().description("Manage workspace groups").option("--json", "Output as JSON (for piping to jq)").action(list14).command("list", "List all groups in the workspace").option("--json", "Output as JSON (for piping to jq)").action(list14).command("get", "Get group details and members").arguments("<name:string>").option("--json", "Output as JSON (for piping to jq)").action(get11).command("create", "Create a new group").arguments("<name:string>").option("--summary <summary:string>", "Group summary/description").action(create).command("delete", "Delete a group").arguments("<name:string>").action(deleteGroup2).command("add-user", "Add a user to a group").arguments("<name:string> <username:string>").action(addUser2).command("remove-user", "Remove a user from a group").arguments("<name:string> <username:string>").action(removeUser);
|
|
96756
|
+
var group_default = command36;
|
|
96676
96757
|
|
|
96677
96758
|
// src/commands/audit/audit.ts
|
|
96678
96759
|
init_mod3();
|
|
@@ -96749,8 +96830,8 @@ async function get12(opts, id) {
|
|
|
96749
96830
|
}
|
|
96750
96831
|
}
|
|
96751
96832
|
var auditListOptions = (cmd) => cmd.option("--json", "Output as JSON (for piping to jq)").option("--username <username:string>", "Filter by username").option("--operation <operation:string>", "Filter by operation (exact or prefix)").option("--action-kind <actionKind:string>", "Filter by action kind (Create, Update, Delete, Execute)").option("--before <before:string>", "Filter events before this timestamp").option("--after <after:string>", "Filter events after this timestamp").option("--limit <limit:number>", "Number of entries to return (default 30, max 100)");
|
|
96752
|
-
var
|
|
96753
|
-
var audit_default =
|
|
96833
|
+
var command37 = auditListOptions(new Command().description("View audit logs (requires admin)")).action(list15).command("list", auditListOptions(new Command().description("List audit log entries"))).action(list15).command("get", "Get a specific audit log entry").arguments("<id:string>").option("--json", "Output as JSON (for piping to jq)").action(get12);
|
|
96834
|
+
var audit_default = command37;
|
|
96754
96835
|
|
|
96755
96836
|
// src/commands/token/token.ts
|
|
96756
96837
|
init_mod3();
|
|
@@ -96804,8 +96885,8 @@ async function deleteToken2(opts, tokenPrefix) {
|
|
|
96804
96885
|
await deleteToken({ tokenPrefix });
|
|
96805
96886
|
info(colors.green(`Token with prefix '${tokenPrefix}' deleted.`));
|
|
96806
96887
|
}
|
|
96807
|
-
var
|
|
96808
|
-
var token_default =
|
|
96888
|
+
var command38 = new Command().description("Manage API tokens").option("--json", "Output as JSON (for piping to jq)").action(list16).command("list", "List API tokens").option("--json", "Output as JSON (for piping to jq)").action(list16).command("create", "Create a new API token").option("--label <label:string>", "Token label").option("--expiration <expiration:string>", "Token expiration (ISO 8601 timestamp)").action(create2).command("delete", "Delete a token by its prefix").arguments("<token_prefix:string>").action(deleteToken2);
|
|
96889
|
+
var token_default = command38;
|
|
96809
96890
|
|
|
96810
96891
|
// src/main.ts
|
|
96811
96892
|
await init_generate_metadata();
|
|
@@ -96866,8 +96947,8 @@ ${await res.text()}`);
|
|
|
96866
96947
|
console.log();
|
|
96867
96948
|
}
|
|
96868
96949
|
}
|
|
96869
|
-
var
|
|
96870
|
-
var docs_default =
|
|
96950
|
+
var command39 = new Command().name("docs").description("Search Windmill documentation.").arguments("<query:string>").option("--json", "Output results as JSON.").action(docs);
|
|
96951
|
+
var docs_default = command39;
|
|
96871
96952
|
|
|
96872
96953
|
// src/commands/config/config.ts
|
|
96873
96954
|
init_mod3();
|
|
@@ -96937,8 +97018,8 @@ async function migrateAction() {
|
|
|
96937
97018
|
info(` Also removed additional legacy keys: ${legacyKeys.slice(1).join(", ")}`);
|
|
96938
97019
|
}
|
|
96939
97020
|
}
|
|
96940
|
-
var
|
|
96941
|
-
var config_default =
|
|
97021
|
+
var command40 = new Command().name("config").description("Show all available wmill.yaml configuration options").option("--json", "Output as JSON for programmatic consumption").action(configAction).command("migrate").description("Migrate wmill.yaml from gitBranches/environments to workspaces format").action(migrateAction);
|
|
97022
|
+
var config_default = command40;
|
|
96942
97023
|
|
|
96943
97024
|
// src/commands/datatable/datatable.ts
|
|
96944
97025
|
init_mod3();
|
|
@@ -98284,16 +98365,16 @@ async function startServe(opts) {
|
|
|
98284
98365
|
error(`server error: ${err.message}`);
|
|
98285
98366
|
process.exitCode = 1;
|
|
98286
98367
|
});
|
|
98287
|
-
await new Promise((
|
|
98368
|
+
await new Promise((resolve11) => server.listen(port, host, () => resolve11()));
|
|
98288
98369
|
return {
|
|
98289
98370
|
host,
|
|
98290
98371
|
port,
|
|
98291
98372
|
user: DEFAULT_USER,
|
|
98292
98373
|
password,
|
|
98293
98374
|
connectionString: (datatableName) => `postgresql://${DEFAULT_USER}:${encodeURIComponent(password)}@${host}:${port}/${encodeURIComponent(datatableName)}`,
|
|
98294
|
-
close: () => new Promise((
|
|
98295
|
-
server.close(() =>
|
|
98296
|
-
setTimeout(
|
|
98375
|
+
close: () => new Promise((resolve11) => {
|
|
98376
|
+
server.close(() => resolve11());
|
|
98377
|
+
setTimeout(resolve11, 1000).unref();
|
|
98297
98378
|
})
|
|
98298
98379
|
};
|
|
98299
98380
|
}
|
|
@@ -98802,13 +98883,13 @@ async function psql(opts) {
|
|
|
98802
98883
|
}
|
|
98803
98884
|
handle.close().finally(() => process.exit(1));
|
|
98804
98885
|
});
|
|
98805
|
-
const exitCode = await new Promise((
|
|
98886
|
+
const exitCode = await new Promise((resolve11) => {
|
|
98806
98887
|
child.on("exit", (code2, signal) => {
|
|
98807
98888
|
if (signal && typeof signal === "string") {
|
|
98808
98889
|
const num = signalToNumber(signal);
|
|
98809
|
-
|
|
98890
|
+
resolve11(num !== undefined ? 128 + num : 1);
|
|
98810
98891
|
} else {
|
|
98811
|
-
|
|
98892
|
+
resolve11(code2 ?? 0);
|
|
98812
98893
|
}
|
|
98813
98894
|
});
|
|
98814
98895
|
});
|
|
@@ -98906,8 +98987,8 @@ async function serve2(opts) {
|
|
|
98906
98987
|
async function psql2(opts) {
|
|
98907
98988
|
await psql(opts);
|
|
98908
98989
|
}
|
|
98909
|
-
var
|
|
98910
|
-
var datatable_default =
|
|
98990
|
+
var command41 = new Command().description("datatable related commands").command("list", "list all datatables in the workspace").option("--json", "Output as JSON (for piping to jq)").action(list17).command("run", "run a SQL query on a datatable").arguments("<sql:string>").option("-n --name <name:string>", "Datatable name (default: main)").option("-s --silent", "Output only the final result as JSON. Useful for scripting.").action(run4).command("migrate", migrateCommand).command("create", "register a datatable database in the workspace (default: instance-backed 'main') so scripts can use datatable://<name>").arguments("[name:string]").option("--resource <resource:string>", "Back the datatable with an existing postgresql resource path instead of the instance database").option("--force", "Allow adding to a workspace that already has datatables (fork metadata on existing ones is not preserved)").action(create3).command("serve", "Serve all datatables as a Postgres-wire endpoint (psql, DBeaver, pgAdmin); the client picks the datatable via the database name in its connection string").option("--port <port:number>", "Port to listen on (default: first free port in 5433-5500)").option("--host <host:string>", "Bind address (default: 127.0.0.1)").option("--password <password:string>", "Password for Postgres clients (default: generate a random password at startup)").action(serve2).command("psql", "Start a serve listener and launch psql connected to it").option("-n --name <name:string>", "Datatable to connect psql to (default: main)").option("--port <port:number>", "Port the proxy listens on (default: first free port in 5433-5500)").option("--host <host:string>", "Bind address for the proxy (default: 127.0.0.1)").option("--password <password:string>", "Password for the temporary Postgres proxy (default: generate a random password at startup)").action(psql2);
|
|
98991
|
+
var datatable_default = command41;
|
|
98911
98992
|
|
|
98912
98993
|
// src/commands/pipeline/pipeline.ts
|
|
98913
98994
|
init_mod3();
|
|
@@ -98923,10 +99004,10 @@ await __promiseAll([
|
|
|
98923
99004
|
|
|
98924
99005
|
// src/commands/pipeline/boundedCascade.ts
|
|
98925
99006
|
var SCRIPT_PREFIX = "script:";
|
|
98926
|
-
var scriptNodeId = (
|
|
99007
|
+
var scriptNodeId = (path25) => `${SCRIPT_PREFIX}${path25}`;
|
|
98927
99008
|
var isScriptNode = (id) => id.startsWith(SCRIPT_PREFIX);
|
|
98928
99009
|
var scriptPathOf = (id) => id.slice(SCRIPT_PREFIX.length);
|
|
98929
|
-
var assetNodeId = (kind,
|
|
99010
|
+
var assetNodeId = (kind, path25) => `${kind}:${path25}`;
|
|
98930
99011
|
var NON_AUTORUN_TRIGGER_KINDS = new Set([
|
|
98931
99012
|
"kafka",
|
|
98932
99013
|
"mqtt",
|
|
@@ -99161,9 +99242,9 @@ await __promiseAll([
|
|
|
99161
99242
|
init_script_common(),
|
|
99162
99243
|
init_conf()
|
|
99163
99244
|
]);
|
|
99164
|
-
import * as
|
|
99165
|
-
import * as
|
|
99166
|
-
import
|
|
99245
|
+
import * as fs19 from "node:fs";
|
|
99246
|
+
import * as path25 from "node:path";
|
|
99247
|
+
import process26 from "node:process";
|
|
99167
99248
|
|
|
99168
99249
|
// src/commands/pipeline/duckdbMacros.ts
|
|
99169
99250
|
function stripKw(s2, kw) {
|
|
@@ -99395,7 +99476,7 @@ function parseMacroAnnotations(content) {
|
|
|
99395
99476
|
// src/commands/pipeline/localGraph.ts
|
|
99396
99477
|
function workspaceRoot() {
|
|
99397
99478
|
const yaml = getWmillYamlPath();
|
|
99398
|
-
return yaml ?
|
|
99479
|
+
return yaml ? path25.dirname(yaml) : process26.cwd();
|
|
99399
99480
|
}
|
|
99400
99481
|
function wasmFnForLanguage(language) {
|
|
99401
99482
|
switch (language) {
|
|
@@ -99624,14 +99705,14 @@ async function collectScripts(folderDir, root, defaultTs2) {
|
|
|
99624
99705
|
function walk(dir) {
|
|
99625
99706
|
let entries;
|
|
99626
99707
|
try {
|
|
99627
|
-
entries =
|
|
99708
|
+
entries = fs19.readdirSync(dir, { withFileTypes: true });
|
|
99628
99709
|
} catch {
|
|
99629
99710
|
return;
|
|
99630
99711
|
}
|
|
99631
99712
|
for (const e2 of entries) {
|
|
99632
99713
|
if (e2.name.startsWith(".") || e2.name === "node_modules")
|
|
99633
99714
|
continue;
|
|
99634
|
-
const abs =
|
|
99715
|
+
const abs = path25.join(dir, e2.name);
|
|
99635
99716
|
if (e2.isDirectory()) {
|
|
99636
99717
|
walk(abs);
|
|
99637
99718
|
continue;
|
|
@@ -99641,7 +99722,7 @@ async function collectScripts(folderDir, root, defaultTs2) {
|
|
|
99641
99722
|
const ext2 = exts.find((x3) => e2.name.endsWith(x3));
|
|
99642
99723
|
if (!ext2)
|
|
99643
99724
|
continue;
|
|
99644
|
-
const relFromRoot =
|
|
99725
|
+
const relFromRoot = path25.relative(root, abs).replaceAll("\\", "/");
|
|
99645
99726
|
let language;
|
|
99646
99727
|
try {
|
|
99647
99728
|
language = inferContentTypeFromFilePath(abs, defaultTs2);
|
|
@@ -99650,7 +99731,7 @@ async function collectScripts(folderDir, root, defaultTs2) {
|
|
|
99650
99731
|
}
|
|
99651
99732
|
out.push({
|
|
99652
99733
|
path: removeExtensionToPath(relFromRoot),
|
|
99653
|
-
content:
|
|
99734
|
+
content: fs19.readFileSync(abs, "utf-8"),
|
|
99654
99735
|
language
|
|
99655
99736
|
});
|
|
99656
99737
|
}
|
|
@@ -99660,11 +99741,11 @@ async function collectScripts(folderDir, root, defaultTs2) {
|
|
|
99660
99741
|
return out;
|
|
99661
99742
|
}
|
|
99662
99743
|
function hideDbtRunnables(graph) {
|
|
99663
|
-
const key = (usage_kind,
|
|
99744
|
+
const key = (usage_kind, path26) => `${usage_kind}:${path26}`;
|
|
99664
99745
|
const dbtKeys = new Set((graph.runnables ?? []).filter((r2) => r2.dbt).map((r2) => key(r2.usage_kind, r2.path)));
|
|
99665
99746
|
if (dbtKeys.size === 0)
|
|
99666
99747
|
return graph;
|
|
99667
|
-
const kept = (usage_kind,
|
|
99748
|
+
const kept = (usage_kind, path26) => !dbtKeys.has(key(usage_kind, path26));
|
|
99668
99749
|
return {
|
|
99669
99750
|
...graph,
|
|
99670
99751
|
runnables: graph.runnables.filter((r2) => kept(r2.usage_kind, r2.path)),
|
|
@@ -99680,7 +99761,7 @@ function hideDbtRunnables(graph) {
|
|
|
99680
99761
|
}
|
|
99681
99762
|
async function buildLocalPipelineGraph(args) {
|
|
99682
99763
|
const folderClean = args.folder.replace(/^f\//, "").replace(/\/$/, "");
|
|
99683
|
-
const folderDir =
|
|
99764
|
+
const folderDir = path25.join(args.root, "f", folderClean);
|
|
99684
99765
|
const all = await collectScripts(folderDir, args.root, args.defaultTs);
|
|
99685
99766
|
const libMacros = collectMacroLibraries(args.root);
|
|
99686
99767
|
const runnables = [];
|
|
@@ -99914,14 +99995,14 @@ function collectMacroLibraries(root) {
|
|
|
99914
99995
|
const walk = (dir) => {
|
|
99915
99996
|
let entries;
|
|
99916
99997
|
try {
|
|
99917
|
-
entries =
|
|
99998
|
+
entries = fs19.readdirSync(dir, { withFileTypes: true });
|
|
99918
99999
|
} catch {
|
|
99919
100000
|
return;
|
|
99920
100001
|
}
|
|
99921
100002
|
for (const e2 of entries) {
|
|
99922
100003
|
if (e2.name.startsWith(".") || e2.name === "node_modules")
|
|
99923
100004
|
continue;
|
|
99924
|
-
const abs =
|
|
100005
|
+
const abs = path25.join(dir, e2.name);
|
|
99925
100006
|
if (e2.isDirectory()) {
|
|
99926
100007
|
walk(abs);
|
|
99927
100008
|
continue;
|
|
@@ -99930,17 +100011,17 @@ function collectMacroLibraries(root) {
|
|
|
99930
100011
|
continue;
|
|
99931
100012
|
let content;
|
|
99932
100013
|
try {
|
|
99933
|
-
content =
|
|
100014
|
+
content = fs19.readFileSync(abs, "utf-8");
|
|
99934
100015
|
} catch {
|
|
99935
100016
|
continue;
|
|
99936
100017
|
}
|
|
99937
100018
|
if (!parseMacroAnnotations(content).macros)
|
|
99938
100019
|
continue;
|
|
99939
|
-
const relFromRoot =
|
|
100020
|
+
const relFromRoot = path25.relative(root, abs).replaceAll("\\", "/");
|
|
99940
100021
|
out.set(removeExtensionToPath(relFromRoot), parseMacroLibrary(content));
|
|
99941
100022
|
}
|
|
99942
100023
|
};
|
|
99943
|
-
walk(
|
|
100024
|
+
walk(path25.join(root, "f"));
|
|
99944
100025
|
return out;
|
|
99945
100026
|
}
|
|
99946
100027
|
function buildMacroEdges(all, libMacros, runnables) {
|
|
@@ -100045,25 +100126,25 @@ await __promiseAll([
|
|
|
100045
100126
|
init_codebase()
|
|
100046
100127
|
]);
|
|
100047
100128
|
import * as http4 from "node:http";
|
|
100048
|
-
import * as
|
|
100049
|
-
import * as
|
|
100129
|
+
import * as fs20 from "node:fs";
|
|
100130
|
+
import * as path26 from "node:path";
|
|
100050
100131
|
import { createHash as createHash3, randomBytes as randomBytes2 } from "node:crypto";
|
|
100051
|
-
import
|
|
100132
|
+
import process27 from "node:process";
|
|
100052
100133
|
var PORT2 = 3201;
|
|
100053
100134
|
var LISTEN_HOST = "127.0.0.1";
|
|
100054
100135
|
async function stableWsToken(remote, workspaceId, root, folder, port) {
|
|
100055
100136
|
const key = createHash3("sha256").update(`${remote}\x00${workspaceId}\x00${root}\x00${folder}\x00${port}`).digest("hex").slice(0, 32);
|
|
100056
100137
|
let tokenFile;
|
|
100057
100138
|
try {
|
|
100058
|
-
tokenFile =
|
|
100059
|
-
const existing =
|
|
100139
|
+
tokenFile = path26.join(await getConfigDirPath(), `pipeline-dev-${key}.token`);
|
|
100140
|
+
const existing = fs20.readFileSync(tokenFile, "utf-8").trim();
|
|
100060
100141
|
if (existing)
|
|
100061
100142
|
return existing;
|
|
100062
100143
|
} catch {}
|
|
100063
100144
|
const token = randomBytes2(24).toString("base64url");
|
|
100064
100145
|
if (tokenFile) {
|
|
100065
100146
|
try {
|
|
100066
|
-
|
|
100147
|
+
fs20.writeFileSync(tokenFile, token, { mode: 384 });
|
|
100067
100148
|
} catch {}
|
|
100068
100149
|
}
|
|
100069
100150
|
return token;
|
|
@@ -100071,7 +100152,7 @@ async function stableWsToken(remote, workspaceId, root, folder, port) {
|
|
|
100071
100152
|
function resolveFolder(root, folderArg) {
|
|
100072
100153
|
if (folderArg)
|
|
100073
100154
|
return folderArg.replace(/^f\//, "").replace(/\/$/, "");
|
|
100074
|
-
const rel =
|
|
100155
|
+
const rel = path26.relative(root, process27.cwd()).replaceAll("\\", "/");
|
|
100075
100156
|
if (rel === "" || rel.startsWith(".."))
|
|
100076
100157
|
return;
|
|
100077
100158
|
const segs = rel.split("/");
|
|
@@ -100084,12 +100165,12 @@ async function dev3(opts, folderArg) {
|
|
|
100084
100165
|
const folder = resolveFolder(root, folderArg);
|
|
100085
100166
|
if (!folder) {
|
|
100086
100167
|
error(colors.red("Could not determine the pipeline folder. Pass it explicitly " + "(`wmill pipeline dev <folder>`) or run from inside an `f/<folder>` directory."));
|
|
100087
|
-
|
|
100168
|
+
process27.exit(1);
|
|
100088
100169
|
}
|
|
100089
|
-
const folderDir =
|
|
100090
|
-
if (!
|
|
100170
|
+
const folderDir = path26.join(root, "f", folder);
|
|
100171
|
+
if (!fs20.existsSync(folderDir)) {
|
|
100091
100172
|
error(colors.red(`Folder not found on disk: ${folderDir}`));
|
|
100092
|
-
|
|
100173
|
+
process27.exit(1);
|
|
100093
100174
|
}
|
|
100094
100175
|
const workspace = await resolveWorkspace(opts);
|
|
100095
100176
|
await requireLogin(opts);
|
|
@@ -100132,7 +100213,7 @@ async function dev3(opts, folderArg) {
|
|
|
100132
100213
|
}
|
|
100133
100214
|
}
|
|
100134
100215
|
let timer;
|
|
100135
|
-
const watcher =
|
|
100216
|
+
const watcher = fs20.watch(folderDir, { recursive: true });
|
|
100136
100217
|
watcher.on("change", (_ev, filename) => {
|
|
100137
100218
|
if (filename && filename.toString().endsWith(".lock"))
|
|
100138
100219
|
return;
|
|
@@ -100187,18 +100268,18 @@ async function dev3(opts, folderArg) {
|
|
|
100187
100268
|
open_default(url).catch((e2) => warn(colors.yellow(`Failed to open browser: ${e2.message}`)));
|
|
100188
100269
|
}
|
|
100189
100270
|
});
|
|
100190
|
-
|
|
100271
|
+
process27.on("SIGINT", () => {
|
|
100191
100272
|
info(colors.yellow(`
|
|
100192
100273
|
\uD83D\uDED1 Shutting down…`));
|
|
100193
100274
|
watcher.close();
|
|
100194
100275
|
for (const ws of clients)
|
|
100195
100276
|
ws.close();
|
|
100196
100277
|
server.close();
|
|
100197
|
-
|
|
100278
|
+
process27.exit(0);
|
|
100198
100279
|
});
|
|
100199
100280
|
}
|
|
100200
|
-
var
|
|
100201
|
-
var dev_default3 =
|
|
100281
|
+
var command42 = new Command().description("Live-preview a data pipeline from local files: watch an `f/<folder>` of `// pipeline` scripts, push the working-tree graph to the dev page, and run the cascade via preview (no deploy).").arguments("[folder:string]").option("--port <port:number>", "Port for the dev WebSocket server.").option("--no-open", "Do not open the browser automatically.").option("--frontend <origin:string>", "Origin serving the /pipeline_dev page (e.g. http://localhost:3000 for a locally-run frontend). Defaults to the workspace remote; use it when the remote's deployed frontend predates the dev page.").action(dev3);
|
|
100282
|
+
var dev_default3 = command42;
|
|
100202
100283
|
|
|
100203
100284
|
// src/commands/pipeline/docs.ts
|
|
100204
100285
|
init_gen();
|
|
@@ -100211,8 +100292,8 @@ await __promiseAll([
|
|
|
100211
100292
|
init_conf()
|
|
100212
100293
|
]);
|
|
100213
100294
|
import { writeFile as writeFile25 } from "node:fs/promises";
|
|
100214
|
-
import { existsSync as
|
|
100215
|
-
import * as
|
|
100295
|
+
import { existsSync as existsSync20, readFileSync as readFileSync8 } from "node:fs";
|
|
100296
|
+
import * as path27 from "node:path";
|
|
100216
100297
|
var ASSET_KINDS = "s3object,ducklake,datatable,volume,dbt";
|
|
100217
100298
|
function assetUri(kind, p3) {
|
|
100218
100299
|
const prefix = kind === "s3object" ? "s3" : kind;
|
|
@@ -100420,8 +100501,8 @@ async function generatePipelineDocs(opts, folder) {
|
|
|
100420
100501
|
}
|
|
100421
100502
|
}
|
|
100422
100503
|
const md = generatePipelineMarkdown(f3, graph, datatableSchemas, !!opts.local);
|
|
100423
|
-
const folderDir =
|
|
100424
|
-
await writeFile25(
|
|
100504
|
+
const folderDir = path27.join(root, "f", f3);
|
|
100505
|
+
await writeFile25(path27.join(folderDir, "PIPELINE.md"), md, "utf-8");
|
|
100425
100506
|
const written = ["PIPELINE.md"];
|
|
100426
100507
|
const pointers = [
|
|
100427
100508
|
["AGENTS.md", `See @PIPELINE.md for this pipeline's graph, assets, and how to run it.
|
|
@@ -100430,8 +100511,8 @@ async function generatePipelineDocs(opts, folder) {
|
|
|
100430
100511
|
`]
|
|
100431
100512
|
];
|
|
100432
100513
|
for (const [name, content] of pointers) {
|
|
100433
|
-
const p3 =
|
|
100434
|
-
if (
|
|
100514
|
+
const p3 = path27.join(folderDir, name);
|
|
100515
|
+
if (existsSync20(p3)) {
|
|
100435
100516
|
let existing;
|
|
100436
100517
|
try {
|
|
100437
100518
|
existing = readFileSync8(p3, "utf-8");
|
|
@@ -100506,13 +100587,13 @@ function s3Arg(param, obj) {
|
|
|
100506
100587
|
}
|
|
100507
100588
|
|
|
100508
100589
|
// src/commands/pipeline/pipeline.ts
|
|
100509
|
-
async function apiGet(
|
|
100510
|
-
const response = await fetch(`${OpenAPI.BASE}${
|
|
100590
|
+
async function apiGet(path28) {
|
|
100591
|
+
const response = await fetch(`${OpenAPI.BASE}${path28}`, {
|
|
100511
100592
|
headers: { Authorization: `Bearer ${OpenAPI.TOKEN}` }
|
|
100512
100593
|
});
|
|
100513
100594
|
if (!response.ok) {
|
|
100514
100595
|
const body = await response.text();
|
|
100515
|
-
throw new Error(`GET ${
|
|
100596
|
+
throw new Error(`GET ${path28} -> ${response.status}: ${body}`);
|
|
100516
100597
|
}
|
|
100517
100598
|
return await response.json();
|
|
100518
100599
|
}
|
|
@@ -100531,9 +100612,9 @@ async function list18(opts) {
|
|
|
100531
100612
|
}
|
|
100532
100613
|
}
|
|
100533
100614
|
var ASSET_KINDS2 = "s3object,ducklake,datatable,volume,dbt";
|
|
100534
|
-
function assetUri2(kind,
|
|
100615
|
+
function assetUri2(kind, path28) {
|
|
100535
100616
|
const prefix = kind === "s3object" ? "s3" : kind;
|
|
100536
|
-
return `${prefix}://${
|
|
100617
|
+
return `${prefix}://${path28}`;
|
|
100537
100618
|
}
|
|
100538
100619
|
function shortName(scriptPath) {
|
|
100539
100620
|
return scriptPath.split("/").pop() ?? scriptPath;
|
|
@@ -101089,8 +101170,8 @@ Full logs: ${runUrl}`);
|
|
|
101089
101170
|
info(colors.green.bold(`Bounded run complete — ${order.length} script(s) succeeded.`));
|
|
101090
101171
|
}
|
|
101091
101172
|
}
|
|
101092
|
-
var
|
|
101093
|
-
var pipeline_default =
|
|
101173
|
+
var command43 = new Command().description("inspect asset-driven pipelines (scripts marked `// pipeline`, wired by `// on <spec>` annotations)").command("list", "list pipeline folders in the workspace").option("--json", "Output as JSON (for piping to jq)").action(list18).command("show", "render a pipeline folder's DAG (sources, lineage, subscriptions) in the terminal").arguments("<folder:string>").option("--json", "Output the raw asset graph as JSON").option("--local", "Build the graph from local working-tree files (// pipeline scripts) instead of the deployed workspace — no deploy needed.").action(show2).command("run", "run a cascade: from --from (a root OR any mid-DAG model), fan downstream up to the --to end node(s)").arguments("<folder:string>").option("--from <script:string>", "Start script (short name or path). May be any node, including a mid-DAG model — that node plus its transitive downstream runs, upstream is NOT re-run (dbt `--select model+`). Defaults to the folder's sole schedule/manual root.").option("--to <node:string>", "End node(s) to stop at — script names/paths or asset URIs (e.g. datatable://main/staged). Repeatable or comma-separated. Omit to run the full downstream.", { collect: true }).option("--dry-run", "Print the topological run plan without executing.").option("--json", "Output the plan as JSON (for piping to jq).").option("--local", "Run the local working-tree scripts via preview (no deploy) instead of the deployed versions; the graph is built from local files.").option("--upload <binding:string>", "Bind an object to a data_upload/webhook entry point so it runs in the cascade, as SCRIPT[:PARAM]=SOURCE (SOURCE is a local file or an s3://key). Local files are uploaded to the workspace store; the S3Object param is inferred when the script has exactly one. Repeatable.", { collect: true }).option("--arg <binding:string>", "Pass a plain run arg to a script in the cascade, as SCRIPT:PARAM=VALUE (VALUE is parsed as JSON when possible, else taken as a string — e.g. daily_report:partition=2026-07-02). Repeatable.", { collect: true }).option("--partition <value:string>", "Partition value for `// partitioned` scripts in the run (e.g. 2026-06-30) — use it to backfill a past slice. With --local, time kinds (daily/hourly/weekly/monthly) default to the current UTC period when omitted; `dynamic` always needs it. Deployed runs without it defer to backend run-start resolution.").action(run5).command("docs", "generate PIPELINE.md (+ AGENTS.md pointer) describing a folder's pipeline graph and datatable schemas, for an editor / agentic loop").arguments("<folder:string>").option("--local", "Build the graph from local working-tree files instead of the deployed workspace.").action(generatePipelineDocs).command("dev", dev_default3);
|
|
101174
|
+
var pipeline_default = command43;
|
|
101094
101175
|
|
|
101095
101176
|
// src/commands/ducklake/ducklake.ts
|
|
101096
101177
|
init_mod3();
|
|
@@ -101120,8 +101201,8 @@ async function run6(opts, sql) {
|
|
|
101120
101201
|
const name = opts.name ?? DEFAULT_DUCKLAKE_NAME;
|
|
101121
101202
|
await runCatalogQuery(opts, "ducklake", name, sql);
|
|
101122
101203
|
}
|
|
101123
|
-
var
|
|
101124
|
-
var ducklake_default =
|
|
101204
|
+
var command44 = new Command().description("ducklake related commands").command("list", "list all ducklakes in the workspace").option("--json", "Output as JSON (for piping to jq)").action(list19).command("run", "run a SQL query on a ducklake").arguments("<sql:string>").option("-n --name <name:string>", "Ducklake name (default: main)").option("-s --silent", "Output only the final result as JSON. Useful for scripting.").action(run6);
|
|
101205
|
+
var ducklake_default = command44;
|
|
101125
101206
|
|
|
101126
101207
|
// src/commands/object-storage/object-storage.ts
|
|
101127
101208
|
init_mod3();
|
|
@@ -101322,8 +101403,8 @@ async function preview3(opts, fileKey) {
|
|
|
101322
101403
|
`);
|
|
101323
101404
|
}
|
|
101324
101405
|
}
|
|
101325
|
-
var
|
|
101326
|
-
var object_storage_default =
|
|
101406
|
+
var command45 = new Command().alias("s3").description("Object storage (S3) related commands. Operates on the workspace's default object storage; use --storage to target a configured secondary storage.").action(listStorages).command("list", "List configured object storages for the workspace (default + secondary).").option("--json", "Output as JSON (for piping to jq)").action(listStorages).command("files", "List files in an object storage. Optionally filter by prefix.").alias("ls").arguments("[prefix:string]").option("--json", "Output as JSON (for piping to jq)").option("--max-keys <maxKeys:number>", "Page size (default 100)").option("--marker <marker:string>", "Pagination marker from a previous response").option("--storage <storage:string>", "Secondary storage name (omit for the workspace default)").action(listFiles).command("upload", "Upload a local file to object storage at the given file key.").arguments("<local_path:string> <file_key:string>").option("--storage <storage:string>", "Secondary storage name").option("--content-type <contentType:string>", "Content-Type header to set on the object").option("--content-disposition <contentDisposition:string>", "Content-Disposition header to set on the object").action(upload).command("download", "Download an object to a local file (or stdout). Default output path is the basename of the file key in the current directory.").arguments("<file_key:string> [output_path:string]").option("--storage <storage:string>", "Secondary storage name").option("--stdout", "Write file contents to stdout instead of a file").action(download).command("delete", "Delete an object from object storage. Prompts for confirmation unless --yes is set.").arguments("<file_key:string>").option("--storage <storage:string>", "Secondary storage name").option("--yes", "Skip the confirmation prompt").action(del).command("move", "Move an object within the same storage (rename or relocate by key).").arguments("<src_file_key:string> <dest_file_key:string>").option("--storage <storage:string>", "Secondary storage name").action(move).command("info", "Show metadata (size, mime, last-modified) for an object.").arguments("<file_key:string>").option("--json", "Output as JSON (for piping to jq)").option("--storage <storage:string>", "Secondary storage name").action(info2).command("preview", "Preview the contents of an object (text/CSV). Use --bytes-from / --bytes-length to peek at a slice of binary files.").arguments("<file_key:string>").option("--storage <storage:string>", "Secondary storage name").option("--mime <mime:string>", "Override the detected mime type (e.g. text/csv)").option("--bytes-from <bytesFrom:number>", "Start offset in bytes").option("--bytes-length <bytesLength:number>", "Number of bytes to read").option("--csv-separator <csvSeparator:string>", "CSV column separator (default ,)").option("--csv-header", "Treat the first CSV row as a header").action(preview3);
|
|
101407
|
+
var object_storage_default = command45;
|
|
101327
101408
|
|
|
101328
101409
|
// src/main.ts
|
|
101329
101410
|
await init_context();
|
|
@@ -101343,7 +101424,7 @@ async function checkVersionSafe(cmd) {
|
|
|
101343
101424
|
}
|
|
101344
101425
|
mainCommand.version(`${currentVersion} (New version available: ${latestVersion}. Run '${mainCommand.getName()} upgrade' to upgrade to the latest version!)`);
|
|
101345
101426
|
}
|
|
101346
|
-
var
|
|
101427
|
+
var command46 = new Command().name("wmill").action(() => info(`Welcome to Windmill CLI ${VERSION}. Use -h for help.`)).description("Windmill CLI").globalOption("--workspace <workspace:string>", "Specify the target workspace. This overrides the default workspace.").globalOption("--debug --verbose", "Show debug/verbose logs").globalOption("--show-diffs", "Show diff informations when syncing (may show sensitive informations)").globalOption("--token <token:string>", "Specify an API token. This will override any stored token.").globalOption("--base-url <baseUrl:string>", "Specify the base URL of the API. If used, --token and --workspace are required and no local remote/workspace already set will be used.").globalOption("--config-dir <configDir:string>", "Specify a custom config directory. Overrides WMILL_CONFIG_DIR environment variable and default ~/.config location.").env("HEADERS <headers:string>", `Specify headers to use for all requests. e.g: "HEADERS='h1: v1, h2: v2'"`).version(VERSION).versionOption(false).helpOption("-h, --help", "Show this help.", {
|
|
101347
101428
|
action: async function() {
|
|
101348
101429
|
const self2 = this;
|
|
101349
101430
|
const long = self2.getRawArgs().includes(`--${self2.getHelpOption()?.name}`);
|
|
@@ -101385,20 +101466,20 @@ var command45 = new Command().name("wmill").action(() => info(`Welcome to Windmi
|
|
|
101385
101466
|
error(e2);
|
|
101386
101467
|
info("Try running with sudo and otherwise check the result of the command: npm uninstall windmill-cli && npm install -g windmill-cli");
|
|
101387
101468
|
})).command("completions", new Command().description("Generate shell completions.").command("bash", new Command().description("Generate bash completions.").action(() => {
|
|
101388
|
-
process.stdout.write(generateShellCompletions(
|
|
101469
|
+
process.stdout.write(generateShellCompletions(command46, "bash") + `
|
|
101389
101470
|
`);
|
|
101390
101471
|
})).command("zsh", new Command().description("Generate zsh completions.").action(() => {
|
|
101391
|
-
process.stdout.write(generateShellCompletions(
|
|
101472
|
+
process.stdout.write(generateShellCompletions(command46, "zsh") + `
|
|
101392
101473
|
`);
|
|
101393
101474
|
})).command("fish", new Command().description("Generate fish completions.").action(() => {
|
|
101394
|
-
process.stdout.write(generateShellCompletions(
|
|
101475
|
+
process.stdout.write(generateShellCompletions(command46, "fish") + `
|
|
101395
101476
|
`);
|
|
101396
101477
|
})));
|
|
101397
101478
|
async function main2() {
|
|
101398
101479
|
try {
|
|
101399
101480
|
const args = process.argv.slice(2);
|
|
101400
101481
|
if (args.length === 0) {
|
|
101401
|
-
|
|
101482
|
+
command46.showHelp();
|
|
101402
101483
|
}
|
|
101403
101484
|
const LOG_LEVEL = args.includes("--verbose") || args.includes("--debug") ? "DEBUG" : "INFO";
|
|
101404
101485
|
setShowDiffs(args.includes("--show-diffs"));
|
|
@@ -101418,7 +101499,7 @@ async function main2() {
|
|
|
101418
101499
|
const { warnIfTsconfigStale: warnIfTsconfigStale2 } = await init_tsconfig().then(() => exports_tsconfig);
|
|
101419
101500
|
await warnIfTsconfigStale2().catch(() => {});
|
|
101420
101501
|
}
|
|
101421
|
-
await
|
|
101502
|
+
await command46.parse(args);
|
|
101422
101503
|
} catch (e2) {
|
|
101423
101504
|
if (e2 && typeof e2 === "object" && "name" in e2 && e2.name === "ApiError") {
|
|
101424
101505
|
const body = e2.body;
|
|
@@ -101454,7 +101535,7 @@ if (isMain()) {
|
|
|
101454
101535
|
process.stdin.destroy();
|
|
101455
101536
|
});
|
|
101456
101537
|
}
|
|
101457
|
-
var main_default =
|
|
101538
|
+
var main_default = command46;
|
|
101458
101539
|
export {
|
|
101459
101540
|
add as workspaceAdd,
|
|
101460
101541
|
workspace_default as workspace,
|