@radsoft/markbase 2026.11.1 → 2026.11.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/README.md CHANGED
@@ -157,6 +157,27 @@ Keep the key server-side. It's a secret; don't ship it to the browser.
157
157
 
158
158
  ---
159
159
 
160
+ ## Opt-in phonetic clearance
161
+
162
+ Starting with SDK `2026.11.2`, pass `phonetic: true` in `clearance` or
163
+ `clearanceBatch` options to add whole-name ASCII phonetic matching. Omit it or use
164
+ `false` for spelling-only behavior. One name still uses one monthly request;
165
+ batches require Launch or Scale.
166
+
167
+ Read `matching.phonetic_status` and each match's `signals.phonetic` separately from
168
+ `similarity` and `risk`, which retain their spelling-based meaning. Names with
169
+ digits, non-ASCII characters, more than 12 tokens, or no token of at least four
170
+ letters return `not_evaluated` and retain spelling results. A changed token must
171
+ have at least four letters; short tokens must match literally in the same position.
172
+ `matching.truncated` reports a phonetic retrieval cap or hydration budget being
173
+ reached; `false` does not establish exhaustive coverage.
174
+
175
+ An unavailable opt-in request returns 503 without silently switching modes.
176
+ Admission failures do not consume monthly quota. Accepted batches count even if a
177
+ search fails and are never retried automatically. See the
178
+ [phonetic contract](../docs/phonetic-clearance.md) for response evidence, ranking,
179
+ and limits. Phonetic evidence does not establish legal availability.
180
+
160
181
  ## Reference
161
182
 
162
183
  | 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
+ /** Opt-in whole-name ASCII phonetic matching; 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.3",
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",