@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.
Files changed (84) hide show
  1. package/lib/env.ts +30 -0
  2. package/lib/index.ts +2 -0
  3. package/{sdk → lib/sdk}/build-bdc.ts +343 -298
  4. package/{sdk → lib/sdk}/client.ts +24 -38
  5. package/{sdk → lib/sdk}/common.ts +1 -1
  6. package/{sdk → lib/sdk}/data-collection.ts +2 -2
  7. package/{sdk → lib/sdk}/download.ts +19 -15
  8. package/{sdk → lib/sdk}/filing-dates.ts +3 -3
  9. package/{sdk → lib/sdk}/filing-landscape.ts +12 -24
  10. package/lib/sdk/index.ts +14 -0
  11. package/{sdk → lib/sdk}/list-files.ts +2 -2
  12. package/{sdk → lib/sdk}/nearest-infrastructure.ts +5 -5
  13. package/lib/sdk/parsing.ts +157 -0
  14. package/{sdk → lib/sdk}/plausibility.ts +43 -29
  15. package/out/env.d.ts +24 -0
  16. package/out/env.d.ts.map +1 -0
  17. package/out/env.js +28 -0
  18. package/out/env.js.map +1 -0
  19. package/out/index.d.ts +2 -2
  20. package/out/index.d.ts.map +1 -1
  21. package/out/index.js +2 -2
  22. package/out/index.js.map +1 -1
  23. package/out/schema.d.ts.map +1 -1
  24. package/out/schema.js.map +1 -1
  25. package/out/sdk/build-bdc.d.ts +32 -25
  26. package/out/sdk/build-bdc.d.ts.map +1 -1
  27. package/out/sdk/build-bdc.js +255 -219
  28. package/out/sdk/build-bdc.js.map +1 -1
  29. package/out/sdk/buildings.d.ts.map +1 -1
  30. package/out/sdk/buildings.js.map +1 -1
  31. package/out/sdk/client.d.ts +7 -7
  32. package/out/sdk/client.d.ts.map +1 -1
  33. package/out/sdk/client.js +17 -29
  34. package/out/sdk/client.js.map +1 -1
  35. package/out/sdk/common.d.ts +1 -1
  36. package/out/sdk/common.d.ts.map +1 -1
  37. package/out/sdk/common.js.map +1 -1
  38. package/out/sdk/data-collection.d.ts +2 -2
  39. package/out/sdk/data-collection.d.ts.map +1 -1
  40. package/out/sdk/data-collection.js.map +1 -1
  41. package/out/sdk/download.d.ts +4 -3
  42. package/out/sdk/download.d.ts.map +1 -1
  43. package/out/sdk/download.js +12 -13
  44. package/out/sdk/download.js.map +1 -1
  45. package/out/sdk/filing-dates.d.ts +3 -3
  46. package/out/sdk/filing-dates.d.ts.map +1 -1
  47. package/out/sdk/filing-dates.js +1 -1
  48. package/out/sdk/filing-dates.js.map +1 -1
  49. package/out/sdk/filing-landscape.d.ts +4 -4
  50. package/out/sdk/filing-landscape.d.ts.map +1 -1
  51. package/out/sdk/filing-landscape.js +9 -19
  52. package/out/sdk/filing-landscape.js.map +1 -1
  53. package/out/sdk/index.d.ts +14 -14
  54. package/out/sdk/index.d.ts.map +1 -1
  55. package/out/sdk/index.js +14 -14
  56. package/out/sdk/index.js.map +1 -1
  57. package/out/sdk/list-files.d.ts +2 -2
  58. package/out/sdk/list-files.d.ts.map +1 -1
  59. package/out/sdk/list-files.js +1 -1
  60. package/out/sdk/list-files.js.map +1 -1
  61. package/out/sdk/location.d.ts.map +1 -1
  62. package/out/sdk/location.js.map +1 -1
  63. package/out/sdk/nearest-infrastructure.d.ts +4 -4
  64. package/out/sdk/nearest-infrastructure.d.ts.map +1 -1
  65. package/out/sdk/nearest-infrastructure.js +2 -2
  66. package/out/sdk/nearest-infrastructure.js.map +1 -1
  67. package/out/sdk/parsing.d.ts +66 -28
  68. package/out/sdk/parsing.d.ts.map +1 -1
  69. package/out/sdk/parsing.js +103 -70
  70. package/out/sdk/parsing.js.map +1 -1
  71. package/out/sdk/plausibility.d.ts +32 -14
  72. package/out/sdk/plausibility.d.ts.map +1 -1
  73. package/out/sdk/plausibility.js +15 -20
  74. package/out/sdk/plausibility.js.map +1 -1
  75. package/out/sdk/technologies.d.ts.map +1 -1
  76. package/out/sdk/technologies.js.map +1 -1
  77. package/package.json +164 -22
  78. package/index.ts +0 -2
  79. package/sdk/index.ts +0 -14
  80. package/sdk/parsing.ts +0 -124
  81. /package/{schema.ts → lib/schema.ts} +0 -0
  82. /package/{sdk → lib/sdk}/buildings.ts +0 -0
  83. /package/{sdk → lib/sdk}/location.ts +0 -0
  84. /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;AAGH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAA8B,MAAM,wBAAwB,CAAA;AACzG,OAAO,EAAE,YAAY,EAAE,cAAc,EAAiC,MAAM,oBAAoB,CAAA;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AACpC,OAAO,EAAE,GAAG,EAAe,MAAM,QAAQ,CAAA;AAEzC,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAoB,MAAM,cAAc,CAAA;AAsC9F;;;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;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,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,aAAyB,CAAC,CAAA;QAEjE,MAAM,WAAW,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE,CAAA;QAEhD,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACnC,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,eAAe,EAAE,GAAG,CAAC,eAAe;YACpC,YAAY,EAAE,GAAG,CAAC,YAAY;YAC9B,WAAW,EAAE,GAAG,CAAC,WAAW;SAC5B,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO;QACN,OAAO,EAAE,QAAQ,CAAC,aAAa;QAC/B,oBAAoB,EAAE,kBAAkB;QACxC,mBAAmB,EAAE,iBAAiB;QACtC,OAAO;KACP,CAAA;AACF,CAAC"}
