@datocms/cma-client 5.1.11 → 5.1.13

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.
Files changed (118) hide show
  1. package/README.md +313 -178
  2. package/dist/cjs/fieldTypes/file.js +6 -6
  3. package/dist/cjs/fieldTypes/gallery.js +7 -7
  4. package/dist/cjs/fieldTypes/rich_text.js +14 -12
  5. package/dist/cjs/fieldTypes/rich_text.js.map +1 -1
  6. package/dist/cjs/fieldTypes/schema.js +3 -0
  7. package/dist/cjs/fieldTypes/schema.js.map +1 -0
  8. package/dist/cjs/fieldTypes/single_block.js +13 -12
  9. package/dist/cjs/fieldTypes/single_block.js.map +1 -1
  10. package/dist/cjs/fieldTypes/structured_text.js +13 -12
  11. package/dist/cjs/fieldTypes/structured_text.js.map +1 -1
  12. package/dist/cjs/generated/Client.js +1 -1
  13. package/dist/cjs/generated/resources/Item.js.map +1 -1
  14. package/dist/cjs/generated/resources/ScheduledPublication.js.map +1 -1
  15. package/dist/cjs/generated/resources/ScheduledUnpublishing.js.map +1 -1
  16. package/dist/cjs/generated/resources/Upload.js.map +1 -1
  17. package/dist/cjs/index.js +1 -0
  18. package/dist/cjs/index.js.map +1 -1
  19. package/dist/cjs/utilities/buildBlockRecord.js +1 -46
  20. package/dist/cjs/utilities/buildBlockRecord.js.map +1 -1
  21. package/dist/cjs/utilities/duplicateBlockRecord.js +50 -0
  22. package/dist/cjs/utilities/duplicateBlockRecord.js.map +1 -0
  23. package/dist/cjs/utilities/inspectItem.js +50 -20
  24. package/dist/cjs/utilities/inspectItem.js.map +1 -1
  25. package/dist/cjs/utilities/nonRecursiveBlocks.js +1 -170
  26. package/dist/cjs/utilities/nonRecursiveBlocks.js.map +1 -1
  27. package/dist/cjs/utilities/recursiveBlocks.js +52 -112
  28. package/dist/cjs/utilities/recursiveBlocks.js.map +1 -1
  29. package/dist/esm/fieldTypes/file.d.ts +3 -3
  30. package/dist/esm/fieldTypes/file.js +3 -3
  31. package/dist/esm/fieldTypes/gallery.d.ts +5 -5
  32. package/dist/esm/fieldTypes/gallery.js +5 -5
  33. package/dist/esm/fieldTypes/rich_text.d.ts +8 -9
  34. package/dist/esm/fieldTypes/rich_text.js +9 -7
  35. package/dist/esm/fieldTypes/rich_text.js.map +1 -1
  36. package/dist/esm/fieldTypes/schema.d.ts +59 -0
  37. package/dist/esm/fieldTypes/schema.js +2 -0
  38. package/dist/esm/fieldTypes/schema.js.map +1 -0
  39. package/dist/esm/fieldTypes/single_block.d.ts +30 -15
  40. package/dist/esm/fieldTypes/single_block.js +8 -7
  41. package/dist/esm/fieldTypes/single_block.js.map +1 -1
  42. package/dist/esm/fieldTypes/structured_text.d.ts +14 -15
  43. package/dist/esm/fieldTypes/structured_text.js +8 -7
  44. package/dist/esm/fieldTypes/structured_text.js.map +1 -1
  45. package/dist/esm/generated/ApiTypes.d.ts +94 -980
  46. package/dist/esm/generated/Client.js +1 -1
  47. package/dist/esm/generated/RawApiTypes.d.ts +160 -999
  48. package/dist/esm/generated/resources/Field.d.ts +300 -300
  49. package/dist/esm/generated/resources/Item.d.ts +34 -34
  50. package/dist/esm/generated/resources/Item.js.map +1 -1
  51. package/dist/esm/generated/resources/ItemVersion.d.ts +3 -1
  52. package/dist/esm/generated/resources/ScheduledPublication.d.ts +3 -3
  53. package/dist/esm/generated/resources/ScheduledPublication.js.map +1 -1
  54. package/dist/esm/generated/resources/ScheduledUnpublishing.d.ts +3 -3
  55. package/dist/esm/generated/resources/ScheduledUnpublishing.js.map +1 -1
  56. package/dist/esm/generated/resources/Upload.d.ts +6 -6
  57. package/dist/esm/generated/resources/Upload.js.map +1 -1
  58. package/dist/esm/index.d.ts +1 -0
  59. package/dist/esm/index.js +1 -0
  60. package/dist/esm/index.js.map +1 -1
  61. package/dist/esm/utilities/buildBlockRecord.d.ts +11 -5
  62. package/dist/esm/utilities/buildBlockRecord.js +0 -44
  63. package/dist/esm/utilities/buildBlockRecord.js.map +1 -1
  64. package/dist/esm/utilities/duplicateBlockRecord.d.ts +6 -0
  65. package/dist/esm/utilities/duplicateBlockRecord.js +46 -0
  66. package/dist/esm/utilities/duplicateBlockRecord.js.map +1 -0
  67. package/dist/esm/utilities/inspectItem.d.ts +3 -3
  68. package/dist/esm/utilities/inspectItem.js +28 -21
  69. package/dist/esm/utilities/inspectItem.js.map +1 -1
  70. package/dist/esm/utilities/itemDefinition.d.ts +25 -27
  71. package/dist/esm/utilities/nonRecursiveBlocks.d.ts +10 -75
  72. package/dist/esm/utilities/nonRecursiveBlocks.js +1 -164
  73. package/dist/esm/utilities/nonRecursiveBlocks.js.map +1 -1
  74. package/dist/esm/utilities/recursiveBlocks.d.ts +53 -23
  75. package/dist/esm/utilities/recursiveBlocks.js +52 -112
  76. package/dist/esm/utilities/recursiveBlocks.js.map +1 -1
  77. package/dist/types/fieldTypes/file.d.ts +3 -3
  78. package/dist/types/fieldTypes/gallery.d.ts +5 -5
  79. package/dist/types/fieldTypes/rich_text.d.ts +8 -9
  80. package/dist/types/fieldTypes/schema.d.ts +59 -0
  81. package/dist/types/fieldTypes/single_block.d.ts +30 -15
  82. package/dist/types/fieldTypes/structured_text.d.ts +14 -15
  83. package/dist/types/generated/ApiTypes.d.ts +94 -980
  84. package/dist/types/generated/RawApiTypes.d.ts +160 -999
  85. package/dist/types/generated/resources/Field.d.ts +300 -300
  86. package/dist/types/generated/resources/Item.d.ts +34 -34
  87. package/dist/types/generated/resources/ItemVersion.d.ts +3 -1
  88. package/dist/types/generated/resources/ScheduledPublication.d.ts +3 -3
  89. package/dist/types/generated/resources/ScheduledUnpublishing.d.ts +3 -3
  90. package/dist/types/generated/resources/Upload.d.ts +6 -6
  91. package/dist/types/index.d.ts +1 -0
  92. package/dist/types/utilities/buildBlockRecord.d.ts +11 -5
  93. package/dist/types/utilities/duplicateBlockRecord.d.ts +6 -0
  94. package/dist/types/utilities/inspectItem.d.ts +3 -3
  95. package/dist/types/utilities/itemDefinition.d.ts +25 -27
  96. package/dist/types/utilities/nonRecursiveBlocks.d.ts +10 -75
  97. package/dist/types/utilities/recursiveBlocks.d.ts +53 -23
  98. package/package.json +4 -4
  99. package/src/fieldTypes/file.ts +6 -6
  100. package/src/fieldTypes/gallery.ts +10 -10
  101. package/src/fieldTypes/rich_text.ts +26 -24
  102. package/src/fieldTypes/schema.ts +657 -0
  103. package/src/fieldTypes/single_block.ts +61 -38
  104. package/src/fieldTypes/structured_text.ts +57 -51
  105. package/src/generated/ApiTypes.ts +221 -1880
  106. package/src/generated/Client.ts +1 -1
  107. package/src/generated/RawApiTypes.ts +276 -2113
  108. package/src/generated/resources/Item.ts +93 -187
  109. package/src/generated/resources/ScheduledPublication.ts +4 -15
  110. package/src/generated/resources/ScheduledUnpublishing.ts +4 -15
  111. package/src/generated/resources/Upload.ts +9 -32
  112. package/src/index.ts +1 -0
  113. package/src/utilities/buildBlockRecord.ts +16 -56
  114. package/src/utilities/duplicateBlockRecord.ts +53 -0
  115. package/src/utilities/inspectItem.ts +64 -52
  116. package/src/utilities/itemDefinition.ts +109 -98
  117. package/src/utilities/nonRecursiveBlocks.ts +25 -279
  118. package/src/utilities/recursiveBlocks.ts +337 -72
