mailwoman 2.0.0 → 2.0.3

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/out/cli.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,90 +1,90 @@
1
1
  {
2
- "name": "mailwoman",
3
- "version": "2.0.0",
4
- "description": "Utilities for working with contacts for email, phone, and postal addresses.",
5
- "license": "AGPL-3.0-only",
6
- "contributors": [
7
- {
8
- "name": "Teffen Ellis",
9
- "email": "teffen@sister.software"
2
+ "name": "mailwoman",
3
+ "version": "2.0.3",
4
+ "description": "Utilities for working with contacts for email, phone, and postal addresses.",
5
+ "license": "AGPL-3.0-only",
6
+ "contributors": [
7
+ {
8
+ "name": "Teffen Ellis",
9
+ "email": "teffen@sister.software"
10
+ },
11
+ {
12
+ "name": "Pelias Contributors"
13
+ }
14
+ ],
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/sister-software/mailwoman.git",
18
+ "directory": "mailwoman"
10
19
  },
11
- {
12
- "name": "Pelias Contributors"
13
- }
14
- ],
15
- "repository": {
16
- "type": "git",
17
- "url": "https://github.com/sister-software/mailwoman.git",
18
- "directory": "mailwoman"
19
- },
20
- "bugs": {
21
- "url": "https://github.com/sister-software/mailwoman/issues"
22
- },
23
- "homepage": "https://github.com/sister-software/mailwoman",
24
- "type": "module",
25
- "exports": {
26
- "./package.json": "./package.json",
27
- ".": "./out/index.js",
28
- "./server": "./out/server/index.js",
29
- "./sdk/test": "./out/sdk/test/index.js",
30
- "./sdk/repo": "./out/sdk/repo.js",
31
- "./sdk/cli": "./out/sdk/cli.js"
32
- },
33
- "dependencies": {
34
- "@fragaria/address-formatter": "^6.3.0",
35
- "@mailwoman/classifiers": "workspace:*",
36
- "@mailwoman/core": "workspace:*",
37
- "better-sqlite3": "^11.5.0",
38
- "change-case": "^5.4.4",
39
- "express": "^5.0.1",
40
- "geojson": "^0.5.0",
41
- "ioredis": "^5.4.1",
42
- "pastel": "^4.0.1",
43
- "path-ts": "^1.0.5",
44
- "piscina": "^4.7.0",
45
- "pluralize": "^8.0.0",
46
- "regenerate": "^1.4.2",
47
- "spliterator": "^2.0.0",
48
- "zod": "^4.1.12"
49
- },
50
- "peerDependencies": {
51
- "@inkjs/ui": "^2.0.0",
52
- "core-js": "^3.49.0",
53
- "ink": "^7.0.3",
54
- "react": "^19.2.6"
55
- },
56
- "files": [
57
- "!out/test/**/*",
58
- "!**/*.ts",
59
- "out/**/*.js",
60
- "out/**/*.js.map",
61
- "out/**/*.d.ts",
62
- "out/**/*.d.ts.map",
63
- "out/**/*.json"
64
- ],
65
- "keywords": [
66
- "address",
67
- "parser",
68
- "usps",
69
- "postal",
70
- "pelias"
71
- ],
72
- "bin": "./out/cli.js",
73
- "peerDependenciesMeta": {
74
- "@inkjs/ui": {
75
- "optional": true
20
+ "bugs": {
21
+ "url": "https://github.com/sister-software/mailwoman/issues"
22
+ },
23
+ "homepage": "https://github.com/sister-software/mailwoman",
24
+ "type": "module",
25
+ "exports": {
26
+ "./package.json": "./package.json",
27
+ ".": "./out/index.js",
28
+ "./server": "./out/server/index.js",
29
+ "./sdk/test": "./out/sdk/test/index.js",
30
+ "./sdk/repo": "./out/sdk/repo.js",
31
+ "./sdk/cli": "./out/sdk/cli.js"
32
+ },
33
+ "dependencies": {
34
+ "@fragaria/address-formatter": "^6.3.0",
35
+ "@mailwoman/classifiers": "2.0.3",
36
+ "@mailwoman/core": "2.0.3",
37
+ "better-sqlite3": "^11.5.0",
38
+ "change-case": "^5.4.4",
39
+ "express": "^5.0.1",
40
+ "geojson": "^0.5.0",
41
+ "ioredis": "^5.4.1",
42
+ "pastel": "^4.0.1",
43
+ "path-ts": "^1.0.5",
44
+ "piscina": "^4.7.0",
45
+ "pluralize": "^8.0.0",
46
+ "regenerate": "^1.4.2",
47
+ "spliterator": "^2.0.0",
48
+ "zod": "^4.1.12"
76
49
  },
77
- "core-js": {
78
- "optional": true
50
+ "peerDependencies": {
51
+ "@inkjs/ui": "^2.0.0",
52
+ "core-js": "^3.49.0",
53
+ "ink": "^7.0.3",
54
+ "react": "^19.2.6"
79
55
  },
80
- "ink": {
81
- "optional": true
56
+ "files": [
57
+ "!out/test/**/*",
58
+ "!**/*.ts",
59
+ "out/**/*.js",
60
+ "out/**/*.js.map",
61
+ "out/**/*.d.ts",
62
+ "out/**/*.d.ts.map",
63
+ "out/**/*.json"
64
+ ],
65
+ "keywords": [
66
+ "address",
67
+ "parser",
68
+ "usps",
69
+ "postal",
70
+ "pelias"
71
+ ],
72
+ "bin": "./out/cli.js",
73
+ "peerDependenciesMeta": {
74
+ "@inkjs/ui": {
75
+ "optional": true
76
+ },
77
+ "core-js": {
78
+ "optional": true
79
+ },
80
+ "ink": {
81
+ "optional": true
82
+ },
83
+ "react": {
84
+ "optional": true
85
+ }
82
86
  },
83
- "react": {
84
- "optional": true
87
+ "publishConfig": {
88
+ "access": "public"
85
89
  }
86
- },
87
- "publishConfig": {
88
- "access": "public"
89
- }
90
- }
90
+ }
package/out/cli.d.ts DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * @copyright Sister Software
4
- * @license AGPL-3.0
5
- * @author Teffen Ellis, et al.
6
- */
7
- export {};
8
- //# sourceMappingURL=cli.d.ts.map
@@ -1,28 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * `mailwoman corpus build --version 0.1.0 --output /data/corpus/versioned/ --inputs '{ "wof-admin":
7
- * "/data/wof/admin.db", "wof-postalcode": "/data/wof/post.db" }'`
8
- *
9
- * End-to-end corpus build. Drives every registered adapter (or the filtered subset) per `--inputs`,
10
- * runs synthesis + alignment, computes the locality-holdout split, and writes the final JSONL
11
- * shards + per-stage manifests under `<output>/corpus-v<version>/`.
12
- *
13
- * Adapters whose id is missing from `--inputs` are skipped (and noted in the manifest); this is how
14
- * the CLI handles partial builds during development.
15
- */
16
- import zod from "zod";
17
- import type { CommandComponent } from "../../sdk/cli.js";
18
- declare const BuildConfigSchema: zod.ZodObject<{
19
- corpusVersion: zod.ZodDefault<zod.ZodString>;
20
- output: zod.ZodString;
21
- inputs: zod.ZodString;
22
- synthesize: zod.ZodDefault<zod.ZodOptional<zod.z.ZodCoercedBoolean<unknown>>>;
23
- rowsPerShard: zod.ZodDefault<zod.ZodOptional<zod.z.ZodCoercedNumber<unknown>>>;
24
- }, zod.z.core.$strip>;
25
- export { BuildConfigSchema as options };
26
- declare const CorpusBuild: CommandComponent<typeof BuildConfigSchema>;
27
- export default CorpusBuild;
28
- //# sourceMappingURL=build.d.ts.map
@@ -1,19 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * `mailwoman corpus list` — print every adapter known to the default registry, one per line.
7
- *
8
- * Used by humans and by scripts that want to fan out a build over adapters. Prints nothing (zero
9
- * lines + exit 0) when no adapter has been registered yet; that's the expected state during early
10
- * Phase 1 while adapters are still being authored.
11
- */
12
- /**
13
- * Per-line output is rendered as a single `Text` node so Ink does not column-wrap the adapter id
14
- * when the host stdout is non-TTY (CI, spawned tests). The list is meant to be grep-friendly, not
15
- * pretty.
16
- */
17
- declare const CorpusList: () => import("react/jsx-runtime").JSX.Element;
18
- export default CorpusList;
19
- //# sourceMappingURL=list.d.ts.map
@@ -1,26 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * `mailwoman corpus run <adapter-id> --input <path> --output <dir> [--country XX] [--limit N]`
7
- *
8
- * CLI shim around `runAdapter` from `@mailwoman/corpus`. Resolves `<adapter-id>` against the
9
- * default registry; refuses with a clear, non-zero exit if the id isn't known (and lists the
10
- * registered ids). On success, prints a one-line summary and the path to the manifest file.
11
- */
12
- import zod from "zod";
13
- import type { CommandComponent } from "../../sdk/cli.js";
14
- declare const ArgumentsSchema: zod.ZodArray<zod.ZodString>;
15
- declare const RunConfigSchema: zod.ZodObject<{
16
- input: zod.ZodString;
17
- output: zod.ZodString;
18
- country: zod.ZodOptional<zod.ZodString>;
19
- limit: zod.ZodOptional<zod.z.ZodCoercedNumber<unknown>>;
20
- corpusVersion: zod.ZodDefault<zod.ZodOptional<zod.ZodString>>;
21
- progressEvery: zod.ZodDefault<zod.ZodOptional<zod.z.ZodCoercedNumber<unknown>>>;
22
- }, zod.z.core.$strip>;
23
- export { ArgumentsSchema as args, RunConfigSchema as options };
24
- declare const CorpusRun: CommandComponent<typeof RunConfigSchema, typeof ArgumentsSchema>;
25
- export default CorpusRun;
26
- //# sourceMappingURL=run.d.ts.map
@@ -1,15 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- */
6
- import zod from "zod";
7
- import type { CommandComponent } from "../sdk/cli.js";
8
- declare const ArgumentsSchema: zod.ZodArray<zod.ZodString>;
9
- declare const DebugConfigSchema: zod.ZodObject<{
10
- locale: zod.ZodOptional<zod.ZodString>;
11
- }, zod.z.core.$strip>;
12
- export { ArgumentsSchema as args, DebugConfigSchema as options };
13
- declare const DebugCommand: CommandComponent<typeof DebugConfigSchema, typeof ArgumentsSchema>;
14
- export default DebugCommand;
15
- //# sourceMappingURL=debug.d.ts.map
@@ -1,25 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- */
6
- import zod from "zod";
7
- import type { CommandComponent } from "../sdk/cli.js";
8
- declare const ArgumentsSchema: zod.ZodArray<zod.ZodString>;
9
- export { ArgumentsSchema as args, ParseConfigSchema as options };
10
- declare const ParseConfigSchema: zod.ZodObject<{
11
- debug: zod.ZodDefault<zod.ZodOptional<zod.ZodBoolean>>;
12
- locale: zod.ZodDefault<zod.ZodOptional<zod.ZodString>>;
13
- neural: zod.ZodDefault<zod.ZodOptional<zod.ZodBoolean>>;
14
- format: zod.ZodDefault<zod.ZodOptional<zod.ZodEnum<{
15
- tuple: "tuple";
16
- json: "json";
17
- xml: "xml";
18
- }>>>;
19
- model: zod.ZodOptional<zod.ZodString>;
20
- tokenizer: zod.ZodOptional<zod.ZodString>;
21
- policy: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
22
- }, zod.z.core.$strip>;
23
- declare const ParseCommand: CommandComponent<typeof ParseConfigSchema, typeof ArgumentsSchema>;
24
- export default ParseCommand;
25
- //# sourceMappingURL=parse.d.ts.map
@@ -1,19 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- */
6
- import zod from "zod";
7
- import type { CommandComponent } from "../sdk/cli.js";
8
- export declare const options: zod.ZodObject<{
9
- port: zod.ZodDefault<zod.ZodOptional<zod.ZodNumber>>;
10
- host: zod.ZodDefault<zod.ZodOptional<zod.ZodString>>;
11
- cpus: zod.ZodOptional<zod.ZodNumber>;
12
- }, zod.z.core.$strip>;
13
- declare const ParseCommand: CommandComponent<zod.ZodObject<{
14
- port: zod.ZodDefault<zod.ZodOptional<zod.ZodNumber>>;
15
- host: zod.ZodDefault<zod.ZodOptional<zod.ZodString>>;
16
- cpus: zod.ZodOptional<zod.ZodNumber>;
17
- }, zod.z.core.$strip>>;
18
- export default ParseCommand;
19
- //# sourceMappingURL=serve.d.ts.map
@@ -1,12 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- */
6
- import zod from "zod";
7
- import type { PositionalCommandComponent } from "../../../sdk/cli.js";
8
- declare const ArgumentsSchema: zod.ZodArray<zod.ZodString>;
9
- export { ArgumentsSchema as args };
10
- declare const WOFPrepare: PositionalCommandComponent<typeof ArgumentsSchema>;
11
- export default WOFPrepare;
12
- //# sourceMappingURL=index.d.ts.map
@@ -1,24 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- */
6
- import zod from "zod";
7
- import type { CommandComponent } from "../../sdk/cli.js";
8
- declare const ArgumentsSchema: zod.ZodArray<zod.ZodString>;
9
- /**
10
- * `--repos` is a comma-separated allow-list of repo names. When set, the discovery step still
11
- * queries `gh repo list` for `whosonfirst-data/*` but filters down to only repos whose `name` is
12
- * present in the list. When absent, every non-archived repo in the org is synced (the original
13
- * behavior).
14
- *
15
- * The corpus build only needs a small subset (4 repos for US+FR admin+postalcode + the placetypes
16
- * codex). Cloning all ~100 whosonfirst-data repos is otherwise ~2.9 GB of git for no reason.
17
- */
18
- declare const OptionsSchema: zod.ZodObject<{
19
- repos: zod.ZodOptional<zod.ZodString>;
20
- }, zod.z.core.$strip>;
21
- export { ArgumentsSchema as args, OptionsSchema as options };
22
- declare const WOFSync: CommandComponent<typeof OptionsSchema, typeof ArgumentsSchema>;
23
- export default WOFSync;
24
- //# sourceMappingURL=sync.d.ts.map
package/out/index.d.ts DELETED
@@ -1,9 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- */
6
- export * from "@mailwoman/core";
7
- export * from "@mailwoman/classifiers";
8
- export * from "./utils/index.js";
9
- //# sourceMappingURL=index.d.ts.map
package/out/sdk/cli.d.ts DELETED
@@ -1,28 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- */
6
- import type * as zod from "zod";
7
- /**
8
- * Type-helper to infer the positional arguments of a command.
9
- */
10
- export type PositionalArguments<T extends zod.ZodTypeAny> = {
11
- args: zod.infer<T>;
12
- };
13
- /**
14
- * React component for a command with positional arguments.
15
- */
16
- export type PositionalCommandComponent<T extends zod.ZodTypeAny> = React.FC<PositionalArguments<T>>;
17
- /**
18
- * Type-helper to infer the options of a command.
19
- */
20
- export type CommandProps<OptionProps extends zod.ZodObject, PositionalProps extends zod.ZodTypeAny | unknown = unknown> = {
21
- options: zod.infer<OptionProps>;
22
- args: PositionalProps extends zod.ZodTypeAny ? zod.infer<PositionalProps> : unknown[];
23
- };
24
- /**
25
- * React component for a command with options.
26
- */
27
- export type CommandComponent<OptionProps extends zod.ZodObject, PositionalProps extends zod.ZodTypeAny | unknown = unknown> = React.FC<CommandProps<OptionProps, PositionalProps>>;
28
- //# sourceMappingURL=cli.d.ts.map
@@ -1,41 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- */
6
- import { type Classification, type Classifier, type LibPostalLanguageCode } from "@mailwoman/core";
7
- import { type ClassificationRecord } from "mailwoman";
8
- /**
9
- * Global test parser instance.
10
- */
11
- export declare const parser: import("mailwoman").AddressParser;
12
- export declare function assert(input: string, ...expectedClassifications: ClassificationRecord[]): void;
13
- /**
14
- * Assert that two items are deeply equal after JSON serialization.
15
- *
16
- * @param actual - The actual item.
17
- * @param expected - The expected item.
18
- * @param message - The message to display.
19
- */
20
- export declare function assertDeepSerialized(actual: unknown, expected: unknown, message?: string): void;
21
- /**
22
- * Given two iterables, zip them together into a single iterable which yields pairs of elements.
23
- *
24
- * If one iterable is longer than the other, the shorter iterable will be padded with `undefined`.
25
- */
26
- export declare function zip<T, U>(a: Iterable<T>, b: Iterable<U>): Generator<[a: T | undefined, b: U | undefined, idx: number]>;
27
- /**
28
- * Given two iterables, assert that they are congruent, i.e. that they have the same elements in the
29
- * same order.
30
- */
31
- export declare function assertCongruent<Item>(actualItemIterators: Iterable<Iterable<Item>>, ...expectedItemIterators: Iterable<Item>[]): void;
32
- export type ExpectedClassificationEntry = [
33
- input: string,
34
- Iterable<LibPostalLanguageCode>,
35
- expectPositiveMatch?: boolean
36
- ];
37
- /**
38
- * Assert that a classifier correctly classifies a set of inputs.
39
- */
40
- export declare function assertClassification(classifier: Classifier, classificationTarget: Classification, expectations: ExpectedClassificationEntry[]): void;
41
- //# sourceMappingURL=index.d.ts.map
@@ -1,20 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- */
6
- import { type SerializedSolution } from "mailwoman";
7
- /**
8
- * Response from the address parser endpoint.
9
- */
10
- export interface ParseAddressResponse {
11
- input: {
12
- body: string;
13
- start: number;
14
- end: number;
15
- };
16
- solutions: SerializedSolution[];
17
- debug?: string;
18
- }
19
- export declare const AddressRouter: import("express-serve-static-core").Router;
20
- //# sourceMappingURL=AddressRouter.d.ts.map
@@ -1,7 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- */
6
- export * from "./AddressRouter.js";
7
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=main.d.ts.map
@@ -1,11 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- */
6
- import { type VerboseParseResult } from "@mailwoman/core";
7
- /**
8
- * Create a diagnostic report for a parser result.
9
- */
10
- export declare function createDiagnosticReport({ solutions, context, measures }: VerboseParseResult): string;
11
- //# sourceMappingURL=DebugOutputBuilder.d.ts.map
@@ -1,8 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- */
6
- export * from "./DebugOutputBuilder.js";
7
- export * from "./parser.js";
8
- //# sourceMappingURL=index.d.ts.map
@@ -1,13 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- */
6
- import { AddressParser, type AddressParserOptions } from "@mailwoman/core/parser";
7
- /**
8
- * Create an address parser with the given options.
9
- *
10
- * This is the primary entry point for the Mailwoman library.
11
- */
12
- export declare function createAddressParser({ classifiers, solvers, ...options }?: AddressParserOptions): AddressParser;
13
- //# sourceMappingURL=parser.d.ts.map