@findlane/server 0.26.0 → 0.28.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.cjs +2 -0
- package/dist/index.d.cts +23 -7
- package/dist/index.d.ts +23 -7
- package/dist/index.js +2 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -381,6 +381,8 @@ class SearchServerClient {
|
|
|
381
381
|
const stage = await beginReplacement(stageId, options.signal);
|
|
382
382
|
if (stage.status === "committed")
|
|
383
383
|
return { acceptedRevision: stage.acceptedRevision, recordCount: stage.recordCount, replaced: true };
|
|
384
|
+
if (stage.status === "committing")
|
|
385
|
+
return await commitReplacement(stageId, stage.batchCount, stage.recordCount, options.signal);
|
|
384
386
|
if (stage.status !== "open")
|
|
385
387
|
throw new Error(`Stage is ${stage.status}`);
|
|
386
388
|
let batch = [];
|
package/dist/index.d.cts
CHANGED
|
@@ -21,7 +21,12 @@ export type IndexSettings = {
|
|
|
21
21
|
}[];
|
|
22
22
|
facetFields: string[];
|
|
23
23
|
filterFields?: string[];
|
|
24
|
-
|
|
24
|
+
/** Prefixes and typos match (true, the default), or not (false). `"min"` keeps only the results with the
|
|
25
|
+
* fewest typos, and `"strict"` those and the ones with one more, ranked after them, as Algolia's modes do. */
|
|
26
|
+
typoTolerance: boolean | "min" | "strict";
|
|
27
|
+
/** The last query word matches as the start of longer words from its first letter, numbers too, for search
|
|
28
|
+
* boxes that search as you type. Off by default, when words match as prefixes from 3 letters. */
|
|
29
|
+
shortPrefixes?: boolean;
|
|
25
30
|
/** Words of at least `oneTypo` letters match with one typo, and of at least `twoTypos` with two.
|
|
26
31
|
* `{ oneTypo: 4, twoTypos: 7 }` by default; oneTypo is 3 to 20, twoTypos from oneTypo to 50. */
|
|
27
32
|
typoWordLengths?: {
|
|
@@ -304,13 +309,18 @@ export type CompareOptions = {
|
|
|
304
309
|
searched?: boolean;
|
|
305
310
|
signal?: AbortSignal;
|
|
306
311
|
};
|
|
312
|
+
/** What browser search may do with an index. A list left out follows the index's settings: a policy of
|
|
313
|
+
* `returnFields` alone limits only the fields browsers get. Fields a page asks for that the policy hides
|
|
314
|
+
* are left out of its results. */
|
|
307
315
|
export type PublicSearchPolicy = {
|
|
316
|
+
/** The fields browsers get; a parent such as `variations` returns the fields inside it. */
|
|
308
317
|
returnFields: string[];
|
|
309
|
-
searchFields
|
|
310
|
-
filterFields
|
|
311
|
-
facetFields
|
|
312
|
-
sortIds
|
|
313
|
-
|
|
318
|
+
searchFields?: string[];
|
|
319
|
+
filterFields?: string[];
|
|
320
|
+
facetFields?: string[];
|
|
321
|
+
sortIds?: string[];
|
|
322
|
+
/** With `sortIds`: the sort browsers get when they ask for none. */
|
|
323
|
+
defaultSort?: string;
|
|
314
324
|
/** Whether browser search may use `near` and `within`, which show roughly where each record is. */
|
|
315
325
|
location?: boolean;
|
|
316
326
|
};
|
|
@@ -691,7 +701,8 @@ export type IndexingStatus = {
|
|
|
691
701
|
};
|
|
692
702
|
export type ReplacementStage = {
|
|
693
703
|
stageId: string;
|
|
694
|
-
|
|
704
|
+
/** "committing" (0.27.0): a big stage's commit going on in steps; committing it again waits for it. */
|
|
705
|
+
status: "open" | "committing" | "committed" | "aborted";
|
|
695
706
|
baseRevision: number;
|
|
696
707
|
recordCount: number;
|
|
697
708
|
batchCount: number;
|
|
@@ -1167,6 +1178,11 @@ export type RevenueReport = AnalyticsReport & {
|
|
|
1167
1178
|
revenue: number;
|
|
1168
1179
|
}>;
|
|
1169
1180
|
};
|
|
1181
|
+
/** Orders in the main currency cancelled or refunded since (0.27.0), which every number above leaves out, and their value. */
|
|
1182
|
+
cancelled: {
|
|
1183
|
+
orders: number;
|
|
1184
|
+
revenue: number;
|
|
1185
|
+
};
|
|
1170
1186
|
otherCurrencies: {
|
|
1171
1187
|
currency: string;
|
|
1172
1188
|
orders: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -21,7 +21,12 @@ export type IndexSettings = {
|
|
|
21
21
|
}[];
|
|
22
22
|
facetFields: string[];
|
|
23
23
|
filterFields?: string[];
|
|
24
|
-
|
|
24
|
+
/** Prefixes and typos match (true, the default), or not (false). `"min"` keeps only the results with the
|
|
25
|
+
* fewest typos, and `"strict"` those and the ones with one more, ranked after them, as Algolia's modes do. */
|
|
26
|
+
typoTolerance: boolean | "min" | "strict";
|
|
27
|
+
/** The last query word matches as the start of longer words from its first letter, numbers too, for search
|
|
28
|
+
* boxes that search as you type. Off by default, when words match as prefixes from 3 letters. */
|
|
29
|
+
shortPrefixes?: boolean;
|
|
25
30
|
/** Words of at least `oneTypo` letters match with one typo, and of at least `twoTypos` with two.
|
|
26
31
|
* `{ oneTypo: 4, twoTypos: 7 }` by default; oneTypo is 3 to 20, twoTypos from oneTypo to 50. */
|
|
27
32
|
typoWordLengths?: {
|
|
@@ -304,13 +309,18 @@ export type CompareOptions = {
|
|
|
304
309
|
searched?: boolean;
|
|
305
310
|
signal?: AbortSignal;
|
|
306
311
|
};
|
|
312
|
+
/** What browser search may do with an index. A list left out follows the index's settings: a policy of
|
|
313
|
+
* `returnFields` alone limits only the fields browsers get. Fields a page asks for that the policy hides
|
|
314
|
+
* are left out of its results. */
|
|
307
315
|
export type PublicSearchPolicy = {
|
|
316
|
+
/** The fields browsers get; a parent such as `variations` returns the fields inside it. */
|
|
308
317
|
returnFields: string[];
|
|
309
|
-
searchFields
|
|
310
|
-
filterFields
|
|
311
|
-
facetFields
|
|
312
|
-
sortIds
|
|
313
|
-
|
|
318
|
+
searchFields?: string[];
|
|
319
|
+
filterFields?: string[];
|
|
320
|
+
facetFields?: string[];
|
|
321
|
+
sortIds?: string[];
|
|
322
|
+
/** With `sortIds`: the sort browsers get when they ask for none. */
|
|
323
|
+
defaultSort?: string;
|
|
314
324
|
/** Whether browser search may use `near` and `within`, which show roughly where each record is. */
|
|
315
325
|
location?: boolean;
|
|
316
326
|
};
|
|
@@ -691,7 +701,8 @@ export type IndexingStatus = {
|
|
|
691
701
|
};
|
|
692
702
|
export type ReplacementStage = {
|
|
693
703
|
stageId: string;
|
|
694
|
-
|
|
704
|
+
/** "committing" (0.27.0): a big stage's commit going on in steps; committing it again waits for it. */
|
|
705
|
+
status: "open" | "committing" | "committed" | "aborted";
|
|
695
706
|
baseRevision: number;
|
|
696
707
|
recordCount: number;
|
|
697
708
|
batchCount: number;
|
|
@@ -1167,6 +1178,11 @@ export type RevenueReport = AnalyticsReport & {
|
|
|
1167
1178
|
revenue: number;
|
|
1168
1179
|
}>;
|
|
1169
1180
|
};
|
|
1181
|
+
/** Orders in the main currency cancelled or refunded since (0.27.0), which every number above leaves out, and their value. */
|
|
1182
|
+
cancelled: {
|
|
1183
|
+
orders: number;
|
|
1184
|
+
revenue: number;
|
|
1185
|
+
};
|
|
1170
1186
|
otherCurrencies: {
|
|
1171
1187
|
currency: string;
|
|
1172
1188
|
orders: number;
|
package/dist/index.js
CHANGED
|
@@ -335,6 +335,8 @@ class SearchServerClient {
|
|
|
335
335
|
const stage = await beginReplacement(stageId, options.signal);
|
|
336
336
|
if (stage.status === "committed")
|
|
337
337
|
return { acceptedRevision: stage.acceptedRevision, recordCount: stage.recordCount, replaced: true };
|
|
338
|
+
if (stage.status === "committing")
|
|
339
|
+
return await commitReplacement(stageId, stage.batchCount, stage.recordCount, options.signal);
|
|
338
340
|
if (stage.status !== "open")
|
|
339
341
|
throw new Error(`Stage is ${stage.status}`);
|
|
340
342
|
let batch = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@findlane/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.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",
|