@@ -1,5 +1,5 @@
1
1
  import type * as RawApiTypes from '../generated/RawApiTypes';
2
- import type { ItemDefinition } from '../utilities/itemDefinition';
2
+ import type { ItemTypeDefinition, ToItemAttributesInRequest } from '../utilities/itemDefinition';
3
3
  import { type LocalizedFieldValue } from '../utilities/normalizedFieldValues';
4
4
  import type { FramedSingleBlockEditorConfiguration } from './appearance/framed_single_block';
5
5
  import type { FramelessSingleBlockEditorConfiguration } from './appearance/frameless_single_block';
@@ -46,11 +46,25 @@ export type SingleBlockFieldValue = string | null;
46
46
  * - Omit ID for new blocks being created
47
47
  */
48
48
  /** Represents an existing block in a CMA request */
49
- export type UnchangedBlockInARequest<D extends ItemDefinition = ItemDefinition> = RawApiTypes.Item<D>['id'];
49
+ export type UnchangedBlockInRequest = RawApiTypes.ItemIdentity;
50
50
  /** Represents a block we want to update in a CMA request */
51
- export type UpdatedBlockInARequest<D extends ItemDefinition = ItemDefinition> = D extends any ? OptionalFields<RawApiTypes.Item<D>, 'meta'> : never;
51
+ export type UpdatedBlockInRequest<D extends ItemTypeDefinition = ItemTypeDefinition> = {
52
+ __itemTypeId?: D['itemTypeId'];
53
+ type: RawApiTypes.ItemType1;
54
+ id: RawApiTypes.ItemIdentity;
55
+ relationships: RawApiTypes.ItemRelationships<D>;
56
+ meta?: RawApiTypes.ItemMeta;
57
+ attributes: ToItemAttributesInRequest<D>;
58
+ };
52
59
  /** Represents a new block to create in a CMA request */
53
- export type NewBlockInARequest<D extends ItemDefinition = ItemDefinition> = D extends any ? OptionalFields<RawApiTypes.Item<D>, 'id' | 'meta'> : never;
60
+ export type NewBlockInRequest<D extends ItemTypeDefinition = ItemTypeDefinition> = {
61
+ __itemTypeId?: D['itemTypeId'];
62
+ type: RawApiTypes.ItemType1;
63
+ id?: RawApiTypes.ItemIdentity;
64
+ relationships: RawApiTypes.ItemRelationships<D>;
65
+ meta?: RawApiTypes.ItemMeta;
66
+ attributes: ToItemAttributesInRequest<D>;
67
+ };
54
68
  /**
55
69
  * Union type representing the different ways a block can be specified in API requests:
56
70
  * - string: Just the block ID (to keep existing blocks unchanged)
@@ -59,14 +73,15 @@ export type NewBlockInARequest<D extends ItemDefinition = ItemDefinition> = D ex
59
73
  *
60
74
  * Also, 'meta' can always be omitted
61
75
  */
62
- export type BlockItemInARequest<D extends ItemDefinition = ItemDefinition> = UnchangedBlockInARequest | UpdatedBlockInARequest<D> | NewBlockInARequest<D>;
76
+ export type BlockInRequest<D extends ItemTypeDefinition = ItemTypeDefinition> = UnchangedBlockInRequest | UpdatedBlockInRequest<D> | NewBlockInRequest<D>;
77
+ export type BlockInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends unknown ? RawApiTypes.ItemInNestedResponse<D> : never;
63
78
  /**
64
79
  * Single Block field value for API requests - allows flexible block representations:
65
80
  * - string: Just the block ID (to keep existing blocks unchanged)
66
81
  * - Full block object with ID (to update an existing block)
67
82
  * - Block object without ID (to create a new block)
68
83
  */
69
- export type SingleBlockFieldValueAsRequest<D extends ItemDefinition = ItemDefinition> = BlockItemInARequest<D> | null;
84
+ export type SingleBlockFieldValueInRequest<D extends ItemTypeDefinition = ItemTypeDefinition> = BlockInRequest<D> | null;
70
85
  /**
71
86
  * =============================================================================
72
87
  * NESTED VARIANT - Type for API responses with ?nested=true parameter
@@ -79,7 +94,7 @@ export type SingleBlockFieldValueAsRequest<D extends ItemDefinition = ItemDefini
79
94
  /**
80
95
  * Single Block field value with nested block - fully populated block object
81
96
  */
