@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,152 +0,0 @@
1
- module.exports = [
2
- {
3
- id: 1,
4
- title: "Restaurant 1",
5
- description: "Restaurant 1 description",
6
- createdAt: "2022-03-10T14:45:51.764Z",
7
- updatedAt: "2022-04-07T18:34:34.132Z",
8
- publishedAt: "2022-03-23T11:57:05.812Z",
9
- locale: "en",
10
- street: null,
11
- city: null,
12
- country: null,
13
- recipes: [
14
- {
15
- id: 1,
16
- name: null,
17
- ingredients: [
18
- {
19
- id: 1,
20
- name: null,
21
- pcs: null,
22
- required: null,
23
- },
24
- ],
25
- variants: {
26
- id: 1,
27
- name: null,
28
- },
29
- },
30
- ],
31
- descs: {
32
- id: 1,
33
- rich_description: "restaurant 1 rich_desc",
34
- history: null,
35
- excerpt: null,
36
- test_variants: {
37
- id: 2,
38
- name: null,
39
- },
40
- },
41
- },
42
- {
43
- id: 2,
44
- title: "Restaurant 2",
45
- description: "Restaurant 2 description",
46
- createdAt: "2022-03-14T10:35:27.187Z",
47
- updatedAt: "2022-04-07T18:34:34.154Z",
48
- publishedAt: "2022-03-24T13:32:31.066Z",
49
- locale: "en",
50
- street: null,
51
- city: null,
52
- country: null,
53
- recipes: [],
54
- descs: null,
55
- },
56
- {
57
- id: 3,
58
- title: "Full Restaurant",
59
- description: "With some great description",
60
- createdAt: "2022-03-24T13:17:22.161Z",
61
- updatedAt: "2022-04-07T18:34:34.168Z",
62
- publishedAt: "2022-03-24T13:37:31.870Z",
63
- locale: "en",
64
- street: "Testowa",
65
- city: "Testow",
66
- country: "Test Rep.",
67
- recipes: [
68
- {
69
- id: 3,
70
- name: "Tomato Soup",
71
- ingredients: [
72
- {
73
- id: 2,
74
- name: "Tomato",
75
- pcs: 4,
76
- required: false,
77
- },
78
- {
79
- id: 3,
80
- name: "Soup",
81
- pcs: 1,
82
- required: true,
83
- },
84
- ],
85
- variants: {
86
- id: 4,
87
- name: "Red, yellow, green",
88
- },
89
- },
90
- {
91
- id: 2,
92
- name: "Beef Broth",
93
- ingredients: [
94
- {
95
- id: 4,
96
- name: "Beef",
97
- pcs: 1,
98
- required: true,
99
- },
100
- {
101
- id: 5,
102
- name: "Water",
103
- pcs: 2,
104
- required: true,
105
- },
106
- ],
107
- variants: null,
108
- },
109
- {
110
- id: 4,
111
- name: "Goulash",
112
- ingredients: [
113
- {
114
- id: 6,
115
- name: "Beef meat",
116
- pcs: 1,
117
- required: true,
118
- },
119
- {
120
- id: 7,
121
- name: "Pepper",
122
- pcs: 4,
123
- required: null,
124
- },
125
- {
126
- id: 8,
127
- name: "Pepper spices",
128
- pcs: 1,
129
- required: true,
130
- },
131
- {
132
- id: 9,
133
- name: "Water",
134
- pcs: 1,
135
- required: null,
136
- },
137
- ],
138
- variants: null,
139
- },
140
- ],
141
- descs: {
142
- id: 3,
143
- rich_description: "Another restaurant desc",
144
- history: "Est. 2022, based in NY, NY",
145
- excerpt: "Est. 2022",
146
- test_variants: {
147
- id: 5,
148
- name: "no such thing...",
149
- },
150
- },
151
- },
152
- ];
@@ -1,31 +0,0 @@
1
- module.exports = {
2
- id: 29,
3
- Title: "Kniha s obálkou 2",
4
- Author: null,
5
- Pages: null,
6
- non_localizable_name: "Non localizable book for kids",
7
- additional_info: {
8
- id: 38,
9
- rich_description: "RD",
10
- history: "H",
11
- excerpt: "E",
12
- test_variants: {
13
- id: 38,
14
- name: "Nejsou k dispozici žádné varianty",
15
- },
16
- },
17
- seo_setup: [
18
- {
19
- id: 21,
20
- seo_desc: "nastavení 1",
21
- main_image: null,
22
- rest: null,
23
- },
24
- {
25
- id: 22,
26
- seo_desc: "nastavení 2",
27
- main_image: null,
28
- rest: null,
29
- },
30
- ],
31
- };
@@ -1,3 +0,0 @@
1
- module.exports =
2
- // eslint-disable-next-line quotes
3
- '{"Title":"Moje první dětská kniha","additional_info":[null,null,{"rich_description":"# H1\\n## H2\\n#### H4\\n\\n** Jedna** _dva_ <u>tři</u>... a možná ještě více pohádek...","history":"Není tu žádný...","excerpt":"Krátký výňatek","test_variants":[null,null,null,{"name":"toto je finální verze"}]}]}';
@@ -1,3 +0,0 @@
1
- module.exports =
2
- // eslint-disable-next-line quotes
3
- '{"seo_setup":[null,{"seo_desc":"nastavení 1"},{"seo_desc":"nastavení 2"}],"Title":"Kniha s obálkou 2","additional_info":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,{"rich_description":"RD","history":"H 2","excerpt":"E","test_variants":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,{"name":"Nejsou k dispozici žádné varianty, proč?"}]}]}';
@@ -1,3 +0,0 @@
1
- module.exports =
2
- // eslint-disable-next-line quotes
3
- '{"title":"Plná restaurace","description":"S nějakým skvělým popisem","recipes":[null,null,{"name":"Hovězí vývar","ingredients":[null,null,null,null,{"name":"Hovězí"},{"name":"Voda"}]},{"name":"Rajčatová polévka","ingredients":[null,null,{"name":"rajče"},{"name":"Polévka"}],"variants":[null,null,null,null,{"name":"Červená, žlutá, zelená"}]},{"name":"Guláš","ingredients":[null,null,null,null,null,null,{"name":"Hovězí maso"},{"name":"Pepř"},{"name":"pepř, koření"},{"name":"Voda"}]}],"descs":[null,null,null,{"rich_description":"Další restaurace desc","history":"Est. 2022, se sídlem v NY, NY","excerpt":"Est. 2022","test_variants":[null,null,null,null,null,{"name":"nic takového..."}]}]}';
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- module.exports =
4
- // eslint-disable-next-line quotes
5
- '{"title":"Volles Restaurant","description":"Mit einer großartigen Beschreibung","recipes":[null,null,{"name":"Rinderbrühe","ingredients":[null,null,null,null,{"name":"Rindfleisch"},{"name":"Wasser"}]},{"name":"Tomatensuppe","ingredients":[null,null,{"name":"Tomate"},{"name":"Suppe"}],"variants":[null,null,null,null,{"name":"Rot, gelb, grün"}]},{"name":"Gulasch","ingredients":[null,null,null,null,null,null,{"name":"Rindfleisch"},{"name":"Pfeffer"},{"name":"Pfeffer-Gewürze"},{"name":"Wasser"}]}],"descs":[null,null,null,{"rich_description":"Ein weiteres Restaurant desc","history":"Est. 2022, mit Sitz in NY, NY","excerpt":"Est. 2022","test_variants":[null,null,null,null,null,{"name":"so etwas nicht..."}]}]}';