Commit Graph
86 Commits
Author SHA1 Message Date
apairon 7cdc0ab719 ✨ types(tasks): allowAnonymous (Default-deny für context.enqueue) 2026-11-14 20:49:57 +00:00
apairon e8cf990959 ✨ types(hooks): fs.copyAsync/removeAsync, context.after auch für Jobs/Tasks
continuous-integration/drone/push Build is passing
2026-11-14 19:30:38 +00:00
apairon 3ef0d86290 ✨ types(hooks): …Async-Zwillinge, context.after/enqueue, TaskConfig
continuous-integration/drone/push Build is passing
- `http.fetchAsync`, `http.fetchStreamAsync`, `fs.readFileAsync`,
  `fs.writeFileAsync`, `smtp.sendMailAsync`, `exec.commandAsync`,
  `image.filterAsync`, `pdf.fromHTMLAsync`, `pdf.cpuAsync` — gespiegelte
  Signaturen der jeweiligen sync-Methode (ein Go-Kern, zwei Registrierungen).
- `HookContext.after(fn)` und `HookContext.enqueue(task, data?)`, inklusive
  Semantik in den Doc-Kommentaren (nach der Antwort, 2 s; durable, Name wird
  geprüft, Payload ≤ 64 KB).
- `TaskConfig` (Spiegel von task.schema.json) und `HookContext.task`; im
  Task-Skript ist der Payload die globale Variable `data`.
2026-11-14 13:38:40 +00:00
apairon 77c6891c6f 🧹 types: engine/jsEngine erlauben "" (Default) wie die Schemas
continuous-integration/drone/push Build is passing
2026-11-13 10:47:52 +00:00
apairon 85c7a5d99d 🐛 types(config): Compound-Durations und leere Engine-Werte erlauben, js-Block in server() 2026-11-13 10:46:12 +00:00
apairon e935dc7cc1 ✨ types(config): engine/jsEngine und Duration-Timeouts
- hooks.schema.json: `timeout` akzeptiert Integer (ms) oder Go-Duration-String;
  neu `engine` (goja|v8) und `ignoreRequestCancel`.
- job.schema.json: `timeout` Integer oder String; neu `engine`.
- project.schema.json: neu `jsEngine` (goja|v8).
- index.d.ts: JobConfig.timeout ist `number | string` (Beschreibung war
  fälschlich "seconds"), neu `engine`.
