windmill-cli 1.589.0 → 1.589.2

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 (31) hide show
  1. package/esm/gen/core/OpenAPI.js +1 -1
  2. package/esm/src/commands/app/app_metadata.js +224 -33
  3. package/esm/src/commands/app/apps.js +18 -14
  4. package/esm/src/commands/app/dev.js +10 -8
  5. package/esm/src/commands/app/raw_apps.js +7 -59
  6. package/esm/src/commands/flow/flow_metadata.js +5 -2
  7. package/esm/src/commands/init/init.js +5 -7
  8. package/esm/src/commands/sync/sync.js +29 -10
  9. package/esm/src/commands/trigger/trigger.js +3 -7
  10. package/esm/src/main.js +2 -2
  11. package/esm/src/utils/utils.js +9 -0
  12. package/package.json +1 -1
  13. package/types/gen/types.gen.d.ts +2 -0
  14. package/types/gen/types.gen.d.ts.map +1 -1
  15. package/types/src/commands/app/app_metadata.d.ts +8 -1
  16. package/types/src/commands/app/app_metadata.d.ts.map +1 -1
  17. package/types/src/commands/app/apps.d.ts +1 -1
  18. package/types/src/commands/app/apps.d.ts.map +1 -1
  19. package/types/src/commands/app/dev.d.ts.map +1 -1
  20. package/types/src/commands/app/raw_apps.d.ts +0 -7
  21. package/types/src/commands/app/raw_apps.d.ts.map +1 -1
  22. package/types/src/commands/flow/flow_metadata.d.ts.map +1 -1
  23. package/types/src/commands/init/init.d.ts.map +1 -1
  24. package/types/src/commands/sync/sync.d.ts.map +1 -1
  25. package/types/src/commands/trigger/trigger.d.ts.map +1 -1
  26. package/types/src/main.d.ts +1 -1
  27. package/types/src/main.d.ts.map +1 -1
  28. package/types/src/utils/utils.d.ts +1 -0
  29. package/types/src/utils/utils.d.ts.map +1 -1
  30. package/types/windmill-utils-internal/src/gen/types.gen.d.ts +2 -0
  31. package/types/windmill-utils-internal/src/gen/types.gen.d.ts.map +1 -1
