meshy-node 0.5.3 → 0.5.4

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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # meshy-node
2
2
 
3
- Version: 0.5.3
3
+ Version: 0.5.4
4
4
 
5
5
  This package contains the built Meshy standalone node runtime only.
6
6
  It intentionally excludes repository source files and TypeScript sources.
package/main.cjs CHANGED
@@ -24269,7 +24269,7 @@ var require_send = __commonJS({
24269
24269
  var join17 = path23.join;
24270
24270
  var normalize = path23.normalize;
24271
24271
  var resolve15 = path23.resolve;
24272
- var sep4 = path23.sep;
24272
+ var sep5 = path23.sep;
24273
24273
  var BYTES_RANGE_REGEXP = /^ *bytes=/;
24274
24274
  var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1e3;
24275
24275
  var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/;
@@ -24477,14 +24477,14 @@ var require_send = __commonJS({
24477
24477
  var parts;
24478
24478
  if (root !== null) {
24479
24479
  if (path24) {
24480
- path24 = normalize("." + sep4 + path24);
24480
+ path24 = normalize("." + sep5 + path24);
24481
24481
  }
24482
24482
  if (UP_PATH_REGEXP.test(path24)) {
24483
24483
  debug('malicious path "%s"', path24);
24484
24484
  this.error(403);
24485
24485
  return res;
24486
24486
  }
24487
- parts = path24.split(sep4);
24487
+ parts = path24.split(sep5);
24488
24488
  path24 = normalize(join17(root, path24));
24489
24489
  } else {
24490
24490
  if (UP_PATH_REGEXP.test(path24)) {
@@ -24492,7 +24492,7 @@ var require_send = __commonJS({
24492
24492
  this.error(403);
24493
24493
  return res;
24494
24494
  }
24495
- parts = normalize(path24).split(sep4);
24495
+ parts = normalize(path24).split(sep5);
24496
24496
  path24 = resolve15(path24);
24497
24497
  }
24498
24498
  if (containsDotFile(parts)) {
@@ -24590,7 +24590,7 @@ var require_send = __commonJS({
24590
24590
  var self2 = this;
24591
24591
  debug('stat "%s"', path24);
24592
24592
  fs24.stat(path24, function onstat(err, stat) {
24593
- if (err && err.code === "ENOENT" && !extname3(path24) && path24[path24.length - 1] !== sep4) {
24593
+ if (err && err.code === "ENOENT" && !extname3(path24) && path24[path24.length - 1] !== sep5) {
24594
24594
  return next(err);
24595
24595
  }
24596
24596
  if (err) return self2.onStatError(err);
@@ -44577,12 +44577,22 @@ function resolveNodeWorkDirTarget(nodeId, rootPath, currentPath, allowAbsolute)
44577
44577
  }
44578
44578
  const useAbsolute = allowAbsolute && isAbsolutePath(currentPath);
44579
44579
  const resolvedPath = useAbsolute ? path16.resolve(currentPath) : currentPath;
44580
+ const targetPath = useAbsolute ? resolvedPath : resolveRelativeNodeWorkDirTarget(rootPath, resolvedPath);
44580
44581
  return {
44581
44582
  rootPath,
44582
44583
  resolvedPath,
44584
+ targetPath,
44583
44585
  useAbsolute
44584
44586
  };
44585
44587
  }
44588
+ function resolveRelativeNodeWorkDirTarget(rootPath, relativePath) {
44589
+ const resolvedRoot = path16.resolve(rootPath);
44590
+ const resolved = path16.resolve(resolvedRoot, relativePath);
44591
+ if (!resolved.startsWith(resolvedRoot + path16.sep) && resolved !== resolvedRoot) {
44592
+ throw new MeshyError("VALIDATION_ERROR", "Invalid directory path", 400);
44593
+ }
44594
+ return resolved;
44595
+ }
44586
44596
  function getLocalNodeWorkDirTree(nodeId, rootPath, currentPath, options) {
44587
44597
  const { rootPath: resolvedRootPath, resolvedPath, useAbsolute } = resolveNodeWorkDirTarget(
44588
44598
  nodeId,
@@ -44616,24 +44626,24 @@ function getLocalNodeWorkDirTree(nodeId, rootPath, currentPath, options) {
44616
44626
  }
44617
44627
  }
44618
44628
  function getLocalNodeWorkDirBranchInfo(nodeId, rootPath, currentPath, options) {
44619
- const { resolvedPath } = resolveNodeWorkDirTarget(
44629
+ const { targetPath } = resolveNodeWorkDirTarget(
44620
44630
  nodeId,
44621
44631
  rootPath,
44622
44632
  currentPath,
44623
44633
  options.allowAbsolute
44624
44634
  );
44625
- const branchInfo = getGitBranchInfo(resolvedPath, {
44635
+ const branchInfo = getGitBranchInfo(targetPath, {
44626
44636
  limit: options.limit,
44627
44637
  offset: options.offset
44628
44638
  });
44629
44639
  return {
44630
44640
  nodeId,
44631
- path: resolvedPath,
44641
+ path: targetPath,
44632
44642
  ...branchInfo
44633
44643
  };
44634
44644
  }
44635
44645
  function createLocalNodeWorkDirBranch(nodeId, rootPath, currentPath, options) {
44636
- const { resolvedPath } = resolveNodeWorkDirTarget(
44646
+ const { targetPath } = resolveNodeWorkDirTarget(
44637
44647
  nodeId,
44638
44648
  rootPath,
44639
44649
  currentPath,
@@ -44641,14 +44651,14 @@ function createLocalNodeWorkDirBranch(nodeId, rootPath, currentPath, options) {
44641
44651
  );
44642
44652
  try {
44643
44653
  const result = createGitBranch(
44644
- resolvedPath,
44654
+ targetPath,
44645
44655
  options.branchName,
44646
44656
  options.startPoint,
44647
44657
  { limit: options.limit, offset: options.offset }
44648
44658
  );
44649
44659
  return {
44650
44660
  nodeId,
44651
- path: resolvedPath,
44661
+ path: targetPath,
44652
44662
  ...result
44653
44663
  };
44654
44664
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meshy-node",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "private": false,
5
5
  "description": "Standalone Meshy node package with bundled runtime and dashboard assets.",
6
6
  "type": "commonjs",
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "packageName": "meshy-node",
3
- "packageVersion": "0.5.3",
3
+ "packageVersion": "0.5.4",
4
4
  "packages": {
5
5
  "workspace": {
6
6
  "name": "meshy",
7
- "version": "0.5.3"
7
+ "version": "0.5.4"
8
8
  },
9
9
  "node": {
10
10
  "name": "meshy-node",
11
- "version": "0.5.3"
11
+ "version": "0.5.4"
12
12
  },
13
13
  "core": {
14
14
  "name": "@meshy/core",