@opengeni/ogtool 0.3.32-canary.1 → 0.3.34-canary.1

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.
@@ -14338,33 +14338,11 @@ class SiteSessionPathError extends Error {
14338
14338
  this.name = "SiteSessionPathError";
14339
14339
  }
14340
14340
  }
14341
- var SITE_SESSION_ROUTES = [
14342
- { methods: ["GET", "POST"], pattern: /^\/sessions$/u },
14343
- { methods: ["GET", "PUT"], pattern: /^\/new-session-draft$/u },
14344
- { methods: ["GET"], pattern: /^\/sessions\/[^/]+$/u },
14345
- { methods: ["GET"], pattern: /^\/sessions\/[^/]+\/events$/u },
14346
- { methods: ["GET"], pattern: /^\/sessions\/[^/]+\/events\/stream$/u },
14347
- { methods: ["POST"], pattern: /^\/sessions\/[^/]+\/events$/u },
14348
- { methods: ["GET"], pattern: /^\/sessions\/[^/]+\/queue$/u },
14349
- {
14350
- methods: ["POST"],
14351
- pattern: /^\/sessions\/[^/]+\/queue\/[^/]+\/(?:move|edit|steer|delete)$/u
14352
- },
14353
- { methods: ["GET", "PUT"], pattern: /^\/sessions\/[^/]+\/composer-draft$/u },
14354
- { methods: ["POST"], pattern: /^\/sessions\/[^/]+\/composer-draft\/submit$/u }
14355
- ];
14356
- function siteSessionRouteAllowed(pathname, method) {
14357
- if (!pathname.startsWith(SITE_WORKSPACE_PREFIX))
14358
- return false;
14359
- const suffix = pathname.slice(SITE_WORKSPACE_PREFIX.length);
14360
- return SITE_SESSION_ROUTES.some((route) => route.methods.includes(method) && route.pattern.test(suffix));
14361
- }
14362
- function siteSessionPath(path, workspaceId, method = "GET", siteId) {
14363
- const verb = method.toUpperCase();
14341
+ function siteSessionPath(path, workspaceId, _method = "GET", siteId) {
14364
14342
  const pathname = path.split("?")[0];
14365
- const session = siteSessionRouteAllowed(pathname, verb);
14366
- const context = verb === "GET" && (path === "/v1/config/client" || /^\/v1\/workspaces\/site-host(?:[?].*|$|\/(?:model-catalog|live-events\/stream|control-events(?:\/stream)?|interaction-events\/stream)(?:[?].*|$))/u.test(path));
14367
- if (!session && !context || /[%\\#]/u.test(pathname) || pathname.split("/").some((p) => p === "." || p === "..")) {
14343
+ const workspace = pathname === SITE_WORKSPACE_PREFIX || pathname.startsWith(`${SITE_WORKSPACE_PREFIX}/`);
14344
+ const context = pathname === "/v1/config/client";
14345
+ if (!workspace && !context || /[%\\#\u0000-\u0020\u007f]/u.test(pathname) || pathname.split("/").some((p) => p === "." || p === "..")) {
14368
14346
  throw new SiteSessionPathError;
14369
14347
  }
14370
14348
  const rewritten = path.replace("/workspaces/site-host", `/workspaces/${encodeURIComponent(workspaceId)}`);
@@ -15321,7 +15299,7 @@ async function abortableDelay(delayMs, signal) {
15321
15299
  // package.json
15322
15300
  var package_default = {
15323
15301
  name: "@opengeni/ogtool",
15324
- version: "0.3.32-canary.1",
15302
+ version: "0.3.34-canary.1",
15325
15303
  description: "Codemode CLI and typed client entrypoint for an OpenGeni execution attempt.",
15326
15304
  license: "Apache-2.0",
15327
15305
  repository: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/ogtool",
3
- "version": "0.3.32-canary.1",
3
+ "version": "0.3.34-canary.1",
4
4
  "description": "Codemode CLI and typed client entrypoint for an OpenGeni execution attempt.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -37,7 +37,7 @@
37
37
  "prepublishOnly": "bash ../../scripts/prepublish-guard"
38
38
  },
39
39
  "dependencies": {
40
- "@opengeni/codemode": "^0.5.0-canary.1"
40
+ "@opengeni/codemode": "^0.5.2-canary.1"
41
41
  },
42
42
  "engines": {
43
43
  "node": ">=18"