@valbuild/server 0.146.2 → 0.146.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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @valbuild/server
2
2
 
3
+ ## 0.146.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#877](https://github.com/valbuild/val/pull/877) [`c31f609`](https://github.com/valbuild/val/commit/c31f609fdeed79aa0e139fa4f652ba0684e96ea3) Thanks [@freekh](https://github.com/freekh)! - The Studio has an unlinked page, `/val/adept`, for trying out dependency
8
+ upgrades on a hosted project: it computes a lockfile for the live site's
9
+ `package.json`, previews each kind of upgrade from it, and fetches the type
10
+ declarations and TypeScript compiler a typecheck would load. It only shows
11
+ results; nothing on it is staged or published. Nothing links to it yet.
12
+
13
+ For it, the server now forwards Val Build's `/adept/*` routes for a signed-in
14
+ Studio session: lockfiles, upgrades, their jobs, type bundles and the
15
+ compiler. Like everything else the Studio asks Val Build for, they go with the
16
+ project's own credential, and they are open at a proposal's address too,
17
+ since they publish nothing.
18
+
19
+ - Updated dependencies [[`81f2e80`](https://github.com/valbuild/val/commit/81f2e803c4cefdf58bbe6856c06e98ace95a8e0b), [`59ff6c3`](https://github.com/valbuild/val/commit/59ff6c367bc313b2bb7718b00c1641aaccab949d), [`c31f609`](https://github.com/valbuild/val/commit/c31f609fdeed79aa0e139fa4f652ba0684e96ea3)]:
20
+ - @valbuild/shared@0.146.4
21
+ - @valbuild/ui@0.146.4
22
+
3
23
  ## 0.146.2
4
24
 
5
25
  ### Patch Changes
@@ -240,6 +240,16 @@ export declare class ValOpsHttp extends ValOps {
240
240
  * every artifact, and the upload is the slow one.
241
241
  */
242
242
  private currentPublishToken;
243
+ /**
244
+ * adept, through content: lockfiles, upgrades and type bundles, for the
245
+ * Studio's unlinked `/val/adept` page. A job is content's to scope to
246
+ * this project; a name and a version are matched, not passed, so nothing
247
+ * with a `..` reaches another of content's routes.
248
+ *
249
+ * Allowed at a proposal's address too: adept computes and publishes
250
+ * nothing, so there is nothing a proposal's Studio could move on the site.
251
+ */
252
+ private static adeptPathAllowed;
243
253
  /**
244
254
  * The content paths this may reach, and nothing else.
245
255
  *
@@ -10916,6 +10916,19 @@ class ValOpsHttp extends ValOps {
10916
10916
  };
10917
10917
  }
10918
10918
 
10919
+ /**
10920
+ * adept, through content: lockfiles, upgrades and type bundles, for the
10921
+ * Studio's unlinked `/val/adept` page. A job is content's to scope to
10922
+ * this project; a name and a version are matched, not passed, so nothing
10923
+ * with a `..` reaches another of content's routes.
10924
+ *
10925
+ * Allowed at a proposal's address too: adept computes and publishes
10926
+ * nothing, so there is nothing a proposal's Studio could move on the site.
10927
+ */
10928
+ static adeptPathAllowed(path) {
10929
+ return /^\/adept\/(lockfile|upgrade|jobs\/\d{1,18}(\/result)?|compiler\/[0-9A-Za-z][0-9A-Za-z.+-]{0,63})$/.test(path) || /^\/adept\/types\/public\/(@[a-z0-9~-][a-z0-9._~-]{0,213}\/)?[a-z0-9~-][a-z0-9._~-]{0,213}@[0-9a-z][0-9a-z.+-]{0,63}$/i.test(path);
10930
+ }
10931
+
10919
10932
  /**
10920
10933
  * The content paths this may reach, and nothing else.
10921
10934
  *
@@ -10958,6 +10971,7 @@ class ValOpsHttp extends ValOps {
10958
10971
  if (/^\/publish-requests(\/[A-Za-z0-9_-]{1,100})?$/.test(path)) {
10959
10972
  return true;
10960
10973
  }
10974
+ if (ValOpsHttp.adeptPathAllowed(path)) return true;
10961
10975
  if (/^\/publish-jobs\/(next|[A-Za-z0-9_-]{1,100}\/(steps|renew|cancel|discard))$/.test(path)) {
10962
10976
  return true;
10963
10977
  }
@@ -11039,6 +11053,7 @@ class ValOpsHttp extends ValOps {
11039
11053
  return true;
11040
11054
  }
11041
11055
  if (/^\/publish\/[A-Za-z0-9_-]+\/artifacts$/.test(path)) return true;
11056
+ if (ValOpsHttp.adeptPathAllowed(path)) return true;
11042
11057
  // Where its press is -- read only: a POST there is the site's Try again.
11043
11058
  if (method === "GET" && path !== "/publish-requests/try-again" && /^\/publish-requests\/[A-Za-z0-9_-]{1,100}$/.test(path)) return true;
11044
11059
  return /^\/publish-jobs\/[A-Za-z0-9_-]{1,100}\/(merge-prepare|steps|renew|cancel)$/.test(path);
@@ -10916,6 +10916,19 @@ class ValOpsHttp extends ValOps {
10916
10916
  };
10917
10917
  }
10918
10918
 
10919
+ /**
10920
+ * adept, through content: lockfiles, upgrades and type bundles, for the
10921
+ * Studio's unlinked `/val/adept` page. A job is content's to scope to
10922
+ * this project; a name and a version are matched, not passed, so nothing
10923
+ * with a `..` reaches another of content's routes.
10924
+ *
10925
+ * Allowed at a proposal's address too: adept computes and publishes
10926
+ * nothing, so there is nothing a proposal's Studio could move on the site.
10927
+ */
10928
+ static adeptPathAllowed(path) {
10929
+ return /^\/adept\/(lockfile|upgrade|jobs\/\d{1,18}(\/result)?|compiler\/[0-9A-Za-z][0-9A-Za-z.+-]{0,63})$/.test(path) || /^\/adept\/types\/public\/(@[a-z0-9~-][a-z0-9._~-]{0,213}\/)?[a-z0-9~-][a-z0-9._~-]{0,213}@[0-9a-z][0-9a-z.+-]{0,63}$/i.test(path);
10930
+ }
10931
+
10919
10932
  /**
10920
10933
  * The content paths this may reach, and nothing else.
10921
10934
  *
@@ -10958,6 +10971,7 @@ class ValOpsHttp extends ValOps {
10958
10971
  if (/^\/publish-requests(\/[A-Za-z0-9_-]{1,100})?$/.test(path)) {
10959
10972
  return true;
10960
10973
  }
10974
+ if (ValOpsHttp.adeptPathAllowed(path)) return true;
10961
10975
  if (/^\/publish-jobs\/(next|[A-Za-z0-9_-]{1,100}\/(steps|renew|cancel|discard))$/.test(path)) {
10962
10976
  return true;
10963
10977
  }
@@ -11039,6 +11053,7 @@ class ValOpsHttp extends ValOps {
11039
11053
  return true;
11040
11054
  }
11041
11055
  if (/^\/publish\/[A-Za-z0-9_-]+\/artifacts$/.test(path)) return true;
11056
+ if (ValOpsHttp.adeptPathAllowed(path)) return true;
11042
11057
  // Where its press is -- read only: a POST there is the site's Try again.
11043
11058
  if (method === "GET" && path !== "/publish-requests/try-again" && /^\/publish-requests\/[A-Za-z0-9_-]{1,100}$/.test(path)) return true;
11044
11059
  return /^\/publish-jobs\/[A-Za-z0-9_-]{1,100}\/(merge-prepare|steps|renew|cancel)$/.test(path);
@@ -10879,6 +10879,19 @@ class ValOpsHttp extends ValOps {
10879
10879
  };
10880
10880
  }
10881
10881
 
10882
+ /**
10883
+ * adept, through content: lockfiles, upgrades and type bundles, for the
10884
+ * Studio's unlinked `/val/adept` page. A job is content's to scope to
10885
+ * this project; a name and a version are matched, not passed, so nothing
10886
+ * with a `..` reaches another of content's routes.
10887
+ *
10888
+ * Allowed at a proposal's address too: adept computes and publishes
10889
+ * nothing, so there is nothing a proposal's Studio could move on the site.
10890
+ */
10891
+ static adeptPathAllowed(path) {
10892
+ return /^\/adept\/(lockfile|upgrade|jobs\/\d{1,18}(\/result)?|compiler\/[0-9A-Za-z][0-9A-Za-z.+-]{0,63})$/.test(path) || /^\/adept\/types\/public\/(@[a-z0-9~-][a-z0-9._~-]{0,213}\/)?[a-z0-9~-][a-z0-9._~-]{0,213}@[0-9a-z][0-9a-z.+-]{0,63}$/i.test(path);
10893
+ }
10894
+
10882
10895
  /**
10883
10896
  * The content paths this may reach, and nothing else.
10884
10897
  *
@@ -10921,6 +10934,7 @@ class ValOpsHttp extends ValOps {
10921
10934
  if (/^\/publish-requests(\/[A-Za-z0-9_-]{1,100})?$/.test(path)) {
10922
10935
  return true;
10923
10936
  }
10937
+ if (ValOpsHttp.adeptPathAllowed(path)) return true;
10924
10938
  if (/^\/publish-jobs\/(next|[A-Za-z0-9_-]{1,100}\/(steps|renew|cancel|discard))$/.test(path)) {
10925
10939
  return true;
10926
10940
  }
@@ -11002,6 +11016,7 @@ class ValOpsHttp extends ValOps {
11002
11016
  return true;
11003
11017
  }
11004
11018
  if (/^\/publish\/[A-Za-z0-9_-]+\/artifacts$/.test(path)) return true;
11019
+ if (ValOpsHttp.adeptPathAllowed(path)) return true;
11005
11020
  // Where its press is -- read only: a POST there is the site's Try again.
11006
11021
  if (method === "GET" && path !== "/publish-requests/try-again" && /^\/publish-requests\/[A-Za-z0-9_-]{1,100}$/.test(path)) return true;
11007
11022
  return /^\/publish-jobs\/[A-Za-z0-9_-]{1,100}\/(merge-prepare|steps|renew|cancel)$/.test(path);
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "./package.json": "./package.json"
17
17
  },
18
18
  "types": "dist/valbuild-server.cjs.d.ts",
19
- "version": "0.146.2",
19
+ "version": "0.146.4",
20
20
  "devDependencies": {
21
21
  "@prettier/sync": "^0.6.1",
22
22
  "@types/jest": "^30.0.0",
@@ -30,9 +30,9 @@
30
30
  "typescript": "^6.0.3",
31
31
  "zod": "^4.4.3",
32
32
  "zod-validation-error": "^5.0.0",
33
- "@valbuild/shared": "0.146.2",
34
- "@valbuild/ui": "0.146.2",
35
- "@valbuild/core": "0.146.2"
33
+ "@valbuild/core": "0.146.2",
34
+ "@valbuild/ui": "0.146.4",
35
+ "@valbuild/shared": "0.146.4"
36
36
  },
37
37
  "engines": {
38
38
  "node": "^20.19.0 || >=22"