@schmock/faker 2.3.0 → 2.4.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.
Files changed (65) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -0
  3. package/dist/constants.d.ts +82 -1
  4. package/dist/constants.d.ts.map +1 -1
  5. package/dist/field-name-matcher.d.ts +19 -0
  6. package/dist/field-name-matcher.d.ts.map +1 -1
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +4 -1
  10. package/dist/jsf-config.d.ts +19 -4
  11. package/dist/jsf-config.d.ts.map +1 -1
  12. package/dist/output-limits.d.ts +3 -0
  13. package/dist/output-limits.d.ts.map +1 -0
  14. package/dist/overrides.d.ts +2 -1
  15. package/dist/overrides.d.ts.map +1 -1
  16. package/dist/schema-children.d.ts +14 -0
  17. package/dist/schema-children.d.ts.map +1 -0
  18. package/dist/schema-enhancement.d.ts +1 -0
  19. package/dist/schema-enhancement.d.ts.map +1 -1
  20. package/dist/validation.d.ts +24 -5
  21. package/dist/validation.d.ts.map +1 -1
  22. package/package.json +21 -7
  23. package/dist/constants.js +0 -8
  24. package/dist/field-mappings.js +0 -1114
  25. package/dist/field-name-matcher.js +0 -148
  26. package/dist/jsf-config.js +0 -117
  27. package/dist/overrides.js +0 -137
  28. package/dist/schema-enhancement.js +0 -104
  29. package/dist/test-utils.d.ts +0 -57
  30. package/dist/test-utils.d.ts.map +0 -1
  31. package/dist/test-utils.js +0 -284
  32. package/dist/validation.js +0 -300
  33. package/src/advanced-features.test.ts +0 -912
  34. package/src/audit-faker-args.test.ts +0 -97
  35. package/src/constants.d.ts.map +0 -1
  36. package/src/constants.ts +0 -9
  37. package/src/data-quality.test.ts +0 -415
  38. package/src/error-handling.test.ts +0 -504
  39. package/src/field-mappings.test.ts +0 -351
  40. package/src/field-mappings.ts +0 -1148
  41. package/src/field-name-matcher.test.ts +0 -292
  42. package/src/field-name-matcher.ts +0 -187
  43. package/src/index.d.ts.map +0 -1
  44. package/src/index.test.ts +0 -1320
  45. package/src/index.ts +0 -185
  46. package/src/integration.test.ts +0 -634
  47. package/src/jsf-config.d.ts.map +0 -1
  48. package/src/jsf-config.test.ts +0 -65
  49. package/src/jsf-config.ts +0 -156
  50. package/src/overrides.d.ts.map +0 -1
  51. package/src/overrides.property.test.ts +0 -172
  52. package/src/overrides.test.ts +0 -38
  53. package/src/overrides.ts +0 -179
  54. package/src/performance.test.ts +0 -441
  55. package/src/plugin-integration.test.ts +0 -575
  56. package/src/post-process.test.ts +0 -177
  57. package/src/real-world.test.ts +0 -636
  58. package/src/schema-enhancement.d.ts.map +0 -1
  59. package/src/schema-enhancement.test.ts +0 -222
  60. package/src/schema-enhancement.ts +0 -144
  61. package/src/steps/deterministic-seeds.steps.ts +0 -112
  62. package/src/steps/faker-plugin.steps.ts +0 -301
  63. package/src/test-utils.ts +0 -385
  64. package/src/validation.d.ts.map +0 -1
  65. package/src/validation.ts +0 -417
