Sorry, no results found for "".
1import { buildClient } from "@datocms/cma-client-node";2 3async function run() {4 const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });5 6 const modelIdOrApiKey = "blog_post";7 8 const itemType = await client.itemTypes.rawReorderFieldsAndFieldsets(9 modelIdOrApiKey,10 [11 {12 id: "Pkg-oztERp6o-Rj76nYKJg",13 type: "field",14 attributes: { position: 1 },15 relationships: { fieldset: { data: null } },16 },17 ],18 );19 20 // Check the 'Returned output' tab for the result ☝️21 console.log(itemType);22}23 24run();
1{2 type: "field",3 id: "Pkg-oztERp6o-Rj76nYKJg",4 attributes: {5 label: "Title",6 field_type: "string",7 api_key: "title",8 localized: true,9 validators: { required: {} },10 position: 1,11 hint: "This field will be used as post title",12 default_value: { en: "A default value", it: "Un valore di default" },13 appearance: {14 editor: "single_line",15 parameters: { heading: false },16 addons: [{ id: "1234", field_extension: "lorem_ipsum", parameters: {} }],17 },18 deep_filtering_enabled: true,19 },20 relationships: {21 item_type: { data: { type: "item_type", id: "DxMaW10UQiCmZcuuA-IkkA" } },22 fieldset: { data: null },23 },24}