mirror of
https://github.com/holidayapi/holidayapi-node.git
synced 2025-06-21 12:36:33 +00:00
feat: pull country or language by code.
* feat: pull country or language by code. This differs from the existing `search` functionality in that it allows you to explicitly pull back a single country or language instead of anything that matches (which could result in more items returned than expected). * refactor(types): add new types for the affected endpoints. * docs(readme): update to include examples for new functionality. * test: expand tests to include new parameters. * feat(package): upgrade dependencies to the latest versions. * fix(eslint): adjust configuration based on an updated dependency. * docs(license): bump the year of the license.
This commit is contained in:
parent
9b40c4050e
commit
319d67d84b
10 changed files with 4543 additions and 1958 deletions
11
dist/types.d.ts
vendored
11
dist/types.d.ts
vendored
|
@ -1,11 +1,14 @@
|
|||
export declare type Endpoint = 'countries' | 'holidays' | 'languages';
|
||||
export declare type Request = {
|
||||
declare type Request = {
|
||||
format?: 'csv' | 'json' | 'php' | 'tsv' | 'yaml' | 'xml';
|
||||
key?: string;
|
||||
pretty?: boolean;
|
||||
search?: string;
|
||||
};
|
||||
export declare type Requests = Request | HolidaysRequest;
|
||||
export declare type Requests = CountriesRequest | HolidaysRequest | LanguagesRequest;
|
||||
export declare type CountriesRequest = Request & {
|
||||
country?: string;
|
||||
};
|
||||
export declare type HolidaysRequest = Request & {
|
||||
country?: string;
|
||||
day?: number;
|
||||
|
@ -17,6 +20,9 @@ export declare type HolidaysRequest = Request & {
|
|||
upcoming?: boolean;
|
||||
year?: number;
|
||||
};
|
||||
export declare type LanguagesRequest = Request & {
|
||||
language?: string;
|
||||
};
|
||||
export declare type Response = {
|
||||
requests: {
|
||||
available: number;
|
||||
|
@ -62,3 +68,4 @@ export declare type LanguagesResponse = Response & {
|
|||
name: string;
|
||||
}[];
|
||||
};
|
||||
export {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue