@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.
Files changed (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -0
  3. package/common/__tests__/create-loader.test.js +8 -8
  4. package/common/__tests__/load-address-options.test.js +11 -11
  5. package/common/__tests__/load-zip-options.test.js +8 -8
  6. package/common/__tests__/search-zip.test.js +8 -8
  7. package/common/__tests__/search.test.js +5 -5
  8. package/common/create-loader.d.ts +1 -1
  9. package/common/get-address-extended.d.ts +1 -1
  10. package/common/get-address-extended.js +2 -2
  11. package/common/get-address.d.ts +1 -1
  12. package/common/get-address.js +2 -2
  13. package/common/index.d.ts +1 -1
  14. package/common/index.js +1 -1
  15. package/common/load-address-options.d.ts +1 -1
  16. package/common/load-address-options.js +2 -2
  17. package/common/load-zip-options.d.ts +1 -1
  18. package/common/load-zip-options.js +2 -2
  19. package/common/search-zip.d.ts +1 -1
  20. package/common/search-zip.js +2 -2
  21. package/common/search.d.ts +1 -1
  22. package/common/search.js +2 -2
  23. package/package.json +4 -3
  24. package/v1/create-address-loader.d.ts +2 -2
  25. package/v1/create-address-loader.js +3 -3
  26. package/v1/create-zip-loader.d.ts +2 -2
  27. package/v1/create-zip-loader.js +3 -3
  28. package/v1/get-address-extended.d.ts +1 -1
  29. package/v1/get-address-extended.js +2 -2
  30. package/v1/get-address.d.ts +1 -1
  31. package/v1/get-address.js +2 -2
  32. package/v1/get-city-part.d.ts +1 -1
  33. package/v1/get-city-part.js +2 -2
  34. package/v1/get-city.d.ts +1 -1
  35. package/v1/get-city.js +2 -2
  36. package/v1/get-city.test.js +4 -4
  37. package/v1/get-momc.d.ts +1 -1
  38. package/v1/get-momc.js +2 -2
  39. package/v1/get-mop.d.ts +1 -1
  40. package/v1/get-mop.js +2 -2
  41. package/v1/get-street.d.ts +1 -1
  42. package/v1/get-street.js +2 -2
  43. package/v1/index.d.ts +23 -27
  44. package/v1/index.js +26 -26
  45. package/v1/load-address-options.d.ts +2 -2
  46. package/v1/load-address-options.js +2 -2
  47. package/v1/load-zip-options.d.ts +2 -2
  48. package/v1/load-zip-options.js +2 -2
  49. package/v1/search-zip.d.ts +1 -1
  50. package/v1/search-zip.js +2 -2
  51. package/v1/search.d.ts +1 -1
  52. package/v1/search.js +2 -2
  53. package/v1/types.d.ts +1 -1
  54. package/v1/types.js +1 -1
  55. package/v2/__tests__/get-building-addresses.test.js +4 -4
  56. package/v2/__tests__/search-city-part.test.js +8 -8
  57. package/v2/create-address-loader.d.ts +2 -2
  58. package/v2/create-address-loader.js +3 -3
  59. package/v2/create-zip-loader.d.ts +2 -2
  60. package/v2/create-zip-loader.js +3 -3
  61. package/v2/get-address-extended.d.ts +1 -1
  62. package/v2/get-address-extended.js +2 -2
  63. package/v2/get-address.d.ts +1 -1
  64. package/v2/get-address.js +2 -2
  65. package/v2/get-building-addresses.d.ts +1 -1
  66. package/v2/get-building-addresses.js +2 -2
  67. package/v2/index.d.ts +11 -11
  68. package/v2/index.js +11 -11
  69. package/v2/load-address-options.d.ts +2 -2
  70. package/v2/load-address-options.js +2 -2
  71. package/v2/load-zip-options.d.ts +2 -2
  72. package/v2/load-zip-options.js +2 -2
  73. package/v2/search-city-part.d.ts +1 -1
  74. package/v2/search-city-part.js +2 -2
  75. package/v2/search-zip.d.ts +1 -1
  76. package/v2/search-zip.js +2 -2
  77. package/v2/search.d.ts +1 -1
  78. package/v2/search.js +2 -2
  79. package/v2/types.d.ts +2 -2
  80. package/v2/types.js +1 -1
package/v1/index.d.ts CHANGED
@@ -1,40 +1,36 @@
1
- export type { BuildingType, BuildingUsageType, ConstructionType, ElevatorType, GasConnectionType, HeatingType, Location, LocationExtended, ObjectType, ObjectTypeBasic, Point, SewerConnectionType, WaterConnectionType, } from "./types";
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: (params: {
4
- level: number;
5
- limit?: number;
6
- zip?: number;
7
- getLabel?: (address: import("./types").Location) => string;
8
- }) => (term: string, options?: {
9
- signal?: AbortSignal;
10
- }) => Promise<import("./types").Option[]>;
11
- createZipLoader: (params: {
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 create_address_loader_1 = require("./create-address-loader");
5
- const create_zip_loader_1 = require("./create-zip-loader");
6
- const get_address_1 = require("./get-address");
7
- const get_address_extended_1 = require("./get-address-extended");
8
- const get_city_1 = require("./get-city");
9
- const get_city_part_1 = require("./get-city-part");
10
- const get_momc_1 = require("./get-momc");
11
- const get_mop_1 = require("./get-mop");
12
- const get_street_1 = require("./get-street");
13
- const load_address_options_1 = require("./load-address-options");
14
- const load_zip_options_1 = require("./load-zip-options");
15
- const search_1 = require("./search");
16
- const search_zip_1 = require("./search-zip");
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: create_address_loader_1.createAddressLoader,
19
- createZipLoader: create_zip_loader_1.createZipLoader,
20
- getAddress: get_address_1.getAddress,
21
- getAddressExtended: get_address_extended_1.getAddressExtended,
22
- getCity: get_city_1.getCity,
23
- getCityPart: get_city_part_1.getCityPart,
24
- getMomc: get_momc_1.getMomc,
25
- getMop: get_mop_1.getMop,
26
- getStreet: get_street_1.getStreet,
27
- loadAddressOptions: load_address_options_1.loadAddressOptions,
28
- loadZipOptions: load_zip_options_1.loadZipOptions,
29
- search: search_1.search,
30
- searchZip: search_zip_1.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 load_address_options_1 = require("../common/load-address-options");
5
- exports.loadAddressOptions = (0, load_address_options_1.loadAddressOptionsGeneral)("/v1/search");
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");
@@ -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[]>;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadZipOptions = void 0;
4
- const load_zip_options_1 = require("../common/load-zip-options");
5
- exports.loadZipOptions = (0, load_zip_options_1.loadZipOptionsGeneral)("/v1/zip/search");
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");
@@ -1,3 +1,3 @@
1
1
  export declare const searchZip: (term: string, limit?: number, options?: {
2
2
  signal?: AbortSignal;
3
- }) => Promise<import("./types").Location[]>;
3
+ }) => Promise<import("./types.ts").Location[]>;
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 search_zip_1 = require("../common/search-zip");
5
- exports.searchZip = (0, search_zip_1.searchZipGeneral)("/v1/zip/search");
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
@@ -5,4 +5,4 @@ export declare const search: (props: {
5
5
  zip?: number;
6
6
  address?: string;
7
7
  signal?: AbortSignal;
8
- }) => Promise<import("./types").Location[]>;
8
+ }) => Promise<import("./types.ts").Location[]>;
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 search_1 = require("../common/search");
5
- exports.search = (0, search_1.searchGeneral)("/v1/search");
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 config_1 = require("../../config");
4
- const get_building_addresses_1 = require("../get-building-addresses");
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, get_building_addresses_1.getBuildingAddresses)(123);
46
- expect(fetch).toHaveBeenCalledWith(`${config_1.smartAddressUrl}/v2/address/123/building-addresses`);
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 config_1 = require("../../config");
4
- const search_city_part_1 = require("../search-city-part");
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, search_city_part_1.searchCityPart)("");
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, search_city_part_1.searchCityPart)("Vrchlabí");
33
+ const result = await (0, search_city_part_ts_1.searchCityPart)("Vrchlabí");
34
34
  expect(result).toEqual(mockResponse);
