@lana-commerce/core 12.0.0 → 13.0.0-alpha.1

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/CHANGELOG.md CHANGED
@@ -7,9 +7,14 @@ This project adheres to [Semantic Versioning][semantic versioning].
7
7
  ## [Unreleased]
8
8
 
9
9
  ### Major Changes
10
+
11
+ - Autocomplete APIs are removed in favor of "suggest" APIs.
12
+
10
13
  ### Minor Changes
11
14
  ### Patch Changes
12
15
 
16
+ - Update how "productFiltering" converts variant options to API search requests.
17
+
13
18
  ## [Released]
14
19
 
15
20
  ## 12.0.0 (2024-07-18)
@@ -102,11 +102,8 @@ function makeOptionFilter(optionID) {
102
102
  return {
103
103
  kind: "or",
104
104
  opts: vals.map((val) => ({
105
- kind: "and",
106
- opts: [
107
- { kind: "opt", opt: { op: "eq", name: "variants.options.option_id", text: optionID } },
108
- { kind: "opt", opt: { op: "eq", name: "variants.options.option_value_id", text: val } },
109
- ],
105
+ kind: "opt",
106
+ opt: { op: "eq", name: "variants.options", text: `${optionID}:${val}` },
110
107
  })),
111
108
  };
112
109
  },
@@ -96,11 +96,8 @@ export function makeOptionFilter(optionID) {
96
96
  return {
97
97
  kind: "or",
98
98
  opts: vals.map((val) => ({
99
- kind: "and",
100
- opts: [
101
- { kind: "opt", opt: { op: "eq", name: "variants.options.option_id", text: optionID } },
102
- { kind: "opt", opt: { op: "eq", name: "variants.options.option_value_id", text: val } },
103
- ],
99
+ kind: "opt",
100
+ opt: { op: "eq", name: "variants.options", text: `${optionID}:${val}` },
104
101
  })),
105
102
  };
106
103
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lana-commerce/core",
3
- "version": "12.0.0",
3
+ "version": "13.0.0-alpha.1",
4
4
  "description": "Lana JS Core",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -9838,24 +9838,6 @@ export interface EndpointAuthRefresh extends Endpoint<EndpointAuthRefresh, Token
9838
9838
  data(v: Token): EndpointAuthRefresh;
9839
9839
  extract(v: Extractor<TokenAndUserID>): EndpointAuthRefresh;
9840
9840
  }
