@shopware/api-gen 1.4.0 → 1.5.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 +16 -27
- package/dist/cli.mjs +784 -394
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.mjs +4 -4
- package/dist/shared/{api-gen.BWZPGkRz.mjs → api-gen.a71ec925.mjs} +205 -791
- package/package.json +9 -8
package/README.md
CHANGED
|
@@ -252,11 +252,22 @@ Remember to add `.env` file in order to authenticate with Shopware instance.
|
|
|
252
252
|
OPENAPI_JSON_URL="https://your-shop-instance.shopware.store"
|
|
253
253
|
## This one needed to fetch store API schema
|
|
254
254
|
OPENAPI_ACCESS_KEY="YOUR_STORE_API_ACCESS_KEY"
|
|
255
|
-
|
|
255
|
+
|
|
256
|
+
## Admin API authentication (choose one method):
|
|
257
|
+
|
|
258
|
+
## Option 1: Password grant (username/password)
|
|
256
259
|
SHOPWARE_ADMIN_USERNAME="my@username.com"
|
|
257
260
|
SHOPWARE_ADMIN_PASSWORD="my-password"
|
|
261
|
+
|
|
262
|
+
## Option 2: Client credentials grant (integration)
|
|
263
|
+
## Create an integration in Shopware Admin > Settings > System > Integrations
|
|
264
|
+
# SHOPWARE_ADMIN_CLIENT_ID="your-integration-client-id"
|
|
265
|
+
# SHOPWARE_ADMIN_CLIENT_SECRET="your-integration-secret"
|
|
258
266
|
```
|
|
259
267
|
|
|
268
|
+
> [!NOTE]
|
|
269
|
+
> When `SHOPWARE_ADMIN_CLIENT_SECRET` is set, the client credentials grant will be used automatically. Otherwise, the password grant with username/password is used.
|
|
270
|
+
|
|
260
271
|
### `validateJson`
|
|
261
272
|
|
|
262
273
|
This command allow to validate the output JSON file of your instance. You can configure which rules should be applied, we provide you with the schema configuration file, so you can easily modify it.
|
|
@@ -390,35 +401,13 @@ await split({
|
|
|
390
401
|
|
|
391
402
|
Full changelog for stable version is available [here](https://github.com/shopware/frontends/blob/main/packages/api-gen/CHANGELOG.md)
|
|
392
403
|
|
|
393
|
-
### Latest changes: 1.
|
|
404
|
+
### Latest changes: 1.5.0
|
|
394
405
|
|
|
395
406
|
### Minor Changes
|
|
396
407
|
|
|
397
|
-
- [#
|
|
398
|
-
|
|
399
|
-
Example:
|
|
400
|
-
|
|
401
|
-
```json
|
|
402
|
-
{
|
|
403
|
-
"$schema": "./node_modules/@shopware/api-gen/api-gen.schema.json",
|
|
404
|
-
"store-api": {
|
|
405
|
-
"patches": ["storeApiSchema.overrides.json"],
|
|
406
|
-
"rules": ["COMPONENTS_API_ALIAS"]
|
|
407
|
-
},
|
|
408
|
-
"admin-api": {
|
|
409
|
-
"patches": ["adminApiSchema.overrides.json"]
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
```
|
|
413
|
-
|
|
414
|
-
- [#2126](https://github.com/shopware/frontends/pull/2126) [`e595bc1`](https://github.com/shopware/frontends/commit/e595bc1ea6afe01a0065300277a78ef8c1fe5667) Thanks [@mdanilowicz](https://github.com/mdanilowicz)! - Enhanced OpenAPI schema override merging to properly handle conflicts between `$ref` and composition keywords (`oneOf`, `anyOf`, `allOf`, `not`). When merging overrides:
|
|
415
|
-
- Composition keywords now automatically remove conflicting `$ref` properties
|
|
416
|
-
- `$ref` overrides can replace composition keywords entirely
|
|
417
|
-
- Different composition keywords can replace each other (e.g., `allOf` → `oneOf`)
|
|
418
|
-
|
|
419
|
-
This ensures correct schema merging when using composition keywords in override files, preventing invalid OpenAPI schemas with conflicting `$ref` and composition keyword properties.
|
|
408
|
+
- [#2262](https://github.com/shopware/frontends/pull/2262) [`7a20ea0`](https://github.com/shopware/frontends/commit/7a20ea0454ee237c772e532a03408477e968a958) Thanks [@mkucmus](https://github.com/mkucmus)! - Added support for `client_credentials` grant type authentication when loading Admin API schema. Set `SHOPWARE_ADMIN_CLIENT_SECRET` and `SHOPWARE_ADMIN_CLIENT_ID`environment variables to use integration credentials instead of username/password.
|
|
420
409
|
|
|
421
410
|
### Patch Changes
|
|
422
411
|
|
|
423
|
-
- Updated dependencies [[`
|
|
424
|
-
- @shopware/api-client@1.
|
|
412
|
+
- Updated dependencies [[`9604f22`](https://github.com/shopware/frontends/commit/9604f22678150d04c3c3156fd8ee2ce440c8c8bf), [`b5f7e2a`](https://github.com/shopware/frontends/commit/b5f7e2a20c9dfdde1690e9006252d847f732bc0a), [`9604f22`](https://github.com/shopware/frontends/commit/9604f22678150d04c3c3156fd8ee2ce440c8c8bf)]:
|
|
413
|
+
- @shopware/api-client@1.5.0
|