35
- expect(fetch).toHaveBeenCalledWith(`${config_1.smartAddressUrl}/v2/city-part/search?term=Vrchlab%C3%AD`);
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, search_city_part_1.searchCityPart)("Praha", 5);
44
- expect(fetch).toHaveBeenCalledWith(`${config_1.smartAddressUrl}/v2/city-part/search?term=Praha&limit=5`);
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 create_loader_1 = require("../common/create-loader");
5
- const load_address_options_1 = require("./load-address-options");
6
- const createAddressLoader = (params) => (0, create_loader_1.createLoaderGeneral)(load_address_options_1.loadAddressOptions, params);
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 {};
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createZipLoader = void 0;
4
- const create_loader_1 = require("../common/create-loader");
5
- const load_zip_options_1 = require("./load-zip-options");
6
- const createZipLoader = (params) => (0, create_loader_1.createLoaderGeneral)(load_zip_options_1.loadZipOptions, params);
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 get_address_extended_1 = require("../common/get-address-extended");
5
- exports.getAddressExtended = (0, get_address_extended_1.getAddressExtendedGeneral)("/v2/address/");
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/");
@@ -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 get_address_1 = require("../common/get-address");
5
- exports.getAddress = (0, get_address_1.getAddressGeneral)("/v2/address/");
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 config_1 = require("../config");
4
+ const config_ts_1 = require("../config.js");
5
5
  const getBuildingAddresses = async (id) => {
6
- const response = await fetch(`${config_1.smartAddressUrl}/v2/address/${id}/building-addresses`);
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 load_address_options_1 = require("../common/load-address-options");
5
- exports.loadAddressOptions = (0, load_address_options_1.loadAddressOptionsGeneral)("/v2/search");
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");
@@ -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[]>;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadZipOptions = void 0;
4
- const load_zip_options_1 = require("../common/load-zip-options");
5
- exports.loadZipOptions = (0, load_zip_options_1.loadZipOptionsGeneral)("/v2/zip/search");
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");
@@ -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[]>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.searchCityPart = void 0;
4
- const config_1 = require("../config");
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(`${config_1.smartAddressUrl}/v2/city-part/search?${params.toString()}`);
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;
@@ -1,3 +1,3 @@
1
1
  export declare const searchZip: (term: string, limit?: number, options?: {
2
2
  signal?: AbortSignal;
3
- }) => Promise<import("./types").Location[]>;
3
+ }) => Promise<import("./types.ts").Location[]>;
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 search_zip_1 = require("../common/search-zip");
5
- exports.searchZip = (0, search_zip_1.searchZipGeneral)("/v2/zip/search");
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
@@ -5,4 +5,4 @@ export declare const search: (props: {
5
5
  zip?: number;
6
6
  address?: string;
7
7
  signal?: AbortSignal;
8
- }) => Promise<import("./types").Location[]>;
8
+ }) => Promise<import("./types.ts").Location[]>;
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 search_1 = require("../common/search");
5
- exports.search = (0, search_1.searchGeneral)("/v2/search");
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);