@datocms/cma-client 5.1.1 → 5.1.3
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/boolean.js +7 -1
- package/dist/cjs/fieldTypes/boolean.js.map +1 -1
- package/dist/cjs/fieldTypes/color.js +7 -1
- package/dist/cjs/fieldTypes/color.js.map +1 -1
- package/dist/cjs/fieldTypes/date.js +7 -1
- package/dist/cjs/fieldTypes/date.js.map +1 -1
- package/dist/cjs/fieldTypes/date_time.js +7 -1
- package/dist/cjs/fieldTypes/date_time.js.map +1 -1
- package/dist/cjs/fieldTypes/file.js +7 -1
- package/dist/cjs/fieldTypes/file.js.map +1 -1
- package/dist/cjs/fieldTypes/float.js +7 -1
- package/dist/cjs/fieldTypes/float.js.map +1 -1
- package/dist/cjs/fieldTypes/gallery.js +7 -1
- package/dist/cjs/fieldTypes/gallery.js.map +1 -1
- package/dist/cjs/fieldTypes/integer.js +7 -1
- package/dist/cjs/fieldTypes/integer.js.map +1 -1
- package/dist/cjs/fieldTypes/json.js +7 -1
- package/dist/cjs/fieldTypes/json.js.map +1 -1
- package/dist/cjs/fieldTypes/lat_lon.js +7 -1
- package/dist/cjs/fieldTypes/lat_lon.js.map +1 -1
- package/dist/cjs/fieldTypes/link.js +7 -1
- package/dist/cjs/fieldTypes/link.js.map +1 -1
- package/dist/cjs/fieldTypes/links.js +7 -1
- package/dist/cjs/fieldTypes/links.js.map +1 -1
- package/dist/cjs/fieldTypes/rich_text.js +23 -5
- package/dist/cjs/fieldTypes/rich_text.js.map +1 -1
- package/dist/cjs/fieldTypes/seo.js +7 -1
- package/dist/cjs/fieldTypes/seo.js.map +1 -1
- package/dist/cjs/fieldTypes/single_block.js +37 -17
- package/dist/cjs/fieldTypes/single_block.js.map +1 -1
- package/dist/cjs/fieldTypes/slug.js +8 -2
- package/dist/cjs/fieldTypes/slug.js.map +1 -1
- package/dist/cjs/fieldTypes/string.js +7 -1
- package/dist/cjs/fieldTypes/string.js.map +1 -1
- package/dist/cjs/fieldTypes/structured_text.js +28 -22
- package/dist/cjs/fieldTypes/structured_text.js.map +1 -1
- package/dist/cjs/fieldTypes/text.js +7 -1
- package/dist/cjs/fieldTypes/text.js.map +1 -1
- package/dist/cjs/fieldTypes/video.js +7 -1
- package/dist/cjs/fieldTypes/video.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 +3 -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/{fieldValueLocalization.js → fieldValue.js} +52 -52
- 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/boolean.d.ts +2 -0
- package/dist/esm/fieldTypes/boolean.js +5 -0
- package/dist/esm/fieldTypes/boolean.js.map +1 -1
- package/dist/esm/fieldTypes/color.d.ts +2 -0
- package/dist/esm/fieldTypes/color.js +5 -0
- package/dist/esm/fieldTypes/color.js.map +1 -1
- package/dist/esm/fieldTypes/date.d.ts +2 -0
- package/dist/esm/fieldTypes/date.js +5 -0
- package/dist/esm/fieldTypes/date.js.map +1 -1
- package/dist/esm/fieldTypes/date_time.d.ts +2 -0
- package/dist/esm/fieldTypes/date_time.js +5 -0
- package/dist/esm/fieldTypes/date_time.js.map +1 -1
- package/dist/esm/fieldTypes/file.d.ts +2 -0
- package/dist/esm/fieldTypes/file.js +5 -0
- package/dist/esm/fieldTypes/file.js.map +1 -1
- package/dist/esm/fieldTypes/float.d.ts +2 -0
- package/dist/esm/fieldTypes/float.js +5 -0
- package/dist/esm/fieldTypes/float.js.map +1 -1
- package/dist/esm/fieldTypes/gallery.d.ts +2 -0
- package/dist/esm/fieldTypes/gallery.js +5 -0
- package/dist/esm/fieldTypes/gallery.js.map +1 -1
- package/dist/esm/fieldTypes/integer.d.ts +2 -0
- package/dist/esm/fieldTypes/integer.js +5 -0
- package/dist/esm/fieldTypes/integer.js.map +1 -1
- package/dist/esm/fieldTypes/json.d.ts +2 -0
- package/dist/esm/fieldTypes/json.js +5 -0
- package/dist/esm/fieldTypes/json.js.map +1 -1
- package/dist/esm/fieldTypes/lat_lon.d.ts +2 -0
- package/dist/esm/fieldTypes/lat_lon.js +5 -0
- package/dist/esm/fieldTypes/lat_lon.js.map +1 -1
- package/dist/esm/fieldTypes/link.d.ts +2 -0
- package/dist/esm/fieldTypes/link.js +5 -0
- package/dist/esm/fieldTypes/link.js.map +1 -1
- package/dist/esm/fieldTypes/links.d.ts +2 -0
- package/dist/esm/fieldTypes/links.js +5 -0
- package/dist/esm/fieldTypes/links.js.map +1 -1
- package/dist/esm/fieldTypes/rich_text.d.ts +13 -9
- package/dist/esm/fieldTypes/rich_text.js +20 -5
- package/dist/esm/fieldTypes/rich_text.js.map +1 -1
- package/dist/esm/fieldTypes/seo.d.ts +2 -0
- package/dist/esm/fieldTypes/seo.js +5 -0
- package/dist/esm/fieldTypes/seo.js.map +1 -1
- package/dist/esm/fieldTypes/single_block.d.ts +33 -23
- package/dist/esm/fieldTypes/single_block.js +30 -13
- package/dist/esm/fieldTypes/single_block.js.map +1 -1
- package/dist/esm/fieldTypes/slug.d.ts +2 -0
- package/dist/esm/fieldTypes/slug.js +6 -1
- package/dist/esm/fieldTypes/slug.js.map +1 -1
- package/dist/esm/fieldTypes/string.d.ts +2 -0
- package/dist/esm/fieldTypes/string.js +5 -0
- package/dist/esm/fieldTypes/string.js.map +1 -1
- package/dist/esm/fieldTypes/structured_text.d.ts +22 -83
- package/dist/esm/fieldTypes/structured_text.js +25 -22
- package/dist/esm/fieldTypes/structured_text.js.map +1 -1
- package/dist/esm/fieldTypes/text.d.ts +2 -0
- package/dist/esm/fieldTypes/text.js +5 -0
- package/dist/esm/fieldTypes/text.js.map +1 -1
- package/dist/esm/fieldTypes/video.d.ts +2 -0
- package/dist/esm/fieldTypes/video.js +5 -0
- package/dist/esm/fieldTypes/video.js.map +1 -1
- package/dist/esm/generated/{SimpleSchemaTypes.d.ts → ApiTypes.d.ts} +2 -2
- 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} +2 -2
- 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 +713 -713
- 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 +6 -4
- package/dist/esm/index.js +2 -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/{types/utilities/fieldValueLocalization.d.ts → esm/utilities/fieldValue.d.ts} +30 -29
- package/dist/esm/utilities/{fieldValueLocalization.js → fieldValue.js} +39 -39
- 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/boolean.d.ts +2 -0
- package/dist/types/fieldTypes/color.d.ts +2 -0
- package/dist/types/fieldTypes/date.d.ts +2 -0
- package/dist/types/fieldTypes/date_time.d.ts +2 -0
- package/dist/types/fieldTypes/file.d.ts +2 -0
- package/dist/types/fieldTypes/float.d.ts +2 -0
- package/dist/types/fieldTypes/gallery.d.ts +2 -0
- package/dist/types/fieldTypes/integer.d.ts +2 -0
- package/dist/types/fieldTypes/json.d.ts +2 -0
- package/dist/types/fieldTypes/lat_lon.d.ts +2 -0
- package/dist/types/fieldTypes/link.d.ts +2 -0
- package/dist/types/fieldTypes/links.d.ts +2 -0
- package/dist/types/fieldTypes/rich_text.d.ts +13 -9
- package/dist/types/fieldTypes/seo.d.ts +2 -0
- package/dist/types/fieldTypes/single_block.d.ts +33 -23
- package/dist/types/fieldTypes/slug.d.ts +2 -0
- package/dist/types/fieldTypes/string.d.ts +2 -0
- package/dist/types/fieldTypes/structured_text.d.ts +22 -83
- package/dist/types/fieldTypes/text.d.ts +2 -0
- package/dist/types/fieldTypes/video.d.ts +2 -0
- package/dist/types/generated/{SimpleSchemaTypes.d.ts → ApiTypes.d.ts} +2 -2
- package/dist/types/generated/Client.d.ts +1 -1
- package/dist/types/generated/{SchemaTypes.d.ts → RawApiTypes.d.ts} +2 -2
- 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 +713 -713
- 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 +6 -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/{esm/utilities/fieldValueLocalization.d.ts → types/utilities/fieldValue.d.ts} +30 -29
- 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/boolean.ts +11 -0
- package/src/fieldTypes/color.ts +11 -0
- package/src/fieldTypes/date.ts +11 -0
- package/src/fieldTypes/date_time.ts +11 -0
- package/src/fieldTypes/file.ts +11 -0
- package/src/fieldTypes/float.ts +11 -0
- package/src/fieldTypes/gallery.ts +11 -0
- package/src/fieldTypes/integer.ts +11 -0
- package/src/fieldTypes/json.ts +11 -0
- package/src/fieldTypes/lat_lon.ts +11 -0
- package/src/fieldTypes/link.ts +11 -0
- package/src/fieldTypes/links.ts +11 -0
- package/src/fieldTypes/rich_text.ts +45 -15
- package/src/fieldTypes/seo.ts +11 -0
- package/src/fieldTypes/single_block.ts +76 -30
- package/src/fieldTypes/slug.ts +12 -1
- package/src/fieldTypes/string.ts +11 -0
- package/src/fieldTypes/structured_text.ts +63 -148
- package/src/fieldTypes/text.ts +11 -0
- package/src/fieldTypes/video.ts +11 -0
- package/src/generated/{SimpleSchemaTypes.ts → ApiTypes.ts} +2 -2
- package/src/generated/Client.ts +2 -2
- package/src/generated/{SchemaTypes.ts → RawApiTypes.ts} +2 -2
- 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 +8 -4
- package/src/resources/Role.ts +6 -6
- package/src/utilities/blocks.ts +30 -30
- package/src/utilities/buildBlockRecord.ts +4 -4
- package/src/utilities/{fieldValueLocalization.ts → fieldValue.ts} +59 -74
- 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.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.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/structuredText.d.ts +0 -177
- package/src/utilities/structuredText.ts +0 -590
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
* All functions come in both sync and async variants to support different use cases,
|
|
22
22
|
* particularly useful when block transformations require async operations like API calls.
|
|
23
23
|
*/
|
|
24
|
+
import { type TreePath } from 'datocms-structured-text-utils';
|
|
24
25
|
import type { BlockItemInARequest } from '../fieldTypes';
|
|
25
|
-
import type * as
|
|
26
|
-
import type * as
|
|
27
|
-
import { type TreePath } from './structuredText';
|
|
26
|
+
import type * as ApiTypes from '../generated/ApiTypes';
|
|
27
|
+
import type * as RawApiTypes from '../generated/RawApiTypes';
|
|
28
28
|
/**
|
|
29
29
|
* Visit every block in a field value, calling the visitor function for each block found.
|
|
30
30
|
* Supports rich text, single block, and structured text field types.
|
|
@@ -33,7 +33,7 @@ import { type TreePath } from './structuredText';
|
|
|
33
33
|
* @param value - The field value containing blocks to visit
|
|
34
34
|
* @param visitor - Synchronous function called for each block. Receives the block item and its path
|
|
35
35
|
*/
|
|
36
|
-
export declare function nonRecursiveVisitBlocksInFieldValue(field:
|
|
36
|
+
export declare function nonRecursiveVisitBlocksInFieldValue(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, visitor: (item: BlockItemInARequest, path: TreePath) => void): void;
|
|
37
37
|
/**
|
|
38
38
|
* Visit every block in a field value, calling the visitor function for each block found.
|
|
39
39
|
* Supports rich text, single block, and structured text field types.
|
|
@@ -43,7 +43,7 @@ export declare function nonRecursiveVisitBlocksInFieldValue(field: SchemaTypes.F
|
|
|
43
43
|
* @param visitor - Asynchronous function called for each block. Receives the block item and its path
|
|
44
44
|
* @returns Promise that resolves when all blocks have been visited
|
|
45
45
|
*/
|
|
46
|
-
export declare function nonRecursiveVisitBlocksInFieldValueAsync(field:
|
|
46
|
+
export declare function nonRecursiveVisitBlocksInFieldValueAsync(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, visitor: (item: BlockItemInARequest, path: TreePath) => Promise<void>): Promise<void>;
|
|
47
47
|
/**
|
|
48
48
|
* Transform blocks in a field value by applying a mapping function to each block.
|
|
49
49
|
* Creates a new field value structure with transformed blocks while preserving the original structure.
|
|
@@ -54,7 +54,7 @@ export declare function nonRecursiveVisitBlocksInFieldValueAsync(field: SchemaTy
|
|
|
54
54
|
* @param mapper - Synchronous function that transforms each block. Receives block item and path, returns new block
|
|
55
55
|
* @returns The new field value with transformed blocks
|
|
56
56
|
*/
|
|
57
|
-
export declare function nonRecursiveMapBlocksInFieldValue(field:
|
|
57
|
+
export declare function nonRecursiveMapBlocksInFieldValue(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, mapper: (item: BlockItemInARequest, path: TreePath) => BlockItemInARequest): unknown;
|
|
58
58
|
/**
|
|
59
59
|
* Transform blocks in a field value by applying a mapping function to each block.
|
|
60
60
|
* Creates a new field value structure with transformed blocks while preserving the original structure.
|
|
@@ -65,7 +65,7 @@ export declare function nonRecursiveMapBlocksInFieldValue(field: SchemaTypes.Fie
|
|
|
65
65
|
* @param mapper - Asynchronous function that transforms each block. Receives block item and path, returns new block
|
|
66
66
|
* @returns Promise that resolves to the new field value with transformed blocks
|
|
67
67
|
*/
|
|
68
|
-
export declare function nonRecursiveMapBlocksInFieldValueAsync(field:
|
|
68
|
+
export declare function nonRecursiveMapBlocksInFieldValueAsync(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, mapper: (item: BlockItemInARequest, path: TreePath) => Promise<BlockItemInARequest>): Promise<unknown>;
|
|
69
69
|
/**
|
|
70
70
|
* Find all blocks that match the predicate function.
|
|
71
71
|
* Searches through all blocks in the field value and returns all matches.
|
|
@@ -75,7 +75,7 @@ export declare function nonRecursiveMapBlocksInFieldValueAsync(field: SchemaType
|
|
|
75
75
|
* @param predicate - Synchronous function that tests each block. Should return true for matching blocks
|
|
76
76
|
* @returns Array of objects, each containing a matching block and its path
|
|
77
77
|
*/
|
|
78
|
-
export declare function nonRecursiveFindAllBlocksInFieldValue(field:
|
|
78
|
+
export declare function nonRecursiveFindAllBlocksInFieldValue(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => boolean): Array<{
|
|
79
79
|
item: BlockItemInARequest;
|
|
80
80
|
path: TreePath;
|
|
81
81
|
}>;
|
|
@@ -88,7 +88,7 @@ export declare function nonRecursiveFindAllBlocksInFieldValue(field: SchemaTypes
|
|
|
88
88
|
* @param predicate - Asynchronous function that tests each block. Should return true for matching blocks
|
|
89
89
|
* @returns Promise that resolves to an array of objects, each containing a matching block and its path
|
|
90
90
|
*/
|
|
91
|
-
export declare function nonRecursiveFindAllBlocksInFieldValueAsync(field:
|
|
91
|
+
export declare function nonRecursiveFindAllBlocksInFieldValueAsync(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => Promise<boolean>): Promise<Array<{
|
|
92
92
|
item: BlockItemInARequest;
|
|
93
93
|
path: TreePath;
|
|
94
94
|
}>>;
|
|
@@ -102,7 +102,7 @@ export declare function nonRecursiveFindAllBlocksInFieldValueAsync(field: Schema
|
|
|
102
102
|
* @param predicate - Synchronous function that tests each block. Blocks returning false are removed
|
|
103
103
|
* @returns The new field value with filtered blocks
|
|
104
104
|
*/
|
|
105
|
-
export declare function nonRecursiveFilterBlocksInFieldValue(field:
|
|
105
|
+
export declare function nonRecursiveFilterBlocksInFieldValue(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => boolean): unknown;
|
|
106
106
|
/**
|
|
107
107
|
* Filter blocks in a field value, removing those that don't match the predicate.
|
|
108
108
|
* Creates a new field value containing only blocks that pass the predicate test.
|
|
@@ -113,7 +113,7 @@ export declare function nonRecursiveFilterBlocksInFieldValue(field: SchemaTypes.
|
|
|
113
113
|
* @param predicate - Asynchronous function that tests each block. Blocks returning false are removed
|
|
114
114
|
* @returns Promise that resolves to the new field value with filtered blocks
|
|
115
115
|
*/
|
|
116
|
-
export declare function nonRecursiveFilterBlocksInFieldValueAsync(field:
|
|
116
|
+
export declare function nonRecursiveFilterBlocksInFieldValueAsync(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => Promise<boolean>): Promise<unknown>;
|
|
117
117
|
/**
|
|
118
118
|
* Reduce all blocks in a field value to a single value by applying a reducer function.
|
|
119
119
|
* Processes each block in the field value and accumulates the results into a single value.
|
|
@@ -125,7 +125,7 @@ export declare function nonRecursiveFilterBlocksInFieldValueAsync(field: SchemaT
|
|
|
125
125
|
* @param initialValue - The initial value for the accumulator
|
|
126
126
|
* @returns The final accumulated value
|
|
127
127
|
*/
|
|
128
|
-
export declare function nonRecursiveReduceBlocksInFieldValue<R>(field:
|
|
128
|
+
export declare function nonRecursiveReduceBlocksInFieldValue<R>(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, reducer: (accumulator: R, item: BlockItemInARequest, path: TreePath) => R, initialValue: R): R;
|
|
129
129
|
/**
|
|
130
130
|
* Reduce all blocks in a field value to a single value by applying a reducer function.
|
|
131
131
|
* Processes each block in the field value and accumulates the results into a single value.
|
|
@@ -137,7 +137,7 @@ export declare function nonRecursiveReduceBlocksInFieldValue<R>(field: SchemaTyp
|
|
|
137
137
|
* @param initialValue - The initial value for the accumulator
|
|
138
138
|
* @returns Promise that resolves to the final accumulated value
|
|
139
139
|
*/
|
|
140
|
-
export declare function nonRecursiveReduceBlocksInFieldValueAsync<R>(field:
|
|
140
|
+
export declare function nonRecursiveReduceBlocksInFieldValueAsync<R>(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, reducer: (accumulator: R, item: BlockItemInARequest, path: TreePath) => Promise<R>, initialValue: R): Promise<R>;
|
|
141
141
|
/**
|
|
142
142
|
* Check if any block in the field value matches the predicate function.
|
|
143
143
|
* Returns true as soon as the first matching block is found (short-circuit evaluation).
|
|
@@ -147,7 +147,7 @@ export declare function nonRecursiveReduceBlocksInFieldValueAsync<R>(field: Sche
|
|
|
147
147
|
* @param predicate - Synchronous function that tests each block. Should return true for matching blocks
|
|
148
148
|
* @returns True if any block matches, false otherwise
|
|
149
149
|
*/
|
|
150
|
-
export declare function nonRecursiveSomeBlocksInFieldValue(field:
|
|
150
|
+
export declare function nonRecursiveSomeBlocksInFieldValue(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => boolean): boolean;
|
|
151
151
|
/**
|
|
152
152
|
* Check if any block in the field value matches the predicate function.
|
|
153
153
|
* Returns true as soon as the first matching block is found (short-circuit evaluation).
|
|
@@ -157,7 +157,7 @@ export declare function nonRecursiveSomeBlocksInFieldValue(field: SchemaTypes.Fi
|
|
|
157
157
|
* @param predicate - Asynchronous function that tests each block. Should return true for matching blocks
|
|
158
158
|
* @returns Promise that resolves to true if any block matches, false otherwise
|
|
159
159
|
*/
|
|
160
|
-
export declare function nonRecursiveSomeBlocksInFieldValueAsync(field:
|
|
160
|
+
export declare function nonRecursiveSomeBlocksInFieldValueAsync(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => Promise<boolean>): Promise<boolean>;
|
|
161
161
|
/**
|
|
162
162
|
* Check if every block in the field value matches the predicate function.
|
|
163
163
|
* Returns false as soon as the first non-matching block is found (short-circuit evaluation).
|
|
@@ -167,7 +167,7 @@ export declare function nonRecursiveSomeBlocksInFieldValueAsync(field: SchemaTyp
|
|
|
167
167
|
* @param predicate - Synchronous function that tests each block. Should return true for valid blocks
|
|
168
168
|
* @returns True if all blocks match, false otherwise
|
|
169
169
|
*/
|
|
170
|
-
export declare function nonRecursiveEveryBlockInFieldValue(field:
|
|
170
|
+
export declare function nonRecursiveEveryBlockInFieldValue(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => boolean): boolean;
|
|
171
171
|
/**
|
|
172
172
|
* Check if every block in the field value matches the predicate function.
|
|
173
173
|
* Returns false as soon as the first non-matching block is found (short-circuit evaluation).
|
|
@@ -177,4 +177,4 @@ export declare function nonRecursiveEveryBlockInFieldValue(field: SchemaTypes.Fi
|
|
|
177
177
|
* @param predicate - Asynchronous function that tests each block. Should return true for valid blocks
|
|
178
178
|
* @returns Promise that resolves to true if all blocks match, false otherwise
|
|
179
179
|
*/
|
|
180
|
-
export declare function nonRecursiveEveryBlockInFieldValueAsync(field:
|
|
180
|
+
export declare function nonRecursiveEveryBlockInFieldValueAsync(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => Promise<boolean>): Promise<boolean>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
import type * as
|
|
3
|
-
export declare function buildBlockRecord(body:
|
|
1
|
+
import type * as ApiTypes from '../generated/ApiTypes';
|
|
2
|
+
import type * as RawApiTypes from '../generated/RawApiTypes';
|
|
3
|
+
export declare function buildBlockRecord(body: ApiTypes.ItemUpdateSchema): {
|
|
4
4
|
type: "item";
|
|
5
5
|
id: string;
|
|
6
6
|
attributes?: {
|
|
@@ -23,10 +23,10 @@ export declare function buildBlockRecord(body: SimpleSchemaTypes.ItemUpdateSchem
|
|
|
23
23
|
} | undefined;
|
|
24
24
|
relationships?: {
|
|
25
25
|
item_type?: {
|
|
26
|
-
data:
|
|
26
|
+
data: RawApiTypes.ItemTypeData;
|
|
27
27
|
} | undefined;
|
|
28
28
|
creator?: {
|
|
29
|
-
data:
|
|
29
|
+
data: RawApiTypes.UserData | RawApiTypes.SsoUserData | RawApiTypes.AccessTokenData | RawApiTypes.AccountData | RawApiTypes.OrganizationData;
|
|
30
30
|
} | undefined;
|
|
31
31
|
} | undefined;
|
|
32
32
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
import type * as
|
|
1
|
+
import type * as ApiTypes from '../generated/ApiTypes';
|
|
2
|
+
import type * as RawApiTypes from '../generated/RawApiTypes';
|
|
3
3
|
/**
|
|
4
4
|
* Represents a localized field value in DatoCMS.
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@ import type * as SimpleSchemaTypes from '../generated/SimpleSchemaTypes';
|
|
|
7
7
|
* for various locales structured as an object, such as
|
|
8
8
|
* `{ "en": "Hello", "it": "Ciao" }`
|
|
9
9
|
*/
|
|
10
|
-
export type LocalizedFieldValue = Record<string,
|
|
10
|
+
export type LocalizedFieldValue<T = unknown> = Record<string, T>;
|
|
11
11
|
/**
|
|
12
12
|
* Determines whether a DatoCMS field is localized or not.
|
|
13
13
|
*
|
|
@@ -17,7 +17,7 @@ export type LocalizedFieldValue = Record<string, unknown>;
|
|
|
17
17
|
* @param field - The DatoCMS field definition (either full or simple schema)
|
|
18
18
|
* @returns true if the field is localized, false otherwise
|
|
19
19
|
*/
|
|
20
|
-
export declare function isLocalized(field:
|
|
20
|
+
export declare function isLocalized(field: RawApiTypes.Field | ApiTypes.Field): boolean;
|
|
21
21
|
/**
|
|
22
22
|
* A normalized entry that represents a single value from either a localized or non-localized field.
|
|
23
23
|
*
|
|
@@ -26,10 +26,11 @@ export declare function isLocalized(field: SchemaTypes.Field | SimpleSchemaTypes
|
|
|
26
26
|
*
|
|
27
27
|
* This uniform structure allows the same processing logic to work with both field types.
|
|
28
28
|
*/
|
|
29
|
-
export type
|
|
29
|
+
export type FieldValueEntry = {
|
|
30
30
|
locale: string | undefined;
|
|
31
31
|
value: unknown;
|
|
32
32
|
};
|
|
33
|
+
export type PossiblyLocalizedEntry = FieldValueEntry;
|
|
33
34
|
/**
|
|
34
35
|
* Converts a field value (localized or non-localized) into a uniform array of entries.
|
|
35
36
|
*
|
|
@@ -40,7 +41,7 @@ export type PossiblyLocalizedEntry = {
|
|
|
40
41
|
* @param value - The field value to convert (either a localized object or direct value)
|
|
41
42
|
* @returns Array of entries where each entry contains a locale (string for localized, undefined for non-localized) and the corresponding value
|
|
42
43
|
*/
|
|
43
|
-
export declare function
|
|
44
|
+
export declare function fieldValueToEntries(field: RawApiTypes.Field | ApiTypes.Field, value: unknown): FieldValueEntry[];
|
|
44
45
|
/**
|
|
45
46
|
* Converts an array of possibly localized entries back into the appropriate field value format.
|
|
46
47
|
*
|
|
@@ -52,11 +53,11 @@ export declare function fieldValueToPossiblyLocalizedEntries(field: SchemaTypes.
|
|
|
52
53
|
* @param possiblyLocalizedEntries - Array of entries to convert back to field value format
|
|
53
54
|
* @returns Either a localized object (for localized fields) or the direct value (for non-localized fields)
|
|
54
55
|
*/
|
|
55
|
-
export declare function
|
|
56
|
+
export declare function entriesToFieldValue(field: RawApiTypes.Field | ApiTypes.Field, possiblyLocalizedEntries: FieldValueEntry[]): any;
|
|
56
57
|
/**
|
|
57
|
-
* Maps
|
|
58
|
+
* Maps field values using a provided mapping function.
|
|
58
59
|
* For localized fields, applies the mapping function to each locale value.
|
|
59
|
-
* For non-localized fields, applies the mapping function directly to the
|
|
60
|
+
* For non-localized fields, applies the mapping function directly to the value.
|
|
60
61
|
*
|
|
61
62
|
* @template T - The type that the mapping function returns
|
|
62
63
|
* @param field - The DatoCMS field definition
|
|
@@ -64,11 +65,11 @@ export declare function possiblyLocalizedEntriesToFieldValue(field: SchemaTypes.
|
|
|
64
65
|
* @param mapFn - The function to apply to each locale value or the direct value
|
|
65
66
|
* @returns The mapped value with the same structure as the input
|
|
66
67
|
*/
|
|
67
|
-
export declare function
|
|
68
|
+
export declare function mapFieldValue<T>(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, mapFn: (locale: string | undefined, localeValue: unknown) => T): any;
|
|
68
69
|
/**
|
|
69
|
-
* Maps
|
|
70
|
+
* Maps field values using a provided mapping function (async version).
|
|
70
71
|
* For localized fields, applies the mapping function to each locale value.
|
|
71
|
-
* For non-localized fields, applies the mapping function directly to the
|
|
72
|
+
* For non-localized fields, applies the mapping function directly to the value.
|
|
72
73
|
*
|
|
73
74
|
* @template T - The type that the mapping function returns
|
|
74
75
|
* @param field - The DatoCMS field definition
|
|
@@ -76,9 +77,9 @@ export declare function mapLocalizedFieldValues<T>(field: SchemaTypes.Field | Si
|
|
|
76
77
|
* @param mapFn - The function to apply to each locale value or the direct value
|
|
77
78
|
* @returns The mapped value with the same structure as the input
|
|
78
79
|
*/
|
|
79
|
-
export declare function
|
|
80
|
+
export declare function mapFieldValueAsync<T>(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, mapFn: (locale: string | undefined, localeValue: unknown) => Promise<T>): Promise<any>;
|
|
80
81
|
/**
|
|
81
|
-
* Filters
|
|
82
|
+
* Filters field values using a provided filter function.
|
|
82
83
|
* For localized fields, filters each locale value.
|
|
83
84
|
* For non-localized fields, returns the value if the filter passes, otherwise undefined.
|
|
84
85
|
*
|
|
@@ -87,9 +88,9 @@ export declare function mapLocalizedFieldValuesAsync<T>(field: SchemaTypes.Field
|
|
|
87
88
|
* @param filterFn - The function to test each locale value or the direct value
|
|
88
89
|
* @returns The filtered value with the same structure as the input
|
|
89
90
|
*/
|
|
90
|
-
export declare function
|
|
91
|
+
export declare function filterFieldValue(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, filterFn: (locale: string | undefined, localeValue: unknown) => boolean): any;
|
|
91
92
|
/**
|
|
92
|
-
* Filters
|
|
93
|
+
* Filters field values using a provided filter function (async version).
|
|
93
94
|
* For localized fields, filters each locale value.
|
|
94
95
|
* For non-localized fields, returns the value if the filter passes, otherwise undefined.
|
|
95
96
|
*
|
|
@@ -98,9 +99,9 @@ export declare function filterLocalizedFieldValues(field: SchemaTypes.Field | Si
|
|
|
98
99
|
* @param filterFn - The function to test each locale value or the direct value
|
|
99
100
|
* @returns The filtered value with the same structure as the input
|
|
100
101
|
*/
|
|
101
|
-
export declare function
|
|
102
|
+
export declare function filterFieldValueAsync(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, filterFn: (locale: string | undefined, localeValue: unknown) => Promise<boolean>): Promise<any>;
|
|
102
103
|
/**
|
|
103
|
-
* Tests whether at least one
|
|
104
|
+
* Tests whether at least one field value passes the test implemented by the provided function.
|
|
104
105
|
* For localized fields, tests each locale value.
|
|
105
106
|
* For non-localized fields, tests the direct value.
|
|
106
107
|
*
|
|
@@ -109,9 +110,9 @@ export declare function filterLocalizedFieldValuesAsync(field: SchemaTypes.Field
|
|
|
109
110
|
* @param testFn - The function to test each locale value or the direct value
|
|
110
111
|
* @returns true if at least one value passes the test, false otherwise
|
|
111
112
|
*/
|
|
112
|
-
export declare function
|
|
113
|
+
export declare function someFieldValue(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, testFn: (locale: string | undefined, localeValue: unknown) => boolean): boolean;
|
|
113
114
|
/**
|
|
114
|
-
* Tests whether at least one
|
|
115
|
+
* Tests whether at least one field value passes the test implemented by the provided function (async version).
|
|
115
116
|
* For localized fields, tests each locale value.
|
|
116
117
|
* For non-localized fields, tests the direct value.
|
|
117
118
|
*
|
|
@@ -120,9 +121,9 @@ export declare function someLocalizedFieldValues(field: SchemaTypes.Field | Simp
|
|
|
120
121
|
* @param testFn - The function to test each locale value or the direct value
|
|
121
122
|
* @returns true if at least one value passes the test, false otherwise
|
|
122
123
|
*/
|
|
123
|
-
export declare function
|
|
124
|
+
export declare function someFieldValueAsync(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, testFn: (locale: string | undefined, localeValue: unknown) => Promise<boolean>): Promise<boolean>;
|
|
124
125
|
/**
|
|
125
|
-
* Tests whether all
|
|
126
|
+
* Tests whether all field values pass the test implemented by the provided function.
|
|
126
127
|
* For localized fields, tests each locale value.
|
|
127
128
|
* For non-localized fields, tests the direct value.
|
|
128
129
|
*
|
|
@@ -131,9 +132,9 @@ export declare function someLocalizedFieldValuesAsync(field: SchemaTypes.Field |
|
|
|
131
132
|
* @param testFn - The function to test each locale value or the direct value
|
|
132
133
|
* @returns true if all values pass the test, false otherwise
|
|
133
134
|
*/
|
|
134
|
-
export declare function
|
|
135
|
+
export declare function everyFieldValue(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, testFn: (locale: string | undefined, localeValue: unknown) => boolean): boolean;
|
|
135
136
|
/**
|
|
136
|
-
* Tests whether all
|
|
137
|
+
* Tests whether all field values pass the test implemented by the provided function (async version).
|
|
137
138
|
* For localized fields, tests each locale value.
|
|
138
139
|
* For non-localized fields, tests the direct value.
|
|
139
140
|
*
|
|
@@ -142,9 +143,9 @@ export declare function everyLocalizedFieldValues(field: SchemaTypes.Field | Sim
|
|
|
142
143
|
* @param testFn - The function to test each locale value or the direct value
|
|
143
144
|
* @returns true if all values pass the test, false otherwise
|
|
144
145
|
*/
|
|
145
|
-
export declare function
|
|
146
|
+
export declare function everyFieldValueAsync(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, testFn: (locale: string | undefined, localeValue: unknown) => Promise<boolean>): Promise<boolean>;
|
|
146
147
|
/**
|
|
147
|
-
* Visits each
|
|
148
|
+
* Visits each field value with the provided function.
|
|
148
149
|
* For localized fields, visits each locale value.
|
|
149
150
|
* For non-localized fields, visits the direct value.
|
|
150
151
|
*
|
|
@@ -152,9 +153,9 @@ export declare function everyLocalizedFieldValuesAsync(field: SchemaTypes.Field
|
|
|
152
153
|
* @param value - The field value (either localized object or direct value)
|
|
153
154
|
* @param visitFn - The function to call for each locale value or the direct value
|
|
154
155
|
*/
|
|
155
|
-
export declare function
|
|
156
|
+
export declare function visitFieldValue(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, visitFn: (locale: string | undefined, localeValue: unknown) => void): void;
|
|
156
157
|
/**
|
|
157
|
-
* Visits each
|
|
158
|
+
* Visits each field value with the provided function (async version).
|
|
158
159
|
* For localized fields, visits each locale value.
|
|
159
160
|
* For non-localized fields, visits the direct value.
|
|
160
161
|
*
|
|
@@ -162,4 +163,4 @@ export declare function visitLocalizedFieldValues(field: SchemaTypes.Field | Sim
|
|
|
162
163
|
* @param value - The field value (either localized object or direct value)
|
|
163
164
|
* @param visitFn - The function to call for each locale value or the direct value
|
|
164
165
|
*/
|
|
165
|
-
export declare function
|
|
166
|
+
export declare function visitFieldValueAsync(field: RawApiTypes.Field | ApiTypes.Field, value: unknown, visitFn: (locale: string | undefined, localeValue: unknown) => Promise<void>): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
import type * as
|
|
3
|
-
export declare function modelIdsReferencedInField(field:
|
|
4
|
-
export declare function blockModelIdsReferencedInField(field:
|
|
1
|
+
import type * as ApiTypes from '../generated/ApiTypes';
|
|
2
|
+
import type * as RawApiTypes from '../generated/RawApiTypes';
|
|
3
|
+
export declare function modelIdsReferencedInField(field: RawApiTypes.Field | ApiTypes.Field): string[];
|
|
4
|
+
export declare function blockModelIdsReferencedInField(field: RawApiTypes.Field | ApiTypes.Field): string[];
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { type BlockItemInARequest } from '../fieldTypes';
|
|
2
|
-
import type * as
|
|
3
|
-
import type * as
|
|
2
|
+
import type * as ApiTypes from '../generated/ApiTypes';
|
|
3
|
+
import type * as RawApiTypes from '../generated/RawApiTypes';
|
|
4
4
|
import type { SchemaRepository } from './schemaRepository';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Path through a field value (ie. ['content', 0, 'attributes', 'title'])
|
|
7
|
+
*/
|
|
8
|
+
export type TreePath = readonly (string | number)[];
|
|
9
|
+
export declare function visitBlocksInFieldValues(schemaRepository: SchemaRepository, field: RawApiTypes.Field | ApiTypes.Field, value: unknown, visitor: (item: BlockItemInARequest, path: TreePath) => void | Promise<void>, path?: TreePath): Promise<void>;
|
|
10
|
+
export declare function findAllBlocksInFieldValues(schemaRepository: SchemaRepository, field: RawApiTypes.Field | ApiTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => boolean | Promise<boolean>, path?: TreePath): Promise<Array<{
|
|
8
11
|
item: BlockItemInARequest;
|
|
9
12
|
path: TreePath;
|
|
10
13
|
}>>;
|
|
11
|
-
export declare function filterBlocksInFieldValues(schemaRepository: SchemaRepository, field:
|
|
12
|
-
export declare function reduceBlocksInFieldValues<R>(schemaRepository: SchemaRepository, field:
|
|
13
|
-
export declare function someBlocksInFieldValues(schemaRepository: SchemaRepository, field:
|
|
14
|
-
export declare function everyBlockInFieldValues(schemaRepository: SchemaRepository, field:
|
|
15
|
-
export declare function mapBlocksInFieldValues(schemaRepository: SchemaRepository, field:
|
|
14
|
+
export declare function filterBlocksInFieldValues(schemaRepository: SchemaRepository, field: RawApiTypes.Field | ApiTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => boolean | Promise<boolean>, path?: TreePath): Promise<unknown>;
|
|
15
|
+
export declare function reduceBlocksInFieldValues<R>(schemaRepository: SchemaRepository, field: RawApiTypes.Field | ApiTypes.Field, value: unknown, reducer: (accumulator: R, item: BlockItemInARequest, path: TreePath) => R | Promise<R>, initialValue: R, path?: TreePath): Promise<R>;
|
|
16
|
+
export declare function someBlocksInFieldValues(schemaRepository: SchemaRepository, field: RawApiTypes.Field | ApiTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => boolean | Promise<boolean>, path?: TreePath): Promise<boolean>;
|
|
17
|
+
export declare function everyBlockInFieldValues(schemaRepository: SchemaRepository, field: RawApiTypes.Field | ApiTypes.Field, value: unknown, predicate: (item: BlockItemInARequest, path: TreePath) => boolean | Promise<boolean>, path?: TreePath): Promise<boolean>;
|
|
18
|
+
export declare function mapBlocksInFieldValues(schemaRepository: SchemaRepository, field: RawApiTypes.Field | ApiTypes.Field, value: unknown, mapper: (item: BlockItemInARequest, path: TreePath) => BlockItemInARequest | Promise<BlockItemInARequest>, path?: TreePath): Promise<unknown>;
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
import type * as
|
|
1
|
+
import type * as ApiTypes from '../generated/ApiTypes';
|
|
2
|
+
import type * as RawApiTypes from '../generated/RawApiTypes';
|
|
3
3
|
interface GenericClient {
|
|
4
4
|
itemTypes: {
|
|
5
5
|
rawList(): Promise<{
|
|
6
|
-
data:
|
|
6
|
+
data: RawApiTypes.ItemType[];
|
|
7
7
|
}>;
|
|
8
8
|
};
|
|
9
9
|
fields: {
|
|
10
10
|
rawList(itemTypeId: string): Promise<{
|
|
11
|
-
data:
|
|
11
|
+
data: RawApiTypes.Field[];
|
|
12
|
+
}>;
|
|
13
|
+
rawReferencing(itemTypeId: string): Promise<{
|
|
14
|
+
data: RawApiTypes.Field[];
|
|
12
15
|
}>;
|
|
13
16
|
};
|
|
14
17
|
fieldsets: {
|
|
15
18
|
rawList(itemTypeId: string): Promise<{
|
|
16
|
-
data:
|
|
19
|
+
data: RawApiTypes.Fieldset[];
|
|
17
20
|
}>;
|
|
18
21
|
};
|
|
19
22
|
plugins: {
|
|
20
23
|
rawList(): Promise<{
|
|
21
|
-
data:
|
|
24
|
+
data: RawApiTypes.Plugin[];
|
|
22
25
|
}>;
|
|
23
26
|
};
|
|
24
27
|
}
|
|
@@ -51,88 +54,88 @@ export declare class SchemaRepository {
|
|
|
51
54
|
* Gets all item types from the DatoCMS project.
|
|
52
55
|
* @returns Promise that resolves to an array of all item types
|
|
53
56
|
*/
|
|
54
|
-
getAllItemTypes(): Promise<
|
|
57
|
+
getAllItemTypes(): Promise<ApiTypes.ItemType[]>;
|
|
55
58
|
/**
|
|
56
59
|
* Gets all item types from the DatoCMS project.
|
|
57
60
|
* @returns Promise that resolves to an array of all item types
|
|
58
61
|
*/
|
|
59
|
-
getAllRawItemTypes(): Promise<
|
|
62
|
+
getAllRawItemTypes(): Promise<RawApiTypes.ItemType[]>;
|
|
60
63
|
/**
|
|
61
64
|
* Gets all item types that are models (not modular blocks).
|
|
62
65
|
* @returns Promise that resolves to an array of model item types
|
|
63
66
|
*/
|
|
64
|
-
getAllModels(): Promise<
|
|
67
|
+
getAllModels(): Promise<ApiTypes.ItemType[]>;
|
|
65
68
|
/**
|
|
66
69
|
* Gets all item types that are models (not modular blocks).
|
|
67
70
|
* @returns Promise that resolves to an array of model item types
|
|
68
71
|
*/
|
|
69
|
-
getAllRawModels(): Promise<
|
|
72
|
+
getAllRawModels(): Promise<RawApiTypes.ItemType[]>;
|
|
70
73
|
/**
|
|
71
74
|
* Gets all item types that are modular blocks.
|
|
72
75
|
* @returns Promise that resolves to an array of block model item types
|
|
73
76
|
*/
|
|
74
|
-
getAllBlockModels(): Promise<
|
|
77
|
+
getAllBlockModels(): Promise<ApiTypes.ItemType[]>;
|
|
75
78
|
/**
|
|
76
79
|
* Gets all item types that are modular blocks.
|
|
77
80
|
* @returns Promise that resolves to an array of block model item types
|
|
78
81
|
*/
|
|
79
|
-
getAllRawBlockModels(): Promise<
|
|
82
|
+
getAllRawBlockModels(): Promise<RawApiTypes.ItemType[]>;
|
|
80
83
|
/**
|
|
81
84
|
* Gets an item type by its API key.
|
|
82
85
|
* @param apiKey - The API key of the item type to retrieve
|
|
83
86
|
* @returns Promise that resolves to the item type
|
|
84
87
|
* @throws Error if the item type is not found
|
|
85
88
|
*/
|
|
86
|
-
getItemTypeByApiKey(apiKey: string): Promise<
|
|
89
|
+
getItemTypeByApiKey(apiKey: string): Promise<ApiTypes.ItemType>;
|
|
87
90
|
/**
|
|
88
91
|
* Gets an item type by its API key.
|
|
89
92
|
* @param apiKey - The API key of the item type to retrieve
|
|
90
93
|
* @returns Promise that resolves to the item type
|
|
91
94
|
* @throws Error if the item type is not found
|
|
92
95
|
*/
|
|
93
|
-
getRawItemTypeByApiKey(apiKey: string): Promise<
|
|
96
|
+
getRawItemTypeByApiKey(apiKey: string): Promise<RawApiTypes.ItemType>;
|
|
94
97
|
/**
|
|
95
98
|
* Gets an item type by its ID.
|
|
96
99
|
* @param id - The ID of the item type to retrieve
|
|
97
100
|
* @returns Promise that resolves to the item type
|
|
98
101
|
* @throws Error if the item type is not found
|
|
99
102
|
*/
|
|
100
|
-
getItemTypeById(id: string): Promise<
|
|
103
|
+
getItemTypeById(id: string): Promise<ApiTypes.ItemType>;
|
|
101
104
|
/**
|
|
102
105
|
* Gets an item type by its ID.
|
|
103
106
|
* @param id - The ID of the item type to retrieve
|
|
104
107
|
* @returns Promise that resolves to the item type
|
|
105
108
|
* @throws Error if the item type is not found
|
|
106
109
|
*/
|
|
107
|
-
getRawItemTypeById(id: string): Promise<
|
|
110
|
+
getRawItemTypeById(id: string): Promise<RawApiTypes.ItemType>;
|
|
108
111
|
/**
|
|
109
112
|
* Gets all fields for a given item type.
|
|
110
113
|
* Fields are cached after the first request for performance.
|
|
111
114
|
* @param itemType - The item type to get fields for
|
|
112
115
|
* @returns Promise that resolves to an array of fields
|
|
113
116
|
*/
|
|
114
|
-
getItemTypeFields(itemType:
|
|
117
|
+
getItemTypeFields(itemType: ApiTypes.ItemType | RawApiTypes.ItemType): Promise<ApiTypes.Field[]>;
|
|
115
118
|
/**
|
|
116
119
|
* Gets all fields for a given item type.
|
|
117
120
|
* Fields are cached after the first request for performance.
|
|
118
121
|
* @param itemType - The item type to get fields for
|
|
119
122
|
* @returns Promise that resolves to an array of fields
|
|
120
123
|
*/
|
|
121
|
-
getRawItemTypeFields(itemType:
|
|
124
|
+
getRawItemTypeFields(itemType: RawApiTypes.ItemType): Promise<RawApiTypes.Field[]>;
|
|
122
125
|
/**
|
|
123
126
|
* Gets all fieldsets for a given item type.
|
|
124
127
|
* Fieldsets are cached after the first request for performance.
|
|
125
128
|
* @param itemType - The item type to get fieldsets for
|
|
126
129
|
* @returns Promise that resolves to an array of fieldsets
|
|
127
130
|
*/
|
|
128
|
-
getItemTypeFieldsets(itemType:
|
|
131
|
+
getItemTypeFieldsets(itemType: ApiTypes.ItemType | RawApiTypes.ItemType): Promise<ApiTypes.Fieldset[]>;
|
|
129
132
|
/**
|
|
130
133
|
* Gets all fieldsets for a given item type.
|
|
131
134
|
* Fieldsets are cached after the first request for performance.
|
|
132
135
|
* @param itemType - The item type to get fieldsets for
|
|
133
136
|
* @returns Promise that resolves to an array of fieldsets
|
|
134
137
|
*/
|
|
135
|
-
getRawItemTypeFieldsets(itemType:
|
|
138
|
+
getRawItemTypeFieldsets(itemType: RawApiTypes.ItemType): Promise<RawApiTypes.Fieldset[]>;
|
|
136
139
|
/**
|
|
137
140
|
* Loads and caches all plugins from the DatoCMS API.
|
|
138
141
|
* This method is called lazily and caches the result for subsequent calls.
|
|
@@ -143,39 +146,39 @@ export declare class SchemaRepository {
|
|
|
143
146
|
* Gets all plugins from the DatoCMS project.
|
|
144
147
|
* @returns Promise that resolves to an array of all plugins
|
|
145
148
|
*/
|
|
146
|
-
getAllPlugins(): Promise<
|
|
149
|
+
getAllPlugins(): Promise<ApiTypes.Plugin[]>;
|
|
147
150
|
/**
|
|
148
151
|
* Gets all plugins from the DatoCMS project.
|
|
149
152
|
* @returns Promise that resolves to an array of all plugins
|
|
150
153
|
*/
|
|
151
|
-
getAllRawPlugins(): Promise<
|
|
154
|
+
getAllRawPlugins(): Promise<RawApiTypes.Plugin[]>;
|
|
152
155
|
/**
|
|
153
156
|
* Gets a plugin by its ID.
|
|
154
157
|
* @param id - The ID of the plugin to retrieve
|
|
155
158
|
* @returns Promise that resolves to the plugin
|
|
156
159
|
* @throws Error if the plugin is not found
|
|
157
160
|
*/
|
|
158
|
-
getPluginById(id: string): Promise<
|
|
161
|
+
getPluginById(id: string): Promise<ApiTypes.Plugin>;
|
|
159
162
|
/**
|
|
160
163
|
* Gets a plugin by its ID.
|
|
161
164
|
* @param id - The ID of the plugin to retrieve
|
|
162
165
|
* @returns Promise that resolves to the plugin
|
|
163
166
|
* @throws Error if the plugin is not found
|
|
164
167
|
*/
|
|
165
|
-
getRawPluginById(id: string): Promise<
|
|
168
|
+
getRawPluginById(id: string): Promise<RawApiTypes.Plugin>;
|
|
166
169
|
/**
|
|
167
170
|
* Gets a plugin by its package name.
|
|
168
171
|
* @param packageName - The package name of the plugin to retrieve
|
|
169
172
|
* @returns Promise that resolves to the plugin
|
|
170
173
|
* @throws Error if the plugin is not found
|
|
171
174
|
*/
|
|
172
|
-
getPluginByPackageName(packageName: string): Promise<
|
|
175
|
+
getPluginByPackageName(packageName: string): Promise<ApiTypes.Plugin>;
|
|
173
176
|
/**
|
|
174
177
|
* Gets a plugin by its package name.
|
|
175
178
|
* @param packageName - The package name of the plugin to retrieve
|
|
176
179
|
* @returns Promise that resolves to the plugin
|
|
177
180
|
* @throws Error if the plugin is not found
|
|
178
181
|
*/
|
|
179
|
-
getRawPluginByPackageName(packageName: string): Promise<
|
|
182
|
+
getRawPluginByPackageName(packageName: string): Promise<RawApiTypes.Plugin>;
|
|
180
183
|
}
|
|
181
184
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datocms/cma-client",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.3",
|
|
4
4
|
"description": "JS client for DatoCMS REST Content Management API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datocms",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"url": "https://github.com/datocms/js-rest-api-clients/issues"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@datocms/rest-client-utils": "^5.1.
|
|
41
|
-
"datocms-structured-text-utils": "^5.
|
|
40
|
+
"@datocms/rest-client-utils": "^5.1.2",
|
|
41
|
+
"datocms-structured-text-utils": "^5.1.0",
|
|
42
42
|
"uuid": "^9.0.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@datocms/dashboard-client": "^5.1.
|
|
45
|
+
"@datocms/dashboard-client": "^5.1.2",
|
|
46
46
|
"@types/uuid": "^9.0.7"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "69bf5360c450dc20913dbafd63c12e1306c230b3"
|
|
49
49
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LocalizedFieldValue } from '../utilities/fieldValue';
|
|
1
2
|
import type { BooleanEditorConfiguration } from './appearance/boolean';
|
|
2
3
|
import type { BooleanRadioGroupEditorConfiguration } from './appearance/boolean_radio_group';
|
|
3
4
|
|
|
@@ -9,6 +10,16 @@ export function isBooleanFieldValue(
|
|
|
9
10
|
return typeof value === 'boolean' || value === null;
|
|
10
11
|
}
|
|
11
12
|
|
|
13
|
+
export function isLocalizedBooleanFieldValue(
|
|
14
|
+
value: unknown,
|
|
15
|
+
): value is LocalizedFieldValue<BooleanFieldValue> {
|
|
16
|
+
return (
|
|
17
|
+
typeof value === 'object' &&
|
|
18
|
+
value !== null &&
|
|
19
|
+
Object.values(value).every(isBooleanFieldValue)
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
12
23
|
export type BooleanFieldValidators = Record<string, never>;
|
|
13
24
|
|
|
14
25
|
export type BooleanFieldAppearance =
|