@openapi-qraft/cli 2.0.0-next.0 → 2.0.0-next.10
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/CHANGELOG.md +129 -0
- package/README.md +1 -3
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,134 @@
|
|
|
1
1
|
# @openapi-qraft/cli
|
|
2
2
|
|
|
3
|
+
## 2.0.0-next.10
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 8c77eb2: Generate comprehensive operation names with consideration of the `--service-name-base` option. Operation names now
|
|
8
|
+
include all path parts and parameters, and the structure can be customized based on the `--service-name-base` value.
|
|
9
|
+
|
|
10
|
+
**Breaking Changes:**
|
|
11
|
+
|
|
12
|
+
- Operation names now include all path parts and parameters by default.
|
|
13
|
+
- `/api/v{api-version}` is no longer automatically removed from the path when generating operation names.
|
|
14
|
+
- The `--service-name-base` option now influences the generated operation names with a new structure.
|
|
15
|
+
|
|
16
|
+
**Examples:**
|
|
17
|
+
|
|
18
|
+
- With `--service-name-base=endpoint[0]`:
|
|
19
|
+
`POST /v1/users/{id}` → `api.v1.postUsersId`
|
|
20
|
+
- With `--service-name-base=endpoint[1]`:
|
|
21
|
+
`GET /v1/users/{id}` → `api.users.getId`
|
|
22
|
+
- With `--service-name-base=endpoint[1]`:
|
|
23
|
+
`POST /v1/users/suspend` → `api.users.postSuspend`
|
|
24
|
+
- With `--service-name-base=endpoint[1]`:
|
|
25
|
+
`POST /v1/users/{id}/{key}` → `api.postIdKey`
|
|
26
|
+
- With `--service-name-base=tags`:
|
|
27
|
+
`POST /v1/users/{id}/{key}` → `api.<tag>.postV1UsersIdKey`
|
|
28
|
+
|
|
29
|
+
This change provides more flexibility in operation name generation and allows for better customization based on project
|
|
30
|
+
requirements.
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies [8c77eb2]
|
|
35
|
+
- @openapi-qraft/plugin@2.0.0-next.10
|
|
36
|
+
- @openapi-qraft/openapi-typescript-plugin@1.2.0-next.10
|
|
37
|
+
- @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.10
|
|
38
|
+
|
|
39
|
+
## 2.0.0-next.9
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- Updated dependencies [4ef9ce0]
|
|
44
|
+
- Updated dependencies [9dc1918]
|
|
45
|
+
- Updated dependencies [78638a5]
|
|
46
|
+
- @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.9
|
|
47
|
+
- @openapi-qraft/openapi-typescript-plugin@1.2.0-next.9
|
|
48
|
+
- @openapi-qraft/plugin@2.0.0-next.9
|
|
49
|
+
|
|
50
|
+
## 2.0.0-next.8
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- Updated dependencies [5b64278]
|
|
55
|
+
- @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.8
|
|
56
|
+
- @openapi-qraft/plugin@2.0.0-next.8
|
|
57
|
+
- @openapi-qraft/openapi-typescript-plugin@1.2.0-next.8
|
|
58
|
+
|
|
59
|
+
## 2.0.0-next.7
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
62
|
+
|
|
63
|
+
- @openapi-qraft/plugin@2.0.0-next.7
|
|
64
|
+
- @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.7
|
|
65
|
+
- @openapi-qraft/openapi-typescript-plugin@1.2.0-next.7
|
|
66
|
+
|
|
67
|
+
## 2.0.0-next.6
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- Updated dependencies [fc6b4e7]
|
|
72
|
+
- @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.6
|
|
73
|
+
- @openapi-qraft/plugin@2.0.0-next.6
|
|
74
|
+
- @openapi-qraft/openapi-typescript-plugin@1.2.0-next.6
|
|
75
|
+
|
|
76
|
+
## 2.0.0-next.5
|
|
77
|
+
|
|
78
|
+
### Patch Changes
|
|
79
|
+
|
|
80
|
+
- Updated dependencies [56687f3]
|
|
81
|
+
- @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.5
|
|
82
|
+
- @openapi-qraft/plugin@2.0.0-next.5
|
|
83
|
+
- @openapi-qraft/openapi-typescript-plugin@1.2.0-next.5
|
|
84
|
+
|
|
85
|
+
## 2.0.0-next.4
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- Updated dependencies [cd8a856]
|
|
90
|
+
- @openapi-qraft/openapi-typescript-plugin@1.2.0-next.4
|
|
91
|
+
- @openapi-qraft/plugin@2.0.0-next.4
|
|
92
|
+
- @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.4
|
|
93
|
+
|
|
94
|
+
## 2.0.0-next.3
|
|
95
|
+
|
|
96
|
+
### Patch Changes
|
|
97
|
+
|
|
98
|
+
- Updated dependencies [7e51026]
|
|
99
|
+
- @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.3
|
|
100
|
+
- @openapi-qraft/plugin@2.0.0-next.3
|
|
101
|
+
- @openapi-qraft/openapi-typescript-plugin@1.2.0-next.3
|
|
102
|
+
|
|
103
|
+
## 2.0.0-next.2
|
|
104
|
+
|
|
105
|
+
### Patch Changes
|
|
106
|
+
|
|
107
|
+
- @openapi-qraft/plugin@2.0.0-next.2
|
|
108
|
+
- @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.2
|
|
109
|
+
- @openapi-qraft/openapi-typescript-plugin@1.2.0-next.2
|
|
110
|
+
|
|
111
|
+
## 2.0.0-next.1
|
|
112
|
+
|
|
113
|
+
### Minor Changes
|
|
114
|
+
|
|
115
|
+
- 2a53608: Updated TypeScript to version 5.5.4
|
|
116
|
+
- 76634bf: ### Changeset: `createPredefinedParametersRequestFn`
|
|
117
|
+
|
|
118
|
+
Introduced `createPredefinedParametersRequestFn`, generated by the `@openapi-qraft/cli` using
|
|
119
|
+
the `--operation-predefined-parameters` option.
|
|
120
|
+
This function allows for the automatic application of predefined
|
|
121
|
+
parameters to selected API operations by wrapping the base `requestFn`. It simplifies managing parameters, reducing
|
|
122
|
+
boilerplate code, and supports both static and dynamic values, enhancing flexibility in API request handling.
|
|
123
|
+
|
|
124
|
+
### Patch Changes
|
|
125
|
+
|
|
126
|
+
- Updated dependencies [2a53608]
|
|
127
|
+
- Updated dependencies [76634bf]
|
|
128
|
+
- @openapi-qraft/tanstack-query-react-plugin@2.0.0-next.1
|
|
129
|
+
- @openapi-qraft/openapi-typescript-plugin@1.2.0-next.1
|
|
130
|
+
- @openapi-qraft/plugin@2.0.0-next.1
|
|
131
|
+
|
|
3
132
|
## 2.0.0-next.0
|
|
4
133
|
|
|
5
134
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ within React applications.
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npm install -g @openapi-qraft/cli
|
|
16
|
+
npm install -g @openapi-qraft/cli@next
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
@@ -112,8 +112,6 @@ npx openapi-qraft --plugin tanstack-query-react --plugin openapi-typescript http
|
|
|
112
112
|
- `--operation-predefined-parameters '/**:header.x-monite-version'` - set `header.x-monite-version`
|
|
113
113
|
as optional parameters for all services.
|
|
114
114
|
- `--operation-predefined-parameters '/**,!/auth/token:header.x-entity-id'` - set `header.x-entity-id` as optional parameters for all services except `/auth/token`.
|
|
115
|
-
- `--operation-predefined-parameters '/**:header.x-monite-version,query.x-api-key' '/user/**,/post/**:header.x-monite-entity-id'` -
|
|
116
|
-
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.
|
|
117
115
|
- `--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.
|
|
118
116
|
|
|
119
117
|
> **Note:** In future versions of the library, this feature will be expanded. Not only will it make parameters
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openapi-qraft/cli",
|
|
3
|
-
"version": "2.0.0-next.
|
|
4
|
-
"description": "CLI for generating typed
|
|
3
|
+
"version": "2.0.0-next.10",
|
|
4
|
+
"description": "CLI for generating typed TanStack Query React Hooks and services from OpenAPI Document, improving type safety in React apps",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc --project tsconfig.build.json",
|
|
7
7
|
"dev": "yarn build --watch --noEmitOnError false",
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
"openapi-qraft": "./bin.mjs"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@openapi-qraft/openapi-typescript-plugin": "1.
|
|
19
|
-
"@openapi-qraft/plugin": "2.0.0-next.
|
|
20
|
-
"@openapi-qraft/tanstack-query-react-plugin": "2.0.0-next.
|
|
18
|
+
"@openapi-qraft/openapi-typescript-plugin": "1.2.0-next.10",
|
|
19
|
+
"@openapi-qraft/plugin": "2.0.0-next.10",
|
|
20
|
+
"@openapi-qraft/tanstack-query-react-plugin": "2.0.0-next.10",
|
|
21
21
|
"commander": "^11.1.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@openapi-qraft/eslint-config": "1.0.0",
|
|
25
|
-
"@types/node": "^
|
|
26
|
-
"eslint": "^9.
|
|
27
|
-
"globals": "^15.
|
|
25
|
+
"@types/node": "^20.16.5",
|
|
26
|
+
"eslint": "^9.10.0",
|
|
27
|
+
"globals": "^15.9.0",
|
|
28
28
|
"rimraf": "^5.0.10",
|
|
29
|
-
"typescript": "^5.
|
|
30
|
-
"vitest": "^1.
|
|
29
|
+
"typescript": "^5.6.2",
|
|
30
|
+
"vitest": "^1.6.0"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
33
|
"dist",
|