Major Changes
-
#871
1566f7a
Thanks @patzick! - Read more about new major release: https://github.com/shopware/frontends/discussions/965 -
#1056
c729e70
Thanks @patzick! - Removed deprecations from the code:onContextChanged
function insidecreateAPIClient
method. UseapiClient.hook("onContextChanged", ...)
instead.apiType
flag from thecreateAPIClient
. Use separate methods to create store and admin api clientsonAuthChange
from thecreateAdminAPIClient
. UseadminApiClient.hook('onAuthChange',...)
instead
Minor Changes
-
#1039
2343012
Thanks @patzick! - We're exposingfetchOptions
inside params ofinvoke
method. You can now useofetch
features liketimeout
orsignal
with AbortControllerExample for the AbortController:
const controller = new AbortController(); const request = client.invoke("readContext get /context", { fetchOptions: { signal: controller.signal, }, }); controller.abort(); // At this point client will throw an error with the information, that the request has been cancelled
-
#560
9643e56
Thanks @patzick! - [createAdminAPIClient] ability to pass optional fieldcredentials
to be used as authentication method before invoking any Admin API endpoint. -
#639
d60d062
Thanks @patzick! - Management of defaultHeaders. You can now set them on apiClient init or runtime.const apiClient = createApiClient({ ..., defaultHeaders: { 'sw-language-id': 'my-id', }, }); console.log('Debug default headers:', apiClient.defaultHeaders); // Change header runtime apiClient.defaultHeaders['sw-language-id'] = 'my-new-id'; // Remove header runtime apiClient.defaultHeaders['sw-language-id'] = ""; // Change multiple headers runtime apiClient.defaultHeaders.apply({ 'sw-language-id': 'another-id', 'sw-currency-id': 'currency-id', })
-
#857
864616f
Thanks @mdanilowicz! - Add error and success callbacks
Patch Changes
-
#787
782ef4d
Thanks @mkucmus! - Adjust test snapshot for Shopware v6.6 response -
#567
1583a7a
Thanks @patzick! - Export default API types to be compatible with thebundler
mode resolution intsconfig
-
#557
97d2859
Thanks @patzick! - AddedAccept: application/json
default header to get only JSON responses.