@ideal-postcodes/core-interface
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -0,1 +1,15 @@ | ||
## [1.1.1](https://github.com/ideal-postcodes/core-interface/compare/1.1.0...1.1.1) (2019-06-06) | ||
### Bug Fixes | ||
* **Karma-Typescript:** Explicitly exclude typings module ([ff40c04](https://github.com/ideal-postcodes/core-interface/commit/ff40c04)) | ||
## [1.1.1](https://github.com/ideal-postcodes/core-interface/compare/1.1.0...1.1.1) (2019-06-06) | ||
### Bug Fixes | ||
* **Karma-Typescript:** Explicitly exclude typings module ([ff40c04](https://github.com/ideal-postcodes/core-interface/commit/ff40c04)) | ||
# [1.1.0](https://github.com/ideal-postcodes/core-interface/compare/1.0.0...1.1.0) (2019-06-05) | ||
@@ -2,0 +16,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { AddressQueryResponse } from "../../node_modules/@ideal-postcodes/api-typings"; | ||
import { AddressQueryResponse } from "@ideal-postcodes/api-typings"; | ||
import { OptionalStringMap } from "../util"; | ||
@@ -3,0 +3,0 @@ import { Client } from "../client"; |
@@ -1,2 +0,2 @@ | ||
import { AddressSuggestionResponse } from "../../node_modules/@ideal-postcodes/api-typings"; | ||
import { AddressSuggestionResponse } from "@ideal-postcodes/api-typings"; | ||
import { OptionalStringMap } from "../util"; | ||
@@ -3,0 +3,0 @@ import { Client } from "../client"; |
@@ -1,2 +0,2 @@ | ||
import { PublicKeyResponse, PrivateKeyResponse, KeyUsageResponse } from "../../node_modules/@ideal-postcodes/api-typings"; | ||
import { PublicKeyResponse, PrivateKeyResponse, KeyUsageResponse } from "@ideal-postcodes/api-typings"; | ||
import { OptionalStringMap } from "../util"; | ||
@@ -3,0 +3,0 @@ import { Client } from "../client"; |
@@ -1,2 +0,2 @@ | ||
import { PostcodesResponse } from "../../node_modules/@ideal-postcodes/api-typings"; | ||
import { PostcodesResponse } from "@ideal-postcodes/api-typings"; | ||
import { OptionalStringMap } from "../util"; | ||
@@ -3,0 +3,0 @@ import { Client } from "../client"; |
@@ -1,2 +0,2 @@ | ||
import { UdprnResponse } from "../../node_modules/@ideal-postcodes/api-typings"; | ||
import { UdprnResponse } from "@ideal-postcodes/api-typings"; | ||
import { OptionalStringMap } from "../util"; | ||
@@ -3,0 +3,0 @@ import { Client } from "../client"; |
@@ -1,2 +0,2 @@ | ||
import { UmprnResponse } from "../../node_modules/@ideal-postcodes/api-typings"; | ||
import { UmprnResponse } from "@ideal-postcodes/api-typings"; | ||
import { OptionalStringMap } from "../util"; | ||
@@ -3,0 +3,0 @@ import { Client } from "../client"; |
{ | ||
"name": "@ideal-postcodes/core-interface", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Interface specification for javascript based API Clients to api.ideal-postcodes.co.uk", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -5,2 +5,4 @@ <h1 align="center"> | ||
> Javascript API interface for api.ideal-postcodes.co.uk | ||
[![CircleCI](https://circleci.com/gh/ideal-postcodes/core-interface/tree/master.svg?style=svg)](https://circleci.com/gh/ideal-postcodes/core-interface/tree/master) | ||
@@ -11,2 +13,4 @@ [![Coverage Status](https://coveralls.io/repos/github/ideal-postcodes/core-interface/badge.svg?branch=master)](https://coveralls.io/github/ideal-postcodes/core-interface?branch=master) | ||
[![npm version](https://badge.fury.io/js/%40ideal-postcodes%2Fcore-interface.svg)](https://badge.fury.io/js/%40ideal-postcodes%2Fcore-interface) | ||
![npm bundle size (scoped)](https://img.shields.io/bundlephobia/min/@ideal-postcodes/core-interface.svg?color=%234c1&style=popout) | ||
![npm bundle size (scoped)](https://img.shields.io/bundlephobia/minzip/@ideal-postcodes/core-interface.svg?color=%234c1&style=popout) | ||
@@ -46,9 +50,14 @@ `@ideal-postcodes/core-interface` is an environment agnostic implementation of the Ideal Postcodes javascript API client interface. | ||
Instantiate a client | ||
Instantiate a client with, | ||
```javascript | ||
const client = new Client({}); | ||
const api_key = "iddqd"; | ||
const client = new Client({ api_key }); | ||
// Only api_key is required by core-node and core-browser - all others are optional | ||
// The agentless interface requires explicit configuration | ||
``` | ||
More configuration options [outlined in the docs](https://core-interface.ideal-postcodes.dev/docs/interfaces/config.html) | ||
Configuration options [outlined in the docs](https://core-interface.ideal-postcodes.dev/docs/interfaces/config.html) | ||
@@ -61,4 +70,6 @@ #### Resource Methods | ||
Resource methods return a promise with a HTTP response object type. | ||
Resource methods return a promise with a [HTTP response object type](https://core-interface.ideal-postcodes.dev/interfaces/httpresponse.html). | ||
#### Retrieve | ||
Requesting a resource by ID (e.g. a postcode lookup for postcode with ID "SW1A 2AA") maps to the `#retrieve` method. | ||
@@ -81,2 +92,3 @@ | ||
``` | ||
#### List | ||
@@ -100,4 +112,22 @@ Reqesting a resource endpoint (e.g. an address query to `/addresses`) maps to the `#list` method. | ||
The resources are: | ||
#### Custom Actions | ||
Some endpoints are defined as custom actions. E.g. `/keys/:key/usage`. These can be invoked using the name of the custom action. | ||
E.g. for [key usage data extraction](https://ideal-postcodes.co.uk/documentation/keys#usage) | ||
```javascript | ||
client.keys.usage(api_key, { | ||
query: { | ||
tags: "checkout,production" | ||
}, | ||
header: { | ||
Authorization: 'IDEALPOSTCODES user_token="foo"', | ||
}, | ||
timeout: 5000, | ||
}); | ||
``` | ||
#### Available Resources | ||
- [Postcodes](#postcodes) | ||
@@ -104,0 +134,0 @@ - [Addresses](#addresses) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61832
349