@shopware/api-client 1.0.2 → 1.1.1
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.
- package/README.md +19 -5
- package/api-types/adminApiSchema.json +30084 -20576
- package/api-types/adminApiSchema.overrides.json +390 -1
- package/api-types/adminApiTypes.d.ts +21977 -15773
- package/api-types/storeApiSchema.json +7133 -3832
- package/api-types/storeApiSchema.overrides.json +14 -146
- package/api-types/storeApiTypes.d.ts +1760 -702
- package/dist/index.cjs +45 -25
- package/dist/index.d.cts +31218 -23954
- package/dist/index.d.mts +31218 -23954
- package/dist/index.d.ts +31218 -23954
- package/dist/index.mjs +45 -25
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@ You can use types generated from your custom API instance to have autocompletion
|
|
|
10
10
|
|
|
11
11
|
To generate your own types use [@shopware/api-gen](https://www.npmjs.com/package/@shopware/api-gen) CLI.
|
|
12
12
|
|
|
13
|
+
To take a deep dive into the topic visit the [🧑🎓 API Client Tutorial](https://api-client-tutorial-composable-frontends.pages.dev) first.
|
|
14
|
+
|
|
13
15
|
## Setup
|
|
14
16
|
|
|
15
17
|
Install npm package:
|
|
@@ -251,11 +253,25 @@ try {
|
|
|
251
253
|
}
|
|
252
254
|
```
|
|
253
255
|
|
|
256
|
+
### Hooks
|
|
257
|
+
|
|
258
|
+
Api client provides hooks to listen to events like context change, authentication change or default headers change. Example:
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
apiClient.hook("onDefaultHeaderChanged", (key, value) => {
|
|
262
|
+
// here we can detect that the default header has changed, either by the user or by the headers incoming from the API
|
|
263
|
+
});
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
calling `apiClient.hook` will autocomplete the list of available hooks.
|
|
267
|
+
|
|
254
268
|
## Links
|
|
255
269
|
|
|
270
|
+
- [🧑🎓 Tutorial](https://api-client-tutorial-composable-frontends.pages.dev)
|
|
271
|
+
|
|
256
272
|
- [📘 Documentation](https://frontends.shopware.com)
|
|
257
273
|
|
|
258
|
-
- [👥 Community Slack](https://shopwarecommunity.slack.com) (`#
|
|
274
|
+
- [👥 Community Slack](https://shopwarecommunity.slack.com) (`#composable-frontends` channel)
|
|
259
275
|
|
|
260
276
|
<!-- AUTO GENERATED CHANGELOG -->
|
|
261
277
|
|
|
@@ -263,10 +279,8 @@ try {
|
|
|
263
279
|
|
|
264
280
|
Full changelog for stable version is available [here](https://github.com/shopware/frontends/blob/main/packages/api-client/CHANGELOG.md)
|
|
265
281
|
|
|
266
|
-
### Latest changes: 1.
|
|
282
|
+
### Latest changes: 1.1.1
|
|
267
283
|
|
|
268
284
|
### Patch Changes
|
|
269
285
|
|
|
270
|
-
- [#
|
|
271
|
-
|
|
272
|
-
- [#1074](https://github.com/shopware/frontends/pull/1074) [`b688163`](https://github.com/shopware/frontends/commit/b68816391ee8ed1ac94a6462a2a016d708f259b4) Thanks [@mkucmus](https://github.com/mkucmus)! - Update default schemas' `translated` properties as required
|
|
286
|
+
- [#1425](https://github.com/shopware/frontends/pull/1425) [`8df7651`](https://github.com/shopware/frontends/commit/8df76511c8afca78c79fe3f009ed32d207913f86) Thanks [@quando1910](https://github.com/quando1910)! - - fix: override header value when invoke adminApiClient and storeAPiClient
|