@valbuild/shared 0.103.0 → 0.105.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.
@@ -430,6 +430,10 @@ export declare const Api: {
430
430
  schemaSha: z.ZodString;
431
431
  sourcesSha: z.ZodString;
432
432
  patches: z.ZodArray<z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>>;
433
+ removed: z.ZodOptional<z.ZodArray<z.ZodObject<{
434
+ patchId: z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>;
435
+ reason: z.ZodString;
436
+ }, z.core.$strip>>>;
433
437
  config: z.ZodObject<{
434
438
  project: z.ZodOptional<z.ZodString>;
435
439
  root: z.ZodOptional<z.ZodString>;
@@ -813,7 +817,7 @@ export declare const Api: {
813
817
  schemaSha: z.ZodString;
814
818
  sourcesSha: z.ZodString;
815
819
  modules: z.ZodRecord<z.ZodString & z.ZodType<ModuleFilePath, string, z.core.$ZodTypeInternals<ModuleFilePath, string>>, z.ZodObject<{
816
- render: z.ZodOptional<z.ZodAny>;
820
+ preview: z.ZodOptional<z.ZodAny>;
817
821
  source: z.ZodOptional<z.ZodAny>;
818
822
  baseSource: z.ZodOptional<z.ZodAny>;
819
823
  patches: z.ZodOptional<z.ZodObject<{
@@ -914,7 +918,13 @@ export declare const Api: {
914
918
  }, z.core.$strip>;
915
919
  }, z.core.$strip>, z.ZodObject<{
916
920
  status: z.ZodLiteral<200>;
917
- json: z.ZodObject<{}, z.core.$strip>;
921
+ json: z.ZodObject<{
922
+ removed: z.ZodOptional<z.ZodArray<z.ZodObject<{
923
+ patchId: z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>;
924
+ moduleFilePath: z.ZodString & z.ZodType<ModuleFilePath, string, z.core.$ZodTypeInternals<ModuleFilePath, string>>;
925
+ message: z.ZodString;
926
+ }, z.core.$strip>>>;
927
+ }, z.core.$strip>;
918
928
  }, z.core.$strip>, z.ZodObject<{
919
929
  status: z.ZodLiteral<409>;
920
930
  json: z.ZodObject<{
@@ -1001,6 +1001,14 @@ var SourcePath = zod.z.string().transform(function (path) {
1001
1001
 
1002
1002
  var SerializedStringSchema = zod.z.object({
1003
1003
  type: zod.z.literal("string"),
1004
+ // A render is static config, so unlike a `preview` it travels WHOLE — this
1005
+ // is the field the editor reads the layout from. See `core/src/render.ts`.
1006
+ render: zod.z.union([zod.z.object({
1007
+ as: zod.z.literal("textarea")
1008
+ }), zod.z.object({
1009
+ as: zod.z.literal("code"),
1010
+ language: zod.z["enum"](core.CODE_LANGUAGES)
1011
+ })]).optional(),
1004
1012
  options: zod.z.object({
1005
1013
  maxLength: zod.z.number().optional(),
1006
1014
  minLength: zod.z.number().optional(),
@@ -1051,6 +1059,8 @@ var SerializedArraySchema = zod.z.lazy(function () {
1051
1059
  type: zod.z.literal("array"),
1052
1060
  item: SerializedSchema,
1053
1061
  opt: zod.z["boolean"](),
1062
+ // Only whether a preview EXISTS: the closure itself cannot be serialized.
1063
+ preview: zod.z.literal(true).optional(),
1054
1064
  readonly: zod.z["boolean"]().optional(),
1055
1065
  hidden: zod.z["boolean"]().optional()
1056
1066
  });
@@ -1120,6 +1130,8 @@ var SerializedRecordSchema = zod.z.lazy(function () {
1120
1130
  type: zod.z.literal("record"),
1121
1131
  item: SerializedSchema,
1122
1132
  opt: zod.z["boolean"](),
1133
+ // Only whether a preview EXISTS: the closure itself cannot be serialized.
1134
+ preview: zod.z.literal(true).optional(),
1123
1135
  // Optional gallery marker for files/images
1124
1136
  mediaType: zod.z.union([zod.z.literal("files"), zod.z.literal("images")]).optional(),
1125
1137
  // Optional legacy gallery metadata
@@ -1648,6 +1660,21 @@ var Api = {
1648
1660
  schemaSha: zod.z.string(),
1649
1661
  sourcesSha: zod.z.string(),
1650
1662
  patches: zod.z.array(PatchId),
1663
+ /**
1664
+ * Unpublished changes the store threw away because it could not
1665
+ * read them.
1666
+ *
1667
+ * On stat rather than on `GET /patches` because stat is the
1668
+ * channel that always flows: the case worth reporting is a repair
1669
+ * that removed EVERYTHING, and then there is nothing left for the
1670
+ * studio to fetch, so a notice riding on the fetch is never
1671
+ * collected. Said once - the server drains it when it hands it
1672
+ * over.
1673
+ */
1674
+ removed: zod.z.array(zod.z.object({
1675
+ patchId: PatchId,
1676
+ reason: zod.z.string()
1677
+ })).optional(),
1651
1678
  config: ValConfig,
1652
1679
  profileId: zod.z.string().nullable(),
1653
1680
  mode: zod.z.union([zod.z.literal("http"), zod.z.literal("fs")]),
@@ -1894,7 +1921,7 @@ var Api = {
1894
1921
  schemaSha: zod.z.string(),
1895
1922
  sourcesSha: zod.z.string(),
1896
1923
  modules: zod.z.record(ModuleFilePath, zod.z.object({
1897
- render: zod.z.any().optional(),
1924
+ preview: zod.z.any().optional(),
1898
1925
  // TODO: improve this type
1899
1926
  source: zod.z.any().optional(),
1900
1927
  //.optional(), // TODO: Json zod type
@@ -1974,7 +2001,23 @@ var Api = {
1974
2001
  },
1975
2002
  res: zod.z.union([unauthorizedResponse, zod.z.object({
1976
2003
  status: zod.z.literal(200),
1977
- json: zod.z.object({}) // TODO:
2004
+ json: zod.z.object({
2005
+ /**
2006
+ * Unpublished changes the save threw away because they could not be
2007
+ * applied.
2008
+ *
2009
+ * `fs` mode only, and the reason the save is a 200 rather than the
2010
+ * 400 it used to be: with auto-save on, refusing the whole commit
2011
+ * for one bad patch means nothing is ever written again. The rest is
2012
+ * written, these are removed, and the studio drops them locally and
2013
+ * says so.
2014
+ */
2015
+ removed: zod.z.array(zod.z.object({
2016
+ patchId: PatchId,
2017
+ moduleFilePath: ModuleFilePath,
2018
+ message: zod.z.string()
2019
+ })).optional()
2020
+ })
1978
2021
  }), zod.z.object({
1979
2022
  status: zod.z.literal(409),
1980
2023
  json: zod.z.object({
@@ -1001,6 +1001,14 @@ var SourcePath = zod.z.string().transform(function (path) {
1001
1001
 
1002
1002
  var SerializedStringSchema = zod.z.object({
1003
1003
  type: zod.z.literal("string"),
1004
+ // A render is static config, so unlike a `preview` it travels WHOLE — this
1005
+ // is the field the editor reads the layout from. See `core/src/render.ts`.
1006
+ render: zod.z.union([zod.z.object({
1007
+ as: zod.z.literal("textarea")
1008
+ }), zod.z.object({
1009
+ as: zod.z.literal("code"),
1010
+ language: zod.z["enum"](core.CODE_LANGUAGES)
1011
+ })]).optional(),
1004
1012
  options: zod.z.object({
1005
1013
  maxLength: zod.z.number().optional(),
1006
1014
  minLength: zod.z.number().optional(),
@@ -1051,6 +1059,8 @@ var SerializedArraySchema = zod.z.lazy(function () {
1051
1059
  type: zod.z.literal("array"),
1052
1060
  item: SerializedSchema,
1053
1061
  opt: zod.z["boolean"](),
1062
+ // Only whether a preview EXISTS: the closure itself cannot be serialized.
1063
+ preview: zod.z.literal(true).optional(),
1054
1064
  readonly: zod.z["boolean"]().optional(),
1055
1065
  hidden: zod.z["boolean"]().optional()
1056
1066
  });
@@ -1120,6 +1130,8 @@ var SerializedRecordSchema = zod.z.lazy(function () {
1120
1130
  type: zod.z.literal("record"),
1121
1131
  item: SerializedSchema,
1122
1132
  opt: zod.z["boolean"](),
1133
+ // Only whether a preview EXISTS: the closure itself cannot be serialized.
1134
+ preview: zod.z.literal(true).optional(),
1123
1135
  // Optional gallery marker for files/images
1124
1136
  mediaType: zod.z.union([zod.z.literal("files"), zod.z.literal("images")]).optional(),
1125
1137
  // Optional legacy gallery metadata
@@ -1648,6 +1660,21 @@ var Api = {
1648
1660
  schemaSha: zod.z.string(),
1649
1661
  sourcesSha: zod.z.string(),
1650
1662
  patches: zod.z.array(PatchId),
1663
+ /**
1664
+ * Unpublished changes the store threw away because it could not
1665
+ * read them.
1666
+ *
1667
+ * On stat rather than on `GET /patches` because stat is the
1668
+ * channel that always flows: the case worth reporting is a repair
1669
+ * that removed EVERYTHING, and then there is nothing left for the
1670
+ * studio to fetch, so a notice riding on the fetch is never
1671
+ * collected. Said once - the server drains it when it hands it
1672
+ * over.
1673
+ */
1674
+ removed: zod.z.array(zod.z.object({
1675
+ patchId: PatchId,
1676
+ reason: zod.z.string()
1677
+ })).optional(),
1651
1678
  config: ValConfig,
1652
1679
  profileId: zod.z.string().nullable(),
1653
1680
  mode: zod.z.union([zod.z.literal("http"), zod.z.literal("fs")]),
@@ -1894,7 +1921,7 @@ var Api = {
1894
1921
  schemaSha: zod.z.string(),
1895
1922
  sourcesSha: zod.z.string(),
1896
1923
  modules: zod.z.record(ModuleFilePath, zod.z.object({
1897
- render: zod.z.any().optional(),
1924
+ preview: zod.z.any().optional(),
1898
1925
  // TODO: improve this type
1899
1926
  source: zod.z.any().optional(),
1900
1927
  //.optional(), // TODO: Json zod type
@@ -1974,7 +2001,23 @@ var Api = {
1974
2001
  },
1975
2002
  res: zod.z.union([unauthorizedResponse, zod.z.object({
1976
2003
  status: zod.z.literal(200),
1977
- json: zod.z.object({}) // TODO:
2004
+ json: zod.z.object({
2005
+ /**
2006
+ * Unpublished changes the save threw away because they could not be
2007
+ * applied.
2008
+ *
2009
+ * `fs` mode only, and the reason the save is a 200 rather than the
2010
+ * 400 it used to be: with auto-save on, refusing the whole commit
2011
+ * for one bad patch means nothing is ever written again. The rest is
2012
+ * written, these are removed, and the studio drops them locally and
2013
+ * says so.
2014
+ */
2015
+ removed: zod.z.array(zod.z.object({
2016
+ patchId: PatchId,
2017
+ moduleFilePath: ModuleFilePath,
2018
+ message: zod.z.string()
2019
+ })).optional()
2020
+ })
1978
2021
  }), zod.z.object({
1979
2022
  status: zod.z.literal(409),
1980
2023
  json: zod.z.object({
@@ -1,4 +1,4 @@
1
- import { Internal } from '@valbuild/core';
1
+ import { Internal, CODE_LANGUAGES } from '@valbuild/core';
2
2
  import { b as base64DataUrlToUint8Array } from '../../dist/utils-00f3e1df.esm.js';
3
3
  import { z } from 'zod';
4
4
  import { fromError } from 'zod-validation-error';
@@ -997,6 +997,14 @@ var SourcePath = z.string().transform(function (path) {
997
997
 
998
998
  var SerializedStringSchema = z.object({
999
999
  type: z.literal("string"),
1000
+ // A render is static config, so unlike a `preview` it travels WHOLE — this
1001
+ // is the field the editor reads the layout from. See `core/src/render.ts`.
1002
+ render: z.union([z.object({
1003
+ as: z.literal("textarea")
1004
+ }), z.object({
1005
+ as: z.literal("code"),
1006
+ language: z["enum"](CODE_LANGUAGES)
1007
+ })]).optional(),
1000
1008
  options: z.object({
1001
1009
  maxLength: z.number().optional(),
1002
1010
  minLength: z.number().optional(),
@@ -1047,6 +1055,8 @@ var SerializedArraySchema = z.lazy(function () {
1047
1055
  type: z.literal("array"),
1048
1056
  item: SerializedSchema,
1049
1057
  opt: z["boolean"](),
1058
+ // Only whether a preview EXISTS: the closure itself cannot be serialized.
1059
+ preview: z.literal(true).optional(),
1050
1060
  readonly: z["boolean"]().optional(),
1051
1061
  hidden: z["boolean"]().optional()
1052
1062
  });
@@ -1116,6 +1126,8 @@ var SerializedRecordSchema = z.lazy(function () {
1116
1126
  type: z.literal("record"),
1117
1127
  item: SerializedSchema,
1118
1128
  opt: z["boolean"](),
1129
+ // Only whether a preview EXISTS: the closure itself cannot be serialized.
1130
+ preview: z.literal(true).optional(),
1119
1131
  // Optional gallery marker for files/images
1120
1132
  mediaType: z.union([z.literal("files"), z.literal("images")]).optional(),
1121
1133
  // Optional legacy gallery metadata
@@ -1644,6 +1656,21 @@ var Api = {
1644
1656
  schemaSha: z.string(),
1645
1657
  sourcesSha: z.string(),
1646
1658
  patches: z.array(PatchId),
1659
+ /**
1660
+ * Unpublished changes the store threw away because it could not
1661
+ * read them.
1662
+ *
1663
+ * On stat rather than on `GET /patches` because stat is the
1664
+ * channel that always flows: the case worth reporting is a repair
1665
+ * that removed EVERYTHING, and then there is nothing left for the
1666
+ * studio to fetch, so a notice riding on the fetch is never
1667
+ * collected. Said once - the server drains it when it hands it
1668
+ * over.
1669
+ */
1670
+ removed: z.array(z.object({
1671
+ patchId: PatchId,
1672
+ reason: z.string()
1673
+ })).optional(),
1647
1674
  config: ValConfig,
1648
1675
  profileId: z.string().nullable(),
1649
1676
  mode: z.union([z.literal("http"), z.literal("fs")]),
@@ -1890,7 +1917,7 @@ var Api = {
1890
1917
  schemaSha: z.string(),
1891
1918
  sourcesSha: z.string(),
1892
1919
  modules: z.record(ModuleFilePath, z.object({
1893
- render: z.any().optional(),
1920
+ preview: z.any().optional(),
1894
1921
  // TODO: improve this type
1895
1922
  source: z.any().optional(),
1896
1923
  //.optional(), // TODO: Json zod type
@@ -1970,7 +1997,23 @@ var Api = {
1970
1997
  },
1971
1998
  res: z.union([unauthorizedResponse, z.object({
1972
1999
  status: z.literal(200),
1973
- json: z.object({}) // TODO:
2000
+ json: z.object({
2001
+ /**
2002
+ * Unpublished changes the save threw away because they could not be
2003
+ * applied.
2004
+ *
2005
+ * `fs` mode only, and the reason the save is a 200 rather than the
2006
+ * 400 it used to be: with auto-save on, refusing the whole commit
2007
+ * for one bad patch means nothing is ever written again. The rest is
2008
+ * written, these are removed, and the studio drops them locally and
2009
+ * says so.
2010
+ */
2011
+ removed: z.array(z.object({
2012
+ patchId: PatchId,
2013
+ moduleFilePath: ModuleFilePath,
2014
+ message: z.string()
2015
+ })).optional()
2016
+ })
1974
2017
  }), z.object({
1975
2018
  status: z.literal(409),
1976
2019
  json: z.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valbuild/shared",
3
- "version": "0.103.0",
3
+ "version": "0.105.1",
4
4
  "private": false,
5
5
  "description": "Val shared types and utilities",
6
6
  "repository": {
@@ -31,7 +31,7 @@
31
31
  "dependencies": {
32
32
  "zod": "^4.3.5",
33
33
  "zod-validation-error": "^5.0.0",
34
- "@valbuild/core": "0.103.0"
34
+ "@valbuild/core": "0.105.1"
35
35
  },
36
36
  "files": [
37
37
  "dist",