@signa-so/sdk 0.16.0 → 0.17.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.
@@ -6,9 +6,27 @@ import { createList } from '../pagination.js';
6
6
  * Five watch types compile to one query shape (VAL-PRODUCT-001):
7
7
  * `'mark' | 'portfolio' | 'owner' | 'class' | 'similarity'`. `query.match`
8
8
  * is rejected in ANY form (object or string) — use `filters.ownerId`,
9
- * `filters.trademarkIds`, `filters.niceClasses` for scoping and
10
- * `min_match_tier` for similarity precision. See {@link WatchQuery} and
11
- * the watches guide for worked examples.
9
+ * `filters.trademarkIds`, `filters.niceClasses` for scoping.
10
+ *
11
+ * Similarity watches (0.17.0) take `version: 'v3'`, `q`, `similarity` (the
12
+ * search channels; {@link Presets} spread in) and `min_tier` (the weakest
13
+ * tier that alerts, default `related`):
14
+ *
15
+ * ```typescript
16
+ * await signa.watches.create({
17
+ * name: 'LIMBER look-alikes',
18
+ * watch_type: 'similarity',
19
+ * query: { version: 'v3', q: 'limber', ...Presets.clearance, min_tier: 'similar' },
20
+ * });
21
+ * ```
22
+ *
23
+ * The old `strategies` / `min_match_tier` keys are accepted by the API until
24
+ * 2026-12-28 and reported in the response `deprecations`; a watch written
25
+ * with them keeps its legacy matching until it is re-saved without them.
26
+ * Every other written query is stored as `v3`, even a plain
27
+ * `{ version: 'v2', q }`. Preview and
28
+ * diagnostics report `similarity_applied` and `min_tier` (`null` for a watch
29
+ * in the old form). See {@link WatchQuery} and the watches guide.
12
30
  */
