@geoalgeria/poste 1.0.2 → 2.0.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.
@@ -0,0 +1,68 @@
1
+ {
2
+ "@context": "https://schema.org",
3
+ "@type": "Dataset",
4
+ "name": "Algeria post offices & ATMs",
5
+ "alternateName": "Bureaux de poste et GAB d'Algérie",
6
+ "identifier": "@geoalgeria/poste",
7
+ "description": "Post offices and Baridi Mob ATMs from Algérie Poste's baridimap portal.",
8
+ "conditionsOfAccess": "Data © Algérie Poste; redistributed for reference",
9
+ "isAccessibleForFree": true,
10
+ "creator": {
11
+ "@type": "Organization",
12
+ "name": "Yasser's Studio",
13
+ "url": "https://yasser.studio"
14
+ },
15
+ "spatialCoverage": {
16
+ "@type": "Place",
17
+ "name": "Algeria",
18
+ "geo": {
19
+ "@type": "GeoShape",
20
+ "box": "19.562719 -8.165285 37.067213 10.195022"
21
+ }
22
+ },
23
+ "variableMeasured": "5934 records, 58 wilayas",
24
+ "distribution": [
25
+ {
26
+ "@type": "DataDownload",
27
+ "name": "postoffices (JSON)",
28
+ "encodingFormat": "application/json",
29
+ "contentUrl": "https://cdn.jsdelivr.net/npm/@geoalgeria/poste/data/postoffices.json"
30
+ },
31
+ {
32
+ "@type": "DataDownload",
33
+ "name": "postoffices (CSV)",
34
+ "encodingFormat": "text/csv",
35
+ "contentUrl": "https://cdn.jsdelivr.net/npm/@geoalgeria/poste/data/csv/postoffices.csv"
36
+ },
37
+ {
38
+ "@type": "DataDownload",
39
+ "name": "postoffices (GeoJSON)",
40
+ "encodingFormat": "application/geo+json",
41
+ "contentUrl": "https://cdn.jsdelivr.net/npm/@geoalgeria/poste/data/geojson/postoffices.geojson"
42
+ },
43
+ {
44
+ "@type": "DataDownload",
45
+ "name": "atms (JSON)",
46
+ "encodingFormat": "application/json",
47
+ "contentUrl": "https://cdn.jsdelivr.net/npm/@geoalgeria/poste/data/atms.json"
48
+ },
49
+ {
50
+ "@type": "DataDownload",
51
+ "name": "atms (CSV)",
52
+ "encodingFormat": "text/csv",
53
+ "contentUrl": "https://cdn.jsdelivr.net/npm/@geoalgeria/poste/data/csv/atms.csv"
54
+ },
55
+ {
56
+ "@type": "DataDownload",
57
+ "name": "atms (GeoJSON)",
58
+ "encodingFormat": "application/geo+json",
59
+ "contentUrl": "https://cdn.jsdelivr.net/npm/@geoalgeria/poste/data/geojson/atms.geojson"
60
+ }
61
+ ],
62
+ "dateModified": "2026-06-08",
63
+ "url": "https://geoalgeria.com",
64
+ "sameAs": "https://github.com/yasserstudio/geoalgeria",
65
+ "citation": [
66
+ "Algérie Poste — baridimap.poste.dz — Data © Algérie Poste; redistributed for reference"
67
+ ]
68
+ }
package/package.json CHANGED
@@ -1,19 +1,28 @@
1
1
  {
2
2
  "name": "@geoalgeria/poste",
3
- "version": "1.0.2",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "description": "Algeria post offices (3908) and ATMs (2026) — real postal codes, bilingual names, coordinates, commune/wilaya linkage. Sourced from Algérie Poste (baridimap.poste.dz). JSON, CSV, GeoJSON.",
6
6
  "main": "index.js",
7
+ "types": "types/index.d.ts",
7
8
  "exports": {
8
- ".": "./index.js",
9
+ ".": {
10
+ "types": "./types/index.d.ts",
11
+ "default": "./index.js"
12
+ },
9
13
  "./data/*": "./data/*"
10
14
  },
11
15
  "files": [
16
+ "dataset-metadata.json",
12
17
  "data/**/*.json",
18
+ "data/**/*.csv",
19
+ "data/**/*.geojson",
20
+ "types/",
13
21
  "index.js"
14
22
  ],
15
23
  "scripts": {
16
- "fetch": "node scripts/fetch.mjs"
24
+ "fetch": "node scripts/fetch.mjs",
25
+ "test": "node ../../scripts/validate-packages.mjs poste"
17
26
  },
18
27
  "keywords": [
19
28
  "algeria",
@@ -0,0 +1,153 @@
1
+ // Type definitions for @geoalgeria/poste (schema v2).
2
+ // Post offices and ATMs (GAB) of Algérie Poste, sourced from baridimap.poste.dz.
3
+ // Records follow the canonical GeoRecord contract (zero-padded string
4
+ // wilaya_code, string ONS commune_code, geo_precision/geo_method/source) plus
5
+ // the postal-specific fields below.
6
+
7
+ /** Coordinate provenance, coarse-grained. Detail lives in `geo_method`.
8
+ * `null` when the record has no coordinate at all. */
9
+ export type GeoPrecision = "exact" | "approximate" | null;
10
+
11
+ /** How the coordinate was obtained. `null` on an ungeocoded record — no method
12
+ * produced a point, so none can be named. */
13
+ export type GeoMethod = "baridimap" | null;
14
+
15
+ /** Office class/category as published by Algérie Poste. */
16
+ export type OfficeClass = "CE" | "GA" | "HC" | "R1" | "R2" | "R3" | "R4";
17
+
18
+ /** ATM operational status as published by Algérie Poste. `"1"` is an
19
+ * undocumented source value carried through verbatim rather than guessed at. */
20
+ export type AtmStatus = "OPEN" | "CLOSED (OFFLINE)" | "1";
21
+
22
+ /** A post office (bureau de poste). */
23
+ export interface PostOffice {
24
+ /** Stable id, unique within this file. Opaque — do not parse. */
25
+ id: string;
26
+ /** Office name (French / transliterated). */
27
+ name: string;
28
+ /** Office name in Arabic. */
29
+ name_ar: string;
30
+ /** Wilaya code, zero-padded 2-digit string ("01".."69"). */
31
+ wilaya_code: string;
32
+ /** Commune (ONS) code as a 4-digit string. */
33
+ commune_code: string;
34
+ /** Commune name (French). */
35
+ commune: string;
36
+ /** Commune name in Arabic. */
37
+ commune_ar: string;
38
+ /** Latitude, or null when the office is not geocoded. */
39
+ lat: number | null;
40
+ /** Longitude, or null. Both coordinates are set, or both are null. */
41
+ lng: number | null;
42
+ /** `"exact"` for a Baridimap point, `null` when `lat`/`lng` are null —
43
+ * a record with no point asserts no precision. */
44
+ geo_precision: GeoPrecision;
45
+ /** How `lat`/`lng` were obtained; null when there are none. */
46
+ geo_method: GeoMethod;
47
+ /** Provenance key into `metadata.sources[]` — always "baridimap". */
48
+ source: "baridimap";
49
+ /** Office class/category. */
50
+ class: OfficeClass;
51
+ /** 5-digit postal code. */
52
+ postal_code: string;
53
+ /** Previous postal code, or null when the office was never renumbered. */
54
+ postal_code_old: string | null;
55
+ /** Street address. */
56
+ address: string;
57
+ }
58
+
59
+ /** An ATM (GAB — distributeur automatique). */
60
+ export interface Atm {
61
+ /** Stable id, unique within this file. Opaque — do not parse. */
62
+ id: string;
63
+ /** ATM name/label. */
64
+ name: string;
65
+ /** Wilaya code, zero-padded 2-digit string ("01".."69"). */
66
+ wilaya_code: string;
67
+ /** Commune (ONS) code. Currently null for every ATM (the source resolves ATMs
68
+ * to a commune name only); typed as `string | null` so a future populated
69
+ * value is not a breaking change. */
70
+ commune_code: string | null;
71
+ /** Commune name (French). */
72
+ commune: string;
73
+ /** Commune name in Arabic. */
74
+ commune_ar: string;
75
+ /** Latitude, or null when the ATM is not geocoded. */
76
+ lat: number | null;
77
+ /** Longitude, or null. Both coordinates are set, or both are null. */
78
+ lng: number | null;
79
+ /** `"exact"` for a Baridimap point, `null` when `lat`/`lng` are null. */
80
+ geo_precision: GeoPrecision;
81
+ /** How `lat`/`lng` were obtained; null when there are none. */
82
+ geo_method: GeoMethod;
83
+ /** Provenance key into `metadata.sources[]` — always "baridimap". */
84
+ source: "baridimap";
85
+ /** Operational status. */
86
+ status: AtmStatus;
87
+ /** 5-digit postal code of the hosting office. */
88
+ postal_code: string;
89
+ /** Previous postal code, or null when never renumbered. */
90
+ postal_code_old: string | null;
91
+ /** Street address. Currently null for every ATM (the source omits it); typed
92
+ * as `string | null` so a future populated value is not a breaking change. */
93
+ address: string | null;
94
+ }
95
+
96
+ /** One provenance entry in `metadata.sources[]`. */
97
+ export interface SourceRef {
98
+ key: string;
99
+ name: string;
100
+ url?: string;
101
+ license: string;
102
+ retrieved?: string;
103
+ evidence_type?: "official" | "crowdsourced" | "derived";
104
+ }
105
+
106
+ /** One data file described in `metadata.entities[]`. */
107
+ export interface EntityRef {
108
+ file: string;
109
+ count: number;
110
+ }
111
+
112
+ /** Dataset metadata (data/metadata.json) — canonical fields plus postal stats. */
113
+ export interface Metadata {
114
+ package: "@geoalgeria/poste";
115
+ schema_version: string;
116
+ title_fr: string;
117
+ title_ar: string;
118
+ title_en: string;
119
+ /** Post offices + ATMs. */
120
+ record_count: number;
121
+ /** Records with coordinates. */
122
+ geocoded_count: number;
123
+ geocoded_pct: number;
124
+ /** Count by `geo_precision` among geocoded records; ungeocoded records carry none. */
125
+ precision: { exact: number; approximate: number };
126
+ estimated_universe: number | null;
127
+ coverage_pct: number | null;
128
+ coverage_note: string;
129
+ wilayas_covered: number;
130
+ /** `[minLng, minLat, maxLng, maxLat]`, or null when nothing is geocoded. */
131
+ bbox: [number, number, number, number] | null;
132
+ /** Per-file record counts (postoffices.json, atms.json). */
133
+ entities: EntityRef[];
134
+ sources: SourceRef[];
135
+ license: string;
136
+ /** ISO date (YYYY-MM-DD) the dataset was regenerated. */
137
+ updated: string;
138
+ distinct_postal_codes: number;
139
+ }
140
+
141
+ /** All post offices. */
142
+ export function postOffices(): PostOffice[];
143
+ /** All ATMs. */
144
+ export function atms(): Atm[];
145
+ /** Dataset metadata. */
146
+ export function metadata(): Metadata;
147
+
148
+ declare const _default: {
149
+ postOffices: typeof postOffices;
150
+ atms: typeof atms;
151
+ metadata: typeof metadata;
152
+ };
153
+ export default _default;