@mailwoman/corpus 9.3.0 → 9.4.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 (165) hide show
  1. package/lib/recipes/anchor-absorption.ts +2 -2
  2. package/lib/recipes/bare-country.ts +2 -2
  3. package/lib/recipes/boundary-stress.ts +3 -1
  4. package/lib/recipes/country-balanced.ts +2 -1
  5. package/lib/recipes/cz-pcfirst-preposition.ts +2 -1
  6. package/lib/recipes/fr-admin-split.ts +2 -1
  7. package/lib/recipes/fr-bare-street.ts +2 -1
  8. package/lib/recipes/fr-fragment.ts +2 -1
  9. package/lib/recipes/fr-lieudit.ts +2 -2
  10. package/lib/recipes/fr-order.ts +2 -1
  11. package/lib/recipes/german.ts +2 -1
  12. package/lib/recipes/house-venue.ts +2 -1
  13. package/lib/recipes/intersection.ts +2 -1
  14. package/lib/recipes/locale.ts +2 -1
  15. package/lib/recipes/nl-postcode.ts +3 -1
  16. package/lib/recipes/no-fragment.ts +2 -8
  17. package/lib/recipes/no-street-led.ts +2 -8
  18. package/lib/recipes/no-street.ts +2 -1
  19. package/lib/recipes/po-box-cedex.ts +1 -1
  20. package/lib/recipes/po-box.ts +2 -1
  21. package/lib/recipes/scaffold.ts +0 -1
  22. package/lib/recipes/si-bare-village.ts +3 -1
  23. package/lib/recipes/street-affix.ts +3 -2
  24. package/lib/recipes/street-bare.ts +3 -1
  25. package/lib/recipes/street.ts +3 -1
  26. package/lib/recipes/sub-venue-sources.ts +2 -1
  27. package/lib/recipes/sub-venue.ts +2 -1
  28. package/lib/recipes/trailing-region.ts +3 -8
  29. package/lib/recipes/unit.ts +2 -2
  30. package/lib/tools/fetch/acra-sg.ts +174 -0
  31. package/lib/tools/fetch/download.ts +217 -2
  32. package/lib/tools/fetch/gcis-tw.ts +175 -0
  33. package/lib/tools/fetch/houjin-jp.ts +135 -0
  34. package/lib/tools/fetch/index.ts +27 -0
  35. package/lib/tools/fetch/juso-kr.ts +165 -0
  36. package/lib/tools/fetch/localdata-kr.ts +194 -0
  37. package/lib/tools/golden-relabel-street.ts +6 -3
  38. package/out/recipes/anchor-absorption.d.ts.map +1 -1
  39. package/out/recipes/anchor-absorption.js +2 -1
  40. package/out/recipes/anchor-absorption.js.map +1 -1
  41. package/out/recipes/bare-country.d.ts.map +1 -1
  42. package/out/recipes/bare-country.js +2 -1
  43. package/out/recipes/bare-country.js.map +1 -1
  44. package/out/recipes/boundary-stress.d.ts.map +1 -1
  45. package/out/recipes/boundary-stress.js +2 -1
  46. package/out/recipes/boundary-stress.js.map +1 -1
  47. package/out/recipes/country-balanced.d.ts.map +1 -1
  48. package/out/recipes/country-balanced.js +2 -1
  49. package/out/recipes/country-balanced.js.map +1 -1
  50. package/out/recipes/cz-pcfirst-preposition.d.ts.map +1 -1
  51. package/out/recipes/cz-pcfirst-preposition.js +2 -1
  52. package/out/recipes/cz-pcfirst-preposition.js.map +1 -1
  53. package/out/recipes/fr-admin-split.d.ts +1 -1
  54. package/out/recipes/fr-admin-split.d.ts.map +1 -1
  55. package/out/recipes/fr-admin-split.js +1 -1
  56. package/out/recipes/fr-admin-split.js.map +1 -1
  57. package/out/recipes/fr-bare-street.d.ts.map +1 -1
  58. package/out/recipes/fr-bare-street.js +2 -1
  59. package/out/recipes/fr-bare-street.js.map +1 -1
  60. package/out/recipes/fr-fragment.d.ts.map +1 -1
  61. package/out/recipes/fr-fragment.js +2 -1
  62. package/out/recipes/fr-fragment.js.map +1 -1
  63. package/out/recipes/fr-lieudit.d.ts +1 -1
  64. package/out/recipes/fr-lieudit.d.ts.map +1 -1
  65. package/out/recipes/fr-lieudit.js +1 -1
  66. package/out/recipes/fr-lieudit.js.map +1 -1
  67. package/out/recipes/fr-order.d.ts.map +1 -1
  68. package/out/recipes/fr-order.js +2 -1
  69. package/out/recipes/fr-order.js.map +1 -1
  70. package/out/recipes/german.d.ts.map +1 -1
  71. package/out/recipes/german.js +2 -1
  72. package/out/recipes/german.js.map +1 -1
  73. package/out/recipes/house-venue.d.ts.map +1 -1
  74. package/out/recipes/house-venue.js +2 -1
  75. package/out/recipes/house-venue.js.map +1 -1
  76. package/out/recipes/intersection.d.ts.map +1 -1
  77. package/out/recipes/intersection.js +2 -1
  78. package/out/recipes/intersection.js.map +1 -1
  79. package/out/recipes/locale.d.ts +1 -1
  80. package/out/recipes/locale.d.ts.map +1 -1
  81. package/out/recipes/locale.js +1 -1
  82. package/out/recipes/locale.js.map +1 -1
  83. package/out/recipes/nl-postcode.d.ts.map +1 -1
  84. package/out/recipes/nl-postcode.js +2 -1
  85. package/out/recipes/nl-postcode.js.map +1 -1
  86. package/out/recipes/no-fragment.d.ts.map +1 -1
  87. package/out/recipes/no-fragment.js +2 -1
  88. package/out/recipes/no-fragment.js.map +1 -1
  89. package/out/recipes/no-street-led.d.ts.map +1 -1
  90. package/out/recipes/no-street-led.js +2 -1
  91. package/out/recipes/no-street-led.js.map +1 -1
  92. package/out/recipes/no-street.d.ts.map +1 -1
  93. package/out/recipes/no-street.js +2 -1
  94. package/out/recipes/no-street.js.map +1 -1
  95. package/out/recipes/po-box-cedex.d.ts.map +1 -1
  96. package/out/recipes/po-box-cedex.js +2 -1
  97. package/out/recipes/po-box-cedex.js.map +1 -1
  98. package/out/recipes/po-box.d.ts.map +1 -1
  99. package/out/recipes/po-box.js +2 -1
  100. package/out/recipes/po-box.js.map +1 -1
  101. package/out/recipes/scaffold.d.ts +0 -1
  102. package/out/recipes/scaffold.d.ts.map +1 -1
  103. package/out/recipes/scaffold.js +0 -12
  104. package/out/recipes/scaffold.js.map +1 -1
  105. package/out/recipes/si-bare-village.d.ts.map +1 -1
  106. package/out/recipes/si-bare-village.js +2 -1
  107. package/out/recipes/si-bare-village.js.map +1 -1
  108. package/out/recipes/street-affix.d.ts.map +1 -1
  109. package/out/recipes/street-affix.js +3 -3
  110. package/out/recipes/street-affix.js.map +1 -1
  111. package/out/recipes/street-bare.d.ts.map +1 -1
  112. package/out/recipes/street-bare.js +2 -1
  113. package/out/recipes/street-bare.js.map +1 -1
  114. package/out/recipes/street.d.ts.map +1 -1
  115. package/out/recipes/street.js +2 -1
  116. package/out/recipes/street.js.map +1 -1
  117. package/out/recipes/sub-venue-sources.d.ts.map +1 -1
  118. package/out/recipes/sub-venue-sources.js +2 -1
  119. package/out/recipes/sub-venue-sources.js.map +1 -1
  120. package/out/recipes/sub-venue.d.ts.map +1 -1
  121. package/out/recipes/sub-venue.js +2 -1
  122. package/out/recipes/sub-venue.js.map +1 -1
  123. package/out/recipes/trailing-region.d.ts.map +1 -1
  124. package/out/recipes/trailing-region.js +2 -1
  125. package/out/recipes/trailing-region.js.map +1 -1
  126. package/out/recipes/unit.d.ts.map +1 -1
  127. package/out/recipes/unit.js +2 -1
  128. package/out/recipes/unit.js.map +1 -1
  129. package/out/tools/fetch/acra-sg.d.ts +23 -0
  130. package/out/tools/fetch/acra-sg.d.ts.map +1 -0
  131. package/out/tools/fetch/acra-sg.js +126 -0
  132. package/out/tools/fetch/acra-sg.js.map +1 -0
  133. package/out/tools/fetch/download.d.ts +65 -0
  134. package/out/tools/fetch/download.d.ts.map +1 -1
  135. package/out/tools/fetch/download.js +160 -2
  136. package/out/tools/fetch/download.js.map +1 -1
  137. package/out/tools/fetch/gcis-tw.d.ts +23 -0
  138. package/out/tools/fetch/gcis-tw.d.ts.map +1 -0
  139. package/out/tools/fetch/gcis-tw.js +135 -0
  140. package/out/tools/fetch/gcis-tw.js.map +1 -0
  141. package/out/tools/fetch/houjin-jp.d.ts +24 -0
  142. package/out/tools/fetch/houjin-jp.d.ts.map +1 -0
  143. package/out/tools/fetch/houjin-jp.js +102 -0
  144. package/out/tools/fetch/houjin-jp.js.map +1 -0
  145. package/out/tools/fetch/index.d.ts +27 -0
  146. package/out/tools/fetch/index.d.ts.map +1 -1
  147. package/out/tools/fetch/index.js +27 -0
  148. package/out/tools/fetch/index.js.map +1 -1
  149. package/out/tools/fetch/juso-kr.d.ts +30 -0
  150. package/out/tools/fetch/juso-kr.d.ts.map +1 -0
  151. package/out/tools/fetch/juso-kr.js +120 -0
  152. package/out/tools/fetch/juso-kr.js.map +1 -0
  153. package/out/tools/fetch/localdata-kr.d.ts +30 -0
  154. package/out/tools/fetch/localdata-kr.d.ts.map +1 -0
  155. package/out/tools/fetch/localdata-kr.js +139 -0
  156. package/out/tools/fetch/localdata-kr.js.map +1 -0
  157. package/out/tools/golden-relabel-street.d.ts.map +1 -1
  158. package/out/tools/golden-relabel-street.js +1 -2
  159. package/out/tools/golden-relabel-street.js.map +1 -1
  160. package/package.json +10 -10
  161. package/lib/name-prone-us-suffixes.ts +0 -12
  162. package/out/name-prone-us-suffixes.d.ts +0 -12
  163. package/out/name-prone-us-suffixes.d.ts.map +0 -1
  164. package/out/name-prone-us-suffixes.js +0 -12
  165. package/out/name-prone-us-suffixes.js.map +0 -1
