@localazy/strapi-plugin 0.1.10 → 0.1.11-rc.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 (42) hide show
  1. package/.eslintrc +6 -2
  2. package/admin/src/modules/@common/models/supported-content-type-fields.js +8 -0
  3. package/admin/src/modules/plugin-settings/components/Tree/index.js +2 -0
  4. package/admin/src/modules/plugin-settings/utils/get-filtered-models-schemas.js +4 -4
  5. package/admin/src/modules/plugin-settings/utils/get-models-tree.js +3 -1
  6. package/package.json +1 -1
  7. package/server/bootstrap.js +15 -1
  8. package/server/controllers/localazy-transfer-controller.js +41 -46
  9. package/server/functions/should-set-downloaded-property.js +16 -0
  10. package/server/models/supported-content-type-fields.js +8 -0
  11. package/server/services/index.js +2 -0
  12. package/server/services/strapi-i18n-service.js +4 -3
  13. package/server/services/strapi-localazy-i18n-service.js +104 -0
  14. package/server/tests/fixtures/parsed-localazy-entry-to-create-entry-cookbook.js +5761 -0
  15. package/server/tests/fixtures/parsed-localazy-entry-to-create-entry-restaurant-simple-menu.js +536 -0
  16. package/server/tests/fixtures/parsed-localazy-entry-to-update-entry.js +35157 -0
  17. package/server/tests/fixtures/populate-create-update-entry-with-base-entry-cookbook-empty-recipes.js +202 -0
  18. package/server/tests/fixtures/populate-create-update-entry-with-base-entry-cookbook.js +2700 -0
  19. package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-flat-simple.js +47 -0
  20. package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-flat-with-media.js +169 -0
  21. package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-menu-empty.js +3003 -0
  22. package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-menu-with-media.js +2057 -0
  23. package/server/tests/fixtures/populate-create-update-entry-with-base-entry-sample-json.js +46 -0
  24. package/server/tests/fixtures/{all-models-with-multimedia.js → strapi-plugin-all-models.js} +717 -540
  25. package/server/utils/__tests__/get-models-tree.test.js +1 -1
  26. package/server/utils/__tests__/parsed-localazy-entry-to-create-entry.test.js +90 -93
  27. package/server/utils/__tests__/parsed-localazy-entry-to-update-entry.test.js +417 -101
  28. package/server/utils/__tests__/populate-create-update-entry-with-base-entry.test.js +852 -0
  29. package/server/utils/get-full-populate-object.js +56 -0
  30. package/server/utils/get-models-tree.js +3 -1
  31. package/server/utils/model-utils.js +38 -0
  32. package/server/utils/parsed-localazy-entry-to-create-entry.js +1 -18
  33. package/server/utils/parsed-localazy-entry-to-update-entry.js +38 -3
  34. package/server/utils/populate-create-update-entry-with-base-entry.js +222 -0
  35. package/server/utils/transfer-setup-utils.js +14 -0
  36. package/server/tests/fixtures/restaurant-model.js +0 -230
  37. package/server/tests/fixtures/restaurants-entries.js +0 -152
  38. package/server/tests/fixtures/strapi-book-with-multimedia-components-cs.js +0 -31
  39. package/server/tests/fixtures/stringified-book-cs.js +0 -3
  40. package/server/tests/fixtures/stringified-book-with-multimedia-components-cs.js +0 -3
  41. package/server/tests/fixtures/stringified-restaurant-cs.js +0 -3
  42. package/server/tests/fixtures/stringified-restaurant-de.js +0 -5
