windmill-cli 1.645.0 → 1.647.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.
Files changed (2) hide show
  1. package/esm/main.js +129 -14
  2. package/package.json +1 -1
package/esm/main.js CHANGED
@@ -11785,7 +11785,7 @@ var init_OpenAPI = __esm(() => {
11785
11785
  PASSWORD: undefined,
11786
11786
  TOKEN: getEnv2("WM_TOKEN"),
11787
11787
  USERNAME: undefined,
11788
- VERSION: "1.645.0",
11788
+ VERSION: "1.647.0",
11789
11789
  WITH_CREDENTIALS: true,
11790
11790
  interceptors: {
11791
11791
  request: new Interceptors,
@@ -12157,7 +12157,9 @@ __export(exports_services_gen, {
12157
12157
  runScriptPreviewInline: () => runScriptPreviewInline,
12158
12158
  runScriptPreviewAndWaitResult: () => runScriptPreviewAndWaitResult,
12159
12159
  runScriptPreview: () => runScriptPreview,
12160
+ runScriptByPathInline: () => runScriptByPathInline,
12160
12161
  runScriptByPath: () => runScriptByPath,
12162
+ runScriptByHashInline: () => runScriptByHashInline,
12161
12163
  runScriptByHash: () => runScriptByHash,
12162
12164
  runRawScriptDependencies: () => runRawScriptDependencies,
12163
12165
  runFlowPreviewAndWaitResult: () => runFlowPreviewAndWaitResult,
@@ -14104,6 +14106,7 @@ var backendVersion = () => {
14104
14106
  path: data2.path,
14105
14107
  description: data2.description,
14106
14108
  value: data2.value,
14109
+ broad_filter: data2.broadFilter,
14107
14110
  page: data2.page,
14108
14111
  per_page: data2.perPage
14109
14112
  }
@@ -14463,7 +14466,8 @@ var backendVersion = () => {
14463
14466
  path_start: data2.pathStart,
14464
14467
  path: data2.path,
14465
14468
  description: data2.description,
14466
- value: data2.value
14469
+ value: data2.value,
14470
+ broad_filter: data2.broadFilter
14467
14471
  }
14468
14472
  });
14469
14473
  }, listSearchResource = (data2) => {
@@ -16001,6 +16005,28 @@ var backendVersion = () => {
16001
16005
  body: data2.requestBody,
16002
16006
  mediaType: "application/json"
16003
16007
  });
16008
+ }, runScriptByPathInline = (data2) => {
16009
+ return request(OpenAPI, {
16010
+ method: "POST",
16011
+ url: "/w/{workspace}/jobs/run_inline/p/{path}",
16012
+ path: {
16013
+ workspace: data2.workspace,
16014
+ path: data2.path
16015
+ },
16016
+ body: data2.requestBody,
16017
+ mediaType: "application/json"
16018
+ });
16019
+ }, runScriptByHashInline = (data2) => {
16020
+ return request(OpenAPI, {
16021
+ method: "POST",
16022
+ url: "/w/{workspace}/jobs/run_inline/h/{hash}",
16023
+ path: {
16024
+ workspace: data2.workspace,
16025
+ hash: data2.hash
16026
+ },
16027
+ body: data2.requestBody,
16028
+ mediaType: "application/json"
16029
+ });
16004
16030
  }, runScriptPreviewAndWaitResult = (data2) => {
16005
16031
  return request(OpenAPI, {
16006
16032
  method: "POST",
@@ -16386,7 +16412,8 @@ var backendVersion = () => {
16386
16412
  has_null_parent: data2.hasNullParent,
16387
16413
  success: data2.success,
16388
16414
  all_workspaces: data2.allWorkspaces,
16389
- is_not_schedule: data2.isNotSchedule
16415
+ is_not_schedule: data2.isNotSchedule,
16416
+ broad_filter: data2.broadFilter
16390
16417
  }
16391
16418
  });
16392
16419
  }, getDbClock = () => {
@@ -16878,7 +16905,8 @@ var backendVersion = () => {
16878
16905
  path_start: data2.pathStart,
16879
16906
  schedule_path: data2.schedulePath,
16880
16907
  description: data2.description,
16881
- summary: data2.summary
16908
+ summary: data2.summary,
16909
+ broad_filter: data2.broadFilter
16882
16910
  }
16883
16911
  });
16884
16912
  }, listSchedulesWithJobs = (data2) => {
@@ -19139,7 +19167,8 @@ var backendVersion = () => {
19139
19167
  usage_path: data2.usagePath,
19140
19168
  asset_kinds: data2.assetKinds,
19141
19169
  path: data2.path,
19142
- columns: data2.columns
19170
+ columns: data2.columns,
19171
+ broad_filter: data2.broadFilter
19143
19172
  }
19144
19173
  });
