@shopware/api-client 1.0.0 → 1.0.2
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 +3 -64
- package/api-types/adminApiSchema.overrides.json +4 -0
- package/api-types/adminApiTypes.d.ts +581 -581
- package/api-types/storeApiSchema.overrides.json +137 -0
- package/api-types/storeApiTypes.d.ts +615 -629
- package/api-types/storeApiTypes.overrides.ts +0 -19
- package/dist/index.d.cts +1210 -1210
- package/dist/index.d.mts +1210 -1210
- package/dist/index.d.ts +1210 -1210
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -263,71 +263,10 @@ try {
|
|
|
263
263
|
|
|
264
264
|
Full changelog for stable version is available [here](https://github.com/shopware/frontends/blob/main/packages/api-client/CHANGELOG.md)
|
|
265
265
|
|
|
266
|
-
### Latest changes: 1.0.
|
|
267
|
-
|
|
268
|
-
### Major Changes
|
|
269
|
-
|
|
270
|
-
- [#871](https://github.com/shopware/frontends/pull/871) [`1566f7a`](https://github.com/shopware/frontends/commit/1566f7a3962c511b5c72e12a4a5db40c4aa5d198) Thanks [@patzick](https://github.com/patzick)! - Read more about new major release: https://github.com/shopware/frontends/discussions/965
|
|
271
|
-
|
|
272
|
-
- [#1056](https://github.com/shopware/frontends/pull/1056) [`c729e70`](https://github.com/shopware/frontends/commit/c729e7014c70d7f71edf5297104065d18e482e04) Thanks [@patzick](https://github.com/patzick)! - Removed deprecations from the code:
|
|
273
|
-
|
|
274
|
-
- `onContextChanged` function inside `createAPIClient` method. Use `apiClient.hook("onContextChanged", ...)` instead.
|
|
275
|
-
- `apiType` flag from the `createAPIClient`. Use separate methods to create store and admin api clients
|
|
276
|
-
- `onAuthChange` from the `createAdminAPIClient`. Use `adminApiClient.hook('onAuthChange',...)` instead
|
|
277
|
-
|
|
278
|
-
### Minor Changes
|
|
279
|
-
|
|
280
|
-
- [#1039](https://github.com/shopware/frontends/pull/1039) [`2343012`](https://github.com/shopware/frontends/commit/2343012ad552b06557e6715055b3abc534fa2fae) Thanks [@patzick](https://github.com/patzick)! - We're exposing `fetchOptions` inside params of `invoke` method. You can now use `ofetch` features like `timeout` or `signal` with AbortController
|
|
281
|
-
|
|
282
|
-
Example for the AbortController:
|
|
283
|
-
|
|
284
|
-
```ts
|
|
285
|
-
const controller = new AbortController();
|
|
286
|
-
|
|
287
|
-
const request = client.invoke("readContext get /context", {
|
|
288
|
-
fetchOptions: {
|
|
289
|
-
signal: controller.signal,
|
|
290
|
-
},
|
|
291
|
-
});
|
|
292
|
-
|
|
293
|
-
controller.abort(); // At this point client will throw an error with the information, that the request has been cancelled
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
- [#560](https://github.com/shopware/frontends/pull/560) [`9643e56`](https://github.com/shopware/frontends/commit/9643e56dafba9282b75c12c96b2afb3a4738f86e) Thanks [@patzick](https://github.com/patzick)! - [createAdminAPIClient] ability to pass optional field `credentials` to be used as authentication method before invoking any Admin API endpoint.
|
|
297
|
-
|
|
298
|
-
- [#639](https://github.com/shopware/frontends/pull/639) [`d60d062`](https://github.com/shopware/frontends/commit/d60d0620c7114a2f26bb2faf24241e2cbabc8798) Thanks [@patzick](https://github.com/patzick)! - Management of defaultHeaders. You can now set them on apiClient init or runtime.
|
|
299
|
-
|
|
300
|
-
```ts
|
|
301
|
-
const apiClient = createApiClient({
|
|
302
|
-
...,
|
|
303
|
-
defaultHeaders: {
|
|
304
|
-
'sw-language-id': 'my-id',
|
|
305
|
-
},
|
|
306
|
-
});
|
|
307
|
-
|
|
308
|
-
console.log('Debug default headers:', apiClient.defaultHeaders);
|
|
309
|
-
|
|
310
|
-
// Change header runtime
|
|
311
|
-
apiClient.defaultHeaders['sw-language-id'] = 'my-new-id';
|
|
312
|
-
|
|
313
|
-
// Remove header runtime
|
|
314
|
-
apiClient.defaultHeaders['sw-language-id'] = "";
|
|
315
|
-
|
|
316
|
-
// Change multiple headers runtime
|
|
317
|
-
apiClient.defaultHeaders.apply({
|
|
318
|
-
'sw-language-id': 'another-id',
|
|
319
|
-
'sw-currency-id': 'currency-id',
|
|
320
|
-
})
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
- [#857](https://github.com/shopware/frontends/pull/857) [`864616f`](https://github.com/shopware/frontends/commit/864616f0c9e1cbe11e434b9a04a35ff9520bcb3c) Thanks [@mdanilowicz](https://github.com/mdanilowicz)! - Add error and success callbacks
|
|
266
|
+
### Latest changes: 1.0.2
|
|
324
267
|
|
|
325
268
|
### Patch Changes
|
|
326
269
|
|
|
327
|
-
- [#
|
|
328
|
-
|
|
329
|
-
- [#567](https://github.com/shopware/frontends/pull/567) [`1583a7a`](https://github.com/shopware/frontends/commit/1583a7ae0d68b72fb362b625e1634e03bad68110) Thanks [@patzick](https://github.com/patzick)! - Export default API types to be compatible with the `bundler` mode resolution in `tsconfig`
|
|
330
|
-
|
|
331
|
-
- [#557](https://github.com/shopware/frontends/pull/557) [`97d2859`](https://github.com/shopware/frontends/commit/97d2859e4dcbdc563200f2f64d1a20880b675d87) Thanks [@patzick](https://github.com/patzick)! - Added `Accept: application/json` default header to get only JSON responses.
|
|
270
|
+
- [#1089](https://github.com/shopware/frontends/pull/1089) [`db7c93f`](https://github.com/shopware/frontends/commit/db7c93ff8cbb581221c11a492e77068af8faa8d6) Thanks [@mkucmus](https://github.com/mkucmus)! - Migrate eslint config to flat format
|
|
332
271
|
|
|
333
|
-
- [`
|
|
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
|