@@ -5,15 +5,24 @@
5
5
  *
6
6
  * Download and manifest utilities for `mailwoman corpus fetch <source>`.
7
7
  */
8
- import { pathExists, readLocalTextFile } from "@mailwoman/core/fs/readers";
8
+ import { pathExists, readLocalTextFile, tryStat } from "@mailwoman/core/fs/readers";
9
9
  import { openWriteStream, pipeline, Readable } from "@mailwoman/core/fs/streams";
10
- import { writeLocalFile, writeLocalTextFile } from "@mailwoman/core/fs/writers";
10
+ import { movePath, writeLocalFile, writeLocalTextFile } from "@mailwoman/core/fs/writers";
11
11
  import { tryParsingJSON } from "@mailwoman/core/json";
12
12
  import { sleep } from "@mailwoman/core/utils/sleep";
13
13
  /**
14
14
  * Rate limited — retryable, the server is asking us to back off.
15
15
  */
16
16
  const HTTP_TOO_MANY_REQUESTS = 429;
17
+ /**
18
+ * The answer to a satisfiable `Range` request; anything else means the host ignored the range and would send the whole
19
+ * body again.
20
+ */
21
+ const HTTP_PARTIAL_CONTENT = 206;
22
+ /**
23
+ * The answer to a range that starts at or past the end of the body: the resume point is already the whole file.
24
+ */
25
+ const HTTP_RANGE_NOT_SATISFIABLE = 416;
17
26
  /**
18
27
  * Lowest 5xx status. Server-side failures are retryable; 4xx are not.
19
28
  */