@@ -1,93 +1,71 @@
1
- "use strict";
2
-
3
1
  module.exports = [
4
2
  {
5
- kind: "singleType",
6
- collectionName: "tokens",
3
+ kind: "collectionType",
4
+ collectionName: "cookbooks",
7
5
  info: {
8
- singularName: "token",
9
- pluralName: "tokens",
10
- displayName: "Token",
6
+ singularName: "cookbook",
7
+ pluralName: "cookbooks",
8
+ displayName: "cookbook",
9
+ description: "",
11
10
  },
12
11
  options: {
13
- draftAndPublish: false,
12
+ draftAndPublish: true,
13
+ },
14
+ pluginOptions: {
15
+ i18n: {
16
+ localized: true,
17
+ },
14
18
  },
15
- pluginOptions: {},
16
19
  attributes: {
17
- access_token: {
20
+ title: {
21
+ pluginOptions: {
22
+ i18n: {
23
+ localized: true,
24
+ },
25
+ },
18
26
  type: "string",
19
27
  },
20
- createdAt: {
21
- type: "datetime",
22
- },
23
- updatedAt: {
24
- type: "datetime",
25
- },
26
- createdBy: {
27
- type: "relation",
28
- relation: "oneToOne",
29
- target: "admin::user",
30
- configurable: false,
31
- writable: false,
32
- visible: false,
33
- useJoinTable: false,
34
- private: true,
35
- },
36
- updatedBy: {
37
- type: "relation",
38
- relation: "oneToOne",
39
- target: "admin::user",
40
- configurable: false,
41
- writable: false,
42
- visible: false,
43
- useJoinTable: false,
44
- private: true,
28
+ author_name: {
29
+ pluginOptions: {
30
+ i18n: {
31
+ localized: false,
32
+ },
33
+ },
34
+ type: "string",
45
35
  },
46
- },
47
- __schema__: {
48
- collectionName: "tokens",
49
- info: {
50
- singularName: "token",
51
- pluralName: "tokens",
52
- displayName: "Token",
36
+ pages: {
37
+ pluginOptions: {
38
+ i18n: {
39
+ localized: true,
40
+ },
41
+ },
42
+ type: "integer",
53
43
  },
54
- options: {
55
- draftAndPublish: false,
44
+ recipes: {
45
+ type: "component",
46
+ repeatable: true,
47
+ pluginOptions: {
48
+ i18n: {
49
+ localized: true,
50
+ },
51
+ },
52
+ component: "food.cookbook-item",
56
53
  },
57
- pluginOptions: {},
58
- attributes: {
59
- access_token: {
60
- type: "string",
54
+ gallery: {
55
+ type: "component",
56
+ repeatable: false,
57
+ pluginOptions: {
58
+ i18n: {
59
+ localized: true,
60
+ },
61
61
  },
62
+ component: "food.gallery",
62
63
  },
63
- kind: "singleType",
64
- },
65
- modelType: "contentType",
66
- modelName: "token",
67
- connection: "default",
68
- uid: "plugin::localazy.token",
69
- plugin: "localazy",
70
- globalId: "LocalazyToken",
71
- actions: undefined,
72
- lifecycles: undefined,
73
- singularName: "token",
74
- tableName: "tokens",
75
- },
76
- {
77
- kind: "singleType",
78
- collectionName: "testtokens",
79
- info: {
80
- singularName: "testtoken",
81
- pluralName: "testtokens",
82
- displayName: "testtoken",
83
- },
84
- options: {
85
- draftAndPublish: true,
86
- comment: "",
87
- },
88
- attributes: {
89
- at: {
90
- type: "string",
64
+ used_in_restaurants: {
65
+ type: "relation",
66
+ relation: "oneToMany",
67
+ target: "api::restaurant-simple-menu.restaurant-simple-menu",
68
+ mappedBy: "used_cookbooks",
91
69
  },
92
70
  createdAt: {
93
71
  type: "datetime",
@@ -121,99 +99,187 @@ module.exports = [
121
99
  useJoinTable: false,
122
100
  private: true,
123
101
  },
102
+ localizations: {
103
+ writable: true,
104
+ private: false,
105
+ configurable: false,
106
+ visible: false,
107
+ type: "relation",
108
+ relation: "oneToMany",
109
+ target: "api::cookbook.cookbook",
110
+ },
111
+ locale: {
112
+ writable: true,
113
+ private: false,
114
+ configurable: false,
115
+ visible: false,
116
+ type: "string",
117
+ },
124
118
  },
125
119
  __schema__: {
126
- collectionName: "testtokens",
120
+ collectionName: "cookbooks",
127
121
  info: {
128
- singularName: "testtoken",
129
- pluralName: "testtokens",
130
- displayName: "testtoken",
122
+ singularName: "cookbook",
123
+ pluralName: "cookbooks",
124
+ displayName: "cookbook",
125
+ description: "",
131
126
  },
132
127
  options: {
133
128
  draftAndPublish: true,
134
- comment: "",
129
+ },
130
+ pluginOptions: {
131
+ i18n: {
132
+ localized: true,
133
+ },
135
134
  },
136
135
  attributes: {
137
- at: {
136
+ title: {
137
+ pluginOptions: {
138
+ i18n: {
139
+ localized: true,
140
+ },
141
+ },
142
+ type: "string",
143
+ },
144
+ author_name: {
145
+ pluginOptions: {
146
+ i18n: {
147
+ localized: false,
148
+ },
149
+ },
138
150
  type: "string",
139
151
  },
152
+ pages: {
153
+ pluginOptions: {
154
+ i18n: {
155
+ localized: true,
156
+ },
157
+ },
158
+ type: "integer",
159
+ },
160
+ recipes: {
161
+ type: "component",
162
+ repeatable: true,
163
+ pluginOptions: {
164
+ i18n: {
165
+ localized: true,
166
+ },
167
+ },
168
+ component: "food.cookbook-item",
169
+ },
170
+ gallery: {
171
+ type: "component",
172
+ repeatable: false,
173
+ pluginOptions: {
174
+ i18n: {
175
+ localized: true,
176
+ },
177
+ },
178
+ component: "food.gallery",
179
+ },
180
+ used_in_restaurants: {
181
+ type: "relation",
182
+ relation: "oneToMany",
183
+ target: "api::restaurant-simple-menu.restaurant-simple-menu",
184
+ mappedBy: "used_cookbooks",
185
+ },
140
186
  },
141
- kind: "singleType",
187
+ kind: "collectionType",
142
188
  },
143
189
  modelType: "contentType",
144
- modelName: "testtoken",
190
+ modelName: "cookbook",
145
191
  connection: "default",
146
- uid: "plugin::localazy.testtoken",
147
- plugin: "localazy",
148
- globalId: "LocalazyTesttoken",
149
- actions: undefined,
150
- lifecycles: undefined,
151
- singularName: "testtoken",
152
- tableName: "testtokens",
192
+ uid: "api::cookbook.cookbook",
193
+ apiName: "cookbook",
194
+ globalId: "Cookbook",
195
+ actions: {
196
+ },
197
+ lifecycles: {
198
+ },
199
+ singularName: "cookbook",
200
+ tableName: "cookbooks",
153
201
  },
154
202
  {
155
- collectionName: "up_users",
203
+ kind: "collectionType",
204
+ collectionName: "restaurant_simple_flats",
156
205
  info: {
157
- name: "user",
206
+ singularName: "restaurant-simple-flat",
207
+ pluralName: "restaurant-simple-flats",
208
+ displayName: "restaurant-simple-flat",
158
209
  description: "",
159
- singularName: "user",
160
- pluralName: "users",
161
- displayName: "User",
162
210
  },
163
211
  options: {
164
- draftAndPublish: false,
165
- timestamps: true,
212
+ draftAndPublish: true,
166
213
  },
167
- attributes: {
168
- username: {
169
- type: "string",
170
- minLength: 3,
171
- unique: true,
172
- configurable: false,
173
- required: true,
174
- },
175
- email: {
176
- type: "email",
177
- minLength: 6,
178
- configurable: false,
179
- required: true,
214
+ pluginOptions: {
215
+ i18n: {
216
+ localized: true,
180
217
  },
181
- provider: {
218
+ },
219
+ attributes: {
220
+ name: {
221
+ pluginOptions: {
222
+ i18n: {
223
+ localized: true,
224
+ },
225
+ },
182
226
  type: "string",
183
- configurable: false,
184
- },
185
- password: {
186
- type: "password",
187
- minLength: 6,
188
- configurable: false,
189
- private: true,
190
227
  },
191
- resetPasswordToken: {
192
- type: "string",
193
- configurable: false,
194
- private: true,
228
+ description: {
229
+ pluginOptions: {
230
+ i18n: {
231
+ localized: true,
232
+ },
233
+ },
234
+ type: "text",
195
235
  },
196
- confirmationToken: {
197
- type: "string",
198
- configurable: false,
199
- private: true,
236
+ established_at: {
237
+ pluginOptions: {
238
+ i18n: {
239
+ localized: false,
240
+ },
241
+ },
242
+ type: "date",
200
243
  },
201
- confirmed: {
244
+ is_franchise: {
245
+ pluginOptions: {
246
+ i18n: {
247
+ localized: true,
248
+ },
249
+ },
202
250
  type: "boolean",
203
- default: false,
204
- configurable: false,
205
251
  },
206
- blocked: {
207
- type: "boolean",
208
- default: false,
209
- configurable: false,
252
+ contact_email: {
253
+ pluginOptions: {
254
+ i18n: {
255
+ localized: true,
256
+ },
257
+ },
258
+ type: "email",
210
259
  },
211
- role: {
260
+ cuisine: {
261
+ pluginOptions: {
262
+ i18n: {
263
+ localized: true,
264
+ },
265
+ },
266
+ type: "enumeration",
267
+ enum: [
268
+ "Thai",
269
+ "Spanish",
270
+ "Moroccan",
271
+ "Japanese",
272
+ "Indian",
273
+ "Italian",
274
+ "French",
275
+ "Chinese",
276
+ ],
277
+ },
278
+ featured_image: {
212
279
  type: "relation",
213
- relation: "manyToOne",
214
- target: "plugin::users-permissions.role",
215
- inversedBy: "users",
216
- configurable: false,
280
+ relation: "morphOne",
281
+ target: "plugin::upload.file",
282
+ morphBy: "related",
217
283
  },
218
284
  createdAt: {
219
285
  type: "datetime",
@@ -221,6 +287,12 @@ module.exports = [
221
287
  updatedAt: {
222
288
  type: "datetime",
223
289
  },
290
+ publishedAt: {
291
+ type: "datetime",
292
+ configurable: false,
293
+ writable: true,
294
+ visible: false,
295
+ },
224
296
  createdBy: {
225
297
  type: "relation",
226
298
  relation: "oneToOne",
@@ -241,106 +313,136 @@ module.exports = [
241
313
  useJoinTable: false,
242
314
  private: true,
243
315
  },
244
- },
245
- config: {
246
- attributes: {
247
- resetPasswordToken: {
248
- hidden: true,
249
- },
250
- confirmationToken: {
251
- hidden: true,
252
- },
253
- provider: {
254
- hidden: true,
255
- },
316
+ localizations: {
317
+ writable: true,
318
+ private: false,
319
+ configurable: false,
320
+ visible: false,
321
+ type: "relation",
322
+ relation: "oneToMany",
323
+ target: "api::restaurant-simple-flat.restaurant-simple-flat",
324
+ },
325
+ locale: {
326
+ writable: true,
327
+ private: false,
328
+ configurable: false,
329
+ visible: false,
330
+ type: "string",
256
331
  },
257
332
  },
258
- kind: "collectionType",
259
333
  __schema__: {
260
- collectionName: "up_users",
334
+ collectionName: "restaurant_simple_flats",
261
335
  info: {
262
- name: "user",
336
+ singularName: "restaurant-simple-flat",
337
+ pluralName: "restaurant-simple-flats",
338
+ displayName: "restaurant-simple-flat",
263
339
  description: "",
264
- singularName: "user",
265
- pluralName: "users",
266
- displayName: "User",
267
340
  },
268
341
  options: {
269
- draftAndPublish: false,
270
- timestamps: true,
342
+ draftAndPublish: true,
271
343
  },
272
- attributes: {
273
- username: {
274
- type: "string",
275
- minLength: 3,
276
- unique: true,
277
- configurable: false,
278
- required: true,
279
- },
280
- email: {
281
- type: "email",
282
- minLength: 6,
283
- configurable: false,
284
- required: true,
344
+ pluginOptions: {
345
+ i18n: {
346
+ localized: true,
285
347
  },
286
- provider: {
348
+ },
349
+ attributes: {
350
+ name: {
351
+ pluginOptions: {
352
+ i18n: {
353
+ localized: true,
354
+ },
355
+ },
287
356
  type: "string",
288
- configurable: false,
289
357
  },
290
- password: {
291
- type: "password",
292
- minLength: 6,
293
- configurable: false,
294
- private: true,
295
- },
296
- resetPasswordToken: {
297
- type: "string",
298
- configurable: false,
299
- private: true,
358
+ description: {
359
+ pluginOptions: {
360
+ i18n: {
361
+ localized: true,
362
+ },
363
+ },
364
+ type: "text",
300
365
  },
301
- confirmationToken: {
302
- type: "string",
303
- configurable: false,
304
- private: true,
366
+ established_at: {
367
+ pluginOptions: {
368
+ i18n: {
369
+ localized: false,
370
+ },
371
+ },
372
+ type: "date",
305
373
  },
306
- confirmed: {
374
+ is_franchise: {
375
+ pluginOptions: {
376
+ i18n: {
377
+ localized: true,
378
+ },
379
+ },
307
380
  type: "boolean",
308
- default: false,
309
- configurable: false,
310
381
  },
311
- blocked: {
312
- type: "boolean",
313
- default: false,
314
- configurable: false,
382
+ contact_email: {
383
+ pluginOptions: {
384
+ i18n: {
385
+ localized: true,
386
+ },
387
+ },
388
+ type: "email",
315
389
  },
316
- role: {
317
- type: "relation",
318
- relation: "manyToOne",
319
- target: "plugin::users-permissions.role",
320
- inversedBy: "users",
321
- configurable: false,
390
+ cuisine: {
391
+ pluginOptions: {
392
+ i18n: {
393
+ localized: true,
394
+ },
395
+ },
396
+ type: "enumeration",
397
+ enum: [
398
+ "Thai",
399
+ "Spanish",
400
+ "Moroccan",
401
+ "Japanese",
402
+ "Indian",
403
+ "Italian",
404
+ "French",
405
+ "Chinese",
406
+ ],
407
+ },
408
+ featured_image: {
409
+ allowedTypes: [
410
+ "images",
411
+ "files",
412
+ "videos",
413
+ "audios",
414
+ ],
415
+ type: "media",
416
+ multiple: false,
417
+ pluginOptions: {
418
+ i18n: {
419
+ localized: true,
420
+ },
421
+ },
322
422
  },
323
423
  },
324
424
  kind: "collectionType",
325
425
  },
326
426
  modelType: "contentType",
327
- modelName: "user",
427
+ modelName: "restaurant-simple-flat",
328
428
  connection: "default",
329
- uid: "plugin::users-permissions.user",
330
- plugin: "users-permissions",
331
- globalId: "UsersPermissionsUser",
332
- actions: undefined,
333
- lifecycles: undefined,
334
- singularName: "user",
335
- tableName: "up_users",
429
+ uid: "api::restaurant-simple-flat.restaurant-simple-flat",
430
+ apiName: "restaurant-simple-flat",
431
+ globalId: "RestaurantSimpleFlat",
432
+ actions: {
433
+ },
434
+ lifecycles: {
435
+ },
436
+ singularName: "restaurant-simple-flat",
437
+ tableName: "restaurant_simple_flats",
336
438
  },
337
439
  {
338
440
  kind: "collectionType",
339
- collectionName: "books",
441
+ collectionName: "restaurant_simple_menus",
340
442
  info: {
341
- singularName: "book",
342
- pluralName: "books",
343
- displayName: "Book",
443
+ singularName: "restaurant-simple-menu",
444
+ pluralName: "restaurant-simple-menus",
445
+ displayName: "restaurant-simple-menu",
344
446
  description: "",
345
447
  },
346
448
  options: {
@@ -352,69 +454,106 @@ module.exports = [
352
454
  },
353
455
  },
354
456
  attributes: {
355
- Title: {
457
+ name: {
458
+ pluginOptions: {
459
+ i18n: {
460
+ localized: true,
461
+ },
462
+ },
356
463
  type: "string",
464
+ },
465
+ description: {
357
466
  pluginOptions: {
358
467
  i18n: {
359
468
  localized: true,
360
469
  },
361
470
  },
471
+ type: "text",
362
472
  },
363
- Author: {
364
- type: "string",
473
+ established_at: {
365
474
  pluginOptions: {
366
475
  i18n: {
367
476
  localized: true,
368
477
  },
369
478
  },
479
+ type: "date",
370
480
  },
371
- Pages: {
372
- type: "integer",
481
+ is_franchise: {
373
482
  pluginOptions: {
374
483
  i18n: {
375
484
  localized: true,
376
485
  },
377
486
  },
487
+ type: "boolean",
378
488
  },
379
- additional_info: {
380
- type: "component",
381
- repeatable: false,
382
- component: "food.pub-component-1",
489
+ contact_email: {
383
490
  pluginOptions: {
384
491
  i18n: {
385
492
  localized: true,
386
493
  },
387
494
  },
495
+ type: "email",
388
496
  },
389
- cover: {
497
+ cuisine: {
498
+ pluginOptions: {
499
+ i18n: {
500
+ localized: true,
501
+ },
502
+ },
503
+ type: "enumeration",
504
+ enum: [
505
+ "Thai",
506
+ "Spanish",
507
+ "Moroccan",
508
+ "Japanese",
509
+ "Indian",
510
+ "Italian",
511
+ "French",
512
+ "Chinese",
513
+ ],
514
+ },
515
+ featured_image: {
390
516
  type: "relation",
391
517
  relation: "morphOne",
392
518
  target: "plugin::upload.file",
393
519
  morphBy: "related",
394
520
  },
395
- presentations: {
396
- type: "relation",
397
- relation: "morphMany",
398
- target: "plugin::upload.file",
399
- morphBy: "related",
521
+ capacity: {
522
+ pluginOptions: {
523
+ i18n: {
524
+ localized: true,
525
+ },
526
+ },
527
+ type: "integer",
400
528
  },
401
- seo_setup: {
402
- type: "component",
403
- repeatable: true,
529
+ our_story: {
404
530
  pluginOptions: {
405
531
  i18n: {
406
532
  localized: true,
407
533
  },
408
534
  },
409
- component: "seo.gallery",
535
+ type: "richtext",
410
536
  },
411
- non_localizable_name: {
537
+ supported_restaurants: {
538
+ type: "relation",
539
+ relation: "oneToMany",
540
+ target: "api::restaurant-simple-menu.restaurant-simple-menu",
541
+ },
542
+ menu: {
543
+ type: "component",
544
+ repeatable: true,
412
545
  pluginOptions: {
413
546
  i18n: {
414
- localized: false,
547
+ localized: true,
415
548
  },
416
549
  },
417
- type: "string",
550
+ component: "restaurant.menu-item",
551
+ },
552
+ used_cookbooks: {
553
+ type: "relation",
554
+ relation: "manyToOne",
555
+ target: "api::cookbook.cookbook",
556
+ inversedBy: "used_in_restaurants",
418
557
  },
419
558
  createdAt: {
420
559
  type: "datetime",
@@ -455,7 +594,7 @@ module.exports = [
455
594
  visible: false,
456
595
  type: "relation",
457
596
  relation: "oneToMany",
458
- target: "api::book.book",
597
+ target: "api::restaurant-simple-menu.restaurant-simple-menu",
459
598
  },
460
599
  locale: {
461
600
  writable: true,
@@ -466,11 +605,11 @@ module.exports = [
466
605
  },
467
606
  },
468
607
  __schema__: {
469
- collectionName: "books",
608
+ collectionName: "restaurant_simple_menus",
470
609
  info: {
471
- singularName: "book",
472
- pluralName: "books",
473
- displayName: "Book",
610
+ singularName: "restaurant-simple-menu",
611
+ pluralName: "restaurant-simple-menus",
612
+ displayName: "restaurant-simple-menu",
474
613
  description: "",
475
614
  },
476
615
  options: {
@@ -482,102 +621,140 @@ module.exports = [
482
621
  },
483
622
  },
484
623
  attributes: {
485
- Title: {
624
+ name: {
625
+ pluginOptions: {
626
+ i18n: {
627
+ localized: true,
628
+ },
629
+ },
486
630
  type: "string",
631
+ },
632
+ description: {
487
633
  pluginOptions: {
488
634
  i18n: {
489
635
  localized: true,
490
636
  },
491
637
  },
638
+ type: "text",
492
639
  },
493
- Author: {
494
- type: "string",
640
+ established_at: {
495
641
  pluginOptions: {
496
642
  i18n: {
497
643
  localized: true,
498
644
  },
499
645
  },
646
+ type: "date",
500
647
  },
501
- Pages: {
502
- type: "integer",
648
+ is_franchise: {
503
649
  pluginOptions: {
504
650
  i18n: {
505
651
  localized: true,
506
652
  },
507
653
  },
654
+ type: "boolean",
508
655
  },
509
- additional_info: {
510
- type: "component",
511
- repeatable: false,
512
- component: "food.pub-component-1",
656
+ contact_email: {
513
657
  pluginOptions: {
514
658
  i18n: {
515
659
  localized: true,
516
660
  },
517
661
  },
662
+ type: "email",
518
663
  },
519
- cover: {
664
+ cuisine: {
665
+ pluginOptions: {
666
+ i18n: {
667
+ localized: true,
668
+ },
669
+ },
670
+ type: "enumeration",
671
+ enum: [
672
+ "Thai",
673
+ "Spanish",
674
+ "Moroccan",
675
+ "Japanese",
676
+ "Indian",
677
+ "Italian",
678
+ "French",
679
+ "Chinese",
680
+ ],
681
+ },
682
+ featured_image: {
520
683
  type: "media",
521
684
  multiple: false,
522
685
  required: false,
523
- allowedTypes: ["images", "files", "videos", "audios"],
686
+ allowedTypes: [
687
+ "images",
688
+ "files",
689
+ "videos",
690
+ "audios",
691
+ ],
524
692
  pluginOptions: {
525
693
  i18n: {
526
694
  localized: true,
527
695
  },
528
696
  },
529
697
  },
530
- presentations: {
531
- type: "media",
532
- multiple: true,
533
- required: false,
534
- allowedTypes: ["images", "files", "videos", "audios"],
698
+ capacity: {
535
699
  pluginOptions: {
536
700
  i18n: {
537
701
  localized: true,
538
702
  },
539
703
  },
704
+ type: "integer",
540
705
  },
541
- seo_setup: {
542
- type: "component",
543
- repeatable: true,
706
+ our_story: {
544
707
  pluginOptions: {
545
708
  i18n: {
546
709
  localized: true,
547
710
  },
548
711
  },
549
- component: "seo.gallery",
712
+ type: "richtext",
550
713
  },
551
- non_localizable_name: {
714
+ supported_restaurants: {
715
+ type: "relation",
716
+ relation: "oneToMany",
717
+ target: "api::restaurant-simple-menu.restaurant-simple-menu",
718
+ },
719
+ menu: {
720
+ type: "component",
721
+ repeatable: true,
552
722
  pluginOptions: {
553
723
  i18n: {
554
- localized: false,
724
+ localized: true,
555
725
  },
556
726
  },
557
- type: "string",
727
+ component: "restaurant.menu-item",
728
+ },
729
+ used_cookbooks: {
730
+ type: "relation",
731
+ relation: "manyToOne",
732
+ target: "api::cookbook.cookbook",
733
+ inversedBy: "used_in_restaurants",
558
734
  },
559
735
  },
560
736
  kind: "collectionType",
561
737
  },
562
738
  modelType: "contentType",
563
- modelName: "book",
739
+ modelName: "restaurant-simple-menu",
564
740
  connection: "default",
565
- uid: "api::book.book",
566
- apiName: "book",
567
- globalId: "Book",
568
- actions: {},
569
- lifecycles: {},
570
- singularName: "book",
571
- tableName: "books",
741
+ uid: "api::restaurant-simple-menu.restaurant-simple-menu",
742
+ apiName: "restaurant-simple-menu",
743
+ globalId: "RestaurantSimpleMenu",
744
+ actions: {
745
+ },
746
+ lifecycles: {
747
+ },
748
+ singularName: "restaurant-simple-menu",
749
+ tableName: "restaurant_simple_menus",
572
750
  },
573
751
  {
574
752
  kind: "collectionType",
575
- collectionName: "restaurants",
753
+ collectionName: "sample_jsons",
576
754
  info: {
577
- singularName: "restaurant",
578
- pluralName: "restaurants",
579
- displayName: "Restaurant",
580
- description: "",
755
+ singularName: "sample-json",
756
+ pluralName: "sample-jsons",
757
+ displayName: "sample-json",
581
758
  },
582
759
  options: {
583
760
  draftAndPublish: true,
@@ -588,57 +765,7 @@ module.exports = [
588
765
  },
589
766
  },
590
767
  attributes: {
591
- title: {
592
- pluginOptions: {
593
- i18n: {
594
- localized: true,
595
- },
596
- },
597
- type: "string",
598
- required: true,
599
- },
600
- description: {
601
- pluginOptions: {
602
- i18n: {
603
- localized: true,
604
- },
605
- },
606
- type: "text",
607
- },
608
- books: {
609
- type: "relation",
610
- relation: "oneToMany",
611
- target: "api::book.book",
612
- },
613
- recipes: {
614
- type: "component",
615
- repeatable: true,
616
- pluginOptions: {
617
- i18n: {
618
- localized: true,
619
- },
620
- },
621
- component: "food.recipe",
622
- },
623
- descs: {
624
- type: "component",
625
- repeatable: false,
626
- pluginOptions: {
627
- i18n: {
628
- localized: true,
629
- },
630
- },
631
- component: "food.pub-component-1",
632
- },
633
- street: {
634
- pluginOptions: {
635
- i18n: {
636
- localized: true,
637
- },
638
- },
639
- type: "string",
640
- },
641
- city: {
768
+ purpose: {
642
769
  pluginOptions: {
643
770
  i18n: {
644
771
  localized: true,
@@ -646,13 +773,13 @@ module.exports = [
646
773
  },
647
774
  type: "string",
648
775
  },
649
- country: {
776
+ data: {
650
777
  pluginOptions: {
651
778
  i18n: {
652
779
  localized: true,
653
780
  },
654
781
  },
655
- type: "string",
782
+ type: "json",
656
783
  },
657
784
  createdAt: {
658
785
  type: "datetime",
@@ -693,7 +820,7 @@ module.exports = [
693
820
  visible: false,
694
821
  type: "relation",
695
822
  relation: "oneToMany",
696
- target: "api::restaurant.restaurant",
823
+ target: "api::sample-json.sample-json",
697
824
  },
698
825
  locale: {
699
826
  writable: true,
@@ -704,12 +831,11 @@ module.exports = [
704
831
  },
705
832
  },
706
833
  __schema__: {
707
- collectionName: "restaurants",
834
+ collectionName: "sample_jsons",
708
835
  info: {
709
- singularName: "restaurant",
710
- pluralName: "restaurants",
711
- displayName: "Restaurant",
712
- description: "",
836
+ singularName: "sample-json",
837
+ pluralName: "sample-jsons",
838
+ displayName: "sample-json",
713
839
  },
714
840
  options: {
715
841
  draftAndPublish: true,
@@ -720,345 +846,396 @@ module.exports = [
720
846
  },
721
847
  },
722
848
  attributes: {
723
- title: {
849
+ purpose: {
724
850
  pluginOptions: {
725
851
  i18n: {
726
852
  localized: true,
727
853
  },
728
854
  },
729
855
  type: "string",
730
- required: true,
731
856
  },
732
- description: {
733
- pluginOptions: {
734
- i18n: {
735
- localized: true,
736
- },
737
- },
738
- type: "text",
739
- },
740
- books: {
741
- type: "relation",
742
- relation: "oneToMany",
743
- target: "api::book.book",
744
- },
745
- recipes: {
746
- type: "component",
747
- repeatable: true,
748
- pluginOptions: {
749
- i18n: {
750
- localized: true,
751
- },
752
- },
753
- component: "food.recipe",
754
- },
755
- descs: {
756
- type: "component",
757
- repeatable: false,
758
- pluginOptions: {
759
- i18n: {
760
- localized: true,
761
- },
762
- },
763
- component: "food.pub-component-1",
764
- },
765
- street: {
766
- pluginOptions: {
767
- i18n: {
768
- localized: true,
769
- },
770
- },
771
- type: "string",
772
- },
773
- city: {
774
- pluginOptions: {
775
- i18n: {
776
- localized: true,
777
- },
778
- },
779
- type: "string",
780
- },
781
- country: {
857
+ data: {
782
858
  pluginOptions: {
783
859
  i18n: {
784
860
  localized: true,
785
861
  },
786
862
  },
787
- type: "string",
863
+ type: "json",
788
864
  },
789
865
  },
790
866
  kind: "collectionType",
791
867
  },
792
868
  modelType: "contentType",
793
- modelName: "restaurant",
869
+ modelName: "sample-json",
794
870
  connection: "default",
795
- uid: "api::restaurant.restaurant",
796
- apiName: "restaurant",
797
- globalId: "Restaurant",
798
- actions: {},
799
- lifecycles: {},
800
- singularName: "restaurant",
801
- tableName: "restaurants",
871
+ uid: "api::sample-json.sample-json",
872
+ apiName: "sample-json",
873
+ globalId: "SampleJson",
874
+ actions: {
875
+ },
876
+ lifecycles: {
877
+ },
878
+ singularName: "sample-json",
879
+ tableName: "sample_jsons",
802
880
  },
803
881
  {
804
- collectionName: "components_food_ingredient_variants",
882
+ collectionName: "components_food_cookbook_items",
805
883
  info: {
806
- displayName: "ingredient_variants",
807
- icon: "atlas",
884
+ displayName: "Cookbook Item",
885
+ icon: "book-open",
886
+ description: "",
887
+ },
888
+ options: {
808
889
  },
809
- options: {},
810
890
  attributes: {
811
891
  name: {
812
892
  type: "string",
813
893
  },
894
+ recipe: {
895
+ type: "richtext",
896
+ },
897
+ gallery: {
898
+ type: "component",
899
+ repeatable: true,
900
+ component: "food.gallery-item",
901
+ },
902
+ estimated_cook_time: {
903
+ type: "time",
904
+ required: false,
905
+ },
906
+ difficulty: {
907
+ type: "enumeration",
908
+ enum: [
909
+ "beginner",
910
+ "easy",
911
+ "moderate",
912
+ "hard",
913
+ "superstar",
914
+ "dead mode",
915
+ ],
916
+ },
917
+ author_name: {
918
+ type: "string",
919
+ },
920
+ ingredients: {
921
+ type: "component",
922
+ repeatable: true,
923
+ component: "food.recipe-ingredient",
924
+ },
814
925
  },
815
- __filename__: "ingredient-variants.json",
926
+ __filename__: "cookbook-item.json",
816
927
  __schema__: {
817
- collectionName: "components_food_ingredient_variants",
928
+ collectionName: "components_food_cookbook_items",
818
929
  info: {
819
- displayName: "ingredient_variants",
820
- icon: "atlas",
930
+ displayName: "Cookbook Item",
931
+ icon: "book-open",
932
+ description: "",
933
+ },
934
+ options: {
821
935
  },
822
- options: {},
823
936
  attributes: {
824
937
  name: {
825
938
  type: "string",
826
939
  },
940
+ recipe: {
941
+ type: "richtext",
942
+ },
943
+ gallery: {
944
+ type: "component",
945
+ repeatable: true,
946
+ component: "food.gallery-item",
947
+ },
948
+ estimated_cook_time: {
949
+ type: "time",
950
+ required: false,
951
+ },
952
+ difficulty: {
953
+ type: "enumeration",
954
+ enum: [
955
+ "beginner",
956
+ "easy",
957
+ "moderate",
958
+ "hard",
959
+ "superstar",
960
+ "dead mode",
961
+ ],
962
+ },
963
+ author_name: {
964
+ type: "string",
965
+ },
966
+ ingredients: {
967
+ type: "component",
968
+ repeatable: true,
969
+ component: "food.recipe-ingredient",
970
+ },
827
971
  },
828
- __filename__: "ingredient-variants.json",
972
+ __filename__: "cookbook-item.json",
829
973
  },
830
- uid: "food.ingredient-variants",
974
+ uid: "food.cookbook-item",
831
975
  category: "food",
832
976
  modelType: "component",
833
- modelName: "ingredient-variants",
834
- globalId: "ComponentFoodIngredientVariants",
835
- singularName: "ingredient-variants",
836
- tableName: "components_food_ingredient_variants",
977
+ modelName: "cookbook-item",
978
+ globalId: "ComponentFoodCookbookItem",
979
+ singularName: "cookbook-item",
980
+ tableName: "components_food_cookbook_items",
837
981
  },
838
982
  {
839
- collectionName: "components_food_ingredients",
983
+ collectionName: "components_food_gallery_items",
840
984
  info: {
841
- displayName: "ingredients",
842
- icon: "atom",
843
- description: "",
985
+ displayName: "Gallery Item",
986
+ icon: "photo-video",
987
+ },
988
+ options: {
844
989
  },
845
- options: {},
846
990
  attributes: {
847
- name: {
991
+ image_title: {
848
992
  type: "string",
849
993
  },
850
- pcs: {
851
- type: "integer",
994
+ image_description: {
995
+ type: "text",
852
996
  },
853
- required: {
854
- type: "boolean",
997
+ image: {
998
+ type: "relation",
999
+ relation: "morphOne",
1000
+ target: "plugin::upload.file",
1001
+ morphBy: "related",
855
1002
  },
856
1003
  },
857
- __filename__: "ingredients.json",
1004
+ __filename__: "gallery-item.json",
858
1005
  __schema__: {
859
- collectionName: "components_food_ingredients",
1006
+ collectionName: "components_food_gallery_items",
860
1007
  info: {
861
- displayName: "ingredients",
862
- icon: "atom",
863
- description: "",
1008
+ displayName: "Gallery Item",
1009
+ icon: "photo-video",
1010
+ },
1011
+ options: {
864
1012
  },
865
- options: {},
866
1013
  attributes: {
867
- name: {
1014
+ image_title: {
868
1015
  type: "string",
869
1016
  },
870
- pcs: {
871
- type: "integer",
1017
+ image_description: {
1018
+ type: "text",
872
1019
  },
873
- required: {
874
- type: "boolean",
1020
+ image: {
1021
+ allowedTypes: [
1022
+ "images",
1023
+ "files",
1024
+ "videos",
1025
+ "audios",
1026
+ ],
1027
+ type: "media",
1028
+ multiple: false,
875
1029
  },
876
1030
  },
877
- __filename__: "ingredients.json",
1031
+ __filename__: "gallery-item.json",
878
1032
  },
879
- uid: "food.ingredients",
1033
+ uid: "food.gallery-item",
880
1034
  category: "food",
881
1035
  modelType: "component",
882
- modelName: "ingredients",
883
- globalId: "ComponentFoodIngredients",
884
- singularName: "ingredients",
885
- tableName: "components_food_ingredients",
1036
+ modelName: "gallery-item",
1037
+ globalId: "ComponentFoodGalleryItem",
1038
+ singularName: "gallery-item",
1039
+ tableName: "components_food_gallery_items",
886
1040
  },
887
1041
  {
888
- collectionName: "components_food_pub_component_1s",
1042
+ collectionName: "components_food_galleries",
889
1043
  info: {
890
- displayName: "Pub Component 1",
891
- icon: "american-sign-language-interpreting",
1044
+ displayName: "Gallery",
1045
+ icon: "photo-video",
892
1046
  description: "",
893
1047
  },
894
- options: {},
1048
+ options: {
1049
+ },
895
1050
  attributes: {
896
- rich_description: {
897
- type: "richtext",
1051
+ main_image: {
1052
+ type: "component",
1053
+ repeatable: false,
1054
+ component: "food.gallery-item",
898
1055
  },
899
- history: {
900
- type: "text",
1056
+ gallery: {
1057
+ type: "component",
1058
+ repeatable: true,
1059
+ component: "food.gallery-item",
901
1060
  },
902
- excerpt: {
1061
+ optional_title: {
903
1062
  type: "string",
904
1063
  },
905
- test_variants: {
906
- type: "component",
907
- repeatable: false,
908
- component: "food.ingredient-variants",
1064
+ annotation: {
1065
+ type: "richtext",
909
1066
  },
910
1067
  },
911
- __filename__: "pub-component-1.json",
1068
+ __filename__: "gallery.json",
912
1069
  __schema__: {
913
- collectionName: "components_food_pub_component_1s",
1070
+ collectionName: "components_food_galleries",
914
1071
  info: {
915
- displayName: "Pub Component 1",
916
- icon: "american-sign-language-interpreting",
1072
+ displayName: "Gallery",
1073
+ icon: "photo-video",
917
1074
  description: "",
918
1075
  },
919
- options: {},
1076
+ options: {
1077
+ },
920
1078
  attributes: {
921
- rich_description: {
922
- type: "richtext",
1079
+ main_image: {
1080
+ type: "component",
1081
+ repeatable: false,
1082
+ component: "food.gallery-item",
923
1083
  },
924
- history: {
925
- type: "text",
1084
+ gallery: {
1085
+ type: "component",
1086
+ repeatable: true,
1087
+ component: "food.gallery-item",
926
1088
  },
927
- excerpt: {
1089
+ optional_title: {
928
1090
  type: "string",
929
1091
  },
930
- test_variants: {
931
- type: "component",
932
- repeatable: false,
933
- component: "food.ingredient-variants",
1092
+ annotation: {
1093
+ type: "richtext",
934
1094
  },
935
1095
  },
936
- __filename__: "pub-component-1.json",
1096
+ __filename__: "gallery.json",
937
1097
  },
938
- uid: "food.pub-component-1",
1098
+ uid: "food.gallery",
939
1099
  category: "food",
940
1100
  modelType: "component",
941
- modelName: "pub-component-1",
942
- globalId: "ComponentFoodPubComponent1",
943
- singularName: "pub-component-1",
944
- tableName: "components_food_pub_component_1s",
1101
+ modelName: "gallery",
1102
+ globalId: "ComponentFoodGallery",
1103
+ singularName: "gallery",
1104
+ tableName: "components_food_galleries",
945
1105
  },
946
1106
  {
947
- collectionName: "components_food_recipes",
1107
+ collectionName: "components_food_recipe_ingredients",
948
1108
  info: {
949
- displayName: "recipe",
950
- icon: "ad",
951
- description: "",
1109
+ displayName: "Recipe Ingredient",
1110
+ icon: "apple-alt",
1111
+ },
1112
+ options: {
952
1113
  },
953
- options: {},
954
1114
  attributes: {
955
1115
  name: {
956
1116
  type: "string",
957
1117
  },
958
- ingredients: {
959
- type: "component",
960
- repeatable: true,
961
- component: "food.ingredients",
1118
+ amount: {
1119
+ type: "decimal",
962
1120
  },
963
- variants: {
964
- type: "component",
965
- repeatable: false,
966
- component: "food.ingredient-variants",
1121
+ unit: {
1122
+ type: "string",
1123
+ },
1124
+ is_required: {
1125
+ type: "boolean",
1126
+ default: true,
1127
+ required: false,
967
1128
  },
968
1129
  },
969
- __filename__: "recipe.json",
1130
+ __filename__: "recipe-ingredient.json",
970
1131
  __schema__: {
971
- collectionName: "components_food_recipes",
1132
+ collectionName: "components_food_recipe_ingredients",
972
1133
  info: {
973
- displayName: "recipe",
974
- icon: "ad",
975
- description: "",
1134
+ displayName: "Recipe Ingredient",
1135
+ icon: "apple-alt",
1136
+ },
1137
+ options: {
976
1138
  },
977
- options: {},
978
1139
  attributes: {
979
1140
  name: {
980
1141
  type: "string",
981
1142
  },
982
- ingredients: {
983
- type: "component",
984
- repeatable: true,
985
- component: "food.ingredients",
1143
+ amount: {
1144
+ type: "decimal",
986
1145
  },
987
- variants: {
988
- type: "component",
989
- repeatable: false,
990
- component: "food.ingredient-variants",
1146
+ unit: {
1147
+ type: "string",
1148
+ },
1149
+ is_required: {
1150
+ type: "boolean",
1151
+ default: true,
1152
+ required: false,
991
1153
  },
992
1154
  },
993
- __filename__: "recipe.json",
1155
+ __filename__: "recipe-ingredient.json",
994
1156
  },
995
- uid: "food.recipe",
1157
+ uid: "food.recipe-ingredient",
996
1158
  category: "food",
997
1159
  modelType: "component",
998
- modelName: "recipe",
999
- globalId: "ComponentFoodRecipe",
1000
- singularName: "recipe",
1001
- tableName: "components_food_recipes",
1160
+ modelName: "recipe-ingredient",
1161
+ globalId: "ComponentFoodRecipeIngredient",
1162
+ singularName: "recipe-ingredient",
1163
+ tableName: "components_food_recipe_ingredients",
1002
1164
  },
1003
1165
  {
1004
- collectionName: "components_seo_galleries",
1166
+ collectionName: "components_restaurant_menu_items",
1005
1167
  info: {
1006
- displayName: "Gallery",
1007
- icon: "address-card",
1168
+ displayName: "Menu Item",
1169
+ icon: "hotdog",
1008
1170
  description: "",
1009
1171
  },
1010
- options: {},
1172
+ options: {
1173
+ },
1011
1174
  attributes: {
1012
- main_image: {
1013
- type: "relation",
1014
- relation: "morphOne",
1015
- target: "plugin::upload.file",
1016
- morphBy: "related",
1175
+ name: {
1176
+ type: "string",
1177
+ },
1178
+ price: {
1179
+ type: "decimal",
1180
+ },
1181
+ currency: {
1182
+ type: "string",
1183
+ },
1184
+ description: {
1185
+ type: "richtext",
1017
1186
  },
1018
- rest: {
1187
+ is_available: {
1188
+ type: "boolean",
1189
+ },
1190
+ food_gallery: {
1019
1191
  type: "relation",
1020
1192
  relation: "morphMany",
1021
1193
  target: "plugin::upload.file",
1022
1194
  morphBy: "related",
1023
1195
  },
1024
- seo_desc: {
1025
- type: "string",
1026
- },
1027
1196
  },
1028
- __filename__: "gallery.json",
1197
+ __filename__: "menu-item.json",
1029
1198
  __schema__: {
1030
- collectionName: "components_seo_galleries",
1199
+ collectionName: "components_restaurant_menu_items",
1031
1200
  info: {
1032
- displayName: "Gallery",
1033
- icon: "address-card",
1201
+ displayName: "Menu Item",
1202
+ icon: "hotdog",
1034
1203
  description: "",
1035
1204
  },
1036
- options: {},
1205
+ options: {
1206
+ },
1037
1207
  attributes: {
1038
- main_image: {
1039
- type: "media",
1040
- multiple: false,
1041
- required: false,
1042
- allowedTypes: ["images", "files", "videos", "audios"],
1208
+ name: {
1209
+ type: "string",
1043
1210
  },
1044
- rest: {
1045
- type: "media",
1046
- multiple: true,
1047
- required: false,
1048
- allowedTypes: ["images", "videos", "audios", "files"],
1211
+ price: {
1212
+ type: "decimal",
1049
1213
  },
1050
- seo_desc: {
1214
+ currency: {
1051
1215
  type: "string",
1052
1216
  },
1217
+ description: {
1218
+ type: "richtext",
1219
+ },
1220
+ is_available: {
1221
+ type: "boolean",
1222
+ },
1223
+ food_gallery: {
1224
+ allowedTypes: [
1225
+ "images",
1226
+ ],
1227
+ type: "media",
1228
+ multiple: true,
1229
+ },
1053
1230
  },
1054
- __filename__: "gallery.json",
1231
+ __filename__: "menu-item.json",
1055
1232
  },
1056
- uid: "seo.gallery",
1057
- category: "seo",
1233
+ uid: "restaurant.menu-item",
1234
+ category: "restaurant",
1058
1235
  modelType: "component",
1059
- modelName: "gallery",
1060
- globalId: "ComponentSeoGallery",
1061
- singularName: "gallery",
1062
- tableName: "components_seo_galleries",
1236
+ modelName: "menu-item",
1237
+ globalId: "ComponentRestaurantMenuItem",
1238
+ singularName: "menu-item",
1239
+ tableName: "components_restaurant_menu_items",
1063
1240
  },
1064
1241
  ];