@findlane/server 0.32.0 → 0.34.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.
- package/dist/index.d.cts +48 -0
- package/dist/index.d.ts +48 -0
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -107,6 +107,13 @@ export type IndexSettings = {
|
|
|
107
107
|
variants?: {
|
|
108
108
|
field: string;
|
|
109
109
|
} | null;
|
|
110
|
+
/** Facet matches (0.34.0): the facet values a search's query names, such as a category, a brand or a zip, for
|
|
111
|
+
* searches that ask (`facetMatches` in a search). Each of up to 10 fields is a facet, with its values' names
|
|
112
|
+
* read from records beside them (`labelPath`, and `labelKey` when the field isn't beside it: categories.name
|
|
113
|
+
* beside categories.slug), written (`labels`: a value's names, values sharing one matching as one), or the
|
|
114
|
+
* values themselves; `only: "labelled"` leaves the rest out, `hide` lists values that never match, and `link`
|
|
115
|
+
* is where a match goes, with `{value}`. `perField` matches per field, 3 by default. Null for none. */
|
|
116
|
+
facetMatches?: FacetMatchesSetting | null;
|
|
110
117
|
/** When saving: types for fields no record has yet, so settings can come before the records. Records'
|
|
111
118
|
* types win once they have the field. Not returned when reading settings. */
|
|
112
119
|
fieldTypes?: Record<string, "text" | "number" | "boolean" | "text[]" | "number[]" | "boolean[]" | "location">;
|
|
@@ -422,6 +429,42 @@ export type SearchRequest = {
|
|
|
422
429
|
* unless it says, or `true` for that. Up to 5. Their results come back in `subindexes`; the search and its
|
|
423
430
|
* subindexes count as one search (0.25.0). */
|
|
424
431
|
subindexes?: Record<string, Omit<SearchRequest, "subindexes"> | true>;
|
|
432
|
+
/** The facet values the query names (0.34.0): `true` for every field of the index's facetMatches setting, or
|
|
433
|
+
* `{ fields }` for some of them. They come back in `facetMatches`. */
|
|
434
|
+
facetMatches?: boolean | {
|
|
435
|
+
fields?: string[];
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
/** The facetMatches setting (0.34.0); see IndexSettings. */
|
|
439
|
+
export type FacetMatchesSetting = {
|
|
440
|
+
fields: Array<{
|
|
441
|
+
field: string;
|
|
442
|
+
labelPath?: string;
|
|
443
|
+
labelKey?: string;
|
|
444
|
+
labels?: Record<string, string | string[]>;
|
|
445
|
+
only?: "labelled";
|
|
446
|
+
hide?: string[];
|
|
447
|
+
link?: string;
|
|
448
|
+
}>;
|
|
449
|
+
perField?: number;
|
|
450
|
+
};
|
|
451
|
+
/** A facet value a query names (0.34.0): the field's `values` it stands for (several when values share a label),
|
|
452
|
+
* its `label`, its `count` of records the search's filters allow, how it matched (`match`: exact, prefix, typo,
|
|
453
|
+
* or contains, a later word of the value), whether it took every word (`whole`), where those words are in `q`
|
|
454
|
+
* (`typed`, UTF-16 offsets), its `link`, a `filter` for it, and whether the search applied it (false for now). */
|
|
455
|
+
export type FacetMatch = {
|
|
456
|
+
field: string;
|
|
457
|
+
values: string[];
|
|
458
|
+
label: string;
|
|
459
|
+
count: number;
|
|
460
|
+
match: "exact" | "prefix" | "typo" | "contains";
|
|
461
|
+
whole: boolean;
|
|
462
|
+
typed?: [number, number];
|
|
463
|
+
link?: string;
|
|
464
|
+
filter: Record<string, {
|
|
465
|
+
in: Array<string | number | boolean>;
|
|
466
|
+
}>;
|
|
467
|
+
applied: boolean;
|
|
425
468
|
};
|
|
426
469
|
/** A subindex whose search failed, such as one the index doesn't have (404). */
|
|
427
470
|
export type SubindexError = {
|
|
@@ -539,6 +582,9 @@ export type SearchResponse<T> = {
|
|
|
539
582
|
};
|
|
540
583
|
/** A rule pinned it at its place (0.20.0). */
|
|
541
584
|
pinned?: true;
|
|
585
|
+
/** With optimized images on (0.33.0): its image's placeholder, a ThumbHash in base64, for the browser SDK's
|
|
586
|
+
* `Image` (its `placeholder` prop) to show while the image loads. */
|
|
587
|
+
placeholder?: string;
|
|
542
588
|
}[];
|
|
543
589
|
/** The matches; with the index's `distinct` setting, the groups. */
|
|
544
590
|
total: number;
|
|
@@ -586,6 +632,8 @@ export type SearchResponse<T> = {
|
|
|
586
632
|
};
|
|
587
633
|
/** With `subindexes`: each subindex's results by name, or its error (0.25.0). */
|
|
588
634
|
subindexes?: Record<string, SearchResponse<JsonRecord> | SubindexError>;
|
|
635
|
+
/** With `facetMatches`: the facet values the query names, best first, at most 10 (0.34.0). */
|
|
636
|
+
facetMatches?: FacetMatch[];
|
|
589
637
|
};
|
|
590
638
|
/** How a product's recommendations are served (the recommendations add-on). */
|
|
591
639
|
/** One of an index's lists (docs: Lists): a row of products, such as Popular or New arrivals, from a filter and
|
package/dist/index.d.ts
CHANGED
|
@@ -107,6 +107,13 @@ export type IndexSettings = {
|
|
|
107
107
|
variants?: {
|
|
108
108
|
field: string;
|
|
109
109
|
} | null;
|
|
110
|
+
/** Facet matches (0.34.0): the facet values a search's query names, such as a category, a brand or a zip, for
|
|
111
|
+
* searches that ask (`facetMatches` in a search). Each of up to 10 fields is a facet, with its values' names
|
|
112
|
+
* read from records beside them (`labelPath`, and `labelKey` when the field isn't beside it: categories.name
|
|
113
|
+
* beside categories.slug), written (`labels`: a value's names, values sharing one matching as one), or the
|
|
114
|
+
* values themselves; `only: "labelled"` leaves the rest out, `hide` lists values that never match, and `link`
|
|
115
|
+
* is where a match goes, with `{value}`. `perField` matches per field, 3 by default. Null for none. */
|
|
116
|
+
facetMatches?: FacetMatchesSetting | null;
|
|
110
117
|
/** When saving: types for fields no record has yet, so settings can come before the records. Records'
|
|
111
118
|
* types win once they have the field. Not returned when reading settings. */
|
|
112
119
|
fieldTypes?: Record<string, "text" | "number" | "boolean" | "text[]" | "number[]" | "boolean[]" | "location">;
|
|
@@ -422,6 +429,42 @@ export type SearchRequest = {
|
|
|
422
429
|
* unless it says, or `true` for that. Up to 5. Their results come back in `subindexes`; the search and its
|
|
423
430
|
* subindexes count as one search (0.25.0). */
|
|
424
431
|
subindexes?: Record<string, Omit<SearchRequest, "subindexes"> | true>;
|
|
432
|
+
/** The facet values the query names (0.34.0): `true` for every field of the index's facetMatches setting, or
|
|
433
|
+
* `{ fields }` for some of them. They come back in `facetMatches`. */
|
|
434
|
+
facetMatches?: boolean | {
|
|
435
|
+
fields?: string[];
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
/** The facetMatches setting (0.34.0); see IndexSettings. */
|
|
439
|
+
export type FacetMatchesSetting = {
|
|
440
|
+
fields: Array<{
|
|
441
|
+
field: string;
|
|
442
|
+
labelPath?: string;
|
|
443
|
+
labelKey?: string;
|
|
444
|
+
labels?: Record<string, string | string[]>;
|
|
445
|
+
only?: "labelled";
|
|
446
|
+
hide?: string[];
|
|
447
|
+
link?: string;
|
|
448
|
+
}>;
|
|
449
|
+
perField?: number;
|
|
450
|
+
};
|
|
451
|
+
/** A facet value a query names (0.34.0): the field's `values` it stands for (several when values share a label),
|
|
452
|
+
* its `label`, its `count` of records the search's filters allow, how it matched (`match`: exact, prefix, typo,
|
|
453
|
+
* or contains, a later word of the value), whether it took every word (`whole`), where those words are in `q`
|
|
454
|
+
* (`typed`, UTF-16 offsets), its `link`, a `filter` for it, and whether the search applied it (false for now). */
|
|
455
|
+
export type FacetMatch = {
|
|
456
|
+
field: string;
|
|
457
|
+
values: string[];
|
|
458
|
+
label: string;
|
|
459
|
+
count: number;
|
|
460
|
+
match: "exact" | "prefix" | "typo" | "contains";
|
|
461
|
+
whole: boolean;
|
|
462
|
+
typed?: [number, number];
|
|
463
|
+
link?: string;
|
|
464
|
+
filter: Record<string, {
|
|
465
|
+
in: Array<string | number | boolean>;
|
|
466
|
+
}>;
|
|
467
|
+
applied: boolean;
|
|
425
468
|
};
|
|
426
469
|
/** A subindex whose search failed, such as one the index doesn't have (404). */
|
|
427
470
|
export type SubindexError = {
|
|
@@ -539,6 +582,9 @@ export type SearchResponse<T> = {
|
|
|
539
582
|
};
|
|
540
583
|
/** A rule pinned it at its place (0.20.0). */
|
|
541
584
|
pinned?: true;
|
|
585
|
+
/** With optimized images on (0.33.0): its image's placeholder, a ThumbHash in base64, for the browser SDK's
|
|
586
|
+
* `Image` (its `placeholder` prop) to show while the image loads. */
|
|
587
|
+
placeholder?: string;
|
|
542
588
|
}[];
|
|
543
589
|
/** The matches; with the index's `distinct` setting, the groups. */
|
|
544
590
|
total: number;
|
|
@@ -586,6 +632,8 @@ export type SearchResponse<T> = {
|
|
|
586
632
|
};
|
|
587
633
|
/** With `subindexes`: each subindex's results by name, or its error (0.25.0). */
|
|
588
634
|
subindexes?: Record<string, SearchResponse<JsonRecord> | SubindexError>;
|
|
635
|
+
/** With `facetMatches`: the facet values the query names, best first, at most 10 (0.34.0). */
|
|
636
|
+
facetMatches?: FacetMatch[];
|
|
589
637
|
};
|
|
590
638
|
/** How a product's recommendations are served (the recommendations add-on). */
|
|
591
639
|
/** One of an index's lists (docs: Lists): a row of products, such as Popular or New arrivals, from a filter and
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@findlane/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "Findlane server SDK: upload catalogs, manage index settings, and search with a secret workspace API key.",
|
|
5
5
|
"keywords": ["findlane", "search", "full-text search", "typo tolerance", "ecommerce search", "search api", "sdk"],
|
|
6
6
|
"license": "MIT",
|