@valbuild/shared 0.144.9 → 0.145.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 +37 -0
- package/dist/declarations/src/internal/ApiRoutes.d.ts +117 -109
- package/dist/declarations/src/internal/server/types.d.ts +3 -3
- package/dist/declarations/src/internal/zod/History.d.ts +3 -3
- package/dist/declarations/src/internal/zod/Patch.d.ts +0 -1
- package/dist/declarations/src/internal/zod/SerializedSchema.d.ts +1 -1
- package/internal/dist/valbuild-shared-internal.cjs.dev.js +60 -7
- package/internal/dist/valbuild-shared-internal.cjs.prod.js +60 -7
- package/internal/dist/valbuild-shared-internal.esm.js +60 -8
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# @valbuild/shared
|
|
2
2
|
|
|
3
|
+
## 0.145.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#859](https://github.com/valbuild/val/pull/859) [`f085be0`](https://github.com/valbuild/val/commit/f085be0eb5bdc195e9d8cdb15dd5f8acfdabe23c) Thanks [@freekh](https://github.com/freekh)! - An edit Val Build refuses to save because of the project's plan — the Free plan's 1,000 changes a week are used, or a Hosted trial has ended — is now kept in the Studio instead of being reverted.
|
|
8
|
+
|
|
9
|
+
- `PUT /patches` answers such a save with a `403` of type `plan-refused`, carrying Val Build's reason and fix as data and which patches of the request it did save. It used to answer `400 patch-error`, which the Studio reads as a bad patch and drops.
|
|
10
|
+
- The Studio keeps the refused edits and any made after them, shows the plan notice with **Upgrade** or **Add a card** beside it, and saves them by itself once the plan allows it: as soon as Val Build says editing is open again (an owner added a card, the week moved on), and otherwise by trying again now and then. A publish or a restore that meets held edits says why, in Val Build's words, instead of suggesting the connection.
|
|
11
|
+
- The MCP write tools answer a refused write as `forbidden`, with Val Build's sentence, instead of `internal`.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#851](https://github.com/valbuild/val/pull/851) [`b6cb939`](https://github.com/valbuild/val/commit/b6cb9395d8bdcd5182e9c6ba84f5284930de2fa5) Thanks [@freekh](https://github.com/freekh)! - New `s.int()` for whole numbers, `.step()` on `s.int()` and `s.number()`, and a slider for both:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
s.object({
|
|
19
|
+
columns: s.int().min(1).max(6),
|
|
20
|
+
opacity: s
|
|
21
|
+
.int()
|
|
22
|
+
.min(0)
|
|
23
|
+
.max(100)
|
|
24
|
+
.step(5)
|
|
25
|
+
.render({ as: "slider", min: 0, max: 100 }),
|
|
26
|
+
lineHeight: s.number().render({ as: "slider", min: 1, max: 2, step: 0.1 }),
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- `.min()`, `.max()` and `.step()` are rules the validator checks. A step is counted from `min`, or from 0 when there is none.
|
|
31
|
+
- `.render({ as: "slider", min, max, step? })` is how the field is edited: a slider, with a box beside it for typing an exact value. `min` and `max` are required. The slider's step defaults to the schema's `.step()`, then to 1.
|
|
32
|
+
- The slider can only produce values the schema accepts. A slider outside `.min()`/`.max()`, with a step that is not a multiple of `.step()`, or with decimals on an `s.int()` throws where the schema is defined.
|
|
33
|
+
- A value outside the slider's range is still valid content. The field says it is out of the slider's reach and offers "Set to" the nearest stop. A value that breaks a rule offers "Round to" the nearest allowed value.
|
|
34
|
+
- Fixed: `.min(0)` and `.max(0)` on `s.number()` were ignored.
|
|
35
|
+
- A new item of a number schema starts at the nearest allowed value instead of `0`, so `s.int().min(1)` starts at 1.
|
|
36
|
+
|
|
37
|
+
- Updated dependencies [[`b6cb939`](https://github.com/valbuild/val/commit/b6cb9395d8bdcd5182e9c6ba84f5284930de2fa5)]:
|
|
38
|
+
- @valbuild/core@0.145.0
|
|
39
|
+
|
|
3
40
|
## 0.144.9
|
|
4
41
|
|
|
5
42
|
### Patch Changes
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { VAL_SESSION_COOKIE, VAL_STATE_COOKIE } from "./server/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Why Val Build refused a write for the project's plan, as data: the `error` of
|
|
5
|
+
* its 403 (`refusalError` in valbuild/home's `billing/projectLimits.ts`).
|
|
6
|
+
*
|
|
7
|
+
* Every field but `code` is optional and every field is a plain string, so a
|
|
8
|
+
* newer Val Build that adds a code or a fix still parses: the Studio says an
|
|
9
|
+
* unknown one with Billing beside it rather than failing to read the answer.
|
|
10
|
+
*/
|
|
11
|
+
export declare const PlanRefusalError: z.ZodObject<{
|
|
12
|
+
code: z.ZodString;
|
|
13
|
+
fix: z.ZodOptional<z.ZodString>;
|
|
14
|
+
until: z.ZodOptional<z.ZodString>;
|
|
15
|
+
billingUrl: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type PlanRefusalErrorT = z.infer<typeof PlanRefusalError>;
|
|
4
18
|
/**
|
|
5
19
|
* The header a request to `/admin/proxy` must carry. A cross-site form or
|
|
6
20
|
* `<img>` cannot set a custom header, so without it the proxy cannot be driven
|
|
@@ -19,7 +33,7 @@ export declare const PatchGroup: z.ZodObject<{
|
|
|
19
33
|
authorId: z.ZodNullable<z.ZodString>;
|
|
20
34
|
createdAt: z.ZodString;
|
|
21
35
|
publishedAt: z.ZodNullable<z.ZodString>;
|
|
22
|
-
patchIds: z.ZodArray<z.ZodString & z.ZodType<
|
|
36
|
+
patchIds: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
23
37
|
}, z.core.$strip>;
|
|
24
38
|
export type PatchGroupT = z.infer<typeof PatchGroup>;
|
|
25
39
|
declare const cookies: z.ZodUnion<readonly [z.ZodLiteral<"val_session">, z.ZodLiteral<"val_enable">, z.ZodLiteral<"val_state">]>;
|
|
@@ -54,7 +68,7 @@ export declare const Api: {
|
|
|
54
68
|
redirect_to: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>>>;
|
|
55
69
|
};
|
|
56
70
|
cookies: {
|
|
57
|
-
|
|
71
|
+
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
58
72
|
};
|
|
59
73
|
};
|
|
60
74
|
res: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -80,7 +94,7 @@ export declare const Api: {
|
|
|
80
94
|
redirect_to: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>>>;
|
|
81
95
|
};
|
|
82
96
|
cookies: {
|
|
83
|
-
|
|
97
|
+
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
84
98
|
};
|
|
85
99
|
};
|
|
86
100
|
res: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -103,7 +117,7 @@ export declare const Api: {
|
|
|
103
117
|
GET: {
|
|
104
118
|
req: {
|
|
105
119
|
cookies: {
|
|
106
|
-
|
|
120
|
+
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
107
121
|
};
|
|
108
122
|
};
|
|
109
123
|
res: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -126,7 +140,7 @@ export declare const Api: {
|
|
|
126
140
|
redirect_to: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>>>;
|
|
127
141
|
};
|
|
128
142
|
cookies: {
|
|
129
|
-
|
|
143
|
+
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
130
144
|
};
|
|
131
145
|
};
|
|
132
146
|
res: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -138,14 +152,13 @@ export declare const Api: {
|
|
|
138
152
|
status: z.ZodLiteral<302>;
|
|
139
153
|
redirectTo: z.ZodString;
|
|
140
154
|
cookies: z.ZodObject<{
|
|
141
|
-
|
|
155
|
+
[x: number]: z.ZodObject<{
|
|
142
156
|
value: z.ZodLiteral<"true">;
|
|
143
157
|
options: z.ZodObject<{
|
|
144
158
|
httpOnly: z.ZodLiteral<false>;
|
|
145
159
|
sameSite: z.ZodLiteral<"lax">;
|
|
146
160
|
}, z.core.$strip>;
|
|
147
|
-
}, z.core.$strip
|
|
148
|
-
val_state: z.ZodObject<{
|
|
161
|
+
}, z.core.$strip> | z.ZodObject<{
|
|
149
162
|
value: z.ZodString;
|
|
150
163
|
options: z.ZodObject<{
|
|
151
164
|
httpOnly: z.ZodLiteral<true>;
|
|
@@ -158,7 +171,7 @@ export declare const Api: {
|
|
|
158
171
|
status: z.ZodLiteral<302>;
|
|
159
172
|
redirectTo: z.ZodString;
|
|
160
173
|
cookies: z.ZodObject<{
|
|
161
|
-
|
|
174
|
+
[x: number]: z.ZodObject<{
|
|
162
175
|
value: z.ZodLiteral<"true">;
|
|
163
176
|
options: z.ZodObject<{
|
|
164
177
|
httpOnly: z.ZodLiteral<false>;
|
|
@@ -181,7 +194,7 @@ export declare const Api: {
|
|
|
181
194
|
redirect_to: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>>>;
|
|
182
195
|
};
|
|
183
196
|
cookies: {
|
|
184
|
-
|
|
197
|
+
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
185
198
|
};
|
|
186
199
|
};
|
|
187
200
|
res: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -193,7 +206,7 @@ export declare const Api: {
|
|
|
193
206
|
status: z.ZodLiteral<302>;
|
|
194
207
|
redirectTo: z.ZodString;
|
|
195
208
|
cookies: z.ZodObject<{
|
|
196
|
-
|
|
209
|
+
[x: number]: z.ZodObject<{
|
|
197
210
|
value: z.ZodLiteral<"false">;
|
|
198
211
|
}, z.core.$strip>;
|
|
199
212
|
}, z.core.$strip>;
|
|
@@ -216,14 +229,13 @@ export declare const Api: {
|
|
|
216
229
|
status: z.ZodLiteral<302>;
|
|
217
230
|
redirectTo: z.ZodString;
|
|
218
231
|
cookies: z.ZodObject<{
|
|
219
|
-
|
|
232
|
+
[x: number]: z.ZodObject<{
|
|
220
233
|
value: z.ZodLiteral<"true">;
|
|
221
234
|
options: z.ZodObject<{
|
|
222
235
|
httpOnly: z.ZodLiteral<false>;
|
|
223
236
|
sameSite: z.ZodLiteral<"lax">;
|
|
224
237
|
}, z.core.$strip>;
|
|
225
|
-
}, z.core.$strip
|
|
226
|
-
val_state: z.ZodObject<{
|
|
238
|
+
}, z.core.$strip> | z.ZodObject<{
|
|
227
239
|
value: z.ZodString;
|
|
228
240
|
options: z.ZodObject<{
|
|
229
241
|
httpOnly: z.ZodLiteral<true>;
|
|
@@ -248,24 +260,22 @@ export declare const Api: {
|
|
|
248
260
|
state: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>>>;
|
|
249
261
|
};
|
|
250
262
|
cookies: {
|
|
251
|
-
|
|
263
|
+
[VAL_STATE_COOKIE]: z.ZodString;
|
|
252
264
|
};
|
|
253
265
|
};
|
|
254
266
|
res: z.ZodObject<{
|
|
255
267
|
status: z.ZodLiteral<302>;
|
|
256
268
|
redirectTo: z.ZodString;
|
|
257
269
|
cookies: z.ZodObject<{
|
|
258
|
-
|
|
270
|
+
[x: number]: z.ZodObject<{
|
|
259
271
|
value: z.ZodLiteral<null>;
|
|
260
|
-
}, z.core.$strip
|
|
261
|
-
val_enable: z.ZodOptional<z.ZodObject<{
|
|
272
|
+
}, z.core.$strip> | z.ZodOptional<z.ZodObject<{
|
|
262
273
|
value: z.ZodLiteral<"true">;
|
|
263
274
|
options: z.ZodObject<{
|
|
264
275
|
httpOnly: z.ZodLiteral<false>;
|
|
265
276
|
sameSite: z.ZodLiteral<"lax">;
|
|
266
277
|
}, z.core.$strip>;
|
|
267
|
-
}, z.core.$strip
|
|
268
|
-
val_session: z.ZodOptional<z.ZodObject<{
|
|
278
|
+
}, z.core.$strip>> | z.ZodOptional<z.ZodObject<{
|
|
269
279
|
value: z.ZodString;
|
|
270
280
|
options: z.ZodOptional<z.ZodObject<{
|
|
271
281
|
httpOnly: z.ZodLiteral<true>;
|
|
@@ -289,17 +299,7 @@ export declare const Api: {
|
|
|
289
299
|
res: z.ZodUnion<readonly [z.ZodObject<{
|
|
290
300
|
status: z.ZodLiteral<200>;
|
|
291
301
|
cookies: z.ZodObject<{
|
|
292
|
-
|
|
293
|
-
value: z.ZodString;
|
|
294
|
-
options: z.ZodOptional<z.ZodObject<{
|
|
295
|
-
httpOnly: z.ZodLiteral<true>;
|
|
296
|
-
sameSite: z.ZodLiteral<"strict">;
|
|
297
|
-
path: z.ZodString;
|
|
298
|
-
secure: z.ZodLiteral<true>;
|
|
299
|
-
expires: z.ZodCustom<Date, Date>;
|
|
300
|
-
}, z.core.$strip>>;
|
|
301
|
-
}, z.core.$strip>>;
|
|
302
|
-
val_state: z.ZodOptional<z.ZodObject<{
|
|
302
|
+
[x: number]: z.ZodOptional<z.ZodObject<{
|
|
303
303
|
value: z.ZodString;
|
|
304
304
|
options: z.ZodOptional<z.ZodObject<{
|
|
305
305
|
httpOnly: z.ZodLiteral<true>;
|
|
@@ -314,17 +314,7 @@ export declare const Api: {
|
|
|
314
314
|
status: z.ZodLiteral<302>;
|
|
315
315
|
redirectTo: z.ZodString;
|
|
316
316
|
cookies: z.ZodObject<{
|
|
317
|
-
|
|
318
|
-
value: z.ZodString;
|
|
319
|
-
options: z.ZodOptional<z.ZodObject<{
|
|
320
|
-
httpOnly: z.ZodLiteral<true>;
|
|
321
|
-
sameSite: z.ZodLiteral<"strict">;
|
|
322
|
-
path: z.ZodString;
|
|
323
|
-
secure: z.ZodLiteral<true>;
|
|
324
|
-
expires: z.ZodCustom<Date, Date>;
|
|
325
|
-
}, z.core.$strip>>;
|
|
326
|
-
}, z.core.$strip>>;
|
|
327
|
-
val_state: z.ZodOptional<z.ZodObject<{
|
|
317
|
+
[x: number]: z.ZodOptional<z.ZodObject<{
|
|
328
318
|
value: z.ZodString;
|
|
329
319
|
options: z.ZodOptional<z.ZodObject<{
|
|
330
320
|
httpOnly: z.ZodLiteral<true>;
|
|
@@ -410,13 +400,13 @@ export declare const Api: {
|
|
|
410
400
|
baseSha: z.ZodString;
|
|
411
401
|
schemaSha: z.ZodString;
|
|
412
402
|
sourcesSha: z.ZodString;
|
|
413
|
-
patches: z.ZodArray<z.ZodString & z.ZodType<
|
|
414
|
-
appliedPatches: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<
|
|
415
|
-
publishingPatches: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<
|
|
416
|
-
heldBackPatches: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<
|
|
403
|
+
patches: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
404
|
+
appliedPatches: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>>;
|
|
405
|
+
publishingPatches: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>>;
|
|
406
|
+
heldBackPatches: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>>;
|
|
417
407
|
headCommitSha: z.ZodOptional<z.ZodString>;
|
|
418
408
|
removed: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
419
|
-
patchId: z.ZodString & z.ZodType<
|
|
409
|
+
patchId: z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>;
|
|
420
410
|
reason: z.ZodString;
|
|
421
411
|
}, z.core.$strip>>>;
|
|
422
412
|
config: z.ZodObject<{
|
|
@@ -450,19 +440,19 @@ export declare const Api: {
|
|
|
450
440
|
schemaSha: z.ZodString;
|
|
451
441
|
sourcesSha: z.ZodString;
|
|
452
442
|
commitSha: z.ZodOptional<z.ZodString>;
|
|
453
|
-
patches: z.ZodArray<z.ZodString & z.ZodType<
|
|
454
|
-
appliedPatches: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<
|
|
455
|
-
publishingPatches: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<
|
|
456
|
-
heldBackPatches: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<
|
|
443
|
+
patches: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
444
|
+
appliedPatches: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>>;
|
|
445
|
+
publishingPatches: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>>;
|
|
446
|
+
heldBackPatches: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>>;
|
|
457
447
|
headCommitSha: z.ZodOptional<z.ZodString>;
|
|
458
|
-
headPatchId: z.ZodOptional<z.ZodNullable<z.ZodString & z.ZodType<
|
|
448
|
+
headPatchId: z.ZodOptional<z.ZodNullable<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>>;
|
|
459
449
|
headVersion: z.ZodOptional<z.ZodNumber>;
|
|
460
450
|
patchGroups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
461
451
|
patchGroupId: z.ZodString;
|
|
462
452
|
authorId: z.ZodNullable<z.ZodString>;
|
|
463
453
|
createdAt: z.ZodString;
|
|
464
454
|
publishedAt: z.ZodNullable<z.ZodString>;
|
|
465
|
-
patchIds: z.ZodArray<z.ZodString & z.ZodType<
|
|
455
|
+
patchIds: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
466
456
|
}, z.core.$strip>>>;
|
|
467
457
|
commits: z.ZodArray<z.ZodObject<{
|
|
468
458
|
commitSha: z.ZodString;
|
|
@@ -628,7 +618,7 @@ export declare const Api: {
|
|
|
628
618
|
headBaseSha: z.ZodString;
|
|
629
619
|
}, z.core.$strip>, z.ZodObject<{
|
|
630
620
|
type: z.ZodLiteral<"patch">;
|
|
631
|
-
patchId: z.ZodString & z.ZodType<
|
|
621
|
+
patchId: z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>;
|
|
632
622
|
}, z.core.$strip>]>;
|
|
633
623
|
filePath: z.ZodString;
|
|
634
624
|
data: z.ZodAny;
|
|
@@ -646,7 +636,7 @@ export declare const Api: {
|
|
|
646
636
|
status: z.ZodLiteral<200>;
|
|
647
637
|
json: z.ZodObject<{
|
|
648
638
|
filePath: z.ZodString;
|
|
649
|
-
patchId: z.ZodString & z.ZodType<
|
|
639
|
+
patchId: z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>;
|
|
650
640
|
}, z.core.$strip>;
|
|
651
641
|
}, z.core.$strip>]>;
|
|
652
642
|
};
|
|
@@ -737,10 +727,10 @@ export declare const Api: {
|
|
|
737
727
|
DELETE: {
|
|
738
728
|
req: {
|
|
739
729
|
query: {
|
|
740
|
-
id: z.ZodArray<z.ZodString & z.ZodType<
|
|
730
|
+
id: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
741
731
|
};
|
|
742
732
|
body: z.ZodOptional<z.ZodObject<{
|
|
743
|
-
unstagePatchIds: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<
|
|
733
|
+
unstagePatchIds: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>>;
|
|
744
734
|
reportHeadVersion: z.ZodOptional<z.ZodLiteral<true>>;
|
|
745
735
|
}, z.core.$strip>>;
|
|
746
736
|
cookies: {
|
|
@@ -757,7 +747,7 @@ export declare const Api: {
|
|
|
757
747
|
json: z.ZodObject<{
|
|
758
748
|
message: z.ZodString;
|
|
759
749
|
errors: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
760
|
-
patchId: z.ZodString & z.ZodType<
|
|
750
|
+
patchId: z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>;
|
|
761
751
|
message: z.ZodString;
|
|
762
752
|
publishJobId: z.ZodOptional<z.ZodString>;
|
|
763
753
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -767,8 +757,8 @@ export declare const Api: {
|
|
|
767
757
|
}, z.core.$strip>;
|
|
768
758
|
}, z.core.$strip>, z.ZodObject<{
|
|
769
759
|
status: z.ZodLiteral<200>;
|
|
770
|
-
json: z.ZodUnion<readonly [z.ZodArray<z.ZodString & z.ZodType<
|
|
771
|
-
deleted: z.ZodArray<z.ZodString & z.ZodType<
|
|
760
|
+
json: z.ZodUnion<readonly [z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>, z.ZodObject<{
|
|
761
|
+
deleted: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
772
762
|
headVersion: z.ZodOptional<z.ZodNumber>;
|
|
773
763
|
}, z.core.$strip>]>;
|
|
774
764
|
}, z.core.$strip>]>;
|
|
@@ -781,16 +771,16 @@ export declare const Api: {
|
|
|
781
771
|
headBaseSha: z.ZodString;
|
|
782
772
|
}, z.core.$strip>, z.ZodObject<{
|
|
783
773
|
type: z.ZodLiteral<"patch">;
|
|
784
|
-
patchId: z.ZodString & z.ZodType<
|
|
774
|
+
patchId: z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>;
|
|
785
775
|
}, z.core.$strip>]>;
|
|
786
776
|
sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
787
777
|
patches: z.ZodArray<z.ZodObject<{
|
|
788
778
|
path: z.ZodString & z.ZodType<ModuleFilePath, string, z.core.$ZodTypeInternals<ModuleFilePath, string>>;
|
|
789
|
-
patchId: z.ZodString & z.ZodType<
|
|
779
|
+
patchId: z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>;
|
|
790
780
|
patch: z.ZodAny;
|
|
791
781
|
}, z.core.$strip>>;
|
|
792
782
|
patchGroupId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
793
|
-
withPatchIds: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<
|
|
783
|
+
withPatchIds: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>>;
|
|
794
784
|
}, z.core.$strip>;
|
|
795
785
|
cookies: {
|
|
796
786
|
val_session: z.ZodOptional<z.ZodString>;
|
|
@@ -818,16 +808,38 @@ export declare const Api: {
|
|
|
818
808
|
}, z.core.$strip>;
|
|
819
809
|
}, z.core.$strip>>>;
|
|
820
810
|
}, z.core.$strip>;
|
|
811
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
812
|
+
status: z.ZodLiteral<403>;
|
|
813
|
+
json: z.ZodObject<{
|
|
814
|
+
type: z.ZodLiteral<"plan-refused">;
|
|
815
|
+
message: z.ZodString;
|
|
816
|
+
error: z.ZodObject<{
|
|
817
|
+
code: z.ZodString;
|
|
818
|
+
fix: z.ZodOptional<z.ZodString>;
|
|
819
|
+
until: z.ZodOptional<z.ZodString>;
|
|
820
|
+
billingUrl: z.ZodOptional<z.ZodString>;
|
|
821
|
+
}, z.core.$strip>;
|
|
822
|
+
newPatchIds: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
823
|
+
parentRef: z.ZodUnion<readonly [z.ZodObject<{
|
|
824
|
+
type: z.ZodLiteral<"head">;
|
|
825
|
+
headBaseSha: z.ZodString;
|
|
826
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
827
|
+
type: z.ZodLiteral<"patch">;
|
|
828
|
+
patchId: z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>;
|
|
829
|
+
}, z.core.$strip>]>;
|
|
830
|
+
patchGroupId: z.ZodOptional<z.ZodString>;
|
|
831
|
+
headVersion: z.ZodOptional<z.ZodNumber>;
|
|
832
|
+
}, z.core.$strip>;
|
|
821
833
|
}, z.core.$strip>, z.ZodObject<{
|
|
822
834
|
status: z.ZodLiteral<200>;
|
|
823
835
|
json: z.ZodObject<{
|
|
824
|
-
newPatchIds: z.ZodArray<z.ZodString & z.ZodType<
|
|
836
|
+
newPatchIds: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
825
837
|
parentRef: z.ZodUnion<readonly [z.ZodObject<{
|
|
826
838
|
type: z.ZodLiteral<"head">;
|
|
827
839
|
headBaseSha: z.ZodString;
|
|
828
840
|
}, z.core.$strip>, z.ZodObject<{
|
|
829
841
|
type: z.ZodLiteral<"patch">;
|
|
830
|
-
patchId: z.ZodString & z.ZodType<
|
|
842
|
+
patchId: z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>;
|
|
831
843
|
}, z.core.$strip>]>;
|
|
832
844
|
patchGroupId: z.ZodOptional<z.ZodString>;
|
|
833
845
|
headVersion: z.ZodOptional<z.ZodNumber>;
|
|
@@ -837,7 +849,7 @@ export declare const Api: {
|
|
|
837
849
|
GET: {
|
|
838
850
|
req: {
|
|
839
851
|
query: {
|
|
840
|
-
patch_id: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<
|
|
852
|
+
patch_id: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>>;
|
|
841
853
|
exclude_patch_ops: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>> & z.ZodType<"true" | "false", string[], z.core.$ZodTypeInternals<"true" | "false", string[]>>, z.ZodTransform<boolean, "true" | "false">>>;
|
|
842
854
|
/**
|
|
843
855
|
* Include the patch group annotation in the answer.
|
|
@@ -863,7 +875,7 @@ export declare const Api: {
|
|
|
863
875
|
json: z.ZodObject<{
|
|
864
876
|
message: z.ZodString;
|
|
865
877
|
patchErrors: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
866
|
-
patchId: z.ZodString & z.ZodType<
|
|
878
|
+
patchId: z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>;
|
|
867
879
|
message: z.ZodString;
|
|
868
880
|
publishJobId: z.ZodOptional<z.ZodString>;
|
|
869
881
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -916,7 +928,7 @@ export declare const Api: {
|
|
|
916
928
|
nestedFilePath: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
917
929
|
metadata: z.ZodOptional<z.ZodType<JSONValueT, unknown, z.core.$ZodTypeInternals<JSONValueT, unknown>>>;
|
|
918
930
|
}, z.core.$strict>], "op">>>;
|
|
919
|
-
patchId: z.ZodString & z.ZodType<
|
|
931
|
+
patchId: z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>;
|
|
920
932
|
createdAt: z.ZodString;
|
|
921
933
|
authorId: z.ZodNullable<z.ZodString>;
|
|
922
934
|
appliedAt: z.ZodNullable<z.ZodObject<{
|
|
@@ -929,13 +941,13 @@ export declare const Api: {
|
|
|
929
941
|
authorId: z.ZodNullable<z.ZodString>;
|
|
930
942
|
createdAt: z.ZodString;
|
|
931
943
|
publishedAt: z.ZodNullable<z.ZodString>;
|
|
932
|
-
patchIds: z.ZodArray<z.ZodString & z.ZodType<
|
|
944
|
+
patchIds: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
933
945
|
}, z.core.$strip>>>;
|
|
934
946
|
baseSha: z.ZodString;
|
|
935
947
|
error: z.ZodOptional<z.ZodObject<{
|
|
936
948
|
message: z.ZodString;
|
|
937
949
|
}, z.core.$strip>>;
|
|
938
|
-
errors: z.ZodOptional<z.ZodRecord<z.ZodString & z.ZodType<
|
|
950
|
+
errors: z.ZodOptional<z.ZodRecord<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>, z.ZodObject<{
|
|
939
951
|
message: z.ZodString;
|
|
940
952
|
}, z.core.$strip>>>;
|
|
941
953
|
}, z.core.$strip>;
|
|
@@ -947,8 +959,8 @@ export declare const Api: {
|
|
|
947
959
|
req: {
|
|
948
960
|
body: z.ZodObject<{
|
|
949
961
|
patchGroupId: z.ZodOptional<z.ZodString>;
|
|
950
|
-
patchIds: z.ZodArray<z.ZodString & z.ZodType<
|
|
951
|
-
withPatchIds: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<
|
|
962
|
+
patchIds: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
963
|
+
withPatchIds: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>>;
|
|
952
964
|
}, z.core.$strip>;
|
|
953
965
|
cookies: {
|
|
954
966
|
val_session: z.ZodOptional<z.ZodString>;
|
|
@@ -978,7 +990,7 @@ export declare const Api: {
|
|
|
978
990
|
status: z.ZodLiteral<200>;
|
|
979
991
|
json: z.ZodObject<{
|
|
980
992
|
patchGroupId: z.ZodNullable<z.ZodString>;
|
|
981
|
-
patchIds: z.ZodArray<z.ZodString & z.ZodType<
|
|
993
|
+
patchIds: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
982
994
|
headVersion: z.ZodOptional<z.ZodNumber>;
|
|
983
995
|
}, z.core.$strip>;
|
|
984
996
|
}, z.core.$strip>]>;
|
|
@@ -987,8 +999,8 @@ export declare const Api: {
|
|
|
987
999
|
req: {
|
|
988
1000
|
body: z.ZodObject<{
|
|
989
1001
|
patchGroupId: z.ZodOptional<z.ZodString>;
|
|
990
|
-
patchIds: z.ZodArray<z.ZodString & z.ZodType<
|
|
991
|
-
withPatchIds: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<
|
|
1002
|
+
patchIds: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
1003
|
+
withPatchIds: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>>;
|
|
992
1004
|
}, z.core.$strip>;
|
|
993
1005
|
cookies: {
|
|
994
1006
|
val_session: z.ZodOptional<z.ZodString>;
|
|
@@ -1018,7 +1030,7 @@ export declare const Api: {
|
|
|
1018
1030
|
status: z.ZodLiteral<200>;
|
|
1019
1031
|
json: z.ZodObject<{
|
|
1020
1032
|
patchGroupId: z.ZodNullable<z.ZodString>;
|
|
1021
|
-
patchIds: z.ZodArray<z.ZodString & z.ZodType<
|
|
1033
|
+
patchIds: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
1022
1034
|
headVersion: z.ZodOptional<z.ZodNumber>;
|
|
1023
1035
|
}, z.core.$strip>;
|
|
1024
1036
|
}, z.core.$strip>]>;
|
|
@@ -1084,7 +1096,7 @@ export declare const Api: {
|
|
|
1084
1096
|
* answer and is honoured as one: a group holding nothing renders
|
|
1085
1097
|
* base.
|
|
1086
1098
|
*/
|
|
1087
|
-
patch_id: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<
|
|
1099
|
+
patch_id: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>>;
|
|
1088
1100
|
/**
|
|
1089
1101
|
* Apply only the patches in the CALLER'S OWN patch groups.
|
|
1090
1102
|
*
|
|
@@ -1148,9 +1160,9 @@ export declare const Api: {
|
|
|
1148
1160
|
source: z.ZodOptional<z.ZodAny>;
|
|
1149
1161
|
baseSource: z.ZodOptional<z.ZodAny>;
|
|
1150
1162
|
patches: z.ZodOptional<z.ZodObject<{
|
|
1151
|
-
applied: z.ZodArray<z.ZodString & z.ZodType<
|
|
1152
|
-
skipped: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<
|
|
1153
|
-
errors: z.ZodOptional<z.ZodRecord<z.ZodString & z.ZodType<
|
|
1163
|
+
applied: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
1164
|
+
skipped: z.ZodOptional<z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>>;
|
|
1165
|
+
errors: z.ZodOptional<z.ZodRecord<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>, z.ZodObject<{
|
|
1154
1166
|
message: z.ZodString;
|
|
1155
1167
|
}, z.core.$strip>>>;
|
|
1156
1168
|
}, z.core.$strip>>;
|
|
@@ -1171,7 +1183,7 @@ export declare const Api: {
|
|
|
1171
1183
|
body: z.ZodObject<{
|
|
1172
1184
|
jobId: z.ZodString;
|
|
1173
1185
|
tab: z.ZodString;
|
|
1174
|
-
patchIds: z.ZodArray<z.ZodString & z.ZodType<
|
|
1186
|
+
patchIds: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
1175
1187
|
}, z.core.$strip>;
|
|
1176
1188
|
cookies: {
|
|
1177
1189
|
val_session: z.ZodOptional<z.ZodString>;
|
|
@@ -1293,7 +1305,7 @@ export declare const Api: {
|
|
|
1293
1305
|
req: {
|
|
1294
1306
|
body: z.ZodObject<{
|
|
1295
1307
|
message: z.ZodOptional<z.ZodString>;
|
|
1296
|
-
patchIds: z.ZodArray<z.ZodString & z.ZodType<
|
|
1308
|
+
patchIds: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
1297
1309
|
patchGroupId: z.ZodOptional<z.ZodString>;
|
|
1298
1310
|
expectedHeadCommitSha: z.ZodOptional<z.ZodString>;
|
|
1299
1311
|
}, z.core.$strip>;
|
|
@@ -1315,7 +1327,7 @@ export declare const Api: {
|
|
|
1315
1327
|
branch: z.ZodOptional<z.ZodString>;
|
|
1316
1328
|
binaryFilesUnread: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1317
1329
|
removed: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1318
|
-
patchId: z.ZodString & z.ZodType<
|
|
1330
|
+
patchId: z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>;
|
|
1319
1331
|
moduleFilePath: z.ZodString & z.ZodType<ModuleFilePath, string, z.core.$ZodTypeInternals<ModuleFilePath, string>>;
|
|
1320
1332
|
message: z.ZodString;
|
|
1321
1333
|
}, z.core.$strip>>>;
|
|
@@ -1362,7 +1374,7 @@ export declare const Api: {
|
|
|
1362
1374
|
binaryFilePatchErrors: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1363
1375
|
message: z.ZodString;
|
|
1364
1376
|
}, z.core.$strip>>;
|
|
1365
|
-
unappliablePatches: z.ZodOptional<z.ZodRecord<z.ZodString & z.ZodType<
|
|
1377
|
+
unappliablePatches: z.ZodOptional<z.ZodRecord<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>, z.ZodObject<{
|
|
1366
1378
|
moduleFilePath: z.ZodString & z.ZodType<ModuleFilePath, string, z.core.$ZodTypeInternals<ModuleFilePath, string>>;
|
|
1367
1379
|
message: z.ZodString;
|
|
1368
1380
|
}, z.core.$strip>>>;
|
|
@@ -1490,7 +1502,7 @@ export declare const Api: {
|
|
|
1490
1502
|
modules: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1491
1503
|
source: z.ZodNullable<z.ZodType<JSONValueT, unknown, z.core.$ZodTypeInternals<JSONValueT, unknown>>>;
|
|
1492
1504
|
schema: z.ZodNullable<z.ZodType<SerializedSchemaT, unknown, z.core.$ZodTypeInternals<SerializedSchemaT, unknown>>>;
|
|
1493
|
-
patchIds: z.ZodArray<z.ZodString & z.ZodType<
|
|
1505
|
+
patchIds: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
1494
1506
|
changedPaths: z.ZodArray<z.ZodString>;
|
|
1495
1507
|
failures: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1496
1508
|
kind: z.ZodLiteral<"commit-not-found">;
|
|
@@ -1518,7 +1530,7 @@ export declare const Api: {
|
|
|
1518
1530
|
}, z.core.$strip>], "kind">>;
|
|
1519
1531
|
}, z.core.$strip>>;
|
|
1520
1532
|
patches: z.ZodArray<z.ZodObject<{
|
|
1521
|
-
patchId: z.ZodString & z.ZodType<
|
|
1533
|
+
patchId: z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>;
|
|
1522
1534
|
moduleFilePath: z.ZodString;
|
|
1523
1535
|
patch: z.ZodUnknown;
|
|
1524
1536
|
authorId: z.ZodNullable<z.ZodString>;
|
|
@@ -1610,7 +1622,7 @@ export declare const Api: {
|
|
|
1610
1622
|
module: z.ZodNullable<z.ZodObject<{
|
|
1611
1623
|
source: z.ZodNullable<z.ZodType<JSONValueT, unknown, z.core.$ZodTypeInternals<JSONValueT, unknown>>>;
|
|
1612
1624
|
schema: z.ZodNullable<z.ZodType<SerializedSchemaT, unknown, z.core.$ZodTypeInternals<SerializedSchemaT, unknown>>>;
|
|
1613
|
-
patchIds: z.ZodArray<z.ZodString & z.ZodType<
|
|
1625
|
+
patchIds: z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>;
|
|
1614
1626
|
changedPaths: z.ZodArray<z.ZodString>;
|
|
1615
1627
|
failures: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1616
1628
|
kind: z.ZodLiteral<"commit-not-found">;
|
|
@@ -1761,11 +1773,7 @@ export declare const Api: {
|
|
|
1761
1773
|
req: {
|
|
1762
1774
|
path: z.ZodString;
|
|
1763
1775
|
query: {
|
|
1764
|
-
patch_id: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString & z.ZodType<
|
|
1765
|
-
VAL_DATA_TYPE: "PatchId";
|
|
1766
|
-
}, (string & {
|
|
1767
|
-
VAL_DATA_TYPE: "PatchId";
|
|
1768
|
-
})[]>>>;
|
|
1776
|
+
patch_id: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>>, z.ZodTransform<any, any[]>>>;
|
|
1769
1777
|
remote: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>>>;
|
|
1770
1778
|
};
|
|
1771
1779
|
headers: {
|
|
@@ -1817,7 +1825,7 @@ export declare const Api: {
|
|
|
1817
1825
|
own_patch_groups_only: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>> & z.ZodType<"true" | "false", string[], z.core.$ZodTypeInternals<"true" | "false", string[]>>, z.ZodTransform<boolean, "true" | "false">>>;
|
|
1818
1826
|
};
|
|
1819
1827
|
cookies: {
|
|
1820
|
-
|
|
1828
|
+
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
1821
1829
|
};
|
|
1822
1830
|
};
|
|
1823
1831
|
res: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -1871,7 +1879,7 @@ export declare const Api: {
|
|
|
1871
1879
|
POST: {
|
|
1872
1880
|
req: {
|
|
1873
1881
|
cookies: {
|
|
1874
|
-
|
|
1882
|
+
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
1875
1883
|
};
|
|
1876
1884
|
};
|
|
1877
1885
|
res: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -1909,7 +1917,7 @@ export declare const Api: {
|
|
|
1909
1917
|
cursor_id: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>>>;
|
|
1910
1918
|
};
|
|
1911
1919
|
cookies: {
|
|
1912
|
-
|
|
1920
|
+
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
1913
1921
|
};
|
|
1914
1922
|
};
|
|
1915
1923
|
res: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -1945,7 +1953,7 @@ export declare const Api: {
|
|
|
1945
1953
|
name: z.ZodString;
|
|
1946
1954
|
}, z.core.$strip>;
|
|
1947
1955
|
cookies: {
|
|
1948
|
-
|
|
1956
|
+
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
1949
1957
|
};
|
|
1950
1958
|
};
|
|
1951
1959
|
res: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -1974,7 +1982,7 @@ export declare const Api: {
|
|
|
1974
1982
|
cursor_id: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string, string[]>>>;
|
|
1975
1983
|
};
|
|
1976
1984
|
cookies: {
|
|
1977
|
-
|
|
1985
|
+
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
1978
1986
|
};
|
|
1979
1987
|
};
|
|
1980
1988
|
res: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -2012,13 +2020,13 @@ export declare const Api: {
|
|
|
2012
2020
|
POST: {
|
|
2013
2021
|
req: {
|
|
2014
2022
|
body: z.ZodObject<{
|
|
2015
|
-
patchId: z.ZodString & z.ZodType<
|
|
2023
|
+
patchId: z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>;
|
|
2016
2024
|
parentRef: z.ZodUnion<readonly [z.ZodObject<{
|
|
2017
2025
|
type: z.ZodLiteral<"head">;
|
|
2018
2026
|
headBaseSha: z.ZodString;
|
|
2019
2027
|
}, z.core.$strip>, z.ZodObject<{
|
|
2020
2028
|
type: z.ZodLiteral<"patch">;
|
|
2021
|
-
patchId: z.ZodString & z.ZodType<
|
|
2029
|
+
patchId: z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>;
|
|
2022
2030
|
}, z.core.$strip>]>;
|
|
2023
2031
|
files: z.ZodArray<z.ZodObject<{
|
|
2024
2032
|
filePath: z.ZodString;
|
|
@@ -2027,7 +2035,7 @@ export declare const Api: {
|
|
|
2027
2035
|
}, z.core.$strip>>;
|
|
2028
2036
|
}, z.core.$strip>;
|
|
2029
2037
|
cookies: {
|
|
2030
|
-
|
|
2038
|
+
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
2031
2039
|
};
|
|
2032
2040
|
};
|
|
2033
2041
|
res: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -2038,7 +2046,7 @@ export declare const Api: {
|
|
|
2038
2046
|
}, z.core.$strip>, z.ZodObject<{
|
|
2039
2047
|
status: z.ZodLiteral<200>;
|
|
2040
2048
|
json: z.ZodObject<{
|
|
2041
|
-
patchId: z.ZodString & z.ZodType<
|
|
2049
|
+
patchId: z.ZodString & z.ZodType<PatchIdT, string, z.core.$ZodTypeInternals<PatchIdT, string>>;
|
|
2042
2050
|
files: z.ZodArray<z.ZodObject<{
|
|
2043
2051
|
filePath: z.ZodString;
|
|
2044
2052
|
metadata: z.ZodObject<{
|
|
@@ -2073,7 +2081,7 @@ export declare const Api: {
|
|
|
2073
2081
|
contentType: z.ZodString;
|
|
2074
2082
|
}, z.core.$strip>;
|
|
2075
2083
|
cookies: {
|
|
2076
|
-
|
|
2084
|
+
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
2077
2085
|
};
|
|
2078
2086
|
};
|
|
2079
2087
|
res: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -2098,7 +2106,7 @@ export declare const Api: {
|
|
|
2098
2106
|
GET: {
|
|
2099
2107
|
req: {
|
|
2100
2108
|
cookies: {
|
|
2101
|
-
|
|
2109
|
+
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
2102
2110
|
};
|
|
2103
2111
|
};
|
|
2104
2112
|
res: z.ZodObject<{
|
|
@@ -2122,7 +2130,7 @@ export declare const Api: {
|
|
|
2122
2130
|
"x-val-studio": z.ZodOptional<z.ZodString>;
|
|
2123
2131
|
};
|
|
2124
2132
|
cookies: {
|
|
2125
|
-
|
|
2133
|
+
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
2126
2134
|
};
|
|
2127
2135
|
body: z.ZodUnknown;
|
|
2128
2136
|
};
|
|
@@ -2139,7 +2147,7 @@ export declare const Api: {
|
|
|
2139
2147
|
"x-val-studio": z.ZodOptional<z.ZodString>;
|
|
2140
2148
|
};
|
|
2141
2149
|
cookies: {
|
|
2142
|
-
|
|
2150
|
+
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
2143
2151
|
};
|
|
2144
2152
|
body: z.ZodUnknown;
|
|
2145
2153
|
};
|
|
@@ -2156,7 +2164,7 @@ export declare const Api: {
|
|
|
2156
2164
|
"x-val-studio": z.ZodOptional<z.ZodString>;
|
|
2157
2165
|
};
|
|
2158
2166
|
cookies: {
|
|
2159
|
-
|
|
2167
|
+
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
2160
2168
|
};
|
|
2161
2169
|
body: z.ZodUnknown;
|
|
2162
2170
|
};
|
|
@@ -2173,7 +2181,7 @@ export declare const Api: {
|
|
|
2173
2181
|
"x-val-studio": z.ZodOptional<z.ZodString>;
|
|
2174
2182
|
};
|
|
2175
2183
|
cookies: {
|
|
2176
|
-
|
|
2184
|
+
[VAL_SESSION_COOKIE]: z.ZodOptional<z.ZodString>;
|
|
2177
2185
|
};
|
|
2178
2186
|
body: z.ZodUnknown;
|
|
2179
2187
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Json } from "@valbuild/core";
|
|
2
|
-
export declare const VAL_SESSION_COOKIE:
|
|
3
|
-
export declare const VAL_STATE_COOKIE:
|
|
4
|
-
export declare const VAL_ENABLE_COOKIE_NAME:
|
|
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;
|
|
@@ -66,7 +66,7 @@ export type BinaryFileRef = z.infer<typeof BinaryFileRef>;
|
|
|
66
66
|
export declare const HistoricalModule: z.ZodObject<{
|
|
67
67
|
source: z.ZodNullable<z.ZodType<JSONValueT, unknown, z.core.$ZodTypeInternals<JSONValueT, unknown>>>;
|
|
68
68
|
schema: z.ZodNullable<z.ZodType<SerializedSchemaT, unknown, z.core.$ZodTypeInternals<SerializedSchemaT, unknown>>>;
|
|
69
|
-
patchIds: z.ZodArray<z.ZodString & z.ZodType<
|
|
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">;
|
|
@@ -111,7 +111,7 @@ export declare const HistoricalPatchSet: z.ZodObject<{
|
|
|
111
111
|
modules: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
112
112
|
source: z.ZodNullable<z.ZodType<JSONValueT, unknown, z.core.$ZodTypeInternals<JSONValueT, unknown>>>;
|
|
113
113
|
schema: z.ZodNullable<z.ZodType<SerializedSchemaT, unknown, z.core.$ZodTypeInternals<SerializedSchemaT, unknown>>>;
|
|
114
|
-
patchIds: z.ZodArray<z.ZodString & z.ZodType<
|
|
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<
|
|
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.
|
|
@@ -83,7 +83,7 @@ export declare const SerializedSettingsSchema: z.ZodType<SerializedSettingsSchem
|
|
|
83
83
|
*/
|
|
84
84
|
export declare const SerializedValViewSchema: z.ZodObject<{
|
|
85
85
|
type: z.ZodLiteral<"view">;
|
|
86
|
-
moduleFilePath: z.ZodType<
|
|
86
|
+
moduleFilePath: z.ZodType<ModuleFilePathT, unknown, z.core.$ZodTypeInternals<ModuleFilePathT, unknown>>;
|
|
87
87
|
opt: z.ZodLiteral<false>;
|
|
88
88
|
readonly: z.ZodOptional<z.ZodBoolean>;
|
|
89
89
|
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1086,8 +1086,8 @@ var _excluded = ["directory"];
|
|
|
1086
1086
|
|
|
1087
1087
|
// A render is static config, so unlike a `preview` it travels WHOLE — this
|
|
1088
1088
|
// is the field the editor reads the layout from. See `core/src/render.ts`.
|
|
1089
|
-
//
|
|
1090
|
-
//
|
|
1089
|
+
// Array, record and keyOf carry `{ as: "inline" }`; number carries
|
|
1090
|
+
// `{ as: "slider", ... }`. A stale `render` on any other schema is stripped here, harmlessly.
|
|
1091
1091
|
// NB: these z.objects STRIP unknown keys, so a render variant that is not
|
|
1092
1092
|
// declared here is silently dropped in transit — add it here when it is added
|
|
1093
1093
|
// to `render.ts`.
|
|
@@ -1095,6 +1095,13 @@ var InlineRender = zod.z.object({
|
|
|
1095
1095
|
as: zod.z.literal("inline")
|
|
1096
1096
|
});
|
|
1097
1097
|
var FieldRender = InlineRender.optional();
|
|
1098
|
+
// The other render, and the only one a leaf takes: `s.number()` / `s.int()`.
|
|
1099
|
+
var NumberRender = zod.z.object({
|
|
1100
|
+
as: zod.z.literal("slider"),
|
|
1101
|
+
min: zod.z.number(),
|
|
1102
|
+
max: zod.z.number(),
|
|
1103
|
+
step: zod.z.number().optional()
|
|
1104
|
+
}).optional();
|
|
1098
1105
|
|
|
1099
1106
|
/**
|
|
1100
1107
|
* The fields EVERY serialized schema carries, in one place.
|
|
@@ -1154,8 +1161,11 @@ var SerializedNumberSchema = zod.z.object(getSitemapTree._objectSpread2(getSitem
|
|
|
1154
1161
|
type: zod.z.literal("number"),
|
|
1155
1162
|
options: zod.z.object({
|
|
1156
1163
|
max: zod.z.number().optional(),
|
|
1157
|
-
min: zod.z.number().optional()
|
|
1164
|
+
min: zod.z.number().optional(),
|
|
1165
|
+
integer: zod.z["boolean"]().optional(),
|
|
1166
|
+
step: zod.z.number().optional()
|
|
1158
1167
|
}).optional(),
|
|
1168
|
+
render: NumberRender,
|
|
1159
1169
|
opt: zod.z["boolean"]()
|
|
1160
1170
|
}));
|
|
1161
1171
|
var SerializedObjectSchema = zod.z.lazy(function () {
|
|
@@ -1628,7 +1638,22 @@ var notFoundResponse = zod.z.object({
|
|
|
1628
1638
|
var GenericError = zod.z.object({
|
|
1629
1639
|
message: zod.z.string()
|
|
1630
1640
|
});
|
|
1631
|
-
|
|
1641
|
+
/**
|
|
1642
|
+
* Why Val Build refused a write for the project's plan, as data: the `error` of
|
|
1643
|
+
* its 403 (`refusalError` in valbuild/home's `billing/projectLimits.ts`).
|
|
1644
|
+
*
|
|
1645
|
+
* Every field but `code` is optional and every field is a plain string, so a
|
|
1646
|
+
* newer Val Build that adds a code or a fix still parses: the Studio says an
|
|
1647
|
+
* unknown one with Billing beside it rather than failing to read the answer.
|
|
1648
|
+
*/
|
|
1649
|
+
var PlanRefusalError = zod.z.object({
|
|
1650
|
+
code: zod.z.string(),
|
|
1651
|
+
fix: zod.z.string().optional(),
|
|
1652
|
+
/** When it lifts by itself, as an ISO time, if it does. */
|
|
1653
|
+
until: zod.z.string().optional(),
|
|
1654
|
+
/** The organization's Billing in Val Build. */
|
|
1655
|
+
billingUrl: zod.z.string().optional()
|
|
1656
|
+
});
|
|
1632
1657
|
/**
|
|
1633
1658
|
* The header a request to `/admin/proxy` must carry. A cross-site form or
|
|
1634
1659
|
* `<img>` cannot set a custom header, so without it the proxy cannot be driven
|
|
@@ -2625,6 +2650,29 @@ var Api = {
|
|
|
2625
2650
|
error: GenericError
|
|
2626
2651
|
})))
|
|
2627
2652
|
})
|
|
2653
|
+
}),
|
|
2654
|
+
/*
|
|
2655
|
+
* Val Build refused the write for the project's plan: the Free week's
|
|
2656
|
+
* changes are used, or a trial is over. Not the 400 above, because the
|
|
2657
|
+
* patches are fine -- they are kept, and saved once the plan allows.
|
|
2658
|
+
* `message` is Val Build's own sentence and `error` the same as data,
|
|
2659
|
+
* so the Studio can put the fix beside it.
|
|
2660
|
+
*
|
|
2661
|
+
* The patches of the batch BEFORE the refused one were saved (the Free
|
|
2662
|
+
* week can run out mid-batch), so this carries what a 200 does about
|
|
2663
|
+
* them: the client marks those saved and keeps the rest.
|
|
2664
|
+
*/
|
|
2665
|
+
zod.z.object({
|
|
2666
|
+
status: zod.z.literal(403),
|
|
2667
|
+
json: zod.z.object({
|
|
2668
|
+
type: zod.z.literal("plan-refused"),
|
|
2669
|
+
message: zod.z.string(),
|
|
2670
|
+
error: PlanRefusalError,
|
|
2671
|
+
newPatchIds: zod.z.array(PatchId),
|
|
2672
|
+
parentRef: ParentRef,
|
|
2673
|
+
patchGroupId: zod.z.string().optional(),
|
|
2674
|
+
headVersion: zod.z.number().optional()
|
|
2675
|
+
})
|
|
2628
2676
|
}), zod.z.object({
|
|
2629
2677
|
status: zod.z.literal(200),
|
|
2630
2678
|
json: zod.z.object({
|
|
@@ -5569,7 +5617,11 @@ function emptyOf(schema, context) {
|
|
|
5569
5617
|
} else if (schema.type === "boolean") {
|
|
5570
5618
|
return false;
|
|
5571
5619
|
} else if (schema.type === "number") {
|
|
5572
|
-
|
|
5620
|
+
var _Internal$number$near, _schema$options;
|
|
5621
|
+
// 0, unless the schema rules it out: an `s.int().min(1)` starts at 1
|
|
5622
|
+
// rather than as an error. `null` means the schema allows nothing at all,
|
|
5623
|
+
// which validation will say; 0 is as good a start as any for that.
|
|
5624
|
+
return (_Internal$number$near = core.Internal.number.nearestAllowedNumber(0, (_schema$options = schema.options) !== null && _schema$options !== void 0 ? _schema$options : {})) !== null && _Internal$number$near !== void 0 ? _Internal$number$near : 0;
|
|
5573
5625
|
} else if (schema.type === "keyOf") {
|
|
5574
5626
|
if (schema.values === "string") {
|
|
5575
5627
|
return ""; // TODO: figure out this: user code might very well fail in this case
|
|
@@ -5611,14 +5663,14 @@ function emptyOf(schema, context) {
|
|
|
5611
5663
|
} else if (schema.type === "dateTime") {
|
|
5612
5664
|
return clampDateTimeString(new Date().toISOString(), schema.options);
|
|
5613
5665
|
} else if (schema.type === "color") {
|
|
5614
|
-
var _schema$options$forma, _schema$
|
|
5666
|
+
var _schema$options$forma, _schema$options2;
|
|
5615
5667
|
// Mid grey: visible against both a light and a dark canvas
|
|
5616
5668
|
return core.Internal.color.formatColor({
|
|
5617
5669
|
r: 128,
|
|
5618
5670
|
g: 128,
|
|
5619
5671
|
b: 128,
|
|
5620
5672
|
a: 1
|
|
5621
|
-
}, (_schema$options$forma = (_schema$
|
|
5673
|
+
}, (_schema$options$forma = (_schema$options2 = schema.options) === null || _schema$options2 === void 0 ? void 0 : _schema$options2.format) !== null && _schema$options$forma !== void 0 ? _schema$options$forma : core.DEFAULT_COLOR_FORMAT);
|
|
5622
5674
|
} else if (schema.type === "code") {
|
|
5623
5675
|
return ""; // An empty editor: no language has a sensible starting snippet
|
|
5624
5676
|
} else if (schema.type === "view") {
|
|
@@ -8069,6 +8121,7 @@ exports.PatchBlock = PatchBlock;
|
|
|
8069
8121
|
exports.PatchGroup = PatchGroup;
|
|
8070
8122
|
exports.PatchId = PatchId;
|
|
8071
8123
|
exports.PatchJSON = PatchJSON;
|
|
8124
|
+
exports.PlanRefusalError = PlanRefusalError;
|
|
8072
8125
|
exports.PublishProtocolError = PublishProtocolError;
|
|
8073
8126
|
exports.RAMP_STEPS = RAMP_STEPS;
|
|
8074
8127
|
exports.RemirrorBr = RemirrorBr;
|
|
@@ -1086,8 +1086,8 @@ var _excluded = ["directory"];
|
|
|
1086
1086
|
|
|
1087
1087
|
// A render is static config, so unlike a `preview` it travels WHOLE — this
|
|
1088
1088
|
// is the field the editor reads the layout from. See `core/src/render.ts`.
|
|
1089
|
-
//
|
|
1090
|
-
//
|
|
1089
|
+
// Array, record and keyOf carry `{ as: "inline" }`; number carries
|
|
1090
|
+
// `{ as: "slider", ... }`. A stale `render` on any other schema is stripped here, harmlessly.
|
|
1091
1091
|
// NB: these z.objects STRIP unknown keys, so a render variant that is not
|
|
1092
1092
|
// declared here is silently dropped in transit — add it here when it is added
|
|
1093
1093
|
// to `render.ts`.
|
|
@@ -1095,6 +1095,13 @@ var InlineRender = zod.z.object({
|
|
|
1095
1095
|
as: zod.z.literal("inline")
|
|
1096
1096
|
});
|
|
1097
1097
|
var FieldRender = InlineRender.optional();
|
|
1098
|
+
// The other render, and the only one a leaf takes: `s.number()` / `s.int()`.
|
|
1099
|
+
var NumberRender = zod.z.object({
|
|
1100
|
+
as: zod.z.literal("slider"),
|
|
1101
|
+
min: zod.z.number(),
|
|
1102
|
+
max: zod.z.number(),
|
|
1103
|
+
step: zod.z.number().optional()
|
|
1104
|
+
}).optional();
|
|
1098
1105
|
|
|
1099
1106
|
/**
|
|
1100
1107
|
* The fields EVERY serialized schema carries, in one place.
|
|
@@ -1154,8 +1161,11 @@ var SerializedNumberSchema = zod.z.object(getSitemapTree._objectSpread2(getSitem
|
|
|
1154
1161
|
type: zod.z.literal("number"),
|
|
1155
1162
|
options: zod.z.object({
|
|
1156
1163
|
max: zod.z.number().optional(),
|
|
1157
|
-
min: zod.z.number().optional()
|
|
1164
|
+
min: zod.z.number().optional(),
|
|
1165
|
+
integer: zod.z["boolean"]().optional(),
|
|
1166
|
+
step: zod.z.number().optional()
|
|
1158
1167
|
}).optional(),
|
|
1168
|
+
render: NumberRender,
|
|
1159
1169
|
opt: zod.z["boolean"]()
|
|
1160
1170
|
}));
|
|
1161
1171
|
var SerializedObjectSchema = zod.z.lazy(function () {
|
|
@@ -1628,7 +1638,22 @@ var notFoundResponse = zod.z.object({
|
|
|
1628
1638
|
var GenericError = zod.z.object({
|
|
1629
1639
|
message: zod.z.string()
|
|
1630
1640
|
});
|
|
1631
|
-
|
|
1641
|
+
/**
|
|
1642
|
+
* Why Val Build refused a write for the project's plan, as data: the `error` of
|
|
1643
|
+
* its 403 (`refusalError` in valbuild/home's `billing/projectLimits.ts`).
|
|
1644
|
+
*
|
|
1645
|
+
* Every field but `code` is optional and every field is a plain string, so a
|
|
1646
|
+
* newer Val Build that adds a code or a fix still parses: the Studio says an
|
|
1647
|
+
* unknown one with Billing beside it rather than failing to read the answer.
|
|
1648
|
+
*/
|
|
1649
|
+
var PlanRefusalError = zod.z.object({
|
|
1650
|
+
code: zod.z.string(),
|
|
1651
|
+
fix: zod.z.string().optional(),
|
|
1652
|
+
/** When it lifts by itself, as an ISO time, if it does. */
|
|
1653
|
+
until: zod.z.string().optional(),
|
|
1654
|
+
/** The organization's Billing in Val Build. */
|
|
1655
|
+
billingUrl: zod.z.string().optional()
|
|
1656
|
+
});
|
|
1632
1657
|
/**
|
|
1633
1658
|
* The header a request to `/admin/proxy` must carry. A cross-site form or
|
|
1634
1659
|
* `<img>` cannot set a custom header, so without it the proxy cannot be driven
|
|
@@ -2625,6 +2650,29 @@ var Api = {
|
|
|
2625
2650
|
error: GenericError
|
|
2626
2651
|
})))
|
|
2627
2652
|
})
|
|
2653
|
+
}),
|
|
2654
|
+
/*
|
|
2655
|
+
* Val Build refused the write for the project's plan: the Free week's
|
|
2656
|
+
* changes are used, or a trial is over. Not the 400 above, because the
|
|
2657
|
+
* patches are fine -- they are kept, and saved once the plan allows.
|
|
2658
|
+
* `message` is Val Build's own sentence and `error` the same as data,
|
|
2659
|
+
* so the Studio can put the fix beside it.
|
|
2660
|
+
*
|
|
2661
|
+
* The patches of the batch BEFORE the refused one were saved (the Free
|
|
2662
|
+
* week can run out mid-batch), so this carries what a 200 does about
|
|
2663
|
+
* them: the client marks those saved and keeps the rest.
|
|
2664
|
+
*/
|
|
2665
|
+
zod.z.object({
|
|
2666
|
+
status: zod.z.literal(403),
|
|
2667
|
+
json: zod.z.object({
|
|
2668
|
+
type: zod.z.literal("plan-refused"),
|
|
2669
|
+
message: zod.z.string(),
|
|
2670
|
+
error: PlanRefusalError,
|
|
2671
|
+
newPatchIds: zod.z.array(PatchId),
|
|
2672
|
+
parentRef: ParentRef,
|
|
2673
|
+
patchGroupId: zod.z.string().optional(),
|
|
2674
|
+
headVersion: zod.z.number().optional()
|
|
2675
|
+
})
|
|
2628
2676
|
}), zod.z.object({
|
|
2629
2677
|
status: zod.z.literal(200),
|
|
2630
2678
|
json: zod.z.object({
|
|
@@ -5569,7 +5617,11 @@ function emptyOf(schema, context) {
|
|
|
5569
5617
|
} else if (schema.type === "boolean") {
|
|
5570
5618
|
return false;
|
|
5571
5619
|
} else if (schema.type === "number") {
|
|
5572
|
-
|
|
5620
|
+
var _Internal$number$near, _schema$options;
|
|
5621
|
+
// 0, unless the schema rules it out: an `s.int().min(1)` starts at 1
|
|
5622
|
+
// rather than as an error. `null` means the schema allows nothing at all,
|
|
5623
|
+
// which validation will say; 0 is as good a start as any for that.
|
|
5624
|
+
return (_Internal$number$near = core.Internal.number.nearestAllowedNumber(0, (_schema$options = schema.options) !== null && _schema$options !== void 0 ? _schema$options : {})) !== null && _Internal$number$near !== void 0 ? _Internal$number$near : 0;
|
|
5573
5625
|
} else if (schema.type === "keyOf") {
|
|
5574
5626
|
if (schema.values === "string") {
|
|
5575
5627
|
return ""; // TODO: figure out this: user code might very well fail in this case
|
|
@@ -5611,14 +5663,14 @@ function emptyOf(schema, context) {
|
|
|
5611
5663
|
} else if (schema.type === "dateTime") {
|
|
5612
5664
|
return clampDateTimeString(new Date().toISOString(), schema.options);
|
|
5613
5665
|
} else if (schema.type === "color") {
|
|
5614
|
-
var _schema$options$forma, _schema$
|
|
5666
|
+
var _schema$options$forma, _schema$options2;
|
|
5615
5667
|
// Mid grey: visible against both a light and a dark canvas
|
|
5616
5668
|
return core.Internal.color.formatColor({
|
|
5617
5669
|
r: 128,
|
|
5618
5670
|
g: 128,
|
|
5619
5671
|
b: 128,
|
|
5620
5672
|
a: 1
|
|
5621
|
-
}, (_schema$options$forma = (_schema$
|
|
5673
|
+
}, (_schema$options$forma = (_schema$options2 = schema.options) === null || _schema$options2 === void 0 ? void 0 : _schema$options2.format) !== null && _schema$options$forma !== void 0 ? _schema$options$forma : core.DEFAULT_COLOR_FORMAT);
|
|
5622
5674
|
} else if (schema.type === "code") {
|
|
5623
5675
|
return ""; // An empty editor: no language has a sensible starting snippet
|
|
5624
5676
|
} else if (schema.type === "view") {
|
|
@@ -8069,6 +8121,7 @@ exports.PatchBlock = PatchBlock;
|
|
|
8069
8121
|
exports.PatchGroup = PatchGroup;
|
|
8070
8122
|
exports.PatchId = PatchId;
|
|
8071
8123
|
exports.PatchJSON = PatchJSON;
|
|
8124
|
+
exports.PlanRefusalError = PlanRefusalError;
|
|
8072
8125
|
exports.PublishProtocolError = PublishProtocolError;
|
|
8073
8126
|
exports.RAMP_STEPS = RAMP_STEPS;
|
|
8074
8127
|
exports.RemirrorBr = RemirrorBr;
|
|
@@ -1079,8 +1079,8 @@ var _excluded = ["directory"];
|
|
|
1079
1079
|
|
|
1080
1080
|
// A render is static config, so unlike a `preview` it travels WHOLE — this
|
|
1081
1081
|
// is the field the editor reads the layout from. See `core/src/render.ts`.
|
|
1082
|
-
//
|
|
1083
|
-
//
|
|
1082
|
+
// Array, record and keyOf carry `{ as: "inline" }`; number carries
|
|
1083
|
+
// `{ as: "slider", ... }`. A stale `render` on any other schema is stripped here, harmlessly.
|
|
1084
1084
|
// NB: these z.objects STRIP unknown keys, so a render variant that is not
|
|
1085
1085
|
// declared here is silently dropped in transit — add it here when it is added
|
|
1086
1086
|
// to `render.ts`.
|
|
@@ -1088,6 +1088,13 @@ var InlineRender = z.object({
|
|
|
1088
1088
|
as: z.literal("inline")
|
|
1089
1089
|
});
|
|
1090
1090
|
var FieldRender = InlineRender.optional();
|
|
1091
|
+
// The other render, and the only one a leaf takes: `s.number()` / `s.int()`.
|
|
1092
|
+
var NumberRender = z.object({
|
|
1093
|
+
as: z.literal("slider"),
|
|
1094
|
+
min: z.number(),
|
|
1095
|
+
max: z.number(),
|
|
1096
|
+
step: z.number().optional()
|
|
1097
|
+
}).optional();
|
|
1091
1098
|
|
|
1092
1099
|
/**
|
|
1093
1100
|
* The fields EVERY serialized schema carries, in one place.
|
|
@@ -1147,8 +1154,11 @@ var SerializedNumberSchema = z.object(_objectSpread2(_objectSpread2({}, commonSc
|
|
|
1147
1154
|
type: z.literal("number"),
|
|
1148
1155
|
options: z.object({
|
|
1149
1156
|
max: z.number().optional(),
|
|
1150
|
-
min: z.number().optional()
|
|
1157
|
+
min: z.number().optional(),
|
|
1158
|
+
integer: z["boolean"]().optional(),
|
|
1159
|
+
step: z.number().optional()
|
|
1151
1160
|
}).optional(),
|
|
1161
|
+
render: NumberRender,
|
|
1152
1162
|
opt: z["boolean"]()
|
|
1153
1163
|
}));
|
|
1154
1164
|
var SerializedObjectSchema = z.lazy(function () {
|
|
@@ -1621,7 +1631,22 @@ var notFoundResponse = z.object({
|
|
|
1621
1631
|
var GenericError = z.object({
|
|
1622
1632
|
message: z.string()
|
|
1623
1633
|
});
|
|
1624
|
-
|
|
1634
|
+
/**
|
|
1635
|
+
* Why Val Build refused a write for the project's plan, as data: the `error` of
|
|
1636
|
+
* its 403 (`refusalError` in valbuild/home's `billing/projectLimits.ts`).
|
|
1637
|
+
*
|
|
1638
|
+
* Every field but `code` is optional and every field is a plain string, so a
|
|
1639
|
+
* newer Val Build that adds a code or a fix still parses: the Studio says an
|
|
1640
|
+
* unknown one with Billing beside it rather than failing to read the answer.
|
|
1641
|
+
*/
|
|
1642
|
+
var PlanRefusalError = z.object({
|
|
1643
|
+
code: z.string(),
|
|
1644
|
+
fix: z.string().optional(),
|
|
1645
|
+
/** When it lifts by itself, as an ISO time, if it does. */
|
|
1646
|
+
until: z.string().optional(),
|
|
1647
|
+
/** The organization's Billing in Val Build. */
|
|
1648
|
+
billingUrl: z.string().optional()
|
|
1649
|
+
});
|
|
1625
1650
|
/**
|
|
1626
1651
|
* The header a request to `/admin/proxy` must carry. A cross-site form or
|
|
1627
1652
|
* `<img>` cannot set a custom header, so without it the proxy cannot be driven
|
|
@@ -2618,6 +2643,29 @@ var Api = {
|
|
|
2618
2643
|
error: GenericError
|
|
2619
2644
|
})))
|
|
2620
2645
|
})
|
|
2646
|
+
}),
|
|
2647
|
+
/*
|
|
2648
|
+
* Val Build refused the write for the project's plan: the Free week's
|
|
2649
|
+
* changes are used, or a trial is over. Not the 400 above, because the
|
|
2650
|
+
* patches are fine -- they are kept, and saved once the plan allows.
|
|
2651
|
+
* `message` is Val Build's own sentence and `error` the same as data,
|
|
2652
|
+
* so the Studio can put the fix beside it.
|
|
2653
|
+
*
|
|
2654
|
+
* The patches of the batch BEFORE the refused one were saved (the Free
|
|
2655
|
+
* week can run out mid-batch), so this carries what a 200 does about
|
|
2656
|
+
* them: the client marks those saved and keeps the rest.
|
|
2657
|
+
*/
|
|
2658
|
+
z.object({
|
|
2659
|
+
status: z.literal(403),
|
|
2660
|
+
json: z.object({
|
|
2661
|
+
type: z.literal("plan-refused"),
|
|
2662
|
+
message: z.string(),
|
|
2663
|
+
error: PlanRefusalError,
|
|
2664
|
+
newPatchIds: z.array(PatchId),
|
|
2665
|
+
parentRef: ParentRef,
|
|
2666
|
+
patchGroupId: z.string().optional(),
|
|
2667
|
+
headVersion: z.number().optional()
|
|
2668
|
+
})
|
|
2621
2669
|
}), z.object({
|
|
2622
2670
|
status: z.literal(200),
|
|
2623
2671
|
json: z.object({
|
|
@@ -5562,7 +5610,11 @@ function emptyOf(schema, context) {
|
|
|
5562
5610
|
} else if (schema.type === "boolean") {
|
|
5563
5611
|
return false;
|
|
5564
5612
|
} else if (schema.type === "number") {
|
|
5565
|
-
|
|
5613
|
+
var _Internal$number$near, _schema$options;
|
|
5614
|
+
// 0, unless the schema rules it out: an `s.int().min(1)` starts at 1
|
|
5615
|
+
// rather than as an error. `null` means the schema allows nothing at all,
|
|
5616
|
+
// which validation will say; 0 is as good a start as any for that.
|
|
5617
|
+
return (_Internal$number$near = Internal.number.nearestAllowedNumber(0, (_schema$options = schema.options) !== null && _schema$options !== void 0 ? _schema$options : {})) !== null && _Internal$number$near !== void 0 ? _Internal$number$near : 0;
|
|
5566
5618
|
} else if (schema.type === "keyOf") {
|
|
5567
5619
|
if (schema.values === "string") {
|
|
5568
5620
|
return ""; // TODO: figure out this: user code might very well fail in this case
|
|
@@ -5604,14 +5656,14 @@ function emptyOf(schema, context) {
|
|
|
5604
5656
|
} else if (schema.type === "dateTime") {
|
|
5605
5657
|
return clampDateTimeString(new Date().toISOString(), schema.options);
|
|
5606
5658
|
} else if (schema.type === "color") {
|
|
5607
|
-
var _schema$options$forma, _schema$
|
|
5659
|
+
var _schema$options$forma, _schema$options2;
|
|
5608
5660
|
// Mid grey: visible against both a light and a dark canvas
|
|
5609
5661
|
return Internal.color.formatColor({
|
|
5610
5662
|
r: 128,
|
|
5611
5663
|
g: 128,
|
|
5612
5664
|
b: 128,
|
|
5613
5665
|
a: 1
|
|
5614
|
-
}, (_schema$options$forma = (_schema$
|
|
5666
|
+
}, (_schema$options$forma = (_schema$options2 = schema.options) === null || _schema$options2 === void 0 ? void 0 : _schema$options2.format) !== null && _schema$options$forma !== void 0 ? _schema$options$forma : DEFAULT_COLOR_FORMAT);
|
|
5615
5667
|
} else if (schema.type === "code") {
|
|
5616
5668
|
return ""; // An empty editor: no language has a sensible starting snippet
|
|
5617
5669
|
} else if (schema.type === "view") {
|
|
@@ -8016,4 +8068,4 @@ function parse(schema, body, call) {
|
|
|
8016
8068
|
return parsed.data;
|
|
8017
8069
|
}
|
|
8018
8070
|
|
|
8019
|
-
export { AA_LARGE, AA_TEXT, Api, BRAND_CONTRAST_PAIRS, BinaryFileRef, CodeOptions, ColorOptions, DEFAULT_ERROR_MESSAGE, DateOptions, ENCODE_DEFAULTS, ENCODE_MIME_TYPE_OF, FileOptions, HistoricalCommit, HistoricalModule, HistoricalPatchSet, HistoryError, ImageEncodeOption, ImageOptions, JSONValue, JSON_ENTRIES_BATCH_MAX, ModuleComparison, NEVER_ENCODED, ParentRef$1 as ParentRef, Patch, PatchBlock, PatchGroup, PatchId, PatchJSON, PublishProtocolError, RAMP_STEPS, RemirrorBr, RemirrorBulletList, RemirrorHeading, RemirrorImage, RemirrorJSON, RemirrorLinkMark, RemirrorListItem, RemirrorOrderedList, RemirrorParagraph, RemirrorText, RemirrorTextMark, RestoreVerdict, RichTextOptions, SCHEMA_SOURCE_FIXES, SerializedArraySchema, SerializedBooleanSchema, SerializedCodeSchema, SerializedColorSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedDiscriminatedUnionSchema, SerializedEnumSchema, SerializedFileSchema, SerializedImageSchema, SerializedKeyOfSchema, SerializedLiteralSchema, SerializedLocaleSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedRecordSchema, SerializedRichTextSchema, SerializedRouteSchema, SerializedSchema, SerializedSettingsSchema, SerializedStringSchema, SerializedValViewSchema, SerializedVideoSchema, SharedValConfig, VAL_ENABLE_COOKIE_NAME, VAL_GREEN_RAMP, VAL_SESSION_COOKIE, VAL_STATE_COOKIE, VAL_STUDIO_HEADER, ValCommit, ValDeployment, VideoOptions, VideoStreamOption, accentRamp, buildDuplicatePatch, buildEmptyAtPathPatch, buildFileRefValue, buildImageGalleryPatch, buildRemoveImageGalleryEntryPatch, buildSearchIndex, chainHeadOf, checkCompatibility, chooseEncoded, concatModulePath, contrastRatio, createRegExpFromPattern, createSearchIndex, createValClient, declaredLocales, describeContainerAtPath, emptyOf, explainIncompatible, filterBlockingValidationErrors, filterRoutesByPatterns, findSimilar, fitWithin, flattenRichText, forEachRichTextImage, getErrorMessageFromUnknownJson, getFilenameFromRef, getInlineImgInfo, getKeyOfRecordAt, getRefParts, getRoutesOf, getRoutesWithModulePaths, getSourceAt, indexModule, isMimeTypeAccepted, isRemoteSchema, isSchemaSourceFixError, isSkippedSource, keyOfRecordPath, levenshtein, localeAt, memoizePerRequest, newestCommitSha, parseArtifacts, parseBuildTarget, parseCancel, parseDeclare, parseDiscard, parseJob, parseNewestCiRun, parsePress, parseProblems, parseProjectSource, parsePromote, parsePublishToken, parseRenew, parseRequestStatus, parseStatus, parseUpdateTarget, parseVerify, partitionValidationErrors, performSearch, relativeLuminance, remirrorToRichTextSource, removeModule, resolveEncodeSettings, resolvePairGround, resolveSchemaSourceFixForError, resolveSchemaSourceFixes, resolveSerializedSchemaAtPath, richTextImageSchema, richTextToRemirror, safeParsePatch, sourcePathOfChild, themeCustomProperties, toolNames, traverseSchemaSource, urlOf, validateRoutePatterns, withExtension };
|
|
8071
|
+
export { AA_LARGE, AA_TEXT, Api, BRAND_CONTRAST_PAIRS, BinaryFileRef, CodeOptions, ColorOptions, DEFAULT_ERROR_MESSAGE, DateOptions, ENCODE_DEFAULTS, ENCODE_MIME_TYPE_OF, FileOptions, HistoricalCommit, HistoricalModule, HistoricalPatchSet, HistoryError, ImageEncodeOption, ImageOptions, JSONValue, JSON_ENTRIES_BATCH_MAX, ModuleComparison, NEVER_ENCODED, ParentRef$1 as ParentRef, Patch, PatchBlock, PatchGroup, PatchId, PatchJSON, PlanRefusalError, PublishProtocolError, RAMP_STEPS, RemirrorBr, RemirrorBulletList, RemirrorHeading, RemirrorImage, RemirrorJSON, RemirrorLinkMark, RemirrorListItem, RemirrorOrderedList, RemirrorParagraph, RemirrorText, RemirrorTextMark, RestoreVerdict, RichTextOptions, SCHEMA_SOURCE_FIXES, SerializedArraySchema, SerializedBooleanSchema, SerializedCodeSchema, SerializedColorSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedDiscriminatedUnionSchema, SerializedEnumSchema, SerializedFileSchema, SerializedImageSchema, SerializedKeyOfSchema, SerializedLiteralSchema, SerializedLocaleSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedRecordSchema, SerializedRichTextSchema, SerializedRouteSchema, SerializedSchema, SerializedSettingsSchema, SerializedStringSchema, SerializedValViewSchema, SerializedVideoSchema, SharedValConfig, VAL_ENABLE_COOKIE_NAME, VAL_GREEN_RAMP, VAL_SESSION_COOKIE, VAL_STATE_COOKIE, VAL_STUDIO_HEADER, ValCommit, ValDeployment, VideoOptions, VideoStreamOption, accentRamp, buildDuplicatePatch, buildEmptyAtPathPatch, buildFileRefValue, buildImageGalleryPatch, buildRemoveImageGalleryEntryPatch, buildSearchIndex, chainHeadOf, checkCompatibility, chooseEncoded, concatModulePath, contrastRatio, createRegExpFromPattern, createSearchIndex, createValClient, declaredLocales, describeContainerAtPath, emptyOf, explainIncompatible, filterBlockingValidationErrors, filterRoutesByPatterns, findSimilar, fitWithin, flattenRichText, forEachRichTextImage, getErrorMessageFromUnknownJson, getFilenameFromRef, getInlineImgInfo, getKeyOfRecordAt, getRefParts, getRoutesOf, getRoutesWithModulePaths, getSourceAt, indexModule, isMimeTypeAccepted, isRemoteSchema, isSchemaSourceFixError, isSkippedSource, keyOfRecordPath, levenshtein, localeAt, memoizePerRequest, newestCommitSha, parseArtifacts, parseBuildTarget, parseCancel, parseDeclare, parseDiscard, parseJob, parseNewestCiRun, parsePress, parseProblems, parseProjectSource, parsePromote, parsePublishToken, parseRenew, parseRequestStatus, parseStatus, parseUpdateTarget, parseVerify, partitionValidationErrors, performSearch, relativeLuminance, remirrorToRichTextSource, removeModule, resolveEncodeSettings, resolvePairGround, resolveSchemaSourceFixForError, resolveSchemaSourceFixes, resolveSerializedSchemaAtPath, richTextImageSchema, richTextToRemirror, safeParsePatch, sourcePathOfChild, themeCustomProperties, toolNames, traverseSchemaSource, urlOf, validateRoutePatterns, withExtension };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valbuild/shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.145.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.
|
|
40
|
+
"@valbuild/core": "0.145.0"
|
|
41
41
|
},
|
|
42
42
|
"files": [
|
|
43
43
|
"CHANGELOG.md",
|