Interface RecipeSearchRequestOptions

The options for a recipe API request

interface RecipeSearchRequestOptions {
    allowCache?: boolean;
    apiKey?: string;
    basicDuration?: OpenRange;
    cacheFor?: number;
    category?: ItemCategory;
    damage?: OpenRange;
    durability?: OpenRange;
    duration?: OpenRange;
    health?: OpenRange;
    id?: string;
    ignoreVersion?: boolean;
    level?: number | OpenRange;
    priority?: boolean;
    retries?: number;
    skill?: CraftingSkill;
    timeout?: number;
    type?: CraftableItemType;
}

Hierarchy

Properties

allowCache?: boolean

Whether to allow this request to use the cache or ongoing requests if available

Requests using cache or other requests do not count towards the ratelimit and return a lot faster.
apiKey?: string

The API key to use in this request

The key has to be registered in the config.
If this is not given, the registered key with the most free requests will be selected.
basicDuration?: OpenRange

Only match recipes if their basic duration lies within this range

Values have to be integer, and Ranges have to have at least one bound.

cacheFor?: number

The amount of time the request should be cached for, overwrites the defaults specified in the config

category?: ItemCategory

Only match recipes of this item category

damage?: OpenRange

Only match recipes if their damage lies within this range

Values have to be integer, and Ranges have to have at least one bound.

durability?: OpenRange

Only match recipes if their durability lies within this range

Values have to be integer, and Ranges have to have at least one bound.

duration?: OpenRange

Only match recipes if their duration lies within this range

Values have to be integer, and Ranges have to have at least one bound.

health?: OpenRange

Only match recipes if their health lies within this range

Values have to be integer, and Ranges have to have at least one bound.

id?: string

Only match the recipe with this ID

ignoreVersion?: boolean

Whether to ignore version errors

You can use this to resolve temporary conflicts while the library awaits being updated. Otherwise it should stay enabled.

Default

false
level?: number | OpenRange

Only match recipes within this level range

Values have to be integer, and Ranges have to have at least one bound.

priority?: boolean

Whether this request should be put to the front of the queue, executing before any non-priority requests are handled

Default

false
retries?: number

The amount of times to retry the request on error

Only match recipes using this crafting skill

timeout?: number

The amount of milliseconds a until the request should be rejected

Be aware that each retry has it's own timeout, meaning 30,000 ms of timeout may lead to a 90,000 ms wait until a request is rejected on 2 retries.

Only match recipes of this item type

Generated using TypeDoc