@malevich-studio/strapi-sdk-typescript 1.1.0 → 1.1.2

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
@@ -21239,6 +21239,14 @@ class Strapi {
21239
21239
  } : {}),
21240
21240
  }, params));
21241
21241
  }
21242
+ async getLocales(params) {
21243
+ return await this.baseFetch('i18n/locales', _.merge({
21244
+ headers: {
21245
+ 'Content-Type': 'application/json',
21246
+ },
21247
+ method: 'GET',
21248
+ }, params));
21249
+ }
21242
21250
  async getDocuments(endpoint, data, params = {}) {
21243
21251
  return await this.fetch(endpoint, data, {
21244
21252
  method: 'GET',
@@ -21629,13 +21637,13 @@ class Dynamiczone extends BaseRelation {
21629
21637
  }
21630
21638
  getType() {
21631
21639
  const types = this.attribute.components
21632
- .map(componentItem => getComponentName(componentItem))
21640
+ .map(componentItem => `DynamiczoneComponent<'${componentItem}', ${getComponentName(componentItem)}>`)
21633
21641
  .join(' | ');
21634
21642
  return `(${types})[]`;
21635
21643
  }
21636
21644
  getInputType() {
21637
21645
  const types = this.attribute.components
21638
- .map(componentItem => `DynamiczoneInput<'${componentItem}', ${getComponentName(componentItem)}Input>`)
21646
+ .map(componentItem => `DynamiczoneComponent<'${componentItem}', ${getComponentName(componentItem)}Input>`)
21639
21647
  .join(' | ');
21640
21648
  return `(${types})[]`;
21641
21649
  }
@@ -21826,6 +21834,16 @@ async function generateStrapiTypes(strapi) {
21826
21834
  updatedAt: {
21827
21835
  type: 'datetime',
21828
21836
  },
21837
+ ...(contentType.schema.draftAndPublish ? {
21838
+ publishedAt: {
21839
+ type: 'datetime',
21840
+ },
21841
+ } : {}),
21842
+ ...(contentType.schema.pluginOptions?.i18n?.localized ? {
21843
+ locale: {
21844
+ type: 'string',
21845
+ },
21846
+ } : {}),
21829
21847
  ...contentType.schema.attributes,
21830
21848
  };
21831
21849
  allInterfaces.push(generateResponseTypeCode(modelName, attributes));
@@ -21833,7 +21851,7 @@ async function generateStrapiTypes(strapi) {
21833
21851
  allInterfaces.push(generateInputTypeCode(modelName, attributes));
21834
21852
  }
21835
21853
  const output = [
21836
- 'import {Strapi as StrapiBase, Query, Filters, FilterValue, RelationInput, DynamiczonePopulate, DynamiczoneInput} from "@malevich-studio/strapi-sdk-typescript";',
21854
+ 'import {Strapi as StrapiBase, Query, Filters, FilterValue, RelationInput, DynamiczonePopulate, DynamiczoneComponent} from "@malevich-studio/strapi-sdk-typescript";',
21837
21855
  'import {BlocksContent} from "@strapi/blocks-react-renderer";',
21838
21856
  '',
21839
21857
  'export default class Strapi extends StrapiBase {',