@@ -181,15 +181,13 @@ async function initAction(opts) {
181
181
  // Create CLAUDE.md file
182
182
  if (!(await dntShim.Deno.stat("CLAUDE.md").catch(() => null))) {
183
183
  await dntShim.Deno.writeTextFile("CLAUDE.md", `
184
- # Claude
184
+ You are a helpful assistant that can help with Windmill scripts and flows creation.
185
185
 
186
- You are a helpful assistant that can help with Windmill scripts and flows creation.
186
+ ## Script Guidance
187
+ ${scriptGuidanceContent}
187
188
 
188
- ## Script Guidance
189
- ${scriptGuidanceContent}
190
-
191
- ## Flow Guidance
192
- ${flowGuidanceContent}
189
+ ## Flow Guidance
190
+ ${flowGuidanceContent}
193
191
  `);
194
192
  log.info(colors.green("Created CLAUDE.md"));
195
193
  }
@@ -1,13 +1,13 @@
1
1
  import * as dntShim from "../../../_dnt.shims.js";
2
2
  import { requireLogin } from "../../core/auth.js";
3
- import { fetchVersion, resolveWorkspace } from "../../core/context.js";
3
+ import { resolveWorkspace } from "../../core/context.js";
4
4
  import { colors, Command, Confirm, ensureDir, log, minimatch, path, SEP, yamlParseContent, yamlStringify, } from "../../../deps.js";
5
5
  import * as wmill from "../../../gen/services.gen.js";
6
6
  import { getTypeStrFromPath, parseFromPath, pushObj, showConflict, showDiff, } from "../../types.js";
7
7
  import { downloadZip } from "./pull.js";
8
8
  import { exts, findContentFile, findResourceFile, handleScriptMetadata, removeExtensionToPath, } from "../script/script.js";
9
9
  import { handleFile } from "../script/script.js";
10
- import { deepEqual, isFileResource, isRawAppFile, isWorkspaceDependencies, } from "../../utils/utils.js";
10
+ import { deepEqual, fetchRemoteVersion, isFileResource, isRawAppFile, isWorkspaceDependencies, } from "../../utils/utils.js";
11
11
  import { getEffectiveSettings, mergeConfigWithConfigFile, validateBranchConfiguration, } from "../../core/conf.js";
12
12
  import { fromBranchSpecificPath, getBranchSpecificPath, getSpecificItemsForCurrentBranch, isBranchSpecificFile, isCurrentBranchFile, isSpecificItem, } from "../../core/specific_items.js";
13
13
  import { getCurrentGitBranch } from "../../utils/git.js";
@@ -19,8 +19,7 @@ import { newPathAssigner, } from "../../../windmill-utils-internal/src/path-util
19
19
  import { extractInlineScripts as extractInlineScriptsForFlows } from "../../../windmill-utils-internal/src/inline-scripts/extractor.js";
20
20
  import { generateFlowLockInternal } from "../flow/flow_metadata.js";
21
21
  import { isExecutionModeAnonymous } from "../app/apps.js";
22
- import { generateAppLocksInternal } from "../app/app_metadata.js";
23
- import { updateGlobalVersions } from "./global.js";
22
+ import { APP_BACKEND_FOLDER, generateAppLocksInternal, } from "../app/app_metadata.js";
24
23
  // Merge CLI options with effective settings, preserving CLI flags as overrides
25
24
  function mergeCliWithEffectiveOptions(cliOpts, effectiveOpts) {
26
25
  // overlay CLI options on top (undefined cliOpts won't override effectiveOpts)
@@ -416,7 +415,7 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, ig
416
415
  for (const s of inlineScripts) {
417
416
  yield {
418
417
  isDirectory: false,
419
- path: path.join(finalPath, "runnables", s.path),
418
+ path: path.join(finalPath, APP_BACKEND_FOLDER, s.path),
420
419
  async *getChildren() { },
421
420
  // deno-lint-ignore require-await
422
421
  async getContentText() {
@@ -1369,7 +1368,11 @@ export async function pull(opts) {
1369
1368
  }
1370
1369
  for (const change of tracker.rawApps) {
1371
1370
  log.info(`Updating lock metadata for raw app ${change}`);
1372
- await generateAppLocksInternal(change, false, workspace, opts, true, true);
1371
+ await generateAppLocksInternal(change, false, true, workspace, opts, true, true);
1372
+ }
1373
+ for (const change of tracker.apps) {
1374
+ log.info(`Updating lock metadata for app ${change}`);
1375
+ await generateAppLocksInternal(change, false, false, workspace, opts, true, true);
1373
1376
  }
1374
1377
  if (opts.jsonOutput) {
1375
1378
  const result = {
@@ -1520,6 +1523,7 @@ export async function push(opts) {
1520
1523
  const tracker = await buildTracker(changes);
1521
1524
  const staleScripts = [];
1522
1525
  const staleFlows = [];
1526
+ const staleApps = [];
1523
1527
  for (const change of tracker.scripts) {
1524
1528
  const stale = await generateScriptMetadataInternal(change, workspace, opts, true, true, rawWorkspaceDependencies, codebases, false);
1525
1529
  if (stale) {
@@ -1547,11 +1551,26 @@ export async function push(opts) {
1547
1551
  }
1548
1552
  log.info("");
1549
1553
  }
1550
- const version = await fetchVersion(workspace.remote);
1551
- if (version) {
1552
- updateGlobalVersions(version);
1554
+ for (const change of tracker.apps) {
1555
+ const stale = await generateAppLocksInternal(change, false, true, workspace, opts, true, true);
1556
+ if (stale) {
1557
+ staleApps.push(stale);
1558
+ }
1559
+ }
1560
+ for (const change of tracker.rawApps) {
1561
+ const stale = await generateAppLocksInternal(change, true, true, workspace, opts, true, true);
1562
+ if (stale) {
1563
+ staleApps.push(stale);
1564
+ }
1565
+ }
1566
+ if (staleApps.length > 0) {
1567
+ log.warn("Stale apps locks found, you may want to update them using 'wmill app generate-locks' before pushing:");
1568
+ for (const stale of staleApps) {
1569
+ log.warn(stale);
1570
+ }
1571
+ log.info("");
1553
1572
  }
1554
- log.info(colors.gray("Remote version: " + version));
1573
+ await fetchRemoteVersion(workspace);
1555
1574
  log.info(`remote (${workspace.name}) <- local: ${changes.length} changes to apply`);
1556
1575
  // Handle JSON output for dry-run
1557
1576
  if (opts.dryRun && opts.jsonOutput) {
@@ -2,7 +2,7 @@ import * as dntShim from "../../../_dnt.shims.js";
2
2
  import * as wmill from "../../../gen/services.gen.js";
3
3
  import { colors, Command, log, SEP, Table } from "../../../deps.js";
4
4
  import { isSuperset, parseFromFile, removeType, TRIGGER_TYPES, } from "../../types.js";
5
- import { fromBranchSpecificPath, isBranchSpecificFile } from "../../core/specific_items.js";
5
+ import { fromBranchSpecificPath, isBranchSpecificFile, } from "../../core/specific_items.js";
6
6
  import { getCurrentGitBranch } from "../../utils/git.js";
7
7
  import { requireLogin } from "../../core/auth.js";
8
8
  import { validatePath, resolveWorkspace } from "../../core/context.js";
@@ -31,9 +31,7 @@ async function updateTrigger(triggerType, workspace, path, trigger) {
31
31
  postgres: wmill.updatePostgresTrigger,
32
32
  mqtt: wmill.updateMqttTrigger,
33
33
  sqs: wmill.updateSqsTrigger,
34
- gcp: async (args) => {
35
- throw new Error("GCP triggers are not supported yet");
36
- },
34
+ gcp: wmill.updateGcpTrigger,
37
35
  email: wmill.updateEmailTrigger,
38
36
  };
39
37
  const triggerFunction = triggerFunctions[triggerType];
@@ -48,9 +46,7 @@ async function createTrigger(triggerType, workspace, path, trigger) {
48
46
  postgres: wmill.createPostgresTrigger,
49
47
  mqtt: wmill.createMqttTrigger,
50
48
  sqs: wmill.createSqsTrigger,
51
- gcp: async (args) => {
52
- throw new Error("GCP triggers are not supported yet");
53
- },
49
+ gcp: wmill.createGcpTrigger,
54
50
  email: wmill.createEmailTrigger,
55
51
  };
56
52
  const triggerFunction = triggerFunctions[triggerType];
package/esm/src/main.js CHANGED
@@ -20,7 +20,6 @@ import gitsyncSettings from "./commands/gitsync-settings/gitsync-settings.js";
20
20
  import instance from "./commands/instance/instance.js";
21
21
  import workerGroups from "./commands/worker-groups/worker_groups.js";
22
22
  import dev from "./commands/dev/dev.js";
23
- import { fetchVersion } from "./core/context.js";
24
23
  import { OpenAPI } from "../gen/index.js";
25
24
  import { getHeaders, getIsWin } from "./utils/utils.js";
26
25
  import { setShowDiffs } from "./core/conf.js";
@@ -33,6 +32,7 @@ import queues from "./commands/queues/queues.js";
33
32
  import dependencies from "./commands/dependencies/dependencies.js";
34
33
  import init from "./commands/init/init.js";
35
34
  import jobs from "./commands/jobs/jobs.js";
35
+ import { fetchVersion } from "./core/context.js";
36
36
  export { flow, app, script, workspace, resource, resourceType, user, variable, hub, folder, schedule, trigger, sync, gitsyncSettings, instance, dev, hubPull, pull, push, workspaceAdd, };
37
37
  // addEventListener("error", (event) => {
38
38
  // if (event.error) {
@@ -40,7 +40,7 @@ export { flow, app, script, workspace, resource, resourceType, user, variable, h
40
40
  // console.error(JSON.stringify(event.error, null, 4));
41
41
  // }
42
42
  // });
43
- export const VERSION = "1.589.0";
43
+ export const VERSION = "1.589.2";
44
44
  export const WM_FORK_PREFIX = "wm-fork";
45
45
  const command = new Command()
46
46
  .name("wmill")
@@ -4,6 +4,8 @@ import * as dntShim from "../../_dnt.shims.js";
4
4
  // @ts-nocheck This file is copied from a JS project, so it's not type-safe.
5
5
  import { colors, encodeHex, log, SEP } from "../../deps.js";
6
6
  import crypto from "node:crypto";
7
+ import { fetchVersion } from "../core/context.js";
8
+ import { updateGlobalVersions } from "../commands/sync/global.js";
7
9
  export function deepEqual(a, b) {
8
10
  if (a === b)
9
11
  return true;
@@ -214,3 +216,10 @@ export function writeIfChanged(path, content) {
214
216
  dntShim.Deno.writeTextFileSync(path, content);
215
217
  return true; // File was written
216
218
  }
219
+ export async function fetchRemoteVersion(workspace) {
220
+ const version = await fetchVersion(workspace.remote);
221
+ if (version) {
222
+ updateGlobalVersions(version);
223
+ }
224
+ log.info(colors.gray("Remote version: " + version));
225
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-cli",
3
- "version": "1.589.0",
3
+ "version": "1.589.2",
4
4
  "description": "CLI for Windmill",
5
5
  "repository": {
6
6
  "type": "git",
@@ -4757,6 +4757,7 @@ export type GetScriptDeploymentStatusData = {
4757
4757
  export type GetScriptDeploymentStatusResponse = ({
4758
4758
  lock?: string;
4759
4759
  lock_error_logs?: string;
4760
+ job_id?: string;
4760
4761
  });
4761
4762
  export type ListSelectedJobGroupsData = {
4762
4763
  /**
@@ -5465,6 +5466,7 @@ export type GetFlowDeploymentStatusData = {
5465
5466
  };
5466
5467
  export type GetFlowDeploymentStatusResponse = ({
5467
5468
  lock_error_logs?: string;
5469
+ job_id?: string;
5468
5470
  });
5469
5471
  export type GetTriggersCountOfFlowData = {
5470
5472
  path: string;