@valbuild/shared 0.141.0 → 0.143.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @valbuild/shared
2
2
 
3
+ ## 0.143.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`f7c25bd`](https://github.com/valbuild/val/commit/f7c25bd4b44c288db8e5ab914e6d8a72c0216ba5), [`729c4ed`](https://github.com/valbuild/val/commit/729c4edfa28f5a2942c435ccf225e65858b080cc)]:
8
+ - @valbuild/core@0.143.0
9
+
10
+ ## 0.142.0
11
+
12
+ ### Patch Changes
13
+
14
+ - [#805](https://github.com/valbuild/val/pull/805) [`3d2b9e8`](https://github.com/valbuild/val/commit/3d2b9e8c11aa6a4449527e2a1bbb363566797a14) Thanks [@freekh](https://github.com/freekh)! - Proposals in the Studio, for projects on the Val platform that have them turned on: a switcher in the top bar to move between the site and its proposals, New proposal, Rename, Close and All proposals (with Reopen), and — inside a proposal — Save where Publish is, in the proposal's colour. Nothing is shown for a project without proposals. At a proposal's address the server now refuses to publish to the site, so a Save there can never start a site build.
15
+
3
16
  ## 0.141.0
4
17
 
5
18
  ### Minor Changes
@@ -436,6 +436,10 @@ export declare const Api: {
436
436
  code: z.ZodLiteral<"no-base">;
437
437
  message: z.ZodString;
438
438
  }, z.core.$strip>>;
439
+ proposal: z.ZodOptional<z.ZodObject<{
440
+ name: z.ZodString;
441
+ branch: z.ZodString;
442
+ }, z.core.$strip>>;
439
443
  }, z.core.$strip>, z.ZodObject<{
440
444
  type: z.ZodLiteral<"use-websocket">;
441
445
  url: z.ZodString;
@@ -491,6 +495,10 @@ export declare const Api: {
491
495
  code: z.ZodLiteral<"no-base">;
492
496
  message: z.ZodString;
493
497
  }, z.core.$strip>>;
498
+ proposal: z.ZodOptional<z.ZodObject<{
499
+ name: z.ZodString;
500
+ branch: z.ZodString;
501
+ }, z.core.$strip>>;
494
502
  }, z.core.$strip>]>;
495
503
  }, z.core.$strip>]>;
496
504
  };
@@ -552,6 +560,60 @@ export declare const Api: {
552
560
  }, z.core.$strip>;
553
561
  };
554
562
  };
