@prismicio/mock 0.0.6 → 0.0.9

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 (99) hide show
  1. package/README.md +4 -1
  2. package/dist/api/index.cjs +242 -122
  3. package/dist/api/index.cjs.map +1 -0
  4. package/dist/api/index.d.ts +3 -2
  5. package/dist/api/index.d.ts.map +1 -0
  6. package/dist/api/index.js +669 -0
  7. package/dist/api/index.js.map +1 -0
  8. package/dist/index.cjs +581 -571
  9. package/dist/index.cjs.map +1 -0
  10. package/dist/index.d.ts +155 -247
  11. package/dist/{index.mjs → index.js} +574 -561
  12. package/dist/index.js.map +1 -0
  13. package/dist/model/index.cjs +294 -257
  14. package/dist/model/index.cjs.map +1 -0
  15. package/dist/model/index.d.ts +72 -106
  16. package/dist/model/index.d.ts.map +1 -0
  17. package/dist/model/index.js +556 -0
  18. package/dist/model/index.js.map +1 -0
  19. package/dist/value/index.cjs +500 -647
  20. package/dist/value/index.cjs.map +1 -0
  21. package/dist/value/index.d.ts +71 -129
  22. package/dist/value/index.d.ts.map +1 -0
  23. package/dist/value/index.js +1461 -0
  24. package/dist/value/index.js.map +1 -0
  25. package/package.json +30 -27
  26. package/src/api/query.ts +2 -2
  27. package/src/api/ref.ts +3 -3
  28. package/src/api/repository.ts +5 -5
  29. package/src/lib/buildContentRelationshipField.ts +6 -1
  30. package/src/lib/buildEmbedField.ts +16 -27
  31. package/src/lib/buildImageFieldImage.ts +49 -0
  32. package/src/lib/createFaker.ts +98 -20
  33. package/src/lib/generateCustomTypeId.ts +1 -1
  34. package/src/lib/generateFieldId.ts +1 -3
  35. package/src/lib/generateTags.ts +4 -12
  36. package/src/lib/getMockEmbedData.ts +33 -12
  37. package/src/lib/getMockImageData.ts +1 -1
  38. package/src/lib/lorem.ts +112 -0
  39. package/src/model/boolean.ts +1 -1
  40. package/src/model/buildMockGroupFieldMap.ts +65 -0
  41. package/src/model/color.ts +2 -2
  42. package/src/model/contentRelationship.ts +16 -23
  43. package/src/model/customType.ts +49 -48
  44. package/src/model/date.ts +2 -2
  45. package/src/model/embed.ts +2 -2
  46. package/src/model/geoPoint.ts +1 -1
  47. package/src/model/group.ts +9 -16
  48. package/src/model/image.ts +16 -20
  49. package/src/model/index.ts +2 -0
  50. package/src/model/integrationFields.ts +5 -3
  51. package/src/model/keyText.ts +2 -2
  52. package/src/model/link.ts +3 -3
  53. package/src/model/linkToMedia.ts +2 -2
  54. package/src/model/number.ts +2 -2
  55. package/src/model/richText.ts +6 -6
  56. package/src/model/select.ts +13 -18
  57. package/src/model/sharedSlice.ts +15 -42
  58. package/src/model/sharedSliceVariation.ts +36 -24
  59. package/src/model/slice.ts +19 -23
  60. package/src/model/sliceZone.ts +23 -59
  61. package/src/model/timestamp.ts +2 -2
  62. package/src/model/title.ts +5 -5
  63. package/src/model/uid.ts +2 -2
  64. package/src/types.ts +130 -88
  65. package/src/value/boolean.ts +1 -1
  66. package/src/value/color.ts +16 -6
  67. package/src/value/contentRelationship.ts +54 -39
  68. package/src/value/customType.ts +5 -5
  69. package/src/value/date.ts +25 -9
  70. package/src/value/embed.ts +32 -7
  71. package/src/value/geoPoint.ts +21 -11
  72. package/src/value/group.ts +31 -45
  73. package/src/value/image.ts +22 -9
  74. package/src/value/integrationFields.ts +26 -14
  75. package/src/value/keyText.ts +16 -6
  76. package/src/value/link.ts +36 -37
  77. package/src/value/linkToMedia.ts +19 -23
  78. package/src/value/number.ts +16 -6
  79. package/src/value/richText/embed.ts +2 -2
  80. package/src/value/richText/heading.ts +10 -17
  81. package/src/value/richText/image.ts +8 -6
  82. package/src/value/richText/index.ts +4 -9
  83. package/src/value/richText/list.ts +4 -8
  84. package/src/value/richText/oList.ts +4 -8
  85. package/src/value/richText/paragraph.ts +8 -4
  86. package/src/value/richText/preformatted.ts +9 -5
  87. package/src/value/select.ts +23 -8
  88. package/src/value/sharedSlice.ts +3 -3
  89. package/src/value/sharedSliceVariation.ts +4 -36
  90. package/src/value/slice.ts +3 -32
  91. package/src/value/sliceZone.ts +54 -69
  92. package/src/value/timestamp.ts +42 -16
  93. package/src/value/title.ts +26 -13
  94. package/src/value/uid.ts +2 -2
  95. package/dist/api/index.mjs +0 -515
  96. package/dist/model/index.mjs +0 -465
  97. package/dist/value/index.mjs +0 -1554
  98. package/src/lib/buildImageField.ts +0 -34
  99. package/src/lib/buildMockGroupFieldMap.ts +0 -84
package/dist/index.cjs CHANGED
@@ -3,70 +3,159 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const changeCase = require('change-case');
6
- const fakerLocaleEN = require('faker/lib/locales/en/index.js');
7
- const Faker = require('faker/lib/index.js');
6
+ const Rand = require('rand-seed');
8
7
  const prismicT = require('@prismicio/types');
9
8
 
10
9
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
10
 
12
11
  function _interopNamespace(e) {
13
12
  if (e && e.__esModule) return e;
14
- var n = Object.create(null);
13
+ const n = Object.create(null);
15
14
  if (e) {
16
- Object.keys(e).forEach(function (k) {
15
+ for (const k in e) {
17
16
  if (k !== 'default') {
18
- var d = Object.getOwnPropertyDescriptor(e, k);
17
+ const d = Object.getOwnPropertyDescriptor(e, k);
19
18
  Object.defineProperty(n, k, d.get ? d : {
20
19
  enumerable: true,
21
- get: function () {
22
- return e[k];
23
- }
20
+ get: function () { return e[k]; }
24
21
  });
25
22
  }
26
- });
23
+ }
27
24
  }
28
- n['default'] = e;
25
+ n["default"] = e;
29
26
  return Object.freeze(n);
30
27
  }
31
28
 
32
29
  const changeCase__namespace = /*#__PURE__*/_interopNamespace(changeCase);
33
- const fakerLocaleEN__namespace = /*#__PURE__*/_interopNamespace(fakerLocaleEN);
34
- const Faker__default = /*#__PURE__*/_interopDefaultLegacy(Faker);
30
+ const Rand__default = /*#__PURE__*/_interopDefaultLegacy(Rand);
35
31
  const prismicT__namespace = /*#__PURE__*/_interopNamespace(prismicT);
36
32
 
37
33
  const FAKER_SEED = 1984;
38
34
 
