Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

@ideal-postcodes/core-interface

Package Overview
Dependencies
1
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.3 to 3.0.0-beta.1

14

CHANGELOG.md

@@ -0,1 +1,15 @@

# [3.0.0-beta.1](https://github.com/ideal-postcodes/core-interface/compare/2.0.3...3.0.0-beta.1) (2022-02-03)
### Features
* **OpenAPI:** Migrate from api-typings to openapi spec ([06ce31d](https://github.com/ideal-postcodes/core-interface/commit/06ce31d6de53b65837fbb30ba44f88d343c51c90))
* **Resolve:** Resolve address suggestions ([c2cfef7](https://github.com/ideal-postcodes/core-interface/commit/c2cfef7ee4fcc5ec8a66989278f4ab5dbf778723))
### BREAKING CHANGES
* **OpenAPI:** Core-Interface typings now uses
@ideal-postcodes/openapi
## [2.0.3](https://github.com/ideal-postcodes/core-interface/compare/2.0.2...2.0.3) (2021-07-23)

@@ -2,0 +16,0 @@

2

dist/error.d.ts

@@ -7,2 +7,4 @@ /**

import { HttpResponse } from "./agent";
import { components } from "@ideal-postcodes/openapi";
export declare type ApiErrorResponse = components["schemas"]["ErrorResponse"];
/**

@@ -9,0 +11,0 @@ * IdealPostcodesErrorOptions

10

dist/helpers.d.ts

@@ -5,3 +5,3 @@ /**

import { HttpResponse } from "./agent";
import { Address, KeyStatus } from "@ideal-postcodes/api-typings";
import { UkAddress, PafAddress, NybAddress, MrAddress, KeyStatus } from "./types";
import { Authenticable, Filterable, Taggable, HttpOptions, Paginateable } from "./types";

@@ -111,3 +111,3 @@ import { Client } from "./client";

*/
export declare const lookupPostcode: (options: LookupPostcodeOptions) => Promise<Address[]>;
export declare const lookupPostcode: (options: LookupPostcodeOptions) => Promise<PafAddress[]>;
/**

@@ -120,3 +120,3 @@ * Lookup Address

*/
export declare const lookupAddress: (options: LookupAddressOptions) => Promise<Address[]>;
export declare const lookupAddress: (options: LookupAddressOptions) => Promise<UkAddress[]>;
/**

@@ -131,3 +131,3 @@ * Lookup UDPRN

*/
export declare const lookupUdprn: (options: LookupUdprnOptions) => Promise<Address | null>;
export declare const lookupUdprn: (options: LookupUdprnOptions) => Promise<PafAddress | NybAddress | null>;
/**

@@ -142,3 +142,3 @@ * Lookup UMPRN

*/
export declare const lookupUmprn: (options: LookupUmprnOptions) => Promise<Address | null>;
export declare const lookupUmprn: (options: LookupUmprnOptions) => Promise<MrAddress | null>;
/**

@@ -145,0 +145,0 @@ * Check Key Availability

@@ -85,7 +85,7 @@ "use strict";

var client = options.client;
util_1.appendAuthorization({ client: client, header: header, options: options });
util_1.appendIp({ header: header, options: options });
util_1.appendFilter({ query: query, options: options });
util_1.appendTags({ client: client, query: query, options: options });
util_1.appendPage({ query: query, options: options });
(0, util_1.appendAuthorization)({ client: client, header: header, options: options });
(0, util_1.appendIp)({ header: header, options: options });
(0, util_1.appendFilter)({ query: query, options: options });
(0, util_1.appendTags)({ client: client, query: query, options: options });
(0, util_1.appendPage)({ query: query, options: options });
var queryOptions = { header: header, query: query };

@@ -110,6 +110,6 @@ if (options.timeout !== undefined)

var client = options.client;
util_1.appendAuthorization({ client: client, header: header, options: options });
util_1.appendIp({ header: header, options: options });
util_1.appendFilter({ query: query, options: options });
util_1.appendTags({ client: client, query: query, options: options });
(0, util_1.appendAuthorization)({ client: client, header: header, options: options });
(0, util_1.appendIp)({ header: header, options: options });
(0, util_1.appendFilter)({ query: query, options: options });
(0, util_1.appendTags)({ client: client, query: query, options: options });
var request = { header: header, query: query };

@@ -116,0 +116,0 @@ if (options.timeout !== undefined)

@@ -1,2 +0,2 @@

import { AddressQueryResponse } from "@ideal-postcodes/api-typings";
import { AddressResponse } from "../types";
import { OptionalStringMap } from "../util";

@@ -42,3 +42,3 @@ import { Client } from "../client";

export interface Response extends HttpResponse {
body: AddressQueryResponse;
body: AddressResponse;
}

@@ -45,0 +45,0 @@ export interface List {

@@ -7,4 +7,4 @@ "use strict";

var list = function (client, request) {
return resource_1.listMethod({ resource: resource, client: client })(request);
return (0, resource_1.listMethod)({ resource: resource, client: client })(request);
};
exports.list = list;

@@ -1,2 +0,2 @@

import { AddressSuggestionResponse } from "@ideal-postcodes/api-typings";
import { AddressSuggestionResponse, GbrResolveResponse } from "../types";
import { OptionalStringMap } from "../util";

@@ -47,2 +47,9 @@ import { Client } from "../client";

export declare const list: List;
export interface GbrResponse extends HttpResponse {
body: GbrResolveResponse;
}
export interface Gbr {
(client: Client, id: string, request: Request): Promise<GbrResponse>;
}
export declare const gbr: Gbr;
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.list = void 0;
exports.gbr = exports.list = void 0;
var resource_1 = require("./resource");
var resource = "autocomplete/addresses";
var list = function (client, request) {
return resource_1.listMethod({ resource: resource, client: client })(request);
return (0, resource_1.listMethod)({ resource: resource, client: client })(request);
};
exports.list = list;
// Resolves address to the GBR format
var gbr = function (client, id, request) {
return (0, resource_1.retrieveMethod)({
resource: resource,
client: client,
action: "gbr",
})(id, request);
};
exports.gbr = gbr;

@@ -1,2 +0,2 @@

import { PublicKeyResponse, PrivateKeyResponse, KeyUsageResponse } from "@ideal-postcodes/api-typings";
import { PublicKeyResponse, PrivateKeyResponse, KeyUsageResponse } from "../types";
import { OptionalStringMap } from "../util";

@@ -3,0 +3,0 @@ import { Client } from "../client";

@@ -7,3 +7,3 @@ "use strict";

var retrieve = function (client, apiKey, request) {
return resource_1.retrieveMethod({
return (0, resource_1.retrieveMethod)({
resource: resource,

@@ -15,3 +15,3 @@ client: client,

var usage = function (client, apiKey, request) {
return resource_1.retrieveMethod({
return (0, resource_1.retrieveMethod)({
resource: resource,

@@ -18,0 +18,0 @@ client: client,

@@ -1,2 +0,2 @@

import { PostcodesResponse } from "@ideal-postcodes/api-typings";
import { PostcodesResponse } from "../types";
import { OptionalStringMap } from "../util";

@@ -3,0 +3,0 @@ import { Client } from "../client";

@@ -7,3 +7,3 @@ "use strict";

var retrieve = function (client, postcode, request) {
return resource_1.retrieveMethod({
return (0, resource_1.retrieveMethod)({
resource: resource,

@@ -10,0 +10,0 @@ client: client,

@@ -24,8 +24,8 @@ "use strict";

url: toRetrieveUrl(options, id),
query: util_1.toStringMap(request.query),
header: util_1.toHeader(request, client),
timeout: util_1.toTimeout(request, client),
query: (0, util_1.toStringMap)(request.query),
header: (0, util_1.toHeader)(request, client),
timeout: (0, util_1.toTimeout)(request, client),
})
.then(function (response) {
var error = error_1.parse(response);
var error = (0, error_1.parse)(response);
if (error)

@@ -45,8 +45,8 @@ throw error;

url: client.url() + "/" + resource,
query: util_1.toStringMap(request.query),
header: util_1.toHeader(request, client),
timeout: util_1.toTimeout(request, client),
query: (0, util_1.toStringMap)(request.query),
header: (0, util_1.toHeader)(request, client),
timeout: (0, util_1.toTimeout)(request, client),
})
.then(function (response) {
var error = error_1.parse(response);
var error = (0, error_1.parse)(response);
if (error)

@@ -53,0 +53,0 @@ throw error;

@@ -1,2 +0,2 @@

import { UdprnResponse } from "@ideal-postcodes/api-typings";
import { UdprnResponse } from "../types";
import { OptionalStringMap } from "../util";

@@ -3,0 +3,0 @@ import { Client } from "../client";

@@ -7,4 +7,4 @@ "use strict";

var retrieve = function (client, udprn, request) {
return resource_1.retrieveMethod({ resource: resource, client: client })(udprn, request);
return (0, resource_1.retrieveMethod)({ resource: resource, client: client })(udprn, request);
};
exports.retrieve = retrieve;

@@ -1,2 +0,2 @@

import { UmprnResponse } from "@ideal-postcodes/api-typings";
import { UmprnResponse } from "../types";
import { OptionalStringMap } from "../util";

@@ -3,0 +3,0 @@ import { Client } from "../client";

@@ -7,4 +7,4 @@ "use strict";

var retrieve = function (client, umprn, request) {
return resource_1.retrieveMethod({ resource: resource, client: client })(umprn, request);
return (0, resource_1.retrieveMethod)({ resource: resource, client: client })(umprn, request);
};
exports.retrieve = retrieve;
/**
* @module Misc Types
*/
import { Address } from "@ideal-postcodes/api-typings";
import { paths, components } from "@ideal-postcodes/openapi";
export declare type AddressResponse = paths["/addresses"]["get"]["responses"][200]["content"]["application/json"];
export declare type AddressSuggestionResponse = paths["/autocomplete/addresses"]["get"]["responses"][200]["content"]["application/json"];
export declare type GbrResolveResponse = paths["/autocomplete/addresses/{address}/gbr"]["get"]["responses"][200]["content"]["application/json"];
export declare type PublicKeyResponse = paths["/keys/{key}"]["get"]["responses"][200]["content"]["application/json"];
export declare type PrivateKeyResponse = paths["/keys/{key}/details"]["get"]["responses"][200]["content"]["application/json"];
export declare type KeyUsageResponse = paths["/keys/{key}/usage"]["get"]["responses"][200]["content"]["application/json"];
export declare type PostcodesResponse = paths["/postcodes/{postcode}"]["get"]["responses"][200]["content"]["application/json"];
export declare type UdprnResponse = paths["/udprn/{udprn}"]["get"]["responses"][200]["content"]["application/json"];
export declare type UmprnResponse = paths["/umprn/{umprn}"]["get"]["responses"][200]["content"]["application/json"];
export declare type KeyStatus = components["schemas"]["ApiKey"];
export declare type PafAddress = components["schemas"]["PafAddress"];
export declare type MrAddress = components["schemas"]["MrAddress"];
export declare type NybAddress = components["schemas"]["NybAddress"];
export declare type UkAddress = PafAddress | MrAddress | NybAddress;
/**

@@ -34,3 +48,3 @@ * Authenticable

*/
export declare type AddressKeys = keyof Address;
export declare type AddressKeys = keyof components["schemas"]["PafAddress"];
/**

@@ -37,0 +51,0 @@ * Filterable

@@ -77,3 +77,3 @@ "use strict";

var _b = _a.header, header = _b === void 0 ? {} : _b;
return __assign(__assign({}, client.config.header), exports.toStringMap(header));
return __assign(__assign({}, client.config.header), (0, exports.toStringMap)(header));
};

@@ -109,3 +109,3 @@ exports.toHeader = toHeader;

var header = _a.header, options = _a.options, client = _a.client;
header.Authorization = exports.toAuthHeader(client, options);
header.Authorization = (0, exports.toAuthHeader)(client, options);
return header;

@@ -112,0 +112,0 @@ };

@@ -7,2 +7,4 @@ /**

import { HttpResponse } from "./agent";
import { components } from "@ideal-postcodes/openapi";
export declare type ApiErrorResponse = components["schemas"]["ErrorResponse"];
/**

@@ -9,0 +11,0 @@ * IdealPostcodesErrorOptions

@@ -5,3 +5,3 @@ /**

import { HttpResponse } from "./agent";
import { Address, KeyStatus } from "@ideal-postcodes/api-typings";
import { UkAddress, PafAddress, NybAddress, MrAddress, KeyStatus } from "./types";
import { Authenticable, Filterable, Taggable, HttpOptions, Paginateable } from "./types";

@@ -111,3 +111,3 @@ import { Client } from "./client";

*/
export declare const lookupPostcode: (options: LookupPostcodeOptions) => Promise<Address[]>;
export declare const lookupPostcode: (options: LookupPostcodeOptions) => Promise<PafAddress[]>;
/**

@@ -120,3 +120,3 @@ * Lookup Address

*/
export declare const lookupAddress: (options: LookupAddressOptions) => Promise<Address[]>;
export declare const lookupAddress: (options: LookupAddressOptions) => Promise<UkAddress[]>;
/**

@@ -131,3 +131,3 @@ * Lookup UDPRN

*/
export declare const lookupUdprn: (options: LookupUdprnOptions) => Promise<Address | null>;
export declare const lookupUdprn: (options: LookupUdprnOptions) => Promise<PafAddress | NybAddress | null>;
/**

@@ -142,3 +142,3 @@ * Lookup UMPRN

*/
export declare const lookupUmprn: (options: LookupUmprnOptions) => Promise<Address | null>;
export declare const lookupUmprn: (options: LookupUmprnOptions) => Promise<MrAddress | null>;
/**

@@ -145,0 +145,0 @@ * Check Key Availability

@@ -1,2 +0,2 @@

import { AddressQueryResponse } from "@ideal-postcodes/api-typings";
import { AddressResponse } from "../types";
import { OptionalStringMap } from "../util";

@@ -42,3 +42,3 @@ import { Client } from "../client";

export interface Response extends HttpResponse {
body: AddressQueryResponse;
body: AddressResponse;
}

@@ -45,0 +45,0 @@ export interface List {

@@ -1,2 +0,2 @@

import { AddressSuggestionResponse } from "@ideal-postcodes/api-typings";
import { AddressSuggestionResponse, GbrResolveResponse } from "../types";
import { OptionalStringMap } from "../util";

@@ -47,2 +47,9 @@ import { Client } from "../client";

export declare const list: List;
export interface GbrResponse extends HttpResponse {
body: GbrResolveResponse;
}
export interface Gbr {
(client: Client, id: string, request: Request): Promise<GbrResponse>;
}
export declare const gbr: Gbr;
export {};

@@ -1,3 +0,9 @@

import { listMethod } from "./resource";
import { listMethod, retrieveMethod } from "./resource";
const resource = "autocomplete/addresses";
export const list = (client, request) => listMethod({ resource, client })(request);
// Resolves address to the GBR format
export const gbr = (client, id, request) => retrieveMethod({
resource,
client,
action: "gbr",
})(id, request);

@@ -1,2 +0,2 @@

import { PublicKeyResponse, PrivateKeyResponse, KeyUsageResponse } from "@ideal-postcodes/api-typings";
import { PublicKeyResponse, PrivateKeyResponse, KeyUsageResponse } from "../types";
import { OptionalStringMap } from "../util";

@@ -3,0 +3,0 @@ import { Client } from "../client";

@@ -1,2 +0,2 @@

import { PostcodesResponse } from "@ideal-postcodes/api-typings";
import { PostcodesResponse } from "../types";
import { OptionalStringMap } from "../util";

@@ -3,0 +3,0 @@ import { Client } from "../client";

@@ -1,2 +0,2 @@

import { UdprnResponse } from "@ideal-postcodes/api-typings";
import { UdprnResponse } from "../types";
import { OptionalStringMap } from "../util";

@@ -3,0 +3,0 @@ import { Client } from "../client";

@@ -1,2 +0,2 @@

import { UmprnResponse } from "@ideal-postcodes/api-typings";
import { UmprnResponse } from "../types";
import { OptionalStringMap } from "../util";

@@ -3,0 +3,0 @@ import { Client } from "../client";

/**
* @module Misc Types
*/
import { Address } from "@ideal-postcodes/api-typings";
import { paths, components } from "@ideal-postcodes/openapi";
export declare type AddressResponse = paths["/addresses"]["get"]["responses"][200]["content"]["application/json"];
export declare type AddressSuggestionResponse = paths["/autocomplete/addresses"]["get"]["responses"][200]["content"]["application/json"];
export declare type GbrResolveResponse = paths["/autocomplete/addresses/{address}/gbr"]["get"]["responses"][200]["content"]["application/json"];
export declare type PublicKeyResponse = paths["/keys/{key}"]["get"]["responses"][200]["content"]["application/json"];
export declare type PrivateKeyResponse = paths["/keys/{key}/details"]["get"]["responses"][200]["content"]["application/json"];
export declare type KeyUsageResponse = paths["/keys/{key}/usage"]["get"]["responses"][200]["content"]["application/json"];
export declare type PostcodesResponse = paths["/postcodes/{postcode}"]["get"]["responses"][200]["content"]["application/json"];
export declare type UdprnResponse = paths["/udprn/{udprn}"]["get"]["responses"][200]["content"]["application/json"];
export declare type UmprnResponse = paths["/umprn/{umprn}"]["get"]["responses"][200]["content"]["application/json"];
export declare type KeyStatus = components["schemas"]["ApiKey"];
export declare type PafAddress = components["schemas"]["PafAddress"];
export declare type MrAddress = components["schemas"]["MrAddress"];
export declare type NybAddress = components["schemas"]["NybAddress"];
export declare type UkAddress = PafAddress | MrAddress | NybAddress;
/**

@@ -34,3 +48,3 @@ * Authenticable

*/
export declare type AddressKeys = keyof Address;
export declare type AddressKeys = keyof components["schemas"]["PafAddress"];
/**

@@ -37,0 +51,0 @@ * Filterable

{
"name": "@ideal-postcodes/core-interface",
"version": "2.0.3",
"version": "3.0.0-beta.1",
"description": "Interface specification for javascript based API Clients to api.ideal-postcodes.co.uk",

@@ -25,3 +25,3 @@ "author": {

"test-watch": "NODE_ENV=test mocha --watch",
"test": "npm run lint && NODE_ENV=test nyc mocha",
"test": "NODE_ENV=test nyc mocha",
"test:browsers:headless": "karma start",

@@ -95,7 +95,14 @@ "test:browsers": "npm run test:browsers:latest && npm run test:browsers:legacy",

"release": {
"extends": "@cablanchard/semantic-release/dist/npm"
"extends": "@cablanchard/semantic-release/dist/npm",
"branches": [
"master",
{
"name": "beta",
"prerelease": true
}
]
},
"license": "MIT",
"dependencies": {
"@ideal-postcodes/api-typings": "~2.1.0"
"@ideal-postcodes/openapi": "~1.1.0-beta.4"
},

@@ -111,16 +118,16 @@ "devDependencies": {

"@ideal-postcodes/supported-browsers": "~2.5.0",
"@types/chai": "~4.2.0",
"@types/chai": "~4.3.0",
"@types/dotenv": "~8.2.0",
"@types/karma": "~6.3.0",
"@types/mocha": "~8.2.0",
"@types/node": "~16.3.1",
"@types/prettier": "~2.3.0",
"@types/mocha": "~9.0.0",
"@types/node": "~17.0.5",
"@types/prettier": "~2.4.1",
"@types/sinon": "~10.0.0",
"@typescript-eslint/eslint-plugin": "~4.28.1",
"@typescript-eslint/eslint-plugin": "~5.8.0",
"chai": "~4.3.0",
"codecov": "~3.8.0",
"core-js": "~3.15.0",
"core-js": "~3.20.1",
"dotenv": "~8.2.0",
"eslint": "~7.31.0",
"eslint-plugin-compat": "~3.11.1",
"eslint": "~7.32.0",
"eslint-plugin-compat": "~3.13.0",
"karma": "~6.3.3",

@@ -133,17 +140,17 @@ "karma-chrome-launcher": "~3.1.0",

"karma-typescript": "~5.5.1",
"karma-typescript-es6-transform": "~5.3.0",
"mocha": "~9.0.1",
"karma-typescript-es6-transform": "~5.5.2",
"mocha": "~9.1.0",
"nyc": "~15.1.0",
"prettier": "~2.3.1",
"puppeteer": "~10.1.0",
"prettier": "~2.4.0",
"puppeteer": "~13.0.1",
"regenerator-runtime": "~0.13.3",
"semantic-release": "~17.4.1",
"sinon": "~11.1.1",
"sinon": "~12.0.1",
"source-map-support": "~0.5.10",
"ts-node": "~10.1.0",
"ts-node": "~10.4.0",
"tslint": "~6.1.2",
"type-zoo": "~3.4.0",
"typedoc": "^0.21.0",
"typescript": "~4.3.4"
"typescript": "~4.4.3"
}
}

@@ -27,3 +27,3 @@ <h1 align="center">

- [GitHub Repository](https://github.com/ideal-postcodes/core-interface)
- [Typings Repository](https://github.com/ideal-postcodes/api-typings)
- [Typings Repository](https://github.com/ideal-postcodes/openapi)
- [Fixtures Repository](https://github.com/ideal-postcodes/api-fixtures)

@@ -30,0 +30,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc