You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,11 @@
1
1
## CHANGELOG
2
2
3
+
3
4
## v4.2.0 - future release
5
+
6
+
### Enchancements
4
7
- Allow custom params for 'loginGuestUser' and custom body for 'loginRegisteredUserB2C' function [#415](https://github.com/SalesforceCommerceCloud/commerce-sdk/pull/415)
8
+
- Add helper to encode special SCAPI characters [#416](https://github.com/SalesforceCommerceCloud/commerce-sdk/pull/416)
Copy file name to clipboardExpand all lines: README.md
+67Lines changed: 67 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,12 @@ Please be aware that existing tenants are on a temporary allow list and will see
18
18
19
19
In practice, we recommend that customers using the SLAS helper functions upgrade to `v4.0.0` of the `commerce-sdk`.
20
20
21
+
## :warning: Planned SDK Changes :warning:
22
+
23
+
### Encoding path parameters
24
+
25
+
In the next major version release, the SDK will encode special characters (UTF-8 based on SCAPI guidelines) in path parameters by default. Please see the [Encoding special characters](#encoding-special-characters) section for more details.
26
+
21
27
## Prerequisites
22
28
23
29
Download and install Node.js and npm [here](https://nodejs.org/en/download/).
The SDK currently single encodes special characters for query parameters in UTF-8 format based on SCAPI guidelines. However, the SDK does NOT encode path parameters, and will require the developer to encode any path parameters with special characters.
331
+
332
+
Additionally, SCAPI has special characters that should be double encoded, specifically `%` and `,`:
333
+
-`%` should always be double encoded
334
+
-`,` should be double encoded when used as part of an ID/parameter string, and single encoded when used to differentiate items in a list
335
+
336
+
There is a helper function called `encodeSCAPISpecialCharacters` that can be utilized to single encode the SCAPI special characters and no other special characters.
337
+
338
+
Here's an example where the `getCategory/getCategories` endpoints are called with a `categoryID` with special characters:
**NOTE: In the next major version release, path parameters will be single encoded by default**
388
+
322
389
## Caching
323
390
324
391
The SDK currently supports two types of caches - In-memory and Redis. Both the implementations respect [standard cache headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control). To use another type of cache, write your own implementation of the [CacheManager](https://github.com/SalesforceCommerceCloud/commerce-sdk-core/tree/main/src/base/cacheManager.ts). See the [default cache manager](https://github.com/SalesforceCommerceCloud/commerce-sdk-core/tree/main/src/base/cacheManagerKeyv.ts) to design your implementation.
0 commit comments