@urbankitstudio/atlas 0.6.38 → 0.6.39
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/README.md +2 -0
- package/dist/index.cjs +163 -2
- package/dist/index.d.cts +103 -1
- package/dist/index.d.ts +103 -1
- package/dist/index.js +154 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -104,6 +104,8 @@ For single-address owner lookups in the browser, the free [Owner Lookup](https:/
|
|
|
104
104
|
| `buildCityQuery(dataset, street)` | the URL urbankitstudio.com sends for that dataset and street (on a table that splits the address into columns, the street name is derived first; see below); `null` when the lookup needs a point or a parcel id first |
|
|
105
105
|
| `citiesForCounty(stateSlug, countySlug)` | `CitySummary[]` — the covered cities inside one atlas county |
|
|
106
106
|
| `cityPath(slug, kind)` | URL path of the city's page under `/tools/property-report` or `/tools/zoning-cases` |
|
|
107
|
+
| `pausedAnswer(entry, record, page?)` | `CountyPausedAnswer` — the `coverage` block (`status: "paused"`) the hosted API returns for a county paused by its terms or a law; which counties are paused is live data at `GET https://urbankitstudio.com/api/atlas/status` (`paused`) |
|
|
108
|
+
| `accessBlocks(entry, flag)`, `flagsFor(preset)`, `pausedFlags(flags)`, `presetOf(flags)` | the seven surface flags (`ACCESS_FLAGS`: `paid_lookup`, `paid_enrich`, `paid_bulk`, `paid_lists`, `free_site_lookup`, `free_site_lists`, `free_discovery`) and the presets `paid-off`, `paid-lists-off`, `all-off` (`PRESET_FLAGS`); `accessBlocks` says whether one surface is paused for a county |
|
|
107
109
|
|
|
108
110
|
The full typed root is also exported as `atlas`:
|
|
109
111
|
|
package/dist/index.cjs
CHANGED
|
@@ -114,8 +114,9 @@ function stateSlugFromAbbrev(input) {
|
|
|
114
114
|
return null;
|
|
115
115
|
}
|
|
116
116
|
var COUNTY_UNIT_SUFFIX = /\b(?:County|Parish|Borough|Municipality|Census Area|City|Statewide|Planning Region|District of Columbia)$/i;
|
|
117
|
+
var APOSTROPHES = /['\u2019\u02bc]/g;
|
|
117
118
|
function requestCountySlug(county) {
|
|
118
|
-
const name = county.trim();
|
|
119
|
+
const name = county.replace(APOSTROPHES, "").trim();
|
|
119
120
|
if (!canonicalRequestSlug(name)) return "";
|
|
120
121
|
const hasUnit = COUNTY_UNIT_SUFFIX.test(name) || COUNTY_UNIT_SUFFIX.test(name.replace(/[-_]+/g, " "));
|
|
121
122
|
return canonicalRequestSlug(hasUnit ? name : `${name} County`);
|
|
@@ -228,6 +229,155 @@ function coverageAnswer(record, ref) {
|
|
|
228
229
|
return { ...block, message: coverageAnswerText(block) };
|
|
229
230
|
}
|
|
230
231
|
|
|
232
|
+
// src/access.ts
|
|
233
|
+
var ACCESS_FLAGS = [
|
|
234
|
+
"paid_lookup",
|
|
235
|
+
"paid_enrich",
|
|
236
|
+
"paid_bulk",
|
|
237
|
+
"paid_lists",
|
|
238
|
+
"free_site_lookup",
|
|
239
|
+
"free_site_lists",
|
|
240
|
+
"free_discovery"
|
|
241
|
+
];
|
|
242
|
+
var ACCESS_PRESETS = ["paid-off", "paid-lists-off", "all-off"];
|
|
243
|
+
var PRESET_FLAGS = {
|
|
244
|
+
"paid-off": ["paid_lookup", "paid_enrich", "paid_bulk", "paid_lists"],
|
|
245
|
+
"paid-lists-off": ["paid_bulk", "paid_lists"],
|
|
246
|
+
"all-off": ACCESS_FLAGS
|
|
247
|
+
};
|
|
248
|
+
function flagsFor(preset) {
|
|
249
|
+
const on = new Set(PRESET_FLAGS[preset]);
|
|
250
|
+
return Object.fromEntries(ACCESS_FLAGS.map((f) => [f, on.has(f)]));
|
|
251
|
+
}
|
|
252
|
+
function pausedFlags(flags) {
|
|
253
|
+
return ACCESS_FLAGS.filter((f) => flags[f] === true);
|
|
254
|
+
}
|
|
255
|
+
function presetOf(flags) {
|
|
256
|
+
const paused = pausedFlags(flags).join(",");
|
|
257
|
+
return ACCESS_PRESETS.find((p) => PRESET_FLAGS[p].join(",") === paused) ?? "custom";
|
|
258
|
+
}
|
|
259
|
+
var ACCESS_REASONS = [
|
|
260
|
+
"licence-terms",
|
|
261
|
+
"state-law",
|
|
262
|
+
"county-request",
|
|
263
|
+
"data-quality",
|
|
264
|
+
"upstream-broken",
|
|
265
|
+
"other"
|
|
266
|
+
];
|
|
267
|
+
function accessBlocks(entry, flag) {
|
|
268
|
+
return entry?.flags[flag] === true;
|
|
269
|
+
}
|
|
270
|
+
var ARCGIS_REST_RE = /(?:^|[^a-z0-9_-])rest\/services|sharing\/rest|arcgis\.com\/home\/item|(?:Map|Feature|Image|GP|VectorTile|Scene)Server/i;
|
|
271
|
+
function discoverySafeContact(value, record) {
|
|
272
|
+
if (!value) return null;
|
|
273
|
+
if (value.length > MAX_MATCHED_LENGTH) return null;
|
|
274
|
+
const d = decoded(value);
|
|
275
|
+
const v = d.toLowerCase().replace(STOPS_RE, ".");
|
|
276
|
+
const nfkc = d.normalize("NFKC").toLowerCase().replace(STOPS_RE, ".");
|
|
277
|
+
const folded = nfkc.replace(IGNORABLE_RE, "");
|
|
278
|
+
if (v.length > MAX_MATCHED_LENGTH || nfkc.length > MAX_MATCHED_LENGTH) return null;
|
|
279
|
+
const texts = withControlsDeleted([v, folded]);
|
|
280
|
+
if (texts.some((t) => ARCGIS_REST_RE.test(t))) return null;
|
|
281
|
+
const endpoints = [];
|
|
282
|
+
for (const ep of record?.endpoints ?? []) {
|
|
283
|
+
const host = hostnameOf(ep.url);
|
|
284
|
+
const key = host && hostKey(host);
|
|
285
|
+
if (host && key) endpoints.push({ key, host });
|
|
286
|
+
}
|
|
287
|
+
if (endpoints.length === 0) return value;
|
|
288
|
+
for (const form of texts) {
|
|
289
|
+
for (const name of dottedNames(form)) {
|
|
290
|
+
const host = hostnameOf(`http://${name}`);
|
|
291
|
+
const key = host && hostKey(host);
|
|
292
|
+
if (host && key && endpoints.some((ep) => key === ep.key || host.endsWith(`.${ep.host}`))) return null;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
const fullwidth = v.replace(/[!-~]/g, (ch) => String.fromCharCode(ch.charCodeAt(0) - 65248));
|
|
296
|
+
const boundaryForms = withControlsDeleted([v, nfkc, fullwidth].flatMap((form) => [form, form.replace(IGNORABLE_RE, "")]));
|
|
297
|
+
for (const ep of endpoints) {
|
|
298
|
+
const bounded = labelBounded(ep.key);
|
|
299
|
+
if (boundaryForms.some((form) => bounded.test(form))) return null;
|
|
300
|
+
}
|
|
301
|
+
return value;
|
|
302
|
+
}
|
|
303
|
+
function discoverySafeUrl(value, record) {
|
|
304
|
+
const text2 = discoverySafeContact(value, record);
|
|
305
|
+
if (text2 === null) return null;
|
|
306
|
+
let parsed;
|
|
307
|
+
try {
|
|
308
|
+
parsed = new URL(text2.trim());
|
|
309
|
+
} catch {
|
|
310
|
+
return text2;
|
|
311
|
+
}
|
|
312
|
+
return discoverySafeContact(parsed.href, record) === null ? null : text2;
|
|
313
|
+
}
|
|
314
|
+
var MAX_MATCHED_LENGTH = 2048;
|
|
315
|
+
var STOPS_RE = /[。.。]/g;
|
|
316
|
+
var IGNORABLE_RE = /[\p{Cf}\p{Default_Ignorable_Code_Point}]/gu;
|
|
317
|
+
var CONTROL_RE = /\p{Cc}/gu;
|
|
318
|
+
function withControlsDeleted(forms) {
|
|
319
|
+
const out = [...forms];
|
|
320
|
+
for (const form of forms) {
|
|
321
|
+
const deleted = form.replace(CONTROL_RE, "");
|
|
322
|
+
if (deleted !== form) out.push(deleted);
|
|
323
|
+
}
|
|
324
|
+
return out;
|
|
325
|
+
}
|
|
326
|
+
function labelBounded(key) {
|
|
327
|
+
return new RegExp(`(?:^|[^a-z0-9])${key.replace(/[\\^$.*+?()[\]{}|/]/g, "\\$&")}(?![a-z0-9])`, "u");
|
|
328
|
+
}
|
|
329
|
+
var NAME_RUN_RE = /[\p{L}\p{N}\p{M}_.-]+/gu;
|
|
330
|
+
function dottedNames(form) {
|
|
331
|
+
const names = [];
|
|
332
|
+
for (const run of form.match(NAME_RUN_RE) ?? []) {
|
|
333
|
+
for (const part of run.split(/\.{2,}/)) {
|
|
334
|
+
const name = part.replace(/^\.+|\.+$/g, "");
|
|
335
|
+
if (name.includes(".")) names.push(name);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
return names;
|
|
339
|
+
}
|
|
340
|
+
function decoded(value) {
|
|
341
|
+
return value.replace(/(?:%[0-9a-f]{2})+/gi, (run) => {
|
|
342
|
+
try {
|
|
343
|
+
return decodeURIComponent(run);
|
|
344
|
+
} catch {
|
|
345
|
+
return run;
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
function hostKey(hostname) {
|
|
350
|
+
const h = hostname.replace(/^www\./, "");
|
|
351
|
+
return h.includes(".") || h.includes(":") ? h : null;
|
|
352
|
+
}
|
|
353
|
+
function hostnameOf(url) {
|
|
354
|
+
try {
|
|
355
|
+
return new URL(url).hostname.toLowerCase().replace(/\.+$/, "");
|
|
356
|
+
} catch {
|
|
357
|
+
return null;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
var ATLAS_COUNTY_PAGE_BASE = "https://urbankitstudio.com/parcel-atlas";
|
|
361
|
+
function pausedAnswer(entry, record, page = {}) {
|
|
362
|
+
const withheld = accessBlocks(entry, "free_discovery");
|
|
363
|
+
const freeOff = accessBlocks(entry, "free_site_lookup") || withheld;
|
|
364
|
+
const office = (v, check = discoverySafeContact) => withheld ? check(v, record) : v ?? null;
|
|
365
|
+
const pageUrl = !freeOff && page.state_slug && page.county_slug ? `${ATLAS_COUNTY_PAGE_BASE}/${page.state_slug}/${page.county_slug}` : null;
|
|
366
|
+
return {
|
|
367
|
+
indexed: true,
|
|
368
|
+
status: "paused",
|
|
369
|
+
preset: presetOf(entry.flags),
|
|
370
|
+
paused: pausedFlags(entry.flags),
|
|
371
|
+
reason: entry.reason,
|
|
372
|
+
why: withheld ? discoverySafeContact(entry.why, record) : entry.why,
|
|
373
|
+
citation_url: withheld ? discoverySafeUrl(entry.citation_url, record) : entry.citation_url,
|
|
374
|
+
since: entry.since,
|
|
375
|
+
county_office: record?.contact ? { department: office(record.contact.department), url: office(record.contact.url, discoverySafeUrl) } : null,
|
|
376
|
+
free_alternatives: pageUrl ? { county_page: pageUrl } : null,
|
|
377
|
+
request: null
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
|
|
231
381
|
// data/index.json
|
|
232
382
|
var data_default = {
|
|
233
383
|
version: "0.3.0",
|
|
@@ -38923,8 +39073,9 @@ function slugify(s) {
|
|
|
38923
39073
|
return s.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
38924
39074
|
}
|
|
38925
39075
|
var COUNTY_UNIT_SUFFIX2 = /\b(?:County|Parish|Borough|Municipality|Census Area|City|Statewide|Planning Region|District of Columbia)$/i;
|
|
39076
|
+
var APOSTROPHES2 = /['\u2019\u02bc]/g;
|
|
38926
39077
|
function countySlugFromName(county) {
|
|
38927
|
-
const name = county.trim();
|
|
39078
|
+
const name = county.replace(APOSTROPHES2, "").trim();
|
|
38928
39079
|
return slugify(COUNTY_UNIT_SUFFIX2.test(name) ? name : `${name} County`);
|
|
38929
39080
|
}
|
|
38930
39081
|
function canonicalLayerUrl(url) {
|
|
@@ -42982,6 +43133,10 @@ function citiesForCounty(stateSlug, countySlug) {
|
|
|
42982
43133
|
return citiesForCountyIn(SUMMARIES, stateSlug, countySlug).map((c) => ({ ...c, kinds: [...c.kinds], names: [...c.names] }));
|
|
42983
43134
|
}
|
|
42984
43135
|
|
|
43136
|
+
exports.ACCESS_FLAGS = ACCESS_FLAGS;
|
|
43137
|
+
exports.ACCESS_PRESETS = ACCESS_PRESETS;
|
|
43138
|
+
exports.ACCESS_REASONS = ACCESS_REASONS;
|
|
43139
|
+
exports.ATLAS_COUNTY_PAGE_BASE = ATLAS_COUNTY_PAGE_BASE;
|
|
42985
43140
|
exports.CITY_RECORD_LIMIT = CITY_RECORD_LIMIT;
|
|
42986
43141
|
exports.CITY_STREET_MAX_LEN = CITY_STREET_MAX_LEN;
|
|
42987
43142
|
exports.COUNTY_RECHECK_REQUEST_MESSAGE = COUNTY_RECHECK_REQUEST_MESSAGE;
|
|
@@ -42992,6 +43147,8 @@ exports.LIVE_STATUS_URL = LIVE_STATUS_URL;
|
|
|
42992
43147
|
exports.NOT_IN_ATLAS_WHY = NOT_IN_ATLAS_WHY;
|
|
42993
43148
|
exports.NO_PUBLIC_DATA_WHY = NO_PUBLIC_DATA_WHY;
|
|
42994
43149
|
exports.POINT_PLACEHOLDER = POINT_PLACEHOLDER;
|
|
43150
|
+
exports.PRESET_FLAGS = PRESET_FLAGS;
|
|
43151
|
+
exports.accessBlocks = accessBlocks;
|
|
42995
43152
|
exports.atlas = atlas;
|
|
42996
43153
|
exports.atlasIndex = atlasIndex;
|
|
42997
43154
|
exports.buildCityQuery = buildCityQuery;
|
|
@@ -43018,6 +43175,7 @@ exports.findCityIn = findCityIn;
|
|
|
43018
43175
|
exports.findCounty = findCounty;
|
|
43019
43176
|
exports.findCountyByFips = findCountyByFips;
|
|
43020
43177
|
exports.findState = findState;
|
|
43178
|
+
exports.flagsFor = flagsFor;
|
|
43021
43179
|
exports.getCityProperty = getCityProperty;
|
|
43022
43180
|
exports.getCityZoning = getCityZoning;
|
|
43023
43181
|
exports.isReviewedUnservable = isReviewedUnservable;
|
|
@@ -43027,6 +43185,9 @@ exports.listStates = listStates;
|
|
|
43027
43185
|
exports.mergeCityIndexes = mergeCityIndexes;
|
|
43028
43186
|
exports.offersAttributeSearch = offersAttributeSearch;
|
|
43029
43187
|
exports.offersPagination = offersPagination;
|
|
43188
|
+
exports.pausedAnswer = pausedAnswer;
|
|
43189
|
+
exports.pausedFlags = pausedFlags;
|
|
43190
|
+
exports.presetOf = presetOf;
|
|
43030
43191
|
exports.propertyQueryUrl = propertyQueryUrl;
|
|
43031
43192
|
exports.requestHint = requestHint;
|
|
43032
43193
|
exports.reviewedCapability = reviewedCapability;
|
package/dist/index.d.cts
CHANGED
|
@@ -462,6 +462,108 @@ declare function reviewedCapability(county: Pick<CountyRecord, "capabilityOverri
|
|
|
462
462
|
*/
|
|
463
463
|
declare function isReviewedUnservable(county: Pick<CountyRecord, "capabilityOverrides">, field: CapabilityField): boolean;
|
|
464
464
|
|
|
465
|
+
/**
|
|
466
|
+
* The surfaces a county can be paused on, one flag each. True = paused.
|
|
467
|
+
*
|
|
468
|
+
* "paid_lookup": a REST lookup by a paying caller (PAYG or a paid plan).
|
|
469
|
+
* "paid_enrich": a billed single-parcel owner lookup (MCP enrich_address).
|
|
470
|
+
* "paid_bulk": a billed owner list of addresses (REST bulk rows).
|
|
471
|
+
* "paid_lists": a billed radius owner list (REST radius, MCP radius_owners).
|
|
472
|
+
* "free_site_lookup": the site's free lookup tools, and a REST lookup by an
|
|
473
|
+
* anonymous or free-tier caller.
|
|
474
|
+
* "free_site_lists": the site's free whole-layer download (ArcGIS to GeoJSON).
|
|
475
|
+
* "free_discovery": the county record beyond its identity (endpoint URLs,
|
|
476
|
+
* notes, every other field) in county metadata and the
|
|
477
|
+
* discovery tools.
|
|
478
|
+
*/
|
|
479
|
+
declare const ACCESS_FLAGS: readonly ["paid_lookup", "paid_enrich", "paid_bulk", "paid_lists", "free_site_lookup", "free_site_lists", "free_discovery"];
|
|
480
|
+
type AccessFlag = (typeof ACCESS_FLAGS)[number];
|
|
481
|
+
type AccessFlags = Readonly<Record<AccessFlag, boolean>>;
|
|
482
|
+
/**
|
|
483
|
+
* Named sets of flags.
|
|
484
|
+
*
|
|
485
|
+
* "paid-off": every billed call. Free use still answers.
|
|
486
|
+
* "paid-lists-off": billed owner LISTS only (radius, bulk). Single-parcel
|
|
487
|
+
* lookups still work.
|
|
488
|
+
* "all-off": everything, free use included.
|
|
489
|
+
*/
|
|
490
|
+
declare const ACCESS_PRESETS: readonly ["paid-off", "paid-lists-off", "all-off"];
|
|
491
|
+
type AccessPreset = (typeof ACCESS_PRESETS)[number];
|
|
492
|
+
declare const PRESET_FLAGS: Readonly<Record<AccessPreset, readonly AccessFlag[]>>;
|
|
493
|
+
/** The flags a preset sets: every flag present, true for the preset's own. */
|
|
494
|
+
declare function flagsFor(preset: AccessPreset): AccessFlags;
|
|
495
|
+
/** The paused flags, in ACCESS_FLAGS order. */
|
|
496
|
+
declare function pausedFlags(flags: AccessFlags): AccessFlag[];
|
|
497
|
+
/** The preset these flags are exactly, or "custom". */
|
|
498
|
+
declare function presetOf(flags: AccessFlags): AccessPreset | "custom";
|
|
499
|
+
/** Why a county is paused. One code per county. */
|
|
500
|
+
declare const ACCESS_REASONS: readonly ["licence-terms", "state-law", "county-request", "data-quality", "upstream-broken", "other"];
|
|
501
|
+
type AccessReason = (typeof ACCESS_REASONS)[number];
|
|
502
|
+
/** One paused county, as the operator recorded it. */
|
|
503
|
+
interface CountyAccessEntry {
|
|
504
|
+
county_fips: string;
|
|
505
|
+
flags: AccessFlags;
|
|
506
|
+
reason: AccessReason;
|
|
507
|
+
/** One sentence of at most 280 characters, written to be shown as is. */
|
|
508
|
+
why: string;
|
|
509
|
+
/** The county's own terms page, or the law, that the pause rests on. */
|
|
510
|
+
citation_url: string;
|
|
511
|
+
/** When the county was paused: an ISO timestamp, or YYYY-MM-DD. */
|
|
512
|
+
since: string;
|
|
513
|
+
}
|
|
514
|
+
/** Is `flag` paused for this county? No entry means the county is fully on. */
|
|
515
|
+
declare function accessBlocks(entry: {
|
|
516
|
+
flags: AccessFlags;
|
|
517
|
+
} | null | undefined, flag: AccessFlag): boolean;
|
|
518
|
+
/** What pausedAnswer reads from a county record. */
|
|
519
|
+
interface AccessRecordLike {
|
|
520
|
+
contact?: {
|
|
521
|
+
department?: string | null;
|
|
522
|
+
url?: string | null;
|
|
523
|
+
} | null;
|
|
524
|
+
/** The record's own endpoints: their hosts are what a withheld answer must not name. */
|
|
525
|
+
endpoints?: ReadonlyArray<{
|
|
526
|
+
url: string;
|
|
527
|
+
}> | null;
|
|
528
|
+
}
|
|
529
|
+
/** Where the county's free page lives. Either slug missing: no page offered. */
|
|
530
|
+
interface AccessPageRef {
|
|
531
|
+
state_slug?: string | null;
|
|
532
|
+
county_slug?: string | null;
|
|
533
|
+
}
|
|
534
|
+
declare const ATLAS_COUNTY_PAGE_BASE = "https://urbankitstudio.com/parcel-atlas";
|
|
535
|
+
/** The one answer every surface gives for a county that is paused. */
|
|
536
|
+
interface CountyPausedAnswer {
|
|
537
|
+
/** Always true: the county IS in the atlas. */
|
|
538
|
+
indexed: true;
|
|
539
|
+
status: "paused";
|
|
540
|
+
/** The preset the flags match, or "custom". */
|
|
541
|
+
preset: AccessPreset | "custom";
|
|
542
|
+
/** Which surfaces are paused, in ACCESS_FLAGS order. */
|
|
543
|
+
paused: AccessFlag[];
|
|
544
|
+
reason: AccessReason;
|
|
545
|
+
/** One sentence to show the person as is. Null under free_discovery when it
|
|
546
|
+
* names the county's service (discoverySafeContact). */
|
|
547
|
+
why: string | null;
|
|
548
|
+
/** The county's own terms page, or the law, that the pause rests on. Null
|
|
549
|
+
* under free_discovery when it names the county's service (discoverySafeContact). */
|
|
550
|
+
citation_url: string | null;
|
|
551
|
+
since: string;
|
|
552
|
+
/** The county office that holds the records, from the record's contact. */
|
|
553
|
+
county_office: {
|
|
554
|
+
department: string | null;
|
|
555
|
+
url: string | null;
|
|
556
|
+
} | null;
|
|
557
|
+
/** The free county page; null when free lookup or discovery is paused, or the page is unknown. */
|
|
558
|
+
free_alternatives: {
|
|
559
|
+
county_page: string;
|
|
560
|
+
} | null;
|
|
561
|
+
/** Always null: a paused county is not something to request. */
|
|
562
|
+
request: null;
|
|
563
|
+
}
|
|
564
|
+
/** The paused answer for one county. `record` is its atlas record when known. */
|
|
565
|
+
declare function pausedAnswer(entry: CountyAccessEntry, record: AccessRecordLike | null | undefined, page?: AccessPageRef): CountyPausedAnswer;
|
|
566
|
+
|
|
465
567
|
/**
|
|
466
568
|
* Look up a county by state slug and county slug. A two-letter state
|
|
467
569
|
* abbreviation is also accepted, as in findState.
|
|
@@ -1037,4 +1139,4 @@ declare function citiesForCounty(stateSlug: string, countySlug: string): CitySum
|
|
|
1037
1139
|
declare const cityPropertyIndex: CityPropertyIndex;
|
|
1038
1140
|
declare const cityZoningIndex: CityZoningIndex;
|
|
1039
1141
|
|
|
1040
|
-
export { type Atlas, type AtlasIndex, CITY_RECORD_LIMIT, CITY_STREET_MAX_LEN, COUNTY_RECHECK_REQUEST_MESSAGE, COUNTY_REQUEST_MESSAGE, COUNTY_REQUEST_URL, COVERAGE_REASONS, type CapabilityBasis, type CapabilityBasisType, type CapabilityField, type CapabilityOverrides, type CapabilityStatus, type CaseFieldMap, type CasesSource, type CityDatasetDescriptor, type CityFilter, type CityKind, type CityLookup, type CityPropertyIndex, type CityPropertyIndexEntry, type CityPropertyRecord, type CityProvider, type CityQueryTemplate, type CitySource, type CitySummary, type CityZoningIndex, type CityZoningIndexEntry, type CityZoningRecord, type ContactInfo, type CountyAdvisory, type CountyCoverage, type CountyProduct, type CountyRecord, type CountyRequestHint, type CountyRequestRef, type CoverageAnswer, type CoverageReason, type CoverageRecordLike, type CoverageStatus, type CoverageTextInput, type CurrentZoningFieldMap, type CurrentZoningSource, type DatasetKind, type DeepLinkCounty, type EndpointPresenceLike, type EndpointRecord, type EndpointStatus, type GeocoderConfig, type GeocoderProvider, LIVE_STATUS_URL, type LicenseType, NOT_IN_ATLAS_WHY, NO_PUBLIC_DATA_WHY, POINT_PLACEHOLDER, type PropertyDataset, type PropertyDatasets, type PropertyFieldMap, type PropertySource, type PropertySourceType, type PropertyStatusBuckets, type SearchField, type ServiceType, type SplitStreet, type StateFile, type StateIndexEntry, type VerifiedBy, type ZoningByAddressSource, type ZoningSourceType, type ZoningStatusBuckets, type ZoningToolKind, atlas, atlasIndex, buildCityQuery, buildParcelLookupDeepLink, canonicalLayerUrl, casesLocationTemplate, casesQueryUrl, citiesForCounty, citiesForCountyIn, cityDatasetDescriptors, cityDatasets, cityPath, cityPropertyIndex, cityZoningIndex, countyHasEndpoint, countyOffersAttributeSearch, countyPath, countySlugFromName, coverageAnswer, coverageAnswerText, currentZoningTemplate, findCity, findCityIn, findCounty, findCountyByFips, findState, getCityProperty, getCityZoning, isReviewedUnservable, listCities, listCountiesByState, listStates, mergeCityIndexes, offersAttributeSearch, offersPagination, propertyQueryUrl, requestHint, reviewedCapability, slugify, splitAddressStreetName, splitStreet, statePath, streetForDataset };
|
|
1142
|
+
export { ACCESS_FLAGS, ACCESS_PRESETS, ACCESS_REASONS, ATLAS_COUNTY_PAGE_BASE, type AccessFlag, type AccessFlags, type AccessPageRef, type AccessPreset, type AccessReason, type AccessRecordLike, type Atlas, type AtlasIndex, CITY_RECORD_LIMIT, CITY_STREET_MAX_LEN, COUNTY_RECHECK_REQUEST_MESSAGE, COUNTY_REQUEST_MESSAGE, COUNTY_REQUEST_URL, COVERAGE_REASONS, type CapabilityBasis, type CapabilityBasisType, type CapabilityField, type CapabilityOverrides, type CapabilityStatus, type CaseFieldMap, type CasesSource, type CityDatasetDescriptor, type CityFilter, type CityKind, type CityLookup, type CityPropertyIndex, type CityPropertyIndexEntry, type CityPropertyRecord, type CityProvider, type CityQueryTemplate, type CitySource, type CitySummary, type CityZoningIndex, type CityZoningIndexEntry, type CityZoningRecord, type ContactInfo, type CountyAccessEntry, type CountyAdvisory, type CountyCoverage, type CountyPausedAnswer, type CountyProduct, type CountyRecord, type CountyRequestHint, type CountyRequestRef, type CoverageAnswer, type CoverageReason, type CoverageRecordLike, type CoverageStatus, type CoverageTextInput, type CurrentZoningFieldMap, type CurrentZoningSource, type DatasetKind, type DeepLinkCounty, type EndpointPresenceLike, type EndpointRecord, type EndpointStatus, type GeocoderConfig, type GeocoderProvider, LIVE_STATUS_URL, type LicenseType, NOT_IN_ATLAS_WHY, NO_PUBLIC_DATA_WHY, POINT_PLACEHOLDER, PRESET_FLAGS, type PropertyDataset, type PropertyDatasets, type PropertyFieldMap, type PropertySource, type PropertySourceType, type PropertyStatusBuckets, type SearchField, type ServiceType, type SplitStreet, type StateFile, type StateIndexEntry, type VerifiedBy, type ZoningByAddressSource, type ZoningSourceType, type ZoningStatusBuckets, type ZoningToolKind, accessBlocks, atlas, atlasIndex, buildCityQuery, buildParcelLookupDeepLink, canonicalLayerUrl, casesLocationTemplate, casesQueryUrl, citiesForCounty, citiesForCountyIn, cityDatasetDescriptors, cityDatasets, cityPath, cityPropertyIndex, cityZoningIndex, countyHasEndpoint, countyOffersAttributeSearch, countyPath, countySlugFromName, coverageAnswer, coverageAnswerText, currentZoningTemplate, findCity, findCityIn, findCounty, findCountyByFips, findState, flagsFor, getCityProperty, getCityZoning, isReviewedUnservable, listCities, listCountiesByState, listStates, mergeCityIndexes, offersAttributeSearch, offersPagination, pausedAnswer, pausedFlags, presetOf, propertyQueryUrl, requestHint, reviewedCapability, slugify, splitAddressStreetName, splitStreet, statePath, streetForDataset };
|
package/dist/index.d.ts
CHANGED
|
@@ -462,6 +462,108 @@ declare function reviewedCapability(county: Pick<CountyRecord, "capabilityOverri
|
|
|
462
462
|
*/
|
|
463
463
|
declare function isReviewedUnservable(county: Pick<CountyRecord, "capabilityOverrides">, field: CapabilityField): boolean;
|
|
464
464
|
|
|
465
|
+
/**
|
|
466
|
+
* The surfaces a county can be paused on, one flag each. True = paused.
|
|
467
|
+
*
|
|
468
|
+
* "paid_lookup": a REST lookup by a paying caller (PAYG or a paid plan).
|
|
469
|
+
* "paid_enrich": a billed single-parcel owner lookup (MCP enrich_address).
|
|
470
|
+
* "paid_bulk": a billed owner list of addresses (REST bulk rows).
|
|
471
|
+
* "paid_lists": a billed radius owner list (REST radius, MCP radius_owners).
|
|
472
|
+
* "free_site_lookup": the site's free lookup tools, and a REST lookup by an
|
|
473
|
+
* anonymous or free-tier caller.
|
|
474
|
+
* "free_site_lists": the site's free whole-layer download (ArcGIS to GeoJSON).
|
|
475
|
+
* "free_discovery": the county record beyond its identity (endpoint URLs,
|
|
476
|
+
* notes, every other field) in county metadata and the
|
|
477
|
+
* discovery tools.
|
|
478
|
+
*/
|
|
479
|
+
declare const ACCESS_FLAGS: readonly ["paid_lookup", "paid_enrich", "paid_bulk", "paid_lists", "free_site_lookup", "free_site_lists", "free_discovery"];
|
|
480
|
+
type AccessFlag = (typeof ACCESS_FLAGS)[number];
|
|
481
|
+
type AccessFlags = Readonly<Record<AccessFlag, boolean>>;
|
|
482
|
+
/**
|
|
483
|
+
* Named sets of flags.
|
|
484
|
+
*
|
|
485
|
+
* "paid-off": every billed call. Free use still answers.
|
|
486
|
+
* "paid-lists-off": billed owner LISTS only (radius, bulk). Single-parcel
|
|
487
|
+
* lookups still work.
|
|
488
|
+
* "all-off": everything, free use included.
|
|
489
|
+
*/
|
|
490
|
+
declare const ACCESS_PRESETS: readonly ["paid-off", "paid-lists-off", "all-off"];
|
|
491
|
+
type AccessPreset = (typeof ACCESS_PRESETS)[number];
|
|
492
|
+
declare const PRESET_FLAGS: Readonly<Record<AccessPreset, readonly AccessFlag[]>>;
|
|
493
|
+
/** The flags a preset sets: every flag present, true for the preset's own. */
|
|
494
|
+
declare function flagsFor(preset: AccessPreset): AccessFlags;
|
|
495
|
+
/** The paused flags, in ACCESS_FLAGS order. */
|
|
496
|
+
declare function pausedFlags(flags: AccessFlags): AccessFlag[];
|
|
497
|
+
/** The preset these flags are exactly, or "custom". */
|
|
498
|
+
declare function presetOf(flags: AccessFlags): AccessPreset | "custom";
|
|
499
|
+
/** Why a county is paused. One code per county. */
|
|
500
|
+
declare const ACCESS_REASONS: readonly ["licence-terms", "state-law", "county-request", "data-quality", "upstream-broken", "other"];
|
|
501
|
+
type AccessReason = (typeof ACCESS_REASONS)[number];
|
|
502
|
+
/** One paused county, as the operator recorded it. */
|
|
503
|
+
interface CountyAccessEntry {
|
|
504
|
+
county_fips: string;
|
|
505
|
+
flags: AccessFlags;
|
|
506
|
+
reason: AccessReason;
|
|
507
|
+
/** One sentence of at most 280 characters, written to be shown as is. */
|
|
508
|
+
why: string;
|
|
509
|
+
/** The county's own terms page, or the law, that the pause rests on. */
|
|
510
|
+
citation_url: string;
|
|
511
|
+
/** When the county was paused: an ISO timestamp, or YYYY-MM-DD. */
|
|
512
|
+
since: string;
|
|
513
|
+
}
|
|
514
|
+
/** Is `flag` paused for this county? No entry means the county is fully on. */
|
|
515
|
+
declare function accessBlocks(entry: {
|
|
516
|
+
flags: AccessFlags;
|
|
517
|
+
} | null | undefined, flag: AccessFlag): boolean;
|
|
518
|
+
/** What pausedAnswer reads from a county record. */
|
|
519
|
+
interface AccessRecordLike {
|
|
520
|
+
contact?: {
|
|
521
|
+
department?: string | null;
|
|
522
|
+
url?: string | null;
|
|
523
|
+
} | null;
|
|
524
|
+
/** The record's own endpoints: their hosts are what a withheld answer must not name. */
|
|
525
|
+
endpoints?: ReadonlyArray<{
|
|
526
|
+
url: string;
|
|
527
|
+
}> | null;
|
|
528
|
+
}
|
|
529
|
+
/** Where the county's free page lives. Either slug missing: no page offered. */
|
|
530
|
+
interface AccessPageRef {
|
|
531
|
+
state_slug?: string | null;
|
|
532
|
+
county_slug?: string | null;
|
|
533
|
+
}
|
|
534
|
+
declare const ATLAS_COUNTY_PAGE_BASE = "https://urbankitstudio.com/parcel-atlas";
|
|
535
|
+
/** The one answer every surface gives for a county that is paused. */
|
|
536
|
+
interface CountyPausedAnswer {
|
|
537
|
+
/** Always true: the county IS in the atlas. */
|
|
538
|
+
indexed: true;
|
|
539
|
+
status: "paused";
|
|
540
|
+
/** The preset the flags match, or "custom". */
|
|
541
|
+
preset: AccessPreset | "custom";
|
|
542
|
+
/** Which surfaces are paused, in ACCESS_FLAGS order. */
|
|
543
|
+
paused: AccessFlag[];
|
|
544
|
+
reason: AccessReason;
|
|
545
|
+
/** One sentence to show the person as is. Null under free_discovery when it
|
|
546
|
+
* names the county's service (discoverySafeContact). */
|
|
547
|
+
why: string | null;
|
|
548
|
+
/** The county's own terms page, or the law, that the pause rests on. Null
|
|
549
|
+
* under free_discovery when it names the county's service (discoverySafeContact). */
|
|
550
|
+
citation_url: string | null;
|
|
551
|
+
since: string;
|
|
552
|
+
/** The county office that holds the records, from the record's contact. */
|
|
553
|
+
county_office: {
|
|
554
|
+
department: string | null;
|
|
555
|
+
url: string | null;
|
|
556
|
+
} | null;
|
|
557
|
+
/** The free county page; null when free lookup or discovery is paused, or the page is unknown. */
|
|
558
|
+
free_alternatives: {
|
|
559
|
+
county_page: string;
|
|
560
|
+
} | null;
|
|
561
|
+
/** Always null: a paused county is not something to request. */
|
|
562
|
+
request: null;
|
|
563
|
+
}
|
|
564
|
+
/** The paused answer for one county. `record` is its atlas record when known. */
|
|
565
|
+
declare function pausedAnswer(entry: CountyAccessEntry, record: AccessRecordLike | null | undefined, page?: AccessPageRef): CountyPausedAnswer;
|
|
566
|
+
|
|
465
567
|
/**
|
|
466
568
|
* Look up a county by state slug and county slug. A two-letter state
|
|
467
569
|
* abbreviation is also accepted, as in findState.
|
|
@@ -1037,4 +1139,4 @@ declare function citiesForCounty(stateSlug: string, countySlug: string): CitySum
|
|
|
1037
1139
|
declare const cityPropertyIndex: CityPropertyIndex;
|
|
1038
1140
|
declare const cityZoningIndex: CityZoningIndex;
|
|
1039
1141
|
|
|
1040
|
-
export { type Atlas, type AtlasIndex, CITY_RECORD_LIMIT, CITY_STREET_MAX_LEN, COUNTY_RECHECK_REQUEST_MESSAGE, COUNTY_REQUEST_MESSAGE, COUNTY_REQUEST_URL, COVERAGE_REASONS, type CapabilityBasis, type CapabilityBasisType, type CapabilityField, type CapabilityOverrides, type CapabilityStatus, type CaseFieldMap, type CasesSource, type CityDatasetDescriptor, type CityFilter, type CityKind, type CityLookup, type CityPropertyIndex, type CityPropertyIndexEntry, type CityPropertyRecord, type CityProvider, type CityQueryTemplate, type CitySource, type CitySummary, type CityZoningIndex, type CityZoningIndexEntry, type CityZoningRecord, type ContactInfo, type CountyAdvisory, type CountyCoverage, type CountyProduct, type CountyRecord, type CountyRequestHint, type CountyRequestRef, type CoverageAnswer, type CoverageReason, type CoverageRecordLike, type CoverageStatus, type CoverageTextInput, type CurrentZoningFieldMap, type CurrentZoningSource, type DatasetKind, type DeepLinkCounty, type EndpointPresenceLike, type EndpointRecord, type EndpointStatus, type GeocoderConfig, type GeocoderProvider, LIVE_STATUS_URL, type LicenseType, NOT_IN_ATLAS_WHY, NO_PUBLIC_DATA_WHY, POINT_PLACEHOLDER, type PropertyDataset, type PropertyDatasets, type PropertyFieldMap, type PropertySource, type PropertySourceType, type PropertyStatusBuckets, type SearchField, type ServiceType, type SplitStreet, type StateFile, type StateIndexEntry, type VerifiedBy, type ZoningByAddressSource, type ZoningSourceType, type ZoningStatusBuckets, type ZoningToolKind, atlas, atlasIndex, buildCityQuery, buildParcelLookupDeepLink, canonicalLayerUrl, casesLocationTemplate, casesQueryUrl, citiesForCounty, citiesForCountyIn, cityDatasetDescriptors, cityDatasets, cityPath, cityPropertyIndex, cityZoningIndex, countyHasEndpoint, countyOffersAttributeSearch, countyPath, countySlugFromName, coverageAnswer, coverageAnswerText, currentZoningTemplate, findCity, findCityIn, findCounty, findCountyByFips, findState, getCityProperty, getCityZoning, isReviewedUnservable, listCities, listCountiesByState, listStates, mergeCityIndexes, offersAttributeSearch, offersPagination, propertyQueryUrl, requestHint, reviewedCapability, slugify, splitAddressStreetName, splitStreet, statePath, streetForDataset };
|
|
1142
|
+
export { ACCESS_FLAGS, ACCESS_PRESETS, ACCESS_REASONS, ATLAS_COUNTY_PAGE_BASE, type AccessFlag, type AccessFlags, type AccessPageRef, type AccessPreset, type AccessReason, type AccessRecordLike, type Atlas, type AtlasIndex, CITY_RECORD_LIMIT, CITY_STREET_MAX_LEN, COUNTY_RECHECK_REQUEST_MESSAGE, COUNTY_REQUEST_MESSAGE, COUNTY_REQUEST_URL, COVERAGE_REASONS, type CapabilityBasis, type CapabilityBasisType, type CapabilityField, type CapabilityOverrides, type CapabilityStatus, type CaseFieldMap, type CasesSource, type CityDatasetDescriptor, type CityFilter, type CityKind, type CityLookup, type CityPropertyIndex, type CityPropertyIndexEntry, type CityPropertyRecord, type CityProvider, type CityQueryTemplate, type CitySource, type CitySummary, type CityZoningIndex, type CityZoningIndexEntry, type CityZoningRecord, type ContactInfo, type CountyAccessEntry, type CountyAdvisory, type CountyCoverage, type CountyPausedAnswer, type CountyProduct, type CountyRecord, type CountyRequestHint, type CountyRequestRef, type CoverageAnswer, type CoverageReason, type CoverageRecordLike, type CoverageStatus, type CoverageTextInput, type CurrentZoningFieldMap, type CurrentZoningSource, type DatasetKind, type DeepLinkCounty, type EndpointPresenceLike, type EndpointRecord, type EndpointStatus, type GeocoderConfig, type GeocoderProvider, LIVE_STATUS_URL, type LicenseType, NOT_IN_ATLAS_WHY, NO_PUBLIC_DATA_WHY, POINT_PLACEHOLDER, PRESET_FLAGS, type PropertyDataset, type PropertyDatasets, type PropertyFieldMap, type PropertySource, type PropertySourceType, type PropertyStatusBuckets, type SearchField, type ServiceType, type SplitStreet, type StateFile, type StateIndexEntry, type VerifiedBy, type ZoningByAddressSource, type ZoningSourceType, type ZoningStatusBuckets, type ZoningToolKind, accessBlocks, atlas, atlasIndex, buildCityQuery, buildParcelLookupDeepLink, canonicalLayerUrl, casesLocationTemplate, casesQueryUrl, citiesForCounty, citiesForCountyIn, cityDatasetDescriptors, cityDatasets, cityPath, cityPropertyIndex, cityZoningIndex, countyHasEndpoint, countyOffersAttributeSearch, countyPath, countySlugFromName, coverageAnswer, coverageAnswerText, currentZoningTemplate, findCity, findCityIn, findCounty, findCountyByFips, findState, flagsFor, getCityProperty, getCityZoning, isReviewedUnservable, listCities, listCountiesByState, listStates, mergeCityIndexes, offersAttributeSearch, offersPagination, pausedAnswer, pausedFlags, presetOf, propertyQueryUrl, requestHint, reviewedCapability, slugify, splitAddressStreetName, splitStreet, statePath, streetForDataset };
|
package/dist/index.js
CHANGED
|
@@ -112,8 +112,9 @@ function stateSlugFromAbbrev(input) {
|
|
|
112
112
|
return null;
|
|
113
113
|
}
|
|
114
114
|
var COUNTY_UNIT_SUFFIX = /\b(?:County|Parish|Borough|Municipality|Census Area|City|Statewide|Planning Region|District of Columbia)$/i;
|
|
115
|
+
var APOSTROPHES = /['\u2019\u02bc]/g;
|
|
115
116
|
function requestCountySlug(county) {
|
|
116
|
-
const name = county.trim();
|
|
117
|
+
const name = county.replace(APOSTROPHES, "").trim();
|
|
117
118
|
if (!canonicalRequestSlug(name)) return "";
|
|
118
119
|
const hasUnit = COUNTY_UNIT_SUFFIX.test(name) || COUNTY_UNIT_SUFFIX.test(name.replace(/[-_]+/g, " "));
|
|
119
120
|
return canonicalRequestSlug(hasUnit ? name : `${name} County`);
|
|
@@ -226,6 +227,155 @@ function coverageAnswer(record, ref) {
|
|
|
226
227
|
return { ...block, message: coverageAnswerText(block) };
|
|
227
228
|
}
|
|
228
229
|
|
|
230
|
+
// src/access.ts
|
|
231
|
+
var ACCESS_FLAGS = [
|
|
232
|
+
"paid_lookup",
|
|
233
|
+
"paid_enrich",
|
|
234
|
+
"paid_bulk",
|
|
235
|
+
"paid_lists",
|
|
236
|
+
"free_site_lookup",
|
|
237
|
+
"free_site_lists",
|
|
238
|
+
"free_discovery"
|
|
239
|
+
];
|
|
240
|
+
var ACCESS_PRESETS = ["paid-off", "paid-lists-off", "all-off"];
|
|
241
|
+
var PRESET_FLAGS = {
|
|
242
|
+
"paid-off": ["paid_lookup", "paid_enrich", "paid_bulk", "paid_lists"],
|
|
243
|
+
"paid-lists-off": ["paid_bulk", "paid_lists"],
|
|
244
|
+
"all-off": ACCESS_FLAGS
|
|
245
|
+
};
|
|
246
|
+
function flagsFor(preset) {
|
|
247
|
+
const on = new Set(PRESET_FLAGS[preset]);
|
|
248
|
+
return Object.fromEntries(ACCESS_FLAGS.map((f) => [f, on.has(f)]));
|
|
249
|
+
}
|
|
250
|
+
function pausedFlags(flags) {
|
|
251
|
+
return ACCESS_FLAGS.filter((f) => flags[f] === true);
|
|
252
|
+
}
|
|
253
|
+
function presetOf(flags) {
|
|
254
|
+
const paused = pausedFlags(flags).join(",");
|
|
255
|
+
return ACCESS_PRESETS.find((p) => PRESET_FLAGS[p].join(",") === paused) ?? "custom";
|
|
256
|
+
}
|
|
257
|
+
var ACCESS_REASONS = [
|
|
258
|
+
"licence-terms",
|
|
259
|
+
"state-law",
|
|
260
|
+
"county-request",
|
|
261
|
+
"data-quality",
|
|
262
|
+
"upstream-broken",
|
|
263
|
+
"other"
|
|
264
|
+
];
|
|
265
|
+
function accessBlocks(entry, flag) {
|
|
266
|
+
return entry?.flags[flag] === true;
|
|
267
|
+
}
|
|
268
|
+
var ARCGIS_REST_RE = /(?:^|[^a-z0-9_-])rest\/services|sharing\/rest|arcgis\.com\/home\/item|(?:Map|Feature|Image|GP|VectorTile|Scene)Server/i;
|
|
269
|
+
function discoverySafeContact(value, record) {
|
|
270
|
+
if (!value) return null;
|
|
271
|
+
if (value.length > MAX_MATCHED_LENGTH) return null;
|
|
272
|
+
const d = decoded(value);
|
|
273
|
+
const v = d.toLowerCase().replace(STOPS_RE, ".");
|
|
274
|
+
const nfkc = d.normalize("NFKC").toLowerCase().replace(STOPS_RE, ".");
|
|
275
|
+
const folded = nfkc.replace(IGNORABLE_RE, "");
|
|
276
|
+
if (v.length > MAX_MATCHED_LENGTH || nfkc.length > MAX_MATCHED_LENGTH) return null;
|
|
277
|
+
const texts = withControlsDeleted([v, folded]);
|
|
278
|
+
if (texts.some((t) => ARCGIS_REST_RE.test(t))) return null;
|
|
279
|
+
const endpoints = [];
|
|
280
|
+
for (const ep of record?.endpoints ?? []) {
|
|
281
|
+
const host = hostnameOf(ep.url);
|
|
282
|
+
const key = host && hostKey(host);
|
|
283
|
+
if (host && key) endpoints.push({ key, host });
|
|
284
|
+
}
|
|
285
|
+
if (endpoints.length === 0) return value;
|
|
286
|
+
for (const form of texts) {
|
|
287
|
+
for (const name of dottedNames(form)) {
|
|
288
|
+
const host = hostnameOf(`http://${name}`);
|
|
289
|
+
const key = host && hostKey(host);
|
|
290
|
+
if (host && key && endpoints.some((ep) => key === ep.key || host.endsWith(`.${ep.host}`))) return null;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
const fullwidth = v.replace(/[!-~]/g, (ch) => String.fromCharCode(ch.charCodeAt(0) - 65248));
|
|
294
|
+
const boundaryForms = withControlsDeleted([v, nfkc, fullwidth].flatMap((form) => [form, form.replace(IGNORABLE_RE, "")]));
|
|
295
|
+
for (const ep of endpoints) {
|
|
296
|
+
const bounded = labelBounded(ep.key);
|
|
297
|
+
if (boundaryForms.some((form) => bounded.test(form))) return null;
|
|
298
|
+
}
|
|
299
|
+
return value;
|
|
300
|
+
}
|
|
301
|
+
function discoverySafeUrl(value, record) {
|
|
302
|
+
const text2 = discoverySafeContact(value, record);
|
|
303
|
+
if (text2 === null) return null;
|
|
304
|
+
let parsed;
|
|
305
|
+
try {
|
|
306
|
+
parsed = new URL(text2.trim());
|
|
307
|
+
} catch {
|
|
308
|
+
return text2;
|
|
309
|
+
}
|
|
310
|
+
return discoverySafeContact(parsed.href, record) === null ? null : text2;
|
|
311
|
+
}
|
|
312
|
+
var MAX_MATCHED_LENGTH = 2048;
|
|
313
|
+
var STOPS_RE = /[。.。]/g;
|
|
314
|
+
var IGNORABLE_RE = /[\p{Cf}\p{Default_Ignorable_Code_Point}]/gu;
|
|
315
|
+
var CONTROL_RE = /\p{Cc}/gu;
|
|
316
|
+
function withControlsDeleted(forms) {
|
|
317
|
+
const out = [...forms];
|
|
318
|
+
for (const form of forms) {
|
|
319
|
+
const deleted = form.replace(CONTROL_RE, "");
|
|
320
|
+
if (deleted !== form) out.push(deleted);
|
|
321
|
+
}
|
|
322
|
+
return out;
|
|
323
|
+
}
|
|
324
|
+
function labelBounded(key) {
|
|
325
|
+
return new RegExp(`(?:^|[^a-z0-9])${key.replace(/[\\^$.*+?()[\]{}|/]/g, "\\$&")}(?![a-z0-9])`, "u");
|
|
326
|
+
}
|
|
327
|
+
var NAME_RUN_RE = /[\p{L}\p{N}\p{M}_.-]+/gu;
|
|
328
|
+
function dottedNames(form) {
|
|
329
|
+
const names = [];
|
|
330
|
+
for (const run of form.match(NAME_RUN_RE) ?? []) {
|
|
331
|
+
for (const part of run.split(/\.{2,}/)) {
|
|
332
|
+
const name = part.replace(/^\.+|\.+$/g, "");
|
|
333
|
+
if (name.includes(".")) names.push(name);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return names;
|
|
337
|
+
}
|
|
338
|
+
function decoded(value) {
|
|
339
|
+
return value.replace(/(?:%[0-9a-f]{2})+/gi, (run) => {
|
|
340
|
+
try {
|
|
341
|
+
return decodeURIComponent(run);
|
|
342
|
+
} catch {
|
|
343
|
+
return run;
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
function hostKey(hostname) {
|
|
348
|
+
const h = hostname.replace(/^www\./, "");
|
|
349
|
+
return h.includes(".") || h.includes(":") ? h : null;
|
|
350
|
+
}
|
|
351
|
+
function hostnameOf(url) {
|
|
352
|
+
try {
|
|
353
|
+
return new URL(url).hostname.toLowerCase().replace(/\.+$/, "");
|
|
354
|
+
} catch {
|
|
355
|
+
return null;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
var ATLAS_COUNTY_PAGE_BASE = "https://urbankitstudio.com/parcel-atlas";
|
|
359
|
+
function pausedAnswer(entry, record, page = {}) {
|
|
360
|
+
const withheld = accessBlocks(entry, "free_discovery");
|
|
361
|
+
const freeOff = accessBlocks(entry, "free_site_lookup") || withheld;
|
|
362
|
+
const office = (v, check = discoverySafeContact) => withheld ? check(v, record) : v ?? null;
|
|
363
|
+
const pageUrl = !freeOff && page.state_slug && page.county_slug ? `${ATLAS_COUNTY_PAGE_BASE}/${page.state_slug}/${page.county_slug}` : null;
|
|
364
|
+
return {
|
|
365
|
+
indexed: true,
|
|
366
|
+
status: "paused",
|
|
367
|
+
preset: presetOf(entry.flags),
|
|
368
|
+
paused: pausedFlags(entry.flags),
|
|
369
|
+
reason: entry.reason,
|
|
370
|
+
why: withheld ? discoverySafeContact(entry.why, record) : entry.why,
|
|
371
|
+
citation_url: withheld ? discoverySafeUrl(entry.citation_url, record) : entry.citation_url,
|
|
372
|
+
since: entry.since,
|
|
373
|
+
county_office: record?.contact ? { department: office(record.contact.department), url: office(record.contact.url, discoverySafeUrl) } : null,
|
|
374
|
+
free_alternatives: pageUrl ? { county_page: pageUrl } : null,
|
|
375
|
+
request: null
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
|
|
229
379
|
// data/index.json
|
|
230
380
|
var data_default = {
|
|
231
381
|
version: "0.3.0",
|
|
@@ -38921,8 +39071,9 @@ function slugify(s) {
|
|
|
38921
39071
|
return s.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
38922
39072
|
}
|
|
38923
39073
|
var COUNTY_UNIT_SUFFIX2 = /\b(?:County|Parish|Borough|Municipality|Census Area|City|Statewide|Planning Region|District of Columbia)$/i;
|
|
39074
|
+
var APOSTROPHES2 = /['\u2019\u02bc]/g;
|
|
38924
39075
|
function countySlugFromName(county) {
|
|
38925
|
-
const name = county.trim();
|
|
39076
|
+
const name = county.replace(APOSTROPHES2, "").trim();
|
|
38926
39077
|
return slugify(COUNTY_UNIT_SUFFIX2.test(name) ? name : `${name} County`);
|
|
38927
39078
|
}
|
|
38928
39079
|
function canonicalLayerUrl(url) {
|
|
@@ -42980,4 +43131,4 @@ function citiesForCounty(stateSlug, countySlug) {
|
|
|
42980
43131
|
return citiesForCountyIn(SUMMARIES, stateSlug, countySlug).map((c) => ({ ...c, kinds: [...c.kinds], names: [...c.names] }));
|
|
42981
43132
|
}
|
|
42982
43133
|
|
|
42983
|
-
export { CITY_RECORD_LIMIT, CITY_STREET_MAX_LEN, COUNTY_RECHECK_REQUEST_MESSAGE, COUNTY_REQUEST_MESSAGE, COUNTY_REQUEST_URL, COVERAGE_REASONS, LIVE_STATUS_URL, NOT_IN_ATLAS_WHY, NO_PUBLIC_DATA_WHY, POINT_PLACEHOLDER, atlas, atlasIndex, buildCityQuery, buildParcelLookupDeepLink, canonicalLayerUrl, casesLocationTemplate, casesQueryUrl, citiesForCounty, citiesForCountyIn, cityDatasetDescriptors, cityDatasets, cityPath, cityPropertyIndex, cityZoningIndex, countyHasEndpoint, countyOffersAttributeSearch, countyPath, countySlugFromName, coverageAnswer, coverageAnswerText, currentZoningTemplate, findCity, findCityIn, findCounty, findCountyByFips, findState, getCityProperty, getCityZoning, isReviewedUnservable, listCities, listCountiesByState, listStates, mergeCityIndexes, offersAttributeSearch, offersPagination, propertyQueryUrl, requestHint, reviewedCapability, slugify, splitAddressStreetName, splitStreet, statePath, streetForDataset };
|
|
43134
|
+
export { ACCESS_FLAGS, ACCESS_PRESETS, ACCESS_REASONS, ATLAS_COUNTY_PAGE_BASE, CITY_RECORD_LIMIT, CITY_STREET_MAX_LEN, COUNTY_RECHECK_REQUEST_MESSAGE, COUNTY_REQUEST_MESSAGE, COUNTY_REQUEST_URL, COVERAGE_REASONS, LIVE_STATUS_URL, NOT_IN_ATLAS_WHY, NO_PUBLIC_DATA_WHY, POINT_PLACEHOLDER, PRESET_FLAGS, accessBlocks, atlas, atlasIndex, buildCityQuery, buildParcelLookupDeepLink, canonicalLayerUrl, casesLocationTemplate, casesQueryUrl, citiesForCounty, citiesForCountyIn, cityDatasetDescriptors, cityDatasets, cityPath, cityPropertyIndex, cityZoningIndex, countyHasEndpoint, countyOffersAttributeSearch, countyPath, countySlugFromName, coverageAnswer, coverageAnswerText, currentZoningTemplate, findCity, findCityIn, findCounty, findCountyByFips, findState, flagsFor, getCityProperty, getCityZoning, isReviewedUnservable, listCities, listCountiesByState, listStates, mergeCityIndexes, offersAttributeSearch, offersPagination, pausedAnswer, pausedFlags, presetOf, propertyQueryUrl, requestHint, reviewedCapability, slugify, splitAddressStreetName, splitStreet, statePath, streetForDataset };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@urbankitstudio/atlas",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.39",
|
|
4
4
|
"description": "JS SDK for the UrbanKit County Parcel REST API Atlas: 494 counties across all 50 US states and DC, 494 verified public ArcGIS REST endpoints for county parcel data, with searchable field metadata, sample queries and license info, plus verified city code-violation, building-permit and zoning-case datasets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"parcel",
|