@ripplo/testing 0.6.0 → 0.7.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/DSL.md +355 -0
- package/LICENSE.md +1 -0
- package/README.md +47 -273
- package/dist/engine-BT7hUouB.d.ts +1095 -0
- package/dist/express.d.ts +7 -9
- package/dist/express.js +422 -48
- package/dist/index.d.ts +122 -59
- package/dist/index.js +1630 -1126
- package/package.json +31 -113
- package/dist/actions.d.ts +0 -260
- package/dist/actions.js +0 -177
- package/dist/assert.d.ts +0 -188
- package/dist/assert.js +0 -111
- package/dist/builder-SsgqYqSC.d.ts +0 -156
- package/dist/chunk-2YLI7VD4.js +0 -65
- package/dist/chunk-4MGIQFAJ.js +0 -16
- package/dist/chunk-DCJBLS2U.js +0 -26
- package/dist/chunk-MGATMMCZ.js +0 -16
- package/dist/chunk-XO36IU66.js +0 -88
- package/dist/chunk-YFOTJIVF.js +0 -134
- package/dist/chunk-YQAEOH5W.js +0 -111
- package/dist/compiler.d.ts +0 -32
- package/dist/compiler.js +0 -8
- package/dist/control.d.ts +0 -45
- package/dist/control.js +0 -17
- package/dist/elysia.d.ts +0 -78
- package/dist/elysia.js +0 -114
- package/dist/engine-BOqzK_go.d.ts +0 -61
- package/dist/fastify.d.ts +0 -14
- package/dist/fastify.js +0 -79
- package/dist/hono.d.ts +0 -19
- package/dist/hono.js +0 -89
- package/dist/koa.d.ts +0 -14
- package/dist/koa.js +0 -135
- package/dist/locators.d.ts +0 -40
- package/dist/locators.js +0 -11
- package/dist/lockfile.d.ts +0 -722
- package/dist/lockfile.js +0 -707
- package/dist/nestjs.d.ts +0 -17
- package/dist/nestjs.js +0 -139
- package/dist/nextjs.d.ts +0 -14
- package/dist/nextjs.js +0 -137
- package/dist/step-De52hTLd.d.ts +0 -19
- package/dist/types-BzZrl65Z.d.ts +0 -115
|
@@ -0,0 +1,1095 @@
|
|
|
1
|
+
import { ResultAsync } from 'neverthrow';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
declare const budgetSchema: z.ZodEnum<{
|
|
5
|
+
fast: "fast";
|
|
6
|
+
slow: "slow";
|
|
7
|
+
async: "async";
|
|
8
|
+
}>;
|
|
9
|
+
type Budget = z.infer<typeof budgetSchema>;
|
|
10
|
+
declare const valueRefSchema: z.ZodObject<{
|
|
11
|
+
ref: z.ZodString;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
type ValueRef = z.infer<typeof valueRefSchema>;
|
|
14
|
+
declare const primitiveSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
15
|
+
type Primitive$1 = z.infer<typeof primitiveSchema>;
|
|
16
|
+
declare const setValueSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
17
|
+
ref: z.ZodString;
|
|
18
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
|
19
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
20
|
+
ref: z.ZodString;
|
|
21
|
+
}, z.core.$strip>]>>;
|
|
22
|
+
}, z.core.$strip>, z.ZodNull]>;
|
|
23
|
+
type SetValue = z.infer<typeof setValueSchema>;
|
|
24
|
+
declare const changedSchema: z.ZodObject<{
|
|
25
|
+
kind: z.ZodLiteral<"changed">;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
type Changed = z.infer<typeof changedSchema>;
|
|
28
|
+
declare const updateValueSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
29
|
+
ref: z.ZodString;
|
|
30
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
|
31
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
32
|
+
ref: z.ZodString;
|
|
33
|
+
}, z.core.$strip>]>>;
|
|
34
|
+
}, z.core.$strip>, z.ZodNull]>, z.ZodObject<{
|
|
35
|
+
kind: z.ZodLiteral<"changed">;
|
|
36
|
+
}, z.core.$strip>]>;
|
|
37
|
+
type UpdateValue = z.infer<typeof updateValueSchema>;
|
|
38
|
+
declare const stringValueSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
39
|
+
ref: z.ZodString;
|
|
40
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
41
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
42
|
+
ref: z.ZodString;
|
|
43
|
+
}, z.core.$strip>]>>;
|
|
44
|
+
}, z.core.$strip>]>;
|
|
45
|
+
type StringValue = z.infer<typeof stringValueSchema>;
|
|
46
|
+
type Locator = {
|
|
47
|
+
readonly by: "role";
|
|
48
|
+
readonly name: StringValue | undefined;
|
|
49
|
+
readonly role: string;
|
|
50
|
+
} | {
|
|
51
|
+
readonly by: "testId";
|
|
52
|
+
readonly value: StringValue;
|
|
53
|
+
} | {
|
|
54
|
+
readonly by: "inside";
|
|
55
|
+
readonly scope: Locator;
|
|
56
|
+
readonly target: Locator;
|
|
57
|
+
};
|
|
58
|
+
declare const primitiveTypeSchema: z.ZodEnum<{
|
|
59
|
+
string: "string";
|
|
60
|
+
number: "number";
|
|
61
|
+
boolean: "boolean";
|
|
62
|
+
}>;
|
|
63
|
+
type PrimitiveType = z.infer<typeof primitiveTypeSchema>;
|
|
64
|
+
declare const consistencyClassSchema: z.ZodEnum<{
|
|
65
|
+
strict: "strict";
|
|
66
|
+
eventual: "eventual";
|
|
67
|
+
}>;
|
|
68
|
+
type ConsistencyClass = z.infer<typeof consistencyClassSchema>;
|
|
69
|
+
declare const stringConstraintsSchema: z.ZodObject<{
|
|
70
|
+
kind: z.ZodLiteral<"string">;
|
|
71
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
declare const numberConstraintsSchema: z.ZodObject<{
|
|
76
|
+
kind: z.ZodLiteral<"number">;
|
|
77
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
78
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
declare const constraintsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
81
|
+
kind: z.ZodLiteral<"string">;
|
|
82
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
85
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
86
|
+
kind: z.ZodLiteral<"number">;
|
|
87
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
90
|
+
kind: z.ZodLiteral<"datetime">;
|
|
91
|
+
maxOffsetDays: z.ZodNumber;
|
|
92
|
+
minOffsetDays: z.ZodNumber;
|
|
93
|
+
}, z.core.$strip>], "kind">;
|
|
94
|
+
type StringConstraints = z.infer<typeof stringConstraintsSchema>;
|
|
95
|
+
type NumberConstraints = z.infer<typeof numberConstraintsSchema>;
|
|
96
|
+
type Constraints = z.infer<typeof constraintsSchema>;
|
|
97
|
+
declare const generatorSchema: z.ZodEnum<{
|
|
98
|
+
"company.name": "company.name";
|
|
99
|
+
"date.iso": "date.iso";
|
|
100
|
+
"internet.email": "internet.email";
|
|
101
|
+
"internet.url": "internet.url";
|
|
102
|
+
"person.fullName": "person.fullName";
|
|
103
|
+
"lorem.slug": "lorem.slug";
|
|
104
|
+
"lorem.word": "lorem.word";
|
|
105
|
+
}>;
|
|
106
|
+
type Generator = z.infer<typeof generatorSchema>;
|
|
107
|
+
declare const valueSpaceSchema: z.ZodObject<{
|
|
108
|
+
constraints: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
109
|
+
kind: z.ZodLiteral<"string">;
|
|
110
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
113
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
114
|
+
kind: z.ZodLiteral<"number">;
|
|
115
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
118
|
+
kind: z.ZodLiteral<"datetime">;
|
|
119
|
+
maxOffsetDays: z.ZodNumber;
|
|
120
|
+
minOffsetDays: z.ZodNumber;
|
|
121
|
+
}, z.core.$strip>], "kind">>;
|
|
122
|
+
generator: z.ZodEnum<{
|
|
123
|
+
"company.name": "company.name";
|
|
124
|
+
"date.iso": "date.iso";
|
|
125
|
+
"internet.email": "internet.email";
|
|
126
|
+
"internet.url": "internet.url";
|
|
127
|
+
"person.fullName": "person.fullName";
|
|
128
|
+
"lorem.slug": "lorem.slug";
|
|
129
|
+
"lorem.word": "lorem.word";
|
|
130
|
+
}>;
|
|
131
|
+
name: z.ZodString;
|
|
132
|
+
type: z.ZodEnum<{
|
|
133
|
+
string: "string";
|
|
134
|
+
number: "number";
|
|
135
|
+
boolean: "boolean";
|
|
136
|
+
}>;
|
|
137
|
+
values: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
138
|
+
}, z.core.$strip>;
|
|
139
|
+
type ValueSpace = z.infer<typeof valueSpaceSchema>;
|
|
140
|
+
declare const propSpecSchema: z.ZodObject<{
|
|
141
|
+
consistency: z.ZodDefault<z.ZodEnum<{
|
|
142
|
+
strict: "strict";
|
|
143
|
+
eventual: "eventual";
|
|
144
|
+
}>>;
|
|
145
|
+
optional: z.ZodBoolean;
|
|
146
|
+
stable: z.ZodBoolean;
|
|
147
|
+
type: z.ZodEnum<{
|
|
148
|
+
string: "string";
|
|
149
|
+
number: "number";
|
|
150
|
+
boolean: "boolean";
|
|
151
|
+
}>;
|
|
152
|
+
valueSpace: z.ZodOptional<z.ZodString>;
|
|
153
|
+
}, z.core.$strip>;
|
|
154
|
+
type PropSpec = z.infer<typeof propSpecSchema>;
|
|
155
|
+
declare const sourceSchema: z.ZodEnum<{
|
|
156
|
+
backend: "backend";
|
|
157
|
+
client: "client";
|
|
158
|
+
}>;
|
|
159
|
+
type Source = z.infer<typeof sourceSchema>;
|
|
160
|
+
declare const entitySchemaSchema: z.ZodObject<{
|
|
161
|
+
description: z.ZodOptional<z.ZodString>;
|
|
162
|
+
identity: z.ZodArray<z.ZodString>;
|
|
163
|
+
identityKind: z.ZodEnum<{
|
|
164
|
+
surrogate: "surrogate";
|
|
165
|
+
natural: "natural";
|
|
166
|
+
}>;
|
|
167
|
+
name: z.ZodString;
|
|
168
|
+
props: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
169
|
+
consistency: z.ZodDefault<z.ZodEnum<{
|
|
170
|
+
strict: "strict";
|
|
171
|
+
eventual: "eventual";
|
|
172
|
+
}>>;
|
|
173
|
+
optional: z.ZodBoolean;
|
|
174
|
+
stable: z.ZodBoolean;
|
|
175
|
+
type: z.ZodEnum<{
|
|
176
|
+
string: "string";
|
|
177
|
+
number: "number";
|
|
178
|
+
boolean: "boolean";
|
|
179
|
+
}>;
|
|
180
|
+
valueSpace: z.ZodOptional<z.ZodString>;
|
|
181
|
+
}, z.core.$strip>>;
|
|
182
|
+
source: z.ZodDefault<z.ZodEnum<{
|
|
183
|
+
backend: "backend";
|
|
184
|
+
client: "client";
|
|
185
|
+
}>>;
|
|
186
|
+
}, z.core.$strip>;
|
|
187
|
+
type EntitySchema = z.infer<typeof entitySchemaSchema>;
|
|
188
|
+
declare const singletonSchemaSchema: z.ZodObject<{
|
|
189
|
+
consistency: z.ZodDefault<z.ZodEnum<{
|
|
190
|
+
strict: "strict";
|
|
191
|
+
eventual: "eventual";
|
|
192
|
+
}>>;
|
|
193
|
+
default: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
194
|
+
description: z.ZodOptional<z.ZodString>;
|
|
195
|
+
name: z.ZodString;
|
|
196
|
+
source: z.ZodDefault<z.ZodEnum<{
|
|
197
|
+
backend: "backend";
|
|
198
|
+
client: "client";
|
|
199
|
+
}>>;
|
|
200
|
+
type: z.ZodEnum<{
|
|
201
|
+
string: "string";
|
|
202
|
+
number: "number";
|
|
203
|
+
boolean: "boolean";
|
|
204
|
+
}>;
|
|
205
|
+
valueSpace: z.ZodOptional<z.ZodString>;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
type SingletonSchema = z.infer<typeof singletonSchemaSchema>;
|
|
208
|
+
declare const browserSingletonSchema: z.ZodEnum<{
|
|
209
|
+
title: "title";
|
|
210
|
+
url: "url";
|
|
211
|
+
viewport: "viewport";
|
|
212
|
+
}>;
|
|
213
|
+
type BrowserSingleton = z.infer<typeof browserSingletonSchema>;
|
|
214
|
+
|
|
215
|
+
type StateAssertion$1 = {
|
|
216
|
+
readonly as: string;
|
|
217
|
+
readonly kind: "created";
|
|
218
|
+
readonly props: Record<string, SetValue>;
|
|
219
|
+
} | {
|
|
220
|
+
readonly as: string;
|
|
221
|
+
readonly kind: "updated";
|
|
222
|
+
readonly props: Record<string, UpdateValue>;
|
|
223
|
+
} | {
|
|
224
|
+
readonly kind: "deleted";
|
|
225
|
+
};
|
|
226
|
+
type SingletonAssertion = {
|
|
227
|
+
readonly kind: "is";
|
|
228
|
+
readonly value: SetValue;
|
|
229
|
+
};
|
|
230
|
+
interface Selection$1 {
|
|
231
|
+
readonly entity: string;
|
|
232
|
+
readonly where: Record<string, WhereValue>;
|
|
233
|
+
}
|
|
234
|
+
interface Within {
|
|
235
|
+
readonly field: string;
|
|
236
|
+
readonly kind: "within";
|
|
237
|
+
readonly selection: Selection$1;
|
|
238
|
+
}
|
|
239
|
+
type WhereValue = SetValue | Within;
|
|
240
|
+
type Predicate = {
|
|
241
|
+
readonly kind: "visible";
|
|
242
|
+
readonly locator: Locator;
|
|
243
|
+
readonly wait: Budget | undefined;
|
|
244
|
+
} | {
|
|
245
|
+
readonly kind: "disabled";
|
|
246
|
+
readonly locator: Locator;
|
|
247
|
+
readonly wait: Budget | undefined;
|
|
248
|
+
} | {
|
|
249
|
+
readonly kind: "enabled";
|
|
250
|
+
readonly locator: Locator;
|
|
251
|
+
readonly wait: Budget | undefined;
|
|
252
|
+
} | {
|
|
253
|
+
readonly kind: "focused";
|
|
254
|
+
readonly locator: Locator;
|
|
255
|
+
readonly wait: Budget | undefined;
|
|
256
|
+
} | {
|
|
257
|
+
readonly kind: "value";
|
|
258
|
+
readonly locator: Locator;
|
|
259
|
+
readonly value: StringValue;
|
|
260
|
+
readonly wait: Budget | undefined;
|
|
261
|
+
} | {
|
|
262
|
+
readonly kind: "text";
|
|
263
|
+
readonly locator: Locator;
|
|
264
|
+
readonly value: StringValue;
|
|
265
|
+
readonly wait: Budget | undefined;
|
|
266
|
+
} | {
|
|
267
|
+
readonly assertion: SingletonAssertion;
|
|
268
|
+
readonly kind: "singleton";
|
|
269
|
+
readonly singleton: string;
|
|
270
|
+
readonly wait: Budget | undefined;
|
|
271
|
+
} | {
|
|
272
|
+
readonly kind: "browser";
|
|
273
|
+
readonly name: BrowserSingleton;
|
|
274
|
+
readonly value: StringValue;
|
|
275
|
+
readonly wait: Budget | undefined;
|
|
276
|
+
} | {
|
|
277
|
+
readonly assertion: StateAssertion$1;
|
|
278
|
+
readonly entity: string;
|
|
279
|
+
readonly key: Record<string, WhereValue>;
|
|
280
|
+
readonly kind: "state";
|
|
281
|
+
readonly wait: Budget | undefined;
|
|
282
|
+
} | {
|
|
283
|
+
readonly kind: "jsErrors";
|
|
284
|
+
} | {
|
|
285
|
+
readonly kind: "not";
|
|
286
|
+
readonly predicate: Predicate;
|
|
287
|
+
} | {
|
|
288
|
+
readonly kind: "and";
|
|
289
|
+
readonly predicates: ReadonlyArray<Predicate>;
|
|
290
|
+
} | {
|
|
291
|
+
readonly entity: string;
|
|
292
|
+
readonly kind: "count";
|
|
293
|
+
readonly value: number;
|
|
294
|
+
} | {
|
|
295
|
+
readonly condition: Predicate;
|
|
296
|
+
readonly consequence: Predicate;
|
|
297
|
+
readonly kind: "when";
|
|
298
|
+
readonly otherwise: Predicate | undefined;
|
|
299
|
+
};
|
|
300
|
+
type Condition = Extract<Predicate, {
|
|
301
|
+
kind: "singleton" | "count";
|
|
302
|
+
}> | {
|
|
303
|
+
readonly kind: "not";
|
|
304
|
+
readonly predicate: Condition;
|
|
305
|
+
} | {
|
|
306
|
+
readonly kind: "and";
|
|
307
|
+
readonly predicates: ReadonlyArray<Condition>;
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
declare const CLIENT_MOUNT_KEY = "__ripplo__";
|
|
311
|
+
declare const CLIENT_SEED_KEY = "__ripplo_seed__";
|
|
312
|
+
declare const stepSchema: z.ZodObject<{
|
|
313
|
+
action: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
314
|
+
kind: z.ZodLiteral<"goto">;
|
|
315
|
+
url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
316
|
+
ref: z.ZodString;
|
|
317
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
318
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
319
|
+
ref: z.ZodString;
|
|
320
|
+
}, z.core.$strip>]>>;
|
|
321
|
+
}, z.core.$strip>]>;
|
|
322
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
323
|
+
kind: z.ZodLiteral<"fill">;
|
|
324
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
325
|
+
value: z.ZodUnion<readonly [z.ZodObject<{
|
|
326
|
+
ref: z.ZodString;
|
|
327
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
|
328
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
329
|
+
ref: z.ZodString;
|
|
330
|
+
}, z.core.$strip>]>>;
|
|
331
|
+
}, z.core.$strip>, z.ZodNull]>;
|
|
332
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
333
|
+
kind: z.ZodLiteral<"clear">;
|
|
334
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
335
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
336
|
+
kind: z.ZodLiteral<"click">;
|
|
337
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
338
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
339
|
+
kind: z.ZodLiteral<"dblclick">;
|
|
340
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
341
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
342
|
+
kind: z.ZodLiteral<"select">;
|
|
343
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
344
|
+
value: z.ZodUnion<readonly [z.ZodObject<{
|
|
345
|
+
ref: z.ZodString;
|
|
346
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
|
347
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
348
|
+
ref: z.ZodString;
|
|
349
|
+
}, z.core.$strip>]>>;
|
|
350
|
+
}, z.core.$strip>, z.ZodNull]>;
|
|
351
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
352
|
+
kind: z.ZodLiteral<"check">;
|
|
353
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
354
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
355
|
+
kind: z.ZodLiteral<"uncheck">;
|
|
356
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
357
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
358
|
+
kind: z.ZodLiteral<"hover">;
|
|
359
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
360
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
361
|
+
files: z.ZodArray<z.ZodString>;
|
|
362
|
+
kind: z.ZodLiteral<"upload">;
|
|
363
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
364
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
365
|
+
key: z.ZodString;
|
|
366
|
+
kind: z.ZodLiteral<"press">;
|
|
367
|
+
locator: z.ZodOptional<z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>>;
|
|
368
|
+
}, z.core.$strip>], "kind">;
|
|
369
|
+
expect: z.ZodDefault<z.ZodArray<z.ZodType<Predicate, unknown, z.core.$ZodTypeInternals<Predicate, unknown>>>>;
|
|
370
|
+
}, z.core.$strip>;
|
|
371
|
+
type Step = z.infer<typeof stepSchema>;
|
|
372
|
+
declare const testSchema: z.ZodObject<{
|
|
373
|
+
absent: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
374
|
+
entity: z.ZodString;
|
|
375
|
+
where: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
376
|
+
ref: z.ZodString;
|
|
377
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
|
378
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
379
|
+
ref: z.ZodString;
|
|
380
|
+
}, z.core.$strip>]>>;
|
|
381
|
+
}, z.core.$strip>, z.ZodNull]>>;
|
|
382
|
+
}, z.core.$strip>>>;
|
|
383
|
+
exclusive: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
384
|
+
intent: z.ZodString;
|
|
385
|
+
invariants: z.ZodDefault<z.ZodArray<z.ZodType<Predicate, unknown, z.core.$ZodTypeInternals<Predicate, unknown>>>>;
|
|
386
|
+
maybe: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
387
|
+
as: z.ZodString;
|
|
388
|
+
entity: z.ZodString;
|
|
389
|
+
set: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
390
|
+
ref: z.ZodString;
|
|
391
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
|
392
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
393
|
+
ref: z.ZodString;
|
|
394
|
+
}, z.core.$strip>]>>;
|
|
395
|
+
}, z.core.$strip>, z.ZodNull]>>;
|
|
396
|
+
}, z.core.$strip>>>;
|
|
397
|
+
name: z.ZodString;
|
|
398
|
+
params: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
399
|
+
example: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
400
|
+
valueSpace: z.ZodString;
|
|
401
|
+
}, z.core.$strip>>;
|
|
402
|
+
singletons: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
403
|
+
ref: z.ZodString;
|
|
404
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
|
405
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
406
|
+
ref: z.ZodString;
|
|
407
|
+
}, z.core.$strip>]>>;
|
|
408
|
+
}, z.core.$strip>, z.ZodNull]>>>;
|
|
409
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
410
|
+
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
411
|
+
action: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
412
|
+
kind: z.ZodLiteral<"goto">;
|
|
413
|
+
url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
414
|
+
ref: z.ZodString;
|
|
415
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
416
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
417
|
+
ref: z.ZodString;
|
|
418
|
+
}, z.core.$strip>]>>;
|
|
419
|
+
}, z.core.$strip>]>;
|
|
420
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
421
|
+
kind: z.ZodLiteral<"fill">;
|
|
422
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
423
|
+
value: z.ZodUnion<readonly [z.ZodObject<{
|
|
424
|
+
ref: z.ZodString;
|
|
425
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
|
426
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
427
|
+
ref: z.ZodString;
|
|
428
|
+
}, z.core.$strip>]>>;
|
|
429
|
+
}, z.core.$strip>, z.ZodNull]>;
|
|
430
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
431
|
+
kind: z.ZodLiteral<"clear">;
|
|
432
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
433
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
434
|
+
kind: z.ZodLiteral<"click">;
|
|
435
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
436
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
437
|
+
kind: z.ZodLiteral<"dblclick">;
|
|
438
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
439
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
440
|
+
kind: z.ZodLiteral<"select">;
|
|
441
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
442
|
+
value: z.ZodUnion<readonly [z.ZodObject<{
|
|
443
|
+
ref: z.ZodString;
|
|
444
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
|
445
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
446
|
+
ref: z.ZodString;
|
|
447
|
+
}, z.core.$strip>]>>;
|
|
448
|
+
}, z.core.$strip>, z.ZodNull]>;
|
|
449
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
450
|
+
kind: z.ZodLiteral<"check">;
|
|
451
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
452
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
453
|
+
kind: z.ZodLiteral<"uncheck">;
|
|
454
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
455
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
456
|
+
kind: z.ZodLiteral<"hover">;
|
|
457
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
458
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
459
|
+
files: z.ZodArray<z.ZodString>;
|
|
460
|
+
kind: z.ZodLiteral<"upload">;
|
|
461
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
462
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
463
|
+
key: z.ZodString;
|
|
464
|
+
kind: z.ZodLiteral<"press">;
|
|
465
|
+
locator: z.ZodOptional<z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>>;
|
|
466
|
+
}, z.core.$strip>], "kind">;
|
|
467
|
+
expect: z.ZodDefault<z.ZodArray<z.ZodType<Predicate, unknown, z.core.$ZodTypeInternals<Predicate, unknown>>>>;
|
|
468
|
+
}, z.core.$strip>>>;
|
|
469
|
+
stub: z.ZodDefault<z.ZodBoolean>;
|
|
470
|
+
world: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
471
|
+
as: z.ZodString;
|
|
472
|
+
entity: z.ZodString;
|
|
473
|
+
set: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
474
|
+
ref: z.ZodString;
|
|
475
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
|
476
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
477
|
+
ref: z.ZodString;
|
|
478
|
+
}, z.core.$strip>]>>;
|
|
479
|
+
}, z.core.$strip>, z.ZodNull]>>;
|
|
480
|
+
}, z.core.$strip>>>;
|
|
481
|
+
}, z.core.$strip>;
|
|
482
|
+
type Test = z.infer<typeof testSchema>;
|
|
483
|
+
declare const lockfileSchema: z.ZodObject<{
|
|
484
|
+
entities: z.ZodArray<z.ZodObject<{
|
|
485
|
+
description: z.ZodOptional<z.ZodString>;
|
|
486
|
+
identity: z.ZodArray<z.ZodString>;
|
|
487
|
+
identityKind: z.ZodEnum<{
|
|
488
|
+
surrogate: "surrogate";
|
|
489
|
+
natural: "natural";
|
|
490
|
+
}>;
|
|
491
|
+
name: z.ZodString;
|
|
492
|
+
props: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
493
|
+
consistency: z.ZodDefault<z.ZodEnum<{
|
|
494
|
+
strict: "strict";
|
|
495
|
+
eventual: "eventual";
|
|
496
|
+
}>>;
|
|
497
|
+
optional: z.ZodBoolean;
|
|
498
|
+
stable: z.ZodBoolean;
|
|
499
|
+
type: z.ZodEnum<{
|
|
500
|
+
string: "string";
|
|
501
|
+
number: "number";
|
|
502
|
+
boolean: "boolean";
|
|
503
|
+
}>;
|
|
504
|
+
valueSpace: z.ZodOptional<z.ZodString>;
|
|
505
|
+
}, z.core.$strip>>;
|
|
506
|
+
source: z.ZodDefault<z.ZodEnum<{
|
|
507
|
+
backend: "backend";
|
|
508
|
+
client: "client";
|
|
509
|
+
}>>;
|
|
510
|
+
}, z.core.$strip>>;
|
|
511
|
+
fixtures: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
512
|
+
sha256: z.ZodString;
|
|
513
|
+
size: z.ZodNumber;
|
|
514
|
+
}, z.core.$strip>>>;
|
|
515
|
+
singletons: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
516
|
+
consistency: z.ZodDefault<z.ZodEnum<{
|
|
517
|
+
strict: "strict";
|
|
518
|
+
eventual: "eventual";
|
|
519
|
+
}>>;
|
|
520
|
+
default: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
521
|
+
description: z.ZodOptional<z.ZodString>;
|
|
522
|
+
name: z.ZodString;
|
|
523
|
+
source: z.ZodDefault<z.ZodEnum<{
|
|
524
|
+
backend: "backend";
|
|
525
|
+
client: "client";
|
|
526
|
+
}>>;
|
|
527
|
+
type: z.ZodEnum<{
|
|
528
|
+
string: "string";
|
|
529
|
+
number: "number";
|
|
530
|
+
boolean: "boolean";
|
|
531
|
+
}>;
|
|
532
|
+
valueSpace: z.ZodOptional<z.ZodString>;
|
|
533
|
+
}, z.core.$strip>>>;
|
|
534
|
+
tests: z.ZodArray<z.ZodObject<{
|
|
535
|
+
absent: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
536
|
+
entity: z.ZodString;
|
|
537
|
+
where: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
538
|
+
ref: z.ZodString;
|
|
539
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
|
540
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
541
|
+
ref: z.ZodString;
|
|
542
|
+
}, z.core.$strip>]>>;
|
|
543
|
+
}, z.core.$strip>, z.ZodNull]>>;
|
|
544
|
+
}, z.core.$strip>>>;
|
|
545
|
+
exclusive: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
546
|
+
intent: z.ZodString;
|
|
547
|
+
invariants: z.ZodDefault<z.ZodArray<z.ZodType<Predicate, unknown, z.core.$ZodTypeInternals<Predicate, unknown>>>>;
|
|
548
|
+
maybe: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
549
|
+
as: z.ZodString;
|
|
550
|
+
entity: z.ZodString;
|
|
551
|
+
set: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
552
|
+
ref: z.ZodString;
|
|
553
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
|
554
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
555
|
+
ref: z.ZodString;
|
|
556
|
+
}, z.core.$strip>]>>;
|
|
557
|
+
}, z.core.$strip>, z.ZodNull]>>;
|
|
558
|
+
}, z.core.$strip>>>;
|
|
559
|
+
name: z.ZodString;
|
|
560
|
+
params: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
561
|
+
example: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
562
|
+
valueSpace: z.ZodString;
|
|
563
|
+
}, z.core.$strip>>;
|
|
564
|
+
singletons: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
565
|
+
ref: z.ZodString;
|
|
566
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
|
567
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
568
|
+
ref: z.ZodString;
|
|
569
|
+
}, z.core.$strip>]>>;
|
|
570
|
+
}, z.core.$strip>, z.ZodNull]>>>;
|
|
571
|
+
sourcePath: z.ZodOptional<z.ZodString>;
|
|
572
|
+
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
573
|
+
action: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
574
|
+
kind: z.ZodLiteral<"goto">;
|
|
575
|
+
url: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
576
|
+
ref: z.ZodString;
|
|
577
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
578
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
579
|
+
ref: z.ZodString;
|
|
580
|
+
}, z.core.$strip>]>>;
|
|
581
|
+
}, z.core.$strip>]>;
|
|
582
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
583
|
+
kind: z.ZodLiteral<"fill">;
|
|
584
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
585
|
+
value: z.ZodUnion<readonly [z.ZodObject<{
|
|
586
|
+
ref: z.ZodString;
|
|
587
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
|
588
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
589
|
+
ref: z.ZodString;
|
|
590
|
+
}, z.core.$strip>]>>;
|
|
591
|
+
}, z.core.$strip>, z.ZodNull]>;
|
|
592
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
593
|
+
kind: z.ZodLiteral<"clear">;
|
|
594
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
595
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
596
|
+
kind: z.ZodLiteral<"click">;
|
|
597
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
598
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
599
|
+
kind: z.ZodLiteral<"dblclick">;
|
|
600
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
601
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
602
|
+
kind: z.ZodLiteral<"select">;
|
|
603
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
604
|
+
value: z.ZodUnion<readonly [z.ZodObject<{
|
|
605
|
+
ref: z.ZodString;
|
|
606
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
|
607
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
608
|
+
ref: z.ZodString;
|
|
609
|
+
}, z.core.$strip>]>>;
|
|
610
|
+
}, z.core.$strip>, z.ZodNull]>;
|
|
611
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
612
|
+
kind: z.ZodLiteral<"check">;
|
|
613
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
614
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
615
|
+
kind: z.ZodLiteral<"uncheck">;
|
|
616
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
617
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
618
|
+
kind: z.ZodLiteral<"hover">;
|
|
619
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
620
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
621
|
+
files: z.ZodArray<z.ZodString>;
|
|
622
|
+
kind: z.ZodLiteral<"upload">;
|
|
623
|
+
locator: z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>;
|
|
624
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
625
|
+
key: z.ZodString;
|
|
626
|
+
kind: z.ZodLiteral<"press">;
|
|
627
|
+
locator: z.ZodOptional<z.ZodType<Locator, unknown, z.core.$ZodTypeInternals<Locator, unknown>>>;
|
|
628
|
+
}, z.core.$strip>], "kind">;
|
|
629
|
+
expect: z.ZodDefault<z.ZodArray<z.ZodType<Predicate, unknown, z.core.$ZodTypeInternals<Predicate, unknown>>>>;
|
|
630
|
+
}, z.core.$strip>>>;
|
|
631
|
+
stub: z.ZodDefault<z.ZodBoolean>;
|
|
632
|
+
world: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
633
|
+
as: z.ZodString;
|
|
634
|
+
entity: z.ZodString;
|
|
635
|
+
set: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
636
|
+
ref: z.ZodString;
|
|
637
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
|
638
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
639
|
+
ref: z.ZodString;
|
|
640
|
+
}, z.core.$strip>]>>;
|
|
641
|
+
}, z.core.$strip>, z.ZodNull]>>;
|
|
642
|
+
}, z.core.$strip>>>;
|
|
643
|
+
}, z.core.$strip>>;
|
|
644
|
+
valueSpaces: z.ZodArray<z.ZodObject<{
|
|
645
|
+
constraints: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
646
|
+
kind: z.ZodLiteral<"string">;
|
|
647
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
648
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
649
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
650
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
651
|
+
kind: z.ZodLiteral<"number">;
|
|
652
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
653
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
654
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
655
|
+
kind: z.ZodLiteral<"datetime">;
|
|
656
|
+
maxOffsetDays: z.ZodNumber;
|
|
657
|
+
minOffsetDays: z.ZodNumber;
|
|
658
|
+
}, z.core.$strip>], "kind">>;
|
|
659
|
+
generator: z.ZodEnum<{
|
|
660
|
+
"company.name": "company.name";
|
|
661
|
+
"date.iso": "date.iso";
|
|
662
|
+
"internet.email": "internet.email";
|
|
663
|
+
"internet.url": "internet.url";
|
|
664
|
+
"person.fullName": "person.fullName";
|
|
665
|
+
"lorem.slug": "lorem.slug";
|
|
666
|
+
"lorem.word": "lorem.word";
|
|
667
|
+
}>;
|
|
668
|
+
name: z.ZodString;
|
|
669
|
+
type: z.ZodEnum<{
|
|
670
|
+
string: "string";
|
|
671
|
+
number: "number";
|
|
672
|
+
boolean: "boolean";
|
|
673
|
+
}>;
|
|
674
|
+
values: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
675
|
+
}, z.core.$strip>>;
|
|
676
|
+
}, z.core.$strip>;
|
|
677
|
+
type Lockfile = z.infer<typeof lockfileSchema>;
|
|
678
|
+
declare const sessionSchema: z.ZodObject<{
|
|
679
|
+
cookies: z.ZodArray<z.ZodObject<{
|
|
680
|
+
domain: z.ZodString;
|
|
681
|
+
expires: z.ZodNumber;
|
|
682
|
+
httpOnly: z.ZodBoolean;
|
|
683
|
+
name: z.ZodString;
|
|
684
|
+
path: z.ZodString;
|
|
685
|
+
sameSite: z.ZodEnum<{
|
|
686
|
+
Strict: "Strict";
|
|
687
|
+
Lax: "Lax";
|
|
688
|
+
None: "None";
|
|
689
|
+
}>;
|
|
690
|
+
secure: z.ZodBoolean;
|
|
691
|
+
value: z.ZodString;
|
|
692
|
+
}, z.core.$strip>>;
|
|
693
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
694
|
+
origins: z.ZodArray<z.ZodObject<{
|
|
695
|
+
localStorage: z.ZodArray<z.ZodObject<{
|
|
696
|
+
name: z.ZodString;
|
|
697
|
+
value: z.ZodString;
|
|
698
|
+
}, z.core.$strip>>;
|
|
699
|
+
origin: z.ZodString;
|
|
700
|
+
}, z.core.$strip>>;
|
|
701
|
+
}, z.core.$strip>;
|
|
702
|
+
type Session = z.infer<typeof sessionSchema>;
|
|
703
|
+
|
|
704
|
+
declare const rowSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodNull]>>;
|
|
705
|
+
type Row = z.infer<typeof rowSchema>;
|
|
706
|
+
declare const setupSpecSchema: z.ZodObject<{
|
|
707
|
+
as: z.ZodString;
|
|
708
|
+
entity: z.ZodString;
|
|
709
|
+
fields: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
710
|
+
ref: z.ZodString;
|
|
711
|
+
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodObject<{
|
|
712
|
+
template: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
713
|
+
ref: z.ZodString;
|
|
714
|
+
}, z.core.$strip>]>>;
|
|
715
|
+
}, z.core.$strip>, z.ZodNull]>>;
|
|
716
|
+
}, z.core.$strip>;
|
|
717
|
+
type SetupSpec = z.infer<typeof setupSpecSchema>;
|
|
718
|
+
declare const setupRowSchema: z.ZodObject<{
|
|
719
|
+
as: z.ZodString;
|
|
720
|
+
row: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodNull]>>;
|
|
721
|
+
session: z.ZodOptional<z.ZodObject<{
|
|
722
|
+
cookies: z.ZodArray<z.ZodObject<{
|
|
723
|
+
domain: z.ZodString;
|
|
724
|
+
expires: z.ZodNumber;
|
|
725
|
+
httpOnly: z.ZodBoolean;
|
|
726
|
+
name: z.ZodString;
|
|
727
|
+
path: z.ZodString;
|
|
728
|
+
sameSite: z.ZodEnum<{
|
|
729
|
+
Strict: "Strict";
|
|
730
|
+
Lax: "Lax";
|
|
731
|
+
None: "None";
|
|
732
|
+
}>;
|
|
733
|
+
secure: z.ZodBoolean;
|
|
734
|
+
value: z.ZodString;
|
|
735
|
+
}, z.core.$strip>>;
|
|
736
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
737
|
+
origins: z.ZodArray<z.ZodObject<{
|
|
738
|
+
localStorage: z.ZodArray<z.ZodObject<{
|
|
739
|
+
name: z.ZodString;
|
|
740
|
+
value: z.ZodString;
|
|
741
|
+
}, z.core.$strip>>;
|
|
742
|
+
origin: z.ZodString;
|
|
743
|
+
}, z.core.$strip>>;
|
|
744
|
+
}, z.core.$strip>>;
|
|
745
|
+
}, z.core.$strip>;
|
|
746
|
+
type SetupRow = z.infer<typeof setupRowSchema>;
|
|
747
|
+
|
|
748
|
+
type Primitive = string | number | boolean;
|
|
749
|
+
type Fields = Record<string, Primitive>;
|
|
750
|
+
interface ParamToken {
|
|
751
|
+
readonly base: string;
|
|
752
|
+
readonly example: Primitive | undefined;
|
|
753
|
+
readonly valueSpace: string;
|
|
754
|
+
}
|
|
755
|
+
type EntityKind = "of" | "only" | "maybe";
|
|
756
|
+
type CaptureKind = "created" | "updated";
|
|
757
|
+
interface EntityDescriptor {
|
|
758
|
+
readonly entity: string;
|
|
759
|
+
readonly kind: EntityKind | CaptureKind;
|
|
760
|
+
readonly props: Record<string, SetValue>;
|
|
761
|
+
}
|
|
762
|
+
interface AbsenceDescriptor {
|
|
763
|
+
readonly entity: string;
|
|
764
|
+
readonly kind: "none";
|
|
765
|
+
readonly where: Record<string, SetValue>;
|
|
766
|
+
}
|
|
767
|
+
interface SingletonStateDescriptor {
|
|
768
|
+
readonly kind: "singletonState";
|
|
769
|
+
readonly singleton: string;
|
|
770
|
+
readonly value: SetValue;
|
|
771
|
+
}
|
|
772
|
+
type AnyDescriptor = EntityDescriptor | AbsenceDescriptor | SingletonStateDescriptor;
|
|
773
|
+
interface FieldBind {
|
|
774
|
+
readonly descriptor: EntityDescriptor;
|
|
775
|
+
readonly field: string;
|
|
776
|
+
readonly kind: "field";
|
|
777
|
+
}
|
|
778
|
+
interface ParamBind {
|
|
779
|
+
readonly kind: "param";
|
|
780
|
+
readonly token: ParamToken;
|
|
781
|
+
}
|
|
782
|
+
type Bind = FieldBind | ParamBind;
|
|
783
|
+
declare const bindingBrand: unique symbol;
|
|
784
|
+
type Binding<T extends Primitive> = ValueRef & {
|
|
785
|
+
readonly __bind: Bind;
|
|
786
|
+
readonly [bindingBrand]: T;
|
|
787
|
+
};
|
|
788
|
+
type AnyBinding = Binding<Primitive>;
|
|
789
|
+
interface Carrier<D extends AnyDescriptor> {
|
|
790
|
+
readonly __entity: D;
|
|
791
|
+
}
|
|
792
|
+
type EntityHandle<F extends Fields> = {
|
|
793
|
+
readonly [K in keyof F]: Binding<F[K]>;
|
|
794
|
+
} & Carrier<EntityDescriptor>;
|
|
795
|
+
type AbsenceHandle = Carrier<AbsenceDescriptor>;
|
|
796
|
+
type GivenItem = Carrier<AnyDescriptor>;
|
|
797
|
+
|
|
798
|
+
interface LeafPredicate {
|
|
799
|
+
readonly predicate: Predicate;
|
|
800
|
+
readonly wait: (budget: Budget) => LeafPredicate;
|
|
801
|
+
}
|
|
802
|
+
interface ConditionPredicate {
|
|
803
|
+
readonly __condition: true;
|
|
804
|
+
readonly predicate: Condition;
|
|
805
|
+
readonly wait: (budget: Budget) => ConditionPredicate;
|
|
806
|
+
}
|
|
807
|
+
type ConditionInput = ConditionPredicate;
|
|
808
|
+
interface CapturePredicate<Out extends Fields> {
|
|
809
|
+
readonly predicate: Predicate;
|
|
810
|
+
readonly ref: EntityHandle<Out>;
|
|
811
|
+
readonly wait: (budget: Budget) => CapturePredicate<Out>;
|
|
812
|
+
}
|
|
813
|
+
type StateAssertion = Extract<Predicate, {
|
|
814
|
+
kind: "state";
|
|
815
|
+
}>["assertion"];
|
|
816
|
+
interface Capture {
|
|
817
|
+
readonly assertion: StateAssertion;
|
|
818
|
+
readonly descriptor: EntityDescriptor;
|
|
819
|
+
}
|
|
820
|
+
type PredicateInput = LeafPredicate | Predicate;
|
|
821
|
+
declare function visible(locator: Locator): LeafPredicate;
|
|
822
|
+
declare function disabled(locator: Locator): LeafPredicate;
|
|
823
|
+
declare function enabled(locator: Locator): LeafPredicate;
|
|
824
|
+
declare function focused(locator: Locator): LeafPredicate;
|
|
825
|
+
declare function value(locator: Locator, binding: Binding<string> | string): LeafPredicate;
|
|
826
|
+
declare function text(locator: Locator, binding: Binding<string> | string): LeafPredicate;
|
|
827
|
+
declare function not(input: ConditionInput): ConditionPredicate;
|
|
828
|
+
declare function not(input: PredicateInput): LeafPredicate;
|
|
829
|
+
declare function and(...conditions: ReadonlyArray<ConditionInput>): ConditionPredicate;
|
|
830
|
+
interface Countable {
|
|
831
|
+
readonly name: string;
|
|
832
|
+
}
|
|
833
|
+
interface CountCondition {
|
|
834
|
+
readonly is: (count: number) => ConditionPredicate;
|
|
835
|
+
}
|
|
836
|
+
declare function count(entity: Countable): CountCondition;
|
|
837
|
+
type WhenClause = readonly [ConditionInput, PredicateInput];
|
|
838
|
+
declare function when(...clauses: readonly WhenClause[]): LeafPredicate;
|
|
839
|
+
declare function when(...clausesThenFallback: readonly [...WhenClause[], PredicateInput]): LeafPredicate;
|
|
840
|
+
|
|
841
|
+
interface ValueSpacePartial<T extends Primitive> {
|
|
842
|
+
readonly __t: T | undefined;
|
|
843
|
+
readonly constraints: Constraints | undefined;
|
|
844
|
+
readonly generator: Generator;
|
|
845
|
+
readonly primitive: PrimitiveType;
|
|
846
|
+
readonly values: ReadonlyArray<T> | undefined;
|
|
847
|
+
}
|
|
848
|
+
type StringConstraintsArg = Omit<StringConstraints, "kind">;
|
|
849
|
+
type NumberConstraintsArg = Required<Omit<NumberConstraints, "kind">>;
|
|
850
|
+
interface DatetimeOptions {
|
|
851
|
+
readonly offsetDays: {
|
|
852
|
+
readonly max: number;
|
|
853
|
+
readonly min: number;
|
|
854
|
+
};
|
|
855
|
+
}
|
|
856
|
+
declare const v: {
|
|
857
|
+
boolean: () => ValueSpacePartial<boolean>;
|
|
858
|
+
companyName: (constraints?: StringConstraintsArg) => ValueSpacePartial<string>;
|
|
859
|
+
datetime: (options: DatetimeOptions) => ValueSpacePartial<string>;
|
|
860
|
+
email: (constraints?: StringConstraintsArg) => ValueSpacePartial<string>;
|
|
861
|
+
fullName: (constraints?: StringConstraintsArg) => ValueSpacePartial<string>;
|
|
862
|
+
id: (constraints?: StringConstraintsArg) => ValueSpacePartial<string>;
|
|
863
|
+
number: (constraints: NumberConstraintsArg) => ValueSpacePartial<number>;
|
|
864
|
+
oneOf: <T extends Primitive>(values: readonly [T, ...T[]]) => ValueSpacePartial<T>;
|
|
865
|
+
slug: (constraints?: StringConstraintsArg) => ValueSpacePartial<string>;
|
|
866
|
+
url: (constraints?: StringConstraintsArg) => ValueSpacePartial<string>;
|
|
867
|
+
word: (constraints?: StringConstraintsArg) => ValueSpacePartial<string>;
|
|
868
|
+
};
|
|
869
|
+
interface PropBuilder<T extends Primitive, Opt extends boolean = boolean> {
|
|
870
|
+
readonly __o: Opt | undefined;
|
|
871
|
+
readonly __t: T | undefined;
|
|
872
|
+
readonly spec: PropSpec;
|
|
873
|
+
readonly valueSpace: ValueSpacePartial<Primitive> | undefined;
|
|
874
|
+
}
|
|
875
|
+
type Mods = Partial<{
|
|
876
|
+
readonly consistency: ConsistencyClass;
|
|
877
|
+
readonly optional: boolean;
|
|
878
|
+
readonly stable: boolean;
|
|
879
|
+
}>;
|
|
880
|
+
type IsOptional = {
|
|
881
|
+
readonly optional: true;
|
|
882
|
+
};
|
|
883
|
+
type FieldOptions<T extends Primitive> = {
|
|
884
|
+
readonly value: ValueSpacePartial<T>;
|
|
885
|
+
} & Mods;
|
|
886
|
+
declare function field<T extends Primitive>(options: FieldOptions<T> & IsOptional): PropBuilder<T, true>;
|
|
887
|
+
declare function field<T extends Primitive>(options: FieldOptions<T>): PropBuilder<T, false>;
|
|
888
|
+
interface IdentityBuilder<T extends Primitive, K extends "natural" | "surrogate" = "natural" | "surrogate"> {
|
|
889
|
+
readonly idKind: K;
|
|
890
|
+
readonly prop: PropBuilder<T>;
|
|
891
|
+
}
|
|
892
|
+
declare function id(): IdentityBuilder<string, "surrogate">;
|
|
893
|
+
declare function key<T extends Primitive>(options: FieldOptions<T>): IdentityBuilder<T, "natural">;
|
|
894
|
+
interface FieldHandle<T extends Primitive> {
|
|
895
|
+
readonly __t: T | undefined;
|
|
896
|
+
readonly entity: string;
|
|
897
|
+
readonly field: string;
|
|
898
|
+
readonly primitive: PrimitiveType;
|
|
899
|
+
readonly valueSpaceName: string;
|
|
900
|
+
}
|
|
901
|
+
type Settable<T extends Primitive, K, OptK> = Binding<T> | T | (K extends OptK ? null : never);
|
|
902
|
+
type Props<Out extends Fields, OptK extends PropertyKey> = Partial<{
|
|
903
|
+
[K in keyof Out]: Settable<Out[K], K, OptK>;
|
|
904
|
+
}>;
|
|
905
|
+
type UpdateProps<Out extends Fields, OptK extends PropertyKey> = Partial<{
|
|
906
|
+
[K in keyof Out]: Settable<Out[K], K, OptK> | Changed;
|
|
907
|
+
}>;
|
|
908
|
+
type Setters<In extends Fields, OptK extends PropertyKey> = Partial<{
|
|
909
|
+
[K in keyof In]: Settable<In[K], K, OptK>;
|
|
910
|
+
}>;
|
|
911
|
+
interface Selection<S extends Fields> {
|
|
912
|
+
readonly __s: S | undefined;
|
|
913
|
+
readonly entity: string;
|
|
914
|
+
readonly where: Record<string, WhereValue>;
|
|
915
|
+
}
|
|
916
|
+
interface WithinMatcher<T extends Primitive> {
|
|
917
|
+
readonly __t: T | undefined;
|
|
918
|
+
readonly field: string;
|
|
919
|
+
readonly kind: "within";
|
|
920
|
+
readonly selection: {
|
|
921
|
+
readonly entity: string;
|
|
922
|
+
readonly where: Record<string, WhereValue>;
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
type Criteria<S extends Fields> = Partial<{
|
|
926
|
+
[K in keyof S]: Binding<S[K]> | S[K] | WithinMatcher<S[K]>;
|
|
927
|
+
}>;
|
|
928
|
+
type WhereInput<Sel extends Fields, OptK extends PropertyKey> = Partial<{
|
|
929
|
+
[K in keyof Sel]: Settable<Sel[K], K, OptK> | WithinMatcher<Sel[K]>;
|
|
930
|
+
}>;
|
|
931
|
+
type FieldsOfType<S, T extends Primitive> = {
|
|
932
|
+
[K in keyof S]: S[K] extends T ? K : never;
|
|
933
|
+
}[keyof S];
|
|
934
|
+
declare function within<S extends Fields, T extends Primitive = Primitive>(selection: Selection<S>, sourceField: FieldsOfType<S, T>): WithinMatcher<T>;
|
|
935
|
+
declare function changed(): Changed;
|
|
936
|
+
interface EntityDef<In extends Fields = Fields, Out extends Fields = Fields, Sel extends Fields = Out, OptK extends PropertyKey = PropertyKey, Name extends string = string, Src extends Source = Source> {
|
|
937
|
+
readonly field: {
|
|
938
|
+
readonly [K in keyof Out]: FieldHandle<Out[K]>;
|
|
939
|
+
};
|
|
940
|
+
readonly name: Name;
|
|
941
|
+
readonly schema: EntitySchema;
|
|
942
|
+
readonly source: Src;
|
|
943
|
+
readonly valueSpaces: ReadonlyArray<ValueSpace>;
|
|
944
|
+
readonly created: (props: Props<Out, OptK>) => CapturePredicate<Out>;
|
|
945
|
+
readonly deleted: (where: WhereInput<Sel, OptK>) => LeafPredicate;
|
|
946
|
+
readonly maybe: (where: Setters<In, OptK>) => EntityHandle<Out>;
|
|
947
|
+
readonly none: (where: Setters<In, OptK>) => AbsenceHandle;
|
|
948
|
+
readonly of: (props: Setters<In, OptK>) => EntityHandle<Out>;
|
|
949
|
+
readonly only: (props: Setters<In, OptK>) => EntityHandle<Out>;
|
|
950
|
+
readonly updated: (where: WhereInput<Sel, OptK>, props: UpdateProps<Out, OptK>) => CapturePredicate<Out>;
|
|
951
|
+
readonly where: (criteria: Criteria<Sel>) => Selection<Out>;
|
|
952
|
+
}
|
|
953
|
+
type Handle<M extends EntityDef> = ReturnType<M["of"]>;
|
|
954
|
+
interface EntityConfig<I, P, Src extends Source> {
|
|
955
|
+
readonly description: string;
|
|
956
|
+
readonly fields: P;
|
|
957
|
+
readonly identity: I;
|
|
958
|
+
readonly source: Src;
|
|
959
|
+
}
|
|
960
|
+
type IdentityRecord = Record<string, IdentityBuilder<Primitive>>;
|
|
961
|
+
type PropRecord = Record<string, PropBuilder<Primitive>>;
|
|
962
|
+
type FieldTypeOf<B> = B extends PropBuilder<infer T> ? T : never;
|
|
963
|
+
type IdTypeOf<B> = B extends IdentityBuilder<infer T> ? T : never;
|
|
964
|
+
type Flatten<T> = {
|
|
965
|
+
[K in keyof T]: T[K];
|
|
966
|
+
};
|
|
967
|
+
type AllIds<I> = {
|
|
968
|
+
[K in keyof I]: IdTypeOf<I[K]>;
|
|
969
|
+
};
|
|
970
|
+
type NaturalIds<I> = {
|
|
971
|
+
[K in keyof I as I[K] extends IdentityBuilder<Primitive, "natural"> ? K : never]: IdTypeOf<I[K]>;
|
|
972
|
+
};
|
|
973
|
+
type AllProps<P> = {
|
|
974
|
+
[K in keyof P]: FieldTypeOf<P[K]>;
|
|
975
|
+
};
|
|
976
|
+
type OutFields<I, P> = Flatten<AllIds<I> & AllProps<P>>;
|
|
977
|
+
type InFields<I, P> = Flatten<NaturalIds<I> & AllProps<P>>;
|
|
978
|
+
type MatchFields<I, P> = Flatten<AllIds<I> & AllProps<P>>;
|
|
979
|
+
type OptionalKeys<P> = {
|
|
980
|
+
[K in keyof P]: P[K] extends PropBuilder<Primitive, true> ? K : never;
|
|
981
|
+
}[keyof P];
|
|
982
|
+
declare function entity<I extends IdentityRecord, P extends PropRecord, Name extends string, Src extends Source>(name: Name, definition: EntityConfig<I, P, Src>): EntityDef<InFields<I, P>, OutFields<I, P>, MatchFields<I, P>, OptionalKeys<P>, Name, Src>;
|
|
983
|
+
|
|
984
|
+
type SingletonConfig<T extends Primitive$1, Src extends Source> = {
|
|
985
|
+
readonly default: T;
|
|
986
|
+
readonly description: string;
|
|
987
|
+
readonly source: Src;
|
|
988
|
+
readonly value: ValueSpacePartial<T>;
|
|
989
|
+
} & Partial<{
|
|
990
|
+
readonly consistency: ConsistencyClass;
|
|
991
|
+
}>;
|
|
992
|
+
type SingletonValue<T extends Primitive$1> = T | Binding<T>;
|
|
993
|
+
interface SingletonStateHandle<T extends Primitive$1> extends Carrier<SingletonStateDescriptor> {
|
|
994
|
+
readonly is: (value: SingletonValue<T>) => ConditionPredicate;
|
|
995
|
+
}
|
|
996
|
+
interface SingletonDef<Name extends string, T extends Primitive$1 = Primitive$1, Src extends Source = Source> {
|
|
997
|
+
readonly name: Name;
|
|
998
|
+
readonly schema: SingletonSchema;
|
|
999
|
+
readonly source: Src;
|
|
1000
|
+
readonly value: FieldHandle<T>;
|
|
1001
|
+
readonly valueSpaces: ReadonlyArray<ValueSpace>;
|
|
1002
|
+
readonly is: (value: SingletonValue<T>) => ConditionPredicate;
|
|
1003
|
+
readonly of: (value: SingletonValue<T>) => SingletonStateHandle<T>;
|
|
1004
|
+
}
|
|
1005
|
+
declare function singleton<Name extends string, T extends Primitive$1, Src extends Source>(name: Name, config: SingletonConfig<T, Src>): SingletonDef<Name, T, Src>;
|
|
1006
|
+
|
|
1007
|
+
interface EngineError {
|
|
1008
|
+
readonly message: string;
|
|
1009
|
+
}
|
|
1010
|
+
interface EntityMeta {
|
|
1011
|
+
readonly name: string;
|
|
1012
|
+
readonly schema: EntitySchema;
|
|
1013
|
+
readonly valueSpaces: ReadonlyArray<ValueSpace>;
|
|
1014
|
+
}
|
|
1015
|
+
interface SingletonMeta {
|
|
1016
|
+
readonly name: string;
|
|
1017
|
+
readonly schema: SingletonSchema;
|
|
1018
|
+
readonly source: Source;
|
|
1019
|
+
readonly valueSpaces: ReadonlyArray<ValueSpace>;
|
|
1020
|
+
}
|
|
1021
|
+
type EntityList = ReadonlyArray<EntityMeta>;
|
|
1022
|
+
type SingletonList = ReadonlyArray<SingletonMeta>;
|
|
1023
|
+
type Cell = Primitive$1 | null;
|
|
1024
|
+
interface EntityImpl<In extends RowFields, Out extends RowFields> {
|
|
1025
|
+
readonly read: (ctx: {
|
|
1026
|
+
readonly runId: string;
|
|
1027
|
+
}) => Promise<ReadonlyArray<Out>>;
|
|
1028
|
+
readonly seed: (ctx: {
|
|
1029
|
+
readonly fields: In;
|
|
1030
|
+
readonly runId: string;
|
|
1031
|
+
}) => Promise<{
|
|
1032
|
+
readonly row: Out;
|
|
1033
|
+
readonly session: Session | undefined;
|
|
1034
|
+
}>;
|
|
1035
|
+
}
|
|
1036
|
+
type RowFields = Record<string, Cell>;
|
|
1037
|
+
type NullifyOptional<F, Opt extends PropertyKey> = {
|
|
1038
|
+
[K in keyof F]: K extends Opt ? F[K] | null : F[K];
|
|
1039
|
+
};
|
|
1040
|
+
interface SingletonImpl<T extends Primitive$1> {
|
|
1041
|
+
readonly read: (ctx: {
|
|
1042
|
+
readonly runId: string;
|
|
1043
|
+
}) => Promise<T | null>;
|
|
1044
|
+
readonly seed: (ctx: {
|
|
1045
|
+
readonly runId: string;
|
|
1046
|
+
readonly value: T;
|
|
1047
|
+
}) => Promise<void>;
|
|
1048
|
+
}
|
|
1049
|
+
type Teardown = (runId: string) => Promise<void>;
|
|
1050
|
+
interface DeclSource {
|
|
1051
|
+
readonly entities: EntityList;
|
|
1052
|
+
readonly singletons: SingletonList;
|
|
1053
|
+
}
|
|
1054
|
+
type EntityImplFor<D> = D extends EntityDef<infer In, infer Out, infer _Sel, infer Opt, infer _Name, infer _Src> ? EntityImpl<NullifyOptional<In, Opt>, NullifyOptional<Out, Opt>> : never;
|
|
1055
|
+
type SingletonImplFor<D> = D extends SingletonDef<infer _N, infer T, infer _S> ? SingletonImpl<T> : never;
|
|
1056
|
+
interface EngineImpls<R extends DeclSource, Src extends Source> {
|
|
1057
|
+
readonly entities: {
|
|
1058
|
+
readonly [D in Extract<R["entities"][number], {
|
|
1059
|
+
readonly source: Src;
|
|
1060
|
+
}> as D["name"]]: EntityImplFor<D>;
|
|
1061
|
+
};
|
|
1062
|
+
readonly singletons: {
|
|
1063
|
+
readonly [D in Extract<R["singletons"][number], {
|
|
1064
|
+
readonly source: Src;
|
|
1065
|
+
}> as D["name"]]: SingletonImplFor<D>;
|
|
1066
|
+
};
|
|
1067
|
+
}
|
|
1068
|
+
type NameOf<H> = H extends EntityDef<infer _In, infer _Out, infer _Sel, infer _Opt, infer Name> ? Name : never;
|
|
1069
|
+
interface DuplicateEntityName<Name extends string> {
|
|
1070
|
+
readonly __duplicateEntityName: `entity name "${Name}" is declared more than once`;
|
|
1071
|
+
}
|
|
1072
|
+
type UniqueNames<Entities extends EntityList, Seen extends string = never> = Entities extends readonly [infer Head, ...infer Tail] ? Tail extends EntityList ? readonly [
|
|
1073
|
+
NameOf<Head> extends Seen ? DuplicateEntityName<NameOf<Head>> : Head,
|
|
1074
|
+
...UniqueNames<Tail, Seen | NameOf<Head>>
|
|
1075
|
+
] : Entities : Entities;
|
|
1076
|
+
interface EngineRead {
|
|
1077
|
+
readonly entities: Record<string, Row[]>;
|
|
1078
|
+
readonly singletons: Record<string, Cell>;
|
|
1079
|
+
}
|
|
1080
|
+
interface EngineSeedRequest {
|
|
1081
|
+
readonly entities: ReadonlyArray<SetupSpec>;
|
|
1082
|
+
readonly singletons: Record<string, Cell>;
|
|
1083
|
+
}
|
|
1084
|
+
interface EngineReadRequest {
|
|
1085
|
+
readonly entities: ReadonlyArray<string>;
|
|
1086
|
+
readonly singletons: ReadonlyArray<string>;
|
|
1087
|
+
}
|
|
1088
|
+
interface Engine {
|
|
1089
|
+
readonly read: (request: EngineReadRequest, runId: string) => ResultAsync<EngineRead, EngineError>;
|
|
1090
|
+
readonly seed: (request: EngineSeedRequest, runId: string) => ResultAsync<SetupRow[], EngineError>;
|
|
1091
|
+
readonly teardown: (runId: string) => ResultAsync<void, EngineError>;
|
|
1092
|
+
}
|
|
1093
|
+
declare function createEngine<R extends DeclSource>(ripplo: R, impls: EngineImpls<R, "backend">, teardown: Teardown): Engine;
|
|
1094
|
+
|
|
1095
|
+
export { key as $, type AnyBinding as A, type Binding as B, type Capture as C, type DeclSource as D, type Engine as E, type FieldHandle as F, type GivenItem as G, type Handle as H, type SingletonValue as I, type WithinMatcher as J, and as K, type Locator as L, changed as M, count as N, createEngine as O, type PredicateInput as P, disabled as Q, type Row as R, type Step as S, type Test as T, type UniqueNames as U, enabled as V, type WhenClause as W, entity as X, field as Y, focused as Z, id as _, type EntityList as a, not as a0, singleton as a1, text as a2, v as a3, value as a4, visible as a5, when as a6, within as a7, type SingletonList as b, type Lockfile as c, type BrowserSingleton as d, type LeafPredicate as e, type Primitive as f, type Primitive$1 as g, type SingletonDef as h, type AbsenceHandle as i, CLIENT_MOUNT_KEY as j, CLIENT_SEED_KEY as k, type ConditionInput as l, type ConditionPredicate as m, type CountCondition as n, type DuplicateEntityName as o, type EngineError as p, type EngineImpls as q, type EngineRead as r, type EntityDef as s, type EntityHandle as t, type EntityImpl as u, type FieldOptions as v, type Fields as w, type Selection as x, type SingletonConfig as y, type SingletonImpl as z };
|