@webstudio-is/sdk 0.253.0 → 0.255.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/lib/index.js +5 -6
  2. package/package.json +9 -6
package/lib/index.js CHANGED
@@ -117,11 +117,10 @@ var DefaultPagePage = z2.string().refine((path) => path !== "", "Can't be empty"
117
117
  var OldPagePath = z2.string().refine((path) => path !== "", "Can't be empty").refine((path) => path !== "/", "Can't be just a /").refine(
118
118
  (path) => path === "" || path.startsWith("/"),
119
119
  "Must start with a / or a full URL e.g. https://website.org"
120
- ).refine((path) => path.endsWith("/") === false, "Can't end with a /").refine((path) => path.includes("//") === false, "Can't contain repeating /").refine(
121
- (path) => /^[-_a-zA-Z0-9*:?\\/.]*$/.test(path),
122
- // Allow uppercase letters (A-Z)
123
- "Only a-z, A-Z, 0-9, -, _, /, :, ?, . and * are allowed"
124
- ).refine(
120
+ ).refine((path) => path.endsWith("/") === false, "Can't end with a /").refine((path) => path.includes("//") === false, "Can't contain repeating /").refine((path) => {
121
+ const disallowedChars = /[\s<>"{}|\\^`[\]\u0000-\u001f\u007f]/;
122
+ return !disallowedChars.test(path);
123
+ }, "Path contains invalid characters (spaces or URL-unsafe characters are not allowed)").refine(
125
124
  (path) => path !== "/s" && path.startsWith("/s/") === false,
126
125
  "/s prefix is reserved for the system"
127
126
  ).refine(
@@ -143,7 +142,7 @@ var ProjectMeta = z2.object({
143
142
  faviconAssetId: z2.string().optional(),
144
143
  code: z2.string().optional()
145
144
  });
146
- var ProjectNewRedirectPath = z2.string().refine((data) => {
145
+ var ProjectNewRedirectPath = z2.string().min(1, "Path is required").refine((data) => {
147
146
  try {
148
147
  new URL(data, "http://url.com");
149
148
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk",
3
- "version": "0.253.0",
3
+ "version": "0.255.0",
4
4
  "description": "Webstudio project data schema",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -26,6 +26,9 @@
26
26
  "webstudio": "./src/core-templates.tsx",
27
27
  "types": "./lib/types/core-templates.d.ts",
28
28
  "import": "./lib/core-templates.js"
29
+ },
30
+ "./router-paths.test": {
31
+ "webstudio": "./src/router-paths.test.ts"
29
32
  }
30
33
  },
31
34
  "files": [
@@ -42,16 +45,16 @@
42
45
  "type-fest": "^4.37.0",
43
46
  "warn-once": "^0.1.1",
44
47
  "zod": "^3.24.2",
45
- "@webstudio-is/css-engine": "0.253.0",
46
- "@webstudio-is/icons": "0.253.0",
47
- "@webstudio-is/fonts": "0.253.0"
48
+ "@webstudio-is/css-engine": "0.255.0",
49
+ "@webstudio-is/fonts": "0.255.0",
50
+ "@webstudio-is/icons": "0.255.0"
48
51
  },
49
52
  "devDependencies": {
50
53
  "html-tags": "^4.0.0",
51
54
  "vitest": "^3.1.2",
52
55
  "@webstudio-is/css-data": "0.0.0",
53
- "@webstudio-is/template": "0.253.0",
54
- "@webstudio-is/tsconfig": "1.0.7"
56
+ "@webstudio-is/tsconfig": "1.0.7",
57
+ "@webstudio-is/template": "0.255.0"
55
58
  },
56
59
  "scripts": {
57
60
  "typecheck": "tsgo --noEmit -p tsconfig.typecheck.json",