35
+ const wordsString = "lorem ipsum dolor sit amet, consectetur adipiscing elit ut aliquam, purus sit amet luctus venenatis, lectus magna fringilla urna, porttitor rhoncus dolor purus non enim praesent elementum facilisis leo, vel fringilla est ullamcorper eget nulla facilisi etiam dignissim diam quis enim lobortis scelerisque fermentum dui faucibus in ornare quam viverra orci sagittis eu volutpat odio facilisis mauris sit amet massa vitae tortor condimentum lacinia quis vel eros donec ac odio tempor orci dapibus ultrices in iaculis nunc sed augue lacus, viverra vitae congue eu, consequat ac felis donec et odio pellentesque diam volutpat commodo sed egestas egestas fringilla phasellus faucibus scelerisque eleifend donec pretium vulputate sapien nec sagittis aliquam malesuada bibendum arcu vitae elementum curabitur vitae nunc sed velit dignissim sodales ut eu sem integer vitae justo eget magna fermentum iaculis eu non diam phasellus vestibulum lorem sed risus ultricies tristique nulla aliquet enim tortor, at auctor urna nunc id cursus metus aliquam eleifend mi in nulla posuere sollicitudin aliquam ultrices sagittis orci, a scelerisque purus semper eget duis at tellus at urna condimentum mattis pellentesque id nibh tortor, id aliquet lectus proin nibh nisl, condimentum id venenatis a, condimentum vitae sapien pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas sed tempus, urna et pharetra pharetra, massa massa ultricies mi, quis hendrerit dolor magna eget est lorem ipsum dolor sit amet, consectetur adipiscing elit pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas integer eget aliquet nibh praesent tristique magna sit amet purus gravida quis blandit turpis cursus in hac habitasse platea dictumst quisque sagittis, purus sit amet volutpat consequat, mauris nunc congue nisi, vitae suscipit tellus mauris a diam maecenas sed enim ut sem viverra aliquet eget sit amet tellus cras adipiscing enim eu turpis egestas pretium aenean pharetra, magna ac placerat vestibulum, lectus mauris ultrices eros, in cursus turpis massa tincidunt dui ut ornare lectus sit amet est placerat in egestas erat imperdiet sed euismod nisi porta lorem mollis aliquam ut porttitor leo a diam sollicitudin tempor id eu nisl nunc mi ipsum, faucibus vitae aliquet nec, ullamcorper sit amet risus nullam eget felis eget nunc lobortis mattis aliquam faucibus purus in massa tempor nec feugiat nisl pretium fusce id velit ut tortor pretium viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare suspendisse sed nisi lacus, sed viverra tellus in hac habitasse platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus at augue eget arcu dictum varius duis at consectetur lorem donec massa sapien, faucibus et molestie ac, feugiat sed lectus vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa, eget egestas purus viverra accumsan in nisl nisi, scelerisque eu ultrices vitae, auctor eu augue ut lectus arcu, bibendum at varius vel, pharetra vel turpis nunc eget lorem dolor, sed viverra ipsum nunc aliquet bibendum enim, facilisis gravida neque convallis a cras semper auctor neque, vitae tempus quam pellentesque nec nam aliquam sem et tortor consequat id porta nibh venenatis cras sed felis eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum integer enim neque, volutpat ac tincidunt vitae, semper quis lectus nulla at volutpat diam ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet proin fermentum leo vel orci porta non pulvinar neque laoreet suspendisse interdum consectetur libero, id faucibus nisl tincidunt eget nullam non nisi est, sit amet facilisis magna etiam tempor, orci eu lobortis elementum, nibh tellus molestie nunc, non blandit massa enim nec dui nunc mattis enim ut tellus elementum sagittis vitae et leo duis ut diam quam nulla porttitor massa id neque aliquam vestibulum morbi blandit cursus risus, at ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel risus commodo viverra maecenas accumsan, lacus vel facilisis volutpat, est velit egestas dui, id ornare arcu odio ut sem nulla pharetra diam sit amet nisl suscipit adipiscing bibendum est ultricies integer quis auctor elit sed vulputate mi sit amet mauris commodo quis imperdiet massa tincidunt nunc pulvinar sapien et ligula ullamcorper malesuada proin libero nunc, consequat interdum varius sit amet, mattis vulputate enim nulla aliquet porttitor lacus, luctus accumsan tortor posuere ac ut consequat semper viverra nam libero justo, laoreet sit amet cursus sit amet, dictum sit amet justo donec enim diam, vulputate ut pharetra sit amet, aliquam id diam maecenas ultricies mi eget mauris pharetra et ultrices neque ornare aenean euismod elementum nisi, quis eleifend quam adipiscing vitae proin sagittis, nisl rhoncus mattis rhoncus, urna neque viverra justo, nec ultrices dui sapien eget mi proin sed libero enim, sed faucibus turpis in eu mi bibendum neque egestas congue quisque egestas diam in arcu cursus euismod quis viverra nibh cras pulvinar mattis nunc, sed blandit libero volutpat sed cras ornare arcu dui vivamus arcu felis, bibendum ut tristique et, egestas quis ipsum suspendisse ultrices gravida dictum fusce ut placerat orci nulla pellentesque dignissim enim, sit amet venenatis urna cursus eget nunc scelerisque viverra mauris, in aliquam sem fringilla ut morbi tincidunt augue interdum velit euismod in pellentesque massa placerat duis ultricies lacus sed turpis tincidunt id aliquet risus feugiat in ante metus, dictum at tempor commodo, ullamcorper a lacus vestibulum sed arcu non odio euismod lacinia at quis risus sed vulputate odio ut enim blandit volutpat maecenas volutpat blandit aliquam etiam erat velit, scelerisque in dictum non, consectetur a erat nam at lectus urna duis convallis convallis tellus, id interdum velit laoreet id donec ultrices tincidunt arcu, non sodales neque sodales ut etiam sit amet nisl purus, in mollis nunc sed id semper risus in hendrerit gravida rutrum quisque non tellus orci, ac auctor augue mauris augue neque, gravida in fermentum et, sollicitudin ac orci phasellus egestas tellus rutrum tellus pellentesque eu tincidunt tortor aliquam nulla facilisi cras fermentum, odio eu feugiat pretium, nibh ipsum consequat nisl, vel pretium lectus quam id leo in vitae turpis massa sed elementum tempus egestas sed sed risus pretium quam vulputate dignissim suspendisse in est ante in nibh mauris, cursus mattis molestie a, iaculis at erat pellentesque adipiscing commodo elit, at imperdiet dui accumsan sit amet nulla facilisi morbi tempus iaculis urna, id volutpat lacus laoreet non curabitur gravida arcu ac tortor dignissim convallis aenean et tortor at risus viverra adipiscing at in tellus integer feugiat scelerisque varius morbi enim nunc, faucibus a pellentesque sit amet, porttitor eget dolor morbi non arcu risus, quis varius quam quisque id diam vel quam elementum pulvinar etiam non quam lacus suspendisse faucibus interdum posuere lorem ipsum dolor sit amet, consectetur adipiscing elit duis tristique sollicitudin nibh sit amet commodo nulla facilisi nullam vehicula ipsum a arcu cursus vitae congue mauris rhoncus aenean vel elit scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas maecenas pharetra convallis posuere morbi leo urna, molestie at elementum eu, facilisis sed odio morbi quis commodo odio aenean sed adipiscing diam donec adipiscing tristique risus nec feugiat in fermentum posuere urna nec tincidunt praesent semper feugiat nibh sed pulvinar proin gravida hendrerit lectus a molestie";
36
+ const loremWords = wordsString.split(" ");
37
+ const lorem = (length, wordOffset = 0) => {
38
+ const count = parseInt(length.substring(0, length.length - 1));
39
+ const countType = length.charAt(length.length - 1);
40
+ if (!isNaN(count) && (countType === "w" || countType === "c")) {
41
+ if (!lorem.spaceIndices.length) {
42
+ let startIndex = -1;
43
+ do {
44
+ const index = wordsString.indexOf(" ", startIndex + 1);
45
+ lorem.spaceIndices.push(index);
46
+ startIndex = index;
47
+ } while (startIndex !== -1);
48
+ }
49
+ if (countType === "c") {
50
+ return wordsString.substring(0, count);
51
+ } else {
52
+ let sentence = "";
53
+ const startSpaceIndex = lorem.spaceIndices[wordOffset % lorem.spaceIndices.length - 1];
54
+ const endSpaceIndex = lorem.spaceIndices[(wordOffset % lorem.spaceIndices.length + count) % lorem.spaceIndices.length - 1];
55
+ if (count + wordOffset % lorem.spaceIndices.length > lorem.spaceIndices.length) {
56
+ sentence += wordsString.substring(startSpaceIndex + 1) + " ";
57
+ const wraparoundCounts = Math.floor(count / lorem.spaceIndices.length) - 1;
58
+ for (let i = 0; i < wraparoundCounts; i++) {
59
+ sentence += wordsString + " ";
60
+ }
61
+ sentence += wordsString.substring(0, endSpaceIndex);
62
+ } else {
63
+ sentence = wordsString.substring(startSpaceIndex + 1, endSpaceIndex);
64
+ }
65
+ if (sentence.charAt(sentence.length - 1) === ",") {
66
+ return sentence.substring(0, sentence.length - 1);
67
+ } else {
68
+ return sentence.substring(0, sentence.length);
69
+ }
70
+ }
71
+ }
72
+ throw new Error("Length must be of the form `${number}w` or `${number}c`");
73
+ };
74
+ lorem.spaceIndices = [];
75
+
39
76
  const createFaker = (seed = FAKER_SEED) => {
40
- let normalizedSeed;
41
- if (typeof seed === "string") {
42
- normalizedSeed = seed.split("").map((char) => char.charCodeAt(0));
77
+ const normalizedSeed = seed.toString();
78
+ if (createFaker.cache[normalizedSeed]) {
79
+ return createFaker.cache[normalizedSeed];
43
80
  } else {
44
- normalizedSeed = seed;
45
- }
46
- const cacheKey = JSON.stringify(normalizedSeed);
47
- if (createFaker.cache[cacheKey]) {
48
- return createFaker.cache[cacheKey];
81
+ const faker = new Faker(normalizedSeed);
82
+ return createFaker.cache[normalizedSeed] = faker;
49
83
  }
50
- const fakerInstance = new Faker__default['default']();
51
- fakerInstance.locales["en"] = fakerLocaleEN__namespace;
52
- fakerInstance.seed(normalizedSeed);
53
- createFaker.cache[cacheKey] = fakerInstance;
54
- return fakerInstance;
55
84
  };
56
85
  createFaker.cache = {};
86
+ const DAY_MS = 1e3 * 60 * 60 * 24;
87
+ const YEAR_MS = DAY_MS * 365;
88
+ const YEAR_2022_MS = 52 * (YEAR_MS + DAY_MS / 4);
89
+ class Faker {
90
+ constructor(seed) {
91
+ this.rand = new Rand__default["default"](seed);
92
+ }
93
+ boolean() {
94
+ return this.random() >= 0.5;
95
+ }
96
+ random() {
97
+ return this.rand.next();
98
+ }
99
+ randomElement(elements) {
100
+ return elements[this.range(0, elements.length)];
101
+ }
102
+ randomElements(elements) {
103
+ return elements.filter(() => this.boolean());
104
+ }
105
+ range(min, max) {
106
+ return Math.floor(this.rangeFloat(Math.ceil(min), Math.floor(max)));
107
+ }
108
+ rangeFloat(min, max) {
109
+ return this.random() * (max - min) + min;
110
+ }
111
+ words(length, wordOffset = this.range(0, loremWords.length)) {
112
+ return lorem(`${length}w`, wordOffset);
113
+ }
114
+ word() {
115
+ return this.randomElement(loremWords);
116
+ }
117
+ lorem(length, wordOffset = this.range(0, loremWords.length)) {
118
+ return lorem(length, wordOffset);
119
+ }
120
+ url() {
121
+ return `https://${this.word()}.example`;
122
+ }
123
+ hexColor() {
124
+ return `#${this.hash(6)}`;
125
+ }
126
+ hash(length) {
127
+ let hash = "";
128
+ for (let i = 0; i < length; i++) {
129
+ const chars = this.boolean() ? "abcdef" : "0123456789";
130
+ hash += chars[this.range(0, chars.length)];
131
+ }
132
+ return hash;
133
+ }
134
+ date() {
135
+ return new Date(YEAR_2022_MS + this.range(-YEAR_MS * 3, YEAR_MS * 3));
136
+ }
137
+ dateAfter(date) {
138
+ const timestamp = date.getTime();
139
+ return new Date(this.range(timestamp, timestamp + YEAR_MS * 3));
140
+ }
141
+ dateBefore(date) {
142
+ const timestamp = date.getTime();
143
+ return new Date(this.range(timestamp - YEAR_MS * 3, timestamp));
144
+ }
145
+ dateBetween(min, max) {
146
+ return new Date(this.range(min.getTime(), max.getTime()));
147
+ }
148
+ }
57
149
 
58
150
  const generateTags = (config) => {
59
151
  var _a, _b;
60
152
  const faker = createFaker(config.seed);
61
- return Array(faker.datatype.number({
62
- min: (_a = config.min) != null ? _a : 0,
63
- max: (_b = config.max) != null ? _b : 2
64
- })).fill(void 0).map(() => changeCase__namespace.capitalCase(faker.lorem.words(faker.datatype.number({ min: 1, max: 3 }))));
153
+ return Array.from({ length: faker.range((_a = config.min) != null ? _a : 0, (_b = config.max) != null ? _b : 2) }, () => changeCase__namespace.capitalCase(faker.words(faker.range(1, 3))));
65
154
  };
66
155
 
67
156
  const boolean$1 = (config = {}) => {
68
157
  const faker = createFaker(config.seed);
69
- return faker.datatype.boolean();
158
+ return faker.boolean();
70
159
  };
71
160
 
72
161
  const valueForModel = (config) => {
@@ -283,7 +372,7 @@ const boolean = (config = {}) => {
283
372
  return {
284
373
  type: prismicT__namespace.CustomTypeModelFieldType.Boolean,
285
374
  config: {
286
- label: changeCase__namespace.capitalCase(faker.company.bsNoun())
375
+ label: changeCase__namespace.capitalCase(faker.word())
287
376
  }
288
377
  };
289
378
  };
@@ -293,38 +382,58 @@ const color$1 = (config = {}) => {
293
382
  return {
294
383
  type: prismicT__namespace.CustomTypeModelFieldType.Color,
295
384
  config: {
296
- label: changeCase__namespace.capitalCase(faker.company.bsNoun()),
297
- placeholder: changeCase__namespace.sentenceCase(faker.lorem.words(3))
385
+ label: changeCase__namespace.capitalCase(faker.word()),
386
+ placeholder: changeCase__namespace.sentenceCase(faker.words(3))
298
387
  }
299
388
  };
300
389
  };
301
390
 
302
- const generateCustomTypeId = (config) => {
303
- const faker = createFaker(config.seed);
304
- return changeCase__namespace.snakeCase(faker.company.bsNoun());
305
- };
306
-
307
391
  const contentRelationship$1 = (config = {}) => {
308
392
  const faker = createFaker(config.seed);
309
393
  return {
310
394
  type: prismicT__namespace.CustomTypeModelFieldType.Link,
311
395
  config: {
312
- label: changeCase__namespace.capitalCase(faker.company.bsNoun()),
313
- placeholder: changeCase__namespace.sentenceCase(faker.lorem.words(3)),
396
+ label: changeCase__namespace.capitalCase(faker.word()),
397
+ placeholder: changeCase__namespace.sentenceCase(faker.words(3)),
314
398
  select: prismicT__namespace.CustomTypeModelLinkSelectType.Document,
315
- customtypes: config.constrainCustomTypes ? Array(faker.datatype.number({ min: 1, max: 3 })).fill(void 0).map(() => generateCustomTypeId({ seed: config.seed })) : void 0,
316
- tags: config.constrainTags ? Array(faker.datatype.number({ min: 1, max: 3 })).fill(void 0).map(() => changeCase__namespace.capitalCase(faker.lorem.words(faker.datatype.number({ min: 1, max: 3 })))) : void 0
399
+ customtypes: config.customTypeIDs,
400
+ tags: config.tags
317
401
  }
318
402
  };
319
403
  };
320
404
 
405
+ const customType$1 = (config = {}) => {
406
+ var _a, _b;
407
+ const faker = createFaker(config.seed);
408
+ let label = config.label || changeCase__namespace.capitalCase(faker.words(faker.range(1, 2)));
409
+ let id = config.id || changeCase__namespace.snakeCase(label);
410
+ if (config.id && !config.label) {
411
+ label = changeCase__namespace.capitalCase(config.id);
412
+ } else if (config.label && !config.label) {
413
+ id = changeCase__namespace.snakeCase(config.label);
414
+ }
415
+ let json = {};
416
+ if ("fields" in config && config.fields) {
417
+ json = { Main: config.fields };
418
+ } else if ("tabs" in config && config.tabs) {
419
+ json = config.tabs;
420
+ }
421
+ return {
422
+ id,
423
+ label,
424
+ status: (_a = config.status) != null ? _a : faker.boolean(),
425
+ repeatable: (_b = config.repeatable) != null ? _b : faker.boolean(),
426
+ json
427
+ };
428
+ };
429
+
321
430
  const date$1 = (config = {}) => {
322
431
  const faker = createFaker(config.seed);
323
432
  return {
324
433
  type: prismicT__namespace.CustomTypeModelFieldType.Date,
325
434
  config: {
326
- label: changeCase__namespace.capitalCase(faker.company.bsNoun()),
327
- placeholder: changeCase__namespace.sentenceCase(faker.lorem.words(3))
435
+ label: changeCase__namespace.capitalCase(faker.word()),
436
+ placeholder: changeCase__namespace.sentenceCase(faker.words(3))
328
437
  }
329
438
  };
330
439
  };
@@ -334,8 +443,8 @@ const embed$2 = (config = {}) => {
334
443
  return {
335
444
  type: prismicT__namespace.CustomTypeModelFieldType.Embed,
336
445
  config: {
337
- label: changeCase__namespace.capitalCase(faker.company.bsNoun()),
338
- placeholder: changeCase__namespace.sentenceCase(faker.lorem.words(3))
446
+ label: changeCase__namespace.capitalCase(faker.word()),
447
+ placeholder: changeCase__namespace.sentenceCase(faker.words(3))
339
448
  }
340
449
  };
341
450
  };
@@ -345,28 +454,40 @@ const geoPoint$1 = (config = {}) => {
345
454
  return {
346
455
  type: prismicT__namespace.CustomTypeModelFieldType.GeoPoint,
347
456
  config: {
348
- label: changeCase__namespace.capitalCase(faker.company.bsNoun())
457
+ label: changeCase__namespace.capitalCase(faker.word())
458
+ }
459
+ };
460
+ };
461
+
462
+ const group$1 = (config = {}) => {
463
+ const faker = createFaker(config.seed);
464
+ return {
465
+ type: prismicT__namespace.CustomTypeModelFieldType.Group,
466
+ config: {
467
+ label: changeCase__namespace.capitalCase(faker.word()),
468
+ fields: config.fields || {}
349
469
  }
350
470
  };
351
471
  };
352
472
 
353
473
  const image$2 = (config = {}) => {
354
- var _a;
355
474
  const faker = createFaker(config.seed);
356
- const thumbnailsCount = (_a = config.thumbnailsCount) != null ? _a : faker.datatype.number(3);
475
+ const thumbnails = (config.thumbnailNames || []).map((name) => {
476
+ return {
477
+ name,
478
+ width: faker.range(500, 2e3),
479
+ height: faker.range(500, 2e3)
480
+ };
481
+ });
357
482
  return {
358
483
  type: prismicT__namespace.CustomTypeModelFieldType.Image,
359
484
  config: {
360
- label: changeCase__namespace.capitalCase(faker.company.bsNoun()),
485
+ label: changeCase__namespace.capitalCase(faker.word()),
361
486
  constraint: {
362
- width: config.withConstraint ? faker.datatype.number({ min: 500, max: 2e3 }) : null,
363
- height: config.withConstraint ? faker.datatype.number({ min: 500, max: 2e3 }) : null
487
+ width: config.withConstraint ? faker.range(500, 2e3) : null,
488
+ height: config.withConstraint ? faker.range(500, 2e3) : null
364
489
  },
365
- thumbnails: Array(thumbnailsCount).fill(void 0).map(() => ({
366
- name: changeCase__namespace.pascalCase(faker.company.bsNoun()),
367
- width: faker.datatype.number({ min: 500, max: 2e3 }),
368
- height: faker.datatype.number({ min: 500, max: 2e3 })
369
- }))
490
+ thumbnails
370
491
  }
371
492
  };
372
493
  };
@@ -376,8 +497,8 @@ const integrationFields$1 = (config = {}) => {
376
497
  return {
377
498
  type: prismicT__namespace.CustomTypeModelFieldType.IntegrationFields,
378
499
  config: {
379
- label: changeCase__namespace.capitalCase(faker.company.bsNoun()),
380
- catalog: changeCase__namespace.snakeCase(faker.lorem.words(4))
500
+ label: changeCase__namespace.capitalCase(faker.word()),
501
+ catalog: config.catalog || changeCase__namespace.snakeCase(faker.words(2))
381
502
  }
382
503
  };
383
504
  };
@@ -387,8 +508,8 @@ const keyText$1 = (config = {}) => {
387
508
  return {
388
509
  type: prismicT__namespace.CustomTypeModelFieldType.Text,
389
510
  config: {
390
- label: changeCase__namespace.capitalCase(faker.company.bsNoun()),
391
- placeholder: changeCase__namespace.sentenceCase(faker.lorem.words(3))
511
+ label: changeCase__namespace.capitalCase(faker.word()),
512
+ placeholder: changeCase__namespace.sentenceCase(faker.words(3))
392
513
  }
393
514
  };
394
515
  };
@@ -398,10 +519,10 @@ const link$1 = (config = {}) => {
398
519
  return {
399
520
  type: prismicT__namespace.CustomTypeModelFieldType.Link,
400
521
  config: {
401
- label: changeCase__namespace.capitalCase(faker.company.bsNoun()),
402
- placeholder: changeCase__namespace.sentenceCase(faker.lorem.words(3)),
522
+ label: changeCase__namespace.capitalCase(faker.word()),
523
+ placeholder: changeCase__namespace.sentenceCase(faker.words(3)),
403
524
  select: null,
404
- allowTargetBlank: ("allowTargetBlank" in config ? config.allowTargetBlank : faker.datatype.boolean()) || void 0
525
+ allowTargetBlank: ("allowTargetBlank" in config ? config.allowTargetBlank : faker.boolean()) || void 0
405
526
  }
406
527
  };
407
528
  };
@@ -411,8 +532,8 @@ const linkToMedia$1 = (config = {}) => {
411
532
  return {
412
533
  type: prismicT__namespace.CustomTypeModelFieldType.Link,
413
534
  config: {
414
- label: changeCase__namespace.capitalCase(faker.company.bsNoun()),
415
- placeholder: changeCase__namespace.sentenceCase(faker.lorem.words(3)),
535
+ label: changeCase__namespace.capitalCase(faker.word()),
536
+ placeholder: changeCase__namespace.sentenceCase(faker.words(3)),
416
537
  select: prismicT__namespace.CustomTypeModelLinkSelectType.Media
417
538
  }
418
539
  };
@@ -423,8 +544,8 @@ const number$1 = (config = {}) => {
423
544
  return {
424
545
  type: prismicT__namespace.CustomTypeModelFieldType.Number,
425
546
  config: {
426
- label: changeCase__namespace.capitalCase(faker.company.bsNoun()),
427
- placeholder: changeCase__namespace.sentenceCase(faker.lorem.words(3))
547
+ label: changeCase__namespace.capitalCase(faker.word()),
548
+ placeholder: changeCase__namespace.sentenceCase(faker.words(3))
428
549
  }
429
550
  };
430
551
  };
@@ -432,7 +553,7 @@ const number$1 = (config = {}) => {
432
553
  const richText$1 = (config = {}) => {
433
554
  var _a;
434
555
  const faker = createFaker(config.seed);
435
- const blockTypes = faker.random.arrayElements([
556
+ const blockTypes = faker.randomElements([
436
557
  prismicT__namespace.RichTextNodeType.heading1,
437
558
  prismicT__namespace.RichTextNodeType.heading2,
438
559
  prismicT__namespace.RichTextNodeType.heading3,
@@ -449,168 +570,94 @@ const richText$1 = (config = {}) => {
449
570
  prismicT__namespace.RichTextNodeType.embed,
450
571
  prismicT__namespace.RichTextNodeType.hyperlink
451
572
  ]).join(",");
452
- const blockTypeConfig = ((_a = config.withMultipleBlocks) != null ? _a : faker.datatype.boolean()) ? { multi: blockTypes } : { single: blockTypes };
573
+ const blockTypeConfig = ((_a = config.withMultipleBlocks) != null ? _a : faker.boolean()) ? { multi: blockTypes } : { single: blockTypes };
453
574
  return {
454
575
  type: prismicT__namespace.CustomTypeModelFieldType.StructuredText,
455
576
  config: {
456
- label: changeCase__namespace.capitalCase(faker.company.bsNoun()),
457
- placeholder: changeCase__namespace.sentenceCase(faker.lorem.words(3)),
458
- allowTargetBlank: faker.datatype.boolean() ? true : void 0,
577
+ label: changeCase__namespace.capitalCase(faker.word()),
578
+ placeholder: changeCase__namespace.sentenceCase(faker.words(3)),
579
+ allowTargetBlank: faker.boolean() ? true : void 0,
459
580
  ...blockTypeConfig
460
581
  }
461
582
  };
462
583
  };
463
584
 
464
585
  const select$1 = (config = {}) => {
465
- var _a;
466
586
  const faker = createFaker(config.seed);
467
- const optionsCount = (_a = config.optionsCount) != null ? _a : faker.datatype.number({ min: 1, max: 5 });
468
- const options = Array(optionsCount).fill(void 0).map(() => changeCase__namespace.capitalCase(faker.company.bsBuzz()));
469
587
  return {
470
588
  type: prismicT__namespace.CustomTypeModelFieldType.Select,
471
589
  config: {
472
- label: changeCase__namespace.capitalCase(faker.company.bsNoun()),
473
- placeholder: changeCase__namespace.sentenceCase(faker.lorem.words(3)),
474
- options,
475
- default_value: config.withDefaultValue ? faker.random.arrayElement(options) : void 0
590
+ label: changeCase__namespace.capitalCase(faker.word()),
591
+ placeholder: changeCase__namespace.sentenceCase(faker.words(3)),
592
+ options: config.options || [],
593
+ default_value: config.defaultValue || void 0
476
594
  }
477
595
  };
478
596
  };
479
597
 
480
- const timestamp$1 = (config = {}) => {
598
+ const sharedSlice$1 = (config = {}) => {
481
599
  const faker = createFaker(config.seed);
600
+ let name = config.name || changeCase__namespace.capitalCase(faker.words(faker.range(1, 2)));
601
+ let id = config.id || changeCase__namespace.snakeCase(name);
602
+ if (config.id && !config.name) {
603
+ name = changeCase__namespace.pascalCase(config.id);
604
+ } else if (config.name && !config.name) {
605
+ id = changeCase__namespace.snakeCase(config.name);
606
+ }
482
607
  return {
483
- type: prismicT__namespace.CustomTypeModelFieldType.Timestamp,
484
- config: {
485
- label: changeCase__namespace.capitalCase(faker.company.bsNoun()),
486
- placeholder: changeCase__namespace.sentenceCase(faker.lorem.words(3))
487
- }
608
+ type: prismicT__namespace.CustomTypeModelSliceType.SharedSlice,
609
+ id,
610
+ name,
611
+ description: changeCase__namespace.sentenceCase(faker.words(faker.range(5, 10))),
612
+ variations: config.variations || []
488
613
  };
489
614
  };
490
615
 
491
- const title$1 = (config = {}) => {
492
- const faker = createFaker(config.seed);
493
- const single = faker.random.arrayElements([
494
- "heading1",
495
- "heading2",
496
- "heading3",
497
- "heading4",
498
- "heading5",
499
- "heading6"
500
- ]).join(",");
616
+ const sharedSliceChoice = () => {
501
617
  return {
502
- type: prismicT__namespace.CustomTypeModelFieldType.StructuredText,
503
- config: {
504
- label: changeCase__namespace.capitalCase(faker.company.bsNoun()),
505
- placeholder: changeCase__namespace.sentenceCase(faker.lorem.words(3)),
506
- single,
507
- allowTargetBlank: faker.datatype.boolean() ? true : void 0
508
- }
618
+ type: prismicT__namespace.CustomTypeModelSliceType.SharedSlice
509
619
  };
510
620
  };
511
621
 
512
- const generateFieldId = (config) => {
513
- const faker = createFaker(config.seed);
514
- return changeCase__namespace.snakeCase(faker.lorem.words(faker.datatype.number({ min: 1, max: 3 })));
515
- };
516
-
517
- const mockModelFns = {
518
- boolean,
519
- color: color$1,
520
- contentRelationship: contentRelationship$1,
521
- date: date$1,
522
- embed: embed$2,
523
- geoPoint: geoPoint$1,
524
- image: image$2,
525
- integrationFields: integrationFields$1,
526
- keyText: keyText$1,
527
- link: link$1,
528
- linkToMedia: linkToMedia$1,
529
- number: number$1,
530
- richText: richText$1,
531
- select: select$1,
532
- timestamp: timestamp$1,
533
- title: title$1
534
- };
535
- const buildMockGroupFieldMap = (config = {}) => {
536
- var _a;
622
+ const sharedSliceVariation$1 = (config = {}) => {
537
623
  const faker = createFaker(config.seed);
538
- const configs = config.configs || {};
539
- const fields = {};
540
- for (const mockModelType in mockModelFns) {
541
- const mockModelFn = mockModelFns[mockModelType];
542
- const mockModelMapConfig = configs[mockModelType] || {};
543
- const count = (_a = mockModelMapConfig.count) != null ? _a : faker.random.arrayElement([0, 0, 0, 1]);
544
- for (let i = 0; i < count; i++) {
545
- const fieldId = generateFieldId({ seed: config.seed });
546
- fields[fieldId] = mockModelFn({
547
- seed: config.seed,
548
- ...mockModelMapConfig.config
549
- });
550
- }
624
+ let name = config.name || changeCase__namespace.capitalCase(faker.words(faker.range(1, 2)));
625
+ let id = config.id || changeCase__namespace.snakeCase(name);
626
+ if (config.id && !config.name) {
627
+ name = changeCase__namespace.pascalCase(config.id);
628
+ } else if (config.name && !config.name) {
629
+ id = changeCase__namespace.snakeCase(config.name);
551
630
  }
552
- return fields;
553
- };
554
-
555
- const uid$1 = (config = {}) => {
556
- const faker = createFaker(config.seed);
557
631
  return {
558
- type: prismicT__namespace.CustomTypeModelFieldType.UID,
559
- config: {
560
- label: changeCase__namespace.capitalCase(faker.company.bsNoun()),
561
- placeholder: changeCase__namespace.sentenceCase(faker.lorem.words(3))
562
- }
563
- };
564
- };
565
-
566
- const sharedSliceChoice = () => {
567
- return {
568
- type: prismicT__namespace.CustomTypeModelSliceType.SharedSlice
632
+ id,
633
+ name,
634
+ description: changeCase__namespace.sentenceCase(faker.words(faker.range(5, 10))),
635
+ docURL: faker.url(),
636
+ version: faker.hash(7),
637
+ primary: config.primaryFields || {},
638
+ items: config.itemsFields || {}
569
639
  };
570
640
  };
571
641
 
572
642
  const slice$1 = (config = {}) => {
573
- var _a, _b, _c, _d, _e, _f;
574
643
  const faker = createFaker(config.seed);
575
644
  return {
576
645
  type: prismicT__namespace.CustomTypeModelSliceType.Slice,
577
- icon: changeCase__namespace.snakeCase(faker.company.bsNoun()),
578
- display: faker.datatype.boolean() ? prismicT__namespace.CustomTypeModelSliceDisplay.Grid : prismicT__namespace.CustomTypeModelSliceDisplay.List,
579
- fieldset: changeCase__namespace.capitalCase(faker.lorem.words()),
580
- description: faker.lorem.sentence(),
581
- repeat: buildMockGroupFieldMap({
582
- seed: (_b = (_a = config.repeatFieldConfig) == null ? void 0 : _a.seed) != null ? _b : config.seed,
583
- configs: (_c = config.repeatFieldConfig) == null ? void 0 : _c.configs
584
- }),
585
- "non-repeat": buildMockGroupFieldMap({
586
- seed: (_e = (_d = config.nonRepeatFieldConfig) == null ? void 0 : _d.seed) != null ? _e : config.seed,
587
- configs: (_f = config.nonRepeatFieldConfig) == null ? void 0 : _f.configs
588
- })
646
+ icon: changeCase__namespace.snakeCase(faker.word()),
647
+ display: faker.boolean() ? prismicT__namespace.CustomTypeModelSliceDisplay.Grid : prismicT__namespace.CustomTypeModelSliceDisplay.List,
648
+ fieldset: changeCase__namespace.capitalCase(faker.words(2)),
649
+ description: changeCase__namespace.sentenceCase(faker.words(faker.range(5, 10))),
650
+ repeat: config.repeatFields || {},
651
+ "non-repeat": config.nonRepeatFields || {}
589
652
  };
590
653
  };
591
654
 
592
655
  const sliceZone$1 = (config = {}) => {
593
- var _a;
594
- const faker = createFaker(config.seed);
595
- let choices = {};
596
- if ("choices" in config) {
597
- choices = config.choices || {};
598
- } else {
599
- const choicesCount = (_a = config.choicesCount) != null ? _a : faker.datatype.number({ min: 2, max: 6 });
600
- for (let i = 0; i < choicesCount; i++) {
601
- const choiceId = generateFieldId({ seed: config.seed });
602
- choices[choiceId] = config.withSharedSlices ? sharedSliceChoice() : slice$1({ seed: config.seed });
603
- }
604
- }
605
656
  const labels = {};
606
- for (const choiceId in choices) {
607
- const choice = choices[choiceId];
657
+ for (const choiceId in config.choices) {
658
+ const choice = config.choices[choiceId];
608
659
  if (choice.type === prismicT__namespace.CustomTypeModelSliceType.Slice) {
609
- const labelsCount = faker.datatype.number({ min: 0, max: 3 });
610
- labels[choiceId] = Array(labelsCount).fill(void 0).map(() => ({
611
- name: changeCase__namespace.capitalCase(faker.company.bsNoun()),
612
- display: faker.datatype.boolean() ? prismicT__namespace.CustomTypeModelSliceDisplay.Grid : prismicT__namespace.CustomTypeModelSliceDisplay.List
613
- }));
660
+ labels[choiceId] = [];
614
661
  }
615
662
  }
616
663
  return {
@@ -618,102 +665,87 @@ const sliceZone$1 = (config = {}) => {
618
665
  fieldset: "Slice zone",
619
666
  config: {
620
667
  labels,
621
- choices
668
+ choices: config.choices || {}
622
669
  }
623
670
  };
624
671
  };
625
672
 
626
- const customType$1 = (config = {}) => {
627
- var _a;
673
+ const timestamp$1 = (config = {}) => {
628
674
  const faker = createFaker(config.seed);
629
- const tabsCount = (_a = config.tabsCount) != null ? _a : faker.datatype.number({ min: 1, max: 3 });
630
- const json = {};
631
- for (let i = 0; i < tabsCount; i++) {
632
- const tabName = changeCase__namespace.capitalCase(faker.lorem.word());
633
- const tabFields = buildMockGroupFieldMap({
634
- seed: config.seed,
635
- configs: config.configs
636
- });
637
- if (i === 0 && config.withUID) {
638
- const fieldId = generateFieldId({ seed: config.seed });
639
- tabFields[fieldId] = uid$1();
640
- }
641
- if (config.withSliceZones) {
642
- const sliceZoneId = generateFieldId({ seed: config.seed });
643
- tabFields[sliceZoneId] = sliceZone$1({
644
- withSharedSlices: config.withSharedSlices
645
- });
646
- }
647
- json[tabName] = tabFields;
648
- }
649
- const id = generateCustomTypeId({ seed: config.seed });
650
675
  return {
651
- id,
652
- label: changeCase__namespace.capitalCase(id),
653
- status: faker.datatype.boolean(),
654
- repeatable: faker.datatype.boolean(),
655
- json
676
+ type: prismicT__namespace.CustomTypeModelFieldType.Timestamp,
677
+ config: {
678
+ label: changeCase__namespace.capitalCase(faker.word()),
679
+ placeholder: changeCase__namespace.sentenceCase(faker.words(3))
680
+ }
656
681
  };
657
682
  };
658
683
 
659
- const group$1 = (config = {}) => {
684
+ const title$1 = (config = {}) => {
660
685
  const faker = createFaker(config.seed);
661
- const fields = buildMockGroupFieldMap({
662
- seed: config.seed,
663
- configs: config.configs
664
- });
686
+ const single = faker.randomElements([
687
+ "heading1",
688
+ "heading2",
689
+ "heading3",
690
+ "heading4",
691
+ "heading5",
692
+ "heading6"
693
+ ]).join(",");
665
694
  return {
666
- type: prismicT__namespace.CustomTypeModelFieldType.Group,
695
+ type: prismicT__namespace.CustomTypeModelFieldType.StructuredText,
667
696
  config: {
668
- label: changeCase__namespace.capitalCase(faker.company.bsNoun()),
669
- fields
697
+ label: changeCase__namespace.capitalCase(faker.word()),
698
+ placeholder: changeCase__namespace.sentenceCase(faker.words(3)),
699
+ single,
700
+ allowTargetBlank: faker.boolean() || void 0
670
701
  }
671
702
  };
672
703
  };
673
704
 
674
- const sharedSliceVariation$1 = (config = {}) => {
675
- var _a, _b, _c, _d, _e, _f;
705
+ const uid$1 = (config = {}) => {
676
706
  const faker = createFaker(config.seed);
677
- const name = changeCase__namespace.capitalCase(faker.company.bsNoun());
678
707
  return {
679
- id: changeCase__namespace.snakeCase(name),
680
- name,
681
- description: faker.lorem.sentence(),
682
- docURL: faker.internet.url(),
683
- version: faker.git.shortSha(),
684
- primary: buildMockGroupFieldMap({
685
- seed: (_b = (_a = config.primaryFieldConfig) == null ? void 0 : _a.seed) != null ? _b : config.seed,
686
- configs: (_c = config.primaryFieldConfig) == null ? void 0 : _c.configs
687
- }),
688
- items: buildMockGroupFieldMap({
689
- seed: (_e = (_d = config.itemsFieldConfig) == null ? void 0 : _d.seed) != null ? _e : config.seed,
690
- configs: (_f = config.itemsFieldConfig) == null ? void 0 : _f.configs
691
- })
708
+ type: prismicT__namespace.CustomTypeModelFieldType.UID,
709
+ config: {
710
+ label: changeCase__namespace.capitalCase(faker.word()),
711
+ placeholder: changeCase__namespace.sentenceCase(faker.words(3))
712
+ }
692
713
  };
693
714
  };
694
715
 
695
- const sharedSlice$1 = (config = {}) => {
696
- var _a;
716
+ const generateFieldId = (config) => {
697
717
  const faker = createFaker(config.seed);
698
- const name = changeCase__namespace.capitalCase(faker.company.bsNoun());
699
- let variations = [];
700
- if ("variations" in config) {
701
- variations = config.variations || [];
702
- } else {
703
- const variationsCount = (_a = config.variationsCount) != null ? _a : faker.datatype.number({ min: 1, max: 3 });
704
- variations = Array(variationsCount).fill(void 0).map(() => sharedSliceVariation$1({
705
- seed: config.seed,
706
- itemsFieldConfig: config.itemsFieldConfig,
707
- primaryFieldConfig: config.primaryFieldConfig
708
- }));
718
+ return changeCase__namespace.snakeCase(faker.words(faker.range(1, 3)));
719
+ };
720
+
721
+ const mockModelFns = {
722
+ boolean,
723
+ color: color$1,
724
+ contentRelationship: contentRelationship$1,
725
+ date: date$1,
726
+ embed: embed$2,
727
+ geoPoint: geoPoint$1,
728
+ image: image$2,
729
+ integrationFields: integrationFields$1,
730
+ keyText: keyText$1,
731
+ link: link$1,
732
+ linkToMedia: linkToMedia$1,
733
+ number: number$1,
734
+ richText: richText$1,
735
+ select: select$1,
736
+ timestamp: timestamp$1,
737
+ title: title$1
738
+ };
739
+ const buildMockGroupFieldMap = (config = {}) => {
740
+ const faker = createFaker(config.seed);
741
+ const fields = {};
742
+ const fieldTypes = faker.randomElements(Object.keys(mockModelFns));
743
+ for (const fieldType of fieldTypes) {
744
+ const fieldId = generateFieldId({ seed: config.seed });
745
+ const mockModelFn = mockModelFns[fieldType];
746
+ fields[fieldId] = mockModelFn({ seed: config.seed });
709
747
  }
710
- return {
711
- type: prismicT__namespace.CustomTypeModelSliceType.SharedSlice,
712
- id: changeCase__namespace.snakeCase(name),
713
- name,
714
- description: faker.lorem.sentence(),
715
- variations
716
- };
748
+ return fields;
717
749
  };
718
750
 
719
751
  const index$2 = /*#__PURE__*/Object.freeze({
@@ -741,14 +773,29 @@ const index$2 = /*#__PURE__*/Object.freeze({
741
773
  sliceZone: sliceZone$1,
742
774
  timestamp: timestamp$1,
743
775
  title: title$1,
744
- uid: uid$1
776
+ uid: uid$1,
777
+ buildMockGroupFieldMap: buildMockGroupFieldMap
745
778
  });
746
779
 
747
780
  const timestamp = (config = {}) => {
748
781
  const faker = createFaker(config.seed);
749
- const after = config.after || faker.date.past(20, new Date("2021-03-07")).toISOString().split("T")[0];
750
- const before = config.before || faker.date.future(20, new Date("2021-03-07")).toISOString().split("T")[0];
751
- return faker.date.between(after, before).toISOString();
782
+ if (config.state === "empty") {
783
+ return null;
784
+ } else {
785
+ let date;
786
+ const after = config.after ? new Date(config.after.toISOString().split("T")[0]) : void 0;
787
+ const before = config.before ? new Date(config.before.toISOString().split("T")[0]) : void 0;
788
+ if (after && before) {
789
+ date = faker.dateBetween(after, before);
790
+ } else if (after) {
791
+ date = faker.dateAfter(after);
792
+ } else if (before) {
793
+ date = faker.dateBefore(before);
794
+ } else {
795
+ date = faker.date();
796
+ }
797
+ return date.toISOString();
798
+ }
752
799
  };
753
800
 
754
801
  const buildAlternativeLanguage = (config) => {
@@ -779,11 +826,11 @@ const customType = (config = {}) => {
779
826
  }));
780
827
  return {
781
828
  type: model.id,
782
- id: faker.git.shortSha(),
783
- uid: hasUID ? changeCase__namespace.snakeCase(faker.lorem.words(2)) : null,
784
- url: withURL ? faker.internet.url() : null,
785
- href: faker.internet.url(),
786
- lang: faker.lorem.word(),
829
+ id: faker.hash(7),
830
+ uid: hasUID ? changeCase__namespace.snakeCase(faker.words(faker.range(1, 3))) : null,
831
+ url: withURL ? faker.url() : null,
832
+ href: faker.url(),
833
+ lang: faker.word(),
787
834
  tags: generateTags({ seed: config.seed }),
788
835
  slugs: [],
789
836
  linked_documents: [],
@@ -800,7 +847,7 @@ const customType = (config = {}) => {
800
847
 
801
848
  const color = (config = {}) => {
802
849
  const faker = createFaker(config.seed);
803
- return faker.internet.color().toUpperCase();
850
+ return config.state === "empty" ? null : faker.hexColor().toUpperCase();
804
851
  };
805
852
 
806
853
  const buildContentRelationshipField = (config) => {
@@ -817,11 +864,18 @@ const buildContentRelationshipField = (config) => {
817
864
  };
818
865
  };
819
866
 
867
+ const generateCustomTypeId = (config) => {
868
+ const faker = createFaker(config.seed);
869
+ return changeCase__namespace.snakeCase(faker.words(faker.range(1, 3)));
870
+ };
871
+
820
872
  const contentRelationship = (config = {}) => {
821
- var _a;
822
873
  const faker = createFaker(config.seed);
823
- const isFilled = (_a = config.isFilled) != null ? _a : true;
824
- if (isFilled) {
874
+ if (config.state === "empty") {
875
+ return {
876
+ link_type: prismicT__namespace.LinkType.Document
877
+ };
878
+ } else {
825
879
  const model = config.model || contentRelationship$1({ seed: config.seed });
826
880
  const linkableDocuments = config.linkableDocuments ? config.linkableDocuments.filter((document2) => {
827
881
  let shouldKeep = true;
@@ -835,177 +889,186 @@ const contentRelationship = (config = {}) => {
835
889
  }) : [
836
890
  {
837
891
  ...customType({ seed: config.seed }),
838
- type: model.config.customtypes ? faker.random.arrayElement(model.config.customtypes) : generateCustomTypeId({ seed: config.seed }),
839
- tags: model.config.tags ? faker.random.arrayElements(model.config.tags) : generateTags({ seed: config.seed })
892
+ type: model.config.customtypes ? faker.randomElement(model.config.customtypes) : generateCustomTypeId({ seed: config.seed }),
893
+ tags: model.config.tags ? faker.randomElements(model.config.tags) : generateTags({ seed: config.seed })
840
894
  }
841
895
  ];
842
- const document = faker.random.arrayElement(linkableDocuments);
896
+ const document = faker.randomElement(linkableDocuments);
843
897
  if (!document) {
844
898
  throw new Error("A linkable document could not be found.");
845
899
  }
846
- return buildContentRelationshipField({ document });
847
- } else {
848
- return {
849
- link_type: prismicT__namespace.LinkType.Document
850
- };
900
+ return buildContentRelationshipField({
901
+ document
902
+ });
851
903
  }
852
904
  };
853
905
 
854
906
  const date = (config = {}) => {
855
- return timestamp({
907
+ return config.state === "empty" ? null : timestamp({
856
908
  seed: config.seed,
857
909
  after: config.after,
858
- before: config.before
910
+ before: config.before,
911
+ state: "filled"
859
912
  }).split("T")[0];
860
913
  };
861
914
 
862
915
  const buildEmbedField = (config) => {
916
+ var _a;
863
917
  const faker = createFaker(config.seed);
864
918
  return {
865
- type: faker.datatype.boolean() ? prismicT__namespace.EmbedType.Link : prismicT__namespace.EmbedType.Rich,
866
- url: config.embedData.url,
867
- html: config.embedData.html,
868
- title: changeCase__namespace.capitalCase(faker.lorem.words(3)),
869
- version: faker.datatype.number({ min: 1, max: 3, precision: 10 }).toString(),
870
- cache_age: faker.datatype.number(),
871
- embed_url: config.embedData.embed_url,
872
- author_url: faker.internet.url(),
873
- author_name: faker.company.companyName(),
874
- provider_name: faker.company.companyName(),
875
- thumbnail_width: config.embedData.thumbnail_width,
876
- thumbnail_height: config.embedData.thumbnail_height,
877
- thumbnail_url: config.embedData.thumbnail_url,
878
- width: faker.datatype.number({ min: 200, max: 500 }),
879
- height: faker.datatype.number({ min: 200, max: 500 })
919
+ embed_url: (_a = config.url) != null ? _a : faker.url(),
920
+ html: `<div>embed html</div>`,
921
+ ...config.data
880
922
  };
881
923
  };
882
924
 
883
925
  const dataSet$1 = [
884
926
  {
885
- url: "https://www.youtube.com/watch?v=fiOwHYFkUz0",
927
+ version: "1.0",
928
+ type: "video",
886
929
  embed_url: "https://www.youtube.com/embed/fiOwHYFkUz0",
887
930
  thumbnail_url: "https://i.ytimg.com/vi/fiOwHYFkUz0/hqdefault.jpg",
888
931
  thumbnail_height: 360,
889
932
  thumbnail_width: 480,
890
- html: '<iframe width="200" height="113" src="https://www.youtube.com/embed/fiOwHYFkUz0?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
933
+ html: '<iframe width="200" height="113" src="https://www.youtube.com/embed/fiOwHYFkUz0?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>',
934
+ width: 200,
935
+ height: 113
891
936
  },
892
937
  {
893
- url: "https://www.youtube.com/watch?v=c-ATzcy6VkI",
938
+ version: "1.0",
939
+ type: "video",
894
940
  embed_url: "https://www.youtube.com/embed/c-ATzcy6VkI",
895
941
  thumbnail_url: "https://i.ytimg.com/vi/c-ATzcy6VkI/hqdefault.jpg",
896
942
  thumbnail_height: 360,
897
943
  thumbnail_width: 480,
898
- html: '<iframe width="200" height="113" src="https://www.youtube.com/embed/c-ATzcy6VkI?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
944
+ html: '<iframe width="200" height="113" src="https://www.youtube.com/embed/c-ATzcy6VkI?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>',
945
+ width: 200,
946
+ height: 113
899
947
  },
900
948
  {
901
- url: "https://www.youtube.com/watch?v=iewZXv94XGY",
949
+ version: "1.0",
950
+ type: "video",
902
951
  embed_url: "https://www.youtube.com/watch?v=fiOwHYFkUz0",
903
952
  thumbnail_url: "https://i.ytimg.com/vi/iewZXv94XGY/hqdefault.jpg",
904
953
  thumbnail_height: 360,
905
954
  thumbnail_width: 480,
906
- html: '<iframe width="200" height="113" src="https://www.youtube.com/embed/iewZXv94XGY?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
955
+ html: '<iframe width="200" height="113" src="https://www.youtube.com/embed/iewZXv94XGY?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>',
956
+ width: 200,
957
+ height: 113
907
958
  },
908
959
  {
909
- url: "https://twitter.com/prismicio/status/1356293316158095361",
910
- embed_url: "https://www.youtube.com/watch?v=iewZXv94XGY",
960
+ version: "1.0",
961
+ type: "rich",
962
+ embed_url: "https://twitter.com/prismicio/status/1356293316158095361",
911
963
  thumbnail_url: null,
912
964
  thumbnail_height: null,
913
965
  thumbnail_width: null,
914
- html: '<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Gatsby is a popular choice for Prismic users and we work hard on delivering a CMS that plays to its strengths.<br><br>But, what makes <a href="https://twitter.com/GatsbyJS?ref_src=twsrc%5Etfw">@GatsbyJS</a> so popular?<br><br>Here are some of <a href="https://twitter.com/mxstbr?ref_src=twsrc%5Etfw">@mxstbr</a>&#39;s thoughts on Gatsby&#39;s success and how they&#39;re improving developer experience.<a href="https://t.co/ZjCPvsWWUD">https://t.co/ZjCPvsWWUD</a> <a href="https://t.co/EQqzJpeNKl">pic.twitter.com/EQqzJpeNKl</a></p>&mdash; Prismic (@prismicio) <a href="https://twitter.com/prismicio/status/1356293316158095361?ref_src=twsrc%5Etfw">February 1, 2021</a></blockquote>\n<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>\n'
966
+ html: '<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Gatsby is a popular choice for Prismic users and we work hard on delivering a CMS that plays to its strengths.<br><br>But, what makes <a href="https://twitter.com/GatsbyJS?ref_src=twsrc%5Etfw">@GatsbyJS</a> so popular?<br><br>Here are some of <a href="https://twitter.com/mxstbr?ref_src=twsrc%5Etfw">@mxstbr</a>&#39;s thoughts on Gatsby&#39;s success and how they&#39;re improving developer experience.<a href="https://t.co/ZjCPvsWWUD">https://t.co/ZjCPvsWWUD</a> <a href="https://t.co/EQqzJpeNKl">pic.twitter.com/EQqzJpeNKl</a></p>&mdash; Prismic (@prismicio) <a href="https://twitter.com/prismicio/status/1356293316158095361?ref_src=twsrc%5Etfw">February 1, 2021</a></blockquote>\n<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>\n',
967
+ width: 200,
968
+ height: 113
915
969
  },
916
970
  {
917
- url: "https://twitter.com/timbenniks/status/1304146886832594944",
971
+ type: "rich",
972
+ version: "1.0",
973
+ embed_url: "https://twitter.com/timbenniks/status/1304146886832594944",
918
974
  thumbnail_url: null,
919
975
  thumbnail_width: null,
920
976
  thumbnail_height: null,
921
- embed_url: "https://twitter.com/timbenniks/status/1304146886832594944",
922
- html: '<blockquote class="twitter-tweet"><p lang="en" dir="ltr">I\u2019ve been diving deep on <a href="https://twitter.com/prismicio?ref_src=twsrc%5Etfw">@prismicio</a> <a href="https://twitter.com/hashtag/slicemachine?src=hash&amp;ref_src=twsrc%5Etfw">#slicemachine</a> today. I made all my own components and I used custom slices. It works like a charm with <a href="https://twitter.com/nuxt_js?ref_src=twsrc%5Etfw">@nuxt_js</a>. Also: I\u2019m coding with this view. <a href="https://t.co/F0I8X9gz39">pic.twitter.com/F0I8X9gz39</a></p>&mdash; Tim Benniks (@timbenniks) <a href="https://twitter.com/timbenniks/status/1304146886832594944?ref_src=twsrc%5Etfw">September 10, 2020</a></blockquote>\n<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>\n'
977
+ html: '<blockquote class="twitter-tweet"><p lang="en" dir="ltr">I\u2019ve been diving deep on <a href="https://twitter.com/prismicio?ref_src=twsrc%5Etfw">@prismicio</a> <a href="https://twitter.com/hashtag/slicemachine?src=hash&amp;ref_src=twsrc%5Etfw">#slicemachine</a> today. I made all my own components and I used custom slices. It works like a charm with <a href="https://twitter.com/nuxt_js?ref_src=twsrc%5Etfw">@nuxt_js</a>. Also: I\u2019m coding with this view. <a href="https://t.co/F0I8X9gz39">pic.twitter.com/F0I8X9gz39</a></p>&mdash; Tim Benniks (@timbenniks) <a href="https://twitter.com/timbenniks/status/1304146886832594944?ref_src=twsrc%5Etfw">September 10, 2020</a></blockquote>\n<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>\n',
978
+ width: 200,
979
+ height: 113
923
980
  },
924
981
  {
925
- url: "https://twitter.com/prismicio/status/1354112310252630016",
982
+ version: "1.0",
983
+ type: "rich",
984
+ embed_url: "https://twitter.com/prismicio/status/1354112310252630016",
926
985
  thumbnail_url: null,
927
986
  thumbnail_width: null,
928
987
  thumbnail_height: null,
929
- embed_url: "https://twitter.com/prismicio/status/1354112310252630016",
930
- html: '<blockquote class="twitter-tweet"><p lang="en" dir="ltr">We&#39;re launching a new <a href="https://twitter.com/hashtag/SliceContest?src=hash&amp;ref_src=twsrc%5Etfw">#SliceContest</a> tomorrow along with Slice Machine upgrades.<br><br>Want to know more? Join us at tomorrow&#39;s Product Meet-up\u{1F447}<a href="https://t.co/prYSypiAvB">https://t.co/prYSypiAvB</a><br><br>We can&#39;t tell you any further details for now, but here&#39;s a sneak peek at the prizes\u{1F440} <a href="https://t.co/fV1eoGlEBh">pic.twitter.com/fV1eoGlEBh</a></p>&mdash; Prismic (@prismicio) <a href="https://twitter.com/prismicio/status/1354112310252630016?ref_src=twsrc%5Etfw">January 26, 2021</a></blockquote>\n<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>\n'
988
+ html: '<blockquote class="twitter-tweet"><p lang="en" dir="ltr">We&#39;re launching a new <a href="https://twitter.com/hashtag/SliceContest?src=hash&amp;ref_src=twsrc%5Etfw">#SliceContest</a> tomorrow along with Slice Machine upgrades.<br><br>Want to know more? Join us at tomorrow&#39;s Product Meet-up\u{1F447}<a href="https://t.co/prYSypiAvB">https://t.co/prYSypiAvB</a><br><br>We can&#39;t tell you any further details for now, but here&#39;s a sneak peek at the prizes\u{1F440} <a href="https://t.co/fV1eoGlEBh">pic.twitter.com/fV1eoGlEBh</a></p>&mdash; Prismic (@prismicio) <a href="https://twitter.com/prismicio/status/1354112310252630016?ref_src=twsrc%5Etfw">January 26, 2021</a></blockquote>\n<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>\n',
989
+ width: 200,
990
+ height: 113
931
991
  },
932
992
  {
933
- url: "https://twitter.com/prismicio/status/1354835716430319617",
993
+ version: "1.0",
994
+ type: "rich",
995
+ embed_url: "https://twitter.com/prismicio/status/1354835716430319617",
934
996
  thumbnail_url: null,
935
997
  thumbnail_width: null,
936
998
  thumbnail_height: null,
937
- embed_url: "https://twitter.com/prismicio/status/1354835716430319617",
938
- html: '<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Does anyone want to create a wildly popular website for discussing &#39;Wall Street Bets&#39; using Prismic?<br><br>It may or may not have to look a lot like <a href="https://twitter.com/hashtag/reddit?src=hash&amp;ref_src=twsrc%5Etfw">#reddit</a> and we won&#39;t make it private.<br><br>Just asking for some friends...</p>&mdash; Prismic (@prismicio) <a href="https://twitter.com/prismicio/status/1354835716430319617?ref_src=twsrc%5Etfw">January 28, 2021</a></blockquote>\n<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>\n'
999
+ html: '<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Does anyone want to create a wildly popular website for discussing &#39;Wall Street Bets&#39; using Prismic?<br><br>It may or may not have to look a lot like <a href="https://twitter.com/hashtag/reddit?src=hash&amp;ref_src=twsrc%5Etfw">#reddit</a> and we won&#39;t make it private.<br><br>Just asking for some friends...</p>&mdash; Prismic (@prismicio) <a href="https://twitter.com/prismicio/status/1354835716430319617?ref_src=twsrc%5Etfw">January 28, 2021</a></blockquote>\n<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>\n',
1000
+ width: 200,
1001
+ height: 113
939
1002
  }
940
1003
  ];
941
1004
  const getMockEmbedData = (config) => {
942
1005
  const faker = createFaker(config.seed);
943
- return faker.random.arrayElement(dataSet$1);
1006
+ return faker.randomElement(dataSet$1);
944
1007
  };
945
1008
 
946
1009
  const embed$1 = (config = {}) => {
947
- const embedData = getMockEmbedData({ seed: config.seed });
948
- return buildEmbedField({ seed: config.seed, embedData });
1010
+ var _a, _b, _c;
1011
+ const data = (_a = config.data) != null ? _a : getMockEmbedData({ seed: config.seed });
1012
+ return config.state === "empty" ? {} : buildEmbedField({
1013
+ seed: config.seed,
1014
+ url: (_b = config.url) != null ? _b : "embed_url" in data ? data.embed_url : void 0,
1015
+ html: (_c = config.html) != null ? _c : "html" in data ? data.html : void 0,
1016
+ data
1017
+ });
949
1018
  };
950
1019
 
951
1020
  const geoPoint = (config = {}) => {
952
1021
  const faker = createFaker(config.seed);
953
- const coordinates = faker.address.nearbyGPSCoordinate();
954
- return {
955
- longitude: Number.parseFloat(coordinates[0]),
956
- latitude: Number.parseFloat(coordinates[1])
1022
+ return config.state === "empty" ? {} : {
1023
+ longitude: faker.rangeFloat(-180, 180),
1024
+ latitude: faker.rangeFloat(-90, 90)
957
1025
  };
958
1026
  };
959
1027
 
960
- const patterns$9 = {
961
- short: {
962
- minItems: 1,
963
- maxItems: 3
964
- },
965
- medium: {
966
- minItems: 3,
967
- maxItems: 6
968
- },
969
- long: {
970
- minItems: 6,
971
- maxItems: 12
972
- }
973
- };
974
1028
  const group = (config = {}) => {
975
- const faker = createFaker(config.seed);
976
- const model = config.model || group$1({ seed: config.seed });
977
- const patternKey = config.pattern || faker.random.arrayElement(Object.keys(patterns$9));
978
- const pattern = patterns$9[patternKey];
979
- const itemsCount = faker.datatype.number({
980
- min: pattern.minItems,
981
- max: pattern.maxItems
982
- });
983
- return Array(itemsCount).fill(void 0).map(() => {
984
- return valueForModelMap({
985
- seed: config.seed,
986
- map: model.config.fields,
987
- configs: config.configs
1029
+ var _a;
1030
+ if (config.state === "empty") {
1031
+ return [];
1032
+ } else {
1033
+ const faker = createFaker(config.seed);
1034
+ const model = config.model || group$1({ seed: config.seed });
1035
+ const itemsCount = (_a = config.itemsCount) != null ? _a : faker.range(1, 6);
1036
+ return Array(itemsCount).fill(void 0).map(() => {
1037
+ return valueForModelMap({
1038
+ seed: config.seed,
1039
+ map: model.config.fields,
1040
+ configs: config.configs
1041
+ });
988
1042
  });
989
- });
1043
+ }
990
1044
  };
991
1045
 
992
- const buildImageField = (config) => {
1046
+ const buildImageFieldImage = (config) => {
993
1047
  var _a, _b, _c, _d;
994
- const faker = createFaker(config.seed);
995
- const url = new URL(config.imageData.url);
996
- const dimensions = {
997
- width: (_b = (_a = config.constraint) == null ? void 0 : _a.width) != null ? _b : config.imageData.width,
998
- height: (_d = (_c = config.constraint) == null ? void 0 : _c.height) != null ? _d : config.imageData.height
999
- };
1000
- url.searchParams.set("w", dimensions.width.toString());
1001
- url.searchParams.set("h", dimensions.height.toString());
1002
- url.searchParams.set("fit", "crop");
1003
- return {
1004
- url: url.toString(),
1005
- dimensions,
1006
- alt: faker.lorem.sentence(),
1007
- copyright: faker.lorem.sentence()
1008
- };
1048
+ if (config.state === "empty") {
1049
+ return {
1050
+ url: null,
1051
+ dimensions: null,
1052
+ alt: null,
1053
+ copyright: null
1054
+ };
1055
+ } else {
1056
+ const faker = createFaker(config.seed);
1057
+ const url = new URL(config.imageData.url);
1058
+ const dimensions = {
1059
+ width: (_b = (_a = config.constraint) == null ? void 0 : _a.width) != null ? _b : config.imageData.width,
1060
+ height: (_d = (_c = config.constraint) == null ? void 0 : _c.height) != null ? _d : config.imageData.height
1061
+ };
1062
+ url.searchParams.set("w", dimensions.width.toString());
1063
+ url.searchParams.set("h", dimensions.height.toString());
1064
+ url.searchParams.set("fit", "crop");
1065
+ return {
1066
+ url: url.toString(),
1067
+ dimensions,
1068
+ alt: changeCase__namespace.sentenceCase(faker.words(faker.range(5, 15))),
1069
+ copyright: changeCase__namespace.sentenceCase(faker.words(faker.range(5, 15)))
1070
+ };
1071
+ }
1009
1072
  };
1010
1073
 
1011
1074
  const dataSet = [
@@ -1092,25 +1155,27 @@ const dataSet = [
1092
1155
  ];
1093
1156
  const getMockImageData = (config) => {
1094
1157
  const faker = createFaker(config.seed);
1095
- return faker.random.arrayElement(dataSet);
1158
+ return faker.randomElement(dataSet);
1096
1159
  };
1097
1160
 
1098
1161
  const image$1 = (config = {}) => {
1099
1162
  const model = config.model || image$2({ seed: config.seed });
1100
1163
  const imageData = getMockImageData({ seed: config.seed });
1101
- const value = buildImageField({
1164
+ const value = buildImageFieldImage({
1102
1165
  seed: config.seed,
1103
1166
  imageData,
1104
- constraint: model.config.constraint
1167
+ constraint: model.config.constraint,
1168
+ state: config.state
1105
1169
  });
1106
1170
  for (const thumbnail of model.config.thumbnails) {
1107
- value[thumbnail.name] = buildImageField({
1171
+ value[thumbnail.name] = buildImageFieldImage({
1108
1172
  seed: config.seed,
1109
1173
  imageData,
1110
1174
  constraint: {
1111
1175
  width: thumbnail.width,
1112
1176
  height: thumbnail.height
1113
- }
1177
+ },
1178
+ state: config.state
1114
1179
  });
1115
1180
  }
1116
1181
  return value;
@@ -1119,87 +1184,86 @@ const image$1 = (config = {}) => {
1119
1184
  const integrationFields = (config = {}) => {
1120
1185
  const faker = createFaker(config.seed);
1121
1186
  const imageData = getMockImageData({ seed: config.seed });
1122
- return {
1123
- id: faker.git.shortSha(),
1124
- title: changeCase__namespace.capitalCase(faker.lorem.words(3)),
1125
- description: faker.lorem.sentence(),
1187
+ return config.state === "empty" ? null : {
1188
+ id: faker.hash(7),
1189
+ title: changeCase__namespace.capitalCase(faker.words(faker.range(1, 3))),
1190
+ description: changeCase__namespace.sentenceCase(faker.words(faker.range(5, 10))),
1126
1191
  image_url: imageData.url,
1127
- last_update: faker.date.past(20, new Date("2021-03-07")).getTime(),
1192
+ last_update: faker.date().getTime(),
1128
1193
  blob: config.data
1129
1194
  };
1130
1195
  };
1131
1196
 
1132
1197
  const keyText = (config = {}) => {
1133
1198
  const faker = createFaker(config.seed);
1134
- return changeCase__namespace.sentenceCase(faker.lorem.words(3));
1199
+ return config.state === "empty" ? null : changeCase__namespace.sentenceCase(faker.words(3));
1135
1200
  };
1136
1201
 
1137
1202
  const linkToMedia = (config = {}) => {
1138
- var _a;
1139
1203
  const faker = createFaker(config.seed);
1140
- const isFilled = (_a = config.isFilled) != null ? _a : true;
1141
- if (isFilled) {
1204
+ if (config.state === "empty") {
1142
1205
  return {
1143
- link_type: prismicT__namespace.LinkType.Media,
1144
- name: faker.system.commonFileName(),
1145
- kind: faker.system.commonFileType(),
1146
- url: faker.internet.url(),
1147
- size: faker.datatype.number().toString(),
1148
- height: faker.datatype.number().toString(),
1149
- width: faker.datatype.number().toString()
1206
+ link_type: prismicT__namespace.LinkType.Media
1150
1207
  };
1151
1208
  } else {
1152
1209
  return {
1153
- link_type: prismicT__namespace.LinkType.Media
1210
+ link_type: prismicT__namespace.LinkType.Media,
1211
+ name: `${changeCase__namespace.snakeCase(faker.words(faker.range(1, 2)))}.example`,
1212
+ kind: changeCase__namespace.snakeCase(faker.word()),
1213
+ url: faker.url(),
1214
+ size: faker.range(500, 3e3).toString(),
1215
+ height: faker.range(500, 3e3).toString(),
1216
+ width: faker.range(500, 3e3).toString()
1154
1217
  };
1155
1218
  }
1156
1219
  };
1157
1220
 
1158
1221
  const link = (config = {}) => {
1159
- var _a, _b;
1222
+ var _a;
1160
1223
  const faker = createFaker(config.seed);
1161
- const isFilled = (_a = config.isFilled) != null ? _a : true;
1162
- const type = config.type || faker.random.arrayElement([
1224
+ const type = config.type || faker.randomElement([
1163
1225
  prismicT__namespace.LinkType.Web,
1164
1226
  prismicT__namespace.LinkType.Document,
1165
1227
  prismicT__namespace.LinkType.Media
1166
1228
  ]);
1167
- if (isFilled) {
1229
+ if (config.state === "empty") {
1230
+ return {
1231
+ link_type: type
1232
+ };
1233
+ } else {
1168
1234
  switch (type) {
1169
1235
  case prismicT__namespace.LinkType.Document: {
1170
1236
  return contentRelationship({
1171
1237
  seed: config.seed,
1172
- isFilled,
1238
+ state: config.state,
1173
1239
  linkableDocuments: config.linkableDocuments
1174
1240
  });
1175
1241
  }
1176
1242
  case prismicT__namespace.LinkType.Media: {
1177
1243
  return linkToMedia({
1178
1244
  seed: config.seed,
1179
- isFilled
1245
+ state: config.state
1180
1246
  });
1181
1247
  }
1182
- case prismicT__namespace.LinkType.Web: {
1248
+ case prismicT__namespace.LinkType.Web:
1249
+ default: {
1183
1250
  const model = config.model || link$1({ seed: config.seed });
1184
1251
  return {
1185
1252
  link_type: prismicT__namespace.LinkType.Web,
1186
- url: faker.internet.url(),
1187
- target: ((_b = config.withTargetBlank) != null ? _b : model.config.allowTargetBlank && faker.datatype.boolean()) ? "_blank" : void 0
1253
+ url: faker.url(),
1254
+ target: ((_a = config.withTargetBlank) != null ? _a : model.config.allowTargetBlank && faker.boolean()) ? "_blank" : void 0
1188
1255
  };
1189
1256
  }
1190
1257
  }
1191
1258
  }
1192
- return {
1193
- link_type: type
1194
- };
1195
1259
  };
1196
1260
 
1197
1261
  const number = (config = {}) => {
1198
1262
  const faker = createFaker(config.seed);
1199
- return faker.datatype.number();
1263
+ return config.state === "empty" ? null : faker.range(1, 100);
1200
1264
  };
1201
1265
 
1202
- const patterns$8 = {
1266
+ const patterns$5 = {
1203
1267
  short: {
1204
1268
  minWords: 1,
1205
1269
  maxWords: 3
@@ -1224,16 +1288,13 @@ const heading = (config = {}) => {
1224
1288
  prismicT__namespace.RichTextNodeType.heading5,
1225
1289
  prismicT__namespace.RichTextNodeType.heading6
1226
1290
  ].includes(type2));
1227
- const type = faker.random.arrayElement(types);
1291
+ const type = faker.randomElement(types);
1228
1292
  if (type) {
1229
- const patternKey = config.pattern || faker.random.arrayElement(Object.keys(patterns$8));
1230
- const pattern = patterns$8[patternKey];
1293
+ const patternKey = config.pattern || faker.randomElement(Object.keys(patterns$5));
1294
+ const pattern = patterns$5[patternKey];
1231
1295
  return {
1232
1296
  type,
1233
- text: changeCase__namespace.capitalCase(faker.lorem.words(faker.datatype.number({
1234
- min: pattern.minWords,
1235
- max: pattern.maxWords
1236
- }))),
1297
+ text: changeCase__namespace.capitalCase(faker.words(faker.range(pattern.minWords, pattern.maxWords))),
1237
1298
  spans: []
1238
1299
  };
1239
1300
  } else {
@@ -1241,7 +1302,7 @@ const heading = (config = {}) => {
1241
1302
  }
1242
1303
  };
1243
1304
 
1244
- const patterns$7 = {
1305
+ const patterns$4 = {
1245
1306
  short: {
1246
1307
  sentenceCount: 2
1247
1308
  },
@@ -1254,16 +1315,17 @@ const patterns$7 = {
1254
1315
  };
1255
1316
  const paragraph = (config = {}) => {
1256
1317
  const faker = createFaker(config.seed);
1257
- const patternKey = config.pattern || faker.random.arrayElement(Object.keys(patterns$7));
1258
- const pattern = patterns$7[patternKey];
1318
+ const patternKey = config.pattern || faker.randomElement(Object.keys(patterns$4));
1319
+ const pattern = patterns$4[patternKey];
1320
+ const text = Array.from({ length: pattern.sentenceCount }, () => changeCase__namespace.sentenceCase(faker.words(faker.range(5, 15))) + ".").join(" ");
1259
1321
  return {
1260
1322
  type: prismicT__namespace.RichTextNodeType.paragraph,
1261
- text: faker.lorem.paragraph(pattern.sentenceCount),
1323
+ text,
1262
1324
  spans: []
1263
1325
  };
1264
1326
  };
1265
1327
 
1266
- const patterns$6 = {
1328
+ const patterns$3 = {
1267
1329
  short: {
1268
1330
  sentenceCount: 2
1269
1331
  },
@@ -1276,16 +1338,17 @@ const patterns$6 = {
1276
1338
  };
1277
1339
  const preformatted = (config = {}) => {
1278
1340
  const faker = createFaker(config.seed);
1279
- const patternKey = config.pattern || faker.random.arrayElement(Object.keys(patterns$6));
1280
- const pattern = patterns$6[patternKey];
1341
+ const patternKey = config.pattern || faker.randomElement(Object.keys(patterns$3));
1342
+ const pattern = patterns$3[patternKey];
1343
+ const text = Array.from({ length: pattern.sentenceCount }, () => changeCase__namespace.sentenceCase(faker.words(faker.range(5, 15))) + ".").join(" ");
1281
1344
  return {
1282
1345
  type: prismicT__namespace.RichTextNodeType.preformatted,
1283
- text: faker.lorem.paragraph(pattern.sentenceCount),
1346
+ text,
1284
1347
  spans: []
1285
1348
  };
1286
1349
  };
1287
1350
 
1288
- const patterns$5 = {
1351
+ const patterns$2 = {
1289
1352
  short: {
1290
1353
  minItems: 1,
1291
1354
  maxItems: 3
@@ -1301,22 +1364,19 @@ const patterns$5 = {
1301
1364
  };
1302
1365
  const list = (config = {}) => {
1303
1366
  const faker = createFaker(config.seed);
1304
- const patternKey = config.pattern || faker.random.arrayElement(Object.keys(patterns$5));
1305
- const pattern = patterns$5[patternKey];
1306
- const itemsCount = faker.datatype.number({
1307
- min: pattern.minItems,
1308
- max: pattern.maxItems
1309
- });
1367
+ const patternKey = config.pattern || faker.randomElement(Object.keys(patterns$2));
1368
+ const pattern = patterns$2[patternKey];
1369
+ const itemsCount = faker.range(pattern.minItems, pattern.maxItems);
1310
1370
  return Array(itemsCount).fill(void 0).map(() => {
1311
1371
  return {
1312
1372
  type: prismicT__namespace.RichTextNodeType.listItem,
1313
- text: faker.lorem.sentence(),
1373
+ text: changeCase__namespace.sentenceCase(faker.words(faker.range(5, 15))),
1314
1374
  spans: []
1315
1375
  };
1316
1376
  });
1317
1377
  };
1318
1378
 
1319
- const patterns$4 = {
1379
+ const patterns$1 = {
1320
1380
  short: {
1321
1381
  minItems: 1,
1322
1382
  maxItems: 3
@@ -1332,16 +1392,13 @@ const patterns$4 = {
1332
1392
  };
1333
1393
  const oList = (config = {}) => {
1334
1394
  const faker = createFaker(config.seed);
1335
- const patternKey = config.pattern || faker.random.arrayElement(Object.keys(patterns$4));
1336
- const pattern = patterns$4[patternKey];
1337
- const itemsCount = faker.datatype.number({
1338
- min: pattern.minItems,
1339
- max: pattern.maxItems
1340
- });
1395
+ const patternKey = config.pattern || faker.randomElement(Object.keys(patterns$1));
1396
+ const pattern = patterns$1[patternKey];
1397
+ const itemsCount = faker.range(pattern.minItems, pattern.maxItems);
1341
1398
  return Array(itemsCount).fill(void 0).map(() => {
1342
1399
  return {
1343
1400
  type: prismicT__namespace.RichTextNodeType.oListItem,
1344
- text: faker.lorem.sentence(),
1401
+ text: changeCase__namespace.sentenceCase(faker.words(faker.range(5, 15))),
1345
1402
  spans: []
1346
1403
  };
1347
1404
  });
@@ -1349,7 +1406,11 @@ const oList = (config = {}) => {
1349
1406
 
1350
1407
  const image = (config = {}) => {
1351
1408
  const imageData = getMockImageData({ seed: config.seed });
1352
- const imageField = buildImageField({ seed: config.seed, imageData });
1409
+ const imageField = buildImageFieldImage({
1410
+ seed: config.seed,
1411
+ imageData,
1412
+ state: "filled"
1413
+ });
1353
1414
  return {
1354
1415
  type: prismicT__namespace.RichTextNodeType.image,
1355
1416
  alt: imageField.alt,
@@ -1360,15 +1421,15 @@ const image = (config = {}) => {
1360
1421
  };
1361
1422
 
1362
1423
  const embed = (config = {}) => {
1363
- const embedData = getMockEmbedData({ seed: config.seed });
1364
- const embedField = buildEmbedField({ seed: config.seed, embedData });
1424
+ const data = getMockEmbedData({ seed: config.seed });
1425
+ const embedField = buildEmbedField({ seed: config.seed, data });
1365
1426
  return {
1366
1427
  type: prismicT__namespace.RichTextNodeType.embed,
1367
1428
  oembed: embedField
1368
1429
  };
1369
1430
  };
1370
1431
 
1371
- const patterns$3 = {
1432
+ const patterns = {
1372
1433
  short: {
1373
1434
  blockCountMin: 1,
1374
1435
  blockCountMax: 2
@@ -1405,14 +1466,11 @@ const richText = (config = {}) => {
1405
1466
  const supportsMultipleBlocks = "multi" in model.config;
1406
1467
  const types = ("multi" in model.config ? model.config.multi : model.config.single).split(",").filter((type) => Object.keys(generators).includes(type));
1407
1468
  if (types.length > 0) {
1408
- const patternKey = config.pattern || faker.random.arrayElement(Object.keys(patterns$3));
1409
- const pattern = patterns$3[patternKey];
1410
- const blockCount = supportsMultipleBlocks ? faker.datatype.number({
1411
- min: pattern.blockCountMin,
1412
- max: pattern.blockCountMax
1413
- }) : 1;
1469
+ const patternKey = config.pattern || faker.randomElement(Object.keys(patterns));
1470
+ const pattern = patterns[patternKey];
1471
+ const blockCount = supportsMultipleBlocks ? faker.range(pattern.blockCountMin, pattern.blockCountMax) : 1;
1414
1472
  return Array(blockCount).fill(void 0).map(() => {
1415
- const type = faker.random.arrayElement(types);
1473
+ const type = faker.randomElement(types);
1416
1474
  const generator = generators[type];
1417
1475
  return generator({ seed: config.seed, model });
1418
1476
  }).flat().filter((block) => block !== void 0).slice(0, blockCount);
@@ -1425,39 +1483,20 @@ const select = (config = {}) => {
1425
1483
  const faker = createFaker(config.seed);
1426
1484
  const model = config.model || select$1({ seed: config.seed });
1427
1485
  const defaultValue = model.config.default_value;
1428
- return typeof defaultValue === "string" && faker.datatype.boolean() ? defaultValue : faker.random.arrayElement(model.config.options);
1429
- };
1430
-
1431
- const patterns$2 = {
1432
- none: {
1433
- minItems: 0,
1434
- maxItems: 0
1435
- },
1436
- short: {
1437
- minItems: 1,
1438
- maxItems: 3
1439
- },
1440
- medium: {
1441
- minItems: 3,
1442
- maxItems: 6
1443
- },
1444
- long: {
1445
- minItems: 6,
1446
- maxItems: 12
1486
+ if (config.state === "empty") {
1487
+ return null;
1488
+ } else {
1489
+ return typeof defaultValue === "string" && faker.boolean() ? defaultValue : faker.randomElement(model.config.options);
1447
1490
  }
1448
1491
  };
1492
+
1449
1493
  const slice = (config = {}) => {
1450
- var _a;
1494
+ var _a, _b;
1451
1495
  const faker = createFaker(config.seed);
1452
1496
  const model = config.model || slice$1({ seed: config.seed });
1453
- const patternKey = config.pattern || faker.random.arrayElement(Object.keys(patterns$2));
1454
- const pattern = patterns$2[patternKey];
1455
1497
  const sliceType = (_a = config.type) != null ? _a : generateFieldId({ seed: config.seed });
1456
- const sliceLabel = config.label !== void 0 ? config.label : changeCase__namespace.capitalCase(faker.company.bsNoun());
1457
- const itemsCount = Object.keys(model.repeat).length > 0 ? faker.datatype.number({
1458
- min: pattern.minItems,
1459
- max: pattern.maxItems
1460
- }) : 0;
1498
+ const sliceLabel = config.label !== void 0 ? config.label : changeCase__namespace.capitalCase(faker.words(faker.range(1, 2)));
1499
+ const itemsCount = Object.keys(model.repeat).length > 0 ? (_b = config.itemsCount) != null ? _b : faker.range(1, 6) : 0;
1461
1500
  return {
1462
1501
  slice_type: sliceType,
1463
1502
  slice_label: sliceLabel,
@@ -1476,41 +1515,17 @@ const slice = (config = {}) => {
1476
1515
  };
1477
1516
  };
1478
1517
 
1479
- const patterns$1 = {
1480
- none: {
1481
- minItems: 0,
1482
- maxItems: 0
1483
- },
1484
- short: {
1485
- minItems: 1,
1486
- maxItems: 3
1487
- },
1488
- medium: {
1489
- minItems: 3,
1490
- maxItems: 6
1491
- },
1492
- long: {
1493
- minItems: 6,
1494
- maxItems: 12
1495
- }
1496
- };
1497
1518
  const sharedSliceVariation = (config = {}) => {
1498
1519
  var _a, _b;
1499
1520
  const faker = createFaker(config.seed);
1500
1521
  const model = config.model || sharedSliceVariation$1({ seed: config.seed });
1501
- const patternKey = config.pattern || faker.random.arrayElement(Object.keys(patterns$1));
1502
- const pattern = patterns$1[patternKey];
1503
1522
  const sliceType = (_a = config.type) != null ? _a : generateFieldId({ seed: config.seed });
1504
- const sliceLabel = (_b = config.label) != null ? _b : changeCase__namespace.capitalCase(faker.company.bsNoun());
1505
- const itemsCount = Object.keys(model.items).length > 0 ? faker.datatype.number({
1506
- min: pattern.minItems,
1507
- max: pattern.maxItems
1508
- }) : 0;
1523
+ const itemsCount = Object.keys(model.items).length > 0 ? (_b = config.itemsCount) != null ? _b : faker.range(1, 6) : 0;
1509
1524
  return {
1510
1525
  slice_type: sliceType,
1511
- slice_label: sliceLabel,
1526
+ slice_label: null,
1512
1527
  variation: model.id,
1513
- version: faker.git.shortSha(),
1528
+ version: faker.hash(7),
1514
1529
  primary: valueForModelMap({
1515
1530
  seed: config.seed,
1516
1531
  map: model.primary,
@@ -1529,85 +1544,79 @@ const sharedSliceVariation = (config = {}) => {
1529
1544
  const sharedSlice = (config = {}) => {
1530
1545
  const faker = createFaker(config.seed);
1531
1546
  const model = config.model || sharedSlice$1({ seed: config.seed });
1532
- const variationModel = faker.random.arrayElement(model.variations);
1547
+ const variationModel = faker.randomElement(model.variations);
1533
1548
  return sharedSliceVariation({
1534
1549
  seed: config.seed,
1535
1550
  model: variationModel,
1536
- pattern: config.pattern,
1551
+ itemsCount: config.itemsCount,
1537
1552
  type: model.id,
1538
1553
  primaryFieldConfigs: config.primaryFieldConfigs,
1539
1554
  itemsFieldConfigs: config.itemsFieldConfigs
1540
1555
  });
1541
1556
  };
1542
1557
 
1543
- const patterns = {
1544
- short: {
1545
- minItems: 1,
1546
- maxItems: 3
1547
- },
1548
- medium: {
1549
- minItems: 3,
1550
- maxItems: 6
1551
- },
1552
- long: {
1553
- minItems: 6,
1554
- maxItems: 12
1555
- }
1556
- };
1557
1558
  const sliceZone = (config = {}) => {
1558
- const faker = createFaker(config.seed);
1559
- const model = config.model || sliceZone$1({ seed: config.seed });
1560
- const patternKey = config.pattern || faker.random.arrayElement(Object.keys(patterns));
1561
- const pattern = patterns[patternKey];
1562
- const itemsCount = faker.datatype.number({
1563
- min: pattern.minItems,
1564
- max: pattern.maxItems
1565
- });
1566
- return Array(itemsCount).fill(void 0).map(() => {
1567
- var _a;
1568
- const choices = Object.entries(model.config.choices);
1569
- const [choiceType, choiceModel] = faker.random.arrayElement(choices);
1570
- const choiceLabels = model.config.labels[choiceType] || [];
1571
- const choiceLabel = faker.random.arrayElement(choiceLabels);
1572
- switch (choiceModel.type) {
1573
- case prismicT__namespace.CustomTypeModelSliceType.Slice: {
1574
- return slice({
1575
- seed: config.seed,
1576
- model: choiceModel,
1577
- type: choiceType,
1578
- label: choiceLabel ? choiceLabel.name : null,
1579
- primaryFieldConfigs: config.primaryFieldConfigs,
1580
- itemsFieldConfigs: config.itemsFieldConfigs
1581
- });
1582
- }
1583
- case prismicT__namespace.CustomTypeModelSliceType.SharedSlice: {
1584
- const sharedSliceModel = (_a = config.sharedSliceModels) == null ? void 0 : _a.find((sharedSliceModel2) => sharedSliceModel2.id === choiceType);
1585
- if (sharedSliceModel) {
1586
- return sharedSlice({
1587
- seed: config.seed,
1588
- model: sharedSliceModel,
1589
- primaryFieldConfigs: config.primaryFieldConfigs,
1590
- itemsFieldConfigs: config.itemsFieldConfigs
1591
- });
1559
+ var _a;
1560
+ if (config.state === "empty") {
1561
+ return [];
1562
+ } else {
1563
+ const faker = createFaker(config.seed);
1564
+ const model = config.model || sliceZone$1({ seed: config.seed });
1565
+ if (Object.keys(model.config.choices).length > 0) {
1566
+ const itemsCount = (_a = config.itemsCount) != null ? _a : faker.range(1, 6);
1567
+ return Array(itemsCount).fill(void 0).map(() => {
1568
+ var _a2;
1569
+ const choices = Object.entries(model.config.choices);
1570
+ const [choiceType, choiceModel] = faker.randomElement(choices);
1571
+ const choiceLabels = model.config.labels[choiceType] || [];
1572
+ const choiceLabel = faker.randomElement(choiceLabels);
1573
+ switch (choiceModel.type) {
1574
+ case prismicT__namespace.CustomTypeModelSliceType.Slice: {
1575
+ return slice({
1576
+ seed: config.seed,
1577
+ model: choiceModel,
1578
+ type: choiceType,
1579
+ label: choiceLabel ? choiceLabel.name : null,
1580
+ primaryFieldConfigs: config.primaryFieldConfigs,
1581
+ itemsFieldConfigs: config.itemsFieldConfigs
1582
+ });
1583
+ }
1584
+ case prismicT__namespace.CustomTypeModelSliceType.SharedSlice: {
1585
+ const sharedSliceModel = (_a2 = config.sharedSliceModels) == null ? void 0 : _a2.find((sharedSliceModel2) => sharedSliceModel2.id === choiceType);
1586
+ if (sharedSliceModel) {
1587
+ return sharedSlice({
1588
+ seed: config.seed,
1589
+ model: sharedSliceModel,
1590
+ primaryFieldConfigs: config.primaryFieldConfigs,
1591
+ itemsFieldConfigs: config.itemsFieldConfigs
1592
+ });
1593
+ }
1594
+ }
1592
1595
  }
1593
- }
1596
+ }).filter((slice2) => slice2 !== void 0);
1597
+ } else {
1598
+ return [];
1594
1599
  }
1595
- }).filter((slice2) => slice2 !== void 0);
1600
+ }
1596
1601
  };
1597
1602
 
1598
1603
  const title = (config = {}) => {
1599
- return [
1600
- heading({
1601
- seed: config.seed,
1602
- model: config.model,
1603
- pattern: config.pattern
1604
- })
1605
- ];
1604
+ if (config.state === "empty") {
1605
+ return [];
1606
+ } else {
1607
+ return [
1608
+ heading({
1609
+ seed: config.seed,
1610
+ model: config.model,
1611
+ pattern: config.pattern
1612
+ })
1613
+ ];
1614
+ }
1606
1615
  };
1607
1616
 
1608
1617
  const uid = (config = {}) => {
1609
1618
  const faker = createFaker(config.seed);
1610
- return changeCase__namespace.snakeCase(faker.lorem.words(2));
1619
+ return changeCase__namespace.snakeCase(faker.words(faker.range(1, 3)));
1611
1620
  };
1612
1621
 
1613
1622
  const index$1 = /*#__PURE__*/Object.freeze({
@@ -1642,10 +1651,10 @@ const ref = (config = {}) => {
1642
1651
  var _a;
1643
1652
  const faker = createFaker(config.seed);
1644
1653
  const value = {
1645
- id: faker.git.shortSha(),
1646
- ref: faker.git.shortSha(),
1654
+ id: faker.hash(16),
1655
+ ref: faker.hash(16),
1647
1656
  isMasterRef: (_a = config.isMasterRef) != null ? _a : false,
1648
- label: config.isMasterRef ? "Master" : changeCase__namespace.capitalCase(faker.company.bsNoun())
1657
+ label: config.isMasterRef ? "Master" : changeCase__namespace.capitalCase(faker.words(faker.range(1, 3)))
1649
1658
  };
1650
1659
  if (config.isScheduled) {
1651
1660
  value.scheduledAt = timestamp({ seed: config.seed });
@@ -1668,8 +1677,8 @@ const repository = (config = {}) => {
1668
1677
  types,
1669
1678
  languages: [
1670
1679
  {
1671
- id: faker.lorem.word(),
1672
- name: changeCase__namespace.capitalCase(faker.lorem.word())
1680
+ id: faker.word(),
1681
+ name: changeCase__namespace.capitalCase(faker.word())
1673
1682
  }
1674
1683
  ],
1675
1684
  tags: generateTags({
@@ -1679,11 +1688,11 @@ const repository = (config = {}) => {
1679
1688
  }),
1680
1689
  forms: {},
1681
1690
  license: "All Rights Reserved",
1682
- version: faker.git.shortSha(),
1691
+ version: faker.hash(7),
1683
1692
  bookmarks: {},
1684
1693
  experiments: {},
1685
- oauth_token: faker.internet.url(),
1686
- oauth_initiate: faker.internet.url()
1694
+ oauth_token: faker.url(),
1695
+ oauth_initiate: faker.url()
1687
1696
  };
1688
1697
  };
1689
1698
 
@@ -1697,8 +1706,8 @@ const query = (config = {}) => {
1697
1706
  const results = documents.slice((page - 1) * pageSize, page * pageSize);
1698
1707
  return {
1699
1708
  page,
1700
- next_page: page < totalPages ? faker.internet.url() : null,
1701
- prev_page: page > 1 ? faker.internet.url() : null,
1709
+ next_page: page < totalPages ? faker.url() : null,
1710
+ prev_page: page > 1 ? faker.url() : null,
1702
1711
  total_pages: totalPages,
1703
1712
  results_size: results.length,
1704
1713
  results_per_page: pageSize,
@@ -1726,3 +1735,4 @@ const index = /*#__PURE__*/Object.freeze({
1726
1735
  exports.api = index;
1727
1736
  exports.model = index$2;
1728
1737
  exports.value = index$1;
1738
+ //# sourceMappingURL=index.cjs.map