13
31
  export class Watches extends BaseResource {
14
32
  /** Create a watch. */
@@ -1 +1 @@
1
- {"version":3,"file":"watches.js","sourceRoot":"","sources":["../../src/resources/watches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAkB,MAAM,kBAAkB,CAAC;AAoB9D;;;;;;;;;GASG;AACH,MAAM,OAAO,OAAQ,SAAQ,Y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C,IAAI,CAAC,gBAAgB,CACnB,eAAe,kBAAkB,CAAC,OAAO,CAAC,SAAS,EACnD,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,EACrB,OAAO,CACR,CAAC;QACJ,MAAM,SAAS,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAClD,OAAO,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC;CAEF"}
package/dist/types.d.ts CHANGED
@@ -455,51 +455,60 @@ export type WatchStatus = 'active' | 'paused' | 'disabled';
455
455
  * (= `ALERT_EVENT_TYPES` from `@signa/types`) and `DEFAULT_TRIGGER_EVENTS`.
456
456
  */
457
457
  export type WatchTriggerEvent = 'trademark.created' | 'trademark.updated' | 'trademark.status_changed' | 'trademark.retracted' | 'trademark.corrected';
458
- /** Search strategy names accepted by watch similarity queries. */
459
- export type WatchSearchStrategy = 'exact' | 'phonetic' | 'fuzzy' | 'prefix';
460
- /** Attribution tier gate for watch similarity queries. */
458
+ /**
459
+ * Legacy attribution tier gate, echoed by diagnostics for a watch stored in
460
+ * the v1/v2 form. New watches use `min_tier` ({@link MatchTier}).
461
+ */
461
462
  export type WatchMinMatchTier = 'exact' | 'normalized' | 'fuzzy' | 'phonetic';
462
463
  /**
463
- * Watch query DSL. Five watch types share one shape — the
464
- * `watch_type` selects which scoping field is required, but the body
465
- * shape is identical to a trademark search body. See the
464
+ * Watch query DSL. Five watch types share one shape; the `watch_type`
465
+ * selects which scoping field is required. See the
466
466
  * [Watches guide](https://docs.signa.so/guides/monitoring/watches) for
467
467
  * the per-type required-field table.
468
468
  *
469
- * `q` is a whitespace-separated keyword list (max 20, each ≥3 chars, no
470
- * stop words). `filters` accepts the same vocabulary as the trademark
471
- * search API (`trademarkIds`, `ownerId`, `niceClasses`, `jurisdictions`,
472
- * `offices`, etc.). `strategies` uses the same selector as public trademark
473
- * search. `trigger_events` narrows which lifecycle events fire alerts.
474
- * `min_match_tier` gates similarity matches by retrieval attribution tier.
475
- * `score_threshold` is NOT currently supported — sending it on a write is
476
- * rejected with 400; scores are informational (see `match_score` on alerts).
469
+ * Send `version: 'v3'`, `q`, optional `similarity` (the search channels,
470
+ * same default as search) and optional `min_tier` (the weakest
471
+ * {@link MatchTier} that alerts; default `related`, everything through).
472
+ * The API stores every written query as `v3` whatever `version` it sends, so
473
+ * a plain `{ version: 'v2', q }` gets the default channels and `min_tier:
474
+ * 'related'` too. `filters` keeps its camelCase vocabulary (`trademarkIds`,
475
+ * `ownerId`, `niceClasses`, `jurisdictions`, `offices`, ...).
476
+ * `trigger_events` narrows which lifecycle events fire alerts. Watches do
477
+ * not accept the search `mark_text_*` filters or exclusions (400).
477
478
  *
478
- * Forbidden DSL keys (`function_score`, `script`, `sort`, `cursor`,
479
- * `aggregations`, `highlight`) are rejected with 400. `query.match` is
480
- * rejected in ANY form (object or string) — earlier doc revisions described
481
- * shapes that were never honored by the evaluator. Use `filters.ownerId`,
482
- * `filters.trademarkIds`, `filters.niceClasses` for scoping and
483
- * `min_match_tier` for similarity precision. Unknown `filters` keys are
484
- * rejected with 400 listing the allowed vocabulary; `filters.offices`
485
- * accepts any casing and is stored lowercase.
479
+ * The old `strategies` and `min_match_tier` keys are removed from this type
480
+ * (0.17.0). The API still accepts them until 2026-12-28: a watch written
481
+ * with them is kept as a legacy watch, with its original matching, until it
482
+ * is re-saved without them, and the write response lists them in
483
+ * `deprecations`. Stored watches are never rewritten: a watch saved in the
484
+ * v1/v2 form keeps its matching until its query changes.
485
+ *
486
+ * `score_threshold` is NOT supported on write (400); scores are
487
+ * informational (see `match.score` on alerts). Forbidden DSL keys
488
+ * (`function_score`, `script`, `sort`, `cursor`, `aggregations`,
489
+ * `highlight`) and `query.match` in any form are rejected with 400. Unknown
490
+ * `filters` keys are rejected with 400 listing the allowed vocabulary.
486
491
  */
487
492
  export interface WatchQuery {
488
- /** `"v2"` for tier-based watch matching. `"v1"` is accepted during migration. */
489
- version: 'v1' | 'v2';
490
- /** Optional keyword query (required for similarity watches). Whitespace-separated; each ≥3 chars; no stop words. */
493
+ /**
494
+ * Required on write. `'v1'`, `'v2'` and `'v3'` are accepted; send `'v3'`. A new or changed query is
495
+ * stored as `'v3'` whatever version it sends, unless it uses the deprecated keys; `'v1'` / `'v2'`
496
+ * otherwise appear only on stored legacy queries.
497
+ */
498
+ version: 'v1' | 'v2' | 'v3';
499
+ /** Search text (required for similarity watches). */
491
500
  q?: string;
492
- /** Search strategies to use. Omit for the public-search default (`exact` + `fuzzy`). */
493
- strategies?: WatchSearchStrategy[];
501
+ /** Similarity channels for `q`. Omit for the search default (`identical`, `fuzzy`, `embedded`, `lookalike`). */
502
+ similarity?: readonly SimilarityChannel[];
503
+ /** The weakest similarity tier that alerts. Default `related` (every tier). */
504
+ min_tier?: MatchTier;
494
505
  /** Filter object — same vocabulary as the trademark search API. Common keys: `trademarkIds`, `ownerId`, `niceClasses`, `jurisdictions`, `offices`, `statusPrimary`. */
495
506
  filters?: Record<string, unknown>;
496
507
  /** Restrict alert generation to specific trigger event types. */
497
508
  trigger_events?: WatchTriggerEvent[];
498
- /** Minimum attribution tier for similarity watches. `phonetic` is the broad "any tier" setting. */
499
- min_match_tier?: WatchMinMatchTier;
500
509
  /**
501
510
  * NOT currently supported — sending this on create/update/bulk/preview is
502
- * rejected with 400. Scores are informational (see `match_score` on alerts).
511
+ * rejected with 400. Scores are informational (see `match.score` on alerts).
503
512
  * The field is retained on the type so existing stored watch queries still
504
513
  * deserialize on GET. Contact support for calibrated-band thresholds.
505
514
  */
@@ -522,6 +531,12 @@ export interface Watch {
522
531
  metadata: Record<string, unknown>;
523
532
  created_at: string;
524
533
  updated_at: string;
534
+ /**
535
+ * Present on create, update and bulk responses when the written query used
536
+ * a deprecated key (`strategies`, `min_match_tier`); the watch is kept as a
537
+ * legacy watch until re-saved without them.
538
+ */
539
+ deprecations?: SearchDeprecation[];
525
540
  }
526
541
  /**
527
542
  * Alert event types — what the API actually emits for `Alert.event_type`.
@@ -598,6 +613,12 @@ export interface AlertMatch {
598
613
  score: number | null;
599
614
  /** What the score is derived from, e.g. `opensearch_relevance`; null when none. */
600
615
  score_basis: string | null;
616
+ /**
617
+ * Similarity tier of the matched mark, the same label a search hit carries
618
+ * as `match.tier`. `null` for filter-only watches, marks found only by their
619
+ * number, and alerts emitted before 0.17.0.
620
+ */
621
+ tier: MatchTier | null;
601
622
  }
602
623
  /**
603
624
  * Compact mark summary embedded on the alert (Alerts v2 `trademark` block).
@@ -1133,6 +1154,12 @@ export interface WatchPreviewResponse {
1133
1154
  has_more?: boolean;
1134
1155
  /** Echo of the effective page size for `results`. Omitted when count_only. */
1135
1156
  result_limit?: number;
1157
+ /** The similarity channels the query runs. `null` without `q` and for a query with the deprecated keys. */
1158
+ similarity_applied: SimilarityChannel[] | null;
1159
+ /** The weakest tier that alerts. `null` for a query with the deprecated keys. */
1160
+ min_tier: MatchTier | null;
1161
+ /** Deprecated query keys the previewed query used (see {@link Watch.deprecations}). */
1162
+ deprecations?: SearchDeprecation[];
1136
1163
  request_id: string;
1137
1164
  }
1138
1165
  /**
@@ -1180,7 +1207,12 @@ export interface WatchDiagnostics {
1180
1207
  * INERT — no longer gates matching, and rejected on new writes.
1181
1208
  */
1182
1209
  score_threshold: number | null;
1210
+ /** Legacy tier gate of a watch stored in the v1/v2 form; `null` otherwise. */
1183
1211
  min_match_tier: WatchMinMatchTier | null;
1212
+ /** The similarity channels the watch query runs. `null` without `q`, and for a legacy watch (stored with the deprecated keys, or before v3 and not re-saved since). */
1213
+ similarity_applied: SimilarityChannel[] | null;
1214
+ /** The weakest tier that alerts. `null` for a legacy watch (stored with the deprecated keys, or before v3 and not re-saved since), which reports `min_match_tier`. */
1215
+ min_tier: MatchTier | null;
1184
1216
  alert_fired: boolean;
1185
1217
  /**
1186
1218
  * Walked in order: alert fired → office not in scope → freshness limit →
@@ -1544,21 +1576,15 @@ export interface TrademarkDocument {
1544
1576
  }
1545
1577
  /** Owner related entity (GLEIF corporate hierarchy). */
1546
1578
  export type OwnerRelated = components['schemas']['OwnerRelated'];
1547
- /**
1548
- * ENG-106 — how the query text is matched against the mark text.
1549
- * `similar` (default) runs the ranked strategies ladder (relevance scoring).
1550
- * `exact` | `starts_with` | `ends_with` | `contains` are deterministic
1551
- * (date-led sort, `relevance_score` null on every row). Deterministic modes
1552
- * require a query and disallow `strategies`; `contains` additionally needs a
1553
- * folded query of at least 3 characters.
1554
- */
1555
- export type MatchMode = 'similar' | 'exact' | 'starts_with' | 'ends_with' | 'contains';
1556
1579
  /**
1557
1580
  * Search metadata on trademark search and list responses.
1558
1581
  *
1559
- * 0.14.0: `fallback_reason` is gone; every caveat is a coded entry in
1560
- * `warnings[]` (e.g. `expanded_fallback` with `affected_filters`, or
1561
- * `partial_results`). `index_generation` names the index that served the page;
1582
+ * 0.17.0: `similarity_applied` (the channels `q` ran on), `ranking_version`
1583
+ * (cursors are bound to it), `order` (the order applied), `complete` /
1584
+ * `incomplete_reason` (false only with `allow_partial`), `identifier` (when
1585
+ * `q` was read as a trademark number) and `deprecations` (old parameters the
1586
+ * request used). `strategies_used` and `match` are deprecated and removed on
1587
+ * 2026-12-28. `index_generation` names the index that served the page;
1562
1588
  * cursors are bound to it, so a cursor from before an index rebuild returns
1563
1589
  * `400 cursor_invalid` and pagination restarts.
1564
1590
  *
@@ -1566,11 +1592,45 @@ export type MatchMode = 'similar' | 'exact' | 'starts_with' | 'ends_with' | 'con
1566
1592
  * (`SignaList.total_count`) when the request sets `include_total`.
1567
1593
  */
1568
1594
  export type SearchMeta = NonNullable<components['schemas']['SearchResponseV2']['search_meta']>;
1595
+ /**
1596
+ * A similarity channel for a ranked `q`. The default set is `identical`,
1597
+ * `fuzzy`, `embedded` and `lookalike`; `identical` is always on. See
1598
+ * {@link Presets} for the knockout and clearance sets.
1599
+ */
1600
+ export type SimilarityChannel = SearchMeta['similarity_applied'][number];
1601
+ /**
1602
+ * `match` on a search hit: `tier` (strongest similarity tier matched; `null`
1603
+ * without `q` or for a hit found only by its number), `via` (channels that
1604
+ * matched, plus `identifier`), `terms` (the `mark_text_*` values the hit
1605
+ * satisfied) and, with `include: ['match_details']`, `details`.
1606
+ */
1607
+ export type TrademarkMatch = components['schemas']['TrademarkMatch'];
1608
+ /**
1609
+ * Similarity tier, strongest first: `identical`, `near_identical`, `similar`,
1610
+ * `related`. A retrieval category, not a measured edit distance. Used by
1611
+ * search hits (`match.tier`), watch `min_tier` and alerts (`match.tier`).
1612
+ */
1613
+ export type MatchTier = NonNullable<TrademarkMatch['tier']>;
1614
+ /**
1615
+ * Mark text operators (POST `filters.mark_text` and `exclude.mark_text`).
1616
+ * Values within one operator are OR; operators are AND. Up to 100 values of
1617
+ * 200 characters each.
1618
+ */
1619
+ export type MarkTextFilters = components['schemas']['MarkTextFilters'];
1620
+ /** One mark text operator: `is`, `word`, `starts_with`, `ends_with`, `contains`, `pattern`. */
1621
+ export type MarkTextOperator = keyof MarkTextFilters;
1622
+ /** POST `exclude`: rows matching any value are removed. Never affects ranking. */
1623
+ export type SearchExclude = components['schemas']['SearchExclude'];
1624
+ /**
1625
+ * A `search_meta.deprecations[]` (and watch `deprecations[]`) entry: an old
1626
+ * parameter the request used, its replacement, and the date (`sunset`) from
1627
+ * which the old parameter is a `400`.
1628
+ */
1629
+ export type SearchDeprecation = NonNullable<SearchMeta['deprecations']>[number];
1569
1630
  /**
1570
1631
  * A `search_meta.warnings[]` element: a stable `code` plus a human `message`,
1571
- * and the code's own detail fields (`strategy`, `affected_filter(s)`,
1572
- * `affected_offices`, `dropped_strategies`, ...). Keep a default branch: new
1573
- * codes can appear.
1632
+ * and the code's own detail fields (`channel`, `affected_filter(s)`,
1633
+ * `affected_offices`, ...). Keep a default branch: new codes can appear.
1574
1634
  */
1575
1635
  export type SearchWarning = NonNullable<SearchMeta['warnings']>[number];
1576
1636
  /** API error body (RFC 9457-inspired). */
@@ -1674,7 +1734,84 @@ export interface ResourceQuotaExceededErrorBody extends APIErrorBody {
1674
1734
  */
1675
1735
  suggestion?: string;
1676
1736
  }
1677
- export type TrademarkSearchInclude = 'full_goods_services';
1737
+ /**
1738
+ * Optional search row projections. `full_goods_services` disables summary G&S
1739
+ * truncation; `match_details` adds `match.details` (matched lanes and applied
1740
+ * ranking factors) to each hit.
1741
+ */
1742
+ export type TrademarkSearchInclude = 'full_goods_services' | 'match_details';
1743
+ /**
1744
+ * One value or a list for a repeated-key GET param (`mark_text_*`, `*_not`).
1745
+ * A scalar is a one-element list; commas inside a value are never split.
1746
+ */
1747
+ export type SearchTextList = string | readonly string[];
1748
+ /**
1749
+ * The search request surface shared by `trademarks.list()` and the owner,
1750
+ * attorney, firm and entity `trademarks()` sub-resources (search v2, 0.17.0).
1751
+ *
1752
+ * `q` ranks; the `mark_text_*` filters decide which marks qualify; the
1753
+ * `mark_text_not_*` and `*_not` exclusions remove marks and never affect
1754
+ * ranking. Values within one key are OR; different keys (and `q`) are AND.
1755
+ * The `mark_text_*` and `*_not` lists go on the wire as repeated keys
1756
+ * (`mark_text_is=a&mark_text_is=b`), so a comma inside a mark is safe.
1757
+ *
1758
+ * ```typescript
1759
+ * import { Presets } from '@signa-so/sdk';
1760
+ * await signa.trademarks.list({ q: 'limber', ...Presets.clearance, mark_text_not_is: ['LIMBER'] });
1761
+ * ```
1762
+ */
1763
+ export interface SearchTextParams {
1764
+ /**
1765
+ * Search text, ranked through the `similarity` channels (1-500 characters,
1766
+ * at least 2 after folding; 1 on the party sub-resources). Always literal.
1767
+ * A trademark number in `q` (`1939139`, `US 5123456`, `tm_...`) is also
1768
+ * looked up, and its records lead the page (`search_meta.identifier`).
1769
+ */
1770
+ q?: string;
1771
+ /**
1772
+ * Similarity channels for `q`: `identical`, `fuzzy`, `embedded`,
1773
+ * `phonetic`, `lookalike`. Default `identical`, `fuzzy`, `embedded`,
1774
+ * `lookalike`; `identical` is always on. Requires `q`. See {@link Presets}.
1775
+ */
1776
+ similarity?: readonly SimilarityChannel[];
1777
+ /** Whole-mark equality (case, accents, punctuation, spacing and trademark notices ignored). Replaces a list in `q` and `match: 'exact'`. */
1778
+ mark_text_is?: SearchTextList;
1779
+ /** The value appears as a whole word, or consecutive words, of the mark. */
1780
+ mark_text_word?: SearchTextList;
1781
+ /** The folded mark begins with the value. Replaces `match: 'starts_with'`. */
1782
+ mark_text_starts_with?: SearchTextList;
1783
+ /** The folded mark ends with the value (at least 3 characters). Replaces `match: 'ends_with'`. */
1784
+ mark_text_ends_with?: SearchTextList;
1785
+ /** The value appears anywhere in the folded mark (at least 3 characters). Replaces `match: 'contains'`. */
1786
+ mark_text_contains?: SearchTextList;
1787
+ /** `*` any run, `?` one character, `\` escapes the next character; everything else literal. */
1788
+ mark_text_pattern?: SearchTextList;
1789
+ /** Exclude marks equal to any value (same folding as `mark_text_is`). */
1790
+ mark_text_not_is?: SearchTextList;
1791
+ /** Exclude marks containing any value as a whole word. */
1792
+ mark_text_not_word?: SearchTextList;
1793
+ /** Exclude marks beginning with any value. */
1794
+ mark_text_not_starts_with?: SearchTextList;
1795
+ /** Exclude marks ending with any value. */
1796
+ mark_text_not_ends_with?: SearchTextList;
1797
+ /** Exclude marks containing any value (punctuation and spacing folded, like the other operators). A list since 0.17.0. */
1798
+ mark_text_not_contains?: SearchTextList;
1799
+ /** Exclude marks matching any pattern. */
1800
+ mark_text_not_pattern?: SearchTextList;
1801
+ /** Exclude marks whose owners are linked to these entities (`ent_*`). */
1802
+ entity_id_not?: SearchTextList;
1803
+ /** Exclude marks linked to any entity in these entities' corporate families (`ent_*`). */
1804
+ entity_group_not?: SearchTextList;
1805
+ /** Exclude marks held by these owners (`own_*`). */
1806
+ owner_id_not?: SearchTextList;
1807
+ /** Exclude these trademarks (`tm_*`); on the grouped view, the family row containing them. */
1808
+ trademark_ids_not?: SearchTextList;
1809
+ /**
1810
+ * Return `200` with `search_meta.complete: false` when the search hits its
1811
+ * time limit or loses a shard, instead of a retryable `503`. Default false.
1812
+ */
1813
+ allow_partial?: boolean;
1814
+ }
1678
1815
  export type TrademarkDetailInclude = 'office_extensions';
1679
1816
  /**
1680
1817
  * How a `jurisdictions` filter matches. `protection` (default) selects rights
@@ -1720,7 +1857,7 @@ export type TrademarkAggregationName = 'status_stage' | 'office_code' | 'jurisdi
1720
1857
  | 'entity_count';
1721
1858
  /** How aggregation counts relate to filters (`aggregation_mode`). */
1722
1859
  export type TrademarkAggregationMode = 'filtered' | 'exclude_own_filter';
1723
- export interface TrademarkListParams {
1860
+ export interface TrademarkListParams extends SearchTextParams {
1724
1861
  /**
1725
1862
  * Coarse status bucket. Accepts a single value or an array to match any of
1726
1863
  * several values — passing `['active', 'pending']` yields TESS-style "live"
@@ -1836,41 +1973,19 @@ export interface TrademarkListParams {
1836
1973
  is_retracted?: boolean;
1837
1974
  is_series_mark?: boolean;
1838
1975
  international_registrations?: 'grouped' | 'expanded';
1839
- /**
1840
- * Optional text query (triggers relevance ranking when no explicit sort),
1841
- * or a list of exact terms: every mark that is an exact match under
1842
- * `match: 'exact'` rules (case, accents, punctuation and spacing) for ANY
1843
- * of the terms, each hit carrying `matched_terms[]`. A list takes 1-100
1844
- * terms, runs `match: 'exact'` (the default for a list) and costs the same
1845
- * as one search page. `list()` sends it as a JSON array
1846
- * (`q=["limber","bimber"]`), and by POST when the query string would pass
1847
- * the API's 2 KB GET limit.
1848
- */
1849
- q?: string | string[];
1850
1976
  /** ENG-67 — faceted bucket counts (TMview "Statistics view"). Field names to aggregate. */
1851
1977
  aggregations?: TrademarkAggregationName[];
1852
1978
  /** `filtered` (default): aggregations respect every filter. `exclude_own_filter`: each aggregation ignores its own filter (drill-down sidebars). */
1853
1979
  aggregation_mode?: TrademarkAggregationMode;
1854
1980
  /** ENG-67 — when true, return only aggregation counts (no result documents). */
1855
1981
  aggregations_only?: boolean;
1856
- /** Search strategies to apply (e.g. 'exact', 'phonetic', 'fuzzy', 'prefix'). */
1857
- strategies?: string[];
1858
- /**
1859
- * ENG-106 — how `q` matches the mark text. `'similar'` (default, ranked) vs
1860
- * the deterministic `'exact'` / `'starts_with'` / `'ends_with'` / `'contains'`
1861
- * modes. Deterministic modes require `q` and disallow `strategies`;
1862
- * `'contains'` needs a folded query ≥ 3 chars.
1863
- */
1864
- match?: MatchMode;
1865
- /** ENG-106 — exclude marks whose text contains this substring (case/accent-insensitive). Composable with any match mode. */
1866
- mark_text_not_contains?: string;
1867
1982
  /** When true, include total_count in pagination (adds latency). */
1868
1983
  include_total?: boolean;
1869
1984
  /** When true, include match highlight spans. */
1870
1985
  highlights?: boolean;
1871
1986
  /** When true, include execution timing in search_meta. */
1872
1987
  include_timing?: boolean;
1873
- /** Optional row projections. `full_goods_services` disables summary G&S truncation. */
1988
+ /** Optional row projections: `full_goods_services`, `match_details`. */
1874
1989
  include?: TrademarkSearchInclude[];
1875
1990
  /** Sparse top-level field projection. `id` and `object` are always retained. */
1876
1991
  fields?: string[];
@@ -1881,8 +1996,10 @@ export interface TrademarkListParams {
1881
1996
  /**
1882
1997
  * Sort spec. Prefix with `-` for descending. Comma-separated for multi-field.
1883
1998
  * E.g. `-filing_date`, `registration_date`, `-filing_date,office_code`.
1884
- * When `q` is present and no sort is given, results are ranked by relevance.
1885
- * When no `q` and no sort, defaults to `-filing_date`.
1999
+ * Default: relevance with `q`; mark text order (exact fits first, then
2000
+ * prefix fits, then shorter marks) with a `mark_text_*` filter and no `q`;
2001
+ * otherwise `-filing_date`. With `q`, `relevance_score` and `match` stay on
2002
+ * every hit under any sort. `search_meta.order` reports the order applied.
1886
2003
  */
1887
2004
  sort?: string;
1888
2005
  limit?: number;
@@ -1995,7 +2112,7 @@ export interface OwnerListParams {
1995
2112
  limit?: number;
1996
2113
  cursor?: string;
1997
2114
  }
1998
- export interface OwnerTrademarksParams {
2115
+ export interface OwnerTrademarksParams extends SearchTextParams {
1999
2116
  /**
2000
2117
  * Coarse status bucket. Accepts a single value or an array to match any of
2001
2118
  * several values (e.g. `['active', 'pending']` for TESS-style "live" marks).
@@ -2100,16 +2217,6 @@ export interface OwnerTrademarksParams {
2100
2217
  include_total?: boolean;
2101
2218
  include?: TrademarkSearchInclude[];
2102
2219
  fields?: string[];
2103
- /** Text query to match against the mark text within this portfolio. Required for any deterministic `match` mode. */
2104
- q?: string;
2105
- /**
2106
- * ENG-106 — how `q` matches the mark text. `'similar'` (default, ranked) vs
2107
- * the deterministic `'exact'` / `'starts_with'` / `'ends_with'` / `'contains'`
2108
- * modes. Deterministic modes require `q`; `'contains'` needs a folded query ≥ 3 chars.
2109
- */
2110
- match?: MatchMode;
2111
- /** ENG-106 — exclude marks whose text contains this substring (case/accent-insensitive). Composable with any match mode. */
2112
- mark_text_not_contains?: string;
2113
2220
  limit?: number;
2114
2221
  cursor?: string;
2115
2222
  }
@@ -2131,7 +2238,7 @@ export interface AttorneyListParams {
2131
2238
  limit?: number;
2132
2239
  cursor?: string;
2133
2240
  }
2134
- export interface AttorneyTrademarksParams {
2241
+ export interface AttorneyTrademarksParams extends SearchTextParams {
2135
2242
  /**
2136
2243
  * Coarse status bucket. Accepts a single value or an array to match any of
2137
2244
  * several values (e.g. `['active', 'pending']` for TESS-style "live" marks).
@@ -2236,16 +2343,6 @@ export interface AttorneyTrademarksParams {
2236
2343
  include_total?: boolean;
2237
2344
  include?: TrademarkSearchInclude[];
2238
2345
  fields?: string[];
2239
- /** Text query to match against the mark text within this portfolio. Required for any deterministic `match` mode. */
2240
- q?: string;
2241
- /**
2242
- * ENG-106 — how `q` matches the mark text. `'similar'` (default, ranked) vs
2243
- * the deterministic `'exact'` / `'starts_with'` / `'ends_with'` / `'contains'`
2244
- * modes. Deterministic modes require `q`; `'contains'` needs a folded query ≥ 3 chars.
2245
- */
2246
- match?: MatchMode;
2247
- /** ENG-106 — exclude marks whose text contains this substring (case/accent-insensitive). Composable with any match mode. */
2248
- mark_text_not_contains?: string;
2249
2346
  limit?: number;
2250
2347
  cursor?: string;
2251
2348
  }
@@ -2273,7 +2370,7 @@ export interface FirmAttorneysParams {
2273
2370
  limit?: number;
2274
2371
  cursor?: string;
2275
2372
  }
2276
- export interface FirmTrademarksParams {
2373
+ export interface FirmTrademarksParams extends SearchTextParams {
2277
2374
  /**
2278
2375
  * Coarse status bucket. Accepts a single value or an array to match any of
2279
2376
  * several values (e.g. `['active', 'pending']` for TESS-style "live" marks).
@@ -2378,16 +2475,6 @@ export interface FirmTrademarksParams {
2378
2475
  include_total?: boolean;
2379
2476
  include?: TrademarkSearchInclude[];
2380
2477
  fields?: string[];
2381
- /** Text query to match against the mark text within this portfolio. Required for any deterministic `match` mode. */
2382
- q?: string;
2383
- /**
2384
- * ENG-106 — how `q` matches the mark text. `'similar'` (default, ranked) vs
2385
- * the deterministic `'exact'` / `'starts_with'` / `'ends_with'` / `'contains'`
2386
- * modes. Deterministic modes require `q`; `'contains'` needs a folded query ≥ 3 chars.
2387
- */
2388
- match?: MatchMode;
2389
- /** ENG-106 — exclude marks whose text contains this substring (case/accent-insensitive). Composable with any match mode. */
2390
- mark_text_not_contains?: string;
2391
2478
  limit?: number;
2392
2479
  cursor?: string;
2393
2480
  }
@@ -2474,7 +2561,7 @@ export interface ClassificationSuggestParams {
2474
2561
  description: string;
2475
2562
  }
2476
2563
  /**
2477
- * POST body for `POST /v1/trademarks` (complex queries with filters, aggregations, strategies).
2564
+ * POST body for `POST /v1/trademarks` (structured filters, `mark_text` operators, exclusions, aggregations).
2478
2565
  *
2479
2566
  * This replaces the old `POST /v1/trademarks/search` endpoint.
2480
2567
  */
@@ -2590,23 +2677,21 @@ export interface ImageSearchResults {
2590
2677
  }
2591
2678
  export interface TrademarkSearchBody {
2592
2679
  /**
2593
- * Optional text query, or a list of exact terms (see
2594
- * `TrademarkListParams.q`). When omitted, results are filter-only.
2680
+ * Search text, ranked through the `similarity` channels. Always literal;
2681
+ * omit it for a filtered listing. See {@link SearchTextParams.q}.
2682
+ */
2683
+ q?: string;
2684
+ /**
2685
+ * Similarity channels for `q` (default `identical`, `fuzzy`, `embedded`,
2686
+ * `lookalike`; `identical` always on). Requires `q`. See {@link Presets}.
2595
2687
  */
2596
- query?: string | string[];
2597
- /** Alias for `query`. Send one or the other, not both. */
2598
- q?: string | string[];
2599
- /** Search strategies (e.g. 'exact', 'phonetic', 'fuzzy', 'prefix'). */
2600
- strategies?: ('exact' | 'phonetic' | 'fuzzy' | 'prefix')[];
2688
+ similarity?: readonly SimilarityChannel[];
2601
2689
  /**
2602
- * ENG-106 — how `query` matches the mark text. `'similar'` (default, ranked)
2603
- * vs the deterministic `'exact'` / `'starts_with'` / `'ends_with'` /
2604
- * `'contains'` modes. Deterministic modes require `query` and disallow
2605
- * `strategies`; `'contains'` needs a folded query ≥ 3 chars.
2690
+ * Exclusions: `mark_text` operators and the `entity_id`, `entity_group`,
2691
+ * `owner_id` and `trademark_ids` lists. A row matching any value is removed;
2692
+ * exclusions never affect ranking.
2606
2693
  */
2607
- match?: MatchMode;
2608
- /** ENG-106 — exclude marks whose text contains this substring (case/accent-insensitive). Composable with any match mode. */
2609
- mark_text_not_contains?: string;
2694
+ exclude?: SearchExclude;
2610
2695
  filters?: {
2611
2696
  /**
2612
2697
  * Coarse status bucket. Accepts a single value or an array to match any
@@ -2674,6 +2759,12 @@ export interface TrademarkSearchBody {
2674
2759
  is_madrid?: boolean;
2675
2760
  is_retracted?: boolean;
2676
2761
  is_series_mark?: boolean;
2762
+ /**
2763
+ * Mark text operators: `is`, `word`, `starts_with`, `ends_with`,
2764
+ * `contains`, `pattern`. Values within one operator are OR; operators
2765
+ * (and `q`) are AND.
2766
+ */
2767
+ mark_text?: MarkTextFilters;
2677
2768
  };
2678
2769
  options?: {
2679
2770
  aggregations?: TrademarkAggregationName[];
@@ -2682,12 +2773,14 @@ export interface TrademarkSearchBody {
2682
2773
  include_total?: boolean;
2683
2774
  highlights?: boolean;
2684
2775
  include_timing?: boolean;
2776
+ /** Return `200` with `search_meta.complete: false` on an engine timeout or shard failure instead of `503`. Default false. */
2777
+ allow_partial?: boolean;
2685
2778
  };
2686
2779
  /**
2687
2780
  * Sort spec. Prefix with `-` for descending. Comma-separated for multi-field.
2688
- * When `query` is present and no sort is given, results are ranked by relevance.
2689
- * When no `query` and no sort, defaults to `-filing_date`.
2690
- * When explicit sort is set with `query`, relevance scoring is disabled.
2781
+ * Default: relevance with `q`; mark text order with a `filters.mark_text`
2782
+ * operator and no `q`; otherwise `-filing_date`. With `q`, `relevance_score`
2783
+ * and `match` stay on every hit under any sort.
2691
2784
  */
2692
2785
  sort?: string;
2693
2786
  limit?: number;