@urbankitstudio/atlas 0.5.3 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -52,6 +52,58 @@ interface ContactInfo {
52
52
  url: string | null;
53
53
  email: string | null;
54
54
  }
55
+ /** A short curated caveat about a county, written by a human. */
56
+ interface CountyAdvisory {
57
+ body: string;
58
+ source?: {
59
+ label: string;
60
+ url: string;
61
+ };
62
+ }
63
+ /** The fields a caller can ask a county about. */
64
+ type CapabilityField = "apn" | "owner_name" | "owner_mailing_address" | "situs_address" | "geometry" | "land_use" | "zoning";
65
+ type CapabilityStatus = "available" | "not_published" | "restricted" | "unverified";
66
+ /**
67
+ * Where a non-available status comes from. The type matters more than the
68
+ * prose, because it tells you whether you are reading a fact about a service, a
69
+ * claim the COUNTY makes, or a claim we make.
70
+ *
71
+ * `county_cited_statute` is the one to read carefully. It means the county
72
+ * publishes that citation as its own reason, reported here attributed to them
73
+ * rather than adopted as our reading of the law. San Bernardino County returns
74
+ * the literal string "Protected Per CA Gov Code 7928.205" in every owner-name
75
+ * row; that section protects the home address of elected and appointed
76
+ * officials, and San Diego County publishes owner names on its public layer.
77
+ * One statute, different county behaviour, so the attribution is not a
78
+ * formality.
79
+ */
80
+ type CapabilityBasisType = "endpoint_schema" | "county_cited_statute" | "statute" | "county_policy";
81
+ interface CapabilityBasis {
82
+ type: CapabilityBasisType;
83
+ /** One sentence you could show a user without editing. */
84
+ note: string;
85
+ citation?: string;
86
+ sourceUrl?: string;
87
+ /** Who makes the claim, when it is not us. Always set for county_cited_statute. */
88
+ attributedTo?: string;
89
+ }
90
+ /**
91
+ * REVIEWED capability assertions, per field. Only entries a human entered and
92
+ * checked appear here, which is exactly the knowledge you cannot compute from
93
+ * the bundled data yourself.
94
+ *
95
+ * What is NOT here is the mechanical half. Whether a field is simply absent
96
+ * from an endpoint's documented `searchFields` is derivable, and this package
97
+ * deliberately does not derive it: a second implementation of that
98
+ * classification would drift from the one the API bills against, and you would
99
+ * have no way to tell which was right. Read `endpoints[].searchFields` for the
100
+ * mechanical answer, and treat an entry here as outranking it.
101
+ */
102
+ type CapabilityOverrides = Partial<Record<CapabilityField, {
103
+ status: CapabilityStatus;
104
+ basis: CapabilityBasis;
105
+ lawfulAlternativeUrl?: string | null;
106
+ }>>;
55
107
  interface CountyRecord {
56
108
  id: string;
57
109
  state: string;
@@ -64,6 +116,14 @@ interface CountyRecord {
64
116
  contact: ContactInfo | null;
65
117
  hasPublicRest: boolean;
66
118
  notes: string | null;
119
+ /** Curated caveat about owner data on this county's public layer. */
120
+ ownerFieldNote?: CountyAdvisory | null;
121
+ /** Curated caveat about how old the county's published data is. */
122
+ dataVintage?: CountyAdvisory | null;
123
+ /** Reviewed, per-field capability assertions. See {@link CapabilityOverrides}. */
124
+ capabilityOverrides?: CapabilityOverrides | null;
125
+ relatedZoningCitySlug?: string | null;
126
+ relatedPropertyCitySlug?: string | null;
67
127
  }
68
128
  interface StateFile {
69
129
  stateSlug: string;
@@ -88,9 +148,41 @@ interface AtlasIndex {
88
148
  states: number;
89
149
  counties: number;
90
150
  endpoints: number;
151
+ /** Counties that publish at least one endpoint, i.e. the ones you can
152
+ * actually query. Distinct from BOTH fields above: counties counts every
153
+ * indexed county, endpoints counts endpoint RECORDS (a few counties
154
+ * publish two). Those two coincided at 155/155 while four counties
155
+ * published none, which is how published copy came to claim 155 verified
156
+ * endpoints. Prefer this when the sentence is about queryable coverage. */
157
+ countiesWithEndpoint: number;
91
158
  };
92
159
  }
93
160
 
161
+ /**
162
+ * The reviewed capability assertion for one field, or null when none exists.
163
+ *
164
+ * Null is the common answer and it is not a failure: it means nobody has had to
165
+ * write anything down about that field for that county, so the ordinary rules
166
+ * apply. Read `county.endpoints[].searchFields` to see what the layer actually
167
+ * documents.
168
+ *
169
+ * A non-null answer is the part worth branching on. It was entered by a human
170
+ * who checked something a field list cannot show, and it outranks whatever the
171
+ * field list implies. The clearest case: San Bernardino County publishes an
172
+ * `OwnerName` column, so the field list says owner names are available, and
173
+ * every row's value is the literal string "Protected Per CA Gov Code 7928.205".
174
+ * Only the reviewed record can tell you that.
175
+ */
176
+ declare function reviewedCapability(county: Pick<CountyRecord, "capabilityOverrides">, field: CapabilityField): NonNullable<CapabilityOverrides[CapabilityField]> | null;
177
+ /**
178
+ * True when a reviewed record says this field cannot be served, whatever the
179
+ * reason. Use it to decide whether to promise a user the field at all.
180
+ *
181
+ * False does NOT mean "available". It means no reviewed record says otherwise,
182
+ * so fall back to the endpoint's documented `searchFields`.
183
+ */
184
+ declare function isReviewedUnservable(county: Pick<CountyRecord, "capabilityOverrides">, field: CapabilityField): boolean;
185
+
94
186
  /**
95
187
  * Look up a county by state slug and county slug.
96
188
  * Returns undefined if the state isn't populated yet or the county doesn't exist.
@@ -146,4 +238,4 @@ interface Atlas {
146
238
  }
147
239
  declare const atlas: Atlas;
148
240
 
149
- export { type Atlas, type AtlasIndex, type ContactInfo, type CountyRecord, type EndpointRecord, type EndpointStatus, LIVE_STATUS_URL, type LicenseType, type SearchField, type ServiceType, type StateFile, type StateIndexEntry, type VerifiedBy, atlas, atlasIndex, buildParcelLookupDeepLink, countyPath, countySlugFromName, findCounty, findCountyByFips, findState, listCountiesByState, listStates, slugify, statePath };
241
+ export { type Atlas, type AtlasIndex, type CapabilityBasis, type CapabilityBasisType, type CapabilityField, type CapabilityOverrides, type CapabilityStatus, type ContactInfo, type CountyAdvisory, type CountyRecord, type EndpointRecord, type EndpointStatus, LIVE_STATUS_URL, type LicenseType, type SearchField, type ServiceType, type StateFile, type StateIndexEntry, type VerifiedBy, atlas, atlasIndex, buildParcelLookupDeepLink, countyPath, countySlugFromName, findCounty, findCountyByFips, findState, isReviewedUnservable, listCountiesByState, listStates, reviewedCapability, slugify, statePath };
package/dist/index.d.ts CHANGED
@@ -52,6 +52,58 @@ interface ContactInfo {
52
52
  url: string | null;
53
53
  email: string | null;
54
54
  }
55
+ /** A short curated caveat about a county, written by a human. */
56
+ interface CountyAdvisory {
57
+ body: string;
58
+ source?: {
59
+ label: string;
60
+ url: string;
61
+ };
62
+ }
63
+ /** The fields a caller can ask a county about. */
64
+ type CapabilityField = "apn" | "owner_name" | "owner_mailing_address" | "situs_address" | "geometry" | "land_use" | "zoning";
65
+ type CapabilityStatus = "available" | "not_published" | "restricted" | "unverified";
66
+ /**
67
+ * Where a non-available status comes from. The type matters more than the
68
+ * prose, because it tells you whether you are reading a fact about a service, a
69
+ * claim the COUNTY makes, or a claim we make.
70
+ *
71
+ * `county_cited_statute` is the one to read carefully. It means the county
72
+ * publishes that citation as its own reason, reported here attributed to them
73
+ * rather than adopted as our reading of the law. San Bernardino County returns
74
+ * the literal string "Protected Per CA Gov Code 7928.205" in every owner-name
75
+ * row; that section protects the home address of elected and appointed
76
+ * officials, and San Diego County publishes owner names on its public layer.
77
+ * One statute, different county behaviour, so the attribution is not a
78
+ * formality.
79
+ */
80
+ type CapabilityBasisType = "endpoint_schema" | "county_cited_statute" | "statute" | "county_policy";
81
+ interface CapabilityBasis {
82
+ type: CapabilityBasisType;
83
+ /** One sentence you could show a user without editing. */
84
+ note: string;
85
+ citation?: string;
86
+ sourceUrl?: string;
87
+ /** Who makes the claim, when it is not us. Always set for county_cited_statute. */
88
+ attributedTo?: string;
89
+ }
90
+ /**
91
+ * REVIEWED capability assertions, per field. Only entries a human entered and
92
+ * checked appear here, which is exactly the knowledge you cannot compute from
93
+ * the bundled data yourself.
94
+ *
95
+ * What is NOT here is the mechanical half. Whether a field is simply absent
96
+ * from an endpoint's documented `searchFields` is derivable, and this package
97
+ * deliberately does not derive it: a second implementation of that
98
+ * classification would drift from the one the API bills against, and you would
99
+ * have no way to tell which was right. Read `endpoints[].searchFields` for the
100
+ * mechanical answer, and treat an entry here as outranking it.
101
+ */
102
+ type CapabilityOverrides = Partial<Record<CapabilityField, {
103
+ status: CapabilityStatus;
104
+ basis: CapabilityBasis;
105
+ lawfulAlternativeUrl?: string | null;
106
+ }>>;
55
107
  interface CountyRecord {
56
108
  id: string;
57
109
  state: string;
@@ -64,6 +116,14 @@ interface CountyRecord {
64
116
  contact: ContactInfo | null;
65
117
  hasPublicRest: boolean;
66
118
  notes: string | null;
119
+ /** Curated caveat about owner data on this county's public layer. */
120
+ ownerFieldNote?: CountyAdvisory | null;
121
+ /** Curated caveat about how old the county's published data is. */
122
+ dataVintage?: CountyAdvisory | null;
123
+ /** Reviewed, per-field capability assertions. See {@link CapabilityOverrides}. */
124
+ capabilityOverrides?: CapabilityOverrides | null;
125
+ relatedZoningCitySlug?: string | null;
126
+ relatedPropertyCitySlug?: string | null;
67
127
  }
68
128
  interface StateFile {
69
129
  stateSlug: string;
@@ -88,9 +148,41 @@ interface AtlasIndex {
88
148
  states: number;
89
149
  counties: number;
90
150
  endpoints: number;
151
+ /** Counties that publish at least one endpoint, i.e. the ones you can
152
+ * actually query. Distinct from BOTH fields above: counties counts every
153
+ * indexed county, endpoints counts endpoint RECORDS (a few counties
154
+ * publish two). Those two coincided at 155/155 while four counties
155
+ * published none, which is how published copy came to claim 155 verified
156
+ * endpoints. Prefer this when the sentence is about queryable coverage. */
157
+ countiesWithEndpoint: number;
91
158
  };
92
159
  }
93
160
 
161
+ /**
162
+ * The reviewed capability assertion for one field, or null when none exists.
163
+ *
164
+ * Null is the common answer and it is not a failure: it means nobody has had to
165
+ * write anything down about that field for that county, so the ordinary rules
166
+ * apply. Read `county.endpoints[].searchFields` to see what the layer actually
167
+ * documents.
168
+ *
169
+ * A non-null answer is the part worth branching on. It was entered by a human
170
+ * who checked something a field list cannot show, and it outranks whatever the
171
+ * field list implies. The clearest case: San Bernardino County publishes an
172
+ * `OwnerName` column, so the field list says owner names are available, and
173
+ * every row's value is the literal string "Protected Per CA Gov Code 7928.205".
174
+ * Only the reviewed record can tell you that.
175
+ */
176
+ declare function reviewedCapability(county: Pick<CountyRecord, "capabilityOverrides">, field: CapabilityField): NonNullable<CapabilityOverrides[CapabilityField]> | null;
177
+ /**
178
+ * True when a reviewed record says this field cannot be served, whatever the
179
+ * reason. Use it to decide whether to promise a user the field at all.
180
+ *
181
+ * False does NOT mean "available". It means no reviewed record says otherwise,
182
+ * so fall back to the endpoint's documented `searchFields`.
183
+ */
184
+ declare function isReviewedUnservable(county: Pick<CountyRecord, "capabilityOverrides">, field: CapabilityField): boolean;
185
+
94
186
  /**
95
187
  * Look up a county by state slug and county slug.
96
188
  * Returns undefined if the state isn't populated yet or the county doesn't exist.
@@ -146,4 +238,4 @@ interface Atlas {
146
238
  }
147
239
  declare const atlas: Atlas;
148
240
 
149
- export { type Atlas, type AtlasIndex, type ContactInfo, type CountyRecord, type EndpointRecord, type EndpointStatus, LIVE_STATUS_URL, type LicenseType, type SearchField, type ServiceType, type StateFile, type StateIndexEntry, type VerifiedBy, atlas, atlasIndex, buildParcelLookupDeepLink, countyPath, countySlugFromName, findCounty, findCountyByFips, findState, listCountiesByState, listStates, slugify, statePath };
241
+ export { type Atlas, type AtlasIndex, type CapabilityBasis, type CapabilityBasisType, type CapabilityField, type CapabilityOverrides, type CapabilityStatus, type ContactInfo, type CountyAdvisory, type CountyRecord, type EndpointRecord, type EndpointStatus, LIVE_STATUS_URL, type LicenseType, type SearchField, type ServiceType, type StateFile, type StateIndexEntry, type VerifiedBy, atlas, atlasIndex, buildParcelLookupDeepLink, countyPath, countySlugFromName, findCounty, findCountyByFips, findState, isReviewedUnservable, listCountiesByState, listStates, reviewedCapability, slugify, statePath };