1.0.20 • Published 3 years ago

prestij.xyz-api v1.0.20

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Prestij.xyz-api library

How to install?

yarn add prestij.xyz-api

How to use?

Guild info

  • GuildAPI.GetGuild() - returns the guild data array

Characters info

  • GuildAPI.GetCharacters() - returns the guild characters limited list. How to work with it? Full syntax:
    ```typescript
    import {GuildAPI} from "prestij.xyz-api";
    
    const myLimit = 10;
    const myOffset = 5;
    
    GuildAPI.GetCharacters({
        limit: myLimit, 
        offset: myOffset
    })
    ```
    Returns the promise of limited response.

Utilities

  • GuildAPI.GetAll<T>( ... ) - returns all pages via limit/offset. How it works?
    import {GuildAPI} from "prestij.xyz-api";
    
    const allCharacters = await GuildAPI.GetAll(GuildAPI.GetCharacters);

Types

Equipment type

export type CharacterEquipmentType = "HEAD" | "NECK" | "SHOULDER" | "CHEST" | "WAIST" | "LEGS" | "FEET"
	| "WRIST" | "HANDS" | "FINGER_1" | "FINGER_2" | "TRINKET_1" | "TRINKET_2"
	| "BACK" | "MAIN_HAND" | "OFF_HAND" | "TABARD";

Character equipment item

export interface CharacterEquipment {
	wow_id: number;
	character_id: number;
	image_id?: number;

	title: string;

	slot: CharacterEquipmentType;
	inventory_type: string;
	level: number;

	quantity: number;
	quality: number;

	item_class_id: number;
	item_subclass_id: number;

	stats?: string;
}

Character guild role

export interface CharacterRole {
	role_index: number;
	title: string;
}

Character race, class and spec

export interface CharacterRace {
	wow_id: number;
	title: string;
}

export interface CharacterClass {
	role_index: number;
	title: string;
}

export interface CharacterActiveSpec {
	wow_id: number;
	title: string;
	type: number;
}

Character

export interface Character {
	wow_id: number;

	name: string;
	gender: string;
	level: number;
	faction: string;
	gear: number;

	guild_role: number;
	meta_text: string;

	race: CharacterRace;
	role: CharacterRole;
	class: CharacterClass;

	realm_id: number;
	guild_id: number;

	equipment: CharacterEquipment[];
}

Guild data item

export interface StoreDataValue<name = string, ValueType=never> {
	field: name;
	value: ValueType;
	id: number;
}

###Guild data

export type GuildInfo = [
	StoreDataValue<'gid', number>,
	StoreDataValue<'guild_name', string>,
	StoreDataValue<'faction_type', string>,
	StoreDataValue<'faction_name', string>,
	StoreDataValue<'created_timestamp', number>,
	StoreDataValue<'players', number>,
	StoreDataValue<'crest_emblem_url', string>,
	StoreDataValue<'crest_background_color', string>,
];
1.0.19

3 years ago

1.0.20

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago