@valbuild/shared 0.141.0 → 0.142.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.
@@ -1,7 +1,7 @@
1
1
  import { Json } from "@valbuild/core";
2
- export declare const VAL_SESSION_COOKIE: "val_session";
3
- export declare const VAL_STATE_COOKIE: "val_state";
4
- export declare const VAL_ENABLE_COOKIE_NAME: "val_enable";
2
+ export declare const VAL_SESSION_COOKIE: any;
3
+ export declare const VAL_STATE_COOKIE: any;
4
+ export declare const VAL_ENABLE_COOKIE_NAME: any;
5
5
  export type VAL_SESSION_COOKIE = typeof VAL_SESSION_COOKIE;
6
6
  export type VAL_STATE_COOKIE = typeof VAL_STATE_COOKIE;
7
7
  export type VAL_ENABLE_COOKIE_NAME = typeof VAL_ENABLE_COOKIE_NAME;
@@ -64,9 +64,9 @@ 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>>>;
69
- patchIds: z.ZodArray<z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>>;
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
+ patchIds: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
70
70
  changedPaths: z.ZodArray<z.ZodString>;
71
71
  failures: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
72
72
  kind: z.ZodLiteral<"commit-not-found">;
@@ -109,9 +109,9 @@ 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>>>;
114
- patchIds: z.ZodArray<z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>>;
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
+ patchIds: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
115
115
  changedPaths: z.ZodArray<z.ZodString>;
116
116
  failures: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
117
117
  kind: z.ZodLiteral<"commit-not-found">;
@@ -139,7 +139,7 @@ export declare const HistoricalPatchSet: z.ZodObject<{
139
139
  }, z.core.$strip>], "kind">>;
140
140
  }, z.core.$strip>>;
141
141
  patches: z.ZodArray<z.ZodObject<{
142
- patchId: z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>;
142
+ patchId: z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>;
143
143
  moduleFilePath: z.ZodString;
144
144
  patch: z.ZodUnknown;
145
145
  authorId: z.ZodNullable<z.ZodString>;
@@ -1,5 +1,4 @@
1
1
  import type { JSONValue as JSONValueT, PatchJSON as PatchJSONT, PatchBlock as PatchBlockT, ParentRef as ParentRefT } from "@valbuild/core/patch";
2
- import type { PatchId as PatchIdT } from "@valbuild/core";
3
2
  import { z } from "zod";
4
3
  /**
5
4
  * JSON, recursively — the shape of a Source over the wire.
@@ -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>;
@@ -101,7 +83,7 @@ export declare const SerializedSettingsSchema: z.ZodType<SerializedSettingsSchem
101
83
  */
102
84
  export declare const SerializedValViewSchema: z.ZodObject<{
103
85
  type: z.ZodLiteral<"view">;
104
- moduleFilePath: z.ZodType<import("@valbuild/core").ModuleFilePath, unknown, z.core.$ZodTypeInternals<import("@valbuild/core").ModuleFilePath, unknown>>;
86
+ moduleFilePath: z.ZodType<ModuleFilePathT, unknown, z.core.$ZodTypeInternals<ModuleFilePathT, unknown>>;
105
87
  opt: z.ZodLiteral<false>;
106
88
  readonly: z.ZodOptional<z.ZodBoolean>;
107
89
  hidden: z.ZodOptional<z.ZodBoolean>;
@@ -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.142.0",
4
4
  "private": false,
5
5
  "description": "Val shared types and utilities",
6
6
  "repository": {