Skip to content

Commit

Permalink
Updating Article type definitions to match the documentation on the S…
Browse files Browse the repository at this point in the history
…hopify 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.
  • Loading branch information
ryanbalsdon committed Jun 26, 2024
1 parent fd6d034 commit 11ea4d1
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -1034,8 +1034,10 @@ declare namespace Shopify {
alt: string | null;
}

interface IBase64Image {
attachment: string;
interface ICreateArticleImage {
attachment?: string;
src?: string;
alt?: string;
}

interface IObjectMetafield {
Expand Down

0 comments on commit 11ea4d1

Please sign in to comment.