From deafb755664d064e4b933d629f862349397ea874 Mon Sep 17 00:00:00 2001 From: Stephen Fraser Date: Tue, 24 Sep 2024 10:47:12 +0100 Subject: [PATCH 1/3] Fixed union type --- src/change-discovery.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/change-discovery.d.ts b/src/change-discovery.d.ts index c7a04ea..cf449f2 100644 --- a/src/change-discovery.d.ts +++ b/src/change-discovery.d.ts @@ -24,6 +24,7 @@ export type ChangeDiscoveryActivity = Prettify< | { type: Exclude; object: ChangeDiscoveryBaseObject; + target: never; } | { type: 'Move'; From 11d96968c5cb3e43b9f514a543a553b47d98ea92 Mon Sep 17 00:00:00 2001 From: Stephen Fraser Date: Tue, 24 Sep 2024 10:47:29 +0100 Subject: [PATCH 2/3] Fixed Search 2 targets --- src/services/search-2.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/search-2.d.ts b/src/services/search-2.d.ts index b009eb0..c30e69f 100644 --- a/src/services/search-2.d.ts +++ b/src/services/search-2.d.ts @@ -48,7 +48,7 @@ export type Search2AnnotationPage = Prettify< >; export type Search2ContextualizingAnnotation = Prettify< - Annotation & { + Omit & { motivation: 'contextualizing'; target: { type: 'SpecificResource'; From 92171a59702bdea26d8ac2fcaa7e23e3214d50c9 Mon Sep 17 00:00:00 2001 From: Stephen Fraser Date: Tue, 24 Sep 2024 10:55:20 +0100 Subject: [PATCH 3/3] Updated tests --- tests/manifest.test-d.ts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tests/manifest.test-d.ts b/tests/manifest.test-d.ts index 966741e..7aa9449 100644 --- a/tests/manifest.test-d.ts +++ b/tests/manifest.test-d.ts @@ -2,6 +2,7 @@ import { Manifest } from '../src/resources/manifest'; import { Service } from '../src/resources/service'; import { AuthProbeService2 } from '../src/services/auth-2'; import { ImageService, ImageService3 } from '../src/services/image-service'; +import { ContentResource } from '../src/resources/contentResource'; const cookbook1: Manifest = { '@context': 'http://iiif.io/api/presentation/3/context.json', @@ -153,7 +154,7 @@ const cookbook5: Manifest = { id: 'https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen', profile: 'level1', type: 'ImageService3', - } as ImageService, + }, ], }, target: 'https://iiif.io/api/cookbook/recipe/0005-image-service/canvas/p1', @@ -165,6 +166,21 @@ const cookbook5: Manifest = { ], }; +const contentResourceWithService: ContentResource = { + id: 'https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen/full/max/0/default.jpg', + type: 'Image', + format: 'image/jpeg', + height: 3024, + width: 4032, + service: [ + { + id: 'https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen', + profile: 'level1', + type: 'ImageService3', + }, + ], +}; + const imageService1: ImageService3 = { '@context': 'http://iiif.io/api/image/3/context.json', extraFormats: ['jpg', 'png'], @@ -357,7 +373,7 @@ const auth2_4_kiosk: AuthProbeService2 = { }, { id: 'https://iiif-auth2-server.herokuapp.com/auth/logout/kiosk/04_gene_cernan.jpg', - type: 'AuthLogoutService2' as const, + type: 'AuthLogoutService2', label: { en: ['Log out'], }, @@ -391,7 +407,7 @@ const auth2_5_external: AuthProbeService2 = { }, { id: 'https://iiif-auth2-server.herokuapp.com/auth/logout/external/05_cader_idris.jpg', - type: 'AuthLogoutService2' as const, + type: 'AuthLogoutService2', label: { en: ['Log out'], },