@ideal-postcodes/sdk 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/LICENSE +1 -23
  2. package/README.md +16 -18
  3. package/dist/autocomplete.cjs +1 -146
  4. package/dist/autocomplete.d.cts +26 -14
  5. package/dist/autocomplete.d.ts +26 -14
  6. package/dist/autocomplete.mjs +1 -146
  7. package/dist/chunk-BNT2VR2B.mjs +6 -0
  8. package/dist/chunk-HQKXKJXR.cjs +6 -0
  9. package/dist/chunk-OHO6PZYM.mjs +1 -0
  10. package/dist/chunk-UO7BIPJH.cjs +1 -0
  11. package/dist/index.cjs +1 -76
  12. package/dist/index.d-BuZcXRMe.d.cts +45 -0
  13. package/dist/index.d-BuZcXRMe.d.ts +45 -0
  14. package/dist/index.d.cts +6 -12
  15. package/dist/index.d.ts +6 -12
  16. package/dist/index.mjs +1 -76
  17. package/dist/preact-query.cjs +1 -497
  18. package/dist/preact-query.d.cts +379 -123
  19. package/dist/preact-query.d.ts +379 -123
  20. package/dist/preact-query.mjs +1 -497
  21. package/dist/react-query.cjs +1 -497
  22. package/dist/react-query.d.cts +378 -122
  23. package/dist/react-query.d.ts +378 -122
  24. package/dist/react-query.mjs +1 -497
  25. package/dist/sdk.gen-C6G6f1JU.d.ts +420 -0
  26. package/dist/sdk.gen-CMX5dsNg.d.cts +420 -0
  27. package/dist/{types.gen-l7tYP1ZJ.d.cts → types.gen-Dmx_l_fj.d.cts} +4612 -2685
  28. package/dist/{types.gen-l7tYP1ZJ.d.ts → types.gen-Dmx_l_fj.d.ts} +4612 -2685
  29. package/package.json +71 -38
  30. package/dist/autocomplete.cjs.map +0 -1
  31. package/dist/autocomplete.mjs.map +0 -1
  32. package/dist/chunk-AVMJGCHZ.mjs +0 -913
  33. package/dist/chunk-AVMJGCHZ.mjs.map +0 -1
  34. package/dist/chunk-ZZUZHG5D.cjs +0 -913
  35. package/dist/chunk-ZZUZHG5D.cjs.map +0 -1
  36. package/dist/index.cjs.map +0 -1
  37. package/dist/index.mjs.map +0 -1
  38. package/dist/preact-query.cjs.map +0 -1
  39. package/dist/preact-query.mjs.map +0 -1
  40. package/dist/react-query.cjs.map +0 -1
  41. package/dist/react-query.mjs.map +0 -1
  42. package/dist/sdk.gen-C45EbTVQ.d.cts +0 -302
  43. package/dist/sdk.gen-_z1PNdoT.d.ts +0 -302