82
- export type SingleBlockFieldValueWithNestedBlocks<D extends ItemDefinition = ItemDefinition> = RawApiTypes.Item<D> | null;
97
+ export type SingleBlockFieldValueInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = BlockInNestedResponse<D> | null;
83
98
  /**
84
99
  * =============================================================================
85
100
  * SHARED UTILITY FUNCTIONS
@@ -90,16 +105,16 @@ export type SingleBlockFieldValueWithNestedBlocks<D extends ItemDefinition = Ite
90
105
  * Validates if the input is a valid item (either block or record) ID
91
106
  */
92
107
  export declare function isItemId(input: unknown): input is string;
93
- export type ItemWithOptionalIdAndMeta<D extends ItemDefinition = ItemDefinition> = D extends any ? OptionalFields<RawApiTypes.Item<D>, 'id' | 'meta'> : never;
108
+ export type ItemWithOptionalIdAndMeta<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends any ? OptionalFields<RawApiTypes.Item<D>, 'id' | 'meta'> : never;
94
109
  /**
95
110
  * Validates if the input is a RawApiTypes.Item object (with optional `id` and `meta`)
96
111
  */
97
- export declare function isItemWithOptionalIdAndMeta<D extends ItemDefinition = ItemDefinition>(block: unknown): block is ItemWithOptionalIdAndMeta<D>;
98
- export type ItemWithOptionalMeta<D extends ItemDefinition = ItemDefinition> = D extends any ? OptionalFields<RawApiTypes.Item<D>, 'meta'> : never;
112
+ export declare function isItemWithOptionalIdAndMeta<D extends ItemTypeDefinition = ItemTypeDefinition>(block: unknown): block is ItemWithOptionalIdAndMeta<D>;
113
+ export type ItemWithOptionalMeta<D extends ItemTypeDefinition = ItemTypeDefinition> = D extends any ? OptionalFields<RawApiTypes.Item<D>, 'meta'> : never;
99
114
  /**
100
115
  * Validates if the input is a a complete RawApiTypes.Item object with optional `meta`
101
116
  */
102
- export declare function isItemWithOptionalMeta<D extends ItemDefinition = ItemDefinition>(block: unknown): block is ItemWithOptionalMeta<D>;
117
+ export declare function isItemWithOptionalMeta<D extends ItemTypeDefinition = ItemTypeDefinition>(block: unknown): block is ItemWithOptionalMeta<D>;
103
118
  /**
104
119
  * =============================================================================
105
120
  * TYPE GUARDS - Runtime validation functions
@@ -115,14 +130,14 @@ export declare function isLocalizedSingleBlockFieldValue(value: unknown): value
115
130
  * Type guard for Single Block field values in API request format.
116
131
  * Allows block as string ID, full object with ID, or object without ID.
117
132
  */
118
- export declare function isSingleBlockFieldValueAsRequest<D extends ItemDefinition = ItemDefinition>(value: unknown): value is SingleBlockFieldValueAsRequest<D>;
119
- export declare function isLocalizedSingleBlockFieldValueAsRequest<D extends ItemDefinition = ItemDefinition>(value: unknown): value is LocalizedFieldValue<SingleBlockFieldValueAsRequest<D>>;
133
+ export declare function isSingleBlockFieldValueInRequest<D extends ItemTypeDefinition = ItemTypeDefinition>(value: unknown): value is SingleBlockFieldValueInRequest<D>;
134
+ export declare function isLocalizedSingleBlockFieldValueInRequest<D extends ItemTypeDefinition = ItemTypeDefinition>(value: unknown): value is LocalizedFieldValue<SingleBlockFieldValueInRequest<D>>;
120
135
  /**
121
136
  * Type guard for Single Block field values with nested blocks (?nested=true format).
122
137
  * Ensures block is a full RawApiTypes.Item object with complete data.
123
138
  */