563
+ /**
564
+ * The content service's proposals API, reached through this deployment:
565
+ * list, open, read, rename, close, reopen and retry a setup
566
+ * (valbuild/home `docs/proposals.md`, Flow B).
567
+ *
568
+ * The same arrangement as `/publish-api`, for the same reasons: the browser
569
+ * holds a session for this origin and no credential content accepts, so
570
+ * this server checks the session, sends the project's key with the person's
571
+ * profile id beside it -- a proposal is opened, renamed and closed by
572
+ * somebody -- and carries content's status and body back unread. The sub-path
573
+ * is content's, after `/proposals`; `ValOpsHttp.proposalsApi` holds the
574
+ * allow list. A save is not here: it is `/save`, which a proposal's server
575
+ * sends to the proposal's own route.
576
+ */
577
+ "/proposals-api": {
578
+ GET: {
579
+ req: {
580
+ path: z.ZodOptional<z.ZodString>;
581
+ cookies: {
582
+ val_session: z.ZodOptional<z.ZodString>;
583
+ };
584
+ };
585
+ res: z.ZodObject<{
586
+ status: z.ZodNumber;
587
+ json: z.ZodUnknown;
588
+ }, z.core.$strip>;
589
+ };
590
+ POST: {
591
+ req: {
592
+ path: z.ZodOptional<z.ZodString>;
593
+ body: z.ZodOptional<z.ZodUnknown>;
594
+ cookies: {
595
+ val_session: z.ZodOptional<z.ZodString>;
596
+ };
597
+ };
598
+ res: z.ZodObject<{
599
+ status: z.ZodNumber;
600
+ json: z.ZodUnknown;
601
+ }, z.core.$strip>;
602
+ };
603
+ PATCH: {
604
+ req: {
605
+ path: z.ZodOptional<z.ZodString>;
606
+ body: z.ZodOptional<z.ZodUnknown>;
607
+ cookies: {
608
+ val_session: z.ZodOptional<z.ZodString>;
609
+ };
610
+ };
611
+ res: z.ZodObject<{
612
+ status: z.ZodNumber;
613
+ json: z.ZodUnknown;
614
+ }, z.core.$strip>;
615
+ };
616
+ };
555
617
  "/upload/patches": {
556
618
  POST: {
557
619
  req: {
@@ -819,14 +881,14 @@ export declare const Api: {
819
881
  patch: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
820
882
  op: z.ZodLiteral<"add">;
821
883
  path: z.ZodArray<z.ZodString>;
822
- value: z.ZodType<import("@valbuild/core/patch").JSONValue, unknown, z.core.$ZodTypeInternals<import("@valbuild/core/patch").JSONValue, unknown>>;
884
+ value: z.ZodType<JSONValueT, unknown, z.core.$ZodTypeInternals<JSONValueT, unknown>>;
823
885
  }, z.core.$strict>, z.ZodObject<{
824
886
  op: z.ZodLiteral<"remove">;
825
887
  path: z.ZodTuple<[z.ZodString], z.ZodString>;
826
888
  }, z.core.$strict>, z.ZodObject<{
827
889
  op: z.ZodLiteral<"replace">;
828
890
  path: z.ZodArray<z.ZodString>;
829
- value: z.ZodType<import("@valbuild/core/patch").JSONValue, unknown, z.core.$ZodTypeInternals<import("@valbuild/core/patch").JSONValue, unknown>>;
891
+ value: z.ZodType<JSONValueT, unknown, z.core.$ZodTypeInternals<JSONValueT, unknown>>;
830
892
  }, z.core.$strict>, z.ZodObject<{
831
893
  op: z.ZodLiteral<"move">;
832
894
  from: z.ZodTuple<[z.ZodString], z.ZodString>;
@@ -838,15 +900,15 @@ export declare const Api: {
838
900
  }, z.core.$strict>, z.ZodObject<{
839
901
  op: z.ZodLiteral<"test">;
840
902
  path: z.ZodArray<z.ZodString>;
841
- value: z.ZodType<import("@valbuild/core/patch").JSONValue, unknown, z.core.$ZodTypeInternals<import("@valbuild/core/patch").JSONValue, unknown>>;
903
+ value: z.ZodType<JSONValueT, unknown, z.core.$ZodTypeInternals<JSONValueT, unknown>>;
842
904
  }, z.core.$strict>, z.ZodObject<{
843
905
  op: z.ZodLiteral<"file">;
844
906
  path: z.ZodArray<z.ZodString>;
845
907
  filePath: z.ZodString;
846
- value: z.ZodType<import("@valbuild/core/patch").JSONValue, unknown, z.core.$ZodTypeInternals<import("@valbuild/core/patch").JSONValue, unknown>>;
908
+ value: z.ZodType<JSONValueT, unknown, z.core.$ZodTypeInternals<JSONValueT, unknown>>;
847
909
  remote: z.ZodBoolean;
848
910
  nestedFilePath: z.ZodOptional<z.ZodArray<z.ZodString>>;
849
- metadata: z.ZodOptional<z.ZodType<import("@valbuild/core/patch").JSONValue, unknown, z.core.$ZodTypeInternals<import("@valbuild/core/patch").JSONValue, unknown>>>;
911
+ metadata: z.ZodOptional<z.ZodType<JSONValueT, unknown, z.core.$ZodTypeInternals<JSONValueT, unknown>>>;
850
912
  }, z.core.$strict>], "op">>>;
851
913
  patchId: z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>;
852
914
  createdAt: z.ZodString;
@@ -989,7 +1051,7 @@ export declare const Api: {
989
1051
  status: z.ZodLiteral<200>;
990
1052
  json: z.ZodObject<{
991
1053
  schemaSha: z.ZodString;
992
- schemas: z.ZodRecord<z.ZodString & z.ZodType<ModuleFilePath, string, z.core.$ZodTypeInternals<ModuleFilePath, string>>, z.ZodType<import("@valbuild/core").SerializedSchema, unknown, z.core.$ZodTypeInternals<import("@valbuild/core").SerializedSchema, unknown>>>;
1054
+ schemas: z.ZodRecord<z.ZodString & z.ZodType<ModuleFilePath, string, z.core.$ZodTypeInternals<ModuleFilePath, string>>, z.ZodType<SerializedSchemaT, unknown, z.core.$ZodTypeInternals<SerializedSchemaT, unknown>>>;
993
1055
  }, z.core.$strip>;
994
1056
  }, z.core.$strip>]>;
995
1057
  };
@@ -1090,7 +1152,7 @@ export declare const Api: {
1090
1152
  message: z.ZodString;
1091
1153
  value: z.ZodOptional<z.ZodUnknown>;
1092
1154
  fatal: z.ZodOptional<z.ZodBoolean>;
1093
- fixes: z.ZodOptional<z.ZodArray<z.ZodType<"image:add-metadata" | "image:check-metadata" | "image:upload-remote" | "image:download-remote" | "image:check-remote" | "images:check-remote" | "images:upload-remote" | "file:add-metadata" | "file:check-metadata" | "file:upload-remote" | "file:download-remote" | "file:check-remote" | "files:check-remote" | "files:upload-remote" | "video:add-metadata" | "video:upload-remote" | "video:download-remote" | "videos:add-metadata" | "videos:check-remote" | "videos:upload-remote" | "keyof:check-keys" | "router:check-route" | "locale:check-locale" | "images:check-unique-folder" | "files:check-unique-folder" | "images:check-all-files" | "files:check-all-files" | "videos:check-unique-folder" | "videos:check-all-files" | "jsonValues:extract-entry" | "record:fill-keys" | "external:upload" | "view:check-module", unknown, z.core.$ZodTypeInternals<"image:add-metadata" | "image:check-metadata" | "image:upload-remote" | "image:download-remote" | "image:check-remote" | "images:check-remote" | "images:upload-remote" | "file:add-metadata" | "file:check-metadata" | "file:upload-remote" | "file:download-remote" | "file:check-remote" | "files:check-remote" | "files:upload-remote" | "video:add-metadata" | "video:upload-remote" | "video:download-remote" | "videos:add-metadata" | "videos:check-remote" | "videos:upload-remote" | "keyof:check-keys" | "router:check-route" | "locale:check-locale" | "images:check-unique-folder" | "files:check-unique-folder" | "images:check-all-files" | "files:check-all-files" | "videos:check-unique-folder" | "videos:check-all-files" | "jsonValues:extract-entry" | "record:fill-keys" | "external:upload" | "view:check-module", unknown>>>>;
1155
+ fixes: z.ZodOptional<z.ZodArray<z.ZodType<ValidationFix, unknown, z.core.$ZodTypeInternals<ValidationFix, unknown>>>>;
1094
1156
  }, z.core.$strip>>>>;
1095
1157
  }, z.core.$strip>>;