package/dist/index.cjs CHANGED
@@ -1,76 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
- var _chunkZZUZHG5Dcjs = require('./chunk-ZZUZHG5D.cjs');
28
-
29
- // src/client.ts
30
- var DEFAULT_BASE_URL = "https://api.ideal-postcodes.co.uk/v1";
31
- var createIdpcClient = (options) => {
32
- const client = _chunkZZUZHG5Dcjs.createClient.call(void 0,
33
- _chunkZZUZHG5Dcjs.createConfig.call(void 0, {
34
- baseUrl: _nullishCoalesce(options.baseUrl, () => ( DEFAULT_BASE_URL)),
35
- fetch: options.fetch
36
- })
37
- );
38
- client.interceptors.request.use((request) => {
39
- const url = new URL(request.url);
40
- if (!url.searchParams.has("api_key")) {
41
- url.searchParams.set("api_key", options.apiKey);
42
- }
43
- if (options.userToken && !url.searchParams.has("user_token") && url.pathname.includes("/keys/")) {
44
- url.searchParams.set("user_token", options.userToken);
45
- }
46
- return new Request(url, request);
47
- });
48
- return client;
49
- };
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
- exports.addressCleanse = _chunkZZUZHG5Dcjs.addressCleanse; exports.createConfig = _chunkZZUZHG5Dcjs.createConfig2; exports.createIdpcClient = createIdpcClient; exports.createLicensee = _chunkZZUZHG5Dcjs.createLicensee; exports.deleteConfig = _chunkZZUZHG5Dcjs.deleteConfig; exports.deleteLicensee = _chunkZZUZHG5Dcjs.deleteLicensee; exports.emailValidation = _chunkZZUZHG5Dcjs.emailValidation; exports.findAddress = _chunkZZUZHG5Dcjs.findAddress; exports.findPlace = _chunkZZUZHG5Dcjs.findPlace; exports.keyAvailability = _chunkZZUZHG5Dcjs.keyAvailability; exports.keyDetails = _chunkZZUZHG5Dcjs.keyDetails; exports.keyLogs = _chunkZZUZHG5Dcjs.keyLogs; exports.keyUsage = _chunkZZUZHG5Dcjs.keyUsage; exports.listConfigs = _chunkZZUZHG5Dcjs.listConfigs; exports.listLicensees = _chunkZZUZHG5Dcjs.listLicensees; exports.phoneNumberValidation = _chunkZZUZHG5Dcjs.phoneNumberValidation; exports.postcodes = _chunkZZUZHG5Dcjs.postcodes; exports.resolveAddress = _chunkZZUZHG5Dcjs.resolveAddress; exports.resolvePlace = _chunkZZUZHG5Dcjs.resolvePlace; exports.retrieveConfig = _chunkZZUZHG5Dcjs.retrieveConfig; exports.retrieveLicensee = _chunkZZUZHG5Dcjs.retrieveLicensee; exports.updateConfig = _chunkZZUZHG5Dcjs.updateConfig; exports.updateKeyDetails = _chunkZZUZHG5Dcjs.updateKeyDetails; exports.updateLicensee = _chunkZZUZHG5Dcjs.updateLicensee;
76
- //# sourceMappingURL=index.cjs.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunkUO7BIPJHcjs = require('./chunk-UO7BIPJH.cjs');var _chunkHQKXKJXRcjs = require('./chunk-HQKXKJXR.cjs');var l="https://api.ideal-postcodes.co.uk/v1",a= exports.createIdpcClient =e=>{let t=_chunkHQKXKJXRcjs.b.call(void 0, _chunkHQKXKJXRcjs.a.call(void 0, {baseUrl:_nullishCoalesce(e.baseUrl, () => (l)),fetch:e.fetch,throwOnError:!0}));return t.interceptors.request.use((i,c)=>_chunkUO7BIPJHcjs.d.call(void 0, i,c.url,e)),t.interceptors.error.use(_chunkUO7BIPJHcjs.f),t};exports.ApiError = _chunkUO7BIPJHcjs.e; exports.addressCleanse = _chunkHQKXKJXRcjs.j; exports.addresses = _chunkHQKXKJXRcjs.m; exports.createConfig = _chunkHQKXKJXRcjs.w; exports.createIdpcClient = a; exports.createLicensee = _chunkHQKXKJXRcjs.q; exports.deleteConfig = _chunkHQKXKJXRcjs.x; exports.deleteLicensee = _chunkHQKXKJXRcjs.r; exports.emailValidation = _chunkHQKXKJXRcjs.A; exports.findAddress = _chunkHQKXKJXRcjs.k; exports.findPlace = _chunkHQKXKJXRcjs.n; exports.keyAvailability = _chunkHQKXKJXRcjs.e; exports.keyDetails = _chunkHQKXKJXRcjs.f; exports.keyLogs = _chunkHQKXKJXRcjs.i; exports.keyUsage = _chunkHQKXKJXRcjs.h; exports.listConfigs = _chunkHQKXKJXRcjs.v; exports.listLicensees = _chunkHQKXKJXRcjs.p; exports.phoneNumberValidation = _chunkHQKXKJXRcjs.B; exports.postcodes = _chunkHQKXKJXRcjs.d; exports.regenerateLicenseeKey = _chunkHQKXKJXRcjs.u; exports.resolveAddress = _chunkHQKXKJXRcjs.l; exports.resolvePlace = _chunkHQKXKJXRcjs.o; exports.retrieveConfig = _chunkHQKXKJXRcjs.y; exports.retrieveLicensee = _chunkHQKXKJXRcjs.s; exports.updateConfig = _chunkHQKXKJXRcjs.z; exports.updateKeyDetails = _chunkHQKXKJXRcjs.g; exports.updateLicensee = _chunkHQKXKJXRcjs.t;
@@ -0,0 +1,45 @@
1
+ declare global {
2
+ interface Window {
3
+ IdealPostcodes: any;
4
+ jQuery: any;
5
+ }
6
+ }
7
+
8
+ declare global {
9
+ interface Window {
10
+ idpcGlobal?: IdpcGlobal;
11
+ }
12
+ }
13
+ /**
14
+ * Global store. Aimed at ensuring multiple copies of our JS libs can have some shared state if required
15
+ */
16
+ interface IdpcGlobal {
17
+ idGen?: Record<string, number>;
18
+ }
19
+
20
+ interface CacheOptions {
21
+ /** Max entries before LRU eviction. Default 50. */
22
+ max?: number;
23
+ /** Time-to-live in ms. Default 60_000. */
24
+ ttlMs?: number;
25
+ }
26
+
27
+ interface Credentials {
28
+ apiKey: string;
29
+ userToken?: string;
30
+ }
31
+
32
+ /** An HTTP error response from the API. */
33
+ declare class ApiError extends Error {
34
+ name: string;
35
+ /** HTTP status. */
36
+ readonly status: number;
37
+ /** API error code, e.g. 4040, when the body carries one. */
38
+ readonly code?: number;
39
+ /** Parsed JSON body, or the raw text when it is not JSON. */
40
+ readonly body: unknown;
41
+ readonly response: Response;
42
+ constructor(response: Response, body: unknown);
43
+ }
44
+
45
+ export { ApiError as A, type CacheOptions as C, type Credentials as a };
@@ -0,0 +1,45 @@
1
+ declare global {
2
+ interface Window {
3
+ IdealPostcodes: any;
4
+ jQuery: any;
5
+ }
6
+ }
7
+
8
+ declare global {
9
+ interface Window {
10
+ idpcGlobal?: IdpcGlobal;
11
+ }
12
+ }
13
+ /**
14
+ * Global store. Aimed at ensuring multiple copies of our JS libs can have some shared state if required
15
+ */
16
+ interface IdpcGlobal {
17
+ idGen?: Record<string, number>;
18
+ }
19
+
20
+ interface CacheOptions {
21
+ /** Max entries before LRU eviction. Default 50. */
22
+ max?: number;
23
+ /** Time-to-live in ms. Default 60_000. */
24
+ ttlMs?: number;
25
+ }
26
+
27
+ interface Credentials {
28
+ apiKey: string;
29
+ userToken?: string;
30
+ }
31
+
32
+ /** An HTTP error response from the API. */
33
+ declare class ApiError extends Error {
34
+ name: string;
35
+ /** HTTP status. */
36
+ readonly status: number;
37
+ /** API error code, e.g. 4040, when the body carries one. */
38
+ readonly code?: number;
39
+ /** Parsed JSON body, or the raw text when it is not JSON. */
40
+ readonly body: unknown;
41
+ readonly response: Response;
42
+ constructor(response: Response, body: unknown);
43
+ }
44
+
45
+ export { ApiError as A, type CacheOptions as C, type Credentials as a };
package/dist/index.d.cts CHANGED
@@ -1,16 +1,10 @@
1
- import { C as Client } from './types.gen-l7tYP1ZJ.cjs';
2
- export { T as AbAddress, A as AddressBaseCore, cP as AddressCleanseData, cR as AddressCleanseError, cQ as AddressCleanseErrors, cT as AddressCleanseResponse, cS as AddressCleanseResponses, aY as AddressSecondaryAbbreviation, bn as AddressSuggestion, bK as ApiKey, bz as ApiKeyAutomatedTopup, by as ApiKeyCurrentPurchase, bE as ApiKeyDailyLimit, bA as ApiKeyDatasets, bG as ApiKeyDetails, bw as ApiKeyDetailsEditable, bx as ApiKeyDetailsResponse, bC as ApiKeyIndividualLimit, bD as ApiKeyMonthlyLimit, bB as ApiKeyNotifications, ck as ApiKeyParam, cg as ApiKeyPathParam, bH as ApiKeyResponse, bu as ApiKeyUsageResponse, bl as AutocompleteResponse, bF as AvailableContexts, bM as BadRequestResponse, aX as BaseAlternateCode, ao as BevAddress, bQ as BiasCountryIsoParam, bS as BiasCountryParam, c7 as BiasIpParam, c8 as BiasLonLatParam, bW as BiasPostcodeAreaParam, bY as BiasPostcodeOutwardParam, bX as BiasPostcodeParam, bV as BiasPostcodeSectorParam, bU as BiasPosttownParam, bT as BiasThoroughfareParam, c6 as BoxParam, aZ as BuildingOrFirmName, as as CannarAddress, b as Carrier, b2 as CarrierRouteId, aI as CarrierRouteRateSortation, aO as City, aN as CityAbbreviation, aJ as CityStateMailingNameIndicator, aL as CityStateNameFacilityCode, br as CleanseResponse, a as ClientOptions, h as Config, i as ConfigNewParam, bO as ConfigParam, g as ConfigResponse, e as ConfigUpdateParam, j as ConfigsResponse, aG as CongressionalDistrictNumber, bJ as Context, ca as ContextParam, aD as Country, aC as CountryIso, aB as CountryIso2, bR as CountryIsoParam, b$ as CountryParam, aP as County, aF as CountyNumber, dH as CreateConfigData, dJ as CreateConfigError, dI as CreateConfigErrors, dL as CreateConfigResponse, dK as CreateConfigResponses, dh as CreateLicenseeData, dj as CreateLicenseeError, di as CreateLicenseeErrors, dl as CreateLicenseeResponse, dk as CreateLicenseeResponses, aE as Dataset, cb as DatasetParam, dM as DeleteConfigData, dO as DeleteConfigError, dN as DeleteConfigErrors, dQ as DeleteConfigResponse, dP as DeleteConfigResponses, dm as DeleteLicenseeData, dp as DeleteLicenseeError, dn as DeleteLicenseeErrors, dr as DeleteLicenseeResponse, dq as DeleteLicenseeResponses, W as Eastings, aA as EcadAddress, ay as EcafAddress, az as EircBase, d as Email, E as EmailResponse, d$ as EmailValidationData, e1 as EmailValidationError, e0 as EmailValidationErrors, e3 as EmailValidationResponse, e2 as EmailValidationResponses, cd as EndParam, f as ErrorResponse, cj as FilterParam, aH as FinanceNumber, cU as FindAddressData, cW as FindAddressError, cV as FindAddressErrors, cY as FindAddressResponse, cX as FindAddressResponses, d2 as FindPlaceData, d4 as FindPlaceError, d3 as FindPlaceErrors, d6 as FindPlaceResponse, d5 as FindPlaceResponses, ar as FodbosaAddress, bt as GbrCleanseMatch, bs as GbrCleanseNoMatch, bk as GbrGlobalAddress, bj as GbrResolveAddressResponse, G as GeonamesPlace, aw as GnafAddress, aV as GovernmentBuildingIndicator, ax as HereAddress, S as Id, I as InvalidPhoneNumber, av as KadasterAddress, au as KartverketAddress, cq as KeyAvailabilityData, cs as KeyAvailabilityError, cr as KeyAvailabilityErrors, cu as KeyAvailabilityResponse, ct as KeyAvailabilityResponses, cv as KeyDetailsData, cx as KeyDetailsError, cw as KeyDetailsErrors, cz as KeyDetailsResponse, cy as KeyDetailsResponses, cK as KeyLogsData, cM as KeyLogsError, cL as KeyLogsErrors, cO as KeyLogsResponse, cN as KeyLogsResponses, cF as KeyUsageData, cH as KeyUsageError, cG as KeyUsageErrors, cJ as KeyUsageResponse, cI as KeyUsageResponses, bv as KeyUsageResult, aW as LacsStatusIndicator, p as Language, b7 as LastLine, o as Latitude, l as Licensee, k as LicenseeEditable, cc as LicenseeParam, bP as LicenseePathParam, L as LicenseeResponse, m as LicenseesResponse, c9 as LimitParam, b9 as Line1, b8 as Line2, dC as ListConfigsData, dE as ListConfigsError, dD as ListConfigsErrors, dG as ListConfigsResponse, dF as ListConfigsResponses, dc as ListLicenseesData, de as ListLicenseesError, dd as ListLicenseesErrors, dg as ListLicenseesResponse, df as ListLicenseesResponses, n as Longitude, aq as MoisAddress, am as MrAddress, aS as MunicipalityCityStateKey, bI as NoContext, V as Northings, N as NotFoundResponse, al as NybAddress, an as PafAddress, y as PafAdministrativeCounty, aj as PafAliasAddress, ai as PafBase, a2 as PafBuildingName, a3 as PafBuildingNumber, J as PafCountry, H as PafCountryIso, ag as PafCountryIso2, F as PafCounty, ah as PafDataset, X as PafDeliveryPointSuffix, $ as PafDepartmentName, a7 as PafDependantLocality, a4 as PafDependantThoroughfare, D as PafDistrict, a6 as PafDoubleDependantLocality, af as PafLanguage, Q as PafLine1, O as PafLine2, M as PafLine3, _ as PafOrganisationName, a0 as PafPobox, ae as PafPostTown, x as PafPostalCounty, ad as PafPostcode, a8 as PafPostcodeInward, a9 as PafPostcodeOutward, Z as PafPostcodeType, K as PafPremise, Y as PafSuOrganisationIndicator, a1 as PafSubBuildingName, a5 as PafThoroughfare, z as PafTraditionalCounty, ab as PafUdprn, aa as PafUmprn, ac as PafUprn, B as PafWard, ci as PageParam, c as PhoneNumber, P as PhoneNumberResponse, e4 as PhoneNumberValidationData, e6 as PhoneNumberValidationError, e5 as PhoneNumberValidationErrors, e8 as PhoneNumberValidationResponse, e7 as PhoneNumberValidationResponses, t as Place, q as PlaceCountryIso, r as PlaceDescriptiveName, v as PlaceId, s as PlaceName, u as PlaceResponse, w as PlaceSuggestion, ba as Plus4Code, c1 as PostTownParam, c3 as PostcodeAreaParam, bL as PostcodeNotFoundResponse, c5 as PostcodeOutwardParam, c4 as PostcodeParam, bN as PostcodeResponse, c2 as PostcodeSectorParam, b_ as PostcodeTypeParam, cl as PostcodesData, cn as PostcodesError, cm as PostcodesErrors, cp as PostcodesResponse, co as PostcodesResponses, aM as PreferredCity, aQ as PreferredLastLineCityStateKey, bc as PrimaryNumber, bp as RateLimitedResponse, b3 as RecordTypeCode, cZ as ResolveAddressData, c$ as ResolveAddressError, c_ as ResolveAddressErrors, d1 as ResolveAddressResponse, d0 as ResolveAddressResponses, d7 as ResolvePlaceData, d9 as ResolvePlaceError, d8 as ResolvePlaceErrors, R as ResolvePlaceResponse, db as ResolvePlaceResponse2, da as ResolvePlaceResponses, dR as RetrieveConfigData, dT as RetrieveConfigError, dS as RetrieveConfigErrors, dV as RetrieveConfigResponse, dU as RetrieveConfigResponses, ds as RetrieveLicenseeData, du as RetrieveLicenseeError, dt as RetrieveLicenseeErrors, dw as RetrieveLicenseeResponse, dv as RetrieveLicenseeResponses, at as SdfiAddress, bb as SecondaryNumber, bZ as SmallUserParam, ce as StartParam, aT as State, aU as StateAbbreviation, b0 as StreetName, a_ as StreetPostDirectionalAbbreviation, b1 as StreetPreDirectionalAbbreviation, a$ as StreetSuffixAbbreviation, ch as TagsParam, bm as UkAddressSuggestion, bq as UnauthorizedResponse, U as UnknownEmail, dW as UpdateConfigData, dY as UpdateConfigError, dX as UpdateConfigErrors, d_ as UpdateConfigResponse, dZ as UpdateConfigResponses, cA as UpdateKeyDetailsData, cC as UpdateKeyDetailsError, cB as UpdateKeyDetailsErrors, cE as UpdateKeyDetailsResponse, cD as UpdateKeyDetailsResponses, b4 as UpdateKeyNumber, dx as UpdateLicenseeData, dz as UpdateLicenseeError, dy as UpdateLicenseeErrors, dB as UpdateLicenseeResponse, dA as UpdateLicenseeResponses, c0 as UprnParam, ap as UpujpAddress, aR as UrbanizationCityStateKey, bo as UsaCassVerifiedAddress, cf as UserTokenParam, bi as UspsAddress, bg as UspsCountry, bf as UspsCountryIso, be as UspsCountryIso2, bh as UspsDataset, bd as UspsLanguage, ak as WelshPafAddress, aK as ZipClassificationCode, b6 as ZipCode, b5 as ZipPlus4Code } from './types.gen-l7tYP1ZJ.cjs';
3
- export { O as Options, d as addressCleanse, o as createConfig, h as createLicensee, q as deleteConfig, i as deleteLicensee, v as emailValidation, f as findAddress, e as findPlace, k as keyAvailability, a as keyDetails, c as keyLogs, b as keyUsage, n as listConfigs, l as listLicensees, w as phoneNumberValidation, p as postcodes, r as resolveAddress, g as resolvePlace, s as retrieveConfig, j as retrieveLicensee, t as updateConfig, u as updateKeyDetails, m as updateLicensee } from './sdk.gen-C45EbTVQ.cjs';
1
+ import { a as Credentials } from './index.d-BuZcXRMe.cjs';
2
+ export { A as ApiError } from './index.d-BuZcXRMe.cjs';
3
+ import { C as Client } from './types.gen-Dmx_l_fj.cjs';
4
+ export { A as AbAddress, b as AbpAddress, c as Address, d as AddressCleanseData, e as AddressCleanseError, f as AddressCleanseErrors, g as AddressCleanseResponse, h as AddressCleanseResponses, i as AddressLatitudeParam, j as AddressListItem, k as AddressLongitudeParam, l as AddressResponse, m as AddressSuggestion, n as AddressesData, o as AddressesError, p as AddressesErrors, q as AddressesResponse, r as AddressesResponses, s as ApiKey, t as ApiKeyAutomatedTopup, u as ApiKeyCurrentPurchase, v as ApiKeyDailyLimit, w as ApiKeyDatasets, x as ApiKeyDetails, y as ApiKeyDetailsEditable, z as ApiKeyDetailsResponse, B as ApiKeyIndividualLimit, D as ApiKeyMonthlyLimit, E as ApiKeyNotifications, G as ApiKeyParam, H as ApiKeyPathParam, I as ApiKeyResponse, J as ApiKeyUsageResponse, K as AutocompleteResponse, L as AvailableContexts, M as BanAddress, N as BevAddress, O as BiasCityParam, P as BiasCountryIsoParam, Q as BiasCountryParam, S as BiasIpParam, T as BiasLonLatParam, U as BiasPostalCode2Param, V as BiasPostalCode3Param, W as BiasPostalCodeParam, X as BiasPostcodeAreaParam, Y as BiasPostcodeOutwardParam, Z as BiasPostcodeParam, _ as BiasPostcodeSectorParam, $ as BiasPosttownParam, a0 as BiasStateCodeParam, a1 as BiasStateParam, a2 as BiasThoroughfareParam, a3 as BoxParam, a4 as CannarAddress, a5 as Carrier, a6 as CityParam, a7 as CleanseResponse, a8 as ClientOptions, a9 as Config, aa as ConfigNewParam, ab as ConfigParam, ac as ConfigResponse, ad as ConfigUpdateParam, ae as ConfigsResponse, af as Context, ag as ContextParam, ah as Country, ai as CountryIso, aj as CountryIso2, ak as CountryIsoParam, al as CountryParam, am as CreateConfigData, an as CreateConfigError, ao as CreateConfigErrors, ap as CreateConfigResponse, aq as CreateConfigResponses, ar as CreateLicenseeData, as as CreateLicenseeError, at as CreateLicenseeErrors, au as CreateLicenseeResponse, av as CreateLicenseeResponses, aw as Dataset, ax as DatasetParam, ay as DeleteConfigData, az as DeleteConfigError, aA as DeleteConfigErrors, aB as DeleteConfigResponse, aC as DeleteConfigResponses, aD as DeleteLicenseeData, aE as DeleteLicenseeError, aF as DeleteLicenseeErrors, aG as DeleteLicenseeResponse, aH as DeleteLicenseeResponses, aI as Eastings, aJ as EcadAddress, aK as EcafAddress, aL as EircBase, aM as Email, aN as EmailResponse, aO as EmailValidationData, aP as EmailValidationError, aQ as EmailValidationErrors, aR as EmailValidationResponse, aS as EmailValidationResponses, aT as EndParam, aU as ErrorResponse, aV as FilterParam, F as FindAddressData, aW as FindAddressError, aX as FindAddressErrors, a as FindAddressResponse, aY as FindAddressResponses, aZ as FindPlaceData, a_ as FindPlaceError, a$ as FindPlaceErrors, b0 as FindPlaceResponse, b1 as FindPlaceResponses, b2 as FodbosaAddress, b3 as GbrCleanseMatch, b4 as GbrCleanseNoMatch, b5 as GbrResolveAddressResponse, b6 as GeonamesPlace, b7 as GnafAddress, b8 as HereAddress, b9 as Id, ba as InvalidPhoneNumber, bb as IsBusinessParam, bc as IsPoboxParam, bd as KadasterAddress, be as KartverketAddress, bf as KeyAvailabilityData, bg as KeyAvailabilityError, bh as KeyAvailabilityErrors, bi as KeyAvailabilityResponse, bj as KeyAvailabilityResponses, bk as KeyDetailsData, bl as KeyDetailsError, bm as KeyDetailsErrors, bn as KeyDetailsResponse, bo as KeyDetailsResponses, bp as KeyLogsData, bq as KeyLogsError, br as KeyLogsErrors, bs as KeyLogsResponse, bt as KeyLogsResponses, bu as KeyUsageData, bv as KeyUsageError, bw as KeyUsageErrors, bx as KeyUsageResponse, by as KeyUsageResponses, bz as KeyUsageResult, bA as Language, bB as Latitude, bC as Licensee, bD as LicenseeEditable, bE as LicenseeParam, bF as LicenseePathParam, bG as LicenseeResponse, bH as LicenseesResponse, bI as LimitParam, bJ as ListConfigsData, bK as ListConfigsError, bL as ListConfigsErrors, bM as ListConfigsResponse, bN as ListConfigsResponses, bO as ListLicenseesData, bP as ListLicenseesError, bQ as ListLicenseesErrors, bR as ListLicenseesResponse, bS as ListLicenseesResponses, bT as Longitude, bU as MoisAddress, bV as MrAddress, bW as NativeRecord, bX as NoContext, bY as Northings, bZ as NotFoundResponse, b_ as NybAddress, b$ as PafAddress, c0 as PafRecordBase, c1 as PafaAddress, c2 as PafwAddress, c3 as PageParam, c4 as PhoneNumber, c5 as PhoneNumberResponse, c6 as PhoneNumberValidationData, c7 as PhoneNumberValidationError, c8 as PhoneNumberValidationErrors, c9 as PhoneNumberValidationResponse, ca as PhoneNumberValidationResponses, cb as Place, cc as PlaceCountryIso, cd as PlaceDescriptiveName, ce as PlaceId, cf as PlaceName, cg as PlaceResponse, ch as PlaceSuggestion, ci as PostTownParam, cj as PostalCode2Param, ck as PostalCode3Param, cl as PostalCodeParam, cm as PostcodeAreaParam, cn as PostcodeNotFoundResponse, co as PostcodeOutwardParam, cp as PostcodeParam, cq as PostcodeResponse, cr as PostcodeSectorParam, cs as PostcodeTypeParam, ct as PostcodesData, cu as PostcodesError, cv as PostcodesErrors, cw as PostcodesResponse, cx as PostcodesResponses, cy as RegenerateLicenseeKeyData, cz as RegenerateLicenseeKeyError, cA as RegenerateLicenseeKeyErrors, cB as RegenerateLicenseeKeyResponse, cC as RegenerateLicenseeKeyResponses, cD as ResolveAddressData, cE as ResolveAddressError, cF as ResolveAddressErrors, R as ResolveAddressResponse, cG as ResolveAddressResponses, cH as ResolvePlaceData, cI as ResolvePlaceError, cJ as ResolvePlaceErrors, cK as ResolvePlaceResponse, cL as ResolvePlaceResponse2, cM as ResolvePlaceResponses, cN as RetrieveConfigData, cO as RetrieveConfigError, cP as RetrieveConfigErrors, cQ as RetrieveConfigResponse, cR as RetrieveConfigResponses, cS as RetrieveLicenseeData, cT as RetrieveLicenseeError, cU as RetrieveLicenseeErrors, cV as RetrieveLicenseeResponse, cW as RetrieveLicenseeResponses, cX as SdfiAddress, cY as SmallUserParam, cZ as StartParam, c_ as StateCodeParam, c$ as StateParam, d0 as SwtAddress, d1 as TagsParam, d2 as UkAddressSuggestion, d3 as UnknownEmail, d4 as UpdateConfigData, d5 as UpdateConfigError, d6 as UpdateConfigErrors, d7 as UpdateConfigResponse, d8 as UpdateConfigResponses, d9 as UpdateKeyDetailsData, da as UpdateKeyDetailsError, db as UpdateKeyDetailsErrors, dc as UpdateKeyDetailsResponse, dd as UpdateKeyDetailsResponses, de as UpdateLicenseeData, df as UpdateLicenseeError, dg as UpdateLicenseeErrors, dh as UpdateLicenseeResponse, di as UpdateLicenseeResponses, dj as UprnParam, dk as UpujpAddress, dl as UserTokenParam, dm as UspsAddress } from './types.gen-Dmx_l_fj.cjs';
5
+ export { O as Options, a as addressCleanse, b as addresses, c as createConfig, d as createLicensee, e as deleteConfig, f as deleteLicensee, g as emailValidation, h as findAddress, i as findPlace, k as keyAvailability, j as keyDetails, l as keyLogs, m as keyUsage, n as listConfigs, o as listLicensees, p as phoneNumberValidation, q as postcodes, r as regenerateLicenseeKey, s as resolveAddress, t as resolvePlace, u as retrieveConfig, v as retrieveLicensee, w as updateConfig, x as updateKeyDetails, y as updateLicensee } from './sdk.gen-CMX5dsNg.cjs';
4
6
 
