@cosmicdrift/kumiko-samples 0.411.0 → 0.413.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/package.json +1 -1
- package/packages/bundled-features/package.json +13 -13
- package/packages/bundled-features/src/admin-shell/feature.ts +1 -1
- package/packages/bundled-features/src/agent-tools/agent-doc-lint.ts +64 -3
- package/packages/bundled-features/src/agent-tools/agent-manifest.ts +13 -130
- package/packages/bundled-features/src/agent-tools/api-docs/anchors.ts +60 -0
- package/packages/bundled-features/src/agent-tools/api-docs/check.ts +25 -0
- package/packages/bundled-features/src/agent-tools/api-docs/collect-events.ts +140 -0
- package/packages/bundled-features/src/agent-tools/api-docs/collect.ts +175 -0
- package/packages/bundled-features/src/agent-tools/api-docs/curl.ts +28 -0
- package/packages/bundled-features/src/agent-tools/api-docs/error-table.ts +45 -0
- package/packages/bundled-features/src/agent-tools/api-docs/examples.ts +43 -0
- package/packages/bundled-features/src/agent-tools/api-docs/generate.ts +179 -0
- package/packages/bundled-features/src/agent-tools/api-docs/index-json.ts +29 -0
- package/packages/bundled-features/src/agent-tools/api-docs/index.ts +21 -0
- package/packages/bundled-features/src/agent-tools/api-docs/list-parameters.ts +38 -0
- package/packages/bundled-features/src/agent-tools/api-docs/markdown.ts +70 -0
- package/packages/bundled-features/src/agent-tools/api-docs/menu-path.ts +82 -0
- package/packages/bundled-features/src/agent-tools/api-docs/model.ts +83 -0
- package/packages/bundled-features/src/agent-tools/api-docs/problems.ts +58 -0
- package/packages/bundled-features/src/agent-tools/api-docs/render-events.ts +76 -0
- package/packages/bundled-features/src/agent-tools/api-docs/render-openapi.ts +216 -0
- package/packages/bundled-features/src/agent-tools/api-docs/render-overview.ts +86 -0
- package/packages/bundled-features/src/agent-tools/api-docs/render-reference.ts +79 -0
- package/packages/bundled-features/src/agent-tools/api-docs/render-tokens.ts +136 -0
- package/packages/bundled-features/src/agent-tools/api-docs/schema-fields.ts +167 -0
- package/packages/bundled-features/src/agent-tools/api-docs/section-ids.ts +28 -0
- package/packages/bundled-features/src/agent-tools/api-docs/system-only.ts +11 -0
- package/packages/bundled-features/src/agent-tools/api-docs/texts/de.ts +166 -0
- package/packages/bundled-features/src/agent-tools/api-docs/texts/en.ts +159 -0
- package/packages/bundled-features/src/agent-tools/api-docs/texts/es.ts +162 -0
- package/packages/bundled-features/src/agent-tools/api-docs/texts/fr.ts +169 -0
- package/packages/bundled-features/src/agent-tools/api-docs/texts/index.ts +67 -0
- package/packages/bundled-features/src/agent-tools/api-docs/texts/it.ts +165 -0
- package/packages/bundled-features/src/agent-tools/api-docs/texts/types.ts +130 -0
- package/packages/bundled-features/src/agent-tools/api-docs/ui-writes.ts +81 -0
- package/packages/bundled-features/src/agent-tools/changes.json +24 -0
- package/packages/bundled-features/src/agent-tools/handler-schema.ts +45 -0
- package/packages/bundled-features/src/agent-tools/index.ts +24 -0
- package/packages/bundled-features/src/agent-tools/labels.ts +181 -0
- package/packages/bundled-features/src/auth-email-password/boot-rules.ts +9 -0
- package/packages/bundled-features/src/auth-email-password/feature.ts +6 -19
- package/packages/bundled-features/src/auth-email-password/validate-options.ts +20 -0
- package/packages/bundled-features/src/billing-foundation/boot-rules.ts +26 -0
- package/packages/bundled-features/src/billing-foundation/validate-options.ts +59 -46
- package/packages/bundled-features/src/cap-overview/boot-rules.ts +14 -0
- package/packages/bundled-features/src/cap-overview/feature.ts +12 -5
- package/packages/bundled-features/src/documents/boot-rules.ts +14 -0
- package/packages/bundled-features/src/documents/feature.ts +8 -4
- package/packages/bundled-features/src/file-derivatives/boot-rules.ts +9 -0
- package/packages/bundled-features/src/file-derivatives/feature.ts +6 -3
- package/packages/bundled-features/src/folders/boot-rules.ts +9 -0
- package/packages/bundled-features/src/folders/feature.ts +6 -3
- package/packages/bundled-features/src/helpdesk/boot-rules.ts +9 -0
- package/packages/bundled-features/src/{contact → helpdesk}/challenge.ts +2 -2
- package/packages/bundled-features/src/{contact → helpdesk}/changes.json +6 -0
- package/packages/bundled-features/src/{contact/client/contact-client-source.ts → helpdesk/client/helpdesk-client-source.ts} +4 -4
- package/packages/bundled-features/src/helpdesk/client/helpdesk-website-client.ts +29 -0
- package/packages/bundled-features/src/helpdesk/client/index.ts +9 -0
- package/packages/bundled-features/src/{contact → helpdesk}/entity.ts +35 -31
- package/packages/bundled-features/src/{contact → helpdesk}/feature.ts +56 -52
- package/packages/bundled-features/src/{contact → helpdesk}/handlers/attempts.ts +3 -3
- package/packages/bundled-features/src/{contact → helpdesk}/handlers/challenge.query.ts +10 -10
- package/packages/bundled-features/src/{contact → helpdesk}/handlers/forward-request.write.ts +25 -23
- package/packages/bundled-features/src/{contact → helpdesk}/handlers/mark-done.write.ts +11 -11
- package/packages/bundled-features/src/{contact → helpdesk}/handlers/notify-reporter-in-app.write.ts +14 -14
- package/packages/bundled-features/src/{contact → helpdesk}/handlers/open-count.query.ts +4 -4
- package/packages/bundled-features/src/{contact → helpdesk}/handlers/open-count.ts +2 -2
- package/packages/bundled-features/src/{contact → helpdesk}/handlers/replies.query.ts +6 -6
- package/packages/bundled-features/src/{contact → helpdesk}/handlers/reply.write.ts +30 -30
- package/packages/bundled-features/src/{contact → helpdesk}/handlers/report.write.ts +29 -29
- package/packages/bundled-features/src/{contact → helpdesk}/handlers/request-delivery.query.ts +40 -40
- package/packages/bundled-features/src/{contact → helpdesk}/handlers/request-detail.query.ts +15 -15
- package/packages/bundled-features/src/{contact → helpdesk}/handlers/request-list.query.ts +2 -2
- package/packages/bundled-features/src/{contact → helpdesk}/handlers/send-reply-mail.write.ts +24 -24
- package/packages/bundled-features/src/{contact → helpdesk}/handlers/send-test.write.ts +18 -14
- package/packages/bundled-features/src/{contact → helpdesk}/handlers/submit.write.ts +32 -31
- package/packages/bundled-features/src/{contact → helpdesk}/handlers/take-over-uploads.ts +5 -5
- package/packages/bundled-features/src/{contact → helpdesk}/i18n.ts +78 -75
- package/packages/bundled-features/src/helpdesk/index.ts +29 -0
- package/packages/bundled-features/src/{contact → helpdesk}/lib.ts +32 -28
- package/packages/bundled-features/src/{contact → helpdesk}/mail.ts +56 -56
- package/packages/bundled-features/src/{contact → helpdesk}/options.ts +18 -16
- package/packages/bundled-features/src/helpdesk/panels.ts +28 -0
- package/packages/bundled-features/src/{contact → helpdesk}/payloads.ts +33 -33
- package/packages/bundled-features/src/{contact → helpdesk}/screens.ts +104 -104
- package/packages/bundled-features/src/{contact → helpdesk}/subject.ts +3 -3
- package/packages/bundled-features/src/{contact → helpdesk}/user-data-hooks.ts +17 -17
- package/packages/bundled-features/src/helpdesk/web/constants.ts +160 -0
- package/packages/bundled-features/src/helpdesk/web/index.ts +29 -0
- package/packages/bundled-features/src/host-routing/boot-rules.ts +27 -0
- package/packages/bundled-features/src/host-routing/validate-options.ts +36 -27
- package/packages/bundled-features/src/inbound-mail-foundation/changes.json +6 -0
- package/packages/bundled-features/src/inbound-mail-foundation/entities.ts +99 -71
- package/packages/bundled-features/src/inbound-mail-foundation/feature.ts +2 -2
- package/packages/bundled-features/src/jobs/boot-rules.ts +9 -0
- package/packages/bundled-features/src/jobs/feature.ts +9 -4
- package/packages/bundled-features/src/legal-pages/boot-rules.ts +19 -0
- package/packages/bundled-features/src/legal-pages/feature.ts +6 -3
- package/packages/bundled-features/src/legal-pages/lib/validate-routes.ts +11 -5
- package/packages/bundled-features/src/metrics/boot-rules.ts +15 -0
- package/packages/bundled-features/src/metrics/validate.ts +8 -2
- package/packages/bundled-features/src/notes-history/boot-rules.ts +9 -0
- package/packages/bundled-features/src/notes-history/feature.ts +6 -3
- package/packages/bundled-features/src/personal-access-tokens/boot-rules.ts +9 -0
- package/packages/bundled-features/src/personal-access-tokens/changes.json +6 -0
- package/packages/bundled-features/src/personal-access-tokens/feature.ts +5 -2
- package/packages/bundled-features/src/personal-access-tokens/handlers/create.write.ts +7 -2
- package/packages/bundled-features/src/personal-access-tokens/i18n.ts +6 -1
- package/packages/bundled-features/src/personal-access-tokens/index.ts +37 -2
- package/packages/bundled-features/src/personal-access-tokens/scope-events-check.ts +31 -0
- package/packages/bundled-features/src/personal-access-tokens/screens.ts +9 -1
- package/packages/bundled-features/src/personal-access-tokens/web/constants.ts +1 -0
- package/packages/bundled-features/src/personal-access-tokens/web/scopes.ts +14 -0
- package/packages/bundled-features/src/presence/boot-rules.ts +9 -0
- package/packages/bundled-features/src/presence/options.ts +5 -1
- package/packages/bundled-features/src/readiness/boot-rules.ts +14 -0
- package/packages/bundled-features/src/readiness/probe-boot-check.ts +8 -6
- package/packages/bundled-features/src/shared/assert-no-where-rule-in-ownership-write.ts +6 -4
- package/packages/bundled-features/src/shared/boot-rules.ts +9 -0
- package/packages/bundled-features/src/subscription-mollie/boot-rules.ts +19 -0
- package/packages/bundled-features/src/subscription-mollie/feature.ts +18 -10
- package/packages/bundled-features/src/tags/boot-rules.ts +9 -0
- package/packages/bundled-features/src/tags/feature.ts +6 -3
- package/packages/bundled-features/src/template-resolver/boot-rules.ts +19 -0
- package/packages/bundled-features/src/template-resolver/feature.ts +14 -10
- package/packages/bundled-features/src/tenant/boot-rules.ts +9 -0
- package/packages/bundled-features/src/tenant/feature.ts +5 -3
- package/samples/apps/marketing-demo/README.md +1 -1
- package/samples/apps/marketing-demo/playwright.config.ts +1 -1
- package/samples/apps/marketing-demo/src/app/client.tsx +3 -3
- package/samples/apps/marketing-demo/src/app/seed-data.ts +1 -1
- package/samples/apps/marketing-demo/src/app/seed.ts +4 -4
- package/samples/apps/marketing-demo/src/app/server.ts +3 -3
- package/samples/apps/marketing-demo/src/features/{helpdesk → ticketing}/feature.ts +15 -12
- package/samples/apps/marketing-demo/src/features/ticketing/i18n.ts +100 -0
- package/samples/apps/marketing-demo/src/features/{helpdesk → ticketing}/schema/ticket.ts +4 -4
- package/samples/apps/marketing-demo/src/features/ticketing/web/index.ts +7 -0
- package/samples/apps/use-all-bundled/feature-manifest.json +67 -67
- package/samples/apps/use-all-bundled/kumiko/migrations/0064_helpdesk-rename.rebuild.json +4 -0
- package/samples/apps/use-all-bundled/package.json +1 -1
- package/samples/apps/use-all-bundled/src/app/client.tsx +1 -1
- package/samples/apps/use-all-bundled/src/app/screens-feature.ts +10 -10
- package/samples/apps/use-all-bundled/src/run-config.ts +6 -6
- package/samples/recipes/api-docs/README.md +52 -0
- package/samples/recipes/api-docs/api-docs/de/events.md +62 -0
- package/samples/recipes/api-docs/api-docs/de/overview.md +100 -0
- package/samples/recipes/api-docs/api-docs/de/reference/tickets.md +305 -0
- package/samples/recipes/api-docs/api-docs/de/tokens.md +66 -0
- package/samples/recipes/api-docs/api-docs/en/events.md +62 -0
- package/samples/recipes/api-docs/api-docs/en/overview.md +100 -0
- package/samples/recipes/api-docs/api-docs/en/reference/tickets.md +305 -0
- package/samples/recipes/api-docs/api-docs/en/tokens.md +66 -0
- package/samples/recipes/api-docs/api-docs/index.json +371 -0
- package/samples/recipes/api-docs/api-docs/openapi.json +982 -0
- package/samples/recipes/api-docs/api-examples/ticket-close.json +21 -0
- package/samples/recipes/api-docs/api-examples/ticket-create.json +42 -0
- package/samples/recipes/api-docs/api-examples/ticket-detail.json +28 -0
- package/samples/recipes/api-docs/api-examples/ticket-list.json +31 -0
- package/samples/recipes/api-docs/api-examples/ticket-update.json +54 -0
- package/samples/recipes/api-docs/api-examples/webhooks/ticket-closed.json +8 -0
- package/samples/recipes/api-docs/api-examples/webhooks/ticket-created.json +10 -0
- package/samples/recipes/api-docs/kumiko.config.ts +33 -0
- package/samples/recipes/api-docs/package.json +14 -0
- package/samples/recipes/api-docs/src/feature.ts +218 -0
- package/samples/recipes/api-docs/tsconfig.json +22 -0
- package/samples/recipes/golden-path/src/feature.ts +1 -1
- package/samples/recipes/{contact → helpdesk}/README.md +16 -16
- package/samples/recipes/{contact → helpdesk}/package.json +2 -2
- package/samples/recipes/{contact → helpdesk}/src/feature.ts +6 -6
- package/packages/bundled-features/src/contact/client/contact-website-client.ts +0 -29
- package/packages/bundled-features/src/contact/client/index.ts +0 -9
- package/packages/bundled-features/src/contact/index.ts +0 -29
- package/packages/bundled-features/src/contact/panels.ts +0 -28
- package/packages/bundled-features/src/contact/web/constants.ts +0 -160
- package/packages/bundled-features/src/contact/web/index.ts +0 -29
- package/samples/apps/marketing-demo/src/features/helpdesk/i18n.ts +0 -100
- package/samples/apps/marketing-demo/src/features/helpdesk/web/index.ts +0 -7
- /package/packages/bundled-features/src/{contact → helpdesk}/handlers/access.ts +0 -0
- /package/packages/bundled-features/src/{contact → helpdesk}/pow.ts +0 -0
- /package/packages/bundled-features/src/{contact → helpdesk}/user-agent.ts +0 -0
- /package/samples/apps/marketing-demo/src/features/{helpdesk → ticketing}/schema/index.ts +0 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import type { ApiDocsTexts } from "./types.ts";
|
|
2
|
+
|
|
3
|
+
export const itApiDocsTexts = {
|
|
4
|
+
text: {
|
|
5
|
+
"overview.title": "API HTTP",
|
|
6
|
+
"overview.description":
|
|
7
|
+
"Endpoint, corpo della richiesta, risposte, codici di errore, elenchi e batch dell'API HTTP.",
|
|
8
|
+
"overview.intro":
|
|
9
|
+
"Ogni chiamata è un POST con corpo JSON. Il campo `type` indica l'handler, `payload` contiene i suoi campi. Le pagine di riferimento elencano ogni handler con i suoi campi.",
|
|
10
|
+
"overview.endpoints.heading": "Endpoint",
|
|
11
|
+
"overview.endpoints.query": "Legge dati. Non modifica mai nulla.",
|
|
12
|
+
"overview.endpoints.write":
|
|
13
|
+
"Modifica dati: creare, aggiornare, eliminare o un'azione specifica.",
|
|
14
|
+
"overview.endpoints.batch": "Esegue più chiamate di scrittura in una transazione.",
|
|
15
|
+
"overview.auth.heading": "Autenticazione",
|
|
16
|
+
"overview.auth.body":
|
|
17
|
+
"Invia un token API nell'header `Authorization` come `Bearer <token>`. Le richieste con token non richiedono cookie né token CSRF. Il token stabilisce anche l'account in cui gira la richiesta, quindi non invii mai un ID di account o di tenant.",
|
|
18
|
+
"overview.body.heading": "Corpo della richiesta",
|
|
19
|
+
"overview.body.body":
|
|
20
|
+
"`type` è il nome dell'handler, per esempio `{exampleType}`. `payload` contiene i campi del riferimento. `requestId` è facoltativo, vedi sotto. Il payload può essere annidato al massimo per {maxDepth} livelli.",
|
|
21
|
+
"overview.responses.heading": "Risposte",
|
|
22
|
+
"overview.responses.success":
|
|
23
|
+
"Una lettura riuscita restituisce `data`. Una scrittura riuscita restituisce `isSuccess: true` e `data`.",
|
|
24
|
+
"overview.responses.error":
|
|
25
|
+
"In caso di errore lo stato HTTP è 4xx o 5xx e il corpo contiene `error`. Le chiamate di scrittura restituiscono anche `isSuccess: false`. Valuta `error.code` e lo stato. `message` è pensato per le persone e può cambiare.",
|
|
26
|
+
"overview.errors.heading": "Codici di errore",
|
|
27
|
+
"overview.errors.columns": "Codice | Stato HTTP | Significato",
|
|
28
|
+
"overview.versions.heading": "Versioni e conflitti",
|
|
29
|
+
"overview.versions.body":
|
|
30
|
+
"Ogni record ha una `version`. Un aggiornamento usa la `version` che hai letto per ultima. Se nel frattempo qualcuno ha modificato il record, la chiamata fallisce con 409 `version_conflict`. Rileggi il record, controlla la modifica e inviala con la nuova versione.",
|
|
31
|
+
"overview.lists.heading": "Elenchi",
|
|
32
|
+
"overview.lists.intro": "Gli handler di elenco finiscono con `:list` e accettano questi campi:",
|
|
33
|
+
"overview.lists.columns": "Campo | Tipo | Descrizione",
|
|
34
|
+
"overview.lists.response":
|
|
35
|
+
"La risposta contiene `rows` e `nextCursor`. Per la pagina successiva invia `nextCursor` come `cursor`. Nell'ultima pagina `nextCursor` è `null`.",
|
|
36
|
+
"overview.batch.heading": "Batch",
|
|
37
|
+
"overview.batch.body":
|
|
38
|
+
"`POST /api/batch` accetta `commands`, un elenco di chiamate di scrittura `{ type, payload }`. Vengono eseguite in una transazione: se una fallisce, nessuna ha effetto. La risposta ha allora `isSuccess: false`, l'`error` e `failedIndex`, la posizione del comando fallito contata da 0.",
|
|
39
|
+
"overview.retry.heading": "Ripetere in sicurezza",
|
|
40
|
+
"overview.retry.body":
|
|
41
|
+
"Invia un `requestId` con le chiamate di scrittura e di batch, una stringa qualsiasi unica per ogni modifica. Se la connessione cade e invii di nuovo la stessa chiamata con lo stesso `requestId`, ricevi il primo risultato e la modifica non viene eseguita due volte.",
|
|
42
|
+
"tokens.title": "Token API",
|
|
43
|
+
"tokens.description":
|
|
44
|
+
"Crea un token API per {appName}, scegli i suoi scope e invialo con le tue richieste.",
|
|
45
|
+
"tokens.intro":
|
|
46
|
+
"Un token API permette a uno script o a un altro servizio di chiamare l'API di {appName} a tuo nome. I suoi scope decidono quali dati può leggere o modificare.",
|
|
47
|
+
"tokens.create.heading": "Creare un token",
|
|
48
|
+
"tokens.create.step1": "Apri {menuPath}.",
|
|
49
|
+
"tokens.create.step2": "Scegli **{createLabel}**.",
|
|
50
|
+
"tokens.create.step3":
|
|
51
|
+
"Inserisci un nome, scegli gli scope e la scadenza e conferma con la tua password.",
|
|
52
|
+
"tokens.create.step4": "Copia il token. Inizia con `kpat_` e viene mostrato una sola volta.",
|
|
53
|
+
"tokens.expiry":
|
|
54
|
+
"Un token scade dopo {defaultDays} giorni se non scegli un'altra scadenza. La scadenza massima possibile è di {maxDays} giorni.",
|
|
55
|
+
"tokens.use.heading": "Usare il token",
|
|
56
|
+
"tokens.use.body":
|
|
57
|
+
"Invia il token nell'header `Authorization`. Le richieste con token non richiedono cookie né token CSRF.",
|
|
58
|
+
"tokens.scopes.heading": "Scope",
|
|
59
|
+
"tokens.scopes.intro":
|
|
60
|
+
"Ogni scope ha due livelli. `read` consente gli handler di lettura. `write` consente tutto ciò che consente `read` più gli handler di scrittura.",
|
|
61
|
+
"tokens.scopes.columns": "Scope | Permesso | Handler",
|
|
62
|
+
"tokens.rateLimit.heading": "Limite di richieste",
|
|
63
|
+
"tokens.rateLimit":
|
|
64
|
+
"Ogni token può inviare {max} richieste ogni {windowSeconds} secondi. Oltre, l'API risponde 429 `pat_rate_limited`.",
|
|
65
|
+
"tokens.errors.heading": "Errori",
|
|
66
|
+
"tokens.errors.columns": "Stato HTTP | Codice | Causa",
|
|
67
|
+
"tokens.errors.missing": "Manca l'header `Authorization`.",
|
|
68
|
+
"tokens.errors.invalid": "Il token è sconosciuto, revocato o scaduto.",
|
|
69
|
+
"tokens.errors.scope": "Al token manca lo scope per questo handler.",
|
|
70
|
+
"tokens.errors.route":
|
|
71
|
+
"L'endpoint non accetta token. I token funzionano solo sugli endpoint dell'API.",
|
|
72
|
+
"tokens.errors.rate": "Troppe richieste con questo token.",
|
|
73
|
+
"tokens.errors.disabled": "I token API non fanno parte del tuo piano.",
|
|
74
|
+
"tokens.revoke.heading": "Revocare un token",
|
|
75
|
+
"tokens.revoke.body":
|
|
76
|
+
"Revoca un token in {menuPath} non appena smetti di usarlo. Cambiare la password revoca tutti i tuoi token. Un token agisce sempre con i tuoi ruoli attuali. Se lasci l'account o il tuo utente viene eliminato, smette di funzionare.",
|
|
77
|
+
"tokens.security.heading": "Sicurezza",
|
|
78
|
+
"tokens.security.item1":
|
|
79
|
+
"Tratta un token come una password. Conservalo in un archivio di segreti, mai nel codice, in un repository, in un'app o pagina web o in un log.",
|
|
80
|
+
"tokens.security.item2":
|
|
81
|
+
"Dai a ogni script il suo token, con solo gli scope di cui ha bisogno.",
|
|
82
|
+
"tokens.security.item3":
|
|
83
|
+
"Revoca i token che non usi più. Revoca subito un token se potrebbe essere trapelato.",
|
|
84
|
+
"reference.description":
|
|
85
|
+
"Riferimento API per {scopeLabel}: ogni handler con i suoi campi e un esempio.",
|
|
86
|
+
"reference.requiredScope": "Scope richiesto",
|
|
87
|
+
"reference.endpoint": "Endpoint",
|
|
88
|
+
"reference.fields.columns": "Campo | Tipo | Obbligatorio | Descrizione",
|
|
89
|
+
"reference.yes": "sì",
|
|
90
|
+
"reference.no": "no",
|
|
91
|
+
"reference.noFields": "Questo handler non accetta campi.",
|
|
92
|
+
"reference.excluded": "Non impostabili tramite API: {fields}.",
|
|
93
|
+
"reference.exampleRequest": "Richiesta di esempio",
|
|
94
|
+
"reference.exampleResponse": "Risposta di esempio",
|
|
95
|
+
"reference.status": "Stato: {status}",
|
|
96
|
+
"events.title": "Eventi webhook",
|
|
97
|
+
"events.description":
|
|
98
|
+
"Eventi webhook: quando vengono inviati, quale scope richiedono e cosa contiene il loro payload.",
|
|
99
|
+
"events.intro":
|
|
100
|
+
"Un evento webhook segnala al tuo sistema che qualcosa è cambiato. Ogni evento ha un nome, una versione e un payload. Lo scope indicato per un evento è lo scope del token che permette di sottoscriverlo.",
|
|
101
|
+
"events.delivery.heading": "Consegna",
|
|
102
|
+
"events.versions.heading": "Versioni",
|
|
103
|
+
"events.versions.body":
|
|
104
|
+
"Aggiungere un campo facoltativo mantiene la versione. Una modifica incompatibile, come rimuovere o rinominare un campo o cambiarne il tipo, riceve una nuova versione.",
|
|
105
|
+
"events.list.heading": "Eventi",
|
|
106
|
+
"events.version": "Versione",
|
|
107
|
+
"events.requiredScope": "Scope richiesto",
|
|
108
|
+
"events.example": "Payload di esempio",
|
|
109
|
+
"events.noFields": "Questo evento non contiene campi.",
|
|
110
|
+
"events.entity.created": "È stato creato un record di tipo {entity}.",
|
|
111
|
+
"events.entity.updated": "È stato aggiornato un record di tipo {entity}.",
|
|
112
|
+
"events.entity.deleted": "È stato eliminato un record di tipo {entity}.",
|
|
113
|
+
},
|
|
114
|
+
errorMeanings: {
|
|
115
|
+
validation_error: "Il payload non corrisponde ai campi dell'handler. `details` indica i campi.",
|
|
116
|
+
unauthenticated: "Non sono state inviate credenziali valide.",
|
|
117
|
+
missing_token: "Manca l'header `Authorization`.",
|
|
118
|
+
invalid_token: "Il token è sconosciuto, revocato o scaduto.",
|
|
119
|
+
ambiguous_auth:
|
|
120
|
+
"La richiesta conteneva sia un cookie di sessione sia un token. Invia solo uno dei due.",
|
|
121
|
+
access_denied:
|
|
122
|
+
"Al token manca lo scope per questo handler, oppure l'endpoint non accetta token.",
|
|
123
|
+
feature_disabled: "Questa funzione è disattivata o non fa parte del tuo piano.",
|
|
124
|
+
not_found: "Il record non esiste o non puoi vederlo.",
|
|
125
|
+
conflict: "La modifica è in conflitto con lo stato attuale dei dati.",
|
|
126
|
+
version_conflict:
|
|
127
|
+
"Il record è cambiato dopo la tua lettura. Rileggilo e riprova con la nuova `version`.",
|
|
128
|
+
precondition_failed:
|
|
129
|
+
"Un campo del record non ha più il valore che la modifica si aspettava. Rileggi il record e riprova.",
|
|
130
|
+
record_locked: "Un'altra modifica blocca il record. Riprova tra poco.",
|
|
131
|
+
idempotent_replay:
|
|
132
|
+
"Questa modifica è già stata applicata con la stessa chiave di idempotenza. Il primo tentativo è riuscito, quindi non inviarla di nuovo.",
|
|
133
|
+
unique_violation: "Esiste già un record con questo valore.",
|
|
134
|
+
unprocessable:
|
|
135
|
+
"I dati sono validi, ma una regola di business rifiuta la modifica. `details.reason` indica la regola.",
|
|
136
|
+
unconfigured:
|
|
137
|
+
"Un'impostazione necessaria a questa funzione è ancora vuota. Configurala prima nell'app, poi riprova.",
|
|
138
|
+
internal_error: "Errore imprevisto del server. Riprova più tardi.",
|
|
139
|
+
member_read_timeout:
|
|
140
|
+
"Una lettura sul server ha impiegato troppo tempo ed è stata interrotta. Riprova più tardi.",
|
|
141
|
+
rate_limited:
|
|
142
|
+
"Troppe richieste. Attendi il numero di secondi indicato dall'header `Retry-After`.",
|
|
143
|
+
rate_limit_unavailable:
|
|
144
|
+
"Il limite di frequenza è temporaneamente non disponibile e la richiesta è stata rifiutata. Riprova tra poco.",
|
|
145
|
+
pat_rate_limited:
|
|
146
|
+
"Questo token ha inviato troppe richieste in poco tempo. Attendi un momento e riprova.",
|
|
147
|
+
},
|
|
148
|
+
listParameters: {
|
|
149
|
+
cursor: "Posizione da `nextCursor` della pagina precedente.",
|
|
150
|
+
limit: "Righe per pagina, {default} per impostazione predefinita, al massimo {max}.",
|
|
151
|
+
search: "Ricerca full-text nei campi ricercabili.",
|
|
152
|
+
sort: "Campo per cui ordinare.",
|
|
153
|
+
sortDirection: "`asc` o `desc`.",
|
|
154
|
+
offset: "Numero di righe da saltare. Per sfogliare è meglio `cursor`.",
|
|
155
|
+
totalCount: "Con `true` ricevi anche `total`, il numero di righe corrispondenti.",
|
|
156
|
+
includeDeleted:
|
|
157
|
+
"Con `true` sono incluse le righe eliminate. Solo per entità con eliminazione logica.",
|
|
158
|
+
onlyDeleted:
|
|
159
|
+
"Con `true` vengono restituite solo le righe eliminate. Solo per entità con eliminazione logica, non insieme a `includeDeleted`.",
|
|
160
|
+
filter: "Un filtro di campo con `field`, `op` e `value`. `op` è uno tra {ops}.",
|
|
161
|
+
filters: "Più filtri di campo, ciascuno con `field`, `op` e `value`. `op` è uno tra {ops}.",
|
|
162
|
+
namedFilter: "Nome di un filtro predefinito dell'entità, per esempio una coda di lavoro.",
|
|
163
|
+
aggregate: "Restituisce valori aggregati invece di righe.",
|
|
164
|
+
},
|
|
165
|
+
} as const satisfies ApiDocsTexts;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { patAuthRejectHttpStatus } from "@cosmicdrift/kumiko-framework/api";
|
|
2
|
+
import type { entityListSchema } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
|
+
import type { FrameworkErrorCode } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
|
+
import { isOneOf } from "@cosmicdrift/kumiko-types/type-guards";
|
|
5
|
+
|
|
6
|
+
export type DocumentedErrorCode = FrameworkErrorCode | keyof typeof patAuthRejectHttpStatus;
|
|
7
|
+
|
|
8
|
+
export type ListParameterKey = keyof typeof entityListSchema.shape;
|
|
9
|
+
|
|
10
|
+
// Headings, column heads and short labels: the page structure, never overridable.
|
|
11
|
+
export const structureTextKeys = [
|
|
12
|
+
"overview.title",
|
|
13
|
+
"overview.endpoints.heading",
|
|
14
|
+
"overview.auth.heading",
|
|
15
|
+
"overview.body.heading",
|
|
16
|
+
"overview.responses.heading",
|
|
17
|
+
"overview.errors.heading",
|
|
18
|
+
"overview.errors.columns",
|
|
19
|
+
"overview.versions.heading",
|
|
20
|
+
"overview.lists.heading",
|
|
21
|
+
"overview.lists.columns",
|
|
22
|
+
"overview.batch.heading",
|
|
23
|
+
"overview.retry.heading",
|
|
24
|
+
"tokens.title",
|
|
25
|
+
"tokens.create.heading",
|
|
26
|
+
"tokens.use.heading",
|
|
27
|
+
"tokens.scopes.heading",
|
|
28
|
+
"tokens.scopes.columns",
|
|
29
|
+
"tokens.rateLimit.heading",
|
|
30
|
+
"tokens.errors.heading",
|
|
31
|
+
"tokens.errors.columns",
|
|
32
|
+
"tokens.revoke.heading",
|
|
33
|
+
"tokens.security.heading",
|
|
34
|
+
"reference.requiredScope",
|
|
35
|
+
"reference.endpoint",
|
|
36
|
+
"reference.fields.columns",
|
|
37
|
+
"reference.yes",
|
|
38
|
+
"reference.no",
|
|
39
|
+
"reference.exampleRequest",
|
|
40
|
+
"reference.exampleResponse",
|
|
41
|
+
"reference.status",
|
|
42
|
+
"events.title",
|
|
43
|
+
"events.delivery.heading",
|
|
44
|
+
"events.versions.heading",
|
|
45
|
+
"events.list.heading",
|
|
46
|
+
"events.version",
|
|
47
|
+
"events.requiredScope",
|
|
48
|
+
"events.example",
|
|
49
|
+
] as const;
|
|
50
|
+
|
|
51
|
+
// Running text: an app may replace single paragraphs through `apiDocs.texts`.
|
|
52
|
+
export const paragraphTextKeys = [
|
|
53
|
+
"overview.description",
|
|
54
|
+
"overview.intro",
|
|
55
|
+
"overview.endpoints.query",
|
|
56
|
+
"overview.endpoints.write",
|
|
57
|
+
"overview.endpoints.batch",
|
|
58
|
+
"overview.auth.body",
|
|
59
|
+
"overview.body.body",
|
|
60
|
+
"overview.responses.success",
|
|
61
|
+
"overview.responses.error",
|
|
62
|
+
"overview.versions.body",
|
|
63
|
+
"overview.lists.intro",
|
|
64
|
+
"overview.lists.response",
|
|
65
|
+
"overview.batch.body",
|
|
66
|
+
"overview.retry.body",
|
|
67
|
+
"tokens.description",
|
|
68
|
+
"tokens.intro",
|
|
69
|
+
"tokens.create.step1",
|
|
70
|
+
"tokens.create.step2",
|
|
71
|
+
"tokens.create.step3",
|
|
72
|
+
"tokens.create.step4",
|
|
73
|
+
"tokens.expiry",
|
|
74
|
+
"tokens.use.body",
|
|
75
|
+
"tokens.scopes.intro",
|
|
76
|
+
"tokens.rateLimit",
|
|
77
|
+
"tokens.errors.missing",
|
|
78
|
+
"tokens.errors.invalid",
|
|
79
|
+
"tokens.errors.scope",
|
|
80
|
+
"tokens.errors.route",
|
|
81
|
+
"tokens.errors.rate",
|
|
82
|
+
"tokens.errors.disabled",
|
|
83
|
+
"tokens.revoke.body",
|
|
84
|
+
"tokens.security.item1",
|
|
85
|
+
"tokens.security.item2",
|
|
86
|
+
"tokens.security.item3",
|
|
87
|
+
"reference.description",
|
|
88
|
+
"reference.noFields",
|
|
89
|
+
"reference.excluded",
|
|
90
|
+
"events.description",
|
|
91
|
+
"events.intro",
|
|
92
|
+
"events.versions.body",
|
|
93
|
+
"events.noFields",
|
|
94
|
+
"events.entity.created",
|
|
95
|
+
"events.entity.updated",
|
|
96
|
+
"events.entity.deleted",
|
|
97
|
+
] as const;
|
|
98
|
+
|
|
99
|
+
export type StructureTextKey = (typeof structureTextKeys)[number];
|
|
100
|
+
export type ParagraphTextKey = (typeof paragraphTextKeys)[number];
|
|
101
|
+
export type ApiDocsTextKey = StructureTextKey | ParagraphTextKey;
|
|
102
|
+
|
|
103
|
+
export type ApiDocsTexts = {
|
|
104
|
+
readonly text: Readonly<Record<ApiDocsTextKey, string>>;
|
|
105
|
+
readonly errorMeanings: Readonly<Record<DocumentedErrorCode, string>>;
|
|
106
|
+
readonly listParameters: Readonly<Record<ListParameterKey, string>>;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const PLACEHOLDER = /\{([A-Za-z][A-Za-z0-9]*)\}/g;
|
|
110
|
+
|
|
111
|
+
export function placeholdersOf(template: string): ReadonlySet<string> {
|
|
112
|
+
return new Set([...template.matchAll(PLACEHOLDER)].map((match) => match[1] ?? ""));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function formatApiDocsText(
|
|
116
|
+
template: string,
|
|
117
|
+
params: Readonly<Record<string, string | number>> = {},
|
|
118
|
+
): string {
|
|
119
|
+
return template.replace(PLACEHOLDER, (_whole, name: string) => {
|
|
120
|
+
const value = params[name];
|
|
121
|
+
if (value === undefined) {
|
|
122
|
+
throw new Error(`API docs text is missing the parameter "${name}": ${template}`);
|
|
123
|
+
}
|
|
124
|
+
return String(value);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function isParagraphTextKey(key: string): key is ParagraphTextKey {
|
|
129
|
+
return isOneOf(paragraphTextKeys, key);
|
|
130
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { qnMatches } from "@cosmicdrift/kumiko-framework/api";
|
|
2
|
+
import type { ScreenDefinition } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
|
+
import { isPlainObject } from "@cosmicdrift/kumiko-types/type-guards";
|
|
4
|
+
import { compareIds } from "../labels.ts";
|
|
5
|
+
import type { RegistryManifestView } from "../types.ts";
|
|
6
|
+
import type { ApiDocsModel } from "./model.ts";
|
|
7
|
+
import { type ApiDocsProblem, sortApiDocsProblems } from "./problems.ts";
|
|
8
|
+
import { isSystemOnlyHandler } from "./system-only.ts";
|
|
9
|
+
|
|
10
|
+
type UiOnlyWrite = { readonly pattern: string; readonly reason: string };
|
|
11
|
+
|
|
12
|
+
function collectStrings(value: unknown, into: Set<string>, seen: WeakSet<object>): void {
|
|
13
|
+
if (typeof value === "string") {
|
|
14
|
+
into.add(value);
|
|
15
|
+
// skip: a string is a leaf, nothing to descend into
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
// skip: primitives and already visited objects add no further strings
|
|
19
|
+
if (typeof value !== "object" || value === null || seen.has(value)) return;
|
|
20
|
+
seen.add(value);
|
|
21
|
+
const children = Array.isArray(value) ? value : isPlainObject(value) ? Object.values(value) : [];
|
|
22
|
+
for (const child of children) collectStrings(child, into, seen);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function featureOf(qualifiedId: string): string {
|
|
26
|
+
return qualifiedId.split(":")[0] ?? qualifiedId;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// An entityEdit screen names no handler: saving runs the entity's generated create/update.
|
|
30
|
+
function entityEditWrites(screen: ScreenDefinition): readonly string[] {
|
|
31
|
+
if (screen.type !== "entityEdit") return [];
|
|
32
|
+
const feature = featureOf(screen.id);
|
|
33
|
+
const entity = screen.entity.slice(screen.entity.lastIndexOf(":") + 1);
|
|
34
|
+
return [`${feature}:write:${entity}:create`, `${feature}:write:${entity}:update`];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Write QN to the ids of the screens that trigger it. */
|
|
38
|
+
export function writesByScreen(
|
|
39
|
+
registry: RegistryManifestView,
|
|
40
|
+
): ReadonlyMap<string, readonly string[]> {
|
|
41
|
+
const registered = new Set(registry.getAllWriteHandlers().keys());
|
|
42
|
+
const screensOfWrite = new Map<string, Set<string>>();
|
|
43
|
+
for (const [screenId, screen] of registry.getAllScreens()) {
|
|
44
|
+
const strings = new Set<string>(entityEditWrites(screen));
|
|
45
|
+
collectStrings(screen, strings, new WeakSet());
|
|
46
|
+
for (const candidate of strings) {
|
|
47
|
+
if (!registered.has(candidate)) continue;
|
|
48
|
+
const screens = screensOfWrite.get(candidate) ?? new Set<string>();
|
|
49
|
+
screens.add(screenId);
|
|
50
|
+
screensOfWrite.set(candidate, screens);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return new Map([...screensOfWrite].map(([qn, screens]) => [qn, [...screens].sort(compareIds)]));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** UI writes that no token scope reaches, in features the docs otherwise cover. */
|
|
57
|
+
export function uiWriteProblems(
|
|
58
|
+
registry: RegistryManifestView,
|
|
59
|
+
model: ApiDocsModel,
|
|
60
|
+
uiOnlyWrites: readonly UiOnlyWrite[],
|
|
61
|
+
): readonly ApiDocsProblem[] {
|
|
62
|
+
const inScope = new Set(model.handlers.map((handler) => handler.qn));
|
|
63
|
+
const coveredFeatures = new Set([...inScope].map(featureOf));
|
|
64
|
+
const usedPatterns = new Set<string>();
|
|
65
|
+
const problems: ApiDocsProblem[] = [];
|
|
66
|
+
const writeHandlers = registry.getAllWriteHandlers();
|
|
67
|
+
for (const [qn, screens] of writesByScreen(registry)) {
|
|
68
|
+
if (inScope.has(qn) || !coveredFeatures.has(featureOf(qn))) continue;
|
|
69
|
+
const handler = writeHandlers.get(qn);
|
|
70
|
+
if (handler !== undefined && isSystemOnlyHandler(handler)) continue;
|
|
71
|
+
const matching = uiOnlyWrites.filter((entry) => qnMatches(entry.pattern, qn));
|
|
72
|
+
for (const entry of matching) usedPatterns.add(entry.pattern);
|
|
73
|
+
if (matching.length === 0) problems.push({ kind: "uiWriteOutsideScopes", qn, screens });
|
|
74
|
+
}
|
|
75
|
+
for (const entry of uiOnlyWrites) {
|
|
76
|
+
if (!usedPatterns.has(entry.pattern)) {
|
|
77
|
+
problems.push({ kind: "unusedUiOnlyWrite", pattern: entry.pattern });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return sortApiDocsProblems(problems);
|
|
81
|
+
}
|
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.412.0",
|
|
4
|
+
"type": "improvement",
|
|
5
|
+
"title": "kumiko api-docs generates HTTP API docs from the registry and the PAT scopes",
|
|
6
|
+
"detail": "`kumiko api-docs [--out <dir>] [--locales en,de] [--check]` reads `kumiko.config.ts` and writes `<out>/openapi.json` (OpenAPI 3.1 with only the handlers some PAT scope reaches, one request wrapper per handler with a `type` discriminator), `<out>/<locale>/overview.md` (endpoints, body, envelopes, error codes with HTTP status, versions, lists, batches, safe retries), `<out>/<locale>/tokens.md` (create path from the app's nav labels, scope table, expiry, rate limit, errors, revoke, security, optional plan note) and `<out>/<locale>/reference/<scope>.md` (per handler: title, description, required grant, field table, curl example, recorded response), plus `<out>/index.json` with order, source versions and language independent anchor ids per heading. Output is plain GFM with only `title` and `description` in the frontmatter, so Astro and Starlight render it as is, and it is byte identical for the same input. New `AppConfig.apiDocs` options: `appName`, `baseUrl` (required), `locales`, `planNote`, `uiOnlyWrites` (pattern plus reason), `texts` (paragraph overrides per locale) and `examplesDir`. `--check` writes nothing and exits 1 when a handler in a scope has no description or no description translation (new gap kind `handlerWithoutDescriptionTranslation`, key `handlerDescriptionKey(qn)`), when a write that a screen triggers lies in no scope and is not listed in `uiOnlyWrites`, when a `uiOnlyWrites` entry matches nothing, or when the committed output differs. Known gap: the screen write check only looks at features with at least one handler in a scope. New exports: `frameworkErrorHttpStatus`, `FrameworkErrorCode`, `patAuthRejectHttpStatus`, `PAT_RATE_LIMITED_CODE`, `qnMatches`, `patAllows`, `handlerDescriptionKey`, `patScopesFromFeature`, `PAT_MAX_EXPIRES_IN_DAYS`, and `ApiExampleFileSchema` from `@cosmicdrift/kumiko-types/api-example`."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"version": "0.412.0",
|
|
10
|
+
"type": "improvement",
|
|
11
|
+
"title": "api-docs token guide covers client code, logs and leaks",
|
|
12
|
+
"detail": "The security list in `tokens.md` now says never to keep a token in an app or web page or in a log, and to revoke a token at once if it may have leaked, in all five locales. Regenerate with `kumiko api-docs`; `--check` reports the changed `tokens.md` until then."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"version": "0.412.0",
|
|
16
|
+
"type": "improvement",
|
|
17
|
+
"title": "api-docs names events by wireName and skips system-only handlers",
|
|
18
|
+
"detail": "`events.md` headings and anchors, the OpenAPI `webhooks` keys and their `summary` use the wire name; the contract QN stays as `x-kumiko-qn` in OpenAPI and as the anchor `qn` in `index.json`. Write and query handlers whose `access.roles` are only `[\"system\"]` are no longer documented, even when a scope pattern such as `app:write:monitor:*` matches them, and the `uiWriteOutsideScopes` check ignores them."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"version": "0.412.0",
|
|
22
|
+
"type": "improvement",
|
|
23
|
+
"title": "kumiko api-docs documents webhook events",
|
|
24
|
+
"detail": "When a scope lists events, the output gains `<locale>/events.md` (delivery text from `apiDocs.webhookDelivery`, versioning rules, one section per event with fields and a recorded example), an OpenAPI 3.1 `webhooks` section keyed by event name and an `events` page in `index.json`. New problems `webhookDeliveryTextMissing` and `webhookEventWithoutDescriptionTranslation`. Field descriptions come from `.describe()` on declared payloads and from the entity field translations on derived ones. `ApiDocsInput.webhookExamples` is optional; `kumiko api-docs` reads `<examplesDir>/webhooks/*.json`."
|
|
25
|
+
},
|
|
2
26
|
{
|
|
3
27
|
"version": "0.409.0",
|
|
4
28
|
"type": "improvement",
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { QueryHandlerDef, WriteHandlerDef } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
+
import { SYSTEM_ONLY_JSON_SCHEMA_KEY } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
|
+
import { isPlainObject } from "@cosmicdrift/kumiko-types/type-guards";
|
|
4
|
+
import * as z from "zod";
|
|
5
|
+
|
|
6
|
+
// Agent dispatch never runs as a system identity, so properties the engine only
|
|
7
|
+
// honors for system callers would be silently dropped — hide them from the tool.
|
|
8
|
+
export function systemOnlyPropertyNames(jsonSchema: Record<string, unknown>): readonly string[] {
|
|
9
|
+
const properties = jsonSchema["properties"];
|
|
10
|
+
if (typeof properties !== "object" || properties === null) return [];
|
|
11
|
+
return Object.entries(properties)
|
|
12
|
+
.filter(
|
|
13
|
+
([, property]) => isPlainObject(property) && property[SYSTEM_ONLY_JSON_SCHEMA_KEY] === true,
|
|
14
|
+
)
|
|
15
|
+
.map(([name]) => name);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function withoutSystemOnlyProperties(
|
|
19
|
+
jsonSchema: Record<string, unknown>,
|
|
20
|
+
): Readonly<Record<string, unknown>> {
|
|
21
|
+
const properties = jsonSchema["properties"];
|
|
22
|
+
if (typeof properties !== "object" || properties === null) return jsonSchema;
|
|
23
|
+
const hidden = systemOnlyPropertyNames(jsonSchema);
|
|
24
|
+
if (hidden.length === 0) return jsonSchema;
|
|
25
|
+
const required = jsonSchema["required"];
|
|
26
|
+
return {
|
|
27
|
+
...jsonSchema,
|
|
28
|
+
properties: Object.fromEntries(
|
|
29
|
+
Object.entries(properties).filter(([name]) => !hidden.includes(name)),
|
|
30
|
+
),
|
|
31
|
+
...(Array.isArray(required) && { required: required.filter((name) => !hidden.includes(name)) }),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** `undefined` when the schema can't be expressed as JSON Schema (transforms,
|
|
36
|
+
* z.instanceof, ...) — such a handler is unusable for an agent tool call. */
|
|
37
|
+
export function handlerInputJsonSchema(
|
|
38
|
+
def: QueryHandlerDef | WriteHandlerDef,
|
|
39
|
+
): Readonly<Record<string, unknown>> | undefined {
|
|
40
|
+
try {
|
|
41
|
+
return withoutSystemOnlyProperties(z.toJSONSchema(def.schema, { io: "input" }));
|
|
42
|
+
} catch {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -2,10 +2,34 @@ export type { AgentDocGap, AgentDocGapKind } from "./agent-doc-lint.ts";
|
|
|
2
2
|
export {
|
|
3
3
|
AgentDocGapKinds,
|
|
4
4
|
findAgentDocGaps,
|
|
5
|
+
findDescriptionTranslationGaps,
|
|
5
6
|
findHandlerTranslationGaps,
|
|
6
7
|
formatAgentDocGap,
|
|
7
8
|
} from "./agent-doc-lint.ts";
|
|
8
9
|
export { buildAgentManifest } from "./agent-manifest.ts";
|
|
10
|
+
export {
|
|
11
|
+
type ApiDocsDiff,
|
|
12
|
+
type ApiDocsInput,
|
|
13
|
+
type ApiDocsLocale,
|
|
14
|
+
type ApiDocsProblem,
|
|
15
|
+
type ApiDocsResult,
|
|
16
|
+
type ApiDocsSource,
|
|
17
|
+
type ApiDocsTexts,
|
|
18
|
+
type ApiExampleFile,
|
|
19
|
+
ApiExampleFileSchema,
|
|
20
|
+
apiDocsLocales,
|
|
21
|
+
diffApiDocsOutput,
|
|
22
|
+
formatApiDocsProblem,
|
|
23
|
+
formatApiDocsText,
|
|
24
|
+
generateApiDocs,
|
|
25
|
+
INDEX_FILE,
|
|
26
|
+
isApiDocsLocale,
|
|
27
|
+
type NamedApiExample,
|
|
28
|
+
type NamedWebhookExample,
|
|
29
|
+
OPENAPI_FILE,
|
|
30
|
+
type ResolvedApiDocsConfig,
|
|
31
|
+
WebhookExampleFileSchema,
|
|
32
|
+
} from "./api-docs/index.ts";
|
|
9
33
|
export { AGENT_TOOLS_FEATURE_NAME, createAgentToolsFeature } from "./feature.ts";
|
|
10
34
|
export { buildToolCatalog, OPEN_FORM_TOOL_NAME, toolNameForQn } from "./tool-catalog.ts";
|
|
11
35
|
export type { ToolCallRequest, ToolCallResult, ToolDispatcher } from "./tool-dispatch.ts";
|