@localazy/strapi-plugin 0.1.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 (150) hide show
  1. package/.babelrc +7 -0
  2. package/.eslintrc +7 -0
  3. package/.github/workflows/.build.yml +39 -0
  4. package/.nvmrc +1 -0
  5. package/LICENSE +21 -0
  6. package/README.md +40 -0
  7. package/admin/src/.eslintrc +3 -0
  8. package/admin/src/components/Initializer/index.js +26 -0
  9. package/admin/src/components/PluginIcon/index.js +14 -0
  10. package/admin/src/i18n.js +37 -0
  11. package/admin/src/index.js +106 -0
  12. package/admin/src/modules/@common/components/Icons/Localazy/index.js +12 -0
  13. package/admin/src/modules/@common/components/SideNav/index.js +46 -0
  14. package/admin/src/modules/@common/components/TransferReport/index.js +54 -0
  15. package/admin/src/modules/@common/locale/en.js +13 -0
  16. package/admin/src/modules/@common/services/i18n-service.js +15 -0
  17. package/admin/src/modules/@common/services/project-service.js +15 -0
  18. package/admin/src/modules/@common/services/user-service.js +38 -0
  19. package/admin/src/modules/@common/utils/are-locales-compatible.js +42 -0
  20. package/admin/src/modules/@common/utils/functions/flatten-deep.js +23 -0
  21. package/admin/src/modules/@common/utils/get-default-locale.js +32 -0
  22. package/admin/src/modules/@common/utils/get-header-subtitle.js +21 -0
  23. package/admin/src/modules/@common/utils/get-header-title.js +24 -0
  24. package/admin/src/modules/@common/utils/get-nav.js +35 -0
  25. package/admin/src/modules/@common/utils/history.js +6 -0
  26. package/admin/src/modules/@common/utils/is-plugin-route.js +15 -0
  27. package/admin/src/modules/@common/utils/iso-locales-utils.js +15 -0
  28. package/admin/src/modules/@common/utils/redirect-to-plugin-route.js +22 -0
  29. package/admin/src/modules/@common/utils/sort-by-model-name.js +10 -0
  30. package/admin/src/modules/localazy-download/locale/en.js +20 -0
  31. package/admin/src/modules/localazy-download/services/localazy-download-service.js +16 -0
  32. package/admin/src/modules/localazy-upload/components/ReadDocsButton.js +21 -0
  33. package/admin/src/modules/localazy-upload/locale/en.js +18 -0
  34. package/admin/src/modules/localazy-upload/services/localazy-upload-service.js +16 -0
  35. package/admin/src/modules/login/components/LoginButton/index.js +56 -0
  36. package/admin/src/modules/login/components/LogoutButton/index.js +50 -0
  37. package/admin/src/modules/login/locale/en.js +7 -0
  38. package/admin/src/modules/login/services/localazy-login-service.js +29 -0
  39. package/admin/src/modules/plugin-settings/components/ContentTransferSetup/index.js +292 -0
  40. package/admin/src/modules/plugin-settings/components/Tree/index.js +120 -0
  41. package/admin/src/modules/plugin-settings/components/TreeItem/index.js +48 -0
  42. package/admin/src/modules/plugin-settings/functions/build-content-transfer-setup-schema.js +71 -0
  43. package/admin/src/modules/plugin-settings/functions/has-model-changed.js +85 -0
  44. package/admin/src/modules/plugin-settings/locale/en.js +19 -0
  45. package/admin/src/modules/plugin-settings/services/plugin-settings-service.js +32 -0
  46. package/admin/src/modules/plugin-settings/services/strapi-model-service.js +26 -0
  47. package/admin/src/modules/plugin-settings/utils/__tests__/get-models-tree.test.js +135 -0
  48. package/admin/src/modules/plugin-settings/utils/array-of-models-to-object.js +6 -0
  49. package/admin/src/modules/plugin-settings/utils/find-model-value-by-key.js +8 -0
  50. package/admin/src/modules/plugin-settings/utils/get-filtered-models-schemas.js +34 -0
  51. package/admin/src/modules/plugin-settings/utils/get-models-tree.js +73 -0
  52. package/admin/src/modules/settings/components/OverviewItem/index.js +44 -0
  53. package/admin/src/modules/settings/components/OverviewItemLink/index.js +34 -0
  54. package/admin/src/modules/settings/components/PrerequisitiesInfo/index.js +30 -0
  55. package/admin/src/modules/settings/locale/en.js +13 -0
  56. package/admin/src/modules/user/model/localazy-identity.js +14 -0
  57. package/admin/src/modules/user/services/localazy-user-service.js +38 -0
  58. package/admin/src/pages/App/index.js +152 -0
  59. package/admin/src/pages/Download/index.js +179 -0
  60. package/admin/src/pages/Index/index.js +8 -0
  61. package/admin/src/pages/Login/index.js +94 -0
  62. package/admin/src/pages/PluginSettings/index.js +42 -0
  63. package/admin/src/pages/Settings/index.js +120 -0
  64. package/admin/src/pages/Upload/index.js +187 -0
  65. package/admin/src/pluginId.js +5 -0
  66. package/admin/src/plugins/apolloClient.js +33 -0
  67. package/admin/src/state/localazy-identity.js +29 -0
  68. package/admin/src/tests/fixtures/all-models.js +877 -0
  69. package/admin/src/tests/fixtures/restaurant-model.js +230 -0
  70. package/admin/src/translations/en.json +4 -0
  71. package/admin/src/translations/fr.json +1 -0
  72. package/admin/src/utils/createAxiosInstance.js +52 -0
  73. package/admin/src/utils/getTrad.js +5 -0
  74. package/jest.config.js +0 -0
  75. package/package.json +60 -0
  76. package/server/bootstrap.js +5 -0
  77. package/server/config/development/index.js +15 -0
  78. package/server/config/example/index.js +15 -0
  79. package/server/config/index.js +15 -0
  80. package/server/config/production/index.js +16 -0
  81. package/server/config/schema.graphql.js +21 -0
  82. package/server/content-types/index.js +3 -0
  83. package/server/controllers/index.js +19 -0
  84. package/server/controllers/localazy-auth-controller.js +46 -0
  85. package/server/controllers/localazy-project-controller.js +21 -0
  86. package/server/controllers/localazy-transfer-controller.js +469 -0
  87. package/server/controllers/localazy-user-controller.js +24 -0
  88. package/server/controllers/my-controller.js +10 -0
  89. package/server/controllers/plugin-settings-controller.js +17 -0
  90. package/server/controllers/strapi-controller.js +16 -0
  91. package/server/db/model/content-transfer-setup.js +13 -0
  92. package/server/db/model/localazy-user.js +23 -0
  93. package/server/db/model/utils/get-strapi-store.js +9 -0
  94. package/server/destroy.js +5 -0
  95. package/server/index.js +25 -0
  96. package/server/middlewares/index.js +3 -0
  97. package/server/policies/index.js +3 -0
  98. package/server/register.js +5 -0
  99. package/server/routes/index.js +26 -0
  100. package/server/routes/localazy-auth.js +22 -0
  101. package/server/routes/localazy-project.js +14 -0
  102. package/server/routes/localazy-transfer.js +22 -0
  103. package/server/routes/localazy-user.js +30 -0
  104. package/server/routes/plugin-settings.js +22 -0
  105. package/server/routes/strapi.js +22 -0
  106. package/server/services/index.js +21 -0
  107. package/server/services/localazy-auth-service.js +38 -0
  108. package/server/services/localazy-download-service.js +54 -0
  109. package/server/services/localazy-pubapi-service.js +47 -0
  110. package/server/services/localazy-upload-service.js +95 -0
  111. package/server/services/localazy-user-service.js +29 -0
  112. package/server/services/plugin-settings-service.js +30 -0
  113. package/server/services/strapi-i18n-service.js +132 -0
  114. package/server/services/strapi-service.js +23 -0
  115. package/server/tests/fixtures/all-models-with-multimedia.js +1064 -0
  116. package/server/tests/fixtures/all-models.js +869 -0
  117. package/server/tests/fixtures/collection-flattened.js +76 -0
  118. package/server/tests/fixtures/restaurant-flattened.js +46 -0
  119. package/server/tests/fixtures/restaurant-model.js +230 -0
  120. package/server/tests/fixtures/restaurants-entries.js +152 -0
  121. package/server/tests/fixtures/restaurants-pick-paths.js +15 -0
  122. package/server/tests/fixtures/strapi-book-with-multimedia-components-cs.js +31 -0
  123. package/server/tests/fixtures/stringified-book-cs.js +3 -0
  124. package/server/tests/fixtures/stringified-book-with-multimedia-components-cs.js +3 -0
  125. package/server/tests/fixtures/stringified-restaurant-cs.js +3 -0
  126. package/server/tests/fixtures/stringified-restaurant-de.js +5 -0
  127. package/server/utils/__tests__/build-populate.test.js +85 -0
  128. package/server/utils/__tests__/flatten-object.test.js +171 -0
  129. package/server/utils/__tests__/get-models-tree.test.js +170 -0
  130. package/server/utils/__tests__/parsed-localazy-entry-to-create-entry.test.js +153 -0
  131. package/server/utils/__tests__/parsed-localazy-entry-to-update-entry.test.js +172 -0
  132. package/server/utils/__tests__/pick-entries.test.js +83 -0
  133. package/server/utils/build-populate.js +43 -0
  134. package/server/utils/delay.js +6 -0
  135. package/server/utils/flatten-object.js +52 -0
  136. package/server/utils/get-localazy-api.js +22 -0
  137. package/server/utils/get-main-keys-of-nested-array-objects.js +5 -0
  138. package/server/utils/get-models-tree.js +43 -0
  139. package/server/utils/intl-display-name.js +7 -0
  140. package/server/utils/is-generally-applicable-content-type.js +33 -0
  141. package/server/utils/is-localazy-applicable-content-type.js +36 -0
  142. package/server/utils/iso-locales-utils.js +22 -0
  143. package/server/utils/objectivise-entry.js +41 -0
  144. package/server/utils/omit-deep.js +17 -0
  145. package/server/utils/parsed-localazy-entry-to-create-entry.js +115 -0
  146. package/server/utils/parsed-localazy-entry-to-update-entry.js +31 -0
  147. package/server/utils/pick-entries.js +14 -0
  148. package/server/utils/transfer-setup-utils.js +39 -0
  149. package/strapi-admin.js +14 -0
  150. package/strapi-server.js +5 -0