1096
1158
  }, z.core.$strip>;
@@ -1156,6 +1218,38 @@ export declare const Api: {
1156
1218
  }, z.core.$strip>]>;
1157
1219
  };
1158
1220
  };
1221
+ /**
1222
+ * In a proposal: the SITE's Source for every module the proposal has saved,
1223
+ * as the build it is based on has it. What Compare with the site diffs the
1224
+ * proposal against -- saved and unsaved alike -- because the Studio's own
1225
+ * base Source there is the proposal's last save. 404 anywhere that is not a
1226
+ * proposal's address. valbuild/home `docs/proposals.md`.
1227
+ */
1228
+ "/proposal-site-sources": {
1229
+ GET: {
1230
+ req: {
1231
+ cookies: {
1232
+ val_session: z.ZodOptional<z.ZodString>;
1233
+ };
1234
+ };
1235
+ res: z.ZodUnion<readonly [z.ZodObject<{
1236
+ status: z.ZodLiteral<401>;
1237
+ json: z.ZodObject<{
1238
+ message: z.ZodString;
1239
+ }, z.core.$strip>;
1240
+ }, z.core.$strip>, z.ZodObject<{
1241
+ status: z.ZodLiteral<404>;
1242
+ json: z.ZodObject<{
1243
+ message: z.ZodString;
1244
+ }, z.core.$strip>;
1245
+ }, z.core.$strip>, z.ZodObject<{
1246
+ status: z.ZodLiteral<200>;
1247
+ json: z.ZodObject<{
1248
+ modules: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1249
+ }, z.core.$strip>;
1250
+ }, z.core.$strip>]>;
1251
+ };
1252
+ };
1159
1253
  "/profiles": {
1160
1254
  GET: {
1161
1255
  req: {
@@ -1388,8 +1482,8 @@ export declare const Api: {
1388
1482
  hasArchive: z.ZodBoolean;
1389
1483
  }, z.core.$strip>;
1390
1484
  modules: z.ZodRecord<z.ZodString, z.ZodObject<{
1391
- source: z.ZodNullable<z.ZodType<import("@valbuild/core/patch").JSONValue, unknown, z.core.$ZodTypeInternals<import("@valbuild/core/patch").JSONValue, unknown>>>;
1392
- schema: z.ZodNullable<z.ZodType<import("@valbuild/core").SerializedSchema, unknown, z.core.$ZodTypeInternals<import("@valbuild/core").SerializedSchema, unknown>>>;
1485
+ source: z.ZodNullable<z.ZodType<JSONValueT, unknown, z.core.$ZodTypeInternals<JSONValueT, unknown>>>;
1486
+ schema: z.ZodNullable<z.ZodType<SerializedSchemaT, unknown, z.core.$ZodTypeInternals<SerializedSchemaT, unknown>>>;
1393
1487
  patchIds: z.ZodArray<z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>>;
1394
1488
  changedPaths: z.ZodArray<z.ZodString>;
1395
1489
  failures: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1508,8 +1602,8 @@ export declare const Api: {
1508
1602
  json: z.ZodObject<{
1509
1603
  moduleFilePath: z.ZodString;
1510
1604
  module: z.ZodNullable<z.ZodObject<{
1511
- source: z.ZodNullable<z.ZodType<import("@valbuild/core/patch").JSONValue, unknown, z.core.$ZodTypeInternals<import("@valbuild/core/patch").JSONValue, unknown>>>;
1512
- schema: z.ZodNullable<z.ZodType<import("@valbuild/core").SerializedSchema, unknown, z.core.$ZodTypeInternals<import("@valbuild/core").SerializedSchema, unknown>>>;
1605
+ source: z.ZodNullable<z.ZodType<JSONValueT, unknown, z.core.$ZodTypeInternals<JSONValueT, unknown>>>;
1606
+ schema: z.ZodNullable<z.ZodType<SerializedSchemaT, unknown, z.core.$ZodTypeInternals<SerializedSchemaT, unknown>>>;
1513
1607
  patchIds: z.ZodArray<z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>>;
1514
1608
  changedPaths: z.ZodArray<z.ZodString>;
1515
1609
  failures: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -64,8 +64,8 @@ export declare const BinaryFileRef: z.ZodObject<{
64
64
  }, z.core.$strip>;
65
65
  export type BinaryFileRef = z.infer<typeof BinaryFileRef>;
66
66
  export declare const HistoricalModule: z.ZodObject<{
67
- source: z.ZodNullable<z.ZodType<import("@valbuild/core/patch").JSONValue, unknown, z.core.$ZodTypeInternals<import("@valbuild/core/patch").JSONValue, unknown>>>;
68
- schema: z.ZodNullable<z.ZodType<import("@valbuild/core").SerializedSchema, unknown, z.core.$ZodTypeInternals<import("@valbuild/core").SerializedSchema, unknown>>>;
67
+ source: z.ZodNullable<z.ZodType<JSONValueT, unknown, z.core.$ZodTypeInternals<JSONValueT, unknown>>>;
68
+ schema: z.ZodNullable<z.ZodType<SerializedSchemaT, unknown, z.core.$ZodTypeInternals<SerializedSchemaT, unknown>>>;
69
69
  patchIds: z.ZodArray<z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>>;
70
70
  changedPaths: z.ZodArray<z.ZodString>;
71
71
  failures: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -109,8 +109,8 @@ export declare const HistoricalPatchSet: z.ZodObject<{
109
109
  hasArchive: z.ZodBoolean;
110
110
  }, z.core.$strip>;
111
111
  modules: z.ZodRecord<z.ZodString, z.ZodObject<{
112
- source: z.ZodNullable<z.ZodType<import("@valbuild/core/patch").JSONValue, unknown, z.core.$ZodTypeInternals<import("@valbuild/core/patch").JSONValue, unknown>>>;
113
- schema: z.ZodNullable<z.ZodType<import("@valbuild/core").SerializedSchema, unknown, z.core.$ZodTypeInternals<import("@valbuild/core").SerializedSchema, unknown>>>;
112
+ source: z.ZodNullable<z.ZodType<JSONValueT, unknown, z.core.$ZodTypeInternals<JSONValueT, unknown>>>;
113
+ schema: z.ZodNullable<z.ZodType<SerializedSchemaT, unknown, z.core.$ZodTypeInternals<SerializedSchemaT, unknown>>>;
114
114
  patchIds: z.ZodArray<z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>>;
115
115
  changedPaths: z.ZodArray<z.ZodString>;
116
116
  failures: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -66,25 +66,7 @@ export declare const ColorOptions: z.ZodObject<{
66
66
  export declare const SerializedColorSchema: z.ZodType<SerializedColorSchemaT>;
67
67
  export declare const CodeOptions: z.ZodObject<{
68
68
  language: z.ZodOptional<z.ZodEnum<{
69
- json: "json";
70
- typescript: "typescript";
71
- javascript: "javascript";
72
- javascriptreact: "javascriptreact";
73
- typescriptreact: "typescriptreact";
74
- java: "java";
75
- html: "html";
76
- css: "css";
77
- xml: "xml";
78
- markdown: "markdown";
79
- sql: "sql";
80
- python: "python";
81
- rust: "rust";
82
- php: "php";
83
- go: "go";
84
- cpp: "cpp";
85
- sass: "sass";
86
- vue: "vue";
87
- angular: "angular";
69
+ [x: string]: any;
88
70
  }>>;
89
71
  }, z.core.$strip>;
90
72
  export declare const SerializedCodeSchema: z.ZodType<SerializedCodeSchemaT>;
@@ -1602,6 +1602,14 @@ var PublishRefusal = zod.z.object({
1602
1602
  message: zod.z.string()
1603
1603
  });
1604
1604
 
1605
+ /** See `proposal` on `/stat`. */
1606
+ var StatProposal = zod.z.object({
1607
+ /** Twenty hex characters, the hash of what it was made from. */
1608
+ name: zod.z.string(),
1609
+ /** `val/p/<name>`. */
1610
+ branch: zod.z.string()
1611
+ });
1612
+
1605
1613
  /**
1606
1614
  * A patch group: the set of patches one user has chosen to publish.
1607
1615
  *
@@ -2032,7 +2040,13 @@ var Api = {
2032
2040
  * connected ones by commit.
2033
2041
  */
2034
2042
  publishJobs: zod.z["boolean"]().optional(),
2035
- publishRefusal: PublishRefusal.optional()
2043
+ publishRefusal: PublishRefusal.optional(),
2044
+ /**
2045
+ * The proposal this server runs at the address of, or absent
2046
+ * on the site. What the Studio's switcher says it is in, and
2047
+ * where its Save goes (valbuild/home `docs/proposals.md`).
2048
+ */
2049
+ proposal: StatProposal.optional()
2036
2050
  }), zod.z.object({
2037
2051
  type: zod.z.literal("use-websocket"),
2038
2052
  url: zod.z.string(),
@@ -2150,7 +2164,13 @@ var Api = {
2150
2164
  * connected ones by commit.
2151
2165
  */
2152
2166
  publishJobs: zod.z["boolean"]().optional(),
2153
- publishRefusal: PublishRefusal.optional()
2167
+ publishRefusal: PublishRefusal.optional(),
2168
+ /**
2169
+ * The proposal this server runs at the address of, or absent
2170
+ * on the site. What the Studio's switcher says it is in, and
2171
+ * where its Save goes (valbuild/home `docs/proposals.md`).
2172
+ */
2173
+ proposal: StatProposal.optional()
2154
2174
  })])
2155
2175
  })])
2156
2176
  }
@@ -2236,6 +2256,60 @@ var Api = {
2236
2256
  })
2237
2257
  }