19145
19174
  }, listAssetsByUsage = (data2) => {
@@ -61563,7 +61592,19 @@ async function compareDynFSElement(els1, els2, ignore, json, skips, ignoreMetada
61563
61592
  }
61564
61593
  }
61565
61594
  }
61566
- changes.sort((a, b) => getOrderFromPath(a.path) == getOrderFromPath(b.path) ? a.path.localeCompare(b.path) : getOrderFromPath(a.path) - getOrderFromPath(b.path));
61595
+ changes.sort((a, b) => {
61596
+ const orderA = getOrderFromPath(a.path);
61597
+ const orderB = getOrderFromPath(b.path);
61598
+ if (orderA !== orderB) {
61599
+ return orderA - orderB;
61600
+ }
61601
+ const deletePriority = (name) => name === "deleted" ? 0 : 1;
61602
+ const dp = deletePriority(a.name) - deletePriority(b.name);
61603
+ if (dp !== 0) {
61604
+ return dp;
61605
+ }
61606
+ return a.path.localeCompare(b.path);
61607
+ });
61567
61608
  return changes;
61568
61609
  }
61569
61610
  function getOrderFromPath(p) {
@@ -78233,10 +78274,83 @@ var push12 = new Command().description("Push completed and queued jobs to worksp
78233
78274
  var command28 = new Command().description("Manage jobs (import/export)").command("pull", pull3).command("push", push12);
78234
78275
  var jobs_default = command28;
78235
78276
 
78277
+ // src/commands/docs/docs.ts
78278
+ init_mod3();
78279
+ init_colors2();
78280
+ init_log();
78281
+ await __promiseAll([
78282
+ init_auth(),
78283
+ init_context()
78284
+ ]);
78285
+ async function docs(opts, query) {
78286
+ await requireLogin(opts);
78287
+ const workspace = await resolveWorkspace(opts);
78288
+ const url = `${workspace.remote}api/inkeep`;
78289
+ console.log(colors.bold(`
78290
+ Searching Windmill docs...
78291
+ `));
78292
+ let res;
78293
+ try {
78294
+ res = await fetch(url, {
78295
+ method: "POST",
78296
+ headers: {
78297
+ "Content-Type": "application/json",
78298
+ Authorization: `Bearer ${workspace.token}`
78299
+ },
78300
+ body: JSON.stringify({ query })
78301
+ });
78302
+ } catch (e) {
78303
+ throw new Error(`Network error connecting to ${workspace.remote}: ${e}`);
78304
+ }
78305
+ if (res.status === 403) {
78306
+ info("Windmill documentation search is an Enterprise Edition feature. Please upgrade to use this command.");
78307
+ return;
78308
+ }
78309
+ if (!res.ok) {
78310
+ throw new Error(`Documentation search failed: ${res.status} ${res.statusText}
78311
+ ${await res.text()}`);
78312
+ }
78313
+ const data3 = await res.json();
78314
+ const raw = data3.choices?.[0]?.message?.content;
78315
+ if (!raw) {
78316
+ info("No documentation found for this query.");
78317
+ return;
78318
+ }
78319
+ let parsed;
78320
+ try {
78321
+ parsed = JSON.parse(raw);
78322
+ } catch {
78323
+ throw new Error("Failed to parse documentation response.");
78324
+ }
78325
+ const items = parsed.content ?? [];
78326
+ if (items.length === 0) {
78327
+ info("No documentation found for this query.");
78328
+ return;
78329
+ }
78330
+ if (opts.json) {
78331
+ console.log(JSON.stringify(items, null, 2));
78332
+ return;
78333
+ }
78334
+ for (const item of items) {
78335
+ console.log(colors.bold(colors.cyan(`\uD83D\uDCC4 ${item.title}`)));
78336
+ if (item.url) {
78337
+ console.log(` ${colors.underline(item.url)}`);
78338
+ }
78339
+ const text = item.source?.content?.[0]?.text;
78340
+ if (text) {
78341
+ const snippet = text.length > 500 ? text.slice(0, 500) + "..." : text;
78342
+ console.log(` ${snippet}`);
78343
+ }
78344
+ console.log();
78345
+ }
78346
+ }
78347
+ var command29 = new Command().name("docs").description("Search Windmill documentation. Requires Enterprise Edition.").arguments("<query:string>").option("--json", "Output results as JSON.").action(docs);
78348
+ var docs_default = command29;
78349
+
78236
78350
  // src/main.ts
78237
78351
  await init_context();
78238
- var VERSION = "1.645.0";
78239
- var command29 = 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).command("init", init_default).command("app", app_default).command("flow", flow_default).command("script", script_default).command("workspace", workspace_default).command("resource", resource_default).command("resource-type", resource_type_default).command("user", user_default).command("variable", variable_default).command("hub", hub_default).command("folder", folder_default).command("schedule", schedule_default).command("trigger", trigger_default).command("dev", dev_default2).command("sync", sync_default).command("lint", lint_default).command("gitsync-settings", gitsync_settings_default).command("instance", instance_default).command("worker-groups", worker_groups_default).command("workers", workers_default).command("queues", queues_default).command("dependencies", dependencies_default).command("jobs", jobs_default).command("version --version", "Show version information").action(async (opts) => {
78352
+ var VERSION = "1.647.0";
78353
+ var command30 = 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).command("init", init_default).command("app", app_default).command("flow", flow_default).command("script", script_default).command("workspace", workspace_default).command("resource", resource_default).command("resource-type", resource_type_default).command("user", user_default).command("variable", variable_default).command("hub", hub_default).command("folder", folder_default).command("schedule", schedule_default).command("trigger", trigger_default).command("dev", dev_default2).command("sync", sync_default).command("lint", lint_default).command("gitsync-settings", gitsync_settings_default).command("instance", instance_default).command("worker-groups", worker_groups_default).command("workers", workers_default).command("queues", queues_default).command("dependencies", dependencies_default).command("jobs", jobs_default).command("docs", docs_default).command("version --version", "Show version information").action(async (opts) => {
78240
78354
  console.log("CLI version: " + VERSION);
78241
78355
  try {
78242
78356
  const provider = new NpmProvider({ package: "windmill-cli" });
@@ -78266,20 +78380,20 @@ var command29 = new Command().name("wmill").action(() => info(`Welcome to Windmi
78266
78380
  error(e);
78267
78381
  info("Try running with sudo and otherwise check the result of the command: npm uninstall windmill-cli && npm install -g windmill-cli");
78268
78382
  })).command("completions", new Command().description("Generate shell completions.").command("bash", new Command().description("Generate bash completions.").action(() => {
78269
- process.stdout.write(generateShellCompletions(command29, "bash") + `
78383
+ process.stdout.write(generateShellCompletions(command30, "bash") + `
78270
78384
  `);
78271
78385
  })).command("zsh", new Command().description("Generate zsh completions.").action(() => {
78272
- process.stdout.write(generateShellCompletions(command29, "zsh") + `
78386
+ process.stdout.write(generateShellCompletions(command30, "zsh") + `
78273
78387
  `);
78274
78388
  })).command("fish", new Command().description("Generate fish completions.").action(() => {
78275
- process.stdout.write(generateShellCompletions(command29, "fish") + `
78389
+ process.stdout.write(generateShellCompletions(command30, "fish") + `
78276
78390
  `);
78277
78391
  })));
78278
78392
  async function main2() {
78279
78393
  try {
78280
78394
  const args = process.argv.slice(2);
78281
78395
  if (args.length === 0) {
78282
- command29.showHelp();
78396
+ command30.showHelp();
78283
78397
  }
78284
78398
  const LOG_LEVEL = args.includes("--verbose") || args.includes("--debug") ? "DEBUG" : "INFO";
78285
78399
  setShowDiffs(args.includes("--show-diffs"));
@@ -78289,7 +78403,7 @@ async function main2() {
78289
78403
  if (extraHeaders) {
78290
78404
  OpenAPI.HEADERS = extraHeaders;
78291
78405
  }
78292
- await command29.parse(args);
78406
+ await command30.parse(args);
78293
78407
  } catch (e) {
78294
78408
  if (e && typeof e === "object" && "name" in e && e.name === "ApiError") {
78295
78409
  console.log("Server failed. " + e.statusText + ": " + e.body);
@@ -78314,7 +78428,7 @@ if (isMain()) {
78314
78428
  process.stdin.destroy();
78315
78429
  });
78316
78430
  }
78317
- var main_default = command29;
78431
+ var main_default = command30;
78318
78432
  export {
78319
78433
  add as workspaceAdd,
78320
78434
  workspace_default as workspace,
@@ -78335,6 +78449,7 @@ export {
78335
78449
  gitsync_settings_default as gitsyncSettings,
78336
78450
  folder_default as folder,
78337
78451
  flow_default as flow,
78452
+ docs_default as docs,
78338
78453
  dev_default2 as dev,
78339
78454
  main_default as default,
78340
78455
  app_default as app,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-cli",
3
- "version": "1.645.0",
3
+ "version": "1.647.0",
4
4
  "description": "CLI for Windmill",
5
5
  "license": "Apache 2.0",
6
6
  "type": "module",