@dxos/echo-generator 0.3.5-main.8a2ebe5 → 0.3.5-main.8a3798d
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/dist/lib/browser/index.mjs +432 -5
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +432 -5
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/types/src/data.d.ts.map +1 -1
- package/dist/types/src/generator.d.ts +1 -0
- package/dist/types/src/generator.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/data.ts +129 -3
- package/src/generator.ts +5 -0
|
@@ -24,6 +24,9 @@ var TestObjectGenerator = class {
|
|
|
24
24
|
get schemas() {
|
|
25
25
|
return Object.values(this.schema);
|
|
26
26
|
}
|
|
27
|
+
getSchema(typename) {
|
|
28
|
+
return this.schemas.find((schema) => schema.typename === typename);
|
|
29
|
+
}
|
|
27
30
|
createObject({ types } = {}) {
|
|
28
31
|
const type = faker.helpers.arrayElement(types ?? Object.keys(this.schema));
|
|
29
32
|
const factory = this._generators[type];
|
|
@@ -87,8 +90,8 @@ var testSchemas = () => {
|
|
|
87
90
|
]
|
|
88
91
|
});
|
|
89
92
|
const organization = new Schema({
|
|
93
|
+
typename: "example.com/schema/organization",
|
|
90
94
|
props: [
|
|
91
|
-
// TODO(burdon): Add metadata for default label.
|
|
92
95
|
{
|
|
93
96
|
id: "name",
|
|
94
97
|
type: Schema.PropType.STRING
|
|
@@ -98,12 +101,13 @@ var testSchemas = () => {
|
|
|
98
101
|
type: Schema.PropType.STRING
|
|
99
102
|
},
|
|
100
103
|
{
|
|
101
|
-
id: "
|
|
102
|
-
type: Schema.PropType.
|
|
104
|
+
id: "description",
|
|
105
|
+
type: Schema.PropType.STRING
|
|
103
106
|
}
|
|
104
107
|
]
|
|
105
108
|
});
|
|
106
109
|
const person = new Schema({
|
|
110
|
+
typename: "example.com/schema/person",
|
|
107
111
|
props: [
|
|
108
112
|
{
|
|
109
113
|
id: "name",
|
|
@@ -117,15 +121,29 @@ var testSchemas = () => {
|
|
|
117
121
|
id: "org",
|
|
118
122
|
type: Schema.PropType.REF,
|
|
119
123
|
ref: organization
|
|
124
|
+
},
|
|
125
|
+
// TODO(burdon): Convert to object with nested props.
|
|
126
|
+
{
|
|
127
|
+
id: "lat",
|
|
128
|
+
type: Schema.PropType.NUMBER
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "lng",
|
|
132
|
+
type: Schema.PropType.NUMBER
|
|
120
133
|
}
|
|
121
134
|
]
|
|
122
135
|
});
|
|
123
136
|
const project = new Schema({
|
|
137
|
+
typename: "example.com/schema/project",
|
|
124
138
|
props: [
|
|
125
139
|
{
|
|
126
140
|
id: "title",
|
|
127
141
|
type: Schema.PropType.STRING
|
|
128
142
|
},
|
|
143
|
+
{
|
|
144
|
+
id: "description",
|
|
145
|
+
type: Schema.PropType.STRING
|
|
146
|
+
},
|
|
129
147
|
{
|
|
130
148
|
id: "repo",
|
|
131
149
|
type: Schema.PropType.STRING
|
|
@@ -137,6 +155,10 @@ var testSchemas = () => {
|
|
|
137
155
|
{
|
|
138
156
|
id: "priority",
|
|
139
157
|
type: Schema.PropType.NUMBER
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
id: "active",
|
|
161
|
+
type: Schema.PropType.BOOLEAN
|
|
140
162
|
}
|
|
141
163
|
]
|
|
142
164
|
});
|
|
@@ -167,6 +189,7 @@ var testObjectGenerators = {
|
|
|
167
189
|
}),
|
|
168
190
|
person: (provider) => {
|
|
169
191
|
const organizations = provider?.("organization");
|
|
192
|
+
const location = faker2.datatype.boolean() ? faker2.helpers.arrayElement(locations) : void 0;
|
|
170
193
|
return {
|
|
171
194
|
name: faker2.person.fullName(),
|
|
172
195
|
email: faker2.datatype.boolean({
|
|
@@ -174,7 +197,8 @@ var testObjectGenerators = {
|
|
|
174
197
|
}) ? faker2.internet.email() : void 0,
|
|
175
198
|
org: organizations?.length && faker2.datatype.boolean({
|
|
176
199
|
probability: 0.3
|
|
177
|
-
}) ? faker2.helpers.arrayElement(organizations) : void 0
|
|
200
|
+
}) ? faker2.helpers.arrayElement(organizations) : void 0,
|
|
201
|
+
...location
|
|
178
202
|
};
|
|
179
203
|
},
|
|
180
204
|
project: () => ({
|
|
@@ -183,11 +207,414 @@ var testObjectGenerators = {
|
|
|
183
207
|
probability: 0.3
|
|
184
208
|
}) ? faker2.internet.url() : void 0,
|
|
185
209
|
status: faker2.helpers.arrayElement(Status),
|
|
186
|
-
priority: faker2.helpers.arrayElement(Priority)
|
|
210
|
+
priority: faker2.helpers.arrayElement(Priority),
|
|
211
|
+
active: faker2.datatype.boolean()
|
|
187
212
|
})
|
|
188
213
|
};
|
|
189
214
|
var createTestObjectGenerator = () => new TestObjectGenerator(testSchemas(), testObjectGenerators);
|
|
190
215
|
var createSpaceObjectGenerator = (space) => new SpaceObjectGenerator(space, testSchemas(), testObjectGenerators);
|
|
216
|
+
var locations = [
|
|
217
|
+
{
|
|
218
|
+
lat: 139.74946157054467,
|
|
219
|
+
lng: 35.686962764371174
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
lat: -73.98196278740681,
|
|
223
|
+
lng: 40.75192492259464
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
lat: -99.1329340602939,
|
|
227
|
+
lng: 19.444388301415472
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
lat: 72.85504343876647,
|
|
231
|
+
lng: 19.0189362343566
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
lat: -46.62696583905523,
|
|
235
|
+
lng: -23.55673372837896
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
lat: 77.22805816860182,
|
|
239
|
+
lng: 28.671938757181522
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
lat: 121.43455881982015,
|
|
243
|
+
lng: 31.218398311228327
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
lat: 88.32272979950551,
|
|
247
|
+
lng: 22.49691515689642
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
lat: 90.40663360810754,
|
|
251
|
+
lng: 23.725005570312817
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
lat: -58.399477232331435,
|
|
255
|
+
lng: -34.600555749907414
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
lat: -118.18192636994041,
|
|
259
|
+
lng: 33.99192410876543
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
lat: 66.98806305137339,
|
|
263
|
+
lng: 24.87193814681484
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
lat: 31.248022361126118,
|
|
267
|
+
lng: 30.051906205103705
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
lat: -43.22696665284366,
|
|
271
|
+
lng: -22.923077315615956
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
lat: 135.4581989565952,
|
|
275
|
+
lng: 34.75198107491417
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
lat: 116.38633982565943,
|
|
279
|
+
lng: 39.93083808990906
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
lat: 120.9802713035424,
|
|
283
|
+
lng: 14.606104813440538
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
lat: 37.6135769672714,
|
|
287
|
+
lng: 55.75410998124818
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
lat: 29.008055727002613,
|
|
291
|
+
lng: 41.10694201243979
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
lat: 2.33138946713035,
|
|
295
|
+
lng: 48.86863878981461
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
lat: 126.99778513820195,
|
|
299
|
+
lng: 37.56829495838895
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
lat: 3.3895852125984334,
|
|
303
|
+
lng: 6.445207512093191
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
lat: 106.82749176247012,
|
|
307
|
+
lng: -6.172471846798885
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
lat: -87.75200083270931,
|
|
311
|
+
lng: 41.83193651927843
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
lat: 113.32306427226172,
|
|
315
|
+
lng: 23.14692716047989
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
lat: -0.11866770247593195,
|
|
319
|
+
lng: 51.5019405883275
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
lat: -77.05200795343472,
|
|
323
|
+
lng: -12.04606681752557
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
lat: 51.42239817500899,
|
|
327
|
+
lng: 35.673888627001304
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
lat: 15.313026023171744,
|
|
331
|
+
lng: -4.327778243275986
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
lat: -74.08528981377441,
|
|
335
|
+
lng: 4.598369421147822
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
lat: 114.1201772298325,
|
|
339
|
+
lng: 22.554316369677963
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
lat: 114.26807118958311,
|
|
343
|
+
lng: 30.581977209337822
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
lat: 114.18306345846304,
|
|
347
|
+
lng: 22.30692675357551
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
lat: 117.19807322410043,
|
|
351
|
+
lng: 39.13197212310894
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
lat: 80.27805287890033,
|
|
355
|
+
lng: 13.091933670856292
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
lat: 121.568333333333,
|
|
359
|
+
lng: 25.0358333333333
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
lat: 77.55806386521755,
|
|
363
|
+
lng: 12.97194099507442
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
lat: 100.51469879369489,
|
|
367
|
+
lng: 13.751945064087977
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
lat: 74.34807892054346,
|
|
371
|
+
lng: 31.56191739488844
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
lat: 106.59303578916195,
|
|
375
|
+
lng: 29.566922888044644
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
lat: 78.47800771287751,
|
|
379
|
+
lng: 17.401928991511454
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
lat: -70.66898671317483,
|
|
383
|
+
lng: -33.448067956934096
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
lat: -80.22605193945003,
|
|
387
|
+
lng: 25.789556555021534
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
lat: -43.916950376804834,
|
|
391
|
+
lng: -19.91308016391116
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
lat: -3.6852975446125242,
|
|
395
|
+
lng: 40.40197212311381
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
lat: -75.17194183200792,
|
|
399
|
+
lng: 40.001919022526465
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
lat: 72.57805776168215,
|
|
403
|
+
lng: 23.031998775062675
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
lat: 106.69308136207889,
|
|
407
|
+
lng: 10.781971309193409
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
lat: -79.42196665298843,
|
|
411
|
+
lng: 43.70192573640844
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
lat: 103.85387481909902,
|
|
415
|
+
lng: 1.2949793251059418
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
lat: 13.23248118266855,
|
|
419
|
+
lng: -8.836340255012658
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
lat: 44.391922914564134,
|
|
423
|
+
lng: 33.34059435615865
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
lat: 2.181424460619155,
|
|
427
|
+
lng: 41.385245438547486
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
lat: 88.32994665421205,
|
|
431
|
+
lng: 22.580390440861947
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
lat: -96.84196278749818,
|
|
435
|
+
lng: 32.82196968167733
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
lat: 123.44802765120869,
|
|
439
|
+
lng: 41.80692512604918
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
lat: 32.532233380011576,
|
|
443
|
+
lng: 15.590024084277673
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
lat: 73.84805776168719,
|
|
447
|
+
lng: 18.531963374654026
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
lat: 151.1832339501475,
|
|
451
|
+
lng: -33.91806510862875
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
lat: 30.314074200315076,
|
|
455
|
+
lng: 59.94096036375191
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
lat: 91.79802154756635,
|
|
459
|
+
lng: 22.33193814680459
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
lat: 113.74277634138707,
|
|
463
|
+
lng: 23.050834758613007
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
lat: -84.40189524187565,
|
|
467
|
+
lng: 33.83195971260585
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
lat: -71.07195953218684,
|
|
471
|
+
lng: 42.33190600170229
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
lat: 46.770795798688255,
|
|
475
|
+
lng: 24.642779007816443
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
lat: -95.341925149146,
|
|
479
|
+
lng: 29.821920243188856
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
lat: 105.8480683412422,
|
|
483
|
+
lng: 21.035273107737055
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
lat: -77.01136443943716,
|
|
487
|
+
lng: 38.901495235087054
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
lat: -103.33198008081848,
|
|
491
|
+
lng: 20.671961950508944
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
lat: 144.97307037590406,
|
|
495
|
+
lng: -37.81808545369631
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
lat: 29.948050030391755,
|
|
499
|
+
lng: 31.201965205759393
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
lat: 104.06807363094873,
|
|
503
|
+
lng: 30.671945877957796
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
lat: -83.0820016464927,
|
|
507
|
+
lng: 42.33190600170229
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
lat: 96.16473175266185,
|
|
511
|
+
lng: 16.785299963188777
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
lat: 108.89305043760862,
|
|
515
|
+
lng: 34.27697130928732
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
lat: -51.20195790450316,
|
|
519
|
+
lng: -30.048068770722466
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
lat: 121.465,
|
|
523
|
+
lng: 25.0127777777778
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
lat: 72.83809356897484,
|
|
527
|
+
lng: 21.20192960187819
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
lat: 109.60911291406296,
|
|
531
|
+
lng: 23.09653464659317
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
lat: -4.041994118507091,
|
|
535
|
+
lng: 5.321942826098564
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
lat: -47.91799814700306,
|
|
539
|
+
lng: -15.781394372878992
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
lat: 32.862445782356644,
|
|
543
|
+
lng: 39.929184444075474
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
lat: -100.33193064232995,
|
|
547
|
+
lng: 25.671940995125283
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
lat: 139.60202098994017,
|
|
551
|
+
lng: 35.43065615270891
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
lat: 118.77802846499208,
|
|
555
|
+
lng: 32.05196500231233
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
lat: -73.58524281670213,
|
|
559
|
+
lng: 45.50194506421502
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
lat: 106.7180927553083,
|
|
563
|
+
lng: 26.581988806001448
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
lat: -34.91755136960728,
|
|
567
|
+
lng: -8.073699467249241
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
lat: 126.64803904445057,
|
|
571
|
+
lng: 45.75192980542715
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
lat: -38.58192718342411,
|
|
575
|
+
lng: -3.7480720258257634
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
lat: -112.07193755969467,
|
|
579
|
+
lng: 33.5419257363676
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
lat: 117.67001623440774,
|
|
583
|
+
lng: 24.520375385531167
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
lat: -38.48193328693924,
|
|
587
|
+
lng: -12.968026046044827
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
lat: 129.00810170722048,
|
|
591
|
+
lng: 35.09699877511093
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
lat: -122.41716877355225,
|
|
595
|
+
lng: 37.76919562968743
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
lat: 28.028063865019476,
|
|
599
|
+
lng: -26.16809888138414
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
lat: 13.399602764700546,
|
|
603
|
+
lng: 52.523764522251156
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
lat: 3.048606670909237,
|
|
607
|
+
lng: 36.765010656628135
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
lat: 12.481312562873995,
|
|
611
|
+
lng: 41.89790148509894
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
lat: 125.75274485499392,
|
|
615
|
+
lng: 39.02138455800434
|
|
616
|
+
}
|
|
617
|
+
];
|
|
191
618
|
export {
|
|
192
619
|
Priority,
|
|
193
620
|
SpaceObjectGenerator,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/data.ts", "../../../src/generator.ts", "../../../src/util.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\n// TODO(burdon): Reconcile with @dxos/plugin-debug, @dxos/aurora/testing.\n// TODO(burdon): Bug when adding stale objects to space (e.g., static objects already added in previous story invocation).\n\nimport { faker } from '@faker-js/faker';\n\nimport { Schema, type Space, TextObject } from '@dxos/client/echo';\n\nimport { SpaceObjectGenerator, TestObjectGenerator } from './generator';\nimport { type TestGeneratorMap, type TestSchemaMap } from './types';\n\n// TODO(burdon): Handle restricted values.\nexport const Status = ['pending', 'active', 'done'];\nexport const Priority = [1, 2, 3, 4, 5];\n\nexport type TestSchemaType = 'document' | 'organization' | 'person' | 'project';\n\nexport const testSchemas = (): TestSchemaMap<TestSchemaType> => {\n const document = new Schema({\n props: [\n {\n id: 'name',\n type: Schema.PropType.STRING,\n },\n {\n id: 'content',\n type: Schema.PropType.STRING, // TODO(burdon): Rich text.\n },\n ],\n });\n\n const organization = new Schema({\n props: [\n // TODO(burdon): Add metadata for default label.\n {\n id: 'name',\n type: Schema.PropType.STRING,\n },\n {\n id: 'website',\n type: Schema.PropType.STRING,\n },\n {\n id: 'active',\n type: Schema.PropType.BOOLEAN,\n },\n ],\n });\n\n const person = new Schema({\n props: [\n {\n id: 'name',\n type: Schema.PropType.STRING,\n },\n {\n id: 'email',\n type: Schema.PropType.STRING,\n },\n {\n id: 'org',\n type: Schema.PropType.REF,\n ref: organization,\n },\n ],\n });\n\n const project = new Schema({\n props: [\n {\n id: 'title',\n type: Schema.PropType.STRING,\n },\n {\n id: 'repo',\n type: Schema.PropType.STRING,\n },\n {\n id: 'status',\n type: Schema.PropType.STRING,\n },\n {\n id: 'priority',\n type: Schema.PropType.NUMBER,\n },\n ],\n });\n\n return { document, organization, person, project };\n};\n\nexport const testObjectGenerators: TestGeneratorMap<TestSchemaType> = {\n document: () => ({\n title: faker.lorem.sentence(3),\n content: faker.lorem.sentences({ min: 1, max: faker.number.int({ min: 1, max: 3 }) }),\n }),\n\n organization: () => ({\n name: faker.company.name(),\n website: faker.datatype.boolean({ probability: 0.3 }) ? faker.internet.url() : undefined,\n description: new TextObject(faker.lorem.sentences()),\n }),\n\n person: (provider) => {\n const organizations = provider?.('organization');\n return {\n name: faker.person.fullName(),\n email: faker.datatype.boolean({ probability: 0.5 }) ? faker.internet.email() : undefined,\n org:\n organizations?.length && faker.datatype.boolean({ probability: 0.3 })\n ? faker.helpers.arrayElement(organizations)\n : undefined,\n };\n },\n\n project: () => ({\n title: faker.commerce.productName(),\n repo: faker.datatype.boolean({ probability: 0.3 }) ? faker.internet.url() : undefined,\n status: faker.helpers.arrayElement(Status),\n priority: faker.helpers.arrayElement(Priority),\n }),\n};\n\nexport const createTestObjectGenerator = () => new TestObjectGenerator(testSchemas(), testObjectGenerators);\n\nexport const createSpaceObjectGenerator = (space: Space) =>\n new SpaceObjectGenerator(space, testSchemas(), testObjectGenerators);\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// TODO(burdon): Reconcile with @dxos/plugin-debug, @dxos/aurora/testing.\n// TODO(burdon): Bug when adding stale objects to space (e.g., static objects already added in previous story invocation).\n\nimport { faker } from '@faker-js/faker';\n\nimport { Expando, type Schema, type Space } from '@dxos/client/echo';\n\nimport { type TestGeneratorMap, type TestObjectProvider, type TestSchemaMap } from './types';\nimport { range } from './util';\n\n/**\n * Typed object generator.\n */\nexport class TestObjectGenerator<T extends string> {\n // prettier-ignore\n constructor(\n public readonly schema: TestSchemaMap<T>,\n private readonly _generators: TestGeneratorMap<T>,\n private readonly _provider?: TestObjectProvider<T>\n ) {}\n\n get schemas(): Schema[] {\n return Object.values(this.schema);\n }\n\n createObject({ types }: { types?: T[] } = {}): Expando {\n const type = faker.helpers.arrayElement(types ?? (Object.keys(this.schema) as T[]));\n const factory = this._generators[type];\n const data = factory(this._provider);\n return new Expando(data, { schema: this.schema[type] });\n }\n\n // TODO(burdon): Create batch.\n createObjects({ types, count }: { types?: T[]; count: number }): Expando[] {\n return range(() => this.createObject({ types }), count);\n }\n}\n\n/**\n * Typed object generator for a space.\n */\nexport class SpaceObjectGenerator<T extends string> extends TestObjectGenerator<T> {\n constructor(private readonly _space: Space, schema: TestSchemaMap<T>, generators: TestGeneratorMap<T>) {\n super(schema, generators, (type: T) => {\n // TODO(burdon): Query by schema.\n const { objects } = this._space.db.query((object) => {\n return object.__schema === schema[type];\n });\n\n return objects;\n });\n }\n\n addSchemas() {\n this.schemas.forEach((schema) => this._space.db.add(schema));\n return this.schemas;\n }\n\n override createObject({ types }: { types?: T[] } = {}): Expando {\n return this._space.db.add(super.createObject({ types }));\n }\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// TODO(burdon): Util.\nexport const range = <T>(fn: (i: number) => T | undefined, length: number): T[] =>\n Array.from({ length })\n .map((_, i) => fn(i))\n .filter(Boolean) as T[];\n"],
|
|
5
|
-
"mappings": ";;;AAOA,SAASA,SAAAA,cAAa;AAEtB,SAASC,QAAoBC,kBAAkB;;;ACF/C,SAASC,aAAa;AAEtB,SAASC,eAAwC;;;ACJ1C,IAAMC,QAAQ,CAAIC,IAAkCC,WACzDC,MAAMC,KAAK;EAAEF;AAAO,CAAA,EACjBG,IAAI,CAACC,GAAGC,MAAMN,GAAGM,CAAAA,CAAAA,EACjBC,OAAOC,OAAAA;;;ADSL,IAAMC,sBAAN,MAAMA;;EAEXC,YACkBC,QACCC,aACAC,WACjB;kBAHgBF;uBACCC;qBACAC;EAChB;EAEH,IAAIC,UAAoB;AACtB,WAAOC,OAAOC,OAAO,KAAKL,MAAM;EAClC;EAEAM,aAAa,EAAEC,MAAK,IAAsB,CAAC,GAAY;AACrD,UAAMC,OAAOC,MAAMC,QAAQC,aAAaJ,
|
|
6
|
-
"names": ["faker", "Schema", "TextObject", "faker", "Expando", "range", "fn", "length", "Array", "from", "map", "_", "i", "filter", "Boolean", "TestObjectGenerator", "constructor", "schema", "_generators", "_provider", "schemas", "Object", "values", "createObject", "types", "type", "faker", "helpers", "arrayElement", "keys", "factory", "data", "Expando", "createObjects", "count", "range", "SpaceObjectGenerator", "_space", "generators", "objects", "db", "query", "object", "__schema", "addSchemas", "forEach", "add", "Status", "Priority", "testSchemas", "document", "Schema", "props", "id", "type", "PropType", "STRING", "organization", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\n// TODO(burdon): Reconcile with @dxos/plugin-debug, @dxos/aurora/testing.\n// TODO(burdon): Bug when adding stale objects to space (e.g., static objects already added in previous story invocation).\n\nimport { faker } from '@faker-js/faker';\n\nimport { Schema, type Space, TextObject } from '@dxos/client/echo';\n\nimport { SpaceObjectGenerator, TestObjectGenerator } from './generator';\nimport { type TestGeneratorMap, type TestSchemaMap } from './types';\n\n// TODO(burdon): Handle restricted values.\nexport const Status = ['pending', 'active', 'done'];\nexport const Priority = [1, 2, 3, 4, 5];\n\nexport type TestSchemaType = 'document' | 'organization' | 'person' | 'project';\n\nexport const testSchemas = (): TestSchemaMap<TestSchemaType> => {\n const document = new Schema({\n props: [\n {\n id: 'name',\n type: Schema.PropType.STRING,\n // TODO(burdon): primary: true,\n },\n {\n id: 'content',\n type: Schema.PropType.STRING, // TODO(burdon): Rich text.\n },\n ],\n });\n\n const organization = new Schema({\n typename: 'example.com/schema/organization',\n props: [\n {\n id: 'name',\n type: Schema.PropType.STRING,\n },\n {\n id: 'website',\n type: Schema.PropType.STRING,\n },\n {\n id: 'description',\n type: Schema.PropType.STRING,\n },\n ],\n });\n\n const person = new Schema({\n typename: 'example.com/schema/person',\n props: [\n {\n id: 'name',\n type: Schema.PropType.STRING,\n },\n {\n id: 'email',\n type: Schema.PropType.STRING,\n },\n {\n id: 'org',\n type: Schema.PropType.REF,\n ref: organization,\n },\n // TODO(burdon): Convert to object with nested props.\n {\n id: 'lat',\n type: Schema.PropType.NUMBER,\n },\n {\n id: 'lng',\n type: Schema.PropType.NUMBER,\n },\n ],\n });\n\n const project = new Schema({\n typename: 'example.com/schema/project',\n props: [\n {\n id: 'title',\n type: Schema.PropType.STRING,\n },\n {\n id: 'description',\n type: Schema.PropType.STRING, // TODO(burdon): Text.\n },\n {\n id: 'repo',\n type: Schema.PropType.STRING,\n },\n {\n id: 'status',\n type: Schema.PropType.STRING,\n },\n {\n id: 'priority',\n type: Schema.PropType.NUMBER,\n },\n {\n id: 'active',\n type: Schema.PropType.BOOLEAN,\n },\n ],\n });\n\n return { document, organization, person, project };\n};\n\nexport const testObjectGenerators: TestGeneratorMap<TestSchemaType> = {\n document: () => ({\n title: faker.lorem.sentence(3),\n content: faker.lorem.sentences({ min: 1, max: faker.number.int({ min: 1, max: 3 }) }),\n }),\n\n organization: () => ({\n name: faker.company.name(),\n website: faker.datatype.boolean({ probability: 0.3 }) ? faker.internet.url() : undefined,\n description: new TextObject(faker.lorem.sentences()),\n }),\n\n person: (provider) => {\n const organizations = provider?.('organization');\n const location = faker.datatype.boolean() ? faker.helpers.arrayElement(locations) : undefined;\n return {\n name: faker.person.fullName(),\n email: faker.datatype.boolean({ probability: 0.5 }) ? faker.internet.email() : undefined,\n org:\n organizations?.length && faker.datatype.boolean({ probability: 0.3 })\n ? faker.helpers.arrayElement(organizations)\n : undefined,\n ...location,\n };\n },\n\n project: () => ({\n title: faker.commerce.productName(),\n repo: faker.datatype.boolean({ probability: 0.3 }) ? faker.internet.url() : undefined,\n status: faker.helpers.arrayElement(Status),\n priority: faker.helpers.arrayElement(Priority),\n active: faker.datatype.boolean(),\n }),\n};\n\nexport const createTestObjectGenerator = () => new TestObjectGenerator(testSchemas(), testObjectGenerators);\n\nexport const createSpaceObjectGenerator = (space: Space) =>\n new SpaceObjectGenerator(space, testSchemas(), testObjectGenerators);\n\nconst locations = [\n { lat: 139.74946157054467, lng: 35.686962764371174 },\n { lat: -73.98196278740681, lng: 40.75192492259464 },\n { lat: -99.1329340602939, lng: 19.444388301415472 },\n { lat: 72.85504343876647, lng: 19.0189362343566 },\n { lat: -46.62696583905523, lng: -23.55673372837896 },\n { lat: 77.22805816860182, lng: 28.671938757181522 },\n { lat: 121.43455881982015, lng: 31.218398311228327 },\n { lat: 88.32272979950551, lng: 22.49691515689642 },\n { lat: 90.40663360810754, lng: 23.725005570312817 },\n { lat: -58.399477232331435, lng: -34.600555749907414 },\n { lat: -118.18192636994041, lng: 33.99192410876543 },\n { lat: 66.98806305137339, lng: 24.87193814681484 },\n { lat: 31.248022361126118, lng: 30.051906205103705 },\n { lat: -43.22696665284366, lng: -22.923077315615956 },\n { lat: 135.4581989565952, lng: 34.75198107491417 },\n { lat: 116.38633982565943, lng: 39.93083808990906 },\n { lat: 120.9802713035424, lng: 14.606104813440538 },\n { lat: 37.6135769672714, lng: 55.75410998124818 },\n { lat: 29.008055727002613, lng: 41.10694201243979 },\n { lat: 2.33138946713035, lng: 48.86863878981461 },\n { lat: 126.99778513820195, lng: 37.56829495838895 },\n { lat: 3.3895852125984334, lng: 6.445207512093191 },\n { lat: 106.82749176247012, lng: -6.172471846798885 },\n { lat: -87.75200083270931, lng: 41.83193651927843 },\n { lat: 113.32306427226172, lng: 23.14692716047989 },\n { lat: -0.11866770247593195, lng: 51.5019405883275 },\n { lat: -77.05200795343472, lng: -12.04606681752557 },\n { lat: 51.42239817500899, lng: 35.673888627001304 },\n { lat: 15.313026023171744, lng: -4.327778243275986 },\n { lat: -74.08528981377441, lng: 4.598369421147822 },\n { lat: 114.1201772298325, lng: 22.554316369677963 },\n { lat: 114.26807118958311, lng: 30.581977209337822 },\n { lat: 114.18306345846304, lng: 22.30692675357551 },\n { lat: 117.19807322410043, lng: 39.13197212310894 },\n { lat: 80.27805287890033, lng: 13.091933670856292 },\n { lat: 121.568333333333, lng: 25.0358333333333 },\n { lat: 77.55806386521755, lng: 12.97194099507442 },\n { lat: 100.51469879369489, lng: 13.751945064087977 },\n { lat: 74.34807892054346, lng: 31.56191739488844 },\n { lat: 106.59303578916195, lng: 29.566922888044644 },\n { lat: 78.47800771287751, lng: 17.401928991511454 },\n { lat: -70.66898671317483, lng: -33.448067956934096 },\n { lat: -80.22605193945003, lng: 25.789556555021534 },\n { lat: -43.916950376804834, lng: -19.91308016391116 },\n { lat: -3.6852975446125242, lng: 40.40197212311381 },\n { lat: -75.17194183200792, lng: 40.001919022526465 },\n { lat: 72.57805776168215, lng: 23.031998775062675 },\n { lat: 106.69308136207889, lng: 10.781971309193409 },\n { lat: -79.42196665298843, lng: 43.70192573640844 },\n { lat: 103.85387481909902, lng: 1.2949793251059418 },\n { lat: 13.23248118266855, lng: -8.836340255012658 },\n { lat: 44.391922914564134, lng: 33.34059435615865 },\n { lat: 2.181424460619155, lng: 41.385245438547486 },\n { lat: 88.32994665421205, lng: 22.580390440861947 },\n { lat: -96.84196278749818, lng: 32.82196968167733 },\n { lat: 123.44802765120869, lng: 41.80692512604918 },\n { lat: 32.532233380011576, lng: 15.590024084277673 },\n { lat: 73.84805776168719, lng: 18.531963374654026 },\n { lat: 151.1832339501475, lng: -33.91806510862875 },\n { lat: 30.314074200315076, lng: 59.94096036375191 },\n { lat: 91.79802154756635, lng: 22.33193814680459 },\n { lat: 113.74277634138707, lng: 23.050834758613007 },\n { lat: -84.40189524187565, lng: 33.83195971260585 },\n { lat: -71.07195953218684, lng: 42.33190600170229 },\n { lat: 46.770795798688255, lng: 24.642779007816443 },\n { lat: -95.341925149146, lng: 29.821920243188856 },\n { lat: 105.8480683412422, lng: 21.035273107737055 },\n { lat: -77.01136443943716, lng: 38.901495235087054 },\n { lat: -103.33198008081848, lng: 20.671961950508944 },\n { lat: 144.97307037590406, lng: -37.81808545369631 },\n { lat: 29.948050030391755, lng: 31.201965205759393 },\n { lat: 104.06807363094873, lng: 30.671945877957796 },\n { lat: -83.0820016464927, lng: 42.33190600170229 },\n { lat: 96.16473175266185, lng: 16.785299963188777 },\n { lat: 108.89305043760862, lng: 34.27697130928732 },\n { lat: -51.20195790450316, lng: -30.048068770722466 },\n { lat: 121.465, lng: 25.0127777777778 },\n { lat: 72.83809356897484, lng: 21.20192960187819 },\n { lat: 109.60911291406296, lng: 23.09653464659317 },\n { lat: -4.041994118507091, lng: 5.321942826098564 },\n { lat: -47.91799814700306, lng: -15.781394372878992 },\n { lat: 32.862445782356644, lng: 39.929184444075474 },\n { lat: -100.33193064232995, lng: 25.671940995125283 },\n { lat: 139.60202098994017, lng: 35.43065615270891 },\n { lat: 118.77802846499208, lng: 32.05196500231233 },\n { lat: -73.58524281670213, lng: 45.50194506421502 },\n { lat: 106.7180927553083, lng: 26.581988806001448 },\n { lat: -34.91755136960728, lng: -8.073699467249241 },\n { lat: 126.64803904445057, lng: 45.75192980542715 },\n { lat: -38.58192718342411, lng: -3.7480720258257634 },\n { lat: -112.07193755969467, lng: 33.5419257363676 },\n { lat: 117.67001623440774, lng: 24.520375385531167 },\n { lat: -38.48193328693924, lng: -12.968026046044827 },\n { lat: 129.00810170722048, lng: 35.09699877511093 },\n { lat: -122.41716877355225, lng: 37.76919562968743 },\n { lat: 28.028063865019476, lng: -26.16809888138414 },\n { lat: 13.399602764700546, lng: 52.523764522251156 },\n { lat: 3.048606670909237, lng: 36.765010656628135 },\n { lat: 12.481312562873995, lng: 41.89790148509894 },\n { lat: 125.75274485499392, lng: 39.02138455800434 },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// TODO(burdon): Reconcile with @dxos/plugin-debug, @dxos/aurora/testing.\n// TODO(burdon): Bug when adding stale objects to space (e.g., static objects already added in previous story invocation).\n\nimport { faker } from '@faker-js/faker';\n\nimport { Expando, type Schema, type Space } from '@dxos/client/echo';\n\nimport { type TestGeneratorMap, type TestObjectProvider, type TestSchemaMap } from './types';\nimport { range } from './util';\n\n/**\n * Typed object generator.\n */\nexport class TestObjectGenerator<T extends string> {\n // prettier-ignore\n constructor(\n public readonly schema: TestSchemaMap<T>,\n private readonly _generators: TestGeneratorMap<T>,\n private readonly _provider?: TestObjectProvider<T>\n ) {}\n\n get schemas(): Schema[] {\n return Object.values(this.schema);\n }\n\n getSchema(typename: string) {\n return this.schemas.find((schema) => schema.typename === typename);\n }\n\n createObject({ types }: { types?: T[] } = {}): Expando {\n const type = faker.helpers.arrayElement(types ?? (Object.keys(this.schema) as T[]));\n const factory = this._generators[type];\n const data = factory(this._provider);\n // TODO(burdon): Runtime type check via: https://github.com/Effect-TS/schema (or zod).\n return new Expando(data, { schema: this.schema[type] });\n }\n\n // TODO(burdon): Create batch.\n createObjects({ types, count }: { types?: T[]; count: number }): Expando[] {\n return range(() => this.createObject({ types }), count);\n }\n}\n\n/**\n * Typed object generator for a space.\n */\nexport class SpaceObjectGenerator<T extends string> extends TestObjectGenerator<T> {\n constructor(private readonly _space: Space, schema: TestSchemaMap<T>, generators: TestGeneratorMap<T>) {\n super(schema, generators, (type: T) => {\n // TODO(burdon): Query by schema.\n const { objects } = this._space.db.query((object) => {\n return object.__schema === schema[type];\n });\n\n return objects;\n });\n }\n\n addSchemas() {\n this.schemas.forEach((schema) => this._space.db.add(schema));\n return this.schemas;\n }\n\n override createObject({ types }: { types?: T[] } = {}): Expando {\n return this._space.db.add(super.createObject({ types }));\n }\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// TODO(burdon): Util.\nexport const range = <T>(fn: (i: number) => T | undefined, length: number): T[] =>\n Array.from({ length })\n .map((_, i) => fn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,KAAK;EAAmB;EACnD;IAAED,KAAK;IAAqBC,KAAK;EAAmB;EACpD;IAAED,KAAK;IAAoBC,KAAK;EAAkB;EAClD;IAAED,KAAK;IAAoBC,KAAK;EAAkB;EAClD;IAAED,KAAK;IAAoBC,KAAK;EAAkB;EAClD;IAAED,KAAK;IAAmBC,KAAK;EAAmB;EAClD;IAAED,KAAK;IAAoBC,KAAK;EAAmB;EACnD;IAAED,KAAK;IAAoBC,KAAK;EAAkB;EAClD;IAAED,KAAK;IAAoBC,KAAK;EAAoB;EACpD;IAAED,KAAK;IAAqBC,KAAK;EAAiB;EAClD;IAAED,KAAK;IAAoBC,KAAK;EAAmB;EACnD;IAAED,KAAK;IAAoBC,KAAK;EAAoB;EACpD;IAAED,KAAK;IAAoBC,KAAK;EAAkB;EAClD;IAAED,KAAK;IAAqBC,KAAK;EAAkB;EACnD;IAAED,KAAK;IAAoBC,KAAK;EAAmB;EACnD;IAAED,KAAK;IAAoBC,KAAK;EAAmB;EACnD;IAAED,KAAK;IAAmBC,KAAK;EAAmB;EAClD;IAAED,KAAK;IAAoBC,KAAK;EAAkB;EAClD;IAAED,KAAK;IAAoBC,KAAK;EAAkB;;",
|
|
6
|
+
"names": ["faker", "Schema", "TextObject", "faker", "Expando", "range", "fn", "length", "Array", "from", "map", "_", "i", "filter", "Boolean", "TestObjectGenerator", "constructor", "schema", "_generators", "_provider", "schemas", "Object", "values", "getSchema", "typename", "find", "createObject", "types", "type", "faker", "helpers", "arrayElement", "keys", "factory", "data", "Expando", "createObjects", "count", "range", "SpaceObjectGenerator", "_space", "generators", "objects", "db", "query", "object", "__schema", "addSchemas", "forEach", "add", "Status", "Priority", "testSchemas", "document", "Schema", "props", "id", "type", "PropType", "STRING", "organization", "typename", "person", "REF", "ref", "NUMBER", "project", "BOOLEAN", "testObjectGenerators", "title", "faker", "lorem", "sentence", "content", "sentences", "min", "max", "number", "int", "name", "company", "website", "datatype", "boolean", "probability", "internet", "url", "undefined", "description", "TextObject", "provider", "organizations", "location", "helpers", "arrayElement", "locations", "fullName", "email", "org", "length", "commerce", "productName", "repo", "status", "priority", "active", "createTestObjectGenerator", "TestObjectGenerator", "createSpaceObjectGenerator", "space", "SpaceObjectGenerator", "lat", "lng"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/echo/echo-generator/src/util.ts":{"bytes":1057,"imports":[],"format":"esm"},"packages/core/echo/echo-generator/src/generator.ts":{"bytes":
|
|
1
|
+
{"inputs":{"packages/core/echo/echo-generator/src/util.ts":{"bytes":1057,"imports":[],"format":"esm"},"packages/core/echo/echo-generator/src/generator.ts":{"bytes":7907,"imports":[{"path":"@faker-js/faker","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"packages/core/echo/echo-generator/src/util.ts","kind":"import-statement","original":"./util"}],"format":"esm"},"packages/core/echo/echo-generator/src/data.ts":{"bytes":35589,"imports":[{"path":"@faker-js/faker","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"packages/core/echo/echo-generator/src/generator.ts","kind":"import-statement","original":"./generator"}],"format":"esm"},"packages/core/echo/echo-generator/src/index.ts":{"bytes":634,"imports":[{"path":"packages/core/echo/echo-generator/src/data.ts","kind":"import-statement","original":"./data"},{"path":"packages/core/echo/echo-generator/src/generator.ts","kind":"import-statement","original":"./generator"},{"path":"packages/core/echo/echo-generator/src/util.ts","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"packages/core/echo/echo-generator/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":20976},"packages/core/echo/echo-generator/dist/lib/browser/index.mjs":{"imports":[{"path":"@faker-js/faker","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@faker-js/faker","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true}],"exports":["Priority","SpaceObjectGenerator","Status","TestObjectGenerator","createSpaceObjectGenerator","createTestObjectGenerator","range","testObjectGenerators","testSchemas"],"entryPoint":"packages/core/echo/echo-generator/src/index.ts","inputs":{"packages/core/echo/echo-generator/src/data.ts":{"bytesInOutput":9993},"packages/core/echo/echo-generator/src/generator.ts":{"bytesInOutput":1422},"packages/core/echo/echo-generator/src/util.ts":{"bytesInOutput":91},"packages/core/echo/echo-generator/src/index.ts":{"bytesInOutput":0}},"bytes":12021}}}
|