@malevich-studio/strapi-sdk-typescript 1.2.15 → 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.mjs CHANGED
@@ -21938,8 +21938,8 @@ function generateMethodsCode(contentType) {
21938
21938
  * Main function to fetch Strapi (v5) data and generate the d.ts file
21939
21939
  */
21940
21940
  async function generateStrapiTypes(strapi) {
21941
- const contentTypes = (await strapi.fetch('content-type-builder/content-types')).data;
21942
- const components = (await strapi.fetch('content-type-builder/components')).data;
21941
+ const contentTypes = (await strapi.fetch('content-type-builder/content-types')).data || [];
21942
+ const components = (await strapi.fetch('content-type-builder/components')).data || [];
21943
21943
  const allInterfaces = [];
21944
21944
  const methods = [];
21945
21945
  for (const component of components) {
@@ -21982,6 +21982,12 @@ async function generateStrapiTypes(strapi) {
21982
21982
  locale: {
21983
21983
  type: 'string',
21984
21984
  },
21985
+ localizations: {
21986
+ type: 'relation',
21987
+ target: contentType.uid,
21988
+ relation: 'oneToMany',
21989
+ required: true,
21990
+ },
21985
21991
  } : {}),
21986
21992
  ...contentType.schema.attributes,
21987
21993
  };