@ideal-postcodes/sdk 0.2.0 → 0.2.1
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.
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.d.cts +2 -2
- package/dist/autocomplete.d.ts +2 -2
- package/dist/autocomplete.mjs +1 -1
- package/dist/chunk-27HFF2QV.mjs +6 -0
- package/dist/{chunk-OHO6PZYM.mjs → chunk-62UQ3UYV.mjs} +1 -1
- package/dist/chunk-6R56WDLC.mjs +1 -0
- package/dist/chunk-CKB3E7DA.cjs +1 -0
- package/dist/{chunk-UO7BIPJH.cjs → chunk-MO2HGDFA.cjs} +1 -1
- package/dist/chunk-WQKSRULX.cjs +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/preact-query.cjs +1 -1
- package/dist/preact-query.d.cts +231 -470
- package/dist/preact-query.d.ts +231 -470
- package/dist/preact-query.mjs +1 -1
- package/dist/react-query.cjs +1 -1
- package/dist/react-query.d.cts +231 -470
- package/dist/react-query.d.ts +231 -470
- package/dist/react-query.mjs +1 -1
- package/dist/{sdk.gen-C6G6f1JU.d.ts → sdk.gen-C47s0BYz.d.ts} +20 -24
- package/dist/{sdk.gen-CMX5dsNg.d.cts → sdk.gen-DdAMouYk.d.cts} +20 -24
- package/dist/{types.gen-Dmx_l_fj.d.cts → types.gen-Cr3qI_1Q.d.cts} +95 -76
- package/dist/{types.gen-Dmx_l_fj.d.ts → types.gen-Cr3qI_1Q.d.ts} +95 -76
- package/package.json +4 -4
- package/dist/chunk-BNT2VR2B.mjs +0 -6
- package/dist/chunk-HQKXKJXR.cjs +0 -6
|
@@ -603,7 +603,12 @@ type LicenseeEditable = {
|
|
|
603
603
|
*/
|
|
604
604
|
postcode?: string;
|
|
605
605
|
/**
|
|
606
|
-
* A list of allowed URLs. An empty list
|
|
606
|
+
* A list of allowed URLs. An empty list disables the check.
|
|
607
|
+
*
|
|
608
|
+
* A request is allowed when its `Origin` or `Referer` header matches an entry. Use one of these formats:
|
|
609
|
+
*
|
|
610
|
+
* - `https://www.example.com` allows one site. Scheme and host must match
|
|
611
|
+
* - `*.example.com` allows the domain and all its subdomains
|
|
607
612
|
*/
|
|
608
613
|
whitelist?: Array<string>;
|
|
609
614
|
daily?: {
|
|
@@ -625,7 +630,7 @@ type Licensee = LicenseeEditable & {
|
|
|
625
630
|
/**
|
|
626
631
|
* Uniquely identifies a licensee for a key.
|
|
627
632
|
*
|
|
628
|
-
* Required to perform paid lookups for a specific licensee. Typically begins `
|
|
633
|
+
* Required to perform paid lookups for a specific licensee. Typically begins `sl_`.
|
|
629
634
|
*
|
|
630
635
|
*/
|
|
631
636
|
key: string;
|
|
@@ -635,7 +640,7 @@ type Licensee = LicenseeEditable & {
|
|
|
635
640
|
createdAt: string;
|
|
636
641
|
daily: {
|
|
637
642
|
/**
|
|
638
|
-
* The number lookups performed by the licensee on the day represented
|
|
643
|
+
* The number of lookups performed by the licensee on the day represented by `licensees.daily.updatedAt`
|
|
639
644
|
*/
|
|
640
645
|
count: number;
|
|
641
646
|
/**
|
|
@@ -5742,9 +5747,9 @@ type EircBase = {
|
|
|
5742
5747
|
/**
|
|
5743
5748
|
* A number associated with the whole building. The building number may have a numeric and an alphanumeric component, which are concatenated e.g. 2A, or alternatively will have a simple building number or a complex building number. The building number always relates to the whole building and not a sub-unit within it.
|
|
5744
5749
|
* A complex building number may be one of the following:
|
|
5745
|
-
* - Dual. Two
|
|
5750
|
+
* - Dual. Two numbers separated by '/' e.g. 63/64 = 63, 64
|
|
5746
5751
|
* - Sequence. An odd or even sequence of numbers with lower and upper bound separated by an underscore '_' e.g. `1_5` = 1,3,5 and `2_6` = 2,4,6
|
|
5747
|
-
* - Range. A range of consecutive numbers with lower and upper bound separated by a dash '-' e.g. `63-66` = 63, 64,
|
|
5752
|
+
* - Range. A range of consecutive numbers with lower and upper bound separated by a dash '-' e.g. `63-66` = 63, 64, 65, 66
|
|
5748
5753
|
* The building number never appears on a line by itself and can prepend Building Group, Primary Thoroughfare or Primary Locality.
|
|
5749
5754
|
*/
|
|
5750
5755
|
building_number: string;
|
|
@@ -7445,13 +7450,13 @@ type AbAddress = {
|
|
|
7445
7450
|
/**
|
|
7446
7451
|
* Northings
|
|
7447
7452
|
*
|
|
7448
|
-
* Northings reference using the [Ordnance Survey National Grid reference system](https://en.wikipedia.org/wiki/Ordnance_Survey_National_Grid)
|
|
7453
|
+
* Northings reference using the [Ordnance Survey National Grid reference system](https://en.wikipedia.org/wiki/Ordnance_Survey_National_Grid).
|
|
7449
7454
|
*
|
|
7450
|
-
* Northern Ireland Northings uses the [Irish Grid Reference System](https://en.wikipedia.org/wiki/Irish_grid_reference_system)
|
|
7455
|
+
* Northern Ireland Northings uses the [Irish Grid Reference System](https://en.wikipedia.org/wiki/Irish_grid_reference_system).
|
|
7451
7456
|
*
|
|
7452
7457
|
* Metres from origin. E.g. `180458`
|
|
7453
7458
|
*
|
|
7454
|
-
* Returns an empty string if no location data is available. Otherwise a number is returned
|
|
7459
|
+
* Returns an empty string if no location data is available. Otherwise a number is returned.
|
|
7455
7460
|
*/
|
|
7456
7461
|
type Northings = string | number;
|
|
7457
7462
|
/**
|
|
@@ -7598,7 +7603,7 @@ type AddressListItem = {
|
|
|
7598
7603
|
/**
|
|
7599
7604
|
* Postcode Outward
|
|
7600
7605
|
*
|
|
7601
|
-
* The first part of a postcode is known as the outward code. e.g. The outward code of
|
|
7606
|
+
* The first part of a postcode is known as the outward code. e.g. The outward code of BR8 7RE is BR8. Enables mail to be sorted to the correct local area for delivery. This part of the code contains the area and the district to which the mail is to be delivered, e.g. 'PO1', 'SW1A' or 'B23'.
|
|
7602
7607
|
*
|
|
7603
7608
|
* Empty (`""`) where the address has no UK postcode.
|
|
7604
7609
|
*/
|
|
@@ -7606,7 +7611,7 @@ type AddressListItem = {
|
|
|
7606
7611
|
/**
|
|
7607
7612
|
* Postcode Inward
|
|
7608
7613
|
*
|
|
7609
|
-
* The second part of a postcode is known as the inward code. e.g. The inward code of
|
|
7614
|
+
* The second part of a postcode is known as the inward code. e.g. The inward code of BR8 7RE is 7RE.
|
|
7610
7615
|
*
|
|
7611
7616
|
* The number identifies the sector in the postal district. The number is followed by 2 letters. The letters then define one or more properties in that sector.
|
|
7612
7617
|
*
|
|
@@ -7923,7 +7928,7 @@ type NativeRecord = PafAddress | MrAddress | NybAddress | PafaAddress | PafwAddr
|
|
|
7923
7928
|
*
|
|
7924
7929
|
* Its fields follow the layout UK address databases typically use, and much of it reflects Royal Mail's Postcode Address File, the UK's primary address database.
|
|
7925
7930
|
*
|
|
7926
|
-
* The API converts non-UK addresses into the same UK layout so international addresses will also seamlessly insert into a standard address database.
|
|
7931
|
+
* The API converts non-UK addresses into the same UK layout so international addresses will also seamlessly insert into a standard address database. Fidelity to the local details is retained with the `native` address field.
|
|
7927
7932
|
*
|
|
7928
7933
|
* Pay attention to the address lines (`line_1`, `line_2` and `line_3`), post town, postcode, county and country. Together they are all you need to identify an address uniquely, in the UK or as an international address.
|
|
7929
7934
|
*
|
|
@@ -8023,7 +8028,7 @@ type Address = {
|
|
|
8023
8028
|
/**
|
|
8024
8029
|
* Postcode Outward
|
|
8025
8030
|
*
|
|
8026
|
-
* The first part of a postcode is known as the outward code. e.g. The outward code of
|
|
8031
|
+
* The first part of a postcode is known as the outward code. e.g. The outward code of BR8 7RE is BR8. Enables mail to be sorted to the correct local area for delivery. This part of the code contains the area and the district to which the mail is to be delivered, e.g. 'PO1', 'SW1A' or 'B23'.
|
|
8027
8032
|
*
|
|
8028
8033
|
* Empty (`""`) where the address has no UK postcode.
|
|
8029
8034
|
*/
|
|
@@ -8031,7 +8036,7 @@ type Address = {
|
|
|
8031
8036
|
/**
|
|
8032
8037
|
* Postcode Inward
|
|
8033
8038
|
*
|
|
8034
|
-
* The second part of a postcode is known as the inward code. e.g. The inward code of
|
|
8039
|
+
* The second part of a postcode is known as the inward code. e.g. The inward code of BR8 7RE is 7RE.
|
|
8035
8040
|
*
|
|
8036
8041
|
* The number identifies the sector in the postal district. The number is followed by 2 letters. The letters then define one or more properties in that sector.
|
|
8037
8042
|
*
|
|
@@ -8404,7 +8409,14 @@ type ApiKeyDetailsEditable = {
|
|
|
8404
8409
|
limit?: number | null;
|
|
8405
8410
|
};
|
|
8406
8411
|
/**
|
|
8407
|
-
* A list of allowed URLs. An empty list
|
|
8412
|
+
* A list of allowed URLs. An empty list disables the check. Up to 10 allowed.
|
|
8413
|
+
*
|
|
8414
|
+
* A request is allowed when its `Origin` or `Referer` header matches an entry. Use one of these formats:
|
|
8415
|
+
*
|
|
8416
|
+
* - `https://www.example.com` allows one site. Scheme and host must match
|
|
8417
|
+
* - `*.example.com` allows the domain and all its subdomains
|
|
8418
|
+
*
|
|
8419
|
+
* See [Allowed URLs](https://docs.ideal-postcodes.co.uk/docs/guides/allowed-urls).
|
|
8408
8420
|
*/
|
|
8409
8421
|
allowed_urls?: Array<string>;
|
|
8410
8422
|
/**
|
|
@@ -8885,7 +8897,14 @@ type ApiKeyDetails = {
|
|
|
8885
8897
|
monthly_limit: ApiKeyMonthlyLimit;
|
|
8886
8898
|
individual_limit: ApiKeyIndividualLimit;
|
|
8887
8899
|
/**
|
|
8888
|
-
* A list of allowed URLs. An empty list
|
|
8900
|
+
* A list of allowed URLs. An empty list disables the check.
|
|
8901
|
+
*
|
|
8902
|
+
* A request is allowed when its `Origin` or `Referer` header matches an entry. Use one of these formats:
|
|
8903
|
+
*
|
|
8904
|
+
* - `https://www.example.com` allows one site. Scheme and host must match
|
|
8905
|
+
* - `*.example.com` allows the domain and all its subdomains
|
|
8906
|
+
*
|
|
8907
|
+
* See [Allowed URLs](https://docs.ideal-postcodes.co.uk/docs/guides/allowed-urls).
|
|
8889
8908
|
*/
|
|
8890
8909
|
allowed_urls: Array<string>;
|
|
8891
8910
|
/**
|
|
@@ -8941,7 +8960,7 @@ type ApiKey = {
|
|
|
8941
8960
|
/**
|
|
8942
8961
|
* Determines whether the key can be used by the requesting agent.
|
|
8943
8962
|
*
|
|
8944
|
-
* Returns false if one of the following conditions
|
|
8963
|
+
* Returns false if one of the following conditions is met:
|
|
8945
8964
|
* - Key has no lookups remaining
|
|
8946
8965
|
* - Daily limit has been reached on the key
|
|
8947
8966
|
* - Daily individual limit has been reached
|
|
@@ -9302,13 +9321,13 @@ type EndParam = number;
|
|
|
9302
9321
|
*/
|
|
9303
9322
|
type StartParam = number;
|
|
9304
9323
|
/**
|
|
9305
|
-
* **
|
|
9324
|
+
* **Management Key**
|
|
9306
9325
|
*
|
|
9307
|
-
* A secret key used
|
|
9326
|
+
* A secret key used to manage your account and API Keys. It was previously called the user token.
|
|
9308
9327
|
*
|
|
9309
|
-
* Your
|
|
9328
|
+
* Your management key can be retrieved and managed from your [accounts page](https://account.ideal-postcodes.co.uk/account).
|
|
9310
9329
|
*
|
|
9311
|
-
* Typically begins `uk_...`
|
|
9330
|
+
* Typically begins `uk_...`. Prefer the `Authorization: Bearer uk_...` header.
|
|
9312
9331
|
*
|
|
9313
9332
|
*/
|
|
9314
9333
|
type UserTokenParam = string;
|
|
@@ -9502,13 +9521,13 @@ type KeyDetailsData = {
|
|
|
9502
9521
|
};
|
|
9503
9522
|
query?: {
|
|
9504
9523
|
/**
|
|
9505
|
-
* **
|
|
9524
|
+
* **Management Key**
|
|
9506
9525
|
*
|
|
9507
|
-
* A secret key used
|
|
9526
|
+
* A secret key used to manage your account and API Keys. It was previously called the user token.
|
|
9508
9527
|
*
|
|
9509
|
-
* Your
|
|
9528
|
+
* Your management key can be retrieved and managed from your [accounts page](https://account.ideal-postcodes.co.uk/account).
|
|
9510
9529
|
*
|
|
9511
|
-
* Typically begins `uk_...`
|
|
9530
|
+
* Typically begins `uk_...`. Prefer the `Authorization: Bearer uk_...` header.
|
|
9512
9531
|
*
|
|
9513
9532
|
*/
|
|
9514
9533
|
user_token?: string;
|
|
@@ -9546,13 +9565,13 @@ type UpdateKeyDetailsData = {
|
|
|
9546
9565
|
};
|
|
9547
9566
|
query?: {
|
|
9548
9567
|
/**
|
|
9549
|
-
* **
|
|
9568
|
+
* **Management Key**
|
|
9550
9569
|
*
|
|
9551
|
-
* A secret key used
|
|
9570
|
+
* A secret key used to manage your account and API Keys. It was previously called the user token.
|
|
9552
9571
|
*
|
|
9553
|
-
* Your
|
|
9572
|
+
* Your management key can be retrieved and managed from your [accounts page](https://account.ideal-postcodes.co.uk/account).
|
|
9554
9573
|
*
|
|
9555
|
-
* Typically begins `uk_...`
|
|
9574
|
+
* Typically begins `uk_...`. Prefer the `Authorization: Bearer uk_...` header.
|
|
9556
9575
|
*
|
|
9557
9576
|
*/
|
|
9558
9577
|
user_token?: string;
|
|
@@ -9590,13 +9609,13 @@ type KeyUsageData = {
|
|
|
9590
9609
|
};
|
|
9591
9610
|
query?: {
|
|
9592
9611
|
/**
|
|
9593
|
-
* **
|
|
9612
|
+
* **Management Key**
|
|
9594
9613
|
*
|
|
9595
|
-
* A secret key used
|
|
9614
|
+
* A secret key used to manage your account and API Keys. It was previously called the user token.
|
|
9596
9615
|
*
|
|
9597
|
-
* Your
|
|
9616
|
+
* Your management key can be retrieved and managed from your [accounts page](https://account.ideal-postcodes.co.uk/account).
|
|
9598
9617
|
*
|
|
9599
|
-
* Typically begins `uk_...`
|
|
9618
|
+
* Typically begins `uk_...`. Prefer the `Authorization: Bearer uk_...` header.
|
|
9600
9619
|
*
|
|
9601
9620
|
*/
|
|
9602
9621
|
user_token?: string;
|
|
@@ -9662,13 +9681,13 @@ type KeyLogsData = {
|
|
|
9662
9681
|
};
|
|
9663
9682
|
query?: {
|
|
9664
9683
|
/**
|
|
9665
|
-
* **
|
|
9684
|
+
* **Management Key**
|
|
9666
9685
|
*
|
|
9667
|
-
* A secret key used
|
|
9686
|
+
* A secret key used to manage your account and API Keys. It was previously called the user token.
|
|
9668
9687
|
*
|
|
9669
|
-
* Your
|
|
9688
|
+
* Your management key can be retrieved and managed from your [accounts page](https://account.ideal-postcodes.co.uk/account).
|
|
9670
9689
|
*
|
|
9671
|
-
* Typically begins `uk_...`
|
|
9690
|
+
* Typically begins `uk_...`. Prefer the `Authorization: Bearer uk_...` header.
|
|
9672
9691
|
*
|
|
9673
9692
|
*/
|
|
9674
9693
|
user_token?: string;
|
|
@@ -10514,13 +10533,13 @@ type ListLicenseesData = {
|
|
|
10514
10533
|
*/
|
|
10515
10534
|
starting_after?: number;
|
|
10516
10535
|
/**
|
|
10517
|
-
* **
|
|
10536
|
+
* **Management Key**
|
|
10518
10537
|
*
|
|
10519
|
-
* A secret key used
|
|
10538
|
+
* A secret key used to manage your account and API Keys. It was previously called the user token.
|
|
10520
10539
|
*
|
|
10521
|
-
* Your
|
|
10540
|
+
* Your management key can be retrieved and managed from your [accounts page](https://account.ideal-postcodes.co.uk/account).
|
|
10522
10541
|
*
|
|
10523
|
-
* Typically begins `uk_...`
|
|
10542
|
+
* Typically begins `uk_...`. Prefer the `Authorization: Bearer uk_...` header.
|
|
10524
10543
|
*
|
|
10525
10544
|
*/
|
|
10526
10545
|
user_token?: string;
|
|
@@ -10567,13 +10586,13 @@ type CreateLicenseeData = {
|
|
|
10567
10586
|
};
|
|
10568
10587
|
query?: {
|
|
10569
10588
|
/**
|
|
10570
|
-
* **
|
|
10589
|
+
* **Management Key**
|
|
10571
10590
|
*
|
|
10572
|
-
* A secret key used
|
|
10591
|
+
* A secret key used to manage your account and API Keys. It was previously called the user token.
|
|
10573
10592
|
*
|
|
10574
|
-
* Your
|
|
10593
|
+
* Your management key can be retrieved and managed from your [accounts page](https://account.ideal-postcodes.co.uk/account).
|
|
10575
10594
|
*
|
|
10576
|
-
* Typically begins `uk_...`
|
|
10595
|
+
* Typically begins `uk_...`. Prefer the `Authorization: Bearer uk_...` header.
|
|
10577
10596
|
*
|
|
10578
10597
|
*/
|
|
10579
10598
|
user_token?: string;
|
|
@@ -10614,13 +10633,13 @@ type DeleteLicenseeData = {
|
|
|
10614
10633
|
};
|
|
10615
10634
|
query?: {
|
|
10616
10635
|
/**
|
|
10617
|
-
* **
|
|
10636
|
+
* **Management Key**
|
|
10618
10637
|
*
|
|
10619
|
-
* A secret key used
|
|
10638
|
+
* A secret key used to manage your account and API Keys. It was previously called the user token.
|
|
10620
10639
|
*
|
|
10621
|
-
* Your
|
|
10640
|
+
* Your management key can be retrieved and managed from your [accounts page](https://account.ideal-postcodes.co.uk/account).
|
|
10622
10641
|
*
|
|
10623
|
-
* Typically begins `uk_...`
|
|
10642
|
+
* Typically begins `uk_...`. Prefer the `Authorization: Bearer uk_...` header.
|
|
10624
10643
|
*
|
|
10625
10644
|
*/
|
|
10626
10645
|
user_token?: string;
|
|
@@ -10669,13 +10688,13 @@ type RetrieveLicenseeData = {
|
|
|
10669
10688
|
};
|
|
10670
10689
|
query?: {
|
|
10671
10690
|
/**
|
|
10672
|
-
* **
|
|
10691
|
+
* **Management Key**
|
|
10673
10692
|
*
|
|
10674
|
-
* A secret key used
|
|
10693
|
+
* A secret key used to manage your account and API Keys. It was previously called the user token.
|
|
10675
10694
|
*
|
|
10676
|
-
* Your
|
|
10695
|
+
* Your management key can be retrieved and managed from your [accounts page](https://account.ideal-postcodes.co.uk/account).
|
|
10677
10696
|
*
|
|
10678
|
-
* Typically begins `uk_...`
|
|
10697
|
+
* Typically begins `uk_...`. Prefer the `Authorization: Bearer uk_...` header.
|
|
10679
10698
|
*
|
|
10680
10699
|
*/
|
|
10681
10700
|
user_token?: string;
|
|
@@ -10716,13 +10735,13 @@ type UpdateLicenseeData = {
|
|
|
10716
10735
|
};
|
|
10717
10736
|
query?: {
|
|
10718
10737
|
/**
|
|
10719
|
-
* **
|
|
10738
|
+
* **Management Key**
|
|
10720
10739
|
*
|
|
10721
|
-
* A secret key used
|
|
10740
|
+
* A secret key used to manage your account and API Keys. It was previously called the user token.
|
|
10722
10741
|
*
|
|
10723
|
-
* Your
|
|
10742
|
+
* Your management key can be retrieved and managed from your [accounts page](https://account.ideal-postcodes.co.uk/account).
|
|
10724
10743
|
*
|
|
10725
|
-
* Typically begins `uk_...`
|
|
10744
|
+
* Typically begins `uk_...`. Prefer the `Authorization: Bearer uk_...` header.
|
|
10726
10745
|
*
|
|
10727
10746
|
*/
|
|
10728
10747
|
user_token?: string;
|
|
@@ -10763,13 +10782,13 @@ type RegenerateLicenseeKeyData = {
|
|
|
10763
10782
|
};
|
|
10764
10783
|
query?: {
|
|
10765
10784
|
/**
|
|
10766
|
-
* **
|
|
10785
|
+
* **Management Key**
|
|
10767
10786
|
*
|
|
10768
|
-
* A secret key used
|
|
10787
|
+
* A secret key used to manage your account and API Keys. It was previously called the user token.
|
|
10769
10788
|
*
|
|
10770
|
-
* Your
|
|
10789
|
+
* Your management key can be retrieved and managed from your [accounts page](https://account.ideal-postcodes.co.uk/account).
|
|
10771
10790
|
*
|
|
10772
|
-
* Typically begins `uk_...`
|
|
10791
|
+
* Typically begins `uk_...`. Prefer the `Authorization: Bearer uk_...` header.
|
|
10773
10792
|
*
|
|
10774
10793
|
*/
|
|
10775
10794
|
user_token?: string;
|
|
@@ -10803,13 +10822,13 @@ type ListConfigsData = {
|
|
|
10803
10822
|
};
|
|
10804
10823
|
query?: {
|
|
10805
10824
|
/**
|
|
10806
|
-
* **
|
|
10825
|
+
* **Management Key**
|
|
10807
10826
|
*
|
|
10808
|
-
* A secret key used
|
|
10827
|
+
* A secret key used to manage your account and API Keys. It was previously called the user token.
|
|
10809
10828
|
*
|
|
10810
|
-
* Your
|
|
10829
|
+
* Your management key can be retrieved and managed from your [accounts page](https://account.ideal-postcodes.co.uk/account).
|
|
10811
10830
|
*
|
|
10812
|
-
* Typically begins `uk_...`
|
|
10831
|
+
* Typically begins `uk_...`. Prefer the `Authorization: Bearer uk_...` header.
|
|
10813
10832
|
*
|
|
10814
10833
|
*/
|
|
10815
10834
|
user_token?: string;
|
|
@@ -10843,13 +10862,13 @@ type CreateConfigData = {
|
|
|
10843
10862
|
};
|
|
10844
10863
|
query?: {
|
|
10845
10864
|
/**
|
|
10846
|
-
* **
|
|
10865
|
+
* **Management Key**
|
|
10847
10866
|
*
|
|
10848
|
-
* A secret key used
|
|
10867
|
+
* A secret key used to manage your account and API Keys. It was previously called the user token.
|
|
10849
10868
|
*
|
|
10850
|
-
* Your
|
|
10869
|
+
* Your management key can be retrieved and managed from your [accounts page](https://account.ideal-postcodes.co.uk/account).
|
|
10851
10870
|
*
|
|
10852
|
-
* Typically begins `uk_...`
|
|
10871
|
+
* Typically begins `uk_...`. Prefer the `Authorization: Bearer uk_...` header.
|
|
10853
10872
|
*
|
|
10854
10873
|
*/
|
|
10855
10874
|
user_token?: string;
|
|
@@ -10890,13 +10909,13 @@ type DeleteConfigData = {
|
|
|
10890
10909
|
};
|
|
10891
10910
|
query?: {
|
|
10892
10911
|
/**
|
|
10893
|
-
* **
|
|
10912
|
+
* **Management Key**
|
|
10894
10913
|
*
|
|
10895
|
-
* A secret key used
|
|
10914
|
+
* A secret key used to manage your account and API Keys. It was previously called the user token.
|
|
10896
10915
|
*
|
|
10897
|
-
* Your
|
|
10916
|
+
* Your management key can be retrieved and managed from your [accounts page](https://account.ideal-postcodes.co.uk/account).
|
|
10898
10917
|
*
|
|
10899
|
-
* Typically begins `uk_...`
|
|
10918
|
+
* Typically begins `uk_...`. Prefer the `Authorization: Bearer uk_...` header.
|
|
10900
10919
|
*
|
|
10901
10920
|
*/
|
|
10902
10921
|
user_token?: string;
|
|
@@ -10988,13 +11007,13 @@ type UpdateConfigData = {
|
|
|
10988
11007
|
};
|
|
10989
11008
|
query?: {
|
|
10990
11009
|
/**
|
|
10991
|
-
* **
|
|
11010
|
+
* **Management Key**
|
|
10992
11011
|
*
|
|
10993
|
-
* A secret key used
|
|
11012
|
+
* A secret key used to manage your account and API Keys. It was previously called the user token.
|
|
10994
11013
|
*
|
|
10995
|
-
* Your
|
|
11014
|
+
* Your management key can be retrieved and managed from your [accounts page](https://account.ideal-postcodes.co.uk/account).
|
|
10996
11015
|
*
|
|
10997
|
-
* Typically begins `uk_...`
|
|
11016
|
+
* Typically begins `uk_...`. Prefer the `Authorization: Bearer uk_...` header.
|
|
10998
11017
|
*
|
|
10999
11018
|
*/
|
|
11000
11019
|
user_token?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ideal-postcodes/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Fetch-based, treeshakable TypeScript SDK for api.ideal-postcodes.co.uk",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ideal Postcodes",
|
|
@@ -102,15 +102,15 @@
|
|
|
102
102
|
"tsup": "~8.5.1",
|
|
103
103
|
"tsx": "4.21.0",
|
|
104
104
|
"typescript": "5.9.3",
|
|
105
|
-
"vitest": "4.
|
|
105
|
+
"vitest": "~4.1.11",
|
|
106
106
|
"@iddqdhq/sdk-scripts": "0.0.1",
|
|
107
|
-
"@ideal-postcodes/openapi": "5.0
|
|
107
|
+
"@ideal-postcodes/openapi": "5.1.0",
|
|
108
108
|
"@tanstack/react-query": "5.100.11",
|
|
109
109
|
"@tanstack/preact-query": "5.100.11",
|
|
110
110
|
"react": "18.3.1",
|
|
111
111
|
"@types/react": "18.3.27",
|
|
112
112
|
"preact": "10.29.3",
|
|
113
|
-
"@iddqdhq/jsutil": "8.1.
|
|
113
|
+
"@iddqdhq/jsutil": "8.1.1",
|
|
114
114
|
"size-limit": "14.0.0",
|
|
115
115
|
"@size-limit/esbuild": "14.0.0",
|
|
116
116
|
"@size-limit/file": "14.0.0",
|
package/dist/chunk-BNT2VR2B.mjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
var F={bodySerializer:e=>JSON.stringify(e,(r,t)=>typeof t=="bigint"?t.toString():t)};function W({onRequest:e,onSseError:r,onSseEvent:t,responseTransformer:n,responseValidator:i,sseDefaultRetryDelay:l,sseMaxRetryAttempts:o,sseMaxRetryDelay:s,sseSleepFn:a,url:m,...c}){let d,b=a??(u=>new Promise(y=>setTimeout(y,u)));return{stream:async function*(){let u=l??3e3,y=0,R=c.signal??new AbortController().signal;for(;!R.aborted;){y++;let A=c.headers instanceof Headers?c.headers:new Headers(c.headers);d!==void 0&&A.set("Last-Event-ID",d);try{let T={redirect:"follow",...c,body:c.serializedBody,headers:A,signal:R},x=new Request(m,T);e&&(x=await e(m,T));let h=await(c.fetch??globalThis.fetch)(x);if(!h.ok)throw new Error(`SSE failed: ${h.status} ${h.statusText}`);if(!h.body)throw new Error("No body in SSE response");let E=h.body.pipeThrough(new TextDecoderStream).getReader(),g="",B=()=>{try{E.cancel()}catch{}};R.addEventListener("abort",B);try{for(;;){let{done:Y,value:Z}=await E.read();if(Y)break;g+=Z,g=g.replace(/\r\n?/g,`
|
|
2
|
-
`);let N=g.split(`
|
|
3
|
-
|
|
4
|
-
`);g=N.pop()??"";for(let ee of N){let re=ee.split(`
|
|
5
|
-
`),z=[],$;for(let w of re)if(w.startsWith("data:"))z.push(w.replace(/^data:\s*/,""));else if(w.startsWith("event:"))$=w.replace(/^event:\s*/,"");else if(w.startsWith("id:"))d=w.replace(/^id:\s*/,"");else if(w.startsWith("retry:")){let H=Number.parseInt(w.replace(/^retry:\s*/,""),10);Number.isNaN(H)||(u=H)}let S,V=!1;if(z.length){let w=z.join(`
|
|
6
|
-
`);try{S=JSON.parse(w),V=!0}catch{S=w}}V&&(i&&await i(S),n&&(S=await n(S))),t?.({data:S,event:$,id:d,retry:u}),z.length&&(yield S)}}}finally{R.removeEventListener("abort",B),E.releaseLock()}break}catch(T){if(r?.(T),o!==void 0&&y>=o)break;let x=Math.min(u*2**(y-1),s??3e4);await b(x)}}}()}}var te=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},se=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},ne=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},q=({allowReserved:e,explode:r,name:t,style:n,value:i})=>{if(!r){let s=(e?i:i.map(a=>encodeURIComponent(a))).join(se(n));switch(n){case"label":return`.${s}`;case"matrix":return`;${t}=${s}`;case"simple":return s;default:return`${t}=${s}`}}let l=te(n),o=i.map(s=>n==="label"||n==="simple"?e?s:encodeURIComponent(s):C({allowReserved:e,name:t,value:s})).join(l);return n==="label"||n==="matrix"?l+o:o},C=({allowReserved:e,name:r,value:t})=>{if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${r}=${e?t:encodeURIComponent(t)}`},P=({allowReserved:e,explode:r,name:t,style:n,value:i,valueOnly:l})=>{if(i instanceof Date)return l?i.toISOString():`${t}=${i.toISOString()}`;if(n!=="deepObject"&&!r){let a=[];Object.entries(i).forEach(([c,d])=>{a=[...a,c,e?d:encodeURIComponent(d)]});let m=a.join(",");switch(n){case"form":return`${t}=${m}`;case"label":return`.${m}`;case"matrix":return`;${t}=${m}`;default:return m}}let o=ne(n),s=Object.entries(i).map(([a,m])=>C({allowReserved:e,name:n==="deepObject"?`${t}[${a}]`:a,value:m})).join(o);return n==="label"||n==="matrix"?o+s:s};var oe=/\{[^{}]+\}/g,ae=({path:e,url:r})=>{let t=r,n=r.match(oe);if(n)for(let i of n){let l=!1,o=i.substring(1,i.length-1),s="simple";o.endsWith("*")&&(l=!0,o=o.substring(0,o.length-1)),o.startsWith(".")?(o=o.substring(1),s="label"):o.startsWith(";")&&(o=o.substring(1),s="matrix");let a=e[o];if(a==null)continue;if(Array.isArray(a)){t=t.replace(i,q({explode:l,name:o,style:s,value:a}));continue}if(typeof a=="object"){t=t.replace(i,P({explode:l,name:o,style:s,value:a,valueOnly:!0}));continue}if(s==="matrix"){t=t.replace(i,`;${C({name:o,value:a})}`);continue}let m=encodeURIComponent(s==="label"?`.${a}`:a);t=t.replace(i,m)}return t},Q=({baseUrl:e,path:r,query:t,querySerializer:n,url:i})=>{let l=i.startsWith("/")?i:`/${i}`,o=(e??"")+l;r&&(o=ae({path:r,url:o}));let s=t?n(t):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(o+=`?${s}`),o};function L(e){let r=e.body!==void 0;if(r&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(r)return e.body}var M=async(e,r)=>{let t=typeof r=="function"?await r(e):r;if(t)return e.scheme==="bearer"?`Bearer ${t}`:e.scheme==="basic"?`Basic ${btoa(t)}`:t};var J=({parameters:e={},...r}={})=>n=>{let i=[];if(n&&typeof n=="object")for(let l in n){let o=n[l];if(o==null)continue;let s=e[l]||r;if(Array.isArray(o)){let a=q({allowReserved:s.allowReserved,explode:!0,name:l,style:"form",value:o,...s.array});a&&i.push(a)}else if(typeof o=="object"){let a=P({allowReserved:s.allowReserved,explode:!0,name:l,style:"deepObject",value:o,...s.object});a&&i.push(a)}else{let a=C({allowReserved:s.allowReserved,name:l,value:o});a&&i.push(a)}}return i.join("&")},_=e=>{if(!e)return"stream";let r=e.split(";")[0]?.trim();if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return"json";if(r==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(t=>r.startsWith(t)))return"blob";if(r.startsWith("text/"))return"text"}},ie=(e,r)=>r?!!(e.headers.has(r)||e.query?.[r]||e.headers.get("Cookie")?.includes(`${r}=`)):!1;async function G(e){for(let r of e.security??[]){if(ie(e,r.name))continue;let t=await M(r,e.auth);if(!t)continue;let n=r.name??"Authorization";switch(r.in){case"query":e.query||(e.query={}),e.query[n]=t;break;case"cookie":e.headers.append("Cookie",`${n}=${t}`);break;default:e.headers.set(n,t);break}}}var U=e=>Q({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:J(e.querySerializer),url:e.url}),I=(e,r)=>{let t={...e,...r};return t.baseUrl?.endsWith("/")&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=v(e.headers,r.headers),t},le=e=>{let r=[];return e.forEach((t,n)=>{r.push([n,t])}),r},v=(...e)=>{let r=new Headers;for(let t of e){if(!t)continue;let n=t instanceof Headers?le(t):Object.entries(t);for(let[i,l]of n)if(l===null)r.delete(i);else if(Array.isArray(l))for(let o of l)r.append(i,o);else l!==void 0&&r.set(i,typeof l=="object"?JSON.stringify(l):l)}return r},D=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(r){let t=this.getInterceptorIndex(r);this.fns[t]&&(this.fns[t]=null)}exists(r){let t=this.getInterceptorIndex(r);return!!this.fns[t]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,t){let n=this.getInterceptorIndex(r);return this.fns[n]?(this.fns[n]=t,r):!1}use(r){return this.fns.push(r),this.fns.length-1}},X=()=>({error:new D,request:new D,response:new D}),de=J({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),ce={"Content-Type":"application/json"},k=(e={})=>({...F,headers:ce,parseAs:"auto",querySerializer:de,...e});var K=(e={})=>{let r=I(k(),e),t=()=>({...r}),n=c=>(r=I(r,c),t()),i=X(),l=async c=>{let d={...r,...c,fetch:c.fetch??r.fetch??globalThis.fetch,headers:v(r.headers,c.headers),serializedBody:void 0};d.security&&await G(d),d.requestValidator&&await d.requestValidator(d),d.body!==void 0&&d.bodySerializer&&(d.serializedBody=d.bodySerializer(d.body)),(d.body===void 0||d.serializedBody==="")&&d.headers.delete("Content-Type");let b=d,O=U(b);return{opts:b,url:O}},o=async c=>{let d=c.throwOnError??r.throwOnError,b=c.responseStyle??r.responseStyle,O,f;try{let{opts:u,url:y}=await l(c),R={redirect:"follow",...u,body:L(u)};O=new Request(y,R);for(let h of i.request.fns)h&&(O=await h(O,u));let A=u.fetch;f=await A(O);for(let h of i.response.fns)h&&(f=await h(f,O,u));let T={request:O,response:f};if(f.ok){let h=(u.parseAs==="auto"?_(f.headers.get("Content-Type")):u.parseAs)??"json";if(f.status===204||f.headers.get("Content-Length")==="0"){let g;switch(h){case"arrayBuffer":case"blob":case"text":g=await f[h]();break;case"formData":g=new FormData;break;case"stream":g=f.body;break;default:g={};break}return u.responseStyle==="data"?g:{data:g,...T}}let E;switch(h){case"arrayBuffer":case"blob":case"formData":case"text":E=await f[h]();break;case"json":{let g=await f.text();E=g?JSON.parse(g):{};break}case"stream":return u.responseStyle==="data"?f.body:{data:f.body,...T}}return h==="json"&&(u.responseValidator&&await u.responseValidator(E),u.responseTransformer&&(E=await u.responseTransformer(E))),u.responseStyle==="data"?E:{data:E,...T}}let x=await f.text(),j;try{j=JSON.parse(x)}catch{}throw j??x}catch(u){let y=u;for(let R of i.error.fns)R&&(y=await R(y,f,O,c));if(y=y||{},d)throw y;return b==="data"?void 0:{error:y,request:O,response:f}}},s=c=>d=>o({...d,method:c}),a=c=>async d=>{let{opts:b,url:O}=await l(d);return W({...b,body:b.body,method:c,onRequest:async(f,u)=>{let y=new Request(f,u);for(let R of i.request.fns)R&&(y=await R(y,b));return y},serializedBody:L(b),url:O})};return{buildUrl:c=>U({...r,...c}),connect:s("CONNECT"),delete:s("DELETE"),get:s("GET"),getConfig:t,head:s("HEAD"),interceptors:i,options:s("OPTIONS"),patch:s("PATCH"),post:s("POST"),put:s("PUT"),request:o,setConfig:n,sse:{connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),head:a("HEAD"),options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),trace:a("TRACE")},trace:s("TRACE")}};var p=K(k({baseUrl:"https://api.ideal-postcodes.co.uk/v1",throwOnError:!0}));var Pe=e=>(e.client??p).get({querySerializer:{parameters:{dataset:{array:{explode:!1}}}},url:"/postcodes/{postcode}",...e}),ve=e=>(e.client??p).get({url:"/keys/{key}",...e}),je=e=>(e.client??p).get({url:"/keys/{key}/details",...e}),Le=e=>(e.client??p).put({url:"/keys/{key}/details",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ue=e=>(e.client??p).get({url:"/keys/{key}/usage",...e}),Ie=e=>(e.client??p).get({url:"/keys/{key}/lookups",...e}),Ke=e=>(e.client??p).post({url:"/cleanse/addresses",...e,headers:{"Content-Type":"application/json",...e.headers}}),Be=e=>(e?.client??p).get({querySerializer:{parameters:{dataset:{array:{explode:!1}}}},url:"/autocomplete/addresses",...e}),Ne=e=>(e.client??p).get({url:"/autocomplete/addresses/{address}/gbr",...e}),$e=e=>(e?.client??p).get({querySerializer:{parameters:{dataset:{array:{explode:!1}}}},url:"/addresses",...e}),Ve=e=>(e?.client??p).get({url:"/places",...e}),He=e=>(e.client??p).get({url:"/places/{place}",...e}),Fe=e=>(e.client??p).get({url:"/keys/{key}/licensees",...e}),We=e=>(e.client??p).post({url:"/keys/{key}/licensees",...e,headers:{"Content-Type":"application/json",...e.headers}}),Qe=e=>(e.client??p).delete({url:"/keys/{key}/licensees/{licensee}",...e}),Me=e=>(e.client??p).get({url:"/keys/{key}/licensees/{licensee}",...e}),Je=e=>(e.client??p).put({url:"/keys/{key}/licensees/{licensee}",...e,headers:{"Content-Type":"application/json",...e.headers}}),_e=e=>(e.client??p).post({url:"/keys/{key}/licensees/{licensee}/regenerate-key",...e}),Ge=e=>(e.client??p).get({url:"/keys/{key}/configs",...e}),Xe=e=>(e.client??p).post({url:"/keys/{key}/configs",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ye=e=>(e.client??p).delete({url:"/keys/{key}/configs/{config}",...e}),Ze=e=>(e.client??p).get({url:"/keys/{key}/configs/{config}",...e}),er=e=>(e.client??p).post({url:"/keys/{key}/configs/{config}",...e,headers:{"Content-Type":"application/json",...e.headers}}),rr=e=>(e.client??p).get({url:"/emails",...e}),tr=e=>(e.client??p).get({url:"/phone_numbers",...e});export{k as a,K as b,p as c,Pe as d,ve as e,je as f,Le as g,Ue as h,Ie as i,Ke as j,Be as k,Ne as l,$e as m,Ve as n,He as o,Fe as p,We as q,Qe as r,Me as s,Je as t,_e as u,Ge as v,Xe as w,Ye as x,Ze as y,er as z,rr as A,tr as B};
|
package/dist/chunk-HQKXKJXR.cjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var F={bodySerializer:e=>JSON.stringify(e,(r,t)=>typeof t=="bigint"?t.toString():t)};function W({onRequest:e,onSseError:r,onSseEvent:t,responseTransformer:n,responseValidator:i,sseDefaultRetryDelay:l,sseMaxRetryAttempts:o,sseMaxRetryDelay:s,sseSleepFn:a,url:m,...c}){let d,b=_nullishCoalesce(a, () => ((u=>new Promise(y=>setTimeout(y,u)))));return{stream:async function*(){let u=_nullishCoalesce(l, () => (3e3)),y=0,R=_nullishCoalesce(c.signal, () => (new AbortController().signal));for(;!R.aborted;){y++;let A=c.headers instanceof Headers?c.headers:new Headers(c.headers);d!==void 0&&A.set("Last-Event-ID",d);try{let T={redirect:"follow",...c,body:c.serializedBody,headers:A,signal:R},x=new Request(m,T);e&&(x=await e(m,T));let h=await(_nullishCoalesce(c.fetch, () => (globalThis.fetch)))(x);if(!h.ok)throw new Error(`SSE failed: ${h.status} ${h.statusText}`);if(!h.body)throw new Error("No body in SSE response");let E=h.body.pipeThrough(new TextDecoderStream).getReader(),g="",B=()=>{try{E.cancel()}catch (e2){}};R.addEventListener("abort",B);try{for(;;){let{done:Y,value:Z}=await E.read();if(Y)break;g+=Z,g=g.replace(/\r\n?/g,`
|
|
2
|
-
`);let N=g.split(`
|
|
3
|
-
|
|
4
|
-
`);g=_nullishCoalesce(N.pop(), () => (""));for(let ee of N){let re=ee.split(`
|
|
5
|
-
`),z=[],$;for(let w of re)if(w.startsWith("data:"))z.push(w.replace(/^data:\s*/,""));else if(w.startsWith("event:"))$=w.replace(/^event:\s*/,"");else if(w.startsWith("id:"))d=w.replace(/^id:\s*/,"");else if(w.startsWith("retry:")){let H=Number.parseInt(w.replace(/^retry:\s*/,""),10);Number.isNaN(H)||(u=H)}let S,V=!1;if(z.length){let w=z.join(`
|
|
6
|
-
`);try{S=JSON.parse(w),V=!0}catch (e3){S=w}}V&&(i&&await i(S),n&&(S=await n(S))),_optionalChain([t, 'optionalCall', _2 => _2({data:S,event:$,id:d,retry:u})]),z.length&&(yield S)}}}finally{R.removeEventListener("abort",B),E.releaseLock()}break}catch(T){if(_optionalChain([r, 'optionalCall', _3 => _3(T)]),o!==void 0&&y>=o)break;let x=Math.min(u*2**(y-1),_nullishCoalesce(s, () => (3e4)));await b(x)}}}()}}var te=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},se=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},ne=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},q=({allowReserved:e,explode:r,name:t,style:n,value:i})=>{if(!r){let s=(e?i:i.map(a=>encodeURIComponent(a))).join(se(n));switch(n){case"label":return`.${s}`;case"matrix":return`;${t}=${s}`;case"simple":return s;default:return`${t}=${s}`}}let l=te(n),o=i.map(s=>n==="label"||n==="simple"?e?s:encodeURIComponent(s):C({allowReserved:e,name:t,value:s})).join(l);return n==="label"||n==="matrix"?l+o:o},C=({allowReserved:e,name:r,value:t})=>{if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${r}=${e?t:encodeURIComponent(t)}`},P=({allowReserved:e,explode:r,name:t,style:n,value:i,valueOnly:l})=>{if(i instanceof Date)return l?i.toISOString():`${t}=${i.toISOString()}`;if(n!=="deepObject"&&!r){let a=[];Object.entries(i).forEach(([c,d])=>{a=[...a,c,e?d:encodeURIComponent(d)]});let m=a.join(",");switch(n){case"form":return`${t}=${m}`;case"label":return`.${m}`;case"matrix":return`;${t}=${m}`;default:return m}}let o=ne(n),s=Object.entries(i).map(([a,m])=>C({allowReserved:e,name:n==="deepObject"?`${t}[${a}]`:a,value:m})).join(o);return n==="label"||n==="matrix"?o+s:s};var oe=/\{[^{}]+\}/g,ae=({path:e,url:r})=>{let t=r,n=r.match(oe);if(n)for(let i of n){let l=!1,o=i.substring(1,i.length-1),s="simple";o.endsWith("*")&&(l=!0,o=o.substring(0,o.length-1)),o.startsWith(".")?(o=o.substring(1),s="label"):o.startsWith(";")&&(o=o.substring(1),s="matrix");let a=e[o];if(a==null)continue;if(Array.isArray(a)){t=t.replace(i,q({explode:l,name:o,style:s,value:a}));continue}if(typeof a=="object"){t=t.replace(i,P({explode:l,name:o,style:s,value:a,valueOnly:!0}));continue}if(s==="matrix"){t=t.replace(i,`;${C({name:o,value:a})}`);continue}let m=encodeURIComponent(s==="label"?`.${a}`:a);t=t.replace(i,m)}return t},Q=({baseUrl:e,path:r,query:t,querySerializer:n,url:i})=>{let l=i.startsWith("/")?i:`/${i}`,o=(_nullishCoalesce(e, () => ("")))+l;r&&(o=ae({path:r,url:o}));let s=t?n(t):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(o+=`?${s}`),o};function L(e){let r=e.body!==void 0;if(r&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(r)return e.body}var M=async(e,r)=>{let t=typeof r=="function"?await r(e):r;if(t)return e.scheme==="bearer"?`Bearer ${t}`:e.scheme==="basic"?`Basic ${btoa(t)}`:t};var J=({parameters:e={},...r}={})=>n=>{let i=[];if(n&&typeof n=="object")for(let l in n){let o=n[l];if(o==null)continue;let s=e[l]||r;if(Array.isArray(o)){let a=q({allowReserved:s.allowReserved,explode:!0,name:l,style:"form",value:o,...s.array});a&&i.push(a)}else if(typeof o=="object"){let a=P({allowReserved:s.allowReserved,explode:!0,name:l,style:"deepObject",value:o,...s.object});a&&i.push(a)}else{let a=C({allowReserved:s.allowReserved,name:l,value:o});a&&i.push(a)}}return i.join("&")},_=e=>{if(!e)return"stream";let r=_optionalChain([e, 'access', _4 => _4.split, 'call', _5 => _5(";"), 'access', _6 => _6[0], 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]);if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return"json";if(r==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(t=>r.startsWith(t)))return"blob";if(r.startsWith("text/"))return"text"}},ie=(e,r)=>r?!!(e.headers.has(r)||_optionalChain([e, 'access', _9 => _9.query, 'optionalAccess', _10 => _10[r]])||_optionalChain([e, 'access', _11 => _11.headers, 'access', _12 => _12.get, 'call', _13 => _13("Cookie"), 'optionalAccess', _14 => _14.includes, 'call', _15 => _15(`${r}=`)])):!1;async function G(e){for(let r of _nullishCoalesce(e.security, () => ([]))){if(ie(e,r.name))continue;let t=await M(r,e.auth);if(!t)continue;let n=_nullishCoalesce(r.name, () => ("Authorization"));switch(r.in){case"query":e.query||(e.query={}),e.query[n]=t;break;case"cookie":e.headers.append("Cookie",`${n}=${t}`);break;default:e.headers.set(n,t);break}}}var U=e=>Q({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:J(e.querySerializer),url:e.url}),I=(e,r)=>{let t={...e,...r};return _optionalChain([t, 'access', _16 => _16.baseUrl, 'optionalAccess', _17 => _17.endsWith, 'call', _18 => _18("/")])&&(t.baseUrl=t.baseUrl.substring(0,t.baseUrl.length-1)),t.headers=v(e.headers,r.headers),t},le=e=>{let r=[];return e.forEach((t,n)=>{r.push([n,t])}),r},v=(...e)=>{let r=new Headers;for(let t of e){if(!t)continue;let n=t instanceof Headers?le(t):Object.entries(t);for(let[i,l]of n)if(l===null)r.delete(i);else if(Array.isArray(l))for(let o of l)r.append(i,o);else l!==void 0&&r.set(i,typeof l=="object"?JSON.stringify(l):l)}return r},D=class{constructor(){this.fns=[]}clear(){this.fns=[]}eject(r){let t=this.getInterceptorIndex(r);this.fns[t]&&(this.fns[t]=null)}exists(r){let t=this.getInterceptorIndex(r);return!!this.fns[t]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,t){let n=this.getInterceptorIndex(r);return this.fns[n]?(this.fns[n]=t,r):!1}use(r){return this.fns.push(r),this.fns.length-1}},X=()=>({error:new D,request:new D,response:new D}),de=J({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),ce={"Content-Type":"application/json"},k= exports.a =(e={})=>({...F,headers:ce,parseAs:"auto",querySerializer:de,...e});var K=(e={})=>{let r=I(k(),e),t=()=>({...r}),n=c=>(r=I(r,c),t()),i=X(),l=async c=>{let d={...r,...c,fetch:_nullishCoalesce(_nullishCoalesce(c.fetch, () => (r.fetch)), () => (globalThis.fetch)),headers:v(r.headers,c.headers),serializedBody:void 0};d.security&&await G(d),d.requestValidator&&await d.requestValidator(d),d.body!==void 0&&d.bodySerializer&&(d.serializedBody=d.bodySerializer(d.body)),(d.body===void 0||d.serializedBody==="")&&d.headers.delete("Content-Type");let b=d,O=U(b);return{opts:b,url:O}},o=async c=>{let d=_nullishCoalesce(c.throwOnError, () => (r.throwOnError)),b=_nullishCoalesce(c.responseStyle, () => (r.responseStyle)),O,f;try{let{opts:u,url:y}=await l(c),R={redirect:"follow",...u,body:L(u)};O=new Request(y,R);for(let h of i.request.fns)h&&(O=await h(O,u));let A=u.fetch;f=await A(O);for(let h of i.response.fns)h&&(f=await h(f,O,u));let T={request:O,response:f};if(f.ok){let h=_nullishCoalesce((u.parseAs==="auto"?_(f.headers.get("Content-Type")):u.parseAs), () => ("json"));if(f.status===204||f.headers.get("Content-Length")==="0"){let g;switch(h){case"arrayBuffer":case"blob":case"text":g=await f[h]();break;case"formData":g=new FormData;break;case"stream":g=f.body;break;default:g={};break}return u.responseStyle==="data"?g:{data:g,...T}}let E;switch(h){case"arrayBuffer":case"blob":case"formData":case"text":E=await f[h]();break;case"json":{let g=await f.text();E=g?JSON.parse(g):{};break}case"stream":return u.responseStyle==="data"?f.body:{data:f.body,...T}}return h==="json"&&(u.responseValidator&&await u.responseValidator(E),u.responseTransformer&&(E=await u.responseTransformer(E))),u.responseStyle==="data"?E:{data:E,...T}}let x=await f.text(),j;try{j=JSON.parse(x)}catch (e4){}throw _nullishCoalesce(j, () => (x))}catch(u){let y=u;for(let R of i.error.fns)R&&(y=await R(y,f,O,c));if(y=y||{},d)throw y;return b==="data"?void 0:{error:y,request:O,response:f}}},s=c=>d=>o({...d,method:c}),a=c=>async d=>{let{opts:b,url:O}=await l(d);return W({...b,body:b.body,method:c,onRequest:async(f,u)=>{let y=new Request(f,u);for(let R of i.request.fns)R&&(y=await R(y,b));return y},serializedBody:L(b),url:O})};return{buildUrl:c=>U({...r,...c}),connect:s("CONNECT"),delete:s("DELETE"),get:s("GET"),getConfig:t,head:s("HEAD"),interceptors:i,options:s("OPTIONS"),patch:s("PATCH"),post:s("POST"),put:s("PUT"),request:o,setConfig:n,sse:{connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),head:a("HEAD"),options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),trace:a("TRACE")},trace:s("TRACE")}};var p=K(k({baseUrl:"https://api.ideal-postcodes.co.uk/v1",throwOnError:!0}));var Pe=e=>(_nullishCoalesce(e.client, () => (p))).get({querySerializer:{parameters:{dataset:{array:{explode:!1}}}},url:"/postcodes/{postcode}",...e}),ve= exports.e =e=>(_nullishCoalesce(e.client, () => (p))).get({url:"/keys/{key}",...e}),je= exports.f =e=>(_nullishCoalesce(e.client, () => (p))).get({url:"/keys/{key}/details",...e}),Le= exports.g =e=>(_nullishCoalesce(e.client, () => (p))).put({url:"/keys/{key}/details",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ue= exports.h =e=>(_nullishCoalesce(e.client, () => (p))).get({url:"/keys/{key}/usage",...e}),Ie= exports.i =e=>(_nullishCoalesce(e.client, () => (p))).get({url:"/keys/{key}/lookups",...e}),Ke= exports.j =e=>(_nullishCoalesce(e.client, () => (p))).post({url:"/cleanse/addresses",...e,headers:{"Content-Type":"application/json",...e.headers}}),Be= exports.k =e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _19 => _19.client]), () => (p))).get({querySerializer:{parameters:{dataset:{array:{explode:!1}}}},url:"/autocomplete/addresses",...e}),Ne= exports.l =e=>(_nullishCoalesce(e.client, () => (p))).get({url:"/autocomplete/addresses/{address}/gbr",...e}),$e= exports.m =e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _20 => _20.client]), () => (p))).get({querySerializer:{parameters:{dataset:{array:{explode:!1}}}},url:"/addresses",...e}),Ve= exports.n =e=>(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _21 => _21.client]), () => (p))).get({url:"/places",...e}),He= exports.o =e=>(_nullishCoalesce(e.client, () => (p))).get({url:"/places/{place}",...e}),Fe= exports.p =e=>(_nullishCoalesce(e.client, () => (p))).get({url:"/keys/{key}/licensees",...e}),We= exports.q =e=>(_nullishCoalesce(e.client, () => (p))).post({url:"/keys/{key}/licensees",...e,headers:{"Content-Type":"application/json",...e.headers}}),Qe= exports.r =e=>(_nullishCoalesce(e.client, () => (p))).delete({url:"/keys/{key}/licensees/{licensee}",...e}),Me= exports.s =e=>(_nullishCoalesce(e.client, () => (p))).get({url:"/keys/{key}/licensees/{licensee}",...e}),Je= exports.t =e=>(_nullishCoalesce(e.client, () => (p))).put({url:"/keys/{key}/licensees/{licensee}",...e,headers:{"Content-Type":"application/json",...e.headers}}),_e= exports.u =e=>(_nullishCoalesce(e.client, () => (p))).post({url:"/keys/{key}/licensees/{licensee}/regenerate-key",...e}),Ge= exports.v =e=>(_nullishCoalesce(e.client, () => (p))).get({url:"/keys/{key}/configs",...e}),Xe= exports.w =e=>(_nullishCoalesce(e.client, () => (p))).post({url:"/keys/{key}/configs",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ye= exports.x =e=>(_nullishCoalesce(e.client, () => (p))).delete({url:"/keys/{key}/configs/{config}",...e}),Ze= exports.y =e=>(_nullishCoalesce(e.client, () => (p))).get({url:"/keys/{key}/configs/{config}",...e}),er= exports.z =e=>(_nullishCoalesce(e.client, () => (p))).post({url:"/keys/{key}/configs/{config}",...e,headers:{"Content-Type":"application/json",...e.headers}}),rr= exports.A =e=>(_nullishCoalesce(e.client, () => (p))).get({url:"/emails",...e}),tr= exports.B =e=>(_nullishCoalesce(e.client, () => (p))).get({url:"/phone_numbers",...e});exports.a = k; exports.b = K; exports.c = p; exports.d = Pe; exports.e = ve; exports.f = je; exports.g = Le; exports.h = Ue; exports.i = Ie; exports.j = Ke; exports.k = Be; exports.l = Ne; exports.m = $e; exports.n = Ve; exports.o = He; exports.p = Fe; exports.q = We; exports.r = Qe; exports.s = Me; exports.t = Je; exports.u = _e; exports.v = Ge; exports.w = Xe; exports.x = Ye; exports.y = Ze; exports.z = er; exports.A = rr; exports.B = tr;
|