2238
2258
  },
2259
+ /**
2260
+ * The content service's proposals API, reached through this deployment:
2261
+ * list, open, read, rename, close, reopen and retry a setup
2262
+ * (valbuild/home `docs/proposals.md`, Flow B).
2263
+ *
2264
+ * The same arrangement as `/publish-api`, for the same reasons: the browser
2265
+ * holds a session for this origin and no credential content accepts, so
2266
+ * this server checks the session, sends the project's key with the person's
2267
+ * profile id beside it -- a proposal is opened, renamed and closed by
2268
+ * somebody -- and carries content's status and body back unread. The sub-path
2269
+ * is content's, after `/proposals`; `ValOpsHttp.proposalsApi` holds the
2270
+ * allow list. A save is not here: it is `/save`, which a proposal's server
2271
+ * sends to the proposal's own route.
2272
+ */
2273
+ "/proposals-api": {
2274
+ GET: {
2275
+ req: {
2276
+ path: zod.z.string().optional(),
2277
+ cookies: {
2278
+ val_session: zod.z.string().optional()
2279
+ }
2280
+ },
2281
+ res: zod.z.object({
2282
+ status: zod.z.number(),
2283
+ json: zod.z.unknown()
2284
+ })
2285
+ },
2286
+ POST: {
2287
+ req: {
2288
+ path: zod.z.string().optional(),
2289
+ body: zod.z.unknown().optional(),
2290
+ cookies: {
2291
+ val_session: zod.z.string().optional()
2292
+ }
2293
+ },
2294
+ res: zod.z.object({
2295
+ status: zod.z.number(),
2296
+ json: zod.z.unknown()
2297
+ })
2298
+ },
2299
+ PATCH: {
2300
+ req: {
2301
+ path: zod.z.string().optional(),
2302
+ body: zod.z.unknown().optional(),
2303
+ cookies: {
2304
+ val_session: zod.z.string().optional()
2305
+ }
2306
+ },
2307
+ res: zod.z.object({
2308
+ status: zod.z.number(),
2309
+ json: zod.z.unknown()
2310
+ })
2311
+ }
2312
+ },
2239
2313
  "/upload/patches": {
2240
2314
  POST: {
2241
2315
  req: {
@@ -2765,6 +2839,32 @@ var Api = {
2765
2839
  })])
