codz-cli 0.0.0-stage → 0.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/BETA.md +91 -0
- package/LICENSE +21 -0
- package/README.md +523 -2
- package/assets/gradle-wrapper/README.txt +2 -0
- package/assets/gradle-wrapper/gradle-wrapper.jar +0 -0
- package/assets/gradle-wrapper/gradlew +251 -0
- package/assets/gradle-wrapper/gradlew.bat +94 -0
- package/bin/codz.js +33 -0
- package/dist/adapters/android.js +321 -0
- package/dist/adapters/androidSetup.js +277 -0
- package/dist/adapters/common.js +114 -0
- package/dist/adapters/dartGen.js +83 -0
- package/dist/adapters/flutter.js +291 -0
- package/dist/adapters/flutterGen.js +204 -0
- package/dist/adapters/flutterScan.js +312 -0
- package/dist/adapters/flutterSetup.js +252 -0
- package/dist/adapters/flutterStyles.js +130 -0
- package/dist/adapters/generic.js +20 -0
- package/dist/adapters/getx.js +423 -0
- package/dist/adapters/index.js +28 -0
- package/dist/adapters/ios.js +440 -0
- package/dist/adapters/kotlinGen.js +110 -0
- package/dist/adapters/models.js +116 -0
- package/dist/adapters/nextjs.js +243 -0
- package/dist/adapters/nextjsGen.js +285 -0
- package/dist/adapters/nextjsScan.js +364 -0
- package/dist/adapters/nextjsSetup.js +119 -0
- package/dist/adapters/react.js +89 -0
- package/dist/adapters/reactNative.js +109 -0
- package/dist/adapters/reactNativeSetup.js +236 -0
- package/dist/adapters/reactQuery.js +89 -0
- package/dist/adapters/reactSetup.js +150 -0
- package/dist/adapters/source.js +165 -0
- package/dist/cli.js +1175 -0
- package/dist/core/cache.js +76 -0
- package/dist/core/changeset.js +404 -0
- package/dist/core/commands.js +239 -0
- package/dist/core/config.js +45 -0
- package/dist/core/diff.js +143 -0
- package/dist/core/events.js +41 -0
- package/dist/core/fsutil.js +122 -0
- package/dist/core/git.js +36 -0
- package/dist/core/jsonEdit.js +113 -0
- package/dist/core/merge.js +159 -0
- package/dist/core/proc.js +23 -0
- package/dist/core/safe.js +75 -0
- package/dist/core/templates.js +100 -0
- package/dist/core/tsAst.js +112 -0
- package/dist/core/types.js +12 -0
- package/dist/core/validateConfig.js +172 -0
- package/dist/core/workflow.js +72 -0
- package/dist/core/workspace.js +80 -0
- package/dist/core/yaml.js +126 -0
- package/dist/core/yamlDoc.js +367 -0
- package/dist/detector.js +95 -0
- package/dist/input/apiSpec.js +395 -0
- package/dist/input/curl.js +259 -0
- package/dist/input/endpoint.js +220 -0
- package/dist/input/har.js +120 -0
- package/dist/input/infer.js +174 -0
- package/dist/input/naming.js +145 -0
- package/dist/input/paste.js +130 -0
- package/dist/skills/androidSkeleton.js +292 -0
- package/dist/skills/androidTests.js +221 -0
- package/dist/skills/androidUi.js +561 -0
- package/dist/skills/androidViews.js +536 -0
- package/dist/skills/apiAdd.js +99 -0
- package/dist/skills/apiDiff.js +271 -0
- package/dist/skills/apiEdit.js +547 -0
- package/dist/skills/apiImport.js +127 -0
- package/dist/skills/apiList.js +35 -0
- package/dist/skills/apiSync.js +221 -0
- package/dist/skills/auth.js +1304 -0
- package/dist/skills/completion.js +142 -0
- package/dist/skills/config.js +93 -0
- package/dist/skills/create.js +358 -0
- package/dist/skills/doctor.js +304 -0
- package/dist/skills/doctorFix.js +214 -0
- package/dist/skills/explain.js +61 -0
- package/dist/skills/feature.js +418 -0
- package/dist/skills/featureEdit.js +225 -0
- package/dist/skills/featureLinks.js +179 -0
- package/dist/skills/init.js +66 -0
- package/dist/skills/iosUi.js +468 -0
- package/dist/skills/locale.js +335 -0
- package/dist/skills/mcp.js +175 -0
- package/dist/skills/mock.js +482 -0
- package/dist/skills/module.js +23 -0
- package/dist/skills/plans.js +66 -0
- package/dist/skills/prefill.js +84 -0
- package/dist/skills/reactNativeUi.js +388 -0
- package/dist/skills/reactUi.js +352 -0
- package/dist/skills/report.js +75 -0
- package/dist/skills/route.js +230 -0
- package/dist/skills/screen.js +597 -0
- package/dist/skills/screenForm.js +410 -0
- package/dist/skills/setup.js +28 -0
- package/dist/skills/setupDoctor.js +226 -0
- package/dist/skills/templatesCmd.js +32 -0
- package/dist/skills/testgen.js +331 -0
- package/dist/skills/theme.js +388 -0
- package/dist/starters/auth.js +144 -0
- package/dist/starters/commands.js +283 -0
- package/dist/starters/engine.js +315 -0
- package/dist/starters/home.js +42 -0
- package/dist/starters/http.js +93 -0
- package/dist/starters/manifest.js +285 -0
- package/dist/starters/paths.js +70 -0
- package/dist/starters/publish.js +150 -0
- package/dist/starters/registry.js +258 -0
- package/dist/starters/sign.js +72 -0
- package/dist/starters/source.js +98 -0
- package/dist/starters/strictJson.js +148 -0
- package/dist/starters/tar.js +180 -0
- package/docs/COMMANDS.md +527 -0
- package/examples/openapi.yaml +319 -0
- package/package.json +57 -4
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
openapi: 3.0.3
|
|
2
|
+
info:
|
|
3
|
+
title: Shop API (codz test)
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
description: |
|
|
6
|
+
Sample API for trying codz.
|
|
7
|
+
codz api import openapi.yaml --list
|
|
8
|
+
codz feature add products --spec openapi.yaml # list, create, detail, edit
|
|
9
|
+
codz feature add orders --spec openapi.yaml # list, create, detail
|
|
10
|
+
codz auth add # uses /auth/login and /auth/me
|
|
11
|
+
servers:
|
|
12
|
+
- url: https://api.example.com/v1
|
|
13
|
+
tags:
|
|
14
|
+
- name: auth
|
|
15
|
+
- name: products
|
|
16
|
+
- name: orders
|
|
17
|
+
|
|
18
|
+
paths:
|
|
19
|
+
# ---------- Sign-in (codz auth add) ----------
|
|
20
|
+
/auth/login:
|
|
21
|
+
post:
|
|
22
|
+
operationId: login
|
|
23
|
+
tags: [auth]
|
|
24
|
+
requestBody:
|
|
25
|
+
required: true
|
|
26
|
+
content:
|
|
27
|
+
application/json:
|
|
28
|
+
schema:
|
|
29
|
+
$ref: '#/components/schemas/LoginRequest'
|
|
30
|
+
responses:
|
|
31
|
+
'200':
|
|
32
|
+
description: Signed in
|
|
33
|
+
content:
|
|
34
|
+
application/json:
|
|
35
|
+
schema:
|
|
36
|
+
$ref: '#/components/schemas/LoginResponse'
|
|
37
|
+
/auth/me:
|
|
38
|
+
get:
|
|
39
|
+
operationId: getMe
|
|
40
|
+
tags: [auth]
|
|
41
|
+
responses:
|
|
42
|
+
'200':
|
|
43
|
+
description: The signed-in user
|
|
44
|
+
content:
|
|
45
|
+
application/json:
|
|
46
|
+
schema:
|
|
47
|
+
$ref: '#/components/schemas/User'
|
|
48
|
+
/auth/refresh:
|
|
49
|
+
post:
|
|
50
|
+
operationId: refreshToken
|
|
51
|
+
tags: [auth]
|
|
52
|
+
requestBody:
|
|
53
|
+
required: true
|
|
54
|
+
content:
|
|
55
|
+
application/json:
|
|
56
|
+
schema:
|
|
57
|
+
type: object
|
|
58
|
+
required: [refreshToken]
|
|
59
|
+
properties:
|
|
60
|
+
refreshToken: { type: string }
|
|
61
|
+
responses:
|
|
62
|
+
'200':
|
|
63
|
+
description: New tokens
|
|
64
|
+
content:
|
|
65
|
+
application/json:
|
|
66
|
+
schema:
|
|
67
|
+
$ref: '#/components/schemas/LoginResponse'
|
|
68
|
+
/auth/logout:
|
|
69
|
+
post:
|
|
70
|
+
operationId: logout
|
|
71
|
+
tags: [auth]
|
|
72
|
+
responses:
|
|
73
|
+
'204':
|
|
74
|
+
description: Signed out
|
|
75
|
+
|
|
76
|
+
# ---------- Products: full set (list, create, detail, edit, delete) ----------
|
|
77
|
+
/products:
|
|
78
|
+
get:
|
|
79
|
+
operationId: listProducts
|
|
80
|
+
tags: [products]
|
|
81
|
+
parameters:
|
|
82
|
+
- { name: page, in: query, schema: { type: integer } }
|
|
83
|
+
- { name: search, in: query, schema: { type: string } }
|
|
84
|
+
- name: category
|
|
85
|
+
in: query
|
|
86
|
+
schema: { type: string, enum: [electronics, home, clothing] }
|
|
87
|
+
responses:
|
|
88
|
+
'200':
|
|
89
|
+
description: A page of products
|
|
90
|
+
content:
|
|
91
|
+
application/json:
|
|
92
|
+
schema:
|
|
93
|
+
type: array
|
|
94
|
+
items:
|
|
95
|
+
$ref: '#/components/schemas/Product'
|
|
96
|
+
post:
|
|
97
|
+
operationId: createProduct
|
|
98
|
+
tags: [products]
|
|
99
|
+
requestBody:
|
|
100
|
+
required: true
|
|
101
|
+
content:
|
|
102
|
+
application/json:
|
|
103
|
+
schema:
|
|
104
|
+
$ref: '#/components/schemas/ProductInput'
|
|
105
|
+
responses:
|
|
106
|
+
'201':
|
|
107
|
+
description: Created
|
|
108
|
+
content:
|
|
109
|
+
application/json:
|
|
110
|
+
schema:
|
|
111
|
+
$ref: '#/components/schemas/Product'
|
|
112
|
+
/products/{productId}:
|
|
113
|
+
parameters:
|
|
114
|
+
- name: productId
|
|
115
|
+
in: path
|
|
116
|
+
required: true
|
|
117
|
+
schema: { type: integer, format: int64 }
|
|
118
|
+
get:
|
|
119
|
+
operationId: getProduct
|
|
120
|
+
tags: [products]
|
|
121
|
+
responses:
|
|
122
|
+
'200':
|
|
123
|
+
description: One product
|
|
124
|
+
content:
|
|
125
|
+
application/json:
|
|
126
|
+
schema:
|
|
127
|
+
$ref: '#/components/schemas/Product'
|
|
128
|
+
put:
|
|
129
|
+
operationId: updateProduct
|
|
130
|
+
tags: [products]
|
|
131
|
+
requestBody:
|
|
132
|
+
required: true
|
|
133
|
+
content:
|
|
134
|
+
application/json:
|
|
135
|
+
schema:
|
|
136
|
+
$ref: '#/components/schemas/ProductInput'
|
|
137
|
+
responses:
|
|
138
|
+
'200':
|
|
139
|
+
description: Updated
|
|
140
|
+
content:
|
|
141
|
+
application/json:
|
|
142
|
+
schema:
|
|
143
|
+
$ref: '#/components/schemas/Product'
|
|
144
|
+
delete:
|
|
145
|
+
operationId: deleteProduct
|
|
146
|
+
tags: [products]
|
|
147
|
+
responses:
|
|
148
|
+
'204':
|
|
149
|
+
description: Deleted
|
|
150
|
+
|
|
151
|
+
# ---------- Orders: nested objects and arrays ----------
|
|
152
|
+
/orders:
|
|
153
|
+
get:
|
|
154
|
+
operationId: listOrders
|
|
155
|
+
tags: [orders]
|
|
156
|
+
parameters:
|
|
157
|
+
- name: status
|
|
158
|
+
in: query
|
|
159
|
+
schema: { type: string, enum: [pending, paid, shipped, cancelled] }
|
|
160
|
+
responses:
|
|
161
|
+
'200':
|
|
162
|
+
description: The user's orders
|
|
163
|
+
content:
|
|
164
|
+
application/json:
|
|
165
|
+
schema:
|
|
166
|
+
type: array
|
|
167
|
+
items:
|
|
168
|
+
$ref: '#/components/schemas/Order'
|
|
169
|
+
post:
|
|
170
|
+
operationId: createOrder
|
|
171
|
+
tags: [orders]
|
|
172
|
+
requestBody:
|
|
173
|
+
required: true
|
|
174
|
+
content:
|
|
175
|
+
application/json:
|
|
176
|
+
schema:
|
|
177
|
+
$ref: '#/components/schemas/OrderInput'
|
|
178
|
+
responses:
|
|
179
|
+
'201':
|
|
180
|
+
description: Created
|
|
181
|
+
content:
|
|
182
|
+
application/json:
|
|
183
|
+
schema:
|
|
184
|
+
$ref: '#/components/schemas/Order'
|
|
185
|
+
/orders/{orderId}:
|
|
186
|
+
get:
|
|
187
|
+
operationId: getOrder
|
|
188
|
+
tags: [orders]
|
|
189
|
+
parameters:
|
|
190
|
+
- name: orderId
|
|
191
|
+
in: path
|
|
192
|
+
required: true
|
|
193
|
+
schema: { type: string, format: uuid }
|
|
194
|
+
responses:
|
|
195
|
+
'200':
|
|
196
|
+
description: One order
|
|
197
|
+
content:
|
|
198
|
+
application/json:
|
|
199
|
+
schema:
|
|
200
|
+
$ref: '#/components/schemas/Order'
|
|
201
|
+
/orders/{orderId}/tracking:
|
|
202
|
+
get:
|
|
203
|
+
operationId: getOrderTracking
|
|
204
|
+
tags: [orders]
|
|
205
|
+
parameters:
|
|
206
|
+
- name: orderId
|
|
207
|
+
in: path
|
|
208
|
+
required: true
|
|
209
|
+
schema: { type: string, format: uuid }
|
|
210
|
+
responses:
|
|
211
|
+
'200':
|
|
212
|
+
description: Delivery tracking (try it with screen add)
|
|
213
|
+
content:
|
|
214
|
+
application/json:
|
|
215
|
+
schema:
|
|
216
|
+
$ref: '#/components/schemas/Tracking'
|
|
217
|
+
|
|
218
|
+
components:
|
|
219
|
+
schemas:
|
|
220
|
+
LoginRequest:
|
|
221
|
+
type: object
|
|
222
|
+
required: [email, password]
|
|
223
|
+
properties:
|
|
224
|
+
email: { type: string, format: email }
|
|
225
|
+
password: { type: string }
|
|
226
|
+
LoginResponse:
|
|
227
|
+
type: object
|
|
228
|
+
required: [token]
|
|
229
|
+
properties:
|
|
230
|
+
token: { type: string }
|
|
231
|
+
refreshToken: { type: string }
|
|
232
|
+
user:
|
|
233
|
+
$ref: '#/components/schemas/User'
|
|
234
|
+
User:
|
|
235
|
+
type: object
|
|
236
|
+
required: [id, name, email]
|
|
237
|
+
properties:
|
|
238
|
+
id: { type: integer, format: int64 }
|
|
239
|
+
name: { type: string }
|
|
240
|
+
email: { type: string, format: email }
|
|
241
|
+
avatar_url: { type: string, nullable: true }
|
|
242
|
+
ProductInput:
|
|
243
|
+
type: object
|
|
244
|
+
required: [name, price, category]
|
|
245
|
+
properties:
|
|
246
|
+
name: { type: string }
|
|
247
|
+
description: { type: string, nullable: true }
|
|
248
|
+
price: { type: number }
|
|
249
|
+
category: { type: string, enum: [electronics, home, clothing] }
|
|
250
|
+
in_stock: { type: boolean }
|
|
251
|
+
tags:
|
|
252
|
+
type: array
|
|
253
|
+
items: { type: string }
|
|
254
|
+
Product:
|
|
255
|
+
allOf:
|
|
256
|
+
- $ref: '#/components/schemas/ProductInput'
|
|
257
|
+
- type: object
|
|
258
|
+
required: [id, created_at]
|
|
259
|
+
properties:
|
|
260
|
+
id: { type: integer, format: int64 }
|
|
261
|
+
created_at: { type: string, format: date-time }
|
|
262
|
+
rating: { type: number, nullable: true }
|
|
263
|
+
OrderInput:
|
|
264
|
+
type: object
|
|
265
|
+
required: [items, shipping_address]
|
|
266
|
+
properties:
|
|
267
|
+
items:
|
|
268
|
+
type: array
|
|
269
|
+
items:
|
|
270
|
+
$ref: '#/components/schemas/OrderItem'
|
|
271
|
+
shipping_address:
|
|
272
|
+
$ref: '#/components/schemas/Address'
|
|
273
|
+
note: { type: string, nullable: true }
|
|
274
|
+
Order:
|
|
275
|
+
type: object
|
|
276
|
+
required: [id, status, items, total, created_at]
|
|
277
|
+
properties:
|
|
278
|
+
id: { type: string }
|
|
279
|
+
status: { type: string, enum: [pending, paid, shipped, cancelled] }
|
|
280
|
+
items:
|
|
281
|
+
type: array
|
|
282
|
+
items:
|
|
283
|
+
$ref: '#/components/schemas/OrderItem'
|
|
284
|
+
total: { type: number }
|
|
285
|
+
shipping_address:
|
|
286
|
+
$ref: '#/components/schemas/Address'
|
|
287
|
+
created_at: { type: string, format: date-time }
|
|
288
|
+
OrderItem:
|
|
289
|
+
type: object
|
|
290
|
+
required: [product_id, quantity]
|
|
291
|
+
properties:
|
|
292
|
+
product_id: { type: integer, format: int64 }
|
|
293
|
+
quantity: { type: integer }
|
|
294
|
+
unit_price: { type: number }
|
|
295
|
+
Address:
|
|
296
|
+
type: object
|
|
297
|
+
required: [line1, city, country]
|
|
298
|
+
properties:
|
|
299
|
+
line1: { type: string }
|
|
300
|
+
line2: { type: string, nullable: true }
|
|
301
|
+
city: { type: string }
|
|
302
|
+
postal_code: { type: string }
|
|
303
|
+
country: { type: string }
|
|
304
|
+
Tracking:
|
|
305
|
+
type: object
|
|
306
|
+
required: [order_id, status, events]
|
|
307
|
+
properties:
|
|
308
|
+
order_id: { type: string }
|
|
309
|
+
status: { type: string }
|
|
310
|
+
carrier: { type: string, nullable: true }
|
|
311
|
+
events:
|
|
312
|
+
type: array
|
|
313
|
+
items:
|
|
314
|
+
type: object
|
|
315
|
+
required: [time, description]
|
|
316
|
+
properties:
|
|
317
|
+
time: { type: string, format: date-time }
|
|
318
|
+
description: { type: string }
|
|
319
|
+
location: { type: string, nullable: true }
|
package/package.json
CHANGED
|
@@ -1,6 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codz-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI that adds API models, screens, routes and tests to Flutter, Next.js, React Native, Android and iOS apps in your project's own style, from OpenAPI or cURL.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"codz": "bin/codz.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin",
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"docs/COMMANDS.md",
|
|
15
|
+
"examples",
|
|
16
|
+
"assets",
|
|
17
|
+
"BETA.md"
|
|
18
|
+
],
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=20"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"test": "node --test \"test/**/*.test.ts\"",
|
|
24
|
+
"test:update-golden": "UPDATE_GOLDEN=1 node --test \"test/**/*.test.ts\"",
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"docs": "node scripts/gen-docs.ts",
|
|
27
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
28
|
+
"prepublishOnly": "npm run build && npm test",
|
|
29
|
+
"beta:pack": "bash scripts/beta-pack.sh",
|
|
30
|
+
"check:all": "bash scripts/check-all.sh"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/node": "^22.10.0",
|
|
34
|
+
"typescript": "^5.8.0"
|
|
35
|
+
},
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"author": "pradeep817",
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/pradeep817/codz.git"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/pradeep817/codz#readme",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/pradeep817/codz/issues"
|
|
45
|
+
},
|
|
46
|
+
"keywords": [
|
|
47
|
+
"cli",
|
|
48
|
+
"codegen",
|
|
49
|
+
"openapi",
|
|
50
|
+
"flutter",
|
|
51
|
+
"nextjs",
|
|
52
|
+
"react-native",
|
|
53
|
+
"react",
|
|
54
|
+
"android",
|
|
55
|
+
"ios",
|
|
56
|
+
"swiftui",
|
|
57
|
+
"mcp"
|
|
58
|
+
]
|
|
59
|
+
}
|