@@ -157,4 +166,153 @@ export async function loadManifestEntries(path, key) {
157
166
  export async function writeManifest(path, manifest) {
158
167
  await writeLocalTextFile(JSON.stringify(manifest, null, 2) + "\n", path);
159
168
  }
169
+ /**
170
+ * Pipe a response body to `dest` and answer the byte count. The one primitive the portal fetchers share when the
171
+ * request is not a bare GET — a session cookie, a CSRF header, or a form POST stands between the listing and the file,
172
+ * so {@link streamDownload}'s URL-only contract does not fit and each module builds its own `Response` first. Writes a
173
+ * `.tmp` sibling and renames, so an interrupted transfer never lands at the final path looking complete.
174
+ */
175
+ export async function streamBodyToFile(res, dest) {
176
+ if (!res.body)
177
+ throw new HTTPStatusError(res.status, `HTTP ${res.status} with no body — ${res.url}`);
178
+ let bytes = 0;
179
+ const counter = new TransformStream({
180
+ transform(chunk, controller) {
181
+ bytes += chunk.byteLength;
182
+ controller.enqueue(chunk);
183
+ },
184
+ });
185
+ const tmp = dest + ".tmp";
186
+ await pipeline(Readable.fromWeb(res.body.pipeThrough(counter)), openWriteStream(tmp));
187
+ await movePath(tmp, dest);
188
+ return bytes;
189
+ }
190
+ /**
191
+ * The per-file entries of a {@link SourceCollectionManifest} keyed by file name, or an empty map when the manifest is
192
+ * missing or not in the collection shape, so a re-run after an interruption fetches only what is missing. The
193
+ * single-file modules' `loadManifestEntries` reads a bare array and is not this.
194
+ */
195
+ export async function loadCollectionFiles(path) {
196
+ const parsed = await readManifest(path);
197
+ const entries = new Map();
198
+ for (const entry of Array.isArray(parsed?.files) ? parsed.files : []) {
199
+ entries.set(entry.filename, entry);
200
+ }
201
+ return entries;
202
+ }
203
+ /**
204
+ * Run one transfer up to `1 + retries` times, pausing `retryDelayMs` between attempts. A government portal drops a
205
+ * multi-hundred-megabyte connection often enough that a collection fetch which lets the first `TypeError: terminated`
206
+ * propagate loses the whole run to one file; the per-file loop calls the transfer through this and records the failure
207
+ * only once the attempts are spent. The last error is rethrown so the caller can name the file it lost.
208
+ */
209
+ export async function withRetries(transfer, options = {}) {
210
+ const { retries = 3, retryDelayMs = DEFAULT_RETRY_DELAY_MS, report, label = "transfer" } = options;
211
+ let lastError;
212
+ for (let attempt = 0; attempt <= retries; attempt++) {
213
+ if (attempt > 0) {
214
+ report?.(` retry ${attempt}/${retries} after ${retryDelayMs}ms — ${label}`);
215
+ await sleep(retryDelayMs);
216
+ }
217
+ try {
218
+ return await transfer();
219
+ }
220
+ catch (error) {
221
+ lastError = error;
222
+ }
223
+ }
224
+ throw lastError instanceof Error ? lastError : new Error(String(lastError));
225
+ }
226
+ /**
227
+ * The byte count already at `path`, or 0 when nothing is there — the resume point of an interrupted range download.
228
+ */
229
+ async function bytesOnDisk(path) {
230
+ const stat = await tryStat(path);
231
+ return stat?.size ?? 0;
232
+ }
233
+ /**
234
+ * Download `url` to `dest` in ranges, resuming from whatever the `.tmp` sibling already holds. For a host that drops a
235
+ * long connection every few megabytes but answers `Range` with 206 (the Korean address portal does both, measured at
236
+ * 0.9–12 MB per connection against a 181 MB file), a whole-body transfer never finishes and a plain retry starts over;
237
+ * this one asks for the remainder each time and keeps what landed. The total comes from the first `Content-Range`, and
238
+ * the loop gives up after `maxConnections` connections so a host that keeps answering 206 with no bytes cannot spin.
239
+ * Answers the byte count written; throws when the host answers anything but 206 for a range.
240
+ */
241
+ export async function resumableDownload(options) {
242
+ const { url, dest, headers = {}, maxConnections = 400, retryDelayMs = DEFAULT_RETRY_DELAY_MS, report } = options;
243
+ const tmp = dest + ".tmp";
244
+ let have = await bytesOnDisk(tmp);
245
+ let total;
246
+ for (let connection = 0; connection < maxConnections; connection++) {
247
+ if (total !== undefined && have >= total)
248
+ break;
249
+ let res;
250
+ try {
251
+ res = await fetch(url, { headers: { ...headers, range: `bytes=${have}-` }, signal: AbortSignal.timeout(600_000) });
252
+ }
253
+ catch {
254
+ await sleep(retryDelayMs);
255
+ continue;
256
+ }
257
+ if (res.status === HTTP_RANGE_NOT_SATISFIABLE && have > 0) {
258
+ // Nothing past `have`: the file on disk is already the whole body (a parallel filler or an earlier run
259
+ // landed it), and `Content-Range: bytes */<total>` says how long it is.
260
+ const whole = /\*\/(\d+)/.exec(res.headers.get("content-range") ?? "")?.[1];
261
+ total = whole ? Number(whole) : have;
262
+ await res.body?.cancel();
263
+ break;
264
+ }
265
+ if (res.status !== HTTP_PARTIAL_CONTENT) {
266
+ throw new HTTPStatusError(res.status, `HTTP ${res.status} for a range request — ${url}`);
267
+ }
268
+ const range = /bytes \d+-\d+\/(\d+)/.exec(res.headers.get("content-range") ?? "")?.[1];
269
+ if (range) {
270
+ total = Number(range);
271
+ }
272
+ const before = have;
273
+ try {
274
+ // Append: the stream opens the file for appending so a partial body extends what earlier connections left.
275
+ await pipeline(Readable.fromWeb(res.body), openWriteStream(tmp, { flags: "a" }));
276
+ }
277
+ catch {
278
+ // The connection dropped mid-body; the bytes that landed are on disk, and the next range starts after them.
279
+ }
280
+ have = await bytesOnDisk(tmp);
281
+ if (have === before) {
282
+ await sleep(retryDelayMs);
283
+ }
284
+ else {
285
+ report?.(` ${(have / 1024 / 1024).toFixed(1)} MB${total ? ` of ${(total / 1024 / 1024).toFixed(1)} MB` : ""}`);
286
+ }
287
+ }
288
+ if (total === undefined || have < total) {
289
+ throw new Error(`resumable download stalled at ${have} of ${total ?? "?"} bytes — ${url}`);
290
+ }
291
+ await movePath(tmp, dest);
292
+ return have;
293
+ }
294
+ /**
295
+ * The `Set-Cookie` values of a response folded into one `Cookie` header value, so a second request to the same portal
296
+ * carries the session the first one opened.
297
+ */
298
+ export function cookieHeader(res) {
299
+ return res.headers
300
+ .getSetCookie()
301
+ .map((cookie) => cookie.split(";")[0])
302
+ .join("; ");
303
+ }
304
+ /**
305
+ * The file name a `Content-Disposition: attachment` header names, RFC 5987 form (`filename*=utf-8''…`) first, plain
306
+ * `filename="…"` second, or `fallback` when the header carries neither.
307
+ */
308
+ export function attachmentFilename(res, fallback) {
309
+ const disposition = res.headers.get("content-disposition") ?? "";
310
+ const extended = /filename\*=(?:utf-8|UTF-8)'[^']*'([^;]+)/.exec(disposition)?.[1];
311
+ if (extended)
312
+ return decodeURIComponent(extended.trim());
313
+ const plain = /filename="?([^";]+)"?/.exec(disposition)?.[1];
314
+ if (plain)
315
+ return decodeURIComponent(plain.trim());
316
+ return fallback;
317
+ }
160
318
  //# sourceMappingURL=download.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"download.js","sourceRoot":"","sources":["../../../lib/tools/fetch/download.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAChF,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAA;AAGnD;;GAEG;AACH,MAAM,sBAAsB,GAAG,GAAG,CAAA;AAElC;;GAEG;AACH,MAAM,qBAAqB,GAAG,GAAG,CAAA;AAEjC;;GAEG;AACH,MAAM,qBAAqB,GAAG,GAAG,CAAA;AAEjC;;GAEG;AACH;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAA;AAuC1C;;GAEG;AACH;;;;;;GAMG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAChC,MAAM,CAAQ;IAEvB,YAAY,MAAc,EAAE,OAAe;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAA;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACrB,CAAC;CACD;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC/C,OAAO,MAAM,KAAK,sBAAsB,IAAI,CAAC,MAAM,IAAI,qBAAqB,IAAI,MAAM,IAAI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;SAChB,YAAY,EAAE;SACd,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SACrC,IAAI,CAAC,IAAI,CAAC,CAAA;AACb,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAa,EAAE,QAAgB;IACjE,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAA;IAChE,MAAM,QAAQ,GAAG,0CAA0C,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IAElF,IAAI,QAAQ;QAAE,OAAO,kBAAkB,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;IACxD,MAAM,KAAK,GAAG,uBAAuB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IAE5D,IAAI,KAAK;QAAE,OAAO,kBAAkB,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAA;IAElD,OAAO,QAAQ,CAAA;AAChB,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Fetch Taiwan's company and business registers (公司登記資料, 商業登記資料) from the Ministry of
