@datocms/cma-client 5.1.0 → 5.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/cjs/fieldTypes/rich_text.js +7 -7
- package/dist/cjs/fieldTypes/rich_text.js.map +1 -1
- package/dist/cjs/fieldTypes/single_block.js +21 -19
- package/dist/cjs/fieldTypes/single_block.js.map +1 -1
- package/dist/cjs/fieldTypes/structured_text.js +12 -24
- package/dist/cjs/fieldTypes/structured_text.js.map +1 -1
- package/dist/cjs/generated/{SchemaTypes.js → ApiTypes.js} +1 -1
- package/dist/cjs/generated/ApiTypes.js.map +1 -0
- package/dist/cjs/generated/Client.js +1 -1
- package/dist/cjs/generated/{SimpleSchemaTypes.js → RawApiTypes.js} +1 -1
- package/dist/cjs/generated/RawApiTypes.js.map +1 -0
- package/dist/cjs/generated/resources/AccessToken.js.map +1 -1
- package/dist/cjs/generated/resources/AuditLogEvent.js.map +1 -1
- package/dist/cjs/generated/resources/BuildEvent.js.map +1 -1
- package/dist/cjs/generated/resources/BuildTrigger.js.map +1 -1
- package/dist/cjs/generated/resources/EditingSession.js.map +1 -1
- package/dist/cjs/generated/resources/EmojiSuggestions.js.map +1 -1
- package/dist/cjs/generated/resources/Environment.js.map +1 -1
- package/dist/cjs/generated/resources/Field.js.map +1 -1
- package/dist/cjs/generated/resources/Fieldset.js.map +1 -1
- package/dist/cjs/generated/resources/Item.js.map +1 -1
- package/dist/cjs/generated/resources/ItemType.js.map +1 -1
- package/dist/cjs/generated/resources/ItemTypeFilter.js.map +1 -1
- package/dist/cjs/generated/resources/ItemVersion.js.map +1 -1
- package/dist/cjs/generated/resources/JobResult.js.map +1 -1
- package/dist/cjs/generated/resources/MaintenanceMode.js.map +1 -1
- package/dist/cjs/generated/resources/MenuItem.js.map +1 -1
- package/dist/cjs/generated/resources/Plugin.js.map +1 -1
- package/dist/cjs/generated/resources/PublicInfo.js.map +1 -1
- package/dist/cjs/generated/resources/Role.js.map +1 -1
- package/dist/cjs/generated/resources/ScheduledPublication.js.map +1 -1
- package/dist/cjs/generated/resources/ScheduledUnpublishing.js.map +1 -1
- package/dist/cjs/generated/resources/SchemaMenuItem.js.map +1 -1
- package/dist/cjs/generated/resources/SearchResult.js.map +1 -1
- package/dist/cjs/generated/resources/Session.js.map +1 -1
- package/dist/cjs/generated/resources/Site.js.map +1 -1
- package/dist/cjs/generated/resources/SiteInvitation.js.map +1 -1
- package/dist/cjs/generated/resources/SsoGroup.js.map +1 -1
- package/dist/cjs/generated/resources/SsoSettings.js.map +1 -1
- package/dist/cjs/generated/resources/SsoUser.js.map +1 -1
- package/dist/cjs/generated/resources/SubscriptionLimit.js.map +1 -1
- package/dist/cjs/generated/resources/Upload.js.map +1 -1
- package/dist/cjs/generated/resources/UploadCollection.js.map +1 -1
- package/dist/cjs/generated/resources/UploadFilter.js.map +1 -1
- package/dist/cjs/generated/resources/UploadRequest.js.map +1 -1
- package/dist/cjs/generated/resources/UploadSmartTag.js.map +1 -1
- package/dist/cjs/generated/resources/UploadTag.js.map +1 -1
- package/dist/cjs/generated/resources/UploadTrack.js.map +1 -1
- package/dist/cjs/generated/resources/UsageCounter.js.map +1 -1
- package/dist/cjs/generated/resources/User.js.map +1 -1
- package/dist/cjs/generated/resources/Webhook.js.map +1 -1
- package/dist/cjs/generated/resources/WebhookCall.js.map +1 -1
- package/dist/cjs/generated/resources/WhiteLabelSettings.js.map +1 -1
- package/dist/cjs/generated/resources/Workflow.js.map +1 -1
- package/dist/cjs/index.js +2 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/resources/Role.js.map +1 -1
- package/dist/cjs/utilities/blocks.js +7 -7
- package/dist/cjs/utilities/blocks.js.map +1 -1
- package/dist/cjs/utilities/buildBlockRecord.js.map +1 -1
- package/dist/cjs/utilities/fieldValue.js +253 -0
- package/dist/cjs/utilities/fieldValue.js.map +1 -0
- package/dist/cjs/utilities/fieldsContainingReferences.js.map +1 -1
- package/dist/cjs/utilities/recursiveBlocks.js +18 -19
- package/dist/cjs/utilities/recursiveBlocks.js.map +1 -1
- package/dist/cjs/utilities/schemaRepository.js.map +1 -1
- package/dist/esm/fieldTypes/rich_text.d.ts +7 -7
- package/dist/esm/fieldTypes/rich_text.js +6 -6
- package/dist/esm/fieldTypes/rich_text.js.map +1 -1
- package/dist/esm/fieldTypes/single_block.d.ts +30 -24
- package/dist/esm/fieldTypes/single_block.js +16 -14
- package/dist/esm/fieldTypes/single_block.js.map +1 -1
- package/dist/esm/fieldTypes/structured_text.d.ts +20 -85
- package/dist/esm/fieldTypes/structured_text.js +11 -23
- package/dist/esm/fieldTypes/structured_text.js.map +1 -1
- package/dist/esm/generated/{SimpleSchemaTypes.d.ts → ApiTypes.d.ts} +13 -8
- package/dist/esm/generated/ApiTypes.js +2 -0
- package/dist/esm/generated/ApiTypes.js.map +1 -0
- package/dist/esm/generated/Client.d.ts +1 -1
- package/dist/esm/generated/Client.js +1 -1
- package/dist/esm/generated/{SchemaTypes.d.ts → RawApiTypes.d.ts} +13 -8
- package/dist/esm/generated/RawApiTypes.js +2 -0
- package/dist/esm/generated/RawApiTypes.js.map +1 -0
- package/dist/esm/generated/resources/AccessToken.d.ts +14 -14
- package/dist/esm/generated/resources/AccessToken.js.map +1 -1
- package/dist/esm/generated/resources/AuditLogEvent.d.ts +4 -4
- package/dist/esm/generated/resources/AuditLogEvent.js.map +1 -1
- package/dist/esm/generated/resources/BuildEvent.d.ts +8 -8
- package/dist/esm/generated/resources/BuildEvent.js.map +1 -1
- package/dist/esm/generated/resources/BuildTrigger.d.ts +16 -16
- package/dist/esm/generated/resources/BuildTrigger.js.map +1 -1
- package/dist/esm/generated/resources/DailyUsage.d.ts +4 -4
- package/dist/esm/generated/resources/EditingSession.d.ts +7 -7
- package/dist/esm/generated/resources/EditingSession.js.map +1 -1
- package/dist/esm/generated/resources/EmojiSuggestions.d.ts +4 -4
- package/dist/esm/generated/resources/EmojiSuggestions.js.map +1 -1
- package/dist/esm/generated/resources/Environment.d.ts +14 -14
- package/dist/esm/generated/resources/Environment.js.map +1 -1
- package/dist/esm/generated/resources/Field.d.ts +213 -213
- package/dist/esm/generated/resources/Field.js.map +1 -1
- package/dist/esm/generated/resources/Fieldset.d.ts +12 -12
- package/dist/esm/generated/resources/Fieldset.js.map +1 -1
- package/dist/esm/generated/resources/Item.d.ts +36 -36
- package/dist/esm/generated/resources/Item.js.map +1 -1
- package/dist/esm/generated/resources/ItemType.d.ts +15 -15
- package/dist/esm/generated/resources/ItemType.js.map +1 -1
- package/dist/esm/generated/resources/ItemTypeFilter.d.ts +12 -12
- package/dist/esm/generated/resources/ItemTypeFilter.js.map +1 -1
- package/dist/esm/generated/resources/ItemVersion.d.ts +10 -10
- package/dist/esm/generated/resources/ItemVersion.js.map +1 -1
- package/dist/esm/generated/resources/JobResult.d.ts +4 -4
- package/dist/esm/generated/resources/JobResult.js.map +1 -1
- package/dist/esm/generated/resources/MaintenanceMode.d.ts +8 -8
- package/dist/esm/generated/resources/MaintenanceMode.js.map +1 -1
- package/dist/esm/generated/resources/MenuItem.d.ts +14 -14
- package/dist/esm/generated/resources/MenuItem.js.map +1 -1
- package/dist/esm/generated/resources/Plugin.d.ts +14 -14
- package/dist/esm/generated/resources/Plugin.js.map +1 -1
- package/dist/esm/generated/resources/PublicInfo.d.ts +4 -4
- package/dist/esm/generated/resources/PublicInfo.js.map +1 -1
- package/dist/esm/generated/resources/Role.d.ts +14 -14
- package/dist/esm/generated/resources/Role.js.map +1 -1
- package/dist/esm/generated/resources/ScheduledPublication.d.ts +6 -6
- package/dist/esm/generated/resources/ScheduledPublication.js.map +1 -1
- package/dist/esm/generated/resources/ScheduledUnpublishing.d.ts +6 -6
- package/dist/esm/generated/resources/ScheduledUnpublishing.js.map +1 -1
- package/dist/esm/generated/resources/SchemaMenuItem.d.ts +14 -14
- package/dist/esm/generated/resources/SchemaMenuItem.js.map +1 -1
- package/dist/esm/generated/resources/SearchResult.d.ts +6 -6
- package/dist/esm/generated/resources/SearchResult.js.map +1 -1
- package/dist/esm/generated/resources/Session.d.ts +4 -4
- package/dist/esm/generated/resources/Session.js.map +1 -1
- package/dist/esm/generated/resources/Site.d.ts +24 -24
- package/dist/esm/generated/resources/Site.js.map +1 -1
- package/dist/esm/generated/resources/SiteInvitation.d.ts +14 -14
- package/dist/esm/generated/resources/SiteInvitation.js.map +1 -1
- package/dist/esm/generated/resources/SsoGroup.d.ts +10 -10
- package/dist/esm/generated/resources/SsoGroup.js.map +1 -1
- package/dist/esm/generated/resources/SsoSettings.d.ts +8 -8
- package/dist/esm/generated/resources/SsoSettings.js.map +1 -1
- package/dist/esm/generated/resources/SsoUser.d.ts +10 -10
- package/dist/esm/generated/resources/SsoUser.js.map +1 -1
- package/dist/esm/generated/resources/SubscriptionFeature.d.ts +4 -4
- package/dist/esm/generated/resources/SubscriptionLimit.d.ts +6 -6
- package/dist/esm/generated/resources/SubscriptionLimit.js.map +1 -1
- package/dist/esm/generated/resources/Upload.d.ts +22 -22
- package/dist/esm/generated/resources/Upload.js.map +1 -1
- package/dist/esm/generated/resources/UploadCollection.d.ts +14 -14
- package/dist/esm/generated/resources/UploadCollection.js.map +1 -1
- package/dist/esm/generated/resources/UploadFilter.d.ts +12 -12
- package/dist/esm/generated/resources/UploadFilter.js.map +1 -1
- package/dist/esm/generated/resources/UploadRequest.d.ts +4 -4
- package/dist/esm/generated/resources/UploadRequest.js.map +1 -1
- package/dist/esm/generated/resources/UploadSmartTag.d.ts +6 -6
- package/dist/esm/generated/resources/UploadSmartTag.js.map +1 -1
- package/dist/esm/generated/resources/UploadTag.d.ts +8 -8
- package/dist/esm/generated/resources/UploadTag.js.map +1 -1
- package/dist/esm/generated/resources/UploadTrack.d.ts +10 -10
- package/dist/esm/generated/resources/UploadTrack.js.map +1 -1
- package/dist/esm/generated/resources/UsageCounter.d.ts +4 -4
- package/dist/esm/generated/resources/UsageCounter.js.map +1 -1
- package/dist/esm/generated/resources/User.d.ts +12 -12
- package/dist/esm/generated/resources/User.js.map +1 -1
- package/dist/esm/generated/resources/Webhook.d.ts +12 -12
- package/dist/esm/generated/resources/Webhook.js.map +1 -1
- package/dist/esm/generated/resources/WebhookCall.d.ts +9 -9
- package/dist/esm/generated/resources/WebhookCall.js.map +1 -1
- package/dist/esm/generated/resources/WhiteLabelSettings.d.ts +6 -6
- package/dist/esm/generated/resources/WhiteLabelSettings.js.map +1 -1
- package/dist/esm/generated/resources/Workflow.d.ts +11 -11
- package/dist/esm/generated/resources/Workflow.js.map +1 -1
- package/dist/esm/index.d.ts +5 -4
- package/dist/esm/index.js +1 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/resources/Role.d.ts +4 -4
- package/dist/esm/resources/Role.js.map +1 -1
- package/dist/esm/utilities/blocks.d.ts +17 -17
- package/dist/esm/utilities/blocks.js +3 -3
- package/dist/esm/utilities/blocks.js.map +1 -1
- package/dist/esm/utilities/buildBlockRecord.d.ts +5 -5
- package/dist/esm/utilities/buildBlockRecord.js.map +1 -1
- package/dist/esm/utilities/fieldValue.d.ts +166 -0
- package/dist/esm/utilities/fieldValue.js +237 -0
- package/dist/esm/utilities/fieldValue.js.map +1 -0
- package/dist/esm/utilities/fieldsContainingReferences.d.ts +4 -4
- package/dist/esm/utilities/fieldsContainingReferences.js.map +1 -1
- package/dist/esm/utilities/recursiveBlocks.d.ts +13 -10
- package/dist/esm/utilities/recursiveBlocks.js +19 -20
- package/dist/esm/utilities/recursiveBlocks.js.map +1 -1
- package/dist/esm/utilities/schemaRepository.d.ts +29 -26
- package/dist/esm/utilities/schemaRepository.js.map +1 -1
- package/dist/types/fieldTypes/rich_text.d.ts +7 -7
- package/dist/types/fieldTypes/single_block.d.ts +30 -24
- package/dist/types/fieldTypes/structured_text.d.ts +20 -85
- package/dist/types/generated/{SimpleSchemaTypes.d.ts → ApiTypes.d.ts} +13 -8
- package/dist/types/generated/Client.d.ts +1 -1
- package/dist/types/generated/{SchemaTypes.d.ts → RawApiTypes.d.ts} +13 -8
- package/dist/types/generated/resources/AccessToken.d.ts +14 -14
- package/dist/types/generated/resources/AuditLogEvent.d.ts +4 -4
- package/dist/types/generated/resources/BuildEvent.d.ts +8 -8
- package/dist/types/generated/resources/BuildTrigger.d.ts +16 -16
- package/dist/types/generated/resources/DailyUsage.d.ts +4 -4
- package/dist/types/generated/resources/EditingSession.d.ts +7 -7
- package/dist/types/generated/resources/EmojiSuggestions.d.ts +4 -4
- package/dist/types/generated/resources/Environment.d.ts +14 -14
- package/dist/types/generated/resources/Field.d.ts +213 -213
- package/dist/types/generated/resources/Fieldset.d.ts +12 -12
- package/dist/types/generated/resources/Item.d.ts +36 -36
- package/dist/types/generated/resources/ItemType.d.ts +15 -15
- package/dist/types/generated/resources/ItemTypeFilter.d.ts +12 -12
- package/dist/types/generated/resources/ItemVersion.d.ts +10 -10
- package/dist/types/generated/resources/JobResult.d.ts +4 -4
- package/dist/types/generated/resources/MaintenanceMode.d.ts +8 -8
- package/dist/types/generated/resources/MenuItem.d.ts +14 -14
- package/dist/types/generated/resources/Plugin.d.ts +14 -14
- package/dist/types/generated/resources/PublicInfo.d.ts +4 -4
- package/dist/types/generated/resources/Role.d.ts +14 -14
- package/dist/types/generated/resources/ScheduledPublication.d.ts +6 -6
- package/dist/types/generated/resources/ScheduledUnpublishing.d.ts +6 -6
- package/dist/types/generated/resources/SchemaMenuItem.d.ts +14 -14
- package/dist/types/generated/resources/SearchResult.d.ts +6 -6
- package/dist/types/generated/resources/Session.d.ts +4 -4
- package/dist/types/generated/resources/Site.d.ts +24 -24
- package/dist/types/generated/resources/SiteInvitation.d.ts +14 -14
- package/dist/types/generated/resources/SsoGroup.d.ts +10 -10
- package/dist/types/generated/resources/SsoSettings.d.ts +8 -8
- package/dist/types/generated/resources/SsoUser.d.ts +10 -10
- package/dist/types/generated/resources/SubscriptionFeature.d.ts +4 -4
- package/dist/types/generated/resources/SubscriptionLimit.d.ts +6 -6
- package/dist/types/generated/resources/Upload.d.ts +22 -22
- package/dist/types/generated/resources/UploadCollection.d.ts +14 -14
- package/dist/types/generated/resources/UploadFilter.d.ts +12 -12
- package/dist/types/generated/resources/UploadRequest.d.ts +4 -4
- package/dist/types/generated/resources/UploadSmartTag.d.ts +6 -6
- package/dist/types/generated/resources/UploadTag.d.ts +8 -8
- package/dist/types/generated/resources/UploadTrack.d.ts +10 -10
- package/dist/types/generated/resources/UsageCounter.d.ts +4 -4
- package/dist/types/generated/resources/User.d.ts +12 -12
- package/dist/types/generated/resources/Webhook.d.ts +12 -12
- package/dist/types/generated/resources/WebhookCall.d.ts +9 -9
- package/dist/types/generated/resources/WhiteLabelSettings.d.ts +6 -6
- package/dist/types/generated/resources/Workflow.d.ts +11 -11
- package/dist/types/index.d.ts +5 -4
- package/dist/types/resources/Role.d.ts +4 -4
- package/dist/types/utilities/blocks.d.ts +17 -17
- package/dist/types/utilities/buildBlockRecord.d.ts +5 -5
- package/dist/types/utilities/fieldValue.d.ts +166 -0
- package/dist/types/utilities/fieldsContainingReferences.d.ts +4 -4
- package/dist/types/utilities/recursiveBlocks.d.ts +13 -10
- package/dist/types/utilities/schemaRepository.d.ts +29 -26
- package/package.json +5 -5
- package/src/fieldTypes/rich_text.ts +14 -14
- package/src/fieldTypes/single_block.ts +48 -33
- package/src/fieldTypes/structured_text.ts +37 -153
- package/src/generated/{SimpleSchemaTypes.ts → ApiTypes.ts} +44 -9
- package/src/generated/Client.ts +2 -2
- package/src/generated/{SchemaTypes.ts → RawApiTypes.ts} +44 -9
- package/src/generated/resources/AccessToken.ts +32 -34
- package/src/generated/resources/AuditLogEvent.ts +8 -8
- package/src/generated/resources/BuildEvent.ts +16 -18
- package/src/generated/resources/BuildTrigger.ts +30 -30
- package/src/generated/resources/DailyUsage.ts +5 -5
- package/src/generated/resources/EditingSession.ts +12 -12
- package/src/generated/resources/EmojiSuggestions.ts +7 -7
- package/src/generated/resources/Environment.ts +33 -39
- package/src/generated/resources/Field.ts +40 -54
- package/src/generated/resources/Fieldset.ts +28 -36
- package/src/generated/resources/Item.ts +99 -126
- package/src/generated/resources/ItemType.ts +37 -45
- package/src/generated/resources/ItemTypeFilter.ts +26 -26
- package/src/generated/resources/ItemVersion.ts +22 -26
- package/src/generated/resources/JobResult.ts +6 -8
- package/src/generated/resources/MaintenanceMode.ts +13 -13
- package/src/generated/resources/MenuItem.ts +34 -44
- package/src/generated/resources/Plugin.ts +30 -42
- package/src/generated/resources/PublicInfo.ts +5 -7
- package/src/generated/resources/Role.ts +29 -44
- package/src/generated/resources/ScheduledPublication.ts +13 -13
- package/src/generated/resources/ScheduledUnpublishing.ts +13 -13
- package/src/generated/resources/SchemaMenuItem.ts +34 -34
- package/src/generated/resources/SearchResult.ts +12 -12
- package/src/generated/resources/Session.ts +8 -10
- package/src/generated/resources/Site.ts +43 -47
- package/src/generated/resources/SiteInvitation.ts +30 -30
- package/src/generated/resources/SsoGroup.ts +20 -24
- package/src/generated/resources/SsoSettings.ts +14 -16
- package/src/generated/resources/SsoUser.ts +18 -22
- package/src/generated/resources/SubscriptionFeature.ts +5 -5
- package/src/generated/resources/SubscriptionLimit.ts +9 -9
- package/src/generated/resources/Upload.ts +57 -73
- package/src/generated/resources/UploadCollection.ts +34 -34
- package/src/generated/resources/UploadFilter.ts +26 -26
- package/src/generated/resources/UploadRequest.ts +8 -8
- package/src/generated/resources/UploadSmartTag.ts +12 -12
- package/src/generated/resources/UploadTag.ts +18 -20
- package/src/generated/resources/UploadTrack.ts +25 -29
- package/src/generated/resources/UsageCounter.ts +8 -8
- package/src/generated/resources/User.ts +28 -39
- package/src/generated/resources/Webhook.ts +26 -34
- package/src/generated/resources/WebhookCall.ts +17 -19
- package/src/generated/resources/WhiteLabelSettings.ts +11 -11
- package/src/generated/resources/Workflow.ts +23 -29
- package/src/index.ts +7 -4
- package/src/resources/Role.ts +6 -6
- package/src/utilities/blocks.ts +36 -36
- package/src/utilities/buildBlockRecord.ts +4 -4
- package/src/utilities/{fieldValueLocalization.ts → fieldValue.ts} +161 -147
- package/src/utilities/fieldsContainingReferences.ts +4 -4
- package/src/utilities/recursiveBlocks.ts +47 -44
- package/src/utilities/schemaRepository.ts +53 -56
- package/dist/cjs/generated/SchemaTypes.js.map +0 -1
- package/dist/cjs/generated/SimpleSchemaTypes.js.map +0 -1
- package/dist/cjs/utilities/fieldValueLocalization.js +0 -218
- package/dist/cjs/utilities/fieldValueLocalization.js.map +0 -1
- package/dist/cjs/utilities/structuredText.js +0 -371
- package/dist/cjs/utilities/structuredText.js.map +0 -1
- package/dist/esm/generated/SchemaTypes.js +0 -2
- package/dist/esm/generated/SchemaTypes.js.map +0 -1
- package/dist/esm/generated/SimpleSchemaTypes.js +0 -2
- package/dist/esm/generated/SimpleSchemaTypes.js.map +0 -1
- package/dist/esm/utilities/fieldValueLocalization.d.ts +0 -123
- package/dist/esm/utilities/fieldValueLocalization.js +0 -204
- package/dist/esm/utilities/fieldValueLocalization.js.map +0 -1
- package/dist/esm/utilities/structuredText.d.ts +0 -177
- package/dist/esm/utilities/structuredText.js +0 -354
- package/dist/esm/utilities/structuredText.js.map +0 -1
- package/dist/types/utilities/fieldValueLocalization.d.ts +0 -123
- package/dist/types/utilities/structuredText.d.ts +0 -177
- package/src/utilities/structuredText.ts +0 -590
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as RawApiTypes from '../generated/RawApiTypes';
|
|
2
|
+
import type { FramedSingleBlockEditorConfiguration } from './appearance/framed_single_block';
|
|
3
|
+
import type { FramelessSingleBlockEditorConfiguration } from './appearance/frameless_single_block';
|
|
4
|
+
import type { RequiredValidator } from './validators/required';
|
|
5
|
+
import type { SingleBlockBlocksValidator } from './validators/single_block_blocks';
|
|
2
6
|
/**
|
|
3
7
|
* SINGLE BLOCK FIELD TYPE SYSTEM FOR DATOCMS
|
|
4
8
|
*
|
|
@@ -39,20 +43,26 @@ export type SingleBlockFieldValue = string | null;
|
|
|
39
43
|
* - Include full block object for updates
|
|
40
44
|
* - Omit ID for new blocks being created
|
|
41
45
|
*/
|
|
46
|
+
/** Represents an existing block in a CMA request */
|
|
47
|
+
export type UnchangedBlockInARequest = string;
|
|
48
|
+
/** Represents a block we want to update in a CMA request */
|
|
49
|
+
export type UpdatedBlockInARequest = OptionalFields<RawApiTypes.Item, 'meta'>;
|
|
50
|
+
/** Represents a new block to create in a CMA request */
|
|
51
|
+
export type NewBlockInARequest = OptionalFields<RawApiTypes.Item, 'id' | 'meta'>;
|
|
42
52
|
/**
|
|
43
53
|
* Union type representing the different ways a block can be specified in API requests:
|
|
44
|
-
* - string: Just the block ID (
|
|
45
|
-
* - Full block object with ID (
|
|
46
|
-
* - Block object without ID (
|
|
54
|
+
* - string: Just the block ID (to keep existing blocks unchanged)
|
|
55
|
+
* - Full block object with ID (to update an existing block)
|
|
56
|
+
* - Block object without ID (to create a new block)
|
|
47
57
|
*
|
|
48
58
|
* Also, 'meta' can always be omitted
|
|
49
59
|
*/
|
|
50
|
-
export type BlockItemInARequest =
|
|
60
|
+
export type BlockItemInARequest = UnchangedBlockInARequest | UpdatedBlockInARequest | NewBlockInARequest;
|
|
51
61
|
/**
|
|
52
62
|
* Single Block field value for API requests - allows flexible block representations:
|
|
53
|
-
* - string: Just the block ID (
|
|
54
|
-
* -
|
|
55
|
-
* -
|
|
63
|
+
* - string: Just the block ID (to keep existing blocks unchanged)
|
|
64
|
+
* - Full block object with ID (to update an existing block)
|
|
65
|
+
* - Block object without ID (to create a new block)
|
|
56
66
|
*/
|
|
57
67
|
export type SingleBlockFieldValueAsRequest = BlockItemInARequest | null;
|
|
58
68
|
/**
|
|
@@ -61,13 +71,13 @@ export type SingleBlockFieldValueAsRequest = BlockItemInARequest | null;
|
|
|
61
71
|
* =============================================================================
|
|
62
72
|
*
|
|
63
73
|
* When using the ?nested=true query parameter, the API returns Single Block data
|
|
64
|
-
* with embedded block fully populated as complete
|
|
74
|
+
* with embedded block fully populated as complete RawApiTypes.Item object instead
|
|
65
75
|
* of just string ID. This provides type safety for working with fully resolved data.
|
|
66
76
|
*/
|
|
67
77
|
/**
|
|
68
78
|
* Single Block field value with nested block - fully populated block object
|
|
69
79
|
*/
|
|
70
|
-
export type
|
|
80
|
+
export type SingleBlockFieldValueWithNestedBlocks = RawApiTypes.Item | null;
|
|
71
81
|
/**
|
|
72
82
|
* =============================================================================
|
|
73
83
|
* SHARED UTILITY FUNCTIONS
|
|
@@ -75,19 +85,19 @@ export type SingleBlockFieldValueWithResolvedBlocks = SchemaTypes.Item | null;
|
|
|
75
85
|
* These functions are used internally and can be imported by other modules
|
|
76
86
|
*/
|
|
77
87
|
/**
|
|
78
|
-
* Validates if a
|
|
88
|
+
* Validates if the input is a valid item (either block or record) ID
|
|
79
89
|
*/
|
|
80
|
-
export declare function
|
|
81
|
-
export type ItemWithOptionalIdAndMeta = OptionalFields<
|
|
90
|
+
export declare function isItemId(input: unknown): input is string;
|
|
91
|
+
export type ItemWithOptionalIdAndMeta = OptionalFields<RawApiTypes.Item, 'id' | 'meta'>;
|
|
82
92
|
/**
|
|
83
|
-
* Validates if
|
|
93
|
+
* Validates if the input is a RawApiTypes.Item object (with optional `id` and `meta`)
|
|
84
94
|
*/
|
|
85
|
-
export declare function
|
|
86
|
-
export type ItemWithOptionalMeta = OptionalFields<
|
|
95
|
+
export declare function isItemWithOptionalIdAndMeta(block: unknown): block is ItemWithOptionalIdAndMeta;
|
|
96
|
+
export type ItemWithOptionalMeta = OptionalFields<RawApiTypes.Item, 'meta'>;
|
|
87
97
|
/**
|
|
88
|
-
* Validates if
|
|
98
|
+
* Validates if the input is a a complete RawApiTypes.Item object with optional `meta`
|
|
89
99
|
*/
|
|
90
|
-
export declare function
|
|
100
|
+
export declare function isItemWithOptionalMeta(block: unknown): block is ItemWithOptionalMeta;
|
|
91
101
|
/**
|
|
92
102
|
* =============================================================================
|
|
93
103
|
* TYPE GUARDS - Runtime validation functions
|
|
@@ -105,13 +115,9 @@ export declare function isSingleBlockFieldValue(value: unknown): value is Single
|
|
|
105
115
|
export declare function isSingleBlockFieldValueAsRequest(value: unknown): value is SingleBlockFieldValueAsRequest;
|
|
106
116
|
/**
|
|
107
117
|
* Type guard for Single Block field values with nested blocks (?nested=true format).
|
|
108
|
-
* Ensures block is a full
|
|
118
|
+
* Ensures block is a full RawApiTypes.Item object with complete data.
|
|
109
119
|
*/
|
|
110
|
-
export declare function
|
|
111
|
-
import type { FramedSingleBlockEditorConfiguration } from './appearance/framed_single_block';
|
|
112
|
-
import type { FramelessSingleBlockEditorConfiguration } from './appearance/frameless_single_block';
|
|
113
|
-
import type { RequiredValidator } from './validators/required';
|
|
114
|
-
import type { SingleBlockBlocksValidator } from './validators/single_block_blocks';
|
|
120
|
+
export declare function isSingleBlockFieldValueWithNestedBlocks(value: unknown): value is SingleBlockFieldValueWithNestedBlocks;
|
|
115
121
|
export type SingleBlockFieldValidators = {
|
|
116
122
|
/** Only accept references to block records of the specified block models */
|
|
117
123
|
single_block_blocks: SingleBlockBlocksValidator;
|
|
@@ -5,25 +5,27 @@
|
|
|
5
5
|
* These functions are used internally and can be imported by other modules
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
* Validates if a
|
|
8
|
+
* Validates if the input is a valid item (either block or record) ID
|
|
9
9
|
*/
|
|
10
|
-
export function
|
|
11
|
-
return typeof
|
|
10
|
+
export function isItemId(input) {
|
|
11
|
+
return typeof input === 'string';
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Validates if
|
|
14
|
+
* Validates if the input is a RawApiTypes.Item object (with optional `id` and `meta`)
|
|
15
15
|
*/
|
|
16
|
-
export function
|
|
16
|
+
export function isItemWithOptionalIdAndMeta(block) {
|
|
17
17
|
return (typeof block === 'object' &&
|
|
18
18
|
block !== null &&
|
|
19
19
|
'type' in block &&
|
|
20
20
|
'attributes' in block);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* Validates if
|
|
23
|
+
* Validates if the input is a a complete RawApiTypes.Item object with optional `meta`
|
|
24
24
|
*/
|
|
25
|
-
export function
|
|
26
|
-
return
|
|
25
|
+
export function isItemWithOptionalMeta(block) {
|
|
26
|
+
return (isItemWithOptionalIdAndMeta(block) &&
|
|
27
|
+
'id' in block &&
|
|
28
|
+
typeof block.id === 'string');
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
31
|
* =============================================================================
|
|
@@ -44,20 +46,20 @@ export function isSingleBlockFieldValue(value) {
|
|
|
44
46
|
export function isSingleBlockFieldValueAsRequest(value) {
|
|
45
47
|
if (value === null)
|
|
46
48
|
return true;
|
|
47
|
-
// String ID
|
|
48
|
-
if (
|
|
49
|
+
// String ID - referencing existing block
|
|
50
|
+
if (isItemId(value))
|
|
49
51
|
return true;
|
|
50
52
|
// Object (either with or without ID for updates/creation)
|
|
51
|
-
return
|
|
53
|
+
return isItemWithOptionalIdAndMeta(value);
|
|
52
54
|
}
|
|
53
55
|
/**
|
|
54
56
|
* Type guard for Single Block field values with nested blocks (?nested=true format).
|
|
55
|
-
* Ensures block is a full
|
|
57
|
+
* Ensures block is a full RawApiTypes.Item object with complete data.
|
|
56
58
|
*/
|
|
57
|
-
export function
|
|
59
|
+
export function isSingleBlockFieldValueWithNestedBlocks(value) {
|
|
58
60
|
if (value === null)
|
|
59
61
|
return true;
|
|
60
62
|
// Must be a full object with ID (nested format always includes complete block objects)
|
|
61
|
-
return
|
|
63
|
+
return isItemWithOptionalMeta(value);
|
|
62
64
|
}
|
|
63
65
|
//# sourceMappingURL=single_block.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single_block.js","sourceRoot":"","sources":["../../../src/fieldTypes/single_block.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"single_block.js","sourceRoot":"","sources":["../../../src/fieldTypes/single_block.ts"],"names":[],"mappings":"AAiGA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAOD;;GAEG;AACH,MAAM,UAAU,2BAA2B,CACzC,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,IAAI,KAAK;QACf,YAAY,IAAI,KAAK,CACtB,CAAC;AACJ,CAAC;AAID;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,KAAc;IAEd,OAAO,CACL,2BAA2B,CAAC,KAAK,CAAC;QAClC,IAAI,IAAI,KAAK;QACb,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ,CAC7B,CAAC;AACJ,CAAC;AAED;;;;GAIG;AAEH;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CACrC,KAAc;IAEd,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gCAAgC,CAC9C,KAAc;IAEd,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEhC,yCAAyC;IACzC,IAAI,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEjC,0DAA0D;IAC1D,OAAO,2BAA2B,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uCAAuC,CACrD,KAAc;IAEd,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEhC,uFAAuF;IACvF,OAAO,sBAAsB,CAAC,KAAK,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { type Block, type Document, type InlineBlock
|
|
2
|
-
import type * as
|
|
1
|
+
import { type Block, type Document, type InlineBlock } from 'datocms-structured-text-utils';
|
|
2
|
+
import type * as RawApiTypes from '../generated/RawApiTypes';
|
|
3
|
+
import type { StructuredTextEditorConfiguration } from './appearance/structured_text';
|
|
3
4
|
import { type BlockItemInARequest } from './single_block';
|
|
5
|
+
import type { LengthValidator } from './validators/length';
|
|
6
|
+
import type { StructuredTextBlocksValidator } from './validators/structured_text_blocks';
|
|
7
|
+
import type { StructuredTextInlineBlocksValidator } from './validators/structured_text_inline_blocks';
|
|
8
|
+
import type { StructuredTextLinksValidator } from './validators/structured_text_links';
|
|
4
9
|
/**
|
|
5
10
|
* STRUCTURED TEXT TYPE SYSTEM FOR DATOCMS
|
|
6
11
|
*
|
|
@@ -10,10 +15,10 @@ import { type BlockItemInARequest } from './single_block';
|
|
|
10
15
|
* The challenge we're solving:
|
|
11
16
|
* - DatoCMS structured text can contain "blocks" (embedded content items) in bloth 'block'
|
|
12
17
|
* and 'inlineBlock' nodes
|
|
13
|
-
* - By default,
|
|
18
|
+
* - By default, CMA responses contain blocks as string IDs (lightweight references)
|
|
14
19
|
* - With ?nested=true parameter though, API responses contain blocks as full item objects
|
|
15
20
|
* (which in turn can contain other blocks)
|
|
16
|
-
* - For
|
|
21
|
+
* - For CMA requests, blocks can be represented as:
|
|
17
22
|
* 1. String IDs (referencing existing items)
|
|
18
23
|
* 2. Full item objects with IDs (for updates)
|
|
19
24
|
* 3. Item objects without IDs (for creation)
|
|
@@ -33,62 +38,36 @@ import { type BlockItemInARequest } from './single_block';
|
|
|
33
38
|
/**
|
|
34
39
|
* Variant of 'block' structured text node for API requests
|
|
35
40
|
*/
|
|
36
|
-
export type BlockAsRequest =
|
|
37
|
-
item: BlockItemInARequest;
|
|
38
|
-
};
|
|
41
|
+
export type BlockAsRequest = Block<BlockItemInARequest>;
|
|
39
42
|
/**
|
|
40
43
|
* Variant of 'inlineBlock' structured text node for API requests
|
|
41
44
|
*/
|
|
42
|
-
export type InlineBlockAsRequest =
|
|
43
|
-
item: BlockItemInARequest;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Generic type to transform a node that might be containing a 'block' or 'inlineBlock' as a (deeply nested) children to its variant for API requests
|
|
47
|
-
*/
|
|
48
|
-
export type NodeAsRequest<T> = WithMappedChildren<T, DeepMapVariants<T extends {
|
|
49
|
-
children: infer C;
|
|
50
|
-
} ? C : never, BlockAsRequest, InlineBlockAsRequest>>;
|
|
45
|
+
export type InlineBlockAsRequest = InlineBlock<BlockItemInARequest>;
|
|
51
46
|
/**
|
|
52
47
|
* Variant of Structured Text document for API requests
|
|
53
48
|
*/
|
|
54
|
-
export type DocumentAsRequest =
|
|
55
|
-
schema: 'dast';
|
|
56
|
-
document: NodeAsRequest<Root>;
|
|
57
|
-
};
|
|
49
|
+
export type DocumentAsRequest = Document<BlockItemInARequest>;
|
|
58
50
|
/**
|
|
59
51
|
* =============================================================================
|
|
60
52
|
* NESTED VARIANTS - Types for API responses with ?nested=true parameter
|
|
61
53
|
* =============================================================================
|
|
62
54
|
*
|
|
63
|
-
* When using the GET /items?nested=true, the
|
|
64
|
-
* with embedded blocks fully populated as complete
|
|
55
|
+
* When using the GET /items?nested=true, the CMA returns Structured Text documents
|
|
56
|
+
* with embedded blocks fully populated as complete RawApiTypes.Item objects instead
|
|
65
57
|
* of just string IDs.
|
|
66
58
|
*/
|
|
67
59
|
/**
|
|
68
60
|
* Variant of 'block' structured text node for ?nested=true API responses
|
|
69
61
|
*/
|
|
70
|
-
export type
|
|
71
|
-
item: SchemaTypes.Item;
|
|
72
|
-
};
|
|
62
|
+
export type BlockWithNestedBlocks = Block<RawApiTypes.Item>;
|
|
73
63
|
/**
|
|
74
64
|
* Variant of 'inlineBlock' structured text node for ?nested=true API responses
|
|
75
65
|
*/
|
|
76
|
-
export type
|
|
77
|
-
item: SchemaTypes.Item;
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* Generic type to transform a node that might be containing a 'block' or 'inlineBlock' as a (deeply nested) children to it's variant for ?nested=true API responses
|
|
81
|
-
*/
|
|
82
|
-
export type NodeWithResolvedBlocks<T> = WithMappedChildren<T, DeepMapVariants<T extends {
|
|
83
|
-
children: infer C;
|
|
84
|
-
} ? C : never, BlockWithResolvedBlocks, InlineBlockWithResolvedBlocks>>;
|
|
66
|
+
export type InlineBlockWithNestedBlocks = InlineBlock<RawApiTypes.Item>;
|
|
85
67
|
/**
|
|
86
68
|
* Variant of Structured Text document for ?nested=true API responses
|
|
87
69
|
*/
|
|
88
|
-
export type
|
|
89
|
-
schema: 'dast';
|
|
90
|
-
document: NodeWithResolvedBlocks<Root>;
|
|
91
|
-
};
|
|
70
|
+
export type DocumentWithNestedBlocks = Document<RawApiTypes.Item>;
|
|
92
71
|
/**
|
|
93
72
|
* =============================================================================
|
|
94
73
|
* MAIN APPLICATION TYPES
|
|
@@ -100,7 +79,7 @@ export type DocumentWithResolvedBlocks = {
|
|
|
100
79
|
*/
|
|
101
80
|
export type StructuredTextFieldValue = Document | null;
|
|
102
81
|
export type StructuredTextFieldValueAsRequest = DocumentAsRequest | null;
|
|
103
|
-
export type
|
|
82
|
+
export type StructuredTextFieldValueWithNestedBlocks = DocumentWithNestedBlocks | null;
|
|
104
83
|
/**
|
|
105
84
|
* Type guard for basic structured text field values (blocks as string IDs only).
|
|
106
85
|
* Checks for the expected structure and ensures all block/inlineBlock nodes have string IDs.
|
|
@@ -113,52 +92,9 @@ export declare function isStructuredTextFieldValue(value: unknown): value is Str
|
|
|
113
92
|
export declare function isStructuredTextFieldValueAsRequest(value: unknown): value is StructuredTextFieldValueAsRequest;
|
|
114
93
|
/**
|
|
115
94
|
* Type guard for structured text field values with nested blocks (?nested=true format).
|
|
116
|
-
* Ensures all block/inlineBlock nodes have full
|
|
117
|
-
*/
|
|
118
|
-
export declare function isStructuredTextFieldValueWithResolvedBlocks(value: unknown): value is StructuredTextFieldValueWithResolvedBlocks;
|
|
119
|
-
/**
|
|
120
|
-
* =============================================================================
|
|
121
|
-
* SHARED TRANSFORMATION UTILITIES
|
|
122
|
-
* =============================================================================
|
|
123
|
-
*
|
|
124
|
-
* These utility types provide the machinery for automatically transforming
|
|
125
|
-
* structured text types between their different variants. The goal is to
|
|
126
|
-
* recursively walk through complex nested structures and apply the appropriate
|
|
127
|
-
* transformations to Block and InlineBlock nodes while preserving all other types.
|
|
128
|
-
*/
|
|
129
|
-
/**
|
|
130
|
-
* Utility type that preserves the structure of T but replaces its children with ChildrenType.
|
|
131
|
-
* If T doesn't have children, it returns T unchanged.
|
|
132
|
-
*/
|
|
133
|
-
type WithMappedChildren<T, ChildrenType> = T extends {
|
|
134
|
-
children: any;
|
|
135
|
-
} ? Omit<T, 'children'> & {
|
|
136
|
-
children: ChildrenType;
|
|
137
|
-
} : T;
|
|
138
|
-
/**
|
|
139
|
-
* Generic transformation type that replace 'block' and 'inlineBlock' node types to their variants.
|
|
95
|
+
* Ensures all block/inlineBlock nodes have full RawApiTypes.Item objects.
|
|
140
96
|
*/
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Recursively transform a Structured Text node type using the provided variants for 'block' and 'inlineBlock' nodes.
|
|
144
|
-
*
|
|
145
|
-
* This handles three cases:
|
|
146
|
-
* _ Arrays: Transform each array element recursively
|
|
147
|
-
* _ Objects with children: Transform the object itself AND recursively transform its children
|
|
148
|
-
* _ Leaf nodes: Apply the variant mapping
|
|
149
|
-
*/
|
|
150
|
-
type DeepMapVariants<T, BlockVariant, InlineBlockVariant> = T extends (infer U)[] ? DeepMapVariants<U, BlockVariant, InlineBlockVariant>[] : T extends {
|
|
151
|
-
children: infer Children;
|
|
152
|
-
} ? T extends {
|
|
153
|
-
children: any;
|
|
154
|
-
} ? Omit<T, 'children'> & {
|
|
155
|
-
children: DeepMapVariants<Children, BlockVariant, InlineBlockVariant>;
|
|
156
|
-
} : MapVariants<T, BlockVariant, InlineBlockVariant> : MapVariants<T, BlockVariant, InlineBlockVariant>;
|
|
157
|
-
import type { StructuredTextEditorConfiguration } from './appearance/structured_text';
|
|
158
|
-
import type { LengthValidator } from './validators/length';
|
|
159
|
-
import type { StructuredTextBlocksValidator } from './validators/structured_text_blocks';
|
|
160
|
-
import type { StructuredTextInlineBlocksValidator } from './validators/structured_text_inline_blocks';
|
|
161
|
-
import type { StructuredTextLinksValidator } from './validators/structured_text_links';
|
|
97
|
+
export declare function isStructuredTextFieldValueWithNestedBlocks(value: unknown): value is StructuredTextFieldValueWithNestedBlocks;
|
|
162
98
|
export type StructuredTextFieldValidators = {
|
|
163
99
|
/** Only accept references to block records of the specified block models */
|
|
164
100
|
structured_text_blocks: StructuredTextBlocksValidator;
|
|
@@ -178,4 +114,3 @@ export type StructuredTextFieldAppearance = {
|
|
|
178
114
|
/** Plugin configuration */
|
|
179
115
|
parameters: Record<string, unknown>;
|
|
180
116
|
};
|
|
181
|
-
export {};
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
import { isBlock,
|
|
2
|
-
import {
|
|
3
|
-
import { isBlockObject, isBlockObjectWithId, isBlockStringId, } from './single_block';
|
|
4
|
-
/**
|
|
5
|
-
* Helper function to validate if a value has the expected structured text document structure.
|
|
6
|
-
* Checks for the presence of 'schema' and 'document' properties on a non-null object.
|
|
7
|
-
*/
|
|
8
|
-
function isValidDocumentStructure(value) {
|
|
9
|
-
return (typeof value === 'object' &&
|
|
10
|
-
value !== null &&
|
|
11
|
-
'schema' in value &&
|
|
12
|
-
'document' in value);
|
|
13
|
-
}
|
|
1
|
+
import { everyNode, isBlock, isDocument, isInlineBlock, } from 'datocms-structured-text-utils';
|
|
2
|
+
import { isItemId, isItemWithOptionalIdAndMeta, isItemWithOptionalMeta, } from './single_block';
|
|
14
3
|
/**
|
|
15
4
|
* Utility function to validate all block/inlineBlock nodes in a structured text document tree.
|
|
16
5
|
* Calls the provided callback for each block/inlineBlock node found and returns true only if all pass.
|
|
@@ -18,8 +7,7 @@ function isValidDocumentStructure(value) {
|
|
|
18
7
|
function validateAllBlockNodes(node, callback) {
|
|
19
8
|
return everyNode(node, (currentNode) => {
|
|
20
9
|
// If this is a block or inlineBlock node, validate it with the callback
|
|
21
|
-
if (
|
|
22
|
-
(isBlock(currentNode) || isInlineBlock(currentNode))) {
|
|
10
|
+
if (isBlock(currentNode) || isInlineBlock(currentNode)) {
|
|
23
11
|
return callback(currentNode);
|
|
24
12
|
}
|
|
25
13
|
// For all other node types, they're valid by default
|
|
@@ -33,7 +21,7 @@ function validateAllBlockNodes(node, callback) {
|
|
|
33
21
|
export function isStructuredTextFieldValue(value) {
|
|
34
22
|
if (value === null)
|
|
35
23
|
return true;
|
|
36
|
-
if (!
|
|
24
|
+
if (!isDocument(value)) {
|
|
37
25
|
return false;
|
|
38
26
|
}
|
|
39
27
|
// Check that all block/inlineBlock nodes have string item IDs
|
|
@@ -48,34 +36,34 @@ export function isStructuredTextFieldValue(value) {
|
|
|
48
36
|
export function isStructuredTextFieldValueAsRequest(value) {
|
|
49
37
|
if (value === null)
|
|
50
38
|
return true;
|
|
51
|
-
if (!
|
|
39
|
+
if (!isDocument(value)) {
|
|
52
40
|
return false;
|
|
53
41
|
}
|
|
54
42
|
// Check that all block/inlineBlock nodes have valid request format items
|
|
55
43
|
return validateAllBlockNodes(value.document, (node) => {
|
|
56
44
|
const item = node.item;
|
|
57
45
|
// String ID
|
|
58
|
-
if (
|
|
46
|
+
if (isItemId(item))
|
|
59
47
|
return true;
|
|
60
48
|
// Object (either with or without ID)
|
|
61
|
-
return
|
|
49
|
+
return isItemWithOptionalIdAndMeta(item);
|
|
62
50
|
});
|
|
63
51
|
}
|
|
64
52
|
/**
|
|
65
53
|
* Type guard for structured text field values with nested blocks (?nested=true format).
|
|
66
|
-
* Ensures all block/inlineBlock nodes have full
|
|
54
|
+
* Ensures all block/inlineBlock nodes have full RawApiTypes.Item objects.
|
|
67
55
|
*/
|
|
68
|
-
export function
|
|
56
|
+
export function isStructuredTextFieldValueWithNestedBlocks(value) {
|
|
69
57
|
if (value === null)
|
|
70
58
|
return true;
|
|
71
|
-
if (!
|
|
59
|
+
if (!isDocument(value)) {
|
|
72
60
|
return false;
|
|
73
61
|
}
|
|
74
62
|
// Check that all block/inlineBlock nodes have full item objects
|
|
75
63
|
return validateAllBlockNodes(value.document, (node) => {
|
|
76
64
|
const item = node.item;
|
|
77
65
|
// Must be a full object with ID (nested format always includes full items)
|
|
78
|
-
return
|
|
66
|
+
return isItemWithOptionalMeta(item);
|
|
79
67
|
});
|
|
80
68
|
}
|
|
81
69
|
//# 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,OAAO,EACP,
|
|
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,QAAQ,EACR,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AA4FxB;;;GAGG;AACH,SAAS,qBAAqB,CAC5B,IAAa,EACb,QAAsD;IAEtD,OAAO,SAAS,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE;QACrC,wEAAwE;QACxE,IAAI,OAAO,CAAI,WAAW,CAAC,IAAI,aAAa,CAAI,WAAW,CAAC,EAAE;YAC5D,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,CAAU,KAAK,CAAC,EAAE;QAC/B,OAAO,KAAK,CAAC;KACd;IAED,8DAA8D;IAC9D,OAAO,qBAAqB,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QACpD,OAAO,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mCAAmC,CACjD,KAAc;IAEd,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEhC,IAAI,CAAC,UAAU,CAAU,KAAK,CAAC,EAAE;QAC/B,OAAO,KAAK,CAAC;KACd;IAED,yEAAyE;IACzE,OAAO,qBAAqB,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QACpD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAEvB,YAAY;QACZ,IAAI,QAAQ,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;QAEhC,qCAAqC;QACrC,OAAO,2BAA2B,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0CAA0C,CACxD,KAAc;IAEd,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEhC,IAAI,CAAC,UAAU,CAAU,KAAK,CAAC,EAAE;QAC/B,OAAO,KAAK,CAAC;KACd;IAED,gEAAgE;IAChE,OAAO,qBAAqB,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QACpD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAEvB,2EAA2E;QAC3E,OAAO,sBAAsB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -4,7 +4,7 @@ import type { BooleanFieldAppearance, BooleanFieldValidators, BooleanFieldValue,
|
|
|
4
4
|
*/
|
|
5
5
|
type FieldAppearanceConfig<TAppearance> = TAppearance & Omit<RawFieldAttributes['appearance'], keyof TAppearance>;
|
|
6
6
|
/**
|
|
7
|
-
* Base field configuration for attributes (non-localized), extending the original
|
|
7
|
+
* Base field configuration for attributes (non-localized), extending the original RawApiTypes
|
|
8
8
|
*/
|
|
9
9
|
type NonLocalizedFieldAttributesForFieldType<SourceType, FieldType extends RawFieldAttributes['field_type'], FieldValue, FieldValidators, FieldAppearance> = Omit<SourceType, 'field_type' | 'default_value' | 'validators' | 'appearance' | 'localized'> & {
|
|
10
10
|
field_type: FieldType;
|
|
@@ -14,7 +14,7 @@ type NonLocalizedFieldAttributesForFieldType<SourceType, FieldType extends RawFi
|
|
|
14
14
|
appearance: FieldAppearanceConfig<FieldAppearance>;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
-
* Base field configuration for attributes (localized), extending the original
|
|
17
|
+
* Base field configuration for attributes (localized), extending the original RawApiTypes
|
|
18
18
|
*/
|
|
19
19
|
type LocalizedFieldAttributesForFieldType<SourceType, FieldType extends RawFieldAttributes['field_type'], FieldValue, FieldValidators, FieldAppearance> = Omit<SourceType, 'field_type' | 'default_value' | 'validators' | 'appearance' | 'localized'> & {
|
|
20
20
|
field_type: FieldType;
|
|
@@ -30,16 +30,21 @@ type FieldAttributesForFieldType<SourceType, FieldType extends RawFieldAttribute
|
|
|
30
30
|
type GenericFieldAttributes<SourceType> = FieldAttributesForFieldType<SourceType, 'boolean', BooleanFieldValue, BooleanFieldValidators, BooleanFieldAppearance> | FieldAttributesForFieldType<SourceType, 'color', ColorFieldValue, ColorFieldValidators, ColorFieldAppearance> | FieldAttributesForFieldType<SourceType, 'date', DateFieldValue, DateFieldValidators, DateFieldAppearance> | FieldAttributesForFieldType<SourceType, 'date_time', DateTimeFieldValue, DateTimeFieldValidators, DateTimeFieldAppearance> | FieldAttributesForFieldType<SourceType, 'file', null, FileFieldValidators, FileFieldAppearance> | FieldAttributesForFieldType<SourceType, 'float', FloatFieldValue, FloatFieldValidators, FloatFieldAppearance> | FieldAttributesForFieldType<SourceType, 'gallery', null, GalleryFieldValidators, GalleryFieldAppearance> | FieldAttributesForFieldType<SourceType, 'integer', IntegerFieldValue, IntegerFieldValidators, IntegerFieldAppearance> | FieldAttributesForFieldType<SourceType, 'json', JsonFieldValue, JsonFieldValidators, JsonFieldAppearance> | FieldAttributesForFieldType<SourceType, 'lat_lon', LocationFieldValue, LocationFieldValidators, LocationFieldAppearance> | FieldAttributesForFieldType<SourceType, 'link', null, LinkFieldValidators, LinkFieldAppearance> | FieldAttributesForFieldType<SourceType, 'links', null, LinksFieldValidators, LinksFieldAppearance> | FieldAttributesForFieldType<SourceType, 'rich_text', null, RichTextFieldValidators, RichTextFieldAppearance> | FieldAttributesForFieldType<SourceType, 'seo', null, SeoFieldValidators, SeoFieldAppearance> | FieldAttributesForFieldType<SourceType, 'single_block', null, SingleBlockFieldValidators, SingleBlockFieldAppearance> | FieldAttributesForFieldType<SourceType, 'slug', null, SlugFieldValidators, SlugFieldAppearance> | FieldAttributesForFieldType<SourceType, 'string', StringFieldValue, StringFieldValidators, StringFieldAppearance> | FieldAttributesForFieldType<SourceType, 'structured_text', null, StructuredTextFieldValidators, StructuredTextFieldAppearance> | FieldAttributesForFieldType<SourceType, 'text', TextFieldValue, TextFieldValidators, TextFieldAppearance> | FieldAttributesForFieldType<SourceType, 'video', null, VideoFieldValidators, VideoFieldAppearance>;
|
|
31
31
|
export type FieldAttributes = GenericFieldAttributes<RawFieldAttributes>;
|
|
32
32
|
export type Field = GenericFieldAttributes<RawField>;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
type LocalizedFieldCreateConfigForFieldType<SourceType, FieldType extends RawFieldAttributes['field_type'], FieldValue, FieldValidators, FieldAppearance> = Omit<SourceType, 'field_type' | 'default_value' | 'validators' | 'appearance' | 'localized'> & {
|
|
34
|
+
field_type: FieldType;
|
|
35
|
+
localized: true;
|
|
36
|
+
default_value?: Record<string, FieldValue>;
|
|
37
|
+
validators?: FieldValidators;
|
|
38
|
+
appearance?: FieldAppearanceConfig<FieldAppearance>;
|
|
39
|
+
};
|
|
40
|
+
type NonLocalizedFieldCreateConfigForFieldType<SourceType, FieldType extends RawFieldAttributes['field_type'], FieldValue, FieldValidators, FieldAppearance> = Omit<SourceType, 'field_type' | 'default_value' | 'validators' | 'appearance' | 'localized'> & {
|
|
38
41
|
field_type: FieldType;
|
|
39
|
-
|
|
42
|
+
localized?: false;
|
|
43
|
+
default_value?: FieldValue;
|
|
40
44
|
validators?: FieldValidators;
|
|
41
45
|
appearance?: FieldAppearanceConfig<FieldAppearance>;
|
|
42
46
|
};
|
|
47
|
+
type FieldCreateConfigForFieldType<SourceType, FieldType extends RawFieldAttributes['field_type'], FieldValue, FieldValidators, FieldAppearance> = LocalizedFieldCreateConfigForFieldType<SourceType, FieldType, FieldValue, FieldValidators, FieldAppearance> | NonLocalizedFieldCreateConfigForFieldType<SourceType, FieldType, FieldValue, FieldValidators, FieldAppearance>;
|
|
43
48
|
type FieldCreateConfig<SourceType> = FieldCreateConfigForFieldType<SourceType, 'boolean', BooleanFieldValue, BooleanFieldValidators, BooleanFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'color', ColorFieldValue, ColorFieldValidators, ColorFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'date', DateFieldValue, DateFieldValidators, DateFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'date_time', DateTimeFieldValue, DateTimeFieldValidators, DateTimeFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'file', null, FileFieldValidators, FileFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'float', FloatFieldValue, FloatFieldValidators, FloatFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'gallery', null, GalleryFieldValidators, GalleryFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'integer', IntegerFieldValue, IntegerFieldValidators, IntegerFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'json', JsonFieldValue, JsonFieldValidators, JsonFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'lat_lon', LocationFieldValue, LocationFieldValidators, LocationFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'link', null, LinkFieldValidators, LinkFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'links', null, LinksFieldValidators, LinksFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'rich_text', null, RichTextFieldValidators, RichTextFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'seo', null, SeoFieldValidators, SeoFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'single_block', null, SingleBlockFieldValidators, SingleBlockFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'slug', null, SlugFieldValidators, SlugFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'string', StringFieldValue, StringFieldValidators, StringFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'structured_text', null, StructuredTextFieldValidators, StructuredTextFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'text', TextFieldValue, TextFieldValidators, TextFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'video', null, VideoFieldValidators, VideoFieldAppearance>;
|
|
44
49
|
export type FieldCreateSchema = FieldCreateConfig<RawFieldCreateSchema>;
|
|
45
50
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiTypes.js","sourceRoot":"","sources":["../../../src/generated/ApiTypes.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type LogLevel, request } from '@datocms/rest-client-utils';
|
|
2
|
-
import type { JobResult } from './
|
|
2
|
+
import type { JobResult } from './ApiTypes';
|
|
3
3
|
import * as Resources from './resources';
|
|
4
4
|
export type RequestOptions = {
|
|
5
5
|
method: 'GET' | 'PUT' | 'POST' | 'DELETE';
|
|
@@ -62,7 +62,7 @@ export class Client {
|
|
|
62
62
|
return this.config.baseUrl || Client.defaultBaseUrl;
|
|
63
63
|
}
|
|
64
64
|
request(options) {
|
|
65
|
-
return request(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.1.
|
|
65
|
+
return request(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.1.2', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: Object.assign(Object.assign(Object.assign({}, (this.config.extraHeaders || {})), (this.config.environment
|
|
66
66
|
? { 'X-Environment': this.config.environment }
|
|
67
67
|
: {})), { 'X-API-Version': '3' }), fetchJobResult: (jobId) => {
|
|
68
68
|
return this.jobResultsFetcher
|
|
@@ -4,7 +4,7 @@ import type { BooleanFieldAppearance, BooleanFieldValidators, BooleanFieldValue,
|
|
|
4
4
|
*/
|
|
5
5
|
type FieldAppearanceConfig<TAppearance> = TAppearance & Omit<RawFieldAttributes['appearance'], keyof TAppearance>;
|
|
6
6
|
/**
|
|
7
|
-
* Base field configuration for attributes (non-localized), extending the original
|
|
7
|
+
* Base field configuration for attributes (non-localized), extending the original RawApiTypes
|
|
8
8
|
*/
|
|
9
9
|
type NonLocalizedFieldAttributesForFieldType<SourceType, FieldType extends RawFieldAttributes['field_type'], FieldValue, FieldValidators, FieldAppearance> = Omit<SourceType, 'field_type' | 'default_value' | 'validators' | 'appearance' | 'localized'> & {
|
|
10
10
|
field_type: FieldType;
|
|
@@ -14,7 +14,7 @@ type NonLocalizedFieldAttributesForFieldType<SourceType, FieldType extends RawFi
|
|
|
14
14
|
appearance: FieldAppearanceConfig<FieldAppearance>;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
-
* Base field configuration for attributes (localized), extending the original
|
|
17
|
+
* Base field configuration for attributes (localized), extending the original RawApiTypes
|
|
18
18
|
*/
|
|
19
19
|
type LocalizedFieldAttributesForFieldType<SourceType, FieldType extends RawFieldAttributes['field_type'], FieldValue, FieldValidators, FieldAppearance> = Omit<SourceType, 'field_type' | 'default_value' | 'validators' | 'appearance' | 'localized'> & {
|
|
20
20
|
field_type: FieldType;
|
|
@@ -30,16 +30,21 @@ type FieldAttributesForFieldType<SourceType, FieldType extends RawFieldAttribute
|
|
|
30
30
|
type GenericFieldAttributes<SourceType> = FieldAttributesForFieldType<SourceType, 'boolean', BooleanFieldValue, BooleanFieldValidators, BooleanFieldAppearance> | FieldAttributesForFieldType<SourceType, 'color', ColorFieldValue, ColorFieldValidators, ColorFieldAppearance> | FieldAttributesForFieldType<SourceType, 'date', DateFieldValue, DateFieldValidators, DateFieldAppearance> | FieldAttributesForFieldType<SourceType, 'date_time', DateTimeFieldValue, DateTimeFieldValidators, DateTimeFieldAppearance> | FieldAttributesForFieldType<SourceType, 'file', null, FileFieldValidators, FileFieldAppearance> | FieldAttributesForFieldType<SourceType, 'float', FloatFieldValue, FloatFieldValidators, FloatFieldAppearance> | FieldAttributesForFieldType<SourceType, 'gallery', null, GalleryFieldValidators, GalleryFieldAppearance> | FieldAttributesForFieldType<SourceType, 'integer', IntegerFieldValue, IntegerFieldValidators, IntegerFieldAppearance> | FieldAttributesForFieldType<SourceType, 'json', JsonFieldValue, JsonFieldValidators, JsonFieldAppearance> | FieldAttributesForFieldType<SourceType, 'lat_lon', LocationFieldValue, LocationFieldValidators, LocationFieldAppearance> | FieldAttributesForFieldType<SourceType, 'link', null, LinkFieldValidators, LinkFieldAppearance> | FieldAttributesForFieldType<SourceType, 'links', null, LinksFieldValidators, LinksFieldAppearance> | FieldAttributesForFieldType<SourceType, 'rich_text', null, RichTextFieldValidators, RichTextFieldAppearance> | FieldAttributesForFieldType<SourceType, 'seo', null, SeoFieldValidators, SeoFieldAppearance> | FieldAttributesForFieldType<SourceType, 'single_block', null, SingleBlockFieldValidators, SingleBlockFieldAppearance> | FieldAttributesForFieldType<SourceType, 'slug', null, SlugFieldValidators, SlugFieldAppearance> | FieldAttributesForFieldType<SourceType, 'string', StringFieldValue, StringFieldValidators, StringFieldAppearance> | FieldAttributesForFieldType<SourceType, 'structured_text', null, StructuredTextFieldValidators, StructuredTextFieldAppearance> | FieldAttributesForFieldType<SourceType, 'text', TextFieldValue, TextFieldValidators, TextFieldAppearance> | FieldAttributesForFieldType<SourceType, 'video', null, VideoFieldValidators, VideoFieldAppearance>;
|
|
31
31
|
export type FieldAttributes = GenericFieldAttributes<RawFieldAttributes>;
|
|
32
32
|
export type Field = RawField;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
type LocalizedFieldCreateConfigForFieldType<SourceType, FieldType extends RawFieldAttributes['field_type'], FieldValue, FieldValidators, FieldAppearance> = Omit<SourceType, 'field_type' | 'default_value' | 'validators' | 'appearance' | 'localized'> & {
|
|
34
|
+
field_type: FieldType;
|
|
35
|
+
localized: true;
|
|
36
|
+
default_value?: Record<string, FieldValue>;
|
|
37
|
+
validators?: FieldValidators;
|
|
38
|
+
appearance?: FieldAppearanceConfig<FieldAppearance>;
|
|
39
|
+
};
|
|
40
|
+
type NonLocalizedFieldCreateConfigForFieldType<SourceType, FieldType extends RawFieldAttributes['field_type'], FieldValue, FieldValidators, FieldAppearance> = Omit<SourceType, 'field_type' | 'default_value' | 'validators' | 'appearance' | 'localized'> & {
|
|
38
41
|
field_type: FieldType;
|
|
39
|
-
|
|
42
|
+
localized?: false;
|
|
43
|
+
default_value?: FieldValue;
|
|
40
44
|
validators?: FieldValidators;
|
|
41
45
|
appearance?: FieldAppearanceConfig<FieldAppearance>;
|
|
42
46
|
};
|
|
47
|
+
type FieldCreateConfigForFieldType<SourceType, FieldType extends RawFieldAttributes['field_type'], FieldValue, FieldValidators, FieldAppearance> = LocalizedFieldCreateConfigForFieldType<SourceType, FieldType, FieldValue, FieldValidators, FieldAppearance> | NonLocalizedFieldCreateConfigForFieldType<SourceType, FieldType, FieldValue, FieldValidators, FieldAppearance>;
|
|
43
48
|
type FieldCreateConfig<SourceType> = FieldCreateConfigForFieldType<SourceType, 'boolean', BooleanFieldValue, BooleanFieldValidators, BooleanFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'color', ColorFieldValue, ColorFieldValidators, ColorFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'date', DateFieldValue, DateFieldValidators, DateFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'date_time', DateTimeFieldValue, DateTimeFieldValidators, DateTimeFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'file', null, FileFieldValidators, FileFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'float', FloatFieldValue, FloatFieldValidators, FloatFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'gallery', null, GalleryFieldValidators, GalleryFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'integer', IntegerFieldValue, IntegerFieldValidators, IntegerFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'json', JsonFieldValue, JsonFieldValidators, JsonFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'lat_lon', LocationFieldValue, LocationFieldValidators, LocationFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'link', null, LinkFieldValidators, LinkFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'links', null, LinksFieldValidators, LinksFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'rich_text', null, RichTextFieldValidators, RichTextFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'seo', null, SeoFieldValidators, SeoFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'single_block', null, SingleBlockFieldValidators, SingleBlockFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'slug', null, SlugFieldValidators, SlugFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'string', StringFieldValue, StringFieldValidators, StringFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'structured_text', null, StructuredTextFieldValidators, StructuredTextFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'text', TextFieldValue, TextFieldValidators, TextFieldAppearance> | FieldCreateConfigForFieldType<SourceType, 'video', null, VideoFieldValidators, VideoFieldAppearance>;
|
|
44
49
|
export type FieldCreateSchema = Omit<RawFieldCreateSchema, 'data'> & {
|
|
45
50
|
data: Omit<RawFieldCreateSchema['data'], 'attributes'> & {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RawApiTypes.js","sourceRoot":"","sources":["../../../src/generated/RawApiTypes.ts"],"names":[],"mappings":""}
|