@@ -1,15 +1,15 @@
1
- export * from "./build-bdc.ts";
2
- export * from "./buildings.ts";
3
- export * from "./client.ts";
4
- export * from "./common.ts";
5
- export * from "./data-collection.ts";
6
- export * from "./download.ts";
7
- export * from "./filing-dates.ts";
8
- export * from "./filing-landscape.ts";
9
- export * from "./list-files.ts";
10
- export * from "./location.ts";
11
- export * from "./nearest-infrastructure.ts";
12
- export * from "./parsing.ts";
13
- export * from "./plausibility.ts";
14
- export * from "./technologies.ts";
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
@@ -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 "./build-bdc.js";
2
- export * from "./buildings.js";
3
- export * from "./client.js";
4
- export * from "./common.js";
5
- export * from "./data-collection.js";
6
- export * from "./download.js";
7
- export * from "./filing-dates.js";
8
- export * from "./filing-landscape.js";
9
- export * from "./list-files.js";
10
- export * from "./location.js";
11
- export * from "./nearest-infrastructure.js";
12
- export * from "./parsing.js";
13
- export * from "./plausibility.js";
14
- export * from "./technologies.js";
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
@@ -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"}
@@ -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 "./client.ts";
14
- import { type BDCFile, type BDCFileCategory, type BDCProviderSubCategory, type BDCStateSubCategory, type BDCSummarySubCategory } from "./common.ts";
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"}
@@ -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 "./common.js";
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"}
@@ -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 { DatabaseClient } from "@mailwoman/core/kysley/client";
37
- import { type CoverageCell, type LayerContractDatabase } from "@mailwoman/core/layers";
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<LayerContractDatabase>, options: NearestInfrastructureOptions): Promise<InfrastructureHit[]>;
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,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EAAqB,KAAK,YAAY,EAAE,KAAK,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AACzG,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,2CAA2C,CAAA;AAC7F,OAAO,EAA+B,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAKnF;;;;;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,cAAc,CAAC,qBAAqB,CAAC,EACjD,OAAO,EAAE,4BAA4B,GACnC,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAkC9B"}
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-lookup";
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 "./filing-landscape.js";
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;AAGH,OAAO,EAAE,iBAAiB,EAAiD,MAAM,wBAAwB,CAAA;AACzG,OAAO,EAAE,iBAAiB,EAAkB,MAAM,2CAA2C,CAAA;AAC7F,OAAO,EAAE,cAAc,EAAkC,MAAM,oBAAoB,CAAA;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAEpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AAEjE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAG,EAAE,CAAA;AAiC1D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAC1C,SAAoB,EACpB,UAAiD,EACjD,OAAqC;IAErC,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAA;IAExD,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC;QAC7B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,MAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE;QAC/B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,wCAAwC;KACtE,CAAC,CAAA;IAEF,MAAM,kBAAkB,G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ister Software.
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
- * @file FCC BDC availability CSV byte-level parser.
6
- *
7
- * Re-homed from Nexus's `sync/fcc/bdc/parsing.ts` (relicense-by-copy, no provenance headers): the same
8
- * byte-scanning generator over the FCC's 12-column availability CSV see the Nexus `RawBSLAvailabilityRow`
9
- * tuple (`sync/fcc/bdc/block-aggregator.ts`) for the column order this scan assumes: frn, provider_id,
10
- * brand_name, location_id, technology, max_advertised_download_speed, max_advertised_upload_speed,
11
- * low_latency, business_residential_code, state_usps, block_geoid, h3_res8_id. Changed only where the
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.
17
- *
18
- * Columns 0-2 (frn, provider_id, brand_name) and 9, 11 (state_usps, h3_res8_id) are scanned over but
19
- * never sliced into the output record: `provider_id` comes from the `providerID` parameter instead (the
20
- * FCC partitions availability files per provider, so the caller already knows it), and FRN/brand/state/H3
21
- * join concerns are out of scope for 2a (decision 8 provider identity is a 2c registry-join seam).
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 { ProviderID } from "./common.ts";
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 takeAvailabilityLine}
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
- * Decoded to an ASCII string at the parse boundary (2a decision 3) — joins `TIGERBlockTable.GEOID` (note: uppercase
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
- * Given a buffer containing FCC BDC availability CSV data, yield each data row (the header row is skipped) as a
49
- * {@linkcode BDCAvailabilityRow}.
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
- * A byte-level scan, not a general CSV parser: it tracks comma/newline byte positions directly and only toggles
52
- * quote-awareness via a running double-quote count (an odd count means the scanner is currently inside a quoted field,
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 takeAvailabilityLine(csvBuffer: Buffer, providerID: ProviderID): Iterable<BDCAvailabilityRow>;
94
+ export declare function readAvailabilityRowsSync(csvBuffer: Buffer | string, providerID: ProviderID): Iterable<BDCAvailabilityRow>;
57
95
  //# sourceMappingURL=parsing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parsing.d.ts","sourceRoot":"","sources":["../../sdk/parsing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAgB7C;;;;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;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;;GAQG;AACH,wBAAiB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,QAAQ,CAAC,kBAAkB,CAAC,CAmD7G"}
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"}
@@ -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 byte-level parser.
5
+ * @file FCC BDC availability CSV row reader.
6
6
  *
7
- * Re-homed from Nexus's `sync/fcc/bdc/parsing.ts` (relicense-by-copy, no provenance headers): the same
8
- * byte-scanning generator over the FCC's 12-column availability CSV see the Nexus `RawBSLAvailabilityRow`
9
- * tuple (`sync/fcc/bdc/block-aggregator.ts`) for the column order this scan assumes: frn, provider_id,
10
- * brand_name, location_id, technology, max_advertised_download_speed, max_advertised_upload_speed,
11
- * low_latency, business_residential_code, state_usps, block_geoid, h3_res8_id. Changed only where the
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
- * Columns 0-2 (frn, provider_id, brand_name) and 9, 11 (state_usps, h3_res8_id) are scanned over but
19
- * never sliced into the output record: `provider_id` comes from the `providerID` parameter instead (the
20
- * FCC partitions availability files per provider, so the caller already knows it), and FRN/brand/state/H3
21
- * join concerns are out of scope for 2a (decision 8 — provider identity is a 2c registry-join seam).
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
- * Byte values this scanner switches on.
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
- * Local to this file — no generic newline-delimited-file utility exists elsewhere in the repo to import. Nexus's
27
- * equivalent (`LineDelimitedCharacter`) lived in `@isp.nexus/sdk/files`, a workspace this port doesn't carry over, and
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 CSVByte = {
31
- Newline: 10,
32
- Comma: 44,
33
- DoubleQuote: 34,
34
- One: 49,
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
- * Given a buffer containing FCC BDC availability CSV data, yield each data row (the header row is skipped) as a
38
- * {@linkcode BDCAvailabilityRow}.
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
- * A byte-level scan, not a general CSV parser: it tracks comma/newline byte positions directly and only toggles
41
- * quote-awareness via a running double-quote count (an odd count means the scanner is currently inside a quoted field,
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* takeAvailabilityLine(csvBuffer, providerID) {
46
- // Skip the header row.
47
- let byteIndex = csvBuffer.indexOf(CSVByte.Newline) + 1;
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
@@ -1 +1 @@
1
- {"version":3,"file":"parsing.js","sourceRoot":"","sources":["../../sdk/parsing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH;;;;;;GAMG;AACH,MAAM,OAAO,GAAG;IACf,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,EAAE;IACT,WAAW,EAAE,EAAE;IACf,GAAG,EAAE,EAAE;CACE,CAAA;AA0BV;;;;;;;;GAQG;AACH,MAAM,SAAS,CAAC,CAAC,oBAAoB,CAAC,SAAiB,EAAE,UAAsB;IAC9E,uBAAuB;IACvB,IAAI,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACtD,MAAM,iBAAiB,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC,CAAA,CAAC,aAAa;IAC3D,iBAAiB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;IAChC,IAAI,cAAc,GAAG,CAAC,CAAA;IACtB,IAAI,gBAAgB,GAAG,CAAC,CAAA;IAExB,OAAO,SAAS,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,CAAA;QAEjC,IAAI,IAAI,KAAK,OAAO,CAAC,WAAW,EAAE,CAAC;YAClC,gBAAgB,EAAE,CAAA;QACnB,CAAC;QAED,IAAI,IAAI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