@openapi-qraft/cli 1.13.0 → 1.14.0-beta.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +12 -3
  3. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @openapi-qraft/cli
2
2
 
3
+ ## 1.14.0-beta.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [77f0812]
8
+ - Updated dependencies [49dc44f]
9
+ - Updated dependencies [787f568]
10
+ - @openapi-qraft/plugin@1.14.0-beta.0
11
+ - @openapi-qraft/tanstack-query-react-plugin@1.14.0-beta.0
12
+ - @openapi-qraft/openapi-typescript-plugin@1.1.0-beta.0
13
+
3
14
  ## 1.13.0
4
15
 
5
16
  ### Patch Changes
package/README.md CHANGED
@@ -104,10 +104,19 @@ npx openapi-qraft --plugin tanstack-query-react --plugin openapi-typescript http
104
104
  - `--operation-predefined-parameters '/**,!/auth/token:header.x-entity-id'` - set `header.x-entity-id` as optional parameters for all services except `/auth/token`.
105
105
  - `--operation-predefined-parameters '/**:header.x-monite-version,query.x-api-key' '/user/**,/post/**:header.x-monite-entity-id'` -
106
106
  set `header.x-monite-version` and `query.x-api-key` as optional parameters for all services, and `header.x-monite-entity-id` for the `/user/**` and `/post/**` services.
107
+ - `--operation-predefined-parameters 'post,put /**:header.x-entity-id'` - set the `Header` record `x-entity-id` as an optional parameter for the `POST` and `PUT` methods.
107
108
 
108
- > **Note:** In future versions of the library, this feature will be expanded. Not only will it make parameters optional,
109
- > but it will also offer typed suggestions for these predefined parameters when creating a client. This enhancement will
110
- > further improve type safety and developer experience.
109
+ > **Note:** In future versions of the library, this feature will be expanded. Not only will it make parameters
110
+ > optional, but it will also offer typed suggestions for these predefined parameters when creating a client. This enhancement will
111
+ > further improve type safety and developer experience.
112
+
113
+ - **`--operation-name-modifier <patterns...>`:** Modifies operation names using a pattern.
114
+
115
+ - Examples:
116
+ - `--operation-name-modifier 'get /**:[A-Za-z]+Id ==> findOne'` - will change all `GET` operations with `Id` suffix to `findOne`.
117
+ - `--operation-name-modifier 'put,patch /**:[A-Za-z]+Id ==> updateOne'` - will change all `PUT` and `PATCH` operations with `Id` suffix to `updateOne`.
118
+ - `--operation-name-modifier '/posts,/files:create[a-zA-Z]+ ==> createOne'` - will change all operations under `/posts` and `/files` to `createOne` if the operation name starts with `create`.
119
+ - `--operation-name-modifier 'post /files ==> createOne' 'put /posts ==> updateOne'` - will change all `POST` operations under `/files` to `createOne` and all `PUT` operations under `/posts` to `updateOne`.
111
120
 
112
121
  - **`--service-name-base <endpoint[<index>] | tags>`:** Use OpenAPI Operation `endpoint[<index>]` path part (e.g.: `/0/1/2`) or `tags` as the base name of the service. _(optional, default: `endpoint[0]`)_.
113
122
  - Examples:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openapi-qraft/cli",
3
- "version": "1.13.0",
3
+ "version": "1.14.0-beta.0",
4
4
  "description": "CLI for generating typed Tanstack Query React Hooks and services from OpenAPI Schemas, improving type safety in React apps",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.build.json",
@@ -15,9 +15,9 @@
15
15
  "openapi-qraft": "./bin.mjs"
16
16
  },
17
17
  "dependencies": {
18
- "@openapi-qraft/openapi-typescript-plugin": "1.0.7",
19
- "@openapi-qraft/plugin": "1.13.0",
20
- "@openapi-qraft/tanstack-query-react-plugin": "1.13.0",
18
+ "@openapi-qraft/openapi-typescript-plugin": "1.1.0-beta.0",
19
+ "@openapi-qraft/plugin": "1.14.0-beta.0",
20
+ "@openapi-qraft/tanstack-query-react-plugin": "1.14.0-beta.0",
21
21
  "commander": "^11.1.0"
22
22
  },
23
23
  "devDependencies": {