windmill-cli 1.794.1 → 1.795.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 +31 -21
  2. package/package.json +1 -1
package/esm/main.js CHANGED
@@ -16769,7 +16769,7 @@ var init_OpenAPI = __esm(() => {
16769
16769
  PASSWORD: undefined,
16770
16770
  TOKEN: getEnv3("WM_TOKEN"),
16771
16771
  USERNAME: undefined,
16772
- VERSION: "1.794.1",
16772
+ VERSION: "1.795.0",
16773
16773
  WITH_CREDENTIALS: true,
16774
16774
  interceptors: {
16775
16775
  request: new Interceptors,
@@ -27547,7 +27547,7 @@ var init_auth = __esm(async () => {
27547
27547
  });
27548
27548
 
27549
27549
  // src/core/constants.ts
27550
- var WM_FORK_PREFIX = "wm-fork", VERSION = "1.794.1";
27550
+ var WM_FORK_PREFIX = "wm-fork", VERSION = "1.795.0";
27551
27551
 
27552
27552
  // src/utils/git.ts
27553
27553
  var exports_git = {};
@@ -65611,7 +65611,7 @@ var init_openflow = __esm(() => {
65611
65611
  openflow_default = {
65612
65612
  openapi: "3.0.3",
65613
65613
  info: {
65614
- version: "1.794.1",
65614
+ version: "1.795.0",
65615
65615
  title: "OpenFlow Spec",
65616
65616
  contact: {
65617
65617
  name: "Ruben Fiszel",
@@ -73852,6 +73852,7 @@ __export(exports_sync, {
73852
73852
  pull: () => pull,
73853
73853
  push: () => push4,
73854
73854
  pushParentScriptForModule: () => pushParentScriptForModule,
73855
+ rawAppPathWithinFolder: () => rawAppPathWithinFolder,
73855
73856
  readDirRecursiveWithIgnore: () => readDirRecursiveWithIgnore2,
73856
73857
  resolveWsNameForConfigFromFlags: () => resolveWsNameForConfigFromFlags,
73857
73858
  summarizeCaseRewrites: () => summarizeCaseRewrites,
@@ -74437,6 +74438,14 @@ async function pushFilesetParentResource(childPath, workspaceId, alreadySynced,
74437
74438
  await pushResource(workspaceId, serverPath, undefined, newObj, resourceFilePath, wsSpecific ? true : undefined, true);
74438
74439
  return { status: "pushed", resourceFilePath };
74439
74440
  }
74441
+ function rawAppPathWithinFolder(baseFolder, relPath) {
74442
+ const resolved = path13.join(baseFolder, relPath);
74443
+ const rel = path13.relative(baseFolder, resolved);
74444
+ if (rel === "" || rel === ".." || rel.startsWith(".." + path13.sep) || path13.isAbsolute(rel)) {
74445
+ throw new Error(`raw app path ${JSON.stringify(relPath)} escapes the app folder ${baseFolder}`);
74446
+ }
74447
+ return resolved;
74448
+ }
74440
74449
  function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, resourceTypeToIsFileset, ignoreCodebaseChanges, stripOnBehalfOf) {
74441
74450
  let _moduleScriptPaths = null;
74442
74451
  async function getModuleScriptPaths() {
@@ -74638,9 +74647,10 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, re
74638
74647
  if (filePath.startsWith("/sql_to_apply/") || filePath === "/wmill.d.ts" || filePath === "/AGENTS.md" || filePath === "/DATATABLES.md") {
74639
74648
  continue;
74640
74649
  }
74650
+ const filePathInApp = rawAppPathWithinFolder(finalPath, filePath.replace(/^\//, ""));
74641
74651
  yield {
74642
74652
  isDirectory: false,
74643
- path: path13.join(finalPath, filePath.substring(1)),
74653
+ path: filePathInApp,
74644
74654
  async* getChildren() {},
74645
74655
  async getContentText() {
74646
74656
  if (typeof content !== "string") {
@@ -74693,7 +74703,7 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, re
74693
74703
  }
74694
74704
  yield {
74695
74705
  isDirectory: false,
74696
- path: path13.join(finalPath, APP_BACKEND_FOLDER, `${runnableId}.yaml`),
74706
+ path: rawAppPathWithinFolder(path13.join(finalPath, APP_BACKEND_FOLDER), `${runnableId}.yaml`),
74697
74707
  async* getChildren() {},
74698
74708
  async getContentText() {
74699
74709
  return import_yaml14.stringify(simplifiedRunnable, yamlOptions);
@@ -75213,7 +75223,7 @@ function canonicalizeCaseInsensitiveKeys(localMap, remoteMap) {
75213
75223
  const out = {};
75214
75224
  const rewritten = [];
75215
75225
  for (const [k4, v4] of Object.entries(localMap)) {
75216
- const sep5 = k4.includes("\\") ? "\\" : "/";
75226
+ const sep6 = k4.includes("\\") ? "\\" : "/";
75217
75227
  const segs = k4.split(/[\\/]/);
75218
75228
  const canonSegs = [];
75219
75229
  let node = root;
@@ -75234,7 +75244,7 @@ function canonicalizeCaseInsensitiveKeys(localMap, remoteMap) {
75234
75244
  node = undefined;
75235
75245
  }
75236
75246
  }
75237
- const canonKey = canonSegs.join(sep5);
75247
+ const canonKey = canonSegs.join(sep6);
75238
75248
  if (changed && canonKey !== k4) {
75239
75249
  out[canonKey] = v4;
75240
75250
  rewritten.push({ from: k4, to: canonKey });
@@ -76727,11 +76737,11 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
76727
76737
  }
76728
76738
  const rules = folderRulesCache.get(folderName2);
76729
76739
  const remotePath = change.path.replace(/\.(script|schedule|http_trigger|websocket_trigger|kafka_trigger|nats_trigger|postgres_trigger|mqtt_trigger|amqp_trigger|sqs_trigger|gcp_trigger|azure_trigger|email_trigger)\.(yaml|json)$/, "").replace(/(\.flow|__flow)\/flow\.(yaml|json)$/, "").replace(/\.(app|raw_app)(\/app\.(yaml|json))?$/, "");
76730
- const relative8 = remotePath.slice(`f/${folderName2}/`.length);
76731
- if (!relative8)
76740
+ const relative9 = remotePath.slice(`f/${folderName2}/`.length);
76741
+ if (!relative9)
76732
76742
  continue;
76733
76743
  for (const rule of rules) {
76734
- if (minimatch(relative8, rule.path_glob)) {
76744
+ if (minimatch(relative9, rule.path_glob)) {
76735
76745
  folderDefaultAnnotations.set(change.path, rule.permissioned_as);
76736
76746
  break;
76737
76747
  }
@@ -77739,12 +77749,12 @@ function filterWorkspaceDependencies(rawWorkspaceDependencies, scriptContent, la
77739
77749
  }
77740
77750
  return filtered;
77741
77751
  }
77742
- async function filterWorkspaceDependenciesForScripts(scripts, rawWorkspaceDependencies, folder, sep5) {
77752
+ async function filterWorkspaceDependenciesForScripts(scripts, rawWorkspaceDependencies, folder, sep6) {
77743
77753
  const filtered = {};
77744
77754
  for (const script of scripts) {
77745
77755
  let content = script.content;
77746
77756
  if (content.startsWith("!inline ")) {
77747
- const filePath = folder + sep5 + content.replace("!inline ", "");
77757
+ const filePath = folder + sep6 + content.replace("!inline ", "");
77748
77758
  try {
77749
77759
  content = await readTextFile(filePath);
77750
77760
  } catch {
@@ -81978,7 +81988,7 @@ var init_new = __esm(async () => {
81978
81988
  });
81979
81989
 
81980
81990
  // src/commands/app/app.ts
81981
- import { sep as SEP14, isAbsolute as isAbsolute5, resolve as pathResolve, relative as pathRelative, basename as basename9 } from "node:path";
81991
+ import { sep as SEP14, isAbsolute as isAbsolute6, resolve as pathResolve, relative as pathRelative, basename as basename9 } from "node:path";
81982
81992
  import { stat as stat10 } from "node:fs/promises";
81983
81993
  function respecializeFields(fields) {
81984
81994
  Object.entries(fields).forEach(([k4, v4]) => {
@@ -82179,7 +82189,7 @@ async function push5(opts, filePath, remotePath) {
82179
82189
  if (!filePath) {
82180
82190
  filePath = originalCwd;
82181
82191
  }
82182
- const absoluteFilePath = isAbsolute5(filePath) ? filePath : pathResolve(originalCwd, filePath);
82192
+ const absoluteFilePath = isAbsolute6(filePath) ? filePath : pathResolve(originalCwd, filePath);
82183
82193
  const normalizedPath = absoluteFilePath.endsWith(SEP14) ? absoluteFilePath.slice(0, -1) : absoluteFilePath;
82184
82194
  const dirName = basename9(normalizedPath);
82185
82195
  const isRawAppByName = dirName.endsWith("__raw_app") || dirName.endsWith(".raw_app");
@@ -82208,7 +82218,7 @@ async function push5(opts, filePath, remotePath) {
82208
82218
  }
82209
82219
  const wmillRoot = process.cwd();
82210
82220
  let inferred = pathRelative(wmillRoot, normalizedPath).replaceAll(SEP14, "/");
82211
- if (inferred.startsWith("..") || isAbsolute5(inferred)) {
82221
+ if (inferred.startsWith("..") || isAbsolute6(inferred)) {
82212
82222
  error(colors.red(`Could not infer remote path: '${filePath}' is outside the wmill.yaml root (${wmillRoot}). Move the folder under the root or pass <remote_path> explicitly.`));
82213
82223
  return;
82214
82224
  }
@@ -82504,24 +82514,24 @@ var init_folder = __esm(async () => {
82504
82514
  error(`Path '${testPath}' is not under folder '${folderName2}' (expected prefix '${prefix}')`);
82505
82515
  return;
82506
82516
  }
82507
- const relative9 = testPath.slice(prefix.length);
82517
+ const relative10 = testPath.slice(prefix.length);
82508
82518
  const { minimatch: minimatch2 } = await Promise.resolve().then(() => (init_esm2(), exports_esm));
82509
82519
  for (let i5 = 0;i5 < rules.length; i5++) {
82510
82520
  const rule = rules[i5];
82511
- if (minimatch2(relative9, rule.path_glob)) {
82521
+ if (minimatch2(relative10, rule.path_glob)) {
82512
82522
  if (opts.json) {
82513
- console.log(JSON.stringify({ matched: true, rule_index: i5, rule, relative_path: relative9 }));
82523
+ console.log(JSON.stringify({ matched: true, rule_index: i5, rule, relative_path: relative10 }));
82514
82524
  } else {
82515
82525
  info(colors.green(`✓ Rule #${i5 + 1} matches: path_glob='${rule.path_glob}' → permissioned_as='${rule.permissioned_as}'`));
82516
- info(colors.gray(` (relative path tested: '${relative9}')`));
82526
+ info(colors.gray(` (relative path tested: '${relative10}')`));
82517
82527
  }
82518
82528
  return;
82519
82529
  }
82520
82530
  }
82521
82531
  if (opts.json) {
82522
- console.log(JSON.stringify({ matched: false, relative_path: relative9 }));
82532
+ console.log(JSON.stringify({ matched: false, relative_path: relative10 }));
82523
82533
  } else {
82524
- info(colors.yellow(`No rule matches path '${testPath}' (relative: '${relative9}')`));
82534
+ info(colors.yellow(`No rule matches path '${testPath}' (relative: '${relative10}')`));
82525
82535
  }
82526
82536
  });
82527
82537
  folder_default = command15;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-cli",
3
- "version": "1.794.1",
3
+ "version": "1.795.0",
4
4
  "description": "CLI for Windmill",
5
5
  "license": "Apache 2.0",
6
6
  "type": "module",