@datocms/cma-client 5.1.24 → 5.1.26

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.
@@ -612,6 +612,11 @@ export type ItemTypeDestroyHrefSchema = {
612
612
  skip_menu_items_deletion?: boolean;
613
613
  [k: string]: unknown;
614
614
  };
615
+ /**
616
+ * This interface was referenced by `ItemType`'s JSON-Schema
617
+ * via the `referencing.targetSchema` link.
618
+ */
619
+ export type ItemTypeReferencingTargetSchema = ItemType[];
615
620
  /**
616
621
  * This interface was referenced by `ItemType`'s JSON-Schema
617
622
  * via the `reorder_fields_and_fieldsets.schema` link.
@@ -147,7 +147,7 @@ export class Client {
147
147
  ...this.config,
148
148
  ...options,
149
149
  logFn: this.config.logFn || console.log,
150
- userAgent: '@datocms/cma-client v5.1.24',
150
+ userAgent: '@datocms/cma-client v5.1.26',
151
151
  baseUrl: this.baseUrl,
152
152
  preCallStack: new Error().stack,
153
153
  extraHeaders: {
@@ -4758,6 +4758,13 @@ export type ItemTypeDestroyTargetSchema = {
4758
4758
  export type ItemTypeDestroyJobSchema = {
4759
4759
  data: ItemType;
4760
4760
  };
4761
+ /**
4762
+ * This interface was referenced by `ItemType`'s JSON-Schema
4763
+ * via the `referencing.targetSchema` link.
4764
+ */
4765
+ export type ItemTypeReferencingTargetSchema = {
4766
+ data: ItemType[];
4767
+ };
4761
4768
  /**
4762
4769
  * This interface was referenced by `ItemType`'s JSON-Schema
4763
4770
  * via the `reorder_fields_and_fieldsets.schema` link.
@@ -147,14 +147,12 @@ export default class Field extends BaseResource {
147
147
  }
148
148
 
149
149
  /**
150
- * List referenced fields
150
+ * List fields referencing a model/block
151
151
  *
152
152
  * Read more: https://www.datocms.com/docs/content-management-api/resources/field/referencing
153
153
  *
154
154
  * @throws {ApiError}
155
155
  * @throws {TimeoutError}
156
- *
157
- * @deprecated This API call is to be considered private and might change without notice
158
156
  */
159
157
  referencing(itemTypeId: string | ApiTypes.ItemTypeData) {
160
158
  return this.rawReferencing(Utils.toId(itemTypeId)).then((body) =>
@@ -165,14 +163,12 @@ export default class Field extends BaseResource {
165
163
  }
166
164
 
167
165
  /**
168
- * List referenced fields
166
+ * List fields referencing a model/block
169
167
  *
170
168
  * Read more: https://www.datocms.com/docs/content-management-api/resources/field/referencing
171
169
  *
172
170
  * @throws {ApiError}
173
171
  * @throws {TimeoutError}
174
- *
175
- * @deprecated This API call is to be considered private and might change without notice
176
172
  */
177
173
  rawReferencing(
178
174
  itemTypeId: string,
@@ -272,6 +272,39 @@ export default class ItemType extends BaseResource {
272
272
  });
273
273
  }
274
274
 
275
+ /**
276
+ * List models referencing another model/block
277
+ *
278
+ * Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/referencing
279
+ *
280
+ * @throws {ApiError}
281
+ * @throws {TimeoutError}
282
+ */
283
+ referencing(itemTypeId: string | ApiTypes.ItemTypeData) {
284
+ return this.rawReferencing(Utils.toId(itemTypeId)).then((body) =>
285
+ Utils.deserializeResponseBody<ApiTypes.ItemTypeReferencingTargetSchema>(
286
+ body,
287
+ ),
288
+ );
289
+ }
290
+
291
+ /**
292
+ * List models referencing another model/block
293
+ *
294
+ * Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/referencing
295
+ *
296
+ * @throws {ApiError}
297
+ * @throws {TimeoutError}
298
+ */
299
+ rawReferencing(
300
+ itemTypeId: string,
301
+ ): Promise<RawApiTypes.ItemTypeReferencingTargetSchema> {
302
+ return this.client.request<RawApiTypes.ItemTypeReferencingTargetSchema>({
303
+ method: 'GET',
304
+ url: `/item-types/${itemTypeId}/referencing`,
305
+ });
306
+ }
307
+
275
308
  /**
276
309
  * Reorders a set of fields and fieldsets within the model
277
310
  *