windmill-cli 1.784.0 → 1.785.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 +429 -76
  2. package/package.json +2 -2
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.784.0",
16787
+ VERSION: "1.785.0",
16788
16788
  WITH_CREDENTIALS: true,
16789
16789
  interceptors: {
16790
16790
  request: new Interceptors,
@@ -17515,6 +17515,8 @@ __export(exports_services_gen, {
17515
17515
  getOfflineLicenseStatus: () => getOfflineLicenseStatus,
17516
17516
  getObjectStorageUsage: () => getObjectStorageUsage,
17517
17517
  getOauthConnect: () => getOauthConnect,
17518
+ getNpmProxyConfig: () => getNpmProxyConfig,
17519
+ getNpmPackageTarball: () => getNpmPackageTarball,
17518
17520
  getNpmPackageMetadata: () => getNpmPackageMetadata,
17519
17521
  getNpmPackageFiletree: () => getNpmPackageFiletree,
17520
17522
  getNpmPackageFile: () => getNpmPackageFile,
@@ -20549,6 +20551,14 @@ var backendVersion = () => {
20549
20551
  workspace: data3.workspace
20550
20552
  }
20551
20553
  });
20554
+ }, getNpmProxyConfig = (data3) => {
20555
+ return request(OpenAPI, {
20556
+ method: "GET",
20557
+ url: "/w/{workspace}/npm_proxy/config",
20558
+ path: {
20559
+ workspace: data3.workspace
20560
+ }
20561
+ });
20552
20562
  }, getNpmPackageMetadata = (data3) => {
20553
20563
  return request(OpenAPI, {
20554
20564
  method: "GET",
@@ -20591,6 +20601,16 @@ var backendVersion = () => {
20591
20601
  filepath: data3.filepath
20592
20602
  }
20593
20603
  });
20604
+ }, getNpmPackageTarball = (data3) => {
20605
+ return request(OpenAPI, {
20606
+ method: "GET",
20607
+ url: "/w/{workspace}/npm_proxy/tarball/{package}/{version}",
20608
+ path: {
20609
+ workspace: data3.workspace,
20610
+ package: data3._package,
20611
+ version: data3.version
20612
+ }
20613
+ });
20594
20614
  }, queryResourceTypes = (data3) => {
20595
20615
  return request(OpenAPI, {
20596
20616
  method: "GET",
@@ -26943,6 +26963,8 @@ __export(exports_gen, {
26943
26963
  getOfflineLicenseStatus: () => getOfflineLicenseStatus,
26944
26964
  getObjectStorageUsage: () => getObjectStorageUsage,
26945
26965
  getOauthConnect: () => getOauthConnect,
26966
+ getNpmProxyConfig: () => getNpmProxyConfig,
26967
+ getNpmPackageTarball: () => getNpmPackageTarball,
26946
26968
  getNpmPackageMetadata: () => getNpmPackageMetadata,
26947
26969
  getNpmPackageFiletree: () => getNpmPackageFiletree,
26948
26970
  getNpmPackageFile: () => getNpmPackageFile,
@@ -27427,7 +27449,7 @@ var init_auth = __esm(async () => {
27427
27449
  });
27428
27450
 
27429
27451
  // src/core/constants.ts
27430
- var WM_FORK_PREFIX = "wm-fork", VERSION = "1.784.0";
27452
+ var WM_FORK_PREFIX = "wm-fork", VERSION = "1.785.0";
27431
27453
 
27432
27454
  // src/utils/git.ts
27433
27455
  var exports_git = {};
@@ -31744,6 +31766,12 @@ function isFileResource(path5) {
31744
31766
  const splitPath = path5.split(".");
31745
31767
  return splitPath.length >= 4 && splitPath[splitPath.length - 3] == "resource" && splitPath[splitPath.length - 2] == "file";
31746
31768
  }
31769
+ function removeResourceSuffix(path5) {
31770
+ if (isFileResource(path5)) {
31771
+ return path5.split(".").slice(0, -3).join(".");
31772
+ }
31773
+ return path5.replace(/\.resource\.(yaml|json)$/, "");
31774
+ }
31747
31775
  function isFilesetResource(path5) {
31748
31776
  return path5.includes(".fileset/") || path5.includes(".fileset\\");
31749
31777
  }
@@ -61708,7 +61736,7 @@ var init_openflow = __esm(() => {
61708
61736
  openflow_default = {
61709
61737
  openapi: "3.0.3",
61710
61738
  info: {
61711
- version: "1.784.0",
61739
+ version: "1.785.0",
61712
61740
  title: "OpenFlow Spec",
61713
61741
  contact: {
61714
61742
  name: "Ruben Fiszel",
@@ -64178,17 +64206,73 @@ Frontend appends a \`*\` to the displayed name.
64178
64206
  },
64179
64207
  filters: {
64180
64208
  type: "array",
64209
+ description: "Filters to match incoming messages (only matching messages trigger the script). Each entry is either a leaf `{key, value}` (top-level field) or `{path, value}` (dotted path into nested objects), or a group `{any_of: [...]}` / `{all_of: [...]}` / `{none_of: [...]}` nesting more entries. Entries at the top level are combined with `filter_logic`.",
64181
64210
  items: {
64182
- type: "object",
64183
- properties: {
64184
- key: {
64185
- type: "string"
64211
+ description: "Either a leaf filter, matching a field of the message (parsed as JSON) against a value by equality (or superset, when the value is an object or array) — addressed by `key` for a top-level field or `path` for a dotted path into nested objects — or a group nesting sub-filters under a boolean operator (`none_of` matches when none of its sub-filters do).\n",
64212
+ oneOf: [
64213
+ {
64214
+ type: "object",
64215
+ properties: {
64216
+ key: {
64217
+ type: "string"
64218
+ },
64219
+ value: {}
64220
+ },
64221
+ required: [
64222
+ "key",
64223
+ "value"
64224
+ ]
64186
64225
  },
64187
- value: {}
64188
- },
64189
- required: [
64190
- "key",
64191
- "value"
64226
+ {
64227
+ type: "object",
64228
+ properties: {
64229
+ path: {
64230
+ type: "string",
64231
+ description: "Dotted path into nested objects, e.g. `a.b.c`. Does not traverse arrays."
64232
+ },
64233
+ value: {}
64234
+ },
64235
+ required: [
64236
+ "path",
64237
+ "value"
64238
+ ]
64239
+ },
64240
+ {
64241
+ type: "object",
64242
+ properties: {
64243
+ any_of: {
64244
+ type: "array",
64245
+ items: {}
64246
+ }
64247
+ },
64248
+ required: [
64249
+ "any_of"
64250
+ ]
64251
+ },
64252
+ {
64253
+ type: "object",
64254
+ properties: {
64255
+ all_of: {
64256
+ type: "array",
64257
+ items: {}
64258
+ }
64259
+ },
64260
+ required: [
64261
+ "all_of"
64262
+ ]
64263
+ },
64264
+ {
64265
+ type: "object",
64266
+ properties: {
64267
+ none_of: {
64268
+ type: "array",
64269
+ items: {}
64270
+ }
64271
+ },
64272
+ required: [
64273
+ "none_of"
64274
+ ]
64275
+ }
64192
64276
  ]
64193
64277
  }
64194
64278
  },
@@ -64199,7 +64283,7 @@ Frontend appends a \`*\` to the displayed name.
64199
64283
  "or"
64200
64284
  ],
64201
64285
  default: "and",
64202
- description: "Logic to apply when evaluating filters. 'and' requires all filters to match, 'or' requires any filter to match."
64286
+ description: "Logic to apply when evaluating the top-level filters. 'and' requires all of them to match, 'or' requires any of them to match. Nested `any_of`/`all_of`/`none_of` groups carry their own logic."
64203
64287
  },
64204
64288
  auto_offset_reset: {
64205
64289
  type: "string",
@@ -64921,18 +65005,73 @@ Frontend appends a \`*\` to the displayed name.
64921
65005
  },
64922
65006
  filters: {
64923
65007
  type: "array",
64924
- description: "Array of key-value filters to match incoming messages (only matching messages trigger the script)",
65008
+ description: "Filters to match incoming messages (only matching messages trigger the script). Each entry is either a leaf `{key, value}` (top-level field) or `{path, value}` (dotted path into nested objects), or a group `{any_of: [...]}` / `{all_of: [...]}` / `{none_of: [...]}` nesting more entries. Entries at the top level are combined with `filter_logic`.",
64925
65009
  items: {
64926
- type: "object",
64927
- properties: {
64928
- key: {
64929
- type: "string"
65010
+ description: "Either a leaf filter, matching a field of the message (parsed as JSON) against a value by equality (or superset, when the value is an object or array) — addressed by `key` for a top-level field or `path` for a dotted path into nested objects — or a group nesting sub-filters under a boolean operator (`none_of` matches when none of its sub-filters do).\n",
65011
+ oneOf: [
65012
+ {
65013
+ type: "object",
65014
+ properties: {
65015
+ key: {
65016
+ type: "string"
65017
+ },
65018
+ value: {}
65019
+ },
65020
+ required: [
65021
+ "key",
65022
+ "value"
65023
+ ]
64930
65024
  },
64931
- value: {}
64932
- },
64933
- required: [
64934
- "key",
64935
- "value"
65025
+ {
65026
+ type: "object",
65027
+ properties: {
65028
+ path: {
65029
+ type: "string",
65030
+ description: "Dotted path into nested objects, e.g. `a.b.c`. Does not traverse arrays."
65031
+ },
65032
+ value: {}
65033
+ },
65034
+ required: [
65035
+ "path",
65036
+ "value"
65037
+ ]
65038
+ },
65039
+ {
65040
+ type: "object",
65041
+ properties: {
65042
+ any_of: {
65043
+ type: "array",
65044
+ items: {}
65045
+ }
65046
+ },
65047
+ required: [
65048
+ "any_of"
65049
+ ]
65050
+ },
65051
+ {
65052
+ type: "object",
65053
+ properties: {
65054
+ all_of: {
65055
+ type: "array",
65056
+ items: {}
65057
+ }
65058
+ },
65059
+ required: [
65060
+ "all_of"
65061
+ ]
65062
+ },
65063
+ {
65064
+ type: "object",
65065
+ properties: {
65066
+ none_of: {
65067
+ type: "array",
65068
+ items: {}
65069
+ }
65070
+ },
65071
+ required: [
65072
+ "none_of"
65073
+ ]
65074
+ }
64936
65075
  ]
64937
65076
  }
64938
65077
  },
@@ -64943,7 +65082,7 @@ Frontend appends a \`*\` to the displayed name.
64943
65082
  "or"
64944
65083
  ],
64945
65084
  default: "and",
64946
- description: "Logic to apply when evaluating filters. 'and' requires all filters to match, 'or' requires any filter to match."
65085
+ description: "Logic to apply when evaluating the top-level filters. 'and' requires all of them to match, 'or' requires any of them to match. Nested `any_of`/`all_of`/`none_of` groups carry their own logic."
64947
65086
  },
64948
65087
  initial_messages: {
64949
65088
  type: "array",
@@ -65696,6 +65835,9 @@ function getWorkspaceSpecificPath(basePath, specificItems, workspaceNameOverride
65696
65835
  return;
65697
65836
  }
65698
65837
  function isCurrentWorkspaceFile(path8, workspaceNameOverride) {
65838
+ if (isFilesetResource(path8)) {
65839
+ return false;
65840
+ }
65699
65841
  let currentWorkspace = null;
65700
65842
  if (workspaceNameOverride) {
65701
65843
  currentWorkspace = workspaceNameOverride;
@@ -65715,6 +65857,9 @@ function isCurrentWorkspaceFile(path8, workspaceNameOverride) {
65715
65857
  return pattern.test(path8);
65716
65858
  }
65717
65859
  function isWorkspaceSpecificFile(path8) {
65860
+ if (isFilesetResource(path8)) {
65861
+ return false;
65862
+ }
65718
65863
  const typePattern = buildItemTypePattern();
65719
65864
  return new RegExp(`\\.[^.]+\\.${typePattern}\\.(yaml|json)$|` + `\\.[^.]+\\.resource\\.file\\..+$|` + `/folder\\.[^.]+\\.meta\\.(yaml|json)$|` + `^settings\\.[^.]+\\.(yaml|json)$`).test(path8);
65720
65865
  }
@@ -66769,7 +66914,7 @@ __export(exports_generate_metadata, {
66769
66914
  });
66770
66915
  import { sep as SEP5 } from "node:path";
66771
66916
  async function walkLocalScripts(codebases, ignore) {
66772
- const elems = await elementsToMap(await FSFSElement(process.cwd(), codebases, false), (p, isD) => !isD && !hasScriptExt(p) || ignore(p, isD) || isFolderResourcePathAnyFormat(p) || isDatatableMigrationPath(p) || isScriptModulePath(p) && !isModuleEntryPoint(p), false, {});
66917
+ const elems = await elementsToMap(await FSFSElement(process.cwd(), codebases, false), (p, isD) => !isD && !hasScriptExt(p) || ignore(p, isD) || isFolderResourcePathAnyFormat(p) || isDatatableMigrationPath(p) || isFileResource(p) || isFilesetResource(p) || isScriptModulePath(p) && !isModuleEntryPoint(p), false, {});
66773
66918
  return Object.keys(elems);
66774
66919
  }
66775
66920
  async function walkLocalFlowFolders(ignore) {
@@ -66828,7 +66973,7 @@ function categorizeLocalFiles(paths) {
66828
66973
  flowFolderSet.add(p.substring(0, p.lastIndexOf(SEP5)));
66829
66974
  } else if (p.endsWith(SEP5 + "raw_app.yaml") || p.endsWith(SEP5 + "app.yaml")) {
66830
66975
  appPaths.push(p);
66831
- } else if (hasScriptExt(p) && !isFolderResourcePathAnyFormat(p) && !isDatatableMigrationPath(p) && !(isScriptModulePath(p) && !isModuleEntryPoint(p))) {
66976
+ } else if (hasScriptExt(p) && !isFolderResourcePathAnyFormat(p) && !isDatatableMigrationPath(p) && !isFileResource(p) && !isFilesetResource(p) && !(isScriptModulePath(p) && !isModuleEntryPoint(p))) {
66832
66977
  scripts.push(p);
66833
66978
  }
66834
66979
  }
@@ -67220,6 +67365,7 @@ var init_generate_metadata = __esm(async () => {
67220
67365
  await __promiseAll([
67221
67366
  init_confirm(),
67222
67367
  init_types(),
67368
+ init_utils(),
67223
67369
  init_conf(),
67224
67370
  init_context(),
67225
67371
  init_auth(),
@@ -67278,6 +67424,9 @@ async function push2(opts, filePath) {
67278
67424
  if (filePath.endsWith(".script.json") || filePath.endsWith(".script.yaml")) {
67279
67425
  throw Error("Cannot push a script metadata file, point to the script content file instead (.py, .ts, .go|.sh)");
67280
67426
  }
67427
+ if (isFileResource(filePath) || isFilesetResource(filePath)) {
67428
+ throw Error("Cannot push a file/fileset resource content file as a script, push its .resource.yaml with 'wmill resource push' instead");
67429
+ }
67281
67430
  await requireLogin(opts);
67282
67431
  try {
67283
67432
  const content = await readScriptContent(filePath);
@@ -67337,6 +67486,9 @@ async function handleScriptMetadata(path10, workspace, alreadySynced, message, r
67337
67486
  }
67338
67487
  }
67339
67488
  async function handleFile(path10, workspace, alreadySynced, message, opts, rawWorkspaceDependencies, codebases, permissionedAsContext) {
67489
+ if (isFileResource(path10) || isFilesetResource(path10)) {
67490
+ return false;
67491
+ }
67340
67492
  const moduleEntryPoint = isModuleEntryPoint(path10);
67341
67493
  if (!isAppInlineScriptPath2(path10) && !isFlowInlineScriptPath2(path10) && !isRawAppPath(path10) && (!isScriptModulePath(path10) || moduleEntryPoint) && hasScriptExt(path10)) {
67342
67494
  if (alreadySynced.includes(path10)) {
@@ -69268,7 +69420,15 @@ async function readFilesetDirectory(dirPath) {
69268
69420
  await walk(dirPath, "");
69269
69421
  return result;
69270
69422
  }
69271
- async function pushResource(workspace, remotePath, resource, localResource, originalLocalPath, wsSpecific) {
69423
+ function validateFilesetPointer(dirPath, remotePath) {
69424
+ const normalize6 = (p) => p.replaceAll("\\", "/").replace(/\/+$/, "");
69425
+ const pointer = normalize6(dirPath);
69426
+ const expected = normalize6(remotePath.replaceAll(SEP8, "/")) + ".fileset";
69427
+ if (pointer !== expected) {
69428
+ throw new Error(`Resource ${remotePath.replaceAll(SEP8, "/")} uses '!inline_fileset ${dirPath}', ` + `but a fileset directory must live next to its resource file, at '${expected}'. ` + `Move the directory there (e.g. 'git mv ${pointer} ${expected}') and update the ` + `'!inline_fileset' value to match.`);
69429
+ }
69430
+ }
69431
+ async function pushResource(workspace, remotePath, resource, localResource, originalLocalPath, wsSpecific, enforceCanonicalFileset) {
69272
69432
  remotePath = removeType(remotePath, "resource");
69273
69433
  try {
69274
69434
  resource = await getResource({
@@ -69279,6 +69439,9 @@ async function pushResource(workspace, remotePath, resource, localResource, orig
69279
69439
  const resolveInlineContent = async () => {
69280
69440
  if (typeof localResource.value === "string" && localResource.value.startsWith("!inline_fileset ")) {
69281
69441
  const dirPath = localResource.value.split(" ")[1];
69442
+ if (enforceCanonicalFileset) {
69443
+ validateFilesetPointer(dirPath, remotePath);
69444
+ }
69282
69445
  localResource.value = await readFilesetDirectory(dirPath.replaceAll("/", SEP8));
69283
69446
  } else if (localResource.value["content"]?.startsWith("!inline ")) {
69284
69447
  const basePath = localResource.value["content"].split(" ")[1];
@@ -69444,6 +69607,7 @@ __export(exports_sync, {
69444
69607
  gitDeploy: () => gitDeploy,
69445
69608
  generateDatatablesDocumentation: () => generateDatatablesDocumentation,
69446
69609
  generateAgentsDocumentation: () => generateAgentsDocumentation,
69610
+ findFilesetResourceFile: () => findFilesetResourceFile,
69447
69611
  findCodebase: () => findCodebase,
69448
69612
  findCaseInsensitiveCollisions: () => findCaseInsensitiveCollisions,
69449
69613
  extractInlineScriptsForApps: () => extractInlineScriptsForApps,
@@ -69920,13 +70084,16 @@ function parseFileResourceTypeMap(raw) {
69920
70084
  }
69921
70085
  return { formatExtMap, filesetMap };
69922
70086
  }
69923
- async function findFilesetResourceFile(changePath) {
70087
+ async function findFilesetResourceFile(changePath, wsName) {
69924
70088
  const filesetIdx = changePath.indexOf(".fileset" + SEP9);
69925
70089
  if (filesetIdx === -1) {
69926
70090
  throw new Error(`Not a fileset resource path: ${changePath}`);
69927
70091
  }
69928
70092
  const basePath = changePath.substring(0, filesetIdx);
69929
70093
  const candidates = [basePath + ".resource.json", basePath + ".resource.yaml"];
70094
+ if (wsName) {
70095
+ candidates.unshift(toWorkspaceSpecificPath(basePath + ".resource.json", wsName), toWorkspaceSpecificPath(basePath + ".resource.yaml", wsName));
70096
+ }
69930
70097
  for (const candidate of candidates) {
69931
70098
  try {
69932
70099
  const s = await stat7(candidate);
@@ -69939,7 +70106,7 @@ async function findFilesetResourceFile(changePath) {
69939
70106
  async function pushFilesetParentResource(childPath, workspaceId, alreadySynced, cachedWsName, specificItems) {
69940
70107
  let resourceFilePath;
69941
70108
  try {
69942
- resourceFilePath = await findFilesetResourceFile(childPath);
70109
+ resourceFilePath = await findFilesetResourceFile(childPath, cachedWsName);
69943
70110
  } catch {
69944
70111
  return { status: "parent-missing" };
69945
70112
  }
@@ -69956,7 +70123,7 @@ async function pushFilesetParentResource(childPath, workspaceId, alreadySynced,
69956
70123
  } else if (specificItems && isSpecificItem(childPath, specificItems)) {
69957
70124
  wsSpecific = true;
69958
70125
  }
69959
- await pushResource(workspaceId, serverPath, undefined, newObj, resourceFilePath, wsSpecific ? true : undefined);
70126
+ await pushResource(workspaceId, serverPath, undefined, newObj, resourceFilePath, wsSpecific ? true : undefined, true);
69960
70127
  return { status: "pushed", resourceFilePath };
69961
70128
  }
69962
70129
  function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, resourceTypeToIsFileset, ignoreCodebaseChanges, stripOnBehalfOf) {
@@ -72034,6 +72201,41 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
72034
72201
  warn(msg);
72035
72202
  }
72036
72203
  }
72204
+ {
72205
+ const wsNameForPointerCheck = wsNameForFiles || (isGitRepository() ? getCurrentGitBranch() : null);
72206
+ const pointerErrors = [];
72207
+ for (const change of changes) {
72208
+ if (change.name !== "added" && change.name !== "edited") {
72209
+ continue;
72210
+ }
72211
+ const normalizedPath = change.path.replaceAll(SEP9, "/");
72212
+ if (!normalizedPath.endsWith(".resource.yaml") && !normalizedPath.endsWith(".resource.json")) {
72213
+ continue;
72214
+ }
72215
+ if (isFilesetResource(change.path)) {
72216
+ continue;
72217
+ }
72218
+ const content = change.name === "added" ? change.content : change.after;
72219
+ let parsed;
72220
+ try {
72221
+ parsed = parseFromPath(change.path, content);
72222
+ } catch {
72223
+ continue;
72224
+ }
72225
+ if (typeof parsed?.value === "string" && parsed.value.startsWith("!inline_fileset ")) {
72226
+ const serverPath = wsNameForPointerCheck && isWorkspaceSpecificFile(change.path) ? fromWorkspaceSpecificPath(change.path, wsNameForPointerCheck) : change.path;
72227
+ try {
72228
+ validateFilesetPointer(parsed.value.split(" ")[1], removeType(serverPath, "resource"));
72229
+ } catch (e) {
72230
+ pointerErrors.push(e instanceof Error ? e.message : String(e));
72231
+ }
72232
+ }
72233
+ }
72234
+ if (pointerErrors.length > 0) {
72235
+ throw new Error(pointerErrors.join(`
72236
+ `));
72237
+ }
72238
+ }
72037
72239
  if (opts.dryRun && opts.jsonOutput) {
72038
72240
  const result = {
72039
72241
  success: true,
@@ -72218,27 +72420,22 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
72218
72420
  }
72219
72421
  }
72220
72422
  if (change.name === "edited") {
72221
- if (await handleScriptMetadata(change.path, workspace, alreadySynced, opts.message, rawWorkspaceDependencies, codebases, opts, permissionedAsContext)) {
72423
+ if (isFileResource(change.path) || isFilesetResource(change.path)) {
72222
72424
  if (stateTarget) {
72223
- await writeFile7(stateTarget, change.after, "utf-8");
72425
+ await mkdir5(path12.dirname(stateTarget), { recursive: true });
72426
+ info(`Editing ${getTypeStrFromPath(change.path)} ${change.path}`);
72224
72427
  }
72225
- continue;
72226
- } else if (await handleFile(change.path, workspace, alreadySynced, opts.message, opts, rawWorkspaceDependencies, codebases, permissionedAsContext)) {
72227
- if (stateTarget) {
72228
- await writeFile7(stateTarget, change.after, "utf-8");
72428
+ }
72429
+ if (isFilesetResource(change.path)) {
72430
+ const result = await pushFilesetParentResource(change.path, workspace.workspaceId, alreadySynced, cachedWsNameForPush, specificItems);
72431
+ if (result.status === "parent-missing") {
72432
+ throw new Error(`No resource metadata file found for fileset resource: ${change.path}`);
72229
72433
  }
72230
- continue;
72231
- } else if (isScriptModulePath(change.path)) {
72232
- await pushParentScriptForModule(change.path, workspace, alreadySynced, opts.message, opts, rawWorkspaceDependencies, codebases);
72233
72434
  if (stateTarget) {
72234
72435
  await writeFile7(stateTarget, change.after, "utf-8");
72235
72436
  }
72236
72437
  continue;
72237
72438
  }
72238
- if (stateTarget) {
72239
- await mkdir5(path12.dirname(stateTarget), { recursive: true });
72240
- info(`Editing ${getTypeStrFromPath(change.path)} ${change.path}`);
72241
- }
72242
72439
  if (isFileResource(change.path)) {
72243
72440
  const resourceFilePath = await findResourceFile(change.path);
72244
72441
  if (!alreadySynced.includes(resourceFilePath)) {
@@ -72253,24 +72450,33 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
72253
72450
  } else if (specificItems && isSpecificItem(change.path, specificItems)) {
72254
72451
  isFileResWsSpecific = true;
72255
72452
  }
72256
- await pushResource(workspace.workspaceId, serverPath, undefined, newObj2, resourceFilePath, isFileResWsSpecific ? true : undefined);
72257
- if (stateTarget) {
72258
- await writeFile7(stateTarget, change.after, "utf-8");
72259
- }
72260
- continue;
72453
+ await pushResource(workspace.workspaceId, serverPath, undefined, newObj2, resourceFilePath, isFileResWsSpecific ? true : undefined, true);
72454
+ }
72455
+ if (stateTarget) {
72456
+ await writeFile7(stateTarget, change.after, "utf-8");
72261
72457
  }
72458
+ continue;
72262
72459
  }
72263
- if (isFilesetResource(change.path)) {
72264
- const result = await pushFilesetParentResource(change.path, workspace.workspaceId, alreadySynced, cachedWsNameForPush, specificItems);
72265
- if (result.status === "parent-missing") {
72266
- throw new Error(`No resource metadata file found for fileset resource: ${change.path}`);
72460
+ if (await handleScriptMetadata(change.path, workspace, alreadySynced, opts.message, rawWorkspaceDependencies, codebases, opts, permissionedAsContext)) {
72461
+ if (stateTarget) {
72462
+ await writeFile7(stateTarget, change.after, "utf-8");
72267
72463
  }
72268
- if (result.status === "pushed") {
72269
- if (stateTarget) {
72270
- await writeFile7(stateTarget, change.after, "utf-8");
72271
- }
72272
- continue;
72464
+ continue;
72465
+ } else if (await handleFile(change.path, workspace, alreadySynced, opts.message, opts, rawWorkspaceDependencies, codebases, permissionedAsContext)) {
72466
+ if (stateTarget) {
72467
+ await writeFile7(stateTarget, change.after, "utf-8");
72273
72468
  }
72469
+ continue;
72470
+ } else if (isScriptModulePath(change.path)) {
72471
+ await pushParentScriptForModule(change.path, workspace, alreadySynced, opts.message, opts, rawWorkspaceDependencies, codebases);
72472
+ if (stateTarget) {
72473
+ await writeFile7(stateTarget, change.after, "utf-8");
72474
+ }
72475
+ continue;
72476
+ }
72477
+ if (stateTarget) {
72478
+ await mkdir5(path12.dirname(stateTarget), { recursive: true });
72479
+ info(`Editing ${getTypeStrFromPath(change.path)} ${change.path}`);
72274
72480
  }
72275
72481
  const oldObj = parseFromPath(change.path, change.before);
72276
72482
  const newObj = parseFromPath(change.path, change.after);
@@ -72387,7 +72593,7 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
72387
72593
  });
72388
72594
  break;
72389
72595
  case "resource": {
72390
- const resourcePath = removeSuffix(target, ".resource.json");
72596
+ const resourcePath = removeResourceSuffix(target);
72391
72597
  try {
72392
72598
  await deleteResource({
72393
72599
  workspace: workspaceId,
@@ -80580,7 +80786,7 @@ async function pushObj(workspace, p, befObj, newObj, plainSecrets, alreadySynced
80580
80786
  } else if (typeEnding === "resource") {
80581
80787
  if (!alreadySynced3.includes(p)) {
80582
80788
  alreadySynced3.push(p);
80583
- await pushResource(workspace, p, befObj, newObj, originalLocalPath || p, wsSpecific);
80789
+ await pushResource(workspace, p, befObj, newObj, originalLocalPath || p, wsSpecific, true);
80584
80790
  }
80585
80791
  } else if (typeEnding === "resource-type") {
80586
80792
  await pushResourceType(workspace, p, befObj, newObj);
@@ -83505,6 +83711,14 @@ async getResult(jobId: string): Promise<any>
83505
83711
  */
83506
83712
  async getResultMaybe(jobId: string): Promise<any>
83507
83713
 
83714
+ /**
83715
+ * Cancel a queued or running job by ID.
83716
+ * @param jobId - UUID of the job to cancel
83717
+ * @param reason - Optional reason for cancellation
83718
+ * @returns Response message from the cancel endpoint
83719
+ */
83720
+ async cancelJob(jobId: string, reason: string | undefined = undefined): Promise<string>
83721
+
83508
83722
  /**
83509
83723
  * Run a script asynchronously by its path
83510
83724
  * @param path - Script path in Windmill
@@ -84269,6 +84483,14 @@ async getResult(jobId: string): Promise<any>
84269
84483
  */
84270
84484
  async getResultMaybe(jobId: string): Promise<any>
84271
84485
 
84486
+ /**
84487
+ * Cancel a queued or running job by ID.
84488
+ * @param jobId - UUID of the job to cancel
84489
+ * @param reason - Optional reason for cancellation
84490
+ * @returns Response message from the cancel endpoint
84491
+ */
84492
+ async cancelJob(jobId: string, reason: string | undefined = undefined): Promise<string>
84493
+
84272
84494
  /**
84273
84495
  * Run a script asynchronously by its path
84274
84496
  * @param path - Script path in Windmill
@@ -85127,6 +85349,14 @@ async getResult(jobId: string): Promise<any>
85127
85349
  */
85128
85350
  async getResultMaybe(jobId: string): Promise<any>
85129
85351
 
85352
+ /**
85353
+ * Cancel a queued or running job by ID.
85354
+ * @param jobId - UUID of the job to cancel
85355
+ * @param reason - Optional reason for cancellation
85356
+ * @returns Response message from the cancel endpoint
85357
+ */
85358
+ async cancelJob(jobId: string, reason: string | undefined = undefined): Promise<string>
85359
+
85130
85360
  /**
85131
85361
  * Run a script asynchronously by its path
85132
85362
  * @param path - Script path in Windmill
@@ -91120,18 +91350,62 @@ properties:
91120
91350
  filters:
91121
91351
  type: array
91122
91352
  items:
91123
- type: object
91124
- properties:
91125
- key:
91126
- type: string
91127
- value: {}
91353
+ oneOf:
91354
+ - type: object
91355
+ properties:
91356
+ key:
91357
+ type: string
91358
+ value: {}
91359
+ required:
91360
+ - key
91361
+ - value
91362
+ - type: object
91363
+ properties:
91364
+ path:
91365
+ type: string
91366
+ description: Dotted path into nested objects, e.g. \`a.b.c\`. Does not traverse
91367
+ arrays.
91368
+ value: {}
91369
+ required:
91370
+ - path
91371
+ - value
91372
+ - type: object
91373
+ properties:
91374
+ any_of:
91375
+ type: array
91376
+ items:
91377
+ type: object
91378
+ required:
91379
+ - any_of
91380
+ - type: object
91381
+ properties:
91382
+ all_of:
91383
+ type: array
91384
+ items:
91385
+ type: object
91386
+ required:
91387
+ - all_of
91388
+ - type: object
91389
+ properties:
91390
+ none_of:
91391
+ type: array
91392
+ items:
91393
+ type: object
91394
+ required:
91395
+ - none_of
91396
+ description: 'Filters to match incoming messages (only matching messages trigger
91397
+ the script). Each entry is either a leaf \`{key, value}\` (top-level field) or
91398
+ \`{path, value}\` (dotted path into nested objects), or a group \`{any_of: [...]}\`
91399
+ / \`{all_of: [...]}\` / \`{none_of: [...]}\` nesting more entries. Entries at the
91400
+ top level are combined with \`filter_logic\`.'
91128
91401
  filter_logic:
91129
91402
  type: string
91130
91403
  enum:
91131
91404
  - and
91132
91405
  - or
91133
- description: Logic to apply when evaluating filters. 'and' requires all filters
91134
- to match, 'or' requires any filter to match.
91406
+ description: Logic to apply when evaluating the top-level filters. 'and' requires
91407
+ all of them to match, 'or' requires any of them to match. Nested \`any_of\`/\`all_of\`/\`none_of\`
91408
+ groups carry their own logic.
91135
91409
  auto_offset_reset:
91136
91410
  type: string
91137
91411
  enum:
@@ -91232,6 +91506,18 @@ properties:
91232
91506
  type: array
91233
91507
  items:
91234
91508
  type: object
91509
+ properties:
91510
+ qos:
91511
+ type: string
91512
+ enum:
91513
+ - qos0
91514
+ - qos1
91515
+ - qos2
91516
+ topic:
91517
+ type: string
91518
+ required:
91519
+ - qos
91520
+ - topic
91235
91521
  description: Array of MQTT topics to subscribe to, each with topic name and QoS
91236
91522
  level
91237
91523
  v3_config:
@@ -91776,24 +92062,91 @@ properties:
91776
92062
  filters:
91777
92063
  type: array
91778
92064
  items:
91779
- type: object
91780
- properties:
91781
- key:
91782
- type: string
91783
- value: {}
91784
- description: Array of key-value filters to match incoming messages (only matching
91785
- messages trigger the script)
92065
+ oneOf:
92066
+ - type: object
92067
+ properties:
92068
+ key:
92069
+ type: string
92070
+ value: {}
92071
+ required:
92072
+ - key
92073
+ - value
92074
+ - type: object
92075
+ properties:
92076
+ path:
92077
+ type: string
92078
+ description: Dotted path into nested objects, e.g. \`a.b.c\`. Does not traverse
92079
+ arrays.
92080
+ value: {}
92081
+ required:
92082
+ - path
92083
+ - value
92084
+ - type: object
92085
+ properties:
92086
+ any_of:
92087
+ type: array
92088
+ items:
92089
+ type: object
92090
+ required:
92091
+ - any_of
92092
+ - type: object
92093
+ properties:
92094
+ all_of:
92095
+ type: array
92096
+ items:
92097
+ type: object
92098
+ required:
92099
+ - all_of
92100
+ - type: object
92101
+ properties:
92102
+ none_of:
92103
+ type: array
92104
+ items:
92105
+ type: object
92106
+ required:
92107
+ - none_of
92108
+ description: 'Filters to match incoming messages (only matching messages trigger
92109
+ the script). Each entry is either a leaf \`{key, value}\` (top-level field) or
92110
+ \`{path, value}\` (dotted path into nested objects), or a group \`{any_of: [...]}\`
92111
+ / \`{all_of: [...]}\` / \`{none_of: [...]}\` nesting more entries. Entries at the
92112
+ top level are combined with \`filter_logic\`.'
91786
92113
  filter_logic:
91787
92114
  type: string
91788
92115
  enum:
91789
92116
  - and
91790
92117
  - or
91791
- description: Logic to apply when evaluating filters. 'and' requires all filters
91792
- to match, 'or' requires any filter to match.
92118
+ description: Logic to apply when evaluating the top-level filters. 'and' requires
92119
+ all of them to match, 'or' requires any of them to match. Nested \`any_of\`/\`all_of\`/\`none_of\`
92120
+ groups carry their own logic.
91793
92121
  initial_messages:
91794
92122
  type: array
91795
92123
  items:
91796
- type: object
92124
+ oneOf:
92125
+ - type: object
92126
+ properties:
92127
+ raw_message:
92128
+ type: string
92129
+ required:
92130
+ - raw_message
92131
+ - type: object
92132
+ properties:
92133
+ runnable_result:
92134
+ type: object
92135
+ properties:
92136
+ path:
92137
+ type: string
92138
+ args:
92139
+ type: object
92140
+ description: The arguments to pass to the script or flow
92141
+ additionalProperties: true
92142
+ is_flow:
92143
+ type: boolean
92144
+ required:
92145
+ - path
92146
+ - args
92147
+ - is_flow
92148
+ required:
92149
+ - runnable_result
91797
92150
  description: Messages to send immediately after connecting (can be raw strings
91798
92151
  or computed by runnables)
91799
92152
  url_runnable_args:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-cli",
3
- "version": "1.784.0",
3
+ "version": "1.785.0",
4
4
  "description": "CLI for Windmill",
5
5
  "license": "Apache 2.0",
6
6
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "windmill-parser-wasm-java": "1.510.1",
24
24
  "windmill-parser-wasm-nu": "1.510.1",
25
25
  "windmill-parser-wasm-php": "1.647.1",
26
- "windmill-parser-wasm-py": "1.693.1",
26
+ "windmill-parser-wasm-py": "1.782.0",
27
27
  "windmill-parser-wasm-py-imports": "1.693.1",
28
28
  "windmill-parser-wasm-r": "1.668.1",
29
29
  "windmill-parser-wasm-regex": "1.764.0",