2766
2840
  }
2767
2841
  },
2842
+ /**
2843
+ * In a proposal: the SITE's Source for every module the proposal has saved,
2844
+ * as the build it is based on has it. What Compare with the site diffs the
2845
+ * proposal against -- saved and unsaved alike -- because the Studio's own
2846
+ * base Source there is the proposal's last save. 404 anywhere that is not a
2847
+ * proposal's address. valbuild/home `docs/proposals.md`.
2848
+ */
2849
+ "/proposal-site-sources": {
2850
+ GET: {
2851
+ req: {
2852
+ cookies: {
2853
+ val_session: zod.z.string().optional()
2854
+ }
2855
+ },
2856
+ res: zod.z.union([unauthorizedResponse, zod.z.object({
2857
+ status: zod.z.literal(404),
2858
+ json: GenericError
2859
+ }), zod.z.object({
2860
+ status: zod.z.literal(200),
2861
+ json: zod.z.object({
2862
+ /** By module file path. A module absent here is the same in both. */
2863
+ modules: zod.z.record(zod.z.string(), zod.z.unknown())
2864
+ })
2865
+ })])
2866
+ }
2867
+ },
2768
2868
  "/profiles": {
2769
2869
  GET: {
2770
2870
  req: {
@@ -1602,6 +1602,14 @@ var PublishRefusal = zod.z.object({
1602
1602
  message: zod.z.string()
1603
1603
  });
1604
1604
 
1605
+ /** See `proposal` on `/stat`. */
1606
+ var StatProposal = zod.z.object({
1607
+ /** Twenty hex characters, the hash of what it was made from. */
1608
+ name: zod.z.string(),
1609
+ /** `val/p/<name>`. */
1610
+ branch: zod.z.string()
1611
+ });
1612
+
1605
1613
  /**
1606
1614
  * A patch group: the set of patches one user has chosen to publish.
1607
1615
  *
@@ -2032,7 +2040,13 @@ var Api = {
2032
2040
  * connected ones by commit.
2033
2041
  */
2034
2042
  publishJobs: zod.z["boolean"]().optional(),
2035
- publishRefusal: PublishRefusal.optional()
2043
+ publishRefusal: PublishRefusal.optional(),
2044
+ /**
2045
+ * The proposal this server runs at the address of, or absent
2046
+ * on the site. What the Studio's switcher says it is in, and
2047
+ * where its Save goes (valbuild/home `docs/proposals.md`).
2048
+ */
2049
+ proposal: StatProposal.optional()
2036
2050
  }), zod.z.object({
2037
2051
  type: zod.z.literal("use-websocket"),
2038
2052
  url: zod.z.string(),
@@ -2150,7 +2164,13 @@ var Api = {
2150
2164
  * connected ones by commit.
2151
2165
  */
2152
2166
  publishJobs: zod.z["boolean"]().optional(),
2153
- publishRefusal: PublishRefusal.optional()
2167
+ publishRefusal: PublishRefusal.optional(),
2168
+ /**
2169
+ * The proposal this server runs at the address of, or absent
2170
+ * on the site. What the Studio's switcher says it is in, and
2171
+ * where its Save goes (valbuild/home `docs/proposals.md`).
2172
+ */
2173
+ proposal: StatProposal.optional()
2154
2174
  })])
