@puffinstudio/fizzyx 0.4.7 → 0.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/.fizzy.yaml +4 -0
- package/.fizzyx/oss-manifest.json +1 -1
- package/README.md +112 -1
- package/dist/main.js +441 -60
- package/package.json +10 -5
package/.fizzy.yaml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": 1,
|
|
3
3
|
"localDir": "/home/e/.repos/fizzyx/./public",
|
|
4
4
|
"remotePrefix": "assets",
|
|
5
|
-
"lastSyncedAt": "2026-06-
|
|
5
|
+
"lastSyncedAt": "2026-06-18T15:35:59.270Z",
|
|
6
6
|
"files": {
|
|
7
7
|
"Monkey_D._Luffy_Anime_Post_Timeskip_Infobox.webp": {
|
|
8
8
|
"mtimeMs": 1781757440085.3743,
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# fizzyx
|
|
2
2
|
|
|
3
|
-
CLI tool for Fizzy board workflow
|
|
3
|
+
CLI tool for Fizzy board workflow, OSS/S3-compatible storage, and OpenAPI client generation.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -141,6 +141,117 @@ Show sync status (pending uploads, manifest info):
|
|
|
141
141
|
fizzyx oss status [--env dev]
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
+
List exact pending files without uploading:
|
|
145
|
+
|
|
146
|
+
```sh
|
|
147
|
+
fizzyx oss status --files
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## OpenAPI Commands
|
|
151
|
+
|
|
152
|
+
Generate a typed API client from an OpenAPI spec.
|
|
153
|
+
|
|
154
|
+
### Generate
|
|
155
|
+
|
|
156
|
+
```sh
|
|
157
|
+
fizzyx openapi generate -i <url|path> -o <dir> -c wx
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Options:
|
|
161
|
+
|
|
162
|
+
| Flag | Description |
|
|
163
|
+
| -------------------------- | ------------------------------------------------------- |
|
|
164
|
+
| `-i, --input <url\|path>` | OpenAPI spec URL or file path (JSON/YAML) |
|
|
165
|
+
| `-o, --output <dir\|file>` | Output directory (or `.ts` path for custom api name) |
|
|
166
|
+
| `-c, --client <name>` | Client target (`wx`) |
|
|
167
|
+
| `--api-name <name>` | API filename (default: `api.ts`) |
|
|
168
|
+
| `--types-name <name>` | Types filename (default: `types.ts`, `false` to inline) |
|
|
169
|
+
| `--runtime-name <name>` | Runtime filename (default: `wx-request.ts`) |
|
|
170
|
+
| `--run <script\|cmd>` | npm script or shell command after generation |
|
|
171
|
+
|
|
172
|
+
If `--input`/`--output`/`--client` are omitted, values from `.fizzy.yaml` `openapi[0]` are used.
|
|
173
|
+
|
|
174
|
+
Output is 3 files — runtime, types, and tree-shakeable endpoint functions:
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
src/api/
|
|
178
|
+
├── wx-request.ts # runtime (configure, setToken, onError, request)
|
|
179
|
+
├── types.ts # named interfaces / enums / aliases
|
|
180
|
+
└── api.ts # tree-shakeable export functions + param types
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Generated Runtime API
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
import { configure, setToken, onError, initToken } from "./api";
|
|
187
|
+
|
|
188
|
+
// Setup at app startup
|
|
189
|
+
configure({ baseUrl: "https://api.example.com", storageKey: "myapp_token" });
|
|
190
|
+
|
|
191
|
+
// Or with custom logger + hooks
|
|
192
|
+
configure({
|
|
193
|
+
baseUrl: "https://api.example.com",
|
|
194
|
+
storageKey: "tb_token",
|
|
195
|
+
logger: { error: myReporter, warn: () => {}, info: () => {}, debug: () => {} },
|
|
196
|
+
hooks: [
|
|
197
|
+
{ onError: (ctx) => wx.showToast({ title: ctx.message }) },
|
|
198
|
+
{ onSuccess: (ctx) => reportAnalytics(ctx) },
|
|
199
|
+
],
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
// Token auto-loads from storage. Explicit load if needed:
|
|
203
|
+
await initToken();
|
|
204
|
+
|
|
205
|
+
// Token persists to storage on set
|
|
206
|
+
setToken("jwt...");
|
|
207
|
+
setToken(null); // logout, clears storage
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Logger vs Hooks:**
|
|
211
|
+
|
|
212
|
+
- `Logger` controls **output** (console, file, sentry). Default: `console.error/warn/info/debug` with `[fizzyx]` prefix.
|
|
213
|
+
- `RequestHook` fires **business callbacks** at lifecycle points (`onRequest`, `onSuccess`, `onError`). Use for toast, analytics, loading state.
|
|
214
|
+
|
|
215
|
+
### Generated Endpoint API
|
|
216
|
+
|
|
217
|
+
Each endpoint is a standalone export function with typed params:
|
|
218
|
+
|
|
219
|
+
```ts
|
|
220
|
+
import { listPets, createPet, ListPetsQueryParams } from "./api";
|
|
221
|
+
|
|
222
|
+
// GET with query params
|
|
223
|
+
const pets = await listPets({ query: { limit: 10, status: "available" } });
|
|
224
|
+
|
|
225
|
+
// POST with body
|
|
226
|
+
const pet = await createPet({ name: "Fluffy" });
|
|
227
|
+
|
|
228
|
+
// POST without requestBody (no data param generated)
|
|
229
|
+
const result = await someAction();
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
- No `createApi()` wrapper — tree-shakeable by default
|
|
233
|
+
- Each function exports its param types (`ListPetsQueryParams`, `CreatePetPathParams`)
|
|
234
|
+
- JSDoc comments from OpenAPI `description`/`summary` on endpoints and params
|
|
235
|
+
|
|
236
|
+
### List Generators
|
|
237
|
+
|
|
238
|
+
```sh
|
|
239
|
+
fizzyx openapi list
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Config (`.fizzy.yaml`)
|
|
243
|
+
|
|
244
|
+
```yaml
|
|
245
|
+
openapi:
|
|
246
|
+
- input: ./openapi.json
|
|
247
|
+
output: ./src/api
|
|
248
|
+
client: wx
|
|
249
|
+
api_name: sdk.ts
|
|
250
|
+
types_name: types.ts
|
|
251
|
+
runtime_name: wx-request.ts
|
|
252
|
+
run: check
|
|
253
|
+
```
|
|
254
|
+
|
|
144
255
|
## Config File (`.fizzy.yaml`)
|
|
145
256
|
|
|
146
257
|
Minimal OSS-only config:
|