@findlane/server 0.26.0 → 0.27.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 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
- typoTolerance: boolean;
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?: {
@@ -691,7 +696,8 @@ export type IndexingStatus = {
691
696
  };
692
697
  export type ReplacementStage = {
693
698
  stageId: string;
694
- status: "open" | "committed" | "aborted";
699
+ /** "committing" (0.27.0): a big stage's commit going on in steps; committing it again waits for it. */
700
+ status: "open" | "committing" | "committed" | "aborted";
695
701
  baseRevision: number;
696
702
  recordCount: number;
697
703
  batchCount: number;
@@ -1167,6 +1173,11 @@ export type RevenueReport = AnalyticsReport & {
1167
1173
  revenue: number;
1168
1174
  }>;
1169
1175
  };
1176
+ /** Orders in the main currency cancelled or refunded since (0.27.0), which every number above leaves out, and their value. */
1177
+ cancelled: {
1178
+ orders: number;
1179
+ revenue: number;
1180
+ };
1170
1181
  otherCurrencies: {
1171
1182
  currency: string;
1172
1183
  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
- typoTolerance: boolean;
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?: {
@@ -691,7 +696,8 @@ export type IndexingStatus = {
691
696
  };
692
697
  export type ReplacementStage = {
693
698
  stageId: string;
694
- status: "open" | "committed" | "aborted";
699
+ /** "committing" (0.27.0): a big stage's commit going on in steps; committing it again waits for it. */
700
+ status: "open" | "committing" | "committed" | "aborted";
695
701
  baseRevision: number;
696
702
  recordCount: number;
697
703
  batchCount: number;
@@ -1167,6 +1173,11 @@ export type RevenueReport = AnalyticsReport & {
1167
1173
  revenue: number;
1168
1174
  }>;
1169
1175
  };
1176
+ /** Orders in the main currency cancelled or refunded since (0.27.0), which every number above leaves out, and their value. */
1177
+ cancelled: {
1178
+ orders: number;
1179
+ revenue: number;
1180
+ };
1170
1181
  otherCurrencies: {
1171
1182
  currency: string;
1172
1183
  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.26.0",
3
+ "version": "0.27.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",