@mailwoman/bdc 9.1.0 → 9.3.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.
- package/lib/env.ts +30 -0
- package/lib/index.ts +2 -0
- package/{sdk → lib/sdk}/build-bdc.ts +343 -298
- package/{sdk → lib/sdk}/client.ts +24 -38
- package/{sdk → lib/sdk}/common.ts +1 -1
- package/{sdk → lib/sdk}/data-collection.ts +2 -2
- package/{sdk → lib/sdk}/download.ts +19 -15
- package/{sdk → lib/sdk}/filing-dates.ts +3 -3
- package/{sdk → lib/sdk}/filing-landscape.ts +12 -24
- package/lib/sdk/index.ts +14 -0
- package/{sdk → lib/sdk}/list-files.ts +2 -2
- package/{sdk → lib/sdk}/nearest-infrastructure.ts +5 -5
- package/lib/sdk/parsing.ts +157 -0
- package/{sdk → lib/sdk}/plausibility.ts +43 -29
- package/out/env.d.ts +24 -0
- package/out/env.d.ts.map +1 -0
- package/out/env.js +28 -0
- package/out/env.js.map +1 -0
- package/out/index.d.ts +2 -2
- package/out/index.d.ts.map +1 -1
- package/out/index.js +2 -2
- package/out/index.js.map +1 -1
- package/out/schema.d.ts.map +1 -1
- package/out/schema.js.map +1 -1
- package/out/sdk/build-bdc.d.ts +32 -25
- package/out/sdk/build-bdc.d.ts.map +1 -1
- package/out/sdk/build-bdc.js +255 -219
- package/out/sdk/build-bdc.js.map +1 -1
- package/out/sdk/buildings.d.ts.map +1 -1
- package/out/sdk/buildings.js.map +1 -1
- package/out/sdk/client.d.ts +7 -7
- package/out/sdk/client.d.ts.map +1 -1
- package/out/sdk/client.js +17 -29
- package/out/sdk/client.js.map +1 -1
- package/out/sdk/common.d.ts +1 -1
- package/out/sdk/common.d.ts.map +1 -1
- package/out/sdk/common.js.map +1 -1
- package/out/sdk/data-collection.d.ts +2 -2
- package/out/sdk/data-collection.d.ts.map +1 -1
- package/out/sdk/data-collection.js.map +1 -1
- package/out/sdk/download.d.ts +4 -3
- package/out/sdk/download.d.ts.map +1 -1
- package/out/sdk/download.js +12 -13
- package/out/sdk/download.js.map +1 -1
- package/out/sdk/filing-dates.d.ts +3 -3
- package/out/sdk/filing-dates.d.ts.map +1 -1
- package/out/sdk/filing-dates.js +1 -1
- package/out/sdk/filing-dates.js.map +1 -1
- package/out/sdk/filing-landscape.d.ts +4 -4
- package/out/sdk/filing-landscape.d.ts.map +1 -1
- package/out/sdk/filing-landscape.js +9 -19
- package/out/sdk/filing-landscape.js.map +1 -1
- package/out/sdk/index.d.ts +14 -14
- package/out/sdk/index.d.ts.map +1 -1
- package/out/sdk/index.js +14 -14
- package/out/sdk/index.js.map +1 -1
- package/out/sdk/list-files.d.ts +2 -2
- package/out/sdk/list-files.d.ts.map +1 -1
- package/out/sdk/list-files.js +1 -1
- package/out/sdk/list-files.js.map +1 -1
- package/out/sdk/location.d.ts.map +1 -1
- package/out/sdk/location.js.map +1 -1
- package/out/sdk/nearest-infrastructure.d.ts +4 -4
- package/out/sdk/nearest-infrastructure.d.ts.map +1 -1
- package/out/sdk/nearest-infrastructure.js +2 -2
- package/out/sdk/nearest-infrastructure.js.map +1 -1
- package/out/sdk/parsing.d.ts +66 -28
- package/out/sdk/parsing.d.ts.map +1 -1
- package/out/sdk/parsing.js +103 -70
- package/out/sdk/parsing.js.map +1 -1
- package/out/sdk/plausibility.d.ts +32 -14
- package/out/sdk/plausibility.d.ts.map +1 -1
- package/out/sdk/plausibility.js +15 -20
- package/out/sdk/plausibility.js.map +1 -1
- package/out/sdk/technologies.d.ts.map +1 -1
- package/out/sdk/technologies.js.map +1 -1
- package/package.json +164 -22
- package/index.ts +0 -2
- package/sdk/index.ts +0 -14
- package/sdk/parsing.ts +0 -124
- /package/{schema.ts → lib/schema.ts} +0 -0
- /package/{sdk → lib/sdk}/buildings.ts +0 -0
- /package/{sdk → lib/sdk}/location.ts +0 -0
- /package/{sdk → lib/sdk}/technologies.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filing-landscape.js","sourceRoot":"","sources":["../../sdk/filing-landscape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;
|
|
1
|
+
{"version":3,"file":"filing-landscape.js","sourceRoot":"","sources":["../../lib/sdk/filing-landscape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAEzD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAE5B,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAoB,MAAM,SAAS,CAAA;AAsCzF;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAU,CAAA;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,QAAQ,CAAA;AAE/C;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAU,CAAA;AAEnD;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,SAAS,CAAA;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,CAAA;AAEpD;;GAEG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,GAAG,CAAA;AAEtD;;GAEG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,IAAI,CAAA;AAE3D;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,0BAAkC;IAC7E,IAAI,0BAA0B,GAAG,kCAAkC;QAAE,OAAO,yBAAyB,CAAA;IAErG,IAAI,0BAA0B,GAAG,mCAAmC;QAAE,OAAO,uBAAuB,CAAA;IAEpG,IAAI,0BAA0B,GAAG,uCAAuC;QAAE,OAAO,yBAAyB,CAAA;IAE1G,OAAO,wBAAwB,CAAA;AAChC,CAAC;AAED;;;GAGG;AACH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ED,OAAO;QACN,OAAO,EAAE,QAAQ,CAAC,aAAa;QAC/B,oBAAoB,EAAE,kBAAkB;QACxC,mBAAmB,EAAE,iBAAiB;QACtC,OAAO;KACP,CAAA;AACF,CAAC"}
|
package/out/sdk/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export * from "
|
|
2
|
-
export * from "
|
|
3
|
-
export * from "
|
|
4
|
-
export * from "
|
|
5
|
-
export * from "
|
|
6
|
-
export * from "
|
|
7
|
-
export * from "
|
|
8
|
-
export * from "
|
|
9
|
-
export * from "
|
|
10
|
-
export * from "
|
|
11
|
-
export * from "
|
|
12
|
-
export * from "
|
|
13
|
-
export * from "
|
|
14
|
-
export * from "
|
|
1
|
+
export * from "#sdk/build-bdc";
|
|
2
|
+
export * from "#sdk/buildings";
|
|
3
|
+
export * from "#sdk/client";
|
|
4
|
+
export * from "#sdk/common";
|
|
5
|
+
export * from "#sdk/data-collection";
|
|
6
|
+
export * from "#sdk/download";
|
|
7
|
+
export * from "#sdk/filing-dates";
|
|
8
|
+
export * from "#sdk/filing-landscape";
|
|
9
|
+
export * from "#sdk/list-files";
|
|
10
|
+
export * from "#sdk/location";
|
|
11
|
+
export * from "#sdk/nearest-infrastructure";
|
|
12
|
+
export * from "#sdk/parsing";
|
|
13
|
+
export * from "#sdk/plausibility";
|
|
14
|
+
export * from "#sdk/technologies";
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
package/out/sdk/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../sdk/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/sdk/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA"}
|
package/out/sdk/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export * from "
|
|
2
|
-
export * from "
|
|
3
|
-
export * from "
|
|
4
|
-
export * from "
|
|
5
|
-
export * from "
|
|
6
|
-
export * from "
|
|
7
|
-
export * from "
|
|
8
|
-
export * from "
|
|
9
|
-
export * from "
|
|
10
|
-
export * from "
|
|
11
|
-
export * from "
|
|
12
|
-
export * from "
|
|
13
|
-
export * from "
|
|
14
|
-
export * from "
|
|
1
|
+
export * from "#sdk/build-bdc";
|
|
2
|
+
export * from "#sdk/buildings";
|
|
3
|
+
export * from "#sdk/client";
|
|
4
|
+
export * from "#sdk/common";
|
|
5
|
+
export * from "#sdk/data-collection";
|
|
6
|
+
export * from "#sdk/download";
|
|
7
|
+
export * from "#sdk/filing-dates";
|
|
8
|
+
export * from "#sdk/filing-landscape";
|
|
9
|
+
export * from "#sdk/list-files";
|
|
10
|
+
export * from "#sdk/location";
|
|
11
|
+
export * from "#sdk/nearest-infrastructure";
|
|
12
|
+
export * from "#sdk/parsing";
|
|
13
|
+
export * from "#sdk/plausibility";
|
|
14
|
+
export * from "#sdk/technologies";
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
package/out/sdk/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../sdk/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/sdk/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA"}
|
package/out/sdk/list-files.d.ts
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* {@linkcode BDCClient}. Raw entries are parsed via `parseRawBDCFile` and returned sorted
|
|
11
11
|
* ascending by revision (`compareRevisionAsc`) rather than in API order.
|
|
12
12
|
*/
|
|
13
|
-
import type { BDCClient } from "
|
|
14
|
-
import { type BDCFile, type BDCFileCategory, type BDCProviderSubCategory, type BDCStateSubCategory, type BDCSummarySubCategory } from "
|
|
13
|
+
import type { BDCClient } from "#sdk/client";
|
|
14
|
+
import { type BDCFile, type BDCFileCategory, type BDCProviderSubCategory, type BDCStateSubCategory, type BDCSummarySubCategory } from "#sdk/common";
|
|
15
15
|
export interface RetrieveProviderAvailabilityFilesParams {
|
|
16
16
|
/**
|
|
17
17
|
* The filing's `as_of_date`, e.g. from {@linkcode file://./filing-dates.ts#resolveLatestVintage}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-files.d.ts","sourceRoot":"","sources":["../../sdk/list-files.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAGN,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAE1B,MAAM,aAAa,CAAA;AAEpB,MAAM,WAAW,uCAAuC;IACvD;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,OAAO,eAAe,CAAC,QAAQ,CAAA;IACzC,WAAW,EAAE,sBAAsB,CAAA;CACnC;AAED,MAAM,WAAW,oCAAoC;IACpD,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,OAAO,eAAe,CAAC,KAAK,CAAA;IACtC,WAAW,EAAE,mBAAmB,CAAA;CAChC;AAED,MAAM,WAAW,sCAAsC;IACtD,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,OAAO,eAAe,CAAC,OAAO,CAAA;IACxC,WAAW,EAAE,qBAAqB,CAAA;CAClC;AAED,MAAM,MAAM,+BAA+B,GACxC,uCAAuC,GACvC,oCAAoC,GACpC,sCAAsC,CAAA;AAMzC;;;GAGG;AACH,wBAAsB,yBAAyB,CAC9C,MAAM,EAAE,SAAS,EACjB,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,+BAA+B,GAClE,OAAO,CAAC,OAAO,EAAE,CAAC,CASpB"}
|
|
1
|
+
{"version":3,"file":"list-files.d.ts","sourceRoot":"","sources":["../../lib/sdk/list-files.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAGN,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAE1B,MAAM,aAAa,CAAA;AAEpB,MAAM,WAAW,uCAAuC;IACvD;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,OAAO,eAAe,CAAC,QAAQ,CAAA;IACzC,WAAW,EAAE,sBAAsB,CAAA;CACnC;AAED,MAAM,WAAW,oCAAoC;IACpD,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,OAAO,eAAe,CAAC,KAAK,CAAA;IACtC,WAAW,EAAE,mBAAmB,CAAA;CAChC;AAED,MAAM,WAAW,sCAAsC;IACtD,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,OAAO,eAAe,CAAC,OAAO,CAAA;IACxC,WAAW,EAAE,qBAAqB,CAAA;CAClC;AAED,MAAM,MAAM,+BAA+B,GACxC,uCAAuC,GACvC,oCAAoC,GACpC,sCAAsC,CAAA;AAMzC;;;GAGG;AACH,wBAAsB,yBAAyB,CAC9C,MAAM,EAAE,SAAS,EACjB,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,+BAA+B,GAClE,OAAO,CAAC,OAAO,EAAE,CAAC,CASpB"}
|
package/out/sdk/list-files.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* {@linkcode BDCClient}. Raw entries are parsed via `parseRawBDCFile` and returned sorted
|
|
11
11
|
* ascending by revision (`compareRevisionAsc`) rather than in API order.
|
|
12
12
|
*/
|
|
13
|
-
import { compareRevisionAsc, parseRawBDCFile, } from "
|
|
13
|
+
import { compareRevisionAsc, parseRawBDCFile, } from "#sdk/common";
|
|
14
14
|
/**
|
|
15
15
|
* List the BDC availability files for a given `as_of_date`/category/subcategory, parsed into {@linkcode BDCFile}
|
|
16
16
|
* records and sorted ascending by revision date ({@linkcode compareRevisionAsc}).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-files.js","sourceRoot":"","sources":["../../sdk/list-files.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EACN,kBAAkB,EAClB,eAAe,GAOf,MAAM,aAAa,CAAA;AAgCpB;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC9C,MAAiB,EACjB,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAmC;IAEpE,MAAM,QAAQ,GAAG,uCAAuC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAA;IAEtF,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAmC,QAAQ,EAAE;QACzE,QAAQ;QACR,WAAW;KACX,CAAC,CAAA;IAEF,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAA;AACnE,CAAC"}
|
|
1
|
+
{"version":3,"file":"list-files.js","sourceRoot":"","sources":["../../lib/sdk/list-files.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EACN,kBAAkB,EAClB,eAAe,GAOf,MAAM,aAAa,CAAA;AAgCpB;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC9C,MAAiB,EACjB,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAmC;IAEpE,MAAM,QAAQ,GAAG,uCAAuC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAA;IAEtF,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAmC,QAAQ,EAAE;QACzE,QAAQ;QACR,WAAW;KACX,CAAC,CAAA;IAEF,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAA;AACnE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../sdk/location.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;GAIG;AACH,eAAO,MAAM,2CAA2C,QAAa,CAAA;AAErE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAAA;AAE3F;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,6BAA6B,CAEtG"}
|
|
1
|
+
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../lib/sdk/location.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;GAIG;AACH,eAAO,MAAM,2CAA2C,QAAa,CAAA;AAErE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAAA;AAE3F;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,6BAA6B,CAEtG"}
|
package/out/sdk/location.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../sdk/location.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,2CAA2C,GAAG,UAAU,CAAA;AAqBrE;;;;;;;GAOG;AACH,MAAM,UAAU,+BAA+B,CAAC,KAAc;IAC7D,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,2CAA2C,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC5F,CAAC"}
|
|
1
|
+
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../lib/sdk/location.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,2CAA2C,GAAG,UAAU,CAAA;AAqBrE;;;;;;;GAOG;AACH,MAAM,UAAU,+BAA+B,CAAC,KAAc;IAC7D,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,2CAA2C,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC5F,CAAC"}
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
* deliberately — see `schema.ts`). `POI_H3_RESOLUTION` (`poi-lookup.ts`) is ALSO 9, so the two layers'
|
|
34
34
|
* spines agree without this module hardcoding a resolution of its own.
|
|
35
35
|
*/
|
|
36
|
-
import type
|
|
37
|
-
import { type
|
|
38
|
-
import { type POILookup } from "@mailwoman/resolver-wof-sqlite/poi-lookup";
|
|
36
|
+
import { type CoverageCell, type LayerContractHandle } from "@mailwoman/core/layers";
|
|
37
|
+
import { type POILookup } from "@mailwoman/resolver-wof-sqlite/poi";
|
|
39
38
|
import { type PointLiteral } from "@mailwoman/spatial";
|
|
39
|
+
import type { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
40
40
|
/**
|
|
41
41
|
* Ring budget default for {@link nearestInfrastructure} — wider than `POILookup`'s own internal `DEFAULT_MAX_RINGS`
|
|
42
42
|
* (16, ≈5.4 km) because telecom infrastructure (central offices, comm towers) is sparser per-area than poi.db's dense
|
|
@@ -79,5 +79,5 @@ export interface NearestInfrastructureOptions {
|
|
|
79
79
|
* every `categoryIDs` entry unresolvable against `poiLookup`'s dictionary — returns `[]`, the same discipline
|
|
80
80
|
* `POILookup.search` itself follows.
|
|
81
81
|
*/
|
|
82
|
-
export declare function nearestInfrastructure(poiLookup: POILookup, contractDB: DatabaseClient
|
|
82
|
+
export declare function nearestInfrastructure(poiLookup: POILookup, contractDB: LayerContractHandle & Pick<DatabaseClient, "destroy">, options: NearestInfrastructureOptions): Promise<InfrastructureHit[]>;
|
|
83
83
|
//# sourceMappingURL=nearest-infrastructure.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nearest-infrastructure.d.ts","sourceRoot":"","sources":["../../sdk/nearest-infrastructure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"nearest-infrastructure.d.ts","sourceRoot":"","sources":["../../lib/sdk/nearest-infrastructure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAqB,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACvG,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,oCAAoC,CAAA;AACtF,OAAO,EAA+B,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAK9D;;;;;GAKG;AACH,eAAO,MAAM,wCAAwC,KAAK,CAAA;AAE1D;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IACjC,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAA;CAClC;AAED,MAAM,WAAW,4BAA4B;IAC5C,MAAM,EAAE,YAAY,CAAA;IACpB;;;OAGG;IACH,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAC1C,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,mBAAmB,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,EACjE,OAAO,EAAE,4BAA4B,GACnC,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAkC9B"}
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
* spines agree without this module hardcoding a resolution of its own.
|
|
35
35
|
*/
|
|
36
36
|
import { readLayerCoverage } from "@mailwoman/core/layers";
|
|
37
|
-
import { POI_H3_RESOLUTION } from "@mailwoman/resolver-wof-sqlite/poi
|
|
37
|
+
import { POI_H3_RESOLUTION } from "@mailwoman/resolver-wof-sqlite/poi";
|
|
38
38
|
import { shortCellToInt } from "@mailwoman/spatial";
|
|
39
39
|
import { latLngToCell } from "h3-js";
|
|
40
|
-
import { res9ShortCellToRes6Parent } from "
|
|
40
|
+
import { res9ShortCellToRes6Parent } from "#sdk/filing-landscape";
|
|
41
41
|
/**
|
|
42
42
|
* Ring budget default for {@link nearestInfrastructure} — wider than `POILookup`'s own internal `DEFAULT_MAX_RINGS`
|
|
43
43
|
* (16, ≈5.4 km) because telecom infrastructure (central offices, comm towers) is sparser per-area than poi.db's dense
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nearest-infrastructure.js","sourceRoot":"","sources":["../../sdk/nearest-infrastructure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;
|
|
1
|
+
{"version":3,"file":"nearest-infrastructure.js","sourceRoot":"","sources":["../../lib/sdk/nearest-infrastructure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;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G,MAAM,iBAAiB,CAAC,UAAU,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAC,CAAA;QAEvF,kBAAkB,CAAC,IAAI,CAAC;YACvB,UAAU,EAAE,GAAG,CAAC,UAAU;YAC1B,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,oFAAoF;YACpF,SAAS,EAAE,GAAG,CAAC,SAAU;YACzB,MAAM;YACN,QAAQ;SACR,CAAC,CAAA;IACH,CAAC;IAED,OAAO,kBAAkB,CAAA;AAC1B,CAAC"}
|
package/out/sdk/parsing.d.ts
CHANGED
|
@@ -2,29 +2,63 @@
|
|
|
2
2
|
* @copyright Sister Software.
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
* @file FCC BDC availability CSV
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
5
|
+
* @file FCC BDC availability CSV row reader.
|
|
6
|
+
*
|
|
7
|
+
* Streams the FCC's 12-column availability CSV through `CSVSpliterator` in `array` mode and projects the
|
|
8
|
+
* seven columns 2a keeps. Columns 0-2 (`frn`, `provider_id`, `brand_name`) and 9, 11 (`state_usps`,
|
|
9
|
+
* `h3_res8_id`) are read past and never emitted: `provider_id` comes from the {@linkcode ProviderID}
|
|
10
|
+
* parameter instead (the FCC partitions availability files per provider, so the caller already knows it),
|
|
11
|
+
* and FRN/brand/state/H3 join concerns are a 2c registry-join boundary.
|
|
12
|
+
*
|
|
13
|
+
* Two projection decisions are required and pre-registered. `location_id` (column 3) stays a STRING —
|
|
14
|
+
* the FCC's values are zero-padded 10-digit strings and `parseInt` would lose the leading zeros (decision
|
|
15
|
+
* 1). `geoid` (column 10) is a string joining `TIGERBlockTable.GEOID` (decision 3).
|
|
16
|
+
*
|
|
17
|
+
* ## Why the source is a resource, not a Buffer
|
|
18
|
+
*
|
|
19
|
+
* This read is STREAMING because the files do not fit the alternative. One state × one technology —
|
|
20
|
+
* `bdc_48_FibertothePremises_fixed_broadband_D25` — is 920 MB and 10,369,043 rows, and a national run
|
|
21
|
+
* spans every state × every technology. The previous byte scanner took a `Buffer`, so its caller opened
|
|
22
|
+
* with `readFile(csvPath)` and held the whole file resident per file.
|
|
23
|
+
*
|
|
24
|
+
* ## Why quoting is not optional here
|
|
25
|
+
*
|
|
26
|
+
* Measured on that same file: 421,555 rows carry one embedded comma inside a quoted `brand_name` and 327
|
|
27
|
+
* carry two ("FiberFirst, LLC", "Valor Telecommunications of Texas, LP"). A delimiter scan blind to quotes
|
|
28
|
+
* shifts every column right of `brand_name` on 4% of rows — measured exactly, a quote-blind
|
|
29
|
+
* `String.split(",")` mismatches 81,095 of 2,000,000 real rows. `enableQuoteHandling` also keeps an
|
|
30
|
+
* embedded NEWLINE inside its row — no row in that file needs it (the 12/13/14-field line counts sum
|
|
31
|
+
* exactly to `wc -l`, so no record is split across lines), but the guarantee is what makes the reader safe
|
|
32
|
+
* on a file nobody has measured yet.
|
|
33
|
+
*
|
|
34
|
+
* ## What this costs
|
|
35
|
+
*
|
|
36
|
+
* Measured on the full 920 MB / 10,369,042-row file, projecting these 7 of 12 columns, identical checksums
|
|
37
|
+
* across every arm. One arm per process — arms sharing a process mis-rank, because the JIT warms across
|
|
38
|
+
* them:
|
|
39
|
+
*
|
|
40
|
+
* ```
|
|
41
|
+
* hand-rolled byte scan, whole buffer 778 ns/row peak RSS 978 MB
|
|
42
|
+
* spliterator 6.2.0, streaming 2,435 ns/row peak RSS 112 MB
|
|
43
|
+
* spliterator patched, streaming 860 ns/row peak RSS 100 MB
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* The 6.2.0 row is why this looked like a regression when it landed: CSVSpliterator decoded once per
|
|
47
|
+
* COLUMN, and `TextDecoder`'s per-call overhead dominates at column sizes. Fixed upstream in
|
|
48
|
+
* sister-software/spliterator#6 by decoding the row once — so the streaming path now runs within 10% of a
|
|
49
|
+
* whole-buffer byte scan while holding 9.8x less memory. **Requires a spliterator release carrying that
|
|
50
|
+
* fix**; on 6.2.0 this reader is correct and roughly 3x slower.
|
|
51
|
+
*
|
|
52
|
+
* Do not route around it by hand-rolling a splitter here again. The staging insert this feeds measures 615
|
|
53
|
+
* ns/row, so the parse does sit on the critical path — but a local fast-and-quote-blind parser is exactly
|
|
54
|
+
* the trade that produced the scanner this replaced, and the quote-blind version is 4% wrong.
|
|
22
55
|
*/
|
|
23
|
-
import type {
|
|
56
|
+
import type { AsyncDataResource } from "spliterator";
|
|
57
|
+
import type { ProviderID } from "#sdk/common";
|
|
24
58
|
/**
|
|
25
59
|
* A single parsed row of FCC BDC availability data.
|
|
26
60
|
*
|
|
27
|
-
* @see {@linkcode
|
|
61
|
+
* @see {@linkcode readAvailabilityRows}
|
|
28
62
|
*/
|
|
29
63
|
export interface BDCAvailabilityRow {
|
|
30
64
|
provider_id: number;
|
|
@@ -39,19 +73,23 @@ export interface BDCAvailabilityRow {
|
|
|
39
73
|
low_latency: 0 | 1;
|
|
40
74
|
business_residential_code: string;
|
|
41
75
|
/**
|
|
42
|
-
*
|
|
43
|
-
* column on that side).
|
|
76
|
+
* Joins `TIGERBlockTable.GEOID` (note: uppercase column on that side) — 2a decision 3.
|
|
44
77
|
*/
|
|
45
78
|
geoid: string;
|
|
46
79
|
}
|
|
47
80
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
81
|
+
* Stream an FCC BDC availability CSV, yielding every data row. The header row is consumed, never emitted.
|
|
82
|
+
*
|
|
83
|
+
* `source` is anything `spliterator` can open asynchronously — a path string, a `path-ts` builder, a URL, a file
|
|
84
|
+
* handle, or an async chunk iterator. Prefer handing it the path and letting it own the read: that is what keeps a 920
|
|
85
|
+
* MB file off the heap.
|
|
86
|
+
*/
|
|
87
|
+
export declare function readAvailabilityRows(source: AsyncDataResource, providerID: ProviderID): AsyncIterable<BDCAvailabilityRow>;
|
|
88
|
+
/**
|
|
89
|
+
* Synchronous sibling for an in-memory buffer — fixtures and tests, never the build path.
|
|
50
90
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* so a comma there isn't a column delimiter) — matching the Nexus original's approach for this specific, known-shaped
|
|
54
|
-
* 12-column file rather than reaching for a general CSV library.
|
|
91
|
+
* Kept because a test that must assert on a literal CSV should not have to stand up a stream to do it. If you are
|
|
92
|
+
* reaching for this against a file on disk, reach for {@linkcode readAvailabilityRows} instead.
|
|
55
93
|
*/
|
|
56
|
-
export declare function
|
|
94
|
+
export declare function readAvailabilityRowsSync(csvBuffer: Buffer | string, providerID: ProviderID): Iterable<BDCAvailabilityRow>;
|
|
57
95
|
//# sourceMappingURL=parsing.d.ts.map
|
package/out/sdk/parsing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parsing.d.ts","sourceRoot":"","sources":["../../sdk/parsing.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"parsing.d.ts","sourceRoot":"","sources":["../../lib/sdk/parsing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAGpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAmB7C;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,MAAM,CAAA;IACvB,6BAA6B,EAAE,MAAM,CAAA;IACrC,2BAA2B,EAAE,MAAM,CAAA;IACnC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAA;IAClB,yBAAyB,EAAE,MAAM,CAAA;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;CACb;AA4BD;;;;;;GAMG;AACH,wBAAuB,oBAAoB,CAC1C,MAAM,EAAE,iBAAiB,EACzB,UAAU,EAAE,UAAU,GACpB,aAAa,CAAC,kBAAkB,CAAC,CAInC;AAED;;;;;GAKG;AACH,wBAAiB,wBAAwB,CACxC,SAAS,EAAE,MAAM,GAAG,MAAM,EAC1B,UAAU,EAAE,UAAU,GACpB,QAAQ,CAAC,kBAAkB,CAAC,CAI9B"}
|
package/out/sdk/parsing.js
CHANGED
|
@@ -2,86 +2,119 @@
|
|
|
2
2
|
* @copyright Sister Software.
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
* @file FCC BDC availability CSV
|
|
5
|
+
* @file FCC BDC availability CSV row reader.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* pre-registered 2a decisions require: `geoid` (column 10, `block_geoid`) decodes to an ASCII string
|
|
13
|
-
* instead of staying a raw `Uint8Array` slice (decision 3), and `location_id` (column 3) stays a string
|
|
14
|
-
* instead of `parseInt`ing it, preserving leading zeros (decision 1). `business_residential_code` is
|
|
15
|
-
* likewise decoded to its ASCII string here — the Nexus original kept only the field's first raw byte as
|
|
16
|
-
* a bare `number`, which this port's `BDCAvailabilityRow` shape doesn't call for.
|
|
7
|
+
* Streams the FCC's 12-column availability CSV through `CSVSpliterator` in `array` mode and projects the
|
|
8
|
+
* seven columns 2a keeps. Columns 0-2 (`frn`, `provider_id`, `brand_name`) and 9, 11 (`state_usps`,
|
|
9
|
+
* `h3_res8_id`) are read past and never emitted: `provider_id` comes from the {@linkcode ProviderID}
|
|
10
|
+
* parameter instead (the FCC partitions availability files per provider, so the caller already knows it),
|
|
11
|
+
* and FRN/brand/state/H3 join concerns are a 2c registry-join boundary.
|
|
17
12
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
13
|
+
* Two projection decisions are required and pre-registered. `location_id` (column 3) stays a STRING —
|
|
14
|
+
* the FCC's values are zero-padded 10-digit strings and `parseInt` would lose the leading zeros (decision
|
|
15
|
+
* 1). `geoid` (column 10) is a string joining `TIGERBlockTable.GEOID` (decision 3).
|
|
16
|
+
*
|
|
17
|
+
* ## Why the source is a resource, not a Buffer
|
|
18
|
+
*
|
|
19
|
+
* This read is STREAMING because the files do not fit the alternative. One state × one technology —
|
|
20
|
+
* `bdc_48_FibertothePremises_fixed_broadband_D25` — is 920 MB and 10,369,043 rows, and a national run
|
|
21
|
+
* spans every state × every technology. The previous byte scanner took a `Buffer`, so its caller opened
|
|
22
|
+
* with `readFile(csvPath)` and held the whole file resident per file.
|
|
23
|
+
*
|
|
24
|
+
* ## Why quoting is not optional here
|
|
25
|
+
*
|
|
26
|
+
* Measured on that same file: 421,555 rows carry one embedded comma inside a quoted `brand_name` and 327
|
|
27
|
+
* carry two ("FiberFirst, LLC", "Valor Telecommunications of Texas, LP"). A delimiter scan blind to quotes
|
|
28
|
+
* shifts every column right of `brand_name` on 4% of rows — measured exactly, a quote-blind
|
|
29
|
+
* `String.split(",")` mismatches 81,095 of 2,000,000 real rows. `enableQuoteHandling` also keeps an
|
|
30
|
+
* embedded NEWLINE inside its row — no row in that file needs it (the 12/13/14-field line counts sum
|
|
31
|
+
* exactly to `wc -l`, so no record is split across lines), but the guarantee is what makes the reader safe
|
|
32
|
+
* on a file nobody has measured yet.
|
|
33
|
+
*
|
|
34
|
+
* ## What this costs
|
|
35
|
+
*
|
|
36
|
+
* Measured on the full 920 MB / 10,369,042-row file, projecting these 7 of 12 columns, identical checksums
|
|
37
|
+
* across every arm. One arm per process — arms sharing a process mis-rank, because the JIT warms across
|
|
38
|
+
* them:
|
|
39
|
+
*
|
|
40
|
+
* ```
|
|
41
|
+
* hand-rolled byte scan, whole buffer 778 ns/row peak RSS 978 MB
|
|
42
|
+
* spliterator 6.2.0, streaming 2,435 ns/row peak RSS 112 MB
|
|
43
|
+
* spliterator patched, streaming 860 ns/row peak RSS 100 MB
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* The 6.2.0 row is why this looked like a regression when it landed: CSVSpliterator decoded once per
|
|
47
|
+
* COLUMN, and `TextDecoder`'s per-call overhead dominates at column sizes. Fixed upstream in
|
|
48
|
+
* sister-software/spliterator#6 by decoding the row once — so the streaming path now runs within 10% of a
|
|
49
|
+
* whole-buffer byte scan while holding 9.8x less memory. **Requires a spliterator release carrying that
|
|
50
|
+
* fix**; on 6.2.0 this reader is correct and roughly 3x slower.
|
|
51
|
+
*
|
|
52
|
+
* Do not route around it by hand-rolling a splitter here again. The staging insert this feeds measures 615
|
|
53
|
+
* ns/row, so the parse does sit on the critical path — but a local fast-and-quote-blind parser is exactly
|
|
54
|
+
* the trade that produced the scanner this replaced, and the quote-blind version is 4% wrong.
|
|
22
55
|
*/
|
|
56
|
+
import { CSVSpliterator } from "spliterator";
|
|
23
57
|
/**
|
|
24
|
-
*
|
|
58
|
+
* Column positions in the FCC's 12-column availability CSV. Named rather than sliced by offset so a reader can check
|
|
59
|
+
* them against the header row without counting commas:
|
|
25
60
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* repo convention forbids TS `enum` anyway (`erasableSyntaxOnly`).
|
|
61
|
+
* `frn,provider_id,brand_name,location_id,technology,max_advertised_download_speed,`
|
|
62
|
+
* `max_advertised_upload_speed,low_latency,business_residential_code,state_usps,block_geoid,h3_res8_id`
|
|
29
63
|
*/
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
64
|
+
const Column = {
|
|
65
|
+
LocationID: 3,
|
|
66
|
+
Technology: 4,
|
|
67
|
+
MaxAdvertisedDownloadSpeed: 5,
|
|
68
|
+
MaxAdvertisedUploadSpeed: 6,
|
|
69
|
+
LowLatency: 7,
|
|
70
|
+
BusinessResidentialCode: 8,
|
|
71
|
+
BlockGeoID: 10,
|
|
35
72
|
};
|
|
36
73
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
74
|
+
* Project one already-split CSV row onto {@linkcode BDCAvailabilityRow}.
|
|
75
|
+
*
|
|
76
|
+
* Separate from the iteration so the sync and async readers cannot drift in what they emit — the one-function
|
|
77
|
+
* discipline. Not exported: a caller with a split row wants {@linkcode readAvailabilityRowsSync}.
|
|
78
|
+
*/
|
|
79
|
+
function projectRow(columns, providerID) {
|
|
80
|
+
return {
|
|
81
|
+
provider_id: providerID,
|
|
82
|
+
location_id: columns[Column.LocationID] ?? "",
|
|
83
|
+
technology_code: Number.parseInt(columns[Column.Technology] ?? "", 10),
|
|
84
|
+
max_advertised_download_speed: Number.parseInt(columns[Column.MaxAdvertisedDownloadSpeed] ?? "", 10),
|
|
85
|
+
max_advertised_upload_speed: Number.parseInt(columns[Column.MaxAdvertisedUploadSpeed] ?? "", 10),
|
|
86
|
+
low_latency: columns[Column.LowLatency] === "1" ? 1 : 0,
|
|
87
|
+
business_residential_code: columns[Column.BusinessResidentialCode] ?? "",
|
|
88
|
+
geoid: columns[Column.BlockGeoID] ?? "",
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Shared reader options. `header: true` consumes the first row as the header even in `array` mode;
|
|
93
|
+
* `enableQuoteHandling` is what makes the 421,882 quoted-brand rows keep their column alignment. `crlf` already
|
|
94
|
+
* defaults to `true` for CSV (RFC 4180), so a CRLF file does not leak `\r` into the last column.
|
|
95
|
+
*/
|
|
96
|
+
const READER_OPTIONS = { mode: "array", enableQuoteHandling: true };
|
|
97
|
+
/**
|
|
98
|
+
* Stream an FCC BDC availability CSV, yielding every data row. The header row is consumed, never emitted.
|
|
99
|
+
*
|
|
100
|
+
* `source` is anything `spliterator` can open asynchronously — a path string, a `path-ts` builder, a URL, a file
|
|
101
|
+
* handle, or an async chunk iterator. Prefer handing it the path and letting it own the read: that is what keeps a 920
|
|
102
|
+
* MB file off the heap.
|
|
103
|
+
*/
|
|
104
|
+
export async function* readAvailabilityRows(source, providerID) {
|
|
105
|
+
for await (const columns of CSVSpliterator.fromAsync(source, READER_OPTIONS)) {
|
|
106
|
+
yield projectRow(columns, providerID);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Synchronous sibling for an in-memory buffer — fixtures and tests, never the build path.
|
|
39
111
|
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* so a comma there isn't a column delimiter) — matching the Nexus original's approach for this specific, known-shaped
|
|
43
|
-
* 12-column file rather than reaching for a general CSV library.
|
|
112
|
+
* Kept because a test that must assert on a literal CSV should not have to stand up a stream to do it. If you are
|
|
113
|
+
* reaching for this against a file on disk, reach for {@linkcode readAvailabilityRows} instead.
|
|
44
114
|
*/
|
|
45
|
-
export function*
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const contentDelimiters = new Uint32Array(12); // 12 columns
|
|
49
|
-
contentDelimiters[0] = byteIndex;
|
|
50
|
-
let delimiterIndex = 1;
|
|
51
|
-
let doubleQuoteCount = 0;
|
|
52
|
-
while (byteIndex < csvBuffer.length) {
|
|
53
|
-
const byte = csvBuffer[byteIndex];
|
|
54
|
-
if (byte === CSVByte.DoubleQuote) {
|
|
55
|
-
doubleQuoteCount++;
|
|
56
|
-
}
|
|
57
|
-
if (byte === CSVByte.Comma && doubleQuoteCount % 2 === 0) {
|
|
58
|
-
contentDelimiters[delimiterIndex] = byteIndex;
|
|
59
|
-
delimiterIndex++;
|
|
60
|
-
}
|
|
61
|
-
if (byte === CSVByte.Newline) {
|
|
62
|
-
contentDelimiters[delimiterIndex] = CSVByte.Newline;
|
|
63
|
-
const slices = [];
|
|
64
|
-
// Skip columns 0-2 (frn, provider_id, brand_name) — see the file header for why.
|
|
65
|
-
for (let i = 3; i < contentDelimiters.length; i++) {
|
|
66
|
-
const start = contentDelimiters[i] + 1;
|
|
67
|
-
const end = contentDelimiters[i + 1];
|
|
68
|
-
slices.push(csvBuffer.subarray(start, end));
|
|
69
|
-
}
|
|
70
|
-
const record = {
|
|
71
|
-
provider_id: providerID,
|
|
72
|
-
location_id: slices[0].toString("ascii"),
|
|
73
|
-
technology_code: Number.parseInt(slices[1].toString(), 10),
|
|
74
|
-
max_advertised_download_speed: Number.parseInt(slices[2].toString(), 10),
|
|
75
|
-
max_advertised_upload_speed: Number.parseInt(slices[3].toString(), 10),
|
|
76
|
-
low_latency: slices[4][0] === CSVByte.One ? 1 : 0,
|
|
77
|
-
business_residential_code: slices[5].toString("ascii"),
|
|
78
|
-
geoid: slices[7].toString("ascii"),
|
|
79
|
-
};
|
|
80
|
-
yield record;
|
|
81
|
-
delimiterIndex = 1;
|
|
82
|
-
doubleQuoteCount = 0;
|
|
83
|
-
}
|
|
84
|
-
byteIndex++;
|
|
115
|
+
export function* readAvailabilityRowsSync(csvBuffer, providerID) {
|
|
116
|
+
for (const columns of CSVSpliterator.from(csvBuffer, READER_OPTIONS)) {
|
|
117
|
+
yield projectRow(columns, providerID);
|
|
85
118
|
}
|
|
86
119
|
}
|
|
87
120
|
//# sourceMappingURL=parsing.js.map
|
package/out/sdk/parsing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parsing.js","sourceRoot":"","sources":["../../sdk/parsing.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"parsing.js","sourceRoot":"","sources":["../../lib/sdk/parsing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAI5C;;;;;;GAMG;AACH,MAAM,MAAM,GAAG;IACd,UAAU,EAAE,CAAC;IACb,UAAU,EAAE,CAAC;IACb,0BAA0B,EAAE,CAAC;IAC7B,wBAAwB,EAAE,CAAC;IAC3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