@malevich-studio/strapi-sdk-typescript 1.2.14 → 1.2.16
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/dist/cli.cjs +8 -2
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +8 -2
- package/dist/cli.mjs.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -21958,8 +21958,8 @@ function generateMethodsCode(contentType) {
|
|
|
21958
21958
|
* Main function to fetch Strapi (v5) data and generate the d.ts file
|
|
21959
21959
|
*/
|
|
21960
21960
|
async function generateStrapiTypes(strapi) {
|
|
21961
|
-
const contentTypes = (await strapi.fetch('content-type-builder/content-types')).data;
|
|
21962
|
-
const components = (await strapi.fetch('content-type-builder/components')).data;
|
|
21961
|
+
const contentTypes = (await strapi.fetch('content-type-builder/content-types')).data || [];
|
|
21962
|
+
const components = (await strapi.fetch('content-type-builder/components')).data || [];
|
|
21963
21963
|
const allInterfaces = [];
|
|
21964
21964
|
const methods = [];
|
|
21965
21965
|
for (const component of components) {
|
|
@@ -22002,6 +22002,12 @@ async function generateStrapiTypes(strapi) {
|
|
|
22002
22002
|
locale: {
|
|
22003
22003
|
type: 'string',
|
|
22004
22004
|
},
|
|
22005
|
+
localizations: {
|
|
22006
|
+
type: 'relation',
|
|
22007
|
+
target: contentType.uid,
|
|
22008
|
+
relation: 'oneToMany',
|
|
22009
|
+
required: true,
|
|
22010
|
+
},
|
|
22005
22011
|
} : {}),
|
|
22006
22012
|
...contentType.schema.attributes,
|
|
22007
22013
|
};
|