@shopware/api-gen 1.0.4 → 1.1.0
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 +40 -6
- package/dist/cli.mjs +6379 -4962
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -5,6 +5,8 @@ Generate TypeScript schemas from Shopware OpenAPI specification.
|
|
|
5
5
|
|
|
6
6
|
After generating schemas, you can use them in fully typed [API Client](https://www.npmjs.com/package/@shopware/api-client).
|
|
7
7
|
|
|
8
|
+
To take a deep dive into the topic visit the [🧑🎓 API Client Tutorial](https://api-client-tutorial-composable-frontends.pages.dev) first.
|
|
9
|
+
|
|
8
10
|
## Usage
|
|
9
11
|
|
|
10
12
|
<!-- automd:pm-install name="@shopware/api-gen" dev -->
|
|
@@ -41,7 +43,7 @@ If your instance contains inacurate or outdated OpenAPI specification, you can o
|
|
|
41
43
|
|
|
42
44
|
Example of overrides file:
|
|
43
45
|
|
|
44
|
-
<!-- automd:file src="
|
|
46
|
+
<!-- automd:file src="packages/api-gen/tests/snapshots-override/simpleOverride.example.ts" code -->
|
|
45
47
|
|
|
46
48
|
```ts [simpleOverride.example.ts]
|
|
47
49
|
import { components as mainComponents } from "./storeApiTypes";
|
|
@@ -227,19 +229,51 @@ Prepare your config file named **api-gen.config.json**:
|
|
|
227
229
|
}
|
|
228
230
|
```
|
|
229
231
|
|
|
232
|
+
## Links
|
|
233
|
+
|
|
234
|
+
- [🧑🎓 Tutorial](https://api-client-tutorial-composable-frontends.pages.dev)
|
|
235
|
+
|
|
236
|
+
- [📘 Documentation](https://frontends.shopware.com)
|
|
237
|
+
|
|
238
|
+
- [👥 Community Slack](https://shopwarecommunity.slack.com) (`#composable-frontends` channel)
|
|
239
|
+
|
|
230
240
|
<!-- AUTO GENERATED CHANGELOG -->
|
|
231
241
|
|
|
232
242
|
## Changelog
|
|
233
243
|
|
|
234
244
|
Full changelog for stable version is available [here](https://github.com/shopware/frontends/blob/main/packages/api-gen/CHANGELOG.md)
|
|
235
245
|
|
|
236
|
-
### Latest changes: 1.0
|
|
246
|
+
### Latest changes: 1.1.0
|
|
247
|
+
|
|
248
|
+
### Minor Changes
|
|
249
|
+
|
|
250
|
+
- [#1405](https://github.com/shopware/frontends/pull/1405) [`f9fb243`](https://github.com/shopware/frontends/commit/f9fb243d56d05a66ca4efd277c137e2ae8967f7b) Thanks [@patzick](https://github.com/patzick)! - Updated openapi-typescript to v7. Additional checks for better generation
|
|
251
|
+
|
|
252
|
+
- [#1365](https://github.com/shopware/frontends/pull/1365) [`6abe9ab`](https://github.com/shopware/frontends/commit/6abe9abb64b9d2fe94d565393b1c08ec68b58162) Thanks [@patzick](https://github.com/patzick)! - `validateJson` command now checks endpoints exposed by the API to show if there are any endpoints missing in the schema or the schema contains some endpoints definitions, which are not exposed by the backend instance
|
|
253
|
+
|
|
254
|
+
tun it in the console like this:
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
shopware-api-gen validateJson --apiType=store
|
|
258
|
+
|
|
259
|
+
shopware-api-gen validateJson --apiType=admin
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
You need to have the same .env variables as needed for `loadSchema` command as the CLI is checking endpoints against the running instance.
|
|
237
263
|
|
|
238
264
|
### Patch Changes
|
|
239
265
|
|
|
240
|
-
- [#
|
|
266
|
+
- [#1364](https://github.com/shopware/frontends/pull/1364) [`221af3c`](https://github.com/shopware/frontends/commit/221af3c5f56253239f9e7f2a45d71a0220c26cde) Thanks [@patzick](https://github.com/patzick)! - Fix patching schema when there is an oveerite with the `_DELETE` key, and the value was not present in the original schema. In that case there is nothing to delete and value should be omitted.
|
|
267
|
+
|
|
268
|
+
- [#1304](https://github.com/shopware/frontends/pull/1304) [`183eee9`](https://github.com/shopware/frontends/commit/183eee90e855269251f32145711c9b284b0f2aa4) Thanks [@mkucmus](https://github.com/mkucmus)! - Fix import [pitfall](https://github.com/dotenv-org/examples/blob/master/usage/dotenv-es6-import-pitfall/invalid.mjs).
|
|
269
|
+
|
|
270
|
+
- [#1330](https://github.com/shopware/frontends/pull/1330) [`2fdb986`](https://github.com/shopware/frontends/commit/2fdb9861a2ed2b89e28bec170c3a080d470d6210) Thanks [@mkucmus](https://github.com/mkucmus)! - Avoid schema loading when internal value `_DELETE_` is used for `$ref` key.
|
|
271
|
+
|
|
272
|
+
**parse** function of `json5` library tries to load a `$ref` by loading a file under the reference value, and that's why
|
|
273
|
+
|
|
274
|
+
> _ENOENT: no such file or directory, open '{cwd}/\_DELETE_'\_
|
|
241
275
|
|
|
242
|
-
|
|
276
|
+
error was being thrown when there was no `_DELETE_` schema available locally (in the same json schema).
|
|
243
277
|
|
|
244
|
-
- Updated dependencies [[`
|
|
245
|
-
- @shopware/api-client@1.0
|
|
278
|
+
- Updated dependencies [[`6abe9ab`](https://github.com/shopware/frontends/commit/6abe9abb64b9d2fe94d565393b1c08ec68b58162), [`0643174`](https://github.com/shopware/frontends/commit/06431743162c088d46cf1e6305332bd51542eec4), [`266bb32`](https://github.com/shopware/frontends/commit/266bb32e119d7e1b3df7e082fb0fe4b0a475af44), [`f9fb243`](https://github.com/shopware/frontends/commit/f9fb243d56d05a66ca4efd277c137e2ae8967f7b), [`15bebee`](https://github.com/shopware/frontends/commit/15bebee0daefacc078ac99fea8725b95fdbc1cc7), [`ebb10eb`](https://github.com/shopware/frontends/commit/ebb10eba629b3ec2c5a4a50fa12ef0b134601d6f)]:
|
|
279
|
+
- @shopware/api-client@1.1.0
|