pike/glyph Public Public: anyone can read this; nobody can change it.

forked from apps/glyph

workbenchthis machine
Files main
557 lines · 13.8 KB · ~4.7k tok Raw History
1
{
2
  "openapi": "3.1.0",
3
  "info": {
4
    "title": "glyph",
5
    "version": "0.1.0",
6
    "description": "Type a prompt, get SVG logos and icons drawn by Claude; preview in your theme, copy or download."
7
  },
8
  "paths": {
9
    "/api/drawings": {
10
      "get": {
11
        "summary": "Your drawings, newest first (an admin sees everyone's).",
12
        "operationId": "getApiDrawings",
13
        "parameters": [
14
          {
15
            "name": "limit",
16
            "in": "query",
17
            "schema": {
18
              "type": "integer",
19
              "minimum": 1,
20
              "maximum": 200,
21
              "default": 50
22
            }
23
          }
24
        ],
25
        "responses": {
26
          "200": {
27
            "description": "Your drawings, newest first (an admin sees everyone's).",
28
            "content": {
29
              "application/json": {
30
                "schema": {
31
                  "type": "array",
32
                  "items": {
33
                    "$ref": "#/components/schemas/Drawing"
34
                  }
35
                }
36
              }
37
            }
38
          },
39
          "default": {
40
            "description": "{ error, message }: why not",
41
            "content": {
42
              "application/json": {
43
                "schema": {
44
                  "$ref": "#/components/schemas/Error"
45
                }
46
              }
47
            }
48
          }
49
        },
50
        "x-contract": {
51
          "resource": "drawing",
52
          "verb": "list",
53
          "least": "author"
54
        }
55
      },
56
      "post": {
57
        "summary": "Ask Claude for a drawing. Answers at once with status `drawing`; read it again (or listen on /events for `drawing.changed`) until it is `done` or `failed`. One at a time per person.",
58
        "operationId": "postApiDrawings",
59
        "requestBody": {
60
          "required": true,
61
          "content": {
62
            "application/json": {
63
              "schema": {
64
                "type": "object",
65
                "properties": {
66
                  "prompt": {
67
                    "type": "string",
68
                    "minLength": 1,
69
                    "maxLength": 400
70
                  },
71
                  "kind": {
72
                    "enum": [
73
                      "mark",
74
                      "icon",
75
                      "badge",
76
                      "spot"
77
                    ],
78
                    "default": "mark"
79
                  }
80
                },
81
                "required": [
82
                  "prompt"
83
                ]
84
              }
85
            }
86
          }
87
        },
88
        "responses": {
89
          "202": {
90
            "description": "Ask Claude for a drawing. Answers at once with status `drawing`; read it again (or listen on /events for `drawing.changed`) until it is `done` or `failed`. One at a time per person.",
91
            "content": {
92
              "application/json": {
93
                "schema": {
94
                  "$ref": "#/components/schemas/Drawing"
95
                }
96
              }
97
            }
98
          },
99
          "default": {
100
            "description": "{ error, message }: why not",
101
            "content": {
102
              "application/json": {
103
                "schema": {
104
                  "$ref": "#/components/schemas/Error"
105
                }
106
              }
107
            }
108
          }
109
        },
110
        "x-contract": {
111
          "resource": "drawing",
112
          "verb": "create",
113
          "least": "user"
114
        }
115
      }
116
    },
117
    "/api/drawings/{id}": {
118
      "get": {
119
        "summary": "One drawing.",
120
        "operationId": "getApiDrawingsId",
121
        "parameters": [
122
          {
123
            "name": "id",
124
            "in": "path",
125
            "required": true,
126
            "schema": {
127
              "type": "integer"
128
            }
129
          }
130
        ],
131
        "responses": {
132
          "200": {
133
            "description": "One drawing.",
134
            "content": {
135
              "application/json": {
136
                "schema": {
137
                  "$ref": "#/components/schemas/Drawing"
138
                }
139
              }
140
            }
141
          },
142
          "default": {
143
            "description": "{ error, message }: why not",
144
            "content": {
145
              "application/json": {
146
                "schema": {
147
                  "$ref": "#/components/schemas/Error"
148
                }
149
              }
150
            }
151
          }
152
        },
153
        "x-contract": {
154
          "resource": "drawing",
155
          "verb": "read",
156
          "least": "author"
157
        }
158
      },
159
      "delete": {
160
        "summary": "Remove a drawing.",
161
        "operationId": "deleteApiDrawingsId",
162
        "parameters": [
163
          {
164
            "name": "id",
165
            "in": "path",
166
            "required": true,
167
            "schema": {
168
              "type": "integer"
169
            }
170
          }
171
        ],
172
        "responses": {
173
          "200": {
174
            "description": "Remove a drawing.",
175
            "content": {
176
              "application/json": {
177
                "schema": {
178
                  "type": "object",
179
                  "properties": {
180
                    "id": {
181
                      "type": "integer"
182
                    }
183
                  },
184
                  "required": [
185
                    "id"
186
                  ]
187
                }
188
              }
189
            }
190
          },
191
          "default": {
192
            "description": "{ error, message }: why not",
193
            "content": {
194
              "application/json": {
195
                "schema": {
196
                  "$ref": "#/components/schemas/Error"
197
                }
198
              }
199
            }
200
          }
201
        },
202
        "x-contract": {
203
          "resource": "drawing",
204
          "verb": "delete",
205
          "least": "author"
206
        }
207
      }
208
    },
209
    "/api/audit": {
210
      "get": {
211
        "summary": "The audit trail, newest first; `before` pages back by id.",
212
        "operationId": "getApiAudit",
213
        "parameters": [
214
          {
215
            "name": "limit",
216
            "in": "query",
217
            "schema": {
218
              "type": "integer",
219
              "minimum": 1,
220
              "maximum": 500,
221
              "default": 100
222
            }
223
          },
224
          {
225
            "name": "before",
226
            "in": "query",
227
            "schema": {
228
              "type": "integer"
229
            }
230
          }
231
        ],
232
        "responses": {
233
          "200": {
234
            "description": "The audit trail, newest first; `before` pages back by id.",
235
            "content": {
236
              "application/json": {
237
                "schema": {
238
                  "type": "array",
239
                  "items": {
240
                    "$ref": "#/components/schemas/AuditRow"
241
                  }
242
                }
243
              }
244
            }
245
          },
246
          "default": {
247
            "description": "{ error, message }: why not",
248
            "content": {
249
              "application/json": {
250
                "schema": {
251
                  "$ref": "#/components/schemas/Error"
252
                }
253
              }
254
            }
255
          }
256
        },
257
        "x-contract": {
258
          "resource": "audit",
259
          "verb": "list",
260
          "least": "admin"
261
        }
262
      }
263
    },
264
    "/api/audit/{id}": {
265
      "get": {
266
        "summary": "One row of the audit trail.",
267
        "operationId": "getApiAuditId",
268
        "parameters": [
269
          {
270
            "name": "id",
271
            "in": "path",
272
            "required": true,
273
            "schema": {
274
              "type": "integer"
275
            }
276
          }
277
        ],
278
        "responses": {
279
          "200": {
280
            "description": "One row of the audit trail.",
281
            "content": {
282
              "application/json": {
283
                "schema": {
284
                  "$ref": "#/components/schemas/AuditRow"
285
                }
286
              }
287
            }
288
          },
289
          "default": {
290
            "description": "{ error, message }: why not",
291
            "content": {
292
              "application/json": {
293
                "schema": {
294
                  "$ref": "#/components/schemas/Error"
295
                }
296
              }
297
            }
298
          }
299
        },
300
        "x-contract": {
301
          "resource": "audit",
302
          "verb": "read",
303
          "least": "admin"
304
        }
305
      }
306
    },
307
    "/mcp": {
308
      "post": {
309
        "summary": "One JSON-RPC 2.0 message to the MCP server; its tools are the actions.",
310
        "operationId": "postMcp",
311
        "requestBody": {
312
          "required": true,
313
          "content": {
314
            "application/json": {
315
              "schema": {
316
                "type": "object",
317
                "properties": {
318
                  "jsonrpc": {
319
                    "const": "2.0"
320
                  },
321
                  "id": {},
322
                  "method": {
323
                    "type": "string"
324
                  },
325
                  "params": {
326
                    "type": "object"
327
                  }
328
                },
329
                "required": [
330
                  "jsonrpc",
331
                  "method"
332
                ]
333
              }
334
            }
335
          }
336
        },
337
        "responses": {
338
          "200": {
339
            "description": "One JSON-RPC 2.0 message to the MCP server; its tools are the actions.",
340
            "content": {
341
              "application/json": {
342
                "schema": {
343
                  "type": "object"
344
                }
345
              }
346
            }
347
          },
348
          "default": {
349
            "description": "{ error, message }: why not",
350
            "content": {
351
              "application/json": {
352
                "schema": {
353
                  "$ref": "#/components/schemas/Error"
354
                }
355
              }
356
            }
357
          }
358
        }
359
      }
360
    },
361
    "/healthz": {
362
      "get": {
363
        "summary": "Whether the app is up: its version, commit, environment and seconds since it started.",
364
        "operationId": "getHealthz",
365
        "responses": {
366
          "200": {
367
            "description": "Whether the app is up: its version, commit, environment and seconds since it started.",
368
            "content": {
369
              "application/json": {
370
                "schema": {
371
                  "type": "object",
372
                  "properties": {
373
                    "ok": {
374
                      "type": "boolean"
375
                    },
376
                    "version": {
377
                      "type": "string"
378
                    },
379
                    "commit": {
380
                      "type": "string"
381
                    },
382
                    "env": {
383
                      "type": "string"
384
                    },
385
                    "uptime": {
386
                      "type": "integer"
387
                    }
388
                  },
389
                  "required": [
390
                    "ok",
391
                    "version",
392
                    "uptime"
393
                  ]
394
                }
395
              }
396
            }
397
          },
398
          "default": {
399
            "description": "{ error, message }: why not",
400
            "content": {
401
              "application/json": {
402
                "schema": {
403
                  "$ref": "#/components/schemas/Error"
404
                }
405
              }
406
            }
407
          }
408
        }
409
      }
410
    }
411
  },
412
  "components": {
413
    "schemas": {
414
      "Drawing": {
415
        "type": "object",
416
        "properties": {
417
          "id": {
418
            "type": "integer"
419
          },
420
          "prompt": {
421
            "type": "string",
422
            "minLength": 1,
423
            "maxLength": 400
424
          },
425
          "kind": {
426
            "enum": [
427
              "mark",
428
              "icon",
429
              "badge",
430
              "spot"
431
            ]
432
          },
433
          "status": {
434
            "enum": [
435
              "drawing",
436
              "done",
437
              "failed"
438
            ]
439
          },
440
          "svgs": {
441
            "type": "array",
442
            "items": {
443
              "type": "string"
444
            },
445
            "description": "The drawings, as SVG, in the placeholder ink, glow and paper colours."
446
          },
447
          "error": {
448
            "type": [
449
              "string",
450
              "null"
451
            ]
452
          },
453
          "author_id": {
454
            "type": "string"
455
          },
456
          "author_name": {
457
            "type": "string"
458
          },
459
          "created_at": {
460
            "type": "string",
461
            "format": "date-time"
462
          },
463
          "updated_at": {
464
            "type": "string",
465
            "format": "date-time"
466
          }
467
        },
468
        "required": [
469
          "id",
470
          "prompt",
471
          "kind",
472
          "status",
473
          "svgs",
474
          "author_id",
475
          "author_name",
476
          "created_at",
477
          "updated_at"
478
        ]
479
      },
480
      "AuditRow": {
481
        "type": "object",
482
        "properties": {
483
          "id": {
484
            "type": "integer"
485
          },
486
          "at": {
487
            "type": "string",
488
            "format": "date-time"
489
          },
490
          "who_id": {
491
            "type": [
492
              "string",
493
              "null"
494
            ]
495
          },
496
          "who_name": {
497
            "type": [
498
              "string",
499
              "null"
500
            ]
501
          },
502
          "role": {
503
            "enum": [
504
              "anon",
505
              "user",
506
              "admin"
507
            ]
508
          },
509
          "resource": {
510
            "type": "string"
511
          },
512
          "verb": {
513
            "type": "string"
514
          },
515
          "target": {
516
            "type": [
517
              "string",
518
              "null"
519
            ]
520
          },
521
          "allowed": {
522
            "enum": [
523
              0,
524
              1
525
            ]
526
          },
527
          "outcome": {
528
            "type": "string"
529
          }
530
        },
531
        "required": [
532
          "id",
533
          "at",
534
          "role",
535
          "resource",
536
          "verb",
537
          "allowed",
538
          "outcome"
539
        ]
540
      },
541
      "Error": {
542
        "type": "object",
543
        "properties": {
544
          "error": {
545
            "type": "string"
546
          },
547
          "message": {
548
            "type": "string"
549
          }
550
        },
551
        "required": [
552
          "error"
553
        ]
554
      }
555
    }
556
  }
557
}
↑↓ navigate ↵ open esc close
↑↓ navigate ↵ open esc close

Keyboard shortcuts