From 11ea4d19af2a8bf1ffe1b1d7f1e72a07d7e9ca80 Mon Sep 17 00:00:00 2001 From: Ryan Balsdon Date: Wed, 26 Jun 2024 11:43:37 -0400 Subject: [PATCH] Updating Article type definitions to match the documentation on the Shopify Dev Portal. The largest change is the inclusion of a src and alt field on the image, which lets Shopify download an image on your behalf. The remaining fields of both create and update actions have been marked as optional too. The only required field listed in the documentation is the Article ID on updates. --- types/index.d.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index f17f0252..bc5a896c 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -996,32 +996,32 @@ declare namespace Shopify { } interface ICreateArticle { - author: string; - body_html: string; + author?: string; + body_html?: string; handle?: string; - image?: IBase64Image; + image?: ICreateArticleImage; metafields?: ICreateObjectMetafield[]; published?: boolean; published_at?: string; summary_html?: string | null; tags?: string; template_suffix?: string | null; - title: string; + title?: string; user_id?: number; } interface IUpdateArticle { - author: string; - body_html: string; + author?: string; + body_html?: string; handle?: string; - image?: IBase64Image; + image?: ICreateArticleImage; metafields?: ICreateObjectMetafield[]; published?: boolean; published_at?: string; summary_html?: string | null; tags?: string; template_suffix?: string | null; - title: string; + title?: string; user_id?: number; } @@ -1034,8 +1034,10 @@ declare namespace Shopify { alt: string | null; } - interface IBase64Image { - attachment: string; + interface ICreateArticleImage { + attachment?: string; + src?: string; + alt?: string; } interface IObjectMetafield {