@localazy/strapi-plugin 0.1.9 → 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.
- package/.eslintrc +6 -2
- package/.nvmrc +1 -1
- package/admin/src/modules/@common/models/supported-content-type-fields.js +8 -0
- package/admin/src/modules/plugin-settings/components/Tree/index.js +2 -0
- package/admin/src/modules/plugin-settings/utils/get-filtered-models-schemas.js +4 -4
- package/admin/src/modules/plugin-settings/utils/get-models-tree.js +3 -1
- package/package.json +1 -1
- package/server/bootstrap.js +15 -1
- package/server/controllers/localazy-transfer-controller.js +45 -47
- package/server/functions/should-set-downloaded-property.js +16 -0
- package/server/models/supported-content-type-fields.js +8 -0
- package/server/services/index.js +2 -0
- package/server/services/strapi-i18n-service.js +4 -3
- package/server/services/strapi-localazy-i18n-service.js +104 -0
- package/server/tests/fixtures/parsed-localazy-entry-to-create-entry-cookbook.js +5761 -0
- package/server/tests/fixtures/parsed-localazy-entry-to-create-entry-restaurant-simple-menu.js +536 -0
- package/server/tests/fixtures/parsed-localazy-entry-to-update-entry.js +35157 -0
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-cookbook-empty-recipes.js +202 -0
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-cookbook.js +2700 -0
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-flat-simple.js +47 -0
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-flat-with-media.js +169 -0
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-menu-empty.js +3003 -0
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-menu-with-media.js +2057 -0
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-sample-json.js +46 -0
- package/server/tests/fixtures/{all-models-with-multimedia.js → strapi-plugin-all-models.js} +717 -540
- package/server/utils/__tests__/get-models-tree.test.js +1 -1
- package/server/utils/__tests__/parsed-localazy-entry-to-create-entry.test.js +74 -107
- package/server/utils/__tests__/parsed-localazy-entry-to-update-entry.test.js +396 -133
- package/server/utils/__tests__/populate-create-update-entry-with-base-entry.test.js +852 -0
- package/server/utils/get-full-populate-object.js +56 -0
- package/server/utils/get-models-tree.js +3 -1
- package/server/utils/model-utils.js +38 -0
- package/server/utils/parsed-localazy-entry-to-create-entry.js +24 -24
- package/server/utils/parsed-localazy-entry-to-update-entry.js +43 -4
- package/server/utils/pick-entries.js +2 -1
- package/server/utils/populate-create-update-entry-with-base-entry.js +222 -0
- package/server/utils/reset-array-keys-deep.js +19 -0
- package/server/utils/transfer-setup-utils.js +14 -0
- package/server/tests/fixtures/restaurant-model.js +0 -230
- package/server/tests/fixtures/restaurants-entries.js +0 -152
- package/server/tests/fixtures/strapi-book-with-multimedia-components-cs.js +0 -31
- package/server/tests/fixtures/stringified-book-cs.js +0 -3
- package/server/tests/fixtures/stringified-book-with-multimedia-components-cs.js +0 -3
- package/server/tests/fixtures/stringified-restaurant-cs.js +0 -3
- package/server/tests/fixtures/stringified-restaurant-de.js +0 -5
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const updateEntry = {
|
|
4
|
+
id: 47,
|
|
5
|
+
name: "hlad, okno",
|
|
6
|
+
description: "Orientální pouliční jídlo v ústech rychlé a snadné!",
|
|
7
|
+
established_at: "2022-10-01",
|
|
8
|
+
is_franchise: false,
|
|
9
|
+
contact_email: "david@localazy.com",
|
|
10
|
+
cuisine: "Thai",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// filtered baseEntry
|
|
14
|
+
const baseEntry = {
|
|
15
|
+
id: 1,
|
|
16
|
+
name: "Hungry Window",
|
|
17
|
+
description: "Oriental street food in your mouth quick and easy!",
|
|
18
|
+
established_at: "2022-10-01",
|
|
19
|
+
is_franchise: false,
|
|
20
|
+
contact_email: "david@localazy.com",
|
|
21
|
+
cuisine: "Thai",
|
|
22
|
+
featured_image: null,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// filtered fullyPopulatedLocalizedEntry
|
|
26
|
+
const fullyPopulatedLocalizedEntry = {
|
|
27
|
+
id: 47,
|
|
28
|
+
name: "hlad, okno",
|
|
29
|
+
description: "Orientální pouliční jídlo v ústech rychlé a snadné!",
|
|
30
|
+
established_at: "2022-10-01",
|
|
31
|
+
is_franchise: false,
|
|
32
|
+
contact_email: "david@localazy.com",
|
|
33
|
+
cuisine: "Thai",
|
|
34
|
+
featured_image: null,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const uid = "api::restaurant-simple-flat.restaurant-simple-flat";
|
|
38
|
+
|
|
39
|
+
const locale = "cs";
|
|
40
|
+
|
|
41
|
+
module.exports = {
|
|
42
|
+
updateEntry,
|
|
43
|
+
baseEntry,
|
|
44
|
+
fullyPopulatedLocalizedEntry,
|
|
45
|
+
uid,
|
|
46
|
+
locale,
|
|
47
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const updateEntry = {
|
|
4
|
+
id: 52,
|
|
5
|
+
name: "Michelin",
|
|
6
|
+
description: "Najbardziej wyszukana restauracja w Układzie Słonecznym. Sprawdź nasze menu stworzone przez jedynego Gordona Ramsaya.",
|
|
7
|
+
established_at: "2002-06-23",
|
|
8
|
+
is_franchise: true,
|
|
9
|
+
contact_email: "david@localazy.com",
|
|
10
|
+
cuisine: "French",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// filtered baseEntry
|
|
14
|
+
const baseEntry = {
|
|
15
|
+
id: 3,
|
|
16
|
+
name: "Michelin's",
|
|
17
|
+
description: "The most fancy restaurant in the Solar System. Check out our menu created by the one and only Gordon Ramsay.",
|
|
18
|
+
established_at: "2002-06-23",
|
|
19
|
+
is_franchise: true,
|
|
20
|
+
contact_email: "david@localazy.com",
|
|
21
|
+
cuisine: "French",
|
|
22
|
+
featured_image: {
|
|
23
|
+
id: 1,
|
|
24
|
+
name: "jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
25
|
+
alternativeText: "jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
26
|
+
caption: "jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
27
|
+
width: 5596,
|
|
28
|
+
height: 3731,
|
|
29
|
+
formats: {
|
|
30
|
+
thumbnail: {
|
|
31
|
+
name: "thumbnail_jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
32
|
+
hash: "thumbnail_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b",
|
|
33
|
+
ext: ".jpg",
|
|
34
|
+
mime: "image/jpeg",
|
|
35
|
+
path: null,
|
|
36
|
+
width: 234,
|
|
37
|
+
height: 156,
|
|
38
|
+
size: 11.74,
|
|
39
|
+
url: "/uploads/thumbnail_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b.jpg",
|
|
40
|
+
},
|
|
41
|
+
large: {
|
|
42
|
+
name: "large_jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
43
|
+
hash: "large_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b",
|
|
44
|
+
ext: ".jpg",
|
|
45
|
+
mime: "image/jpeg",
|
|
46
|
+
path: null,
|
|
47
|
+
width: 1000,
|
|
48
|
+
height: 666,
|
|
49
|
+
size: 140.2,
|
|
50
|
+
url: "/uploads/large_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b.jpg",
|
|
51
|
+
},
|
|
52
|
+
medium: {
|
|
53
|
+
name: "medium_jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
54
|
+
hash: "medium_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b",
|
|
55
|
+
ext: ".jpg",
|
|
56
|
+
mime: "image/jpeg",
|
|
57
|
+
path: null,
|
|
58
|
+
width: 750,
|
|
59
|
+
height: 500,
|
|
60
|
+
size: 86.32,
|
|
61
|
+
url: "/uploads/medium_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b.jpg",
|
|
62
|
+
},
|
|
63
|
+
small: {
|
|
64
|
+
name: "small_jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
65
|
+
hash: "small_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b",
|
|
66
|
+
ext: ".jpg",
|
|
67
|
+
mime: "image/jpeg",
|
|
68
|
+
path: null,
|
|
69
|
+
width: 500,
|
|
70
|
+
height: 333,
|
|
71
|
+
size: 42.51,
|
|
72
|
+
url: "/uploads/small_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b.jpg",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
hash: "jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b",
|
|
76
|
+
ext: ".jpg",
|
|
77
|
+
mime: "image/jpeg",
|
|
78
|
+
size: 3461.64,
|
|
79
|
+
url: "/uploads/jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b.jpg",
|
|
80
|
+
previewUrl: null,
|
|
81
|
+
provider: "local",
|
|
82
|
+
provider_metadata: null,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// filtered fullyPopulatedLocalizedEntry
|
|
87
|
+
const fullyPopulatedLocalizedEntry = {
|
|
88
|
+
id: 52,
|
|
89
|
+
name: "Michelin",
|
|
90
|
+
description: "Najbardziej wyszukana restauracja w Układzie Słonecznym. Sprawdź nasze menu stworzone przez jedynego Gordona Ramsaya.",
|
|
91
|
+
established_at: "2002-06-23",
|
|
92
|
+
is_franchise: true,
|
|
93
|
+
contact_email: "david@localazy.com",
|
|
94
|
+
cuisine: "French",
|
|
95
|
+
featured_image: {
|
|
96
|
+
id: 1,
|
|
97
|
+
name: "jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
98
|
+
alternativeText: "jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
99
|
+
caption: "jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
100
|
+
width: 5596,
|
|
101
|
+
height: 3731,
|
|
102
|
+
formats: {
|
|
103
|
+
thumbnail: {
|
|
104
|
+
name: "thumbnail_jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
105
|
+
hash: "thumbnail_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b",
|
|
106
|
+
ext: ".jpg",
|
|
107
|
+
mime: "image/jpeg",
|
|
108
|
+
path: null,
|
|
109
|
+
width: 234,
|
|
110
|
+
height: 156,
|
|
111
|
+
size: 11.74,
|
|
112
|
+
url: "/uploads/thumbnail_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b.jpg",
|
|
113
|
+
},
|
|
114
|
+
large: {
|
|
115
|
+
name: "large_jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
116
|
+
hash: "large_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b",
|
|
117
|
+
ext: ".jpg",
|
|
118
|
+
mime: "image/jpeg",
|
|
119
|
+
path: null,
|
|
120
|
+
width: 1000,
|
|
121
|
+
height: 666,
|
|
122
|
+
size: 140.2,
|
|
123
|
+
url: "/uploads/large_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b.jpg",
|
|
124
|
+
},
|
|
125
|
+
medium: {
|
|
126
|
+
name: "medium_jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
127
|
+
hash: "medium_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b",
|
|
128
|
+
ext: ".jpg",
|
|
129
|
+
mime: "image/jpeg",
|
|
130
|
+
path: null,
|
|
131
|
+
width: 750,
|
|
132
|
+
height: 500,
|
|
133
|
+
size: 86.32,
|
|
134
|
+
url: "/uploads/medium_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b.jpg",
|
|
135
|
+
},
|
|
136
|
+
small: {
|
|
137
|
+
name: "small_jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
138
|
+
hash: "small_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b",
|
|
139
|
+
ext: ".jpg",
|
|
140
|
+
mime: "image/jpeg",
|
|
141
|
+
path: null,
|
|
142
|
+
width: 500,
|
|
143
|
+
height: 333,
|
|
144
|
+
size: 42.51,
|
|
145
|
+
url: "/uploads/small_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b.jpg",
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
hash: "jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b",
|
|
149
|
+
ext: ".jpg",
|
|
150
|
+
mime: "image/jpeg",
|
|
151
|
+
size: 3461.64,
|
|
152
|
+
url: "/uploads/jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b.jpg",
|
|
153
|
+
previewUrl: null,
|
|
154
|
+
provider: "local",
|
|
155
|
+
provider_metadata: null,
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const uid = "api::restaurant-simple-flat.restaurant-simple-flat";
|
|
160
|
+
|
|
161
|
+
const locale = "pl";
|
|
162
|
+
|
|
163
|
+
module.exports = {
|
|
164
|
+
updateEntry,
|
|
165
|
+
baseEntry,
|
|
166
|
+
fullyPopulatedLocalizedEntry,
|
|
167
|
+
uid,
|
|
168
|
+
locale,
|
|
169
|
+
};
|