7
+ * Economic Affairs' commerce open-data platform, data.gcis.nat.gov.tw. The platform publishes the
8
+ * full registers as CSV files split by region (the six special municipalities each on their own,
9
+ * the rest of the island in four bands) and by industry letter, 148 files in all, each row carrying
10
+ * the registered address (公司地址) and, for companies, the tax office's business address
11
+ * (營業地址) as free text. This is the NOISY source for Taiwanese addresses: a person typed these.
12
+ *
13
+ * License: 政府資料開放授權條款-第1版 (Open Government Data License, Taiwan, v1.0). The platform's
14
+ * own dialog states the condition that binds: attribution in the form it prescribes, or the grant is
15
+ * void from the start ("未盡顯名標示義務者,視為自始未取得開放資料之授權"). The manifest records the
16
+ * prescribed wording per file so the corpus build and the model card can carry it.
17
+ *
18
+ * Invoke via `mailwoman corpus fetch gcis-tw --out-root <path>`.
19
+ */
20
+ import type { BaseFetchOptions, FetchSummary } from "#tools/fetch/download";
21
+ export type FetchGCISTWOptions = BaseFetchOptions;
22
+ export declare function fetchGCISTW(options: FetchGCISTWOptions, report?: (line: string) => void): Promise<FetchSummary>;
23
+ //# sourceMappingURL=gcis-tw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gcis-tw.d.ts","sourceRoot":"","sources":["../../../lib/tools/fetch/gcis-tw.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AASH,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAA4C,MAAM,uBAAuB,CAAA;AAgBrH,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,CAAA;AA+CjD,wBAAsB,WAAW,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAoFrH"}
@@ -0,0 +1,135 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Fetch Taiwan's company and business registers (公司登記資料, 商業登記資料) from the Ministry of
7
+ * Economic Affairs' commerce open-data platform, data.gcis.nat.gov.tw. The platform publishes the
8
+ * full registers as CSV files split by region (the six special municipalities each on their own,
9
+ * the rest of the island in four bands) and by industry letter, 148 files in all, each row carrying
10
+ * the registered address (公司地址) and, for companies, the tax office's business address
11
+ * (營業地址) as free text. This is the NOISY source for Taiwanese addresses: a person typed these.
12
+ *
13
+ * License: 政府資料開放授權條款-第1版 (Open Government Data License, Taiwan, v1.0). The platform's
14
+ * own dialog states the condition that binds: attribution in the form it prescribes, or the grant is
15
+ * void from the start ("未盡顯名標示義務者,視為自始未取得開放資料之授權"). The manifest records the
16
+ * prescribed wording per file so the corpus build and the model card can carry it.
17
+ *
18
+ * Invoke via `mailwoman corpus fetch gcis-tw --out-root <path>`.
19
+ */
20
+ import { BYTES_PER_KIB } from "@mailwoman/core/fs/formatters";
21
+ import { pathExists } from "@mailwoman/core/fs/readers";
22
+ import { makeDirectories } from "@mailwoman/core/fs/writers";
23
+ import { sha256File } from "@mailwoman/core/hash";
24
+ import { sleep } from "@mailwoman/core/utils/sleep";
25
+ import { join } from "path-ts";
26
+ import { loadCollectionFiles, streamBodyToFile, withRetries, writeManifest } from "#tools/fetch/download";
27
+ const SLUG = "gcis-tw";
28
+ const PORTAL = "https://data.gcis.nat.gov.tw";
29
+ const CATALOG_URL = `${PORTAL}/od/datacategory`;
30
+ const LICENSE = "政府資料開放授權條款-第1版 (Open Government Data License, Taiwan, v1.0) — http://data.gov.tw/license";
31
+ const ATTRIBUTION = "提供機關/經濟部商業發展署 [<dataset title>] — the 顯名聲明 each file's dialog prescribes";
32
+ const PACE_MS = 300;
33
+ /**
34
+ * The bulk register files: `<region><register>資料-<industry letter><industry>`. The per-industry API datasets and the
35
+ * monthly new-registration lists share the catalog and are not these.
36
+ */
37
+ const BULK_TITLE = /(公司登記資料|商業登記資料)-[A-Z]/;
38
+ /**
39
+ * A file name a shell and a manifest can carry: the title with its punctuation folded to underscores.
40
+ */
41
+ function filenameFor(title) {
42
+ return `${title
43
+ .replaceAll(/[()()、,/\\\s]+/g, "_")
44
+ .replaceAll(/_+/g, "_")
45
+ .replaceAll(/^_|_$/g, "")}.csv`;
46
+ }
47
+ async function listBulkDatasets() {
48
+ const res = await fetch(CATALOG_URL, { headers: { accept: "text/html" } });
49
+ if (!res.ok)
50
+ throw new Error(`gcis-tw: the catalog answered HTTP ${res.status}`);
51
+ const html = await res.text();
52
+ const datasets = [];
53
+ for (const [, path, rawTitle] of html.matchAll(/<a[^>]*href="(\/od\/detail[^"]*)"[^>]*>([^<]+)<\/a>/g)) {
54
+ const title = rawTitle?.trim();
55
+ if (!path || !title || !BULK_TITLE.test(title))
56
+ continue;
57
+ datasets.push({ title, detailPath: path.replace(/;jsessionid=[^?]*/, "") });
58
+ }
59
+ return datasets;
60
+ }
61
+ /**
62
+ * The `/od/file?oid=…` link a dataset's detail page hands its download dialog.
63
+ */
64
+ async function fileURLFor(dataset) {
65
+ const res = await fetch(`${PORTAL}${dataset.detailPath}`, { headers: { accept: "text/html" } });
66
+ if (!res.ok)
67
+ return undefined;
68
+ const html = await res.text();
69
+ const path = /showDialog\('(\/od\/file\?oid=[^']+)'\)/.exec(html)?.[1];
70
+ return path ? `${PORTAL}${path}` : undefined;
71
+ }
72
+ export async function fetchGCISTW(options, report) {
73
+ const destDir = join(options.outRoot, SLUG);
74
+ await makeDirectories(destDir);
75
+ const manifestPath = join(destDir, "MANIFEST.json");
76
+ const datasets = await listBulkDatasets();
77
+ report?.(`=== ${SLUG}: ${datasets.length} bulk register files in the catalog`);
78
+ const previous = await loadCollectionFiles(manifestPath);
79
+ const files = new Map();
80
+ let fetched = 0;
81
+ let skipped = 0;
82
+ const failedCodes = [];
83
+ for (const dataset of datasets) {
84
+ const filename = filenameFor(dataset.title);
85
+ const dest = join(destDir, filename);
86
+ const before = previous.get(filename);
87
+ if (before && (await pathExists(dest))) {
88
+ files.set(filename, before);
89
+ skipped++;
90
+ continue;
91
+ }
92
+ await sleep(PACE_MS);
93
+ const url = await fileURLFor(dataset);
94
+ if (!url) {
95
+ report?.(` ✗ no file link on the detail page for ${dataset.title}`);
96
+ failedCodes.push(dataset.title);
97
+ continue;
98
+ }
99
+ report?.(`--- ${dataset.title}`);
100
+ let bytes;
101
+ try {
102
+ bytes = await withRetries(async () => {
103
+ const res = await fetch(url, { headers: { accept: "*/*" }, signal: AbortSignal.timeout(1_800_000) });
104
+ if (!res.ok)
105
+ throw new Error(`HTTP ${res.status} for ${dataset.title}`);
106
+ return streamBodyToFile(res, dest);
107
+ }, { report, label: dataset.title });
108
+ }
109
+ catch (error) {
110
+ report?.(` ✗ ${error.message}`);
111
+ failedCodes.push(dataset.title);
112
+ continue;
113
+ }
114
+ if (bytes < BYTES_PER_KIB) {
115
+ report?.(` ✗ ${bytes} bytes — an error page, not the register`);
116
+ failedCodes.push(dataset.title);
117
+ continue;
118
+ }
119
+ const sha = await sha256File(dest);
120
+ files.set(filename, { source_url: url, downloaded_at: new Date().toISOString(), filename, sha256: sha, bytes });
121
+ fetched++;
122
+ report?.(` ✓ ${(bytes / 1024 / 1024).toFixed(1)} MB sha256=${sha}`);
123
+ const manifest = {
124
+ source: SLUG,
125
+ source_url: CATALOG_URL,
126
+ license: LICENSE,
127
+ attribution: ATTRIBUTION,
128
+ downloaded_at: new Date().toISOString(),
129
+ files: [...files.values()],
130
+ };
131
+ await writeManifest(manifestPath, manifest);
132
+ }
133
+ return { fetched, skipped, failed: failedCodes.length, failedCodes };
134
+ }
135
+ //# sourceMappingURL=gcis-tw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gcis-tw.js","sourceRoot":"","sources":["../../../lib/tools/fetch/gcis-tw.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAG9B,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAEzG,MAAM,IAAI,GAAG,SAAS,CAAA;AACtB,MAAM,MAAM,GAAG,8BAA8B,CAAA;AAC7C,MAAM,WAAW,GAAG,GAAG,MAAM,kBAAkB,CAAA;AAC/C,MAAM,OA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Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Fetch the National Tax Agency's corporate-number register (法人番号公表サイト 全件データ): every
7
+ * corporation assigned a number, about 5,000,000 rows, with the head-office address as one string
8
+ * (国内所在地) plus the prefecture and municipality split out and the postcode. The nationwide CSV
9
+ * in Unicode is one zip of about 255 MB. This is the NOISY source for Japanese addresses; the
10
+ * Overture rows the JP corpus is built from are the LABEL half.
11
+ *
12
+ * The agency states the three published fields may be used freely by anyone ("どなたでも自由にご利用
13
+ * いただくことができます"), with no attribution condition on the download page.
14
+ *
15
+ * The file sits behind a form: the page hands out a per-session token, and a POST with that token,
16
+ * `event=download` and the file number of the nationwide Unicode CSV answers the zip. The file
17
+ * number is read off the page rather than pinned, because the agency re-issues the files monthly.
18
+ *
19
+ * Invoke via `mailwoman corpus fetch houjin-jp --out-root <path>`.
20
+ */
21
+ import type { BaseFetchOptions, FetchSummary } from "#tools/fetch/download";
22
+ export type FetchHoujinJPOptions = BaseFetchOptions;
23
+ export declare function fetchHoujinJP(options: FetchHoujinJPOptions, report?: (line: string) => void): Promise<FetchSummary>;
24
+ //# sourceMappingURL=houjin-jp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"houjin-jp.d.ts","sourceRoot":"","sources":["../../../lib/tools/fetch/houjin-jp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAA4B,MAAM,uBAAuB,CAAA;AAWrG,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAA;AAenD,wBAAsB,aAAa,CAClC,OAAO,EAAE,oBAAoB,EAC7B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,YAAY,CAAC,CAgFvB"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Fetch the National Tax Agency's corporate-number register (法人番号公表サイト 全件データ): every
7
+ * corporation assigned a number, about 5,000,000 rows, with the head-office address as one string
8
+ * (国内所在地) plus the prefecture and municipality split out and the postcode. The nationwide CSV
9
+ * in Unicode is one zip of about 255 MB. This is the NOISY source for Japanese addresses; the
10
+ * Overture rows the JP corpus is built from are the LABEL half.
11
+ *
12
+ * The agency states the three published fields may be used freely by anyone ("どなたでも自由にご利用
13
+ * いただくことができます"), with no attribution condition on the download page.
14
+ *
15
+ * The file sits behind a form: the page hands out a per-session token, and a POST with that token,
16
+ * `event=download` and the file number of the nationwide Unicode CSV answers the zip. The file
17
+ * number is read off the page rather than pinned, because the agency re-issues the files monthly.
18
+ *
19
+ * Invoke via `mailwoman corpus fetch houjin-jp --out-root <path>`.
20
+ */
21
+ import { makeDirectories } from "@mailwoman/core/fs/writers";
22
+ import { sha256File } from "@mailwoman/core/hash";
23
+ import { join } from "path-ts";
24
+ import { attachmentFilename, cookieHeader, streamBodyToFile, withRetries, writeManifest } from "#tools/fetch/download";
25
+ const SLUG = "houjin-jp";
26
+ const PAGE_URL = "https://www.houjin-bangou.nta.go.jp/download/zenken/";
27
+ const FORM_URL = `${PAGE_URL}index.html`;
28
+ const TOKEN_FIELD = "jp.go.nta.houjin_bangou.framework.web.common.CNSFWTokenProcessor.request.token";
29
+ const LICENSE = "国税庁法人番号公表サイト — the three published fields are free for anyone to use (利用規約)";
30
+ const ATTRIBUTION = "国税庁 法人番号公表サイト (National Tax Agency, Corporate Number Publication Site)";
31
+ const USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) mailwoman-corpus-fetch";
32
+ /**
33
+ * The nationwide row of the "CSV形式・Unicode" table carries the file number in its `doDownload(N)` handler.
34
+ */
35
+ function nationwideUnicodeFileNumber(html) {
36
+ const start = html.indexOf('id="csv-unicode"');
37
+ if (start === -1)
38
+ return undefined;
39
+ const section = html.slice(start, html.indexOf('id="xml-unicode"', start));
40
+ const row = /全国[\s\S]{0,600}?doDownload\((\d+)\)/.exec(section);
41
+ return row?.[1];
42
+ }
43
+ export async function fetchHoujinJP(options, report) {
44
+ const destDir = join(options.outRoot, SLUG);
45
+ await makeDirectories(destDir);
46
+ const page = await fetch(PAGE_URL, { headers: { "user-agent": USER_AGENT, accept: "text/html" } });
47
+ if (!page.ok)
48
+ throw new Error(`houjin-jp: the download page answered HTTP ${page.status}`);
49
+ const html = await page.text();
50
+ const token = new RegExp(`${TOKEN_FIELD.replaceAll(".", "\\.")}" value="([^"]+)"`).exec(html)?.[1];
51
+ const fileNumber = nationwideUnicodeFileNumber(html);
52
+ if (!token || !fileNumber) {
53
+ report?.(` ✗ the page carried ${token ? "a token" : "no token"} and ${fileNumber ? `file ${fileNumber}` : "no nationwide Unicode CSV row"}`);
54
+ return { fetched: 0, skipped: 0, failed: 1, failedCodes: ["zenkoku-csv-unicode"] };
55
+ }
56
+ report?.(`=== ${SLUG}: nationwide CSV (Unicode), file ${fileNumber}`);
57
+ let filename = `zenkoku_all_${fileNumber}.zip`;
58
+ let bytes;
59
+ try {
60
+ bytes = await withRetries(async () => {
61
+ // A fresh page per attempt: the token is bound to the session cookie, and both may have lapsed.
62
+ const attemptPage = await fetch(PAGE_URL, { headers: { "user-agent": USER_AGENT, accept: "text/html" } });
63
+ const attemptToken = new RegExp(`${TOKEN_FIELD.replaceAll(".", "\\.")}" value="([^"]+)"`).exec(await attemptPage.text())?.[1];
64
+ if (!attemptToken)
65
+ throw new Error("the download page carried no token");
66
+ const res = await fetch(FORM_URL, {
67
+ method: "POST",
68
+ headers: {
69
+ "user-agent": USER_AGENT,
70
+ cookie: cookieHeader(attemptPage),
71
+ referer: PAGE_URL,
72
+ "content-type": "application/x-www-form-urlencoded",
73
+ },
74
+ body: new URLSearchParams({ [TOKEN_FIELD]: attemptToken, event: "download", selDlFileNo: fileNumber }),
75
+ signal: AbortSignal.timeout(1_800_000),
76
+ });
77
+ if (!res.ok || !(res.headers.get("content-type") ?? "").includes("octet-stream")) {
78
+ throw new Error(`HTTP ${res.status} ${res.headers.get("content-type") ?? ""}`);
79
+ }
80
+ filename = attachmentFilename(res, filename);
81
+ return streamBodyToFile(res, join(destDir, filename));
82
+ }, { report, label: filename });
83
+ }
84
+ catch (error) {
85
+ report?.(` ✗ ${error.message}`);
86
+ return { fetched: 0, skipped: 0, failed: 1, failedCodes: ["zenkoku-csv-unicode"] };
87
+ }
88
+ const dest = join(destDir, filename);
89
+ const sha = await sha256File(dest);
90
+ report?.(` ✓ ${filename} ${(bytes / 1024 / 1024).toFixed(1)} MB sha256=${sha}`);
91
+ const manifest = {
92
+ source: SLUG,
93
+ source_url: PAGE_URL,
94
+ license: LICENSE,
95
+ attribution: ATTRIBUTION,
96
+ downloaded_at: new Date().toISOString(),
97
+ files: [{ source_url: FORM_URL, downloaded_at: new Date().toISOString(), filename, sha256: sha, bytes }],
98
+ };
99
+ await writeManifest(join(destDir, "MANIFEST.json"), manifest);
100
+ return { fetched: 1, skipped: 0, failed: 0, failedCodes: [] };
101
+ }
102
+ //# sourceMappingURL=houjin-jp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"houjin-jp.js","sourceRoot":"","sources":["../../../lib/tools/fetch/houjin-jp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAG9B,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAEtH,MAAM,IAAI,GAAG,WAAW,CAAA;AACxB,MAAM,QAAQ,GAAG,sDAAsD,CAAA;AACvE,MAAM,QAAQ,GAAG,GAAG,QAAQ,YAAY,CAAA;AACxC,MAAM,WAAW,GAAG,gFAAgF,CAAA;AACp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QAAQ,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,GAAG,EAAE,CAAC,CAAA;IAEjF,MAAM,QAAQ,GAA6B;QAC1C,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,WAAW;QACxB,aAAa,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACvC,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;KACxG,CAAA;IAED,MAAM,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,CAAC,EAAE,QAAQ,CAAC,CAAA;IAE7D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAA;AAC9D,CAAC"}
@@ -57,6 +57,18 @@
57
57
  * - `state-hi-schools` — Hawaii DOE school directory (original XLSX; HIDOE + PCS sheets). Tier A
58
58
  * (state PD-equivalent).
59
59
  * - `tiger-full` — US Census TIGER 2024 ADDRFEAT, all US counties. Tier A (US PD).
60
+ * - `juso-kr` — the Korean road-name address register (주소DB, plus the English road-name DB) from
61
+ * business.juso.go.kr, the LABEL source for Korean. Tier B ("이용허락범위 제한 없음", attribution).
62
+ * - `localdata-kr` — Korea's local-government permit registry, one CSV per category, each row carrying
63
+ * the lot-number AND road-name address of one premises plus a coordinate. The NOISY source for
64
+ * Korean. Tier B (same label as `juso-kr`).
65
+ * - `gcis-tw` — Taiwan's company and business registers from the economic ministry's open-data
66
+ * platform, 148 files by region and industry. The NOISY source for Taiwanese. Tier B (Open
67
+ * Government Data License v1.0 — the prescribed attribution is a condition of the grant).
68
+ * - `acra-sg` — Singapore's ACRA corporate-entity register, 27 CSVs with the address FIELDED. The
69
+ * NOISY source for Singapore. Tier B (Singapore Open Data Licence 1.0).
70
+ * - `houjin-jp` — the National Tax Agency's corporate-number register, the nationwide Unicode CSV.
71
+ * The NOISY source for Japanese. Tier A-equivalent (free use, no attribution condition stated).
60
72
  *
61
73
  * License tiers per `docs/licensing-strategy.md` (or the playpen knowledge base mirror at
62
74
  * `docs/docs/projects/mailwoman/licensing-strategy.md`). `openaddresses` is a **Tier-mixed**
@@ -96,11 +108,16 @@
96
108
  * MANIFEST is well-formed.
97
109
  * 5. Add the source's adapter (or extend an existing one) under `corpus/src/adapters/`.
98
110
  */
111
+ import { fetchACRASG } from "#tools/fetch/acra-sg";
99
112
  import { fetchBan } from "#tools/fetch/ban";
113
+ import { fetchGCISTW } from "#tools/fetch/gcis-tw";
100
114
  import { fetchGeonamesDumps } from "#tools/fetch/geonames-dump";
101
115
  import { fetchGeonamesPostal } from "#tools/fetch/geonames-postal";
116
+ import { fetchHoujinJP } from "#tools/fetch/houjin-jp";
102
117
  import { fetchHRSA } from "#tools/fetch/hrsa";
103
118
  import { fetchIMLSPLS } from "#tools/fetch/imls-pls";
119
+ import { fetchJusoKR } from "#tools/fetch/juso-kr";
120
+ import { fetchLocaldataKR } from "#tools/fetch/localdata-kr";
104
121
  import { fetchNAD } from "#tools/fetch/nad";
105
122
  import { fetchNPPES } from "#tools/fetch/nppes";
106
123
  import { fetchOpenAddresses } from "#tools/fetch/openaddresses";
@@ -109,11 +126,16 @@ import { fetchStateHISchools } from "#tools/fetch/state-hi-schools";
109
126
  import { fetchStateSources } from "#tools/fetch/state-sources";
110
127
  import { fetchTigerFull } from "#tools/fetch/tiger-full";
111
128
  import { fetchWikidataSubVenue } from "#tools/fetch/wikidata-subvenue";
129
+ export * from "#tools/fetch/acra-sg";
112
130
  export * from "#tools/fetch/ban";
131
+ export * from "#tools/fetch/gcis-tw";
113
132
  export * from "#tools/fetch/geonames-dump";
114
133
  export * from "#tools/fetch/geonames-postal";
134
+ export * from "#tools/fetch/houjin-jp";
115
135
  export * from "#tools/fetch/hrsa";
116
136
  export * from "#tools/fetch/imls-pls";
137
+ export * from "#tools/fetch/juso-kr";
138
+ export * from "#tools/fetch/localdata-kr";
117
139
  export * from "#tools/fetch/nad";
118
140
  export * from "#tools/fetch/nppes";
119
141
  export * from "#tools/fetch/openaddresses";
@@ -126,7 +148,12 @@ export * from "#tools/fetch/wikidata-subvenue";
126
148
  * The fetch-source registry: id → module entry point. Each entry point takes its own options interface.
127
149
  */
128
150
  export declare const FETCH_SOURCES: {
151
+ readonly "acra-sg": typeof fetchACRASG;
129
152
  readonly ban: typeof fetchBan;
153
+ readonly "gcis-tw": typeof fetchGCISTW;
154
+ readonly "houjin-jp": typeof fetchHoujinJP;
155
+ readonly "juso-kr": typeof fetchJusoKR;
156
+ readonly "localdata-kr": typeof fetchLocaldataKR;
130
157
  readonly nad: typeof fetchNAD;
131
158
  readonly "geonames-dump": typeof fetchGeonamesDumps;
132
159
  readonly "geonames-postal": typeof fetchGeonamesPostal;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/tools/fetch/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE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