5
- interface IdpcClientOptions {
6
- apiKey: string;
7
- /**
8
- * Private user token (begins `uk_...`) used for sensitive account
9
- * operations such as retrieving key details, managing licensees and
10
- * configs, and reading usage / logs. Auto-injected on requests to
11
- * `/keys/{key}/...` endpoints; per-call `query.user_token` overrides win.
12
- */
13
- userToken?: string;
7
+ interface IdpcClientOptions extends Credentials {
14
8
  baseUrl?: string;
15
9
  fetch?: typeof fetch;
16
10
  }
package/dist/index.d.ts CHANGED
@@ -1,16 +1,10 @@
1
- import { C as Client } from './types.gen-l7tYP1ZJ.js';
2
- export { T as AbAddress, A as AddressBaseCore, cP as AddressCleanseData, cR as AddressCleanseError, cQ as AddressCleanseErrors, cT as AddressCleanseResponse, cS as AddressCleanseResponses, aY as AddressSecondaryAbbreviation, bn as AddressSuggestion, bK as ApiKey, bz as ApiKeyAutomatedTopup, by as ApiKeyCurrentPurchase, bE as ApiKeyDailyLimit, bA as ApiKeyDatasets, bG as ApiKeyDetails, bw as ApiKeyDetailsEditable, bx as ApiKeyDetailsResponse, bC as ApiKeyIndividualLimit, bD as ApiKeyMonthlyLimit, bB as ApiKeyNotifications, ck as ApiKeyParam, cg as ApiKeyPathParam, bH as ApiKeyResponse, bu as ApiKeyUsageResponse, bl as AutocompleteResponse, bF as AvailableContexts, bM as BadRequestResponse, aX as BaseAlternateCode, ao as BevAddress, bQ as BiasCountryIsoParam, bS as BiasCountryParam, c7 as BiasIpParam, c8 as BiasLonLatParam, bW as BiasPostcodeAreaParam, bY as BiasPostcodeOutwardParam, bX as BiasPostcodeParam, bV as BiasPostcodeSectorParam, bU as BiasPosttownParam, bT as BiasThoroughfareParam, c6 as BoxParam, aZ as BuildingOrFirmName, as as CannarAddress, b as Carrier, b2 as CarrierRouteId, aI as CarrierRouteRateSortation, aO as City, aN as CityAbbreviation, aJ as CityStateMailingNameIndicator, aL as CityStateNameFacilityCode, br as CleanseResponse, a as ClientOptions, h as Config, i as ConfigNewParam, bO as ConfigParam, g as ConfigResponse, e as ConfigUpdateParam, j as ConfigsResponse, aG as CongressionalDistrictNumber, bJ as Context, ca as ContextParam, aD as Country, aC as CountryIso, aB as CountryIso2, bR as CountryIsoParam, b$ as CountryParam, aP as County, aF as CountyNumber, dH as CreateConfigData, dJ as CreateConfigError, dI as CreateConfigErrors, dL as CreateConfigResponse, dK as CreateConfigResponses, dh as CreateLicenseeData, dj as CreateLicenseeError, di as CreateLicenseeErrors, dl as CreateLicenseeResponse, dk as CreateLicenseeResponses, aE as Dataset, cb as DatasetParam, dM as DeleteConfigData, dO as DeleteConfigError, dN as DeleteConfigErrors, dQ as DeleteConfigResponse, dP as DeleteConfigResponses, dm as DeleteLicenseeData, dp as DeleteLicenseeError, dn as DeleteLicenseeErrors, dr as DeleteLicenseeResponse, dq as DeleteLicenseeResponses, W as Eastings, aA as EcadAddress, ay as EcafAddress, az as EircBase, d as Email, E as EmailResponse, d$ as EmailValidationData, e1 as EmailValidationError, e0 as EmailValidationErrors, e3 as EmailValidationResponse, e2 as EmailValidationResponses, cd as EndParam, f as ErrorResponse, cj as FilterParam, aH as FinanceNumber, cU as FindAddressData, cW as FindAddressError, cV as FindAddressErrors, cY as FindAddressResponse, cX as FindAddressResponses, d2 as FindPlaceData, d4 as FindPlaceError, d3 as FindPlaceErrors, d6 as FindPlaceResponse, d5 as FindPlaceResponses, ar as FodbosaAddress, bt as GbrCleanseMatch, bs as GbrCleanseNoMatch, bk as GbrGlobalAddress, bj as GbrResolveAddressResponse, G as GeonamesPlace, aw as GnafAddress, aV as GovernmentBuildingIndicator, ax as HereAddress, S as Id, I as InvalidPhoneNumber, av as KadasterAddress, au as KartverketAddress, cq as KeyAvailabilityData, cs as KeyAvailabilityError, cr as KeyAvailabilityErrors, cu as KeyAvailabilityResponse, ct as KeyAvailabilityResponses, cv as KeyDetailsData, cx as KeyDetailsError, cw as KeyDetailsErrors, cz as KeyDetailsResponse, cy as KeyDetailsResponses, cK as KeyLogsData, cM as KeyLogsError, cL as KeyLogsErrors, cO as KeyLogsResponse, cN as KeyLogsResponses, cF as KeyUsageData, cH as KeyUsageError, cG as KeyUsageErrors, cJ as KeyUsageResponse, cI as KeyUsageResponses, bv as KeyUsageResult, aW as LacsStatusIndicator, p as Language, b7 as LastLine, o as Latitude, l as Licensee, k as LicenseeEditable, cc as LicenseeParam, bP as LicenseePathParam, L as LicenseeResponse, m as LicenseesResponse, c9 as LimitParam, b9 as Line1, b8 as Line2, dC as ListConfigsData, dE as ListConfigsError, dD as ListConfigsErrors, dG as ListConfigsResponse, dF as ListConfigsResponses, dc as ListLicenseesData, de as ListLicenseesError, dd as ListLicenseesErrors, dg as ListLicenseesResponse, df as ListLicenseesResponses, n as Longitude, aq as MoisAddress, am as MrAddress, aS as MunicipalityCityStateKey, bI as NoContext, V as Northings, N as NotFoundResponse, al as NybAddress, an as PafAddress, y as PafAdministrativeCounty, aj as PafAliasAddress, ai as PafBase, a2 as PafBuildingName, a3 as PafBuildingNumber, J as PafCountry, H as PafCountryIso, ag as PafCountryIso2, F as PafCounty, ah as PafDataset, X as PafDeliveryPointSuffix, $ as PafDepartmentName, a7 as PafDependantLocality, a4 as PafDependantThoroughfare, D as PafDistrict, a6 as PafDoubleDependantLocality, af as PafLanguage, Q as PafLine1, O as PafLine2, M as PafLine3, _ as PafOrganisationName, a0 as PafPobox, ae as PafPostTown, x as PafPostalCounty, ad as PafPostcode, a8 as PafPostcodeInward, a9 as PafPostcodeOutward, Z as PafPostcodeType, K as PafPremise, Y as PafSuOrganisationIndicator, a1 as PafSubBuildingName, a5 as PafThoroughfare, z as PafTraditionalCounty, ab as PafUdprn, aa as PafUmprn, ac as PafUprn, B as PafWard, ci as PageParam, c as PhoneNumber, P as PhoneNumberResponse, e4 as PhoneNumberValidationData, e6 as PhoneNumberValidationError, e5 as PhoneNumberValidationErrors, e8 as PhoneNumberValidationResponse, e7 as PhoneNumberValidationResponses, t as Place, q as PlaceCountryIso, r as PlaceDescriptiveName, v as PlaceId, s as PlaceName, u as PlaceResponse, w as PlaceSuggestion, ba as Plus4Code, c1 as PostTownParam, c3 as PostcodeAreaParam, bL as PostcodeNotFoundResponse, c5 as PostcodeOutwardParam, c4 as PostcodeParam, bN as PostcodeResponse, c2 as PostcodeSectorParam, b_ as PostcodeTypeParam, cl as PostcodesData, cn as PostcodesError, cm as PostcodesErrors, cp as PostcodesResponse, co as PostcodesResponses, aM as PreferredCity, aQ as PreferredLastLineCityStateKey, bc as PrimaryNumber, bp as RateLimitedResponse, b3 as RecordTypeCode, cZ as ResolveAddressData, c$ as ResolveAddressError, c_ as ResolveAddressErrors, d1 as ResolveAddressResponse, d0 as ResolveAddressResponses, d7 as ResolvePlaceData, d9 as ResolvePlaceError, d8 as ResolvePlaceErrors, R as ResolvePlaceResponse, db as ResolvePlaceResponse2, da as ResolvePlaceResponses, dR as RetrieveConfigData, dT as RetrieveConfigError, dS as RetrieveConfigErrors, dV as RetrieveConfigResponse, dU as RetrieveConfigResponses, ds as RetrieveLicenseeData, du as RetrieveLicenseeError, dt as RetrieveLicenseeErrors, dw as RetrieveLicenseeResponse, dv as RetrieveLicenseeResponses, at as SdfiAddress, bb as SecondaryNumber, bZ as SmallUserParam, ce as StartParam, aT as State, aU as StateAbbreviation, b0 as StreetName, a_ as StreetPostDirectionalAbbreviation, b1 as StreetPreDirectionalAbbreviation, a$ as StreetSuffixAbbreviation, ch as TagsParam, bm as UkAddressSuggestion, bq as UnauthorizedResponse, U as UnknownEmail, dW as UpdateConfigData, dY as UpdateConfigError, dX as UpdateConfigErrors, d_ as UpdateConfigResponse, dZ as UpdateConfigResponses, cA as UpdateKeyDetailsData, cC as UpdateKeyDetailsError, cB as UpdateKeyDetailsErrors, cE as UpdateKeyDetailsResponse, cD as UpdateKeyDetailsResponses, b4 as UpdateKeyNumber, dx as UpdateLicenseeData, dz as UpdateLicenseeError, dy as UpdateLicenseeErrors, dB as UpdateLicenseeResponse, dA as UpdateLicenseeResponses, c0 as UprnParam, ap as UpujpAddress, aR as UrbanizationCityStateKey, bo as UsaCassVerifiedAddress, cf as UserTokenParam, bi as UspsAddress, bg as UspsCountry, bf as UspsCountryIso, be as UspsCountryIso2, bh as UspsDataset, bd as UspsLanguage, ak as WelshPafAddress, aK as ZipClassificationCode, b6 as ZipCode, b5 as ZipPlus4Code } from './types.gen-l7tYP1ZJ.js';
3
- export { O as Options, d as addressCleanse, o as createConfig, h as createLicensee, q as deleteConfig, i as deleteLicensee, v as emailValidation, f as findAddress, e as findPlace, k as keyAvailability, a as keyDetails, c as keyLogs, b as keyUsage, n as listConfigs, l as listLicensees, w as phoneNumberValidation, p as postcodes, r as resolveAddress, g as resolvePlace, s as retrieveConfig, j as retrieveLicensee, t as updateConfig, u as updateKeyDetails, m as updateLicensee } from './sdk.gen-_z1PNdoT.js';
1
+ import { a as Credentials } from './index.d-BuZcXRMe.js';
2
+ export { A as ApiError } from './index.d-BuZcXRMe.js';
3
+ import { C as Client } from './types.gen-Dmx_l_fj.js';
4
+ export { A as AbAddress, b as AbpAddress, c as Address, d as AddressCleanseData, e as AddressCleanseError, f as AddressCleanseErrors, g as AddressCleanseResponse, h as AddressCleanseResponses, i as AddressLatitudeParam, j as AddressListItem, k as AddressLongitudeParam, l as AddressResponse, m as AddressSuggestion, n as AddressesData, o as AddressesError, p as AddressesErrors, q as AddressesResponse, r as AddressesResponses, s as ApiKey, t as ApiKeyAutomatedTopup, u as ApiKeyCurrentPurchase, v as ApiKeyDailyLimit, w as ApiKeyDatasets, x as ApiKeyDetails, y as ApiKeyDetailsEditable, z as ApiKeyDetailsResponse, B as ApiKeyIndividualLimit, D as ApiKeyMonthlyLimit, E as ApiKeyNotifications, G as ApiKeyParam, H as ApiKeyPathParam, I as ApiKeyResponse, J as ApiKeyUsageResponse, K as AutocompleteResponse, L as AvailableContexts, M as BanAddress, N as BevAddress, O as BiasCityParam, P as BiasCountryIsoParam, Q as BiasCountryParam, S as BiasIpParam, T as BiasLonLatParam, U as BiasPostalCode2Param, V as BiasPostalCode3Param, W as BiasPostalCodeParam, X as BiasPostcodeAreaParam, Y as BiasPostcodeOutwardParam, Z as BiasPostcodeParam, _ as BiasPostcodeSectorParam, $ as BiasPosttownParam, a0 as BiasStateCodeParam, a1 as BiasStateParam, a2 as BiasThoroughfareParam, a3 as BoxParam, a4 as CannarAddress, a5 as Carrier, a6 as CityParam, a7 as CleanseResponse, a8 as ClientOptions, a9 as Config, aa as ConfigNewParam, ab as ConfigParam, ac as ConfigResponse, ad as ConfigUpdateParam, ae as ConfigsResponse, af as Context, ag as ContextParam, ah as Country, ai as CountryIso, aj as CountryIso2, ak as CountryIsoParam, al as CountryParam, am as CreateConfigData, an as CreateConfigError, ao as CreateConfigErrors, ap as CreateConfigResponse, aq as CreateConfigResponses, ar as CreateLicenseeData, as as CreateLicenseeError, at as CreateLicenseeErrors, au as CreateLicenseeResponse, av as CreateLicenseeResponses, aw as Dataset, ax as DatasetParam, ay as DeleteConfigData, az as DeleteConfigError, aA as DeleteConfigErrors, aB as DeleteConfigResponse, aC as DeleteConfigResponses, aD as DeleteLicenseeData, aE as DeleteLicenseeError, aF as DeleteLicenseeErrors, aG as DeleteLicenseeResponse, aH as DeleteLicenseeResponses, aI as Eastings, aJ as EcadAddress, aK as EcafAddress, aL as EircBase, aM as Email, aN as EmailResponse, aO as EmailValidationData, aP as EmailValidationError, aQ as EmailValidationErrors, aR as EmailValidationResponse, aS as EmailValidationResponses, aT as EndParam, aU as ErrorResponse, aV as FilterParam, F as FindAddressData, aW as FindAddressError, aX as FindAddressErrors, a as FindAddressResponse, aY as FindAddressResponses, aZ as FindPlaceData, a_ as FindPlaceError, a$ as FindPlaceErrors, b0 as FindPlaceResponse, b1 as FindPlaceResponses, b2 as FodbosaAddress, b3 as GbrCleanseMatch, b4 as GbrCleanseNoMatch, b5 as GbrResolveAddressResponse, b6 as GeonamesPlace, b7 as GnafAddress, b8 as HereAddress, b9 as Id, ba as InvalidPhoneNumber, bb as IsBusinessParam, bc as IsPoboxParam, bd as KadasterAddress, be as KartverketAddress, bf as KeyAvailabilityData, bg as KeyAvailabilityError, bh as KeyAvailabilityErrors, bi as KeyAvailabilityResponse, bj as KeyAvailabilityResponses, bk as KeyDetailsData, bl as KeyDetailsError, bm as KeyDetailsErrors, bn as KeyDetailsResponse, bo as KeyDetailsResponses, bp as KeyLogsData, bq as KeyLogsError, br as KeyLogsErrors, bs as KeyLogsResponse, bt as KeyLogsResponses, bu as KeyUsageData, bv as KeyUsageError, bw as KeyUsageErrors, bx as KeyUsageResponse, by as KeyUsageResponses, bz as KeyUsageResult, bA as Language, bB as Latitude, bC as Licensee, bD as LicenseeEditable, bE as LicenseeParam, bF as LicenseePathParam, bG as LicenseeResponse, bH as LicenseesResponse, bI as LimitParam, bJ as ListConfigsData, bK as ListConfigsError, bL as ListConfigsErrors, bM as ListConfigsResponse, bN as ListConfigsResponses, bO as ListLicenseesData, bP as ListLicenseesError, bQ as ListLicenseesErrors, bR as ListLicenseesResponse, bS as ListLicenseesResponses, bT as Longitude, bU as MoisAddress, bV as MrAddress, bW as NativeRecord, bX as NoContext, bY as Northings, bZ as NotFoundResponse, b_ as NybAddress, b$ as PafAddress, c0 as PafRecordBase, c1 as PafaAddress, c2 as PafwAddress, c3 as PageParam, c4 as PhoneNumber, c5 as PhoneNumberResponse, c6 as PhoneNumberValidationData, c7 as PhoneNumberValidationError, c8 as PhoneNumberValidationErrors, c9 as PhoneNumberValidationResponse, ca as PhoneNumberValidationResponses, cb as Place, cc as PlaceCountryIso, cd as PlaceDescriptiveName, ce as PlaceId, cf as PlaceName, cg as PlaceResponse, ch as PlaceSuggestion, ci as PostTownParam, cj as PostalCode2Param, ck as PostalCode3Param, cl as PostalCodeParam, cm as PostcodeAreaParam, cn as PostcodeNotFoundResponse, co as PostcodeOutwardParam, cp as PostcodeParam, cq as PostcodeResponse, cr as PostcodeSectorParam, cs as PostcodeTypeParam, ct as PostcodesData, cu as PostcodesError, cv as PostcodesErrors, cw as PostcodesResponse, cx as PostcodesResponses, cy as RegenerateLicenseeKeyData, cz as RegenerateLicenseeKeyError, cA as RegenerateLicenseeKeyErrors, cB as RegenerateLicenseeKeyResponse, cC as RegenerateLicenseeKeyResponses, cD as ResolveAddressData, cE as ResolveAddressError, cF as ResolveAddressErrors, R as ResolveAddressResponse, cG as ResolveAddressResponses, cH as ResolvePlaceData, cI as ResolvePlaceError, cJ as ResolvePlaceErrors, cK as ResolvePlaceResponse, cL as ResolvePlaceResponse2, cM as ResolvePlaceResponses, cN as RetrieveConfigData, cO as RetrieveConfigError, cP as RetrieveConfigErrors, cQ as RetrieveConfigResponse, cR as RetrieveConfigResponses, cS as RetrieveLicenseeData, cT as RetrieveLicenseeError, cU as RetrieveLicenseeErrors, cV as RetrieveLicenseeResponse, cW as RetrieveLicenseeResponses, cX as SdfiAddress, cY as SmallUserParam, cZ as StartParam, c_ as StateCodeParam, c$ as StateParam, d0 as SwtAddress, d1 as TagsParam, d2 as UkAddressSuggestion, d3 as UnknownEmail, d4 as UpdateConfigData, d5 as UpdateConfigError, d6 as UpdateConfigErrors, d7 as UpdateConfigResponse, d8 as UpdateConfigResponses, d9 as UpdateKeyDetailsData, da as UpdateKeyDetailsError, db as UpdateKeyDetailsErrors, dc as UpdateKeyDetailsResponse, dd as UpdateKeyDetailsResponses, de as UpdateLicenseeData, df as UpdateLicenseeError, dg as UpdateLicenseeErrors, dh as UpdateLicenseeResponse, di as UpdateLicenseeResponses, dj as UprnParam, dk as UpujpAddress, dl as UserTokenParam, dm as UspsAddress } from './types.gen-Dmx_l_fj.js';
5
+ export { O as Options, a as addressCleanse, b as addresses, c as createConfig, d as createLicensee, e as deleteConfig, f as deleteLicensee, g as emailValidation, h as findAddress, i as findPlace, k as keyAvailability, j as keyDetails, l as keyLogs, m as keyUsage, n as listConfigs, o as listLicensees, p as phoneNumberValidation, q as postcodes, r as regenerateLicenseeKey, s as resolveAddress, t as resolvePlace, u as retrieveConfig, v as retrieveLicensee, w as updateConfig, x as updateKeyDetails, y as updateLicensee } from './sdk.gen-C6G6f1JU.js';
4
6
 
5
- interface IdpcClientOptions {
6
- apiKey: string;
7
- /**
8
- * Private user token (begins `uk_...`) used for sensitive account
9
- * operations such as retrieving key details, managing licensees and
10
- * configs, and reading usage / logs. Auto-injected on requests to
11
- * `/keys/{key}/...` endpoints; per-call `query.user_token` overrides win.
12
- */
13
- userToken?: string;
7
+ interface IdpcClientOptions extends Credentials {
14
8
  baseUrl?: string;
15
9
  fetch?: typeof fetch;
16
10
  }
package/dist/index.mjs CHANGED
@@ -1,76 +1 @@
1
- import {
2
- addressCleanse,
3
- createClient,
4
- createConfig,
5
- createConfig2,
6
- createLicensee,
7
- deleteConfig,
8
- deleteLicensee,
9
- emailValidation,
10
- findAddress,
11
- findPlace,
12
- keyAvailability,
13
- keyDetails,
14
- keyLogs,
15
- keyUsage,
16
- listConfigs,
17
- listLicensees,
18
- phoneNumberValidation,
19
- postcodes,
20
- resolveAddress,
21
- resolvePlace,
22
- retrieveConfig,
23
- retrieveLicensee,
24
- updateConfig,
25
- updateKeyDetails,
26
- updateLicensee
27
- } from "./chunk-AVMJGCHZ.mjs";
28
-
29
- // src/client.ts
30
- var DEFAULT_BASE_URL = "https://api.ideal-postcodes.co.uk/v1";
31
- var createIdpcClient = (options) => {
32
- const client = createClient(
33
- createConfig({
34
- baseUrl: options.baseUrl ?? DEFAULT_BASE_URL,
35
- fetch: options.fetch
36
- })
37
- );
38
- client.interceptors.request.use((request) => {
39
- const url = new URL(request.url);
40
- if (!url.searchParams.has("api_key")) {
41
- url.searchParams.set("api_key", options.apiKey);
42
- }
43
- if (options.userToken && !url.searchParams.has("user_token") && url.pathname.includes("/keys/")) {
44
- url.searchParams.set("user_token", options.userToken);
45
- }
46
- return new Request(url, request);
47
- });
48
- return client;
49
- };
50
- export {
51
- addressCleanse,
52
- createConfig2 as createConfig,
53
- createIdpcClient,
54
- createLicensee,
55
- deleteConfig,
56
- deleteLicensee,
57
- emailValidation,
58
- findAddress,
59
- findPlace,
60
- keyAvailability,
61
- keyDetails,
62
- keyLogs,
63
- keyUsage,
64
- listConfigs,
65
- listLicensees,
66
- phoneNumberValidation,
67
- postcodes,
68
- resolveAddress,
69
- resolvePlace,
70
- retrieveConfig,
71
- retrieveLicensee,
72
- updateConfig,
73
- updateKeyDetails,
74
- updateLicensee
75
- };
76
- //# sourceMappingURL=index.mjs.map
1
+ import{d as r,e as s,f as o}from"./chunk-OHO6PZYM.mjs";import{A as D,B as F,a as p,b as n,d as f,e as d,f as C,g as m,h,i as u,j as x,k as y,l as E,m as I,n as U,o as g,p as A,q as O,r as b,s as w,t as L,u as _,v as j,w as k,x as q,y as v,z as B}from"./chunk-BNT2VR2B.mjs";var l="https://api.ideal-postcodes.co.uk/v1",a=e=>{let t=n(p({baseUrl:e.baseUrl??l,fetch:e.fetch,throwOnError:!0}));return t.interceptors.request.use((i,c)=>r(i,c.url,e)),t.interceptors.error.use(o),t};export{s as ApiError,x as addressCleanse,I as addresses,k as createConfig,a as createIdpcClient,O as createLicensee,q as deleteConfig,b as deleteLicensee,D as emailValidation,y as findAddress,U as findPlace,d as keyAvailability,C as keyDetails,u as keyLogs,h as keyUsage,j as listConfigs,A as listLicensees,F as phoneNumberValidation,f as postcodes,_ as regenerateLicenseeKey,E as resolveAddress,g as resolvePlace,v as retrieveConfig,w as retrieveLicensee,B as updateConfig,m as updateKeyDetails,L as updateLicensee};