2155
2175
  })])
2156
2176
  }
@@ -2236,6 +2256,60 @@ var Api = {
2236
2256
  })
2237
2257
  }
2238
2258
  },
2259
+ /**
2260
+ * The content service's proposals API, reached through this deployment:
2261
+ * list, open, read, rename, close, reopen and retry a setup
2262
+ * (valbuild/home `docs/proposals.md`, Flow B).
2263
+ *
2264
+ * The same arrangement as `/publish-api`, for the same reasons: the browser
2265
+ * holds a session for this origin and no credential content accepts, so
2266
+ * this server checks the session, sends the project's key with the person's
2267
+ * profile id beside it -- a proposal is opened, renamed and closed by
2268
+ * somebody -- and carries content's status and body back unread. The sub-path
2269
+ * is content's, after `/proposals`; `ValOpsHttp.proposalsApi` holds the
2270
+ * allow list. A save is not here: it is `/save`, which a proposal's server
2271
+ * sends to the proposal's own route.
2272
+ */
2273
+ "/proposals-api": {
2274
+ GET: {
2275
+ req: {
2276
+ path: zod.z.string().optional(),
2277
+ cookies: {
2278
+ val_session: zod.z.string().optional()
2279
+ }
2280
+ },
2281
+ res: zod.z.object({
2282
+ status: zod.z.number(),
2283
+ json: zod.z.unknown()
2284
+ })
2285
+ },
2286
+ POST: {
2287
+ req: {
2288
+ path: zod.z.string().optional(),
2289
+ body: zod.z.unknown().optional(),
2290
+ cookies: {
2291
+ val_session: zod.z.string().optional()
2292
+ }
2293
+ },
2294
+ res: zod.z.object({
2295
+ status: zod.z.number(),
2296
+ json: zod.z.unknown()
2297
+ })
2298
+ },
2299
+ PATCH: {
2300
+ req: {
2301
+ path: zod.z.string().optional(),
2302
+ body: zod.z.unknown().optional(),
2303
+ cookies: {
2304
+ val_session: zod.z.string().optional()
2305
+ }
2306
+ },
2307
+ res: zod.z.object({
2308
+ status: zod.z.number(),
2309
+ json: zod.z.unknown()
2310
+ })
2311
+ }
2312
+ },
2239
2313
  "/upload/patches": {
2240
2314
  POST: {
2241
2315
  req: {
@@ -2765,6 +2839,32 @@ var Api = {
2765
2839
  })])