@@ -0,0 +1,1064 @@
1
+ "use strict";
2
+
3
+ module.exports = [
4
+ {
5
+ kind: "singleType",
6
+ collectionName: "tokens",
7
+ info: {
8
+ singularName: "token",
9
+ pluralName: "tokens",
10
+ displayName: "Token",
11
+ },
12
+ options: {
13
+ draftAndPublish: false,
14
+ },
15
+ pluginOptions: {},
16
+ attributes: {
17
+ access_token: {
18
+ type: "string",
19
+ },
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,
45
+ },
46
+ },
47
+ __schema__: {
48
+ collectionName: "tokens",
49
+ info: {
50
+ singularName: "token",
51
+ pluralName: "tokens",
52
+ displayName: "Token",
53
+ },
54
+ options: {
55
+ draftAndPublish: false,
56
+ },
57
+ pluginOptions: {},
58
+ attributes: {
59
+ access_token: {
60
+ type: "string",
61
+ },
62
+ },
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",
91
+ },
92
+ createdAt: {
93
+ type: "datetime",
94
+ },
95
+ updatedAt: {
96
+ type: "datetime",
97
+ },
98
+ publishedAt: {
99
+ type: "datetime",
100
+ configurable: false,
101
+ writable: true,
102
+ visible: false,
103
+ },
104
+ createdBy: {
105
+ type: "relation",
106
+ relation: "oneToOne",
107
+ target: "admin::user",
108
+ configurable: false,
109
+ writable: false,
110
+ visible: false,
111
+ useJoinTable: false,
112
+ private: true,
113
+ },
114
+ updatedBy: {
115
+ type: "relation",
116
+ relation: "oneToOne",
117
+ target: "admin::user",
118
+ configurable: false,
119
+ writable: false,
120
+ visible: false,
121
+ useJoinTable: false,
122
+ private: true,
123
+ },
124
+ },
125
+ __schema__: {
126
+ collectionName: "testtokens",
127
+ info: {
128
+ singularName: "testtoken",
129
+ pluralName: "testtokens",
130
+ displayName: "testtoken",
131
+ },
132
+ options: {
133
+ draftAndPublish: true,
134
+ comment: "",
135
+ },
136
+ attributes: {
137
+ at: {
138
+ type: "string",
139
+ },
140
+ },
141
+ kind: "singleType",
142
+ },
143
+ modelType: "contentType",
144
+ modelName: "testtoken",
145
+ 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",
153
+ },
154
+ {
155
+ collectionName: "up_users",
156
+ info: {
157
+ name: "user",
158
+ description: "",
159
+ singularName: "user",
160
+ pluralName: "users",
161
+ displayName: "User",
162
+ },
163
+ options: {
164
+ draftAndPublish: false,
165
+ timestamps: true,
166
+ },
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,
180
+ },
181
+ provider: {
182
+ type: "string",
183
+ configurable: false,
184
+ },
185
+ password: {
186
+ type: "password",
187
+ minLength: 6,
188
+ configurable: false,
189
+ private: true,
190
+ },
191
+ resetPasswordToken: {
192
+ type: "string",
193
+ configurable: false,
194
+ private: true,
195
+ },
196
+ confirmationToken: {
197
+ type: "string",
198
+ configurable: false,
199
+ private: true,
200
+ },
201
+ confirmed: {
202
+ type: "boolean",
203
+ default: false,
204
+ configurable: false,
205
+ },
206
+ blocked: {
207
+ type: "boolean",
208
+ default: false,
209
+ configurable: false,
210
+ },
211
+ role: {
212
+ type: "relation",
213
+ relation: "manyToOne",
214
+ target: "plugin::users-permissions.role",
215
+ inversedBy: "users",
216
+ configurable: false,
217
+ },
218
+ createdAt: {
219
+ type: "datetime",
220
+ },
221
+ updatedAt: {
222
+ type: "datetime",
223
+ },
224
+ createdBy: {
225
+ type: "relation",
226
+ relation: "oneToOne",
227
+ target: "admin::user",
228
+ configurable: false,
229
+ writable: false,
230
+ visible: false,
231
+ useJoinTable: false,
232
+ private: true,
233
+ },
234
+ updatedBy: {
235
+ type: "relation",
236
+ relation: "oneToOne",
237
+ target: "admin::user",
238
+ configurable: false,
239
+ writable: false,
240
+ visible: false,
241
+ useJoinTable: false,
242
+ private: true,
243
+ },
244
+ },
245
+ config: {
246
+ attributes: {
247
+ resetPasswordToken: {
248
+ hidden: true,
249
+ },
250
+ confirmationToken: {
251
+ hidden: true,
252
+ },
253
+ provider: {
254
+ hidden: true,
255
+ },
256
+ },
257
+ },
258
+ kind: "collectionType",
259
+ __schema__: {
260
+ collectionName: "up_users",
261
+ info: {
262
+ name: "user",
263
+ description: "",
264
+ singularName: "user",
265
+ pluralName: "users",
266
+ displayName: "User",
267
+ },
268
+ options: {
269
+ draftAndPublish: false,
270
+ timestamps: true,
271
+ },
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,
285
+ },
286
+ provider: {
287
+ type: "string",
288
+ configurable: false,
289
+ },
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,
300
+ },
301
+ confirmationToken: {
302
+ type: "string",
303
+ configurable: false,
304
+ private: true,
305
+ },
306
+ confirmed: {
307
+ type: "boolean",
308
+ default: false,
309
+ configurable: false,
310
+ },
311
+ blocked: {
312
+ type: "boolean",
313
+ default: false,
314
+ configurable: false,
315
+ },
316
+ role: {
317
+ type: "relation",
318
+ relation: "manyToOne",
319
+ target: "plugin::users-permissions.role",
320
+ inversedBy: "users",
321
+ configurable: false,
322
+ },
323
+ },
324
+ kind: "collectionType",
325
+ },
326
+ modelType: "contentType",
327
+ modelName: "user",
328
+ 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",
336
+ },
337
+ {
338
+ kind: "collectionType",
339
+ collectionName: "books",
340
+ info: {
341
+ singularName: "book",
342
+ pluralName: "books",
343
+ displayName: "Book",
344
+ description: "",
345
+ },
346
+ options: {
347
+ draftAndPublish: true,
348
+ },
349
+ pluginOptions: {
350
+ i18n: {
351
+ localized: true,
352
+ },
353
+ },
354
+ attributes: {
355
+ Title: {
356
+ type: "string",
357
+ pluginOptions: {
358
+ i18n: {
359
+ localized: true,
360
+ },
361
+ },
362
+ },
363
+ Author: {
364
+ type: "string",
365
+ pluginOptions: {
366
+ i18n: {
367
+ localized: true,
368
+ },
369
+ },
370
+ },
371
+ Pages: {
372
+ type: "integer",
373
+ pluginOptions: {
374
+ i18n: {
375
+ localized: true,
376
+ },
377
+ },
378
+ },
379
+ additional_info: {
380
+ type: "component",
381
+ repeatable: false,
382
+ component: "food.pub-component-1",
383
+ pluginOptions: {
384
+ i18n: {
385
+ localized: true,
386
+ },
387
+ },
388
+ },
389
+ cover: {
390
+ type: "relation",
391
+ relation: "morphOne",
392
+ target: "plugin::upload.file",
393
+ morphBy: "related",
394
+ },
395
+ presentations: {
396
+ type: "relation",
397
+ relation: "morphMany",
398
+ target: "plugin::upload.file",
399
+ morphBy: "related",
400
+ },
401
+ seo_setup: {
402
+ type: "component",
403
+ repeatable: true,
404
+ pluginOptions: {
405
+ i18n: {
406
+ localized: true,
407
+ },
408
+ },
409
+ component: "seo.gallery",
410
+ },
411
+ non_localizable_name: {
412
+ pluginOptions: {
413
+ i18n: {
414
+ localized: false,
415
+ },
416
+ },
417
+ type: "string",
418
+ },
419
+ createdAt: {
420
+ type: "datetime",
421
+ },
422
+ updatedAt: {
423
+ type: "datetime",
424
+ },
425
+ publishedAt: {
426
+ type: "datetime",
427
+ configurable: false,
428
+ writable: true,
429
+ visible: false,
430
+ },
431
+ createdBy: {
432
+ type: "relation",
433
+ relation: "oneToOne",
434
+ target: "admin::user",
435
+ configurable: false,
436
+ writable: false,
437
+ visible: false,
438
+ useJoinTable: false,
439
+ private: true,
440
+ },
441
+ updatedBy: {
442
+ type: "relation",
443
+ relation: "oneToOne",
444
+ target: "admin::user",
445
+ configurable: false,
446
+ writable: false,
447
+ visible: false,
448
+ useJoinTable: false,
449
+ private: true,
450
+ },
451
+ localizations: {
452
+ writable: true,
453
+ private: false,
454
+ configurable: false,
455
+ visible: false,
456
+ type: "relation",
457
+ relation: "oneToMany",
458
+ target: "api::book.book",
459
+ },
460
+ locale: {
461
+ writable: true,
462
+ private: false,
463
+ configurable: false,
464
+ visible: false,
465
+ type: "string",
466
+ },
467
+ },
468
+ __schema__: {
469
+ collectionName: "books",
470
+ info: {
471
+ singularName: "book",
472
+ pluralName: "books",
473
+ displayName: "Book",
474
+ description: "",
475
+ },
476
+ options: {
477
+ draftAndPublish: true,
478
+ },
479
+ pluginOptions: {
480
+ i18n: {
481
+ localized: true,
482
+ },
483
+ },
484
+ attributes: {
485
+ Title: {
486
+ type: "string",
487
+ pluginOptions: {
488
+ i18n: {
489
+ localized: true,
490
+ },
491
+ },
492
+ },
493
+ Author: {
494
+ type: "string",
495
+ pluginOptions: {
496
+ i18n: {
497
+ localized: true,
498
+ },
499
+ },
500
+ },
501
+ Pages: {
502
+ type: "integer",
503
+ pluginOptions: {
504
+ i18n: {
505
+ localized: true,
506
+ },
507
+ },
508
+ },
509
+ additional_info: {
510
+ type: "component",
511
+ repeatable: false,
512
+ component: "food.pub-component-1",
513
+ pluginOptions: {
514
+ i18n: {
515
+ localized: true,
516
+ },
517
+ },
518
+ },
519
+ cover: {
520
+ type: "media",
521
+ multiple: false,
522
+ required: false,
523
+ allowedTypes: ["images", "files", "videos", "audios"],
524
+ pluginOptions: {
525
+ i18n: {
526
+ localized: true,
527
+ },
528
+ },
529
+ },
530
+ presentations: {
531
+ type: "media",
532
+ multiple: true,
533
+ required: false,
534
+ allowedTypes: ["images", "files", "videos", "audios"],
535
+ pluginOptions: {
536
+ i18n: {
537
+ localized: true,
538
+ },
539
+ },
540
+ },
541
+ seo_setup: {
542
+ type: "component",
543
+ repeatable: true,
544
+ pluginOptions: {
545
+ i18n: {
546
+ localized: true,
547
+ },
548
+ },
549
+ component: "seo.gallery",
550
+ },
551
+ non_localizable_name: {
552
+ pluginOptions: {
553
+ i18n: {
554
+ localized: false,
555
+ },
556
+ },
557
+ type: "string",
558
+ },
559
+ },
560
+ kind: "collectionType",
561
+ },
562
+ modelType: "contentType",
563
+ modelName: "book",
564
+ connection: "default",
565
+ uid: "api::book.book",
566
+ apiName: "book",
567
+ globalId: "Book",
568
+ actions: {},
569
+ lifecycles: {},
570
+ singularName: "book",
571
+ tableName: "books",
572
+ },
573
+ {
574
+ kind: "collectionType",
575
+ collectionName: "restaurants",
576
+ info: {
577
+ singularName: "restaurant",
578
+ pluralName: "restaurants",
579
+ displayName: "Restaurant",
580
+ description: "",
581
+ },
582
+ options: {
583
+ draftAndPublish: true,
584
+ },
585
+ pluginOptions: {
586
+ i18n: {
587
+ localized: true,
588
+ },
589
+ },
590
+ 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: {
642
+ pluginOptions: {
643
+ i18n: {
644
+ localized: true,
645
+ },
646
+ },
647
+ type: "string",
648
+ },
649
+ country: {
650
+ pluginOptions: {
651
+ i18n: {
652
+ localized: true,
653
+ },
654
+ },
655
+ type: "string",
656
+ },
657
+ createdAt: {
658
+ type: "datetime",
659
+ },
660
+ updatedAt: {
661
+ type: "datetime",
662
+ },
663
+ publishedAt: {
664
+ type: "datetime",
665
+ configurable: false,
666
+ writable: true,
667
+ visible: false,
668
+ },
669
+ createdBy: {
670
+ type: "relation",
671
+ relation: "oneToOne",
672
+ target: "admin::user",
673
+ configurable: false,
674
+ writable: false,
675
+ visible: false,
676
+ useJoinTable: false,
677
+ private: true,
678
+ },
679
+ updatedBy: {
680
+ type: "relation",
681
+ relation: "oneToOne",
682
+ target: "admin::user",
683
+ configurable: false,
684
+ writable: false,
685
+ visible: false,
686
+ useJoinTable: false,
687
+ private: true,
688
+ },
689
+ localizations: {
690
+ writable: true,
691
+ private: false,
692
+ configurable: false,
693
+ visible: false,
694
+ type: "relation",
695
+ relation: "oneToMany",
696
+ target: "api::restaurant.restaurant",
697
+ },
698
+ locale: {
699
+ writable: true,
700
+ private: false,
701
+ configurable: false,
702
+ visible: false,
703
+ type: "string",
704
+ },
705
+ },
706
+ __schema__: {
707
+ collectionName: "restaurants",
708
+ info: {
709
+ singularName: "restaurant",
710
+ pluralName: "restaurants",
711
+ displayName: "Restaurant",
712
+ description: "",
713
+ },
714
+ options: {
715
+ draftAndPublish: true,
716
+ },
717
+ pluginOptions: {
718
+ i18n: {
719
+ localized: true,
720
+ },
721
+ },
722
+ attributes: {
723
+ title: {
724
+ pluginOptions: {
725
+ i18n: {
726
+ localized: true,
727
+ },
728
+ },
729
+ type: "string",
730
+ required: true,
731
+ },
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: {
782
+ pluginOptions: {
783
+ i18n: {
784
+ localized: true,
785
+ },
786
+ },
787
+ type: "string",
788
+ },
789
+ },
790
+ kind: "collectionType",
791
+ },
792
+ modelType: "contentType",
793
+ modelName: "restaurant",
794
+ connection: "default",
795
+ uid: "api::restaurant.restaurant",
796
+ apiName: "restaurant",
797
+ globalId: "Restaurant",
798
+ actions: {},
799
+ lifecycles: {},
800
+ singularName: "restaurant",
801
+ tableName: "restaurants",
802
+ },
803
+ {
804
+ collectionName: "components_food_ingredient_variants",
805
+ info: {
806
+ displayName: "ingredient_variants",
807
+ icon: "atlas",
808
+ },
809
+ options: {},
810
+ attributes: {
811
+ name: {
812
+ type: "string",
813
+ },
814
+ },
815
+ __filename__: "ingredient-variants.json",
816
+ __schema__: {
817
+ collectionName: "components_food_ingredient_variants",
818
+ info: {
819
+ displayName: "ingredient_variants",
820
+ icon: "atlas",
821
+ },
822
+ options: {},
823
+ attributes: {
824
+ name: {
825
+ type: "string",
826
+ },
827
+ },
828
+ __filename__: "ingredient-variants.json",
829
+ },
830
+ uid: "food.ingredient-variants",
831
+ category: "food",
832
+ modelType: "component",
833
+ modelName: "ingredient-variants",
834
+ globalId: "ComponentFoodIngredientVariants",
835
+ singularName: "ingredient-variants",
836
+ tableName: "components_food_ingredient_variants",
837
+ },
838
+ {
839
+ collectionName: "components_food_ingredients",
840
+ info: {
841
+ displayName: "ingredients",
842
+ icon: "atom",
843
+ description: "",
844
+ },
845
+ options: {},
846
+ attributes: {
847
+ name: {
848
+ type: "string",
849
+ },
850
+ pcs: {
851
+ type: "integer",
852
+ },
853
+ required: {
854
+ type: "boolean",
855
+ },
856
+ },
857
+ __filename__: "ingredients.json",
858
+ __schema__: {
859
+ collectionName: "components_food_ingredients",
860
+ info: {
861
+ displayName: "ingredients",
862
+ icon: "atom",
863
+ description: "",
864
+ },
865
+ options: {},
866
+ attributes: {
867
+ name: {
868
+ type: "string",
869
+ },
870
+ pcs: {
871
+ type: "integer",
872
+ },
873
+ required: {
874
+ type: "boolean",
875
+ },
876
+ },
877
+ __filename__: "ingredients.json",
878
+ },
879
+ uid: "food.ingredients",
880
+ category: "food",
881
+ modelType: "component",
882
+ modelName: "ingredients",
883
+ globalId: "ComponentFoodIngredients",
884
+ singularName: "ingredients",
885
+ tableName: "components_food_ingredients",
886
+ },
887
+ {
888
+ collectionName: "components_food_pub_component_1s",
889
+ info: {
890
+ displayName: "Pub Component 1",
891
+ icon: "american-sign-language-interpreting",
892
+ description: "",
893
+ },
894
+ options: {},
895
+ attributes: {
896
+ rich_description: {
897
+ type: "richtext",
898
+ },
899
+ history: {
900
+ type: "text",
901
+ },
902
+ excerpt: {
903
+ type: "string",
904
+ },
905
+ test_variants: {
906
+ type: "component",
907
+ repeatable: false,
908
+ component: "food.ingredient-variants",
909
+ },
910
+ },
911
+ __filename__: "pub-component-1.json",
912
+ __schema__: {
913
+ collectionName: "components_food_pub_component_1s",
914
+ info: {
915
+ displayName: "Pub Component 1",
916
+ icon: "american-sign-language-interpreting",
917
+ description: "",
918
+ },
919
+ options: {},
920
+ attributes: {
921
+ rich_description: {
922
+ type: "richtext",
923
+ },
924
+ history: {
925
+ type: "text",
926
+ },
927
+ excerpt: {
928
+ type: "string",
929
+ },
930
+ test_variants: {
931
+ type: "component",
932
+ repeatable: false,
933
+ component: "food.ingredient-variants",
934
+ },
935
+ },
936
+ __filename__: "pub-component-1.json",
937
+ },
938
+ uid: "food.pub-component-1",
939
+ category: "food",
940
+ modelType: "component",
941
+ modelName: "pub-component-1",
942
+ globalId: "ComponentFoodPubComponent1",
943
+ singularName: "pub-component-1",
944
+ tableName: "components_food_pub_component_1s",
945
+ },
946
+ {
947
+ collectionName: "components_food_recipes",
948
+ info: {
949
+ displayName: "recipe",
950
+ icon: "ad",
951
+ description: "",
952
+ },
953
+ options: {},
954
+ attributes: {
955
+ name: {
956
+ type: "string",
957
+ },
958
+ ingredients: {
959
+ type: "component",
960
+ repeatable: true,
961
+ component: "food.ingredients",
962
+ },
963
+ variants: {
964
+ type: "component",
965
+ repeatable: false,
966
+ component: "food.ingredient-variants",
967
+ },
968
+ },
969
+ __filename__: "recipe.json",
970
+ __schema__: {
971
+ collectionName: "components_food_recipes",
972
+ info: {
973
+ displayName: "recipe",
974
+ icon: "ad",
975
+ description: "",
976
+ },
977
+ options: {},
978
+ attributes: {
979
+ name: {
980
+ type: "string",
981
+ },
982
+ ingredients: {
983
+ type: "component",
984
+ repeatable: true,
985
+ component: "food.ingredients",
986
+ },
987
+ variants: {
988
+ type: "component",
989
+ repeatable: false,
990
+ component: "food.ingredient-variants",
991
+ },
992
+ },
993
+ __filename__: "recipe.json",
994
+ },
995
+ uid: "food.recipe",
996
+ category: "food",
997
+ modelType: "component",
998
+ modelName: "recipe",
999
+ globalId: "ComponentFoodRecipe",
1000
+ singularName: "recipe",
1001
+ tableName: "components_food_recipes",
1002
+ },
1003
+ {
1004
+ collectionName: "components_seo_galleries",
1005
+ info: {
1006
+ displayName: "Gallery",
1007
+ icon: "address-card",
1008
+ description: "",
1009
+ },
1010
+ options: {},
1011
+ attributes: {
1012
+ main_image: {
1013
+ type: "relation",
1014
+ relation: "morphOne",
1015
+ target: "plugin::upload.file",
1016
+ morphBy: "related",
1017
+ },
1018
+ rest: {
1019
+ type: "relation",
1020
+ relation: "morphMany",
1021
+ target: "plugin::upload.file",
1022
+ morphBy: "related",
1023
+ },
1024
+ seo_desc: {
1025
+ type: "string",
1026
+ },
1027
+ },
1028
+ __filename__: "gallery.json",
1029
+ __schema__: {
1030
+ collectionName: "components_seo_galleries",
1031
+ info: {
1032
+ displayName: "Gallery",
1033
+ icon: "address-card",
1034
+ description: "",
1035
+ },
1036
+ options: {},
1037
+ attributes: {
1038
+ main_image: {
1039
+ type: "media",
1040
+ multiple: false,
1041
+ required: false,
1042
+ allowedTypes: ["images", "files", "videos", "audios"],
1043
+ },
1044
+ rest: {
1045
+ type: "media",
1046
+ multiple: true,
1047
+ required: false,
1048
+ allowedTypes: ["images", "videos", "audios", "files"],
1049
+ },
1050
+ seo_desc: {
1051
+ type: "string",
1052
+ },
1053
+ },
1054
+ __filename__: "gallery.json",
1055
+ },
1056
+ uid: "seo.gallery",
1057
+ category: "seo",
1058
+ modelType: "component",
1059
+ modelName: "gallery",
1060
+ globalId: "ComponentSeoGallery",
1061
+ singularName: "gallery",
1062
+ tableName: "components_seo_galleries",
1063
+ },
1064
+ ];