2026-11-13 10:41:03 +00:00
apairon 9fa0aff643 ✨ types(webauthn): kind an der Credential-Ansicht
continuous-integration/drone/push Build is passing
Spiegelt die Enrollment-Art: passkey (discoverable) oder security_key
(nicht resident, nur zweiter Faktor). Leer bei Altbeständen.
2026-11-12 16:56:25 +00:00
apairon a6d2d6bcca ✨ types(mfa): emailAvailable im MFA-Status
continuous-integration/drone/push Build is passing
Spiegelt auth.mfa.allowEmailFallback: die UI blendet den E-Mail-Faktor aus,
wenn der Betreiber ihn serverseitig abgeschaltet hat.
2026-11-12 15:16:28 +00:00
apairon 18a76b04d5 feat(schema): ngram.inMemory.maxFilterCandidates
Neue optionale Kappe je Search-Config: wie viele Index-Kandidaten gegen den
Query-Filter geprüft werden, bevor die Suche auf den regulären Pfad
zurückfällt. 0 = Server-Default (search.inMemory.maxFilterCandidates, 500000),
negativ = keine Kappe. Die Prüfung läuft gestückelt und stoppt, sobald die
Seite voll ist (tibi-server 09aaaf56).
2026-11-11 16:46:32 +00:00
apairon 11069d83d4 ✨ feat(actions): meta.openapi für Aktionen typisieren und validieren (#40)
continuous-integration/drone/push Build is passing
Aktionen erscheinen in der generierten OpenAPI-Spec als /_actions/<name>.
Dafür trägt die Action-Meta jetzt denselben openapi-Block wie eine Sammlung:

- action.schema.json: meta.openapi referenziert openapi.schema.json
  (bisher lehnte additionalProperties: false den Block ab).
- openapi.schema.json: Beschreibung deckt Sammlung und Aktion ab, get/getOne/
  post/put/delete sind entsprechend erläutert.
- index.d.ts: ActionMeta.openapi plus OpenapiMeta/OpenapiOperationMeta/
  OpenapiParameter.
- demo-api/actions/demo-action.yml und types-test/action-openapi.ts zeigen
  und prüfen die Form.
2026-11-11 08:50:17 +00:00
apairon 4e13d4ab9a ✨ types(hooks): LockPackage für context.lock
continuous-integration/drone/push Build is passing
acquire/release/isHeld/held/count/waiters inklusive LockHandle mit
reentrant-Kennzeichen. Gehört zu tibi-server #31.
2026-11-09 16:40:05 +00:00
apairon c91b377c40 ✨ types(auth): Passwort-Reset-Verträge
continuous-integration/drone/push Build is passing
`AdminPasswordResetRequest` und `AdminPasswordResetConfirm` für den
E-Mail-Code-Reset (erster Faktor only, keine Sitzung).
2026-11-06 22:49:29 +00:00
apairon 59841adf9c ✨ types(auth): E-Mail-Rückfallebene und gemerkte Geräte
- `AdminMfaChallenge` trägt `mfaEnrollmentRecommended` und `rememberDeviceDays`.
- `AdminMfaStatus.emailFallback` markiert die erzwungene Rückfallebene.
- `AdminTrustedDevice`/`AdminTrustedDevices` für die Geräteliste.
- `AdminAuthMethod` kennt `trusted_device` und `impersonation`; `AdminMfaMethod`
  schließt beide aus.
2026-11-06 21:27:31 +00:00
apairon 2187ef3d1c ✨ types(auth): Admin-Übersicht und Nutzer-MFA-Status
`AdminMfaOverview` (Quote: Nutzer, mit/ohne Faktor, erzwungen, Policy) und
`AdminUserMfaStatus` (Faktorstatus eines Kontos für die Admin-Sicht).
2026-11-06 20:34:56 +00:00
apairon 5bf93ef035 ✨ types(auth): Passkey-Optionen für den passwortlosen Login
`AdminPasskeyOptions` mit `publicKey` (Request-Options) und dem kurzlebigen
`challengeToken`, der die Assertion an die Server-Challenge bindet.
2026-11-06 20:19:08 +00:00
apairon ba549a016b ✨ types(auth): E-Mail-Faktor und maskierter Hinweis
- `AdminAuthMethod`/`AdminMfaMethod` enthalten jetzt `email`.
- `AdminMfaStatus` um `emailEnabled`, `email` (maskiert), `emailVerified`
  erweitert.
- `AdminMfaChallenge.emailHint` für die maskierte Adresse, wenn der Faktor
  angeboten wird.
- Type-Test deckt die neue Methode und den Status ab.
2026-11-06 19:33:11 +00:00
apairon 2546d05b25 ✨ types(auth): Admin-Login-, MFA- und WebAuthn-Verträge
Eine Quelle für Server und Admin-UI:
- `AdminLoginResponse`: Union aus `AdminMfaChallenge` (`mfaRequired: true`)
  und `AdminLoginSession` (`token`, `user`, `amr`, `mfaEnrollmentRecommended`).
  Die Diskriminante ist `mfaRequired`, damit Clients sauber narrowen.
- `AdminAuthMethod` (`pwd|totp|recovery|webauthn`) vs. `AdminMfaMethod`
  (ohne `pwd`) — Go schreibt `pwd` immer in `amr`, bietet es aber nie als
  Faktor an.
- `AdminMfaStatus`, `AdminMfaTotpEnrollment`, `AdminMfaConfirmResult`,
  `AdminStepUpResult`.
- WebAuthn: `AdminWebAuthnCreationOptions`,
  `AdminWebAuthnRequestOptions`, `AdminWebAuthnCredentialJSON`,
  `AdminWebAuthnCredentialView`, `AdminAuthenticatorTransport`.

Type-Tests in `types-test/admin-auth.ts`: `Expect<Equal<…>>`-Assertions und
`@ts-expect-error` für die nicht möglichen Felder der Challenge. `npm test`
führt jetzt Schemas **und** `tsc` aus (TypeScript als devDependency).
2026-11-06 19:09:14 +00:00
apairon 24c2d34b3a ✨ types(hooks): webauthn-Paket (Passkeys/WebAuthn Level 2)
- `WebAuthnPackage` mit `verifyRegistration` und `verifyAssertion`, verdrahtet
  in `HookContext`.
- `WebAuthnRegistrationOptions`/`WebAuthnAssertionOptions`,
  `WebAuthnCredentialJSON` (Binärfelder base64url oder Byte-Array).
- Diskriminierte Ergebnistypen: `verified: true` mit Credential-Daten bzw.
  `verified: false` mit `WebAuthnErrorCode` und optionalem Detail.
- `attestationTrusted` als explizite Warnung: heute immer `false`, die AAGUID
  ist damit nicht authentisiert.
2026-11-06 14:58:24 +00:00
apairon b80af7ae58 ✨ types(hooks): AES-256-GCM und HKDF im crypto-Paket (#65)
continuous-integration/drone/push Build is passing
- SealedValue { iv, ciphertext, tag } (base64)
- encrypt/decrypt mit key, aad und encoding
- deriveKey (HKDF-SHA256) mit info, length und encoding

Refs #65
2026-11-05 10:20:25 +00:00
apairon 8f17bb7ad4 ✨ types(config): Projekt-Secrets (#66)
ConfigPackage.secret(name): string | null und secretNames(): string[]
ergänzt; project.schema.json erlaubt den secrets-Block (string-Map) mit
Hinweis, dass die Werte nie in API-Antworten oder config.project() landen.

Refs cms/tibi-server#66
2026-11-04 20:26:39 +00:00
apairon 081a87c492 ✨ types(hooks): totp-Paket (#63)
TotpPackage mit generate/verify/uri, TotpOptions (digits, period,
algorithm, t) und window beim Verify; totp im HookContext registriert.
Kommentare nennen Defaults, die State-Losigkeit und dass t nicht aus
Nutzereingaben kommen darf.

Refs cms/tibi-server#63
2026-11-04 19:42:25 +00:00
apairon b5a6c3657d ✨ types(hooks): base64-Varianten und padding (#62)
BaseVariant, Base64Options, Base64DecodeOptions; encode/decode typisieren
variant (base64|base64url|base32) und padding. Overloads erhalten den
Rückgabetyp abhängig von returnBytes.

Refs cms/tibi-server#62
2026-11-04 14:50:37 +00:00
apairon ce0ac300f5 ✨ types(hooks): crypto.hmac und timingSafeEqual (#60)
hmac mit sha1|sha256|sha512, Schlüssel/Daten als String oder Bytes und
encoding-abhängigem Rückgabetyp; timingSafeEqual als boolean. Kommentare
nennen die Begründung für SHA-1 (TOTP) und die Length-Grenze.

Refs cms/tibi-server#60
2026-11-04 14:20:15 +00:00
apairon cbec4753a1 ✨ types(audit): excludeFields und AuditEntry (#67)
collection.audit.excludeFields (dot notation) hält Werte aus dem Audit-Verlauf
heraus; AuditLog.redactedFields nennt die betroffenen Pfade. AuditEntry ist
jetzt als Typ deklariert, damit Clients das Feld sehen.

Refs cms/tibi-server#67
2026-11-04 13:33:58 +00:00
apairon 779dd574fc ✨ types(hooks): crypto.randomBytes und randomToken (#61)
randomBytes gibt je nach encoding Int8Array oder string zurück,
randomToken immer string (Default ungepolstertes base64url). Der neue Typ
ByteEncoding (hex|base64|base64url|bytes) wird von den kommenden
base64-/crypto-Erweiterungen mitgenutzt.

Refs cms/tibi-server#61
2026-11-04 13:22:30 +00:00
apairon 5458214ad9 Schema: cache.image im Projekt und optionaler Asset-cachePath
continuous-integration/drone/push Build is passing
- project.schema.json: cache.image.{path, autoCleanup.{maxAge,maxFiles,tempMaxAge}};
  Server-only-Knöpfe (enabled, interval, Laufbudgets) sind bewusst nicht vorgesehen.
- asset.schema.json: cachePath optional, ohne Pflicht-Verzeichnis, verweist auf
  cache.image.path als Default.
- index.d.ts und Beispiel-YAML nachgezogen.
2026-10-29 12:48:36 +00:00
apairon 8ca80136f4 Schema: outputType um bmp/tiff/gif ergaenzt
continuous-integration/drone/push Build is passing
Server akzeptiert jetzt jpeg, png, webp, bmp, tiff, gif; GIF wird wieder
gelesen (erstes Frame).
2026-10-27 20:50:18 +00:00
apairon 913d5f4cb6 Schema: Bildoperationen (removeBackground/dropShadow/flatten) und Asset-Bildmodus
- image-filter.schema.json: removeBackground (color/tolerance/fromEdges/edgeBlur/
  referenceWidth), dropShadow (color/opacity/blur/offsets/padding/referenceWidth/
  canvas/background), flatten; Tippfehler mitchellNetravili -> mitchellNetravali
- asset.schema.json: optionaler imageProcessing-Block (access/cachePath/
  allowOriginal/defaultFilter/allowedInputTypes/limits/imageFilter)
- index.d.ts: passende Interfaces inkl. AssetConfig
- Beispiel: examples/server/asset-image-processing.yml, demo-api imageFilter.shadow
- validate-schemas.mjs: examples/server-Pattern je Schema
2026-10-27 18:04:55 +00:00
apairon 439c8773e6 feat(schema): add custom tools config and runtime types
continuous-integration/drone/push Build is passing
2026-10-20 20:45:19 +00:00
apairon 21472bdc72 Schema: ngram.sizes auf 2–10 begrenzen, combinedCache ergänzen
continuous-integration/drone/push Build is passing
Die Gesamtabnahme fand zwei Lücken im Config-Vertrag:

- ngram.sizes erlaubte minimum 1 und hatte kein maximum; der Server akzeptiert
  nur 2–10 (collection_setup.go) — das Schema ließ also Configs durch, die beim
  Projektload scheitern.
- combinedCache fehlte komplett, obwohl Server (models.CombinedCacheConfig) und
  Doku den Block als Projekt-YAML führen; additionalProperties:false lehnte
  gültige, dokumentierte Configs ab.

Ergänzt in collection.schema.json und index.d.ts (CombinedCacheConfig mit
enabled/ttl/maxEntries). Die Demo-Collection ngram-stopwords.yml enthält jetzt
eine Combined-Config mit combinedCache, sodass validate:schemas den Block
abdeckt. Gegenprobe per AJV: sizes [1] und [11] werden abgelehnt, [2,3] und
combinedCache akzeptiert.
2026-10-19 22:34:56 +00:00
apairon 9e12a8e9c3 Schema: ngram.stopwords, queryFilter und inMemory ergänzen
continuous-integration/drone/push Build is passing
Der Config-Vertrag kannte nur sizes und normalize. Damit lehnte
`validate:schemas` jedes Projekt ab, das die bereits im Server vorhandenen
ngram-Optionen nutzt (additionalProperties: false), und die generierte
Schema-Referenz konnte sie nie zeigen.

Ergänzt in collection.schema.json und index.d.ts:

- stopwords: { presets?: string[], words?: string[] }
- queryFilter: { minMatchRatio?: 0..1 }
- inMemory: { enabled?, maxDocs?, maxMemoryMB? }

plus demo-api/collections/ngram-stopwords.yml als Validierungs-Fixture; ohne
Schema-Erweiterung schlägt validate:schemas dort mit "must NOT have additional
properties" fehl.
2026-10-19 20:48:10 +00:00
apairon 1233bd393d fix(schema): latencyWindow ist ein String, duration-Muster folgt der Go-Grammatik
Review-Nachbefunde am neuen embedding-Schema:
- latencyWindow war als integer/number deklariert, ist in Go aber ein String
  (ConfigEmbeddingGroup.OnSingleQuery.LatencyWindow, per Atoi geprüft) — Schema
  und index.d.ts auf digits-String (>0) umgestellt.
- duration-Pattern erlaubte nur eine Einheit und akzeptierte Unsinn wie "1ss":
  jetzt (Zahl+Einheit)+, damit auch 1m30s/1h1m/1.5h gelten und 1ss/8/abc fallen.
- Beispiel examples/server/embedding.yml übt latencyWindow und Mehrfach-Einheiten
  aus (npm test: 5 YAML gegen 17 Schemas, tsc --noEmit --strict grün).
2026-10-17 14:07:30 +00:00
apairon 5a45c4dd3f feat(types): Embedding-Abschnitt der Server-Config (Provider, Failover-Gruppen, goldener Pfad) + Status-Payloads
index.d.ts: EmbeddingProviderConfig/EmbeddingGroupConfig (onSingleQuery, onBulkWrite,
health), EmbeddingConfig für config.server().embedding (Roh-JSON von config.Server.
Embedding) sowie die Status-Payloads von GET …/admin/embedding/status (Projekt- und
Server-Scope, Zustände live|degraded|quarantined|offline, Breaker closed|open|half-open).
VectorConfig.provider dokumentiert jetzt, dass dort auch ein Gruppenname stehen darf.

schemas/config/embedding.schema.json: validierbares Schema des Server-Abschnitts
(Enums für Policies/Distributionen, Go-Duration-Muster, Pflichtfelder, keine
erfundenen Properties); Beispiel examples/server/embedding.yml, per
scripts/validate-schemas.mjs mitgeprüft (npm test: 5 YAML gegen 17 Schemas).

Quelle der Wahrheit: internal/config/server.go + internal/config/embedding_group.go
(tibi-server). Typecheck: tsc --noEmit --strict über index.d.ts grün.
2026-10-17 14:00:53 +00:00
apairon 40b441df04 ✨ feat: add new JSON schemas for Tibi configuration including fields, hooks, jobs, and permissions
- Introduced `field-list.schema.json`, `field-meta.schema.json`, and `field.schema.json` for field configurations.
- Added `hooks.schema.json` for defining hooks in the Tibi project.
- Created `image-filter.schema.json` for image processing configurations.
- Implemented `job.schema.json` for job scheduling configurations.
- Added `openapi.schema.json` for OpenAPI metadata generation.
- Introduced `permissions.schema.json` for managing permissions in the project.
- Created `project.schema.json` for overall project configuration.
- Added `projections.schema.json` for defining projections in the project.
- Implemented a validation script `validate-schemas.mjs` to ensure schema compliance.
2026-07-01 09:23:43 +00:00
apairon 4b588d1269 feat(types): add action api types to ApiInfo 2026-04-16 15:59:32 +00:00
apairon 025a7ccca4 ✨ feat(schema): enhance API configuration schemas with new properties and validations
continuous-integration/drone/push Build is passing
- Updated collection.json to include upload defaults, audit logging, query limits, and more.
- Enhanced collectionNavigation.json with viewHint configurations.
- Added project-wide upload defaults and hook configurations in config.json.
- Expanded field.json to support new field types, validations, and properties.
- Improved fieldMeta.json with additional widget configurations and properties.
- Updated hooks.json to include new bulk operation hooks and audit logging.
- Enhanced imageFilter.json with additional image processing options.
- Added timeout properties to job.json for better execution control.
- Refined permissions.json to allow more granular control over HTTP method permissions and added filter and field visibility options.
2026-03-30 12:28:50 +00:00
apairon c2a54a4474 ✨ feat(index.d.ts): update CollectionDocument to use generic types for insertTime and updateTime
continuous-integration/drone/push Build is passing
2026-01-21 14:36:06 +00:00
apairon 1bb16ad994 ✨ feat(index.d.ts): add base64 property to global context for Base64Package interface 2026-01-21 13:57:14 +00:00
apairon 8696b25e9b ✨ feat(index.d.ts): add Base64Package interface for encoding and decoding data
continuous-integration/drone/push Build is passing
2025-08-28 14:31:06 +00:00
apairon 102a93f20c ✨ feat(index.d.ts): add includeHeader option to create method
continuous-integration/drone/push Build is passing
2025-08-27 16:51:08 +00:00
apairon 99e7d940ee ✨ feat(index.d.ts): extend create method options to include rootElement parameter
continuous-integration/drone/push Build is passing
2025-08-27 16:32:38 +00:00
apairon c4d4a2f6e0 ✨ feat(index.d.ts): update create method parameter type for XML string creation
continuous-integration/drone/push Build is passing
2025-08-27 14:36:04 +00:00
apairon fe548c0537 ✨ feat(index.d.ts): add ExecPackage interface to global context
continuous-integration/drone/push Build is passing
2025-08-27 09:06:57 +00:00
apairon b724100477 ✨ feat(index.d.ts): add ExecPackage interface for command execution with options
continuous-integration/drone/push Build is passing
2025-08-27 08:55:15 +00:00
apairon 303652101b feat(index.d.ts): erweitere Bildverarbeitungsoptionen um Resampling, Anker, und Dimensionseinsparungen
continuous-integration/drone/push Build is passing
2025-04-24 10:04:10 +00:00
apairon 592ee4a42b feat(index.d.ts): add outputType option for image processing configuration
continuous-integration/drone/push Build is passing
2025-04-23 17:07:51 +00:00
apairon ca8d37815b feat(index.d.ts): add lossless option to image processing configuration
continuous-integration/drone/push Build is passing
2025-04-23 16:49:52 +00:00
apairon 9beb4d3a43 feat(index.d.ts): add sameSite option to set cookie's SameSite attribute
continuous-integration/drone/push Build is passing
2024-09-26 13:18:14 +00:00
apairon 2b0edd2c9f sleep in hook and cors in config
continuous-integration/drone/push Build is passing
2024-08-23 14:01:15 +00:00
apairon 1b48015c98 context.cyrpto.md5
continuous-integration/drone/push Build is passing
2024-06-26 14:58:39 +00:00