2766
2840
  }
2767
2841
  },
2842
+ /**
2843
+ * In a proposal: the SITE's Source for every module the proposal has saved,
2844
+ * as the build it is based on has it. What Compare with the site diffs the
2845
+ * proposal against -- saved and unsaved alike -- because the Studio's own
2846
+ * base Source there is the proposal's last save. 404 anywhere that is not a
2847
+ * proposal's address. valbuild/home `docs/proposals.md`.
2848
+ */
2849
+ "/proposal-site-sources": {
2850
+ GET: {
2851
+ req: {
2852
+ cookies: {
2853
+ val_session: zod.z.string().optional()
2854
+ }
2855
+ },
2856
+ res: zod.z.union([unauthorizedResponse, zod.z.object({
2857
+ status: zod.z.literal(404),
2858
+ json: GenericError
2859
+ }), zod.z.object({
2860
+ status: zod.z.literal(200),
2861
+ json: zod.z.object({
2862
+ /** By module file path. A module absent here is the same in both. */
2863
+ modules: zod.z.record(zod.z.string(), zod.z.unknown())
2864
+ })
2865
+ })])
2866
+ }
2867
+ },
2768
2868
  "/profiles": {
2769
2869
  GET: {
2770
2870
  req: {
@@ -1595,6 +1595,14 @@ var PublishRefusal = z.object({
1595
1595
  message: z.string()
1596
1596
  });
1597
1597
 
1598
+ /** See `proposal` on `/stat`. */
1599
+ var StatProposal = z.object({
1600
+ /** Twenty hex characters, the hash of what it was made from. */
1601
+ name: z.string(),
1602
+ /** `val/p/<name>`. */
1603
+ branch: z.string()
1604
+ });
1605
+
1598
1606
  /**
1599
1607
  * A patch group: the set of patches one user has chosen to publish.
1600
1608
  *
@@ -2025,7 +2033,13 @@ var Api = {
2025
2033
  * connected ones by commit.
2026
2034
  */
2027
2035
  publishJobs: z["boolean"]().optional(),
2028
- publishRefusal: PublishRefusal.optional()
2036
+ publishRefusal: PublishRefusal.optional(),
2037
+ /**
2038
+ * The proposal this server runs at the address of, or absent
2039
+ * on the site. What the Studio's switcher says it is in, and
2040
+ * where its Save goes (valbuild/home `docs/proposals.md`).
2041
+ */
2042
+ proposal: StatProposal.optional()
2029
2043
  }), z.object({
2030
2044
  type: z.literal("use-websocket"),
2031
2045
  url: z.string(),
@@ -2143,7 +2157,13 @@ var Api = {
2143
2157
  * connected ones by commit.
2144
2158
  */
2145
2159
  publishJobs: z["boolean"]().optional(),
2146
- publishRefusal: PublishRefusal.optional()
2160
+ publishRefusal: PublishRefusal.optional(),
2161
+ /**
2162
+ * The proposal this server runs at the address of, or absent
2163
+ * on the site. What the Studio's switcher says it is in, and
2164
+ * where its Save goes (valbuild/home `docs/proposals.md`).
2165
+ */
2166
+ proposal: StatProposal.optional()
2147
2167
  })])
