@mayder/devibe 0.0.0-stage → 0.2.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/README.md +46 -2
- package/bin/devibe.mjs +7 -0
- package/dist/anatomy.mjs +146 -0
- package/dist/cli.js +50 -0
- package/dist/devibe.svg +4 -0
- package/dist/diff.js +61 -0
- package/dist/graphify.js +155 -0
- package/dist/highlight.LICENSE +29 -0
- package/dist/highlight.min.js +1262 -0
- package/dist/model.js +73 -0
- package/dist/server.js +117 -0
- package/dist/source.js +87 -0
- package/dist/support-desk.js +80 -0
- package/dist/vendor/anatomy/LICENSE +21 -0
- package/dist/vendor/anatomy/README.md +3 -0
- package/dist/vendor/anatomy/iso-kit.mjs +674 -0
- package/dist/viewer.html +872 -0
- package/examples/support-desk/after/route.ts +14 -0
- package/examples/support-desk/after/ticket-service.ts +11 -0
- package/examples/support-desk/before/route.ts +11 -0
- package/examples/support-desk/before/ticket-service.ts +7 -0
- package/package.json +28 -4
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createTicket, type TicketStore } from './ticket-service.ts'
|
|
2
|
+
|
|
3
|
+
export async function postTicket(request: Request, store: TicketStore): Promise<Response> {
|
|
4
|
+
const body: { title?: unknown } | null = await request.json().catch(() => null)
|
|
5
|
+
if (typeof body?.title !== 'string') {
|
|
6
|
+
return Response.json({ error: 'invalid_title' }, { status: 400 })
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const ticket = await createTicket(body.title, store)
|
|
10
|
+
if (!ticket) {
|
|
11
|
+
return Response.json({ error: 'empty_title' }, { status: 422 })
|
|
12
|
+
}
|
|
13
|
+
return Response.json(ticket, { status: 201 })
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createTicket, type TicketStore } from './ticket-service.ts'
|
|
2
|
+
|
|
3
|
+
export async function postTicket(request: Request, store: TicketStore): Promise<Response> {
|
|
4
|
+
const body: { title?: unknown } | null = await request.json().catch(() => null)
|
|
5
|
+
if (typeof body?.title !== 'string') {
|
|
6
|
+
return Response.json({ error: 'invalid_title' }, { status: 400 })
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const ticket = await createTicket(body.title, store)
|
|
10
|
+
return Response.json(ticket, { status: 201 })
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mayder/devibe",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Entiende qué escribió tu IA y revisa sus cambios en tu repo local.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"devibe": "./bin/devibe.mjs"
|
|
8
|
+
},
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=24"
|
|
11
|
+
},
|
|
12
|
+
"license": "UNLICENSED",
|
|
13
|
+
"homepage": "https://devibe-xi.vercel.app/",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/MayderC/devibe.git"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"bin",
|
|
20
|
+
"dist",
|
|
21
|
+
"examples/support-desk/before",
|
|
22
|
+
"examples/support-desk/after"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"test": "node --test examples/support-desk/verify.mjs"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
}
|
|
30
|
+
}
|