@radsoft/markbase 2026.11.1 → 2026.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -157,6 +157,16 @@ Keep the key server-side. It's a secret; don't ship it to the browser.
157
157
 
158
158
  ---
159
159
 
160
+ ## Unreleased: opt-in phonetic clearance
161
+
162
+ The source client accepts an optional `phonetic` boolean in `clearance` and
163
+ `clearanceBatch` options. The API mode is not enabled in production yet; client
164
+ support alone does not make it available. Omit the option for current spelling-only
165
+ behavior. An unavailable opt-in request returns 503, and batches are never retried
166
+ automatically. See the [unreleased contract](../docs/phonetic-clearance.md) for
167
+ response evidence, ranking, and input limits. Existing spelling scores and risk
168
+ thresholds remain unchanged; phonetic evidence is not a legal availability decision.
169
+
160
170
  ## Reference
161
171
 
162
172
  | Method | Returns |
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Trademark, SearchOptions, SearchResult, Suggestion, ClearanceResult, ClearanceBatchResult, OwnerResult, BatchResult, AggregateField, AggregateResult, NiceClass, IndexInfo, RateLimitInfo, MarkStatus } from "./types.js";
1
+ import type { Trademark, SearchOptions, SearchResult, Suggestion, ClearanceOptions, ClearanceResult, ClearanceBatchResult, OwnerResult, BatchResult, AggregateField, AggregateResult, NiceClass, IndexInfo, RateLimitInfo, MarkStatus } from "./types.js";
2
2
  export interface MarkbaseOptions {
3
3
  /**
4
4
  * Get one free at https://markbase.co. Omitted falls back to
@@ -46,19 +46,13 @@ export declare class Markbase {
46
46
  limit?: number;
47
47
  }): Promise<OwnerResult>;
48
48
  /**
49
- * Screen a proposed name against the register, ranked by similarity.
49
+ * Screen a proposed name against the register. Spelling-only matching is the default.
50
50
  * A first-pass signal, not legal advice — pass a class, since trademark
51
51
  * rights are scoped to goods and services.
52
52
  */
53
- clearance(mark: string, opts?: {
54
- trademarkClass?: string | number;
55
- limit?: number;
56
- }): Promise<ClearanceResult>;
53
+ clearance(mark: string, opts?: ClearanceOptions): Promise<ClearanceResult>;
57
54
  /** Screen 1–25 names on Launch or Scale. Each name consumes quota; retries are disabled. */
58
- clearanceBatch(marks: string[], opts?: {
59
- trademarkClass?: string | number;
60
- limit?: number;
61
- }): Promise<ClearanceBatchResult>;
55
+ clearanceBatch(marks: string[], opts?: ClearanceOptions): Promise<ClearanceBatchResult>;
62
56
  /** Distribution counts across a facet. */
63
57
  aggregate(by: AggregateField): Promise<AggregateResult>;
64
58
  /** All 45 Nice classification classes. */
package/dist/client.js CHANGED
@@ -188,7 +188,7 @@ export class Markbase {
188
188
  return this.request("/owner", { query: { name, ...opts } });
189
189
  }
190
190
  /**
191
- * Screen a proposed name against the register, ranked by similarity.
191
+ * Screen a proposed name against the register. Spelling-only matching is the default.
192
192
  * A first-pass signal, not legal advice — pass a class, since trademark
193
193
  * rights are scoped to goods and services.
194
194
  */
@@ -198,6 +198,7 @@ export class Markbase {
198
198
  mark,
199
199
  class: opts.trademarkClass == null ? undefined : padClass(opts.trademarkClass),
200
200
  limit: opts.limit,
201
+ phonetic: opts.phonetic,
201
202
  },
202
203
  });
203
204
  }
@@ -205,7 +206,7 @@ export class Markbase {
205
206
  clearanceBatch(marks, opts = {}) {
206
207
  return this.request("/clearance/batch", {
207
208
  method: "POST", retry: false,
208
- body: JSON.stringify({ marks, class: opts.trademarkClass == null ? undefined : padClass(opts.trademarkClass), limit: opts.limit }),
209
+ body: JSON.stringify({ marks, class: opts.trademarkClass == null ? undefined : padClass(opts.trademarkClass), limit: opts.limit, phonetic: opts.phonetic }),
209
210
  });
210
211
  }
211
212
  /** Distribution counts across a facet. */
package/dist/types.d.ts CHANGED
@@ -52,16 +52,48 @@ export interface Suggestion {
52
52
  owner_name: string | null;
53
53
  status_code: string | null;
54
54
  }
55
+ export interface ClearanceOptions {
56
+ trademarkClass?: string | number;
57
+ limit?: number;
58
+ /** Unreleased opt-in; unavailable mode returns 503. Omit for spelling-only matching. */
59
+ phonetic?: boolean;
60
+ }
61
+ export interface ClearanceMatching {
62
+ mode: "spelling_and_phonetic";
63
+ algorithm: "double_metaphone_v1";
64
+ ranking: "phonetic_v1";
65
+ phonetic_status: "evaluated" | "not_evaluated";
66
+ truncated: boolean;
67
+ }
68
+ export interface ClearanceSignals {
69
+ exact: boolean;
70
+ spelling: {
71
+ score: number;
72
+ };
73
+ phonetic: {
74
+ algorithm: "double_metaphone_v1";
75
+ status: "matched" | "not_matched" | "not_evaluated";
76
+ scope?: "whole_name";
77
+ tokens?: Array<{
78
+ query: string;
79
+ candidate: string;
80
+ variant: "primary" | "alternate";
81
+ }>;
82
+ };
83
+ }
55
84
  export interface ClearanceMatch extends Pick<Trademark, "serial_number" | "word_mark" | "owner_name" | "status_code" | "international_codes"> {
56
- /** 0-1, higher means more similar to the proposed mark. */
85
+ /** 0-1 spelling score; phonetic evidence does not change this value. */
57
86
  similarity: number;
58
87
  risk: RiskLevel;
88
+ signals?: ClearanceSignals;
59
89
  }
60
90
  export interface ClearanceResult {
61
91
  mark: string;
62
92
  class: string | null;
93
+ /** Maximum spelling-based risk among retrieved candidates before the result limit. */
63
94
  highest_risk: RiskLevel;
64
95
  matches: ClearanceMatch[];
96
+ matching?: ClearanceMatching;
65
97
  }
66
98
  export interface ClearanceBatchResult {
67
99
  results: ClearanceResult[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radsoft/markbase",
3
- "version": "2026.11.1",
3
+ "version": "2026.11.2",
4
4
  "description": "Official Node client for the Markbase USPTO trademark API — search, screen, and look up 14M+ US trademarks.",
5
5
  "license": "MIT",
6
6
  "type": "module",