@vcp-dev/contracts 0.3.14

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.
@@ -0,0 +1,264 @@
1
+ import { z } from "zod";
2
+ import { type SiteEditCommandSuccess } from "./site-edit-command-result.js";
3
+ export declare const SiteEditClassNameSourceRangeSchema: z.ZodObject<{
4
+ start: z.ZodNumber;
5
+ end: z.ZodNumber;
6
+ startLine: z.ZodOptional<z.ZodNumber>;
7
+ startColumn: z.ZodOptional<z.ZodNumber>;
8
+ endLine: z.ZodOptional<z.ZodNumber>;
9
+ endColumn: z.ZodOptional<z.ZodNumber>;
10
+ }, z.core.$strip>;
11
+ export type SiteEditClassNameSourceRange = z.infer<typeof SiteEditClassNameSourceRangeSchema>;
12
+ export declare const SiteEditClassNameSourceDiagnosticSchema: z.ZodObject<{
13
+ code: z.ZodEnum<{
14
+ "missing-class-name": "missing-class-name";
15
+ "unsupported-attribute-name": "unsupported-attribute-name";
16
+ "source-locator-warning": "source-locator-warning";
17
+ "invalid-new-attr": "invalid-new-attr";
18
+ "version-conflict": "version-conflict";
19
+ "write-failed": "write-failed";
20
+ }>;
21
+ message: z.ZodString;
22
+ }, z.core.$strip>;
23
+ export type SiteEditClassNameSourceDiagnostic = z.infer<typeof SiteEditClassNameSourceDiagnosticSchema>;
24
+ export declare const SiteEditClassNameSourceStylesheetSchema: z.ZodObject<{
25
+ path: z.ZodString;
26
+ content: z.ZodString;
27
+ hash: z.ZodOptional<z.ZodString>;
28
+ }, z.core.$strip>;
29
+ export type SiteEditClassNameSourceStylesheet = z.infer<typeof SiteEditClassNameSourceStylesheetSchema>;
30
+ export declare const SiteEditClassNameSourceStyleContextSchema: z.ZodObject<{
31
+ revision: z.ZodString;
32
+ entryCss: z.ZodObject<{
33
+ path: z.ZodString;
34
+ content: z.ZodString;
35
+ hash: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strip>;
37
+ stylesheets: z.ZodDefault<z.ZodArray<z.ZodObject<{
38
+ path: z.ZodString;
39
+ content: z.ZodString;
40
+ hash: z.ZodOptional<z.ZodString>;
41
+ }, z.core.$strip>>>;
42
+ computedStyle: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
43
+ }, z.core.$strip>;
44
+ export type SiteEditClassNameSourceStyleContext = z.infer<typeof SiteEditClassNameSourceStyleContextSchema>;
45
+ export declare const SiteEditClassNameSourceSchema: z.ZodObject<{
46
+ key: z.ZodString;
47
+ routeId: z.ZodString;
48
+ filePath: z.ZodString;
49
+ componentName: z.ZodString;
50
+ sourceKind: z.ZodEnum<{
51
+ missing: "missing";
52
+ stringLiteral: "stringLiteral";
53
+ expression: "expression";
54
+ }>;
55
+ attrRaw: z.ZodNullable<z.ZodString>;
56
+ valueRaw: z.ZodNullable<z.ZodString>;
57
+ attrRange: z.ZodNullable<z.ZodObject<{
58
+ start: z.ZodNumber;
59
+ end: z.ZodNumber;
60
+ startLine: z.ZodOptional<z.ZodNumber>;
61
+ startColumn: z.ZodOptional<z.ZodNumber>;
62
+ endLine: z.ZodOptional<z.ZodNumber>;
63
+ endColumn: z.ZodOptional<z.ZodNumber>;
64
+ }, z.core.$strip>>;
65
+ valueRange: z.ZodNullable<z.ZodObject<{
66
+ start: z.ZodNumber;
67
+ end: z.ZodNumber;
68
+ startLine: z.ZodOptional<z.ZodNumber>;
69
+ startColumn: z.ZodOptional<z.ZodNumber>;
70
+ endLine: z.ZodOptional<z.ZodNumber>;
71
+ endColumn: z.ZodOptional<z.ZodNumber>;
72
+ }, z.core.$strip>>;
73
+ openingElementRange: z.ZodObject<{
74
+ start: z.ZodNumber;
75
+ end: z.ZodNumber;
76
+ startLine: z.ZodOptional<z.ZodNumber>;
77
+ startColumn: z.ZodOptional<z.ZodNumber>;
78
+ endLine: z.ZodOptional<z.ZodNumber>;
79
+ endColumn: z.ZodOptional<z.ZodNumber>;
80
+ }, z.core.$strip>;
81
+ version: z.ZodObject<{
82
+ documentVersion: z.ZodNumber;
83
+ contentHash: z.ZodString;
84
+ parserVersion: z.ZodString;
85
+ }, z.core.$strip>;
86
+ diagnostics: z.ZodArray<z.ZodObject<{
87
+ code: z.ZodEnum<{
88
+ "missing-class-name": "missing-class-name";
89
+ "unsupported-attribute-name": "unsupported-attribute-name";
90
+ "source-locator-warning": "source-locator-warning";
91
+ "invalid-new-attr": "invalid-new-attr";
92
+ "version-conflict": "version-conflict";
93
+ "write-failed": "write-failed";
94
+ }>;
95
+ message: z.ZodString;
96
+ }, z.core.$strip>>;
97
+ styleContext: z.ZodOptional<z.ZodObject<{
98
+ revision: z.ZodString;
99
+ entryCss: z.ZodObject<{
100
+ path: z.ZodString;
101
+ content: z.ZodString;
102
+ hash: z.ZodOptional<z.ZodString>;
103
+ }, z.core.$strip>;
104
+ stylesheets: z.ZodDefault<z.ZodArray<z.ZodObject<{
105
+ path: z.ZodString;
106
+ content: z.ZodString;
107
+ hash: z.ZodOptional<z.ZodString>;
108
+ }, z.core.$strip>>>;
109
+ computedStyle: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
110
+ }, z.core.$strip>>;
111
+ }, z.core.$strip>;
112
+ export type SiteEditClassNameSource = z.infer<typeof SiteEditClassNameSourceSchema>;
113
+ export declare const SiteEditGetClassNameSourceResultSchema: z.ZodObject<{
114
+ key: z.ZodString;
115
+ routeId: z.ZodString;
116
+ filePath: z.ZodString;
117
+ componentName: z.ZodString;
118
+ sourceKind: z.ZodEnum<{
119
+ missing: "missing";
120
+ stringLiteral: "stringLiteral";
121
+ expression: "expression";
122
+ }>;
123
+ attrRaw: z.ZodNullable<z.ZodString>;
124
+ valueRaw: z.ZodNullable<z.ZodString>;
125
+ attrRange: z.ZodNullable<z.ZodObject<{
126
+ start: z.ZodNumber;
127
+ end: z.ZodNumber;
128
+ startLine: z.ZodOptional<z.ZodNumber>;
129
+ startColumn: z.ZodOptional<z.ZodNumber>;
130
+ endLine: z.ZodOptional<z.ZodNumber>;
131
+ endColumn: z.ZodOptional<z.ZodNumber>;
132
+ }, z.core.$strip>>;
133
+ valueRange: z.ZodNullable<z.ZodObject<{
134
+ start: z.ZodNumber;
135
+ end: z.ZodNumber;
136
+ startLine: z.ZodOptional<z.ZodNumber>;
137
+ startColumn: z.ZodOptional<z.ZodNumber>;
138
+ endLine: z.ZodOptional<z.ZodNumber>;
139
+ endColumn: z.ZodOptional<z.ZodNumber>;
140
+ }, z.core.$strip>>;
141
+ openingElementRange: z.ZodObject<{
142
+ start: z.ZodNumber;
143
+ end: z.ZodNumber;
144
+ startLine: z.ZodOptional<z.ZodNumber>;
145
+ startColumn: z.ZodOptional<z.ZodNumber>;
146
+ endLine: z.ZodOptional<z.ZodNumber>;
147
+ endColumn: z.ZodOptional<z.ZodNumber>;
148
+ }, z.core.$strip>;
149
+ version: z.ZodObject<{
150
+ documentVersion: z.ZodNumber;
151
+ contentHash: z.ZodString;
152
+ parserVersion: z.ZodString;
153
+ }, z.core.$strip>;
154
+ diagnostics: z.ZodArray<z.ZodObject<{
155
+ code: z.ZodEnum<{
156
+ "missing-class-name": "missing-class-name";
157
+ "unsupported-attribute-name": "unsupported-attribute-name";
158
+ "source-locator-warning": "source-locator-warning";
159
+ "invalid-new-attr": "invalid-new-attr";
160
+ "version-conflict": "version-conflict";
161
+ "write-failed": "write-failed";
162
+ }>;
163
+ message: z.ZodString;
164
+ }, z.core.$strip>>;
165
+ styleContext: z.ZodOptional<z.ZodObject<{
166
+ revision: z.ZodString;
167
+ entryCss: z.ZodObject<{
168
+ path: z.ZodString;
169
+ content: z.ZodString;
170
+ hash: z.ZodOptional<z.ZodString>;
171
+ }, z.core.$strip>;
172
+ stylesheets: z.ZodDefault<z.ZodArray<z.ZodObject<{
173
+ path: z.ZodString;
174
+ content: z.ZodString;
175
+ hash: z.ZodOptional<z.ZodString>;
176
+ }, z.core.$strip>>>;
177
+ computedStyle: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
178
+ }, z.core.$strip>>;
179
+ }, z.core.$strip>;
180
+ export type SiteEditGetClassNameSourceResult = z.infer<typeof SiteEditGetClassNameSourceResultSchema>;
181
+ export declare const SiteEditGetClassNameSourceCommandResultSchema: z.ZodObject<{
182
+ ok: z.ZodLiteral<true>;
183
+ data: z.ZodObject<{
184
+ key: z.ZodString;
185
+ routeId: z.ZodString;
186
+ filePath: z.ZodString;
187
+ componentName: z.ZodString;
188
+ sourceKind: z.ZodEnum<{
189
+ missing: "missing";
190
+ stringLiteral: "stringLiteral";
191
+ expression: "expression";
192
+ }>;
193
+ attrRaw: z.ZodNullable<z.ZodString>;
194
+ valueRaw: z.ZodNullable<z.ZodString>;
195
+ attrRange: z.ZodNullable<z.ZodObject<{
196
+ start: z.ZodNumber;
197
+ end: z.ZodNumber;
198
+ startLine: z.ZodOptional<z.ZodNumber>;
199
+ startColumn: z.ZodOptional<z.ZodNumber>;
200
+ endLine: z.ZodOptional<z.ZodNumber>;
201
+ endColumn: z.ZodOptional<z.ZodNumber>;
202
+ }, z.core.$strip>>;
203
+ valueRange: z.ZodNullable<z.ZodObject<{
204
+ start: z.ZodNumber;
205
+ end: z.ZodNumber;
206
+ startLine: z.ZodOptional<z.ZodNumber>;
207
+ startColumn: z.ZodOptional<z.ZodNumber>;
208
+ endLine: z.ZodOptional<z.ZodNumber>;
209
+ endColumn: z.ZodOptional<z.ZodNumber>;
210
+ }, z.core.$strip>>;
211
+ openingElementRange: z.ZodObject<{
212
+ start: z.ZodNumber;
213
+ end: z.ZodNumber;
214
+ startLine: z.ZodOptional<z.ZodNumber>;
215
+ startColumn: z.ZodOptional<z.ZodNumber>;
216
+ endLine: z.ZodOptional<z.ZodNumber>;
217
+ endColumn: z.ZodOptional<z.ZodNumber>;
218
+ }, z.core.$strip>;
219
+ version: z.ZodObject<{
220
+ documentVersion: z.ZodNumber;
221
+ contentHash: z.ZodString;
222
+ parserVersion: z.ZodString;
223
+ }, z.core.$strip>;
224
+ diagnostics: z.ZodArray<z.ZodObject<{
225
+ code: z.ZodEnum<{
226
+ "missing-class-name": "missing-class-name";
227
+ "unsupported-attribute-name": "unsupported-attribute-name";
228
+ "source-locator-warning": "source-locator-warning";
229
+ "invalid-new-attr": "invalid-new-attr";
230
+ "version-conflict": "version-conflict";
231
+ "write-failed": "write-failed";
232
+ }>;
233
+ message: z.ZodString;
234
+ }, z.core.$strip>>;
235
+ styleContext: z.ZodOptional<z.ZodObject<{
236
+ revision: z.ZodString;
237
+ entryCss: z.ZodObject<{
238
+ path: z.ZodString;
239
+ content: z.ZodString;
240
+ hash: z.ZodOptional<z.ZodString>;
241
+ }, z.core.$strip>;
242
+ stylesheets: z.ZodDefault<z.ZodArray<z.ZodObject<{
243
+ path: z.ZodString;
244
+ content: z.ZodString;
245
+ hash: z.ZodOptional<z.ZodString>;
246
+ }, z.core.$strip>>>;
247
+ computedStyle: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
248
+ }, z.core.$strip>>;
249
+ }, z.core.$strip>;
250
+ }, z.core.$strip>;
251
+ export type SiteEditGetClassNameSourceCommandResult = SiteEditCommandSuccess<SiteEditClassNameSource>;
252
+ export declare const SiteEditClassNameSourceWriteIntentSchema: z.ZodObject<{
253
+ source: z.ZodEnum<{
254
+ "style-panel": "style-panel";
255
+ "class-source-editor": "class-source-editor";
256
+ }>;
257
+ operation: z.ZodEnum<{
258
+ "replace-static-classname": "replace-static-classname";
259
+ "replace-expression": "replace-expression";
260
+ "create-attribute": "create-attribute";
261
+ "remove-attribute": "remove-attribute";
262
+ }>;
263
+ }, z.core.$strip>;
264
+ export type SiteEditClassNameSourceWriteIntent = z.infer<typeof SiteEditClassNameSourceWriteIntentSchema>;
@@ -0,0 +1,50 @@
1
+ import { z } from "zod";
2
+ export declare const SiteEditCommandErrorSchema: z.ZodObject<{
3
+ code: z.ZodString;
4
+ message: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export type SiteEditCommandError = z.infer<typeof SiteEditCommandErrorSchema>;
7
+ export declare const SiteEditCommandDiagnosticSchema: z.ZodObject<{
8
+ code: z.ZodString;
9
+ message: z.ZodString;
10
+ }, z.core.$strip>;
11
+ export type SiteEditCommandDiagnostic = z.infer<typeof SiteEditCommandDiagnosticSchema>;
12
+ export declare function createSiteEditCommandSuccessSchema<TData extends z.ZodTypeAny>(dataSchema: TData): z.ZodObject<{
13
+ ok: z.ZodLiteral<true>;
14
+ data: TData;
15
+ }, z.core.$strip>;
16
+ export declare function createSiteEditCommandFailureSchema<TCode extends z.ZodTypeAny, TCurrent extends z.ZodTypeAny = z.ZodUnknown, TDiagnostics extends z.ZodTypeAny = typeof SiteEditCommandDiagnosticSchema>(input: {
17
+ codeSchema: TCode;
18
+ currentSchema?: TCurrent;
19
+ diagnosticsSchema?: TDiagnostics;
20
+ dataSchema?: z.ZodTypeAny;
21
+ }): z.ZodObject<{
22
+ [x: string]: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
23
+ }, z.core.$strip>;
24
+ export declare function createSiteEditCommandResultSchema<TData extends z.ZodTypeAny, TCode extends z.ZodTypeAny, TCurrent extends z.ZodTypeAny = z.ZodUnknown, TDiagnostics extends z.ZodTypeAny = typeof SiteEditCommandDiagnosticSchema>(input: {
25
+ dataSchema: TData;
26
+ codeSchema: TCode;
27
+ currentSchema?: TCurrent;
28
+ diagnosticsSchema?: TDiagnostics;
29
+ failureDataSchema?: z.ZodTypeAny;
30
+ }): z.ZodDiscriminatedUnion<[z.ZodObject<{
31
+ ok: z.ZodLiteral<true>;
32
+ data: TData;
33
+ }, z.core.$strip>, z.ZodObject<{
34
+ [x: string]: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
35
+ }, z.core.$strip>], "ok">;
36
+ export type SiteEditCommandSuccess<TData> = {
37
+ ok: true;
38
+ data: TData;
39
+ };
40
+ export type SiteEditCommandFailure<TCode extends string = string, TCurrent = unknown, TDiagnostic = SiteEditCommandDiagnostic, TData = never> = {
41
+ ok: false;
42
+ error: {
43
+ code: TCode;
44
+ message: string;
45
+ };
46
+ current?: TCurrent;
47
+ diagnostics?: TDiagnostic[];
48
+ data?: TData;
49
+ };
50
+ export type SiteEditCommandResult<TData, TCode extends string = string, TCurrent = unknown, TDiagnostic = SiteEditCommandDiagnostic, TFailureData = never> = SiteEditCommandSuccess<TData> | SiteEditCommandFailure<TCode, TCurrent, TDiagnostic, TFailureData>;
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+ export declare const SiteEditElementPropertySchema: z.ZodEnum<{
3
+ src: "src";
4
+ alt: "alt";
5
+ poster: "poster";
6
+ href: "href";
7
+ width: "width";
8
+ height: "height";
9
+ }>;
10
+ export type SiteEditElementProperty = z.infer<typeof SiteEditElementPropertySchema>;
@@ -0,0 +1,79 @@
1
+ import { z } from "zod";
2
+ export declare const SiteEditEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3
+ type: z.ZodLiteral<"site-edit.document.changed">;
4
+ siteId: z.ZodString;
5
+ snapshotId: z.ZodString;
6
+ routeId: z.ZodString;
7
+ version: z.ZodNumber;
8
+ at: z.ZodString;
9
+ }, z.core.$strip>, z.ZodObject<{
10
+ type: z.ZodLiteral<"site-edit.operation.planned">;
11
+ siteId: z.ZodString;
12
+ operationId: z.ZodString;
13
+ baseSnapshotId: z.ZodString;
14
+ changedFiles: z.ZodArray<z.ZodString>;
15
+ at: z.ZodString;
16
+ }, z.core.$strip>, z.ZodObject<{
17
+ type: z.ZodLiteral<"site-edit.operation.completed">;
18
+ siteId: z.ZodString;
19
+ result: z.ZodObject<{
20
+ requestId: z.ZodString;
21
+ kind: z.ZodEnum<{
22
+ "update-text": "update-text";
23
+ "remove-node": "remove-node";
24
+ "insert-child": "insert-child";
25
+ "move-node": "move-node";
26
+ "set-class-name-source": "set-class-name-source";
27
+ "set-props": "set-props";
28
+ "apply-style-draft": "apply-style-draft";
29
+ }>;
30
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
31
+ kind: z.ZodLiteral<"node">;
32
+ key: z.ZodString;
33
+ }, z.core.$strip>, z.ZodObject<{
34
+ kind: z.ZodLiteral<"route">;
35
+ routeId: z.ZodString;
36
+ }, z.core.$strip>], "kind">;
37
+ resultVersion: z.ZodNumber;
38
+ affectedFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
39
+ selectionRef: z.ZodOptional<z.ZodObject<{
40
+ key: z.ZodString;
41
+ instanceIndex: z.ZodOptional<z.ZodNumber>;
42
+ instanceCount: z.ZodOptional<z.ZodNumber>;
43
+ }, z.core.$strip>>;
44
+ }, z.core.$strip>;
45
+ at: z.ZodString;
46
+ }, z.core.$strip>, z.ZodObject<{
47
+ type: z.ZodLiteral<"site-edit.operation.failed">;
48
+ siteId: z.ZodString;
49
+ requestId: z.ZodString;
50
+ error: z.ZodObject<{
51
+ code: z.ZodEnum<{
52
+ NODE_NOT_FOUND: "NODE_NOT_FOUND";
53
+ ROUTE_NOT_FOUND: "ROUTE_NOT_FOUND";
54
+ CAPABILITY_REJECTED: "CAPABILITY_REJECTED";
55
+ CONSTRAINT_VIOLATED: "CONSTRAINT_VIOLATED";
56
+ INVALID_PARAMS: "INVALID_PARAMS";
57
+ PLAN_FAILED: "PLAN_FAILED";
58
+ VERSION_STALE: "VERSION_STALE";
59
+ AST_PARSE_ERROR: "AST_PARSE_ERROR";
60
+ UNSUPPORTED_OPERATION: "UNSUPPORTED_OPERATION";
61
+ LOCATOR_FAILED: "LOCATOR_FAILED";
62
+ INVALID_TARGET: "INVALID_TARGET";
63
+ WRITE_IO_ERROR: "WRITE_IO_ERROR";
64
+ CONCURRENT_MODIFIED: "CONCURRENT_MODIFIED";
65
+ ROLLBACK_FAILED: "ROLLBACK_FAILED";
66
+ INTERNAL_ERROR: "INTERNAL_ERROR";
67
+ }>;
68
+ message: z.ZodString;
69
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
70
+ }, z.core.$strip>;
71
+ at: z.ZodString;
72
+ }, z.core.$strip>, z.ZodObject<{
73
+ type: z.ZodLiteral<"site-edit.capability.changed">;
74
+ siteId: z.ZodString;
75
+ routeId: z.ZodString;
76
+ keys: z.ZodArray<z.ZodString>;
77
+ at: z.ZodString;
78
+ }, z.core.$strip>], "type">;
79
+ export type SiteEditEvent = z.infer<typeof SiteEditEventSchema>;
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+ export declare const SiteEditSourceIdentitySchema: z.ZodObject<{
3
+ file: z.ZodString;
4
+ component: z.ZodString;
5
+ structuralPath: z.ZodString;
6
+ key: z.ZodString;
7
+ }, z.core.$strip>;
8
+ export type SiteEditSourceIdentity = z.infer<typeof SiteEditSourceIdentitySchema>;
9
+ export declare function computeSiteEditSourceIdentityKey(file: string, component: string, structuralPath: string): string;
10
+ export declare function parseSiteEditSourceIdentityKey(key: string): Pick<SiteEditSourceIdentity, "file" | "component" | "structuralPath"> | null;