SW Combine SDK
    Preparing search index...

    Galactic News Service (GNS) resource

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Get a specific GNS news item by numeric ID.

      Returns the NewsItem object directly — not wrapped in a Page. Author and faction are normalized to object references with value. If the API returns an array, the SDK returns the first normalized item.

      Parameters

      Returns Promise<NewsItem>

      The NewsItem entity.

      const post = await client.news.gns.get({ id: 49108 });
      console.log(post.title); // access properties directly, not post.data
      console.log(post.author.value);
      console.log(post.faction.value);
    • List GNS news items (paginated with optional filtering) Returns a Page of headline metadata entries (attributes.id, attributes.href, attributes.title, value). Use page.data for the current page items, page.hasMore / page.getNextPage() for pagination, or for await (const item of page) to iterate through all pages automatically. @requires_auth No

      Parameters

      • Optionaloptions: ListGNSOptions

        Optional category, pagination, and filtering parameters

        GNS (Galactic News Service) listing options Extends base options with GNS-specific faction filtering

        • Optionalauthor?: string

          Author name to filter by

        • Optionalcategory?: string

          News category to filter by

        • Optionalend_date?: number

          Filter news up to this Unix timestamp

        • Optionalfaction?: string

          Faction name to filter by (GNS only)

        • Optionalfaction_type?: string

          Faction type to filter by (GNS only)

        • Optionalitem_count?: number

          Number of items to retrieve. Default: 50, Max: 50

        • OptionalpageDelay?: number

          Milliseconds to wait before fetching each subsequent page. Helps avoid rate limits during auto-pagination.

        • Search term to filter by

        • Optionalstart_date?: number

          Filter news starting from this Unix timestamp

        • Optionalstart_index?: number

          Starting position (1-based). Default: 1

      Returns Promise<Page<NewsListItem>>

      const page = await client.news.gns.list();
      const economyNews = await client.news.gns.list({ category: 'economy' });
      const moreNews = await client.news.gns.list({ start_index: 51, item_count: 50 });
      const searchNews = await client.news.gns.list({ search: 'battle', author: 'John Doe' });
      const factionNews = await client.news.gns.list({ faction: 'Empire', faction_type: 'government' });
      console.log(page.data[0].attributes.title);
      console.log(page.start, page.total, page.count);