From cc90b6f59361712217645f8d3efc3aa38bb5672a Mon Sep 17 00:00:00 2001 From: DrMint <29893320+DrMint@users.noreply.github.com> Date: Thu, 23 May 2024 13:24:34 +0200 Subject: [PATCH] Add opengraph version to image --- src/collections/Images/endpoints/getByID.ts | 1 + src/sdk.ts | 2 ++ src/utils/endpoints.ts | 1 + 3 files changed, 4 insertions(+) diff --git a/src/collections/Images/endpoints/getByID.ts b/src/collections/Images/endpoints/getByID.ts index a5c84c5..949f346 100644 --- a/src/collections/Images/endpoints/getByID.ts +++ b/src/collections/Images/endpoints/getByID.ts @@ -94,4 +94,5 @@ export const convertImageToEndpointImage = ({ ], [200, 320, 480, 800, 1280, 1920, 2560] ), + ...(isPayloadImage(sizes?.og) ? { openGraph: sizes.og } : {}), }); diff --git a/src/sdk.ts b/src/sdk.ts index b10f175..fd21f32 100644 --- a/src/sdk.ts +++ b/src/sdk.ts @@ -415,6 +415,7 @@ export type EndpointImage = EndpointMedia & { width: number; height: number; sizes: PayloadImage[]; + openGraph?: PayloadImage; }; export type EndpointAudio = EndpointMedia & { @@ -445,6 +446,7 @@ export type EndpointVideo = EndpointMedia & { export type EndpointMediaThumbnail = PayloadImage & { sizes: PayloadImage[]; + openGraph?: PayloadImage; }; export type PayloadMedia = { diff --git a/src/utils/endpoints.ts b/src/utils/endpoints.ts index 8e88b0b..6e0f4db 100644 --- a/src/utils/endpoints.ts +++ b/src/utils/endpoints.ts @@ -362,4 +362,5 @@ export const convertMediaThumbnailToEndpointMediaThumbnail = ({ ], [200, 320, 480, 800, 1280, 1920, 2560] ), + ...(isPayloadImage(sizes?.og) ? { openGraph: sizes.og } : {}), });