From 30651bfd31b1db57f34670383fae852086bd317f Mon Sep 17 00:00:00 2001 From: Cesare Naldi Date: Tue, 1 Oct 2024 12:56:32 +0200 Subject: [PATCH] fix: off json ref #//MediaAudio/properties/item --- jsonschemas/publications/3d/3.0.0.json | 26 +++++++++++++------ jsonschemas/publications/article/3.0.0.json | 26 +++++++++++++------ jsonschemas/publications/audio/3.0.0.json | 26 +++++++++++++------ .../publications/checking-in/3.0.0.json | 26 +++++++++++++------ jsonschemas/publications/embed/3.0.0.json | 26 +++++++++++++------ jsonschemas/publications/event/3.0.0.json | 26 +++++++++++++------ jsonschemas/publications/image/3.0.0.json | 26 +++++++++++++------ jsonschemas/publications/link/3.0.0.json | 26 +++++++++++++------ .../publications/livestream/3.0.0.json | 26 +++++++++++++------ jsonschemas/publications/mint/3.0.0.json | 26 +++++++++++++------ jsonschemas/publications/space/3.0.0.json | 26 +++++++++++++------ jsonschemas/publications/story/3.0.0.json | 26 +++++++++++++------ jsonschemas/publications/text-only/3.0.0.json | 26 +++++++++++++------ .../publications/transaction/3.0.0.json | 26 +++++++++++++------ jsonschemas/publications/video/3.0.0.json | 26 +++++++++++++------ scripts/build.ts | 2 ++ src/publication/common/media.ts | 17 ++++++------ 17 files changed, 280 insertions(+), 129 deletions(-) diff --git a/jsonschemas/publications/3d/3.0.0.json b/jsonschemas/publications/3d/3.0.0.json index c693c45..376ed1f 100644 --- a/jsonschemas/publications/3d/3.0.0.json +++ b/jsonschemas/publications/3d/3.0.0.json @@ -619,6 +619,21 @@ }, "additionalProperties": true }, + "MediaAttributes": { + "anyOf": [ + { + "not": {} + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/MetadataAttribute" + }, + "minItems": 1 + } + ], + "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + }, "MediaAudio": { "type": "object", "properties": { @@ -636,12 +651,7 @@ ] }, "attributes": { - "type": "array", - "items": { - "$ref": "#/$defs/MetadataAttribute" - }, - "minItems": 1, - "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -766,7 +776,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -813,7 +823,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", diff --git a/jsonschemas/publications/article/3.0.0.json b/jsonschemas/publications/article/3.0.0.json index 66d252a..4dac0ef 100644 --- a/jsonschemas/publications/article/3.0.0.json +++ b/jsonschemas/publications/article/3.0.0.json @@ -578,6 +578,21 @@ }, "additionalProperties": true }, + "MediaAttributes": { + "anyOf": [ + { + "not": {} + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/MetadataAttribute" + }, + "minItems": 1 + } + ], + "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + }, "MediaAudio": { "type": "object", "properties": { @@ -595,12 +610,7 @@ ] }, "attributes": { - "type": "array", - "items": { - "$ref": "#/$defs/MetadataAttribute" - }, - "minItems": 1, - "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -725,7 +735,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -772,7 +782,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", diff --git a/jsonschemas/publications/audio/3.0.0.json b/jsonschemas/publications/audio/3.0.0.json index d762e3a..702e962 100644 --- a/jsonschemas/publications/audio/3.0.0.json +++ b/jsonschemas/publications/audio/3.0.0.json @@ -580,6 +580,21 @@ }, "additionalProperties": true }, + "MediaAttributes": { + "anyOf": [ + { + "not": {} + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/MetadataAttribute" + }, + "minItems": 1 + } + ], + "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + }, "MediaAudio": { "type": "object", "properties": { @@ -597,12 +612,7 @@ ] }, "attributes": { - "type": "array", - "items": { - "$ref": "#/$defs/MetadataAttribute" - }, - "minItems": 1, - "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -727,7 +737,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -774,7 +784,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", diff --git a/jsonschemas/publications/checking-in/3.0.0.json b/jsonschemas/publications/checking-in/3.0.0.json index 2403234..6bd42fd 100644 --- a/jsonschemas/publications/checking-in/3.0.0.json +++ b/jsonschemas/publications/checking-in/3.0.0.json @@ -599,6 +599,21 @@ }, "additionalProperties": true }, + "MediaAttributes": { + "anyOf": [ + { + "not": {} + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/MetadataAttribute" + }, + "minItems": 1 + } + ], + "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + }, "MediaAudio": { "type": "object", "properties": { @@ -616,12 +631,7 @@ ] }, "attributes": { - "type": "array", - "items": { - "$ref": "#/$defs/MetadataAttribute" - }, - "minItems": 1, - "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -746,7 +756,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -793,7 +803,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", diff --git a/jsonschemas/publications/embed/3.0.0.json b/jsonschemas/publications/embed/3.0.0.json index e91eb1f..36e4c45 100644 --- a/jsonschemas/publications/embed/3.0.0.json +++ b/jsonschemas/publications/embed/3.0.0.json @@ -585,6 +585,21 @@ }, "additionalProperties": true }, + "MediaAttributes": { + "anyOf": [ + { + "not": {} + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/MetadataAttribute" + }, + "minItems": 1 + } + ], + "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + }, "MediaAudio": { "type": "object", "properties": { @@ -602,12 +617,7 @@ ] }, "attributes": { - "type": "array", - "items": { - "$ref": "#/$defs/MetadataAttribute" - }, - "minItems": 1, - "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -732,7 +742,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -779,7 +789,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", diff --git a/jsonschemas/publications/event/3.0.0.json b/jsonschemas/publications/event/3.0.0.json index fc2f4a2..c131b48 100644 --- a/jsonschemas/publications/event/3.0.0.json +++ b/jsonschemas/publications/event/3.0.0.json @@ -1115,6 +1115,21 @@ }, "additionalProperties": true }, + "MediaAttributes": { + "anyOf": [ + { + "not": {} + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/MetadataAttribute" + }, + "minItems": 1 + } + ], + "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + }, "MediaAudio": { "type": "object", "properties": { @@ -1132,12 +1147,7 @@ ] }, "attributes": { - "type": "array", - "items": { - "$ref": "#/$defs/MetadataAttribute" - }, - "minItems": 1, - "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -1262,7 +1272,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -1309,7 +1319,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", diff --git a/jsonschemas/publications/image/3.0.0.json b/jsonschemas/publications/image/3.0.0.json index 13a3acb..9619297 100644 --- a/jsonschemas/publications/image/3.0.0.json +++ b/jsonschemas/publications/image/3.0.0.json @@ -580,6 +580,21 @@ }, "additionalProperties": true }, + "MediaAttributes": { + "anyOf": [ + { + "not": {} + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/MetadataAttribute" + }, + "minItems": 1 + } + ], + "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + }, "MediaAudio": { "type": "object", "properties": { @@ -597,12 +612,7 @@ ] }, "attributes": { - "type": "array", - "items": { - "$ref": "#/$defs/MetadataAttribute" - }, - "minItems": 1, - "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -727,7 +737,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -774,7 +784,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", diff --git a/jsonschemas/publications/link/3.0.0.json b/jsonschemas/publications/link/3.0.0.json index 92fa5b6..59b10c8 100644 --- a/jsonschemas/publications/link/3.0.0.json +++ b/jsonschemas/publications/link/3.0.0.json @@ -585,6 +585,21 @@ }, "additionalProperties": true }, + "MediaAttributes": { + "anyOf": [ + { + "not": {} + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/MetadataAttribute" + }, + "minItems": 1 + } + ], + "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + }, "MediaAudio": { "type": "object", "properties": { @@ -602,12 +617,7 @@ ] }, "attributes": { - "type": "array", - "items": { - "$ref": "#/$defs/MetadataAttribute" - }, - "minItems": 1, - "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -732,7 +742,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -779,7 +789,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", diff --git a/jsonschemas/publications/livestream/3.0.0.json b/jsonschemas/publications/livestream/3.0.0.json index 8c7de68..c9bd212 100644 --- a/jsonschemas/publications/livestream/3.0.0.json +++ b/jsonschemas/publications/livestream/3.0.0.json @@ -642,6 +642,21 @@ }, "additionalProperties": true }, + "MediaAttributes": { + "anyOf": [ + { + "not": {} + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/MetadataAttribute" + }, + "minItems": 1 + } + ], + "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + }, "MediaAudio": { "type": "object", "properties": { @@ -659,12 +674,7 @@ ] }, "attributes": { - "type": "array", - "items": { - "$ref": "#/$defs/MetadataAttribute" - }, - "minItems": 1, - "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -789,7 +799,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -836,7 +846,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", diff --git a/jsonschemas/publications/mint/3.0.0.json b/jsonschemas/publications/mint/3.0.0.json index 381cac6..797313f 100644 --- a/jsonschemas/publications/mint/3.0.0.json +++ b/jsonschemas/publications/mint/3.0.0.json @@ -585,6 +585,21 @@ }, "additionalProperties": true }, + "MediaAttributes": { + "anyOf": [ + { + "not": {} + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/MetadataAttribute" + }, + "minItems": 1 + } + ], + "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + }, "MediaAudio": { "type": "object", "properties": { @@ -602,12 +617,7 @@ ] }, "attributes": { - "type": "array", - "items": { - "$ref": "#/$defs/MetadataAttribute" - }, - "minItems": 1, - "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -732,7 +742,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -779,7 +789,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", diff --git a/jsonschemas/publications/space/3.0.0.json b/jsonschemas/publications/space/3.0.0.json index cd53e54..1d9cae5 100644 --- a/jsonschemas/publications/space/3.0.0.json +++ b/jsonschemas/publications/space/3.0.0.json @@ -604,6 +604,21 @@ }, "additionalProperties": true }, + "MediaAttributes": { + "anyOf": [ + { + "not": {} + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/MetadataAttribute" + }, + "minItems": 1 + } + ], + "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + }, "MediaAudio": { "type": "object", "properties": { @@ -621,12 +636,7 @@ ] }, "attributes": { - "type": "array", - "items": { - "$ref": "#/$defs/MetadataAttribute" - }, - "minItems": 1, - "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -751,7 +761,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -798,7 +808,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", diff --git a/jsonschemas/publications/story/3.0.0.json b/jsonschemas/publications/story/3.0.0.json index 28e3d45..6b995be 100644 --- a/jsonschemas/publications/story/3.0.0.json +++ b/jsonschemas/publications/story/3.0.0.json @@ -568,6 +568,21 @@ }, "additionalProperties": true }, + "MediaAttributes": { + "anyOf": [ + { + "not": {} + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/MetadataAttribute" + }, + "minItems": 1 + } + ], + "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + }, "MediaAudio": { "type": "object", "properties": { @@ -585,12 +600,7 @@ ] }, "attributes": { - "type": "array", - "items": { - "$ref": "#/$defs/MetadataAttribute" - }, - "minItems": 1, - "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -715,7 +725,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -762,7 +772,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", diff --git a/jsonschemas/publications/text-only/3.0.0.json b/jsonschemas/publications/text-only/3.0.0.json index 705ed4e..418747d 100644 --- a/jsonschemas/publications/text-only/3.0.0.json +++ b/jsonschemas/publications/text-only/3.0.0.json @@ -565,6 +565,21 @@ }, "additionalProperties": true }, + "MediaAttributes": { + "anyOf": [ + { + "not": {} + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/MetadataAttribute" + }, + "minItems": 1 + } + ], + "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + }, "MediaAudio": { "type": "object", "properties": { @@ -582,12 +597,7 @@ ] }, "attributes": { - "type": "array", - "items": { - "$ref": "#/$defs/MetadataAttribute" - }, - "minItems": 1, - "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -712,7 +722,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -759,7 +769,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", diff --git a/jsonschemas/publications/transaction/3.0.0.json b/jsonschemas/publications/transaction/3.0.0.json index 0ad4d68..c4b6b39 100644 --- a/jsonschemas/publications/transaction/3.0.0.json +++ b/jsonschemas/publications/transaction/3.0.0.json @@ -599,6 +599,21 @@ }, "additionalProperties": true }, + "MediaAttributes": { + "anyOf": [ + { + "not": {} + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/MetadataAttribute" + }, + "minItems": 1 + } + ], + "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + }, "MediaAudio": { "type": "object", "properties": { @@ -616,12 +631,7 @@ ] }, "attributes": { - "type": "array", - "items": { - "$ref": "#/$defs/MetadataAttribute" - }, - "minItems": 1, - "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -746,7 +756,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -793,7 +803,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", diff --git a/jsonschemas/publications/video/3.0.0.json b/jsonschemas/publications/video/3.0.0.json index 3953e20..a83f0d0 100644 --- a/jsonschemas/publications/video/3.0.0.json +++ b/jsonschemas/publications/video/3.0.0.json @@ -583,6 +583,21 @@ }, "additionalProperties": true }, + "MediaAttributes": { + "anyOf": [ + { + "not": {} + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/MetadataAttribute" + }, + "minItems": 1 + } + ], + "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + }, "MediaAudio": { "type": "object", "properties": { @@ -600,12 +615,7 @@ ] }, "attributes": { - "type": "array", - "items": { - "$ref": "#/$defs/MetadataAttribute" - }, - "minItems": 1, - "description": "A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard." + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -730,7 +740,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", @@ -777,7 +787,7 @@ "$ref": "#/$defs/MediaAudio/properties/item" }, "attributes": { - "$ref": "#/$defs/MediaAudio/properties/attributes" + "$ref": "#/$defs/MediaAttributes" }, "type": { "type": "string", diff --git a/scripts/build.ts b/scripts/build.ts index 385596b..7e7b9fc 100755 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -49,6 +49,7 @@ import { GeoURISchema, PhysicalAddressSchema, EncryptedStringSchema, + MediaAttributesSchema, } from '../src'; import { ModuleMetadataSchema } from '../src/module'; @@ -96,6 +97,7 @@ for (const [path, Schema] of schemas) { FollowCondition: FollowConditionSchema, GeoURI: GeoURISchema, MarketplaceMetadataAttribute: MarketplaceMetadataAttributeSchema, + MediaAttributes: MediaAttributesSchema, MediaAudio: MediaAudioSchema, MediaImage: MediaImageSchema, MediaVideo: MediaVideoSchema, diff --git a/src/publication/common/media.ts b/src/publication/common/media.ts index f3684e1..bc127d5 100644 --- a/src/publication/common/media.ts +++ b/src/publication/common/media.ts @@ -9,14 +9,16 @@ import { encryptableUriSchema, } from '../../primitives.js'; +export const MediaAttributesSchema = MetadataAttributeSchema.array() + .min(1) + .optional() + .describe( + 'A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard.', + ); + const MediaCommonSchema = z.object({ item: encryptableUriSchema('The location of the file.'), - attributes: MetadataAttributeSchema.array() - .min(1) - .optional() - .describe( - 'A bag of attributes that can be used to store any kind of metadata that is not currently supported by the standard.', - ), + attributes: MediaAttributesSchema, }); /** @@ -286,9 +288,6 @@ function resolveAnyMediaSchema(val: unknown) { case MediaVideoMimeType.WEBM: return MediaVideoSchema; } - - // the alleged AnyMedia is not a valid shape - return AnyMediaShapeScheme; } /**