Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1202 from Shopify/fix_gift_card_types
Browse files Browse the repository at this point in the history
Fix currency and balance types in GiftCards
  • Loading branch information
paulomarg authored Feb 7, 2024
2 parents f298bec + 224fbf5 commit f47257b
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 54 deletions.
5 changes: 5 additions & 0 deletions .changeset/curly-grapes-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@shopify/shopify-api": patch
---

Fixed the types of the `balance` and `currency` fields in the `GiftCard` object.
12 changes: 3 additions & 9 deletions packages/shopify-api/rest/admin/2022-10/gift_card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import {ResourcePath, ResourceNames} from '../../types';
import {Session} from '../../../lib/session/session';
import {ApiVersion} from '../../../lib/types';

import {Balance} from './balance';
import {Currency} from './currency';

interface FindArgs {
session: Session;
id: number | string;
Expand Down Expand Up @@ -47,10 +44,7 @@ interface DisableArgs {
export class GiftCard extends Base {
public static apiVersion = ApiVersion.October22;

protected static hasOne: {[key: string]: typeof Base} = {
"balance": Balance,
"currency": Currency
};
protected static hasOne: {[key: string]: typeof Base} = {};
protected static hasMany: {[key: string]: typeof Base} = {};
protected static paths: ResourcePath[] = [
{"http_method": "get", "operation": "count", "ids": [], "path": "gift_cards/count.json"},
Expand Down Expand Up @@ -168,10 +162,10 @@ export class GiftCard extends Base {
}

public api_client_id: number | null;
public balance: Balance | null | {[key: string]: any};
public balance: string | null;
public code: string | null;
public created_at: string | null;
public currency: Currency | null | {[key: string]: any};
public currency: string | null;
public customer_id: number | null;
public disabled_at: string | null;
public expires_on: string | null;
Expand Down
12 changes: 3 additions & 9 deletions packages/shopify-api/rest/admin/2023-01/gift_card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import {ResourcePath, ResourceNames} from '../../types';
import {Session} from '../../../lib/session/session';
import {ApiVersion} from '../../../lib/types';

import {Balance} from './balance';
import {Currency} from './currency';

interface FindArgs {
session: Session;
id: number | string;
Expand Down Expand Up @@ -47,10 +44,7 @@ interface DisableArgs {
export class GiftCard extends Base {
public static apiVersion = ApiVersion.January23;

protected static hasOne: {[key: string]: typeof Base} = {
"balance": Balance,
"currency": Currency
};
protected static hasOne: {[key: string]: typeof Base} = {};
protected static hasMany: {[key: string]: typeof Base} = {};
protected static paths: ResourcePath[] = [
{"http_method": "get", "operation": "count", "ids": [], "path": "gift_cards/count.json"},
Expand Down Expand Up @@ -168,10 +162,10 @@ export class GiftCard extends Base {
}

public api_client_id: number | null;
public balance: Balance | null | {[key: string]: any};
public balance: string | null;
public code: string | null;
public created_at: string | null;
public currency: Currency | null | {[key: string]: any};
public currency: string | null;
public customer_id: number | null;
public disabled_at: string | null;
public expires_on: string | null;
Expand Down
12 changes: 3 additions & 9 deletions packages/shopify-api/rest/admin/2023-04/gift_card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import {ResourcePath, ResourceNames} from '../../types';
import {Session} from '../../../lib/session/session';
import {ApiVersion} from '../../../lib/types';

import {Balance} from './balance';
import {Currency} from './currency';

interface FindArgs {
session: Session;
id: number | string;
Expand Down Expand Up @@ -47,10 +44,7 @@ interface DisableArgs {
export class GiftCard extends Base {
public static apiVersion = ApiVersion.April23;

protected static hasOne: {[key: string]: typeof Base} = {
"balance": Balance,
"currency": Currency
};
protected static hasOne: {[key: string]: typeof Base} = {};
protected static hasMany: {[key: string]: typeof Base} = {};
protected static paths: ResourcePath[] = [
{"http_method": "get", "operation": "count", "ids": [], "path": "gift_cards/count.json"},
Expand Down Expand Up @@ -168,10 +162,10 @@ export class GiftCard extends Base {
}

public api_client_id: number | null;
public balance: Balance | null | {[key: string]: any};
public balance: string | null;
public code: string | null;
public created_at: string | null;
public currency: Currency | null | {[key: string]: any};
public currency: string | null;
public customer_id: number | null;
public disabled_at: string | null;
public expires_on: string | null;
Expand Down
12 changes: 3 additions & 9 deletions packages/shopify-api/rest/admin/2023-07/gift_card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import {ResourcePath, ResourceNames} from '../../types';
import {Session} from '../../../lib/session/session';
import {ApiVersion} from '../../../lib/types';

import {Balance} from './balance';
import {Currency} from './currency';

interface FindArgs {
session: Session;
id: number | string;
Expand Down Expand Up @@ -47,10 +44,7 @@ interface DisableArgs {
export class GiftCard extends Base {
public static apiVersion = ApiVersion.July23;

protected static hasOne: {[key: string]: typeof Base} = {
"balance": Balance,
"currency": Currency
};
protected static hasOne: {[key: string]: typeof Base} = {};
protected static hasMany: {[key: string]: typeof Base} = {};
protected static paths: ResourcePath[] = [
{"http_method": "get", "operation": "count", "ids": [], "path": "gift_cards/count.json"},
Expand Down Expand Up @@ -168,10 +162,10 @@ export class GiftCard extends Base {
}

public api_client_id: number | null;
public balance: Balance | null | {[key: string]: any};
public balance: string | null;
public code: string | null;
public created_at: string | null;
public currency: Currency | null | {[key: string]: any};
public currency: string | null;
public customer_id: number | null;
public disabled_at: string | null;
public expires_on: string | null;
Expand Down
12 changes: 3 additions & 9 deletions packages/shopify-api/rest/admin/2023-10/gift_card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import {ResourcePath, ResourceNames} from '../../types';
import {Session} from '../../../lib/session/session';
import {ApiVersion} from '../../../lib/types';

import {Balance} from './balance';
import {Currency} from './currency';

interface FindArgs {
session: Session;
id: number | string;
Expand Down Expand Up @@ -47,10 +44,7 @@ interface DisableArgs {
export class GiftCard extends Base {
public static apiVersion = ApiVersion.October23;

protected static hasOne: {[key: string]: typeof Base} = {
"balance": Balance,
"currency": Currency
};
protected static hasOne: {[key: string]: typeof Base} = {};
protected static hasMany: {[key: string]: typeof Base} = {};
protected static paths: ResourcePath[] = [
{"http_method": "get", "operation": "count", "ids": [], "path": "gift_cards/count.json"},
Expand Down Expand Up @@ -168,10 +162,10 @@ export class GiftCard extends Base {
}

public api_client_id: number | null;
public balance: Balance | null | {[key: string]: any};
public balance: string | null;
public code: string | null;
public created_at: string | null;
public currency: Currency | null | {[key: string]: any};
public currency: string | null;
public customer_id: number | null;
public disabled_at: string | null;
public expires_on: string | null;
Expand Down
12 changes: 3 additions & 9 deletions packages/shopify-api/rest/admin/2024-01/gift_card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import {ResourcePath, ResourceNames} from '../../types';
import {Session} from '../../../lib/session/session';
import {ApiVersion} from '../../../lib/types';

import {Balance} from './balance';
import {Currency} from './currency';

interface FindArgs {
session: Session;
id: number | string;
Expand Down Expand Up @@ -47,10 +44,7 @@ interface DisableArgs {
export class GiftCard extends Base {
public static apiVersion = ApiVersion.January24;

protected static hasOne: {[key: string]: typeof Base} = {
"balance": Balance,
"currency": Currency
};
protected static hasOne: {[key: string]: typeof Base} = {};
protected static hasMany: {[key: string]: typeof Base} = {};
protected static paths: ResourcePath[] = [
{"http_method": "get", "operation": "count", "ids": [], "path": "gift_cards/count.json"},
Expand Down Expand Up @@ -168,10 +162,10 @@ export class GiftCard extends Base {
}

public api_client_id: number | null;
public balance: Balance | null | {[key: string]: any};
public balance: string | null;
public code: string | null;
public created_at: string | null;
public currency: Currency | null | {[key: string]: any};
public currency: string | null;
public customer_id: number | null;
public disabled_at: string | null;
public expires_on: string | null;
Expand Down

0 comments on commit f47257b

Please sign in to comment.