SW Combine SDK
    Preparing search index...

    Inventory entities resource

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Add tag to entity

      Parameters

      • options: { entityType: string; tag: string; uid: string }

      Returns Promise<void>

    • List entities in inventory (paginated with optional filtering)

      Supports filtering by various entity properties. Filter arrays must have matching lengths.

      Type Parameters

      Parameters

      • options: ListInventoryEntitiesOptions<T>

        Inventory UID, entity type, assign type, and optional pagination/filtering parameters

        • assignType: InventoryAssignType

          Assignment type: 'owner', 'commander', or 'pilot'

        • entityType: T

          Entity type: 'ships', 'vehicles', 'stations', 'cities', 'facilities', 'planets', 'items', 'npcs', 'droids', 'creatures', or 'materials'

        • Optionalfilter_inclusion?: InventoryFilterInclusion[]

          Whether each filter should include or exclude matches. Default: 'includes'

        • Optionalfilter_type?: InventoryFilterType[]

          Filter types to apply to the query

        • Optionalfilter_value?: string[]

          Values corresponding to each filter type

        • Optionalitem_count?: number

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

        • Optionalstart_index?: number

          Starting position for pagination (1-based). Default: 1

        • uid: string

      Returns Promise<InventoryEntityTypeMap[T][]>

      const entities = await client.inventory.entities.list({ uid: '1:12345', entityType: 'vehicle', assignType: 'pilot' });
      // Fetch up to 200 entities at once
      const moreEntities = await client.inventory.entities.list({ uid: '1:12345', entityType: 'vehicle', assignType: 'pilot', start_index: 1, item_count: 200 });
      // Filter by multiple criteria
      const multiFiltered = await client.inventory.entities.list({
      uid: '1:12345',
      entityType: 'ships',
      assignType: 'owner',
      filter_type: ['class', 'powered'],
      filter_value: ['Fighter', '1'],
      filter_inclusion: ['includes', 'includes']
      });
    • Remove all tags from entity

      Parameters

      • options: { entityType: string; uid: string }

      Returns Promise<void>

    • Remove tag from entity

      Parameters

      • options: { entityType: string; tag: string; uid: string }

      Returns Promise<void>

    • Update entity property

      Parameters

      • options: {
            entityType: string;
            new_value: string;
            property:
                | "name"
                | "owner"
                | "infotext"
                | "commander"
                | "pilot"
                | "open-to"
                | "action"
                | "crewlist-add"
                | "crewlist-remove"
                | "crewlist-clear";
            reason?: string;
            uid: string;
        }
        • entityType: string

          Entity type (ships, vehicles, stations, etc.)

        • new_value: string

          New value for the property

        • property:
              | "name"
              | "owner"
              | "infotext"
              | "commander"
              | "pilot"
              | "open-to"
              | "action"
              | "crewlist-add"
              | "crewlist-remove"
              | "crewlist-clear"

          Property to update

        • Optionalreason?: string

          Optional reason for the change

        • uid: string

          Entity UID

      Returns Promise<Entity>