Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ValidationData to include metafields #1838

Merged
merged 4 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/breezy-bikes-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/ui-extensions': patch
---

Update the `ValidationData` type to include `metafields`.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ const data: LandingTemplateSchema = {
{
name: "Direct API can't be used to manage storefront access tokens.",
subtitle: 'Note',
url: '/docs/api/admin-extensions#direct-api-access',
type: 'information',
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import {Metafield} from './metafields';

export interface ValidationData {
validation?: {
/**
* the validation's gid when active in a shop
*/
id: string;
/**
* the metafields owned by the validation
*/
metafields: Metafield[];
};
shopifyFunction: {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ const supportedDefinitionTypes = [

export type SupportedDefinitionType = typeof supportedDefinitionTypes[number];

export interface Metafield {
description?: string;
id: string;
namespace: string;
key: string;
value: string;
type: string;
}

interface MetafieldUpdateChange {
type: 'updateMetafield';
key: string;
Expand Down
Loading