postnl-client 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.
- package/dist/index.cjs +23 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +91 -94
- package/dist/index.d.ts +91 -94
- package/dist/index.js +24 -12
- package/dist/index.js.map +1 -1
- package/package.json +14 -3
package/dist/index.d.ts
CHANGED
|
@@ -1432,12 +1432,12 @@ declare const locationSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1432
1432
|
Remark?: string | undefined;
|
|
1433
1433
|
}>, {
|
|
1434
1434
|
city?: string;
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1435
|
+
countryCode?: string;
|
|
1436
|
+
houseNumber?: number;
|
|
1437
|
+
houseNumberExtension?: string;
|
|
1438
1438
|
remark?: string;
|
|
1439
1439
|
street?: string;
|
|
1440
|
-
|
|
1440
|
+
postalCode?: string;
|
|
1441
1441
|
}, {
|
|
1442
1442
|
HouseNr?: unknown;
|
|
1443
1443
|
Zipcode?: string | undefined;
|
|
@@ -1520,12 +1520,12 @@ declare const locationSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1520
1520
|
} | undefined;
|
|
1521
1521
|
Address?: {
|
|
1522
1522
|
city?: string;
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1523
|
+
countryCode?: string;
|
|
1524
|
+
houseNumber?: number;
|
|
1525
|
+
houseNumberExtension?: string;
|
|
1526
1526
|
remark?: string;
|
|
1527
1527
|
street?: string;
|
|
1528
|
-
|
|
1528
|
+
postalCode?: string;
|
|
1529
1529
|
} | undefined;
|
|
1530
1530
|
OpeningHours?: {
|
|
1531
1531
|
monday?: string;
|
|
@@ -1577,12 +1577,12 @@ declare const locationSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1577
1577
|
}>, {
|
|
1578
1578
|
address?: {
|
|
1579
1579
|
city?: string;
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1580
|
+
countryCode?: string;
|
|
1581
|
+
houseNumber?: number;
|
|
1582
|
+
houseNumberExtension?: string;
|
|
1583
1583
|
remark?: string;
|
|
1584
1584
|
street?: string;
|
|
1585
|
-
|
|
1585
|
+
postalCode?: string;
|
|
1586
1586
|
};
|
|
1587
1587
|
deliveryOptions?: string[];
|
|
1588
1588
|
distance?: number;
|
|
@@ -1667,12 +1667,12 @@ declare const locationsResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1667
1667
|
Remark?: string | undefined;
|
|
1668
1668
|
}>, {
|
|
1669
1669
|
city?: string;
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1670
|
+
countryCode?: string;
|
|
1671
|
+
houseNumber?: number;
|
|
1672
|
+
houseNumberExtension?: string;
|
|
1673
1673
|
remark?: string;
|
|
1674
1674
|
street?: string;
|
|
1675
|
-
|
|
1675
|
+
postalCode?: string;
|
|
1676
1676
|
}, {
|
|
1677
1677
|
HouseNr?: unknown;
|
|
1678
1678
|
Zipcode?: string | undefined;
|
|
@@ -1755,12 +1755,12 @@ declare const locationsResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1755
1755
|
} | undefined;
|
|
1756
1756
|
Address?: {
|
|
1757
1757
|
city?: string;
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1758
|
+
countryCode?: string;
|
|
1759
|
+
houseNumber?: number;
|
|
1760
|
+
houseNumberExtension?: string;
|
|
1761
1761
|
remark?: string;
|
|
1762
1762
|
street?: string;
|
|
1763
|
-
|
|
1763
|
+
postalCode?: string;
|
|
1764
1764
|
} | undefined;
|
|
1765
1765
|
OpeningHours?: {
|
|
1766
1766
|
monday?: string;
|
|
@@ -1812,12 +1812,12 @@ declare const locationsResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1812
1812
|
}>, {
|
|
1813
1813
|
address?: {
|
|
1814
1814
|
city?: string;
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1815
|
+
countryCode?: string;
|
|
1816
|
+
houseNumber?: number;
|
|
1817
|
+
houseNumberExtension?: string;
|
|
1818
1818
|
remark?: string;
|
|
1819
1819
|
street?: string;
|
|
1820
|
-
|
|
1820
|
+
postalCode?: string;
|
|
1821
1821
|
};
|
|
1822
1822
|
deliveryOptions?: string[];
|
|
1823
1823
|
distance?: number;
|
|
@@ -1874,12 +1874,12 @@ declare const locationsResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1874
1874
|
}>, "many">, {
|
|
1875
1875
|
address?: {
|
|
1876
1876
|
city?: string;
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1877
|
+
countryCode?: string;
|
|
1878
|
+
houseNumber?: number;
|
|
1879
|
+
houseNumberExtension?: string;
|
|
1880
1880
|
remark?: string;
|
|
1881
1881
|
street?: string;
|
|
1882
|
-
|
|
1882
|
+
postalCode?: string;
|
|
1883
1883
|
};
|
|
1884
1884
|
deliveryOptions?: string[];
|
|
1885
1885
|
distance?: number;
|
|
@@ -1907,12 +1907,12 @@ declare const locationsResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1907
1907
|
ResponseLocation: {
|
|
1908
1908
|
address?: {
|
|
1909
1909
|
city?: string;
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1910
|
+
countryCode?: string;
|
|
1911
|
+
houseNumber?: number;
|
|
1912
|
+
houseNumberExtension?: string;
|
|
1913
1913
|
remark?: string;
|
|
1914
1914
|
street?: string;
|
|
1915
|
-
|
|
1915
|
+
postalCode?: string;
|
|
1916
1916
|
};
|
|
1917
1917
|
deliveryOptions?: string[];
|
|
1918
1918
|
distance?: number;
|
|
@@ -1941,12 +1941,12 @@ declare const locationsResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1941
1941
|
}>>, {
|
|
1942
1942
|
address?: {
|
|
1943
1943
|
city?: string;
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1944
|
+
countryCode?: string;
|
|
1945
|
+
houseNumber?: number;
|
|
1946
|
+
houseNumberExtension?: string;
|
|
1947
1947
|
remark?: string;
|
|
1948
1948
|
street?: string;
|
|
1949
|
-
|
|
1949
|
+
postalCode?: string;
|
|
1950
1950
|
};
|
|
1951
1951
|
deliveryOptions?: string[];
|
|
1952
1952
|
distance?: number;
|
|
@@ -1976,12 +1976,12 @@ declare const locationsResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1976
1976
|
GetLocationsResult: {
|
|
1977
1977
|
address?: {
|
|
1978
1978
|
city?: string;
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1979
|
+
countryCode?: string;
|
|
1980
|
+
houseNumber?: number;
|
|
1981
|
+
houseNumberExtension?: string;
|
|
1982
1982
|
remark?: string;
|
|
1983
1983
|
street?: string;
|
|
1984
|
-
|
|
1984
|
+
postalCode?: string;
|
|
1985
1985
|
};
|
|
1986
1986
|
deliveryOptions?: string[];
|
|
1987
1987
|
distance?: number;
|
|
@@ -2013,12 +2013,12 @@ declare const locationsResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2013
2013
|
locations: {
|
|
2014
2014
|
address?: {
|
|
2015
2015
|
city?: string;
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2016
|
+
countryCode?: string;
|
|
2017
|
+
houseNumber?: number;
|
|
2018
|
+
houseNumberExtension?: string;
|
|
2019
2019
|
remark?: string;
|
|
2020
2020
|
street?: string;
|
|
2021
|
-
|
|
2021
|
+
postalCode?: string;
|
|
2022
2022
|
};
|
|
2023
2023
|
deliveryOptions?: string[];
|
|
2024
2024
|
distance?: number;
|
|
@@ -2077,12 +2077,12 @@ declare const locationLookupResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2077
2077
|
Remark?: string | undefined;
|
|
2078
2078
|
}>, {
|
|
2079
2079
|
city?: string;
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2080
|
+
countryCode?: string;
|
|
2081
|
+
houseNumber?: number;
|
|
2082
|
+
houseNumberExtension?: string;
|
|
2083
2083
|
remark?: string;
|
|
2084
2084
|
street?: string;
|
|
2085
|
-
|
|
2085
|
+
postalCode?: string;
|
|
2086
2086
|
}, {
|
|
2087
2087
|
HouseNr?: unknown;
|
|
2088
2088
|
Zipcode?: string | undefined;
|
|
@@ -2165,12 +2165,12 @@ declare const locationLookupResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2165
2165
|
} | undefined;
|
|
2166
2166
|
Address?: {
|
|
2167
2167
|
city?: string;
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2168
|
+
countryCode?: string;
|
|
2169
|
+
houseNumber?: number;
|
|
2170
|
+
houseNumberExtension?: string;
|
|
2171
2171
|
remark?: string;
|
|
2172
2172
|
street?: string;
|
|
2173
|
-
|
|
2173
|
+
postalCode?: string;
|
|
2174
2174
|
} | undefined;
|
|
2175
2175
|
OpeningHours?: {
|
|
2176
2176
|
monday?: string;
|
|
@@ -2222,12 +2222,12 @@ declare const locationLookupResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2222
2222
|
}>, {
|
|
2223
2223
|
address?: {
|
|
2224
2224
|
city?: string;
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2225
|
+
countryCode?: string;
|
|
2226
|
+
houseNumber?: number;
|
|
2227
|
+
houseNumberExtension?: string;
|
|
2228
2228
|
remark?: string;
|
|
2229
2229
|
street?: string;
|
|
2230
|
-
|
|
2230
|
+
postalCode?: string;
|
|
2231
2231
|
};
|
|
2232
2232
|
deliveryOptions?: string[];
|
|
2233
2233
|
distance?: number;
|
|
@@ -2286,12 +2286,12 @@ declare const locationLookupResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2286
2286
|
ResponseLocation?: {
|
|
2287
2287
|
address?: {
|
|
2288
2288
|
city?: string;
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2289
|
+
countryCode?: string;
|
|
2290
|
+
houseNumber?: number;
|
|
2291
|
+
houseNumberExtension?: string;
|
|
2292
2292
|
remark?: string;
|
|
2293
2293
|
street?: string;
|
|
2294
|
-
|
|
2294
|
+
postalCode?: string;
|
|
2295
2295
|
};
|
|
2296
2296
|
deliveryOptions?: string[];
|
|
2297
2297
|
distance?: number;
|
|
@@ -2351,12 +2351,12 @@ declare const locationLookupResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2351
2351
|
}>>, {
|
|
2352
2352
|
address?: {
|
|
2353
2353
|
city?: string;
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2354
|
+
countryCode?: string;
|
|
2355
|
+
houseNumber?: number;
|
|
2356
|
+
houseNumberExtension?: string;
|
|
2357
2357
|
remark?: string;
|
|
2358
2358
|
street?: string;
|
|
2359
|
-
|
|
2359
|
+
postalCode?: string;
|
|
2360
2360
|
};
|
|
2361
2361
|
deliveryOptions?: string[];
|
|
2362
2362
|
distance?: number;
|
|
@@ -2417,12 +2417,12 @@ declare const locationLookupResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2417
2417
|
GetLocationsResult?: {
|
|
2418
2418
|
address?: {
|
|
2419
2419
|
city?: string;
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2420
|
+
countryCode?: string;
|
|
2421
|
+
houseNumber?: number;
|
|
2422
|
+
houseNumberExtension?: string;
|
|
2423
2423
|
remark?: string;
|
|
2424
2424
|
street?: string;
|
|
2425
|
-
|
|
2425
|
+
postalCode?: string;
|
|
2426
2426
|
};
|
|
2427
2427
|
deliveryOptions?: string[];
|
|
2428
2428
|
distance?: number;
|
|
@@ -2485,12 +2485,12 @@ declare const locationLookupResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2485
2485
|
location?: {
|
|
2486
2486
|
address?: {
|
|
2487
2487
|
city?: string;
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2488
|
+
countryCode?: string;
|
|
2489
|
+
houseNumber?: number;
|
|
2490
|
+
houseNumberExtension?: string;
|
|
2491
2491
|
remark?: string;
|
|
2492
2492
|
street?: string;
|
|
2493
|
-
|
|
2493
|
+
postalCode?: string;
|
|
2494
2494
|
};
|
|
2495
2495
|
deliveryOptions?: string[];
|
|
2496
2496
|
distance?: number;
|
|
@@ -3169,7 +3169,7 @@ declare const shipmentV4RequestSchema: z.ZodObject<{
|
|
|
3169
3169
|
returnBarcode: z.ZodOptional<z.ZodString>;
|
|
3170
3170
|
}, "strip", z.ZodTypeAny, {
|
|
3171
3171
|
labelType?: string | undefined;
|
|
3172
|
-
returnPeriod?:
|
|
3172
|
+
returnPeriod?: 200 | 100 | 35 | 365 | undefined;
|
|
3173
3173
|
returnAddress?: {
|
|
3174
3174
|
countryIso: string;
|
|
3175
3175
|
city?: string | undefined;
|
|
@@ -3191,7 +3191,7 @@ declare const shipmentV4RequestSchema: z.ZodObject<{
|
|
|
3191
3191
|
returnBarcode?: string | undefined;
|
|
3192
3192
|
}, {
|
|
3193
3193
|
labelType?: string | undefined;
|
|
3194
|
-
returnPeriod?:
|
|
3194
|
+
returnPeriod?: 200 | 100 | 35 | 365 | undefined;
|
|
3195
3195
|
returnAddress?: {
|
|
3196
3196
|
countryIso: string;
|
|
3197
3197
|
city?: string | undefined;
|
|
@@ -3561,7 +3561,7 @@ declare const shipmentV4RequestSchema: z.ZodObject<{
|
|
|
3561
3561
|
} | undefined;
|
|
3562
3562
|
returnOptions?: {
|
|
3563
3563
|
labelType?: string | undefined;
|
|
3564
|
-
returnPeriod?:
|
|
3564
|
+
returnPeriod?: 200 | 100 | 35 | 365 | undefined;
|
|
3565
3565
|
returnAddress?: {
|
|
3566
3566
|
countryIso: string;
|
|
3567
3567
|
city?: string | undefined;
|
|
@@ -3743,7 +3743,7 @@ declare const shipmentV4RequestSchema: z.ZodObject<{
|
|
|
3743
3743
|
} | undefined;
|
|
3744
3744
|
returnOptions?: {
|
|
3745
3745
|
labelType?: string | undefined;
|
|
3746
|
-
returnPeriod?:
|
|
3746
|
+
returnPeriod?: 200 | 100 | 35 | 365 | undefined;
|
|
3747
3747
|
returnAddress?: {
|
|
3748
3748
|
countryIso: string;
|
|
3749
3749
|
city?: string | undefined;
|
|
@@ -4402,7 +4402,7 @@ declare const labellingV4RequestSchema: z.ZodObject<{
|
|
|
4402
4402
|
returnBarcode: z.ZodOptional<z.ZodString>;
|
|
4403
4403
|
}, "strip", z.ZodTypeAny, {
|
|
4404
4404
|
labelType?: string | undefined;
|
|
4405
|
-
returnPeriod?:
|
|
4405
|
+
returnPeriod?: 200 | 100 | 35 | 365 | undefined;
|
|
4406
4406
|
returnAddress?: {
|
|
4407
4407
|
countryIso: string;
|
|
4408
4408
|
city?: string | undefined;
|
|
@@ -4424,7 +4424,7 @@ declare const labellingV4RequestSchema: z.ZodObject<{
|
|
|
4424
4424
|
returnBarcode?: string | undefined;
|
|
4425
4425
|
}, {
|
|
4426
4426
|
labelType?: string | undefined;
|
|
4427
|
-
returnPeriod?:
|
|
4427
|
+
returnPeriod?: 200 | 100 | 35 | 365 | undefined;
|
|
4428
4428
|
returnAddress?: {
|
|
4429
4429
|
countryIso: string;
|
|
4430
4430
|
city?: string | undefined;
|
|
@@ -4794,7 +4794,7 @@ declare const labellingV4RequestSchema: z.ZodObject<{
|
|
|
4794
4794
|
} | undefined;
|
|
4795
4795
|
returnOptions?: {
|
|
4796
4796
|
labelType?: string | undefined;
|
|
4797
|
-
returnPeriod?:
|
|
4797
|
+
returnPeriod?: 200 | 100 | 35 | 365 | undefined;
|
|
4798
4798
|
returnAddress?: {
|
|
4799
4799
|
countryIso: string;
|
|
4800
4800
|
city?: string | undefined;
|
|
@@ -4976,7 +4976,7 @@ declare const labellingV4RequestSchema: z.ZodObject<{
|
|
|
4976
4976
|
} | undefined;
|
|
4977
4977
|
returnOptions?: {
|
|
4978
4978
|
labelType?: string | undefined;
|
|
4979
|
-
returnPeriod?:
|
|
4979
|
+
returnPeriod?: 200 | 100 | 35 | 365 | undefined;
|
|
4980
4980
|
returnAddress?: {
|
|
4981
4981
|
countryIso: string;
|
|
4982
4982
|
city?: string | undefined;
|
|
@@ -5616,7 +5616,7 @@ declare const confirmV4RequestSchema: z.ZodObject<{
|
|
|
5616
5616
|
returnBarcode: z.ZodOptional<z.ZodString>;
|
|
5617
5617
|
}, "strip", z.ZodTypeAny, {
|
|
5618
5618
|
labelType?: string | undefined;
|
|
5619
|
-
returnPeriod?:
|
|
5619
|
+
returnPeriod?: 200 | 100 | 35 | 365 | undefined;
|
|
5620
5620
|
returnAddress?: {
|
|
5621
5621
|
countryIso: string;
|
|
5622
5622
|
city?: string | undefined;
|
|
@@ -5638,7 +5638,7 @@ declare const confirmV4RequestSchema: z.ZodObject<{
|
|
|
5638
5638
|
returnBarcode?: string | undefined;
|
|
5639
5639
|
}, {
|
|
5640
5640
|
labelType?: string | undefined;
|
|
5641
|
-
returnPeriod?:
|
|
5641
|
+
returnPeriod?: 200 | 100 | 35 | 365 | undefined;
|
|
5642
5642
|
returnAddress?: {
|
|
5643
5643
|
countryIso: string;
|
|
5644
5644
|
city?: string | undefined;
|
|
@@ -6001,7 +6001,7 @@ declare const confirmV4RequestSchema: z.ZodObject<{
|
|
|
6001
6001
|
} | undefined;
|
|
6002
6002
|
returnOptions?: {
|
|
6003
6003
|
labelType?: string | undefined;
|
|
6004
|
-
returnPeriod?:
|
|
6004
|
+
returnPeriod?: 200 | 100 | 35 | 365 | undefined;
|
|
6005
6005
|
returnAddress?: {
|
|
6006
6006
|
countryIso: string;
|
|
6007
6007
|
city?: string | undefined;
|
|
@@ -6176,7 +6176,7 @@ declare const confirmV4RequestSchema: z.ZodObject<{
|
|
|
6176
6176
|
} | undefined;
|
|
6177
6177
|
returnOptions?: {
|
|
6178
6178
|
labelType?: string | undefined;
|
|
6179
|
-
returnPeriod?:
|
|
6179
|
+
returnPeriod?: 200 | 100 | 35 | 365 | undefined;
|
|
6180
6180
|
returnAddress?: {
|
|
6181
6181
|
countryIso: string;
|
|
6182
6182
|
city?: string | undefined;
|
|
@@ -10535,7 +10535,7 @@ declare const timeframeResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
10535
10535
|
Timeframe: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
10536
10536
|
Date: z.ZodEffects<z.ZodOptional<z.ZodString>, Date | undefined, string | undefined>;
|
|
10537
10537
|
Timeframes: z.ZodEffects<z.ZodOptional<z.ZodObject<{
|
|
10538
|
-
|
|
10538
|
+
TimeframeTimeFrame: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
10539
10539
|
From: z.ZodOptional<z.ZodString>;
|
|
10540
10540
|
To: z.ZodOptional<z.ZodString>;
|
|
10541
10541
|
Options: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
|
|
@@ -10597,7 +10597,7 @@ declare const timeframeResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
10597
10597
|
};
|
|
10598
10598
|
}[], unknown>;
|
|
10599
10599
|
}, "strip", z.ZodTypeAny, {
|
|
10600
|
-
|
|
10600
|
+
TimeframeTimeFrame: {
|
|
10601
10601
|
from?: string;
|
|
10602
10602
|
to?: string;
|
|
10603
10603
|
options?: string[];
|
|
@@ -10607,7 +10607,7 @@ declare const timeframeResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
10607
10607
|
};
|
|
10608
10608
|
}[];
|
|
10609
10609
|
}, {
|
|
10610
|
-
|
|
10610
|
+
TimeframeTimeFrame?: unknown;
|
|
10611
10611
|
}>>, {
|
|
10612
10612
|
from?: string;
|
|
10613
10613
|
to?: string;
|
|
@@ -10617,7 +10617,7 @@ declare const timeframeResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
10617
10617
|
description?: string;
|
|
10618
10618
|
};
|
|
10619
10619
|
}[], {
|
|
10620
|
-
|
|
10620
|
+
TimeframeTimeFrame?: unknown;
|
|
10621
10621
|
} | undefined>;
|
|
10622
10622
|
}, "strip", z.ZodTypeAny, {
|
|
10623
10623
|
Timeframes: {
|
|
@@ -10633,7 +10633,7 @@ declare const timeframeResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
10633
10633
|
}, {
|
|
10634
10634
|
Date?: string | undefined;
|
|
10635
10635
|
Timeframes?: {
|
|
10636
|
-
|
|
10636
|
+
TimeframeTimeFrame?: unknown;
|
|
10637
10637
|
} | undefined;
|
|
10638
10638
|
}>, {
|
|
10639
10639
|
timeframes: {
|
|
@@ -10649,7 +10649,7 @@ declare const timeframeResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
10649
10649
|
}, {
|
|
10650
10650
|
Date?: string | undefined;
|
|
10651
10651
|
Timeframes?: {
|
|
10652
|
-
|
|
10652
|
+
TimeframeTimeFrame?: unknown;
|
|
10653
10653
|
} | undefined;
|
|
10654
10654
|
}>, "many">, {
|
|
10655
10655
|
timeframes: {
|
|
@@ -12738,7 +12738,6 @@ declare class PostNLBadRequestError extends PostNLApiError {
|
|
|
12738
12738
|
declare class PostNLServerError extends PostNLApiError {
|
|
12739
12739
|
name: string;
|
|
12740
12740
|
}
|
|
12741
|
-
declare function parseError(status: number, body: unknown, headers?: Record<string, string>): PostNLApiError;
|
|
12742
12741
|
|
|
12743
12742
|
declare const ProductCode: {
|
|
12744
12743
|
readonly domesticParcel: "3085";
|
|
@@ -12747,6 +12746,4 @@ declare const ProductCode: {
|
|
|
12747
12746
|
};
|
|
12748
12747
|
type ProductCodeValue = (typeof ProductCode)[keyof typeof ProductCode];
|
|
12749
12748
|
|
|
12750
|
-
|
|
12751
|
-
|
|
12752
|
-
export { type AddressCheckInput, AddressResource, AddressType, AssociatedDocumentType, type BarcodeLegacyInput, BarcodeResource, BarcodeType, type BarcodeV4Request, type BarcodeV4Response, Bundle, type CheckoutAddressInput, CheckoutCutOffDay, type CheckoutCutOffTimeInput, CheckoutCutOffType, CheckoutOption, type CheckoutRequestInput, CheckoutResource, type CheckoutResponse, CheckoutWarningOption, type ConfirmV4Request, type ConfirmingRequest, type ConfirmingResponse, ConsolidationMode, CountryCode, Currency, type DecodedLabel, DeliveryConfirmation, type DeliveryDateCalculateInput, DeliveryDateResource, type DeliveryDateResponse, DeliverydateOption, Duration, GuaranteedBefore, IGNORED_LOCATION_OPTIONS, type LabelLegacyOptions, LabelType, LabellingCurrency, type LabellingRequest, type LabellingResponse, type LabellingV4Request, Language, type Location, type LocationAreaInput, LocationDeliveryOption, type LocationLookupInput, type LocationLookupResponse, type LocationNearestByGeocodeInput, type LocationNearestInput, LocationResource, type LocationsResponse, MergeType, MinimalAgeCheck, NetworkType, OriginCountryCode, OutputType, PageOrientation, Positioning, PostNLApiError, PostNLAuthError, PostNLBadRequestError, PostNLClient, type PostNLClientOptions, PostNLError, PostNLMethodNotAllowedError, PostNLRateLimitError, PostNLServerError, PostNLTimeoutError, PostNLValidationError, type PostalcodeCheckAddress, PrintMethod, ProductCode, type ProductCodeValue, ReceiverType, Resolution, type ReturnGenerateRequest, ReturnOutputType, ReturnPeriod, ReturnPeriodV4, ReturnResource, ReturnShipmentTypeV4, type SentDateInput, type SentDateResponse, Service, type ShipmentPostResponse, ShipmentTypeLegacy, ShipmentTypeV4, type ShipmentV4Request, ShippingResource, type ShippingStatusResponse, type SignatureImage, type SignatureResponse, StatusLanguage, SustainabilityCode, type TimeframeGetInput, TimeframeOption, TimeframeResource, type TimeframeResponse, type TrackingByReferenceOptions, type TrackingOptions, TrackingResource, type UpdatedShipment, type UpdatedShipmentsOptions, type UpdatedShipmentsResponse, decodeBase64, labelContentType, parseError, toDecodedLabel, version };
|
|
12749
|
+
export { type AddressCheckInput, AddressResource, AddressType, AssociatedDocumentType, type BarcodeLegacyInput, BarcodeResource, BarcodeType, type BarcodeV4Request, type BarcodeV4Response, Bundle, type CheckoutAddressInput, CheckoutCutOffDay, type CheckoutCutOffTimeInput, CheckoutCutOffType, CheckoutOption, type CheckoutRequestInput, CheckoutResource, type CheckoutResponse, CheckoutWarningOption, type ConfirmV4Request, type ConfirmingRequest, type ConfirmingResponse, ConsolidationMode, CountryCode, Currency, type DecodedLabel, DeliveryConfirmation, type DeliveryDateCalculateInput, DeliveryDateResource, type DeliveryDateResponse, DeliverydateOption, Duration, GuaranteedBefore, IGNORED_LOCATION_OPTIONS, type LabelLegacyOptions, LabelType, LabellingCurrency, type LabellingRequest, type LabellingResponse, type LabellingV4Request, Language, type Location, type LocationAreaInput, LocationDeliveryOption, type LocationLookupInput, type LocationLookupResponse, type LocationNearestByGeocodeInput, type LocationNearestInput, LocationResource, type LocationsResponse, MergeType, MinimalAgeCheck, NetworkType, OriginCountryCode, OutputType, PageOrientation, Positioning, PostNLApiError, PostNLAuthError, PostNLBadRequestError, PostNLClient, type PostNLClientOptions, PostNLError, PostNLMethodNotAllowedError, PostNLRateLimitError, PostNLServerError, PostNLTimeoutError, PostNLValidationError, type PostalcodeCheckAddress, PrintMethod, ProductCode, type ProductCodeValue, ReceiverType, Resolution, type ReturnGenerateRequest, ReturnOutputType, ReturnPeriod, ReturnPeriodV4, ReturnResource, ReturnShipmentTypeV4, type SentDateInput, type SentDateResponse, Service, type ShipmentPostResponse, ShipmentTypeLegacy, ShipmentTypeV4, type ShipmentV4Request, ShippingResource, type ShippingStatusResponse, type SignatureImage, type SignatureResponse, StatusLanguage, SustainabilityCode, type TimeframeGetInput, TimeframeOption, TimeframeResource, type TimeframeResponse, type TrackingByReferenceOptions, type TrackingOptions, TrackingResource, type UpdatedShipment, type UpdatedShipmentsOptions, type UpdatedShipmentsResponse, decodeBase64, labelContentType, toDecodedLabel };
|
package/dist/index.js
CHANGED
|
@@ -87,12 +87,16 @@ function extract(body) {
|
|
|
87
87
|
detail: fault
|
|
88
88
|
};
|
|
89
89
|
const inv = b.Error;
|
|
90
|
-
if (inv
|
|
91
|
-
return {
|
|
90
|
+
if (inv && (inv.ErrorMessage || inv.ErrorDescription || inv.ErrorCode))
|
|
91
|
+
return {
|
|
92
|
+
message: inv.ErrorMessage ?? inv.ErrorDescription ?? "error",
|
|
93
|
+
code: inv.ErrorCode,
|
|
94
|
+
detail: b
|
|
95
|
+
};
|
|
92
96
|
const list = b.errors ?? b.Errors;
|
|
93
97
|
if (Array.isArray(list) && list.length) {
|
|
94
98
|
const f = list[0];
|
|
95
|
-
const msg = f.ErrorMsg ?? f.
|
|
99
|
+
const msg = f.ErrorMsg ?? f.Description ?? f.Error ?? f.title ?? f.detail ?? "error";
|
|
96
100
|
const code = f.ErrorNumber ?? f.Code ?? f.status;
|
|
97
101
|
return { message: String(msg), code: code != null ? String(code) : void 0, detail: list };
|
|
98
102
|
}
|
|
@@ -116,6 +120,15 @@ function parseError(status, body, headers) {
|
|
|
116
120
|
if (status === 400) return new PostNLBadRequestError(status, message, code, detail, body);
|
|
117
121
|
return new PostNLApiError(status, message, code, detail, body);
|
|
118
122
|
}
|
|
123
|
+
function inlineApiError(body) {
|
|
124
|
+
const b = body;
|
|
125
|
+
const err = b && typeof b === "object" ? b.Error : void 0;
|
|
126
|
+
if (err && typeof err === "object" && err.ErrorCode != null) {
|
|
127
|
+
const { message, code, detail } = extract(body);
|
|
128
|
+
return new PostNLApiError(200, message, code, detail, body);
|
|
129
|
+
}
|
|
130
|
+
return void 0;
|
|
131
|
+
}
|
|
119
132
|
|
|
120
133
|
// src/core/http.ts
|
|
121
134
|
var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
@@ -284,6 +297,8 @@ var BaseResource = class {
|
|
|
284
297
|
query: args.query,
|
|
285
298
|
body: ep.method === "GET" ? void 0 : body
|
|
286
299
|
});
|
|
300
|
+
const inline = inlineApiError(raw);
|
|
301
|
+
if (inline) throw inline;
|
|
287
302
|
const out = args.responseSchema.safeParse(raw);
|
|
288
303
|
if (!out.success) throw new PostNLValidationError("invalid response", out.error.issues);
|
|
289
304
|
return out.data;
|
|
@@ -785,12 +800,12 @@ var addressSchema = z.object({
|
|
|
785
800
|
}).transform(
|
|
786
801
|
(a) => stripUndefined({
|
|
787
802
|
city: a.City,
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
803
|
+
countryCode: a.Countrycode,
|
|
804
|
+
houseNumber: a.HouseNr,
|
|
805
|
+
houseNumberExtension: a.HouseNrExt,
|
|
791
806
|
remark: a.Remark,
|
|
792
807
|
street: a.Street,
|
|
793
|
-
|
|
808
|
+
postalCode: a.Zipcode
|
|
794
809
|
})
|
|
795
810
|
);
|
|
796
811
|
var day2 = pnlStringWrapped(z.string()).optional();
|
|
@@ -1568,7 +1583,7 @@ var timeframeTimeframeSchema = z.object({
|
|
|
1568
1583
|
);
|
|
1569
1584
|
var timeframeSchema2 = z.object({
|
|
1570
1585
|
Date: pnlDateField,
|
|
1571
|
-
Timeframes: z.object({
|
|
1586
|
+
Timeframes: z.object({ TimeframeTimeFrame: pnlArray(timeframeTimeframeSchema) }).optional().transform((t) => t?.TimeframeTimeFrame ?? [])
|
|
1572
1587
|
}).transform((t) => ({
|
|
1573
1588
|
...stripUndefined({ date: t.Date }),
|
|
1574
1589
|
timeframes: t.Timeframes
|
|
@@ -1943,9 +1958,6 @@ var ProductCode = {
|
|
|
1943
1958
|
easyReturn: "4910"
|
|
1944
1959
|
};
|
|
1945
1960
|
|
|
1946
|
-
|
|
1947
|
-
var version = "0.1.0";
|
|
1948
|
-
|
|
1949
|
-
export { AddressResource, AddressType, AssociatedDocumentType, BarcodeResource, BarcodeType, Bundle, CheckoutCutOffDay, CheckoutCutOffType, CheckoutOption, CheckoutResource, CheckoutWarningOption, ConsolidationMode, CountryCode, Currency, DeliveryConfirmation, DeliveryDateResource, DeliverydateOption, Duration, GuaranteedBefore, IGNORED_LOCATION_OPTIONS, LabelType, LabellingCurrency, Language, LocationDeliveryOption, LocationResource, MergeType, MinimalAgeCheck, NetworkType, OriginCountryCode, OutputType, PageOrientation, Positioning, PostNLApiError, PostNLAuthError, PostNLBadRequestError, PostNLClient, PostNLError, PostNLMethodNotAllowedError, PostNLRateLimitError, PostNLServerError, PostNLTimeoutError, PostNLValidationError, PrintMethod, ProductCode, ReceiverType, Resolution, ReturnOutputType, ReturnPeriod, ReturnPeriodV4, ReturnResource, ReturnShipmentTypeV4, Service, ShipmentTypeLegacy, ShipmentTypeV4, ShippingResource, StatusLanguage, SustainabilityCode, TimeframeOption, TimeframeResource, TrackingResource, decodeBase64, labelContentType, parseError, toDecodedLabel, version };
|
|
1961
|
+
export { AddressResource, AddressType, AssociatedDocumentType, BarcodeResource, BarcodeType, Bundle, CheckoutCutOffDay, CheckoutCutOffType, CheckoutOption, CheckoutResource, CheckoutWarningOption, ConsolidationMode, CountryCode, Currency, DeliveryConfirmation, DeliveryDateResource, DeliverydateOption, Duration, GuaranteedBefore, IGNORED_LOCATION_OPTIONS, LabelType, LabellingCurrency, Language, LocationDeliveryOption, LocationResource, MergeType, MinimalAgeCheck, NetworkType, OriginCountryCode, OutputType, PageOrientation, Positioning, PostNLApiError, PostNLAuthError, PostNLBadRequestError, PostNLClient, PostNLError, PostNLMethodNotAllowedError, PostNLRateLimitError, PostNLServerError, PostNLTimeoutError, PostNLValidationError, PrintMethod, ProductCode, ReceiverType, Resolution, ReturnOutputType, ReturnPeriod, ReturnPeriodV4, ReturnResource, ReturnShipmentTypeV4, Service, ShipmentTypeLegacy, ShipmentTypeV4, ShippingResource, StatusLanguage, SustainabilityCode, TimeframeOption, TimeframeResource, TrackingResource, decodeBase64, labelContentType, toDecodedLabel };
|
|
1950
1962
|
//# sourceMappingURL=index.js.map
|
|
1951
1963
|
//# sourceMappingURL=index.js.map
|