windmill-cli 1.651.1 → 1.653.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 +59 -15
  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.651.1",
11788
+ VERSION: "1.653.0",
11789
11789
  WITH_CREDENTIALS: true,
11790
11790
  interceptors: {
11791
11791
  request: new Interceptors,
@@ -25369,7 +25369,8 @@ async function remove(_opts, name) {
25369
25369
  }
25370
25370
  async function whoami2(_opts) {
25371
25371
  await requireLogin(_opts);
25372
- info(await globalWhoami());
25372
+ const whoamiInfo = await globalWhoami();
25373
+ info(JSON.stringify(whoamiInfo, null, 2));
25373
25374
  const activeName = await getActiveWorkspaceName(_opts);
25374
25375
  info("Active: " + colors.green.bold(activeName || "none"));
25375
25376
  }
@@ -62244,6 +62245,7 @@ ${folderList}
62244
62245
  let [_basePath, changes2] = queue.shift();
62245
62246
  const promise = (async () => {
62246
62247
  const alreadySynced = [];
62248
+ const deletedVarsResPaths = [];
62247
62249
  const isRawApp = isRawAppFile(changes2[0].path);
62248
62250
  if (isRawApp) {
62249
62251
  const deleteRawApp = changes2.find((change) => change.name === "deleted" && isRawAppFolderMetadataFile(change.path));
@@ -62371,12 +62373,23 @@ ${folderList}
62371
62373
  name: change.path.split(SEP8)[1]
62372
62374
  });
62373
62375
  break;
62374
- case "resource":
62375
- await deleteResource({
62376
- workspace: workspaceId,
62377
- path: removeSuffix(target, ".resource.json")
62378
- });
62376
+ case "resource": {
62377
+ const resourcePath = removeSuffix(target, ".resource.json");
62378
+ try {
62379
+ await deleteResource({
62380
+ workspace: workspaceId,
62381
+ path: resourcePath
62382
+ });
62383
+ } catch (e) {
62384
+ if (e?.status === 404 && deletedVarsResPaths.includes(resourcePath)) {
62385
+ debug(`Resource ${resourcePath} already deleted by linked variable`);
62386
+ } else {
62387
+ throw e;
62388
+ }
62389
+ }
62390
+ deletedVarsResPaths.push(resourcePath);
62379
62391
  break;
62392
+ }
62380
62393
  case "resource-type":
62381
62394
  await deleteResourceType({
62382
62395
  workspace: workspaceId,
@@ -62495,12 +62508,23 @@ ${folderList}
62495
62508
  });
62496
62509
  break;
62497
62510
  }
62498
- case "variable":
62499
- await deleteVariable({
62500
- workspace: workspaceId,
62501
- path: removeSuffix(target, ".variable.json")
62502
- });
62511
+ case "variable": {
62512
+ const variablePath = removeSuffix(target, ".variable.json");
62513
+ try {
62514
+ await deleteVariable({
62515
+ workspace: workspaceId,
62516
+ path: variablePath
62517
+ });
62518
+ } catch (e) {
62519
+ if (e?.status === 404 && deletedVarsResPaths.includes(variablePath)) {
62520
+ debug(`Variable ${variablePath} already deleted by linked resource`);
62521
+ } else {
62522
+ throw e;
62523
+ }
62524
+ }
62525
+ deletedVarsResPaths.push(variablePath);
62503
62526
  break;
62527
+ }
62504
62528
  case "user": {
62505
62529
  const users = await listUsers({
62506
62530
  workspace: workspaceId
@@ -67131,6 +67155,12 @@ function migrateToGroupedFormat(settings) {
67131
67155
  result.color = settings.color;
67132
67156
  if (settings.operator_settings !== undefined)
67133
67157
  result.operator_settings = settings.operator_settings;
67158
+ if (settings.slack_team_id !== undefined)
67159
+ result.slack_team_id = settings.slack_team_id;
67160
+ if (settings.slack_name !== undefined)
67161
+ result.slack_name = settings.slack_name;
67162
+ if (settings.slack_command_script !== undefined)
67163
+ result.slack_command_script = settings.slack_command_script;
67134
67164
  if (settings.auto_invite && typeof settings.auto_invite === "object") {
67135
67165
  result.auto_invite = settings.auto_invite;
67136
67166
  } else if (settings.auto_invite_enabled !== undefined) {
@@ -67192,12 +67222,17 @@ async function pushWorkspaceSettings(workspace, _path, settings, localSettings)
67192
67222
  name: workspaceName,
67193
67223
  mute_critical_alerts: remoteSettings.mute_critical_alerts,
67194
67224
  color: remoteSettings.color,
67195
- operator_settings: remoteSettings.operator_settings
67225
+ operator_settings: remoteSettings.operator_settings,
67226
+ slack_team_id: remoteSettings.slack_team_id,
67227
+ slack_name: remoteSettings.slack_name,
67228
+ slack_command_script: remoteSettings.slack_command_script
67196
67229
  };
67197
67230
  } catch (err) {
67198
67231
  throw new Error(`Failed to get workspace settings: ${err}`);
67199
67232
  }
67200
- if (isSuperset(localSettings, settings)) {
67233
+ const { slack_team_id: _lst, slack_name: _lsn, ...comparableLocal } = localSettings;
67234
+ const { slack_team_id: _rst, slack_name: _rsn, ...comparableRemote } = settings;
67235
+ if (isSuperset(comparableLocal, comparableRemote)) {
67201
67236
  debug(`Workspace settings are up to date`);
67202
67237
  return;
67203
67238
  }
@@ -67346,6 +67381,15 @@ async function pushWorkspaceSettings(workspace, _path, settings, localSettings)
67346
67381
  requestBody: localSettings.operator_settings
67347
67382
  });
67348
67383
  }
67384
+ if (localSettings.slack_command_script != settings.slack_command_script) {
67385
+ debug(`Updating slack command script...`);
67386
+ await editSlackCommand({
67387
+ workspace,
67388
+ requestBody: {
67389
+ slack_command_script: localSettings.slack_command_script
67390
+ }
67391
+ });
67392
+ }
67349
67393
  }
67350
67394
  async function pushWorkspaceKey(workspace, _path, key, localKey) {
67351
67395
  try {
@@ -78416,7 +78460,7 @@ var docs_default = command29;
78416
78460
 
78417
78461
  // src/main.ts
78418
78462
  await init_context();
78419
- var VERSION = "1.651.1";
78463
+ var VERSION = "1.653.0";
78420
78464
  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) => {
78421
78465
  console.log("CLI version: " + VERSION);
78422
78466
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-cli",
3
- "version": "1.651.1",
3
+ "version": "1.653.0",
4
4
  "description": "CLI for Windmill",
5
5
  "license": "Apache 2.0",
6
6
  "type": "module",