UNPKG

16.2 kBMarkdownView Raw
1# Changelog
2
3All notable changes to this project will be documented in this file.
4
5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
8
9## Unreleased
10
11
12## 3.3.1 - 2024-10-02
13
14### Added
15
16- Add new query parameter `q` to the `LandingPageParams` type
17- Add new query parameter `includeNavigation` to the `LandingPageParams` type
18
19
20## 3.3.0 - 2024-08-27
21
22### Added
23
24- Export types for all request query parameters and bodies. For instance,
25 `AutocompleteParams` and `AutocompleteBody` for the `autocomplete()`
26 endpoint
27- Added `templateId` query parameter to endpoints returning product- or
28 recommendation-lists
29- Added `presentPrices` query parameter for list of prices to include
30
31
32## 3.2.1 - 2024-06-12
33
34### Added
35
36- Added support for numbers in custom typed attributes.
37
38
39## 3.2.0 - 2023-12-18
40
41### Added
42
43- `Add To Cart Popup` query to get recommendations for a product that has just been added to the cart.
44
45
46## 3.1.1 - 2023-11-02
47
48### Added
49
50- Sort orders for length, width, height, depth, volume and title.
51
52
53## 3.1.0 - 2023-09-08
54
55### Added
56
57- Added weight property to `Product` & `Variant` interfaces
58
59
60## 3.0.0 - 2023-08-29
61
62As a result of the changes below, this package is now supported in
63NodeJS and Deno. NodeJS requires version 18+ (or 16.15+ with
64`--experimental-fetch` flag active), since `fetch()` is used to make
65cross platform network requests. In Deno the `npm:` prefix before
66the package name should be used.
67
68
69### Added
70
71- Added CommonJS build of this package, which will be used automatically
72 by Node if this package is used with `require()`.
73- The package has been made more friendly to tree-shaking, in order for
74 bundlers to remove unused code. Two new initialization methods have been
75 introduced: `queries()` and `notifications()`. Each method only has
76 access to their respective parts of the Storefront API.
77
78 **Before (minified):**
79 - All exports: 5.82 kB
80 - `esales()`: 5.66 kB
81
82 **After (minified):**
83 - All exports: 4.44 kB
84 - `elevate()` + `localStorageBackedSession()`: 4.09 kB
85 - `elevate()`: 3.42 kB
86 - `queries()`: 2.6 kB
87 - `notifications()`: 1.83 kB
88- Added a `localStorageBackedSession()` method, which uses the same
89 session metadata handling as in version 2 on this package. The returned
90 value can be passed directly to the `session` property in the API initialization.
91
92 The returned object also has methods for updating customer key, as well as
93 resetting both session- and customerKey to new UUID's.
94
95### Changed
96
97- (BREAKING) Made the type `CheckboxFacet.count` optional, since it's
98 only available when `CheckboxFacet.selected` is `true`
99- (BREAKING) New required property `session` in the initialization config.
100 This property should be a method returning an object - or a promise with
101 an object - that has `sessionKey` and `customerKey`.
102
103 ```ts
104 import { elevate } from '@apptus/esales-api';
105
106 const api = elevate({
107 clusterId: '...',
108 // ...,
109 session: async () => {
110 const { id, sessionId } = await visitorInfo();
111 return { customerKey: id, sessionKey: sessionId };
112 }
113 });
114 ```
115- (BREAKING) All notification methods now return promises. In v2
116 `Navigator.sendBeacon()` was used to synchronously schedule POST
117 requests in the browser. This has been changed in v3, where `fetch()` is
118 used instead.
119 ```ts
120 // Before
121 api.notify.click(); // would throw if failing to queue POST
122 > undefined
123
124 // After
125 api.notify.click();
126 > Promise<void>
127 ```
128
129 Any code using notifications should update the code to handle the
130 promises, to avoid potential uncaught promise errors.
131- It is now possible to send a `Variant.key` to `addFavorite()` and
132 `removeFavorite()` notification methods, by passing an object instead of
133 a string. Such as `api.notify.addFavorite({ variantKey: '...' })`
134- Now uses `crypto.randomUUID()` over the `uuid` npm package, and thus
135 there are 0 dependencies for this package anymore. This API is only used
136 and required when `localStorageBackedSession()` is used (which is
137 intended only for browsers).
138- [Apptus eSales has been renamed Voyado Elevate](https://docs.apptus.com/elevate/4/changelog/#esales-is-voyado-elevate).
139 Documentation, comments, and more has changed to match this.
140 The `esales()` method has been deprecated in favor of the new
141 `elevate()` method for initializing the API.
142- Documentation for code has been improved, with better descriptions
143 and less ambiguous information. Many links to [the Elevate docs](https://docs.apptus.com/elevate/4/)
144 has been added to more easily find more information about the API.
145- This package now supports Node.js and Deno, by avoiding browser-only
146 API's in core code paths. Moving session data via `LocalStorage` to it's
147 own method, and replacing `navigator.sendBeacon()` with `fetch()` are
148 the core changes that allows this.
149
150 There's also been a lot of internal updates made to the project,
151 unit test runner, and more as part of this effort.
152
153### Removed
154
155- (BREAKING) The `session` property on the API object returned by
156 `elevate()`/`esales()` has been removed. When using session information
157 with `LocalStorage`, the same functionality can be found on the object
158 returned by the `localStorageBackedSession()` method.
159- (BREAKING) Removed the `api.notify.payment()` notification method,
160 since it's no longer possible to notify payments via the Storefront API.
161- Removed the minified build artifact `lib.min.mjs`. There were several
162 reasons it was deemed unnecessary to keep this file:
163 - Most bundlers already do minification of code as a final step
164 - Tooling that bundled packages had to be configured with this modified
165 entrypoint manually
166 - With multiple module formats (ESM, CJS), having minified versions of
167 each adds more "bloat"/configuration to the package
168
169
170## 2.4.9 - 2023-08-18
171
172### Changed
173
174- Corrected a code example in the README.md
175
176
177## 2.4.8 - 2023-07-07
178
179### Changed
180
181- Reverted back format of `CustomData` in the `LandingPage` interface.
182
183
184## 2.4.7 - 2023-07-05
185
186### Changed
187
188- Updated the format of `CustomData` in the `LandingPage` interface to include the locale information.
189
190
191## 2.4.6 - 2023-06-20
192
193### Changed
194
195- Add property `published` to the `LandingPage` interface
196
197
198## 2.4.5 - 2023-06-20
199
200### Changed
201
202- Measurements such as width, height, depth, length, volume are included on listings
203 if they exist in the product data
204
205
206## 2.4.4 - 2023-06-15
207
208### Added
209
210- Added Algorithm type `RECENTLY_VIEWED` to recommendation lists
211
212
213## 2.4.3 - 2023-06-09
214
215### Added
216
217- Added properties to `Product` & `Variant` interfaces for measurements
218- Added property `typedCustom` to `Product` & `Variant`, which is typed custom attributes for lengths
219
220
221## 2.4.2 - 2023-05-23
222
223### Added
224
225- Added `remaining` property to `ProductGroup`, which lists the number of
226 `Product`'s not included in the group due to Elevate server settings.
227- Added `unit` property to `RangeFacet`, which is a property that will exist
228 on `'MEASUREMENT'` type facets.
229
230
231## 2.4.1 - 2023-05-11
232
233### Changed
234
235- Corrected `CHANGELOG.md` version and date for previous version
236
237
238## 2.4.0 - 2023-05-11
239
240### Added
241
242- Added Algorithm type `MORE_FROM_SERIES` to recommendation lists
243
244
245## 2.3.0 - 2023-05-03
246
247### Added
248
249- Added property `custom` to the `Image` type, which is a map of custom
250 values added to the image during import
251- Added property `prices` to the `Variant` type, which is a list of custom
252 prices for the Variant
253- Added property `custom` to the `Variant` type, which is a map of custom
254 attributes available on the Variant
255- Added type `'NATURAL'` as a possible facet sort order
256- Added `isCheckboxFacet` helper method
257
258### Changed
259
260- Improve JSDoc descriptions for a bunch of properites on types
261
262
263## 2.2.1 - 2023-03-30
264
265### Added
266
267- Add properties `name` and `series` to the `Product` type
268- Add `'NAME'` as a possible sort order for product lists
269
270
271## 2.2.0 - 2023-03-27
272
273### Added
274
275- Added property `recentlyViewed` to the `Autocomplete` body response
276- New notification method `.removeRecentlyViewed()`, that can remove
277 individual or all products from the list of recently viewed products
278- Added missing property `height` to `ImageSource`
279- `iconPath` has been added to nodes in navigation tree.
280
281
282## 2.1.0 - 2023-02-01
283
284### Added
285
286- Added property `label` to the `Variant` interface
287
288
289## 2.0.2 - 2023-01-16
290
291### Added
292
293- Added newly released functionality to add `customData` to `LandingPage`.
294 `LandingPage.customData` is a key-value map of string values, where an
295 integrator can add additional data to a Page.
296
297
298## 2.0.1 - 2022-10-25
299
300### Changed
301
302- Made the validation on the `clusterId` initialization property less strict
303
304
305## 2.0.0 - 2022-10-21
306
307This release is migrating from the eSales v2 API, to eSales Storefront v3 API.
308In the new version of the API, it is now required to provide `locale` in
309addition to market, to support multi-lingual markets. The remaining breaking
310changes are mostly doing some cleanup of the API that _should not_ affect
311any Apptus eSales customers using this library.
312
313### Added
314
315- (BREAKING) Added a required `locale` configuration option, which is required
316 by eSales Storefront API v3.
317- Added a `esales(...).clusterUrl` string property, which is the base URL to
318 to eSales cluster
319
320### Changed
321
322- (BREAKING) `webApiId` and `webApiUrl` has been replaced by `clusterId`,
323 to better match terminology in eSales documentation.
324
325 The `clusterId` property supports using both ID and URL to the
326 eSales cluster. When using a URL, no path should be specified,
327 only the base origin to the server.
328
329 ```ts
330 // Before
331 const api = esales({ webApiId: 'w00000000' });
332 const api2 = esales({ webApiUrl: 'https://w00000000.api.esales.apptus.cloud/api/v2/' });
333
334 // After
335 const api = esales({ clusterId: 'w00000000' });
336 const api2 = esales({ clusterId: 'https://w00000000.api.esales.apptus.cloud/' });
337 ```
338- (BREAKING) Renamed the parameter `pageId` to `pageReference` for the
339 `query.landingPage()` request. This change matches the
340 [change in the Storefront API](https://docs.apptus.com/elevate/4/integration/api/specifications/storefront/v3/#changes).
341- Changed to use Storefront v3 API, instead of API v2.
342
343### Removed
344
345- (BREAKING) Submodule `@apptus/esales-api/mock` removed, which provided methods
346 for creating mock objects matching response data from varios endpoints. The
347 only use case for this submodule was in testing, but was likely not too helpful
348 enough to warrant including this code.
349- (BREAKING) Removes the method `esales(...).query.settings()` for a
350 private/undocumented `/settings` endpoint.
351
352
353## 1.15.0 - 2022-08-24
354
355### Added
356
357- Added support for recent searches handled by eSales, by utilizing `customerKey`:
358 - Added `Autocomplete.recentSearches` property, which is a list of recent searches
359 - Added `api.notify.removeRecentSearches()` method, which can be used to
360 clear individual or all stored recent searches
361 - Added search origin `RECENT_SEARCH` (query param `?origin=RECENT_SEARCH`
362 can be added to search page requests)
363
364
365## 1.14.0 - 2022-08-10
366
367- This version has been unpublished. The changes intended in this version was
368 released in v1.15.0.
369
370
371## 1.13.0 - 2022-05-16
372
373### Added
374
375- Support for types related to Query Relaxation for `api.query.searchPage()`:
376 - Added `boolean` parameter `viewAllSecondary`
377 - Added `secondaryList` and `relatedSearches` to returned interface
378 - Added `RELATED_SEARCHES` as possible value for the `origin` parameter
379- Added Store Availability to the `Variant` interface for returned Products (`Variant.availability`)
380
381
382## 1.12.0 - 2022-05-03
383
384### Added
385
386- Added support for `productRules` for primary and recommendation lists
387 - Property `productRules`added to the `RecommendationListConfiguration` interface
388 - Property `productRules` added to `primaryList` in the `PageBodyConfiguration` interface
389
390
391## 1.11.1 - 2022-04-26
392
393### Changed
394
395- Corrected a few JSDoc `@example`'s code to correct usage
396
397
398## 1.11.0 - 2022-03-10
399
400### Added
401
402- A new parameter has been added to query endpoints; `presentCustom`. Using this parameter
403 it's possible to configure which custom attributes will be available on products
404 in product listings. This parameter is available for the following endpoints:
405 - `autocomplete`
406 - `cartPage`
407 - `landingPage`
408 - `productPage`
409 - `searchPage`
410
411
412## 1.10.0 - 2022-02-04
413
414### Added
415
416- A new property `count` has been added to the `'CHECKBOX'` facet type.
417 At this moment, this will only affect the `onlyInStock` facet, where it's
418 now possible to preview the number of products that match when `onlyInStock` would be selected.
419
420
421## 1.9.0 - 2022-01-28
422
423### Added
424
425- Now allows `boolean` as a value for facets, compatible with for instance `onlyInStock`.
426
427
428## 1.8.1 - 2022-01-21
429
430### Changed
431
432- The `RecommendationListConfiguration.algorithm` was incorrectly using a global
433 Typescript interface instead of our own type, and has been corrected to the correct
434 type.
435
436
437## 1.8.0 - 2022-01-20
438
439### Added
440
441- Properties `algorithm` and `visible` to the `RecommendationList` interface
442- Property `productFilter` to the `RecommendationListConfiguration` interface
443
444### Changed
445
446- Made `limit`, `algorithm` & `visaulization` optional on the `RecommendationListConfiguration` interface
447- Renamed `requestParams` to `params` on the `RecommendationListConfiguration` interface.
448 This is technically not a breaking change, since the `requestParams` was simply ignored by the API.
449
450
451## 1.7.0 - 2022-01-18
452
453### Added
454
455- Added parameters `channels` and `stores` to all queries. For more information, [read further on this topic in Apptus docs](https://docs.apptus.com/esales-4/integration/api/common/query-parameters/?h=channel#optional-parameters).
456
457
458## 1.6.0 - 2021-11-10
459
460### Changed
461
462- It is now possible for the server to respond with a price facet included, but where it's `min`/`max` fields are `undefined`. This can happen if there are no products included in the current selection. The types for returned objects now reflect this fact.
463
464
465## 1.5.1 - 2021-10-20
466
467### Added
468
469- Include `CHANGELOG.md` in the npm package
470
471
472## 1.5.0 - 2021-10-20
473
474### Added
475
476- Add type support for `contentLists` to `autocomplete()`, `landingPage()` and `searchPage()` (body and return value)
477- Added `api.query.contentInformation()` method
478- Added `api.query.contentSearchPage()` method
479- Add `number` and `number[]` as allowed values to the Typescript interface for `ProductFilter` ([see docs example](https://docs.apptus.com/esales-4/integration/api/http-api/queries/common/page-configuration/#numeric-product-filters))
480
481### Changed
482
483- Made `RecommendationList.label` optional. It's possible for API to no return this property
484 if the app overrides the POST request with an empty label.
485
486
487## 1.4.0 - 2021-06-30
488
489### Added
490
491- Added the `notify.end()` method for notifying that a session has ended
492- Added the `notify.payment()` method for notifying client-side payments
493 (client-side payments must be enabled on the cluster)
494
495
496## 1.3.0 - 2021-05-12
497
498### Docs
499
500- Updated some property documentation for landing pages
501
502
503## 1.2.1 - 2021-04-29
504
505### Fixed
506
507- Correct the `/add-to-cart` notification endpoint
508
509
510## 1.2.0 - 2021-03-01
511
512Internal changes.
513
514
515## 1.1.1 - 2021-02-11
516
517### Added
518
519- Add missing properties to `NavigationNode`
520
521
522## 1.1.0 - 2021-02-11
523
524### Added
525
526- Added `'STYLE_WITH'` as possible `Algorithm` value
527
528### Changed
529
530- Updated `NavigationNode` with the `'SPACER'` type
531
532
533## 1.0.2 - 2021-01-25
534
535### Added
536
537- Added `stockNumber` property to `Variant` interface
538- Added `alt` and `caption` properties to `Image` interface
539
540
541## 1.0.1 - 2020-11-06
542
543### Docs
544- Minor updates to `README.md` spelling
545- Added keywords to `package.json`
546
547
548## 1.0.0 - 2020-11-05
549
550### Changed
551- The `exports` field of `package.json` has been updated to better match intended usage
552
553### Docs
554- Restructured the `README.md` into new sections
555- Added more information on how to build a project with this library
556- Added missing `window.fetch` and `window.URL` to the list of possible required polyfills
557
\No newline at end of file