Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit 29d4ce5

Browse files
author
Tomasz Kostuch
authored
Merge pull request #458 from DivanteLtd/release/v1.12.0-rc.1
Release/v1.12.0
2 parents 0024ecd + cbabbc8 commit 29d4ce5

File tree

83 files changed

+15155
-10496
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+15155
-10496
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

CHANGELOG.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,37 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
8+
## [1.12.0] - 2020.06.01
9+
10+
### Added
11+
- Add url module - @gibkigonzo (#3942)
12+
- The `response_format` query parameter to the `/api/catalog` endpoint. Currently there is just one additional format supported: `response_format=compact`. When used, the response format got optimized by: a) remapping the results, removing the `_source` from the `hits.hits`; b) compressing the JSON fields names according to the `config.products.fieldsToCompact`; c) removing the JSON fields from the `product.configurable_children` when their values === parent product values; overall response size reduced over -70% - @pkarw
13+
- The support for `SearchQuery` instead of the ElasticSearch DSL as for the input to `/api/catalog` - using `storefront-query-builder` package - @pkarw - https://github.com/DivanteLtd/vue-storefront/issues/2167
14+
- Create attribute service that allows to fetch attributes with specific options - used for products aggregates - @gibkigonzo (https://github.com/DivanteLtd/vue-storefront/pull/4001, https://github.com/DivanteLtd/mage2vuestorefront/pull/99)
15+
- Add ElasticSearch client support for HTTP authentication - @cewald (#397)
16+
- Endpoint for reset password with reset token. Only for Magento 2 - @Fifciu
17+
- Varnish Cache with autoinvalidation by Cache tags as addon - @Fifciu
18+
- Add `resetPasswordUsingResetToken` to `magento1` platform - @cewald (#415)
19+
- Update to `storefront-query-builder` version `1.0.0` - @cewald (#429)
20+
- Add `composeError` in './magento2/o2m.js' - @flancer64 (#422)
21+
- Explicit data extraction from 'Error' objects - @flancer64 (#424)
22+
- Merge scripts: db7 => db, elastic7=>elastic and add support for es7 in yarn mage2vs import - @gibkigonzo (#436)
23+
24+
### Fixed
25+
- add es7 support for map url module and fixed default index for es config - @gibkigonzo
26+
- Add correct paths for production build - @cewald (#407)
27+
- Fix MSI default stock id value
28+
- Add outputFormatter to response from cache - @gibkigonzo (#428)
29+
- disable showing stack for invalid requests - @gibkigonzo (#431)
30+
- Improve `_outputFormatter` on cache catalog-response to prevent exception - @cewald (#432)
31+
- use ts for compiling additional scripts - @gibkigonzo (#437)
32+
- Bugfix for wrong JSON scheme url's and hostname resolution for `magento1` platform - @cewald (#443)
33+
- check if headers has been already sent in image middleware - @gibkigonzo (#434)
34+
- Missing packages in Docker Makefile (make, python and g++) - @proxiblue (#448)
35+
- change path in ecosystem for o2m - @gibkigonzo (#434)
36+
- udpate typings for query params - @gibkigonzo (#446)
37+
738
## [1.11.1] - 2020.03.17
839

940
### Added
@@ -23,7 +54,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2354

2455
- Fixed some smaller issues with graphql so that it is now working again with the fronted - #350
2556
- Replaced the old `crop` function call which has been removed from Sharp image processor - @grimasod (#381)
26-
57+
- Add product processor to new URL mapper endpoint #401 - @cewald (#401, #403)
58+
- Add fallback for `sourcePriceInclTax` and `finalPriceInclTax` in `magento1` platform - @cewald (#398)
2759

2860
## [1.11.0-rc.1] - 2019.10.03
2961

@@ -39,6 +71,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3971
- Added support for tax calculation where the values from customer_tax_class_ids is used - @resubaka (#307)
4072
- The `db` context object - passed to every api endpoint now has two usefull methods: `getElasticClient` and `getRedisClient` for accesing the data stores - @pkarw (#328)
4173
- The `lib/utils` got two new methods `getStoreCode(req: Express.Request)` and `getStoreView(code: string)` for getting the current multistore context from `vue-storefront` frontend requests - @pkarw
74+
- Check message property instead of errorMessage in apiError function - @cdshotels-liborpansky (#378)
4275

4376
### Removed
4477
- The `scripts/seo.js` tool has been removed, the legacy `migrations` scripts have been removed, the unused legacy extensions (`gls-parcelshop-dk`, `postnord-parcelshop-dk`) - @pkarw (#342)

README.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,7 @@ Starting from [Elasitc 6 and 7](https://www.elastic.co/guide/en/elasticsearch/re
111111

112112
From now on, we're using the separate indexes per each entity type. The convention is: `${indexName}_${entityType}`. If your' **logical index name** is `vue_storefront_catalog` then it will be mapped to the **physical indexes** of: `vue_storefront_catalog_product`, `vue_storefront_catalog_category` ...
113113

114-
To take the advantage of this new logical->physical index distinction we've provided new Elastic tools: `db7`, `migrate7`, `dump7`, `restore7` tools. They can be used exactly the same way [like the old tools](https://docs.vuestorefront.io/guide/data/database-tool.html) were. The only distinction is that they work on separate indexes.
115-
116-
**Create new index**
117-
118-
Before restoreing or importing data you might want to create a new Elastic index with the proper data types/schema applied. You can run just the `yarn db7 new` command in order to do that.
119-
120-
**Restore the data**
121-
122-
After you ran the docker file and have Elastic7 up and running you might want to:
123-
124-
a) restore the demo data by running `yarn restore7` and `yarn restore7_it; yarn restore7_de` for default multistores. The data is restored from `var/catalog_product.json`, `var/catalog_category.json` and so on...
125-
126-
b) import the data from Magento to proper physical indexes. To do so, currently you can do this only with [mage2vuestorefront](https://github.com/DivanteLtd/mage2vuestorefront/pull/96).
127-
128-
**Note:** After 1.11 stable release (around November, 2019) we'll **replace** the standard tools: `db`, `migrate`, `dump`, `restore` with the Elastic 7 equivalents and it will become the default.
129-
114+
[Tools](https://docs.vuestorefront.io/guide/data/database-tool.html) are adjusted to ES7. You can use `yarn db new`, `yarn restore`, `yarn mage2vs import`. Just make sure that you have set up `config.elasticsearch.apiVersion` to `7.1`.
130115

131116
## API access
132117
Catalog API calls are compliant with ElasticSearch (it works like a filtering proxy to ES). More on ES queries: [ElasticSearch queries tutorial](http://okfnlabs.org/blog/2013/07/01/elasticsearch-query-tutorial.html)

config/default.json

Lines changed: 101 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"availableCacheTags": ["P", "C", "T", "A", "product", "category", "attribute", "taxrule"],
1010
"invalidateCacheKey": "aeSu7aip",
1111
"invalidateCacheForwarding": false,
12-
"invalidateCacheForwardUrl": "http://localhost:3000/invalidate?key=aeSu7aip&tag="
12+
"invalidateCacheForwardUrl": "http://localhost:3000/invalidate?key=aeSu7aip&tag=",
13+
"showErrorStack": false
1314
},
1415
"orders": {
1516
"useServerQueue": false
@@ -38,7 +39,89 @@
3839
"taxrule",
3940
"review"
4041
],
41-
"apiVersion": "5.6"
42+
"apiVersion": "5.6",
43+
44+
"searchScoring": {
45+
"attributes": {
46+
"attribute_code": {
47+
"scoreValues": { "attribute_value": { "weight": 1 } }
48+
}
49+
},
50+
"fuzziness": 2,
51+
"cutoff_frequency": 0.01,
52+
"max_expansions": 3,
53+
"minimum_should_match": "75%",
54+
"prefix_length": 2,
55+
"boost_mode": "multiply",
56+
"score_mode": "multiply",
57+
"max_boost": 100,
58+
"function_min_score": 1
59+
},
60+
"searchableAttributes": {
61+
"name": {
62+
"boost": 4
63+
},
64+
"sku": {
65+
"boost": 2
66+
},
67+
"category.name": {
68+
"boost": 1
69+
}
70+
}
71+
},
72+
"products": {
73+
"fieldsToCompress": ["max_regular_price", "max_price", "max_regular_price", "minimal_regular_price", "final_price", "price", "special_price", "original_final_price", "original_price", "original_special_price", "final_price_incl_tax", "price_incl_tax", "special_price_incl_tax", "final_price_tax", "price_tax", "special_price_tax", "image", "small_image", "thumbnail"],
74+
"fieldsToCompact": {
75+
"minimal_price": "mp",
76+
"has_options": "ho",
77+
"url_key": "u",
78+
"status": "s",
79+
"required_options": "ro",
80+
"name": "nm",
81+
"tax_class_id": "tci",
82+
"description": "desc",
83+
"minimal_regular_price": "mrp",
84+
"final_price": "fp",
85+
"price": "p",
86+
"special_price": "sp",
87+
"original_final_price": "ofp",
88+
"original_price": "op",
89+
"original_special_price": "osp",
90+
"final_price_incl_tax": "fpit",
91+
"original_price_incl_tax": "opit",
92+
"price_incl_tax": "pit",
93+
"special_price_incl_tax": "spit",
94+
"final_price_tax": "fpt",
95+
"price_tax": "pt",
96+
"special_price_tax": "spt",
97+
"original_price_tax": "opt",
98+
"image": "i",
99+
"small_image": "si",
100+
"thumbnail": "t"
101+
},
102+
"filterFieldMapping": {
103+
"category.name": "category.name.keyword"
104+
},
105+
"filterAggregationSize": {
106+
"default": 10,
107+
"size": 10,
108+
"color": 10
109+
},
110+
"priceFilterKey": "final_price",
111+
"priceFilters": {
112+
"ranges": [
113+
{ "from": 0, "to": 50 },
114+
{ "from": 50, "to": 100 },
115+
{ "from": 100, "to": 150 },
116+
{ "from": 150 }
117+
]
118+
}
119+
},
120+
"varnish": {
121+
"host": "185.246.52.88",
122+
"port": 80,
123+
"method": "BAN",
124+
"enabled": false
42125
},
43126
"redis": {
44127
"host": "localhost",
@@ -78,7 +161,7 @@
78161
"tax": {
79162
"defaultCountry": "DE",
80163
"defaultRegion": "",
81-
"deprecatedPriceFieldsSupport": true,
164+
"deprecatedPriceFieldsSupport": false,
82165
"calculateServerSide": true,
83166
"sourcePriceIncludesTax": false,
84167
"finalPriceIncludesTax": true,
@@ -115,7 +198,7 @@
115198
"defaultRegion": "",
116199
"calculateServerSide": true,
117200
"sourcePriceIncludesTax": false,
118-
"deprecatedPriceFieldsSupport": true,
201+
"deprecatedPriceFieldsSupport": false,
119202
"finalPriceIncludesTax": true,
120203
"userGroupId": null,
121204
"useOnlyDefaultUserGroupId": false
@@ -145,7 +228,7 @@
145228
"usePlatformTotals": true,
146229
"setConfigurableProductOptions": true,
147230
"sourcePriceIncludesTax": false,
148-
"deprecatedPriceFieldsSupport": true,
231+
"deprecatedPriceFieldsSupport": false,
149232
"finalPriceIncludesTax": false,
150233
"userGroupId": null,
151234
"useOnlyDefaultUserGroupId": false
@@ -164,6 +247,7 @@
164247
"cms-data",
165248
"mail-service",
166249
"example-processor",
250+
"example-custom-filter",
167251
"elastic-stock"
168252
],
169253
"extensions": {
@@ -188,6 +272,9 @@
188272
"resultProcessors": {
189273
"product": "my-product-processor"
190274
}
275+
},
276+
"example-custom-filter": {
277+
"catalogFilter": [ "SampleFilter" ]
191278
}
192279
},
193280
"magento2": {
@@ -257,7 +344,8 @@
257344
"includeFields": [ "children_data", "id", "children_count", "sku", "name", "is_active", "parent_id", "level", "url_key" ]
258345
},
259346
"attribute": {
260-
"includeFields": [ "attribute_code", "id", "entity_type_id", "options", "default_value", "is_user_defined", "frontend_label", "attribute_id", "default_frontend_label", "is_visible_on_front", "is_visible", "is_comparable" ]
347+
"includeFields": [ "attribute_code", "id", "entity_type_id", "options", "default_value", "is_user_defined", "frontend_label", "attribute_id", "default_frontend_label", "is_visible_on_front", "is_visible", "is_comparable" ],
348+
"loadByAttributeMetadata": false
261349
},
262350
"productList": {
263351
"sort": "",
@@ -284,5 +372,12 @@
284372
"description": 1,
285373
"sku": 1,
286374
"configurable_children.sku": 1
375+
},
376+
"urlModule": {
377+
"map": {
378+
"includeFields": ["url_path", "identifier", "id", "slug", "sku", "type_id"],
379+
"searchedFields": ["url_path", "identifier"],
380+
"searchedEntities": ["product", "category", "cms_page"]
381+
}
287382
}
288383
}

config/elastic.schema.product.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,25 @@
7676
"tax_class_id": {"type": "integer"},
7777
"gender": {"type": "integer"},
7878
"material": {"type": "integer"},
79-
"category_gear": {"type": "integer"}
79+
"category_gear": {"type": "integer"},
80+
"attributes_metadata": {
81+
"properties": {
82+
"id": {"type": "integer"},
83+
"attribute_id": {"type": "integer"},
84+
"default_frontend_label": {"type": "text"},
85+
"is_visible_on_front": {"type": "text"},
86+
"is_visible" : {"type": "boolean"},
87+
"frontend_input": {"type": "text"},
88+
"is_user_defined": {"type": "boolean"},
89+
"is_comparable": {"type": "text"},
90+
"attribute_code": {"type": "text"},
91+
"options": {
92+
"properties": {
93+
"value": {"type": "text"},
94+
"label": {"type": "text"}
95+
}
96+
}
97+
}
98+
}
8099
}
81100
}

docker-compose.nodejs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ services:
2626
- /var/www/dist
2727
ports:
2828
- '8080:8080'
29+

docker-compose.varnish.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: '3.0'
2+
services:
3+
varnish:
4+
build:
5+
context: .
6+
dockerfile: varnish/Dockerfile
7+
volumes:
8+
- ./docker/varnish/config.vcl:/usr/local/etc/varnish/default.vcl
9+
ports:
10+
- '1234:80'

docker/varnish/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM cooptilleuls/varnish:6.0-stretch
2+
3+
# install varnish-modules
4+
RUN apt-get update -y && \
5+
apt-get install -y build-essential automake libtool curl git python-docutils && \
6+
curl -s https://packagecloud.io/install/repositories/varnishcache/varnish60/script.deb.sh | bash;
7+
8+
RUN apt-get install -y pkg-config libvarnishapi1 libvarnishapi-dev autotools-dev;
9+
10+
RUN git clone https://github.com/varnish/varnish-modules.git /tmp/vm;
11+
RUN cd /tmp/vm; \
12+
git checkout 6.0; \
13+
./bootstrap && \
14+
./configure;
15+
16+
RUN cd /tmp/vm && \
17+
make && \
18+
make check && \
19+
make install;

0 commit comments

Comments
 (0)