2148
2168
  })])
2149
2169
  }
@@ -2229,6 +2249,60 @@ var Api = {
2229
2249
  })
2230
2250
  }
2231
2251
  },
2252
+ /**
2253
+ * The content service's proposals API, reached through this deployment:
2254
+ * list, open, read, rename, close, reopen and retry a setup
2255
+ * (valbuild/home `docs/proposals.md`, Flow B).
2256
+ *
2257
+ * The same arrangement as `/publish-api`, for the same reasons: the browser
2258
+ * holds a session for this origin and no credential content accepts, so
2259
+ * this server checks the session, sends the project's key with the person's
2260
+ * profile id beside it -- a proposal is opened, renamed and closed by
2261
+ * somebody -- and carries content's status and body back unread. The sub-path
2262
+ * is content's, after `/proposals`; `ValOpsHttp.proposalsApi` holds the
2263
+ * allow list. A save is not here: it is `/save`, which a proposal's server
2264
+ * sends to the proposal's own route.
2265
+ */
2266
+ "/proposals-api": {
2267
+ GET: {
2268
+ req: {
2269
+ path: z.string().optional(),
2270
+ cookies: {
2271
+ val_session: z.string().optional()
2272
+ }
2273
+ },
2274
+ res: z.object({
2275
+ status: z.number(),
2276
+ json: z.unknown()
2277
+ })
2278
+ },
2279
+ POST: {
2280
+ req: {
2281
+ path: z.string().optional(),
2282
+ body: z.unknown().optional(),
2283
+ cookies: {
2284
+ val_session: z.string().optional()
2285
+ }
2286
+ },
2287
+ res: z.object({
2288
+ status: z.number(),
2289
+ json: z.unknown()
2290
+ })
2291
+ },
2292
+ PATCH: {
2293
+ req: {
2294
+ path: z.string().optional(),
2295
+ body: z.unknown().optional(),
2296
+ cookies: {
2297
+ val_session: z.string().optional()
2298
+ }
2299
+ },
2300
+ res: z.object({
2301
+ status: z.number(),
2302
+ json: z.unknown()
2303
+ })
2304
+ }
2305
+ },
2232
2306
  "/upload/patches": {
2233
2307
  POST: {
2234
2308
  req: {
@@ -2758,6 +2832,32 @@ var Api = {
2758
2832
  })])
2759
2833
  }
2760
2834
  },
2835
+ /**
2836
+ * In a proposal: the SITE's Source for every module the proposal has saved,
2837
+ * as the build it is based on has it. What Compare with the site diffs the
2838
+ * proposal against -- saved and unsaved alike -- because the Studio's own
2839
+ * base Source there is the proposal's last save. 404 anywhere that is not a
2840
+ * proposal's address. valbuild/home `docs/proposals.md`.
2841
+ */
2842
+ "/proposal-site-sources": {
2843
+ GET: {
2844
+ req: {
2845
+ cookies: {
2846
+ val_session: z.string().optional()
2847
+ }
2848
+ },
2849
+ res: z.union([unauthorizedResponse, z.object({
2850
+ status: z.literal(404),
2851
+ json: GenericError
2852
+ }), z.object({
2853
+ status: z.literal(200),
2854
+ json: z.object({
2855
+ /** By module file path. A module absent here is the same in both. */
2856
+ modules: z.record(z.string(), z.unknown())
2857
+ })
2858
+ })])
2859
+ }
2860
+ },
2761
2861
  "/profiles": {
2762
2862
  GET: {
2763
2863
  req: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valbuild/shared",
3
- "version": "0.141.0",
3
+ "version": "0.143.0",
4
4
  "private": false,
5
5
  "description": "Val shared types and utilities",
6
6
  "repository": {
@@ -37,7 +37,7 @@
37
37
  "flexsearch": "^0.8.212",
38
38
  "zod": "^4.4.3",
39
39
  "zod-validation-error": "^5.0.0",
40
- "@valbuild/core": "0.141.0"
40
+ "@valbuild/core": "0.143.0"
41
41
  },
42
42
  "files": [
43
43
  "CHANGELOG.md",