Skip to content

Commit fb2aef1

Browse files
authored
Add administrative and county types (#17)
* feat: add county and administrative types * docs: update README * feat: bump minor version * fix: bump minor version * docs: update README * docs: add keywords to package * deps: update packages
1 parent 23d6c7f commit fb2aef1

File tree

5 files changed

+177
-160
lines changed

5 files changed

+177
-160
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pk.search("Paris").then((res) => {
6969
First, add this line before the closing `</body>` tag in your HTML to import PlaceKit JavaScript Client:
7070

7171
```html
72-
<script src="https://cdn.jsdelivr.net/npm/@placekit/client-js@2.2.0/dist/placekit-lite.umd.js"></script>
72+
<script src="https://cdn.jsdelivr.net/npm/@placekit/client-js@2.3.0/dist/placekit-lite.umd.js"></script>
7373
```
7474

7575
Then it works the same as the node example above.
@@ -91,7 +91,7 @@ Or if you are using native ES Modules:
9191

9292
```html
9393
<script type="module">
94-
import placekit from "https://cdn.jsdelivr.net/npm/@placekit/client-js@2.2.0/dist/placekit-lite.js";
94+
import placekit from "https://cdn.jsdelivr.net/npm/@placekit/client-js@2.3.0/dist/placekit-lite.js";
9595
const pk = placekit(/* ... */);
9696
// ...
9797
</script>
@@ -225,7 +225,7 @@ console.log(pk.options); // { "language": "en", "maxResults": 10, ... }
225225
| ------------- | ----------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
226226
| `countries` | `string[]?` | `undefined` | Countries to search in, default to current IP country. Array of [two-letter ISO](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes<sup>[(1)](#ft1)</sup>. |
227227
| `language` | `string?` | `undefined` | Preferred language for the results<sup>[(1)](#ft1)</sup>, [two-letter ISO](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Supported languages are `en` and `fr`. By default the results are displayed in their country's language. |
228-
| `types` | `string[]?` | `undefined` | Type of results to show. Array of accepted values: `street`, `city`, `country`, `airport`, `bus`, `train`, `townhall`, `tourism`. Prepend `-` to omit a type like `['-bus']`. Unset to return all. |
228+
| `types` | `string[]?` | `undefined` | Type of results to show. Array of accepted values: `street`, `city`, `country`, `administrative`, `airport`, `bus`, `county`, `train`, `townhall`, `tourism`. Prepend `-` to omit a type like `['-bus']`. Unset to return all. |
229229
| `maxResults` | `integer?` | `5` | Number of results per page. |
230230
| `coordinates` | `string?` | `undefined` | Coordinates to search around. Automatically set when calling [`pk.requestGeolocation()`](#pkrequestGeolocation). |
231231
| `forwardIP` | `string?` | `undefined` | Set `x-forwarded-for` header to forward the provided IP for back-end usages (otherwise it'll use the server IP). |
@@ -305,13 +305,13 @@ pk.patch
305305
});
306306
```
307307

308-
| Parameter | Type | Description |
309-
| ----------------- | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
308+
| Parameter | Type | Description |
309+
| ----------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
310310
| `opts` | `key-value mapping` (optional) | Search options. |
311311
| `opts.status` | `('pending' \| 'approved')?` | Publication status. |
312312
| `opts.query` | `string?` | Terms filter. |
313313
| `opts.countries` | `string[]?` | Countries filter, array of [two-letter ISO](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. |
314-
| `opts.types` | `string[]?` | Types filter, array of accepted values: `street`, `city`, `airport`, `bus`, `train`, `townhall`, `tourism`. Prepend `-` to omit a type like `['-bus']`. Unset to return all. |
314+
| `opts.types` | `string[]?` | Types filter, array of accepted values: `street`, `city`, `administrative`, `airport`, `bus`, `county`, `train`, `townhall`, `tourism`. Prepend `-` to omit a type like `['-bus']`. Unset to return all. |
315315
| `opts.language` | `string?` | `undefined` | Preferred language for the results, [two-letter ISO](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. |
316316
| `opts.maxResults` | `number?` | Maximum number of results to return. |
317317
| `opts.offset` | `number?` | Paginate results starting from the offset. |
@@ -358,7 +358,7 @@ pk.patch.create(
358358
| Parameter | Type | Description |
359359
| ----------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
360360
| `update` | `key-value mapping` | Full patch record if adding, at least one property if fixing. |
361-
| `update.type` | `string` | Record type, one of `airport`, `bus`, `city`, `street`, `tourism`, `townhall`, `train`. |
361+
| `update.type` | `string` | Record type, one of `administrative`, `airport`, `bus`, `city`, `county`, `street`, `tourism`, `townhall`, `train`. |
362362
| `update.name` | `string` | Record display name (street name, city name, station name...). |
363363
| `update.city` | `string` | Record city name. |
364364
| `update.county` | `string` (optional) | Record county/province/department. |
@@ -441,7 +441,7 @@ pk.patch
441441
| ----------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------- |
442442
| `id` | `string` | Record ID. |
443443
| `update` | `key-value mapping` (optional) | Updated fields, at least one property must be set if defined. |
444-
| `update.type` | `string` | One of `airport`, `bus`, `city`, `street`, `tourism`, `townhall`, `train`. |
444+
| `update.type` | `string` | One of `administrative`, `airport`, `bus`, `city`, `county`, `street`, `tourism`, `townhall`, `train`. |
445445
| `update.name` | `string` | Record display name (street name, city name, station name...). |
446446
| `update.city` | `string` | Record city name. |
447447
| `update.county` | `string` (optional) | Record county/province/department. |

0 commit comments

Comments
 (0)