np-belarus 1.1.5 → 1.2.5
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/data/{np-places.json → np-locations.json} +27407 -27407
- package/dist/schema/districts.d.ts +1 -1
- package/dist/schema/districts.js +1 -1
- package/dist/schema/index.d.ts +2 -2
- package/dist/schema/index.js +1 -1
- package/dist/schema/{places.d.ts → locations.d.ts} +29 -33
- package/dist/schema/{places.js → locations.js} +9 -16
- package/dist/schema/subdistricts.d.ts +1 -1
- package/dist/schema/subdistricts.js +1 -1
- package/dist/seed/index.d.ts +1 -1
- package/dist/seed/index.js +1 -1
- package/dist/seed/{places.d.ts → locations.d.ts} +4 -4
- package/dist/seed/locations.js +24 -0
- package/dist/shared/lib/location-types.d.ts +6 -0
- package/dist/shared/lib/location-types.js +11 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/{place.d.ts → location.d.ts} +9 -9
- package/dist/types/tables.d.ts +4 -4
- package/package.json +4 -4
- package/readme.md +170 -170
- package/dist/seed/places.js +0 -24
- /package/dist/types/{place.js → location.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Районы Беларуси. Каждый район принадлежит области (`regionId`).
|
|
3
3
|
* Пара `(regionId, id)` уникальна и используется в составных внешних ключах
|
|
4
|
-
* таблиц `np_subdistricts` и `
|
|
4
|
+
* таблиц `np_subdistricts` и `np_locations`.
|
|
5
5
|
*/
|
|
6
6
|
export declare const districts: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
7
7
|
name: "np_districts";
|
package/dist/schema/districts.js
CHANGED
|
@@ -3,7 +3,7 @@ import { regions } from "./regions.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Районы Беларуси. Каждый район принадлежит области (`regionId`).
|
|
5
5
|
* Пара `(regionId, id)` уникальна и используется в составных внешних ключах
|
|
6
|
-
* таблиц `np_subdistricts` и `
|
|
6
|
+
* таблиц `np_subdistricts` и `np_locations`.
|
|
7
7
|
*/
|
|
8
8
|
export const districts = pgTable("np_districts", {
|
|
9
9
|
/** Числовой идентификатор района, совпадает с id в np-districts.json */
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { districts } from "./districts.js";
|
|
2
|
-
export {
|
|
2
|
+
export { locations, locationTypeEnum } from "./locations.js";
|
|
3
3
|
export { regions } from "./regions.js";
|
|
4
4
|
export { subdistricts } from "./subdistricts.js";
|
|
5
|
-
export type {
|
|
5
|
+
export type { LocationType } from "./locations.js";
|
package/dist/schema/index.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export declare const placeTypeEnum: import("drizzle-orm/pg-core").PgEnum<["city", "town", "village", "hamlet", "isolated_dwelling"]>;
|
|
1
|
+
import { type LocationType } from "../shared/lib/location-types.js";
|
|
2
|
+
export type { LocationType };
|
|
3
|
+
export declare const locationTypeEnum: import("drizzle-orm/pg-core").PgEnum<["city", "town", "village", "hamlet", "isolated_dwelling"]>;
|
|
5
4
|
/**
|
|
6
5
|
* Населённые пункты Беларуси. Каждая запись ссылается на область, район
|
|
7
6
|
* и (опционально) сельсовет через составные внешние ключи — это гарантирует,
|
|
8
7
|
* что `districtId` принадлежит `regionId`, а `subdistrictId` — выбранному
|
|
9
8
|
* району.
|
|
10
9
|
*/
|
|
11
|
-
export declare const
|
|
12
|
-
name: "
|
|
10
|
+
export declare const locations: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
11
|
+
name: "np_locations";
|
|
13
12
|
schema: undefined;
|
|
14
13
|
columns: {
|
|
15
14
|
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
16
15
|
name: "id";
|
|
17
|
-
tableName: "
|
|
16
|
+
tableName: "np_locations";
|
|
18
17
|
dataType: "number";
|
|
19
18
|
columnType: "PgInteger";
|
|
20
19
|
data: number;
|
|
@@ -31,7 +30,7 @@ export declare const places: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
31
30
|
}, {}, {}>;
|
|
32
31
|
lon: import("drizzle-orm/pg-core").PgColumn<{
|
|
33
32
|
name: "lon";
|
|
34
|
-
tableName: "
|
|
33
|
+
tableName: "np_locations";
|
|
35
34
|
dataType: "number";
|
|
36
35
|
columnType: "PgDoublePrecision";
|
|
37
36
|
data: number;
|
|
@@ -48,7 +47,7 @@ export declare const places: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
48
47
|
}, {}, {}>;
|
|
49
48
|
lat: import("drizzle-orm/pg-core").PgColumn<{
|
|
50
49
|
name: "lat";
|
|
51
|
-
tableName: "
|
|
50
|
+
tableName: "np_locations";
|
|
52
51
|
dataType: "number";
|
|
53
52
|
columnType: "PgDoublePrecision";
|
|
54
53
|
data: number;
|
|
@@ -65,7 +64,7 @@ export declare const places: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
65
64
|
}, {}, {}>;
|
|
66
65
|
regionId: import("drizzle-orm/pg-core").PgColumn<{
|
|
67
66
|
name: "region_id";
|
|
68
|
-
tableName: "
|
|
67
|
+
tableName: "np_locations";
|
|
69
68
|
dataType: "number";
|
|
70
69
|
columnType: "PgInteger";
|
|
71
70
|
data: number;
|
|
@@ -82,7 +81,7 @@ export declare const places: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
82
81
|
}, {}, {}>;
|
|
83
82
|
districtId: import("drizzle-orm/pg-core").PgColumn<{
|
|
84
83
|
name: "district_id";
|
|
85
|
-
tableName: "
|
|
84
|
+
tableName: "np_locations";
|
|
86
85
|
dataType: "number";
|
|
87
86
|
columnType: "PgInteger";
|
|
88
87
|
data: number;
|
|
@@ -99,7 +98,7 @@ export declare const places: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
99
98
|
}, {}, {}>;
|
|
100
99
|
subdistrictId: import("drizzle-orm/pg-core").PgColumn<{
|
|
101
100
|
name: "subdistrict_id";
|
|
102
|
-
tableName: "
|
|
101
|
+
tableName: "np_locations";
|
|
103
102
|
dataType: "number";
|
|
104
103
|
columnType: "PgInteger";
|
|
105
104
|
data: number;
|
|
@@ -114,9 +113,9 @@ export declare const places: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
114
113
|
identity: undefined;
|
|
115
114
|
generated: undefined;
|
|
116
115
|
}, {}, {}>;
|
|
117
|
-
|
|
118
|
-
name: "
|
|
119
|
-
tableName: "
|
|
116
|
+
locationType: import("drizzle-orm/pg-core").PgColumn<{
|
|
117
|
+
name: "location_type";
|
|
118
|
+
tableName: "np_locations";
|
|
120
119
|
dataType: "string";
|
|
121
120
|
columnType: "PgEnumColumn";
|
|
122
121
|
data: "city" | "hamlet" | "isolated_dwelling" | "town" | "village";
|
|
@@ -133,7 +132,7 @@ export declare const places: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
133
132
|
}, {}, {}>;
|
|
134
133
|
name: import("drizzle-orm/pg-core").PgColumn<{
|
|
135
134
|
name: "name";
|
|
136
|
-
tableName: "
|
|
135
|
+
tableName: "np_locations";
|
|
137
136
|
dataType: "string";
|
|
138
137
|
columnType: "PgText";
|
|
139
138
|
data: string;
|
|
@@ -150,7 +149,7 @@ export declare const places: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
150
149
|
}, {}, {}>;
|
|
151
150
|
nameBe: import("drizzle-orm/pg-core").PgColumn<{
|
|
152
151
|
name: "name_be";
|
|
153
|
-
tableName: "
|
|
152
|
+
tableName: "np_locations";
|
|
154
153
|
dataType: "string";
|
|
155
154
|
columnType: "PgText";
|
|
156
155
|
data: string;
|
|
@@ -167,7 +166,7 @@ export declare const places: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
167
166
|
}, {}, {}>;
|
|
168
167
|
nameRu: import("drizzle-orm/pg-core").PgColumn<{
|
|
169
168
|
name: "name_ru";
|
|
170
|
-
tableName: "
|
|
169
|
+
tableName: "np_locations";
|
|
171
170
|
dataType: "string";
|
|
172
171
|
columnType: "PgText";
|
|
173
172
|
data: string;
|
|
@@ -184,7 +183,7 @@ export declare const places: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
184
183
|
}, {}, {}>;
|
|
185
184
|
slug: import("drizzle-orm/pg-core").PgColumn<{
|
|
186
185
|
name: "slug";
|
|
187
|
-
tableName: "
|
|
186
|
+
tableName: "np_locations";
|
|
188
187
|
dataType: "string";
|
|
189
188
|
columnType: "PgVarchar";
|
|
190
189
|
data: string;
|
|
@@ -203,7 +202,7 @@ export declare const places: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
203
202
|
}>;
|
|
204
203
|
nameRuLemma: import("drizzle-orm/pg-core").PgColumn<{
|
|
205
204
|
name: "name_ru_lemma";
|
|
206
|
-
tableName: "
|
|
205
|
+
tableName: "np_locations";
|
|
207
206
|
dataType: "string";
|
|
208
207
|
columnType: "PgText";
|
|
209
208
|
data: string;
|
|
@@ -220,7 +219,7 @@ export declare const places: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
220
219
|
}, {}, {}>;
|
|
221
220
|
namePrefix: import("drizzle-orm/pg-core").PgColumn<{
|
|
222
221
|
name: "name_prefix";
|
|
223
|
-
tableName: "
|
|
222
|
+
tableName: "np_locations";
|
|
224
223
|
dataType: "string";
|
|
225
224
|
columnType: "PgText";
|
|
226
225
|
data: string;
|
|
@@ -237,7 +236,7 @@ export declare const places: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
237
236
|
}, {}, {}>;
|
|
238
237
|
namePrefixBe: import("drizzle-orm/pg-core").PgColumn<{
|
|
239
238
|
name: "name_prefix_be";
|
|
240
|
-
tableName: "
|
|
239
|
+
tableName: "np_locations";
|
|
241
240
|
dataType: "string";
|
|
242
241
|
columnType: "PgText";
|
|
243
242
|
data: string;
|
|
@@ -254,7 +253,7 @@ export declare const places: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
254
253
|
}, {}, {}>;
|
|
255
254
|
namePrefixRu: import("drizzle-orm/pg-core").PgColumn<{
|
|
256
255
|
name: "name_prefix_ru";
|
|
257
|
-
tableName: "
|
|
256
|
+
tableName: "np_locations";
|
|
258
257
|
dataType: "string";
|
|
259
258
|
columnType: "PgText";
|
|
260
259
|
data: string;
|
|
@@ -271,24 +270,21 @@ export declare const places: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
271
270
|
}, {}, {}>;
|
|
272
271
|
population: import("drizzle-orm/pg-core").PgColumn<{
|
|
273
272
|
name: "population";
|
|
274
|
-
tableName: "
|
|
275
|
-
dataType: "
|
|
276
|
-
columnType: "
|
|
277
|
-
data:
|
|
278
|
-
driverParam: string;
|
|
273
|
+
tableName: "np_locations";
|
|
274
|
+
dataType: "number";
|
|
275
|
+
columnType: "PgInteger";
|
|
276
|
+
data: number;
|
|
277
|
+
driverParam: string | number;
|
|
279
278
|
notNull: false;
|
|
280
279
|
hasDefault: false;
|
|
281
280
|
isPrimaryKey: false;
|
|
282
281
|
isAutoincrement: false;
|
|
283
282
|
hasRuntimeDefault: false;
|
|
284
|
-
enumValues:
|
|
283
|
+
enumValues: undefined;
|
|
285
284
|
baseColumn: never;
|
|
286
285
|
identity: undefined;
|
|
287
286
|
generated: undefined;
|
|
288
|
-
}, {}, {
|
|
289
|
-
length: 12;
|
|
290
|
-
}>;
|
|
287
|
+
}, {}, {}>;
|
|
291
288
|
};
|
|
292
289
|
dialect: 'pg';
|
|
293
290
|
}>;
|
|
294
|
-
export {};
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
import { foreignKey, index, integer, pgEnum, pgTable, text, doublePrecision, varchar } from "drizzle-orm/pg-core";
|
|
2
|
+
import { locationTypes } from "../shared/lib/location-types.js";
|
|
2
3
|
import { districts } from "./districts.js";
|
|
3
4
|
import { subdistricts } from "./subdistricts.js";
|
|
4
|
-
|
|
5
|
-
const placeTypeValues = [
|
|
6
|
-
"city",
|
|
7
|
-
"town",
|
|
8
|
-
"village",
|
|
9
|
-
"hamlet",
|
|
10
|
-
"isolated_dwelling",
|
|
11
|
-
];
|
|
12
|
-
export const placeTypeEnum = pgEnum("np_place_type", [...placeTypeValues]);
|
|
5
|
+
export const locationTypeEnum = pgEnum("np_location_type", [...locationTypes]);
|
|
13
6
|
/**
|
|
14
7
|
* Населённые пункты Беларуси. Каждая запись ссылается на область, район
|
|
15
8
|
* и (опционально) сельсовет через составные внешние ключи — это гарантирует,
|
|
16
9
|
* что `districtId` принадлежит `regionId`, а `subdistrictId` — выбранному
|
|
17
10
|
* району.
|
|
18
11
|
*/
|
|
19
|
-
export const
|
|
20
|
-
/** Идентификатор элемента OSM, совпадает с id в np-
|
|
12
|
+
export const locations = pgTable("np_locations", {
|
|
13
|
+
/** Идентификатор элемента OSM, совпадает с id в np-locations.json */
|
|
21
14
|
id: integer("id").primaryKey(),
|
|
22
15
|
/** Долгота в десятичных градусах (WGS84) */
|
|
23
16
|
lon: doublePrecision("lon").notNull(),
|
|
@@ -30,7 +23,7 @@ export const places = pgTable("np_places", {
|
|
|
30
23
|
/** Идентификатор сельсовета внутри района (может отсутствовать) */
|
|
31
24
|
subdistrictId: integer("subdistrict_id"),
|
|
32
25
|
/** Тип населённого пункта по классификации OSM `place` */
|
|
33
|
-
|
|
26
|
+
locationType: locationTypeEnum("location_type").notNull(),
|
|
34
27
|
/** Название населённого пункта (вариант по умолчанию) */
|
|
35
28
|
name: text("name"),
|
|
36
29
|
/** Название на белорусском языке */
|
|
@@ -48,17 +41,17 @@ export const places = pgTable("np_places", {
|
|
|
48
41
|
/** Префикс на русском языке */
|
|
49
42
|
namePrefixRu: text("name_prefix_ru"),
|
|
50
43
|
/** Население по данным OSM */
|
|
51
|
-
population:
|
|
44
|
+
population: integer("population"),
|
|
52
45
|
}, (table) => [
|
|
53
46
|
foreignKey({
|
|
54
|
-
name: "
|
|
47
|
+
name: "np_locations_region_district_fk",
|
|
55
48
|
columns: [table.regionId, table.districtId],
|
|
56
49
|
foreignColumns: [districts.regionId, districts.id],
|
|
57
50
|
}),
|
|
58
51
|
foreignKey({
|
|
59
|
-
name: "
|
|
52
|
+
name: "np_locations_region_district_subdistrict_fk",
|
|
60
53
|
columns: [table.regionId, table.districtId, table.subdistrictId],
|
|
61
54
|
foreignColumns: [subdistricts.regionId, subdistricts.districtId, subdistricts.id],
|
|
62
55
|
}),
|
|
63
|
-
index("
|
|
56
|
+
index("np_locations_name_ru_lemma_gin_idx").using("gin", table.nameRuLemma.op("gin_trgm_ops")),
|
|
64
57
|
]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Сельсоветы (подрайоны) Беларуси. Каждый сельсовет привязан к конкретному
|
|
3
3
|
* району внутри области; тройка `(regionId, districtId, id)` уникальна и
|
|
4
|
-
* используется в составном внешнем ключе таблицы `
|
|
4
|
+
* используется в составном внешнем ключе таблицы `np_locations`.
|
|
5
5
|
*/
|
|
6
6
|
export declare const subdistricts: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
7
7
|
name: "np_subdistricts";
|
|
@@ -3,7 +3,7 @@ import { districts } from "./districts.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Сельсоветы (подрайоны) Беларуси. Каждый сельсовет привязан к конкретному
|
|
5
5
|
* району внутри области; тройка `(regionId, districtId, id)` уникальна и
|
|
6
|
-
* используется в составном внешнем ключе таблицы `
|
|
6
|
+
* используется в составном внешнем ключе таблицы `np_locations`.
|
|
7
7
|
*/
|
|
8
8
|
export const subdistricts = pgTable("np_subdistricts", {
|
|
9
9
|
/** Числовой идентификатор сельсовета, совпадает с id в np-subdistricts.json */
|
package/dist/seed/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* Каждый массив содержит строки, готовые к вставке через drizzle-orm.
|
|
4
4
|
*/
|
|
5
5
|
export { districtsSeed } from "./districts.js";
|
|
6
|
-
export {
|
|
6
|
+
export { locationsSeed } from "./locations.js";
|
|
7
7
|
export { regionsSeed } from "./regions.js";
|
|
8
8
|
export { subdistrictsSeed } from "./subdistricts.js";
|
package/dist/seed/index.js
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* Каждый массив содержит строки, готовые к вставке через drizzle-orm.
|
|
4
4
|
*/
|
|
5
5
|
export { districtsSeed } from "./districts.js";
|
|
6
|
-
export {
|
|
6
|
+
export { locationsSeed } from "./locations.js";
|
|
7
7
|
export { regionsSeed } from "./regions.js";
|
|
8
8
|
export { subdistrictsSeed } from "./subdistricts.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NewLocation } from "../types/tables.js";
|
|
2
2
|
/**
|
|
3
|
-
* Данные для сидирования таблицы `
|
|
4
|
-
* Разворачивает вложенные `names`/`names.prefix` из np-
|
|
3
|
+
* Данные для сидирования таблицы `np_locations`.
|
|
4
|
+
* Разворачивает вложенные `names`/`names.prefix` из np-locations.json
|
|
5
5
|
* в плоские колонки `name*`/`namePrefix*`; адрес в таблицу не попадает.
|
|
6
6
|
*/
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const locationsSeed: NewLocation[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import locationsData from "../data/np-locations.json" with { type: "json" };
|
|
2
|
+
/**
|
|
3
|
+
* Данные для сидирования таблицы `np_locations`.
|
|
4
|
+
* Разворачивает вложенные `names`/`names.prefix` из np-locations.json
|
|
5
|
+
* в плоские колонки `name*`/`namePrefix*`; адрес в таблицу не попадает.
|
|
6
|
+
*/
|
|
7
|
+
export const locationsSeed = locationsData.map((location) => ({
|
|
8
|
+
id: location.id,
|
|
9
|
+
lon: location.lon,
|
|
10
|
+
lat: location.lat,
|
|
11
|
+
regionId: location.regionId,
|
|
12
|
+
districtId: location.districtId,
|
|
13
|
+
...(location.subdistrictId === undefined ? {} : { subdistrictId: location.subdistrictId }),
|
|
14
|
+
locationType: location.locationType,
|
|
15
|
+
slug: location.slug,
|
|
16
|
+
name: location.names?.default,
|
|
17
|
+
nameBe: location.names?.be,
|
|
18
|
+
nameRu: location.names?.ru,
|
|
19
|
+
nameRuLemma: location.names.ruLemma,
|
|
20
|
+
namePrefix: location.names?.prefix?.default,
|
|
21
|
+
namePrefixBe: location.names?.prefix?.be,
|
|
22
|
+
namePrefixRu: location.names?.prefix?.ru,
|
|
23
|
+
population: location.population,
|
|
24
|
+
}));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Допустимые значения тега OpenStreetMap `place` для населённых пунктов.
|
|
3
|
+
* @see https://wiki.openstreetmap.org/wiki/Key:place
|
|
4
|
+
*/
|
|
5
|
+
export declare const locationTypes: readonly ["city", "town", "village", "hamlet", "isolated_dwelling"];
|
|
6
|
+
export type LocationType = (typeof locationTypes)[number];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Допустимые значения тега OpenStreetMap `place` для населённых пунктов.
|
|
3
|
+
* @see https://wiki.openstreetmap.org/wiki/Key:place
|
|
4
|
+
*/
|
|
5
|
+
export const locationTypes = [
|
|
6
|
+
"city", // город
|
|
7
|
+
"town", // небольшой город или поселок
|
|
8
|
+
"village", // деревня или село
|
|
9
|
+
"hamlet", // маленькая деревня, хутор или небольшой населенный пункт
|
|
10
|
+
"isolated_dwelling" // отдельно стоящее жильё или усадьба вне основного населённого пункта
|
|
11
|
+
];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type * from "./
|
|
1
|
+
export type * from "./location.js";
|
|
2
2
|
export type * from "./tables.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type {
|
|
3
|
-
export interface
|
|
1
|
+
import type { LocationType } from "../schema/locations.js";
|
|
2
|
+
export type { LocationType };
|
|
3
|
+
export interface LocationNames {
|
|
4
4
|
default?: string;
|
|
5
5
|
be?: string;
|
|
6
6
|
ru?: string;
|
|
@@ -11,20 +11,20 @@ export interface PlaceNames {
|
|
|
11
11
|
ru?: string;
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
export interface
|
|
14
|
+
export interface LocationAddress {
|
|
15
15
|
city?: string;
|
|
16
16
|
country?: string;
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
18
|
+
export interface Location {
|
|
19
19
|
id: number;
|
|
20
20
|
lon: number;
|
|
21
21
|
lat: number;
|
|
22
22
|
regionId: number;
|
|
23
23
|
districtId: number;
|
|
24
24
|
subdistrictId?: number;
|
|
25
|
-
|
|
25
|
+
locationType: LocationType;
|
|
26
26
|
slug: string;
|
|
27
|
-
names:
|
|
28
|
-
address?:
|
|
29
|
-
population?:
|
|
27
|
+
names: LocationNames;
|
|
28
|
+
address?: LocationAddress;
|
|
29
|
+
population?: number;
|
|
30
30
|
}
|
package/dist/types/tables.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { places } from "../schema/places.js";
|
|
1
|
+
import type { locations } from "../schema/locations.js";
|
|
3
2
|
import type { regions } from "../schema/regions.js";
|
|
3
|
+
import type { districts } from "../schema/districts.js";
|
|
4
4
|
import type { subdistricts } from "../schema/subdistricts.js";
|
|
5
5
|
export type RegionRow = typeof regions.$inferSelect;
|
|
6
6
|
export type NewRegion = typeof regions.$inferInsert;
|
|
@@ -8,5 +8,5 @@ export type DistrictRow = typeof districts.$inferSelect;
|
|
|
8
8
|
export type NewDistrict = typeof districts.$inferInsert;
|
|
9
9
|
export type SubdistrictRow = typeof subdistricts.$inferSelect;
|
|
10
10
|
export type NewSubdistrict = typeof subdistricts.$inferInsert;
|
|
11
|
-
export type
|
|
12
|
-
export type
|
|
11
|
+
export type LocationRow = typeof locations.$inferSelect;
|
|
12
|
+
export type NewLocation = typeof locations.$inferInsert;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "np-belarus",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "Belarus settlements and administrative divisions with PostgreSQL schemas and seed data.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Yury Samakhvalau",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
|
-
"
|
|
54
|
-
"validate": "node validate-
|
|
55
|
-
"build": "npm run
|
|
53
|
+
"locations": "node index.ts",
|
|
54
|
+
"validate": "node validate-locations.mjs",
|
|
55
|
+
"build": "npm run locations && npm run validate",
|
|
56
56
|
"build:package": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.package.json",
|
|
57
57
|
"prepack": "npm run build:package",
|
|
58
58
|
"typecheck": "tsc --noEmit"
|