@axiom-lattice/core 2.1.90 → 2.1.92

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/dist/index.mjs CHANGED
@@ -22730,7 +22730,7 @@ var MicrosandboxRemoteProvider = class {
22730
22730
  getResourceResolver() {
22731
22731
  return {
22732
22732
  resolve: async (address) => {
22733
- return this.client.volumeFsDownload(address.volume, `/project/${address.resourcePath}`);
22733
+ return this.client.volumeFsDownload(address.volume, address.resourcePath);
22734
22734
  }
22735
22735
  };
22736
22736
  }
@@ -23999,17 +23999,19 @@ var TokenCache = class {
23999
23999
 
24000
24000
  // src/sandbox_lattice/ShareService.ts
24001
24001
  import { randomBytes } from "crypto";
24002
+ import bcrypt from "bcryptjs";
24002
24003
  var TOKEN_BYTES = 24;
24003
24004
  function generateToken() {
24004
24005
  return randomBytes(TOKEN_BYTES).toString("base64url");
24005
24006
  }
24006
24007
  function createSharePayload(tenantId, workspaceId, projectId, userId, request) {
24008
+ const resourcePath = (request.resourcePath || "").replace(/^\/?project\//, "");
24007
24009
  return {
24008
24010
  address: createResourceAddress({
24009
24011
  tenantId,
24010
24012
  workspaceId,
24011
24013
  projectId,
24012
- resourcePath: request.resourcePath
24014
+ resourcePath
24013
24015
  }),
24014
24016
  tenantId,
24015
24017
  workspaceId,
@@ -24017,7 +24019,7 @@ function createSharePayload(tenantId, workspaceId, projectId, userId, request) {
24017
24019
  assistantId: request.assistantId ?? null,
24018
24020
  vmIsolation: "project",
24019
24021
  visibility: request.visibility ?? "public",
24020
- passwordHash: request.visibility === "password" && request.password ? request.password : null,
24022
+ passwordHash: request.visibility === "password" && request.password ? bcrypt.hashSync(request.password, 10) : null,
24021
24023
  title: request.title ?? null,
24022
24024
  createdBy: userId,
24023
24025
  expiresAt: request.expiresAt ? new Date(request.expiresAt) : null,