@dxos/echo-generator 0.6.11 → 0.6.12-main.5a87ad5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"inputs":{"inject-globals:@inject-globals":{"bytes":384,"imports":[{"path":"@dxos/node-std/inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo-generator/src/util.ts":{"bytes":2289,"imports":[{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo-generator/src/generator.ts":{"bytes":16683,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"packages/core/echo/echo-generator/src/util.ts","kind":"import-statement","original":"./util"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo-generator/src/data.ts":{"bytes":41064,"imports":[{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"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"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo-generator/src/types.ts":{"bytes":1521,"imports":[{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo-generator/src/index.ts":{"bytes":751,"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/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/echo/echo-generator/src/util.ts","kind":"import-statement","original":"./util"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"packages/core/echo/echo-generator/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":29116},"packages/core/echo/echo-generator/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/node-std/inject-globals","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true}],"exports":["Priority","SpaceObjectGenerator","Status","TestObjectGenerator","TestSchemaType","createSpaceObjectGenerator","createTestObjectGenerator","randomText","range"],"entryPoint":"packages/core/echo/echo-generator/src/index.ts","inputs":{"inject-globals:@inject-globals":{"bytesInOutput":79},"packages/core/echo/echo-generator/src/data.ts":{"bytesInOutput":11548},"packages/core/echo/echo-generator/src/generator.ts":{"bytesInOutput":3818},"packages/core/echo/echo-generator/src/util.ts":{"bytesInOutput":390},"packages/core/echo/echo-generator/src/index.ts":{"bytesInOutput":0}},"bytes":16378}}}
1
+ {"inputs":{"inject-globals:@inject-globals":{"bytes":324,"imports":[{"path":"@dxos/node-std/inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo-generator/src/util.ts":{"bytes":2289,"imports":[{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo-generator/src/generator.ts":{"bytes":16683,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"packages/core/echo/echo-generator/src/util.ts","kind":"import-statement","original":"./util"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo-generator/src/data.ts":{"bytes":41064,"imports":[{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"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"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo-generator/src/types.ts":{"bytes":1521,"imports":[{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/echo/echo-generator/src/index.ts":{"bytes":751,"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/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/echo/echo-generator/src/util.ts","kind":"import-statement","original":"./util"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"packages/core/echo/echo-generator/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":29116},"packages/core/echo/echo-generator/dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/node-std/inject-globals","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true}],"exports":["Priority","SpaceObjectGenerator","Status","TestObjectGenerator","TestSchemaType","createSpaceObjectGenerator","createTestObjectGenerator","randomText","range"],"entryPoint":"packages/core/echo/echo-generator/src/index.ts","inputs":{"inject-globals:@inject-globals":{"bytesInOutput":79},"packages/core/echo/echo-generator/src/data.ts":{"bytesInOutput":11548},"packages/core/echo/echo-generator/src/generator.ts":{"bytesInOutput":3818},"packages/core/echo/echo-generator/src/util.ts":{"bytesInOutput":390},"packages/core/echo/echo-generator/src/index.ts":{"bytesInOutput":0}},"bytes":16378}}}
@@ -0,0 +1,693 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+
3
+ // packages/core/echo/echo-generator/src/data.ts
4
+ import { next as A } from "@dxos/automerge/automerge";
5
+ import { createDocAccessor } from "@dxos/client/echo";
6
+ import { create as create2, DynamicSchema as DynamicSchema2, EchoObject, EchoObjectAnnotationId, effectToJsonSchema, getEchoObjectAnnotation as getEchoObjectAnnotation2, ref, S, StoredSchema } from "@dxos/echo-schema";
7
+ import { faker as faker2 } from "@dxos/random";
8
+
9
+ // packages/core/echo/echo-generator/src/generator.ts
10
+ import { Filter } from "@dxos/client/echo";
11
+ import { DynamicSchema, getEchoObjectAnnotation, getSchema, isReactiveObject } from "@dxos/echo-schema";
12
+ import { create } from "@dxos/echo-schema";
13
+ import { invariant } from "@dxos/invariant";
14
+ import { faker } from "@dxos/random";
15
+
16
+ // packages/core/echo/echo-generator/src/util.ts
17
+ var range = (fn, length) => Array.from({
18
+ length
19
+ }).map((_, i) => fn(i)).filter(Boolean);
20
+ var randomText = (length) => {
21
+ let result = "";
22
+ const characters = "abcdefghijklmnopqrstuvwxyz";
23
+ const charactersLength = characters.length;
24
+ for (let index = 0; index < length; index++) {
25
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
26
+ }
27
+ return result;
28
+ };
29
+
30
+ // packages/core/echo/echo-generator/src/generator.ts
31
+ var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/echo/echo-generator/src/generator.ts";
32
+ var TestObjectGenerator = class {
33
+ // prettier-ignore
34
+ constructor(_schemas, _generators, _provider) {
35
+ this._schemas = _schemas;
36
+ this._generators = _generators;
37
+ this._provider = _provider;
38
+ }
39
+ get schemas() {
40
+ return Object.values(this._schemas);
41
+ }
42
+ getSchema(type) {
43
+ return this.schemas.find((schema) => getEchoObjectAnnotation(schema).typename === type);
44
+ }
45
+ setSchema(type, schema) {
46
+ this._schemas[type] = schema;
47
+ }
48
+ async createObject({ types } = {}) {
49
+ const type = faker.helpers.arrayElement(types ?? Object.keys(this._schemas));
50
+ const data = await this._generators[type](this._provider);
51
+ if (isReactiveObject(data)) {
52
+ return data;
53
+ }
54
+ const schema = this.getSchema(type);
55
+ return schema ? create(schema, data) : create(data);
56
+ }
57
+ // TODO(burdon): Create batch.
58
+ // TODO(burdon): Based on dependencies (e.g., organization before contact).
59
+ async createObjects(map) {
60
+ const tasks = Object.entries(map).map(([type, count]) => {
61
+ return range(() => this.createObject({
62
+ types: [
63
+ type
64
+ ]
65
+ }), count);
66
+ }).flatMap((t) => t);
67
+ return Promise.all(tasks);
68
+ }
69
+ };
70
+ var SpaceObjectGenerator = class extends TestObjectGenerator {
71
+ constructor(_space, schemaMap, generators, _mutations) {
72
+ super(schemaMap, generators, async (type) => {
73
+ const schema = this.getSchema(type);
74
+ return (schema && (await this._space.db.query(Filter.schema(schema)).run()).objects) ?? [];
75
+ });
76
+ this._space = _space;
77
+ this._mutations = _mutations;
78
+ Object.entries(schemaMap).forEach(([type, dynamicSchema]) => {
79
+ const schema = this._maybeRegisterSchema(type, dynamicSchema);
80
+ this.setSchema(type, schema);
81
+ });
82
+ }
83
+ addSchemas() {
84
+ const result = [];
85
+ for (const [typename, schema] of Object.entries(this._schemas)) {
86
+ result.push(this._maybeRegisterSchema(typename, schema));
87
+ }
88
+ return result;
89
+ }
90
+ async createObject({ types } = {}) {
91
+ return this._space.db.add(await super.createObject({
92
+ types
93
+ }));
94
+ }
95
+ _maybeRegisterSchema(typename, schema) {
96
+ if (schema instanceof DynamicSchema) {
97
+ const existingSchema = this._space.db.schema.getSchemaByTypename(typename);
98
+ if (existingSchema != null) {
99
+ return existingSchema;
100
+ }
101
+ this._space.db.add(schema.serializedSchema);
102
+ return this._space.db.schema.registerSchema(schema.serializedSchema);
103
+ } else {
104
+ const existingSchema = this._space.db.graph.schemaRegistry.getSchema(typename);
105
+ if (existingSchema != null) {
106
+ return existingSchema;
107
+ }
108
+ this._space.db.graph.schemaRegistry.addSchema([
109
+ schema
110
+ ]);
111
+ return schema;
112
+ }
113
+ }
114
+ async mutateObject(object, params) {
115
+ invariant(this._mutations, "Mutations not defined.", {
116
+ F: __dxlog_file,
117
+ L: 132,
118
+ S: this,
119
+ A: [
120
+ "this._mutations",
121
+ "'Mutations not defined.'"
122
+ ]
123
+ });
124
+ const type = getEchoObjectAnnotation(getSchema(object)).typename;
125
+ invariant(type && this._mutations?.[type], "Invalid object type.", {
126
+ F: __dxlog_file,
127
+ L: 134,
128
+ S: this,
129
+ A: [
130
+ "type && this._mutations?.[type]",
131
+ "'Invalid object type.'"
132
+ ]
133
+ });
134
+ await this._mutations[type](object, params);
135
+ }
136
+ async mutateObjects(objects, params) {
137
+ for (const object of objects) {
138
+ await this.mutateObject(object, params);
139
+ }
140
+ }
141
+ };
142
+
143
+ // packages/core/echo/echo-generator/src/data.ts
144
+ var Status = [
145
+ "pending",
146
+ "active",
147
+ "done"
148
+ ];
149
+ var Priority = [
150
+ 1,
151
+ 2,
152
+ 3,
153
+ 4,
154
+ 5
155
+ ];
156
+ var TestSchemaType;
157
+ (function(TestSchemaType2) {
158
+ TestSchemaType2["document"] = "example.com/type/document";
159
+ TestSchemaType2["organization"] = "example.com/type/organization";
160
+ TestSchemaType2["contact"] = "example.com/type/contact";
161
+ TestSchemaType2["project"] = "example.com/type/project";
162
+ })(TestSchemaType || (TestSchemaType = {}));
163
+ var createDynamicSchema = (typename, fields) => {
164
+ const typeSchema = S.partial(S.Struct(fields)).pipe(EchoObject(typename, "1.0.0"));
165
+ const typeAnnotation = getEchoObjectAnnotation2(typeSchema);
166
+ const schemaToStore = create2(StoredSchema, {
167
+ typename,
168
+ version: "1.0.0",
169
+ jsonSchema: {}
170
+ });
171
+ const updatedSchema = typeSchema.annotations({
172
+ [EchoObjectAnnotationId]: {
173
+ ...typeAnnotation,
174
+ schemaId: schemaToStore.id
175
+ }
176
+ });
177
+ schemaToStore.jsonSchema = effectToJsonSchema(updatedSchema);
178
+ return new DynamicSchema2(schemaToStore);
179
+ };
180
+ var testSchemas = () => {
181
+ const document = createDynamicSchema("example.com/type/document", {
182
+ title: S.String.pipe(S.description("title of the document")),
183
+ content: S.String
184
+ });
185
+ const organization = createDynamicSchema("example.com/type/organization", {
186
+ name: S.String.pipe(S.description("name of the company or organization")),
187
+ website: S.String.pipe(S.description("public website URL")),
188
+ description: S.String.pipe(S.description("short summary of the company"))
189
+ });
190
+ const contact = createDynamicSchema("example.com/type/contact", {
191
+ name: S.String.pipe(S.description("name of the person")),
192
+ email: S.String,
193
+ org: ref(organization),
194
+ lat: S.Number,
195
+ lng: S.Number
196
+ });
197
+ const project = createDynamicSchema("example.com/type/project", {
198
+ name: S.String.pipe(S.description("name of the project")),
199
+ description: S.String,
200
+ website: S.String,
201
+ repo: S.String,
202
+ status: S.String,
203
+ priority: S.Number,
204
+ active: S.Boolean,
205
+ org: ref(organization)
206
+ });
207
+ return {
208
+ ["example.com/type/document"]: document,
209
+ ["example.com/type/organization"]: organization,
210
+ ["example.com/type/contact"]: contact,
211
+ ["example.com/type/project"]: project
212
+ };
213
+ };
214
+ var testObjectGenerators = {
215
+ ["example.com/type/document"]: async () => ({
216
+ title: faker2.lorem.sentence(3),
217
+ content: faker2.lorem.sentences({
218
+ min: 1,
219
+ max: faker2.number.int({
220
+ min: 1,
221
+ max: 3
222
+ })
223
+ })
224
+ }),
225
+ ["example.com/type/organization"]: async () => ({
226
+ name: faker2.company.name(),
227
+ website: faker2.datatype.boolean({
228
+ probability: 0.3
229
+ }) ? faker2.internet.url() : void 0,
230
+ description: faker2.lorem.sentences()
231
+ }),
232
+ ["example.com/type/contact"]: async (provider) => {
233
+ const organizations = await provider?.("example.com/type/organization");
234
+ const location = faker2.datatype.boolean() ? faker2.helpers.arrayElement(locations) : void 0;
235
+ return {
236
+ name: faker2.person.fullName(),
237
+ email: faker2.datatype.boolean({
238
+ probability: 0.5
239
+ }) ? faker2.internet.email() : void 0,
240
+ org: organizations?.length && faker2.datatype.boolean({
241
+ probability: 0.3
242
+ }) ? faker2.helpers.arrayElement(organizations) : void 0,
243
+ ...location
244
+ };
245
+ },
246
+ ["example.com/type/project"]: async () => ({
247
+ name: faker2.commerce.productName(),
248
+ repo: faker2.datatype.boolean({
249
+ probability: 0.3
250
+ }) ? faker2.internet.url() : void 0,
251
+ status: faker2.helpers.arrayElement(Status),
252
+ priority: faker2.helpers.arrayElement(Priority),
253
+ active: faker2.datatype.boolean()
254
+ })
255
+ };
256
+ var testObjectMutators = {
257
+ ["example.com/type/document"]: async (object, params) => {
258
+ const accessor = createDocAccessor(object, [
259
+ "content"
260
+ ]);
261
+ for (let i = 0; i < params.count; i++) {
262
+ const length = object.content?.content?.length ?? 0;
263
+ accessor.handle.change((doc) => {
264
+ A.splice(doc, accessor.path.slice(), 0, params.maxContentLength >= length ? 0 : params.mutationSize, randomText(params.mutationSize));
265
+ });
266
+ }
267
+ },
268
+ ["example.com/type/organization"]: async () => {
269
+ throw new Error("Method not implemented.");
270
+ },
271
+ ["example.com/type/contact"]: async () => {
272
+ throw new Error("Method not implemented.");
273
+ },
274
+ ["example.com/type/project"]: async () => {
275
+ throw new Error("Method not implemented.");
276
+ }
277
+ };
278
+ var createTestObjectGenerator = () => new TestObjectGenerator(testSchemas(), testObjectGenerators);
279
+ var createSpaceObjectGenerator = (space) => new SpaceObjectGenerator(space, testSchemas(), testObjectGenerators, testObjectMutators);
280
+ var locations = [
281
+ {
282
+ lat: 139.74946157054467,
283
+ lng: 35.686962764371174
284
+ },
285
+ {
286
+ lat: -73.98196278740681,
287
+ lng: 40.75192492259464
288
+ },
289
+ {
290
+ lat: -99.1329340602939,
291
+ lng: 19.444388301415472
292
+ },
293
+ {
294
+ lat: 72.85504343876647,
295
+ lng: 19.0189362343566
296
+ },
297
+ {
298
+ lat: -46.62696583905523,
299
+ lng: -23.55673372837896
300
+ },
301
+ {
302
+ lat: 77.22805816860182,
303
+ lng: 28.671938757181522
304
+ },
305
+ {
306
+ lat: 121.43455881982015,
307
+ lng: 31.218398311228327
308
+ },
309
+ {
310
+ lat: 88.32272979950551,
311
+ lng: 22.49691515689642
312
+ },
313
+ {
314
+ lat: 90.40663360810754,
315
+ lng: 23.725005570312817
316
+ },
317
+ {
318
+ lat: -58.399477232331435,
319
+ lng: -34.600555749907414
320
+ },
321
+ {
322
+ lat: -118.18192636994041,
323
+ lng: 33.99192410876543
324
+ },
325
+ {
326
+ lat: 66.98806305137339,
327
+ lng: 24.87193814681484
328
+ },
329
+ {
330
+ lat: 31.248022361126118,
331
+ lng: 30.051906205103705
332
+ },
333
+ {
334
+ lat: -43.22696665284366,
335
+ lng: -22.923077315615956
336
+ },
337
+ {
338
+ lat: 135.4581989565952,
339
+ lng: 34.75198107491417
340
+ },
341
+ {
342
+ lat: 116.38633982565943,
343
+ lng: 39.93083808990906
344
+ },
345
+ {
346
+ lat: 120.9802713035424,
347
+ lng: 14.606104813440538
348
+ },
349
+ {
350
+ lat: 37.6135769672714,
351
+ lng: 55.75410998124818
352
+ },
353
+ {
354
+ lat: 29.008055727002613,
355
+ lng: 41.10694201243979
356
+ },
357
+ {
358
+ lat: 2.33138946713035,
359
+ lng: 48.86863878981461
360
+ },
361
+ {
362
+ lat: 126.99778513820195,
363
+ lng: 37.56829495838895
364
+ },
365
+ {
366
+ lat: 3.3895852125984334,
367
+ lng: 6.445207512093191
368
+ },
369
+ {
370
+ lat: 106.82749176247012,
371
+ lng: -6.172471846798885
372
+ },
373
+ {
374
+ lat: -87.75200083270931,
375
+ lng: 41.83193651927843
376
+ },
377
+ {
378
+ lat: 113.32306427226172,
379
+ lng: 23.14692716047989
380
+ },
381
+ {
382
+ lat: -0.11866770247593195,
383
+ lng: 51.5019405883275
384
+ },
385
+ {
386
+ lat: -77.05200795343472,
387
+ lng: -12.04606681752557
388
+ },
389
+ {
390
+ lat: 51.42239817500899,
391
+ lng: 35.673888627001304
392
+ },
393
+ {
394
+ lat: 15.313026023171744,
395
+ lng: -4.327778243275986
396
+ },
397
+ {
398
+ lat: -74.08528981377441,
399
+ lng: 4.598369421147822
400
+ },
401
+ {
402
+ lat: 114.1201772298325,
403
+ lng: 22.554316369677963
404
+ },
405
+ {
406
+ lat: 114.26807118958311,
407
+ lng: 30.581977209337822
408
+ },
409
+ {
410
+ lat: 114.18306345846304,
411
+ lng: 22.30692675357551
412
+ },
413
+ {
414
+ lat: 117.19807322410043,
415
+ lng: 39.13197212310894
416
+ },
417
+ {
418
+ lat: 80.27805287890033,
419
+ lng: 13.091933670856292
420
+ },
421
+ {
422
+ lat: 121.568333333333,
423
+ lng: 25.0358333333333
424
+ },
425
+ {
426
+ lat: 77.55806386521755,
427
+ lng: 12.97194099507442
428
+ },
429
+ {
430
+ lat: 100.51469879369489,
431
+ lng: 13.751945064087977
432
+ },
433
+ {
434
+ lat: 74.34807892054346,
435
+ lng: 31.56191739488844
436
+ },
437
+ {
438
+ lat: 106.59303578916195,
439
+ lng: 29.566922888044644
440
+ },
441
+ {
442
+ lat: 78.47800771287751,
443
+ lng: 17.401928991511454
444
+ },
445
+ {
446
+ lat: -70.66898671317483,
447
+ lng: -33.448067956934096
448
+ },
449
+ {
450
+ lat: -80.22605193945003,
451
+ lng: 25.789556555021534
452
+ },
453
+ {
454
+ lat: -43.916950376804834,
455
+ lng: -19.91308016391116
456
+ },
457
+ {
458
+ lat: -3.6852975446125242,
459
+ lng: 40.40197212311381
460
+ },
461
+ {
462
+ lat: -75.17194183200792,
463
+ lng: 40.001919022526465
464
+ },
465
+ {
466
+ lat: 72.57805776168215,
467
+ lng: 23.031998775062675
468
+ },
469
+ {
470
+ lat: 106.69308136207889,
471
+ lng: 10.781971309193409
472
+ },
473
+ {
474
+ lat: -79.42196665298843,
475
+ lng: 43.70192573640844
476
+ },
477
+ {
478
+ lat: 103.85387481909902,
479
+ lng: 1.2949793251059418
480
+ },
481
+ {
482
+ lat: 13.23248118266855,
483
+ lng: -8.836340255012658
484
+ },
485
+ {
486
+ lat: 44.391922914564134,
487
+ lng: 33.34059435615865
488
+ },
489
+ {
490
+ lat: 2.181424460619155,
491
+ lng: 41.385245438547486
492
+ },
493
+ {
494
+ lat: 88.32994665421205,
495
+ lng: 22.580390440861947
496
+ },
497
+ {
498
+ lat: -96.84196278749818,
499
+ lng: 32.82196968167733
500
+ },
501
+ {
502
+ lat: 123.44802765120869,
503
+ lng: 41.80692512604918
504
+ },
505
+ {
506
+ lat: 32.532233380011576,
507
+ lng: 15.590024084277673
508
+ },
509
+ {
510
+ lat: 73.84805776168719,
511
+ lng: 18.531963374654026
512
+ },
513
+ {
514
+ lat: 151.1832339501475,
515
+ lng: -33.91806510862875
516
+ },
517
+ {
518
+ lat: 30.314074200315076,
519
+ lng: 59.94096036375191
520
+ },
521
+ {
522
+ lat: 91.79802154756635,
523
+ lng: 22.33193814680459
524
+ },
525
+ {
526
+ lat: 113.74277634138707,
527
+ lng: 23.050834758613007
528
+ },
529
+ {
530
+ lat: -84.40189524187565,
531
+ lng: 33.83195971260585
532
+ },
533
+ {
534
+ lat: -71.07195953218684,
535
+ lng: 42.33190600170229
536
+ },
537
+ {
538
+ lat: 46.770795798688255,
539
+ lng: 24.642779007816443
540
+ },
541
+ {
542
+ lat: -95.341925149146,
543
+ lng: 29.821920243188856
544
+ },
545
+ {
546
+ lat: 105.8480683412422,
547
+ lng: 21.035273107737055
548
+ },
549
+ {
550
+ lat: -77.01136443943716,
551
+ lng: 38.901495235087054
552
+ },
553
+ {
554
+ lat: -103.33198008081848,
555
+ lng: 20.671961950508944
556
+ },
557
+ {
558
+ lat: 144.97307037590406,
559
+ lng: -37.81808545369631
560
+ },
561
+ {
562
+ lat: 29.948050030391755,
563
+ lng: 31.201965205759393
564
+ },
565
+ {
566
+ lat: 104.06807363094873,
567
+ lng: 30.671945877957796
568
+ },
569
+ {
570
+ lat: -83.0820016464927,
571
+ lng: 42.33190600170229
572
+ },
573
+ {
574
+ lat: 96.16473175266185,
575
+ lng: 16.785299963188777
576
+ },
577
+ {
578
+ lat: 108.89305043760862,
579
+ lng: 34.27697130928732
580
+ },
581
+ {
582
+ lat: -51.20195790450316,
583
+ lng: -30.048068770722466
584
+ },
585
+ {
586
+ lat: 121.465,
587
+ lng: 25.0127777777778
588
+ },
589
+ {
590
+ lat: 72.83809356897484,
591
+ lng: 21.20192960187819
592
+ },
593
+ {
594
+ lat: 109.60911291406296,
595
+ lng: 23.09653464659317
596
+ },
597
+ {
598
+ lat: -4.041994118507091,
599
+ lng: 5.321942826098564
600
+ },
601
+ {
602
+ lat: -47.91799814700306,
603
+ lng: -15.781394372878992
604
+ },
605
+ {
606
+ lat: 32.862445782356644,
607
+ lng: 39.929184444075474
608
+ },
609
+ {
610
+ lat: -100.33193064232995,
611
+ lng: 25.671940995125283
612
+ },
613
+ {
614
+ lat: 139.60202098994017,
615
+ lng: 35.43065615270891
616
+ },
617
+ {
618
+ lat: 118.77802846499208,
619
+ lng: 32.05196500231233
620
+ },
621
+ {
622
+ lat: -73.58524281670213,
623
+ lng: 45.50194506421502
624
+ },
625
+ {
626
+ lat: 106.7180927553083,
627
+ lng: 26.581988806001448
628
+ },
629
+ {
630
+ lat: -34.91755136960728,
631
+ lng: -8.073699467249241
632
+ },
633
+ {
634
+ lat: 126.64803904445057,
635
+ lng: 45.75192980542715
636
+ },
637
+ {
638
+ lat: -38.58192718342411,
639
+ lng: -3.7480720258257634
640
+ },
641
+ {
642
+ lat: -112.07193755969467,
643
+ lng: 33.5419257363676
644
+ },
645
+ {
646
+ lat: 117.67001623440774,
647
+ lng: 24.520375385531167
648
+ },
649
+ {
650
+ lat: -38.48193328693924,
651
+ lng: -12.968026046044827
652
+ },
653
+ {
654
+ lat: 129.00810170722048,
655
+ lng: 35.09699877511093
656
+ },
657
+ {
658
+ lat: -122.41716877355225,
659
+ lng: 37.76919562968743
660
+ },
661
+ {
662
+ lat: 28.028063865019476,
663
+ lng: -26.16809888138414
664
+ },
665
+ {
666
+ lat: 13.399602764700546,
667
+ lng: 52.523764522251156
668
+ },
669
+ {
670
+ lat: 3.048606670909237,
671
+ lng: 36.765010656628135
672
+ },
673
+ {
674
+ lat: 125.75274485499392,
675
+ lng: 39.02138455800434
676
+ },
677
+ {
678
+ lat: 12.481312562873995,
679
+ lng: 41.89790148509894
680
+ }
681
+ ];
682
+ export {
683
+ Priority,
684
+ SpaceObjectGenerator,
685
+ Status,
686
+ TestObjectGenerator,
687
+ TestSchemaType,
688
+ createSpaceObjectGenerator,
689
+ createTestObjectGenerator,
690
+ randomText,
691
+ range
692
+ };
693
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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 { next as A } from '@dxos/automerge/automerge';\nimport { createDocAccessor, type Space } from '@dxos/client/echo';\nimport {\n create,\n DynamicSchema,\n EchoObject,\n EchoObjectAnnotationId,\n effectToJsonSchema,\n getEchoObjectAnnotation,\n ref,\n S,\n StoredSchema,\n} from '@dxos/echo-schema';\nimport { faker } from '@dxos/random';\n\nimport { SpaceObjectGenerator, TestObjectGenerator } from './generator';\nimport { type TestMutationsMap, type TestGeneratorMap, type TestSchemaMap } from './types';\nimport { randomText } from './util';\n\n// TODO(burdon): Handle restricted values.\nexport const Status = ['pending', 'active', 'done'];\nexport const Priority = [1, 2, 3, 4, 5];\n\nexport enum TestSchemaType {\n document = 'example.com/type/document',\n organization = 'example.com/type/organization',\n contact = 'example.com/type/contact',\n project = 'example.com/type/project',\n}\n\nconst createDynamicSchema = (typename: string, fields: S.Struct.Fields): DynamicSchema => {\n const typeSchema = S.partial(S.Struct(fields)).pipe(EchoObject(typename, '1.0.0'));\n const typeAnnotation = getEchoObjectAnnotation(typeSchema);\n const schemaToStore = create(StoredSchema, {\n typename,\n version: '1.0.0',\n jsonSchema: {},\n });\n const updatedSchema = typeSchema.annotations({\n [EchoObjectAnnotationId]: { ...typeAnnotation, schemaId: schemaToStore.id },\n });\n schemaToStore.jsonSchema = effectToJsonSchema(updatedSchema);\n return new DynamicSchema(schemaToStore);\n};\n\nconst testSchemas = (): TestSchemaMap<TestSchemaType> => {\n const document = createDynamicSchema(TestSchemaType.document, {\n title: S.String.pipe(S.description('title of the document')),\n content: S.String,\n });\n\n const organization = createDynamicSchema(TestSchemaType.organization, {\n name: S.String.pipe(S.description('name of the company or organization')),\n website: S.String.pipe(S.description('public website URL')),\n description: S.String.pipe(S.description('short summary of the company')),\n });\n\n const contact = createDynamicSchema(TestSchemaType.contact, {\n name: S.String.pipe(S.description('name of the person')),\n email: S.String,\n org: ref(organization),\n lat: S.Number,\n lng: S.Number,\n });\n\n const project = createDynamicSchema(TestSchemaType.project, {\n name: S.String.pipe(S.description('name of the project')),\n description: S.String,\n website: S.String,\n repo: S.String,\n status: S.String,\n priority: S.Number,\n active: S.Boolean,\n org: ref(organization),\n });\n\n return {\n [TestSchemaType.document]: document,\n [TestSchemaType.organization]: organization,\n [TestSchemaType.contact]: contact,\n [TestSchemaType.project]: project,\n };\n};\n\nconst testObjectGenerators: TestGeneratorMap<TestSchemaType> = {\n [TestSchemaType.document]: async () => ({\n title: faker.lorem.sentence(3),\n content: faker.lorem.sentences({ min: 1, max: faker.number.int({ min: 1, max: 3 }) }),\n }),\n\n [TestSchemaType.organization]: async () => ({\n name: faker.company.name(),\n website: faker.datatype.boolean({ probability: 0.3 }) ? faker.internet.url() : undefined,\n description: faker.lorem.sentences(),\n }),\n\n [TestSchemaType.contact]: async (provider) => {\n const organizations = await provider?.(TestSchemaType.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 [TestSchemaType.project]: async () => ({\n name: 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\nconst testObjectMutators: TestMutationsMap<TestSchemaType> = {\n [TestSchemaType.document]: async (object, params) => {\n const accessor = createDocAccessor(object, ['content']);\n for (let i = 0; i < params.count; i++) {\n const length = object.content?.content?.length ?? 0;\n accessor.handle.change((doc) => {\n A.splice(\n doc,\n accessor.path.slice(),\n 0,\n params.maxContentLength >= length ? 0 : params.mutationSize,\n randomText(params.mutationSize),\n );\n });\n }\n },\n [TestSchemaType.organization]: async () => {\n throw new Error('Method not implemented.');\n },\n [TestSchemaType.contact]: async () => {\n throw new Error('Method not implemented.');\n },\n [TestSchemaType.project]: async () => {\n throw new Error('Method not implemented.');\n },\n};\n\nexport const createTestObjectGenerator = () => new TestObjectGenerator(testSchemas(), testObjectGenerators);\n\nexport const createSpaceObjectGenerator = (space: Space) =>\n new SpaceObjectGenerator(space, testSchemas(), testObjectGenerators, testObjectMutators);\n\n// TODO(burdon): Move to @dxos/random.\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: 125.75274485499392, lng: 39.02138455800434 },\n { lat: 12.481312562873995, lng: 41.89790148509894 },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Space, Filter } from '@dxos/client/echo';\nimport {\n type EchoReactiveObject,\n type ReactiveObject,\n DynamicSchema,\n getEchoObjectAnnotation,\n getSchema,\n type S,\n isReactiveObject,\n} from '@dxos/echo-schema';\nimport { create } from '@dxos/echo-schema';\nimport { invariant } from '@dxos/invariant';\nimport { faker } from '@dxos/random';\n\nimport { type TestSchemaType } from './data';\nimport {\n type TestMutationsMap,\n type TestGeneratorMap,\n type TestObjectProvider,\n type TestSchemaMap,\n type MutationsProviderParams,\n} from './types';\nimport { range } from './util';\n\n/**\n * Typed object generator.\n */\nexport class TestObjectGenerator<T extends string = TestSchemaType> {\n // prettier-ignore\n constructor(\n protected readonly _schemas: TestSchemaMap<T>,\n private readonly _generators: TestGeneratorMap<T>,\n private readonly _provider?: TestObjectProvider<T>,\n ) {}\n\n get schemas(): (DynamicSchema | S.Schema<any>)[] {\n return Object.values(this._schemas);\n }\n\n getSchema(type: T): DynamicSchema | S.Schema<any> | undefined {\n return this.schemas.find((schema) => getEchoObjectAnnotation(schema)!.typename === type);\n }\n\n protected setSchema(type: T, schema: DynamicSchema | S.Schema<any>) {\n this._schemas[type] = schema;\n }\n\n async createObject({ types }: { types?: T[] } = {}): Promise<ReactiveObject<any>> {\n const type = faker.helpers.arrayElement(types ?? (Object.keys(this._schemas) as T[]));\n const data = await this._generators[type](this._provider);\n if (isReactiveObject(data)) {\n return data;\n }\n\n const schema = this.getSchema(type);\n return schema ? create(schema, data) : create(data);\n }\n\n // TODO(burdon): Create batch.\n // TODO(burdon): Based on dependencies (e.g., organization before contact).\n async createObjects(map: Partial<Record<T, number>>) {\n const tasks = Object.entries<number>(map as any)\n .map(([type, count]) => {\n return range(() => this.createObject({ types: [type as T] }), count);\n })\n .flatMap((t) => t);\n\n return Promise.all(tasks);\n }\n}\n\n/**\n * Typed object generator for a space.\n */\nexport class SpaceObjectGenerator<T extends string> extends TestObjectGenerator<T> {\n constructor(\n private readonly _space: Space,\n schemaMap: TestSchemaMap<T>,\n generators: TestGeneratorMap<T>,\n private readonly _mutations?: TestMutationsMap<T>,\n ) {\n super(schemaMap, generators, async (type: T) => {\n const schema = this.getSchema(type);\n return (schema && (await this._space.db.query(Filter.schema(schema)).run()).objects) ?? [];\n });\n\n // TODO(burdon): Map initially are objects that have not been added to the space.\n // Merge existing schema in space with defaults.\n Object.entries<DynamicSchema | S.Schema<any>>(schemaMap).forEach(([type, dynamicSchema]) => {\n const schema = this._maybeRegisterSchema(type, dynamicSchema);\n\n this.setSchema(type as T, schema);\n });\n }\n\n addSchemas() {\n const result: (DynamicSchema | S.Schema<any>)[] = [];\n for (const [typename, schema] of Object.entries(this._schemas)) {\n result.push(this._maybeRegisterSchema(typename, schema as DynamicSchema | S.Schema<any>));\n }\n\n return result;\n }\n\n override async createObject({ types }: { types?: T[] } = {}): Promise<EchoReactiveObject<any>> {\n return this._space.db.add(await super.createObject({ types }));\n }\n\n private _maybeRegisterSchema(typename: string, schema: DynamicSchema | S.Schema<any>): DynamicSchema | S.Schema<any> {\n if (schema instanceof DynamicSchema) {\n const existingSchema = this._space.db.schema.getSchemaByTypename(typename);\n if (existingSchema != null) {\n return existingSchema;\n }\n this._space.db.add(schema.serializedSchema);\n return this._space.db.schema.registerSchema(schema.serializedSchema);\n } else {\n const existingSchema = this._space.db.graph.schemaRegistry.getSchema(typename);\n if (existingSchema != null) {\n return existingSchema;\n }\n this._space.db.graph.schemaRegistry.addSchema([schema]);\n return schema;\n }\n }\n\n async mutateObject(object: EchoReactiveObject<any>, params: MutationsProviderParams) {\n invariant(this._mutations, 'Mutations not defined.');\n const type = getEchoObjectAnnotation(getSchema(object)!)!.typename as T;\n invariant(type && this._mutations?.[type], 'Invalid object type.');\n\n await this._mutations![type](object, params);\n }\n\n async mutateObjects(objects: EchoReactiveObject<any>[], params: MutationsProviderParams) {\n for (const object of objects) {\n await this.mutateObject(object, params);\n }\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\nexport const randomText = (length: number) => {\n let result = '';\n const characters = 'abcdefghijklmnopqrstuvwxyz';\n const charactersLength = characters.length;\n for (let index = 0; index < length; index++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n};\n"],
5
+ "mappings": ";;;AAOA,SAASA,QAAQC,SAAS;AAC1B,SAASC,yBAAqC;AAC9C,SACEC,UAAAA,SACAC,iBAAAA,gBACAC,YACAC,wBACAC,oBACAC,2BAAAA,0BACAC,KACAC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;IAAoBE,KAAK;EAAmB;EACnD;IAAEF,KAAK;IAAmBE,KAAK;EAAmB;EAClD;IAAEF,KAAK;IAAoBE,KAAK;EAAkB;EAClD;IAAEF,KAAK;IAAoBE,KAAK;EAAkB;;",
6
+ "names": ["next", "A", "createDocAccessor", "create", "DynamicSchema", "EchoObject", "EchoObjectAnnotationId", "effectToJsonSchema", "getEchoObjectAnnotation", "ref", "S", "StoredSchema", "faker", "Filter", "DynamicSchema", "getEchoObjectAnnotation", "getSchema", "isReactiveObject", "create", "invariant", "faker", "range", "fn", "length", "Array", "from", "map", "_", "i", "filter", "Boolean", "randomText", "result", "characters", "charactersLength", "index", "charAt", "Math", "floor", "random", "TestObjectGenerator", "constructor", "_schemas", "_generators", "_provider", "schemas", "Object", "values", "getSchema", "type", "find", "schema", "getEchoObjectAnnotation", "typename", "setSchema", "createObject", "types", "faker", "helpers", "arrayElement", "keys", "data", "isReactiveObject", "create", "createObjects", "map", "tasks", "entries", "count", "range", "flatMap", "t", "Promise", "all", "SpaceObjectGenerator", "_space", "schemaMap", "generators", "_mutations", "db", "query", "Filter", "run", "objects", "forEach", "dynamicSchema", "_maybeRegisterSchema", "addSchemas", "result", "push", "add", "DynamicSchema", "existingSchema", "getSchemaByTypename", "serializedSchema", "registerSchema", "graph", "schemaRegistry", "addSchema", "mutateObject", "object", "params", "invariant", "mutateObjects", "Status", "Priority", "TestSchemaType", "createDynamicSchema", "typename", "fields", "typeSchema", "S", "partial", "Struct", "pipe", "EchoObject", "typeAnnotation", "getEchoObjectAnnotation", "schemaToStore", "create", "StoredSchema", "version", "jsonSchema", "updatedSchema", "annotations", "EchoObjectAnnotationId", "schemaId", "id", "effectToJsonSchema", "DynamicSchema", "testSchemas", "document", "title", "String", "description", "content", "organization", "name", "website", "contact", "email", "org", "ref", "lat", "Number", "lng", "project", "repo", "status", "priority", "active", "Boolean", "testObjectGenerators", "faker", "lorem", "sentence", "sentences", "min", "max", "number", "int", "company", "datatype", "boolean", "probability", "internet", "url", "undefined", "provider", "organizations", "location", "helpers", "arrayElement", "locations", "person", "fullName", "length", "commerce", "productName", "testObjectMutators", "object", "params", "accessor", "createDocAccessor", "i", "count", "handle", "change", "doc", "A", "splice", "path", "slice", "maxContentLength", "mutationSize", "randomText", "Error", "createTestObjectGenerator", "TestObjectGenerator", "createSpaceObjectGenerator", "space", "SpaceObjectGenerator"]
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"packages/core/echo/echo-generator/src/util.ts":{"bytes":2289,"imports":[],"format":"esm"},"packages/core/echo/echo-generator/src/generator.ts":{"bytes":16683,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/random","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":41064,"imports":[{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"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"},"packages/core/echo/echo-generator/src/types.ts":{"bytes":1521,"imports":[],"format":"esm"},"packages/core/echo/echo-generator/src/index.ts":{"bytes":751,"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/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/echo/echo-generator/src/util.ts","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"packages/core/echo/echo-generator/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":29109},"packages/core/echo/echo-generator/dist/lib/node-esm/index.mjs":{"imports":[{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true}],"exports":["Priority","SpaceObjectGenerator","Status","TestObjectGenerator","TestSchemaType","createSpaceObjectGenerator","createTestObjectGenerator","randomText","range"],"entryPoint":"packages/core/echo/echo-generator/src/index.ts","inputs":{"packages/core/echo/echo-generator/src/data.ts":{"bytesInOutput":11548},"packages/core/echo/echo-generator/src/generator.ts":{"bytesInOutput":3818},"packages/core/echo/echo-generator/src/util.ts":{"bytesInOutput":390},"packages/core/echo/echo-generator/src/index.ts":{"bytesInOutput":0}},"bytes":16323}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/echo-generator",
3
- "version": "0.6.11",
3
+ "version": "0.6.12-main.5a87ad5",
4
4
  "description": "ECHO data generator for testing.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -10,7 +10,8 @@
10
10
  ".": {
11
11
  "browser": "./dist/lib/browser/index.mjs",
12
12
  "node": {
13
- "default": "./dist/lib/node/index.cjs"
13
+ "require": "./dist/lib/node/index.cjs",
14
+ "default": "./dist/lib/node-esm/index.mjs"
14
15
  },
15
16
  "types": "./dist/types/src/index.d.ts"
16
17
  }
@@ -24,14 +25,13 @@
24
25
  "src"
25
26
  ],
26
27
  "dependencies": {
27
- "@dxos/automerge": "0.6.11",
28
- "@dxos/client": "0.6.11",
29
- "@dxos/echo-db": "0.6.11",
30
- "@dxos/invariant": "0.6.11",
31
- "@dxos/echo-schema": "0.6.11",
32
- "@dxos/node-std": "0.6.11",
33
- "@dxos/random": "0.6.11",
34
- "@dxos/util": "0.6.11"
28
+ "@dxos/automerge": "0.6.12-main.5a87ad5",
29
+ "@dxos/client": "0.6.12-main.5a87ad5",
30
+ "@dxos/echo-db": "0.6.12-main.5a87ad5",
31
+ "@dxos/echo-schema": "0.6.12-main.5a87ad5",
32
+ "@dxos/invariant": "0.6.12-main.5a87ad5",
33
+ "@dxos/node-std": "0.6.12-main.5a87ad5",
34
+ "@dxos/random": "0.6.12-main.5a87ad5"
35
35
  },
36
36
  "devDependencies": {},
37
37
  "publishConfig": {
@@ -2,14 +2,13 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { expect } from 'chai';
5
+ import { onTestFinished, describe, expect, test } from 'vitest';
6
6
 
7
7
  import { next as A } from '@dxos/automerge/automerge';
8
8
  import { Client } from '@dxos/client';
9
9
  import { getObjectCore } from '@dxos/echo-db';
10
10
  import { getType, S, TypedObject } from '@dxos/echo-schema';
11
11
  import { faker } from '@dxos/random';
12
- import { afterTest, describe, test } from '@dxos/test';
13
12
 
14
13
  import { createSpaceObjectGenerator, createTestObjectGenerator, TestSchemaType } from './data';
15
14
  import { SpaceObjectGenerator } from './generator';
@@ -117,7 +116,7 @@ describe('TestObjectGenerator', () => {
117
116
  const setupTest = async () => {
118
117
  const client = new Client();
119
118
  await client.initialize();
120
- afterTest(async () => await client.destroy());
119
+ onTestFinished(async () => await client.destroy());
121
120
  await client.halo.createIdentity();
122
121
  const space = await client.spaces.create();
123
122
  return { client, space };