@@ -1,1148 +0,0 @@
1
- export interface FieldMapping {
2
- keywords: string[];
3
- fakerMethod: string;
4
- schemaType?: string;
5
- minScore: number;
6
- format?: string;
7
- trueProbability?: number;
8
- fakerArgs?: Record<string, unknown>;
9
- }
10
-
11
- // ── Identity & Auth ─────────────────────────────────────────────────
12
- const identity: FieldMapping[] = [
13
- {
14
- keywords: ["email"],
15
- fakerMethod: "internet.email",
16
- schemaType: "string",
17
- minScore: 0.6,
18
- format: "email",
19
- },
20
- {
21
- keywords: ["username", "user_name", "login", "handle"],
22
- fakerMethod: "internet.username",
23
- schemaType: "string",
24
- minScore: 0.6,
25
- },
26
- {
27
- keywords: ["password", "passwd", "secret"],
28
- fakerMethod: "internet.password",
29
- schemaType: "string",
30
- minScore: 0.6,
31
- },
32
- {
33
- keywords: ["token", "api_key", "apikey", "access_token", "refresh_token"],
34
- fakerMethod: "string.alphanumeric",
35
- schemaType: "string",
36
- minScore: 0.8,
37
- },
38
- ];
39
-
40
- // ── Person ──────────────────────────────────────────────────────────
41
- const person: FieldMapping[] = [
42
- {
43
- keywords: ["first_name", "firstname", "given_name", "forename"],
44
- fakerMethod: "person.firstName",
45
- schemaType: "string",
46
- minScore: 0.6,
47
- },
48
- {
49
- keywords: ["last_name", "lastname", "surname", "family_name"],
50
- fakerMethod: "person.lastName",
51
- schemaType: "string",
52
- minScore: 0.6,
53
- },
54
- {
55
- keywords: [
56
- "full_name",
57
- "fullname",
58
- "display_name",
59
- "displayname",
60
- "full_name",
61
- ],
62
- fakerMethod: "person.fullName",
63
- schemaType: "string",
64
- minScore: 0.6,
65
- },
66
- {
67
- keywords: ["name"],
68
- fakerMethod: "person.fullName",
69
- schemaType: "string",
70
- minScore: 0.6,
71
- },
72
- {
73
- keywords: ["middle_name", "middlename"],
74
- fakerMethod: "person.middleName",
75
- schemaType: "string",
76
- minScore: 0.8,
77
- },
78
- {
79
- keywords: ["prefix", "honorific", "salutation"],
80
- fakerMethod: "person.prefix",
81
- schemaType: "string",
82
- minScore: 0.8,
83
- },
84
- {
85
- keywords: ["suffix"],
86
- fakerMethod: "person.suffix",
87
- schemaType: "string",
88
- minScore: 0.9,
89
- },
90
- {
91
- keywords: ["gender", "sex"],
92
- fakerMethod: "person.sex",
93
- schemaType: "string",
94
- minScore: 0.8,
95
- },
96
- {
97
- keywords: ["bio", "biography"],
98
- fakerMethod: "lorem.paragraph",
99
- schemaType: "string",
100
- minScore: 0.8,
101
- },
102
- {
103
- keywords: [
104
- "job_title",
105
- "jobtitle",
106
- "position",
107
- "occupation",
108
- "job",
109
- "role",
110
- ],
111
- fakerMethod: "person.jobTitle",
112
- schemaType: "string",
113
- minScore: 0.6,
114
- },
115
- {
116
- keywords: ["job_area", "department", "division", "team"],
117
- fakerMethod: "person.jobArea",
118
- schemaType: "string",
119
- minScore: 0.8,
120
- },
121
- {
122
- keywords: ["zodiac", "zodiac_sign"],
123
- fakerMethod: "person.zodiacSign",
124
- schemaType: "string",
125
- minScore: 0.9,
126
- },
127
- ];
128
-
129
- // ── Contact ─────────────────────────────────────────────────────────
130
- const contact: FieldMapping[] = [
131
- {
132
- keywords: [
133
- "phone",
134
- "mobile",
135
- "cell",
136
- "tel",
137
- "telephone",
138
- "cellphone",
139
- "fax",
140
- ],
141
- fakerMethod: "phone.number",
142
- schemaType: "string",
143
- minScore: 0.6,
144
- },
145
- {
146
- keywords: ["imei"],
147
- fakerMethod: "phone.imei",
148
- schemaType: "string",
149
- minScore: 0.9,
150
- },
151
- ];
152
-
153
- // ── Address/Location ────────────────────────────────────────────────
154
- const address: FieldMapping[] = [
155
- {
156
- keywords: ["street", "street_address"],
157
- fakerMethod: "location.streetAddress",
158
- schemaType: "string",
159
- minScore: 0.6,
160
- },
161
- {
162
- keywords: ["address", "mailing_address", "postal_address"],
163
- fakerMethod: "location.streetAddress",
164
- schemaType: "string",
165
- minScore: 0.6,
166
- },
167
- {
168
- keywords: ["city", "town"],
169
- fakerMethod: "location.city",
170
- schemaType: "string",
171
- minScore: 0.6,
172
- },
173
- {
174
- keywords: ["state", "province", "region"],
175
- fakerMethod: "location.state",
176
- schemaType: "string",
177
- minScore: 0.8,
178
- },
179
- {
180
- keywords: ["country"],
181
- fakerMethod: "location.country",
182
- schemaType: "string",
183
- minScore: 0.8,
184
- },
185
- {
186
- keywords: ["country_code", "countrycode"],
187
- fakerMethod: "location.countryCode",
188
- schemaType: "string",
189
- minScore: 0.8,
190
- },
191
- {
192
- keywords: ["county"],
193
- fakerMethod: "location.county",
194
- schemaType: "string",
195
- minScore: 0.9,
196
- },
197
- {
198
- keywords: ["continent"],
199
- fakerMethod: "location.continent",
200
- schemaType: "string",
201
- minScore: 0.9,
202
- },
203
- {
204
- keywords: ["zip", "zipcode", "zip_code", "postal", "postal_code"],
205
- fakerMethod: "location.zipCode",
206
- schemaType: "string",
207
- minScore: 0.6,
208
- },
209
- {
210
- keywords: ["latitude", "lat"],
211
- fakerMethod: "location.latitude",
212
- schemaType: "number",
213
- minScore: 0.6,
214
- },
215
- {
216
- keywords: ["longitude", "lng", "lon", "long"],
217
- fakerMethod: "location.longitude",
218
- schemaType: "number",
219
- minScore: 0.6,
220
- },
221
- {
222
- keywords: ["timezone", "time_zone", "tz"],
223
- fakerMethod: "location.timeZone",
224
- schemaType: "string",
225
- minScore: 0.8,
226
- },
227
- {
228
- keywords: ["building_number"],
229
- fakerMethod: "location.buildingNumber",
230
- schemaType: "string",
231
- minScore: 0.9,
232
- },
233
- ];
234
-
235
- // ── Internet/Network ────────────────────────────────────────────────
236
- const internet: FieldMapping[] = [
237
- {
238
- keywords: ["url", "website", "link", "href", "homepage", "webpage"],
239
- fakerMethod: "internet.url",
240
- schemaType: "string",
241
- minScore: 0.6,
242
- },
243
- {
244
- keywords: [
245
- "avatar",
246
- "photo_url",
247
- "profile_image",
248
- "image_url",
249
- "picture",
250
- "thumbnail",
251
- "icon",
252
- ],
253
- fakerMethod: "image.avatar",
254
- schemaType: "string",
255
- minScore: 0.6,
256
- },
257
- {
258
- keywords: ["domain", "hostname", "domain_name"],
259
- fakerMethod: "internet.domainName",
260
- schemaType: "string",
261
- minScore: 0.8,
262
- },
263
- {
264
- keywords: ["ip", "ip_address", "ipaddress", "ipv4"],
265
- fakerMethod: "internet.ipv4",
266
- schemaType: "string",
267
- minScore: 0.8,
268
- },
269
- {
270
- keywords: ["ipv6"],
271
- fakerMethod: "internet.ipv6",
272
- schemaType: "string",
273
- minScore: 0.9,
274
- },
275
- {
276
- keywords: ["mac", "mac_address"],
277
- fakerMethod: "internet.mac",
278
- schemaType: "string",
279
- minScore: 0.9,
280
- },
281
- {
282
- keywords: ["user_agent", "useragent"],
283
- fakerMethod: "internet.userAgent",
284
- schemaType: "string",
285
- minScore: 0.9,
286
- },
287
- {
288
- keywords: ["port"],
289
- fakerMethod: "internet.port",
290
- schemaType: "number",
291
- minScore: 0.9,
292
- },
293
- {
294
- keywords: ["protocol"],
295
- fakerMethod: "internet.protocol",
296
- schemaType: "string",
297
- minScore: 0.9,
298
- },
299
- ];
300
-
301
- // ── IDs & Identifiers ──────────────────────────────────────────────
302
- const ids: FieldMapping[] = [
303
- {
304
- keywords: ["uuid", "guid"],
305
- fakerMethod: "string.uuid",
306
- schemaType: "string",
307
- minScore: 0.6,
308
- },
309
- {
310
- keywords: ["sku"],
311
- fakerMethod: "string.alphanumeric",
312
- schemaType: "string",
313
- minScore: 0.9,
314
- },
315
- {
316
- keywords: ["slug"],
317
- fakerMethod: "lorem.slug",
318
- schemaType: "string",
319
- minScore: 0.8,
320
- },
321
- {
322
- keywords: ["isbn"],
323
- fakerMethod: "commerce.isbn",
324
- schemaType: "string",
325
- minScore: 0.9,
326
- },
327
- {
328
- keywords: ["vin"],
329
- fakerMethod: "vehicle.vin",
330
- schemaType: "string",
331
- minScore: 0.9,
332
- },
333
- {
334
- keywords: ["iban"],
335
- fakerMethod: "finance.iban",
336
- schemaType: "string",
337
- minScore: 0.9,
338
- },
339
- {
340
- keywords: ["bic", "swift"],
341
- fakerMethod: "finance.bic",
342
- schemaType: "string",
343
- minScore: 0.9,
344
- },
345
- {
346
- keywords: ["ssn", "social_security"],
347
- fakerMethod: "string.numeric",
348
- schemaType: "string",
349
- minScore: 0.9,
350
- },
351
- ];
352
-
353
- // ── Text/Content ────────────────────────────────────────────────────
354
- const text: FieldMapping[] = [
355
- {
356
- keywords: [
357
- "description",
358
- "desc",
359
- "summary",
360
- "overview",
361
- "about",
362
- "excerpt",
363
- ],
364
- fakerMethod: "lorem.paragraph",
365
- schemaType: "string",
366
- minScore: 0.6,
367
- },
368
- {
369
- keywords: ["content", "body", "text", "message"],
370
- fakerMethod: "lorem.paragraphs",
371
- schemaType: "string",
372
- minScore: 0.6,
373
- },
374
- {
375
- keywords: ["title", "heading", "subject", "headline"],
376
- fakerMethod: "lorem.sentence",
377
- schemaType: "string",
378
- minScore: 0.6,
379
- },
380
- {
381
- keywords: ["tag", "label", "category", "keyword"],
382
- fakerMethod: "lorem.word",
383
- schemaType: "string",
384
- minScore: 0.8,
385
- },
386
- {
387
- keywords: ["comment", "note", "remark", "feedback", "review"],
388
- fakerMethod: "lorem.sentence",
389
- schemaType: "string",
390
- minScore: 0.8,
391
- },
392
- {
393
- keywords: ["sentence"],
394
- fakerMethod: "lorem.sentence",
395
- schemaType: "string",
396
- minScore: 0.9,
397
- },
398
- {
399
- keywords: ["paragraph"],
400
- fakerMethod: "lorem.paragraph",
401
- schemaType: "string",
402
- minScore: 0.9,
403
- },
404
- {
405
- keywords: ["word"],
406
- fakerMethod: "lorem.word",
407
- schemaType: "string",
408
- minScore: 0.9,
409
- },
410
- ];
411
-
412
- // ── Business/Commerce ───────────────────────────────────────────────
413
- const business: FieldMapping[] = [
414
- {
415
- keywords: [
416
- "company",
417
- "organization",
418
- "org",
419
- "employer",
420
- "brand",
421
- "operator",
422
- ],
423
- fakerMethod: "company.name",
424
- schemaType: "string",
425
- minScore: 0.6,
426
- },
427
- {
428
- keywords: ["product", "product_name", "item_name"],
429
- fakerMethod: "commerce.productName",
430
- schemaType: "string",
431
- minScore: 0.8,
432
- },
433
- {
434
- keywords: [
435
- "price",
436
- "amount",
437
- "cost",
438
- "fee",
439
- "salary",
440
- "wage",
441
- "total",
442
- "subtotal",
443
- "balance",
444
- "revenue",
445
- "income",
446
- ],
447
- fakerMethod: "commerce.price",
448
- minScore: 0.6,
449
- },
450
- {
451
- keywords: ["currency", "currency_code"],
452
- fakerMethod: "finance.currencyCode",
453
- schemaType: "string",
454
- minScore: 0.8,
455
- },
456
- {
457
- keywords: ["currency_name"],
458
- fakerMethod: "finance.currencyName",
459
- schemaType: "string",
460
- minScore: 0.8,
461
- },
462
- {
463
- keywords: ["currency_symbol"],
464
- fakerMethod: "finance.currencySymbol",
465
- schemaType: "string",
466
- minScore: 0.8,
467
- },
468
- {
469
- keywords: ["account_number", "account_no"],
470
- fakerMethod: "finance.accountNumber",
471
- schemaType: "string",
472
- minScore: 0.8,
473
- },
474
- {
475
- keywords: ["credit_card", "card_number"],
476
- fakerMethod: "finance.creditCardNumber",
477
- schemaType: "string",
478
- minScore: 0.8,
479
- },
480
- {
481
- keywords: ["cvv"],
482
- fakerMethod: "finance.creditCardCVV",
483
- schemaType: "string",
484
- minScore: 0.9,
485
- },
486
- {
487
- keywords: ["transaction_type"],
488
- fakerMethod: "finance.transactionType",
489
- schemaType: "string",
490
- minScore: 0.9,
491
- },
492
- ];
493
-
494
- // ── Date/Time ───────────────────────────────────────────────────────
495
- const dateTime: FieldMapping[] = [
496
- {
497
- keywords: [
498
- "created_at",
499
- "createdat",
500
- "creation_date",
501
- "date_created",
502
- "createddate",
503
- ],
504
- fakerMethod: "date.recent",
505
- schemaType: "string",
506
- minScore: 0.6,
507
- format: "date-time",
508
- },
509
- {
510
- keywords: [
511
- "updated_at",
512
- "updatedat",
513
- "modified_at",
514
- "modifiedat",
515
- "date_updated",
516
- "last_modified",
517
- "date_modified",
518
- ],
519
- fakerMethod: "date.recent",
520
- schemaType: "string",
521
- minScore: 0.6,
522
- format: "date-time",
523
- },
524
- {
525
- keywords: ["deleted_at", "deletedat"],
526
- fakerMethod: "date.recent",
527
- schemaType: "string",
528
- minScore: 0.6,
529
- format: "date-time",
530
- },
531
- {
532
- keywords: ["published_at", "publishedat", "publish_date"],
533
- fakerMethod: "date.recent",
534
- schemaType: "string",
535
- minScore: 0.6,
536
- format: "date-time",
537
- },
538
- {
539
- keywords: ["expires_at", "expiresat", "expiration", "expiry"],
540
- fakerMethod: "date.future",
541
- schemaType: "string",
542
- minScore: 0.6,
543
- format: "date-time",
544
- },
545
- {
546
- keywords: ["birthday", "date_of_birth", "dob", "birthdate", "born"],
547
- fakerMethod: "date.birthdate",
548
- schemaType: "string",
549
- minScore: 0.8,
550
- },
551
- {
552
- keywords: ["start_date", "begin_date"],
553
- fakerMethod: "date.past",
554
- schemaType: "string",
555
- minScore: 0.8,
556
- },
557
- {
558
- keywords: ["end_date", "due_date", "deadline"],
559
- fakerMethod: "date.future",
560
- schemaType: "string",
561
- minScore: 0.8,
562
- },
563
- {
564
- keywords: ["timestamp", "ts"],
565
- fakerMethod: "date.recent",
566
- schemaType: "string",
567
- minScore: 0.8,
568
- },
569
- ];
570
-
571
- // ── Color ───────────────────────────────────────────────────────────
572
- const color: FieldMapping[] = [
573
- {
574
- keywords: ["color", "colour"],
575
- fakerMethod: "color.human",
576
- schemaType: "string",
577
- minScore: 0.8,
578
- },
579
- {
580
- keywords: ["hex_color", "hexcolor"],
581
- fakerMethod: "color.rgb",
582
- schemaType: "string",
583
- minScore: 0.9,
584
- },
585
- ];
586
-
587
- // ── Numeric Semantics ───────────────────────────────────────────────
588
- const numeric: FieldMapping[] = [
589
- {
590
- keywords: ["age"],
591
- fakerMethod: "number.int",
592
- schemaType: "number",
593
- minScore: 0.8,
594
- fakerArgs: { min: 18, max: 80 },
595
- },
596
- {
597
- keywords: ["rating", "score", "stars"],
598
- fakerMethod: "number.int",
599
- schemaType: "number",
600
- minScore: 0.8,
601
- fakerArgs: { min: 1, max: 5 },
602
- },
603
- {
604
- keywords: ["count", "quantity", "qty"],
605
- fakerMethod: "number.int",
606
- schemaType: "number",
607
- minScore: 0.8,
608
- fakerArgs: { min: 1, max: 100 },
609
- },
610
- {
611
- keywords: ["percentage", "percent"],
612
- fakerMethod: "number.int",
613
- schemaType: "number",
614
- minScore: 0.8,
615
- fakerArgs: { min: 0, max: 100 },
616
- },
617
- {
618
- keywords: ["weight"],
619
- fakerMethod: "number.float",
620
- schemaType: "number",
621
- minScore: 0.8,
622
- fakerArgs: { min: 0.1, max: 200 },
623
- },
624
- {
625
- keywords: ["height"],
626
- fakerMethod: "number.int",
627
- schemaType: "number",
628
- minScore: 0.8,
629
- fakerArgs: { min: 100, max: 220 },
630
- },
631
- {
632
- keywords: ["width", "length", "depth"],
633
- fakerMethod: "number.int",
634
- schemaType: "number",
635
- minScore: 0.8,
636
- fakerArgs: { min: 1, max: 1000 },
637
- },
638
- {
639
- keywords: ["priority", "order", "rank", "level"],
640
- fakerMethod: "number.int",
641
- schemaType: "number",
642
- minScore: 0.8,
643
- fakerArgs: { min: 1, max: 10 },
644
- },
645
- {
646
- keywords: ["version"],
647
- fakerMethod: "system.semver",
648
- schemaType: "string",
649
- minScore: 0.8,
650
- },
651
- ];
652
-
653
- // ── Boolean Semantics (weighted) ────────────────────────────────────
654
- const booleans: FieldMapping[] = [
655
- {
656
- keywords: ["is_active", "isactive", "active", "enabled", "is_enabled"],
657
- fakerMethod: "datatype.boolean",
658
- schemaType: "boolean",
659
- minScore: 0.6,
660
- trueProbability: 0.9,
661
- },
662
- {
663
- keywords: ["is_deleted", "isdeleted", "deleted"],
664
- fakerMethod: "datatype.boolean",
665
- schemaType: "boolean",
666
- minScore: 0.6,
667
- trueProbability: 0.05,
668
- },
669
- {
670
- keywords: ["is_archived", "isarchived", "archived"],
671
- fakerMethod: "datatype.boolean",
672
- schemaType: "boolean",
673
- minScore: 0.6,
674
- trueProbability: 0.1,
675
- },
676
- {
677
- keywords: [
678
- "is_verified",
679
- "isverified",
680
- "verified",
681
- "confirmed",
682
- "is_confirmed",
683
- ],
684
- fakerMethod: "datatype.boolean",
685
- schemaType: "boolean",
686
- minScore: 0.6,
687
- trueProbability: 0.8,
688
- },
689
- {
690
- keywords: ["is_admin", "isadmin", "admin"],
691
- fakerMethod: "datatype.boolean",
692
- schemaType: "boolean",
693
- minScore: 0.6,
694
- trueProbability: 0.1,
695
- },
696
- {
697
- keywords: ["is_public", "ispublic", "public", "visible", "is_visible"],
698
- fakerMethod: "datatype.boolean",
699
- schemaType: "boolean",
700
- minScore: 0.6,
701
- trueProbability: 0.7,
702
- },
703
- {
704
- keywords: ["is_read", "isread", "read", "seen", "is_seen"],
705
- fakerMethod: "datatype.boolean",
706
- schemaType: "boolean",
707
- minScore: 0.6,
708
- trueProbability: 0.6,
709
- },
710
- {
711
- keywords: ["is_default", "isdefault"],
712
- fakerMethod: "datatype.boolean",
713
- schemaType: "boolean",
714
- minScore: 0.8,
715
- trueProbability: 0.1,
716
- },
717
- {
718
- keywords: ["is_required", "isrequired", "required", "mandatory"],
719
- fakerMethod: "datatype.boolean",
720
- schemaType: "boolean",
721
- minScore: 0.6,
722
- trueProbability: 0.5,
723
- },
724
- {
725
- keywords: ["is_featured", "isfeatured", "featured", "promoted"],
726
- fakerMethod: "datatype.boolean",
727
- schemaType: "boolean",
728
- minScore: 0.8,
729
- trueProbability: 0.15,
730
- },
731
- {
732
- keywords: ["available", "in_stock"],
733
- fakerMethod: "datatype.boolean",
734
- schemaType: "boolean",
735
- minScore: 0.8,
736
- trueProbability: 0.85,
737
- },
738
- ];
739
-
740
- // ── File/System ─────────────────────────────────────────────────────
741
- const fileSystem: FieldMapping[] = [
742
- {
743
- keywords: ["filename", "file_name"],
744
- fakerMethod: "system.fileName",
745
- schemaType: "string",
746
- minScore: 0.8,
747
- },
748
- {
749
- keywords: [
750
- "file_type",
751
- "filetype",
752
- "mime_type",
753
- "mimetype",
754
- "content_type",
755
- ],
756
- fakerMethod: "system.mimeType",
757
- schemaType: "string",
758
- minScore: 0.8,
759
- },
760
- {
761
- keywords: ["file_ext", "extension"],
762
- fakerMethod: "system.fileExt",
763
- schemaType: "string",
764
- minScore: 0.9,
765
- },
766
- {
767
- keywords: ["file_path", "filepath", "path"],
768
- fakerMethod: "system.filePath",
769
- schemaType: "string",
770
- minScore: 0.9,
771
- },
772
- {
773
- keywords: ["cron", "cron_expression"],
774
- fakerMethod: "system.cron",
775
- schemaType: "string",
776
- minScore: 0.9,
777
- },
778
- {
779
- keywords: ["semver"],
780
- fakerMethod: "system.semver",
781
- schemaType: "string",
782
- minScore: 0.9,
783
- },
784
- ];
785
-
786
- // ── Airline (niche) ─────────────────────────────────────────────────
787
- const airline: FieldMapping[] = [
788
- {
789
- keywords: ["aircraft_type", "airplane", "aircraft"],
790
- fakerMethod: "airline.aircraftType",
791
- schemaType: "string",
792
- minScore: 0.9,
793
- },
794
- {
795
- keywords: ["flight_number", "flight"],
796
- fakerMethod: "airline.flightNumber",
797
- schemaType: "string",
798
- minScore: 0.9,
799
- },
800
- {
801
- keywords: ["record_locator", "booking_ref", "pnr"],
802
- fakerMethod: "airline.recordLocator",
803
- schemaType: "string",
804
- minScore: 0.9,
805
- },
806
- {
807
- keywords: ["seat", "seat_number"],
808
- fakerMethod: "airline.seat",
809
- schemaType: "string",
810
- minScore: 0.9,
811
- },
812
- ];
813
-
814
- // ── Animal (niche) ──────────────────────────────────────────────────
815
- const animal: FieldMapping[] = [
816
- {
817
- keywords: ["animal", "animal_type", "species"],
818
- fakerMethod: "animal.type",
819
- schemaType: "string",
820
- minScore: 0.9,
821
- },
822
- {
823
- keywords: ["pet_name"],
824
- fakerMethod: "animal.petName",
825
- schemaType: "string",
826
- minScore: 0.9,
827
- },
828
- {
829
- keywords: ["breed"],
830
- fakerMethod: "animal.dog",
831
- schemaType: "string",
832
- minScore: 0.9,
833
- },
834
- {
835
- keywords: ["bird"],
836
- fakerMethod: "animal.bird",
837
- schemaType: "string",
838
- minScore: 0.9,
839
- },
840
- {
841
- keywords: ["fish"],
842
- fakerMethod: "animal.fish",
843
- schemaType: "string",
844
- minScore: 0.9,
845
- },
846
- {
847
- keywords: ["horse"],
848
- fakerMethod: "animal.horse",
849
- schemaType: "string",
850
- minScore: 0.9,
851
- },
852
- {
853
- keywords: ["insect"],
854
- fakerMethod: "animal.insect",
855
- schemaType: "string",
856
- minScore: 0.9,
857
- },
858
- ];
859
-
860
- // ── Book (niche) ────────────────────────────────────────────────────
861
- const book: FieldMapping[] = [
862
- {
863
- keywords: ["book_title"],
864
- fakerMethod: "book.title",
865
- schemaType: "string",
866
- minScore: 0.9,
867
- },
868
- {
869
- keywords: ["author", "book_author", "writer"],
870
- fakerMethod: "book.author",
871
- schemaType: "string",
872
- minScore: 0.9,
873
- },
874
- {
875
- keywords: ["genre", "book_genre"],
876
- fakerMethod: "book.genre",
877
- schemaType: "string",
878
- minScore: 0.9,
879
- },
880
- {
881
- keywords: ["publisher", "publishing_house"],
882
- fakerMethod: "book.publisher",
883
- schemaType: "string",
884
- minScore: 0.9,
885
- },
886
- {
887
- keywords: ["book_series", "series_name"],
888
- fakerMethod: "book.series",
889
- schemaType: "string",
890
- minScore: 0.9,
891
- },
892
- ];
893
-
894
- // ── Food (niche) ────────────────────────────────────────────────────
895
- const food: FieldMapping[] = [
896
- {
897
- keywords: ["dish", "meal", "recipe_name"],
898
- fakerMethod: "food.dish",
899
- schemaType: "string",
900
- minScore: 0.9,
901
- },
902
- {
903
- keywords: ["ingredient"],
904
- fakerMethod: "food.ingredient",
905
- schemaType: "string",
906
- minScore: 0.9,
907
- },
908
- {
909
- keywords: ["spice"],
910
- fakerMethod: "food.spice",
911
- schemaType: "string",
912
- minScore: 0.9,
913
- },
914
- {
915
- keywords: ["fruit"],
916
- fakerMethod: "food.fruit",
917
- schemaType: "string",
918
- minScore: 0.9,
919
- },
920
- {
921
- keywords: ["vegetable"],
922
- fakerMethod: "food.vegetable",
923
- schemaType: "string",
924
- minScore: 0.9,
925
- },
926
- {
927
- keywords: ["meat"],
928
- fakerMethod: "food.meat",
929
- schemaType: "string",
930
- minScore: 0.9,
931
- },
932
- {
933
- keywords: ["food_description"],
934
- fakerMethod: "food.description",
935
- schemaType: "string",
936
- minScore: 0.9,
937
- },
938
- {
939
- keywords: ["ethnic_category", "cuisine"],
940
- fakerMethod: "food.ethnicCategory",
941
- schemaType: "string",
942
- minScore: 0.9,
943
- },
944
- ];
945
-
946
- // ── Music (niche) ───────────────────────────────────────────────────
947
- const music: FieldMapping[] = [
948
- {
949
- keywords: ["song", "song_name", "track", "track_name"],
950
- fakerMethod: "music.songName",
951
- schemaType: "string",
952
- minScore: 0.9,
953
- },
954
- {
955
- keywords: ["album", "album_name"],
956
- fakerMethod: "music.album",
957
- schemaType: "string",
958
- minScore: 0.9,
959
- },
960
- {
961
- keywords: ["artist", "musician", "band"],
962
- fakerMethod: "music.artist",
963
- schemaType: "string",
964
- minScore: 0.9,
965
- },
966
- {
967
- keywords: ["music_genre"],
968
- fakerMethod: "music.genre",
969
- schemaType: "string",
970
- minScore: 0.9,
971
- },
972
- ];
973
-
974
- // ── Science (niche) ─────────────────────────────────────────────────
975
- const science: FieldMapping[] = [];
976
-
977
- // ── Vehicle (niche) ─────────────────────────────────────────────────
978
- const vehicle: FieldMapping[] = [
979
- {
980
- keywords: ["vehicle", "vehicle_name"],
981
- fakerMethod: "vehicle.vehicle",
982
- schemaType: "string",
983
- minScore: 0.9,
984
- },
985
- {
986
- keywords: ["vehicle_type"],
987
- fakerMethod: "vehicle.type",
988
- schemaType: "string",
989
- minScore: 0.9,
990
- },
991
- {
992
- keywords: ["vehicle_manufacturer", "car_make"],
993
- fakerMethod: "vehicle.manufacturer",
994
- schemaType: "string",
995
- minScore: 0.9,
996
- },
997
- {
998
- keywords: ["vehicle_model", "car_model"],
999
- fakerMethod: "vehicle.model",
1000
- schemaType: "string",
1001
- minScore: 0.9,
1002
- },
1003
- {
1004
- keywords: ["fuel", "fuel_type"],
1005
- fakerMethod: "vehicle.fuel",
1006
- schemaType: "string",
1007
- minScore: 0.9,
1008
- },
1009
- {
1010
- keywords: ["bicycle"],
1011
- fakerMethod: "vehicle.bicycle",
1012
- schemaType: "string",
1013
- minScore: 0.9,
1014
- },
1015
- {
1016
- keywords: ["vehicle_color", "car_color"],
1017
- fakerMethod: "vehicle.color",
1018
- schemaType: "string",
1019
- minScore: 0.9,
1020
- },
1021
- ];
1022
-
1023
- // ── Git/Dev (niche) ─────────────────────────────────────────────────
1024
- const git: FieldMapping[] = [
1025
- {
1026
- keywords: ["branch", "branch_name", "git_branch"],
1027
- fakerMethod: "git.branch",
1028
- schemaType: "string",
1029
- minScore: 0.9,
1030
- },
1031
- {
1032
- keywords: ["commit_sha", "commit_hash", "sha"],
1033
- fakerMethod: "git.commitSha",
1034
- schemaType: "string",
1035
- minScore: 0.9,
1036
- },
1037
- {
1038
- keywords: ["commit_message"],
1039
- fakerMethod: "git.commitMessage",
1040
- schemaType: "string",
1041
- minScore: 0.9,
1042
- },
1043
- ];
1044
-
1045
- // ── Database (niche) ────────────────────────────────────────────────
1046
- const database: FieldMapping[] = [
1047
- {
1048
- keywords: ["db_column", "column_name"],
1049
- fakerMethod: "database.column",
1050
- schemaType: "string",
1051
- minScore: 0.9,
1052
- },
1053
- {
1054
- keywords: ["db_type", "column_type"],
1055
- fakerMethod: "database.type",
1056
- schemaType: "string",
1057
- minScore: 0.9,
1058
- },
1059
- {
1060
- keywords: ["db_engine", "database_engine"],
1061
- fakerMethod: "database.engine",
1062
- schemaType: "string",
1063
- minScore: 0.9,
1064
- },
1065
- {
1066
- keywords: ["collation"],
1067
- fakerMethod: "database.collation",
1068
- schemaType: "string",
1069
- minScore: 0.9,
1070
- },
1071
- {
1072
- keywords: ["mongodb_id", "object_id"],
1073
- fakerMethod: "database.mongodbObjectId",
1074
- schemaType: "string",
1075
- minScore: 0.9,
1076
- },
1077
- ];
1078
-
1079
- // ── Hacker/Tech (niche) ────────────────────────────────────────────
1080
- const hacker: FieldMapping[] = [
1081
- {
1082
- keywords: ["abbreviation", "tech_abbreviation"],
1083
- fakerMethod: "hacker.abbreviation",
1084
- schemaType: "string",
1085
- minScore: 0.9,
1086
- },
1087
- {
1088
- keywords: ["hacker_phrase", "tech_phrase"],
1089
- fakerMethod: "hacker.phrase",
1090
- schemaType: "string",
1091
- minScore: 0.9,
1092
- },
1093
- ];
1094
-
1095
- // ── Word/Lorem (domain) ────────────────────────────────────────────
1096
- const word: FieldMapping[] = [
1097
- {
1098
- keywords: ["adjective"],
1099
- fakerMethod: "word.adjective",
1100
- schemaType: "string",
1101
- minScore: 0.8,
1102
- },
1103
- {
1104
- keywords: ["adverb"],
1105
- fakerMethod: "word.adverb",
1106
- schemaType: "string",
1107
- minScore: 0.8,
1108
- },
1109
- {
1110
- keywords: ["noun"],
1111
- fakerMethod: "word.noun",
1112
- schemaType: "string",
1113
- minScore: 0.8,
1114
- },
1115
- {
1116
- keywords: ["verb"],
1117
- fakerMethod: "word.verb",
1118
- schemaType: "string",
1119
- minScore: 0.8,
1120
- },
1121
- ];
1122
-
1123
- export const ALL_FIELD_MAPPINGS: FieldMapping[] = [
1124
- ...identity,
1125
- ...person,
1126
- ...contact,
1127
- ...address,
1128
- ...internet,
1129
- ...ids,
1130
- ...text,
1131
- ...business,
1132
- ...dateTime,
1133
- ...color,
1134
- ...numeric,
1135
- ...booleans,
1136
- ...fileSystem,
1137
- ...airline,
1138
- ...animal,
1139
- ...book,
1140
- ...food,
1141
- ...music,
1142
- ...science,
1143
- ...vehicle,
1144
- ...git,
1145
- ...database,
1146
- ...hacker,
1147
- ...word,
1148
- ];