@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../../src/fieldTypes/file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../../src/fieldTypes/file.ts"],"names":[],"mappings":"AAoBA,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,WAAW,IAAI,KAAK,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAC7C,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type { LocalizedFieldValue } from '../utilities/fieldValue';
|
|
1
2
|
import type { FloatEditorConfiguration } from './appearance/float';
|
|
2
3
|
import type { NumberRangeValidator } from './validators/number_range';
|
|
3
4
|
import type { RequiredValidator } from './validators/required';
|
|
4
5
|
export type FloatFieldValue = number | null;
|
|
5
6
|
export declare function isFloatFieldValue(value: unknown): value is FloatFieldValue;
|
|
7
|
+
export declare function isLocalizedFloatFieldValue(value: unknown): value is LocalizedFieldValue<FloatFieldValue>;
|
|
6
8
|
export type FloatFieldValidators = {
|
|
7
9
|
/** Value must be specified or it won't be valid */
|
|
8
10
|
required?: RequiredValidator;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export function isFloatFieldValue(value) {
|
|
2
2
|
return typeof value === 'number' || value === null;
|
|
3
3
|
}
|
|
4
|
+
export function isLocalizedFloatFieldValue(value) {
|
|
5
|
+
return (typeof value === 'object' &&
|
|
6
|
+
value !== null &&
|
|
7
|
+
Object.values(value).every(isFloatFieldValue));
|
|
8
|
+
}
|
|
4
9
|
//# sourceMappingURL=float.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"float.js","sourceRoot":"","sources":["../../../src/fieldTypes/float.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"float.js","sourceRoot":"","sources":["../../../src/fieldTypes/float.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAC9C,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LocalizedFieldValue } from '../utilities/fieldValue';
|
|
1
2
|
import type { GalleryEditorConfiguration } from './appearance/gallery';
|
|
2
3
|
import type { ExtensionValidator } from './validators/extension';
|
|
3
4
|
import type { FileSizeValidator } from './validators/file_size';
|
|
@@ -16,6 +17,7 @@ export type GalleryFieldValue = Array<{
|
|
|
16
17
|
} | null;
|
|
17
18
|
}> | null;
|
|
18
19
|
export declare function isGalleryFieldValue(value: unknown): value is GalleryFieldValue;
|
|
20
|
+
export declare function isLocalizedGalleryFieldValue(value: unknown): value is LocalizedFieldValue<GalleryFieldValue>;
|
|
19
21
|
export type GalleryFieldValidators = {
|
|
20
22
|
/** Only accept a number of items within the specified range */
|
|
21
23
|
size?: SizeValidator;
|
|
@@ -4,4 +4,9 @@ export function isGalleryFieldValue(value) {
|
|
|
4
4
|
return (Array.isArray(value) &&
|
|
5
5
|
value.every((item) => typeof item === 'object' && item !== null && 'upload_id' in item));
|
|
6
6
|
}
|
|
7
|
+
export function isLocalizedGalleryFieldValue(value) {
|
|
8
|
+
return (typeof value === 'object' &&
|
|
9
|
+
value !== null &&
|
|
10
|
+
Object.values(value).every(isGalleryFieldValue));
|
|
11
|
+
}
|
|
7
12
|
//# sourceMappingURL=gallery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.js","sourceRoot":"","sources":["../../../src/fieldTypes/gallery.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gallery.js","sourceRoot":"","sources":["../../../src/fieldTypes/gallery.ts"],"names":[],"mappings":"AAoBA,MAAM,UAAU,mBAAmB,CACjC,KAAc;IAEd,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,OAAO,CACL,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACpB,KAAK,CAAC,KAAK,CACT,CAAC,IAAI,EAAE,EAAE,CACP,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,WAAW,IAAI,IAAI,CACnE,CACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAChD,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type { LocalizedFieldValue } from '../utilities/fieldValue';
|
|
1
2
|
import type { IntegerEditorConfiguration } from './appearance/integer';
|
|
2
3
|
import type { NumberRangeValidator } from './validators/number_range';
|
|
3
4
|
import type { RequiredValidator } from './validators/required';
|
|
4
5
|
export type IntegerFieldValue = number | null;
|
|
5
6
|
export declare function isIntegerFieldValue(value: unknown): value is IntegerFieldValue;
|
|
7
|
+
export declare function isLocalizedIntegerFieldValue(value: unknown): value is LocalizedFieldValue<IntegerFieldValue>;
|
|
6
8
|
export type IntegerFieldValidators = {
|
|
7
9
|
/** Value must be specified or it won't be valid */
|
|
8
10
|
required?: RequiredValidator;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export function isIntegerFieldValue(value) {
|
|
2
2
|
return typeof value === 'number' || value === null;
|
|
3
3
|
}
|
|
4
|
+
export function isLocalizedIntegerFieldValue(value) {
|
|
5
|
+
return (typeof value === 'object' &&
|
|
6
|
+
value !== null &&
|
|
7
|
+
Object.values(value).every(isIntegerFieldValue));
|
|
8
|
+
}
|
|
4
9
|
//# sourceMappingURL=integer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integer.js","sourceRoot":"","sources":["../../../src/fieldTypes/integer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"integer.js","sourceRoot":"","sources":["../../../src/fieldTypes/integer.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,mBAAmB,CACjC,KAAc;IAEd,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAChD,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { LocalizedFieldValue } from '../utilities/fieldValue';
|
|
1
2
|
import type { JsonEditorConfiguration } from './appearance/json';
|
|
2
3
|
import type { StringCheckboxGroupEditorConfiguration } from './appearance/string_checkbox_group';
|
|
3
4
|
import type { StringMultiSelectEditorConfiguration } from './appearance/string_multi_select';
|
|
4
5
|
import type { RequiredValidator } from './validators/required';
|
|
5
6
|
export type JsonFieldValue = string | null;
|
|
6
7
|
export declare function isJsonFieldValue(value: unknown): value is JsonFieldValue;
|
|
8
|
+
export declare function isLocalizedJsonFieldValue(value: unknown): value is LocalizedFieldValue<JsonFieldValue>;
|
|
7
9
|
export type JsonFieldValidators = {
|
|
8
10
|
/** Value must be specified or it won't be valid */
|
|
9
11
|
required?: RequiredValidator;
|
|
@@ -11,4 +11,9 @@ export function isJsonFieldValue(value) {
|
|
|
11
11
|
return false;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
+
export function isLocalizedJsonFieldValue(value) {
|
|
15
|
+
return (typeof value === 'object' &&
|
|
16
|
+
value !== null &&
|
|
17
|
+
Object.values(value).every(isJsonFieldValue));
|
|
18
|
+
}
|
|
14
19
|
//# sourceMappingURL=json.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../src/fieldTypes/json.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../src/fieldTypes/json.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI;QACF,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAClB,OAAO,IAAI,CAAC;KACb;IAAC,WAAM;QACN,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAC7C,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LocalizedFieldValue } from '../utilities/fieldValue';
|
|
1
2
|
import type { MapEditorConfiguration } from './appearance/map';
|
|
2
3
|
import type { RequiredValidator } from './validators/required';
|
|
3
4
|
export type LocationFieldValue = {
|
|
@@ -5,6 +6,7 @@ export type LocationFieldValue = {
|
|
|
5
6
|
longitude: number;
|
|
6
7
|
} | null;
|
|
7
8
|
export declare function isLocationFieldValue(value: unknown): value is LocationFieldValue;
|
|
9
|
+
export declare function isLocalizedLocationFieldValue(value: unknown): value is LocalizedFieldValue<LocationFieldValue>;
|
|
8
10
|
export type LocationFieldValidators = {
|
|
9
11
|
/** Value must be specified or it won't be valid */
|
|
10
12
|
required?: RequiredValidator;
|
|
@@ -6,4 +6,9 @@ export function isLocationFieldValue(value) {
|
|
|
6
6
|
'latitude' in value &&
|
|
7
7
|
'longitude' in value);
|
|
8
8
|
}
|
|
9
|
+
export function isLocalizedLocationFieldValue(value) {
|
|
10
|
+
return (typeof value === 'object' &&
|
|
11
|
+
value !== null &&
|
|
12
|
+
Object.values(value).every(isLocationFieldValue));
|
|
13
|
+
}
|
|
9
14
|
//# sourceMappingURL=lat_lon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lat_lon.js","sourceRoot":"","sources":["../../../src/fieldTypes/lat_lon.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lat_lon.js","sourceRoot":"","sources":["../../../src/fieldTypes/lat_lon.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,oBAAoB,CAClC,KAAc;IAEd,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,UAAU,IAAI,KAAK;QACnB,WAAW,IAAI,KAAK,CACrB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CACjD,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LocalizedFieldValue } from '../utilities/fieldValue';
|
|
1
2
|
import type { LinkEmbedEditorConfiguration } from './appearance/link_embed';
|
|
2
3
|
import type { LinkSelectEditorConfiguration } from './appearance/link_select';
|
|
3
4
|
import type { ItemItemTypeValidator } from './validators/item_item_type';
|
|
@@ -5,6 +6,7 @@ import type { RequiredValidator } from './validators/required';
|
|
|
5
6
|
import type { UniqueValidator } from './validators/unique';
|
|
6
7
|
export type LinkFieldValue = string | null;
|
|
7
8
|
export declare function isLinkFieldValue(value: unknown): value is LinkFieldValue;
|
|
9
|
+
export declare function isLocalizedLinkFieldValue(value: unknown): value is LocalizedFieldValue<LinkFieldValue>;
|
|
8
10
|
export type LinkFieldValidators = {
|
|
9
11
|
/** Only accept references to records of the specified models */
|
|
10
12
|
item_item_type: ItemItemTypeValidator;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export function isLinkFieldValue(value) {
|
|
2
2
|
return typeof value === 'string' || value === null;
|
|
3
3
|
}
|
|
4
|
+
export function isLocalizedLinkFieldValue(value) {
|
|
5
|
+
return (typeof value === 'object' &&
|
|
6
|
+
value !== null &&
|
|
7
|
+
Object.values(value).every(isLinkFieldValue));
|
|
8
|
+
}
|
|
4
9
|
//# sourceMappingURL=link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../../src/fieldTypes/link.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../../src/fieldTypes/link.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAC7C,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { LocalizedFieldValue } from '../utilities/fieldValue';
|
|
1
2
|
import type { LinksEmbedEditorConfiguration } from './appearance/links_embed';
|
|
2
3
|
import type { LinksSelectEditorConfiguration } from './appearance/links_select';
|
|
3
4
|
import type { ItemsItemTypeValidator } from './validators/items_item_type';
|
|
4
5
|
import type { SizeValidator } from './validators/size';
|
|
5
6
|
export type LinksFieldValue = string[] | null;
|
|
6
7
|
export declare function isLinksFieldValue(value: unknown): value is LinksFieldValue;
|
|
8
|
+
export declare function isLocalizedLinksFieldValue(value: unknown): value is LocalizedFieldValue<LinksFieldValue>;
|
|
7
9
|
export type LinksFieldValidators = {
|
|
8
10
|
/** Only accept references to records of the specified models */
|
|
9
11
|
items_item_type: ItemsItemTypeValidator;
|
|
@@ -3,4 +3,9 @@ export function isLinksFieldValue(value) {
|
|
|
3
3
|
return true;
|
|
4
4
|
return (Array.isArray(value) && value.every((item) => typeof item === 'string'));
|
|
5
5
|
}
|
|
6
|
+
export function isLocalizedLinksFieldValue(value) {
|
|
7
|
+
return (typeof value === 'object' &&
|
|
8
|
+
value !== null &&
|
|
9
|
+
Object.values(value).every(isLinksFieldValue));
|
|
10
|
+
}
|
|
6
11
|
//# sourceMappingURL=links.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.js","sourceRoot":"","sources":["../../../src/fieldTypes/links.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"links.js","sourceRoot":"","sources":["../../../src/fieldTypes/links.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,OAAO,CACL,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CACxE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAC9C,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as RawApiTypes from '../generated/RawApiTypes';
|
|
2
|
+
import type { LocalizedFieldValue } from '../utilities/fieldValue';
|
|
3
|
+
import type { RichTextEditorConfiguration } from './appearance/rich_text';
|
|
2
4
|
import { type BlockItemInARequest } from './single_block';
|
|
5
|
+
import type { RichTextBlocksValidator } from './validators/rich_text_blocks';
|
|
6
|
+
import type { SizeValidator } from './validators/size';
|
|
3
7
|
/**
|
|
4
8
|
* MODULAR CONTENT FIELD TYPE SYSTEM FOR DATOCMS
|
|
5
9
|
*
|
|
@@ -43,8 +47,8 @@ export type RichTextFieldValue = string[] | null;
|
|
|
43
47
|
/**
|
|
44
48
|
* Modular Content field value for API requests - allows flexible block representations:
|
|
45
49
|
* - string: Just the block ID (most common case)
|
|
46
|
-
* -
|
|
47
|
-
* - Omit<
|
|
50
|
+
* - RawApiTypes.Item: Full block object with ID (for updates)
|
|
51
|
+
* - Omit<RawApiTypes.Item, 'id'>: Block object without ID (for creation)
|
|
48
52
|
*/
|
|
49
53
|
export type RichTextFieldValueAsRequest = BlockItemInARequest[] | null;
|
|
50
54
|
/**
|
|
@@ -53,13 +57,13 @@ export type RichTextFieldValueAsRequest = BlockItemInARequest[] | null;
|
|
|
53
57
|
* =============================================================================
|
|
54
58
|
*
|
|
55
59
|
* When using the ?nested=true query parameter, the API returns Modular Content data
|
|
56
|
-
* with embedded blocks fully populated as complete
|
|
60
|
+
* with embedded blocks fully populated as complete RawApiTypes.Item objects instead
|
|
57
61
|
* of just string IDs. This provides type safety for working with fully resolved data.
|
|
58
62
|
*/
|
|
59
63
|
/**
|
|
60
64
|
* Modular Content field value with nested blocks - array of fully populated block objects
|
|
61
65
|
*/
|
|
62
|
-
export type RichTextFieldValueWithNestedBlocks =
|
|
66
|
+
export type RichTextFieldValueWithNestedBlocks = RawApiTypes.Item[] | null;
|
|
63
67
|
/**
|
|
64
68
|
* =============================================================================
|
|
65
69
|
* TYPE GUARDS - Runtime validation functions
|
|
@@ -70,19 +74,19 @@ export type RichTextFieldValueWithNestedBlocks = SchemaTypes.Item[] | null;
|
|
|
70
74
|
* Checks for array structure and ensures all blocks are string references.
|
|
71
75
|
*/
|
|
72
76
|
export declare function isRichTextFieldValue(value: unknown): value is RichTextFieldValue;
|
|
77
|
+
export declare function isLocalizedRichTextFieldValue(value: unknown): value is LocalizedFieldValue<RichTextFieldValue>;
|
|
73
78
|
/**
|
|
74
79
|
* Type guard for Modular Content field values in API request format.
|
|
75
80
|
* Allows blocks as string IDs, full objects with IDs, or objects without IDs.
|
|
76
81
|
*/
|
|
77
82
|
export declare function isRichTextFieldValueAsRequest(value: unknown): value is RichTextFieldValueAsRequest;
|
|
83
|
+
export declare function isLocalizedRichTextFieldValueAsRequest(value: unknown): value is LocalizedFieldValue<RichTextFieldValueAsRequest>;
|
|
78
84
|
/**
|
|
79
85
|
* Type guard for Modular Content field values with nested blocks (?nested=true format).
|
|
80
|
-
* Ensures all blocks are full
|
|
86
|
+
* Ensures all blocks are full RawApiTypes.Item objects with complete data.
|
|
81
87
|
*/
|
|
82
88
|
export declare function isRichTextFieldValueWithNestedBlocks(value: unknown): value is RichTextFieldValueWithNestedBlocks;
|
|
83
|
-
|
|
84
|
-
import type { RichTextBlocksValidator } from './validators/rich_text_blocks';
|
|
85
|
-
import type { SizeValidator } from './validators/size';
|
|
89
|
+
export declare function isLocalizedRichTextFieldValueWithNestedBlocks(value: unknown): value is LocalizedFieldValue<RichTextFieldValueWithNestedBlocks>;
|
|
86
90
|
export type RichTextFieldValidators = {
|
|
87
91
|
/** Only accept references to block records of the specified block models */
|
|
88
92
|
rich_text_blocks: RichTextBlocksValidator;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isItemId, isItemWithOptionalIdAndMeta, isItemWithOptionalMeta, } from './single_block';
|
|
2
2
|
/**
|
|
3
3
|
* =============================================================================
|
|
4
4
|
* TYPE GUARDS - Runtime validation functions
|
|
@@ -13,6 +13,11 @@ export function isRichTextFieldValue(value) {
|
|
|
13
13
|
return true;
|
|
14
14
|
return (Array.isArray(value) && value.every((block) => typeof block === 'string'));
|
|
15
15
|
}
|
|
16
|
+
export function isLocalizedRichTextFieldValue(value) {
|
|
17
|
+
return (typeof value === 'object' &&
|
|
18
|
+
value !== null &&
|
|
19
|
+
Object.values(value).every(isRichTextFieldValue));
|
|
20
|
+
}
|
|
16
21
|
/**
|
|
17
22
|
* Type guard for Modular Content field values in API request format.
|
|
18
23
|
* Allows blocks as string IDs, full objects with IDs, or objects without IDs.
|
|
@@ -24,15 +29,20 @@ export function isRichTextFieldValueAsRequest(value) {
|
|
|
24
29
|
return false;
|
|
25
30
|
return value.every((block) => {
|
|
26
31
|
// String ID - referencing existing block
|
|
27
|
-
if (
|
|
32
|
+
if (isItemId(block))
|
|
28
33
|
return true;
|
|
29
34
|
// Object (either with or without ID for updates/creation)
|
|
30
|
-
return
|
|
35
|
+
return isItemWithOptionalIdAndMeta(block);
|
|
31
36
|
});
|
|
32
37
|
}
|
|
38
|
+
export function isLocalizedRichTextFieldValueAsRequest(value) {
|
|
39
|
+
return (typeof value === 'object' &&
|
|
40
|
+
value !== null &&
|
|
41
|
+
Object.values(value).every(isRichTextFieldValueAsRequest));
|
|
42
|
+
}
|
|
33
43
|
/**
|
|
34
44
|
* Type guard for Modular Content field values with nested blocks (?nested=true format).
|
|
35
|
-
* Ensures all blocks are full
|
|
45
|
+
* Ensures all blocks are full RawApiTypes.Item objects with complete data.
|
|
36
46
|
*/
|
|
37
47
|
export function isRichTextFieldValueWithNestedBlocks(value) {
|
|
38
48
|
if (value === null)
|
|
@@ -41,7 +51,12 @@ export function isRichTextFieldValueWithNestedBlocks(value) {
|
|
|
41
51
|
return false;
|
|
42
52
|
return value.every((block) => {
|
|
43
53
|
// Must be a full object with ID (nested format always includes complete block objects)
|
|
44
|
-
return
|
|
54
|
+
return isItemWithOptionalMeta(block);
|
|
45
55
|
});
|
|
46
56
|
}
|
|
57
|
+
export function isLocalizedRichTextFieldValueWithNestedBlocks(value) {
|
|
58
|
+
return (typeof value === 'object' &&
|
|
59
|
+
value !== null &&
|
|
60
|
+
Object.values(value).every(isRichTextFieldValueWithNestedBlocks));
|
|
61
|
+
}
|
|
47
62
|
//# sourceMappingURL=rich_text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich_text.js","sourceRoot":"","sources":["../../../src/fieldTypes/rich_text.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rich_text.js","sourceRoot":"","sources":["../../../src/fieldTypes/rich_text.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,QAAQ,EACR,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAuExB;;;;GAIG;AAEH;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAc;IAEd,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEhC,OAAO,CACL,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAC1E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CACjD,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAC3C,KAAc;IAEd,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEhC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAExC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QAC3B,yCAAyC;QACzC,IAAI,QAAQ,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAEjC,0DAA0D;QAC1D,OAAO,2BAA2B,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,sCAAsC,CACpD,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAC1D,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oCAAoC,CAClD,KAAc;IAEd,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEhC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAExC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QAC3B,uFAAuF;QACvF,OAAO,sBAAsB,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,6CAA6C,CAC3D,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,oCAAoC,CAAC,CACjE,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LocalizedFieldValue } from '../utilities/fieldValue';
|
|
1
2
|
import type { SeoEditorConfiguration } from './appearance/seo';
|
|
2
3
|
import type { DescriptionLengthValidator } from './validators/description_length';
|
|
3
4
|
import type { FileSizeValidator } from './validators/file_size';
|
|
@@ -13,6 +14,7 @@ export type SeoFieldValue = {
|
|
|
13
14
|
no_index?: boolean;
|
|
14
15
|
} | null;
|
|
15
16
|
export declare function isSeoFieldValue(value: unknown): value is SeoFieldValue;
|
|
17
|
+
export declare function isLocalizedSeoFieldValue(value: unknown): value is LocalizedFieldValue<SeoFieldValue>;
|
|
16
18
|
export type SeoFieldValidators = {
|
|
17
19
|
/** SEO field has to specify one or more properties, or it won't be valid */
|
|
18
20
|
required_seo_fields?: RequiredSeoFieldsValidator;
|
|
@@ -9,4 +9,9 @@ export function isSeoFieldValue(value) {
|
|
|
9
9
|
'twitter_card' in value ||
|
|
10
10
|
'no_index' in value));
|
|
11
11
|
}
|
|
12
|
+
export function isLocalizedSeoFieldValue(value) {
|
|
13
|
+
return (typeof value === 'object' &&
|
|
14
|
+
value !== null &&
|
|
15
|
+
Object.values(value).every(isSeoFieldValue));
|
|
16
|
+
}
|
|
12
17
|
//# sourceMappingURL=seo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seo.js","sourceRoot":"","sources":["../../../src/fieldTypes/seo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"seo.js","sourceRoot":"","sources":["../../../src/fieldTypes/seo.ts"],"names":[],"mappings":"AAiBA,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,CAAC,OAAO,IAAI,KAAK;YACf,aAAa,IAAI,KAAK;YACtB,OAAO,IAAI,KAAK;YAChB,cAAc,IAAI,KAAK;YACvB,UAAU,IAAI,KAAK,CAAC,CACvB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAC5C,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type * as
|
|
1
|
+
import type * as RawApiTypes from '../generated/RawApiTypes';
|
|
2
|
+
import type { LocalizedFieldValue } from '../utilities/fieldValue';
|
|
3
|
+
import type { FramedSingleBlockEditorConfiguration } from './appearance/framed_single_block';
|
|
4
|
+
import type { FramelessSingleBlockEditorConfiguration } from './appearance/frameless_single_block';
|
|
5
|
+
import type { RequiredValidator } from './validators/required';
|
|
6
|
+
import type { SingleBlockBlocksValidator } from './validators/single_block_blocks';
|
|
2
7
|
/**
|
|
3
8
|
* SINGLE BLOCK FIELD TYPE SYSTEM FOR DATOCMS
|
|
4
9
|
*
|
|
@@ -39,20 +44,26 @@ export type SingleBlockFieldValue = string | null;
|
|
|
39
44
|
* - Include full block object for updates
|
|
40
45
|
* - Omit ID for new blocks being created
|
|
41
46
|
*/
|
|
47
|
+
/** Represents an existing block in a CMA request */
|
|
48
|
+
export type UnchangedBlockInARequest = string;
|
|
49
|
+
/** Represents a block we want to update in a CMA request */
|
|
50
|
+
export type UpdatedBlockInARequest = OptionalFields<RawApiTypes.Item, 'meta'>;
|
|
51
|
+
/** Represents a new block to create in a CMA request */
|
|
52
|
+
export type NewBlockInARequest = OptionalFields<RawApiTypes.Item, 'id' | 'meta'>;
|
|
42
53
|
/**
|
|
43
54
|
* 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 (
|
|
55
|
+
* - string: Just the block ID (to keep existing blocks unchanged)
|
|
56
|
+
* - Full block object with ID (to update an existing block)
|
|
57
|
+
* - Block object without ID (to create a new block)
|
|
47
58
|
*
|
|
48
59
|
* Also, 'meta' can always be omitted
|
|
49
60
|
*/
|
|
50
|
-
export type BlockItemInARequest =
|
|
61
|
+
export type BlockItemInARequest = UnchangedBlockInARequest | UpdatedBlockInARequest | NewBlockInARequest;
|
|
51
62
|
/**
|
|
52
63
|
* Single Block field value for API requests - allows flexible block representations:
|
|
53
|
-
* - string: Just the block ID (
|
|
54
|
-
* -
|
|
55
|
-
* -
|
|
64
|
+
* - string: Just the block ID (to keep existing blocks unchanged)
|
|
65
|
+
* - Full block object with ID (to update an existing block)
|
|
66
|
+
* - Block object without ID (to create a new block)
|
|
56
67
|
*/
|
|
57
68
|
export type SingleBlockFieldValueAsRequest = BlockItemInARequest | null;
|
|
58
69
|
/**
|
|
@@ -61,13 +72,13 @@ export type SingleBlockFieldValueAsRequest = BlockItemInARequest | null;
|
|
|
61
72
|
* =============================================================================
|
|
62
73
|
*
|
|
63
74
|
* When using the ?nested=true query parameter, the API returns Single Block data
|
|
64
|
-
* with embedded block fully populated as complete
|
|
75
|
+
* with embedded block fully populated as complete RawApiTypes.Item object instead
|
|
65
76
|
* of just string ID. This provides type safety for working with fully resolved data.
|
|
66
77
|
*/
|
|
67
78
|
/**
|
|
68
79
|
* Single Block field value with nested block - fully populated block object
|
|
69
80
|
*/
|
|
70
|
-
export type SingleBlockFieldValueWithNestedBlocks =
|
|
81
|
+
export type SingleBlockFieldValueWithNestedBlocks = RawApiTypes.Item | null;
|
|
71
82
|
/**
|
|
72
83
|
* =============================================================================
|
|
73
84
|
* SHARED UTILITY FUNCTIONS
|
|
@@ -75,19 +86,19 @@ export type SingleBlockFieldValueWithNestedBlocks = SchemaTypes.Item | null;
|
|
|
75
86
|
* These functions are used internally and can be imported by other modules
|
|
76
87
|
*/
|
|
77
88
|
/**
|
|
78
|
-
* Validates if a
|
|
89
|
+
* Validates if the input is a valid item (either block or record) ID
|
|
79
90
|
*/
|
|
80
|
-
export declare function
|
|
81
|
-
export type ItemWithOptionalIdAndMeta = OptionalFields<
|
|
91
|
+
export declare function isItemId(input: unknown): input is string;
|
|
92
|
+
export type ItemWithOptionalIdAndMeta = OptionalFields<RawApiTypes.Item, 'id' | 'meta'>;
|
|
82
93
|
/**
|
|
83
|
-
* Validates if
|
|
94
|
+
* Validates if the input is a RawApiTypes.Item object (with optional `id` and `meta`)
|
|
84
95
|
*/
|
|
85
|
-
export declare function
|
|
86
|
-
export type ItemWithOptionalMeta = OptionalFields<
|
|
96
|
+
export declare function isItemWithOptionalIdAndMeta(block: unknown): block is ItemWithOptionalIdAndMeta;
|
|
97
|
+
export type ItemWithOptionalMeta = OptionalFields<RawApiTypes.Item, 'meta'>;
|
|
87
98
|
/**
|
|
88
|
-
* Validates if
|
|
99
|
+
* Validates if the input is a a complete RawApiTypes.Item object with optional `meta`
|
|
89
100
|
*/
|
|
90
|
-
export declare function
|
|
101
|
+
export declare function isItemWithOptionalMeta(block: unknown): block is ItemWithOptionalMeta;
|
|
91
102
|
/**
|
|
92
103
|
* =============================================================================
|
|
93
104
|
* TYPE GUARDS - Runtime validation functions
|
|
@@ -98,20 +109,19 @@ export declare function isBlockObjectWithId(block: unknown): block is ItemWithOp
|
|
|
98
109
|
* Checks for string structure and ensures block is a string reference.
|
|
99
110
|
*/
|
|
100
111
|
export declare function isSingleBlockFieldValue(value: unknown): value is SingleBlockFieldValue;
|
|
112
|
+
export declare function isLocalizedSingleBlockFieldValue(value: unknown): value is LocalizedFieldValue<SingleBlockFieldValue>;
|
|
101
113
|
/**
|
|
102
114
|
* Type guard for Single Block field values in API request format.
|
|
103
115
|
* Allows block as string ID, full object with ID, or object without ID.
|
|
104
116
|
*/
|
|
105
117
|
export declare function isSingleBlockFieldValueAsRequest(value: unknown): value is SingleBlockFieldValueAsRequest;
|
|
118
|
+
export declare function isLocalizedSingleBlockFieldValueAsRequest(value: unknown): value is LocalizedFieldValue<SingleBlockFieldValueAsRequest>;
|
|
106
119
|
/**
|
|
107
120
|
* Type guard for Single Block field values with nested blocks (?nested=true format).
|
|
108
|
-
* Ensures block is a full
|
|
121
|
+
* Ensures block is a full RawApiTypes.Item object with complete data.
|
|
109
122
|
*/
|
|
110
123
|
export declare function isSingleBlockFieldValueWithNestedBlocks(value: unknown): value is SingleBlockFieldValueWithNestedBlocks;
|
|
111
|
-
|
|
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';
|
|
124
|
+
export declare function isLocalizedSingleBlockFieldValueWithNestedBlocks(value: unknown): value is LocalizedFieldValue<SingleBlockFieldValueWithNestedBlocks>;
|
|
115
125
|
export type SingleBlockFieldValidators = {
|
|
116
126
|
/** Only accept references to block records of the specified block models */
|
|
117
127
|
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
|
* =============================================================================
|
|
@@ -37,6 +39,11 @@ export function isBlockObjectWithId(block) {
|
|
|
37
39
|
export function isSingleBlockFieldValue(value) {
|
|
38
40
|
return typeof value === 'string' || value === null;
|
|
39
41
|
}
|
|
42
|
+
export function isLocalizedSingleBlockFieldValue(value) {
|
|
43
|
+
return (typeof value === 'object' &&
|
|
44
|
+
value !== null &&
|
|
45
|
+
Object.values(value).every(isSingleBlockFieldValue));
|
|
46
|
+
}
|
|
40
47
|
/**
|
|
41
48
|
* Type guard for Single Block field values in API request format.
|
|
42
49
|
* Allows block as string ID, full object with ID, or object without ID.
|
|
@@ -44,20 +51,30 @@ export function isSingleBlockFieldValue(value) {
|
|
|
44
51
|
export function isSingleBlockFieldValueAsRequest(value) {
|
|
45
52
|
if (value === null)
|
|
46
53
|
return true;
|
|
47
|
-
// String ID
|
|
48
|
-
if (
|
|
54
|
+
// String ID - referencing existing block
|
|
55
|
+
if (isItemId(value))
|
|
49
56
|
return true;
|
|
50
57
|
// Object (either with or without ID for updates/creation)
|
|
51
|
-
return
|
|
58
|
+
return isItemWithOptionalIdAndMeta(value);
|
|
59
|
+
}
|
|
60
|
+
export function isLocalizedSingleBlockFieldValueAsRequest(value) {
|
|
61
|
+
return (typeof value === 'object' &&
|
|
62
|
+
value !== null &&
|
|
63
|
+
Object.values(value).every(isSingleBlockFieldValueAsRequest));
|
|
52
64
|
}
|
|
53
65
|
/**
|
|
54
66
|
* Type guard for Single Block field values with nested blocks (?nested=true format).
|
|
55
|
-
* Ensures block is a full
|
|
67
|
+
* Ensures block is a full RawApiTypes.Item object with complete data.
|
|
56
68
|
*/
|
|
57
69
|
export function isSingleBlockFieldValueWithNestedBlocks(value) {
|
|
58
70
|
if (value === null)
|
|
59
71
|
return true;
|
|
60
72
|
// Must be a full object with ID (nested format always includes complete block objects)
|
|
61
|
-
return
|
|
73
|
+
return isItemWithOptionalMeta(value);
|
|
74
|
+
}
|
|
75
|
+
export function isLocalizedSingleBlockFieldValueWithNestedBlocks(value) {
|
|
76
|
+
return (typeof value === 'object' &&
|
|
77
|
+
value !== null &&
|
|
78
|
+
Object.values(value).every(isSingleBlockFieldValueWithNestedBlocks));
|
|
62
79
|
}
|
|
63
80
|
//# 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":"AAkGA;;;;;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,MAAM,UAAU,gCAAgC,CAC9C,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,uBAAuB,CAAC,CACpD,CAAC;AACJ,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,MAAM,UAAU,yCAAyC,CACvD,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAC7D,CAAC;AACJ,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;AAED,MAAM,UAAU,gDAAgD,CAC9D,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,uCAAuC,CAAC,CACpE,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LocalizedFieldValue } from '../utilities/fieldValue';
|
|
1
2
|
import type { SlugEditorConfiguration } from './appearance/slug';
|
|
2
3
|
import type { LengthValidator } from './validators/length';
|
|
3
4
|
import type { RequiredValidator } from './validators/required';
|
|
@@ -5,6 +6,7 @@ import type { SlugFormatValidator } from './validators/slug_format';
|
|
|
5
6
|
import type { SlugTitleFieldValidator } from './validators/slug_title_field';
|
|
6
7
|
export type SlugFieldValue = string | null;
|
|
7
8
|
export declare function isSlugFieldValue(value: unknown): value is SlugFieldValue;
|
|
9
|
+
export declare function isLocalizedSlugFieldValue(value: unknown): value is LocalizedFieldValue<SlugFieldValue>;
|
|
8
10
|
export type SlugFieldValidators = {
|
|
9
11
|
/** Value must be specified or it won't be valid */
|
|
10
12
|
required?: RequiredValidator;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export function isSlugFieldValue(value) {
|
|
2
2
|
if (value === null)
|
|
3
3
|
return true;
|
|
4
|
-
return typeof value === 'string'
|
|
4
|
+
return typeof value === 'string';
|
|
5
|
+
}
|
|
6
|
+
export function isLocalizedSlugFieldValue(value) {
|
|
7
|
+
return (typeof value === 'object' &&
|
|
8
|
+
value !== null &&
|
|
9
|
+
Object.values(value).every(isSlugFieldValue));
|
|
5
10
|
}
|
|
6
11
|
//# sourceMappingURL=slug.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slug.js","sourceRoot":"","sources":["../../../src/fieldTypes/slug.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slug.js","sourceRoot":"","sources":["../../../src/fieldTypes/slug.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAC7C,CAAC;AACJ,CAAC"}
|