@uxf/smart-address 14.1.0 → 16.16.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/LICENSE +21 -0
- package/README.md +2 -0
- package/common/__tests__/create-loader.test.js +8 -8
- package/common/__tests__/load-address-options.test.js +11 -11
- package/common/__tests__/load-zip-options.test.js +8 -8
- package/common/__tests__/search-zip.test.js +8 -8
- package/common/__tests__/search.test.js +5 -5
- package/common/create-loader.d.ts +1 -1
- package/common/get-address-extended.d.ts +1 -1
- package/common/get-address-extended.js +2 -2
- package/common/get-address.d.ts +1 -1
- package/common/get-address.js +2 -2
- package/common/index.d.ts +1 -1
- package/common/index.js +1 -1
- package/common/load-address-options.d.ts +1 -1
- package/common/load-address-options.js +2 -2
- package/common/load-zip-options.d.ts +1 -1
- package/common/load-zip-options.js +2 -2
- package/common/search-zip.d.ts +1 -1
- package/common/search-zip.js +2 -2
- package/common/search.d.ts +1 -1
- package/common/search.js +2 -2
- package/package.json +4 -3
- package/v1/create-address-loader.d.ts +2 -2
- package/v1/create-address-loader.js +3 -3
- package/v1/create-zip-loader.d.ts +2 -2
- package/v1/create-zip-loader.js +3 -3
- package/v1/get-address-extended.d.ts +1 -1
- package/v1/get-address-extended.js +2 -2
- package/v1/get-address.d.ts +1 -1
- package/v1/get-address.js +2 -2
- package/v1/get-city-part.d.ts +1 -1
- package/v1/get-city-part.js +2 -2
- package/v1/get-city.d.ts +1 -1
- package/v1/get-city.js +2 -2
- package/v1/get-city.test.js +4 -4
- package/v1/get-momc.d.ts +1 -1
- package/v1/get-momc.js +2 -2
- package/v1/get-mop.d.ts +1 -1
- package/v1/get-mop.js +2 -2
- package/v1/get-street.d.ts +1 -1
- package/v1/get-street.js +2 -2
- package/v1/index.d.ts +23 -27
- package/v1/index.js +26 -26
- package/v1/load-address-options.d.ts +2 -2
- package/v1/load-address-options.js +2 -2
- package/v1/load-zip-options.d.ts +2 -2
- package/v1/load-zip-options.js +2 -2
- package/v1/search-zip.d.ts +1 -1
- package/v1/search-zip.js +2 -2
- package/v1/search.d.ts +1 -1
- package/v1/search.js +2 -2
- package/v1/types.d.ts +1 -1
- package/v1/types.js +1 -1
- package/v2/__tests__/get-building-addresses.test.js +4 -4
- package/v2/__tests__/search-city-part.test.js +8 -8
- package/v2/create-address-loader.d.ts +2 -2
- package/v2/create-address-loader.js +3 -3
- package/v2/create-zip-loader.d.ts +2 -2
- package/v2/create-zip-loader.js +3 -3
- package/v2/get-address-extended.d.ts +1 -1
- package/v2/get-address-extended.js +2 -2
- package/v2/get-address.d.ts +1 -1
- package/v2/get-address.js +2 -2
- package/v2/get-building-addresses.d.ts +1 -1
- package/v2/get-building-addresses.js +2 -2
- package/v2/index.d.ts +11 -11
- package/v2/index.js +11 -11
- package/v2/load-address-options.d.ts +2 -2
- package/v2/load-address-options.js +2 -2
- package/v2/load-zip-options.d.ts +2 -2
- package/v2/load-zip-options.js +2 -2
- package/v2/search-city-part.d.ts +1 -1
- package/v2/search-city-part.js +2 -2
- package/v2/search-zip.d.ts +1 -1
- package/v2/search-zip.js +2 -2
- package/v2/search.d.ts +1 -1
- package/v2/search.js +2 -2
- package/v2/types.d.ts +2 -2
- package/v2/types.js +1 -1
package/v1/index.d.ts
CHANGED
|
@@ -1,40 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
import { createAddressLoader } from "./create-address-loader.ts";
|
|
2
|
+
import { createZipLoader } from "./create-zip-loader.ts";
|
|
3
|
+
import { getCityPart } from "./get-city-part.ts";
|
|
4
|
+
import { getCity } from "./get-city.ts";
|
|
5
|
+
import { getMomc } from "./get-momc.ts";
|
|
6
|
+
import { getMop } from "./get-mop.ts";
|
|
7
|
+
import { getStreet } from "./get-street.ts";
|
|
8
|
+
export type { BuildingType, BuildingUsageType, ConstructionType, ElevatorType, GasConnectionType, HeatingType, Location, LocationExtended, ObjectType, ObjectTypeBasic, Point, SewerConnectionType, WaterConnectionType, } from "./types.ts";
|
|
2
9
|
export declare const SmartAddress: {
|
|
3
|
-
createAddressLoader:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
getLabel?: (address: import("./types").Location) => string;
|
|
13
|
-
}) => (term: string, options?: {
|
|
14
|
-
signal?: AbortSignal;
|
|
15
|
-
}) => Promise<import("./types").Option[]>;
|
|
16
|
-
getAddress: (id: number) => Promise<import("./types").Location>;
|
|
17
|
-
getAddressExtended: (id: number) => Promise<import("./types").LocationExtended>;
|
|
18
|
-
getCity: (id: number) => Promise<import("./types").Location>;
|
|
19
|
-
getCityPart: (id: number) => Promise<import("./types").Location>;
|
|
20
|
-
getMomc: (id: number) => Promise<import("./types").Location>;
|
|
21
|
-
getMop: (id: number) => Promise<import("./types").Location>;
|
|
22
|
-
getStreet: (id: number) => Promise<import("./types").Location>;
|
|
10
|
+
createAddressLoader: typeof createAddressLoader;
|
|
11
|
+
createZipLoader: typeof createZipLoader;
|
|
12
|
+
getAddress: (id: number) => Promise<import("./types.ts").Location>;
|
|
13
|
+
getAddressExtended: (id: number) => Promise<import("./types.ts").LocationExtended>;
|
|
14
|
+
getCity: typeof getCity;
|
|
15
|
+
getCityPart: typeof getCityPart;
|
|
16
|
+
getMomc: typeof getMomc;
|
|
17
|
+
getMop: typeof getMop;
|
|
18
|
+
getStreet: typeof getStreet;
|
|
23
19
|
loadAddressOptions: (params: {
|
|
24
20
|
term: string;
|
|
25
21
|
level: number;
|
|
26
22
|
limit?: number;
|
|
27
23
|
zip?: number;
|
|
28
24
|
address?: string;
|
|
29
|
-
getLabel?: (address: import("./types").Location) => string;
|
|
25
|
+
getLabel?: (address: import("./types.ts").Location) => string;
|
|
30
26
|
signal?: AbortSignal;
|
|
31
|
-
}) => Promise<import("./types").Option[]>;
|
|
27
|
+
}) => Promise<import("./types.ts").Option[]>;
|
|
32
28
|
loadZipOptions: (params: {
|
|
33
29
|
term: string;
|
|
34
30
|
limit?: number;
|
|
35
|
-
getLabel?: (address: import("./types").Location) => string;
|
|
31
|
+
getLabel?: (address: import("./types.ts").Location) => string;
|
|
36
32
|
signal?: AbortSignal;
|
|
37
|
-
}) => Promise<import("./types").Option[]>;
|
|
33
|
+
}) => Promise<import("./types.ts").Option[]>;
|
|
38
34
|
search: (props: {
|
|
39
35
|
term: string;
|
|
40
36
|
level: number;
|
|
@@ -42,8 +38,8 @@ export declare const SmartAddress: {
|
|
|
42
38
|
zip?: number;
|
|
43
39
|
address?: string;
|
|
44
40
|
signal?: AbortSignal;
|
|
45
|
-
}) => Promise<import("./types").Location[]>;
|
|
41
|
+
}) => Promise<import("./types.ts").Location[]>;
|
|
46
42
|
searchZip: (term: string, limit?: number, options?: {
|
|
47
43
|
signal?: AbortSignal;
|
|
48
|
-
}) => Promise<import("./types").Location[]>;
|
|
44
|
+
}) => Promise<import("./types.ts").Location[]>;
|
|
49
45
|
};
|
package/v1/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SmartAddress = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
4
|
+
const create_address_loader_ts_1 = require("./create-address-loader.js");
|
|
5
|
+
const create_zip_loader_ts_1 = require("./create-zip-loader.js");
|
|
6
|
+
const get_address_extended_ts_1 = require("./get-address-extended.js");
|
|
7
|
+
const get_address_ts_1 = require("./get-address.js");
|
|
8
|
+
const get_city_part_ts_1 = require("./get-city-part.js");
|
|
9
|
+
const get_city_ts_1 = require("./get-city.js");
|
|
10
|
+
const get_momc_ts_1 = require("./get-momc.js");
|
|
11
|
+
const get_mop_ts_1 = require("./get-mop.js");
|
|
12
|
+
const get_street_ts_1 = require("./get-street.js");
|
|
13
|
+
const load_address_options_ts_1 = require("./load-address-options.js");
|
|
14
|
+
const load_zip_options_ts_1 = require("./load-zip-options.js");
|
|
15
|
+
const search_zip_ts_1 = require("./search-zip.js");
|
|
16
|
+
const search_ts_1 = require("./search.js");
|
|
17
17
|
exports.SmartAddress = {
|
|
18
|
-
createAddressLoader:
|
|
19
|
-
createZipLoader:
|
|
20
|
-
getAddress:
|
|
21
|
-
getAddressExtended:
|
|
22
|
-
getCity:
|
|
23
|
-
getCityPart:
|
|
24
|
-
getMomc:
|
|
25
|
-
getMop:
|
|
26
|
-
getStreet:
|
|
27
|
-
loadAddressOptions:
|
|
28
|
-
loadZipOptions:
|
|
29
|
-
search:
|
|
30
|
-
searchZip:
|
|
18
|
+
createAddressLoader: create_address_loader_ts_1.createAddressLoader,
|
|
19
|
+
createZipLoader: create_zip_loader_ts_1.createZipLoader,
|
|
20
|
+
getAddress: get_address_ts_1.getAddress,
|
|
21
|
+
getAddressExtended: get_address_extended_ts_1.getAddressExtended,
|
|
22
|
+
getCity: get_city_ts_1.getCity,
|
|
23
|
+
getCityPart: get_city_part_ts_1.getCityPart,
|
|
24
|
+
getMomc: get_momc_ts_1.getMomc,
|
|
25
|
+
getMop: get_mop_ts_1.getMop,
|
|
26
|
+
getStreet: get_street_ts_1.getStreet,
|
|
27
|
+
loadAddressOptions: load_address_options_ts_1.loadAddressOptions,
|
|
28
|
+
loadZipOptions: load_zip_options_ts_1.loadZipOptions,
|
|
29
|
+
search: search_ts_1.search,
|
|
30
|
+
searchZip: search_zip_ts_1.searchZip,
|
|
31
31
|
};
|
|
@@ -4,6 +4,6 @@ export declare const loadAddressOptions: (params: {
|
|
|
4
4
|
limit?: number;
|
|
5
5
|
zip?: number;
|
|
6
6
|
address?: string;
|
|
7
|
-
getLabel?: (address: import("./types").Location) => string;
|
|
7
|
+
getLabel?: (address: import("./types.ts").Location) => string;
|
|
8
8
|
signal?: AbortSignal;
|
|
9
|
-
}) => Promise<import("./types").Option[]>;
|
|
9
|
+
}) => Promise<import("./types.ts").Option[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadAddressOptions = void 0;
|
|
4
|
-
const
|
|
5
|
-
exports.loadAddressOptions = (0,
|
|
4
|
+
const load_address_options_ts_1 = require("../common/load-address-options.js");
|
|
5
|
+
exports.loadAddressOptions = (0, load_address_options_ts_1.loadAddressOptionsGeneral)("/v1/search");
|
package/v1/load-zip-options.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const loadZipOptions: (params: {
|
|
2
2
|
term: string;
|
|
3
3
|
limit?: number;
|
|
4
|
-
getLabel?: (address: import("./types").Location) => string;
|
|
4
|
+
getLabel?: (address: import("./types.ts").Location) => string;
|
|
5
5
|
signal?: AbortSignal;
|
|
6
|
-
}) => Promise<import("./types").Option[]>;
|
|
6
|
+
}) => Promise<import("./types.ts").Option[]>;
|
package/v1/load-zip-options.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadZipOptions = void 0;
|
|
4
|
-
const
|
|
5
|
-
exports.loadZipOptions = (0,
|
|
4
|
+
const load_zip_options_ts_1 = require("../common/load-zip-options.js");
|
|
5
|
+
exports.loadZipOptions = (0, load_zip_options_ts_1.loadZipOptionsGeneral)("/v1/zip/search");
|
package/v1/search-zip.d.ts
CHANGED
package/v1/search-zip.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.searchZip = void 0;
|
|
4
|
-
const
|
|
5
|
-
exports.searchZip = (0,
|
|
4
|
+
const search_zip_ts_1 = require("../common/search-zip.js");
|
|
5
|
+
exports.searchZip = (0, search_zip_ts_1.searchZipGeneral)("/v1/zip/search");
|
package/v1/search.d.ts
CHANGED
package/v1/search.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.search = void 0;
|
|
4
|
-
const
|
|
5
|
-
exports.search = (0,
|
|
4
|
+
const search_ts_1 = require("../common/search.js");
|
|
5
|
+
exports.search = (0, search_ts_1.searchGeneral)("/v1/search");
|
package/v1/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../common/types";
|
|
1
|
+
export * from "../common/types.ts";
|
package/v1/types.js
CHANGED
|
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("../common/types"), exports);
|
|
17
|
+
__exportStar(require("../common/types.js"), exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
3
|
+
const config_ts_1 = require("../../config.js");
|
|
4
|
+
const get_building_addresses_ts_1 = require("../get-building-addresses.js");
|
|
5
5
|
global.fetch = jest.fn();
|
|
6
6
|
describe("getBuildingAddresses", () => {
|
|
7
7
|
beforeEach(() => {
|
|
@@ -42,8 +42,8 @@ describe("getBuildingAddresses", () => {
|
|
|
42
42
|
fetch.mockResolvedValue({
|
|
43
43
|
json: jest.fn().mockResolvedValue(mockLocations),
|
|
44
44
|
});
|
|
45
|
-
const result = await (0,
|
|
46
|
-
expect(fetch).toHaveBeenCalledWith(`${
|
|
45
|
+
const result = await (0, get_building_addresses_ts_1.getBuildingAddresses)(123);
|
|
46
|
+
expect(fetch).toHaveBeenCalledWith(`${config_ts_1.smartAddressUrl}/v2/address/123/building-addresses`);
|
|
47
47
|
expect(result).toEqual(mockLocations);
|
|
48
48
|
});
|
|
49
49
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
jest.mock("../../config", () => ({
|
|
3
|
+
const config_ts_1 = require("../../config.js");
|
|
4
|
+
const search_city_part_ts_1 = require("../search-city-part.js");
|
|
5
|
+
jest.mock("../../config.ts", () => ({
|
|
6
6
|
smartAddressUrl: "http://example.com",
|
|
7
7
|
}));
|
|
8
8
|
describe("searchCityPart", () => {
|
|
@@ -13,7 +13,7 @@ describe("searchCityPart", () => {
|
|
|
13
13
|
jest.resetAllMocks();
|
|
14
14
|
});
|
|
15
15
|
it("should return an empty array for empty input", async () => {
|
|
16
|
-
const result = await (0,
|
|
16
|
+
const result = await (0, search_city_part_ts_1.searchCityPart)("");
|
|
17
17
|
expect(result).toEqual([]);
|
|
18
18
|
});
|
|
19
19
|
it("should return an array of city parts for valid input", async () => {
|
|
@@ -30,9 +30,9 @@ describe("searchCityPart", () => {
|
|
|
30
30
|
status: 200,
|
|
31
31
|
json: () => Promise.resolve(mockResponse),
|
|
32
32
|
}));
|
|
33
|
-
const result = await (0,
|
|
33
|
+
const result = await (0, search_city_part_ts_1.searchCityPart)("Vrchlabí");
|
|
34
34
|
expect(result).toEqual(mockResponse);
|
|
35
|
-
expect(fetch).toHaveBeenCalledWith(`${
|
|
35
|
+
expect(fetch).toHaveBeenCalledWith(`${config_ts_1.smartAddressUrl}/v2/city-part/search?term=Vrchlab%C3%AD`);
|
|
36
36
|
});
|
|
37
37
|
it("should respect limit parameter", async () => {
|
|
38
38
|
const mockResponse = [{ id: 1 }];
|
|
@@ -40,7 +40,7 @@ describe("searchCityPart", () => {
|
|
|
40
40
|
status: 200,
|
|
41
41
|
json: () => Promise.resolve(mockResponse),
|
|
42
42
|
}));
|
|
43
|
-
await (0,
|
|
44
|
-
expect(fetch).toHaveBeenCalledWith(`${
|
|
43
|
+
await (0, search_city_part_ts_1.searchCityPart)("Praha", 5);
|
|
44
|
+
expect(fetch).toHaveBeenCalledWith(`${config_ts_1.smartAddressUrl}/v2/city-part/search?term=Praha&limit=5`);
|
|
45
45
|
});
|
|
46
46
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Location } from "./types";
|
|
1
|
+
import { Location } from "./types.ts";
|
|
2
2
|
type Params = {
|
|
3
3
|
level: number;
|
|
4
4
|
limit?: number;
|
|
@@ -8,5 +8,5 @@ type Params = {
|
|
|
8
8
|
};
|
|
9
9
|
export declare const createAddressLoader: (params: Params) => (term: string, options?: {
|
|
10
10
|
signal?: AbortSignal;
|
|
11
|
-
}) => Promise<import("./types").Option[]>;
|
|
11
|
+
}) => Promise<import("./types.ts").Option[]>;
|
|
12
12
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createAddressLoader = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const createAddressLoader = (params) => (0,
|
|
4
|
+
const create_loader_ts_1 = require("../common/create-loader.js");
|
|
5
|
+
const load_address_options_ts_1 = require("./load-address-options.js");
|
|
6
|
+
const createAddressLoader = (params) => (0, create_loader_ts_1.createLoaderGeneral)(load_address_options_ts_1.loadAddressOptions, params);
|
|
7
7
|
exports.createAddressLoader = createAddressLoader;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Location } from "./types";
|
|
1
|
+
import { Location } from "./types.ts";
|
|
2
2
|
type Params = {
|
|
3
3
|
limit?: number;
|
|
4
4
|
getLabel?: (address: Location) => string;
|
|
5
5
|
};
|
|
6
6
|
export declare const createZipLoader: (params: Params) => (term: string, options?: {
|
|
7
7
|
signal?: AbortSignal;
|
|
8
|
-
}) => Promise<import("./types").Option[]>;
|
|
8
|
+
}) => Promise<import("./types.ts").Option[]>;
|
|
9
9
|
export {};
|
package/v2/create-zip-loader.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createZipLoader = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const createZipLoader = (params) => (0,
|
|
4
|
+
const create_loader_ts_1 = require("../common/create-loader.js");
|
|
5
|
+
const load_zip_options_ts_1 = require("./load-zip-options.js");
|
|
6
|
+
const createZipLoader = (params) => (0, create_loader_ts_1.createLoaderGeneral)(load_zip_options_ts_1.loadZipOptions, params);
|
|
7
7
|
exports.createZipLoader = createZipLoader;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AddressExtended } from "./types";
|
|
1
|
+
import { AddressExtended } from "./types.ts";
|
|
2
2
|
export declare const getAddressExtended: (id: number) => Promise<AddressExtended>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAddressExtended = void 0;
|
|
4
|
-
const
|
|
5
|
-
exports.getAddressExtended = (0,
|
|
4
|
+
const get_address_extended_ts_1 = require("../common/get-address-extended.js");
|
|
5
|
+
exports.getAddressExtended = (0, get_address_extended_ts_1.getAddressExtendedGeneral)("/v2/address/");
|
package/v2/get-address.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getAddress: (id: number) => Promise<import("./types").Location>;
|
|
1
|
+
export declare const getAddress: (id: number) => Promise<import("./types.ts").Location>;
|
package/v2/get-address.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAddress = void 0;
|
|
4
|
-
const
|
|
5
|
-
exports.getAddress = (0,
|
|
4
|
+
const get_address_ts_1 = require("../common/get-address.js");
|
|
5
|
+
exports.getAddress = (0, get_address_ts_1.getAddressGeneral)("/v2/address/");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Location } from "./types";
|
|
1
|
+
import { Location } from "./types.ts";
|
|
2
2
|
export declare const getBuildingAddresses: (id: number) => Promise<Location[]>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getBuildingAddresses = void 0;
|
|
4
|
-
const
|
|
4
|
+
const config_ts_1 = require("../config.js");
|
|
5
5
|
const getBuildingAddresses = async (id) => {
|
|
6
|
-
const response = await fetch(`${
|
|
6
|
+
const response = await fetch(`${config_ts_1.smartAddressUrl}/v2/address/${id}/building-addresses`);
|
|
7
7
|
return await response.json();
|
|
8
8
|
};
|
|
9
9
|
exports.getBuildingAddresses = getBuildingAddresses;
|
package/v2/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from "./create-address-loader";
|
|
2
|
-
export * from "./create-zip-loader";
|
|
3
|
-
export * from "./get-address";
|
|
4
|
-
export * from "./get-address-extended";
|
|
5
|
-
export * from "./get-building-addresses";
|
|
6
|
-
export * from "./load-address-options";
|
|
7
|
-
export * from "./load-zip-options";
|
|
8
|
-
export * from "./search";
|
|
9
|
-
export * from "./search-city-part";
|
|
10
|
-
export * from "./search-zip";
|
|
11
|
-
export * from "./types";
|
|
1
|
+
export * from "./create-address-loader.ts";
|
|
2
|
+
export * from "./create-zip-loader.ts";
|
|
3
|
+
export * from "./get-address.ts";
|
|
4
|
+
export * from "./get-address-extended.ts";
|
|
5
|
+
export * from "./get-building-addresses.ts";
|
|
6
|
+
export * from "./load-address-options.ts";
|
|
7
|
+
export * from "./load-zip-options.ts";
|
|
8
|
+
export * from "./search.ts";
|
|
9
|
+
export * from "./search-city-part.ts";
|
|
10
|
+
export * from "./search-zip.ts";
|
|
11
|
+
export * from "./types.ts";
|
package/v2/index.js
CHANGED
|
@@ -14,14 +14,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./create-address-loader"), exports);
|
|
18
|
-
__exportStar(require("./create-zip-loader"), exports);
|
|
19
|
-
__exportStar(require("./get-address"), exports);
|
|
20
|
-
__exportStar(require("./get-address-extended"), exports);
|
|
21
|
-
__exportStar(require("./get-building-addresses"), exports);
|
|
22
|
-
__exportStar(require("./load-address-options"), exports);
|
|
23
|
-
__exportStar(require("./load-zip-options"), exports);
|
|
24
|
-
__exportStar(require("./search"), exports);
|
|
25
|
-
__exportStar(require("./search-city-part"), exports);
|
|
26
|
-
__exportStar(require("./search-zip"), exports);
|
|
27
|
-
__exportStar(require("./types"), exports);
|
|
17
|
+
__exportStar(require("./create-address-loader.js"), exports);
|
|
18
|
+
__exportStar(require("./create-zip-loader.js"), exports);
|
|
19
|
+
__exportStar(require("./get-address.js"), exports);
|
|
20
|
+
__exportStar(require("./get-address-extended.js"), exports);
|
|
21
|
+
__exportStar(require("./get-building-addresses.js"), exports);
|
|
22
|
+
__exportStar(require("./load-address-options.js"), exports);
|
|
23
|
+
__exportStar(require("./load-zip-options.js"), exports);
|
|
24
|
+
__exportStar(require("./search.js"), exports);
|
|
25
|
+
__exportStar(require("./search-city-part.js"), exports);
|
|
26
|
+
__exportStar(require("./search-zip.js"), exports);
|
|
27
|
+
__exportStar(require("./types.js"), exports);
|
|
@@ -4,6 +4,6 @@ export declare const loadAddressOptions: (params: {
|
|
|
4
4
|
limit?: number;
|
|
5
5
|
zip?: number;
|
|
6
6
|
address?: string;
|
|
7
|
-
getLabel?: (address: import("./types").Location) => string;
|
|
7
|
+
getLabel?: (address: import("./types.ts").Location) => string;
|
|
8
8
|
signal?: AbortSignal;
|
|
9
|
-
}) => Promise<import("./types").Option[]>;
|
|
9
|
+
}) => Promise<import("./types.ts").Option[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadAddressOptions = void 0;
|
|
4
|
-
const
|
|
5
|
-
exports.loadAddressOptions = (0,
|
|
4
|
+
const load_address_options_ts_1 = require("../common/load-address-options.js");
|
|
5
|
+
exports.loadAddressOptions = (0, load_address_options_ts_1.loadAddressOptionsGeneral)("/v2/search");
|
package/v2/load-zip-options.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const loadZipOptions: (params: {
|
|
2
2
|
term: string;
|
|
3
3
|
limit?: number;
|
|
4
|
-
getLabel?: (address: import("./types").Location) => string;
|
|
4
|
+
getLabel?: (address: import("./types.ts").Location) => string;
|
|
5
5
|
signal?: AbortSignal;
|
|
6
|
-
}) => Promise<import("./types").Option[]>;
|
|
6
|
+
}) => Promise<import("./types.ts").Option[]>;
|
package/v2/load-zip-options.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadZipOptions = void 0;
|
|
4
|
-
const
|
|
5
|
-
exports.loadZipOptions = (0,
|
|
4
|
+
const load_zip_options_ts_1 = require("../common/load-zip-options.js");
|
|
5
|
+
exports.loadZipOptions = (0, load_zip_options_ts_1.loadZipOptionsGeneral)("/v2/zip/search");
|
package/v2/search-city-part.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CityPart } from "./types";
|
|
1
|
+
import { CityPart } from "./types.ts";
|
|
2
2
|
export declare const searchCityPart: (term: string, limit?: number) => Promise<CityPart[]>;
|
package/v2/search-city-part.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.searchCityPart = void 0;
|
|
4
|
-
const
|
|
4
|
+
const config_ts_1 = require("../config.js");
|
|
5
5
|
const searchCityPart = async (term, limit) => {
|
|
6
6
|
if (term.length === 0) {
|
|
7
7
|
return [];
|
|
@@ -12,7 +12,7 @@ const searchCityPart = async (term, limit) => {
|
|
|
12
12
|
if (limit) {
|
|
13
13
|
params.append("limit", limit.toString());
|
|
14
14
|
}
|
|
15
|
-
const response = await fetch(`${
|
|
15
|
+
const response = await fetch(`${config_ts_1.smartAddressUrl}/v2/city-part/search?${params.toString()}`);
|
|
16
16
|
return (await response.json());
|
|
17
17
|
};
|
|
18
18
|
exports.searchCityPart = searchCityPart;
|
package/v2/search-zip.d.ts
CHANGED
package/v2/search-zip.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.searchZip = void 0;
|
|
4
|
-
const
|
|
5
|
-
exports.searchZip = (0,
|
|
4
|
+
const search_zip_ts_1 = require("../common/search-zip.js");
|
|
5
|
+
exports.searchZip = (0, search_zip_ts_1.searchZipGeneral)("/v2/zip/search");
|
package/v2/search.d.ts
CHANGED
package/v2/search.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.search = void 0;
|
|
4
|
-
const
|
|
5
|
-
exports.search = (0,
|
|
4
|
+
const search_ts_1 = require("../common/search.js");
|
|
5
|
+
exports.search = (0, search_ts_1.searchGeneral)("/v2/search");
|
package/v2/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "../common/types";
|
|
2
|
-
import { BuildingType, BuildingUsageType, ConstructionType, ElevatorType, GasConnectionType, HeatingType, Location, ObjectType, ObjectTypeBasic, SewerConnectionType, WaterConnectionType } from "../common/types";
|
|
1
|
+
export * from "../common/types.ts";
|
|
2
|
+
import { BuildingType, BuildingUsageType, ConstructionType, ElevatorType, GasConnectionType, HeatingType, Location, ObjectType, ObjectTypeBasic, SewerConnectionType, WaterConnectionType } from "../common/types.ts";
|
|
3
3
|
export type AddressExtendedBasicResponse = Location;
|
|
4
4
|
export type AddressExtendedAdministrativeResponse = {
|
|
5
5
|
id: number;
|
package/v2/types.js
CHANGED
|
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("../common/types"), exports);
|
|
17
|
+
__exportStar(require("../common/types.js"), exports);
|