124
- export declare function isSingleBlockFieldValueWithNestedBlocks<D extends ItemDefinition = ItemDefinition>(value: unknown): value is SingleBlockFieldValueWithNestedBlocks<D>;
125
- export declare function isLocalizedSingleBlockFieldValueWithNestedBlocks<D extends ItemDefinition = ItemDefinition>(value: unknown): value is LocalizedFieldValue<SingleBlockFieldValueWithNestedBlocks<D>>;
139
+ export declare function isSingleBlockFieldValueInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition>(value: unknown): value is SingleBlockFieldValueInNestedResponse<D>;
140
+ export declare function isLocalizedSingleBlockFieldValueInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition>(value: unknown): value is LocalizedFieldValue<SingleBlockFieldValueInNestedResponse<D>>;
126
141
  export type SingleBlockFieldValidators = {
127
142
  /** Only accept references to block records of the specified block models */
128
143
  single_block_blocks: SingleBlockBlocksValidator;
@@ -1,3 +1,4 @@
1
+ import { isValidId } from '../utilities/id';
1
2
  import { isLocalizedFieldValue, } from '../utilities/normalizedFieldValues';
2
3
  /**
3
4
  * =============================================================================
@@ -40,7 +41,7 @@ export function isItemWithOptionalMeta(block) {
40
41
  * Checks for string structure and ensures block is a string reference.
41
42
  */
42
43
  export function isSingleBlockFieldValue(value) {
43
- return typeof value === 'string' || value === null;
44
+ return (typeof value === 'string' && isValidId(value)) || value === null;
44
45
  }
45
46
  export function isLocalizedSingleBlockFieldValue(value) {
46
47
  return (isLocalizedFieldValue(value) &&
@@ -50,7 +51,7 @@ export function isLocalizedSingleBlockFieldValue(value) {
50
51
  * Type guard for Single Block field values in API request format.
51
52
  * Allows block as string ID, full object with ID, or object without ID.
52
53
  */
53
- export function isSingleBlockFieldValueAsRequest(value) {
54
+ export function isSingleBlockFieldValueInRequest(value) {
54
55
  if (value === null)
55
56
  return true;
56
57
  // String ID - referencing existing block
@@ -59,22 +60,22 @@ export function isSingleBlockFieldValueAsRequest(value) {
59
60
  // Object (either with or without ID for updates/creation)
60
61
  return isItemWithOptionalIdAndMeta(value);
61
62
  }
62
- export function isLocalizedSingleBlockFieldValueAsRequest(value) {
63
+ export function isLocalizedSingleBlockFieldValueInRequest(value) {
63
64
  return (isLocalizedFieldValue(value) &&
64
- Object.values(value).every(isSingleBlockFieldValueAsRequest));
65
+ Object.values(value).every(isSingleBlockFieldValueInRequest));
65
66
  }
66
67
  /**
67
68
  * Type guard for Single Block field values with nested blocks (?nested=true format).
68
69
  * Ensures block is a full RawApiTypes.Item object with complete data.
69
70
  */
70
- export function isSingleBlockFieldValueWithNestedBlocks(value) {
71
+ export function isSingleBlockFieldValueInNestedResponse(value) {
71
72
  if (value === null)
72
73
  return true;
73
74
  // Must be a full object with ID (nested format always includes complete block objects)
74
75
  return isItemWithOptionalMeta(value);
75
76
  }
76
- export function isLocalizedSingleBlockFieldValueWithNestedBlocks(value) {
77
+ export function isLocalizedSingleBlockFieldValueInNestedResponse(value) {
77
78
  return (isLocalizedFieldValue(value) &&
78
- Object.values(value).every(isSingleBlockFieldValueWithNestedBlocks));
79
+ Object.values(value).every(isSingleBlockFieldValueInNestedResponse));
79
80
  }
80
81
  //# sourceMappingURL=single_block.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"single_block.js","sourceRoot":"","sources":["../../../src/fieldTypes/single_block.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,qBAAqB,GACtB,MAAM,oCAAoC,CAAC;AAwG5C;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAMD;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAEzC,KAAc;IACd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,IAAI,KAAK;QACf,KAAK,CAAC,IAAI,KAAK,MAAM;QACrB,YAAY,IAAI,KAAK;QACrB,eAAe,IAAI,KAAK,CACzB,CAAC;AACJ,CAAC;AAKD;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAEpC,KAAc;IACd,OAAO,CACL,2BAA2B,CAAC,KAAK,CAAC;QAClC,IAAI,IAAI,KAAK;QACb,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ,CAC7B,CAAC;AACJ,CAAC;AAED;;;;GAIG;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C5C,CAAC;AAED,MAAM,UAAU,yCAAyC,CAGvD,KAAc;IAEd,OAAO,CACL,qBAAqB,CAAC,KAAK,CAAC;QAC5B,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAC7D,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uCAAuC,CAErD,KAAc;IACd,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEhC,uFAAuF;IACvF,OAAO,sBAAsB,CAAC,KAAK,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,gDAAgD,CAG9D,KAAc;IAEd,OAAO,CACL,qBAAqB,CAAC,KAAK,CAAC;QAC5B,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,uCAAuC,CAAC,CACpE,CAAC;AACJ,CAAC"}
@@ -1,9 +1,8 @@
1
1
  import { type Block, type Document, type InlineBlock } from 'datocms-structured-text-utils';
2
- import type * as RawApiTypes from '../generated/RawApiTypes';
3
- import type { ItemDefinition } from '../utilities/itemDefinition';
2
+ import type { ItemTypeDefinition } from '../utilities/itemDefinition';
4
3
  import { type LocalizedFieldValue } from '../utilities/normalizedFieldValues';
5
4
  import type { StructuredTextEditorConfiguration } from './appearance/structured_text';
6
- import { type BlockItemInARequest } from './single_block';
5
+ import { type BlockInNestedResponse, type BlockInRequest } from './single_block';
7
6
  import type { LengthValidator } from './validators/length';
8
7
  import type { StructuredTextBlocksValidator } from './validators/structured_text_blocks';
9
8
  import type { StructuredTextInlineBlocksValidator } from './validators/structured_text_inline_blocks';
@@ -40,15 +39,15 @@ import type { StructuredTextLinksValidator } from './validators/structured_text_
40
39
  /**
41
40
  * Variant of 'block' structured text node for API requests
42
41
  */
43
- export type BlockAsRequest<D extends ItemDefinition = ItemDefinition> = Block<BlockItemInARequest<D>>;
42
+ export type BlockNodeInRequest<D extends ItemTypeDefinition = ItemTypeDefinition> = Block<BlockInRequest<D>>;
44
43
  /**
45
44
  * Variant of 'inlineBlock' structured text node for API requests
46
45
  */
47
- export type InlineBlockAsRequest<D extends ItemDefinition = ItemDefinition> = InlineBlock<BlockItemInARequest<D>>;
46
+ export type InlineBlockNodeInRequest<D extends ItemTypeDefinition = ItemTypeDefinition> = InlineBlock<BlockInRequest<D>>;
48
47
  /**
49
48
  * Variant of Structured Text document for API requests
50
49
  */
51
- export type DocumentAsRequest<BlockItemDefinition extends ItemDefinition = ItemDefinition, InlineBlockItemDefinition extends ItemDefinition = ItemDefinition> = Document<BlockItemInARequest<BlockItemDefinition>, BlockItemInARequest<InlineBlockItemDefinition>>;
50
+ export type DocumentInRequest<BlockItemTypeDefinition extends ItemTypeDefinition = ItemTypeDefinition, InlineBlockItemTypeDefinition extends ItemTypeDefinition = ItemTypeDefinition> = Document<BlockInRequest<BlockItemTypeDefinition>, BlockInRequest<InlineBlockItemTypeDefinition>>;
52
51
  /**
53
52
  * =============================================================================
54
53
  * NESTED VARIANTS - Types for API responses with ?nested=true parameter
@@ -61,15 +60,15 @@ export type DocumentAsRequest<BlockItemDefinition extends ItemDefinition = ItemD
61
60
  /**
62
61
  * Variant of 'block' structured text node for ?nested=true API responses
63
62
  */
64
- export type BlockWithNestedBlocks<D extends ItemDefinition = ItemDefinition> = Block<RawApiTypes.Item<D>>;
63
+ export type BlockNodeInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = Block<BlockInNestedResponse<D>>;
65
64
  /**
66
65
  * Variant of 'inlineBlock' structured text node for ?nested=true API responses
67
66
  */
68
- export type InlineBlockWithNestedBlocks<D extends ItemDefinition = ItemDefinition> = InlineBlock<RawApiTypes.Item<D>>;
67
+ export type InlineBlockNodeInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition> = InlineBlock<BlockInNestedResponse<D>>;
69
68
  /**
70
69
  * Variant of Structured Text document for ?nested=true API responses
71
70
  */
72
- export type DocumentWithNestedBlocks<BlockItemDefinition extends ItemDefinition = ItemDefinition, InlineBlockItemDefinition extends ItemDefinition = ItemDefinition> = Document<RawApiTypes.Item<BlockItemDefinition>, RawApiTypes.Item<InlineBlockItemDefinition>>;
71
+ export type DocumentInNestedResponse<BlockItemTypeDefinition extends ItemTypeDefinition = ItemTypeDefinition, InlineBlockItemTypeDefinition extends ItemTypeDefinition = ItemTypeDefinition> = Document<BlockInNestedResponse<BlockItemTypeDefinition>, BlockInNestedResponse<InlineBlockItemTypeDefinition>>;
73
72
  /**
74
73
  * =============================================================================
75
74
  * MAIN APPLICATION TYPES
@@ -80,8 +79,8 @@ export type DocumentWithNestedBlocks<BlockItemDefinition extends ItemDefinition
80
79
  * Can be null (empty field) or a document with blocks as string IDs
81
80
  */
82
81
  export type StructuredTextFieldValue = Document | null;
83
- export type StructuredTextFieldValueAsRequest<BlockItemDefinition extends ItemDefinition = ItemDefinition, InlineBlockItemDefinition extends ItemDefinition = ItemDefinition> = DocumentAsRequest<BlockItemDefinition, InlineBlockItemDefinition> | null;
84
- export type StructuredTextFieldValueWithNestedBlocks<BlockItemDefinition extends ItemDefinition = ItemDefinition, InlineBlockItemDefinition extends ItemDefinition = ItemDefinition> = DocumentWithNestedBlocks<BlockItemDefinition, InlineBlockItemDefinition> | null;
82
+ export type StructuredTextFieldValueInRequest<BlockItemTypeDefinition extends ItemTypeDefinition = ItemTypeDefinition, InlineBlockItemTypeDefinition extends ItemTypeDefinition = ItemTypeDefinition> = DocumentInRequest<BlockItemTypeDefinition, InlineBlockItemTypeDefinition> | null;
83
+ export type StructuredTextFieldValueInNestedResponse<BlockItemTypeDefinition extends ItemTypeDefinition = ItemTypeDefinition, InlineBlockItemTypeDefinition extends ItemTypeDefinition = ItemTypeDefinition> = DocumentInNestedResponse<BlockItemTypeDefinition, InlineBlockItemTypeDefinition> | null;
85
84
  /**
86
85
  * Type guard for basic structured text field values (blocks as string IDs only).
87
86
  * Checks for the expected structure and ensures all block/inlineBlock nodes have string IDs.
@@ -92,14 +91,14 @@ export declare function isLocalizedStructuredTextFieldValue(value: unknown): val
92
91
  * Type guard for structured text field values in API request format.
93
92
  * Allows blocks as string IDs, full objects with IDs, or objects without IDs.
94
93
  */
95
- export declare function isStructuredTextFieldValueAsRequest<BlockItemDefinition extends ItemDefinition = ItemDefinition, InlineBlockItemDefinition extends ItemDefinition = ItemDefinition>(value: unknown): value is StructuredTextFieldValueAsRequest<BlockItemDefinition, InlineBlockItemDefinition>;
96
- export declare function isLocalizedStructuredTextFieldValueAsRequest<D extends ItemDefinition = ItemDefinition>(value: unknown): value is LocalizedFieldValue<StructuredTextFieldValueAsRequest<D>>;
94
+ export declare function isStructuredTextFieldValueInRequest<BlockItemTypeDefinition extends ItemTypeDefinition = ItemTypeDefinition, InlineBlockItemTypeDefinition extends ItemTypeDefinition = ItemTypeDefinition>(value: unknown): value is StructuredTextFieldValueInRequest<BlockItemTypeDefinition, InlineBlockItemTypeDefinition>;
95
+ export declare function isLocalizedStructuredTextFieldValueInRequest<D extends ItemTypeDefinition = ItemTypeDefinition>(value: unknown): value is LocalizedFieldValue<StructuredTextFieldValueInRequest<D>>;
97
96
  /**
98
97
  * Type guard for structured text field values with nested blocks (?nested=true format).
99
98
  * Ensures all block/inlineBlock nodes have full RawApiTypes.Item objects.
100
99
  */
101
- export declare function isStructuredTextFieldValueWithNestedBlocks<D extends ItemDefinition = ItemDefinition>(value: unknown): value is StructuredTextFieldValueWithNestedBlocks<D>;
102
- export declare function isLocalizedStructuredTextFieldValueWithNestedBlocks<D extends ItemDefinition = ItemDefinition>(value: unknown): value is LocalizedFieldValue<StructuredTextFieldValueWithNestedBlocks<D>>;
100
+ export declare function isStructuredTextFieldValueInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition>(value: unknown): value is StructuredTextFieldValueInNestedResponse<D>;
101
+ export declare function isLocalizedStructuredTextFieldValueInNestedResponse<D extends ItemTypeDefinition = ItemTypeDefinition>(value: unknown): value is LocalizedFieldValue<StructuredTextFieldValueInNestedResponse<D>>;
103
102
  export type StructuredTextFieldValidators = {
104
103
  /** Only accept references to block records of the specified block models */
105
104
  structured_text_blocks: StructuredTextBlocksValidator;
@@ -1,4 +1,5 @@
1
1
  import { everyNode, isBlock, isDocument, isInlineBlock, } from 'datocms-structured-text-utils';
2
+ import { isValidId } from '../utilities/id';
2
3
  import { isLocalizedFieldValue, } from '../utilities/normalizedFieldValues';
3
4
  import { isItemId, isItemWithOptionalIdAndMeta, isItemWithOptionalMeta, } from './single_block';
4
5
  /**
@@ -27,7 +28,7 @@ export function isStructuredTextFieldValue(value) {
27
28
  }
28
29
  // Check that all block/inlineBlock nodes have string item IDs
29
30
  return validateAllBlockNodes(value.document, (node) => {
30
- return typeof node.item === 'string';
31
+ return typeof node.item === 'string' && isValidId(node.item);
31
32
  });
32
33
  }
33
34
  export function isLocalizedStructuredTextFieldValue(value) {
@@ -38,7 +39,7 @@ export function isLocalizedStructuredTextFieldValue(value) {
38
39
  * Type guard for structured text field values in API request format.
39
40
  * Allows blocks as string IDs, full objects with IDs, or objects without IDs.
40
41
  */
41
- export function isStructuredTextFieldValueAsRequest(value) {
42
+ export function isStructuredTextFieldValueInRequest(value) {
42
43
  if (value === null)
43
44
  return true;
44
45
  if (!isDocument(value)) {
@@ -54,15 +55,15 @@ export function isStructuredTextFieldValueAsRequest(value) {
54
55
  return isItemWithOptionalIdAndMeta(item);
55
56
  });
56
57
  }
57
- export function isLocalizedStructuredTextFieldValueAsRequest(value) {
58
+ export function isLocalizedStructuredTextFieldValueInRequest(value) {
58
59
  return (isLocalizedFieldValue(value) &&
59
- Object.values(value).every(isStructuredTextFieldValueAsRequest));
60
+ Object.values(value).every(isStructuredTextFieldValueInRequest));
60
61
  }
61
62
  /**
62
63
  * Type guard for structured text field values with nested blocks (?nested=true format).
63
64
  * Ensures all block/inlineBlock nodes have full RawApiTypes.Item objects.
64
65
  */
65
- export function isStructuredTextFieldValueWithNestedBlocks(value) {
66
+ export function isStructuredTextFieldValueInNestedResponse(value) {
66
67
  if (value === null)
67
68
  return true;
68
69
  if (!isDocument(value)) {
@@ -75,8 +76,8 @@ export function isStructuredTextFieldValueWithNestedBlocks(value) {
75
76
  return isItemWithOptionalMeta(item);
76
77
  });
77
78
  }
78
- export function isLocalizedStructuredTextFieldValueWithNestedBlocks(value) {
79
+ export function isLocalizedStructuredTextFieldValueInNestedResponse(value) {
79
80
  return (isLocalizedFieldValue(value) &&
80
- Object.values(value).every(isStructuredTextFieldValueWithNestedBlocks));
81
+ Object.values(value).every(isStructuredTextFieldValueInNestedResponse));
81
82
  }
82
83
  //# sourceMappingURL=structured_text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"structured_text.js","sourceRoot":"","sources":["../../../src/fieldTypes/structured_text.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,SAAS,EACT,OAAO,EACP,UAAU,EACV,aAAa,GACd,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAEL,qBAAqB,GACtB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAEL,QAAQ,EACR,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAsHxB;;;GAGG;AACH,SAAS,qBAAqB,CAC5B,IAAgB,EAChB,QAAsD;IAEtD,OAAO,SAAS,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE;QACrC,wEAAwE;QACxE,IAAI,OAAO,CAAC,WAAW,CAAC,IAAI,aAAa,CAAC,WAAW,CAAC,EAAE;YACtD,OAAO,QAAQ,CAAC,WAAW,CAAC,CAAC;SAC9B;QACD,qDAAqD;QACrD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CACxC,KAAc;IAEd,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEhC,IAAI,CAAC,UAAU,CAAmB,KAAK,CAAC,EAAE;QACxC,OAAO,KAAK,CAAC;KACd;IAED,8DAA8D;IAC9D,OAAO,qBAAqB,CAAC,KAAK,CAAC,QAAQ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