9841
- export interface EndpointAutocompleteCustomers extends Endpoint<EndpointAutocompleteCustomers, CustomerExpandableItems> {
9842
- /** Unique shop identifier. See also: [Unique Identifiers](/overview/concepts/unique-identifiers) */
9843
- shop_id(v: string): EndpointAutocompleteCustomers;
9844
- data(v: Query): EndpointAutocompleteCustomers;
9845
- expand(v: CustomerExpandableItemsExpansionMap): EndpointAutocompleteCustomers;
9846
- extract(v: Extractor<CustomerExpandableItems>): EndpointAutocompleteCustomers;
9847
- }
9848
- export interface EndpointAutocompleteProducts extends Endpoint<EndpointAutocompleteProducts, ProductExpandableItems> {
9849
- /** Ignore bundle variant types */
9850
- ignore_bundles(v: boolean): EndpointAutocompleteProducts;
9851
- /** Unique shop identifier. See also: [Unique Identifiers](/overview/concepts/unique-identifiers) */
9852
- shop_id(v: string): EndpointAutocompleteProducts;
9853
- /** Filter output by variant type */
9854
- type(v: VariantTypeFilter): EndpointAutocompleteProducts;
9855
- data(v: Query): EndpointAutocompleteProducts;
9856
- expand(v: ProductExpandableItemsExpansionMap): EndpointAutocompleteProducts;
9857
- extract(v: Extractor<ProductExpandableItems>): EndpointAutocompleteProducts;
9858
- }
9859
9841
  export interface EndpointBlogs extends Endpoint<EndpointBlogs, Array<Blog>> {
9860
9842
  /** Output filtering */
9861
9843
  fields(v: Array<string>): EndpointBlogs;
@@ -14027,6 +14009,8 @@ export interface EndpointSuggestProducts extends Endpoint<EndpointSuggestProduct
14027
14009
  ignore_bundles(v: boolean): EndpointSuggestProducts;
14028
14010
  /** Unique shop identifier. See also: [Unique Identifiers](/overview/concepts/unique-identifiers) */
14029
14011
  shop_id(v: string): EndpointSuggestProducts;
14012
+ /** Filter output by variant type */
14013
+ type(v: VariantTypeFilter): EndpointSuggestProducts;
14030
14014
  data(v: Query): EndpointSuggestProducts;
14031
14015
  expand(v: ProductExpandableItemsExpansionMap): EndpointSuggestProducts;
14032
14016
  extract(v: Extractor<ProductExpandableItems>): EndpointSuggestProducts;
@@ -14906,8 +14890,6 @@ export interface ReqFunction {
14906
14890
  (ctx: Context, v: "POST:auth/password/reset.json"): EndpointAuthPasswordReset;
14907
14891
  (ctx: Context, v: "POST:auth/password/verify.json"): EndpointAuthPasswordVerify;
14908
14892
  (ctx: Context, v: "POST:auth/refresh.json"): EndpointAuthRefresh;
14909
- (ctx: Context, v: "POST:autocomplete/customers.json"): EndpointAutocompleteCustomers;
14910
- (ctx: Context, v: "POST:autocomplete/products.json"): EndpointAutocompleteProducts;
14911
14893
  (ctx: Context, v: "GET:blogs.json"): EndpointBlogs;
14912
14894
  (ctx: Context, v: "GET:blogs/page.json"): EndpointBlogsPage;
14913
14895
  (ctx: Context, v: "GET:branding.json"): EndpointBranding;
@@ -3047,7 +3047,6 @@ export interface VariantOption {
3047
3047
  option_value_name: string;
3048
3048
  }
3049
3049
  export type VariantType = "bundle" | "digital_good" | "gift_card" | "physical" | "service";
3050
- export type VariantTypeFilter = "bundle" | "digital_good" | "gift_card" | "physical" | "service";
3051
3050
  export interface AddressShortExpansionMap {
3052
3051
  country?: true;
3053
3052
  province?: true;
@@ -3508,15 +3507,6 @@ export interface EndpointStorefrontAuthRequest extends Endpoint<EndpointStorefro
3508
3507
  shop_id(v: string): EndpointStorefrontAuthRequest;
3509
3508
  extract(v: Extractor<FileURL>): EndpointStorefrontAuthRequest;
3510
3509
  }
3511
- export interface EndpointStorefrontAutocompleteProducts extends Endpoint<EndpointStorefrontAutocompleteProducts, StorefrontProductExpandableItems> {
3512
- /** Unique shop identifier. See also: [Unique Identifiers](/overview/concepts/unique-identifiers) */
3513
- shop_id(v: string): EndpointStorefrontAutocompleteProducts;
3514
- /** Filter output by variant type */
3515
- type(v: VariantTypeFilter): EndpointStorefrontAutocompleteProducts;
3516
- data(v: Query): EndpointStorefrontAutocompleteProducts;
3517
- expand(v: StorefrontProductExpandableItemsExpansionMap): EndpointStorefrontAutocompleteProducts;
3518
- extract(v: Extractor<StorefrontProductExpandableItems>): EndpointStorefrontAutocompleteProducts;
3519
- }
3520
3510
  export interface EndpointStorefrontBranding extends Endpoint<EndpointStorefrontBranding, StorefrontBranding> {
3521
3511
  /** Output filtering */
3522
3512
  fields(v: Array<string>): EndpointStorefrontBranding;
@@ -4915,7 +4905,6 @@ export interface ReqFunction {
4915
4905
  (ctx: Context, v: "POST:storefront/auth/password/verify.json"): EndpointStorefrontAuthPasswordVerify;
4916
4906
  (ctx: Context, v: "POST:storefront/auth/refresh.json"): EndpointStorefrontAuthRefresh;
4917
4907
  (ctx: Context, v: "POST:storefront/auth/request.json"): EndpointStorefrontAuthRequest;
4918
- (ctx: Context, v: "POST:storefront/autocomplete/products.json"): EndpointStorefrontAutocompleteProducts;
4919
4908
  (ctx: Context, v: "GET:storefront/branding.json"): EndpointStorefrontBranding;
4920
4909
  (ctx: Context, v: "GET:storefront/branding/default.json"): EndpointStorefrontBrandingDefault;
4921
4910
  (ctx: Context, v: "GET:storefront/brands.json"): EndpointStorefrontBrands;