@datocms/cma-client 5.1.12 → 5.1.14
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/README.md +362 -167
- package/dist/cjs/generated/Client.js +1 -1
- package/dist/cjs/utilities/buildBlockRecord.js.map +1 -1
- package/dist/cjs/utilities/duplicateBlockRecord.js +2 -1
- package/dist/cjs/utilities/duplicateBlockRecord.js.map +1 -1
- package/dist/cjs/utilities/schemaRepository.js +107 -0
- package/dist/cjs/utilities/schemaRepository.js.map +1 -1
- package/dist/esm/fieldTypes/schema.d.ts +1 -1
- package/dist/esm/fieldTypes/single_block.d.ts +1 -1
- package/dist/esm/generated/ApiTypes.d.ts +4 -0
- package/dist/esm/generated/Client.js +1 -1
- package/dist/esm/generated/RawApiTypes.d.ts +4 -0
- package/dist/esm/generated/resources/Field.d.ts +100 -100
- package/dist/esm/utilities/buildBlockRecord.d.ts +10 -2
- package/dist/esm/utilities/buildBlockRecord.js.map +1 -1
- package/dist/esm/utilities/duplicateBlockRecord.js +2 -1
- package/dist/esm/utilities/duplicateBlockRecord.js.map +1 -1
- package/dist/esm/utilities/schemaRepository.d.ts +40 -0
- package/dist/esm/utilities/schemaRepository.js +107 -0
- package/dist/esm/utilities/schemaRepository.js.map +1 -1
- package/dist/types/fieldTypes/schema.d.ts +1 -1
- package/dist/types/fieldTypes/single_block.d.ts +1 -1
- package/dist/types/generated/ApiTypes.d.ts +4 -0
- package/dist/types/generated/RawApiTypes.d.ts +4 -0
- package/dist/types/generated/resources/Field.d.ts +100 -100
- package/dist/types/utilities/buildBlockRecord.d.ts +10 -2
- package/dist/types/utilities/schemaRepository.d.ts +40 -0
- package/package.json +4 -4
- package/src/fieldTypes/schema.ts +1 -1
- package/src/fieldTypes/single_block.ts +1 -1
- package/src/generated/ApiTypes.ts +4 -0
- package/src/generated/Client.ts +1 -1
- package/src/generated/RawApiTypes.ts +4 -0
- package/src/utilities/buildBlockRecord.ts +18 -2
- package/src/utilities/duplicateBlockRecord.ts +2 -1
- package/src/utilities/schemaRepository.ts +141 -0
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { NewBlockInRequest } from '../fieldTypes';
|
|
2
2
|
import type * as ApiTypes from '../generated/ApiTypes';
|
|
3
|
-
import type { ItemTypeDefinition } from './itemDefinition';
|
|
3
|
+
import type { ItemTypeDefinition, ToItemAttributesInRequest } from './itemDefinition';
|
|
4
4
|
type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
5
|
-
|
|
5
|
+
type UpdateOrCreateBlockRecordSchema<D extends ItemTypeDefinition = ItemTypeDefinition> = {
|
|
6
|
+
id?: ApiTypes.ItemIdentity;
|
|
7
|
+
type?: ApiTypes.ItemType1;
|
|
8
|
+
item_type: ApiTypes.ItemTypeData<D>;
|
|
9
|
+
meta?: ApiTypes.ItemUpdateSchema['meta'];
|
|
10
|
+
creator?: ApiTypes.ItemUpdateSchema['creator'];
|
|
11
|
+
__itemTypeId?: D['itemTypeId'];
|
|
12
|
+
} & ToItemAttributesInRequest<D>;
|
|
13
|
+
export declare function buildBlockRecord<D extends ItemTypeDefinition = ItemTypeDefinition>(body: UpdateOrCreateBlockRecordSchema<NoInfer<D>>): NewBlockInRequest<NoInfer<D>>;
|
|
6
14
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildBlockRecord.js","sourceRoot":"","sources":["../../../src/utilities/buildBlockRecord.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AAGpD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"buildBlockRecord.js","sourceRoot":"","sources":["../../../src/utilities/buildBlockRecord.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AAGpD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAmB9C,MAAM,UAAU,gBAAgB,CAG9B,IAAiD;IAEjD,OAAO,KAAK,CAAC,oBAAoB,CAE9B,IAAI,EAAE;QACP,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,UAAU,EAAE,GAAG;QACf,aAAa,EAAE,CAAC,WAAW,CAAC;KAC7B,CAAC,CAAC,IAAI,CAAC;AACV,CAAC"}
|
|
@@ -21,9 +21,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
import { mapBlocksInNonLocalizedFieldValue } from './recursiveBlocks';
|
|
22
22
|
export function duplicateBlockRecord(existingBlock, schemaRepository) {
|
|
23
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
const { type, attributes, relationships } = existingBlock;
|
|
24
|
+
const { __itemTypeId, type, attributes, relationships } = existingBlock;
|
|
25
25
|
const itemType = yield schemaRepository.getRawItemTypeById(existingBlock.relationships.item_type.data.id);
|
|
26
26
|
const newBlock = {
|
|
27
|
+
__itemTypeId,
|
|
27
28
|
type,
|
|
28
29
|
relationships,
|
|
29
30
|
attributes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"duplicateBlockRecord.js","sourceRoot":"","sources":["../../../src/utilities/duplicateBlockRecord.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAKA,OAAO,EAAE,iCAAiC,EAAE,MAAM,mBAAmB,CAAC;AAKtE,MAAM,UAAgB,oBAAoB,CAGxC,aAAoD,EACpD,gBAAkC;;QAElC,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"duplicateBlockRecord.js","sourceRoot":"","sources":["../../../src/utilities/duplicateBlockRecord.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAKA,OAAO,EAAE,iCAAiC,EAAE,MAAM,mBAAmB,CAAC;AAKtE,MAAM,UAAgB,oBAAoB,CAGxC,aAAoD,EACpD,gBAAkC;;QAElC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC;QAExE,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,kBAAkB,CACxD,aAAa,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAC9C,CAAC;QAEF,MAAM,QAAQ,GAAG;YACf,YAAY;YACZ,IAAI;YACJ,aAAa;YACb,UAAU;SACU,CAAC;QAEvB,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QAErE,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YAC1B,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC;gBAC3C,MAAM,iCAAiC,CACrC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,EAC7C,KAAK,CAAC,UAAU,CAAC,UAAU,EAC3B,gBAAgB,EAChB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;oBACd,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;wBAC7B,MAAM,IAAI,KAAK,CACb,6DAA6D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,6BAA6B,KAAK,2BAA2B,CACzI,CAAC;qBACH;oBAED,MAAM,EAAE,EAAE,EAAE,IAAI,KAA+B,KAAK,EAA/B,qBAAqB,UAAK,KAAK,EAA9C,cAAsC,CAAQ,CAAC;oBAErD,OAAO,qBAA0C,CAAC;gBACpD,CAAC,CACF,CAAC;SACL;QAED,OAAO,QAAyC,CAAC;IACnD,CAAC;CAAA"}
|
|
@@ -24,6 +24,14 @@ interface GenericClient {
|
|
|
24
24
|
data: RawApiTypes.Plugin[];
|
|
25
25
|
}>;
|
|
26
26
|
};
|
|
27
|
+
site: {
|
|
28
|
+
rawFind(params: {
|
|
29
|
+
include: string;
|
|
30
|
+
}): Promise<{
|
|
31
|
+
data: any;
|
|
32
|
+
included?: Array<RawApiTypes.ItemType | RawApiTypes.Field | any>;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
27
35
|
}
|
|
28
36
|
/**
|
|
29
37
|
* Repository for DatoCMS schema entities including item types, fields, and plugins.
|
|
@@ -244,5 +252,37 @@ export declare class SchemaRepository {
|
|
|
244
252
|
* @throws Error if the plugin is not found
|
|
245
253
|
*/
|
|
246
254
|
getRawPluginByPackageName(packageName: string): Promise<RawApiTypes.Plugin>;
|
|
255
|
+
/**
|
|
256
|
+
* Prefetches all models and their fields in a single optimized API call.
|
|
257
|
+
* This method populates the internal caches for both item types and fields,
|
|
258
|
+
* making subsequent lookups very fast without additional API calls.
|
|
259
|
+
*
|
|
260
|
+
* This is more efficient than lazy loading when you know you'll need access
|
|
261
|
+
* to multiple models and fields, as it reduces the number of API requests
|
|
262
|
+
* from potentially dozens down to just one.
|
|
263
|
+
*
|
|
264
|
+
* @returns Promise that resolves when all data has been fetched and cached
|
|
265
|
+
*/
|
|
266
|
+
prefetchAllModelsAndFields(): Promise<void>;
|
|
267
|
+
/**
|
|
268
|
+
* Gets all models that directly or indirectly embed the given block models.
|
|
269
|
+
* This method recursively traverses the schema to find all models that reference
|
|
270
|
+
* the provided blocks, either directly through block fields or indirectly through
|
|
271
|
+
* other block models that reference them.
|
|
272
|
+
*
|
|
273
|
+
* @param blocks - Array of block models to find references to
|
|
274
|
+
* @returns Promise that resolves to array of models that embed these blocks
|
|
275
|
+
*/
|
|
276
|
+
getRawModelsEmbeddingBlocks(blocks: Array<ApiTypes.ItemType | RawApiTypes.ItemType>): Promise<Array<RawApiTypes.ItemType>>;
|
|
277
|
+
/**
|
|
278
|
+
* Gets all models that directly or indirectly embed the given block models.
|
|
279
|
+
* This method recursively traverses the schema to find all models that reference
|
|
280
|
+
* the provided blocks, either directly through block fields or indirectly through
|
|
281
|
+
* other block models that reference them.
|
|
282
|
+
*
|
|
283
|
+
* @param blocks - Array of block models to find references to
|
|
284
|
+
* @returns Promise that resolves to array of models that embed these blocks
|
|
285
|
+
*/
|
|
286
|
+
getModelsEmbeddingBlocks(blocks: Array<ApiTypes.ItemType | RawApiTypes.ItemType>): Promise<Array<ApiTypes.ItemType>>;
|
|
247
287
|
}
|
|
248
288
|
export {};
|
|
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { deserializeResponseBody } from '@datocms/rest-client-utils';
|
|
11
|
+
import { blockModelIdsReferencedInField } from './fieldsContainingReferences';
|
|
11
12
|
/**
|
|
12
13
|
* Repository for DatoCMS schema entities including item types, fields, and plugins.
|
|
13
14
|
* Provides caching and efficient lookup functionality for schema-related operations.
|
|
@@ -410,5 +411,111 @@ export class SchemaRepository {
|
|
|
410
411
|
return plugin;
|
|
411
412
|
});
|
|
412
413
|
}
|
|
414
|
+
/**
|
|
415
|
+
* Prefetches all models and their fields in a single optimized API call.
|
|
416
|
+
* This method populates the internal caches for both item types and fields,
|
|
417
|
+
* making subsequent lookups very fast without additional API calls.
|
|
418
|
+
*
|
|
419
|
+
* This is more efficient than lazy loading when you know you'll need access
|
|
420
|
+
* to multiple models and fields, as it reduces the number of API requests
|
|
421
|
+
* from potentially dozens down to just one.
|
|
422
|
+
*
|
|
423
|
+
* @returns Promise that resolves when all data has been fetched and cached
|
|
424
|
+
*/
|
|
425
|
+
prefetchAllModelsAndFields() {
|
|
426
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
427
|
+
const { included } = yield this.client.site.rawFind({
|
|
428
|
+
include: 'item_types,item_types.fields',
|
|
429
|
+
});
|
|
430
|
+
if (!included) {
|
|
431
|
+
throw new Error('This should not happen');
|
|
432
|
+
}
|
|
433
|
+
const allItemTypes = included.filter((item) => item.type === 'item_type');
|
|
434
|
+
const allFields = included.filter((item) => item.type === 'field');
|
|
435
|
+
// Populate item types caches
|
|
436
|
+
this.itemTypesPromise = Promise.resolve(allItemTypes);
|
|
437
|
+
for (const itemType of allItemTypes) {
|
|
438
|
+
this.itemTypesByApiKey.set(itemType.attributes.api_key, itemType);
|
|
439
|
+
this.itemTypesById.set(itemType.id, itemType);
|
|
440
|
+
}
|
|
441
|
+
// Group fields by item type and populate fields cache
|
|
442
|
+
const fieldsByItemTypeId = new Map();
|
|
443
|
+
for (const field of allFields) {
|
|
444
|
+
const itemTypeId = field.relationships.item_type.data.id;
|
|
445
|
+
if (!fieldsByItemTypeId.has(itemTypeId)) {
|
|
446
|
+
fieldsByItemTypeId.set(itemTypeId, []);
|
|
447
|
+
}
|
|
448
|
+
fieldsByItemTypeId.get(itemTypeId).push(field);
|
|
449
|
+
}
|
|
450
|
+
// Populate the fields cache
|
|
451
|
+
for (const [itemTypeId, fields] of fieldsByItemTypeId) {
|
|
452
|
+
this.fieldsByItemType.set(itemTypeId, fields);
|
|
453
|
+
}
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Gets all models that directly or indirectly embed the given block models.
|
|
458
|
+
* This method recursively traverses the schema to find all models that reference
|
|
459
|
+
* the provided blocks, either directly through block fields or indirectly through
|
|
460
|
+
* other block models that reference them.
|
|
461
|
+
*
|
|
462
|
+
* @param blocks - Array of block models to find references to
|
|
463
|
+
* @returns Promise that resolves to array of models that embed these blocks
|
|
464
|
+
*/
|
|
465
|
+
getRawModelsEmbeddingBlocks(blocks) {
|
|
466
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
467
|
+
yield this.prefetchAllModelsAndFields();
|
|
468
|
+
const allItemTypes = yield this.getAllRawItemTypes();
|
|
469
|
+
const blockIds = new Set(blocks.map((block) => block.id));
|
|
470
|
+
const embeddingModels = [];
|
|
471
|
+
// Helper function to check if a model points to any of the target blocks
|
|
472
|
+
const modelPointsToBlocks = (itemType, alreadyExplored = new Set()) => __awaiter(this, void 0, void 0, function* () {
|
|
473
|
+
if (alreadyExplored.has(itemType.id)) {
|
|
474
|
+
return false;
|
|
475
|
+
}
|
|
476
|
+
alreadyExplored.add(itemType.id);
|
|
477
|
+
const fields = yield this.getRawItemTypeFields(itemType);
|
|
478
|
+
for (const field of fields) {
|
|
479
|
+
const referencedBlockIds = blockModelIdsReferencedInField(field);
|
|
480
|
+
// Check if this field directly references any of our target blocks
|
|
481
|
+
if (referencedBlockIds.some((id) => blockIds.has(id))) {
|
|
482
|
+
return true;
|
|
483
|
+
}
|
|
484
|
+
// Check if this field references other block models that might transitively reference our targets
|
|
485
|
+
const referencedBlocks = referencedBlockIds.map((id) => allItemTypes.find((it) => it.id === id));
|
|
486
|
+
for (const linkedBlock of referencedBlocks) {
|
|
487
|
+
if (yield modelPointsToBlocks(linkedBlock, new Set(alreadyExplored))) {
|
|
488
|
+
return true;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
return false;
|
|
493
|
+
});
|
|
494
|
+
// Check each model to see if it embeds any of the target blocks
|
|
495
|
+
for (const itemType of allItemTypes) {
|
|
496
|
+
if (yield modelPointsToBlocks(itemType)) {
|
|
497
|
+
embeddingModels.push(itemType);
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
return embeddingModels;
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Gets all models that directly or indirectly embed the given block models.
|
|
505
|
+
* This method recursively traverses the schema to find all models that reference
|
|
506
|
+
* the provided blocks, either directly through block fields or indirectly through
|
|
507
|
+
* other block models that reference them.
|
|
508
|
+
*
|
|
509
|
+
* @param blocks - Array of block models to find references to
|
|
510
|
+
* @returns Promise that resolves to array of models that embed these blocks
|
|
511
|
+
*/
|
|
512
|
+
getModelsEmbeddingBlocks(blocks) {
|
|
513
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
514
|
+
const rawResult = yield this.getRawModelsEmbeddingBlocks(blocks);
|
|
515
|
+
return deserializeResponseBody({
|
|
516
|
+
data: rawResult,
|
|
517
|
+
});
|
|
518
|
+
});
|
|
519
|
+
}
|
|
413
520
|
}
|
|
414
521
|
//# sourceMappingURL=schemaRepository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaRepository.js","sourceRoot":"","sources":["../../../src/utilities/schemaRepository.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"schemaRepository.js","sourceRoot":"","sources":["../../../src/utilities/schemaRepository.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAGrE,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAwB9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,MAAM,OAAO,gBAAgB;IAW3B;;;OAGG;IACH,YAAY,MAAqB;QAbzB,qBAAgB,GAA2C,IAAI,CAAC;QAChE,sBAAiB,GAAsC,IAAI,GAAG,EAAE,CAAC;QACjE,kBAAa,GAAsC,IAAI,GAAG,EAAE,CAAC;QAC7D,qBAAgB,GAAqC,IAAI,GAAG,EAAE,CAAC;QAC/D,wBAAmB,GAAwC,IAAI,GAAG,EAAE,CAAC;QACrE,mBAAc,GAAyC,IAAI,CAAC;QAC5D,gBAAW,GAAoC,IAAI,GAAG,EAAE,CAAC;QACzD,yBAAoB,GAAoC,IAAI,GAAG,EAAE,CAAC;QAOxE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACW,aAAa;;YACzB,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;gBAC1B,IAAI,CAAC,gBAAgB,GAAG,CAAC,GAAS,EAAE;oBAClC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;oBAElE,2BAA2B;oBAC3B,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;wBAChC,IAAI,CA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E;YAChE,KAAK,MAAM,QAAQ,IAAI,YAAY,EAAE;gBACnC,IAAI,MAAM,mBAAmB,CAAC,QAAQ,CAAC,EAAE;oBACvC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBAChC;aACF;YAED,OAAO,eAAe,CAAC;QACzB,CAAC;KAAA;IAED;;;;;;;;OAQG;IACG,wBAAwB,CAC5B,MAAuD;;YAEvD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC;YACjE,OAAO,uBAAuB,CAAsB;gBAClD,IAAI,EAAE,SAAS;aAChB,CAAC,CAAC;QACL,CAAC;KAAA;CACF"}
|
|
@@ -20,7 +20,7 @@ type NonLocalizedFieldAttributesForFieldType<SourceType, FieldType extends Field
|
|
|
20
20
|
type LocalizedFieldAttributesForFieldType<SourceType, FieldType extends FieldAttributesStableShell['field_type'], FieldValue, FieldValidators, FieldAppearance> = Omit<SourceType, 'field_type' | 'default_value' | 'validators' | 'appearance' | 'localized'> & {
|
|
21
21
|
field_type: FieldType;
|
|
22
22
|
localized: true;
|
|
23
|
-
default_value:
|
|
23
|
+
default_value: Record<string, FieldValue>;
|
|
24
24
|
validators: FieldValidators;
|
|
25
25
|
appearance: FieldAppearanceConfig<FieldAppearance>;
|
|
26
26
|
};
|
|
@@ -52,7 +52,7 @@ export type UpdatedBlockInRequest<D extends ItemTypeDefinition = ItemTypeDefinit
|
|
|
52
52
|
__itemTypeId?: D['itemTypeId'];
|
|
53
53
|
type: RawApiTypes.ItemType1;
|
|
54
54
|
id: RawApiTypes.ItemIdentity;
|
|
55
|
-
relationships
|
|
55
|
+
relationships: RawApiTypes.ItemRelationships<D>;
|
|
56
56
|
meta?: RawApiTypes.ItemMeta;
|
|
57
57
|
attributes: ToItemAttributesInRequest<D>;
|
|
58
58
|
};
|
|
@@ -6876,6 +6876,7 @@ export type ItemValidateExistingSchema<D extends ItemTypeDefinition = ItemTypeDe
|
|
|
6876
6876
|
type?: ItemType1;
|
|
6877
6877
|
item_type: ItemTypeData<D>;
|
|
6878
6878
|
creator?: AccountData | AccessTokenData | UserData | SsoUserData | OrganizationData;
|
|
6879
|
+
__itemTypeId?: D['itemTypeId'];
|
|
6879
6880
|
} & ToItemAttributesInRequest<D>;
|
|
6880
6881
|
/**
|
|
6881
6882
|
* This interface was referenced by `Item`'s JSON-Schema
|
|
@@ -6885,6 +6886,7 @@ export type ItemValidateNewSchema<D extends ItemTypeDefinition = ItemTypeDefinit
|
|
|
6885
6886
|
type?: ItemType1;
|
|
6886
6887
|
item_type: ItemTypeData<D>;
|
|
6887
6888
|
creator?: AccountData | AccessTokenData | UserData | SsoUserData | OrganizationData;
|
|
6889
|
+
__itemTypeId?: D['itemTypeId'];
|
|
6888
6890
|
} & ToItemAttributesInRequest<D>;
|
|
6889
6891
|
/**
|
|
6890
6892
|
* This interface was referenced by `Item`'s JSON-Schema
|
|
@@ -6940,6 +6942,7 @@ export type ItemCreateSchema<D extends ItemTypeDefinition = ItemTypeDefinition>
|
|
|
6940
6942
|
*/
|
|
6941
6943
|
current_version?: string;
|
|
6942
6944
|
};
|
|
6945
|
+
__itemTypeId?: D['itemTypeId'];
|
|
6943
6946
|
} & ToItemAttributesInRequest<D>;
|
|
6944
6947
|
/**
|
|
6945
6948
|
* This interface was referenced by `Item`'s JSON-Schema
|
|
@@ -7007,6 +7010,7 @@ export type ItemUpdateSchema<D extends ItemTypeDefinition = ItemTypeDefinition>
|
|
|
7007
7010
|
*/
|
|
7008
7011
|
has_children?: null | boolean;
|
|
7009
7012
|
};
|
|
7013
|
+
__itemTypeId?: D['itemTypeId'];
|
|
7010
7014
|
} & ToItemAttributesInRequest<D>;
|
|
7011
7015
|
/**
|
|
7012
7016
|
* Information about the record
|
|
@@ -6744,6 +6744,7 @@ export type ItemValidateExistingSchema<D extends ItemTypeDefinition = ItemTypeDe
|
|
|
6744
6744
|
data: AccountData | AccessTokenData | UserData | SsoUserData | OrganizationData;
|
|
6745
6745
|
};
|
|
6746
6746
|
};
|
|
6747
|
+
__itemTypeId?: D['itemTypeId'];
|
|
6747
6748
|
};
|
|
6748
6749
|
};
|
|
6749
6750
|
/**
|
|
@@ -6771,6 +6772,7 @@ export type ItemValidateNewSchema<D extends ItemTypeDefinition = ItemTypeDefinit
|
|
|
6771
6772
|
data: AccountData | AccessTokenData | UserData | SsoUserData | OrganizationData;
|
|
6772
6773
|
};
|
|
6773
6774
|
};
|
|
6775
|
+
__itemTypeId?: D['itemTypeId'];
|
|
6774
6776
|
};
|
|
6775
6777
|
};
|
|
6776
6778
|
/**
|
|
@@ -6844,6 +6846,7 @@ export type ItemCreateSchema<D extends ItemTypeDefinition = ItemTypeDefinition>
|
|
|
6844
6846
|
data: AccountData | AccessTokenData | UserData | SsoUserData | OrganizationData;
|
|
6845
6847
|
};
|
|
6846
6848
|
};
|
|
6849
|
+
__itemTypeId?: D['itemTypeId'];
|
|
6847
6850
|
};
|
|
6848
6851
|
};
|
|
6849
6852
|
/**
|
|
@@ -6958,6 +6961,7 @@ export type ItemUpdateSchema<D extends ItemTypeDefinition = ItemTypeDefinition>
|
|
|
6958
6961
|
data: AccountData | AccessTokenData | UserData | SsoUserData | OrganizationData;
|
|
6959
6962
|
};
|
|
6960
6963
|
};
|
|
6964
|
+
__itemTypeId?: D['itemTypeId'];
|
|
6961
6965
|
};
|
|
6962
6966
|
};
|
|
6963
6967
|
/**
|