@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.cjs +21 -3
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +21 -3
- package/dist/cli.mjs.map +1 -1
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -21259,6 +21259,14 @@ class Strapi {
|
|
|
21259
21259
|
} : {}),
|
|
21260
21260
|
}, params));
|
|
21261
21261
|
}
|
|
21262
|
+
async getLocales(params) {
|
|
21263
|
+
return await this.baseFetch('i18n/locales', _.merge({
|
|
21264
|
+
headers: {
|
|
21265
|
+
'Content-Type': 'application/json',
|
|
21266
|
+
},
|
|
21267
|
+
method: 'GET',
|
|
21268
|
+
}, params));
|
|
21269
|
+
}
|
|
21262
21270
|
async getDocuments(endpoint, data, params = {}) {
|
|
21263
21271
|
return await this.fetch(endpoint, data, {
|
|
21264
21272
|
method: 'GET',
|
|
@@ -21649,13 +21657,13 @@ class Dynamiczone extends BaseRelation {
|
|
|
21649
21657
|
}
|
|
21650
21658
|
getType() {
|
|
21651
21659
|
const types = this.attribute.components
|
|
21652
|
-
.map(componentItem => getComponentName(componentItem))
|
|
21660
|
+
.map(componentItem => `DynamiczoneComponent<'${componentItem}', ${getComponentName(componentItem)}>`)
|
|
21653
21661
|
.join(' | ');
|
|
21654
21662
|
return `(${types})[]`;
|
|
21655
21663
|
}
|
|
21656
21664
|
getInputType() {
|
|
21657
21665
|
const types = this.attribute.components
|
|
21658
|
-
.map(componentItem => `
|
|
21666
|
+
.map(componentItem => `DynamiczoneComponent<'${componentItem}', ${getComponentName(componentItem)}Input>`)
|
|
21659
21667
|
.join(' | ');
|
|
21660
21668
|
return `(${types})[]`;
|
|
21661
21669
|
}
|
|
@@ -21846,6 +21854,16 @@ async function generateStrapiTypes(strapi) {
|
|
|
21846
21854
|
updatedAt: {
|
|
21847
21855
|
type: 'datetime',
|
|
21848
21856
|
},
|
|
21857
|
+
...(contentType.schema.draftAndPublish ? {
|
|
21858
|
+
publishedAt: {
|
|
21859
|
+
type: 'datetime',
|
|
21860
|
+
},
|
|
21861
|
+
} : {}),
|
|
21862
|
+
...(contentType.schema.pluginOptions?.i18n?.localized ? {
|
|
21863
|
+
locale: {
|
|
21864
|
+
type: 'string',
|
|
21865
|
+
},
|
|
21866
|
+
} : {}),
|
|
21849
21867
|
...contentType.schema.attributes,
|
|
21850
21868
|
};
|
|
21851
21869
|
allInterfaces.push(generateResponseTypeCode(modelName, attributes));
|
|
@@ -21853,7 +21871,7 @@ async function generateStrapiTypes(strapi) {
|
|
|
21853
21871
|
allInterfaces.push(generateInputTypeCode(modelName, attributes));
|
|
21854
21872
|
}
|
|
21855
21873
|
const output = [
|
|
21856
|
-
'import {Strapi as StrapiBase, Query, Filters, FilterValue, RelationInput, DynamiczonePopulate,
|
|
21874
|
+
'import {Strapi as StrapiBase, Query, Filters, FilterValue, RelationInput, DynamiczonePopulate, DynamiczoneComponent} from "@malevich-studio/strapi-sdk-typescript";',
|
|
21857
21875
|
'import {BlocksContent} from "@strapi/blocks-react-renderer";',
|
|
21858
21876
|
'',
|
|
21859
21877
|
'export default class Strapi extends StrapiBase {',
|