Skip to content

bug: Missing abbreviation property on Set interface in TypeScript definitions #332

Description

@tvrdikvoj

What is Hapening

Hi! Thank you for the great SDK.

While integrating @tcgdex/sdk (v2) in a TypeScript project, I noticed that the Set model is missing the abbreviation property in the type definitions (tcgdex.d.ts), even though the REST API correctly returns it at runtime.

Please explain what should happen

The TypeScript compiler should recognize the abbreviation property, as the raw JSON response properly returns:

{
  ...
  "id": "swsh7",
  "name": "Evolving Skies",
  "abbreviation": {
    "official": "EVS"
  }
}

Suggested Fix: Add the abbreviation field to the Set interface in the TypeScript declarations:

interface Set extends Model {
  // ... existing fields
  abbreviation?: {
    official?: string;
  };
}

Please give us a way to reproduce

import TCGdex from '@tcgdex/sdk';
const tcgdex = new TCGdex("en");
async function fetchSet() {
  const set = await tcgdex.set.get("swsh7");
  
  // TypeScript Error: Property 'abbreviation' does not exist on type 'Set'.
  console.log(set.abbreviation?.official); 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions