@getlupa/client 0.4.3-1 → 0.5.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.
Files changed (47) hide show
  1. package/README.md +11 -3
  2. package/dist/cjs/components/search-results/filters/facets/TermFacet.vue.d.ts +3 -2
  3. package/dist/cjs/constants/development/searchBoxDev.example.const.d.ts +1 -0
  4. package/dist/cjs/constants/development/searchResultsDev.example.const.d.ts +1 -0
  5. package/dist/cjs/constants/queryParams.const.d.ts +1 -0
  6. package/dist/cjs/index.d.ts +1 -0
  7. package/dist/cjs/index.min.js +442 -233
  8. package/dist/cjs/store/modules/searchBox.d.ts +4 -3
  9. package/dist/cjs/types/General.d.ts +4 -0
  10. package/dist/cjs/types/search-box/SearchBoxOptions.d.ts +1 -0
  11. package/dist/cjs/types/search-results/SearchResultsOptions.d.ts +1 -0
  12. package/dist/cjs/utils/filter.toggle.utils.d.ts +1 -1
  13. package/dist/cjs/utils/filter.utils.d.ts +1 -0
  14. package/dist/cjs/utils/price.utils.d.ts +2 -2
  15. package/dist/cjs/utils/tracking.utils.d.ts +4 -0
  16. package/dist/es/components/search-results/filters/facets/TermFacet.vue.d.ts +3 -2
  17. package/dist/es/constants/development/searchBoxDev.example.const.d.ts +1 -0
  18. package/dist/es/constants/development/searchResultsDev.example.const.d.ts +1 -0
  19. package/dist/es/constants/queryParams.const.d.ts +1 -0
  20. package/dist/es/index.d.ts +1 -0
  21. package/dist/es/index.min.js +442 -233
  22. package/dist/es/store/modules/searchBox.d.ts +4 -3
  23. package/dist/es/types/General.d.ts +4 -0
  24. package/dist/es/types/search-box/SearchBoxOptions.d.ts +1 -0
  25. package/dist/es/types/search-results/SearchResultsOptions.d.ts +1 -0
  26. package/dist/es/utils/filter.toggle.utils.d.ts +1 -1
  27. package/dist/es/utils/filter.utils.d.ts +1 -0
  28. package/dist/es/utils/price.utils.d.ts +2 -2
  29. package/dist/es/utils/tracking.utils.d.ts +4 -0
  30. package/dist/iife/components/search-results/filters/facets/TermFacet.vue.d.ts +3 -2
  31. package/dist/iife/constants/development/searchBoxDev.example.const.d.ts +1 -0
  32. package/dist/iife/constants/development/searchResultsDev.example.const.d.ts +1 -0
  33. package/dist/iife/constants/queryParams.const.d.ts +1 -0
  34. package/dist/iife/index.d.ts +1 -0
  35. package/dist/iife/index.min.js +1 -1
  36. package/dist/iife/store/modules/searchBox.d.ts +4 -3
  37. package/dist/iife/types/General.d.ts +4 -0
  38. package/dist/iife/types/search-box/SearchBoxOptions.d.ts +1 -0
  39. package/dist/iife/types/search-results/SearchResultsOptions.d.ts +1 -0
  40. package/dist/iife/utils/filter.toggle.utils.d.ts +1 -1
  41. package/dist/iife/utils/filter.utils.d.ts +1 -0
  42. package/dist/iife/utils/price.utils.d.ts +2 -2
  43. package/dist/iife/utils/tracking.utils.d.ts +4 -0
  44. package/package.json +2 -2
  45. package/.github/workflows/build-test.yml +0 -23
  46. package/.github/workflows/npm-publish.yml +0 -24
  47. package/cypress.json +0 -1
@@ -1,8 +1,9 @@
1
1
  import { SearchBoxOptions } from "@/types/search-box/SearchBoxOptions";
2
- import { Options, PublicQuery, SearchQueryResult, Suggestion } from "@getlupa/client-sdk/Types";
2
+ import { PublicQuery, SearchQueryResult, Suggestion } from "@getlupa/client-sdk/Types";
3
3
  import { VuexModule } from "vuex-module-decorators";
4
4
  import { DisplaySuggestion, HighlightedDocInfo } from "@/types/search-box/Common";
5
5
  import { SearchBoxPanel } from "@/types/search-box/SearchBoxPanel";
6
+ import { SdkOptions } from "@/types/General";
6
7
  export default class SearchBoxModule extends VuexModule {
7
8
  options: SearchBoxOptions;
8
9
  docResults: Record<string, SearchQueryResult>;
@@ -43,7 +44,7 @@ export default class SearchBoxModule extends VuexModule {
43
44
  querySuggestions({ queryKey, publicQuery, options, }: {
44
45
  queryKey: string;
45
46
  publicQuery: PublicQuery;
46
- options?: Options | undefined;
47
+ options?: SdkOptions;
47
48
  }): Promise<{
48
49
  queryKey: string;
49
50
  suggestions?: Suggestion[];
@@ -52,7 +53,7 @@ export default class SearchBoxModule extends VuexModule {
52
53
  queryDocuments({ queryKey, publicQuery, options, }: {
53
54
  queryKey: string;
54
55
  publicQuery: PublicQuery;
55
- options?: Options | undefined;
56
+ options?: SdkOptions;
56
57
  }): Promise<{
57
58
  queryKey: string;
58
59
  result?: SearchQueryResult;
@@ -2,6 +2,10 @@ import { Environment } from "@getlupa/client-sdk/Types";
2
2
  import { AnalyticsOptions } from "./AnalyticsOptions";
3
3
  export declare type SdkOptions = {
4
4
  environment: Environment;
5
+ customUrl?: string;
6
+ customPayload?: Record<string, unknown>;
7
+ customHeaders?: Record<string, string>;
8
+ onError?: (err: unknown) => unknown;
5
9
  };
6
10
  export declare type TrackingOptions = {
7
11
  trackBase?: boolean;
@@ -10,6 +10,7 @@ export declare type SearchBoxOptionLabels = {
10
10
  noResults: string;
11
11
  moreResults: string;
12
12
  currency: string;
13
+ priceSeparator?: string;
13
14
  defaultFacetLabel?: string;
14
15
  };
15
16
  export declare type SearchBoxOptionLinks = {
@@ -18,6 +18,7 @@ export declare type SearchResultsSimilarQueriesLabels = {
18
18
  export declare type SearchResultsOptionLabels = SearchResultsPaginationLabels & SearchResultsDidYouMeanLabels & SearchResultsSimilarQueriesLabels & {
19
19
  sortBy: string;
20
20
  currency: string;
21
+ priceSeparator?: string;
21
22
  itemCount: string;
22
23
  emptyResults: string;
23
24
  mobileFilterButton: string;
@@ -16,7 +16,7 @@ export declare const getFacetParam: (key: string, value: string[] | string, type
16
16
  };
17
17
  export declare const toggleTermFilter: (appendParams: AppendParams, facetAction: TermFacetAction, currentFilters?: FilterGroup | undefined) => void;
18
18
  export declare const toggleHierarchyFilter: (appendParams: AppendParams, facetAction: HierarchyFacetAction, currentFilters?: FilterGroup | undefined, removeAllLevels?: boolean) => void;
19
- export declare const toggleRangeFilter: (appendParams: AppendParams, facetAction: RangeFacetAction) => void;
19
+ export declare const toggleRangeFilter: (appendParams: AppendParams, facetAction: RangeFacetAction, currentFilters?: FilterGroup | undefined) => void;
20
20
  export declare const toggleTermParam: (params?: string[], param?: string) => string[];
21
21
  export declare const toggleLastPram: (params?: string[], param?: string) => string[];
22
22
  export declare const toggleHierarchyParam: (params?: string[], param?: string, removeAllLevels?: boolean) => string[];
@@ -8,3 +8,4 @@ export declare const isArrayKey: (key: string) => boolean;
8
8
  export declare const getMostSpecificHierarchyTerms: (terms: string[]) => string[];
9
9
  export declare const recursiveFilter: (items: HierarchyTree[], query?: string) => HierarchyTree[];
10
10
  export declare const recursiveFilterItem: (item: HierarchyTree, query?: string) => HierarchyTree | undefined;
11
+ export declare const rangeFilterToString: (rangeFilter: FilterGroupItemTypeRange, separator?: string | undefined) => string;
@@ -1,2 +1,2 @@
1
- export declare const formatPrice: (price?: string | number | undefined, currency?: string) => string;
2
- export declare const formatPriceSummary: ([min, max]: [min?: string | number | undefined, max?: string | number | undefined], currency?: string | undefined) => string;
1
+ export declare const formatPrice: (price?: string | number | undefined, currency?: string, separator?: string) => string;
2
+ export declare const formatPriceSummary: ([min, max]: [min?: string | number | undefined, max?: string | number | undefined], currency?: string | undefined, separator?: string) => string;
@@ -2,4 +2,8 @@ import { TrackingOptions } from "@/types/General";
2
2
  import { TrackableEventData } from "@/types/search-box/Common";
3
3
  import { Options } from "@getlupa/client-sdk/Types";
4
4
  export declare const initTracking: (options: TrackingOptions) => void;
5
+ export declare const getLupaTrackingContext: () => {
6
+ userId?: string;
7
+ sessionId?: string;
8
+ };
5
9
  export declare const track: (queryKey?: string | undefined, data?: TrackableEventData, options?: Options | undefined) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/client",
3
- "version": "0.4.3-1",
3
+ "version": "0.5.0",
4
4
  "main": "dist/cjs/index.min.js",
5
5
  "module": "dist/es/index.min.js",
6
6
  "types": "dist/es/index.d.ts",
@@ -17,7 +17,7 @@
17
17
  "validate:es5": "npx es5-validator dist/iife/*.min.js"
18
18
  },
19
19
  "dependencies": {
20
- "@getlupa/client-sdk": "^1.0.20",
20
+ "@getlupa/client-sdk": "^1.0.24",
21
21
  "vue": "^2.6.11",
22
22
  "vue-class-component": "^7.2.3",
23
23
  "vue-property-decorator": "^9.1.2",
@@ -1,23 +0,0 @@
1
- # This is a basic workflow to help you get started with Actions
2
-
3
- name: Lupa-Test
4
-
5
- on:
6
- pull_request:
7
- push:
8
- branches:
9
- - main
10
- workflow_dispatch:
11
-
12
- jobs:
13
- test:
14
- runs-on: ubuntu-latest
15
-
16
- steps:
17
- - uses: actions/checkout@v3
18
- - uses: c-hive/gha-yarn-cache@v2
19
- - run: yarn install
20
- - run: yarn build
21
- - run: yarn validate:es5
22
- - run: yarn test:unit
23
- - run: yarn test:e2e
@@ -1,24 +0,0 @@
1
- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3
-
4
- name: NPM Package
5
-
6
- on:
7
- release:
8
- types: [created]
9
-
10
- jobs:
11
-
12
- publish-npm:
13
- runs-on: ubuntu-latest
14
- steps:
15
- - uses: actions/checkout@v3
16
- - uses: actions/setup-node@v3
17
- with:
18
- node-version: 16
19
- registry-url: https://registry.npmjs.org/
20
- - run: yarn install
21
- - run: yarn build
22
- - run: yarn publish --access public
23
- env:
24
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}
package/cypress.json DELETED
@@ -1 +0,0 @@
1
- {}